summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog221
-rw-r--r--GNUmakefile.am8
-rw-r--r--Source/JavaScriptCore/API/JSClassRef.cpp19
-rw-r--r--Source/JavaScriptCore/ChangeLog374
-rw-r--r--Source/JavaScriptCore/Configurations/FeatureDefines.xcconfig3
-rw-r--r--Source/JavaScriptCore/Configurations/Version.xcconfig4
-rw-r--r--Source/JavaScriptCore/GNUmakefile.am2
-rw-r--r--Source/JavaScriptCore/GNUmakefile.list.am5
-rwxr-xr-xSource/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def3
-rw-r--r--Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj8
-rw-r--r--Source/JavaScriptCore/bytecode/CodeBlock.cpp8
-rw-r--r--Source/JavaScriptCore/bytecode/Opcode.h3
-rw-r--r--Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp9
-rw-r--r--Source/JavaScriptCore/dfg/DFGAbstractState.cpp9
-rw-r--r--Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp14
-rw-r--r--Source/JavaScriptCore/dfg/DFGCapabilities.h1
-rw-r--r--Source/JavaScriptCore/dfg/DFGOperations.cpp34
-rw-r--r--Source/JavaScriptCore/dfg/DFGOperations.h3
-rw-r--r--Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp30
-rw-r--r--Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp30
-rw-r--r--Source/JavaScriptCore/heap/CopiedSpace.cpp11
-rw-r--r--Source/JavaScriptCore/heap/Heap.cpp3
-rw-r--r--Source/JavaScriptCore/heap/MarkStack.cpp56
-rw-r--r--Source/JavaScriptCore/heap/MarkStack.h19
-rw-r--r--Source/JavaScriptCore/heap/MarkedAllocator.cpp38
-rw-r--r--Source/JavaScriptCore/heap/MarkedAllocator.h2
-rw-r--r--Source/JavaScriptCore/interpreter/Interpreter.cpp21
-rw-r--r--Source/JavaScriptCore/jit/ExecutableAllocator.h1
-rw-r--r--Source/JavaScriptCore/jit/ExecutableAllocatorFixedVMPool.cpp14
-rw-r--r--Source/JavaScriptCore/jit/JIT.cpp1
-rw-r--r--Source/JavaScriptCore/jit/JIT.h1
-rw-r--r--Source/JavaScriptCore/jit/JITInlineMethods.h3
-rw-r--r--Source/JavaScriptCore/jit/JITOpcodes.cpp22
-rw-r--r--Source/JavaScriptCore/jit/JITOpcodes32_64.cpp24
-rw-r--r--Source/JavaScriptCore/jit/JITStubs.cpp11
-rw-r--r--Source/JavaScriptCore/llint/LLIntSlowPaths.cpp22
-rw-r--r--Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm27
-rw-r--r--Source/JavaScriptCore/llint/LowLevelInterpreter64.asm26
-rw-r--r--Source/JavaScriptCore/parser/ASTBuilder.h44
-rw-r--r--Source/JavaScriptCore/parser/NodeInfo.h4
-rw-r--r--Source/JavaScriptCore/parser/Nodes.cpp40
-rw-r--r--Source/JavaScriptCore/parser/Nodes.h88
-rw-r--r--Source/JavaScriptCore/parser/Parser.cpp54
-rw-r--r--Source/JavaScriptCore/parser/Parser.h118
-rw-r--r--Source/JavaScriptCore/parser/SourceProviderCacheItem.h4
-rw-r--r--Source/JavaScriptCore/parser/SyntaxChecker.h1
-rw-r--r--Source/JavaScriptCore/runtime/Executable.cpp6
-rw-r--r--Source/JavaScriptCore/runtime/Executable.h18
-rw-r--r--Source/JavaScriptCore/runtime/JSFunction.cpp12
-rw-r--r--Source/JavaScriptCore/runtime/JSFunction.h15
-rw-r--r--Source/JavaScriptCore/runtime/JSObject.cpp4
-rw-r--r--Source/JavaScriptCore/runtime/JSObject.h46
-rw-r--r--Source/JavaScriptCore/runtime/JSString.h10
-rw-r--r--Source/JavaScriptCore/runtime/Structure.cpp7
-rw-r--r--Source/JavaScriptCore/runtime/Structure.h2
-rw-r--r--Source/Platform/ChangeLog155
-rw-r--r--Source/Platform/Platform.gypi4
-rw-r--r--Source/Platform/chromium/public/Platform.h10
-rw-r--r--Source/Platform/chromium/public/WebCanvas.h10
-rw-r--r--Source/Platform/chromium/public/WebClipboard.h98
-rw-r--r--Source/Platform/chromium/public/WebDragData.h123
-rw-r--r--Source/Platform/chromium/public/WebFileSystem.h138
-rw-r--r--Source/Platform/chromium/public/WebGraphicsContext3D.h6
-rw-r--r--Source/Platform/chromium/public/WebImage.h (renamed from Source/WebKit/chromium/src/WebStorageEventDispatcherImpl.h)74
-rw-r--r--Source/Platform/chromium/public/WebMediaStreamCenter.h10
-rw-r--r--Source/Platform/chromium/public/WebMediaStreamDescriptor.h12
-rw-r--r--Source/WTF/ChangeLog69
-rw-r--r--Source/WTF/wtf/Assertions.cpp6
-rw-r--r--Source/WTF/wtf/MetaAllocator.cpp12
-rw-r--r--Source/WTF/wtf/OwnPtrCommon.h2
-rw-r--r--Source/WTF/wtf/Platform.h2
-rw-r--r--Source/WTF/wtf/efl/OwnPtrEfl.cpp6
-rw-r--r--Source/WebCore/CMakeLists.txt4
-rw-r--r--Source/WebCore/ChangeLog5207
-rw-r--r--Source/WebCore/Configurations/FeatureDefines.xcconfig3
-rw-r--r--Source/WebCore/Configurations/Version.xcconfig4
-rw-r--r--Source/WebCore/DerivedSources.cpp1
-rw-r--r--Source/WebCore/DerivedSources.make1
-rw-r--r--Source/WebCore/DerivedSources.pri13
-rw-r--r--Source/WebCore/English.lproj/Localizable.stringsbin55504 -> 55792 bytes
-rw-r--r--Source/WebCore/GNUmakefile.am16
-rw-r--r--Source/WebCore/GNUmakefile.list.am9
-rw-r--r--Source/WebCore/Modules/filesystem/DOMFileSystem.cpp12
-rw-r--r--Source/WebCore/Modules/filesystem/DOMFileSystem.h4
-rw-r--r--Source/WebCore/Modules/filesystem/DOMFileSystemBase.cpp46
-rw-r--r--Source/WebCore/Modules/filesystem/DOMFileSystemBase.h29
-rw-r--r--Source/WebCore/Modules/filesystem/DOMFileSystemSync.cpp10
-rw-r--r--Source/WebCore/Modules/filesystem/DOMFileSystemSync.h6
-rw-r--r--Source/WebCore/Modules/filesystem/DOMWindowFileSystem.cpp8
-rw-r--r--Source/WebCore/Modules/filesystem/EntryBase.cpp8
-rw-r--r--Source/WebCore/Modules/filesystem/EntryBase.h5
-rw-r--r--Source/WebCore/Modules/filesystem/FileSystemCallbacks.cpp22
-rw-r--r--Source/WebCore/Modules/filesystem/FileSystemCallbacks.h15
-rw-r--r--Source/WebCore/Modules/filesystem/FileSystemType.h (renamed from Source/WebCore/platform/FileSystemType.h)0
-rw-r--r--Source/WebCore/Modules/filesystem/LocalFileSystem.cpp12
-rw-r--r--Source/WebCore/Modules/filesystem/LocalFileSystem.h2
-rw-r--r--Source/WebCore/Modules/filesystem/WorkerContextFileSystem.cpp17
-rw-r--r--Source/WebCore/Modules/filesystem/chromium/DOMFileSystemChromium.cpp133
-rw-r--r--Source/WebCore/Modules/filesystem/chromium/DOMFileSystemChromium.h (renamed from Source/WebCore/platform/graphics/FractionalLayoutSize.cpp)22
-rw-r--r--Source/WebCore/Modules/filesystem/chromium/DataTransferItemFileSystemChromium.cpp2
-rw-r--r--Source/WebCore/Modules/filesystem/chromium/DraggedIsolatedFileSystem.cpp6
-rw-r--r--Source/WebCore/Modules/indexeddb/DOMWindowIndexedDatabase.cpp26
-rw-r--r--Source/WebCore/Modules/indexeddb/DOMWindowIndexedDatabase.h7
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBBackingStore.h2
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBCursor.cpp69
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBCursor.h11
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBCursor.idl3
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBDatabase.cpp41
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBDatabase.h2
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBDatabase.idl15
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBIndex.cpp61
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBIndex.h12
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBIndex.idl13
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBLevelDBBackingStore.cpp8
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBLevelDBBackingStore.h2
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBLevelDBCoding.cpp2
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp30
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBObjectStore.h6
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBObjectStore.idl7
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBRequest.cpp26
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBRequest.h5
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBRequest.idl4
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBTransaction.cpp70
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBTransaction.h13
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBTransaction.idl4
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBTransactionBackendImpl.cpp6
-rw-r--r--Source/WebCore/Modules/mediastream/LocalMediaStream.cpp12
-rw-r--r--Source/WebCore/Modules/mediastream/LocalMediaStream.h8
-rw-r--r--Source/WebCore/Modules/mediastream/LocalMediaStream.idl2
-rw-r--r--Source/WebCore/Modules/mediastream/MediaStream.cpp15
-rw-r--r--Source/WebCore/Modules/mediastream/MediaStream.h6
-rw-r--r--Source/WebCore/Modules/mediastream/PeerConnection00.cpp2
-rw-r--r--Source/WebCore/Modules/mediastream/SessionDescription.cpp8
-rw-r--r--Source/WebCore/Modules/mediastream/SessionDescription.h3
-rw-r--r--Source/WebCore/Modules/mediastream/SessionDescription.idl3
-rw-r--r--Source/WebCore/Modules/mediastream/UserMediaRequest.cpp10
-rw-r--r--Source/WebCore/Modules/mediastream/UserMediaRequest.h2
-rw-r--r--Source/WebCore/Modules/webaudio/AudioBufferSourceNode.cpp7
-rw-r--r--Source/WebCore/Modules/webaudio/AudioGain.h8
-rw-r--r--Source/WebCore/Modules/webaudio/AudioGainNode.cpp3
-rw-r--r--Source/WebCore/Modules/webaudio/AudioPannerNode.cpp4
-rw-r--r--Source/WebCore/Modules/webaudio/AudioParam.h34
-rw-r--r--Source/WebCore/Modules/webaudio/BiquadFilterNode.cpp5
-rw-r--r--Source/WebCore/Modules/webaudio/BiquadProcessor.cpp8
-rw-r--r--Source/WebCore/Modules/webaudio/BiquadProcessor.h2
-rw-r--r--Source/WebCore/Modules/webaudio/ConvolverNode.cpp1
-rw-r--r--Source/WebCore/Modules/webaudio/DelayNode.cpp3
-rw-r--r--Source/WebCore/Modules/webaudio/DelayProcessor.cpp4
-rw-r--r--Source/WebCore/Modules/webaudio/DelayProcessor.h2
-rw-r--r--Source/WebCore/Modules/webaudio/DynamicsCompressorNode.cpp19
-rw-r--r--Source/WebCore/Modules/webaudio/JavaScriptAudioNode.cpp14
-rw-r--r--Source/WebCore/Modules/webaudio/Oscillator.cpp6
-rw-r--r--Source/WebCore/PlatformEfl.cmake28
-rw-r--r--Source/WebCore/Target.pri15
-rw-r--r--Source/WebCore/UseJSC.cmake2
-rw-r--r--Source/WebCore/WebCore.exp.in15
-rw-r--r--Source/WebCore/WebCore.gyp/WebCore.gyp7
-rw-r--r--Source/WebCore/WebCore.gypi24
-rw-r--r--Source/WebCore/WebCore.order2
-rw-r--r--Source/WebCore/WebCore.pri6
-rwxr-xr-xSource/WebCore/WebCore.vcproj/WebCore.vcproj80
-rwxr-xr-xSource/WebCore/WebCore.vcproj/copyWebCoreResourceFiles.cmd2
-rw-r--r--Source/WebCore/WebCore.xcodeproj/project.pbxproj36
-rw-r--r--Source/WebCore/accessibility/AccessibilityMenuListOption.cpp2
-rw-r--r--Source/WebCore/accessibility/AccessibilityMenuListPopup.cpp2
-rw-r--r--Source/WebCore/accessibility/chromium/AXObjectCacheChromium.cpp5
-rw-r--r--Source/WebCore/accessibility/chromium/AccessibilityObjectChromium.cpp5
-rw-r--r--Source/WebCore/bindings/js/JSHTMLCollectionCustom.cpp8
-rw-r--r--Source/WebCore/bindings/js/JSRequestAnimationFrameCallbackCustom.cpp4
-rw-r--r--Source/WebCore/bindings/objc/DOMCSS.mm1
-rw-r--r--Source/WebCore/bindings/scripts/CodeGeneratorJS.pm27
-rw-r--r--Source/WebCore/bindings/scripts/CodeGeneratorV8.pm14
-rw-r--r--Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.cpp4
-rw-r--r--Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp4
-rw-r--r--Source/WebCore/bindings/scripts/test/V8/V8TestException.cpp2
-rw-r--r--Source/WebCore/bindings/scripts/test/V8/V8TestException.h2
-rw-r--r--Source/WebCore/bindings/v8/V8IsolatedContext.cpp1
-rw-r--r--Source/WebCore/bindings/v8/custom/V8HTMLCollectionCustom.cpp5
-rw-r--r--Source/WebCore/bridge/jni/JNIUtility.cpp14
-rw-r--r--Source/WebCore/bridge/qt/qt_runtime_qt4.cpp8
-rw-r--r--Source/WebCore/css/CSSComputedStyleDeclaration.cpp24
-rw-r--r--Source/WebCore/css/CSSComputedStyleDeclaration.h1
-rw-r--r--Source/WebCore/css/CSSFontFaceRule.cpp8
-rw-r--r--Source/WebCore/css/CSSFontFaceRule.h2
-rw-r--r--Source/WebCore/css/CSSImageSetValue.cpp4
-rw-r--r--Source/WebCore/css/CSSImageValue.cpp4
-rw-r--r--Source/WebCore/css/CSSImportRule.cpp1
-rw-r--r--Source/WebCore/css/CSSMediaRule.cpp25
-rw-r--r--Source/WebCore/css/CSSMediaRule.h2
-rw-r--r--Source/WebCore/css/CSSPageRule.cpp23
-rw-r--r--Source/WebCore/css/CSSPageRule.h4
-rw-r--r--Source/WebCore/css/CSSParser.cpp91
-rw-r--r--Source/WebCore/css/CSSProperty.cpp1
-rw-r--r--Source/WebCore/css/CSSPropertyNames.in1
-rw-r--r--Source/WebCore/css/CSSRule.cpp46
-rw-r--r--Source/WebCore/css/CSSRule.h13
-rw-r--r--Source/WebCore/css/CSSStyleRule.cpp17
-rw-r--r--Source/WebCore/css/CSSStyleRule.h2
-rw-r--r--Source/WebCore/css/CSSStyleSheet.cpp118
-rw-r--r--Source/WebCore/css/CSSStyleSheet.h60
-rw-r--r--Source/WebCore/css/MediaList.cpp23
-rw-r--r--Source/WebCore/css/MediaList.h4
-rw-r--r--Source/WebCore/css/PropertySetCSSStyleDeclaration.cpp70
-rw-r--r--Source/WebCore/css/PropertySetCSSStyleDeclaration.h19
-rw-r--r--Source/WebCore/css/StyleBuilder.cpp1
-rw-r--r--Source/WebCore/css/StylePropertySet.cpp10
-rw-r--r--Source/WebCore/css/StylePropertyShorthand.cpp6
-rw-r--r--Source/WebCore/css/StyleResolver.cpp53
-rw-r--r--Source/WebCore/css/StyleResolver.h3
-rw-r--r--Source/WebCore/css/WebKitCSSKeyframesRule.cpp18
-rw-r--r--Source/WebCore/css/WebKitCSSKeyframesRule.h2
-rw-r--r--Source/WebCore/css/WebKitCSSRegionRule.cpp9
-rw-r--r--Source/WebCore/css/WebKitCSSRegionRule.h2
-rw-r--r--Source/WebCore/css/WebKitCSSShaderValue.cpp4
-rw-r--r--Source/WebCore/css/mediaControlsEfl.css2
-rw-r--r--Source/WebCore/dom/CharacterData.cpp2
-rw-r--r--Source/WebCore/dom/ComposedShadowTreeWalker.cpp7
-rw-r--r--Source/WebCore/dom/ContainerNode.cpp24
-rw-r--r--Source/WebCore/dom/ContainerNode.h3
-rw-r--r--Source/WebCore/dom/ContainerNodeAlgorithms.cpp13
-rw-r--r--Source/WebCore/dom/ContainerNodeAlgorithms.h55
-rw-r--r--Source/WebCore/dom/Document.cpp66
-rw-r--r--Source/WebCore/dom/Document.h7
-rw-r--r--Source/WebCore/dom/Element.cpp72
-rw-r--r--Source/WebCore/dom/Element.h11
-rw-r--r--Source/WebCore/dom/ElementAttributeData.cpp97
-rw-r--r--Source/WebCore/dom/ElementAttributeData.h5
-rw-r--r--Source/WebCore/dom/ElementShadow.cpp13
-rw-r--r--Source/WebCore/dom/ElementShadow.h13
-rw-r--r--Source/WebCore/dom/EventDispatcher.cpp5
-rw-r--r--Source/WebCore/dom/Node.cpp52
-rw-r--r--Source/WebCore/dom/Node.h49
-rw-r--r--Source/WebCore/dom/NodeRareData.h4
-rw-r--r--Source/WebCore/dom/NodeRenderingContext.cpp2
-rw-r--r--Source/WebCore/dom/Position.cpp39
-rw-r--r--Source/WebCore/dom/Position.h9
-rw-r--r--Source/WebCore/dom/RequestAnimationFrameCallback.h4
-rw-r--r--Source/WebCore/dom/RequestAnimationFrameCallback.idl8
-rw-r--r--Source/WebCore/dom/ScriptedAnimationController.cpp32
-rw-r--r--Source/WebCore/dom/ScriptedAnimationController.h9
-rw-r--r--Source/WebCore/dom/ShadowRoot.cpp12
-rw-r--r--Source/WebCore/dom/ShadowRoot.h6
-rw-r--r--Source/WebCore/dom/ShadowRoot.idl1
-rw-r--r--Source/WebCore/dom/TreeScope.cpp2
-rw-r--r--Source/WebCore/dom/TreeScope.h2
-rw-r--r--Source/WebCore/dom/ViewportArguments.cpp13
-rw-r--r--Source/WebCore/dom/ViewportArguments.h1
-rw-r--r--Source/WebCore/editing/ApplyStyleCommand.cpp52
-rw-r--r--Source/WebCore/editing/CompositeEditCommand.cpp8
-rw-r--r--Source/WebCore/editing/CompositeEditCommand.h4
-rw-r--r--Source/WebCore/editing/DeleteSelectionCommand.cpp11
-rw-r--r--Source/WebCore/editing/DeleteSelectionCommand.h13
-rw-r--r--Source/WebCore/editing/IndentOutdentCommand.cpp2
-rw-r--r--Source/WebCore/editing/InsertParagraphSeparatorCommand.cpp40
-rw-r--r--Source/WebCore/editing/InsertTextCommand.cpp2
-rw-r--r--Source/WebCore/editing/MarkupAccumulator.cpp22
-rw-r--r--Source/WebCore/editing/MarkupAccumulator.h3
-rw-r--r--Source/WebCore/editing/ReplaceNodeWithSpanCommand.cpp8
-rw-r--r--Source/WebCore/editing/ReplaceSelectionCommand.cpp7
-rw-r--r--Source/WebCore/editing/htmlediting.cpp5
-rw-r--r--Source/WebCore/editing/htmlediting.h2
-rw-r--r--Source/WebCore/editing/markup.cpp6
-rw-r--r--Source/WebCore/editing/markup.h3
-rwxr-xr-xSource/WebCore/gyp/copy-inspector-resources.sh2
-rw-r--r--Source/WebCore/history/CachedFrame.cpp2
-rw-r--r--Source/WebCore/history/HistoryItem.cpp8
-rw-r--r--Source/WebCore/history/PageCache.cpp7
-rw-r--r--Source/WebCore/html/CollectionType.h1
-rw-r--r--Source/WebCore/html/ColorInputType.cpp2
-rw-r--r--Source/WebCore/html/DateInputType.cpp5
-rw-r--r--Source/WebCore/html/DateInputType.h1
-rw-r--r--Source/WebCore/html/DateTimeInputType.cpp5
-rw-r--r--Source/WebCore/html/DateTimeInputType.h1
-rw-r--r--Source/WebCore/html/DateTimeLocalInputType.cpp5
-rw-r--r--Source/WebCore/html/DateTimeLocalInputType.h1
-rw-r--r--Source/WebCore/html/FileInputType.cpp7
-rw-r--r--Source/WebCore/html/HTMLAnchorElement.cpp4
-rw-r--r--Source/WebCore/html/HTMLAnchorElement.h2
-rw-r--r--Source/WebCore/html/HTMLAttributeNames.in2
-rw-r--r--Source/WebCore/html/HTMLBaseElement.cpp4
-rw-r--r--Source/WebCore/html/HTMLBaseElement.h2
-rw-r--r--Source/WebCore/html/HTMLBodyElement.cpp4
-rw-r--r--Source/WebCore/html/HTMLBodyElement.h2
-rw-r--r--Source/WebCore/html/HTMLButtonElement.cpp4
-rw-r--r--Source/WebCore/html/HTMLButtonElement.h2
-rw-r--r--Source/WebCore/html/HTMLCollection.cpp2
-rw-r--r--Source/WebCore/html/HTMLDetailsElement.cpp2
-rw-r--r--Source/WebCore/html/HTMLElement.cpp4
-rw-r--r--Source/WebCore/html/HTMLElement.h8
-rw-r--r--Source/WebCore/html/HTMLElementsAllInOne.cpp1
-rw-r--r--Source/WebCore/html/HTMLEmbedElement.cpp6
-rw-r--r--Source/WebCore/html/HTMLEmbedElement.h2
-rw-r--r--Source/WebCore/html/HTMLFormCollection.cpp2
-rw-r--r--Source/WebCore/html/HTMLFormControlElement.cpp46
-rw-r--r--Source/WebCore/html/HTMLFormControlElement.h8
-rw-r--r--Source/WebCore/html/HTMLFormElement.cpp4
-rw-r--r--Source/WebCore/html/HTMLFormElement.h3
-rw-r--r--Source/WebCore/html/HTMLFrameElementBase.cpp4
-rw-r--r--Source/WebCore/html/HTMLFrameElementBase.h2
-rw-r--r--Source/WebCore/html/HTMLFrameOwnerElement.cpp9
-rw-r--r--Source/WebCore/html/HTMLFrameOwnerElement.h11
-rw-r--r--Source/WebCore/html/HTMLHtmlElement.cpp4
-rw-r--r--Source/WebCore/html/HTMLHtmlElement.h2
-rw-r--r--Source/WebCore/html/HTMLIFrameElement.cpp10
-rw-r--r--Source/WebCore/html/HTMLIFrameElement.h6
-rw-r--r--Source/WebCore/html/HTMLImageElement.cpp12
-rw-r--r--Source/WebCore/html/HTMLImageElement.h2
-rw-r--r--Source/WebCore/html/HTMLInputElement.cpp309
-rw-r--r--Source/WebCore/html/HTMLInputElement.h25
-rw-r--r--Source/WebCore/html/HTMLInputElement.idl5
-rw-r--r--Source/WebCore/html/HTMLIntentElement.cpp69
-rw-r--r--Source/WebCore/html/HTMLIntentElement.h (renamed from Source/WebCore/platform/graphics/chromium/TextureUploader.cpp)49
-rw-r--r--Source/WebCore/html/HTMLIntentElement.idl38
-rw-r--r--Source/WebCore/html/HTMLKeygenElement.cpp3
-rw-r--r--Source/WebCore/html/HTMLLinkElement.cpp4
-rw-r--r--Source/WebCore/html/HTMLLinkElement.h2
-rw-r--r--Source/WebCore/html/HTMLMediaElement.cpp20
-rw-r--r--Source/WebCore/html/HTMLMediaElement.h15
-rw-r--r--Source/WebCore/html/HTMLMeterElement.cpp2
-rw-r--r--Source/WebCore/html/HTMLModElement.cpp4
-rw-r--r--Source/WebCore/html/HTMLModElement.h2
-rw-r--r--Source/WebCore/html/HTMLObjectElement.cpp6
-rw-r--r--Source/WebCore/html/HTMLObjectElement.h2
-rw-r--r--Source/WebCore/html/HTMLParamElement.cpp6
-rw-r--r--Source/WebCore/html/HTMLParamElement.h2
-rw-r--r--Source/WebCore/html/HTMLPlugInElement.cpp4
-rw-r--r--Source/WebCore/html/HTMLPlugInImageElement.cpp2
-rw-r--r--Source/WebCore/html/HTMLProgressElement.cpp2
-rw-r--r--Source/WebCore/html/HTMLQuoteElement.cpp4
-rw-r--r--Source/WebCore/html/HTMLQuoteElement.h2
-rw-r--r--Source/WebCore/html/HTMLScriptElement.cpp4
-rw-r--r--Source/WebCore/html/HTMLScriptElement.h2
-rw-r--r--Source/WebCore/html/HTMLSourceElement.cpp14
-rw-r--r--Source/WebCore/html/HTMLSourceElement.h4
-rw-r--r--Source/WebCore/html/HTMLStyleElement.cpp21
-rw-r--r--Source/WebCore/html/HTMLStyleElement.h3
-rw-r--r--Source/WebCore/html/HTMLSummaryElement.cpp2
-rw-r--r--Source/WebCore/html/HTMLTableCellElement.cpp4
-rw-r--r--Source/WebCore/html/HTMLTableCellElement.h2
-rw-r--r--Source/WebCore/html/HTMLTableElement.cpp4
-rw-r--r--Source/WebCore/html/HTMLTableElement.h2
-rw-r--r--Source/WebCore/html/HTMLTagNames.in1
-rw-r--r--Source/WebCore/html/HTMLTextAreaElement.cpp2
-rw-r--r--Source/WebCore/html/HTMLTrackElement.cpp13
-rw-r--r--Source/WebCore/html/HTMLTrackElement.h5
-rw-r--r--Source/WebCore/html/HTMLVideoElement.cpp5
-rw-r--r--Source/WebCore/html/HTMLVideoElement.h2
-rw-r--r--Source/WebCore/html/ImageInputType.cpp47
-rw-r--r--Source/WebCore/html/ImageInputType.h3
-rw-r--r--Source/WebCore/html/InputType.cpp287
-rw-r--r--Source/WebCore/html/InputType.h22
-rw-r--r--Source/WebCore/html/MonthInputType.cpp5
-rw-r--r--Source/WebCore/html/MonthInputType.h1
-rw-r--r--Source/WebCore/html/RadioNodeList.cpp103
-rw-r--r--Source/WebCore/html/RadioNodeList.h62
-rw-r--r--Source/WebCore/html/RadioNodeList.idl35
-rw-r--r--Source/WebCore/html/RangeInputType.cpp4
-rw-r--r--Source/WebCore/html/TextFieldInputType.cpp2
-rw-r--r--Source/WebCore/html/TimeInputType.cpp5
-rw-r--r--Source/WebCore/html/TimeInputType.h1
-rw-r--r--Source/WebCore/html/WeekInputType.cpp5
-rw-r--r--Source/WebCore/html/WeekInputType.h1
-rw-r--r--Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp7
-rw-r--r--Source/WebCore/html/canvas/WebGLRenderingContext.cpp40
-rw-r--r--Source/WebCore/html/canvas/WebGLRenderingContext.h12
-rw-r--r--Source/WebCore/html/canvas/WebGLRenderingContext.idl12
-rw-r--r--Source/WebCore/html/parser/HTMLElementStack.cpp13
-rw-r--r--Source/WebCore/html/parser/HTMLElementStack.h1
-rw-r--r--Source/WebCore/html/shadow/CalendarPickerElement.cpp6
-rw-r--r--Source/WebCore/html/shadow/CalendarPickerElement.h1
-rw-r--r--Source/WebCore/html/shadow/SliderThumbElement.cpp2
-rwxr-xr-xSource/WebCore/inspector/CodeGeneratorInspector.py2
-rw-r--r--Source/WebCore/inspector/InspectorDOMAgent.cpp14
-rw-r--r--Source/WebCore/inspector/InspectorStyleSheet.cpp2
-rw-r--r--Source/WebCore/inspector/front-end/BreakpointManager.js72
-rw-r--r--Source/WebCore/inspector/front-end/HeapSnapshotView.js4
-rw-r--r--Source/WebCore/inspector/front-end/InspectorBackendCommands.qrc (renamed from Source/WebCore/inspector/front-end/InspectorBackendStub.qrc)2
-rw-r--r--Source/WebCore/inspector/front-end/JavaScriptSource.js8
-rw-r--r--Source/WebCore/inspector/front-end/JavaScriptSourceFrame.js55
-rw-r--r--Source/WebCore/inspector/front-end/NetworkPanel.js4
-rw-r--r--Source/WebCore/inspector/front-end/ResourcesPanel.js4
-rw-r--r--Source/WebCore/inspector/front-end/SearchController.js22
-rw-r--r--Source/WebCore/inspector/front-end/StylesSidebarPane.js11
-rw-r--r--Source/WebCore/inspector/front-end/TextPrompt.js5
-rw-r--r--Source/WebCore/inspector/front-end/TextViewer.js4
-rw-r--r--Source/WebCore/inspector/front-end/inspector.css11
-rw-r--r--Source/WebCore/inspector/front-end/inspector.html6
-rw-r--r--Source/WebCore/loader/FrameLoader.cpp9
-rw-r--r--Source/WebCore/loader/FrameLoaderClient.h3
-rw-r--r--Source/WebCore/loader/HistoryController.cpp2
-rw-r--r--Source/WebCore/loader/ImageLoader.cpp4
-rw-r--r--Source/WebCore/loader/SubframeLoader.cpp3
-rw-r--r--Source/WebCore/loader/TextTrackLoader.cpp2
-rw-r--r--Source/WebCore/loader/appcache/DOMApplicationCache.cpp21
-rw-r--r--Source/WebCore/loader/appcache/DOMApplicationCache.h5
-rw-r--r--Source/WebCore/loader/archive/cf/LegacyWebArchive.cpp13
-rw-r--r--Source/WebCore/loader/cache/CachedCSSStyleSheet.cpp24
-rw-r--r--Source/WebCore/loader/cache/CachedResourceHandle.h3
-rw-r--r--Source/WebCore/loader/cache/CachedResourceLoader.cpp105
-rw-r--r--Source/WebCore/loader/cache/CachedResourceLoader.h28
-rw-r--r--Source/WebCore/loader/cache/MemoryCache.h1
-rw-r--r--Source/WebCore/notifications/DOMWindowNotifications.cpp26
-rw-r--r--Source/WebCore/notifications/DOMWindowNotifications.h7
-rw-r--r--Source/WebCore/page/Chrome.cpp8
-rw-r--r--Source/WebCore/page/Chrome.h5
-rw-r--r--Source/WebCore/page/ChromeClient.h5
-rw-r--r--Source/WebCore/page/DOMWindow.cpp56
-rw-r--r--Source/WebCore/page/DOMWindow.h7
-rw-r--r--Source/WebCore/page/DOMWindow.idl2
-rw-r--r--Source/WebCore/page/DOMWindowExtension.cpp96
-rw-r--r--Source/WebCore/page/DOMWindowExtension.h12
-rw-r--r--Source/WebCore/page/DOMWindowProperty.cpp39
-rw-r--r--Source/WebCore/page/DOMWindowProperty.h10
-rw-r--r--Source/WebCore/page/EventHandler.cpp18
-rw-r--r--Source/WebCore/page/EventHandler.h3
-rw-r--r--Source/WebCore/page/FocusController.cpp5
-rw-r--r--Source/WebCore/page/Frame.cpp8
-rw-r--r--Source/WebCore/page/FrameView.cpp54
-rw-r--r--Source/WebCore/page/FrameView.h6
-rw-r--r--Source/WebCore/page/NavigatorRegisterProtocolHandler.cpp4
-rw-r--r--Source/WebCore/page/Page.cpp22
-rw-r--r--Source/WebCore/page/PointerLock.cpp10
-rw-r--r--Source/WebCore/page/PointerLock.h3
-rw-r--r--Source/WebCore/page/TouchAdjustment.cpp4
-rw-r--r--Source/WebCore/page/scrolling/ScrollingCoordinator.cpp23
-rw-r--r--Source/WebCore/page/scrolling/ScrollingCoordinator.h2
-rw-r--r--Source/WebCore/page/scrolling/ScrollingTreeNode.cpp3
-rw-r--r--Source/WebCore/page/scrolling/ScrollingTreeNode.h3
-rw-r--r--Source/WebCore/page/scrolling/ScrollingTreeState.cpp9
-rw-r--r--Source/WebCore/page/scrolling/ScrollingTreeState.h9
-rw-r--r--Source/WebCore/page/scrolling/mac/ScrollingTreeNodeMac.mm6
-rw-r--r--Source/WebCore/platform/AsyncFileSystem.cpp19
-rw-r--r--Source/WebCore/platform/AsyncFileSystem.h50
-rw-r--r--Source/WebCore/platform/AsyncFileSystemCallbacks.h2
-rw-r--r--Source/WebCore/platform/EventTracer.cpp (renamed from Source/WebKit/chromium/src/StorageEventDispatcherImpl.h)45
-rw-r--r--Source/WebCore/platform/EventTracer.h (renamed from Source/WebCore/platform/graphics/chromium/ImageChromiumMac.mm)54
-rw-r--r--Source/WebCore/platform/FileChooser.h3
-rw-r--r--Source/WebCore/platform/FractionalLayoutUnit.h60
-rw-r--r--Source/WebCore/platform/LocalizedStrings.cpp5
-rw-r--r--Source/WebCore/platform/LocalizedStrings.h1
-rw-r--r--Source/WebCore/platform/ScrollView.h4
-rw-r--r--Source/WebCore/platform/audio/AudioBus.cpp228
-rw-r--r--Source/WebCore/platform/audio/AudioBus.h16
-rw-r--r--Source/WebCore/platform/blackberry/AsyncFileSystemBlackBerry.cpp61
-rw-r--r--Source/WebCore/platform/blackberry/AsyncFileSystemBlackBerry.h27
-rw-r--r--Source/WebCore/platform/blackberry/CookieParser.cpp21
-rw-r--r--Source/WebCore/platform/blackberry/LocalizedStringsBlackBerry.cpp6
-rw-r--r--Source/WebCore/platform/chromium/ClipboardUtilitiesChromium.cpp17
-rw-r--r--Source/WebCore/platform/chromium/EventTracerChromium.cpp58
-rw-r--r--Source/WebCore/platform/chromium/PlatformSupport.h19
-rw-r--r--Source/WebCore/platform/chromium/PopupListBox.cpp4
-rw-r--r--Source/WebCore/platform/chromium/TraceEvent.h6
-rw-r--r--Source/WebCore/platform/chromium/support/WebMediaStreamDescriptor.cpp25
-rw-r--r--Source/WebCore/platform/efl/EflKeyboardUtilities.cpp22
-rw-r--r--Source/WebCore/platform/efl/LocalizedStringsEfl.cpp6
-rw-r--r--Source/WebCore/platform/efl/PlatformKeyboardEventEfl.cpp4
-rw-r--r--Source/WebCore/platform/efl/ScrollbarEfl.cpp5
-rw-r--r--Source/WebCore/platform/graphics/DisplayRefreshMonitor.cpp8
-rw-r--r--Source/WebCore/platform/graphics/DisplayRefreshMonitor.h2
-rw-r--r--Source/WebCore/platform/graphics/Font.h12
-rw-r--r--Source/WebCore/platform/graphics/FontDescription.h4
-rw-r--r--Source/WebCore/platform/graphics/FractionalLayoutRect.cpp7
-rw-r--r--Source/WebCore/platform/graphics/FractionalLayoutRect.h18
-rw-r--r--Source/WebCore/platform/graphics/FractionalLayoutSize.h2
-rw-r--r--Source/WebCore/platform/graphics/Region.cpp144
-rw-r--r--Source/WebCore/platform/graphics/Region.h8
-rw-r--r--Source/WebCore/platform/graphics/TextRun.cpp1
-rw-r--r--Source/WebCore/platform/graphics/TextRun.h22
-rw-r--r--Source/WebCore/platform/graphics/WidthIterator.cpp7
-rw-r--r--Source/WebCore/platform/graphics/blackberry/DisplayRefreshMonitorBlackBerry.cpp2
-rw-r--r--Source/WebCore/platform/graphics/ca/mac/TileCache.mm10
-rw-r--r--Source/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp12
-rw-r--r--Source/WebCore/platform/graphics/cg/ImageBufferCG.cpp65
-rw-r--r--Source/WebCore/platform/graphics/chromium/AnimationIdVendor.cpp53
-rw-r--r--Source/WebCore/platform/graphics/chromium/AnimationIdVendor.h46
-rw-r--r--Source/WebCore/platform/graphics/chromium/GraphicsLayerChromium.cpp33
-rw-r--r--Source/WebCore/platform/graphics/chromium/GraphicsLayerChromium.h5
-rw-r--r--Source/WebCore/platform/graphics/chromium/ImageChromium.cpp13
-rw-r--r--Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp10
-rw-r--r--Source/WebCore/platform/graphics/chromium/LayerRendererChromium.h8
-rw-r--r--Source/WebCore/platform/graphics/chromium/LinkHighlight.cpp115
-rw-r--r--Source/WebCore/platform/graphics/chromium/LinkHighlight.h66
-rw-r--r--Source/WebCore/platform/graphics/chromium/RenderSurfaceChromium.cpp10
-rw-r--r--Source/WebCore/platform/graphics/chromium/RenderSurfaceChromium.h3
-rw-r--r--Source/WebCore/platform/graphics/chromium/TextureLayerChromium.cpp19
-rw-r--r--Source/WebCore/platform/graphics/chromium/TextureLayerChromium.h1
-rw-r--r--Source/WebCore/platform/graphics/chromium/TextureUploader.h23
-rw-r--r--Source/WebCore/platform/graphics/chromium/ThrottledTextureUploader.cpp142
-rw-r--r--Source/WebCore/platform/graphics/chromium/ThrottledTextureUploader.h84
-rw-r--r--Source/WebCore/platform/graphics/chromium/TiledLayerChromium.cpp11
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCActiveAnimation.cpp20
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCActiveAnimation.h5
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCDrawQuad.h3
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCLayerAnimationController.cpp26
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCLayerTilingData.cpp19
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCLayerTilingData.h3
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp1
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.h2
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp13
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.h2
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCMathUtil.cpp7
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCOcclusionTracker.cpp2
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCQuadCuller.cpp28
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCQuadCuller.h3
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCRenderPass.cpp4
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCRenderSurface.cpp10
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCRenderSurface.h3
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCSingleThreadProxy.cpp41
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCTextureUpdater.cpp50
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCTextureUpdater.h4
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.cpp47
-rw-r--r--Source/WebCore/platform/graphics/glx/GLContextGLX.cpp4
-rw-r--r--Source/WebCore/platform/graphics/glx/GLContextGLX.h1
-rw-r--r--Source/WebCore/platform/graphics/gpu/Texture.cpp18
-rw-r--r--Source/WebCore/platform/graphics/gpu/TilingData.cpp64
-rw-r--r--Source/WebCore/platform/graphics/gpu/TilingData.h23
-rw-r--r--Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp2
-rw-r--r--Source/WebCore/platform/graphics/mac/ComplexTextController.cpp7
-rw-r--r--Source/WebCore/platform/graphics/mac/DisplayRefreshMonitorMac.cpp14
-rw-r--r--Source/WebCore/platform/graphics/texmap/TextureMapperLayer.cpp10
-rw-r--r--Source/WebCore/platform/graphics/transforms/TransformationMatrix.cpp35
-rw-r--r--Source/WebCore/platform/gtk/AsyncFileSystemGtk.cpp49
-rw-r--r--Source/WebCore/platform/gtk/AsyncFileSystemGtk.h25
-rw-r--r--Source/WebCore/platform/gtk/LocalizedStringsGtk.cpp6
-rw-r--r--Source/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.cpp4
-rw-r--r--Source/WebCore/platform/mac/SoftLinking.h6
-rw-r--r--Source/WebCore/platform/mac/WebCoreSystemInterface.h4
-rw-r--r--Source/WebCore/platform/mac/WebCoreSystemInterface.mm4
-rw-r--r--Source/WebCore/platform/mediastream/MediaStreamCenter.h2
-rw-r--r--Source/WebCore/platform/mediastream/MediaStreamDescriptor.h11
-rw-r--r--Source/WebCore/platform/mediastream/chromium/MediaStreamCenterChromium.cpp9
-rw-r--r--Source/WebCore/platform/mediastream/chromium/MediaStreamCenterChromium.h2
-rw-r--r--Source/WebCore/platform/mediastream/gstreamer/MediaStreamCenterGStreamer.cpp2
-rw-r--r--Source/WebCore/platform/mediastream/gstreamer/MediaStreamCenterGStreamer.h2
-rw-r--r--Source/WebCore/platform/network/CredentialStorage.cpp6
-rw-r--r--Source/WebCore/platform/network/CredentialStorage.h2
-rw-r--r--Source/WebCore/platform/network/blackberry/NetworkJob.cpp123
-rw-r--r--Source/WebCore/platform/network/blackberry/NetworkJob.h10
-rw-r--r--Source/WebCore/platform/network/blackberry/NetworkManager.cpp5
-rw-r--r--Source/WebCore/platform/network/blackberry/ResourceRequest.h9
-rw-r--r--Source/WebCore/platform/network/blackberry/ResourceRequestBlackBerry.cpp2
-rw-r--r--Source/WebCore/platform/network/cf/ResourceRequestCFNet.cpp3
-rw-r--r--Source/WebCore/platform/network/mac/ResourceRequestMac.mm3
-rw-r--r--Source/WebCore/platform/qt/KURLQt.cpp4
-rw-r--r--Source/WebCore/platform/qt/LocalizedStringsQt.cpp6
-rw-r--r--Source/WebCore/platform/qt/QWebPageClient.h4
-rw-r--r--Source/WebCore/platform/text/BidiResolver.h3
-rw-r--r--Source/WebCore/platform/win/ClipboardUtilitiesWin.cpp17
-rw-r--r--Source/WebCore/platform/win/PopupMenuWin.cpp4
-rw-r--r--Source/WebCore/plugins/PluginView.cpp7
-rw-r--r--Source/WebCore/plugins/PluginView.h9
-rw-r--r--Source/WebCore/plugins/PluginViewBase.h3
-rw-r--r--Source/WebCore/plugins/qt/PluginPackageQt.cpp21
-rw-r--r--Source/WebCore/plugins/qt/PluginViewQt.cpp262
-rw-r--r--Source/WebCore/rendering/InlineTextBox.cpp91
-rw-r--r--Source/WebCore/rendering/InlineTextBox.h2
-rw-r--r--Source/WebCore/rendering/LayoutTypes.h5
-rwxr-xr-xSource/WebCore/rendering/RenderBlock.cpp159
-rw-r--r--Source/WebCore/rendering/RenderBlock.h45
-rwxr-xr-xSource/WebCore/rendering/RenderBlockLineLayout.cpp4
-rw-r--r--Source/WebCore/rendering/RenderBox.cpp15
-rw-r--r--Source/WebCore/rendering/RenderBox.h3
-rw-r--r--Source/WebCore/rendering/RenderBoxModelObject.cpp95
-rw-r--r--Source/WebCore/rendering/RenderBoxModelObject.h2
-rw-r--r--Source/WebCore/rendering/RenderEmbeddedObject.cpp91
-rw-r--r--Source/WebCore/rendering/RenderEmbeddedObject.h30
-rw-r--r--Source/WebCore/rendering/RenderFileUploadControl.cpp2
-rw-r--r--Source/WebCore/rendering/RenderFrameSet.cpp15
-rw-r--r--Source/WebCore/rendering/RenderImage.cpp46
-rw-r--r--Source/WebCore/rendering/RenderInline.cpp285
-rw-r--r--Source/WebCore/rendering/RenderInline.h8
-rw-r--r--Source/WebCore/rendering/RenderLayer.cpp69
-rw-r--r--Source/WebCore/rendering/RenderLayer.h8
-rw-r--r--Source/WebCore/rendering/RenderLayerBacking.cpp5
-rw-r--r--Source/WebCore/rendering/RenderLayerCompositor.cpp7
-rw-r--r--Source/WebCore/rendering/RenderListBox.cpp6
-rw-r--r--Source/WebCore/rendering/RenderMediaControlsChromium.cpp14
-rw-r--r--Source/WebCore/rendering/RenderMenuList.cpp2
-rwxr-xr-xSource/WebCore/rendering/RenderObject.cpp41
-rw-r--r--Source/WebCore/rendering/RenderObject.h10
-rw-r--r--Source/WebCore/rendering/RenderObjectChildList.cpp3
-rw-r--r--Source/WebCore/rendering/RenderScrollbar.cpp14
-rw-r--r--Source/WebCore/rendering/RenderScrollbar.h13
-rw-r--r--Source/WebCore/rendering/RenderScrollbarPart.h2
-rw-r--r--Source/WebCore/rendering/RenderTableSection.cpp2
-rw-r--r--Source/WebCore/rendering/RenderText.cpp10
-rw-r--r--Source/WebCore/rendering/RenderText.h2
-rw-r--r--Source/WebCore/rendering/RenderTextControlSingleLine.cpp2
-rw-r--r--Source/WebCore/rendering/RenderThemeMac.h2
-rw-r--r--Source/WebCore/rendering/RenderThemeMac.mm60
-rw-r--r--Source/WebCore/rendering/style/RenderStyle.cpp1
-rw-r--r--Source/WebCore/rendering/style/RenderStyle.h7
-rw-r--r--Source/WebCore/rendering/style/StyleRareInheritedData.cpp3
-rw-r--r--Source/WebCore/rendering/style/StyleRareInheritedData.h3
-rw-r--r--Source/WebCore/rendering/svg/RenderSVGEllipse.h1
-rw-r--r--Source/WebCore/rendering/svg/RenderSVGInline.cpp2
-rw-r--r--Source/WebCore/rendering/svg/RenderSVGInlineText.cpp22
-rw-r--r--Source/WebCore/rendering/svg/RenderSVGRect.h1
-rw-r--r--Source/WebCore/rendering/svg/RenderSVGResource.h1
-rw-r--r--Source/WebCore/rendering/svg/RenderSVGShape.h1
-rw-r--r--Source/WebCore/rendering/svg/RenderSVGText.cpp166
-rw-r--r--Source/WebCore/rendering/svg/RenderSVGText.h17
-rw-r--r--Source/WebCore/rendering/svg/SVGInlineTextBox.cpp10
-rw-r--r--Source/WebCore/rendering/svg/SVGInlineTextBox.h4
-rw-r--r--Source/WebCore/rendering/svg/SVGRootInlineBox.cpp1
-rw-r--r--Source/WebCore/rendering/svg/SVGTextLayoutAttributesBuilder.cpp8
-rw-r--r--Source/WebCore/rendering/svg/SVGTextMetrics.cpp1
-rw-r--r--Source/WebCore/storage/StorageArea.h6
-rw-r--r--Source/WebCore/storage/StorageAreaImpl.cpp31
-rw-r--r--Source/WebCore/storage/StorageAreaImpl.h6
-rw-r--r--Source/WebCore/svg/SVGAnimateElement.cpp133
-rw-r--r--Source/WebCore/svg/SVGAnimateElement.h3
-rw-r--r--Source/WebCore/svg/SVGAnimateMotionElement.cpp17
-rw-r--r--Source/WebCore/svg/SVGAnimateMotionElement.h3
-rw-r--r--Source/WebCore/svg/SVGAnimatedLengthList.cpp4
-rw-r--r--Source/WebCore/svg/SVGAnimatedNumberList.cpp4
-rw-r--r--Source/WebCore/svg/SVGAnimatedPointList.cpp6
-rw-r--r--Source/WebCore/svg/SVGAnimationElement.cpp42
-rw-r--r--Source/WebCore/svg/SVGAnimationElement.h5
-rw-r--r--Source/WebCore/svg/SVGElement.cpp14
-rw-r--r--Source/WebCore/svg/SVGFilterElement.cpp40
-rw-r--r--Source/WebCore/svg/SVGFilterElement.h3
-rw-r--r--Source/WebCore/svg/SVGFilterPrimitiveStandardAttributes.h5
-rw-r--r--Source/WebCore/svg/SVGScriptElement.cpp4
-rw-r--r--Source/WebCore/svg/SVGScriptElement.h2
-rw-r--r--Source/WebCore/svg/SVGTRefElement.cpp4
-rw-r--r--Source/WebCore/svg/animation/SMILTimeContainer.cpp25
-rw-r--r--Source/WebCore/svg/animation/SVGSMILElement.cpp57
-rw-r--r--Source/WebCore/svg/animation/SVGSMILElement.h7
-rw-r--r--Source/WebCore/svg/properties/SVGAnimatedListPropertyTearOff.h6
-rw-r--r--Source/WebCore/svg/properties/SVGAnimatedProperty.h1
-rw-r--r--Source/WebCore/svg/properties/SVGAnimatedPropertyTearOff.h10
-rw-r--r--Source/WebCore/svg/properties/SVGAnimatedStaticPropertyTearOff.h10
-rw-r--r--Source/WebCore/testing/Internals.cpp60
-rw-r--r--Source/WebCore/testing/Internals.h4
-rw-r--r--Source/WebCore/testing/Internals.idl4
-rw-r--r--Source/WebKit/ChangeLog63
-rw-r--r--Source/WebKit/PlatformBlackBerry.cmake6
-rw-r--r--Source/WebKit/PlatformEfl.cmake8
-rw-r--r--Source/WebKit/blackberry/Api/BackingStore.cpp31
-rw-r--r--Source/WebKit/blackberry/Api/BackingStore_p.h1
-rw-r--r--Source/WebKit/blackberry/Api/WebPage.cpp61
-rw-r--r--Source/WebKit/blackberry/Api/WebPage.h11
-rw-r--r--Source/WebKit/blackberry/Api/WebPageClient.h3
-rw-r--r--Source/WebKit/blackberry/Api/WebPage_p.h11
-rw-r--r--Source/WebKit/blackberry/ChangeLog253
-rw-r--r--Source/WebKit/blackberry/WebCoreSupport/AutofillManager.cpp80
-rw-r--r--Source/WebKit/blackberry/WebCoreSupport/AutofillManager.h58
-rw-r--r--Source/WebKit/blackberry/WebCoreSupport/ChromeClientBlackBerry.cpp31
-rw-r--r--Source/WebKit/blackberry/WebCoreSupport/ChromeClientBlackBerry.h5
-rw-r--r--Source/WebKit/blackberry/WebCoreSupport/EditorClientBlackBerry.cpp6
-rw-r--r--Source/WebKit/blackberry/WebCoreSupport/FrameLoaderClientBlackBerry.cpp17
-rw-r--r--Source/WebKit/blackberry/WebCoreSupport/PagePopupBlackBerry.cpp254
-rw-r--r--Source/WebKit/blackberry/WebCoreSupport/PagePopupBlackBerry.h67
-rw-r--r--Source/WebKit/blackberry/WebKitSupport/BackingStoreClient.cpp33
-rw-r--r--Source/WebKit/blackberry/WebKitSupport/SelectionHandler.cpp19
-rw-r--r--Source/WebKit/chromium/ChangeLog1096
-rw-r--r--Source/WebKit/chromium/DEPS2
-rw-r--r--Source/WebKit/chromium/README4
-rw-r--r--Source/WebKit/chromium/WebKit.gyp15
-rw-r--r--Source/WebKit/chromium/WebKit.gypi6
-rw-r--r--Source/WebKit/chromium/features.gypi12
-rw-r--r--Source/WebKit/chromium/public/WebFileChooserParams.h8
-rw-r--r--Source/WebKit/chromium/public/WebFrame.h13
-rw-r--r--Source/WebKit/chromium/public/WebFrameClient.h5
-rw-r--r--Source/WebKit/chromium/public/WebStorageArea.h33
-rw-r--r--Source/WebKit/chromium/public/WebStorageEventDispatcher.h9
-rw-r--r--Source/WebKit/chromium/public/WebStorageNamespace.h3
-rw-r--r--Source/WebKit/chromium/public/WebTextInputType.h6
-rw-r--r--Source/WebKit/chromium/public/WebUserMediaRequest.h5
-rw-r--r--Source/WebKit/chromium/public/platform/WebClipboard.h69
-rw-r--r--Source/WebKit/chromium/public/platform/WebDragData.h94
-rw-r--r--Source/WebKit/chromium/public/platform/WebFileSystem.h109
-rw-r--r--Source/WebKit/chromium/public/platform/WebImage.h97
-rw-r--r--Source/WebKit/chromium/public/platform/WebKitPlatformSupport.h15
-rw-r--r--Source/WebKit/chromium/src/AssertMatchingEnums.cpp4
-rw-r--r--Source/WebKit/chromium/src/AsyncFileSystemChromium.cpp156
-rw-r--r--Source/WebKit/chromium/src/AsyncFileSystemChromium.h40
-rw-r--r--Source/WebKit/chromium/src/ChromeClientImpl.cpp5
-rw-r--r--Source/WebKit/chromium/src/ContextMenuClientImpl.cpp22
-rw-r--r--Source/WebKit/chromium/src/DragClientImpl.cpp7
-rw-r--r--Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp35
-rw-r--r--Source/WebKit/chromium/src/FrameLoaderClientImpl.h7
-rw-r--r--Source/WebKit/chromium/src/LocalFileSystemChromium.cpp6
-rw-r--r--Source/WebKit/chromium/src/LocalizedStrings.cpp6
-rw-r--r--Source/WebKit/chromium/src/PageOverlay.cpp4
-rw-r--r--Source/WebKit/chromium/src/PageWidgetDelegate.cpp4
-rw-r--r--Source/WebKit/chromium/src/PlatformSupport.cpp54
-rw-r--r--Source/WebKit/chromium/src/StorageAreaProxy.cpp107
-rw-r--r--Source/WebKit/chromium/src/StorageAreaProxy.h12
-rw-r--r--Source/WebKit/chromium/src/StorageEventDispatcherImpl.cpp83
-rw-r--r--Source/WebKit/chromium/src/WebContentLayerImpl.cpp6
-rw-r--r--Source/WebKit/chromium/src/WebDragData.cpp2
-rw-r--r--Source/WebKit/chromium/src/WebFileSystemCallbacksImpl.cpp9
-rw-r--r--Source/WebKit/chromium/src/WebFileSystemCallbacksImpl.h7
-rw-r--r--Source/WebKit/chromium/src/WebFontImpl.cpp5
-rw-r--r--Source/WebKit/chromium/src/WebFrameImpl.cpp31
-rw-r--r--Source/WebKit/chromium/src/WebFrameImpl.h6
-rw-r--r--Source/WebKit/chromium/src/WebGraphicsContext3D.cpp4
-rw-r--r--Source/WebKit/chromium/src/WebImageCG.cpp2
-rw-r--r--Source/WebKit/chromium/src/WebImageDecoder.cpp10
-rw-r--r--Source/WebKit/chromium/src/WebImageSkia.cpp2
-rw-r--r--Source/WebKit/chromium/src/WebPluginContainerImpl.cpp19
-rw-r--r--Source/WebKit/chromium/src/WebStorageEventDispatcherImpl.cpp34
-rw-r--r--Source/WebKit/chromium/src/WebTextRun.cpp2
-rw-r--r--Source/WebKit/chromium/src/WebUserMediaRequest.cpp16
-rw-r--r--Source/WebKit/chromium/src/WebViewImpl.cpp44
-rw-r--r--Source/WebKit/chromium/src/WebViewImpl.h7
-rw-r--r--Source/WebKit/chromium/src/WebWorkerClientImpl.h2
-rw-r--r--Source/WebKit/chromium/src/WorkerAsyncFileSystemChromium.cpp83
-rw-r--r--Source/WebKit/chromium/src/WorkerAsyncFileSystemChromium.h30
-rw-r--r--Source/WebKit/chromium/src/WorkerAsyncFileWriterChromium.cpp2
-rw-r--r--Source/WebKit/chromium/src/WorkerFileSystemCallbacksBridge.h2
-rw-r--r--Source/WebKit/chromium/src/WorkerFileWriterCallbacksBridge.cpp6
-rw-r--r--Source/WebKit/chromium/src/painting/GraphicsContextBuilder.h27
-rw-r--r--Source/WebKit/chromium/tests/CCActiveAnimationTest.cpp10
-rw-r--r--Source/WebKit/chromium/tests/CCLayerAnimationControllerTest.cpp120
-rw-r--r--Source/WebKit/chromium/tests/CCLayerTreeHostCommonTest.cpp6
-rw-r--r--Source/WebKit/chromium/tests/CCLayerTreeHostImplTest.cpp76
-rw-r--r--Source/WebKit/chromium/tests/CCLayerTreeHostTest.cpp102
-rw-r--r--Source/WebKit/chromium/tests/CCMathUtilTest.cpp17
-rw-r--r--Source/WebKit/chromium/tests/CCOcclusionTrackerTest.cpp54
-rw-r--r--Source/WebKit/chromium/tests/CCQuadCullerTest.cpp2
-rw-r--r--Source/WebKit/chromium/tests/CCTiledLayerTestCommon.h3
-rw-r--r--Source/WebKit/chromium/tests/Canvas2DLayerChromiumTest.cpp3
-rw-r--r--Source/WebKit/chromium/tests/EventListenerTest.cpp251
-rw-r--r--Source/WebKit/chromium/tests/FrameLoaderClientImplTest.cpp115
-rw-r--r--Source/WebKit/chromium/tests/IDBLevelDBCodingTest.cpp28
-rw-r--r--Source/WebKit/chromium/tests/LayerRendererChromiumTest.cpp8
-rw-r--r--Source/WebKit/chromium/tests/LinkHighlightTest.cpp87
-rw-r--r--Source/WebKit/chromium/tests/ListenerLeakTest.cpp125
-rw-r--r--Source/WebKit/chromium/tests/MockCCQuadCuller.h4
-rw-r--r--Source/WebKit/chromium/tests/RegionTest.cpp267
-rw-r--r--Source/WebKit/chromium/tests/TextureLayerChromiumTest.cpp136
-rw-r--r--Source/WebKit/chromium/tests/ThrottledTextureUploaderTest.cpp93
-rw-r--r--Source/WebKit/chromium/tests/TiledLayerChromiumTest.cpp16
-rwxr-xr-xSource/WebKit/chromium/tests/TilingDataTest.cpp734
-rw-r--r--Source/WebKit/chromium/tests/WebFrameTest.cpp56
-rw-r--r--Source/WebKit/chromium/tests/WebViewTest.cpp42
-rw-r--r--Source/WebKit/chromium/tests/data/input_field_date.html1
-rw-r--r--Source/WebKit/chromium/tests/data/input_field_datetime.html1
-rw-r--r--Source/WebKit/chromium/tests/data/input_field_datetimelocal.html1
-rw-r--r--Source/WebKit/chromium/tests/data/input_field_default.html1
-rw-r--r--Source/WebKit/chromium/tests/data/input_field_email.html1
-rw-r--r--Source/WebKit/chromium/tests/data/input_field_month.html1
-rw-r--r--Source/WebKit/chromium/tests/data/input_field_number.html1
-rw-r--r--Source/WebKit/chromium/tests/data/input_field_password.html1
-rw-r--r--Source/WebKit/chromium/tests/data/input_field_search.html1
-rw-r--r--Source/WebKit/chromium/tests/data/input_field_tel.html1
-rw-r--r--Source/WebKit/chromium/tests/data/input_field_time.html1
-rw-r--r--Source/WebKit/chromium/tests/data/input_field_url.html1
-rw-r--r--Source/WebKit/chromium/tests/data/input_field_week.html1
-rw-r--r--Source/WebKit/chromium/tests/data/listener/listener_leak1.html38
-rw-r--r--Source/WebKit/chromium/tests/data/listener/listener_leak2.html40
-rw-r--r--Source/WebKit/chromium/tests/data/listener/mutation_event_listener.html38
-rw-r--r--Source/WebKit/chromium/tests/data/postmessage_test.html16
-rw-r--r--Source/WebKit/efl/ChangeLog218
-rw-r--r--Source/WebKit/efl/WebCoreSupport/DumpRenderTreeSupportEfl.cpp183
-rw-r--r--Source/WebKit/efl/WebCoreSupport/DumpRenderTreeSupportEfl.h19
-rw-r--r--Source/WebKit/efl/WebCoreSupport/EditorClientEfl.cpp9
-rw-r--r--Source/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp13
-rw-r--r--Source/WebKit/efl/ewk/ewk_frame.cpp14
-rw-r--r--Source/WebKit/efl/ewk/ewk_frame.h3
-rw-r--r--Source/WebKit/efl/ewk/ewk_private.h1
-rw-r--r--Source/WebKit/efl/ewk/ewk_settings.cpp5
-rw-r--r--Source/WebKit/efl/ewk/ewk_settings.h2
-rw-r--r--Source/WebKit/efl/ewk/ewk_view.cpp4
-rw-r--r--Source/WebKit/efl/ewk/ewk_view.h2
-rw-r--r--Source/WebKit/gtk/ChangeLog65
-rw-r--r--Source/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.cpp18
-rw-r--r--Source/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.h2
-rw-r--r--Source/WebKit/gtk/webkit/webkitdownload.cpp10
-rw-r--r--Source/WebKit/gtk/webkit/webkitwebsettings.cpp53
-rw-r--r--Source/WebKit/gtk/webkit/webkitwebsettingsprivate.h2
-rw-r--r--Source/WebKit/gtk/webkit/webkitwebview.cpp6
-rw-r--r--Source/WebKit/mac/ChangeLog106
-rw-r--r--Source/WebKit/mac/Configurations/FeatureDefines.xcconfig3
-rw-r--r--Source/WebKit/mac/Configurations/Version.xcconfig4
-rw-r--r--Source/WebKit/mac/Misc/WebKitErrors.h1
-rw-r--r--Source/WebKit/mac/Plugins/Hosted/WebHostedNetscapePluginView.mm2
-rw-r--r--Source/WebKit/mac/Plugins/WebBasePluginPackage.h3
-rw-r--r--Source/WebKit/mac/Plugins/WebBasePluginPackage.mm15
-rw-r--r--Source/WebKit/mac/WebCoreSupport/WebChromeClient.h4
-rw-r--r--Source/WebKit/mac/WebCoreSupport/WebChromeClient.mm10
-rw-r--r--Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm40
-rw-r--r--Source/WebKit/mac/WebCoreSupport/WebInspectorClient.mm2
-rw-r--r--Source/WebKit/mac/WebCoreSupport/WebSystemInterface.mm16
-rw-r--r--Source/WebKit/mac/WebKit.order2
-rw-r--r--Source/WebKit/mac/WebView/WebFrame.mm18
-rw-r--r--Source/WebKit/mac/WebView/WebFramePrivate.h4
-rw-r--r--Source/WebKit/qt/Api/qwebpage.cpp12
-rw-r--r--Source/WebKit/qt/Api/qwebsettings.cpp4
-rw-r--r--Source/WebKit/qt/ChangeLog57
-rw-r--r--Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp26
-rw-r--r--Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h2
-rw-r--r--Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp9
-rw-r--r--Source/WebKit/qt/WebCoreSupport/PageClientQt.cpp14
-rw-r--r--Source/WebKit/win/ChangeLog59
-rw-r--r--Source/WebKit/win/Interfaces/IWebFramePrivate.idl3
-rw-r--r--Source/WebKit/win/WebCoreSupport/EmbeddedWidget.cpp7
-rw-r--r--Source/WebKit/win/WebCoreSupport/EmbeddedWidget.h10
-rw-r--r--Source/WebKit/win/WebCoreSupport/WebChromeClient.cpp9
-rw-r--r--Source/WebKit/win/WebCoreSupport/WebChromeClient.h4
-rw-r--r--Source/WebKit/win/WebFrame.cpp20
-rw-r--r--Source/WebKit/win/WebFrame.h2
-rw-r--r--Source/WebKit2/ChangeLog698
-rw-r--r--Source/WebKit2/Configurations/FeatureDefines.xcconfig3
-rw-r--r--Source/WebKit2/Configurations/Version.xcconfig4
-rw-r--r--Source/WebKit2/GNUmakefile.am1133
-rw-r--r--Source/WebKit2/GNUmakefile.list.am1126
-rw-r--r--Source/WebKit2/PluginProcess/PluginControllerProxy.cpp5
-rw-r--r--Source/WebKit2/PluginProcess/PluginControllerProxy.h2
-rw-r--r--Source/WebKit2/PluginProcess/WebProcessConnection.cpp3
-rw-r--r--Source/WebKit2/PluginProcess/WebProcessConnection.h2
-rw-r--r--Source/WebKit2/PluginProcess/WebProcessConnection.messages.in2
-rw-r--r--Source/WebKit2/Shared/API/c/WKError.h1
-rw-r--r--Source/WebKit2/Shared/APIClientTraits.cpp2
-rw-r--r--Source/WebKit2/Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm5
-rw-r--r--Source/WebKit2/Shared/Plugins/PluginQuirks.h4
-rw-r--r--Source/WebKit2/Shared/WebPreferencesStore.h2
-rw-r--r--Source/WebKit2/Target.pri2
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKPage.h22
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/WebKitLoaderClient.cpp4
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/WebKitSettings.cpp122
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/WebKitSettings.h13
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-sections.txt4
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/tests/TestResources.cpp2
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/tests/TestWebKitSettings.cpp10
-rw-r--r--Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp315
-rw-r--r--Source/WebKit2/UIProcess/API/qt/qquickwebview_p.h72
-rw-r--r--Source/WebKit2/UIProcess/API/qt/qquickwebview_p_p.h45
-rw-r--r--Source/WebKit2/UIProcess/API/qt/qwebiconimageprovider.cpp2
-rw-r--r--Source/WebKit2/UIProcess/API/qt/qwebiconimageprovider_p.h2
-rw-r--r--Source/WebKit2/UIProcess/API/qt/qwebviewportinfo.cpp6
-rw-r--r--Source/WebKit2/UIProcess/API/qt/qwebviewportinfo_p.h2
-rw-r--r--Source/WebKit2/UIProcess/API/qt/tests/qmltests/WebView/tst_evaluateJavaScript.qml87
-rw-r--r--Source/WebKit2/UIProcess/API/qt/tests/tests.pri2
-rw-r--r--Source/WebKit2/UIProcess/DrawingAreaProxyImpl.cpp19
-rw-r--r--Source/WebKit2/UIProcess/DrawingAreaProxyImpl.h2
-rw-r--r--Source/WebKit2/UIProcess/Plugins/PluginInfoStore.cpp5
-rw-r--r--Source/WebKit2/UIProcess/Plugins/PluginInfoStore.h5
-rw-r--r--Source/WebKit2/UIProcess/Plugins/mac/PluginInfoStoreMac.mm5
-rw-r--r--Source/WebKit2/UIProcess/WebContext.cpp8
-rw-r--r--Source/WebKit2/UIProcess/WebContext.h2
-rw-r--r--Source/WebKit2/UIProcess/WebContext.messages.in2
-rw-r--r--Source/WebKit2/UIProcess/WebLoaderClient.cpp15
-rw-r--r--Source/WebKit2/UIProcess/WebLoaderClient.h1
-rw-r--r--Source/WebKit2/UIProcess/WebPageProxy.cpp191
-rw-r--r--Source/WebKit2/UIProcess/WebPageProxy.h8
-rw-r--r--Source/WebKit2/UIProcess/WebPageProxy.messages.in3
-rw-r--r--Source/WebKit2/UIProcess/WebUIClient.cpp12
-rw-r--r--Source/WebKit2/UIProcess/WebUIClient.h2
-rw-r--r--Source/WebKit2/UIProcess/mac/WebInspectorProxyMac.mm2
-rw-r--r--Source/WebKit2/UIProcess/qt/QtDialogRunner.h24
-rw-r--r--Source/WebKit2/UIProcess/qt/QtViewportInteractionEngine.cpp14
-rw-r--r--Source/WebKit2/UIProcess/qt/QtViewportInteractionEngine.h4
-rw-r--r--Source/WebKit2/UIProcess/qt/QtWebError.cpp5
-rw-r--r--Source/WebKit2/UIProcess/qt/QtWebError.h1
-rw-r--r--Source/WebKit2/UIProcess/qt/QtWebPageLoadClient.cpp74
-rw-r--r--Source/WebKit2/UIProcess/qt/QtWebPageLoadClient.h13
-rw-r--r--Source/WebKit2/UIProcess/qt/WebPopupMenuProxyQt.h8
-rw-r--r--Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.cpp5
-rw-r--r--Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.h1
-rw-r--r--Source/WebKit2/WebProcess/Plugins/PDF/BuiltInPDFView.h2
-rw-r--r--Source/WebKit2/WebProcess/Plugins/PDF/BuiltInPDFView.mm26
-rw-r--r--Source/WebKit2/WebProcess/Plugins/Plugin.h3
-rw-r--r--Source/WebKit2/WebProcess/Plugins/PluginProxy.cpp10
-rw-r--r--Source/WebKit2/WebProcess/Plugins/PluginProxy.h4
-rw-r--r--Source/WebKit2/WebProcess/Plugins/PluginView.cpp26
-rw-r--r--Source/WebKit2/WebProcess/Plugins/PluginView.h1
-rw-r--r--Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp17
-rw-r--r--Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h4
-rw-r--r--Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp2
-rw-r--r--Source/WebKit2/WebProcess/WebCoreSupport/mac/WebSystemInterface.mm3
-rw-r--r--Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp4
-rw-r--r--Source/WebKit2/WebProcess/WebPage/WebPage.cpp40
-rw-r--r--Source/WebKit2/WebProcess/WebPage/WebPage.h9
-rw-r--r--Source/WebKit2/WebProcess/WebPage/ca/LayerTreeHostCA.cpp2
-rw-r--r--Source/WebKit2/WebProcess/WebPage/ca/LayerTreeHostCA.h7
-rw-r--r--Source/WebKit2/WebProcess/WebPage/ca/mac/LayerTreeHostCAMac.h2
-rw-r--r--Source/WebKit2/WebProcess/WebPage/ca/mac/LayerTreeHostCAMac.mm7
-rw-r--r--Source/WebKit2/WebProcess/WebPage/ca/win/LayerTreeHostCAWin.cpp4
-rw-r--r--Source/WebKit2/WebProcess/WebPage/ca/win/LayerTreeHostCAWin.h2
-rw-r--r--Source/WebKit2/WebProcess/WebPage/mac/WebInspectorMac.mm2
-rw-r--r--Source/WebKit2/WebProcess/WebProcess.cpp5
-rw-r--r--Source/WebKit2/qt/MainQt.cpp18
-rw-r--r--Source/WebKit2/win/WebKit2.def4
-rw-r--r--Source/WebKit2/win/WebKit2CFLite.def2
-rw-r--r--Source/autotools/symbols.filter4
-rw-r--r--Source/cmake/FindGStreamer-App.cmake34
-rw-r--r--Source/cmake/FindGStreamer-Audio.cmake35
-rw-r--r--Source/cmake/FindGStreamer-Base.cmake33
-rw-r--r--Source/cmake/FindGStreamer-FFT.cmake34
-rw-r--r--Source/cmake/FindGStreamer-Interfaces.cmake33
-rw-r--r--Source/cmake/FindGStreamer-Pbutils.cmake33
-rw-r--r--Source/cmake/FindGStreamer-Plugins-Base.cmake33
-rw-r--r--Source/cmake/FindGStreamer-Video.cmake34
-rw-r--r--Source/cmake/FindGStreamer.cmake147
-rw-r--r--Source/cmake/OptionsBlackBerry.cmake1
-rw-r--r--Source/cmake/OptionsEfl.cmake28
-rw-r--r--Source/cmake/WebKitFeatures.cmake2
-rw-r--r--Source/cmakeconfig.h.cmake2
-rw-r--r--Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/garden-o-matic.html2
-rw-r--r--Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/run-unittests.html2
-rw-r--r--Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/builders.js66
-rw-r--r--Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/builders_unittests.js349
-rw-r--r--Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/config.js9
-rw-r--r--Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/controllers.js10
-rw-r--r--Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/controllers_unittests.js30
-rw-r--r--Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/garden-o-matic.js29
-rw-r--r--Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui.js10
-rw-r--r--Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui/failures.js20
-rw-r--r--Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui/failures_unittests.js10
-rw-r--r--Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui/notifications.js6
-rw-r--r--Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui/notifications_unittests.js2
-rw-r--r--Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui/perf.js118
-rw-r--r--Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui/perf_unittests.js131
-rw-r--r--Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui_unittests.js4
-rw-r--r--Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/styles/onebar.css15
-rw-r--r--Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/styles/perf.css47
-rw-r--r--Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/styles/results.css4
-rw-r--r--Tools/ChangeLog1643
-rw-r--r--Tools/DumpRenderTree/DumpRenderTree.gypi2
-rw-r--r--Tools/DumpRenderTree/LayoutTestController.cpp20
-rw-r--r--Tools/DumpRenderTree/LayoutTestController.h2
-rw-r--r--Tools/DumpRenderTree/blackberry/LayoutTestControllerBlackBerry.cpp12
-rw-r--r--Tools/DumpRenderTree/chromium/EventSender.cpp11
-rw-r--r--Tools/DumpRenderTree/chromium/EventSender.h1
-rw-r--r--Tools/DumpRenderTree/chromium/LayoutTestController.cpp50
-rw-r--r--Tools/DumpRenderTree/chromium/LayoutTestController.h8
-rw-r--r--Tools/DumpRenderTree/chromium/MockWebSpeechInputController.cpp4
-rw-r--r--Tools/DumpRenderTree/chromium/TestShell.cpp25
-rw-r--r--Tools/DumpRenderTree/chromium/TestShell.h4
-rw-r--r--Tools/DumpRenderTree/chromium/WebUserMediaClientMock.cpp51
-rw-r--r--Tools/DumpRenderTree/chromium/WebUserMediaClientMock.h5
-rw-r--r--Tools/DumpRenderTree/chromium/WebViewHost.cpp20
-rw-r--r--Tools/DumpRenderTree/chromium/WebViewHost.h5
-rw-r--r--Tools/DumpRenderTree/efl/CMakeLists.txt1
-rw-r--r--Tools/DumpRenderTree/efl/DumpRenderTree.cpp2
-rw-r--r--Tools/DumpRenderTree/efl/DumpRenderTreeChrome.cpp37
-rw-r--r--Tools/DumpRenderTree/efl/DumpRenderTreeChrome.h4
-rw-r--r--Tools/DumpRenderTree/efl/EventSender.cpp183
-rw-r--r--Tools/DumpRenderTree/efl/LayoutTestControllerEfl.cpp24
-rw-r--r--Tools/DumpRenderTree/efl/PixelDumpSupportEfl.cpp27
-rw-r--r--Tools/DumpRenderTree/efl/TextInputController.cpp178
-rw-r--r--Tools/DumpRenderTree/efl/TextInputController.h37
-rw-r--r--Tools/DumpRenderTree/gtk/EventSender.cpp3
-rw-r--r--Tools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp10
-rw-r--r--Tools/DumpRenderTree/mac/LayoutTestControllerMac.mm10
-rw-r--r--Tools/DumpRenderTree/qt/LayoutTestControllerQt.cpp14
-rw-r--r--Tools/DumpRenderTree/qt/LayoutTestControllerQt.h2
-rw-r--r--Tools/DumpRenderTree/win/LayoutTestControllerWin.cpp18
-rw-r--r--Tools/DumpRenderTree/wx/LayoutTestControllerWx.cpp10
-rw-r--r--Tools/MiniBrowser/mac/BrowserWindowController.m2
-rwxr-xr-xTools/Scripts/build-dumprendertree5
-rwxr-xr-xTools/Scripts/build-webkit2
-rwxr-xr-xTools/Scripts/copy-webkitlibraries-to-product-directory4
-rwxr-xr-xTools/Scripts/old-run-webkit-tests2
-rwxr-xr-xTools/Scripts/run-gtk-tests381
-rwxr-xr-xTools/Scripts/webkitdirs.pm20
-rw-r--r--Tools/Scripts/webkitperl/FeatureList.pm6
-rw-r--r--Tools/Scripts/webkitpy/common/checkout/checkout_mock.py56
-rw-r--r--Tools/Scripts/webkitpy/common/config/committers.py2
-rw-r--r--Tools/Scripts/webkitpy/common/config/urls.py1
-rw-r--r--Tools/Scripts/webkitpy/common/net/bugzilla/bugzilla.py6
-rw-r--r--Tools/Scripts/webkitpy/common/net/bugzilla/bugzilla_mock.py39
-rw-r--r--Tools/Scripts/webkitpy/common/net/omahaproxy.py80
-rw-r--r--Tools/Scripts/webkitpy/common/net/omahaproxy_unittest.py125
-rw-r--r--Tools/Scripts/webkitpy/layout_tests/controllers/manager.py6
-rw-r--r--Tools/Scripts/webkitpy/layout_tests/controllers/single_test_runner.py2
-rwxr-xr-xTools/Scripts/webkitpy/layout_tests/port/chromium.py9
-rw-r--r--Tools/Scripts/webkitpy/layout_tests/port/chromium_android.py2
-rw-r--r--Tools/Scripts/webkitpy/layout_tests/port/chromium_android_unittest.py81
-rw-r--r--Tools/Scripts/webkitpy/layout_tests/port/efl.py23
-rw-r--r--Tools/Scripts/webkitpy/layout_tests/port/test.py7
-rw-r--r--Tools/Scripts/webkitpy/layout_tests/port/webkit.py7
-rwxr-xr-xTools/Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py29
-rwxr-xr-xTools/Scripts/webkitpy/layout_tests/servers/http_server_base.py6
-rw-r--r--Tools/Scripts/webkitpy/layout_tests/servers/websocket_server.py4
-rw-r--r--Tools/Scripts/webkitpy/thirdparty/__init__.py8
-rw-r--r--Tools/Scripts/webkitpy/thirdparty/__init___unittest.py6
-rw-r--r--Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/COPYING28
-rw-r--r--Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/__init__.py184
-rw-r--r--Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/_stream_base.py165
-rw-r--r--Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/_stream_hixie75.py228
-rw-r--r--Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/_stream_hybi.py668
-rw-r--r--Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/common.py179
-rw-r--r--Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/dispatch.py381
-rw-r--r--Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/extensions.py265
-rw-r--r--Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/handshake/__init__.py116
-rw-r--r--Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/handshake/_base.py323
-rw-r--r--Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/handshake/draft75.py190
-rw-r--r--Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/handshake/hybi.py370
-rw-r--r--Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/handshake/hybi00.py242
-rw-r--r--Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/headerparserhandler.py243
-rw-r--r--Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/http_header_util.py263
-rw-r--r--Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/memorizingfile.py99
-rw-r--r--Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/msgutil.py219
-rwxr-xr-xTools/Scripts/webkitpy/thirdparty/mod_pywebsocket/standalone.py870
-rw-r--r--Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/stream.py56
-rw-r--r--Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/util.py489
-rw-r--r--Tools/Scripts/webkitpy/tool/bot/flakytestreporter_unittest.py4
-rw-r--r--Tools/Scripts/webkitpy/tool/bot/irc_command_unittest.py4
-rw-r--r--Tools/Scripts/webkitpy/tool/commands/__init__.py1
-rw-r--r--Tools/Scripts/webkitpy/tool/commands/bugsearch.py7
-rw-r--r--Tools/Scripts/webkitpy/tool/commands/chromechannels.py104
-rw-r--r--Tools/Scripts/webkitpy/tool/commands/chromechannels_unittest.py99
-rw-r--r--Tools/Scripts/webkitpy/tool/commands/download_unittest.py27
-rw-r--r--Tools/Scripts/webkitpy/tool/commands/queries_unittest.py4
-rw-r--r--Tools/Scripts/webkitpy/tool/steps/createbug.py10
-rw-r--r--Tools/TestResultServer/static-dashboards/dashboard_base.js4
-rw-r--r--Tools/TestResultServer/static-dashboards/flakiness_dashboard.js21
-rw-r--r--Tools/TestResultServer/static-dashboards/flakiness_dashboard_embedded_unittests.js40
-rw-r--r--Tools/TestResultServer/static-dashboards/flakiness_dashboard_unittests.js13
-rw-r--r--Tools/TestResultServer/static-dashboards/run-embedded-unittests.html67
-rw-r--r--Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj26
-rw-r--r--Tools/TestWebKitAPI/Tests/WebKit2/DOMWindowExtensionBasic.cpp26
-rw-r--r--Tools/TestWebKitAPI/Tests/WebKit2/DOMWindowExtensionBasic_Bundle.cpp42
-rw-r--r--Tools/TestWebKitAPI/Tests/WebKit2/DOMWindowExtensionNoCache.cpp133
-rw-r--r--Tools/TestWebKitAPI/Tests/WebKit2/DOMWindowExtensionNoCache_Bundle.cpp279
-rw-r--r--Tools/TestWebKitAPI/Tests/WebKit2/PageLoadBasic.cpp8
-rw-r--r--Tools/TestWebKitAPI/Tests/WebKit2/simple-iframe-unload.html6
-rw-r--r--Tools/TestWebKitAPI/Tests/WebKit2/simple-unload.html5
-rw-r--r--Tools/TestWebKitAPI/Tests/mac/MemoryCacheDisableWithinResourceLoadDelegate.html14
-rw-r--r--Tools/TestWebKitAPI/Tests/mac/MemoryCacheDisableWithinResourceLoadDelegate.mm90
-rw-r--r--Tools/WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl4
-rw-r--r--Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp21
-rw-r--r--Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.h6
-rw-r--r--Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp83
-rw-r--r--Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp9
-rw-r--r--Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.h8
-rw-r--r--Tools/WebKitTestRunner/TestController.cpp3
-rw-r--r--Tools/WebKitTestRunner/TestInvocation.cpp10
-rw-r--r--Tools/WebKitTestRunner/qt/main.cpp18
-rw-r--r--Tools/efl/jhbuild.modules6
-rw-r--r--Tools/gtk/common.py12
-rwxr-xr-xTools/gtk/run-api-tests353
-rw-r--r--Tools/qmake/mkspecs/features/features.prf8
-rw-r--r--Tools/qmake/mkspecs/features/features.pri33
-rw-r--r--Tools/qmake/mkspecs/features/functions.prf16
-rw-r--r--WebKitLibraries/ChangeLog36
-rw-r--r--WebKitLibraries/WebKitSystemInterface.h16
-rw-r--r--WebKitLibraries/libWebKitSystemInterfaceLeopard.abin2113272 -> 2113504 bytes
-rw-r--r--WebKitLibraries/libWebKitSystemInterfaceLion.abin610080 -> 634328 bytes
-rw-r--r--WebKitLibraries/libWebKitSystemInterfaceSnowLeopard.abin1543948 -> 1582036 bytes
-rw-r--r--WebKitLibraries/win/tools/vsprops/FeatureDefines.vsprops5
-rw-r--r--configure.ac16
1047 files changed, 32525 insertions, 8505 deletions
diff --git a/ChangeLog b/ChangeLog
index 6dd54f3b8..37dad732c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,224 @@
+2012-05-10 MORITA Hajime <morrita@google.com>
+
+ ElementShadow should minimize the usage of "ShadowRoot" name
+ https://bugs.webkit.org/show_bug.cgi?id=85970
+
+ Reviewed by Dimitri Glazkov.
+
+ Removed symbols which no longer exists
+
+ * Source/autotools/symbols.filter:
+
+2012-05-10 Gyuyoung Kim <gyuyoung.kim@samsung.com>
+
+ Move resumeAnimations to use Internals interface
+ https://bugs.webkit.org/show_bug.cgi?id=86063
+
+ Reviewed by Alexey Proskuryakov.
+
+ * Source/autotools/symbols.filter: Add a symbol filter for resumeAnimations.
+
+2012-05-10 Zan Dobersek <zandobersek@gmail.com>
+
+ [GTK] ENABLE_IFRAME_SEAMLESS support
+ https://bugs.webkit.org/show_bug.cgi?id=85843
+
+ Reviewed by Eric Seidel.
+
+ Add a configuration option for enabling the iframe seamless
+ attribute support, enabling it by default.
+
+ * configure.ac:
+
+2012-05-09 Stephen Chenney <schenney@chromium.org>
+
+ SVG Filters allow invalid elements as children
+ https://bugs.webkit.org/show_bug.cgi?id=83979
+
+ Reviewed by Nikolas Zimmermann.
+
+ This test will crash upon load in Chromium, unless the associated fix is in.
+
+ * ManualTests/bugzilla-83979.svg: Added.
+
+2012-05-09 Kent Tamura <tkent@chromium.org>
+
+ Calendar Picker: Fix a crash by changing input type.
+ https://bugs.webkit.org/show_bug.cgi?id=86007
+
+ Reviewed by Hajime Morita.
+
+ * ManualTests/forms/calendar-picker-crash-by-type-change.html: Added.
+
+2012-05-09 Gyuyoung Kim <gyuyoung.kim@samsung.com>
+
+ Move suspendAnimations to use Internals interface.
+ https://bugs.webkit.org/show_bug.cgi?id=85986
+
+ Reviewed by Ryosuke Niwa.
+
+ * Source/autotools/symbols.filter: Add a symbol filter for suspendAnimations.
+
+2012-05-09 Hugo Parente Lima <hugo.lima@openbossa.org>
+
+ Use suitable viewport values on XHTML-MP pages.
+ https://bugs.webkit.org/show_bug.cgi?id=85425
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Add LEGACY_VIEWPORT_ADAPTION use feature to cmake build system,
+ this feature will enable the use of a suitable viewport size
+ on legacy XHTML-MP pages.
+
+ * Source/cmake/WebKitFeatures.cmake:
+
+2012-05-09 Crystal Zhang <haizhang@rim.com>
+
+ [BlackBerry] Enable PAGE_POPUP in make file, and implement required methods
+ https://bugs.webkit.org/show_bug.cgi?id=85907
+
+ Reviewed by Rob Buis.
+
+ Enable PAGE_POPUP option in make files.
+
+ Internal reviewed by Yong Li.
+
+ * Source/cmake/OptionsBlackBerry.cmake:
+ * Source/cmakeconfig.h.cmake:
+
+2012-05-09 Carlos Garcia Campos <cgarcia@igalia.com>
+
+ [GTK] Split WebKit2 Makefile moving source code listings to GNUmakefile.list.am
+ https://bugs.webkit.org/show_bug.cgi?id=85985
+
+ Reviewed by Gustavo Noronha Silva.
+
+ * GNUmakefile.am:
+
+2012-05-09 Carlos Garcia Campos <cgarcia@igalia.com>
+
+ [GTK] Use independent version numbers for public libraries
+ https://bugs.webkit.org/show_bug.cgi?id=85984
+
+ Reviewed by Gustavo Noronha Silva.
+
+ * configure.ac: Define LIBJAVASCRIPTCOREGTK_VERSION and
+ LIBWEBKIT2GTK_VERSION using the same version as
+ LIBWEBKITGTK_VERSION for backwards compatibility.
+
+2012-05-08 Raphael Kubo da Costa <rakuco@webkit.org>
+
+ [CMake] FindGStreamer: Fix the build with static WebCore.
+ https://bugs.webkit.org/show_bug.cgi?id=85930
+
+ Reviewed by Daniel Bates.
+
+ Building WebCore statically was failing because files in
+ WebCore/platform/gstreamer when ENABLE_VIDEO was set required
+ gstreamer-base, which was not being linked to after r116453.
+
+ Fix that by looking for gstreamer-base, requiring and linking
+ against it if GStreamer is used.
+
+ * Source/cmake/FindGStreamer.cmake:
+
+2012-05-08 Raphael Kubo da Costa <rakuco@webkit.org>
+
+ [CMake] Rewrite FindGStreamer.cmake.
+ https://bugs.webkit.org/show_bug.cgi?id=85857
+
+ Reviewed by Daniel Bates.
+
+ We are currently kind of duplicating the same
+ FindGStreamer-Foo.cmake file whenever a new GStreamer plugin needs
+ to be found. Besides this approach not scaling very well, it
+ relies on pkg-config for version checking, uses the LibFindMacros
+ package that we should deprecate and all the find files could be
+ merged into one, with users using the COMPONENTS feature of the
+ FIND_PACKAGE() call to find the desired plugins.
+
+ FindGStreamer.cmake has then been rewritten to take all that into
+ account:
+ - The LibFindMacros.cmake package is not used anymore.
+ - Version check is performed in the CMake file itself by parsing
+ the gstversion.h header.
+ - All GStreamer plugins are searched and the COMPONENTS keyword
+ used in the FIND_PACKAGE() call is used to check which plugins are
+ required.
+ - The plugins-base and base GStreamer plugins are not searched, as
+ they were not used anywhere in the build system.
+
+ * Source/cmake/FindGStreamer-App.cmake: Removed.
+ * Source/cmake/FindGStreamer-Audio.cmake: Removed.
+ * Source/cmake/FindGStreamer-Base.cmake: Removed.
+ * Source/cmake/FindGStreamer-FFT.cmake: Removed.
+ * Source/cmake/FindGStreamer-Interfaces.cmake: Removed.
+ * Source/cmake/FindGStreamer-Pbutils.cmake: Removed.
+ * Source/cmake/FindGStreamer-Plugins-Base.cmake: Removed.
+ * Source/cmake/FindGStreamer-Video.cmake: Removed.
+ * Source/cmake/FindGStreamer.cmake: Rewrite as described above.
+ * Source/cmake/OptionsEfl.cmake: Use COMPONENTS to specify which
+ GStreamer plugins to look for.
+
+2012-05-08 Ryosuke Niwa <rniwa@webkit.org>
+
+ perf-o-matic fix attempt for dashboard images.
+
+ Rubber-stamped by Antti Koivisto.
+
+ Also stop generating images for 30, 90, and 365 days since they have been timing out.
+
+ * Websites/webkit-perf.appspot.com/controller.py:
+ (schedule_runs_update):
+ * Websites/webkit-perf.appspot.com/models.py:
+ (Runs.chart_params):
+
+2012-05-08 Christophe Dumez <christophe.dumez@intel.com>
+
+ [CMake] Add ENABLE_IFRAME_SEAMLESS flag
+ https://bugs.webkit.org/show_bug.cgi?id=85838
+
+ Reviewed by Eric Seidel.
+
+ Add ENABLE_IFRAME_SEAMLESS flag to CMake and enable it by default.
+ This flag was introduced by r116356.
+
+ * Source/cmake/WebKitFeatures.cmake:
+ * Source/cmakeconfig.h.cmake:
+
+2012-05-08 Balazs Kelemen <kbalazs@webkit.org>
+
+ [Qt] X11 plugins need to be reworked for Qt5+WK1
+ https://bugs.webkit.org/show_bug.cgi?id=80691
+
+ Reviewed by Simon Hausmann.
+
+ Implement basic windowless plugin support with Qt5.
+
+ * Source/api.pri: Need private API's to be able
+ to use QApplicationPrivate::windowForWidget.
+
+2012-05-07 Dave Tu <dtu@chromium.org>
+
+ Adjust flakiness dashboard gpu_tests image diff URLs.
+ https://bugs.webkit.org/show_bug.cgi?id=85423
+
+ Reviewed by Ojan Vafai.
+
+ * Tools/TestResultServer/static-dashboards/flakiness_dashboard.js:
+
+2012-05-07 Liam Quinn <lquinn@rim.com>
+
+ [BlackBerry] WWW-Authenticate header on 200 response pops up authentication dialog
+ https://bugs.webkit.org/show_bug.cgi?id=85643
+
+ Reviewed by George Staikos.
+
+ RIM PR: 151992
+ Added manual test for WWW-Authenticate header on a 200 response.
+
+ * ManualTests/blackberry/http-auth-on-200.php: Added.
+
2012-05-07 Simon Hausmann <simon.hausmann@nokia.com>
[Qt] Unreviewed trivial build fix: Don't include bytearraytestdata.h in the QtWebKit
diff --git a/GNUmakefile.am b/GNUmakefile.am
index a02edb487..c4f8297cd 100644
--- a/GNUmakefile.am
+++ b/GNUmakefile.am
@@ -83,8 +83,11 @@ webkitgtk_cppflags :=
webkitgtk_gdom_built_sources :=
webkitgtk_built_sources :=
webkitgtk_built_nosources :=
+webkit2_h_api :=
webkit2_sources :=
webkit2_built_sources :=
+webkit2gtk_h_api :=
+webkit2gtk_built_sources :=
webkit2_plugin_process_sources :=
webkit2_plugin_process_built_sources :=
webkittestrunner_built_sources :=
@@ -284,7 +287,10 @@ BUILT_SOURCES += \
$(webcore_built_sources) \
$(webcore_built_nosources) \
$(webkitgtk_built_sources) \
- $(webkitgtk_built_nosources)
+ $(webkitgtk_built_nosources) \
+ $(webkit2_built_sources) \
+ $(webkit2gtk_built_sources) \
+ $(webkit2_plugin_process_built_sources)
DISTCLEANFILES += \
$(CLEANFILES) \
diff --git a/Source/JavaScriptCore/API/JSClassRef.cpp b/Source/JavaScriptCore/API/JSClassRef.cpp
index 08fa5c5e0..5f67fc37e 100644
--- a/Source/JavaScriptCore/API/JSClassRef.cpp
+++ b/Source/JavaScriptCore/API/JSClassRef.cpp
@@ -209,13 +209,16 @@ JSObject* OpaqueJSClass::prototype(ExecState* exec)
OpaqueJSClassContextData& jsClassData = contextData(exec);
- if (!jsClassData.cachedPrototype) {
- // Recursive, but should be good enough for our purposes
- jsClassData.cachedPrototype = PassWeak<JSObject>(JSCallbackObject<JSNonFinalObject>::create(exec, exec->lexicalGlobalObject(), exec->lexicalGlobalObject()->callbackObjectStructure(), prototypeClass, &jsClassData), 0); // set jsClassData as the object's private data, so it can clear our reference on destruction
- if (parentClass) {
- if (JSObject* prototype = parentClass->prototype(exec))
- jsClassData.cachedPrototype->setPrototype(exec->globalData(), prototype);
- }
+ if (JSObject* prototype = jsClassData.cachedPrototype.get())
+ return prototype;
+
+ // Recursive, but should be good enough for our purposes
+ JSObject* prototype = JSCallbackObject<JSNonFinalObject>::create(exec, exec->lexicalGlobalObject(), exec->lexicalGlobalObject()->callbackObjectStructure(), prototypeClass, &jsClassData); // set jsClassData as the object's private data, so it can clear our reference on destruction
+ if (parentClass) {
+ if (JSObject* parentPrototype = parentClass->prototype(exec))
+ prototype->setPrototype(exec->globalData(), parentPrototype);
}
- return jsClassData.cachedPrototype.get();
+
+ jsClassData.cachedPrototype = PassWeak<JSObject>(prototype, 0);
+ return prototype;
}
diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog
index 0774438d1..38f229734 100644
--- a/Source/JavaScriptCore/ChangeLog
+++ b/Source/JavaScriptCore/ChangeLog
@@ -1,3 +1,377 @@
+2012-05-10 Gavin Barraclough <barraclough@apple.com>
+
+ Remove op_get_callee
+
+ Rubber stamped by Geoff Garen.
+
+ This is now redundant.
+
+ * bytecode/CodeBlock.cpp:
+ (JSC::CodeBlock::dump):
+ * bytecode/Opcode.h:
+ (JSC):
+ (JSC::padOpcodeName):
+ * dfg/DFGByteCodeParser.cpp:
+ (JSC::DFG::ByteCodeParser::parseBlock):
+ * dfg/DFGCapabilities.h:
+ (JSC::DFG::canCompileOpcode):
+ * interpreter/Interpreter.cpp:
+ (JSC::Interpreter::privateExecute):
+ * jit/JIT.cpp:
+ (JSC::JIT::privateCompileMainPass):
+ * jit/JIT.h:
+ * jit/JITOpcodes.cpp:
+ (JSC):
+ * jit/JITOpcodes32_64.cpp:
+ (JSC):
+ * llint/LowLevelInterpreter32_64.asm:
+ * llint/LowLevelInterpreter64.asm:
+
+2012-05-10 Gavin Barraclough <barraclough@apple.com>
+
+ Cache inheritorID on JSFunction
+ https://bugs.webkit.org/show_bug.cgi?id=85853
+
+ Reviewed by Geoff Garen & Filip Pizlo.
+
+ An object's prototype is indicated via its structure. To create an otherwise
+ empty object with object A as its prototype, we require a structure with its
+ prototype set to point to A. We wish to use this same structure for all empty
+ objects created with a prototype of A, so we presently store this structure as
+ a property of A, known as the inheritorID.
+
+ When a function F is invoked as a constructor, where F has a property 'prototype'
+ set to point to A, in order to create the 'this' value for the constructor to
+ use the following steps are taken:
+ - the 'prototype' proptery of F is read, via a regular [[Get]] access.
+ - the inheritorID internal property of the prototype is read.
+ - a new, empty object is constructed with its structure set to point to inheritorID.
+
+ There are two drawbacks to the current approach:
+ - it requires that every object has an inheritorID field.
+ - it requires a [[Get]] access on every constructor call to access the 'prototype' property.
+
+ Instead, switch to caching a copy of the inheritorID on the function. Constructor
+ calls now only need read the internal property from the callee, saving a [[Get]].
+ This also means that JSObject::m_inheritorID is no longer commonly read, and in a
+ future patch we can move to storing this in a more memory efficient fashion.
+
+ * JavaScriptCore.xcodeproj/project.pbxproj:
+ * bytecode/CodeBlock.cpp:
+ (JSC::CodeBlock::dump):
+ * bytecode/Opcode.h:
+ (JSC):
+ (JSC::padOpcodeName):
+ * bytecompiler/BytecodeGenerator.cpp:
+ (JSC::BytecodeGenerator::BytecodeGenerator):
+ * dfg/DFGAbstractState.cpp:
+ (JSC::DFG::AbstractState::execute):
+ * dfg/DFGByteCodeParser.cpp:
+ (JSC::DFG::ByteCodeParser::parseBlock):
+ * dfg/DFGNodeType.h:
+ (DFG):
+ * dfg/DFGOperations.cpp:
+ * dfg/DFGOperations.h:
+ * dfg/DFGPredictionPropagationPhase.cpp:
+ (JSC::DFG::PredictionPropagationPhase::propagate):
+ * dfg/DFGSpeculativeJIT32_64.cpp:
+ (JSC::DFG::SpeculativeJIT::compile):
+ * dfg/DFGSpeculativeJIT64.cpp:
+ (JSC::DFG::SpeculativeJIT::compile):
+ * interpreter/Interpreter.cpp:
+ (JSC::Interpreter::privateExecute):
+ * jit/JITInlineMethods.h:
+ (JSC::JIT::emitAllocateJSFunction):
+ * jit/JITOpcodes.cpp:
+ (JSC::JIT::emit_op_create_this):
+ (JSC::JIT::emitSlow_op_create_this):
+ * jit/JITOpcodes32_64.cpp:
+ (JSC::JIT::emit_op_create_this):
+ (JSC::JIT::emitSlow_op_create_this):
+ * jit/JITStubs.cpp:
+ (JSC::DEFINE_STUB_FUNCTION):
+ * llint/LLIntSlowPaths.cpp:
+ (JSC::LLInt::LLINT_SLOW_PATH_DECL):
+ * llint/LowLevelInterpreter32_64.asm:
+ * llint/LowLevelInterpreter64.asm:
+ * runtime/JSFunction.cpp:
+ (JSC::JSFunction::JSFunction):
+ (JSC::JSFunction::cacheInheritorID):
+ (JSC):
+ (JSC::JSFunction::put):
+ (JSC::JSFunction::defineOwnProperty):
+ * runtime/JSFunction.h:
+ (JSC::JSFunction::cachedInheritorID):
+ (JSFunction):
+ (JSC::JSFunction::offsetOfCachedInheritorID):
+
+2012-05-10 Michael Saboff <msaboff@apple.com>
+
+ Enh: Hash Const JSString in Backing Stores to Save Memory
+ https://bugs.webkit.org/show_bug.cgi?id=86024
+
+ Reviewed by Filip Pizlo.
+
+ During garbage collection, each marking thread keeps a HashMap of
+ strings. While visiting via MarkStack::copyAndAppend(), we check to
+ see if the string we are visiting is already in the HashMap. If not
+ we add it. If so, we change the reference to the current string we're
+ visiting to the prior string.
+
+ To somewhat reduce the performance impact of this change, if a string
+ is unique at the end of a marking it will not be checked during further
+ GC phases. In some cases this won't catch all duplicates, but we are
+ trying to catch the growth of duplicate strings.
+
+ * heap/Heap.cpp:
+ (JSC::Heap::markRoots):
+ * heap/MarkStack.cpp:
+ (JSC::MarkStackThreadSharedData::resetChildren): New method called by the
+ main thread to reset the slave threads. This is primarily done to
+ clear the m_uniqueStrings HashMap.
+ (JSC):
+ (JSC::MarkStackThreadSharedData::markingThreadMain):
+ (JSC::MarkStackThreadSharedData::markingThreadStartFunc):
+ (JSC::MarkStackThreadSharedData::MarkStackThreadSharedData):
+ (JSC::MarkStackThreadSharedData::reset):
+ (JSC::MarkStack::reset): Added call to clear m_uniqueStrings.
+ (JSC::MarkStack::internalAppend): New method that performs the hash consting.
+ (JSC::SlotVisitor::copyAndAppend): Changed to call the new hash consting
+ internalAppend()
+ * heap/MarkStack.h:
+ (MarkStackThreadSharedData):
+ (MarkStack):
+ (JSC::MarkStack::sharedData):
+ * runtime/JSString.h:
+ (JSString): Added m_isHashConstSingleton flag, accessors for the flag and
+ code to initialize the flag.
+ (JSC::JSString::finishCreation):
+ (JSC::JSString::isHashConstSingleton):
+ (JSC::JSString::clearHashConstSingleton):
+ (JSC::JSString::setHashConstSingleton):
+ (JSC::JSRopeString::finishCreation):
+
+2012-05-09 Filip Pizlo <fpizlo@apple.com>
+
+ JIT memory allocator is not returning memory to the OS on Darwin
+ https://bugs.webkit.org/show_bug.cgi?id=86047
+ <rdar://problem/11414948>
+
+ Reviewed by Geoff Garen.
+
+ Work around the problem by using a different madvise() flag, but only for the JIT memory
+ allocator. Also put in ASSERTs that the call is actually working.
+
+ * jit/ExecutableAllocatorFixedVMPool.cpp:
+ (JSC::FixedVMPoolExecutableAllocator::notifyNeedPage):
+ (JSC::FixedVMPoolExecutableAllocator::notifyPageIsFree):
+
+2012-05-09 Filip Pizlo <fpizlo@apple.com>
+
+ It should be possible to get useful debug logging from the JIT memory allocator
+ https://bugs.webkit.org/show_bug.cgi?id=86042
+
+ Reviewed by Geoff Garen.
+
+ * jit/ExecutableAllocator.h:
+
+2012-05-09 Gavin Barraclough <barraclough@apple.com>
+
+ GC race condition in OpaqueJSClass::prototype
+ https://bugs.webkit.org/show_bug.cgi?id=86034
+
+ Build fix.
+
+ * API/JSClassRef.cpp:
+ (OpaqueJSClass::prototype):
+ - Eeeep, landed bad version of patch!
+
+2012-05-09 Gavin Barraclough <barraclough@apple.com>
+
+ GC race condition in OpaqueJSClass::prototype
+ https://bugs.webkit.org/show_bug.cgi?id=86034
+
+ Reviewed by Filip Pizlo.
+
+ The bug here is basically:
+ if (weakref) weakref->method()
+ where a GC may occur between the if & the method call.
+
+ * API/JSClassRef.cpp:
+ (OpaqueJSClass::prototype):
+
+2012-05-09 Mark Hahnenberg <mhahnenberg@apple.com>
+
+ CopiedSpace does not add pinned blocks back to the to-space filter
+ https://bugs.webkit.org/show_bug.cgi?id=86011
+
+ Reviewed by Geoffrey Garen.
+
+ After a collection has finished, we go through the blocks in from-space
+ and move any of them that are pinned into to-space. At the beginning of
+ collection, we reset the to-space block filter that is used during
+ conservative scanning and add back the blocks that are filled during the
+ collection. However, we neglect to add back those blocks that are moved
+ from from-space to to-space, which can cause the conservative scan to
+ think that some pinned items are not actually in CopiedSpace.
+
+ * heap/CopiedSpace.cpp:
+ (JSC::CopiedSpace::doneCopying): Add the pinned blocks back to the
+ to-space filter. Also added a comment and assert for future readers that
+ indicates that it's okay that we don't also add the block to the
+ to-space block set since it was never removed.
+
+
+2012-05-09 Carlos Garcia Campos <cgarcia@igalia.com>
+
+ [GTK] Use independent version numbers for public libraries
+ https://bugs.webkit.org/show_bug.cgi?id=85984
+
+ Reviewed by Gustavo Noronha Silva.
+
+ * GNUmakefile.am: Use LIBJAVASCRIPTCOREGTK_VERSION for library
+ version.
+
+2012-05-09 Carlos Garcia Campos <cgarcia@igalia.com>
+
+ [GTK] Do not install JavaScriptCore platform-specific headers
+ https://bugs.webkit.org/show_bug.cgi?id=85983
+
+ Reviewed by Gustavo Noronha Silva.
+
+ JavaScriptCore.h includes JSStringRefCF.h unconditionally. It was
+ renamed to JavaScript.h in r29234 and it still exists for
+ compatibility with mac and windows users.
+
+ * GNUmakefile.list.am: Remove JavaScriptCore.h, JSStringRefCF.h
+ and JSStringRefBSTR.h from the sources and headers list.
+
+2012-05-08 Gavin Barraclough <barraclough@apple.com>
+
+ ROLLING OUT r114255
+
+ GC in the middle of JSObject::allocatePropertyStorage can cause badness
+ https://bugs.webkit.org/show_bug.cgi?id=83839
+
+ Reviewed by nobody.
+
+ This breaks the world, with COLLECT_ON_EVERY_ALLOCATION enabled.
+
+ * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
+ * jit/JITStubs.cpp:
+ (JSC::DEFINE_STUB_FUNCTION):
+ * runtime/JSObject.cpp:
+ (JSC::JSObject::allocatePropertyStorage):
+ * runtime/JSObject.h:
+ (JSObject):
+ (JSC::JSObject::isUsingInlineStorage):
+ (JSC):
+ (JSC::JSObject::putDirectInternal):
+ (JSC::JSObject::putDirectWithoutTransition):
+ (JSC::JSObject::transitionTo):
+ * runtime/Structure.cpp:
+ (JSC):
+ * runtime/Structure.h:
+ (JSC::Structure::didTransition):
+
+2012-05-08 Mark Hahnenberg <mhahnenberg@apple.com>
+
+ Heap should not continually allocate new pages in steady state
+ https://bugs.webkit.org/show_bug.cgi?id=85936
+
+ Reviewed by Geoff Garen.
+
+ Currently, in steady state (i.e. a constant amount of live GC
+ memory with a constant rate of allocation) assuming we've just
+ finished a collection with X live blocks in CopiedSpace, we
+ increase our working set by X blocks in CopiedSpace with each
+ collection we perform. This is due to the fact that we allocate
+ until we run out of free blocks to use in the Heap before we
+ consider whether we should run a collection.
+
+ In the longer term, this issue will be mostly resolved by
+ implementing quick release for the CopiedSpace. In the shorter
+ term, we should change our policy to check whether we should
+ allocate before trying to use a free block from the Heap. We
+ can change our policy to something more appropriate once we
+ have implemented quick release.
+
+ This change should also have the convenient side effect of
+ reducing the variance in GC-heavy tests (e.g. v8-splay) due
+ to fact that we are doing less VM allocation during copying
+ collection. Overall, this patch is performance neutral across
+ the benchmarks we track.
+
+ * heap/CopiedSpace.cpp:
+ (JSC::CopiedSpace::getFreshBlock): Shuffle the request from the BlockAllocator
+ around so that we only do it if the block request must succeed
+ i.e. after we've already checked whether we should do a collection.
+ * heap/MarkedAllocator.cpp:
+ (JSC::MarkedAllocator::allocateSlowCase): Ditto.
+ (JSC::MarkedAllocator::allocateBlock): We no longer have a failure mode in this
+ function because by the time we've called it, we've already checked whether we
+ should run a collection so there's no point in returning null.
+ * heap/MarkedAllocator.h: Removing old arguments from function declaration.
+ (MarkedAllocator):
+
+2012-05-08 Gavin Barraclough <barraclough@apple.com>
+
+ SIGFPE on divide in classic interpreter
+ https://bugs.webkit.org/show_bug.cgi?id=85917
+
+ Rubber stamped by Oliver Hunt.
+
+ * interpreter/Interpreter.cpp:
+ (JSC::Interpreter::privateExecute):
+ - check for divisor of -1.
+
+2012-05-07 Oliver Hunt <oliver@apple.com>
+
+ Rolling out r110287
+
+ RS=Filip Pizlo
+
+ r110287 was meant to be refactoring only, but changed behavior
+ enough to break some websites, including qq.com.
+
+2012-05-07 Andy Estes <aestes@apple.com>
+
+ ENABLE_IFRAME_SEAMLESS should be part of FEATURE_DEFINES.
+
+ * Configurations/FeatureDefines.xcconfig:
+
+2012-05-07 Oliver Hunt <oliver@apple.com>
+
+ Fix release build.
+
+ * llint/LLIntSlowPaths.cpp:
+ (JSC::LLInt::LLINT_SLOW_PATH_DECL):
+
+2012-05-07 Oliver Hunt <oliver@apple.com>
+
+ LLInt doesn't check for Ropes when performing a character switch
+ https://bugs.webkit.org/show_bug.cgi?id=85837
+
+ Reviewed by Filip Pizlo.
+
+ Make LLint check if the scrutinee of a char switch is a rope, and if
+ so fall back to a slow case.
+
+ * llint/LLIntSlowPaths.cpp:
+ (JSC::LLInt::LLINT_SLOW_PATH_DECL):
+ (LLInt):
+ * llint/LowLevelInterpreter32_64.asm:
+ * llint/LowLevelInterpreter64.asm:
+
+2012-05-07 Eric Seidel <eric@webkit.org>
+
+ Add ENABLE_IFRAME_SEAMLESS so Apple can turn off SEAMLESS if needed
+ https://bugs.webkit.org/show_bug.cgi?id=85822
+
+ Reviewed by Adam Barth.
+
+ * Configurations/FeatureDefines.xcconfig:
+
2012-05-05 Gavin Barraclough <barraclough@apple.com>
Remove TrustedImm32::m_isPointer
diff --git a/Source/JavaScriptCore/Configurations/FeatureDefines.xcconfig b/Source/JavaScriptCore/Configurations/FeatureDefines.xcconfig
index 2dc145f36..91d688b53 100644
--- a/Source/JavaScriptCore/Configurations/FeatureDefines.xcconfig
+++ b/Source/JavaScriptCore/Configurations/FeatureDefines.xcconfig
@@ -54,6 +54,7 @@ ENABLE_GEOLOCATION = ENABLE_GEOLOCATION;
ENABLE_HIGH_DPI_CANVAS = ENABLE_HIGH_DPI_CANVAS;
ENABLE_ICONDATABASE = $(ENABLE_ICONDATABASE_$(REAL_PLATFORM_NAME));
ENABLE_ICONDATABASE_macosx = ENABLE_ICONDATABASE;
+ENABLE_IFRAME_SEAMLESS = ENABLE_IFRAME_SEAMLESS;
ENABLE_INDEXED_DATABASE = ;
ENABLE_INPUT_SPEECH = ;
ENABLE_INPUT_TYPE_COLOR = ;
@@ -121,4 +122,4 @@ ENABLE_WEB_TIMING = ;
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_CSS_FILTERS) $(ENABLE_CSS_GRID_LAYOUT) $(ENABLE_CSS_SHADERS) $(ENABLE_DASHBOARD_SUPPORT) $(ENABLE_DATALIST) $(ENABLE_DATA_TRANSFER_ITEMS) $(ENABLE_DETAILS) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DIRECTORY_UPLOAD) $(ENABLE_FILE_SYSTEM) $(ENABLE_FILTERS) $(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_NOTIFICATIONS) $(ENABLE_LINK_PREFETCH) $(ENABLE_LINK_PRERENDER) $(ENABLE_MATHML) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_METER_TAG) $(ENABLE_MICRODATA) $(ENABLE_MUTATION_OBSERVERS) $(ENABLE_NOTIFICATIONS) $(ENABLE_PAGE_VISIBILITY_API) $(ENABLE_PROGRESS_TAG) $(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_NOTIFICATIONS_ONLY) $(ENABLE_TOUCH_ICON_LOADING) $(ENABLE_VIDEO) $(ENABLE_VIDEO_TRACK) $(ENABLE_WEBGL) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WEB_TIMING) $(ENABLE_WORKERS) $(ENABLE_XSLT);
+FEATURE_DEFINES = $(ENABLE_3D_RENDERING) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ANIMATION_API) $(ENABLE_BLOB) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CSS_FILTERS) $(ENABLE_CSS_GRID_LAYOUT) $(ENABLE_CSS_SHADERS) $(ENABLE_DASHBOARD_SUPPORT) $(ENABLE_DATALIST) $(ENABLE_DATA_TRANSFER_ITEMS) $(ENABLE_DETAILS) $(ENABLE_DEVICE_ORIENTATION) $(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_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_NOTIFICATIONS) $(ENABLE_LINK_PREFETCH) $(ENABLE_LINK_PRERENDER) $(ENABLE_MATHML) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_METER_TAG) $(ENABLE_MICRODATA) $(ENABLE_MUTATION_OBSERVERS) $(ENABLE_NOTIFICATIONS) $(ENABLE_PAGE_VISIBILITY_API) $(ENABLE_PROGRESS_TAG) $(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_NOTIFICATIONS_ONLY) $(ENABLE_TOUCH_ICON_LOADING) $(ENABLE_VIDEO) $(ENABLE_VIDEO_TRACK) $(ENABLE_WEBGL) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WEB_TIMING) $(ENABLE_WORKERS) $(ENABLE_XSLT);
diff --git a/Source/JavaScriptCore/Configurations/Version.xcconfig b/Source/JavaScriptCore/Configurations/Version.xcconfig
index d7e12df22..9760c9ada 100644
--- a/Source/JavaScriptCore/Configurations/Version.xcconfig
+++ b/Source/JavaScriptCore/Configurations/Version.xcconfig
@@ -21,8 +21,8 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-MAJOR_VERSION = 536;
-MINOR_VERSION = 11;
+MAJOR_VERSION = 537;
+MINOR_VERSION = 1;
TINY_VERSION = 0;
FULL_VERSION = $(MAJOR_VERSION).$(MINOR_VERSION);
diff --git a/Source/JavaScriptCore/GNUmakefile.am b/Source/JavaScriptCore/GNUmakefile.am
index e84528763..1ad42fd1c 100644
--- a/Source/JavaScriptCore/GNUmakefile.am
+++ b/Source/JavaScriptCore/GNUmakefile.am
@@ -7,7 +7,7 @@ lib_LTLIBRARIES += \
# https://bugs.webkit.org/show_bug.cgi?id=27551 is fixed we'll able to
# simply rely on the usual symbol visibility flags.
libjavascriptcoregtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_LDFLAGS = \
- -version-info @LIBWEBKITGTK_VERSION@ \
+ -version-info @LIBJAVASCRIPTCOREGTK_VERSION@ \
$(no_undefined)
nodist_EXTRA_libjavascriptcoregtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_SOURCES = \
diff --git a/Source/JavaScriptCore/GNUmakefile.list.am b/Source/JavaScriptCore/GNUmakefile.list.am
index 1b59db10c..7b3167aa1 100644
--- a/Source/JavaScriptCore/GNUmakefile.list.am
+++ b/Source/JavaScriptCore/GNUmakefile.list.am
@@ -3,11 +3,8 @@ javascriptcore_h_api += \
Source/JavaScriptCore/API/JSContextRef.h \
Source/JavaScriptCore/API/JSObjectRef.h \
Source/JavaScriptCore/API/JSStringRef.h \
- Source/JavaScriptCore/API/JSStringRefBSTR.h \
- Source/JavaScriptCore/API/JSStringRefCF.h \
Source/JavaScriptCore/API/JSValueRef.h \
Source/JavaScriptCore/API/JavaScript.h \
- Source/JavaScriptCore/API/JavaScriptCore.h \
Source/JavaScriptCore/API/WebKitAvailability.h
javascriptcore_built_nosources += \
@@ -273,13 +270,11 @@ javascriptcore_sources += \
Source/JavaScriptCore/debugger/Debugger.h \
Source/JavaScriptCore/ForwardingHeaders/JavaScriptCore/APICast.h \
Source/JavaScriptCore/ForwardingHeaders/JavaScriptCore/APIShims.h \
- Source/JavaScriptCore/ForwardingHeaders/JavaScriptCore/JavaScriptCore.h \
Source/JavaScriptCore/ForwardingHeaders/JavaScriptCore/JavaScript.h \
Source/JavaScriptCore/ForwardingHeaders/JavaScriptCore/JSBase.h \
Source/JavaScriptCore/ForwardingHeaders/JavaScriptCore/JSContextRef.h \
Source/JavaScriptCore/ForwardingHeaders/JavaScriptCore/JSObjectRef.h \
Source/JavaScriptCore/ForwardingHeaders/JavaScriptCore/JSRetainPtr.h \
- Source/JavaScriptCore/ForwardingHeaders/JavaScriptCore/JSStringRefCF.h \
Source/JavaScriptCore/ForwardingHeaders/JavaScriptCore/JSStringRef.h \
Source/JavaScriptCore/ForwardingHeaders/JavaScriptCore/JSValueRef.h \
Source/JavaScriptCore/ForwardingHeaders/JavaScriptCore/OpaqueJSString.h \
diff --git a/Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def b/Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def
index bae50e204..951f85186 100755
--- a/Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def
+++ b/Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def
@@ -62,6 +62,7 @@ EXPORTS
?addSlowCase@Identifier@JSC@@CA?AV?$PassRefPtr@VStringImpl@WTF@@@WTF@@PAVExecState@2@PAVStringImpl@4@@Z
?addSlowCase@Identifier@JSC@@CA?AV?$PassRefPtr@VStringImpl@WTF@@@WTF@@PAVJSGlobalData@2@PAVStringImpl@4@@Z
?addStaticGlobals@JSGlobalObject@JSC@@IAEXPAUGlobalPropertyInfo@12@H@Z
+ ?allocatePropertyStorage@JSObject@JSC@@QAEXAAVJSGlobalData@2@II@Z
?allocateSlowCase@MarkedAllocator@JSC@@AAEPAXXZ
?append@StringBuilder@WTF@@QAEXPBEI@Z
?append@StringBuilder@WTF@@QAEXPB_WI@Z
@@ -209,7 +210,6 @@ EXPORTS
?globalExec@JSGlobalObject@JSC@@QAEPAVExecState@2@XZ
?globalObjectCount@Heap@JSC@@QAEIXZ
?grow@HandleSet@JSC@@AAEXXZ
- ?growPropertyStorage@JSObject@JSC@@QAEPAV?$WriteBarrierBase@W4Unknown@JSC@@@2@AAVJSGlobalData@2@II@Z
?hasInstance@JSObject@JSC@@SA_NPAV12@PAVExecState@2@VJSValue@2@2@Z
?hasProperty@JSObject@JSC@@QBE_NPAVExecState@2@ABVIdentifier@2@@Z
?hasProperty@JSObject@JSC@@QBE_NPAVExecState@2@I@Z
@@ -320,7 +320,6 @@ EXPORTS
?stopProfiling@Profiler@JSC@@QAE?AV?$PassRefPtr@VProfile@JSC@@@WTF@@PAVExecState@2@ABVUString@2@@Z
?stopSampling@JSGlobalData@JSC@@QAEXXZ
?substringSharingImpl@UString@JSC@@QBE?AV12@II@Z
- ?suggestedNewPropertyStorageSize@Structure@JSC@@QAEIXZ
?symbolTableGet@JSVariableObject@JSC@@IAE_NABVIdentifier@2@AAVPropertyDescriptor@2@@Z
?synthesizePrototype@JSValue@JSC@@QBEPAVJSObject@2@PAVExecState@2@@Z
?thisObject@DebuggerCallFrame@JSC@@QBEPAVJSObject@2@XZ
diff --git a/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj b/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
index d5cf8dedc..c5a5b63be 100644
--- a/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
+++ b/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
@@ -1041,6 +1041,9 @@
86880F4C14353B2100B08D42 /* DFGSpeculativeJIT64.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DFGSpeculativeJIT64.cpp; path = dfg/DFGSpeculativeJIT64.cpp; sourceTree = "<group>"; };
869D04AE1193B54D00803475 /* CachedTranscendentalFunction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CachedTranscendentalFunction.h; sourceTree = "<group>"; };
869EBCB60E8C6D4A008722CC /* ResultType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ResultType.h; sourceTree = "<group>"; };
+ 86A054461556451B00445157 /* LowLevelInterpreter.asm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm.asm; name = LowLevelInterpreter.asm; path = llint/LowLevelInterpreter.asm; sourceTree = "<group>"; };
+ 86A054471556451B00445157 /* LowLevelInterpreter32_64.asm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm.asm; name = LowLevelInterpreter32_64.asm; path = llint/LowLevelInterpreter32_64.asm; sourceTree = "<group>"; };
+ 86A054481556451B00445157 /* LowLevelInterpreter64.asm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm.asm; name = LowLevelInterpreter64.asm; path = llint/LowLevelInterpreter64.asm; sourceTree = "<group>"; };
86A90ECF0EE7D51F00AB350D /* JITArithmetic.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JITArithmetic.cpp; sourceTree = "<group>"; };
86ADD1430FDDEA980006EEC2 /* ARMv7Assembler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ARMv7Assembler.h; sourceTree = "<group>"; };
86ADD1440FDDEA980006EEC2 /* MacroAssemblerARMv7.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MacroAssemblerARMv7.h; sourceTree = "<group>"; };
@@ -1430,7 +1433,6 @@
45E12D8806A49B0F00E9DF84 /* jsc.cpp */,
A767FF9F14F4502900789059 /* JSCTypedArrayStubs.h */,
F68EBB8C0255D4C601FF60F7 /* config.h */,
- 0F46809C14BA7F4D00BFE272 /* llint */,
1432EBD70A34CAD400717B9F /* API */,
9688CB120ED12B4E001D649F /* assembler */,
969A078F0ED1D3AE00F1F681 /* bytecode */,
@@ -1440,6 +1442,7 @@
142E312A134FF0A600AFADB5 /* heap */,
1429D77A0ED20D7300B89619 /* interpreter */,
1429D92C0ED22D7000B89619 /* jit */,
+ 0F46809C14BA7F4D00BFE272 /* llint */,
7E39D8370EC3A388003AF11A /* parser */,
95AB831A0DA42C6900BC83F3 /* profiler */,
7EF6E0BB0EB7A1EC0079AFAF /* runtime */,
@@ -1489,6 +1492,9 @@
0F46809F14BA7F8200BFE272 /* LLIntSlowPaths.cpp */,
0F4680A014BA7F8200BFE272 /* LLIntSlowPaths.h */,
0F4680A114BA7F8200BFE272 /* LLIntOffsetsExtractor.cpp */,
+ 86A054461556451B00445157 /* LowLevelInterpreter.asm */,
+ 86A054471556451B00445157 /* LowLevelInterpreter32_64.asm */,
+ 86A054481556451B00445157 /* LowLevelInterpreter64.asm */,
);
name = llint;
sourceTree = "<group>";
diff --git a/Source/JavaScriptCore/bytecode/CodeBlock.cpp b/Source/JavaScriptCore/bytecode/CodeBlock.cpp
index 7b828acab..6a4d073bf 100644
--- a/Source/JavaScriptCore/bytecode/CodeBlock.cpp
+++ b/Source/JavaScriptCore/bytecode/CodeBlock.cpp
@@ -512,15 +512,9 @@ void CodeBlock::dump(ExecState* exec, const Vector<Instruction>::const_iterator&
dataLog("[%4d] init_lazy_reg\t %s\n", location, registerName(exec, r0).data());
break;
}
- case op_get_callee: {
- int r0 = (++it)->u.operand;
- dataLog("[%4d] op_get_callee %s\n", location, registerName(exec, r0).data());
- break;
- }
case op_create_this: {
int r0 = (++it)->u.operand;
- int r1 = (++it)->u.operand;
- dataLog("[%4d] create_this %s %s\n", location, registerName(exec, r0).data(), registerName(exec, r1).data());
+ dataLog("[%4d] create_this %s\n", location, registerName(exec, r0).data());
break;
}
case op_convert_this: {
diff --git a/Source/JavaScriptCore/bytecode/Opcode.h b/Source/JavaScriptCore/bytecode/Opcode.h
index a564de2da..ebf15bbd4 100644
--- a/Source/JavaScriptCore/bytecode/Opcode.h
+++ b/Source/JavaScriptCore/bytecode/Opcode.h
@@ -42,8 +42,7 @@ namespace JSC {
macro(op_create_activation, 2) \
macro(op_init_lazy_reg, 2) \
macro(op_create_arguments, 2) \
- macro(op_create_this, 3) \
- macro(op_get_callee, 2) \
+ macro(op_create_this, 2) \
macro(op_convert_this, 2) \
\
macro(op_new_object, 2) \
diff --git a/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp b/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp
index a520a4c78..b12bf40dc 100644
--- a/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp
+++ b/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp
@@ -442,17 +442,8 @@ BytecodeGenerator::BytecodeGenerator(FunctionBodyNode* functionBody, ScopeChainN
preserveLastVar();
if (isConstructor()) {
- RefPtr<RegisterID> func = newTemporary();
- RefPtr<RegisterID> funcProto = newTemporary();
-
- emitOpcode(op_get_callee);
- instructions().append(func->index());
- // Load prototype.
- emitGetById(funcProto.get(), func.get(), globalData()->propertyNames->prototype);
-
emitOpcode(op_create_this);
instructions().append(m_thisRegister.index());
- instructions().append(funcProto->index());
} else if (!codeBlock->isStrictMode() && (functionBody->usesThis() || codeBlock->usesEval() || m_shouldEmitDebugHooks)) {
emitOpcode(op_convert_this);
instructions().append(m_thisRegister.index());
diff --git a/Source/JavaScriptCore/dfg/DFGAbstractState.cpp b/Source/JavaScriptCore/dfg/DFGAbstractState.cpp
index 6df40ca6f..3eb5463a7 100644
--- a/Source/JavaScriptCore/dfg/DFGAbstractState.cpp
+++ b/Source/JavaScriptCore/dfg/DFGAbstractState.cpp
@@ -774,19 +774,16 @@ bool AbstractState::execute(unsigned indexInBlock)
destination.merge(PredictObjectOther);
break;
}
-
+
case CreateThis: {
- Node& child = m_graph[node.child1()];
AbstractValue& source = forNode(node.child1());
AbstractValue& destination = forNode(nodeIndex);
- if (child.shouldSpeculateFinalObject())
- source.filter(PredictFinalObject);
-
+ source.filter(PredictFunction);
destination.set(PredictFinalObject);
break;
}
-
+
case NewObject:
forNode(nodeIndex).set(m_codeBlock->globalObjectFor(node.codeOrigin)->emptyObjectStructure());
m_haveStructures = true;
diff --git a/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp b/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp
index 7a2d7bdee..cc756c61e 100644
--- a/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp
+++ b/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp
@@ -1534,8 +1534,10 @@ bool ByteCodeParser::parseBlock(unsigned limit)
}
case op_create_this: {
- NodeIndex op1 = get(currentInstruction[2].u.operand);
- set(currentInstruction[1].u.operand, addToGraph(CreateThis, op1));
+ if (m_inlineStackTop->m_inlineCallFrame)
+ set(currentInstruction[1].u.operand, addToGraph(CreateThis, getDirect(m_inlineStackTop->m_calleeVR)));
+ else
+ set(currentInstruction[1].u.operand, addToGraph(CreateThis, addToGraph(GetCallee)));
NEXT_OPCODE(op_create_this);
}
@@ -1565,14 +1567,6 @@ bool ByteCodeParser::parseBlock(unsigned limit)
NEXT_OPCODE(op_new_regexp);
}
- case op_get_callee: {
- if (m_inlineStackTop->m_inlineCallFrame)
- set(currentInstruction[1].u.operand, getDirect(m_inlineStackTop->m_calleeVR));
- else
- set(currentInstruction[1].u.operand, addToGraph(GetCallee));
- NEXT_OPCODE(op_get_callee);
- }
-
// === Bitwise operations ===
case op_bitand: {
diff --git a/Source/JavaScriptCore/dfg/DFGCapabilities.h b/Source/JavaScriptCore/dfg/DFGCapabilities.h
index b807979ba..8aae85ef7 100644
--- a/Source/JavaScriptCore/dfg/DFGCapabilities.h
+++ b/Source/JavaScriptCore/dfg/DFGCapabilities.h
@@ -73,7 +73,6 @@ inline bool canCompileOpcode(OpcodeID opcodeID)
case op_enter:
case op_convert_this:
case op_create_this:
- case op_get_callee:
case op_bitand:
case op_bitor:
case op_bitxor:
diff --git a/Source/JavaScriptCore/dfg/DFGOperations.cpp b/Source/JavaScriptCore/dfg/DFGOperations.cpp
index 0e6e2f972..dfaf5dfe8 100644
--- a/Source/JavaScriptCore/dfg/DFGOperations.cpp
+++ b/Source/JavaScriptCore/dfg/DFGOperations.cpp
@@ -209,39 +209,17 @@ EncodedJSValue DFG_OPERATION operationConvertThis(ExecState* exec, EncodedJSValu
return JSValue::encode(JSValue::decode(encodedOp).toThisObject(exec));
}
-inline JSCell* createThis(ExecState* exec, JSCell* prototype, JSFunction* constructor)
-{
-#if !ASSERT_DISABLED
- ConstructData constructData;
- ASSERT(constructor->methodTable()->getConstructData(constructor, constructData) == ConstructTypeJS);
-#endif
-
- JSGlobalData& globalData = exec->globalData();
- NativeCallFrameTracer tracer(&globalData, exec);
-
- Structure* structure;
- if (prototype->isObject())
- structure = asObject(prototype)->inheritorID(globalData);
- else
- structure = constructor->scope()->globalObject->emptyObjectStructure();
-
- return constructEmptyObject(exec, structure);
-}
-
-JSCell* DFG_OPERATION operationCreateThis(ExecState* exec, JSCell* prototype)
+JSCell* DFG_OPERATION operationCreateThis(ExecState* exec, JSCell* constructor)
{
JSGlobalData* globalData = &exec->globalData();
NativeCallFrameTracer tracer(globalData, exec);
- return createThis(exec, prototype, jsCast<JSFunction*>(exec->callee()));
-}
-
-JSCell* DFG_OPERATION operationCreateThisInlined(ExecState* exec, JSCell* prototype, JSCell* constructor)
-{
- JSGlobalData* globalData = &exec->globalData();
- NativeCallFrameTracer tracer(globalData, exec);
+#if !ASSERT_DISABLED
+ ConstructData constructData;
+ ASSERT(jsCast<JSFunction*>(constructor)->methodTable()->getConstructData(jsCast<JSFunction*>(constructor), constructData) == ConstructTypeJS);
+#endif
- return createThis(exec, prototype, jsCast<JSFunction*>(constructor));
+ return constructEmptyObject(exec, jsCast<JSFunction*>(constructor)->cachedInheritorID(exec));
}
JSCell* DFG_OPERATION operationNewObject(ExecState* exec)
diff --git a/Source/JavaScriptCore/dfg/DFGOperations.h b/Source/JavaScriptCore/dfg/DFGOperations.h
index 52e99cb95..601ed7665 100644
--- a/Source/JavaScriptCore/dfg/DFGOperations.h
+++ b/Source/JavaScriptCore/dfg/DFGOperations.h
@@ -97,8 +97,7 @@ typedef void* DFG_OPERATION (*P_DFGOperation_E)(ExecState*);
// These routines are provide callbacks out to C++ implementations of operations too complex to JIT.
JSCell* DFG_OPERATION operationNewObject(ExecState*);
-JSCell* DFG_OPERATION operationCreateThis(ExecState*, JSCell* encodedOp1);
-JSCell* DFG_OPERATION operationCreateThisInlined(ExecState*, JSCell* encodedOp1, JSCell* constructor);
+JSCell* DFG_OPERATION operationCreateThis(ExecState*, JSCell* constructor);
EncodedJSValue DFG_OPERATION operationConvertThis(ExecState*, EncodedJSValue encodedOp1);
EncodedJSValue DFG_OPERATION operationValueAdd(ExecState*, EncodedJSValue encodedOp1, EncodedJSValue encodedOp2);
EncodedJSValue DFG_OPERATION operationValueAddNotNumber(ExecState*, EncodedJSValue encodedOp1, EncodedJSValue encodedOp2);
diff --git a/Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp b/Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp
index c156e81d0..05c418d1e 100644
--- a/Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp
+++ b/Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp
@@ -3029,32 +3029,17 @@ void SpeculativeJIT::compile(Node& node)
// then we speculate because we want to get recompiled if it isn't (since
// otherwise we'd start taking slow path a lot).
- SpeculateCellOperand proto(this, node.child1());
+ SpeculateCellOperand callee(this, node.child1());
GPRTemporary result(this);
GPRTemporary scratch(this);
- GPRReg protoGPR = proto.gpr();
+ GPRReg calleeGPR = callee.gpr();
GPRReg resultGPR = result.gpr();
GPRReg scratchGPR = scratch.gpr();
- proto.use();
-
+ // Load the inheritorID. If the inheritorID is not set, go to slow path.
+ m_jit.loadPtr(MacroAssembler::Address(calleeGPR, JSFunction::offsetOfCachedInheritorID()), scratchGPR);
MacroAssembler::JumpList slowPath;
-
- // Need to verify that the prototype is an object. If we have reason to believe
- // that it's a FinalObject then we speculate on that directly. Otherwise we
- // do the slow (structure-based) check.
- if (at(node.child1()).shouldSpeculateFinalObject()) {
- if (!isFinalObjectPrediction(m_state.forNode(node.child1()).m_type))
- speculationCheck(BadType, JSValueSource::unboxedCell(protoGPR), node.child1(), m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(protoGPR, JSCell::classInfoOffset()), MacroAssembler::TrustedImmPtr(&JSFinalObject::s_info)));
- } else {
- m_jit.loadPtr(MacroAssembler::Address(protoGPR, JSCell::structureOffset()), scratchGPR);
- slowPath.append(m_jit.branch8(MacroAssembler::Below, MacroAssembler::Address(scratchGPR, Structure::typeInfoTypeOffset()), MacroAssembler::TrustedImm32(ObjectType)));
- }
-
- // Load the inheritorID (the Structure that objects who have protoGPR as the prototype
- // use to refer to that prototype). If the inheritorID is not set, go to slow path.
- m_jit.loadPtr(MacroAssembler::Address(protoGPR, JSObject::offsetOfInheritorID()), scratchGPR);
slowPath.append(m_jit.branchTestPtr(MacroAssembler::Zero, scratchGPR));
emitAllocateJSFinalObject(scratchGPR, resultGPR, scratchGPR, slowPath);
@@ -3064,15 +3049,12 @@ void SpeculativeJIT::compile(Node& node)
slowPath.link(&m_jit);
silentSpillAllRegisters(resultGPR);
- if (node.codeOrigin.inlineCallFrame)
- callOperation(operationCreateThisInlined, resultGPR, protoGPR, node.codeOrigin.inlineCallFrame->callee.get());
- else
- callOperation(operationCreateThis, resultGPR, protoGPR);
+ callOperation(operationCreateThis, resultGPR, calleeGPR);
silentFillAllRegisters(resultGPR);
done.link(&m_jit);
- cellResult(resultGPR, m_compileIndex, UseChildrenCalledExplicitly);
+ cellResult(resultGPR, m_compileIndex);
break;
}
diff --git a/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp b/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp
index a46f8f262..08e7d966d 100644
--- a/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp
+++ b/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp
@@ -3053,32 +3053,17 @@ void SpeculativeJIT::compile(Node& node)
// then we speculate because we want to get recompiled if it isn't (since
// otherwise we'd start taking slow path a lot).
- SpeculateCellOperand proto(this, node.child1());
+ SpeculateCellOperand callee(this, node.child1());
GPRTemporary result(this);
GPRTemporary scratch(this);
- GPRReg protoGPR = proto.gpr();
+ GPRReg calleeGPR = callee.gpr();
GPRReg resultGPR = result.gpr();
GPRReg scratchGPR = scratch.gpr();
- proto.use();
-
+ // Load the inheritorID. If the inheritorID is not set, go to slow path.
+ m_jit.loadPtr(MacroAssembler::Address(calleeGPR, JSFunction::offsetOfCachedInheritorID()), scratchGPR);
MacroAssembler::JumpList slowPath;
-
- // Need to verify that the prototype is an object. If we have reason to believe
- // that it's a FinalObject then we speculate on that directly. Otherwise we
- // do the slow (structure-based) check.
- if (at(node.child1()).shouldSpeculateFinalObject()) {
- if (!isFinalObjectPrediction(m_state.forNode(node.child1()).m_type))
- speculationCheck(BadType, JSValueRegs(protoGPR), node.child1(), m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(protoGPR, JSCell::classInfoOffset()), MacroAssembler::TrustedImmPtr(&JSFinalObject::s_info)));
- } else {
- m_jit.loadPtr(MacroAssembler::Address(protoGPR, JSCell::structureOffset()), scratchGPR);
- slowPath.append(m_jit.branch8(MacroAssembler::Below, MacroAssembler::Address(scratchGPR, Structure::typeInfoTypeOffset()), MacroAssembler::TrustedImm32(ObjectType)));
- }
-
- // Load the inheritorID (the Structure that objects who have protoGPR as the prototype
- // use to refer to that prototype). If the inheritorID is not set, go to slow path.
- m_jit.loadPtr(MacroAssembler::Address(protoGPR, JSObject::offsetOfInheritorID()), scratchGPR);
slowPath.append(m_jit.branchTestPtr(MacroAssembler::Zero, scratchGPR));
emitAllocateJSFinalObject(scratchGPR, resultGPR, scratchGPR, slowPath);
@@ -3088,15 +3073,12 @@ void SpeculativeJIT::compile(Node& node)
slowPath.link(&m_jit);
silentSpillAllRegisters(resultGPR);
- if (node.codeOrigin.inlineCallFrame)
- callOperation(operationCreateThisInlined, resultGPR, protoGPR, node.codeOrigin.inlineCallFrame->callee.get());
- else
- callOperation(operationCreateThis, resultGPR, protoGPR);
+ callOperation(operationCreateThis, resultGPR, calleeGPR);
silentFillAllRegisters(resultGPR);
done.link(&m_jit);
- cellResult(resultGPR, m_compileIndex, UseChildrenCalledExplicitly);
+ cellResult(resultGPR, m_compileIndex);
break;
}
diff --git a/Source/JavaScriptCore/heap/CopiedSpace.cpp b/Source/JavaScriptCore/heap/CopiedSpace.cpp
index 063ea65a2..d52c4e756 100644
--- a/Source/JavaScriptCore/heap/CopiedSpace.cpp
+++ b/Source/JavaScriptCore/heap/CopiedSpace.cpp
@@ -183,6 +183,9 @@ void CopiedSpace::doneCopying()
CopiedBlock* block = static_cast<CopiedBlock*>(m_fromSpace->removeHead());
if (block->m_isPinned) {
block->m_isPinned = false;
+ // We don't add the block to the toSpaceSet because it was never removed.
+ ASSERT(m_toSpaceSet.contains(block));
+ m_toSpaceFilter.add(reinterpret_cast<Bits>(block));
m_toSpace->push(block);
continue;
}
@@ -212,10 +215,10 @@ void CopiedSpace::doneCopying()
CheckedBoolean CopiedSpace::getFreshBlock(AllocationEffort allocationEffort, CopiedBlock** outBlock)
{
CopiedBlock* block = 0;
- if (HeapBlock* heapBlock = m_heap->blockAllocator().allocate())
- block = new (NotNull, heapBlock) CopiedBlock(heapBlock->m_allocation);
- else if (allocationEffort == AllocationMustSucceed) {
- if (!allocateNewBlock(&block)) {
+ if (allocationEffort == AllocationMustSucceed) {
+ if (HeapBlock* heapBlock = m_heap->blockAllocator().allocate())
+ block = new (NotNull, heapBlock) CopiedBlock(heapBlock->m_allocation);
+ else if (!allocateNewBlock(&block)) {
*outBlock = 0;
ASSERT_NOT_REACHED();
return false;
diff --git a/Source/JavaScriptCore/heap/Heap.cpp b/Source/JavaScriptCore/heap/Heap.cpp
index d0dbc3172..d43ec1242 100644
--- a/Source/JavaScriptCore/heap/Heap.cpp
+++ b/Source/JavaScriptCore/heap/Heap.cpp
@@ -656,6 +656,9 @@ void Heap::markRoots(bool fullGC)
visitor.doneCopying();
visitor.reset();
m_sharedData.reset();
+#if ENABLE(PARALLEL_GC)
+ m_sharedData.resetChildren();
+#endif
m_storageSpace.doneCopying();
m_operationInProgress = NoOperation;
diff --git a/Source/JavaScriptCore/heap/MarkStack.cpp b/Source/JavaScriptCore/heap/MarkStack.cpp
index cf6e3513c..785444e55 100644
--- a/Source/JavaScriptCore/heap/MarkStack.cpp
+++ b/Source/JavaScriptCore/heap/MarkStack.cpp
@@ -36,6 +36,7 @@
#include "JSObject.h"
#include "ScopeChain.h"
#include "Structure.h"
+#include "UString.h"
#include "WriteBarrier.h"
#include <wtf/MainThread.h>
@@ -218,17 +219,24 @@ void MarkStackArray::stealSomeCellsFrom(MarkStackArray& other)
}
#if ENABLE(PARALLEL_GC)
-void MarkStackThreadSharedData::markingThreadMain()
+void MarkStackThreadSharedData::resetChildren()
+{
+ for (unsigned i = 0; i < m_slaveMarkStacks.size(); ++i)
+ m_slaveMarkStacks[i]->reset();
+}
+
+void MarkStackThreadSharedData::markingThreadMain(SlotVisitor* slotVisitor)
{
WTF::registerGCThread();
- SlotVisitor slotVisitor(*this);
- ParallelModeEnabler enabler(slotVisitor);
- slotVisitor.drainFromShared(SlotVisitor::SlaveDrain);
+ ParallelModeEnabler enabler(*slotVisitor);
+ slotVisitor->drainFromShared(SlotVisitor::SlaveDrain);
+ delete slotVisitor;
}
-void MarkStackThreadSharedData::markingThreadStartFunc(void* shared)
+void MarkStackThreadSharedData::markingThreadStartFunc(void* myVisitor)
{
- static_cast<MarkStackThreadSharedData*>(shared)->markingThreadMain();
+ SlotVisitor* slotVisitor = static_cast<SlotVisitor*>(myVisitor);
+ slotVisitor->sharedData().markingThreadMain(slotVisitor);
}
#endif
@@ -241,7 +249,9 @@ MarkStackThreadSharedData::MarkStackThreadSharedData(JSGlobalData* globalData)
{
#if ENABLE(PARALLEL_GC)
for (unsigned i = 1; i < Options::numberOfGCMarkers; ++i) {
- m_markingThreads.append(createThread(markingThreadStartFunc, this, "JavaScriptCore::Marking"));
+ SlotVisitor* slotVisitor = new SlotVisitor(*this);
+ m_slaveMarkStacks.append(slotVisitor);
+ m_markingThreads.append(createThread(markingThreadStartFunc, slotVisitor, "JavaScriptCore::Marking"));
ASSERT(m_markingThreads.last());
}
#endif
@@ -273,7 +283,6 @@ void MarkStackThreadSharedData::reset()
#else
ASSERT(m_opaqueRoots.isEmpty());
#endif
-
m_weakReferenceHarvesters.removeAll();
}
@@ -286,6 +295,7 @@ void MarkStack::reset()
#else
m_opaqueRoots.clear();
#endif
+ m_uniqueStrings.clear();
}
void MarkStack::append(ConservativeRoots& conservativeRoots)
@@ -486,6 +496,34 @@ void* SlotVisitor::allocateNewSpace(void* ptr, size_t bytes)
return CopiedSpace::allocateFromBlock(m_copyBlock, bytes);
}
+inline void MarkStack::internalAppend(JSValue* slot)
+{
+ ASSERT(slot);
+ JSValue value = *slot;
+ ASSERT(value);
+ if (!value.isCell())
+ return;
+
+ if (value.isString()) {
+ JSString* string = jsCast<JSString*>(value.asCell());
+ if (!string->isHashConstSingleton() && string->length() > 1 && !string->isRope()) {
+ UniqueStringMap::AddResult addResult = m_uniqueStrings.add(string->string().impl(), value);
+ if (addResult.isNewEntry)
+ string->setHashConstSingleton();
+ else {
+ JSValue existingJSValue = addResult.iterator->second;
+ if (value != existingJSValue)
+ jsCast<JSString*>(existingJSValue.asCell())->clearHashConstSingleton();
+ *slot = existingJSValue;
+ return;
+ }
+ }
+ }
+
+ internalAppend(value.asCell());
+}
+
+
void SlotVisitor::copyAndAppend(void** ptr, size_t bytes, JSValue* values, unsigned length)
{
void* oldPtr = *ptr;
@@ -499,7 +537,7 @@ void SlotVisitor::copyAndAppend(void** ptr, size_t bytes, JSValue* values, unsig
newValues[i] = value;
if (!value)
continue;
- internalAppend(value);
+ internalAppend(&newValues[i]);
}
memcpy(newPtr, oldPtr, jsValuesOffset);
diff --git a/Source/JavaScriptCore/heap/MarkStack.h b/Source/JavaScriptCore/heap/MarkStack.h
index 0695b1b32..48b65c069 100644
--- a/Source/JavaScriptCore/heap/MarkStack.h
+++ b/Source/JavaScriptCore/heap/MarkStack.h
@@ -34,12 +34,14 @@
#include "UnconditionalFinalizer.h"
#include "VTableSpectrum.h"
#include "WeakReferenceHarvester.h"
+#include <wtf/Forward.h>
#include <wtf/HashMap.h>
#include <wtf/HashSet.h>
#include <wtf/Vector.h>
#include <wtf/Noncopyable.h>
#include <wtf/OSAllocator.h>
#include <wtf/PageBlock.h>
+#include <wtf/text/StringHash.h>
namespace JSC {
@@ -171,13 +173,17 @@ namespace JSC {
~MarkStackThreadSharedData();
void reset();
-
+
+#if ENABLE(PARALLEL_GC)
+ void resetChildren();
+#endif
+
private:
friend class MarkStack;
friend class SlotVisitor;
#if ENABLE(PARALLEL_GC)
- void markingThreadMain();
+ void markingThreadMain(SlotVisitor*);
static void markingThreadStartFunc(void* heap);
#endif
@@ -187,6 +193,7 @@ namespace JSC {
MarkStackSegmentAllocator m_segmentAllocator;
Vector<ThreadIdentifier> m_markingThreads;
+ Vector<MarkStack*> m_slaveMarkStacks;
Mutex m_markingLock;
ThreadCondition m_markingCondition;
@@ -221,13 +228,14 @@ namespace JSC {
void addOpaqueRoot(void*);
bool containsOpaqueRoot(void*);
int opaqueRootCount();
-
+
+ MarkStackThreadSharedData& sharedData() { return m_shared; }
bool isEmpty() { return m_stack.isEmpty(); }
void reset();
size_t visitCount() const { return m_visitCount; }
-
+
#if ENABLE(SIMPLE_HEAP_PROFILING)
VTableSpectrum m_visitedTypeCounts;
#endif
@@ -251,6 +259,7 @@ namespace JSC {
void internalAppend(JSCell*);
void internalAppend(JSValue);
+ void internalAppend(JSValue*);
JS_EXPORT_PRIVATE void mergeOpaqueRoots();
@@ -270,6 +279,8 @@ namespace JSC {
MarkStackArray m_stack;
HashSet<void*> m_opaqueRoots; // Handle-owning data structures not visible to the garbage collector.
+ typedef HashMap<StringImpl*, JSValue> UniqueStringMap;
+ UniqueStringMap m_uniqueStrings;
#if !ASSERT_DISABLED
public:
diff --git a/Source/JavaScriptCore/heap/MarkedAllocator.cpp b/Source/JavaScriptCore/heap/MarkedAllocator.cpp
index b5e5fff77..01f00c376 100644
--- a/Source/JavaScriptCore/heap/MarkedAllocator.cpp
+++ b/Source/JavaScriptCore/heap/MarkedAllocator.cpp
@@ -68,44 +68,30 @@ void* MarkedAllocator::allocateSlowCase()
if (LIKELY(result != 0))
return result;
- AllocationEffort allocationEffort;
-
- if (m_heap->shouldCollect())
- allocationEffort = AllocationCanFail;
- else
- allocationEffort = AllocationMustSucceed;
-
- MarkedBlock* block = allocateBlock(allocationEffort);
- if (block) {
- addBlock(block);
- void* result = tryAllocate();
- ASSERT(result);
- return result;
+ if (m_heap->shouldCollect()) {
+ m_heap->collect(Heap::DoNotSweep);
+
+ result = tryAllocate();
+ if (result)
+ return result;
}
-
- m_heap->collect(Heap::DoNotSweep);
-
- result = tryAllocate();
-
- if (result)
- return result;
-
+
ASSERT(!m_heap->shouldCollect());
- addBlock(allocateBlock(AllocationMustSucceed));
-
+ MarkedBlock* block = allocateBlock();
+ ASSERT(block);
+ addBlock(block);
+
result = tryAllocate();
ASSERT(result);
return result;
}
-MarkedBlock* MarkedAllocator::allocateBlock(AllocationEffort allocationEffort)
+MarkedBlock* MarkedAllocator::allocateBlock()
{
MarkedBlock* block = static_cast<MarkedBlock*>(m_heap->blockAllocator().allocate());
if (block)
block = MarkedBlock::recycle(block, m_heap, m_cellSize, m_cellsNeedDestruction);
- else if (allocationEffort == AllocationCanFail)
- return 0;
else
block = MarkedBlock::create(m_heap, m_cellSize, m_cellsNeedDestruction);
diff --git a/Source/JavaScriptCore/heap/MarkedAllocator.h b/Source/JavaScriptCore/heap/MarkedAllocator.h
index 8ad7e925f..8b3620f08 100644
--- a/Source/JavaScriptCore/heap/MarkedAllocator.h
+++ b/Source/JavaScriptCore/heap/MarkedAllocator.h
@@ -41,7 +41,7 @@ private:
JS_EXPORT_PRIVATE void* allocateSlowCase();
void* tryAllocate();
void* tryAllocateHelper();
- MarkedBlock* allocateBlock(AllocationEffort);
+ MarkedBlock* allocateBlock();
MarkedBlock::FreeList m_freeList;
MarkedBlock* m_currentBlock;
diff --git a/Source/JavaScriptCore/interpreter/Interpreter.cpp b/Source/JavaScriptCore/interpreter/Interpreter.cpp
index 1cd5719ff..89547f40a 100644
--- a/Source/JavaScriptCore/interpreter/Interpreter.cpp
+++ b/Source/JavaScriptCore/interpreter/Interpreter.cpp
@@ -2448,7 +2448,7 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi
JSValue dividend = callFrame->r(vPC[2].u.operand).jsValue();
JSValue divisor = callFrame->r(vPC[3].u.operand).jsValue();
- if (dividend.isInt32() && divisor.isInt32() && divisor.asInt32() != 0) {
+ if (dividend.isInt32() && divisor.isInt32() && divisor.asInt32() != 0 && divisor.asInt32() != -1) {
JSValue result = jsNumber(dividend.asInt32() % divisor.asInt32());
ASSERT(result);
callFrame->uncheckedR(dst) = result;
@@ -4788,17 +4788,6 @@ skip_id_custom_self:
vPC += OPCODE_LENGTH(op_create_activation);
NEXT_INSTRUCTION();
}
- DEFINE_OPCODE(op_get_callee) {
- /* op_get_callee callee(r)
-
- Move callee into a register.
- */
-
- callFrame->uncheckedR(vPC[1].u.operand) = JSValue(callFrame->callee());
-
- vPC += OPCODE_LENGTH(op_get_callee);
- NEXT_INSTRUCTION();
- }
DEFINE_OPCODE(op_create_this) {
/* op_create_this this(r) proto(r)
@@ -4809,7 +4798,6 @@ skip_id_custom_self:
*/
int thisRegister = vPC[1].u.operand;
- int protoRegister = vPC[2].u.operand;
JSFunction* constructor = jsCast<JSFunction*>(callFrame->callee());
#if !ASSERT_DISABLED
@@ -4817,12 +4805,7 @@ skip_id_custom_self:
ASSERT(constructor->methodTable()->getConstructData(constructor, constructData) == ConstructTypeJS);
#endif
- Structure* structure;
- JSValue proto = callFrame->r(protoRegister).jsValue();
- if (proto.isObject())
- structure = asObject(proto)->inheritorID(callFrame->globalData());
- else
- structure = constructor->scope()->globalObject->emptyObjectStructure();
+ Structure* structure = constructor->cachedInheritorID(callFrame);
callFrame->uncheckedR(thisRegister) = constructEmptyObject(callFrame, structure);
vPC += OPCODE_LENGTH(op_create_this);
diff --git a/Source/JavaScriptCore/jit/ExecutableAllocator.h b/Source/JavaScriptCore/jit/ExecutableAllocator.h
index 1ddf011cb..c1edc9752 100644
--- a/Source/JavaScriptCore/jit/ExecutableAllocator.h
+++ b/Source/JavaScriptCore/jit/ExecutableAllocator.h
@@ -30,6 +30,7 @@
#include <limits>
#include <wtf/Assertions.h>
#include <wtf/MetaAllocatorHandle.h>
+#include <wtf/MetaAllocator.h>
#include <wtf/PageAllocation.h>
#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
diff --git a/Source/JavaScriptCore/jit/ExecutableAllocatorFixedVMPool.cpp b/Source/JavaScriptCore/jit/ExecutableAllocatorFixedVMPool.cpp
index b4422c3df..884248b20 100644
--- a/Source/JavaScriptCore/jit/ExecutableAllocatorFixedVMPool.cpp
+++ b/Source/JavaScriptCore/jit/ExecutableAllocatorFixedVMPool.cpp
@@ -78,12 +78,26 @@ protected:
virtual void notifyNeedPage(void* page)
{
+#if OS(DARWIN)
+ UNUSED_PARAM(page);
+#else
m_reservation.commit(page, pageSize());
+#endif
}
virtual void notifyPageIsFree(void* page)
{
+#if OS(DARWIN)
+ for (;;) {
+ int result = madvise(page, pageSize(), MADV_FREE);
+ if (!result)
+ return;
+ ASSERT(result == -1);
+ ASSERT(errno == EAGAIN);
+ }
+#else
m_reservation.decommit(page, pageSize());
+#endif
}
private:
diff --git a/Source/JavaScriptCore/jit/JIT.cpp b/Source/JavaScriptCore/jit/JIT.cpp
index 01b1260c9..abc79d34b 100644
--- a/Source/JavaScriptCore/jit/JIT.cpp
+++ b/Source/JavaScriptCore/jit/JIT.cpp
@@ -242,7 +242,6 @@ void JIT::privateCompileMainPass()
DEFINE_OP(op_call_varargs)
DEFINE_OP(op_catch)
DEFINE_OP(op_construct)
- DEFINE_OP(op_get_callee)
DEFINE_OP(op_create_this)
DEFINE_OP(op_convert_this)
DEFINE_OP(op_init_lazy_reg)
diff --git a/Source/JavaScriptCore/jit/JIT.h b/Source/JavaScriptCore/jit/JIT.h
index af5076fb5..6dc0137d9 100644
--- a/Source/JavaScriptCore/jit/JIT.h
+++ b/Source/JavaScriptCore/jit/JIT.h
@@ -582,7 +582,6 @@ namespace JSC {
void emit_op_call_put_result(Instruction*);
void emit_op_catch(Instruction*);
void emit_op_construct(Instruction*);
- void emit_op_get_callee(Instruction*);
void emit_op_create_this(Instruction*);
void emit_op_convert_this(Instruction*);
void emit_op_create_arguments(Instruction*);
diff --git a/Source/JavaScriptCore/jit/JITInlineMethods.h b/Source/JavaScriptCore/jit/JITInlineMethods.h
index cd33821f2..40985ac90 100644
--- a/Source/JavaScriptCore/jit/JITInlineMethods.h
+++ b/Source/JavaScriptCore/jit/JITInlineMethods.h
@@ -448,6 +448,9 @@ inline void JIT::emitAllocateJSFunction(FunctionExecutable* executable, Register
// store the function's executable member
storePtr(TrustedImmPtr(executable), Address(result, JSFunction::offsetOfExecutable()));
+ // clear the function's inheritorID
+ storePtr(TrustedImmPtr(0), Address(result, JSFunction::offsetOfCachedInheritorID()));
+
// store the function's name
ASSERT(executable->nameValue());
int functionNameOffset = sizeof(JSValue) * m_codeBlock->globalObject()->functionNameOffset();
diff --git a/Source/JavaScriptCore/jit/JITOpcodes.cpp b/Source/JavaScriptCore/jit/JITOpcodes.cpp
index d68f4109d..f43e98c45 100644
--- a/Source/JavaScriptCore/jit/JITOpcodes.cpp
+++ b/Source/JavaScriptCore/jit/JITOpcodes.cpp
@@ -1263,42 +1263,24 @@ void JIT::emit_op_convert_this(Instruction* currentInstruction)
addSlowCase(branchPtr(Equal, Address(regT0, JSCell::classInfoOffset()), TrustedImmPtr(&JSString::s_info)));
}
-void JIT::emit_op_get_callee(Instruction* currentInstruction)
-{
- unsigned result = currentInstruction[1].u.operand;
- emitGetFromCallFrameHeaderPtr(RegisterFile::Callee, regT0);
- emitPutVirtualRegister(result);
-}
-
void JIT::emit_op_create_this(Instruction* currentInstruction)
{
- emitGetVirtualRegister(currentInstruction[2].u.operand, regT2);
- emitJumpSlowCaseIfNotJSCell(regT2, currentInstruction[2].u.operand);
- loadPtr(Address(regT2, JSCell::structureOffset()), regT1);
- addSlowCase(emitJumpIfNotObject(regT1));
-
- // now we know that the prototype is an object, but we don't know if it's got an
- // inheritor ID
-
- loadPtr(Address(regT2, JSObject::offsetOfInheritorID()), regT2);
+ emitGetFromCallFrameHeaderPtr(RegisterFile::Callee, regT0);
+ loadPtr(Address(regT0, JSFunction::offsetOfCachedInheritorID()), regT2);
addSlowCase(branchTestPtr(Zero, regT2));
// now regT2 contains the inheritorID, which is the structure that the newly
// allocated object will have.
emitAllocateJSFinalObject(regT2, regT0, regT1);
-
emitPutVirtualRegister(currentInstruction[1].u.operand);
}
void JIT::emitSlow_op_create_this(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
{
- linkSlowCaseIfNotJSCell(iter, currentInstruction[2].u.operand); // not a cell
- linkSlowCase(iter); // not an object
linkSlowCase(iter); // doesn't have an inheritor ID
linkSlowCase(iter); // allocation failed
JITStubCall stubCall(this, cti_op_create_this);
- stubCall.addArgument(currentInstruction[2].u.operand, regT1);
stubCall.call(currentInstruction[1].u.operand);
}
diff --git a/Source/JavaScriptCore/jit/JITOpcodes32_64.cpp b/Source/JavaScriptCore/jit/JITOpcodes32_64.cpp
index 76e11e48c..c9f8922fa 100644
--- a/Source/JavaScriptCore/jit/JITOpcodes32_64.cpp
+++ b/Source/JavaScriptCore/jit/JITOpcodes32_64.cpp
@@ -1523,44 +1523,24 @@ void JIT::emit_op_init_lazy_reg(Instruction* currentInstruction)
emitStore(dst, JSValue());
}
-void JIT::emit_op_get_callee(Instruction* currentInstruction)
-{
- int dst = currentInstruction[1].u.operand;
- emitGetFromCallFrameHeaderPtr(RegisterFile::Callee, regT0);
- emitStoreCell(dst, regT0);
-}
-
void JIT::emit_op_create_this(Instruction* currentInstruction)
{
- emitLoad(currentInstruction[2].u.operand, regT1, regT0);
- emitJumpSlowCaseIfNotJSCell(currentInstruction[2].u.operand, regT1);
- loadPtr(Address(regT0, JSCell::structureOffset()), regT1);
- addSlowCase(emitJumpIfNotObject(regT1));
-
- // now we know that the prototype is an object, but we don't know if it's got an
- // inheritor ID
-
- loadPtr(Address(regT0, JSObject::offsetOfInheritorID()), regT2);
+ emitGetFromCallFrameHeaderPtr(RegisterFile::Callee, regT0);
+ loadPtr(Address(regT0, JSFunction::offsetOfCachedInheritorID()), regT2);
addSlowCase(branchTestPtr(Zero, regT2));
// now regT2 contains the inheritorID, which is the structure that the newly
// allocated object will have.
emitAllocateJSFinalObject(regT2, regT0, regT1);
-
emitStoreCell(currentInstruction[1].u.operand, regT0);
}
void JIT::emitSlow_op_create_this(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
{
- linkSlowCaseIfNotJSCell(iter, currentInstruction[2].u.operand); // not a cell
- linkSlowCase(iter); // not an object
linkSlowCase(iter); // doesn't have an inheritor ID
linkSlowCase(iter); // allocation failed
- unsigned protoRegister = currentInstruction[2].u.operand;
- emitLoad(protoRegister, regT1, regT0);
JITStubCall stubCall(this, cti_op_create_this);
- stubCall.addArgument(regT1, regT0);
stubCall.call(currentInstruction[1].u.operand);
}
diff --git a/Source/JavaScriptCore/jit/JITStubs.cpp b/Source/JavaScriptCore/jit/JITStubs.cpp
index d81e68aae..73f4892ac 100644
--- a/Source/JavaScriptCore/jit/JITStubs.cpp
+++ b/Source/JavaScriptCore/jit/JITStubs.cpp
@@ -1286,12 +1286,7 @@ DEFINE_STUB_FUNCTION(EncodedJSValue, op_create_this)
ASSERT(constructor->methodTable()->getConstructData(constructor, constructData) == ConstructTypeJS);
#endif
- Structure* structure;
- JSValue proto = stackFrame.args[0].jsValue();
- if (proto.isObject())
- structure = asObject(proto)->inheritorID(*stackFrame.globalData);
- else
- structure = constructor->scope()->globalObject->emptyObjectStructure();
+ Structure* structure = constructor->cachedInheritorID(callFrame);
JSValue result = constructEmptyObject(callFrame, structure);
return JSValue::encode(result);
@@ -1497,9 +1492,7 @@ DEFINE_STUB_FUNCTION(JSObject*, op_put_by_id_transition_realloc)
ASSERT(baseValue.isObject());
JSObject* base = asObject(baseValue);
- JSGlobalData& globalData = *stackFrame.globalData;
- PropertyStorage newStorage = base->growPropertyStorage(globalData, oldSize, newSize);
- base->setPropertyStorage(globalData, newStorage, newStructure);
+ base->allocatePropertyStorage(*stackFrame.globalData, oldSize, newSize);
return base;
}
diff --git a/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp b/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp
index 2b5161f7b..d184b6e62 100644
--- a/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp
+++ b/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp
@@ -458,13 +458,7 @@ LLINT_SLOW_PATH_DECL(slow_path_create_this)
ASSERT(constructor->methodTable()->getConstructData(constructor, constructData) == ConstructTypeJS);
#endif
- Structure* structure;
- JSValue proto = LLINT_OP(2).jsValue();
- if (proto.isObject())
- structure = asObject(proto)->inheritorID(globalData);
- else
- structure = constructor->scope()->globalObject->emptyObjectStructure();
-
+ Structure* structure = constructor->cachedInheritorID(exec);
LLINT_RETURN(constructEmptyObject(exec, structure));
}
@@ -1167,6 +1161,20 @@ LLINT_SLOW_PATH_DECL(slow_path_switch_imm)
LLINT_END();
}
+LLINT_SLOW_PATH_DECL(slow_path_switch_char)
+{
+ LLINT_BEGIN();
+ JSValue scrutinee = LLINT_OP_C(3).jsValue();
+ ASSERT(scrutinee.isString());
+ JSString* string = asString(scrutinee);
+ ASSERT(string->length() == 1);
+ int defaultOffset = pc[2].u.operand;
+ StringImpl* impl = string->value(exec).impl();
+ CodeBlock* codeBlock = exec->codeBlock();
+ pc += codeBlock->characterSwitchJumpTable(pc[1].u.operand).offsetForValue((*impl)[0], defaultOffset);
+ LLINT_END();
+}
+
LLINT_SLOW_PATH_DECL(slow_path_switch_string)
{
LLINT_BEGIN();
diff --git a/Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm b/Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm
index 42ab4c1e4..e1361315f 100644
--- a/Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm
+++ b/Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm
@@ -343,31 +343,17 @@ _llint_op_create_arguments:
_llint_op_create_this:
traceExecution()
- loadi 8[PC], t0
- assertNotConstant(t0)
- bineq TagOffset[cfr, t0, 8], CellTag, .opCreateThisSlow
- loadi PayloadOffset[cfr, t0, 8], t0
- loadp JSCell::m_structure[t0], t1
- bbb Structure::m_typeInfo + TypeInfo::m_type[t1], ObjectType, .opCreateThisSlow
- loadp JSObject::m_inheritorID[t0], t2
+ loadp Callee[cfr], t0
+ loadp JSFunction::m_cachedInheritorID[t0], t2
btpz t2, .opCreateThisSlow
allocateBasicJSObject(JSFinalObjectSizeClassIndex, JSGlobalData::jsFinalObjectClassInfo, t2, t0, t1, t3, .opCreateThisSlow)
loadi 4[PC], t1
storei CellTag, TagOffset[cfr, t1, 8]
storei t0, PayloadOffset[cfr, t1, 8]
- dispatch(3)
+ dispatch(2)
.opCreateThisSlow:
callSlowPath(_llint_slow_path_create_this)
- dispatch(3)
-
-
-_llint_op_get_callee:
- traceExecution()
- loadi 4[PC], t0
- loadp PayloadOffset + Callee[cfr], t1
- storei CellTag, TagOffset[cfr, t0, 8]
- storei t1, PayloadOffset[cfr, t0, 8]
dispatch(2)
@@ -1446,8 +1432,9 @@ _llint_op_switch_char:
bineq t1, CellTag, .opSwitchCharFallThrough
loadp JSCell::m_structure[t0], t1
bbneq Structure::m_typeInfo + TypeInfo::m_type[t1], StringType, .opSwitchCharFallThrough
+ bineq JSString::m_length[t0], 1, .opSwitchCharFallThrough
loadp JSString::m_value[t0], t0
- bineq StringImpl::m_length[t0], 1, .opSwitchCharFallThrough
+ btpz t0, .opSwitchOnRope
loadp StringImpl::m_data8[t0], t1
btinz StringImpl::m_hashAndFlags[t0], HashFlags8BitBuffer, .opSwitchChar8Bit
loadh [t1], t0
@@ -1465,6 +1452,10 @@ _llint_op_switch_char:
.opSwitchCharFallThrough:
dispatchBranch(8[PC])
+.opSwitchOnRope:
+ callSlowPath(_llint_slow_path_switch_char)
+ dispatch(0)
+
_llint_op_new_func:
traceExecution()
diff --git a/Source/JavaScriptCore/llint/LowLevelInterpreter64.asm b/Source/JavaScriptCore/llint/LowLevelInterpreter64.asm
index b28051f33..baf246b0b 100644
--- a/Source/JavaScriptCore/llint/LowLevelInterpreter64.asm
+++ b/Source/JavaScriptCore/llint/LowLevelInterpreter64.asm
@@ -221,29 +221,16 @@ _llint_op_create_arguments:
_llint_op_create_this:
traceExecution()
- loadis 16[PB, PC, 8], t0
- assertNotConstant(t0)
- loadp [cfr, t0, 8], t0
- btpnz t0, tagMask, .opCreateThisSlow
- loadp JSCell::m_structure[t0], t1
- bbb Structure::m_typeInfo + TypeInfo::m_type[t1], ObjectType, .opCreateThisSlow
- loadp JSObject::m_inheritorID[t0], t2
+ loadp Callee[cfr], t0
+ loadp JSFunction::m_cachedInheritorID[t0], t2
btpz t2, .opCreateThisSlow
allocateBasicJSObject(JSFinalObjectSizeClassIndex, JSGlobalData::jsFinalObjectClassInfo, t2, t0, t1, t3, .opCreateThisSlow)
loadis 8[PB, PC, 8], t1
storep t0, [cfr, t1, 8]
- dispatch(3)
+ dispatch(2)
.opCreateThisSlow:
callSlowPath(_llint_slow_path_create_this)
- dispatch(3)
-
-
-_llint_op_get_callee:
- traceExecution()
- loadis 8[PB, PC, 8], t0
- loadp Callee[cfr], t1
- storep t1, [cfr, t0, 8]
dispatch(2)
@@ -1292,8 +1279,9 @@ _llint_op_switch_char:
btpnz t1, tagMask, .opSwitchCharFallThrough
loadp JSCell::m_structure[t1], t0
bbneq Structure::m_typeInfo + TypeInfo::m_type[t0], StringType, .opSwitchCharFallThrough
+ bineq JSString::m_length[t1], 1, .opSwitchCharFallThrough
loadp JSString::m_value[t1], t0
- bineq StringImpl::m_length[t0], 1, .opSwitchCharFallThrough
+ btpz t0, .opSwitchOnRope
loadp StringImpl::m_data8[t0], t1
btinz StringImpl::m_hashAndFlags[t0], HashFlags8BitBuffer, .opSwitchChar8Bit
loadh [t1], t0
@@ -1311,6 +1299,10 @@ _llint_op_switch_char:
.opSwitchCharFallThrough:
dispatchInt(16[PB, PC, 8])
+.opSwitchOnRope:
+ callSlowPath(_llint_slow_path_switch_char)
+ dispatch(0)
+
_llint_op_new_func:
traceExecution()
diff --git a/Source/JavaScriptCore/parser/ASTBuilder.h b/Source/JavaScriptCore/parser/ASTBuilder.h
index a173cc10f..0eb60cf89 100644
--- a/Source/JavaScriptCore/parser/ASTBuilder.h
+++ b/Source/JavaScriptCore/parser/ASTBuilder.h
@@ -77,6 +77,7 @@ public:
: m_globalData(globalData)
, m_sourceCode(sourceCode)
, m_scope(globalData)
+ , m_evalCount(0)
{
}
@@ -118,6 +119,7 @@ public:
ParserArenaData<DeclarationStacks::VarStack>* varDeclarations() { return m_scope.m_varDeclarations; }
ParserArenaData<DeclarationStacks::FunctionStack>* funcDeclarations() { return m_scope.m_funcDeclarations; }
+ int features() const { return m_scope.m_features; }
int numConstants() const { return m_scope.m_numConstants; }
void appendToComma(CommaNode* commaNode, ExpressionNode* expr) { commaNode->append(expr); }
@@ -150,8 +152,17 @@ public:
incConstants();
return new (m_globalData) VoidNode(lineNumber, expr);
}
- ExpressionNode* thisExpr(int lineNumber) { return new (m_globalData) ThisNode(lineNumber); }
- ExpressionNode* createResolve(int lineNumber, const Identifier* ident, int start) { return new (m_globalData) ResolveNode(lineNumber, *ident, start); }
+ ExpressionNode* thisExpr(int lineNumber)
+ {
+ usesThis();
+ return new (m_globalData) ThisNode(lineNumber);
+ }
+ ExpressionNode* createResolve(int lineNumber, const Identifier* ident, int start)
+ {
+ if (m_globalData->propertyNames->arguments == *ident)
+ usesArguments();
+ return new (m_globalData) ResolveNode(lineNumber, *ident, start);
+ }
ExpressionNode* createObjectLiteral(int lineNumber) { return new (m_globalData) ObjectLiteralNode(lineNumber); }
ExpressionNode* createObjectLiteral(int lineNumber, PropertyListNode* properties) { return new (m_globalData) ObjectLiteralNode(lineNumber, properties); }
@@ -252,9 +263,9 @@ public:
return result;
}
- FunctionBodyNode* createFunctionBody(int lineNumber, ScopeFlags scopeFlags)
+ FunctionBodyNode* createFunctionBody(int lineNumber, bool inStrictContext)
{
- return FunctionBodyNode::create(m_globalData, lineNumber, scopeFlags);
+ return FunctionBodyNode::create(m_globalData, lineNumber, inStrictContext);
}
template <bool> PropertyNode* createGetterOrSetterProperty(int lineNumber, PropertyNode::Type type, const Identifier* name, ParameterNode* params, FunctionBodyNode* body, int openBracePos, int closeBracePos, int bodyStartLine, int bodyEndLine)
@@ -301,6 +312,8 @@ public:
StatementNode* createFuncDeclStatement(int lineNumber, const Identifier* name, FunctionBodyNode* body, ParameterNode* parameters, int openBracePos, int closeBracePos, int bodyStartLine, int bodyEndLine)
{
FuncDeclNode* decl = new (m_globalData) FuncDeclNode(lineNumber, *name, body, m_sourceCode->subExpression(openBracePos, closeBracePos, bodyStartLine), parameters);
+ if (*name == m_globalData->propertyNames->arguments)
+ usesArguments();
m_scope.m_funcDeclarations->data.append(decl->body());
body->setLoc(bodyStartLine, bodyEndLine);
return decl;
@@ -413,6 +426,8 @@ public:
StatementNode* createTryStatement(int lineNumber, StatementNode* tryBlock, const Identifier* ident, StatementNode* catchBlock, StatementNode* finallyBlock, int startLine, int endLine)
{
TryNode* result = new (m_globalData) TryNode(lineNumber, tryBlock, *ident, catchBlock, finallyBlock);
+ if (catchBlock)
+ usesCatch();
result->setLoc(startLine, endLine);
return result;
}
@@ -448,6 +463,7 @@ public:
StatementNode* createWithStatement(int lineNumber, ExpressionNode* expr, StatementNode* statement, int start, int end, int startLine, int endLine)
{
+ usesWith();
WithNode* result = new (m_globalData) WithNode(lineNumber, expr, statement, end, end - start);
result->setLoc(startLine, endLine);
return result;
@@ -490,6 +506,8 @@ public:
void addVar(const Identifier* ident, int attrs)
{
+ if (m_globalData->propertyNames->arguments == *ident)
+ usesArguments();
m_scope.m_varDeclarations->data.append(std::make_pair(ident, attrs));
}
@@ -504,6 +522,8 @@ public:
return new (m_globalData) CommaNode(lineNumber, list, init);
}
+ int evalCount() const { return m_evalCount; }
+
void appendBinaryExpressionInfo(int& operandStackDepth, ExpressionNode* current, int exprStart, int lhs, int rhs, bool hasAssignments)
{
operandStackDepth++;
@@ -590,11 +610,13 @@ private:
Scope(JSGlobalData* globalData)
: m_varDeclarations(new (globalData) ParserArenaData<DeclarationStacks::VarStack>)
, m_funcDeclarations(new (globalData) ParserArenaData<DeclarationStacks::FunctionStack>)
+ , m_features(0)
, m_numConstants(0)
{
}
ParserArenaData<DeclarationStacks::VarStack>* m_varDeclarations;
ParserArenaData<DeclarationStacks::FunctionStack>* m_funcDeclarations;
+ int m_features;
int m_numConstants;
};
@@ -604,6 +626,15 @@ private:
}
void incConstants() { m_scope.m_numConstants++; }
+ void usesThis() { m_scope.m_features |= ThisFeature; }
+ void usesCatch() { m_scope.m_features |= CatchFeature; }
+ void usesArguments() { m_scope.m_features |= ArgumentsFeature; }
+ void usesWith() { m_scope.m_features |= WithFeature; }
+ void usesEval()
+ {
+ m_evalCount++;
+ m_scope.m_features |= EvalFeature;
+ }
ExpressionNode* createNumber(int lineNumber, double d)
{
return new (m_globalData) NumberNode(lineNumber, d);
@@ -616,6 +647,7 @@ private:
Vector<AssignmentInfo, 10> m_assignmentInfoStack;
Vector<pair<int, int>, 10> m_binaryOperatorStack;
Vector<pair<int, int>, 10> m_unaryTokenStack;
+ int m_evalCount;
};
ExpressionNode* ASTBuilder::makeTypeOfNode(int lineNumber, ExpressionNode* expr)
@@ -765,8 +797,10 @@ ExpressionNode* ASTBuilder::makeFunctionCallNode(int lineNumber, ExpressionNode*
if (func->isResolveNode()) {
ResolveNode* resolve = static_cast<ResolveNode*>(func);
const Identifier& identifier = resolve->identifier();
- if (identifier == m_globalData->propertyNames->eval)
+ if (identifier == m_globalData->propertyNames->eval) {
+ usesEval();
return new (m_globalData) EvalFunctionCallNode(lineNumber, args, divot, divot - start, end - divot);
+ }
return new (m_globalData) FunctionCallResolveNode(lineNumber, identifier, args, divot, divot - start, end - divot);
}
if (func->isBracketAccessorNode()) {
diff --git a/Source/JavaScriptCore/parser/NodeInfo.h b/Source/JavaScriptCore/parser/NodeInfo.h
index e0d4ffec4..4853aec42 100644
--- a/Source/JavaScriptCore/parser/NodeInfo.h
+++ b/Source/JavaScriptCore/parser/NodeInfo.h
@@ -26,7 +26,7 @@ namespace JSC {
template <typename T> struct NodeInfo {
T m_node;
- ScopeFlags m_scopeFlags;
+ CodeFeatures m_features;
int m_numConstants;
};
@@ -44,7 +44,7 @@ namespace JSC {
T m_node;
ParserArenaData<DeclarationStacks::VarStack>* m_varDeclarations;
ParserArenaData<DeclarationStacks::FunctionStack>* m_funcDeclarations;
- ScopeFlags m_scopeFlags;
+ CodeFeatures m_features;
int m_numConstants;
};
diff --git a/Source/JavaScriptCore/parser/Nodes.cpp b/Source/JavaScriptCore/parser/Nodes.cpp
index 75c848bce..c32e4c73a 100644
--- a/Source/JavaScriptCore/parser/Nodes.cpp
+++ b/Source/JavaScriptCore/parser/Nodes.cpp
@@ -75,19 +75,19 @@ StatementNode* SourceElements::singleStatement() const
// ------------------------------ ScopeNode -----------------------------
-ScopeNode::ScopeNode(JSGlobalData* globalData, int lineNumber, ScopeFlags scopeFlags)
+ScopeNode::ScopeNode(JSGlobalData* globalData, int lineNumber, bool inStrictContext)
: StatementNode(lineNumber)
, ParserArenaRefCounted(globalData)
- , m_scopeFlags(scopeFlags)
+ , m_features(inStrictContext ? StrictModeFeature : NoFeatures)
, m_numConstants(0)
, m_statements(0)
{
}
-ScopeNode::ScopeNode(JSGlobalData* globalData, int lineNumber, const SourceCode& source, SourceElements* children, VarStack* varStack, FunctionStack* funcStack, IdentifierSet& capturedVariables, ScopeFlags scopeFlags, int numConstants)
+ScopeNode::ScopeNode(JSGlobalData* globalData, int lineNumber, const SourceCode& source, SourceElements* children, VarStack* varStack, FunctionStack* funcStack, IdentifierSet& capturedVariables, CodeFeatures features, int numConstants)
: StatementNode(lineNumber)
, ParserArenaRefCounted(globalData)
- , m_scopeFlags(scopeFlags)
+ , m_features(features)
, m_source(source)
, m_numConstants(numConstants)
, m_statements(children)
@@ -107,14 +107,14 @@ StatementNode* ScopeNode::singleStatement() const
// ------------------------------ ProgramNode -----------------------------
-inline ProgramNode::ProgramNode(JSGlobalData* globalData, int lineNumber, SourceElements* children, VarStack* varStack, FunctionStack* funcStack, IdentifierSet& capturedVariables, const SourceCode& source, ScopeFlags scopeFlags, int numConstants)
- : ScopeNode(globalData, lineNumber, source, children, varStack, funcStack, capturedVariables, scopeFlags, numConstants)
+inline ProgramNode::ProgramNode(JSGlobalData* globalData, int lineNumber, SourceElements* children, VarStack* varStack, FunctionStack* funcStack, IdentifierSet& capturedVariables, const SourceCode& source, CodeFeatures features, int numConstants)
+ : ScopeNode(globalData, lineNumber, source, children, varStack, funcStack, capturedVariables, features, numConstants)
{
}
-PassRefPtr<ProgramNode> ProgramNode::create(JSGlobalData* globalData, int lineNumber, SourceElements* children, VarStack* varStack, FunctionStack* funcStack, IdentifierSet& capturedVariables, const SourceCode& source, ScopeFlags scopeFlags, int numConstants)
+PassRefPtr<ProgramNode> ProgramNode::create(JSGlobalData* globalData, int lineNumber, SourceElements* children, VarStack* varStack, FunctionStack* funcStack, IdentifierSet& capturedVariables, const SourceCode& source, CodeFeatures features, int numConstants)
{
- RefPtr<ProgramNode> node = new ProgramNode(globalData, lineNumber, children, varStack, funcStack, capturedVariables, source, scopeFlags, numConstants);
+ RefPtr<ProgramNode> node = new ProgramNode(globalData, lineNumber, children, varStack, funcStack, capturedVariables, source, features, numConstants);
ASSERT(node->m_arena.last() == node);
node->m_arena.removeLast();
@@ -125,14 +125,14 @@ PassRefPtr<ProgramNode> ProgramNode::create(JSGlobalData* globalData, int lineNu
// ------------------------------ EvalNode -----------------------------
-inline EvalNode::EvalNode(JSGlobalData* globalData, int lineNumber, SourceElements* children, VarStack* varStack, FunctionStack* funcStack, IdentifierSet& capturedVariables, const SourceCode& source, ScopeFlags scopeFlags, int numConstants)
- : ScopeNode(globalData, lineNumber, source, children, varStack, funcStack, capturedVariables, scopeFlags, numConstants)
+inline EvalNode::EvalNode(JSGlobalData* globalData, int lineNumber, SourceElements* children, VarStack* varStack, FunctionStack* funcStack, IdentifierSet& capturedVariables, const SourceCode& source, CodeFeatures features, int numConstants)
+ : ScopeNode(globalData, lineNumber, source, children, varStack, funcStack, capturedVariables, features, numConstants)
{
}
-PassRefPtr<EvalNode> EvalNode::create(JSGlobalData* globalData, int lineNumber, SourceElements* children, VarStack* varStack, FunctionStack* funcStack, IdentifierSet& capturedVariables, const SourceCode& source, ScopeFlags scopeFlags, int numConstants)
+PassRefPtr<EvalNode> EvalNode::create(JSGlobalData* globalData, int lineNumber, SourceElements* children, VarStack* varStack, FunctionStack* funcStack, IdentifierSet& capturedVariables, const SourceCode& source, CodeFeatures features, int numConstants)
{
- RefPtr<EvalNode> node = new EvalNode(globalData, lineNumber, children, varStack, funcStack, capturedVariables, source, scopeFlags, numConstants);
+ RefPtr<EvalNode> node = new EvalNode(globalData, lineNumber, children, varStack, funcStack, capturedVariables, source, features, numConstants);
ASSERT(node->m_arena.last() == node);
node->m_arena.removeLast();
@@ -149,13 +149,13 @@ FunctionParameters::FunctionParameters(ParameterNode* firstParameter)
append(parameter->ident());
}
-inline FunctionBodyNode::FunctionBodyNode(JSGlobalData* globalData, int lineNumber, ScopeFlags scopeFlags)
- : ScopeNode(globalData, lineNumber, scopeFlags)
+inline FunctionBodyNode::FunctionBodyNode(JSGlobalData* globalData, int lineNumber, bool inStrictContext)
+ : ScopeNode(globalData, lineNumber, inStrictContext)
{
}
-inline FunctionBodyNode::FunctionBodyNode(JSGlobalData* globalData, int lineNumber, SourceElements* children, VarStack* varStack, FunctionStack* funcStack, IdentifierSet& capturedVariables, const SourceCode& sourceCode, ScopeFlags scopeFlags, int numConstants)
- : ScopeNode(globalData, lineNumber, sourceCode, children, varStack, funcStack, capturedVariables, scopeFlags, numConstants)
+inline FunctionBodyNode::FunctionBodyNode(JSGlobalData* globalData, int lineNumber, SourceElements* children, VarStack* varStack, FunctionStack* funcStack, IdentifierSet& capturedVariables, const SourceCode& sourceCode, CodeFeatures features, int numConstants)
+ : ScopeNode(globalData, lineNumber, sourceCode, children, varStack, funcStack, capturedVariables, features, numConstants)
{
}
@@ -172,14 +172,14 @@ void FunctionBodyNode::finishParsing(PassRefPtr<FunctionParameters> parameters,
m_ident = ident;
}
-FunctionBodyNode* FunctionBodyNode::create(JSGlobalData* globalData, int lineNumber, ScopeFlags scopeFlags)
+FunctionBodyNode* FunctionBodyNode::create(JSGlobalData* globalData, int lineNumber, bool inStrictContext)
{
- return new FunctionBodyNode(globalData, lineNumber, scopeFlags);
+ return new FunctionBodyNode(globalData, lineNumber, inStrictContext);
}
-PassRefPtr<FunctionBodyNode> FunctionBodyNode::create(JSGlobalData* globalData, int lineNumber, SourceElements* children, VarStack* varStack, FunctionStack* funcStack, IdentifierSet& capturedVariables, const SourceCode& sourceCode, ScopeFlags scopeFlags, int numConstants)
+PassRefPtr<FunctionBodyNode> FunctionBodyNode::create(JSGlobalData* globalData, int lineNumber, SourceElements* children, VarStack* varStack, FunctionStack* funcStack, IdentifierSet& capturedVariables, const SourceCode& sourceCode, CodeFeatures features, int numConstants)
{
- RefPtr<FunctionBodyNode> node = new FunctionBodyNode(globalData, lineNumber, children, varStack, funcStack, capturedVariables, sourceCode, scopeFlags, numConstants);
+ RefPtr<FunctionBodyNode> node = new FunctionBodyNode(globalData, lineNumber, children, varStack, funcStack, capturedVariables, sourceCode, features, numConstants);
ASSERT(node->m_arena.last() == node);
node->m_arena.removeLast();
diff --git a/Source/JavaScriptCore/parser/Nodes.h b/Source/JavaScriptCore/parser/Nodes.h
index f752b91e9..26c829da6 100644
--- a/Source/JavaScriptCore/parser/Nodes.h
+++ b/Source/JavaScriptCore/parser/Nodes.h
@@ -47,31 +47,19 @@ namespace JSC {
class ScopeChainNode;
class ScopeNode;
- typedef unsigned short ScopeFlags;
-
- const ScopeFlags NoScopeFlags = 0;
-
- // Some scope flags propagate down the parse tree from parent scopes, like
- // strict mode. They are modal to an entire set of nested scopes.
- const ScopeFlags StrictModeFlag = 1 << 0;
- const ScopeFlags FunctionModeFlag = 1 << 1;
- const ScopeFlags AllScopeModeFlags = StrictModeFlag | FunctionModeFlag;
-
- // Some scope flags refer only to a specific scope, and don't propagate down
- // or up.
- const ScopeFlags BlockScopeFlag = 1 << 4;
- const ScopeFlags AllScopeKindFlags = BlockScopeFlag;
-
- // Other flags reflect uses within nested scopes, and so propagate up
- // from the leaves.
- const ScopeFlags UsesEvalFlag = 1 << 8;
- const ScopeFlags UsesArgumentsFlag = 1 << 9;
- const ScopeFlags UsesWithFlag = 1 << 10;
- const ScopeFlags UsesCatchFlag = 1 << 11;
- const ScopeFlags UsesThisFlag = 1 << 12;
- const ScopeFlags ShadowsArgumentsFlag = 1 << 13;
- const ScopeFlags AllScopeUsesFlags = UsesEvalFlag | UsesArgumentsFlag | UsesWithFlag | UsesCatchFlag | UsesThisFlag | ShadowsArgumentsFlag;
+ typedef unsigned CodeFeatures;
+
+ const CodeFeatures NoFeatures = 0;
+ const CodeFeatures EvalFeature = 1 << 0;
+ const CodeFeatures ArgumentsFeature = 1 << 1;
+ const CodeFeatures WithFeature = 1 << 2;
+ const CodeFeatures CatchFeature = 1 << 3;
+ const CodeFeatures ThisFeature = 1 << 4;
+ const CodeFeatures StrictModeFeature = 1 << 5;
+ const CodeFeatures ShadowsArgumentsFeature = 1 << 6;
+ const CodeFeatures AllFeatures = EvalFeature | ArgumentsFeature | WithFeature | CatchFeature | ThisFeature | StrictModeFeature | ShadowsArgumentsFeature;
+
enum Operator {
OpEqual,
OpPlusEq,
@@ -1395,8 +1383,8 @@ namespace JSC {
typedef DeclarationStacks::VarStack VarStack;
typedef DeclarationStacks::FunctionStack FunctionStack;
- ScopeNode(JSGlobalData*, int, ScopeFlags);
- ScopeNode(JSGlobalData*, int, const SourceCode&, SourceElements*, VarStack*, FunctionStack*, IdentifierSet&, ScopeFlags, int numConstants);
+ ScopeNode(JSGlobalData*, int, bool inStrictContext);
+ ScopeNode(JSGlobalData*, int, const SourceCode&, SourceElements*, VarStack*, FunctionStack*, IdentifierSet&, CodeFeatures, int numConstants);
using ParserArenaRefCounted::operator new;
@@ -1409,26 +1397,24 @@ namespace JSC {
m_capturedVariables.clear();
}
- bool hasCapturedVariables() const { return !!m_capturedVariables.size(); }
- size_t capturedVariableCount() const { return m_capturedVariables.size(); }
- bool captures(const Identifier& ident) { return m_capturedVariables.contains(ident.impl()); }
-
- void addScopeFlags(ScopeFlags scopeFlags) { m_scopeFlags |= scopeFlags; }
- ScopeFlags scopeFlags() const { return m_scopeFlags; }
-
- bool isStrictMode() const { return m_scopeFlags & StrictModeFlag; }
- bool usesEval() const { return m_scopeFlags & UsesEvalFlag; }
- bool usesArguments() const { return (m_scopeFlags & UsesArgumentsFlag) && !(m_scopeFlags & ShadowsArgumentsFlag); }
- void setUsesArguments() { m_scopeFlags |= UsesArgumentsFlag; }
- bool usesThis() const { return m_scopeFlags & UsesThisFlag; }
-
- bool needsActivationForMoreThanVariables() const { return m_scopeFlags & (UsesEvalFlag | UsesWithFlag | UsesCatchFlag); }
- bool needsActivation() const { return hasCapturedVariables() || needsActivationForMoreThanVariables(); }
-
const SourceCode& source() const { return m_source; }
const UString& sourceURL() const { return m_source.provider()->url(); }
intptr_t sourceID() const { return m_source.provider()->asID(); }
+ void setFeatures(CodeFeatures features) { m_features = features; }
+ CodeFeatures features() { return m_features; }
+
+ bool usesEval() const { return m_features & EvalFeature; }
+ bool usesArguments() const { return (m_features & ArgumentsFeature) && !(m_features & ShadowsArgumentsFeature); }
+ bool isStrictMode() const { return m_features & StrictModeFeature; }
+ void setUsesArguments() { m_features |= ArgumentsFeature; }
+ bool usesThis() const { return m_features & ThisFeature; }
+ bool needsActivationForMoreThanVariables() const { return m_features & (EvalFeature | WithFeature | CatchFeature); }
+ bool needsActivation() const { return (hasCapturedVariables()) || (m_features & (EvalFeature | WithFeature | CatchFeature)); }
+ bool hasCapturedVariables() const { return !!m_capturedVariables.size(); }
+ size_t capturedVariableCount() const { return m_capturedVariables.size(); }
+ bool captures(const Identifier& ident) { return m_capturedVariables.contains(ident.impl()); }
+
VarStack& varStack() { return m_varStack; }
FunctionStack& functionStack() { return m_functionStack; }
@@ -1448,7 +1434,7 @@ namespace JSC {
ParserArena m_arena;
private:
- ScopeFlags m_scopeFlags;
+ CodeFeatures m_features;
SourceCode m_source;
VarStack m_varStack;
FunctionStack m_functionStack;
@@ -1460,12 +1446,12 @@ namespace JSC {
class ProgramNode : public ScopeNode {
public:
static const bool isFunctionNode = false;
- static PassRefPtr<ProgramNode> create(JSGlobalData*, int, SourceElements*, VarStack*, FunctionStack*, IdentifierSet&, const SourceCode&, ScopeFlags, int numConstants);
+ static PassRefPtr<ProgramNode> create(JSGlobalData*, int, SourceElements*, VarStack*, FunctionStack*, IdentifierSet&, const SourceCode&, CodeFeatures, int numConstants);
static const bool scopeIsFunction = false;
private:
- ProgramNode(JSGlobalData*, int, SourceElements*, VarStack*, FunctionStack*, IdentifierSet&, const SourceCode&, ScopeFlags, int numConstants);
+ ProgramNode(JSGlobalData*, int, SourceElements*, VarStack*, FunctionStack*, IdentifierSet&, const SourceCode&, CodeFeatures, int numConstants);
virtual RegisterID* emitBytecode(BytecodeGenerator&, RegisterID* = 0);
};
@@ -1473,12 +1459,12 @@ namespace JSC {
class EvalNode : public ScopeNode {
public:
static const bool isFunctionNode = false;
- static PassRefPtr<EvalNode> create(JSGlobalData*, int, SourceElements*, VarStack*, FunctionStack*, IdentifierSet&, const SourceCode&, ScopeFlags, int numConstants);
+ static PassRefPtr<EvalNode> create(JSGlobalData*, int, SourceElements*, VarStack*, FunctionStack*, IdentifierSet&, const SourceCode&, CodeFeatures, int numConstants);
static const bool scopeIsFunction = false;
private:
- EvalNode(JSGlobalData*, int, SourceElements*, VarStack*, FunctionStack*, IdentifierSet&, const SourceCode&, ScopeFlags, int numConstants);
+ EvalNode(JSGlobalData*, int, SourceElements*, VarStack*, FunctionStack*, IdentifierSet&, const SourceCode&, CodeFeatures, int numConstants);
virtual RegisterID* emitBytecode(BytecodeGenerator&, RegisterID* = 0);
};
@@ -1495,8 +1481,8 @@ namespace JSC {
class FunctionBodyNode : public ScopeNode {
public:
static const bool isFunctionNode = true;
- static FunctionBodyNode* create(JSGlobalData*, int, ScopeFlags);
- static PassRefPtr<FunctionBodyNode> create(JSGlobalData*, int, SourceElements*, VarStack*, FunctionStack*, IdentifierSet&, const SourceCode&, ScopeFlags, int numConstants);
+ static FunctionBodyNode* create(JSGlobalData*, int, bool isStrictMode);
+ static PassRefPtr<FunctionBodyNode> create(JSGlobalData*, int, SourceElements*, VarStack*, FunctionStack*, IdentifierSet&, const SourceCode&, CodeFeatures, int numConstants);
FunctionParameters* parameters() const { return m_parameters.get(); }
size_t parameterCount() const { return m_parameters->size(); }
@@ -1513,8 +1499,8 @@ namespace JSC {
static const bool scopeIsFunction = true;
private:
- FunctionBodyNode(JSGlobalData*, int, ScopeFlags);
- FunctionBodyNode(JSGlobalData*, int, SourceElements*, VarStack*, FunctionStack*, IdentifierSet&, const SourceCode&, ScopeFlags, int numConstants);
+ FunctionBodyNode(JSGlobalData*, int, bool inStrictContext);
+ FunctionBodyNode(JSGlobalData*, int, SourceElements*, VarStack*, FunctionStack*, IdentifierSet&, const SourceCode&, CodeFeatures, int numConstants);
Identifier m_ident;
Identifier m_inferredName;
diff --git a/Source/JavaScriptCore/parser/Parser.cpp b/Source/JavaScriptCore/parser/Parser.cpp
index a03af24df..d88a9a8b7 100644
--- a/Source/JavaScriptCore/parser/Parser.cpp
+++ b/Source/JavaScriptCore/parser/Parser.cpp
@@ -62,12 +62,11 @@ Parser<LexerType>::Parser(JSGlobalData* globalData, const SourceCode& source, Fu
m_lexer->setCode(source, m_arena);
m_functionCache = source.provider()->cache();
- ScopeFlags scopeFlags = NoScopeFlags;
- if (strictness == JSParseStrict)
- scopeFlags |= StrictModeFlag;
+ ScopeRef scope = pushScope();
if (parserMode == JSParseFunctionCode)
- scopeFlags |= FunctionModeFlag;
- ScopeRef scope = pushScope(scopeFlags);
+ scope->setIsFunction();
+ if (strictness == JSParseStrict)
+ scope->setStrictMode();
if (parameters) {
for (unsigned i = 0; i < parameters->size(); i++)
scope->declareParameter(&parameters->at(i));
@@ -97,12 +96,16 @@ UString Parser<LexerType>::parseInner()
IdentifierSet capturedVariables;
scope->getCapturedVariables(capturedVariables);
- ScopeFlags scopeFlags = scope->modeFlags() | scope->usesFlags();
+ CodeFeatures features = context.features();
+ if (scope->strictMode())
+ features |= StrictModeFeature;
+ if (scope->shadowsArguments())
+ features |= ShadowsArgumentsFeature;
unsigned functionCacheSize = m_functionCache ? m_functionCache->byteSize() : 0;
if (functionCacheSize != oldFunctionCacheSize)
m_lexer->sourceProvider()->notifyCacheSizeChanged(functionCacheSize - oldFunctionCacheSize);
- didFinishParsing(sourceElements, context.varDeclarations(), context.funcDeclarations(), scopeFlags,
+ didFinishParsing(sourceElements, context.varDeclarations(), context.funcDeclarations(), features,
m_lastLine, context.numConstants(), capturedVariables);
return parseError;
@@ -110,13 +113,13 @@ UString Parser<LexerType>::parseInner()
template <typename LexerType>
void Parser<LexerType>::didFinishParsing(SourceElements* sourceElements, ParserArenaData<DeclarationStacks::VarStack>* varStack,
- ParserArenaData<DeclarationStacks::FunctionStack>* funcStack, ScopeFlags scopeFlags, int lastLine, int numConstants, IdentifierSet& capturedVars)
+ ParserArenaData<DeclarationStacks::FunctionStack>* funcStack, CodeFeatures features, int lastLine, int numConstants, IdentifierSet& capturedVars)
{
m_sourceElements = sourceElements;
m_varDeclarations = varStack;
m_funcDeclarations = funcStack;
m_capturedVariables.swap(capturedVars);
- m_scopeFlags = scopeFlags;
+ m_features = features;
m_lastLine = lastLine;
m_numConstants = numConstants;
}
@@ -144,7 +147,7 @@ template <SourceElementsMode mode, class TreeBuilder> TreeSourceElements Parser<
if (directive) {
// "use strict" must be the exact literal without escape sequences or line continuation.
if (!hasSetStrict && directiveLiteralLength == lengthOfUseStrictLiteral && m_globalData->propertyNames->useStrictIdentifier == *directive) {
- currentScope()->setFlags(StrictModeFlag);
+ setStrictMode();
hasSetStrict = true;
failIfFalse(isValidStrictMode());
m_lexer->setOffset(startOffset);
@@ -252,8 +255,6 @@ template <class TreeBuilder> TreeExpression Parser<LexerType>::parseVarDeclarati
next();
bool hasInitializer = match(EQUAL);
failIfFalseIfStrictWithNameAndMessage(declareVariable(name), "Cannot declare a variable named", name->impl(), "in strict mode.");
- if (m_globalData->propertyNames->arguments == *name)
- currentScope()->setFlags(UsesArgumentsFlag);
context.addVar(name, (hasInitializer || (!m_allowsIn && match(INTOKEN))) ? DeclarationStacks::HasInitializer : 0);
if (hasInitializer) {
int varDivot = tokenStart() + 1;
@@ -288,8 +289,6 @@ template <class TreeBuilder> TreeConstDeclList Parser<LexerType>::parseConstDecl
next();
bool hasInitializer = match(EQUAL);
declareVariable(name);
- if (m_globalData->propertyNames->arguments == *name)
- currentScope()->setFlags(UsesArgumentsFlag);
context.addVar(name, DeclarationStacks::IsConstant | (hasInitializer ? DeclarationStacks::HasInitializer : 0));
TreeExpression initializer = 0;
if (hasInitializer) {
@@ -512,7 +511,7 @@ template <class TreeBuilder> TreeStatement Parser<LexerType>::parseWithStatement
{
ASSERT(match(WITH));
failIfTrueWithMessage(strictMode(), "'with' statements are not valid in strict mode");
- currentScope()->setFlags(UsesWithFlag);
+ currentScope()->setNeedsFullActivation();
int startLine = tokenLine();
next();
consumeOrFail(OPENPAREN);
@@ -527,7 +526,6 @@ template <class TreeBuilder> TreeStatement Parser<LexerType>::parseWithStatement
TreeStatement statement = parseStatement(context, unused);
failIfFalse(statement);
- currentScope()->setFlags(UsesWithFlag);
return context.createWithStatement(m_lexer->lastLineNumber(), expr, statement, start, end, startLine, endLine);
}
@@ -616,15 +614,15 @@ template <class TreeBuilder> TreeStatement Parser<LexerType>::parseTryStatement(
int lastLine = m_lastLine;
if (match(CATCH)) {
- currentScope()->setFlags(UsesCatchFlag);
+ currentScope()->setNeedsFullActivation();
next();
consumeOrFail(OPENPAREN);
matchOrFail(IDENT);
ident = m_token.m_data.ident;
next();
- AutoPopScopeRef catchScope(this, pushScope(currentScope()->modeFlags()));
+ AutoPopScopeRef catchScope(this, pushScope());
failIfFalseIfStrictWithNameAndMessage(declareVariable(ident), "Cannot declare a variable named", ident->impl(), "in strict mode");
- currentScope()->setFlags(BlockScopeFlag | UsesCatchFlag);
+ catchScope->preventNewDecls();
consumeOrFail(CLOSEPAREN);
matchOrFail(OPENBRACE);
catchBlock = parseBlockStatement(context);
@@ -761,7 +759,7 @@ template <typename LexerType>
template <class TreeBuilder> TreeFunctionBody Parser<LexerType>::parseFunctionBody(TreeBuilder& context)
{
if (match(CLOSEBRACE))
- return context.createFunctionBody(m_lexer->lastLineNumber(), currentScope()->modeFlags());
+ return context.createFunctionBody(m_lexer->lastLineNumber(), strictMode());
DepthManager statementDepth(&m_statementDepth);
m_statementDepth = 0;
typename TreeBuilder::FunctionBodyBuilder bodyBuilder(const_cast<JSGlobalData*>(m_globalData), m_lexer.get());
@@ -772,7 +770,8 @@ template <class TreeBuilder> TreeFunctionBody Parser<LexerType>::parseFunctionBo
template <typename LexerType>
template <FunctionRequirements requirements, bool nameIsInContainingScope, class TreeBuilder> bool Parser<LexerType>::parseFunctionInfo(TreeBuilder& context, const Identifier*& name, TreeFormalParameterList& parameters, TreeFunctionBody& body, int& openBracePos, int& closeBracePos, int& bodyStartLine)
{
- AutoPopScopeRef functionScope(this, pushScope(currentScope()->modeFlags() | FunctionModeFlag));
+ AutoPopScopeRef functionScope(this, pushScope());
+ functionScope->setIsFunction();
if (match(IDENT)) {
name = m_token.m_data.ident;
next();
@@ -794,8 +793,8 @@ template <FunctionRequirements requirements, bool nameIsInContainingScope, class
// If we know about this function already, we can use the cached info and skip the parser to the end of the function.
if (const SourceProviderCacheItem* cachedInfo = TreeBuilder::CanUseFunctionCache ? findCachedFunctionInfo(openBracePos) : 0) {
// If we're in a strict context, the cached function info must say it was strict too.
- ASSERT(!strictMode() || (cachedInfo->scopeFlags & StrictModeFlag));
- body = context.createFunctionBody(m_lexer->lastLineNumber(), cachedInfo->scopeFlags);
+ ASSERT(!strictMode() || cachedInfo->strictMode);
+ body = context.createFunctionBody(m_lexer->lastLineNumber(), cachedInfo->strictMode);
functionScope->restoreFunctionInfo(cachedInfo);
failIfFalse(popScope(functionScope, TreeBuilder::NeedsFreeVariableInfo));
@@ -855,8 +854,6 @@ template <class TreeBuilder> TreeStatement Parser<LexerType>::parseFunctionDecla
failIfFalse((parseFunctionInfo<FunctionNeedsName, true>(context, name, parameters, body, openBracePos, closeBracePos, bodyStartLine)));
failIfFalse(name);
failIfFalseIfStrict(declareVariable(name));
- if (*name == m_globalData->propertyNames->arguments)
- currentScope()->setFlags(UsesArgumentsFlag);
return context.createFuncDeclStatement(m_lexer->lastLineNumber(), name, body, parameters, openBracePos, closeBracePos, bodyStartLine, m_lastLine);
}
@@ -1416,18 +1413,13 @@ template <class TreeBuilder> TreeExpression Parser<LexerType>::parsePrimaryExpre
}
case THISTOKEN: {
next();
- currentScope()->setFlags(UsesThisFlag);
return context.thisExpr(m_lexer->lastLineNumber());
}
case IDENT: {
int start = tokenStart();
const Identifier* ident = m_token.m_data.ident;
next();
- if (m_globalData->propertyNames->eval == *ident)
- currentScope()->setFlags(UsesEvalFlag);
- else if (m_globalData->propertyNames->arguments == *ident)
- currentScope()->setFlags(UsesArgumentsFlag);
- currentScope()->useVariable(ident);
+ currentScope()->useVariable(ident, m_globalData->propertyNames->eval == *ident);
m_lastIdentifier = ident;
return context.createResolve(m_lexer->lastLineNumber(), ident, start);
}
diff --git a/Source/JavaScriptCore/parser/Parser.h b/Source/JavaScriptCore/parser/Parser.h
index c0b13c53a..c2a11d665 100644
--- a/Source/JavaScriptCore/parser/Parser.h
+++ b/Source/JavaScriptCore/parser/Parser.h
@@ -130,19 +130,30 @@ struct ScopeLabelInfo {
};
struct Scope {
- Scope(const JSGlobalData* globalData, ScopeFlags scopeFlags)
+ Scope(const JSGlobalData* globalData, bool isFunction, bool strictMode)
: m_globalData(globalData)
- , m_scopeFlags(scopeFlags)
+ , m_shadowsArguments(false)
+ , m_usesEval(false)
+ , m_needsFullActivation(false)
+ , m_allowsNewDecls(true)
+ , m_strictMode(strictMode)
+ , m_isFunction(isFunction)
+ , m_isFunctionBoundary(false)
, m_isValidStrictMode(true)
, m_loopDepth(0)
, m_switchDepth(0)
{
- ASSERT(!(scopeFlags & ~AllScopeModeFlags));
}
Scope(const Scope& rhs)
: m_globalData(rhs.m_globalData)
- , m_scopeFlags(rhs.m_scopeFlags)
+ , m_shadowsArguments(rhs.m_shadowsArguments)
+ , m_usesEval(rhs.m_usesEval)
+ , m_needsFullActivation(rhs.m_needsFullActivation)
+ , m_allowsNewDecls(rhs.m_allowsNewDecls)
+ , m_strictMode(rhs.m_strictMode)
+ , m_isFunction(rhs.m_isFunction)
+ , m_isFunctionBoundary(rhs.m_isFunctionBoundary)
, m_isValidStrictMode(rhs.m_isValidStrictMode)
, m_loopDepth(rhs.m_loopDepth)
, m_switchDepth(rhs.m_switchDepth)
@@ -157,22 +168,6 @@ struct Scope {
}
}
- ALWAYS_INLINE ScopeFlags scopeFlags() const { return m_scopeFlags; }
- ALWAYS_INLINE ScopeFlags modeFlags() const { return m_scopeFlags & AllScopeModeFlags; }
- ALWAYS_INLINE ScopeFlags usesFlags() const { return m_scopeFlags & AllScopeUsesFlags; }
- ALWAYS_INLINE void setFlags(ScopeFlags scopeFlags) { m_scopeFlags |= scopeFlags; }
-
- ALWAYS_INLINE bool usesEval() const { return m_scopeFlags & UsesEvalFlag; }
- ALWAYS_INLINE bool strictMode() const { return m_scopeFlags & StrictModeFlag; }
- ALWAYS_INLINE bool shadowsArguments() const { return m_scopeFlags & ShadowsArgumentsFlag; }
- ALWAYS_INLINE bool isFunction() const { return m_scopeFlags & FunctionModeFlag; }
- ALWAYS_INLINE bool isBlockScope() const { return m_scopeFlags & BlockScopeFlag; }
- ALWAYS_INLINE bool isFunctionBoundary() const { return isFunction() && !isBlockScope(); }
-
- ALWAYS_INLINE bool allowsNewDecls() const { return !isBlockScope(); }
-
- ALWAYS_INLINE bool isValidStrictMode() const { return m_isValidStrictMode; }
-
void startSwitch() { m_switchDepth++; }
void endSwitch() { m_switchDepth--; }
void startLoop() { m_loopDepth++; }
@@ -206,6 +201,14 @@ struct Scope {
return 0;
}
+ void setIsFunction()
+ {
+ m_isFunction = true;
+ m_isFunctionBoundary = true;
+ }
+ bool isFunction() { return m_isFunction; }
+ bool isFunctionBoundary() { return m_isFunctionBoundary; }
+
bool declareVariable(const Identifier* ident)
{
bool isValidStrictMode = m_globalData->propertyNames->eval != *ident && m_globalData->propertyNames->arguments != *ident;
@@ -216,28 +219,35 @@ struct Scope {
void declareWrite(const Identifier* ident)
{
- ASSERT(strictMode());
+ ASSERT(m_strictMode);
m_writtenVariables.add(ident->impl());
}
+ void preventNewDecls() { m_allowsNewDecls = false; }
+ bool allowsNewDecls() const { return m_allowsNewDecls; }
+
bool declareParameter(const Identifier* ident)
{
bool isArguments = m_globalData->propertyNames->arguments == *ident;
bool isValidStrictMode = m_declaredVariables.add(ident->ustring().impl()).isNewEntry && m_globalData->propertyNames->eval != *ident && !isArguments;
m_isValidStrictMode = m_isValidStrictMode && isValidStrictMode;
if (isArguments)
- setFlags(ShadowsArgumentsFlag);
+ m_shadowsArguments = true;
return isValidStrictMode;
}
- void useVariable(const Identifier* ident)
+ void useVariable(const Identifier* ident, bool isEval)
{
+ m_usesEval |= isEval;
m_usedVariables.add(ident->ustring().impl());
}
+ void setNeedsFullActivation() { m_needsFullActivation = true; }
+
bool collectFreeVariables(Scope* nestedScope, bool shouldTrackClosedVariables)
{
- setFlags(nestedScope->usesFlags());
+ if (nestedScope->m_usesEval)
+ m_usesEval = true;
IdentifierSet::iterator end = nestedScope->m_usedVariables.end();
for (IdentifierSet::iterator ptr = nestedScope->m_usedVariables.begin(); ptr != end; ++ptr) {
if (nestedScope->m_declaredVariables.contains(*ptr))
@@ -269,7 +279,7 @@ struct Scope {
void getCapturedVariables(IdentifierSet& capturedVariables)
{
- if (usesEval()) {
+ if (m_needsFullActivation || m_usesEval) {
capturedVariables.swap(m_declaredVariables);
return;
}
@@ -279,6 +289,11 @@ struct Scope {
capturedVariables.add(*ptr);
}
}
+ void setStrictMode() { m_strictMode = true; }
+ bool strictMode() const { return m_strictMode; }
+ bool isValidStrictMode() const { return m_isValidStrictMode; }
+ bool shadowsArguments() const { return m_shadowsArguments; }
+
void copyCapturedVariablesToVector(const IdentifierSet& capturedVariables, Vector<RefPtr<StringImpl> >& vector)
{
IdentifierSet::iterator end = capturedVariables.end();
@@ -292,16 +307,20 @@ struct Scope {
void saveFunctionInfo(SourceProviderCacheItem* info)
{
- ASSERT(isFunction());
- info->scopeFlags = m_scopeFlags;
+ ASSERT(m_isFunction);
+ info->usesEval = m_usesEval;
+ info->strictMode = m_strictMode;
+ info->needsFullActivation = m_needsFullActivation;
copyCapturedVariablesToVector(m_writtenVariables, info->writtenVariables);
copyCapturedVariablesToVector(m_usedVariables, info->usedVariables);
}
void restoreFunctionInfo(const SourceProviderCacheItem* info)
{
- ASSERT(isFunction());
- m_scopeFlags |= info->scopeFlags;
+ ASSERT(m_isFunction);
+ m_usesEval = info->usesEval;
+ m_strictMode = info->strictMode;
+ m_needsFullActivation = info->needsFullActivation;
unsigned size = info->usedVariables.size();
for (unsigned i = 0; i < size; ++i)
m_usedVariables.add(info->usedVariables[i]);
@@ -312,7 +331,13 @@ struct Scope {
private:
const JSGlobalData* m_globalData;
- ScopeFlags m_scopeFlags;
+ bool m_shadowsArguments : 1;
+ bool m_usesEval : 1;
+ bool m_needsFullActivation : 1;
+ bool m_allowsNewDecls : 1;
+ bool m_strictMode : 1;
+ bool m_isFunction : 1;
+ bool m_isFunctionBoundary : 1;
bool m_isValidStrictMode : 1;
int m_loopDepth;
int m_switchDepth;
@@ -402,14 +427,20 @@ private:
Parser* m_parser;
};
- ALWAYS_INLINE ScopeRef currentScope()
+ ScopeRef currentScope()
{
return ScopeRef(&m_scopeStack, m_scopeStack.size() - 1);
}
- ScopeRef pushScope(ScopeFlags scopeFlags)
+ ScopeRef pushScope()
{
- m_scopeStack.append(Scope(m_globalData, scopeFlags));
+ bool isFunction = false;
+ bool isStrict = false;
+ if (!m_scopeStack.isEmpty()) {
+ isStrict = m_scopeStack.last().strictMode();
+ isFunction = m_scopeStack.last().isFunction();
+ }
+ m_scopeStack.append(Scope(m_globalData, isFunction, isStrict));
return currentScope();
}
@@ -461,7 +492,7 @@ private:
UString parseInner();
void didFinishParsing(SourceElements*, ParserArenaData<DeclarationStacks::VarStack>*,
- ParserArenaData<DeclarationStacks::FunctionStack>*, ScopeFlags,
+ ParserArenaData<DeclarationStacks::FunctionStack>*, CodeFeatures,
int, int, IdentifierSet&);
// Used to determine type of error to report.
@@ -792,13 +823,14 @@ private:
m_errorMessage = UString(msg);
}
- ALWAYS_INLINE void startLoop() { currentScope()->startLoop(); }
- ALWAYS_INLINE void endLoop() { currentScope()->endLoop(); }
- ALWAYS_INLINE void startSwitch() { currentScope()->startSwitch(); }
- ALWAYS_INLINE void endSwitch() { currentScope()->endSwitch(); }
- ALWAYS_INLINE bool strictMode() { return currentScope()->strictMode(); }
- ALWAYS_INLINE bool isValidStrictMode() { return currentScope()->isValidStrictMode(); }
- ALWAYS_INLINE bool declareParameter(const Identifier* ident) { return currentScope()->declareParameter(ident); }
+ void startLoop() { currentScope()->startLoop(); }
+ void endLoop() { currentScope()->endLoop(); }
+ void startSwitch() { currentScope()->startSwitch(); }
+ void endSwitch() { currentScope()->endSwitch(); }
+ void setStrictMode() { currentScope()->setStrictMode(); }
+ bool strictMode() { return currentScope()->strictMode(); }
+ bool isValidStrictMode() { return currentScope()->isValidStrictMode(); }
+ bool declareParameter(const Identifier* ident) { return currentScope()->declareParameter(ident); }
bool breakIsValid()
{
ScopeRef current = currentScope();
@@ -917,7 +949,7 @@ private:
ParserArenaData<DeclarationStacks::VarStack>* m_varDeclarations;
ParserArenaData<DeclarationStacks::FunctionStack>* m_funcDeclarations;
IdentifierSet m_capturedVariables;
- ScopeFlags m_scopeFlags;
+ CodeFeatures m_features;
int m_numConstants;
struct DepthManager {
@@ -978,7 +1010,7 @@ PassRefPtr<ParsedNode> Parser<LexerType>::parse(JSGlobalObject* lexicalGlobalObj
m_funcDeclarations ? &m_funcDeclarations->data : 0,
m_capturedVariables,
*m_source,
- m_scopeFlags,
+ m_features,
m_numConstants);
result->setLoc(m_source->firstLine(), m_lastLine);
} else if (lexicalGlobalObject) {
diff --git a/Source/JavaScriptCore/parser/SourceProviderCacheItem.h b/Source/JavaScriptCore/parser/SourceProviderCacheItem.h
index ad7a759ce..3662367a0 100644
--- a/Source/JavaScriptCore/parser/SourceProviderCacheItem.h
+++ b/Source/JavaScriptCore/parser/SourceProviderCacheItem.h
@@ -61,7 +61,9 @@ public:
int closeBraceLine;
int closeBracePos;
- unsigned short scopeFlags;
+ bool usesEval;
+ bool strictMode;
+ bool needsFullActivation;
Vector<RefPtr<StringImpl> > usedVariables;
Vector<RefPtr<StringImpl> > writtenVariables;
};
diff --git a/Source/JavaScriptCore/parser/SyntaxChecker.h b/Source/JavaScriptCore/parser/SyntaxChecker.h
index 2acb5097d..c2c93756d 100644
--- a/Source/JavaScriptCore/parser/SyntaxChecker.h
+++ b/Source/JavaScriptCore/parser/SyntaxChecker.h
@@ -220,6 +220,7 @@ public:
void appendStatement(int, int) { }
void addVar(const Identifier*, bool) { }
int combineCommaNodes(int, int, int) { return 1; }
+ int evalCount() const { return 0; }
void appendBinaryExpressionInfo(int& operandStackDepth, int expr, int, int, int, bool)
{
if (!m_topBinaryExpr)
diff --git a/Source/JavaScriptCore/runtime/Executable.cpp b/Source/JavaScriptCore/runtime/Executable.cpp
index 934533c46..3690c2c33 100644
--- a/Source/JavaScriptCore/runtime/Executable.cpp
+++ b/Source/JavaScriptCore/runtime/Executable.cpp
@@ -225,7 +225,7 @@ JSObject* EvalExecutable::compileInternal(ExecState* exec, ScopeChainNode* scope
ASSERT(exception);
return exception;
}
- recordParse(evalNode->scopeFlags(), evalNode->hasCapturedVariables(), evalNode->lineNo(), evalNode->lastLine());
+ recordParse(evalNode->features(), evalNode->hasCapturedVariables(), evalNode->lineNo(), evalNode->lastLine());
JSGlobalObject* globalObject = scopeChainNode->globalObject.get();
@@ -357,7 +357,7 @@ JSObject* ProgramExecutable::compileInternal(ExecState* exec, ScopeChainNode* sc
ASSERT(exception);
return exception;
}
- recordParse(programNode->scopeFlags(), programNode->hasCapturedVariables(), programNode->lineNo(), programNode->lastLine());
+ recordParse(programNode->features(), programNode->hasCapturedVariables(), programNode->lineNo(), programNode->lastLine());
JSGlobalObject* globalObject = scopeChainNode->globalObject.get();
@@ -512,7 +512,7 @@ PassOwnPtr<FunctionCodeBlock> FunctionExecutable::produceCodeBlockFor(ScopeChain
if (m_forceUsesArguments)
body->setUsesArguments();
body->finishParsing(m_parameters, m_name);
- recordParse(body->scopeFlags(), body->hasCapturedVariables(), body->lineNo(), body->lastLine());
+ recordParse(body->features(), body->hasCapturedVariables(), body->lineNo(), body->lastLine());
OwnPtr<FunctionCodeBlock> result;
ASSERT((compilationKind == FirstCompilation) == !codeBlockFor(specializationKind));
diff --git a/Source/JavaScriptCore/runtime/Executable.h b/Source/JavaScriptCore/runtime/Executable.h
index 3b979ba82..b9d3e6ee1 100644
--- a/Source/JavaScriptCore/runtime/Executable.h
+++ b/Source/JavaScriptCore/runtime/Executable.h
@@ -271,14 +271,14 @@ namespace JSC {
ScriptExecutable(Structure* structure, JSGlobalData& globalData, const SourceCode& source, bool isInStrictContext)
: ExecutableBase(globalData, structure, NUM_PARAMETERS_NOT_COMPILED)
, m_source(source)
- , m_scopeFlags(isInStrictContext ? StrictModeFlag : NoScopeFlags)
+ , m_features(isInStrictContext ? StrictModeFeature : 0)
{
}
ScriptExecutable(Structure* structure, ExecState* exec, const SourceCode& source, bool isInStrictContext)
: ExecutableBase(exec->globalData(), structure, NUM_PARAMETERS_NOT_COMPILED)
, m_source(source)
- , m_scopeFlags(isInStrictContext ? StrictModeFlag : NoScopeFlags)
+ , m_features(isInStrictContext ? StrictModeFeature : 0)
{
}
@@ -292,10 +292,10 @@ namespace JSC {
int lineNo() const { return m_firstLine; }
int lastLine() const { return m_lastLine; }
- bool usesEval() const { return m_scopeFlags & UsesEvalFlag; }
- bool usesArguments() const { return m_scopeFlags & UsesArgumentsFlag; }
- bool needsActivation() const { return m_hasCapturedVariables || m_scopeFlags & (UsesEvalFlag | UsesWithFlag | UsesCatchFlag); }
- bool isStrictMode() const { return m_scopeFlags & StrictModeFlag; }
+ bool usesEval() const { return m_features & EvalFeature; }
+ bool usesArguments() const { return m_features & ArgumentsFeature; }
+ bool needsActivation() const { return m_hasCapturedVariables || m_features & (EvalFeature | WithFeature | CatchFeature); }
+ bool isStrictMode() const { return m_features & StrictModeFeature; }
void unlinkCalls();
@@ -311,16 +311,16 @@ namespace JSC {
#endif
}
- void recordParse(ScopeFlags scopeFlags, bool hasCapturedVariables, int firstLine, int lastLine)
+ void recordParse(CodeFeatures features, bool hasCapturedVariables, int firstLine, int lastLine)
{
- m_scopeFlags = scopeFlags;
+ m_features = features;
m_hasCapturedVariables = hasCapturedVariables;
m_firstLine = firstLine;
m_lastLine = lastLine;
}
SourceCode m_source;
- ScopeFlags m_scopeFlags;
+ CodeFeatures m_features;
bool m_hasCapturedVariables;
int m_firstLine;
int m_lastLine;
diff --git a/Source/JavaScriptCore/runtime/JSFunction.cpp b/Source/JavaScriptCore/runtime/JSFunction.cpp
index 243946ba9..563325ab0 100644
--- a/Source/JavaScriptCore/runtime/JSFunction.cpp
+++ b/Source/JavaScriptCore/runtime/JSFunction.cpp
@@ -112,6 +112,16 @@ void JSFunction::finishCreation(ExecState* exec, FunctionExecutable* executable,
putDirectOffset(exec->globalData(), scopeChainNode->globalObject->functionNameOffset(), executable->nameValue());
}
+Structure* JSFunction::cacheInheritorID(ExecState* exec)
+{
+ JSValue prototype = get(exec, exec->globalData().propertyNames->prototype);
+ if (prototype.isObject())
+ m_cachedInheritorID.set(exec->globalData(), this, asObject(prototype)->inheritorID(exec->globalData()));
+ else
+ m_cachedInheritorID.set(exec->globalData(), this, globalObject()->emptyObjectStructure());
+ return m_cachedInheritorID.get();
+}
+
const UString& JSFunction::name(ExecState* exec)
{
return asString(getDirect(exec->globalData(), exec->globalData().propertyNames->name))->tryGetValue();
@@ -332,6 +342,7 @@ void JSFunction::put(JSCell* cell, ExecState* exec, const Identifier& propertyNa
// following the rules set out in ECMA-262 8.12.9.
PropertySlot slot;
thisObject->methodTable()->getOwnPropertySlot(thisObject, exec, propertyName, slot);
+ thisObject->m_cachedInheritorID.clear();
}
if (thisObject->jsExecutable()->isStrictMode() && (propertyName == exec->propertyNames().arguments || propertyName == exec->propertyNames().caller)) {
// This will trigger the property to be reified, if this is not already the case!
@@ -372,6 +383,7 @@ bool JSFunction::defineOwnProperty(JSObject* object, ExecState* exec, const Iden
// following the rules set out in ECMA-262 8.12.9.
PropertySlot slot;
thisObject->methodTable()->getOwnPropertySlot(thisObject, exec, propertyName, slot);
+ thisObject->m_cachedInheritorID.clear();
return Base::defineOwnProperty(object, exec, propertyName, descriptor, throwException);
}
diff --git a/Source/JavaScriptCore/runtime/JSFunction.h b/Source/JavaScriptCore/runtime/JSFunction.h
index 5553115bf..9de66d721 100644
--- a/Source/JavaScriptCore/runtime/JSFunction.h
+++ b/Source/JavaScriptCore/runtime/JSFunction.h
@@ -121,6 +121,18 @@ namespace JSC {
return OBJECT_OFFSETOF(JSFunction, m_executable);
}
+ Structure* cachedInheritorID(ExecState* exec)
+ {
+ if (UNLIKELY(!m_cachedInheritorID))
+ return cacheInheritorID(exec);
+ return m_cachedInheritorID.get();
+ }
+
+ static size_t offsetOfCachedInheritorID()
+ {
+ return OBJECT_OFFSETOF(JSFunction, m_cachedInheritorID);
+ }
+
protected:
const static unsigned StructureFlags = OverridesGetOwnPropertySlot | ImplementsHasInstance | OverridesVisitChildren | OverridesGetPropertyNames | JSObject::StructureFlags;
@@ -130,6 +142,8 @@ namespace JSC {
void finishCreation(ExecState*, NativeExecutable*, int length, const Identifier& name);
void finishCreation(ExecState*, FunctionExecutable*, ScopeChainNode*);
+ Structure* cacheInheritorID(ExecState*);
+
static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier&, PropertySlot&);
static bool getOwnPropertyDescriptor(JSObject*, ExecState*, const Identifier&, PropertyDescriptor&);
static void getOwnPropertyNames(JSObject*, ExecState*, PropertyNameArray&, EnumerationMode = ExcludeDontEnumProperties);
@@ -152,6 +166,7 @@ namespace JSC {
WriteBarrier<ExecutableBase> m_executable;
WriteBarrier<ScopeChainNode> m_scopeChain;
+ WriteBarrier<Structure> m_cachedInheritorID;
};
inline bool JSValue::isFunction() const
diff --git a/Source/JavaScriptCore/runtime/JSObject.cpp b/Source/JavaScriptCore/runtime/JSObject.cpp
index 500f3891a..a8c6c3f3f 100644
--- a/Source/JavaScriptCore/runtime/JSObject.cpp
+++ b/Source/JavaScriptCore/runtime/JSObject.cpp
@@ -552,7 +552,7 @@ Structure* JSObject::createInheritorID(JSGlobalData& globalData)
return m_inheritorID.get();
}
-PropertyStorage JSObject::growPropertyStorage(JSGlobalData& globalData, size_t oldSize, size_t newSize)
+void JSObject::allocatePropertyStorage(JSGlobalData& globalData, size_t oldSize, size_t newSize)
{
ASSERT(newSize > oldSize);
@@ -580,7 +580,7 @@ PropertyStorage JSObject::growPropertyStorage(JSGlobalData& globalData, size_t o
}
ASSERT(newPropertyStorage);
- return newPropertyStorage;
+ m_propertyStorage.set(globalData, this, newPropertyStorage);
}
bool JSObject::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
diff --git a/Source/JavaScriptCore/runtime/JSObject.h b/Source/JavaScriptCore/runtime/JSObject.h
index d95860d62..7345bb700 100644
--- a/Source/JavaScriptCore/runtime/JSObject.h
+++ b/Source/JavaScriptCore/runtime/JSObject.h
@@ -212,9 +212,8 @@ namespace JSC {
bool staticFunctionsReified() { return structure()->staticFunctionsReified(); }
void reifyStaticFunctionsForDelete(ExecState* exec);
- JS_EXPORT_PRIVATE PropertyStorage growPropertyStorage(JSGlobalData&, size_t oldSize, size_t newSize);
+ JS_EXPORT_PRIVATE void allocatePropertyStorage(JSGlobalData&, size_t oldSize, size_t newSize);
bool isUsingInlineStorage() const { return static_cast<const void*>(m_propertyStorage.get()) == static_cast<const void*>(this + 1); }
- void setPropertyStorage(JSGlobalData&, PropertyStorage, Structure*);
void* addressOfPropertyStorage()
{
@@ -453,14 +452,6 @@ inline bool JSObject::isGlobalThis() const
return structure()->typeInfo().type() == GlobalThisType;
}
-inline void JSObject::setPropertyStorage(JSGlobalData& globalData, PropertyStorage storage, Structure* structure)
-{
- ASSERT(storage);
- ASSERT(structure);
- setStructure(globalData, structure);
- m_propertyStorage.set(globalData, this, storage);
-}
-
inline JSObject* constructEmptyObject(ExecState* exec, Structure* structure)
{
return JSFinalObject::create(exec, structure);
@@ -672,11 +663,10 @@ inline bool JSObject::putDirectInternal(JSGlobalData& globalData, const Identifi
if ((mode == PutModePut) && !isExtensible())
return false;
- PropertyStorage newStorage = propertyStorage();
- if (structure()->shouldGrowPropertyStorage())
- newStorage = growPropertyStorage(globalData, structure()->propertyStorageCapacity(), structure()->suggestedNewPropertyStorageSize());
+ size_t currentCapacity = structure()->propertyStorageCapacity();
offset = structure()->addPropertyWithoutTransition(globalData, propertyName, attributes, specificFunction);
- setPropertyStorage(globalData, newStorage, structure());
+ if (currentCapacity != structure()->propertyStorageCapacity())
+ allocatePropertyStorage(globalData, currentCapacity, structure()->propertyStorageCapacity());
ASSERT(offset < structure()->propertyStorageCapacity());
putDirectOffset(globalData, offset, value);
@@ -688,13 +678,12 @@ inline bool JSObject::putDirectInternal(JSGlobalData& globalData, const Identifi
size_t offset;
size_t currentCapacity = structure()->propertyStorageCapacity();
- if (Structure* structure = Structure::addPropertyTransitionToExistingStructure(this->structure(), propertyName, attributes, specificFunction, offset)) {
- PropertyStorage newStorage = propertyStorage();
+ if (Structure* structure = Structure::addPropertyTransitionToExistingStructure(this->structure(), propertyName, attributes, specificFunction, offset)) {
if (currentCapacity != structure->propertyStorageCapacity())
- newStorage = growPropertyStorage(globalData, currentCapacity, structure->propertyStorageCapacity());
+ allocatePropertyStorage(globalData, currentCapacity, structure->propertyStorageCapacity());
ASSERT(offset < structure->propertyStorageCapacity());
- setPropertyStorage(globalData, newStorage, structure);
+ setStructure(globalData, structure);
putDirectOffset(globalData, offset, value);
// This is a new property; transitions with specific values are not currently cachable,
// so leave the slot in an uncachable state.
@@ -738,14 +727,13 @@ inline bool JSObject::putDirectInternal(JSGlobalData& globalData, const Identifi
if ((mode == PutModePut) && !isExtensible())
return false;
- PropertyStorage newStorage = propertyStorage();
- if (structure()->shouldGrowPropertyStorage())
- newStorage = growPropertyStorage(globalData, structure()->propertyStorageCapacity(), structure()->suggestedNewPropertyStorageSize());
-
Structure* structure = Structure::addPropertyTransition(globalData, this->structure(), propertyName, attributes, specificFunction, offset);
+ if (currentCapacity != structure->propertyStorageCapacity())
+ allocatePropertyStorage(globalData, currentCapacity, structure->propertyStorageCapacity());
+
ASSERT(offset < structure->propertyStorageCapacity());
- setPropertyStorage(globalData, newStorage, structure);
+ setStructure(globalData, structure);
putDirectOffset(globalData, offset, value);
// This is a new property; transitions with specific values are not currently cachable,
// so leave the slot in an uncachable state.
@@ -779,20 +767,18 @@ inline void JSObject::putDirect(JSGlobalData& globalData, const Identifier& prop
inline void JSObject::putDirectWithoutTransition(JSGlobalData& globalData, const Identifier& propertyName, JSValue value, unsigned attributes)
{
ASSERT(!value.isGetterSetter() && !(attributes & Accessor));
- PropertyStorage newStorage = propertyStorage();
- if (structure()->shouldGrowPropertyStorage())
- newStorage = growPropertyStorage(globalData, structure()->propertyStorageCapacity(), structure()->suggestedNewPropertyStorageSize());
+ size_t currentCapacity = structure()->propertyStorageCapacity();
size_t offset = structure()->addPropertyWithoutTransition(globalData, propertyName, attributes, getJSFunction(value));
- setPropertyStorage(globalData, newStorage, structure());
+ if (currentCapacity != structure()->propertyStorageCapacity())
+ allocatePropertyStorage(globalData, currentCapacity, structure()->propertyStorageCapacity());
putDirectOffset(globalData, offset, value);
}
inline void JSObject::transitionTo(JSGlobalData& globalData, Structure* newStructure)
{
- PropertyStorage newStorage = propertyStorage();
if (structure()->propertyStorageCapacity() != newStructure->propertyStorageCapacity())
- newStorage = growPropertyStorage(globalData, structure()->propertyStorageCapacity(), newStructure->propertyStorageCapacity());
- setPropertyStorage(globalData, newStorage, newStructure);
+ allocatePropertyStorage(globalData, structure()->propertyStorageCapacity(), newStructure->propertyStorageCapacity());
+ setStructure(globalData, newStructure);
}
inline JSValue JSObject::toPrimitive(ExecState* exec, PreferredPrimitiveType preferredType) const
diff --git a/Source/JavaScriptCore/runtime/JSString.h b/Source/JavaScriptCore/runtime/JSString.h
index 10ec799e5..c95233deb 100644
--- a/Source/JavaScriptCore/runtime/JSString.h
+++ b/Source/JavaScriptCore/runtime/JSString.h
@@ -67,6 +67,7 @@ namespace JSC {
friend class JSGlobalData;
friend class SpecializedThunkJIT;
friend class JSRopeString;
+ friend class MarkStack;
friend struct ThunkHelpers;
typedef JSCell Base;
@@ -91,6 +92,7 @@ namespace JSC {
Base::finishCreation(globalData);
m_length = length;
m_is8Bit = m_value.impl()->is8Bit();
+ m_isHashConstSingleton = false;
}
void finishCreation(JSGlobalData& globalData, size_t length, size_t cost)
@@ -99,6 +101,7 @@ namespace JSC {
Base::finishCreation(globalData);
m_length = length;
m_is8Bit = m_value.impl()->is8Bit();
+ m_isHashConstSingleton = false;
Heap::heap(this)->reportExtraMemoryCost(cost);
}
@@ -108,6 +111,7 @@ namespace JSC {
Base::finishCreation(globalData);
m_length = 0;
m_is8Bit = true;
+ m_isHashConstSingleton = false;
}
public:
@@ -161,9 +165,13 @@ namespace JSC {
protected:
bool isRope() const { return m_value.isNull(); }
bool is8Bit() const { return m_is8Bit; }
+ bool isHashConstSingleton() const { return m_isHashConstSingleton; }
+ void clearHashConstSingleton() { m_isHashConstSingleton = false; }
+ void setHashConstSingleton() { m_isHashConstSingleton = true; }
// A string is represented either by a UString or a rope of fibers.
bool m_is8Bit : 1;
+ bool m_isHashConstSingleton : 1;
unsigned m_length;
mutable UString m_value;
@@ -233,6 +241,7 @@ namespace JSC {
Base::finishCreation(globalData);
m_length = s1->length() + s2->length();
m_is8Bit = (s1->is8Bit() && s2->is8Bit());
+ m_isHashConstSingleton = false;
m_fibers[0].set(globalData, this, s1);
m_fibers[1].set(globalData, this, s2);
}
@@ -242,6 +251,7 @@ namespace JSC {
Base::finishCreation(globalData);
m_length = s1->length() + s2->length() + s3->length();
m_is8Bit = (s1->is8Bit() && s2->is8Bit() && s3->is8Bit());
+ m_isHashConstSingleton = false;
m_fibers[0].set(globalData, this, s1);
m_fibers[1].set(globalData, this, s2);
m_fibers[2].set(globalData, this, s3);
diff --git a/Source/JavaScriptCore/runtime/Structure.cpp b/Source/JavaScriptCore/runtime/Structure.cpp
index 074c8b354..ac4b4f1fe 100644
--- a/Source/JavaScriptCore/runtime/Structure.cpp
+++ b/Source/JavaScriptCore/runtime/Structure.cpp
@@ -267,13 +267,6 @@ void Structure::growPropertyStorageCapacity()
m_propertyStorageCapacity *= 2;
}
-size_t Structure::suggestedNewPropertyStorageSize()
-{
- if (isUsingInlineStorage())
- return JSObject::baseExternalStorageCapacity;
- return m_propertyStorageCapacity * 2;
-}
-
void Structure::despecifyDictionaryFunction(JSGlobalData& globalData, const Identifier& propertyName)
{
StringImpl* rep = propertyName.impl();
diff --git a/Source/JavaScriptCore/runtime/Structure.h b/Source/JavaScriptCore/runtime/Structure.h
index 00bc76177..ee580e245 100644
--- a/Source/JavaScriptCore/runtime/Structure.h
+++ b/Source/JavaScriptCore/runtime/Structure.h
@@ -102,8 +102,6 @@ namespace JSC {
bool isFrozen(JSGlobalData&);
bool isExtensible() const { return !m_preventExtensions; }
bool didTransition() const { return m_didTransition; }
- bool shouldGrowPropertyStorage() { return propertyStorageCapacity() == propertyStorageSize(); }
- JS_EXPORT_PRIVATE size_t suggestedNewPropertyStorageSize();
Structure* flattenDictionaryStructure(JSGlobalData&, JSObject*);
diff --git a/Source/Platform/ChangeLog b/Source/Platform/ChangeLog
index bb21c9c86..627c7e0ff 100644
--- a/Source/Platform/ChangeLog
+++ b/Source/Platform/ChangeLog
@@ -1,3 +1,158 @@
+2012-05-10 Mark Pilgrim <pilgrim@chromium.org>
+
+ [Chromium] Remove WEBKIT_USING_SKIA ifdefs that are always true
+ https://bugs.webkit.org/show_bug.cgi?id=86121
+
+ Reviewed by Adam Barth.
+
+ Chromium always uses Skia now, so this just removes the barriers
+ around code that was previously #if'd.
+
+ * chromium/public/WebCanvas.h:
+ (WebKit):
+ * chromium/public/WebGraphicsContext3D.h:
+ (WebGraphicsContext3D):
+ (WebKit::WebGraphicsContext3D::onCreateGrGLInterface):
+ * chromium/public/WebImage.h:
+ (WebImage):
+
+2012-05-10 Mark Pilgrim <pilgrim@chromium.org>
+
+ [Chromium] Remove dead code behind unused WEBKIT_USING_CG
+ https://bugs.webkit.org/show_bug.cgi?id=86018
+
+ Reviewed by Adam Barth.
+
+ We never use CoreGraphics as the backend for GraphicsContext in
+ Chromium, so this is all dead code.
+
+ * chromium/public/WebCanvas.h:
+ (WebKit):
+ * chromium/public/WebImage.h:
+ (WebImage):
+
+2012-05-09 Mark Pilgrim <pilgrim@chromium.org>
+
+ [Chromium] Move clipboard to Platform.h
+ https://bugs.webkit.org/show_bug.cgi?id=85758
+
+ Reviewed by Adam Barth.
+
+ Part of a refactoring series. See tracking bug 82948.
+
+ * Platform.gypi:
+ * chromium/public/Platform.h:
+ (WebKit):
+ (Platform):
+ (WebKit::Platform::clipboard):
+ * chromium/public/WebClipboard.h: Added.
+ (WebKit):
+ (WebClipboard):
+ (WebKit::WebClipboard::sequenceNumber):
+ (WebKit::WebClipboard::isFormatAvailable):
+ (WebKit::WebClipboard::readAvailableTypes):
+ (WebKit::WebClipboard::readPlainText):
+ (WebKit::WebClipboard::readHTML):
+ (WebKit::WebClipboard::readImage):
+ (WebKit::WebClipboard::readCustomData):
+ (WebKit::WebClipboard::writePlainText):
+ (WebKit::WebClipboard::writeHTML):
+ (WebKit::WebClipboard::writeURL):
+ (WebKit::WebClipboard::writeImage):
+ (WebKit::WebClipboard::writeDataObject):
+ (WebKit::WebClipboard::~WebClipboard):
+ * chromium/public/WebDragData.h: Added.
+ (WebKit):
+ (WebDragData):
+ (WebKit::WebDragData::~WebDragData):
+ (WebKit::WebDragData::WebDragData):
+ (WebKit::WebDragData::operator=):
+ (WebKit::WebDragData::isNull):
+ * chromium/public/WebImage.h: Added.
+ (WebKit):
+ (WebImage):
+ (WebKit::WebImage::~WebImage):
+ (WebKit::WebImage::WebImage):
+ (WebKit::WebImage::operator=):
+ (WebKit::WebImage::getSkBitmap):
+ (WebKit::WebImage::init):
+ (WebKit::WebImage::getCGImageRef):
+
+2012-05-09 Tommy Widenflycht <tommyw@google.com>
+
+ MediaStream API: Adding the possibility of port specific information in MediaStreamDescriptor
+ https://bugs.webkit.org/show_bug.cgi?id=85794
+
+ Reviewed by Adam Barth.
+
+ To facilitate for ports I have added an ExtraData field that can be used for whatever purpose is needed.
+
+ * chromium/public/WebMediaStreamDescriptor.h:
+ (ExtraData):
+ (WebKit::WebMediaStreamDescriptor::ExtraData::~ExtraData):
+ (WebMediaStreamDescriptor):
+
+2012-05-07 Mark Pilgrim <pilgrim@chromium.org>
+
+ [Chromium] Move fileSystem to Platform.h
+ https://bugs.webkit.org/show_bug.cgi?id=85760
+
+ Reviewed by Adam Barth.
+
+ Part of a refactoring series. See tracking bug 82948.
+
+ * Platform.gypi:
+ * chromium/public/Platform.h:
+ (WebKit):
+ (Platform):
+ (WebKit::Platform::fileSystem):
+ * chromium/public/WebFileSystem.h: Added.
+ (WebKit):
+ (WebFileSystem):
+ (WebKit::WebFileSystem::move):
+ (WebKit::WebFileSystem::copy):
+ (WebKit::WebFileSystem::remove):
+ (WebKit::WebFileSystem::removeRecursively):
+ (WebKit::WebFileSystem::readMetadata):
+ (WebKit::WebFileSystem::createFile):
+ (WebKit::WebFileSystem::createDirectory):
+ (WebKit::WebFileSystem::fileExists):
+ (WebKit::WebFileSystem::directoryExists):
+ (WebKit::WebFileSystem::readDirectory):
+ (WebKit::WebFileSystem::createFileWriter):
+ (WebKit::WebFileSystem::createSnapshotFileAndReadMetadata):
+ (WebKit::WebFileSystem::~WebFileSystem):
+
+2012-05-07 Tommy Widenflycht <tommyw@google.com>
+
+ MediaStream API: Rename MediaStreamCenter::didConstructMediaStream
+ https://bugs.webkit.org/show_bug.cgi?id=85796
+
+ Reviewed by Adam Barth.
+
+ Renamed WebMediaStreamCenter::didConstructMediaStream to didCreateMediaStream,
+ and change so that it is only called for MediaStreams created from JS.
+ Also send out the WebMediaStreamDescriptor non-const instead.
+
+ * chromium/public/WebMediaStreamCenter.h:
+ (WebKit::WebMediaStreamCenter::didCreateMediaStream):
+ (WebMediaStreamCenter):
+ (WebKit::WebMediaStreamCenter::didConstructMediaStream):
+
+2012-05-07 Tommy Widenflycht <tommyw@google.com>
+
+ MediaStream API: Allow UserMediaRequest::succeed to take an MediaStreamDescriptor
+ https://bugs.webkit.org/show_bug.cgi?id=85798
+
+ Reviewed by Adam Barth.
+
+ Adding another UserMediaRequest::succeed function that takes an MediaStreamDescriptor
+ instead of the two MediaStreamSource arrays.
+
+ * chromium/public/WebMediaStreamCenter.h:
+ (WebMediaStreamCenter):
+ (WebKit::WebMediaStreamCenter::constructSDP):
+
2012-05-04 Tommy Widenflycht <tommyw@google.com>
MediaStream API: Make PeerConnection00's API fully compliant with the draft
diff --git a/Source/Platform/Platform.gypi b/Source/Platform/Platform.gypi
index be897c216..9a8278acb 100644
--- a/Source/Platform/Platform.gypi
+++ b/Source/Platform/Platform.gypi
@@ -36,12 +36,15 @@
'chromium/public/WebAudioDevice.h',
'chromium/public/WebCString.h',
'chromium/public/WebCanvas.h',
+ 'chromium/public/WebClipboard.h',
'chromium/public/WebColor.h',
'chromium/public/WebCommon.h',
'chromium/public/WebContentLayer.h',
'chromium/public/WebContentLayerClient.h',
'chromium/public/WebData.h',
+ 'chromium/public/WebDragData.h',
'chromium/public/WebExternalTextureLayer.h',
+ 'chromium/public/WebFileSystem.h',
'chromium/public/WebFilterOperation.h',
'chromium/public/WebFilterOperations.h',
'chromium/public/WebFloatPoint.h',
@@ -55,6 +58,7 @@
'chromium/public/WebHTTPLoadInfo.h',
'chromium/public/WebICECandidateDescriptor.h',
'chromium/public/WebICEOptions.h',
+ 'chromium/public/WebImage.h',
'chromium/public/WebIOSurfaceLayer.h',
'chromium/public/WebLayer.h',
'chromium/public/WebLayerTreeView.h',
diff --git a/Source/Platform/chromium/public/Platform.h b/Source/Platform/chromium/public/Platform.h
index abf3d0901..6e5861b20 100644
--- a/Source/Platform/chromium/public/Platform.h
+++ b/Source/Platform/chromium/public/Platform.h
@@ -40,6 +40,8 @@
namespace WebKit {
class WebAudioBus;
+class WebClipboard;
+class WebFileSystem;
class WebMediaStreamCenter;
class WebMediaStreamCenterClient;
class WebMimeRegistry;
@@ -59,6 +61,9 @@ public:
WEBKIT_EXPORT static Platform* current();
// Must return non-null.
+ virtual WebClipboard* clipboard() { return 0; }
+
+ // Must return non-null.
virtual WebMimeRegistry* mimeRegistry() { return 0; }
@@ -69,6 +74,11 @@ public:
virtual WebAudioDevice* createAudioDevice(size_t bufferSize, unsigned numberOfChannels, double sampleRate, WebAudioDevice::RenderCallback*) { return 0; }
+ // FileSystem ----------------------------------------------------------
+
+ // Must return non-null.
+ virtual WebFileSystem* fileSystem() { return 0; }
+
// Gamepad -------------------------------------------------------------
virtual void sampleGamepads(WebGamepads& into) { into.length = 0; }
diff --git a/Source/Platform/chromium/public/WebCanvas.h b/Source/Platform/chromium/public/WebCanvas.h
index 4cf729ee1..aca38e0c4 100644
--- a/Source/Platform/chromium/public/WebCanvas.h
+++ b/Source/Platform/chromium/public/WebCanvas.h
@@ -33,21 +33,11 @@
#include "WebCommon.h"
-#if WEBKIT_USING_SKIA
class SkCanvas;
-#elif WEBKIT_USING_CG
-struct CGContext;
-#endif
namespace WebKit {
-#if WEBKIT_USING_SKIA
typedef SkCanvas WebCanvas;
-#elif WEBKIT_USING_CG
-typedef struct CGContext WebCanvas;
-#else
-#error "Need to define WebCanvas"
-#endif
} // namespace WebKit
diff --git a/Source/Platform/chromium/public/WebClipboard.h b/Source/Platform/chromium/public/WebClipboard.h
new file mode 100644
index 000000000..eb208237e
--- /dev/null
+++ b/Source/Platform/chromium/public/WebClipboard.h
@@ -0,0 +1,98 @@
+/*
+ * Copyright (C) 2009 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WebClipboard_h
+#define WebClipboard_h
+
+#include "WebCommon.h"
+#include "WebData.h"
+#include "WebString.h"
+#include "WebVector.h"
+
+namespace WebKit {
+
+class WebDragData;
+class WebImage;
+class WebURL;
+
+class WebClipboard {
+public:
+ enum Format {
+ FormatPlainText,
+ FormatHTML,
+ FormatBookmark,
+ FormatSmartPaste
+ };
+
+ enum Buffer {
+ BufferStandard,
+ // Used on platforms like the X Window System that treat selection
+ // as a type of clipboard.
+ BufferSelection,
+ };
+
+ // Returns an identifier which can be used to determine whether the data
+ // contained within the clipboard has changed.
+ virtual uint64 sequenceNumber(Buffer) { return 0; }
+
+ virtual bool isFormatAvailable(Format, Buffer) { return false; }
+
+ virtual WebVector<WebString> readAvailableTypes(
+ Buffer, bool* containsFilenames) { return WebVector<WebString>(); }
+ virtual WebString readPlainText(Buffer) { return WebString(); }
+ // fragmentStart and fragmentEnd are indexes into the returned markup that
+ // indicate the start and end of the fragment if the returned markup
+ // contains additional context. If there is no additional context,
+ // fragmentStart will be zero and fragmentEnd will be the same as the length
+ // of the returned markup.
+ virtual WebString readHTML(
+ Buffer buffer, WebURL* pageURL, unsigned* fragmentStart,
+ unsigned* fragmentEnd) { return WebString(); }
+ virtual WebData readImage(Buffer) { return WebData(); }
+ virtual WebString readCustomData(
+ Buffer, const WebString& type) { return WebString(); }
+
+ virtual void writePlainText(const WebString&) { }
+ virtual void writeHTML(
+ const WebString& htmlText, const WebURL&,
+ const WebString& plainText, bool writeSmartPaste) { }
+ virtual void writeURL(
+ const WebURL&, const WebString& title) { }
+ virtual void writeImage(
+ const WebImage&, const WebURL&, const WebString& title) { }
+ virtual void writeDataObject(const WebDragData&) { }
+
+protected:
+ ~WebClipboard() { }
+};
+
+} // namespace WebKit
+
+#endif
diff --git a/Source/Platform/chromium/public/WebDragData.h b/Source/Platform/chromium/public/WebDragData.h
new file mode 100644
index 000000000..edd3df831
--- /dev/null
+++ b/Source/Platform/chromium/public/WebDragData.h
@@ -0,0 +1,123 @@
+/*
+ * Copyright (C) 2009 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WebDragData_h
+#define WebDragData_h
+
+#include "WebCommon.h"
+#include "WebData.h"
+#include "WebString.h"
+#include "WebURL.h"
+
+#if WEBKIT_IMPLEMENTATION
+namespace WebCore { class ChromiumDataObject; }
+namespace WTF { template <typename T> class PassRefPtr; }
+#endif
+
+namespace WebKit {
+
+class WebDragDataPrivate;
+template <typename T> class WebVector;
+
+// Holds data that may be exchanged through a drag-n-drop operation. It is
+// inexpensive to copy a WebDragData object.
+class WebDragData {
+public:
+ struct Item {
+ enum StorageType {
+ // String data with an associated MIME type. Depending on the MIME type, there may be
+ // optional metadata attributes as well.
+ StorageTypeString,
+ // Stores the name of one file being dragged into the renderer.
+ StorageTypeFilename,
+ // An image being dragged out of the renderer. Contains a buffer holding the image data
+ // as well as the suggested name for saving the image to.
+ StorageTypeBinaryData,
+ };
+
+ StorageType storageType;
+
+ // Only valid when storageType == StorageTypeString.
+ WebString stringType;
+ WebString stringData;
+
+ // Only valid when storageType == StorageTypeFilename.
+ WebString filenameData;
+ WebString displayNameData;
+
+ // Only valid when storageType == StorageTypeBinaryData.
+ WebData binaryData;
+
+ // Title associated with a link when stringType == "text/uri-list".
+ // Filename when storageType == StorageTypeBinaryData.
+ WebString title;
+
+ // Only valid when stringType == "text/html".
+ WebURL baseURL;
+ };
+
+ ~WebDragData() { reset(); }
+
+ WebDragData() : m_private(0) { }
+ WebDragData(const WebDragData& d) : m_private(0) { assign(d); }
+ WebDragData& operator=(const WebDragData& d)
+ {
+ assign(d);
+ return *this;
+ }
+
+ WEBKIT_EXPORT void initialize();
+ WEBKIT_EXPORT void reset();
+ WEBKIT_EXPORT void assign(const WebDragData&);
+
+ bool isNull() const { return !m_private; }
+
+ WEBKIT_EXPORT WebVector<Item> items() const;
+ WEBKIT_EXPORT void setItems(const WebVector<Item>&);
+ WEBKIT_EXPORT void addItem(const Item&);
+
+ WEBKIT_EXPORT WebString filesystemId() const;
+ WEBKIT_EXPORT void setFilesystemId(const WebString&);
+
+#if WEBKIT_IMPLEMENTATION
+ WebDragData(const WTF::PassRefPtr<WebCore::ChromiumDataObject>&);
+ WebDragData& operator=(const WTF::PassRefPtr<WebCore::ChromiumDataObject>&);
+ operator WTF::PassRefPtr<WebCore::ChromiumDataObject>() const;
+#endif
+
+private:
+ void assign(WebDragDataPrivate*);
+ void ensureMutable();
+ WebDragDataPrivate* m_private;
+};
+
+} // namespace WebKit
+
+#endif
diff --git a/Source/Platform/chromium/public/WebFileSystem.h b/Source/Platform/chromium/public/WebFileSystem.h
new file mode 100644
index 000000000..25afb49f0
--- /dev/null
+++ b/Source/Platform/chromium/public/WebFileSystem.h
@@ -0,0 +1,138 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WebFileSystem_h
+#define WebFileSystem_h
+
+#include "WebCommon.h"
+#include "WebURL.h"
+
+namespace WebKit {
+
+// FIXME: Move these classes into platform.
+class WebFileSystemCallbacks;
+class WebFileWriter;
+class WebFileWriterClient;
+
+class WebFileSystem {
+public:
+ enum Type {
+ TypeTemporary,
+ TypePersistent,
+
+ // Indicates an isolated filesystem which only exposes a set of files.
+ TypeIsolated,
+
+ // Indicates a non-sandboxed filesystem.
+ TypeExternal,
+ };
+
+ // Moves a file or directory at |srcPath| to |destPath|.
+ // WebFileSystemCallbacks::didSucceed() must be called when the operation is completed successfully.
+ // WebFileSystemCallbacks::didFail() must be called otherwise.
+ virtual void move(const WebURL& srcPath, const WebURL& destPath, WebFileSystemCallbacks*) { WEBKIT_ASSERT_NOT_REACHED(); }
+
+ // Copies a file or directory at |srcPath| to |destPath|.
+ // WebFileSystemCallbacks::didSucceed() must be called when the operation is completed successfully.
+ // WebFileSystemCallbacks::didFail() must be called otherwise.
+ virtual void copy(const WebURL& srcPath, const WebURL& destPath, WebFileSystemCallbacks*) { WEBKIT_ASSERT_NOT_REACHED(); }
+
+ // Deletes a file or directory at a given |path|.
+ // It is an error to try to remove a directory that is not empty.
+ // WebFileSystemCallbacks::didSucceed() must be called when the operation is completed successfully.
+ // WebFileSystemCallbacks::didFail() must be called otherwise.
+ virtual void remove(const WebURL& path, WebFileSystemCallbacks*) { WEBKIT_ASSERT_NOT_REACHED(); }
+
+ // Deletes a file or directory recursively at a given |path|.
+ // WebFileSystemCallbacks::didSucceed() must be called when the operation is completed successfully.
+ // WebFileSystemCallbacks::didFail() must be called otherwise.
+ virtual void removeRecursively(const WebURL& path, WebFileSystemCallbacks*) { WEBKIT_ASSERT_NOT_REACHED(); }
+
+ // Retrieves the metadata information of the file or directory at the given |path|.
+ // This may not always return the local platform path in remote filesystem cases.
+ // WebFileSystemCallbacks::didReadMetadata() must be called with a valid metadata when the retrieval is completed successfully.
+ // WebFileSystemCallbacks::didFail() must be called otherwise.
+ virtual void readMetadata(const WebURL& path, WebFileSystemCallbacks*) { WEBKIT_ASSERT_NOT_REACHED(); }
+
+ // Creates a file at given |path|.
+ // If the |path| doesn't exist, it creates a new file at |path|.
+ // If |exclusive| is true, it fails if the |path| already exists.
+ // If |exclusive| is false, it succeeds if the |path| already exists or
+ // it has successfully created a new file at |path|.
+ //
+ // WebFileSystemCallbacks::didSucceed() must be called when the operation is completed successfully.
+ // WebFileSystemCallbacks::didFail() must be called otherwise.
+ virtual void createFile(const WebURL& path, bool exclusive, WebFileSystemCallbacks*) { WEBKIT_ASSERT_NOT_REACHED(); }
+
+ // Creates a directory at a given |path|.
+ // If the |path| doesn't exist, it creates a new directory at |path|.
+ // If |exclusive| is true, it fails if the |path| already exists.
+ // If |exclusive| is false, it succeeds if the |path| already exists or it has successfully created a new directory at |path|.
+ //
+ // WebFileSystemCallbacks::didSucceed() must be called when
+ // the operation is completed successfully.
+ // WebFileSystemCallbacks::didFail() must be called otherwise.
+ virtual void createDirectory(const WebURL& path, bool exclusive, WebFileSystemCallbacks*) { WEBKIT_ASSERT_NOT_REACHED(); }
+
+ // Checks if a file exists at a given |path|.
+ // WebFileSystemCallbacks::didSucceed() must be called when the operation is completed successfully.
+ // WebFileSystemCallbacks::didFail() must be called otherwise.
+ virtual void fileExists(const WebURL& path, WebFileSystemCallbacks*) { WEBKIT_ASSERT_NOT_REACHED(); }
+
+ // Checks if a directory exists at a given |path|.
+ // WebFileSystemCallbacks::didSucceed() must be called when the operation is completed successfully.
+ // WebFileSystemCallbacks::didFail() must be called otherwise.
+ virtual void directoryExists(const WebURL& path, WebFileSystemCallbacks*) { WEBKIT_ASSERT_NOT_REACHED(); }
+
+ // Reads directory entries of a given directory at |path|.
+ // WebFileSystemCallbacks::didReadDirectory() must be called when the operation is completed successfully.
+ // WebFileSystemCallbacks::didFail() must be called otherwise.
+ virtual void readDirectory(const WebURL& path, WebFileSystemCallbacks*) { WEBKIT_ASSERT_NOT_REACHED(); }
+
+ // Creates a WebFileWriter that can be used to write to the given file.
+ // This is a fast, synchronous call, and should not stat the filesystem.
+ virtual WebFileWriter* createFileWriter(const WebURL& path, WebFileWriterClient*) { WEBKIT_ASSERT_NOT_REACHED(); return 0; }
+
+ // Creates a snapshot file for a given file specified by |path| and registers the file with the |blobURL|. It returns the metadata of the created snapshot file.
+ // The returned metadata should include a local platform path to the snapshot image.
+ // In local filesystem cases the backend may simply return the metadata of the file itself (as well as readMetadata does), while in remote filesystem case the backend may download the file into a temporary snapshot file and return the metadata of the temporary file.
+ // The returned metadata is used to create a File object for the |path|.
+ // The snapshot file is supposed to be deleted when the last reference to the |blobURL| is dropped.
+ // WebFileSystemCallbacks::didReadMetadata() with the metadata of the snapshot file must be called when the operation is completed successfully.
+ // WebFileSystemCallbacks::didFail() must be called otherwise.
+ virtual void createSnapshotFileAndReadMetadata(const WebURL& blobURL, const WebURL& path, WebFileSystemCallbacks*) { WEBKIT_ASSERT_NOT_REACHED(); }
+
+protected:
+ virtual ~WebFileSystem() { }
+};
+
+} // namespace WebKit
+
+#endif
diff --git a/Source/Platform/chromium/public/WebGraphicsContext3D.h b/Source/Platform/chromium/public/WebGraphicsContext3D.h
index 371e8f44b..0e40f5faa 100644
--- a/Source/Platform/chromium/public/WebGraphicsContext3D.h
+++ b/Source/Platform/chromium/public/WebGraphicsContext3D.h
@@ -38,9 +38,7 @@
#define USE_WGC3D_TYPES
-#if WEBKIT_USING_SKIA
struct GrGLInterface;
-#endif
namespace WebKit {
@@ -413,14 +411,10 @@ public:
virtual void getQueryivEXT(WGC3Denum target, WGC3Denum pname, WGC3Dint* params) { }
virtual void getQueryObjectuivEXT(WebGLId query, WGC3Denum pname, WGC3Duint* params) { }
-#if WEBKIT_USING_SKIA
GrGLInterface* createGrGLInterface();
-#endif
protected:
-#if WEBKIT_USING_SKIA
virtual GrGLInterface* onCreateGrGLInterface() { return 0; }
-#endif
};
diff --git a/Source/WebKit/chromium/src/WebStorageEventDispatcherImpl.h b/Source/Platform/chromium/public/WebImage.h
index b03c6b7a6..29bef1c34 100644
--- a/Source/WebKit/chromium/src/WebStorageEventDispatcherImpl.h
+++ b/Source/Platform/chromium/public/WebImage.h
@@ -28,26 +28,74 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef WebStorageEventDispatcherImpl_h
-#define WebStorageEventDispatcherImpl_h
+#ifndef WebImage_h
+#define WebImage_h
-#include "StorageEventDispatcherImpl.h"
-#include "WebStorageEventDispatcher.h"
-#include <wtf/OwnPtr.h>
+#include "WebCommon.h"
+
+#include <SkBitmap.h>
+
+#if WEBKIT_IMPLEMENTATION
+namespace WebCore { class Image; }
+namespace WTF { template <typename T> class PassRefPtr; }
+#endif
namespace WebKit {
-// DEPRECATED - to be removed when removing the instance methods in the public api.
-class WebStorageEventDispatcherImpl : public WebStorageEventDispatcher {
+class WebData;
+struct WebSize;
+
+// A container for an ARGB bitmap.
+class WebImage {
public:
- WebStorageEventDispatcherImpl();
- virtual void dispatchStorageEvent(const WebString& key, const WebString& oldValue,
- const WebString& newValue, const WebString& origin,
- const WebURL&, bool isLocalStorage);
+ ~WebImage() { reset(); }
+
+ WebImage() { init(); }
+ WebImage(const WebImage& image)
+ {
+ init();
+ assign(image);
+ }
+
+ WebImage& operator=(const WebImage& image)
+ {
+ assign(image);
+ return *this;
+ }
+
+ // Decodes the given image data. If the image has multiple frames,
+ // then the frame whose size is desiredSize is returned. Otherwise,
+ // the first frame is returned.
+ WEBKIT_EXPORT static WebImage fromData(const WebData&, const WebSize& desiredSize);
+
+ WEBKIT_EXPORT void reset();
+ WEBKIT_EXPORT void assign(const WebImage&);
+
+ WEBKIT_EXPORT bool isNull() const;
+ WEBKIT_EXPORT WebSize size() const;
+
+#if WEBKIT_IMPLEMENTATION
+ WebImage(const WTF::PassRefPtr<WebCore::Image>&);
+ WebImage& operator=(const WTF::PassRefPtr<WebCore::Image>&);
+#endif
+
+ WebImage(const SkBitmap& bitmap) : m_bitmap(bitmap) { }
+
+ WebImage& operator=(const SkBitmap& bitmap)
+ {
+ m_bitmap = bitmap;
+ return *this;
+ }
+
+ SkBitmap& getSkBitmap() { return m_bitmap; }
+ const SkBitmap& getSkBitmap() const { return m_bitmap; }
+
private:
- OwnPtr<WebCore::StorageEventDispatcherImpl> m_eventDispatcher;
+ void init() { }
+ SkBitmap m_bitmap;
+
};
} // namespace WebKit
-#endif // WebStorageEventDispatcherImpl_h
+#endif
diff --git a/Source/Platform/chromium/public/WebMediaStreamCenter.h b/Source/Platform/chromium/public/WebMediaStreamCenter.h
index 38827c833..fdef7b894 100644
--- a/Source/Platform/chromium/public/WebMediaStreamCenter.h
+++ b/Source/Platform/chromium/public/WebMediaStreamCenter.h
@@ -48,11 +48,13 @@ public:
virtual void didEnableMediaStreamTrack(const WebMediaStreamDescriptor&, const WebMediaStreamComponent&) = 0;
virtual void didDisableMediaStreamTrack(const WebMediaStreamDescriptor&, const WebMediaStreamComponent&) = 0;
virtual void didStopLocalMediaStream(const WebMediaStreamDescriptor&) = 0;
- virtual void didConstructMediaStream(const WebMediaStreamDescriptor&) = 0;
+ virtual void didCreateMediaStream(WebMediaStreamDescriptor&) { }
- // FIXME: Make pure virtual after implementation.
- virtual WebString constructSDP(const WebICECandidateDescriptor&) { return WebString(); }
- virtual WebString constructSDP(const WebSessionDescriptionDescriptor&) { return WebString(); }
+ // DEPRECATED
+ virtual void didConstructMediaStream(const WebMediaStreamDescriptor&) { }
+
+ virtual WebString constructSDP(const WebICECandidateDescriptor&) = 0;
+ virtual WebString constructSDP(const WebSessionDescriptionDescriptor&) = 0;
};
} // namespace WebKit
diff --git a/Source/Platform/chromium/public/WebMediaStreamDescriptor.h b/Source/Platform/chromium/public/WebMediaStreamDescriptor.h
index 4923c97b5..c25f42e1b 100644
--- a/Source/Platform/chromium/public/WebMediaStreamDescriptor.h
+++ b/Source/Platform/chromium/public/WebMediaStreamDescriptor.h
@@ -42,6 +42,11 @@ class WebString;
class WebMediaStreamDescriptor {
public:
+ class ExtraData {
+ public:
+ virtual ~ExtraData() { }
+ };
+
WebMediaStreamDescriptor() { }
WebMediaStreamDescriptor(const WebMediaStreamDescriptor& other) { assign(other); }
~WebMediaStreamDescriptor() { reset(); }
@@ -69,6 +74,13 @@ public:
WEBKIT_EXPORT void audioSources(WebVector<WebMediaStreamComponent>&) const;
WEBKIT_EXPORT void videoSources(WebVector<WebMediaStreamComponent>&) const;
+ // Extra data associated with this WebMediaStreamDescriptor.
+ // If non-null, the extra data pointer will be deleted when the object is destroyed.
+ // Setting the extra data pointer will cause any existing non-null
+ // extra data pointer to be deleted.
+ WEBKIT_EXPORT ExtraData* extraData() const;
+ WEBKIT_EXPORT void setExtraData(ExtraData*);
+
#if WEBKIT_IMPLEMENTATION
WebMediaStreamDescriptor(WebCore::MediaStreamDescriptor*);
WebMediaStreamDescriptor(const WTF::PassRefPtr<WebCore::MediaStreamDescriptor>&);
diff --git a/Source/WTF/ChangeLog b/Source/WTF/ChangeLog
index 2424e8d8e..417481415 100644
--- a/Source/WTF/ChangeLog
+++ b/Source/WTF/ChangeLog
@@ -1,3 +1,72 @@
+2012-05-10 Michał Pakuła vel Rutka <m.pakula@samsung.com>
+
+ [EFL] Add OwnPtr specialization for Eina_Hash.
+ https://bugs.webkit.org/show_bug.cgi?id=85046
+
+ Reviewed by Andreas Kling.
+
+ Add an override for Eina_Hash for EFL port.
+
+ * wtf/OwnPtrCommon.h:
+ (WTF):
+ * wtf/efl/OwnPtrEfl.cpp:
+ (WTF::deleteOwnedPtr):
+ (WTF):
+
+2012-05-09 Filip Pizlo <fpizlo@apple.com>
+
+ It should be possible to get useful debug logging from the JIT memory allocator
+ https://bugs.webkit.org/show_bug.cgi?id=86042
+
+ Reviewed by Geoff Garen.
+
+ * wtf/MetaAllocator.cpp:
+ (WTF::MetaAllocator::findAndRemoveFreeSpace):
+ (WTF::MetaAllocator::addFreeSpace):
+ (WTF::MetaAllocator::dumpProfile):
+
+2012-05-08 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r116440.
+ http://trac.webkit.org/changeset/116440
+ https://bugs.webkit.org/show_bug.cgi?id=85904
+
+ Broke the Chromium Android bot (Requested by beverloo on
+ #webkit).
+
+ * WTF.gyp/WTF.gyp:
+
+2012-05-08 Adam Barth <abarth@webkit.org>
+
+ [Chromium] OS(ANDROID) ImageDiff requires us to build WTF for both host and target
+ https://bugs.webkit.org/show_bug.cgi?id=85897
+
+ Reviewed by Tony Chang.
+
+ * WTF.gyp/WTF.gyp:
+
+2012-05-08 Adam Barth <abarth@webkit.org>
+
+ [Chromium] Assertions.cpp should work on OS(ANDROID)
+ https://bugs.webkit.org/show_bug.cgi?id=85867
+
+ Reviewed by Eric Seidel.
+
+ Some minor ifdefs for OS(ANDROID) on PLATFORM(CHROMIUM).
+
+ * wtf/Assertions.cpp:
+
+2012-05-07 Adam Barth <abarth@webkit.org>
+
+ [Chromium] Android wishes to use an empty implementation if AXObjectCache
+ https://bugs.webkit.org/show_bug.cgi?id=85842
+
+ Reviewed by Eric Seidel.
+
+ Disable accessibility on OS(ANDROID) for PLATFORM(CHROMIUM).
+
+ * wtf/Platform.h:
+
2012-05-04 Jeff Rogers <jrogers@rim.com>
[BlackBerry] Implement numberOfProcessorCores() for QNX
diff --git a/Source/WTF/wtf/Assertions.cpp b/Source/WTF/wtf/Assertions.cpp
index db2c14611..8549f1ef2 100644
--- a/Source/WTF/wtf/Assertions.cpp
+++ b/Source/WTF/wtf/Assertions.cpp
@@ -52,7 +52,7 @@
#include <windows.h>
#endif
-#if OS(DARWIN) || OS(LINUX)
+#if (OS(DARWIN) || OS(LINUX)) && !OS(ANDROID)
#include <cxxabi.h>
#include <dlfcn.h>
#include <execinfo.h>
@@ -256,7 +256,7 @@ void WTFReportArgumentAssertionFailure(const char* file, int line, const char* f
void WTFGetBacktrace(void** stack, int* size)
{
-#if OS(DARWIN) || OS(LINUX)
+#if (OS(DARWIN) || OS(LINUX)) && !OS(ANDROID)
*size = backtrace(stack, *size);
#elif OS(WINDOWS) && !OS(WINCE)
// The CaptureStackBackTrace function is available in XP, but it is not defined
@@ -295,7 +295,7 @@ void WTFReportBacktrace()
# if defined(__GLIBC__) && !defined(__UCLIBC__)
# define WTF_USE_BACKTRACE_SYMBOLS 1
# endif
-# else
+# elif !OS(ANDROID)
# define WTF_USE_DLADDR 1
# endif
#endif
diff --git a/Source/WTF/wtf/MetaAllocator.cpp b/Source/WTF/wtf/MetaAllocator.cpp
index 20237f218..0a7a31e17 100644
--- a/Source/WTF/wtf/MetaAllocator.cpp
+++ b/Source/WTF/wtf/MetaAllocator.cpp
@@ -29,6 +29,7 @@
#include "config.h"
#include "MetaAllocator.h"
+#include <wtf/DataLog.h>
#include <wtf/FastMalloc.h>
namespace WTF {
@@ -260,6 +261,10 @@ void* MetaAllocator::findAndRemoveFreeSpace(size_t sizeInBytes)
}
}
+#if ENABLE(META_ALLOCATOR_PROFILE)
+ dumpProfile();
+#endif
+
return result;
}
@@ -381,6 +386,10 @@ void MetaAllocator::addFreeSpace(void* start, size_t sizeInBytes)
m_freeSpaceEndAddressMap.add(end, node);
}
}
+
+#if ENABLE(META_ALLOCATOR_PROFILE)
+ dumpProfile();
+#endif
}
void MetaAllocator::incrementPageOccupancy(void* address, size_t sizeInBytes)
@@ -441,7 +450,8 @@ void MetaAllocator::freeFreeSpaceNode(FreeSpaceNode* node)
#if ENABLE(META_ALLOCATOR_PROFILE)
void MetaAllocator::dumpProfile()
{
- dataLog("num allocations = %u, num frees = %u\n", m_numAllocations, m_numFrees);
+ dataLog("%d: MetaAllocator(%p): num allocations = %u, num frees = %u, allocated = %lu, reserved = %lu, committed = %lu\n",
+ getpid(), this, m_numAllocations, m_numFrees, m_bytesAllocated, m_bytesReserved, m_bytesCommitted);
}
#endif
diff --git a/Source/WTF/wtf/OwnPtrCommon.h b/Source/WTF/wtf/OwnPtrCommon.h
index cea5a7f76..86670e9c3 100644
--- a/Source/WTF/wtf/OwnPtrCommon.h
+++ b/Source/WTF/wtf/OwnPtrCommon.h
@@ -42,6 +42,7 @@ typedef struct HRGN__* HRGN;
typedef struct _Ecore_Evas Ecore_Evas;
typedef struct _Ecore_Pipe Ecore_Pipe;
typedef struct _Ecore_Timer Ecore_Timer;
+typedef struct _Eina_Hash Eina_Hash;
typedef struct _Eina_Module Eina_Module;
typedef struct _Evas_Object Evas_Object;
#endif
@@ -69,6 +70,7 @@ namespace WTF {
void deleteOwnedPtr(Ecore_Evas*);
void deleteOwnedPtr(Ecore_Pipe*);
void deleteOwnedPtr(Ecore_Timer*);
+ void deleteOwnedPtr(Eina_Hash*);
void deleteOwnedPtr(Eina_Module*);
void deleteOwnedPtr(Evas_Object*);
#endif
diff --git a/Source/WTF/wtf/Platform.h b/Source/WTF/wtf/Platform.h
index 5996bff06..24c2b353f 100644
--- a/Source/WTF/wtf/Platform.h
+++ b/Source/WTF/wtf/Platform.h
@@ -651,7 +651,7 @@
#endif
#if !defined(HAVE_ACCESSIBILITY)
-#if PLATFORM(IOS) || PLATFORM(MAC) || PLATFORM(WIN) || PLATFORM(GTK) || PLATFORM(CHROMIUM)
+#if PLATFORM(IOS) || PLATFORM(MAC) || PLATFORM(WIN) || PLATFORM(GTK) || (PLATFORM(CHROMIUM) && !OS(ANDROID))
#define HAVE_ACCESSIBILITY 1
#endif
#endif /* !defined(HAVE_ACCESSIBILITY) */
diff --git a/Source/WTF/wtf/efl/OwnPtrEfl.cpp b/Source/WTF/wtf/efl/OwnPtrEfl.cpp
index 3671553d1..6501a9608 100644
--- a/Source/WTF/wtf/efl/OwnPtrEfl.cpp
+++ b/Source/WTF/wtf/efl/OwnPtrEfl.cpp
@@ -51,6 +51,12 @@ void deleteOwnedPtr(Ecore_Pipe* ptr)
ecore_pipe_del(ptr);
}
+void deleteOwnedPtr(Eina_Hash* ptr)
+{
+ if (ptr)
+ eina_hash_free(ptr);
+}
+
void deleteOwnedPtr(Eina_Module* ptr)
{
if (ptr)
diff --git a/Source/WebCore/CMakeLists.txt b/Source/WebCore/CMakeLists.txt
index b8fc7e40d..61c884388 100644
--- a/Source/WebCore/CMakeLists.txt
+++ b/Source/WebCore/CMakeLists.txt
@@ -331,6 +331,7 @@ SET(WebCore_IDL_FILES
html/ImageData.idl
html/MediaController.idl
html/MediaError.idl
+ html/RadioNodeList.idl
html/TextMetrics.idl
html/TimeRanges.idl
html/ValidityState.idl
@@ -855,6 +856,7 @@ SET(WebCore_SOURCES
html/PasswordInputType.cpp
html/PluginDocument.cpp
html/RadioInputType.cpp
+ html/RadioNodeList.cpp
html/RangeInputType.cpp
html/ResetInputType.cpp
html/SearchInputType.cpp
@@ -1102,6 +1104,7 @@ SET(WebCore_SOURCES
platform/DateComponents.cpp
platform/DragData.cpp
platform/DragImage.cpp
+ platform/EventTracer.cpp
platform/FileChooser.cpp
platform/FileIconLoader.cpp
platform/FileSystem.cpp
@@ -1155,7 +1158,6 @@ SET(WebCore_SOURCES
platform/graphics/FontFastPath.cpp
platform/graphics/FontFeatureSettings.cpp
platform/graphics/FractionalLayoutRect.cpp
- platform/graphics/FractionalLayoutSize.cpp
platform/graphics/GeneratorGeneratedImage.cpp
platform/graphics/GlyphPageTreeNode.cpp
platform/graphics/Gradient.cpp
diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog
index b2f1989a2..b80e79b9e 100644
--- a/Source/WebCore/ChangeLog
+++ b/Source/WebCore/ChangeLog
@@ -1,3 +1,5210 @@
+2012-05-11 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r116727.
+ http://trac.webkit.org/changeset/116727
+ https://bugs.webkit.org/show_bug.cgi?id=86181
+
+ Build error on Chromium-Android (Requested by tkent on
+ #webkit).
+
+ * platform/graphics/MediaPlayer.cpp:
+ (WebCore::MediaPlayer::enterFullscreen):
+ (WebCore):
+ * platform/graphics/MediaPlayer.h:
+ (MediaPlayer):
+ * platform/graphics/MediaPlayerPrivate.h:
+ (WebCore::MediaPlayerPrivateInterface::enterFullscreen):
+ (MediaPlayerPrivateInterface):
+
+2012-05-11 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r116731.
+ http://trac.webkit.org/changeset/116731
+ https://bugs.webkit.org/show_bug.cgi?id=86178
+
+ Build failure on Chromium-mac (Requested by tkent on #webkit).
+
+ * platform/graphics/chromium/LayerRendererChromium.cpp:
+ (WebCore::LayerRendererChromium::create):
+ (WebCore::LayerRendererChromium::LayerRendererChromium):
+ (WebCore::LayerRendererChromium::initializeSharedObjects):
+ * platform/graphics/chromium/LayerRendererChromium.h:
+ (LayerRendererChromium):
+ * platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp:
+ (WebCore::CCLayerTreeHostImpl::initializeLayerRenderer):
+ * platform/graphics/chromium/cc/CCLayerTreeHostImpl.h:
+ (CCLayerTreeHostImpl):
+ * platform/graphics/chromium/cc/CCSingleThreadProxy.cpp:
+ (UnthrottledTextureUploader):
+ (WebCore::UnthrottledTextureUploader::create):
+ (WebCore::UnthrottledTextureUploader::~UnthrottledTextureUploader):
+ (WebCore::UnthrottledTextureUploader::isBusy):
+ (WebCore::UnthrottledTextureUploader::beginUploads):
+ (WebCore::UnthrottledTextureUploader::endUploads):
+ (WebCore::UnthrottledTextureUploader::uploadTexture):
+ (WebCore::UnthrottledTextureUploader::UnthrottledTextureUploader):
+ (WebCore):
+ (WebCore::CCSingleThreadProxy::initializeLayerRenderer):
+ (WebCore::CCSingleThreadProxy::recreateContext):
+ * platform/graphics/chromium/cc/CCThreadProxy.cpp:
+ (WebCore):
+ (UnthrottledTextureUploader):
+ (WebCore::UnthrottledTextureUploader::create):
+ (WebCore::UnthrottledTextureUploader::~UnthrottledTextureUploader):
+ (WebCore::UnthrottledTextureUploader::isBusy):
+ (WebCore::UnthrottledTextureUploader::beginUploads):
+ (WebCore::UnthrottledTextureUploader::endUploads):
+ (WebCore::UnthrottledTextureUploader::uploadTexture):
+ (WebCore::UnthrottledTextureUploader::UnthrottledTextureUploader):
+ (WebCore::CCThreadProxy::initializeLayerRendererOnImplThread):
+ (WebCore::CCThreadProxy::recreateContextOnImplThread):
+
+2012-05-10 David Reveman <reveman@chromium.org>
+
+ [Chromium] Move instantiation of texture uploader to LayerRendererChromium.
+ https://bugs.webkit.org/show_bug.cgi?id=85893
+
+ Reviewed by Adrienne Walker.
+
+ Move instantiation of texture uploader to LayerRendererChromium and
+ allow CCProxy to decide between a throttled or unthrottled uploader
+ using a flag passed to the LayerRendererChromium constructor.
+
+ * platform/graphics/chromium/LayerRendererChromium.cpp:
+ (WebCore::LayerRendererChromium::create):
+ (WebCore::LayerRendererChromium::LayerRendererChromium):
+ (WebCore::LayerRendererChromium::initializeSharedObjects):
+ * platform/graphics/chromium/LayerRendererChromium.h:
+ (LayerRendererChromium):
+ * platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp:
+ (WebCore::CCLayerTreeHostImpl::initializeLayerRenderer):
+ * platform/graphics/chromium/cc/CCLayerTreeHostImpl.h:
+ (CCLayerTreeHostImpl):
+ * platform/graphics/chromium/cc/CCSingleThreadProxy.cpp:
+ (WebCore::CCSingleThreadProxy::initializeLayerRenderer):
+ (WebCore::CCSingleThreadProxy::recreateContext):
+ * platform/graphics/chromium/cc/CCThreadProxy.cpp:
+ (WebCore::CCThreadProxy::initializeLayerRendererOnImplThread):
+ (WebCore::CCThreadProxy::recreateContextOnImplThread):
+
+2012-05-10 MORITA Hajime <morrita@google.com>
+
+ ElementShadow should minimize the usage of "ShadowRoot" name
+ https://bugs.webkit.org/show_bug.cgi?id=85970
+
+ Reviewed by Dimitri Glazkov.
+
+ This change cleans two out dated assumptions which brought in at
+ early stage of Shadow DOM implementation.
+
+ - Removed Element::hasShadowRoot(): shadow existence can be checked by Element::shadow().
+ - Made ElementShadow::removeAllShadowRoots() private: we no longer allow ShadowRoot removal.
+ It can only happens at the ElementShadow destruction.
+
+ Most of changes in element implementations are basically simple
+ replacement from hasShadowRoot() to shadow().
+
+ No new tests. Covered by existing tests.
+
+ * WebCore.exp.in:
+ * dom/ContainerNodeAlgorithms.h:
+ (WebCore::ChildFrameDisconnector::collectDescendant):
+ * dom/ComposedShadowTreeWalker.cpp:
+ (WebCore::ComposedShadowTreeWalker::traverseChild):
+ * dom/Document.cpp:
+ (WebCore::Document::buildAccessKeyMap):
+ * dom/Element.cpp:
+ (WebCore::Element::recalcStyle):
+ (WebCore::Element::ensureShadowRoot):
+ (WebCore::Element::childrenChanged):
+ * dom/Element.h:
+ (Element):
+ (WebCore::isShadowHost):
+ (WebCore):
+ * dom/ElementShadow.cpp:
+ (WebCore::ElementShadow::~ElementShadow):
+ (WebCore::ElementShadow::removeAllShadowRoots):
+ * dom/ElementShadow.h:
+ (ElementShadow):
+ (WebCore::ElementShadow::host):
+ * dom/EventDispatcher.cpp:
+ * dom/Node.cpp:
+ (WebCore::oldestShadowRootFor):
+ * dom/NodeRenderingContext.cpp:
+ (WebCore::NodeRenderingContext::NodeRenderingContext):
+ * dom/ShadowRoot.cpp:
+ (WebCore::ShadowRoot::create):
+ * html/ColorInputType.cpp:
+ (WebCore::ColorInputType::createShadowSubtree):
+ * html/FileInputType.cpp:
+ (WebCore::FileInputType::createShadowSubtree):
+ (WebCore::FileInputType::multipleAttributeChanged):
+ * html/HTMLDetailsElement.cpp:
+ (WebCore::HTMLDetailsElement::createShadowSubtree):
+ * html/HTMLInputElement.cpp:
+ (WebCore::HTMLInputElement::createShadowSubtree):
+ * html/HTMLKeygenElement.cpp:
+ (WebCore::HTMLKeygenElement::HTMLKeygenElement):
+ (WebCore::HTMLKeygenElement::shadowSelect):
+ * html/HTMLMediaElement.cpp:
+ (WebCore::HTMLMediaElement::hasMediaControls):
+ * html/HTMLMeterElement.cpp:
+ (WebCore::HTMLMeterElement::createShadowSubtree):
+ * html/HTMLProgressElement.cpp:
+ (WebCore::HTMLProgressElement::createShadowSubtree):
+ * html/HTMLSummaryElement.cpp:
+ (WebCore::HTMLSummaryElement::createShadowSubtree):
+ * html/HTMLTextAreaElement.cpp:
+ (WebCore::HTMLTextAreaElement::createShadowSubtree):
+ * html/InputType.cpp:
+ (WebCore::InputType::destroyShadowSubtree):
+ * html/RangeInputType.cpp:
+ (WebCore::RangeInputType::handleMouseDownEvent):
+ (WebCore::RangeInputType::createShadowSubtree):
+ * html/TextFieldInputType.cpp:
+ (WebCore::TextFieldInputType::createShadowSubtree):
+ * html/shadow/SliderThumbElement.cpp:
+ (WebCore::trackLimiterElementOf):
+ * inspector/InspectorDOMAgent.cpp:
+ (WebCore::InspectorDOMAgent::unbind):
+ (WebCore::InspectorDOMAgent::buildObjectForNode):
+ * page/FocusController.cpp:
+ (WebCore):
+ * rendering/RenderFileUploadControl.cpp:
+ (WebCore::RenderFileUploadControl::uploadButton):
+ * svg/SVGTRefElement.cpp:
+ (WebCore::SVGTRefElement::updateReferencedText):
+ (WebCore::SVGTRefElement::detachTarget):
+ * testing/Internals.cpp:
+ (WebCore::Internals::ensureShadowRoot):
+ (WebCore::Internals::youngestShadowRoot):
+ (WebCore::Internals::oldestShadowRoot):
+ * testing/Internals.h:
+ (Internals):
+ * testing/Internals.idl:
+
+2012-05-10 Gyuyoung Kim <gyuyoung.kim@samsung.com>
+
+ Move resumeAnimations to use Internals interface
+ https://bugs.webkit.org/show_bug.cgi?id=86063
+
+ Reviewed by Alexey Proskuryakov.
+
+ Add resumeAnimations functions, because it is able to work in the
+ cross-port way through the Internals interface.
+
+ No new tests, since we are improving here the infra-structure for testing
+ a specific method.
+
+ * testing/Internals.cpp:
+ (WebCore::Internals::resumeAnimations):
+ (WebCore):
+ * testing/Internals.h:
+ (Internals):
+ * testing/Internals.idl:
+
+2012-05-10 Min Qin <qinmin@google.com>
+
+ split MediaPlayer::enterFullscreen into 2 seperate functions
+ https://bugs.webkit.org/show_bug.cgi?id=86052
+
+ Reviewed by Benjamin Poulain.
+
+ It is confusing that enterFullscreen returns a boolean while exitFullscreen does
+ not do the same. And ios does not need the return value.
+ So remove the return value on enterFullscreen and make a seperate canEnterFullscreen()
+ function for android.
+ No tests as there are no behavior change, just refactoring.
+
+ * platform/graphics/MediaPlayer.cpp:
+ (WebCore::MediaPlayer::enterFullscreen):
+ (WebCore):
+ (WebCore::MediaPlayer::canEnterFullscreen):
+ * platform/graphics/MediaPlayer.h:
+ (MediaPlayer):
+ * platform/graphics/MediaPlayerPrivate.h:
+ (WebCore::MediaPlayerPrivateInterface::enterFullscreen):
+ (MediaPlayerPrivateInterface):
+ (WebCore::MediaPlayerPrivateInterface::canEnterFullscreen):
+
+2012-05-10 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r116715.
+ http://trac.webkit.org/changeset/116715
+ https://bugs.webkit.org/show_bug.cgi?id=86172
+
+ Broke http/tests/security/cross-frame-access-selection.html
+ (Requested by tkent on #webkit).
+
+ * dom/Document.cpp:
+ (WebCore):
+ (WebCore::Document::getSelection):
+ * dom/Document.h:
+ (Document):
+ * dom/ShadowRoot.cpp:
+ (WebCore::ShadowRoot::selection):
+ * dom/TreeScope.cpp:
+ (WebCore::TreeScope::~TreeScope):
+ * dom/TreeScope.h:
+ (WebCore):
+ (TreeScope):
+ * page/DOMSelection.cpp:
+ (WebCore::DOMSelection::DOMSelection):
+ * page/DOMSelection.h:
+ (WebCore):
+ (WebCore::DOMSelection::create):
+ (DOMSelection):
+ * page/DOMWindow.cpp:
+ (WebCore::DOMWindow::~DOMWindow):
+ (WebCore::DOMWindow::clearDOMWindowProperties):
+ (WebCore::DOMWindow::getSelection):
+ * page/DOMWindow.h:
+ (DOMWindow):
+
+2012-05-10 Hajime Morrita <morrita@google.com>
+
+ WebKit should support tab-size.
+ https://bugs.webkit.org/show_bug.cgi?id=52994
+
+ - Added boilerplate for "tab-size" CSS property.
+ - Added RenderStye::tabSize() as a RareInheritedData.
+ - Replaced TextRun::m_allowTabs into TextRun::m_tabSize.
+
+ Reviewed by Simon Fraser.
+
+ Tests: fast/css/tab-size-expected.html
+ fast/css/tab-size.html
+
+ * css/CSSComputedStyleDeclaration.cpp:
+ (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
+ * css/CSSParser.cpp:
+ (WebCore::CSSParser::parseValue):
+ * css/CSSProperty.cpp:
+ (WebCore::CSSProperty::isInheritedProperty):
+ * css/CSSPropertyNames.in:
+ * css/CSSStyleSelector.cpp:
+ (WebCore::CSSStyleSelector::applyProperty):
+ * html/canvas/CanvasRenderingContext2D.cpp:
+ (WebCore::CanvasRenderingContext2D::drawTextInternal):
+ * platform/chromium/PopupListBox.cpp:
+ (WebCore::PopupListBox::paintRow):
+ * platform/graphics/Font.h:
+ (WebCore::Font::tabWidth):
+ * platform/graphics/TextRun.h:
+ (WebCore::TextRun::TextRun):
+ (WebCore::TextRun::allowTabs):
+ (WebCore::TextRun::tabSize):
+ (WebCore::TextRun::setTabSize):
+ * platform/graphics/WidthIterator.cpp:
+ (WebCore::WidthIterator::advance):
+ * platform/graphics/mac/ComplexTextController.cpp:
+ (WebCore::ComplexTextController::adjustGlyphsAndAdvances):
+ * platform/win/PopupMenuWin.cpp:
+ (WebCore::PopupMenuWin::paint):
+ * rendering/InlineTextBox.cpp:
+ (WebCore::InlineTextBox::constructTextRun):
+ * rendering/RenderBlock.cpp:
+ (WebCore::RenderBlock::constructTextRun):
+ * rendering/RenderBlockLineLayout.cpp:
+ (WebCore::textWidth):
+ (WebCore::tryHyphenating):
+ * rendering/RenderText.cpp:
+ (WebCore::RenderText::widthFromCache):
+ (WebCore::RenderText::computePreferredLogicalWidths):
+ (WebCore::RenderText::width):
+ * rendering/RenderText.h:
+ * rendering/style/RenderStyle.cpp:
+ (WebCore::RenderStyle::diff):
+ * rendering/style/RenderStyle.h:
+ (WebCore::RenderStyleBitfields::tabSize):
+ (WebCore::RenderStyleBitfields::collapsedTabSize):
+ (WebCore::RenderStyleBitfields::setTabSize):
+ (WebCore::RenderStyleBitfields::initialTabSize):
+ * rendering/style/StyleRareInheritedData.cpp:
+ (WebCore::StyleRareInheritedData::StyleRareInheritedData):
+ (WebCore::StyleRareInheritedData::operator==):
+ * rendering/style/StyleRareInheritedData.h:
+ * rendering/svg/SVGInlineTextBox.cpp:
+ (WebCore::SVGInlineTextBox::constructTextRun):
+ * rendering/svg/SVGTextMetrics.cpp:
+ (WebCore::constructTextRun):
+
+2012-05-10 Antoine Labour <piman@chromium.org>
+
+ Sync with impl thread when removing references to external textures
+ https://bugs.webkit.org/show_bug.cgi?id=86054
+
+ We want to ensure the client side is safe to release textures, so we
+ sync with the impl thread when:
+ - we change the texture (and we had one)
+ - the layer is removed from the tree (and we had a texture)
+ - the layer is destroyed (and we had a texture)
+
+ Reviewed by James Robinson.
+
+ Test: TextureLayerChromiumTest.
+
+ * platform/graphics/chromium/TextureLayerChromium.cpp:
+ (WebCore::TextureLayerChromium::~TextureLayerChromium):
+ (WebCore::TextureLayerChromium::setTextureId):
+ (WebCore::TextureLayerChromium::setLayerTreeHost):
+ (WebCore):
+ * platform/graphics/chromium/TextureLayerChromium.h:
+ (TextureLayerChromium):
+
+2012-05-10 Kent Tamura <tkent@chromium.org>
+
+ [Chromium] attempt to build fix for Chromium-mac.
+ r116697 introduced an override of a system function. It's intentional
+ and WebCoreTextFieldCell should be in the whitelist.
+
+ * WebCore.gyp/WebCore.gyp:
+
+2012-05-10 Anders Carlsson <andersca@apple.com>
+
+ PDF files won't scroll in Safari when using Adobe plug-in
+ https://bugs.webkit.org/show_bug.cgi?id=86167
+ <rdar://problem/11389719>
+
+ Reviewed by Sam Weinig.
+
+ * page/scrolling/ScrollingCoordinator.cpp:
+ (WebCore::computeNonFastScrollableRegion):
+ Loop over the frame view children looking for plug-in views that want wheel events
+ and add them to the non-fast scrollable region. Ideally, the plug-ins should be added
+ to the set of scrollable areas, but PluginView in WebKit2 is not a ScrollableArea yet.
+
+ * plugins/PluginViewBase.h:
+ (PluginViewBase):
+ (WebCore::PluginViewBase::wantsWheelEvents):
+
+2012-05-10 Alexey Proskuryakov <ap@apple.com>
+
+ Crash in 3rd party WebKit apps that disable cache at a wrong time
+ https://bugs.webkit.org/show_bug.cgi?id=86027
+ <rdar://problem/10615880>
+
+ Reviewed by Antti Koivisto.
+
+ Added an API test.
+
+ The fix is to use CachedResourceHandle throughout MemoryCache, which will certainly
+ keep the resource alive. Also removed earlier fixes.
+
+ * css/CSSImageSetValue.cpp: (WebCore::CSSImageSetValue::cachedImageSet):
+ * css/CSSImageValue.cpp: (WebCore::CSSImageValue::cachedImage):
+ * css/WebKitCSSShaderValue.cpp: (WebCore::WebKitCSSShaderValue::cachedShader):
+ * history/PageCache.cpp: (WebCore::PageCache::releaseAutoreleasedPagesNow):
+ * loader/ImageLoader.cpp: (WebCore::ImageLoader::updateFromElement):
+ * loader/TextTrackLoader.cpp: (WebCore::TextTrackLoader::load):
+ * loader/cache/CachedResourceLoader.cpp:
+ (WebCore::CachedResourceLoader::requestImage):
+ (WebCore::CachedResourceLoader::requestFont):
+ (WebCore::CachedResourceLoader::requestTextTrack):
+ (WebCore::CachedResourceLoader::requestShader):
+ (WebCore::CachedResourceLoader::requestCSSStyleSheet):
+ (WebCore::CachedResourceLoader::requestUserCSSStyleSheet):
+ (WebCore::CachedResourceLoader::requestScript):
+ (WebCore::CachedResourceLoader::requestXSLStyleSheet):
+ (WebCore::CachedResourceLoader::requestSVGDocument):
+ (WebCore::CachedResourceLoader::requestLinkResource):
+ (WebCore::CachedResourceLoader::requestRawResource):
+ (WebCore::CachedResourceLoader::requestResource):
+ (WebCore::CachedResourceLoader::revalidateResource):
+ (WebCore::CachedResourceLoader::loadResource):
+ (WebCore::CachedResourceLoader::requestPreload):
+ * loader/cache/CachedResourceLoader.h: (CachedResourceLoader):
+ * loader/cache/MemoryCache.h: (WebCore::MemoryCache::setPruneEnabled):
+
+ * loader/cache/CachedResourceHandle.h:
+ (WebCore::CachedResourceHandle::CachedResourceHandle):
+ (WebCore::CachedResourceHandle::operator=):
+ Teach CachedResourceHandle how to make CachedResourceHandle<CachedResource> from
+ a handle to subclass.
+
+2012-05-10 Tien-Ren Chen <trchen@chromium.org>
+
+ Eliminate duplicated code for culled line box in RenderInline
+ https://bugs.webkit.org/show_bug.cgi?id=85725
+
+ This patch extracts the common part of culledInlineBoundingBox() /
+ culledInlineAbsoluteRects() / culledInlineAbsoluteQuads() to become a
+ template function generateCulledLineBoxRects(). The template function
+ accepts a new parameter, GeneratorContext functor, which will be
+ invoked everytime a new line box rect has been generated. The generated
+ rect will be in local coordinate. The functor will be responsible for
+ appropriate transformation, then appending to vector or union with
+ existing bounding box.
+
+ Reviewed by Eric Seidel.
+
+ No new tests. No change in behavior.
+
+ * rendering/RenderInline.cpp:
+ (WebCore):
+ (WebCore::RenderInline::generateLineBoxRects):
+ (WebCore::RenderInline::generateCulledLineBoxRects):
+ (WebCore::RenderInline::absoluteRects):
+ (WebCore::RenderInline::absoluteQuads):
+ (WebCore::RenderInline::linesBoundingBox):
+ (WebCore::RenderInline::culledInlineVisualOverflowBoundingBox):
+ (WebCore::RenderInline::addFocusRingRects):
+ * rendering/RenderInline.h:
+ (RenderInline):
+
+2012-05-10 Abhishek Arya <inferno@chromium.org>
+
+ Crash in swapInNodePreservingAttributesAndChildren.
+ https://bugs.webkit.org/show_bug.cgi?id=85197
+
+ Reviewed by Ryosuke Niwa.
+
+ Keep the children in a ref vector before adding them to newNode.
+ They can get destroyed due to mutation events.
+
+ No new tests because we don't have a reduction.
+
+ * editing/ReplaceNodeWithSpanCommand.cpp:
+ (WebCore::swapInNodePreservingAttributesAndChildren):
+
+2012-05-10 Shinya Kawanaka <shinyak@chromium.org>
+
+ [Refactoring] Move Selection from DOMWindow to TreeScope.
+ https://bugs.webkit.org/show_bug.cgi?id=82699
+
+ Reviewed by Ryosuke Niwa.
+
+ Since ShadowRoot will also manage its own version of DOMSelection, we would like to
+ share the code among Document and DOMSelection. This patch moves DOMSelection from DOMWindow to TreeScope
+ so that ShadowRoot can also use it.
+
+ No new tests, should covered by existing tests.
+
+ * dom/Document.cpp:
+ (WebCore::Document::updateFocusAppearanceTimerFired):
+ * dom/Document.h:
+ (Document):
+ * dom/ShadowRoot.cpp:
+ (WebCore::ShadowRoot::selection):
+ * do/mTreeScope.cpp:
+ (WebCore::TreeScope::~TreeScope):
+ (WebCore::TreeScope::getSelection):
+ (WebCore):
+ * dom/TreeScope.h:
+ (WebCore):
+ (TreeScope):
+ * page/DOMSelection.cpp:
+ (WebCore::DOMSelection::DOMSelection):
+ (WebCore::DOMSelection::clearTreeScope):
+ (WebCore):
+ * page/DOMSelection.h:
+ (WebCore):
+ (WebCore::DOMSelection::create):
+ (DOMSelection):
+ (WebCore::DOMSelection::frame):
+ * page/DOMWindow.cpp:
+ (WebCore::DOMWindow::~DOMWindow):
+ (WebCore::DOMWindow::clearDOMWindowProperties):
+ (WebCore::DOMWindow::getSelection):
+ * page/DOMWindow.h:
+ (DOMWindow):
+
+2012-05-10 Kent Tamura <tkent@chromium.org>
+
+ Unreviewed, rolling out r116594.
+ http://trac.webkit.org/changeset/116594
+ https://bugs.webkit.org/show_bug.cgi?id=86013
+
+ r116594 might have made some composition tests flaky.
+
+ * platform/graphics/chromium/LayerChromium.cpp:
+ (WebCore::LayerChromium::addAnimation):
+ * platform/graphics/chromium/cc/CCLayerAnimationController.cpp:
+ (WebCore::CCLayerAnimationController::pushNewAnimationsToImplThread):
+ * platform/graphics/chromium/cc/CCLayerTreeHost.cpp:
+ (WebCore::CCLayerTreeHost::finishCommitOnImplThread):
+ (WebCore::CCLayerTreeHost::didBecomeInvisibleOnImplThread):
+ * platform/graphics/chromium/cc/CCLayerTreeHost.h:
+ (CCLayerTreeHost):
+ * platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp:
+ (WebCore::CCLayerTreeHostImpl::CCLayerTreeHostImpl):
+ * platform/graphics/chromium/cc/CCProxy.h:
+ (CCProxy):
+ * platform/graphics/chromium/cc/CCSingleThreadProxy.cpp:
+ (WebCore::CCSingleThreadProxy::CCSingleThreadProxy):
+ (WebCore::CCSingleThreadProxy::doComposite):
+ * platform/graphics/chromium/cc/CCSingleThreadProxy.h:
+ (WebCore):
+ * platform/graphics/chromium/cc/CCThreadProxy.h:
+ (CCThreadProxy):
+
+2012-05-10 Michael Nordman <michaeln@google.com>
+
+ [chromium] DomStorage events handling needs TLC (2)
+ https://bugs.webkit.org/show_bug.cgi?id=85221
+ Alter the StorageArea virtual interface such that the mutators no longer
+ return old values. This is to allow implementations of the interface to operate
+ more asynchronously.
+
+ Reviewed by Adam Barth.
+
+ No new tests. Existing tests cover this.
+
+ * storage/StorageArea.h: Alter the interface so the mutators no longer return previous values
+ * storage/StorageAreaImpl.cpp:
+ (WebCore::StorageAreaImpl::disabledByPrivateBrowsingInFrame): removed an unneeded PLATFORM(CHROMIUM) guard
+ (WebCore::StorageAreaImpl::setItem): no longer return the old value
+ (WebCore::StorageAreaImpl::removeItem): no longer return the old value
+ (WebCore::StorageAreaImpl::clear): no longer return whether something was cleared
+ * storage/StorageAreaImpl.h: match StorageArea's virtual interface
+
+2012-05-10 Beth Dakin <bdakin@apple.com>
+
+ https://bugs.webkit.org/show_bug.cgi?id=86158
+ Overlay scrollbars without layers never paint in overflow regions in
+ tiled drawing mode
+ -and corresponding-
+ <rdar://problem/11289546>
+
+ Reviewed by Darin Adler.
+
+ RenderLayers paint scrollbars that do not have their own layers by
+ running a second pass through the layer tree after the layer tree has
+ painted. This ensures that the scrollbars always paint on top of
+ content. However, this mechanism was relying on
+ FrameView::paintContents() as a choke-point for all painting to
+ trigger the second painting pass. That is not a reasonable choke-point
+ in tiled drawing, so this patch adds similar code to
+ RenderLayerBacking.
+
+ Only opt into the second painting pass for scrollbars that do not have
+ their own layers.
+ * rendering/RenderLayer.cpp:
+ (WebCore::RenderLayer::paintOverflowControls):
+
+ A layer that paints into its backing cannot return early here if it
+ has overlay scrollbars to paint.
+ (WebCore::RenderLayer::paintLayer):
+
+ This replicates code in FrameView::paintContents(). After painting the
+ owning layer, do a second pass if there are overlay scrollbars to
+ paint.
+ * rendering/RenderLayerBacking.cpp:
+ (WebCore::RenderLayerBacking::paintIntoLayer):
+
+2012-05-10 Anders Carlsson <andersca@apple.com>
+
+ Well, at least fixing the GTK+ build is something!
+
+ * platform/gtk/LocalizedStringsGtk.cpp:
+ (WebCore::insecurePluginVersionText):
+ (WebCore):
+
+2012-05-10 Anders Carlsson <andersca@apple.com>
+
+ Add insecurePluginVersionText stubs.
+
+ * platform/blackberry/LocalizedStringsBlackBerry.cpp:
+ (WebCore::insecurePluginVersionText):
+ (WebCore):
+ * platform/efl/LocalizedStringsEfl.cpp:
+ (WebCore::insecurePluginVersionText):
+ (WebCore):
+ * platform/qt/LocalizedStringsQt.cpp:
+ (WebCore::insecurePluginVersionText):
+ (WebCore):
+
+2012-05-10 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r116677.
+ http://trac.webkit.org/changeset/116677
+ https://bugs.webkit.org/show_bug.cgi?id=86159
+
+ This patch causes linker error to some mac bots (Requested by
+ jianli_ on #webkit).
+
+ * WebCore.exp.in:
+ * dom/ContainerNode.h:
+ * dom/Node.cpp:
+ (WebCore::Node::traverseNextNode):
+ (WebCore::Node::traverseNextSibling):
+ * dom/Node.h:
+ (Node):
+
+2012-05-10 Abhishek Arya <inferno@chromium.org>
+
+ Crash in FontCache::releaseFontData due to infinite float size.
+ https://bugs.webkit.org/show_bug.cgi?id=86110
+
+ Reviewed by Andreas Kling.
+
+ New callers always forget to clamp the font size, which overflows
+ to infinity on multiplication. It is best to clamp it at the end
+ to avoid getting greater than std::numeric_limits<float>::max().
+
+ Test: fast/css/large-font-size-crash.html
+
+ * platform/graphics/FontDescription.h:
+ (WebCore::FontDescription::setComputedSize):
+ (WebCore::FontDescription::setSpecifiedSize):
+
+2012-05-10 Beth Dakin <bdakin@apple.com>
+
+ https://bugs.webkit.org/show_bug.cgi?id=82131
+ [Mac] REGRESSION (r110480): Text field that specifies background-color
+ (or is auto-filled) gets un-themed border
+ -and corresponding-
+ <rdar://problem/11115221>
+
+ Reviewed by Maciej Stachowiak.
+
+ This change rolls out r110480 which is what caused styled text fields
+ to get the un-themed border, and it does a bunch of work to make sure
+ we get the pretty, new version of the NSTextField art whenever
+ possible. We do this differently for post-Lion OS's since there is now
+ a way to opt into it all the time. Lion and SnowLeopard can only use
+ the new art in HiDPI mode when the background color of the text field
+ is just white.
+
+ RenderThemeMac::textField() takes a boolean paramter used to determine
+ if the new gradient will be used.
+ * rendering/RenderThemeMac.h:
+ (RenderThemeMac):
+
+ This is the post-Lion workaround. This code has no effect on Lion and
+ SnowLeopard. This allows up to opt into a version of [NSTextField drawWithFrame:] that will only draw the frame of the text field; without this, it will draw the frame and the background, which creates a number of problems with styled text fields and text fields in HiDPI. There is a less comprehesive workaround for Lion and SnowLeopard in place in RenderThemeMac::textField().
+ * rendering/RenderThemeMac.mm:
+ (-[WebCoreTextFieldCell _coreUIDrawOptionsWithFrame:inView:includeFocus:]):
+
+ This is the roll-out of r110480.
+ (WebCore::RenderThemeMac::isControlStyled):
+
+ See the comments for a full explanation, but this is mostly code for
+ Lion and SnowLeopard to determine if we can opt into the new artwork.
+ (WebCore::RenderThemeMac::paintTextField):
+ (WebCore::RenderThemeMac::textField):
+
+2012-05-10 Anders Carlsson <andersca@apple.com>
+
+ WebKit1: Add a way to blacklist specific plug-ins/plug-in versions
+ https://bugs.webkit.org/show_bug.cgi?id=86150
+ <rdar://problem/9551196>
+
+ Reviewed by Sam Weinig.
+
+ * English.lproj/Localizable.strings:
+ Update.
+
+ * loader/SubframeLoader.cpp:
+ (WebCore::SubframeLoader::loadPlugin):
+ It is possible that the client has already set the unavailability reason so don't try to set it twice.
+
+ * platform/LocalizedStrings.cpp:
+ (WebCore::insecurePluginVersionText):
+ * platform/LocalizedStrings.h:
+ Add insecure plug-in version text.
+
+ * rendering/RenderEmbeddedObject.cpp:
+ (WebCore::RenderEmbeddedObject::unavailablePluginReplacementText):
+ * rendering/RenderEmbeddedObject.h:
+ Add InsecurePluginVersion unavailability reason.
+
+2012-05-10 Eric Seidel <eric@webkit.org>
+
+ Make IFRAME_SEAMLESS child documents inherit styles from their parent iframe element
+ https://bugs.webkit.org/show_bug.cgi?id=85940
+
+ Reviewed by Ojan Vafai.
+
+ The HTML5 <iframe seamless> spec says:
+ In a CSS-supporting user agent: the user agent must, for the purpose of CSS property
+ inheritance only, treat the root element of the active document of the iframe
+ element's nested browsing context as being a child of the iframe element.
+ (Thus inherited properties on the root element of the document in the
+ iframe will inherit the computed values of those properties on the iframe
+ element instead of taking their initial values.)
+
+ Initially I implemented this support to the letter of the spec. However, doing so I learned
+ that WebKit has a RenderStyle for the Document Node, not just the root element of the document.
+ In this RenderStyle on the Document, we add a bunch of per-document styles from settings
+ including designMode.
+
+ This change makes StyleResolver::styleForDocument inherit style from the parent iframe's
+ style, before applying any of these per-document styles. This may or may not be correct
+ depending on what behavior we want for rtl-ordering, page-zoom, locale, design mode, etc.
+ For now, we continue to treat the iframe's document as independent in these regards, and
+ the settings on that document override those inherited from the iframe.
+
+ Also, intially when making this work, I added redirects in recalcStyle and scheduleStyleRecalc
+ from the child document to the parent document in the case of seamless (since the parent
+ document effectively manages the style resolve and layout of the child in seamless mode).
+ However, I was not able to find a test which depended on this code change, so in this final patch
+ I have removed both of these modifications and replaced them with FIXMEs. Based on discussions
+ with Ojan and James Robinson, I believe both of those changes may eventually be wanted.
+
+ This change basically does 3 things:
+ 1. Makes StyleResolver::styleForDocument inherit from the parent iframe.
+ 2. Makes any recalcStyle calls on the iframe propogate down into the child document (HTMLIFrameElement::didRecalcStyle).
+ 3. Makes Document::recalcStyle aware of the fact that the Document's style *can* change
+ for reasons other than recalcStyle(Force).
+
+ I'm open to more testing suggestions, if reviewers have settings on the Document's style
+ that you want to make sure we inherit from the parent iframe, or don't inherit, etc.
+ I view this as a complete solution to this aspect of the current <iframe seamless> spec,
+ but likely not the last code we will write for this aspect of the seamless feature. :)
+
+ Tested by fast/frames/seamlesss/seamless-css-cascade.html and seamless-designMode.html
+
+ * css/StyleResolver.cpp:
+ (WebCore::StyleResolver::collectMatchingRulesForList):
+ * dom/Document.cpp:
+ (WebCore::Document::scheduleStyleRecalc):
+ (WebCore::Document::recalcStyle):
+ * html/HTMLIFrameElement.cpp:
+ (WebCore::HTMLIFrameElement::HTMLIFrameElement):
+ (WebCore::HTMLIFrameElement::didRecalcStyle):
+ (WebCore):
+ * html/HTMLIFrameElement.h:
+ (HTMLIFrameElement):
+
+2012-05-10 Julien Chaffraix <jchaffraix@webkit.org>
+
+ Crash in computedCSSPadding* functions due to RenderImage::imageDimensionsChanged called during attachment
+ https://bugs.webkit.org/show_bug.cgi?id=85912
+
+ Reviewed by Eric Seidel.
+
+ Tests: fast/images/link-body-content-imageDimensionChanged-crash.html
+ fast/images/script-counter-imageDimensionChanged-crash.html
+
+ The bug comes from CSS generated images that could end up calling imageDimensionsChanged during attachment. As the
+ rest of the code (e.g. computedCSSPadding*) would assumes that we are already inserted in the tree, we would crash.
+
+ The solution is to bail out in this case as newly inserted RenderObject will trigger layout later on and properly
+ handle what we would be doing as part of imageDimensionChanged (the only exception being updating our intrinsic
+ size which should be done as part of imageDimensionsChanged).
+
+ * rendering/RenderImage.cpp:
+ (WebCore::RenderImage::imageDimensionsChanged):
+
+2012-05-10 Adam Barth <abarth@webkit.org>
+
+ ASSERT in BidiResolver<Iterator, Run>::commitExplicitEmbedding makes running debug builds annoying
+ https://bugs.webkit.org/show_bug.cgi?id=86140
+
+ Reviewed by Eric Seidel.
+
+ The correct fix here is to resolve
+ https://bugs.webkit.org/show_bug.cgi?id=76574, but in the mean time,
+ this ASSERT is annoying.
+
+ * platform/text/BidiResolver.h:
+ (WebCore::::commitExplicitEmbedding):
+
+2012-05-10 Mark Pilgrim <pilgrim@chromium.org>
+
+ [Chromium] Call addTraceEvent and getTraceCategoryEnabledFlag directly
+ https://bugs.webkit.org/show_bug.cgi?id=85399
+
+ Reviewed by Adam Barth.
+
+ Part of a refactoring series. See tracking bug 82948.
+
+ * CMakeLists.txt:
+ * GNUmakefile.list.am:
+ * Target.pri:
+ * WebCore.gypi:
+ * WebCore.vcproj/WebCore.vcproj:
+ * WebCore.xcodeproj/project.pbxproj:
+ * platform/EventTracer.cpp: Added.
+ (WebCore):
+ (WebCore::EventTracer::getTraceCategoryEnabledFlag):
+ (WebCore::EventTracer::addTraceEvent):
+ * platform/EventTracer.h: Added.
+ (WebCore):
+ (EventTracer):
+ * platform/chromium/EventTracerChromium.cpp: Added.
+ (WebCore):
+ (WebCore::EventTracer::getTraceCategoryEnabledFlag):
+ (WebCore::EventTracer::addTraceEvent):
+ * platform/chromium/PlatformSupport.h:
+ * platform/chromium/TraceEvent.h:
+
+2012-05-10 Adam Barth <abarth@webkit.org>
+
+ ScrollView::fixedVisibleContentRect should be public
+ https://bugs.webkit.org/show_bug.cgi?id=86147
+
+ Reviewed by Eric Seidel.
+
+ Some code in the WebKit layer of OS(ANDROID) uses this function. That
+ could will be upstreamed in a later patch. For now, this patch just
+ makes this function public so that we remove the diff to this file.
+
+ * platform/ScrollView.h:
+ (WebCore::ScrollView::fixedVisibleContentRect):
+ (WebCore::ScrollView::delegatesScrollingDidChange):
+
+2012-05-10 Anders Carlsson <andersca@apple.com>
+
+ Rename the missing plug-in indicator to the unavailable plug-in indicator
+ https://bugs.webkit.org/show_bug.cgi?id=86136
+
+ Reviewed by Sam Weinig.
+
+ Since the indicator is shown for more than just missing plug-ins, generalize it and use a plug-in unavailability
+ reason enum to make it easier to extend. Also, pass the unavailability reason to the ChromeClient member functions.
+
+ * WebCore.exp.in:
+ * html/HTMLEmbedElement.cpp:
+ (WebCore::HTMLEmbedElement::updateWidget):
+ * html/HTMLObjectElement.cpp:
+ (WebCore::HTMLObjectElement::updateWidget):
+ * html/HTMLPlugInElement.cpp:
+ (WebCore::HTMLPlugInElement::defaultEventHandler):
+ * html/HTMLPlugInImageElement.cpp:
+ (WebCore::HTMLPlugInImageElement::updateWidgetIfNecessary):
+ * loader/SubframeLoader.cpp:
+ (WebCore::SubframeLoader::loadPlugin):
+ * page/ChromeClient.h:
+ (WebCore::ChromeClient::shouldUnavailablePluginMessageBeButton):
+ (WebCore::ChromeClient::unavailablePluginButtonClicked):
+ * page/FrameView.cpp:
+ (WebCore::FrameView::updateWidget):
+ * rendering/RenderEmbeddedObject.cpp:
+ (WebCore::RenderEmbeddedObject::RenderEmbeddedObject):
+ (WebCore::RenderEmbeddedObject::setPluginUnavailabilityReason):
+ (WebCore::RenderEmbeddedObject::showsUnavailablePluginIndicator):
+ (WebCore::RenderEmbeddedObject::setUnavailablePluginIndicatorIsPressed):
+ (WebCore::RenderEmbeddedObject::paint):
+ (WebCore::RenderEmbeddedObject::paintReplaced):
+ (WebCore::RenderEmbeddedObject::getReplacementTextGeometry):
+ (WebCore::RenderEmbeddedObject::unavailablePluginReplacementText):
+ (WebCore):
+ (WebCore::RenderEmbeddedObject::isInUnavailablePluginIndicator):
+ (WebCore::shouldUnavailablePluginMessageBeButton):
+ (WebCore::RenderEmbeddedObject::handleUnavailablePluginIndicatorEvent):
+ (WebCore::RenderEmbeddedObject::getCursor):
+ * rendering/RenderEmbeddedObject.h:
+ (RenderEmbeddedObject):
+
+2012-05-10 Brady Eidson <beidson@apple.com>
+
+ <rdar://problem/10972577> and https://bugs.webkit.org/show_bug.cgi?id=80170
+ Contents of noscript elements turned into strings in WebArchives
+
+ Reviewed by Andy Estes.
+
+ There's a much deeper question about how innerHTML of <noscript> is expected to work in
+ both a scripting and non-scripting environment that we should pursue separately.
+
+ But for webarchives, we can solve this by filtering out the <noscript> elements completely
+ if scripting is enabled.
+
+ Test: webarchive/ignore-noscript-if-scripting-enabled.html
+
+ * WebCore.exp.in:
+
+ Add arguments to createMarkup and MarkupAccumulator methods to pass a Vector of QualifiedNames
+ that should be filtered from the resulting markup:
+ * editing/MarkupAccumulator.cpp:
+ (WebCore::MarkupAccumulator::serializeNodes):
+ (WebCore::MarkupAccumulator::serializeNodesWithNamespaces):
+ * editing/MarkupAccumulator.h:
+ * editing/markup.cpp:
+ (WebCore::createMarkup):
+ * editing/markup.h:
+
+ If scripting is enabled, add the noscriptTag to the tag names to filter:
+ * loader/archive/cf/LegacyWebArchive.cpp:
+ (WebCore::LegacyWebArchive::create):
+
+2012-05-10 Abhishek Arya <inferno@chromium.org>
+
+ Crash due to floats not removed from first-letter element.
+ https://bugs.webkit.org/show_bug.cgi?id=86019
+
+ Reviewed by Julien Chaffraix.
+
+ Move clearing logic of a floating/positioned object from removeChild
+ to removeChildNode. There are lot of places which use removeChildNode
+ directly and hence the object is not removed from the floating or
+ positioned objects list.
+
+ Test: fast/block/float/float-not-removed-from-first-letter.html
+
+ * rendering/RenderObject.cpp:
+ (WebCore::RenderObject::removeChild):
+ * rendering/RenderObjectChildList.cpp:
+ (WebCore::RenderObjectChildList::removeChildNode):
+
+2012-05-10 Andreas Kling <kling@webkit.org>
+
+ Remove empty ElementAttributeData destructor.
+ <http://webkit.org/b/86126>
+
+ Reviewed by Antti Koivisto.
+
+ * dom/ElementAttributeData.cpp:
+ * dom/ElementAttributeData.h:
+
+2012-05-10 Yury Semikhatsky <yurys@chromium.org>
+
+ Web Inspector: heap snapshot comparison view is broken
+ https://bugs.webkit.org/show_bug.cgi?id=86102
+
+ Reviewed by Pavel Feldman.
+
+ Pass HeapSnapshotProxy instead of undefined to the profile load callback. Added
+ compiler annotations to avoid such errors in the future.
+
+ * inspector/front-end/HeapSnapshotView.js:
+
+2012-05-10 Zan Dobersek <zandobersek@gmail.com>
+
+ [GTK] ENABLE_IFRAME_SEAMLESS support
+ https://bugs.webkit.org/show_bug.cgi?id=85843
+
+ Reviewed by Eric Seidel.
+
+ Export the ENABLE_IFRAME_SEAMLESS feature define when the feature is
+ enabled.
+
+ No new tests - all the related tests should now be passing.
+
+ * GNUmakefile.am:
+
+2012-05-10 Antti Koivisto <antti@apple.com>
+
+ Inline Node::traverseNextNode
+ https://bugs.webkit.org/show_bug.cgi?id=85844
+
+ Reviewed by Ryosuke Niwa.
+
+ Inline traverseNextNode and traverseNextSibling to reduce entry/exit overhead and allow better code generation
+ for many hot loops.
+
+ In this version only the firstChild()/nextSibling() tests are inlined and the ancestor traversal is not.
+
+ Performance bots will tell if this was worthwhile.
+
+ * dom/ContainerNode.h:
+ (WebCore::Node::traverseNextNode):
+ (WebCore):
+ (WebCore::Node::traverseNextSibling):
+ * dom/Node.cpp:
+ (WebCore::Node::traverseNextAncestorSibling):
+ * dom/Node.h:
+ (Node):
+
+2012-05-10 Tommy Widenflycht <tommyw@google.com>
+
+ MediaStream API: Fix MediaHints parsing
+ https://bugs.webkit.org/show_bug.cgi?id=86098
+
+ Reviewed by Adam Barth.
+
+ Not currently testable. Working on a series of patches that will fix that.
+
+ * Modules/mediastream/PeerConnection00.cpp:
+ (WebCore::PeerConnection00::createMediaHints):
+
+2012-05-10 Tommy Widenflycht <tommyw@google.com>
+
+ [chromium] MediaStream API: Fix the ExtraData functionality in WebMediaStreamDescriptor
+ https://bugs.webkit.org/show_bug.cgi?id=86087
+
+ Reviewed by Adam Barth.
+
+ Not easy to test but I have added code that excercises this to WebUserMediaClientMock (in DumpRenderTree).
+
+ * platform/chromium/support/WebMediaStreamDescriptor.cpp:
+ (WebKit::WebMediaStreamDescriptor::setExtraData):
+
+2012-05-10 Pavel Feldman <pfeldman@chromium.org>
+
+ Web Inspector: search title is shown beside the search field (not under) in the vertical mode.
+ https://bugs.webkit.org/show_bug.cgi?id=86120
+
+ Reviewed by Yury Semikhatsky.
+
+ This change makes search title render as placeholder at all times.
+ It also adjusts the size of the search field when navigation arrows appear.
+
+ * inspector/front-end/SearchController.js:
+ (WebInspector.SearchController):
+ (WebInspector.SearchController.prototype.updateSearchLabel):
+ (WebInspector.SearchController.prototype._updateSearchNavigationButtonState):
+ (WebInspector.SearchController.prototype._createSearchNavigationButton):
+ * inspector/front-end/inspector.css:
+ (#toolbar-search-item):
+ (.with-navigation-buttons #search):
+ (.toolbar-search-navigation-label):
+ (.with-navigation-buttons .toolbar-search-navigation-label):
+ * inspector/front-end/inspector.html:
+
+2012-05-10 Varun Jain <varunjain@google.com>
+
+ [chromium] Trigger context menu for long press gesture
+ https://bugs.webkit.org/show_bug.cgi?id=85919
+
+ Reviewed by Adam Barth.
+
+ Test: fast/events/touch/gesture/context-menu-on-long-press.html
+
+ * page/EventHandler.cpp:
+ (WebCore):
+ (WebCore::EventHandler::sendContextMenuEventForGesture):
+ * page/EventHandler.h:
+ (EventHandler):
+
+2012-05-10 Abhishek Arya <inferno@chromium.org>
+
+ Crash in ApplyStyleCommand::joinChildTextNodes.
+ https://bugs.webkit.org/show_bug.cgi?id=85939
+
+ Reviewed by Ryosuke Niwa.
+
+ Test: editing/style/apply-style-join-child-text-nodes-crash.html
+
+ * editing/ApplyStyleCommand.cpp:
+ (WebCore::ApplyStyleCommand::applyRelativeFontStyleChange): add conditions
+ to bail out if our start and end position nodes are removed due to
+ mutation events in joinChildTextNodes.
+ (WebCore::ApplyStyleCommand::applyInlineStyle): this executes after
+ applyRelativeFontStyleChange in ApplyStyleCommand::doApply. So, need
+ to bail out if our start and end position nodes are removed due to
+ mutation events.
+ (WebCore::ApplyStyleCommand::joinChildTextNodes): hold all the children
+ in a ref vector to prevent them from getting destroyed due to mutation events.
+
+2012-05-10 Erik Arvidsson <arv@chromium.org>
+
+ Unreviewed, rebaselined run-bindings-tests results.
+
+ * bindings/scripts/test/JS/JSTestEventTarget.cpp:
+ (WebCore::jsTestEventTargetPrototypeFunctionAddEventListener):
+ (WebCore::jsTestEventTargetPrototypeFunctionRemoveEventListener):
+ * bindings/scripts/test/JS/JSTestObj.cpp:
+ (WebCore::jsTestObjPrototypeFunctionAddEventListener):
+ (WebCore::jsTestObjPrototypeFunctionRemoveEventListener):
+ * bindings/scripts/test/V8/V8TestException.cpp:
+ (WebCore::V8TestException::wrapSlow):
+ * bindings/scripts/test/V8/V8TestException.h:
+ (WebCore::V8TestException::wrap):
+
+2012-05-10 Abhishek Arya <inferno@chromium.org>
+
+ Crash in InsertParagraphSeparatorCommand::doApply.
+ https://bugs.webkit.org/show_bug.cgi?id=84995
+
+ Reviewed by Ryosuke Niwa.
+
+ Test: editing/inserting/insert-paragraph-seperator-crash.html
+
+ * editing/DeleteSelectionCommand.cpp:
+ (WebCore::DeleteSelectionCommand::mergeParagraphs): no need of static cast, since
+ type of enclosingBlock returned is already Element*.
+ * editing/IndentOutdentCommand.cpp:
+ (WebCore::IndentOutdentCommand::tryIndentingAsListItem): no need of static cast, since
+ type of enclosingBlock returned is already Element*.
+ * editing/InsertParagraphSeparatorCommand.cpp:
+ (WebCore::InsertParagraphSeparatorCommand::doApply): RefPtr startBlock to guard against
+ mutation events.
+ * editing/htmlediting.cpp:
+ (WebCore::enclosingBlock): make sure type of enclosingNode is an element before doing
+ the static cast. This was already failing in a couple of layout tests. Also, isBlock
+ check already exists in the function call to enclosingNodeOfType, so don't need it
+ again on enclosingNode's renderer.
+ * editing/htmlediting.h:
+ (WebCore):
+
+2012-05-10 Allan Sandfeld Jensen <allan.jensen@nokia.com>
+
+ TouchAdjustment doesn't correct for scroll-offsets.
+ https://bugs.webkit.org/show_bug.cgi?id=86083
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Already tested by: touchadjustment/scroll-delegation
+
+ * page/EventHandler.cpp:
+ (WebCore::EventHandler::bestClickableNodeForTouchPoint):
+ (WebCore::EventHandler::bestZoomableAreaForTouchPoint):
+ * page/TouchAdjustment.cpp:
+ (WebCore::TouchAdjustment::findNodeWithLowestDistanceMetric):
+ * testing/Internals.cpp:
+ (WebCore::Internals::bestZoomableAreaForTouchPoint):
+
+2012-05-10 Konrad Piascik <kpiascik@rim.com>
+
+ Fix typo in filename
+ https://bugs.webkit.org/show_bug.cgi?id=86095
+
+ Reviewed by Andreas Kling.
+
+ * UseJSC.cmake:
+
+2012-05-10 Stephen Chenney <schenney@chromium.org>
+
+ SVG Filters allow invalid elements as children
+ https://bugs.webkit.org/show_bug.cgi?id=83979
+
+ Reviewed by Nikolas Zimmermann.
+
+ According to the SVG spec, there are numerous restrictions on the
+ content of nodes (that is, their children). Specific to this problem,
+ SVGFilter elements may only contain SVGFilterPrimitive elements, and
+ those may only contain animation related elements. This patch enforces
+ the restriction on filters in the render tree, thus preventing us from
+ having (for instance) content that is inside a filter yet filtered by
+ the filter.
+
+ Manual test: ManualTests/bugzilla-83979.svg
+
+ * svg/SVGFilterElement.cpp:
+ (WebCore::SVGFilterElement::childShouldCreateRenderer): Added to only allow renderers for fe* children
+ (WebCore):
+ * svg/SVGFilterElement.h:
+ (SVGFilterElement):
+ * svg/SVGFilterPrimitiveStandardAttributes.h: Do not allow any children at all for fe* elements.
+ (SVGFilterPrimitiveStandardAttributes):
+
+2012-05-10 Joe Thomas <joethomas@motorola.com>
+
+ [CSS3 Backgrounds and Borders] Add background-size to the background shorthand
+ https://bugs.webkit.org/show_bug.cgi?id=27577
+
+ Reviewed by Alexis Menard.
+
+ Added CSSPropertyBackgroundSize to the background shorthand propery. Added the logic for parsing background-size.
+ bakground-size appears after background-position followed by a '/'.
+ The specification related to this change is http://www.w3.org/TR/css3-background/#the-background
+
+ Tests: fast/backgrounds/background-shorthand-with-backgroundSize-style.html
+ fast/backgrounds/size/backgroundSize-in-background-shorthand.html
+
+ * css/CSSComputedStyleDeclaration.cpp:
+ (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
+ (WebCore::CSSComputedStyleDeclaration::getBackgroundShorthandValue):
+ (WebCore):
+ * css/CSSComputedStyleDeclaration.h:
+ (CSSComputedStyleDeclaration):
+ * css/CSSParser.cpp:
+ (WebCore::CSSParser::parseValue):
+ (WebCore::CSSParser::parseFillShorthand):
+ * css/StylePropertySet.cpp:
+ (WebCore::StylePropertySet::getLayeredShorthandValue):
+ * css/StylePropertyShorthand.cpp:
+ (WebCore):
+ (WebCore::backgroundShorthand):
+
+2012-05-10 MORITA Hajime <morrita@google.com>
+
+ Node::InDetachFlag could be removed.
+ https://bugs.webkit.org/show_bug.cgi?id=85963
+
+ Reviewed by Antti Koivisto.
+
+ Removed Node::inDetach() since it can never true
+ on the only call site setFocusedNode().
+
+ No new test. Covered by existing tests.
+
+ * dom/Document.cpp:
+ (WebCore::Document::setFocusedNode):
+ * dom/Node.cpp:
+ (WebCore::Node::detach):
+ * dom/Node.h:
+ (WebCore):
+ (Node):
+
+2012-05-10 Keishi Hattori <keishi@webkit.org>
+
+ Crash in HTMLFormControlElement::m_fieldSetAncestor
+ https://bugs.webkit.org/show_bug.cgi?id=86070
+
+ Reviewed by Kent Tamura.
+
+ No new tests.
+
+ The previous patch r115990 didn't completely resolve the crash (Bug 85453)
+ We don't have a reproducible test case, so we are reverting to the old code for setting m_fieldSetAncestor.
+
+ * html/HTMLFormControlElement.cpp:
+ (WebCore::HTMLFormControlElement::HTMLFormControlElement):
+ (WebCore::HTMLFormControlElement::updateFieldSetAndLegendAncestor):
+ (WebCore::HTMLFormControlElement::insertedInto): Set m_dataListAncestorState to Unknown because ancestor has changed. Call setNeedsWillValidateCheck because style might need to be updated.
+ (WebCore::HTMLFormControlElement::removedFrom):
+ (WebCore::HTMLFormControlElement::disabled):
+ (WebCore::HTMLFormControlElement::recalcWillValidate):
+ (WebCore::HTMLFormControlElement::willValidate):
+ (WebCore::HTMLFormControlElement::setNeedsWillValidateCheck):
+ * html/HTMLFormControlElement.h:
+ (HTMLFormControlElement): Added m_dataListAncestorState.
+
+2012-05-10 Sam D <dsam2912@gmail.com>
+
+ Web Inspector: rename InspectorBackendStub.js to InspectorBackendCommands.js
+ https://bugs.webkit.org/show_bug.cgi?id=72306
+
+ Changed name for InspectorBackendStub.js to
+ InspectorBackendCommands.js
+
+ Reviewed by Yury Semikhatsky.
+
+ No new tests required. File name is changed.
+
+ * DerivedSources.pri:
+ * GNUmakefile.am:
+ * Target.pri:
+ * WebCore.gyp/WebCore.gyp:
+ * WebCore.gypi:
+ * WebCore.vcproj/copyWebCoreResourceFiles.cmd:
+ * WebCore.xcodeproj/project.pbxproj:
+ * gyp/copy-inspector-resources.sh:
+ * inspector/CodeGeneratorInspector.py:
+ * inspector/front-end/InspectorBackendCommands.qrc: Added.
+ * inspector/front-end/InspectorBackendStub.qrc: Removed.
+ * inspector/front-end/inspector.html:
+
+2012-05-10 Alexis Menard <alexis.menard@openbossa.org>
+
+ [Qt] Avoid string conversions to construct a QUrl when using Qt5.
+ https://bugs.webkit.org/show_bug.cgi?id=86006
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ In Qt5, the QUrl constructor can handle the string directly, even in UTF-16 because the
+ constructor QUrl(QString) has been fixed. Unfortunately we still need to use the old
+ code path when building with Qt4.
+
+ No new tests : it's a performance improvement which should be covered by tests.
+
+ * platform/qt/KURLQt.cpp:
+ (WebCore::KURL::operator QUrl):
+
+2012-05-10 Noel Gordon <noel.gordon@gmail.com>
+
+ [chromium] REGRESSION(r107389) Visible line artifacts on some JPEG images
+ https://bugs.webkit.org/show_bug.cgi?id=85772
+
+ Reviewed by Kent Tamura.
+
+ On some JPEG images, vertical and horizontal lines artifacts might appear in image
+ regions with very high frequency color variation when using DCT_IFAST decodes. Use
+ DCT_IFAST on small screen devices only (Chromium Android).
+
+ No new tests. Covered by existing tests.
+
+ * platform/image-decoders/jpeg/JPEGImageDecoder.cpp:
+ (dctMethod): Permit DCT_IFAST decoding for Chromium Android only.
+
+2012-05-10 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ [Qt] Implement fit-to-width behaviour
+ https://bugs.webkit.org/show_bug.cgi?id=86085
+
+ Reviewed by Simon Hausmann.
+
+ Add a method to get the minimum scale factor that contains the content
+ without showing any chrome background.
+
+ * dom/ViewportArguments.cpp:
+ (WebCore::computeMinimumScaleFactorForContentContained):
+ (WebCore):
+ * dom/ViewportArguments.h:
+ (WebCore):
+
+2012-05-10 MORITA Hajime <morrita@google.com>
+
+ Remove support for Node::willRemove()
+ https://bugs.webkit.org/show_bug.cgi?id=55209
+
+ Reviewed by Ryosuke Niwa.
+
+ This change de-virtualizes Node::willRemove(), gains
+ 5% speedup on Dromaeo dom-modify.
+
+ Originally there were 5 willRemove() overrides:
+ - Element
+ - HTMLStyleElement
+ - HTMLSourceElement
+ - HTMLTrackElement
+ - HTMLFrameOwnerElement
+
+ For first 4 items, this change moves their implementations to
+ Node::removedFrom() overrides.
+
+ Then HTMLFrameOwnerElement is the only class which needs the
+ notification. Because it emits the "unload" event, it needs some
+ notification _before_ its removal. To handle that, this change
+ introduces ChildFrameDisconnector which collects
+ corresponding decendant elements and disconnect their content frame.
+
+ Even though this approach doesn't kill pre-removal tree traversal
+ completely, it's a bit more efficient due to the de-virtualization.
+
+ No new tests. Covered by existing test.
+
+ * dom/ContainerNode.cpp:
+ (WebCore::willRemoveChild): Replaced willRemove() call with ChildFrameDisconnector.
+ (WebCore::willRemoveChildren): Ditto.
+ (WebCore::ContainerNode::disconnectDescendantFrames): Added. Used from FrameLoader to replace Document::willRemove() call.
+ (WebCore):
+ * dom/ContainerNode.h:
+ (ContainerNode):
+ * dom/ContainerNodeAlgorithms.cpp:
+ (WebCore::ChildFrameDisconnector::collectDescendant):
+ (WebCore):
+ (WebCore::ChildFrameDisconnector::Target::disconnect):
+ * dom/ContainerNodeAlgorithms.h:
+ (ChildFrameDisconnector):
+ (Target):
+ (WebCore::ChildFrameDisconnector::Target::Target):
+ (WebCore::ChildFrameDisconnector::Target::isValid):
+ (WebCore):
+ (WebCore::ChildFrameDisconnector::ChildFrameDisconnector):
+ (WebCore::ChildFrameDisconnector::collectDescendant):
+ (WebCore::ChildFrameDisconnector::disconnect):
+ * dom/Element.cpp:
+ (WebCore::Element::removedFrom):
+ * dom/Element.h:
+ * dom/ElementShadow.cpp:
+ * dom/ElementShadow.h:
+ (ElementShadow):
+ * dom/Node.cpp:
+ * dom/Node.h: Added IsFrameOwnerElement flag to de-virtualize IsFrameOwnerElement().
+ (WebCore::Node::isFrameOwnerElement): De-virtualized.
+ (Node):
+ * html/HTMLElement.h:
+ (HTMLElement):
+ (WebCore::HTMLElement::HTMLElement):
+ * html/HTMLFrameOwnerElement.cpp:
+ (WebCore::HTMLFrameOwnerElement::HTMLFrameOwnerElement):
+ (WebCore::HTMLFrameOwnerElement::disconnectContentFrame): Extracted from original willRemove().
+ * html/HTMLFrameOwnerElement.h:
+ (HTMLFrameOwnerElement):
+ (WebCore::toFrameOwnerElement):
+ (WebCore):
+ * html/HTMLMediaElement.cpp:
+ (WebCore::HTMLMediaElement::sourceWasRemoved): Renamed from sourceWillBeRemoved(), dealing with the timing change.
+ * html/HTMLMediaElement.h:
+ (HTMLMediaElement):
+ (WebCore::isMediaElement):
+ (WebCore):
+ (WebCore::toMediaElement):
+ * html/HTMLSourceElement.cpp:
+ (WebCore::HTMLSourceElement::removedFrom): Moved some code from willRemove().
+ * html/HTMLSourceElement.h:
+ (HTMLSourceElement):
+ * html/HTMLStyleElement.cpp:
+ (WebCore::HTMLStyleElement::removedFrom):
+ (WebCore):
+ * html/HTMLStyleElement.h:
+ (HTMLStyleElement):
+ * html/HTMLTrackElement.cpp:
+ (WebCore::HTMLTrackElement::removedFrom): Moved some code from willRemove().
+ * html/HTMLTrackElement.h:
+ (HTMLTrackElement):
+ * loader/FrameLoader.cpp:
+ (WebCore::FrameLoader::clear):
+
+2012-05-10 Kinuko Yasuda <kinuko@chromium.org>
+
+ Change the return type of Entry.toURL() back to String from KURL
+ https://bugs.webkit.org/show_bug.cgi?id=85858
+
+ Reviewed by Ryosuke Niwa.
+
+ I once changed it from String to KURL in r116273 but it turned out that
+ it involves implicit conversion and may incur extra overhead.
+ This partly reverts r116273 while keeping some internal functions
+ returning KURL as it's what we initially create as and is more
+ convenient to operate on.
+
+ No new tests; no functional or visible changes.
+
+ * Modules/filesystem/EntryBase.cpp:
+ (WebCore::EntryBase::toURL):
+ * Modules/filesystem/EntryBase.h:
+ (EntryBase):
+
+2012-05-10 Alexander Pavlov <apavlov@chromium.org>
+
+ Web Inspector: Autocomplete for CSS property values in the Styles pane behaving incorrectly
+ https://bugs.webkit.org/show_bug.cgi?id=85784
+
+ Reviewed by Vsevolod Vlasov.
+
+ Before executing the number increment/decrement within CSS property value, the current word is checked
+ for being a valid suggestion for the current property, and if it is, the numeric change is skipped
+ in favor of the suggested property value switch by a suggest box.
+
+ * inspector/front-end/StylesSidebarPane.js:
+
+2012-05-10 Abhishek Arya <inferno@chromium.org>
+
+ Make DOMCharacterDataModified a scoped event (similar to r73690).
+ https://bugs.webkit.org/show_bug.cgi?id=85920
+
+ Reviewed by Ryosuke Niwa.
+
+ DOMCharacterDataModified was missing in the list of already scoped
+ DOM mutation events like DOMSubtreeModified, DOMNodeInserted, etc.
+ It helps to delay event dispatches until the completion of each call
+ of EditCommand::doApply. This has been useful in the past and helped to
+ prevent unexpected DOM tree mutations while the editing command is executing.
+
+ * dom/CharacterData.cpp:
+ (WebCore::CharacterData::dispatchModifiedEvent):
+
+2012-05-10 Alexandre Elias <aelias@google.com>
+
+ Default to null value for HistoryItem::m_pageScaleFactor
+ https://bugs.webkit.org/show_bug.cgi?id=84385
+
+ Reviewed by Adam Barth.
+
+ Previously, HistoryItem::m_pageScaleFactor defaulted to a value
+ of 1, making it impossible to determine whether this value was never
+ set, or intentionally set to 1. This patch introduces a default value
+ of 0 and makes restoreScrollPositionAndViewState not touch the page
+ scale factor if this value is still present at time of reload.
+
+ This is a no-op change for common navigation scenarios. The
+ motivation for this change is the corner case of syncing history items
+ from a desktop browser to a mobile device. In that case, we need a
+ way to specify that the history item does not contain a
+ pageScaleFactor so that the mobile device does not display the page
+ overly zoomed in.
+
+ No new tests.
+
+ * history/HistoryItem.cpp:
+ (WebCore::HistoryItem::HistoryItem):
+ * loader/HistoryController.cpp:
+ (WebCore::HistoryController::restoreScrollPositionAndViewState):
+
+2012-05-10 Csaba Osztrogonác <ossy@webkit.org>
+
+ Use suitable viewport values when a Mobile DTD is used.
+ https://bugs.webkit.org/show_bug.cgi?id=85425
+
+ Unreviewed debug buildfix after r116571.
+
+ * dom/Document.cpp:
+ (WebCore::Document::setDocType):
+
+2012-05-10 Yoshifumi Inoue <yosin@chromium.org>
+
+ [Forms] Move step related methods to InputType class from HTMLInputElement class
+ https://bugs.webkit.org/show_bug.cgi?id=85978
+
+ Reviewed by Kent Tamura.
+
+ This patch is part of re-factoring of HTMLInputElement.cpp for numeric input type.
+ In this patch, we move implementation of getAllowedValueStep and stepUp/stepUpFromRenderer
+ to InputType class because of these are for DateTime/Number/Range.
+
+ Following patches will change implementation of getAllowedValueStep to use StepRange and
+ remove step related methods, defaultStep, stepScaleFactor, and so on.
+
+ No new tests. This patch should not change behavior.
+
+ * html/HTMLInputElement.cpp:
+ (WebCore):
+ (WebCore::HTMLInputElement::getAllowedValueStep):
+ (WebCore::HTMLInputElement::stepUp):
+ (WebCore::HTMLInputElement::stepDown):
+ (WebCore::HTMLInputElement::stepUpFromRenderer):
+ * html/HTMLInputElement.h:
+ (HTMLInputElement):
+ * html/InputType.cpp:
+ (WebCore::InputType::applyStep):
+ (WebCore):
+ (WebCore::InputType::alignValueForStep):
+ (WebCore::InputType::getAllowedValueStep):
+ (WebCore::InputType::getAllowedValueStepWithDecimalPlaces):
+ (WebCore::InputType::stepUp):
+ (WebCore::InputType::stepUpFromRenderer):
+ * html/InputType.h:
+ (InputType):
+
+2012-05-09 Kent Tamura <tkent@chromium.org>
+
+ Calendar Picker: Fix a crash by changing input type.
+ https://bugs.webkit.org/show_bug.cgi?id=86007
+
+ Reviewed by Hajime Morita.
+
+ Manual test: forms/calendar-picker-crash-by-type-change.html
+
+ * html/shadow/CalendarPickerElement.cpp:
+ (WebCore::CalendarPickerElement::~CalendarPickerElement):
+ Added. Make sure the popup is closed.
+ * html/shadow/CalendarPickerElement.h:
+ (CalendarPickerElement): Add declaration of the destructor.
+
+2012-05-09 Gyuyoung Kim <gyuyoung.kim@samsung.com>
+
+ Move suspendAnimations to use Internals interface.
+ https://bugs.webkit.org/show_bug.cgi?id=85986
+
+ Reviewed by Ryosuke Niwa.
+
+ Add suspendAnimations functions, because it is able to work in the
+ cross-port way through the Internals interface.
+
+ No new tests, since we are improving here the infra-structure for testing
+ a specific method.
+
+ * testing/Internals.cpp:
+ (WebCore::Internals::suspendAnimations):
+ (WebCore):
+ * testing/Internals.h:
+ (Internals):
+ * testing/Internals.idl:
+
+2012-05-09 Charlie Reis <creis@chromium.org>
+
+ Add dispatchMessageEventWithOriginCheck to DOMWindow
+ https://bugs.webkit.org/show_bug.cgi?id=85815
+
+ Reviewed by Adam Barth.
+
+ Useful for ports that support cross-process postMessage.
+ No new tests, since covered by existing postMessage tests.
+
+ * page/DOMWindow.cpp:
+ (WebCore::DOMWindow::postMessageTimerFired):
+ (WebCore):
+ (WebCore::DOMWindow::dispatchMessageEventWithOriginCheck):
+ * page/DOMWindow.h:
+ (WebCore):
+ (DOMWindow):
+
+2012-05-09 Jason Liu <jason.liu@torchmobile.com.cn>
+
+ [BlackBerry] Cookie parsing issue. If the cookie value provided was (") then the browser creates a session cookie instead.
+ https://bugs.webkit.org/show_bug.cgi?id=85775
+
+ Reviewed by Rob Buis.
+
+ Make CookieParser::parseOneCookie handle (cookiename="cookievalue;expires=xxxx) correctly.
+ This cookie's value is "cookievalue not "cookievalue;expires=xxxx.
+
+ Test: http/tests/cookies/single-quoted-value.html
+
+ * platform/blackberry/CookieParser.cpp:
+ (WebCore::CookieParser::parseOneCookie):
+
+2012-05-09 Raymond Liu <raymond.liu@intel.com>
+
+ Add multi-channels support for CopyWithGainFrom in AudioBus
+ https://bugs.webkit.org/show_bug.cgi?id=80675
+
+ Reviewed by Chris Rogers.
+
+ * platform/audio/AudioBus.cpp:
+ (WebCore):
+ (WebCore::AudioBus::AudioBus):
+ (WebCore::AudioBus::copyWithGainFrom):
+ * platform/audio/AudioBus.h:
+ (AudioBus):
+
+2012-05-09 Jessie Berlin <jberlin@apple.com>
+
+ Crash using the new WKBundleDOMWindowExtensions APIs.
+ https://bugs.webkit.org/show_bug.cgi?id=85888
+
+ Reviewed by Brady Eidson.
+
+ WKBundlePageWillDestroyGlobalObjectForDOMWindowExtensionCallback was only being invoked when
+ the WKPage was destroyed, and then only for the child frames. In addition, the
+ DOMWindowExtension was holding onto a destroyed DOMWindow and attempting to unregister from
+ when the WK2 wrapper object was attempting to destroy the DOMWindowExtension.
+
+ The underlying issue here was that the DOMWindowProperties were getting disconnectFrame
+ and willDetachPage called on them at the wrong times.
+
+ Rename DOMWindowProperty::disconnectFrame and reconnectFrame to disconnectFrameForPageCache
+ and reconnectFrameFromPageCache for clarity.
+
+ Only invoke DOMWindowProperty::disconnectFrameForPageCache when the frame is going into the
+ page cache.
+
+ In the cases where the DOMWindow is getting destroyed, the frame is being destroyed, or the
+ DOMWindow is getting cleared because the frame is being navigated, invoke
+ DOMWindowProperty::willDestroyGlobalObjectInFrame instead of disconnectFrame.
+
+ Invoke DOMWindowProperty::willDetachGlobalObjectFromFrame when a document is being detached
+ because the frame has been detached (e.g. fast/storage/storage-detached-iframe.html) and
+ won't be immediately destroyed.
+
+ Invoke DOMWindowProperty::willDestroyGlobalObjectInCachedFrame when a cached frame is
+ being destroyed.
+
+ New WK2 API Test: DOMWindowExtensionNoCache.
+
+ * Modules/indexeddb/DOMWindowIndexedDatabase.cpp:
+ (WebCore::DOMWindowIndexedDatabase::disconnectFrameForPageCache):
+ Updated for disconnectFrame rename.
+ (WebCore::DOMWindowIndexedDatabase::reconnectFrameFromPageCache):
+ Updated for reconnectFrame rename.
+ (WebCore::DOMWindowIndexedDatabase::willDestroyGlobalObjectInCachedFrame):
+ Get rid of the suspended IDBFactory.
+ (WebCore::DOMWindowIndexedDatabase::willDestroyGlobalObjectInFrame):
+ Get rid of the IDBFactory.
+ (WebCore::DOMWindowIndexedDatabase::willDetachGlobalObjectFromFrame):
+ Ditto.
+ * Modules/indexeddb/DOMWindowIndexedDatabase.h:
+
+ * dom/Document.cpp:
+ (WebCore::Document::prepareForDestruction):
+ Tell the DOMWindow before detaching the Document.
+ * dom/Document.h:
+
+ * history/CachedFrame.cpp:
+ (WebCore::CachedFrame::destroy):
+ Tell the DOMWindow.
+
+ * loader/FrameLoader.cpp:
+ (WebCore::FrameLoader::clear):
+ Use Document::prepareForDestruction so that the DOMWindow is told about the main frame
+ navigation before detaching the Document.
+
+ * loader/appcache/DOMApplicationCache.cpp:
+ (WebCore::DOMApplicationCache::disconnectFrameForPageCache):
+ Updated for the disconnectFrame rename.
+ (WebCore::DOMApplicationCache::reconnectFrameFromPageCache):
+ Updated for the reconnectFrame rename.
+ (WebCore::DOMApplicationCache::willDestroyGlobalObjectInFrame):
+ Cover the cases formerly covered by disconnectFrame (which was sometimes being called when
+ called when the frame was destroyed).
+ * loader/appcache/DOMApplicationCache.h:
+
+ * notifications/DOMWindowNotifications.cpp:
+ (WebCore::DOMWindowNotifications::disconnectFrameForPageCache):
+ Updated for the disconnectFrame rename.
+ (WebCore::DOMWindowNotifications::reconnectFrameFromPageCache):
+ Updated for the reconnectFrame rename.
+ (WebCore::DOMWindowNotifications::willDestroyGlobalObjectInCachedFrame):
+ Get rid of the suspended notification center.
+ (WebCore::DOMWindowNotifications::willDestroyGlobalObjectInFrame):
+ Get rid of the notification center.
+ (WebCore::DOMWindowNotifications::willDetachGlobalObjectFromFrame):
+ Do not allow use of the notification center by detached frames.
+ * notifications/DOMWindowNotifications.h:
+
+ * page/DOMWindow.cpp:
+ (WebCore::DOMWindow::clearDOMWindowProperties):
+ Do not call disconnectDOMWindowProperties. It is now the responsibility of the callers to
+ tell the DOMWindowProperties the correct cause of being cleared.
+ (WebCore::DOMWindow::~DOMWindow):
+ Make sure the DOMWindowProperties still know that the DOMWindow is going away.
+ (WebCore::DOMWindow::frameDestroyed):
+ Invoke willDestroyGlobalObjectInFrame on the DOMWindowProperties.
+ (WebCore::DOMWindow::willDetachPage):
+ It is no longer necessary to tell the DOMWindowProperties anything here.
+ (WebCore::DOMWindow::willDestroyCachedFrame):
+ Tell the DOMWindowProperties.
+ (WebCore::DOMWindow::willDestroyDocumentInFrame):
+ Ditto.
+ (WebCore::DOMWindow::willDetachDocumentFromFrame):
+ Ditto.
+ (WebCore::DOMWindow::clear):
+ Ditto.
+ (WebCore::DOMWindow::disconnectDOMWindowProperties):
+ Updated for the disconnectFrame rename.
+ (WebCore::DOMWindow::reconnectDOMWindowProperties):
+ Ditto.
+ * page/DOMWindow.h:
+
+ * page/DOMWindowExtension.cpp:
+ (WebCore::DOMWindowExtension::DOMWindowExtension):
+ Move the responsibility for tracking the disconnected DOMWindow to DOMWindowProperty, since
+ DOMWindowProperty will need it to unregister the property when a cached frame is destroyed.
+ (WebCore::DOMWindowExtension::disconnectFrameForPageCache):
+ Remove the code to check for disconnectFrame being called twice - it is now only called when
+ a frame goes into the page cache.
+ Let the DOMWindowProperty keep track of the disconnected DOMWindow.
+ (WebCore::DOMWindowExtension::reconnectFrameFromPageCache):
+ Let the DOMWindowProperty keep track of the disconnected DOMWindow.
+ (WebCore::DOMWindowExtension::willDestroyGlobalObjectInCachedFrame):
+ Dispatch the willDestroyGlobalObjectForDOMWindowExtension callback.
+ (WebCore::DOMWindowExtension::willDestroyGlobalObjectInFrame):
+ Ditto, but only if the callback hasn't already been sent because the frame has been detached.
+ (WebCore::DOMWindowExtension::willDetachGlobalObjectFromFrame):
+ Send the callback because nothing interesting can be done in the frame once it has been
+ detached.
+ * page/DOMWindowExtension.h:
+
+ * page/DOMWindowProperty.cpp:
+ (WebCore::DOMWindowProperty::DOMWindowProperty):
+ Keep track of the disconnected DOMWindow so it can be used to unregister the property when a
+ cached frame is destroyed.
+ (WebCore::DOMWindowProperty::~DOMWindowProperty):
+ Also unregister the property when a DOMWindowProperty for a cached frame is destroyed.
+ (WebCore::DOMWindowProperty::disconnectFrameForPageCache):
+ Keep track of the disconnected DOMWindow.
+ (WebCore::DOMWindowProperty::reconnectFrameFromPageCache):
+ Ditto.
+ (WebCore::DOMWindowProperty::willDestroyGlobalObjectInCachedFrame):
+ Unregister the property from the disconnected DOMWindow.
+ (WebCore::DOMWindowProperty::willDestroyGlobalObjectInFrame):
+ Unregister the property from the DOMWindow and stop keeping track of the frame.
+ (WebCore::DOMWindowProperty::willDetachGlobalObjectFromFrame):
+ Do not set m_frame to 0 because detached frames still have access to the DOMWindow, even if
+ they can't do anything meaningful with it.
+ * page/DOMWindowProperty.h:
+
+ * page/Frame.cpp:
+ (WebCore::Frame::setView):
+ Tell the DOMWindow that the Document is being detached so it can tell the
+ DOMWindowProperties.
+
+ * page/PointerLock.cpp:
+ (WebCore::PointerLock::disconnectFrameForPageCache):
+ Updated for disconnectFrame rename.
+ (WebCore::PointerLock::willDestroyGlobalObjectInFrame):
+ Cover the cases formerly covered by disconnectFrame (which was sometimes being called when
+ called when the frame was destroyed).
+ * page/PointerLock.h:
+
+2012-05-09 Ian Vollick <vollick@chromium.org>
+
+ [chromium] Ensure animations get ticked at least once when added.
+ https://bugs.webkit.org/show_bug.cgi?id=86013
+
+ Reviewed by James Robinson.
+
+ Tested in
+ CCLayerTreeHostTestTickAnimationWhileBackgrounded.runSingleThreaded
+ CCLayerTreeHostTestAddAnimationWithTimingFunction.runSingleThreaded
+ CCLayerTreeHostTestSynchronizeAnimationStartTimes.runSingleThreaded
+ CCLayerTreeHostTestAnimationFinishedEvents.runSingleThreaded
+
+ * platform/graphics/chromium/LayerChromium.cpp:
+ (WebCore::LayerChromium::addAnimation):
+ * platform/graphics/chromium/cc/CCLayerAnimationController.cpp:
+ (WebCore::CCLayerAnimationController::pushNewAnimationsToImplThread):
+ * platform/graphics/chromium/cc/CCLayerTreeHost.cpp:
+ (WebCore::CCLayerTreeHost::finishCommitOnImplThread):
+ (WebCore::CCLayerTreeHost::didAddAnimation):
+ (WebCore):
+ (WebCore::CCLayerTreeHost::didBecomeInvisibleOnImplThread):
+ * platform/graphics/chromium/cc/CCLayerTreeHost.h:
+ (CCLayerTreeHost):
+ * platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp:
+ (WebCore::CCLayerTreeHostImpl::CCLayerTreeHostImpl):
+ * platform/graphics/chromium/cc/CCProxy.h:
+ (CCProxy):
+ * platform/graphics/chromium/cc/CCSingleThreadProxy.cpp:
+ (CCSingleThreadProxyAnimationTimer):
+ (WebCore::CCSingleThreadProxyAnimationTimer::create):
+ (WebCore::CCSingleThreadProxyAnimationTimer::CCSingleThreadProxyAnimationTimer):
+ (WebCore):
+ (WebCore::CCSingleThreadProxy::CCSingleThreadProxy):
+ (WebCore::CCSingleThreadProxy::didAddAnimation):
+ (WebCore::CCSingleThreadProxy::doComposite):
+ * platform/graphics/chromium/cc/CCSingleThreadProxy.h:
+ (WebCore):
+ * platform/graphics/chromium/cc/CCThreadProxy.h:
+
+2012-05-09 Adam Barth <abarth@webkit.org>
+
+ Implement HTML Media Capture
+ https://bugs.webkit.org/show_bug.cgi?id=85958
+
+ Reviewed by Eric Seidel.
+
+ This patch begins the implementation of
+ http://www.w3.org/TR/html-media-capture/ by adding the capture
+ attribute to HTMLInputElement.
+
+ Test: fast/forms/file/file-input-capture.html
+
+ * html/FileInputType.cpp:
+ (WebCore::FileInputType::handleDOMActivateEvent):
+ * html/HTMLAttributeNames.in:
+ * html/HTMLInputElement.cpp:
+ (WebCore):
+ (WebCore::HTMLInputElement::capture):
+ (WebCore::HTMLInputElement::setCapture):
+ * html/HTMLInputElement.h:
+ (HTMLInputElement):
+ * html/HTMLInputElement.idl:
+ * platform/FileChooser.h:
+ (FileChooserSettings):
+
+2012-05-09 Charles Wei <charles.wei@torchmobile.com.cn>
+
+ [BlackBerry] Refactor data scheme support
+ https://bugs.webkit.org/show_bug.cgi?id=85938
+
+ Reviewed by Rob Buis.
+
+ We will create a DataStream in our platform repository,
+ so that can be wrapped up by NetworkJob for webkit rendering,
+ and by DownloadStream for downloading.
+
+ Refactor, no new tests.
+
+ * platform/network/blackberry/NetworkJob.cpp:
+ (WebCore::NetworkJob::NetworkJob):
+ (WebCore::NetworkJob::initialize):
+ (WebCore::NetworkJob::cancelJob):
+ (WebCore::NetworkJob::sendResponseIfNeeded):
+ * platform/network/blackberry/NetworkJob.h:
+ (NetworkJob):
+ * platform/network/blackberry/NetworkManager.cpp:
+ (WebCore::NetworkManager::startJob):
+
+2012-05-09 Dana Jansens <danakj@chromium.org>
+
+ [chromium] Don't draw when canDraw() is false
+ https://bugs.webkit.org/show_bug.cgi?id=85829
+
+ Reviewed by Adrienne Walker.
+
+ This is based on the work of Daniel Sievers in bug
+ https://bugs.webkit.org/show_bug.cgi?id=82680. When canDraw() is false,
+ we should not call drawLayers() or prepareToDraw() in both Single- and
+ Multi-Threaded mode.
+
+ drawLayers() is crashing in single threaded mode, and this attempts to
+ prevent it from being called with invalid state. While making it behave
+ properly in single-threaded mode, it seems appropriate to unrevert the
+ parts of 82680 that made threaded mode behave similarly appropriately.
+
+ A single-threaded test is not included since LTHTests is unable to run
+ in single-threaded mode at this time (pending work from Ian Vollick). So
+ we test in threaded mode only with a note to include a single thread
+ version.
+
+ Tests: CCLayerTreeHostTestCanDrawBlocksDrawing.runMultiThread
+
+ * platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp:
+ (WebCore::CCLayerTreeHostImpl::prepareToDraw):
+ (WebCore::CCLayerTreeHostImpl::drawLayers):
+ * platform/graphics/chromium/cc/CCSingleThreadProxy.cpp:
+ (WebCore::CCSingleThreadProxy::doComposite):
+ * platform/graphics/chromium/cc/CCThreadProxy.cpp:
+ (WebCore::CCThreadProxy::scheduledActionDrawAndSwapInternal):
+
+2012-05-09 Martin Robinson <mrobinson@igalia.com>
+
+ [Cairo] GLContextGLX releases the context with an uninitialized display
+ https://bugs.webkit.org/show_bug.cgi?id=86039
+
+ Reviewed by Philippe Normand.
+
+ No new tests. This does not change behavior on most machines, but has
+ the potential to prevent a pretty nasty crash on others.
+
+ Use the shared display to release GLX contexts instead of the uninitialized
+ m_display member.
+
+ * platform/graphics/glx/GLContextGLX.cpp:
+ (WebCore::GLContextGLX::~GLContextGLX): Release the display with the shared
+ display.
+ * platform/graphics/glx/GLContextGLX.h:
+ (GLContextGLX): Remove the m_display member.
+
+2012-05-09 Tony Gentilcore <tonyg@chromium.org>
+
+ Subresources loaded after a reload completes shouldn't be revalidated.
+ https://bugs.webkit.org/show_bug.cgi?id=84614
+
+ Based on patch by Darin Fisher.
+
+ Reviewed by Darin Fisher.
+
+ Tests: http/tests/cache/loaded-from-cache-after-reload-within-iframe.html
+ http/tests/cache/loaded-from-cache-after-reload.html
+
+ * loader/FrameLoader.cpp:
+ (WebCore::FrameLoader::checkLoadCompleteForThisFrame): Reset m_loadType after the load completes.
+
+2012-05-09 Erik Arvidsson <arv@chromium.org>
+
+ [V8] Fix issue where V8BindingPerContextData could keep the context object alive
+ https://bugs.webkit.org/show_bug.cgi?id=86036
+
+ Reviewed by Kentaro Hara.
+
+ This is a partial revert of http://trac.webkit.org/changeset/114320/. This keeps
+ the layout tests that were introduced since it turns out that
+ http://trac.webkit.org/changeset/114989 fixes the tests too.
+
+ Covered by: http/tests/security/isolatedWorld/context-destroy.html
+
+ * bindings/v8/V8IsolatedContext.cpp:
+ (WebCore::V8IsolatedContext::destroy):
+
+2012-05-09 Anders Carlsson <andersca@apple.com>
+
+ Speed up some parts of TileCache drawing
+ https://bugs.webkit.org/show_bug.cgi?id=86033
+ <rdar://problem/10919373>
+
+ Reviewed by Sam Weinig.
+
+ * platform/graphics/ca/mac/TileCache.mm:
+ (WebCore::TileCache::tileCoverageRect):
+ If we can't have scrollbars, there's not much need to extend the tile coverage rect outside of the visible rect, since it's
+ unlikely that we'll do any form of scrolling here.
+
+ (WebCore::TileCache::revalidateTiles):
+ Don't update the tile layer frame if it's big enough to contain the tile size. Also, if there are no new tiles created,
+ don't call platformCALayerDidCreateTiles since that will trigger an extra layer flush.
+
+2012-05-09 Alexandre Elias <aelias@google.com>
+
+ setPageScaleFactor should setScrollPosition if scale is unchanged
+ https://bugs.webkit.org/show_bug.cgi?id=84400
+
+ Reviewed by Adam Barth.
+
+ Previously, setPageScaleFactor forgot about its "origin" argument if
+ the page scale factor is unchanged. This has proven undesirable in
+ practice because, for example, a single pinch gesture may zoom in and
+ back out to the original page scale factor, but at a different scroll
+ offset.
+
+ New test case added to scale-and-scroll-body-expected.txt
+
+ * page/Page.cpp:
+ (WebCore::Page::setPageScaleFactor):
+
+2012-05-09 Hugo Parente Lima <hugo.lima@openbossa.org>
+
+ Use suitable viewport values on XHTML-MP pages.
+ https://bugs.webkit.org/show_bug.cgi?id=85425
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Tests: fast/viewport/viewport-legacy-xhtmlmp-misplaced-doctype.html
+ fast/viewport/viewport-legacy-xhtmlmp-ordering.html
+ fast/viewport/viewport-legacy-xhtmlmp.html
+
+ Use device-width and device-height as viewport size on
+ XHTML-MP pages if the use feature LEGACY_VIEWPORT_ADAPTION
+ is set according as the non normative section of
+ http://www.w3.org/TR/css-device-adapt/
+
+ * dom/Document.cpp:
+ (WebCore::Document::setDocType):
+
+2012-05-09 Beth Dakin <bdakin@apple.com>
+
+ https://bugs.webkit.org/show_bug.cgi?id=86025
+ RTL and vertical text documents do no scroll properly with the new
+ tiled scrolling model
+ -and corresponding-
+ <rdar://problem/11077589>
+
+ Reviewed by Dan Bernstein.
+
+ Most of the fix here is just to teach the scrolling tree about the
+ scroll origin.
+ * page/scrolling/ScrollingCoordinator.cpp:
+ (WebCore::ScrollingCoordinator::frameViewLayoutUpdated):
+ (WebCore::ScrollingCoordinator::setScrollParameters):
+ * page/scrolling/ScrollingCoordinator.h:
+ (ScrollParameters):
+ * page/scrolling/ScrollingTreeNode.cpp:
+ (WebCore::ScrollingTreeNode::update):
+ * page/scrolling/ScrollingTreeNode.h:
+ (WebCore::ScrollingTreeNode::scrollOrigin):
+ (ScrollingTreeNode):
+ * page/scrolling/ScrollingTreeState.cpp:
+ (WebCore::ScrollingTreeState::setScrollOrigin):
+ (WebCore):
+ * page/scrolling/ScrollingTreeState.h:
+ (WebCore::ScrollingTreeState::scrollOrigin):
+ (ScrollingTreeState):
+ * page/scrolling/mac/ScrollingTreeNodeMac.mm:
+ (WebCore::ScrollingTreeNodeMac::scrollPosition):
+ (WebCore::ScrollingTreeNodeMac::setScrollLayerPosition):
+ (WebCore::ScrollingTreeNodeMac::minimumScrollPosition):
+ (WebCore::ScrollingTreeNodeMac::maximumScrollPosition):
+ * rendering/RenderLayerCompositor.cpp:
+ (WebCore::RenderLayerCompositor::frameViewDidScroll):
+
+ Teaching the scrolling tree about the scroll origin revealed this pre-
+ existing bug. layoutOverflowRect() is not the right rect to use since
+ it is not writing-mode savvy. unscaledDocumentRect() is the right rect
+ for the view's bounds.
+ * rendering/RenderLayerBacking.cpp:
+ (WebCore::RenderLayerBacking::updateCompositedBounds):
+
+2012-05-09 Rob Buis <rwlbuis@webkit.org>
+
+ Cleanup SVGElement.cpp
+ https://bugs.webkit.org/show_bug.cgi?id=86004
+
+ Reviewed by Eric Seidel.
+
+ Remove unneeded includes. We do not need to check attr in SVGElement::attributeChanged,
+ lower layers assume it is non-null and we do not call attributeChanged in SVG.
+
+ * svg/SVGElement.cpp:
+ (WebCore::SVGElement::attributeChanged):
+ (WebCore::SVGElement::isAnimatableAttribute):
+
+2012-05-09 Jochen Eisinger <jochen@chromium.org>
+
+ When creating a new page during a navigation, prime the initial document with the correct referrer policy
+ https://bugs.webkit.org/show_bug.cgi?id=86001
+
+ Reviewed by Adam Barth.
+
+ Test: http/tests/security/referrer-policy-redirect-link.html
+
+ * dom/Document.h:
+ (WebCore::Document::setReferrerPolicy):
+ * loader/FrameLoader.cpp:
+ (WebCore::FrameLoader::continueLoadAfterNewWindowPolicy):
+
+2012-05-09 Alec Flett <alecflett@chromium.org>
+
+ IndexedDB: call abort handler when there are problems committing
+ https://bugs.webkit.org/show_bug.cgi?id=85841
+
+ Reviewed by Ojan Vafai.
+
+ No new tests. Every existing test that calls commit() is testing
+ the success side of this, and this only throws when there are
+ LevelDB errors, which is exactly what we're trying to diagnose
+ with this patch.
+
+ * Modules/indexeddb/IDBBackingStore.h:
+ (Transaction):
+ * Modules/indexeddb/IDBLevelDBBackingStore.cpp:
+ (WebCore::IDBLevelDBBackingStore::deleteDatabase):
+ (WebCore::IDBLevelDBBackingStore::Transaction::commit):
+ * Modules/indexeddb/IDBLevelDBBackingStore.h:
+ (Transaction):
+ * Modules/indexeddb/IDBTransactionBackendImpl.cpp:
+ (WebCore::IDBTransactionBackendImpl::commit):
+
+2012-05-09 Mark Pilgrim <pilgrim@chromium.org>
+
+ [Chromium] Remove PlatformSupport::loadPlatformImageResource, call loadResource directly
+ https://bugs.webkit.org/show_bug.cgi?id=84417
+
+ Reviewed by Adam Barth.
+
+ Part of a refactoring series. See tracking bug 82948.
+
+ * WebCore.gyp/WebCore.gyp:
+ * WebCore.gypi:
+ * platform/chromium/PlatformSupport.h:
+ (PlatformSupport):
+ * platform/graphics/chromium/ImageChromium.cpp:
+ (WebCore::Image::loadPlatformResource):
+ * platform/graphics/chromium/ImageChromiumMac.mm: Removed.
+
+2012-05-09 Rob Buis <rbuis@rim.com>
+
+ Remove some isSVGFoo methods
+ https://bugs.webkit.org/show_bug.cgi?id=86009
+
+ Reviewed by Eric Seidel.
+
+ These are not used at the moment and were probably just copy and pasted from
+ isSVGFoo methods in RenderObject.h.
+
+ * rendering/RenderObject.h:
+ * rendering/svg/RenderSVGEllipse.h:
+ (RenderSVGEllipse):
+ * rendering/svg/RenderSVGRect.h:
+ (RenderSVGRect):
+ * rendering/svg/RenderSVGShape.h:
+
+2012-05-09 Ian Vollick <vollick@chromium.org>
+
+ [chromium] Add impl-thread support for fill-mode and direction css animation properties
+ https://bugs.webkit.org/show_bug.cgi?id=77662
+
+ Reviewed by James Robinson.
+
+ Adds support for accelerating css animations with -webkit-animation-fill-mode,
+ and -webkit-animation-direction properties.
+
+ Tested in:
+ CCActiveAnimationTest.TrimTimeAlternating
+ CCLayerAnimationControllerTest.createReversedAnimation
+ CCLayerAnimationControllerTest.createAlternatingAnimation
+ CCLayerAnimationControllerTest.createReversedAlternatingAnimation
+
+ * platform/graphics/chromium/cc/CCActiveAnimation.cpp:
+ (WebCore::CCActiveAnimation::CCActiveAnimation):
+ (WebCore::CCActiveAnimation::trimTimeToCurrentIteration):
+ (WebCore::CCActiveAnimation::cloneForImplThread):
+ * platform/graphics/chromium/cc/CCActiveAnimation.h:
+ (CCActiveAnimation):
+ (WebCore::CCActiveAnimation::alternatesDirection):
+ (WebCore::CCActiveAnimation::setAlternatesDirection):
+ * platform/graphics/chromium/cc/CCLayerAnimationController.cpp:
+
+2012-05-09 Ken Buchanan <kenrb@chromium.org>
+
+ Crash from removal of a line break object
+ https://bugs.webkit.org/show_bug.cgi?id=85997
+
+ Reviewed by David Hyatt.
+
+ Regression from r115343. That replaced a call to setNeedsLayout()
+ with a separate call that used a different bit during linebox
+ invalidation after renderer child removal. There are special cases
+ where layout isn't marked on parent nodes just from the removal, so
+ line dirtying needs to explicitly mark ancestors for layout.
+
+ * rendering/RenderObject.h:
+ (WebCore::RenderObject::setAncestorLineBoxDirty):
+
+2012-05-09 Levi Weintraub <leviw@chromium.org>
+
+ Fix performance regression for floats caused by LayoutUnit change
+ https://bugs.webkit.org/show_bug.cgi?id=85834
+
+ Reviewed by Ojan Vafai.
+
+ Refactoring FractionalLayout types to alleviate performance issues. Explicitly
+ inlining constructor and operator functions in FractionalLayoutUnit, as well as
+ pixelSnappedIntSize and pixelSnappedIntRect (particularly hot code paths). Also
+ further simplifying round and ceil functions when sub-pixel layout is not enabled.
+
+ pixelSnappedIntSize was the only function defined in FractionalLayoutSize.cpp,
+ so it is removed.
+
+ No new tests. No change in functionality.
+
+ * CMakeLists.txt:
+ * GNUmakefile.list.am:
+ * Target.pri:
+ * WebCore.gypi:
+ * WebCore.vcproj/WebCore.vcproj:
+ * WebCore.xcodeproj/project.pbxproj:
+ * platform/FractionalLayoutUnit.h:
+ (WebCore::FractionalLayoutUnit::FractionalLayoutUnit):
+ (FractionalLayoutUnit):
+ (WebCore::FractionalLayoutUnit::toInt):
+ (WebCore::FractionalLayoutUnit::toFloat):
+ (WebCore::FractionalLayoutUnit::toDouble):
+ (WebCore::FractionalLayoutUnit::toUnsigned):
+ (WebCore::FractionalLayoutUnit::operator int):
+ (WebCore::FractionalLayoutUnit::operator unsigned):
+ (WebCore::FractionalLayoutUnit::operator float):
+ (WebCore::FractionalLayoutUnit::operator double):
+ (WebCore::FractionalLayoutUnit::operator bool):
+ (WebCore::FractionalLayoutUnit::ceil):
+ (WebCore::FractionalLayoutUnit::round):
+ * platform/graphics/FractionalLayoutRect.cpp:
+ (WebCore):
+ * platform/graphics/FractionalLayoutRect.h:
+ (WebCore::FractionalLayoutRect::pixelSnappedSize):
+ (WebCore::pixelSnappedIntRect):
+ (WebCore):
+ * platform/graphics/FractionalLayoutSize.cpp: Removed.
+ * platform/graphics/FractionalLayoutSize.h:
+ (WebCore):
+ * rendering/LayoutTypes.h:
+ (WebCore::pixelSnappedIntSize):
+ (WebCore):
+
+2012-05-09 Abhishek Arya <inferno@chromium.org>
+
+ Crash in ReplaceSelectionCommand::performTrivialReplace
+ https://bugs.webkit.org/show_bug.cgi?id=85943
+
+ Reviewed by Ryosuke Niwa.
+
+ RefPtr nodeAfterInsertionPos to guard against mutation events.
+
+ Test: editing/inserting/insert-html-crash.html
+
+ * editing/ReplaceSelectionCommand.cpp:
+ (WebCore::ReplaceSelectionCommand::performTrivialReplace):
+
+2012-05-03 Shawn Singh <shawnsingh@chromium.org>
+
+ Hit testing is incorrect in some cases with perspective transforms
+ https://bugs.webkit.org/show_bug.cgi?id=79136
+
+ Reviewed by Simon Fraser.
+
+ Tests: transforms/3d/hit-testing/coplanar-with-camera.html
+ transforms/3d/hit-testing/perspective-clipped.html
+
+ * platform/graphics/transforms/TransformationMatrix.cpp:
+ (WebCore::TransformationMatrix::projectPoint): Fix a
+ divide-by-zero error so that values do not become Inf or Nan. Also
+ fix an overflow error by using a large, but not-too-large constant
+ to represent infinity.
+
+ (WebCore::TransformationMatrix::projectQuad): Fix an error where
+ incorrect quads were being returned. Incorrect quads can occur
+ when projectPoint clamped==true after returning.
+
+2012-05-09 Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org>
+
+ Simplify CSSParser::parseSimpleLengthValue()
+ https://bugs.webkit.org/show_bug.cgi?id=85910
+
+ Reviewed by Alexis Menard.
+
+ Various small improvements to this function, mainly:
+ - Move the check if the property ID accepts a simple length as early as possible;
+ - Remove the check for the characters{8,16} pointers since they'll be valid (we ASSERT that);
+ - Use a template to avoid duplicate code for 8 and 16 bit characters.
+
+ * css/CSSParser.cpp:
+ (WebCore):
+ (WebCore::parseSimpleLength):
+ (WebCore::parseSimpleLengthValue):
+
+2012-05-09 Ami Fischman <fischman@chromium.org>
+
+ [chromium] Support multiple buffered time ranges
+ https://bugs.webkit.org/show_bug.cgi?id=85926
+
+ Reviewed by Eric Carlson.
+
+ Preserve existing rendering of a single rect even in the presence of multiple buffered regions.
+
+ No new tests as this change has no functional effects.
+
+ * rendering/RenderMediaControlsChromium.cpp:
+ (WebCore::paintMediaSlider):
+
+2012-05-09 Dana Jansens <danakj@chromium.org>
+
+ Early-out and avoid any copying when possible for Region operations
+ https://bugs.webkit.org/show_bug.cgi?id=85260
+
+ Reviewed by Anders Carlsson.
+
+ For an empty region, any intersection or subtraction will not modify
+ the region, so we can simply return instead of creating a new Shape
+ and replacing the current empty Shape.
+
+ When a region is united with a region it contains, the orignal
+ containing region is the result. So, if A.unite(B) and A.contains(B)
+ then A does not need to change at all and we can return without making
+ a copy of A's shape. When A is a rect, we can do this test even more
+ simply.
+
+ We also remove redundant checks from trySimpleOperation() methods, where
+ the test is already done in the Region calling site.
+
+ This change improves the performance of the Region overlap testing for
+ composited layers, and allows us to avoid unnecessary copies of the
+ Region during unite. With a layout test (attached to bug #81087), that
+ creates a Region from the union of 225 composited layers, as well as
+ 600 overlapping layers above them, this change decreases the running
+ time of the test by 3.2% by avoiding a copy of the entire Region for
+ each insertion that does not change the resulting Region.
+
+ Unit tests: RegionTest.unite
+
+ * platform/graphics/Region.cpp:
+ (WebCore::Region::Shape::UnionOperation::trySimpleOperation):
+ (WebCore::Region::Shape::IntersectOperation::trySimpleOperation):
+ (WebCore::Region::Shape::SubtractOperation::trySimpleOperation):
+ (WebCore::Region::intersect):
+ (WebCore::Region::unite):
+ (WebCore::Region::subtract):
+ * platform/graphics/Region.h:
+ (WebCore::Region::isRect):
+ (WebCore::Region::Shape::isRect):
+
+2012-05-09 Tommy Widenflycht <tommyw@google.com>
+
+ MediaStream API: SessionDescription::addCandidate should not crash for malformed input
+ https://bugs.webkit.org/show_bug.cgi?id=85988
+
+ Reviewed by Adam Barth.
+
+ Sending null would crash the browser. Added safeguards in both the bindings and the native code.
+
+ Test: fast/mediastream/SessionDescription.html
+
+ * Modules/mediastream/SessionDescription.cpp:
+ (WebCore::SessionDescription::addCandidate):
+ * Modules/mediastream/SessionDescription.h:
+ (SessionDescription):
+ * Modules/mediastream/SessionDescription.idl:
+
+2012-05-09 Tommy Widenflycht <tommyw@google.com>
+
+ MediaStream API: Adding the possibility of port specific information in MediaStreamDescriptor
+ https://bugs.webkit.org/show_bug.cgi?id=85794
+
+ Reviewed by Adam Barth.
+
+ To facilitate for ports I have added an ExtraData field that can be used for whatever purpose is needed.
+
+ No behavioral changes.
+
+ * platform/chromium/support/WebMediaStreamDescriptor.cpp:
+ (ExtraDataContainer):
+ (WebKit::ExtraDataContainer::ExtraDataContainer):
+ (WebKit::ExtraDataContainer::extraData):
+ (WebKit):
+ (WebKit::WebMediaStreamDescriptor::extraData):
+ (WebKit::WebMediaStreamDescriptor::setExtraData):
+ * platform/mediastream/MediaStreamDescriptor.h:
+ (ExtraData):
+ (WebCore::MediaStreamDescriptor::ExtraData::~ExtraData):
+ (MediaStreamDescriptor):
+ (WebCore::MediaStreamDescriptor::extraData):
+ (WebCore::MediaStreamDescriptor::setExtraData):
+
+2012-05-09 Takashi Sakamoto <tasak@google.com>
+
+ Crash in WebCore::RenderBoxModelObject::paddingLeft
+ https://bugs.webkit.org/show_bug.cgi?id=83889
+
+ Reviewed by Abhishek Arya.
+
+ RenderScrollbar creates RenderScrollbarPart without any parent
+ renderers. However, if the scrollbar has percent padding styles,
+ non-null parent renderer is required. So after creating/destroying
+ RenderScrollbarPart instances, set owningRenderer(creating)/0
+ (destroying) as its parent renderer.
+
+ Test: scrollbars/scrollbar-percent-padding-crash.html
+ scrollbars/scrollbar-percent-padding-crash-expected.txt
+
+ * rendering/RenderScrollbar.cpp:
+ (WebCore::RenderScrollbar::updateScrollbarPart):
+ Added setParent after creating/destroying RenderScrollbarPart.
+ * rendering/RenderScrollbarPart.cpp:
+ Made RenderScollbar friend, because setParent is protected and
+ RenderScrollbar is not inherited from class RenderObject.
+
+2012-05-09 Takashi Sakamoto <tasak@google.com>
+
+ ShadowRoot needs applyAuthorStyles
+ https://bugs.webkit.org/show_bug.cgi?id=78472
+
+ Reviewed by Hajime Morita.
+
+ Implemented applyAuthorStyles attribute defined in the following spec:
+ http://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html#shadow-root-attributes
+ Since applyAuthorSheets attribute has been already implemented,
+ renamed all applyAuthorSheets to applyAuthorStyles and
+ added applyAuthorStyles to ShadowRoot.idl.
+ Currently, changing dynamically applyAuthorStyles doesn't work. I will fix this isse in bugs:84215: https://bugs.webkit.org/show_bug.cgi?id=84251
+
+ Test: fast/dom/shadow/shadow-root-applyAuthorStyles.html
+ fast/dom/shadow/shadow-root-applyAuthorStyles-expected.html
+
+ * css/StyleResolver.cpp:
+ (WebCore::StyleResolver::collectMatchingRulesForList):
+ * dom/ShadowRoot.cpp:
+ (WebCore::ShadowRoot::ShadowRoot):
+ (WebCore::ShadowRoot::applyAuthorStyles):
+ (WebCore::ShadowRoot::setApplyAuthorStyles):
+ * dom/ShadowRoot.h:
+ * dom/TreeScope.cpp:
+ (WebCore::TreeScope::applyAuthorStyles):
+ * dom/TreeScope.h:
+ (TreeScope):
+ Changed all applyAuthorSheets to applyAuthorSytles.
+ (ShadowRoot):
+ * dom/ShadowRoot.idl:
+ Added a new attribute, boolean applyAuthorStyles.
+
+2012-05-09 Yoshifumi Inoue <yosin@chromium.org>
+
+ [Chromium][Forms] HTMLOptionsCollection doesn't have indexed properties on property enumeration
+ https://bugs.webkit.org/show_bug.cgi?id=85937
+
+ Reviewed by Kentaro Hara.
+
+ This patch adds numeric indices to properties in enumeration to HTMLOptionsCollection V8 binding
+ to changes Objects.keys in ECMAScript5 and for-in statement behavior for compatibility with
+ Firefox 12, IE9, Opera 11, and Safari 5.
+
+ Test: fast/forms/select/options-indexed-properties.html
+
+ * bindings/scripts/CodeGeneratorV8.pm:
+ (GenerateImplementationIndexer): Set $hasEnumerator true for interface HTMLOptionsCollection
+
+2012-05-09 Shinya Kawanaka <shinyak@chromium.org>
+
+ Position should be able to have ShadowRoot as a container.
+ https://bugs.webkit.org/show_bug.cgi?id=82021
+
+ Reviewed by Ryosuke Niwa.
+
+ Since Position could not take a shadow root as a container node, pointing the direct children
+ of a shadow root was difficult.
+
+ This patch makes it enabled, and fixes a lot of crashes caused by that limitation.
+ Also, we confirm that ShadowRoot is not exposed to JavaScript layer.
+
+ Currently this change is only enabled if shadow dom flag is enabled, since we cannot
+ prove this change does not destroy the existing behavior. However, this change is really required
+ to fix other editing bugs in Shadow DOM. A bunch of patches and tests will be added to
+ fix other editing bugs and they will check this patch does not break editing.
+ We will also add a fuzzer to check the stability of editing in Shadow DOM later, and it will
+ also help to confirm the patch will not break the editing.
+
+ Tests: editing/shadow/doubleclick-on-meter-in-shadow-crash.html
+ editing/shadow/rightclick-on-meter-in-shadow-crash.html
+ editing/shadow/shadow-selection-not-exported.html
+
+ * dom/Position.cpp:
+ (WebCore::Position::Position):
+ (WebCore::Position::containerNode):
+ (WebCore::Position::parentAnchoredEquivalent):
+ (WebCore::Position::previous):
+ (WebCore::Position::next):
+ (WebCore::Position::atStartOfTree):
+ (WebCore::Position::atEndOfTree):
+ (WebCore::Position::findParent):
+ * dom/Position.h:
+ (WebCore):
+ (WebCore::positionInParentBeforeNode):
+ (WebCore::positionInParentAfterNode):
+
+2012-05-09 Zoltan Horvath <zoltan@webkit.org>
+
+ [Qt] Build fix when using libpng version != 1.2
+ https://bugs.webkit.org/show_bug.cgi?id=85614
+
+ Reviewed by Eric Seidel.
+
+ Don't enforce the version of libpng when passing the option to the linker.
+
+ No new tests, no intended functionality change.
+
+ * WebCore.pri:
+
+2012-05-09 Oli Lan <olilan@chromium.org>
+
+ Add identifying methods for date/time input types.
+
+ This patch adds methods isDateField(), isDateTimeField(), isDateTimeLocalField(),
+ isMonthField(), isTimeField() and isWeekField() to InputType and the appropriate
+ HTMLInputElement classes, to allow date/time input types to be identified.
+
+ The new methods match the existing methods for types such as email, search and number.
+
+ https://bugs.webkit.org/show_bug.cgi?id=78746
+
+ Reviewed by Kent Tamura.
+
+ A new test WebViewTest.TextInputType has been added in WebKit/chromium/tests that calls
+ through to these methods via WebViewImpl.textInputType().
+
+ * html/DateInputType.cpp:
+ (WebCore::DateInputType::isDateField):
+ (WebCore):
+ * html/DateInputType.h:
+ (DateInputType):
+ * html/DateTimeInputType.cpp:
+ (WebCore::DateTimeInputType::isDateTimeField):
+ (WebCore):
+ * html/DateTimeInputType.h:
+ (DateTimeInputType):
+ * html/DateTimeLocalInputType.cpp:
+ (WebCore::DateTimeLocalInputType::isDateTimeLocalField):
+ (WebCore):
+ * html/DateTimeLocalInputType.h:
+ (DateTimeLocalInputType):
+ * html/HTMLInputElement.cpp:
+ (WebCore::HTMLInputElement::isDateField):
+ (WebCore):
+ (WebCore::HTMLInputElement::isDateTimeField):
+ (WebCore::HTMLInputElement::isDateTimeLocalField):
+ (WebCore::HTMLInputElement::isMonthField):
+ (WebCore::HTMLInputElement::isTimeField):
+ (WebCore::HTMLInputElement::isWeekField):
+ * html/HTMLInputElement.h:
+ (HTMLInputElement):
+ * html/InputType.cpp:
+ (WebCore::InputType::isDateField):
+ (WebCore):
+ (WebCore::InputType::isDateTimeField):
+ (WebCore::InputType::isDateTimeLocalField):
+ (WebCore::InputType::isMonthField):
+ (WebCore::InputType::isTimeField):
+ (WebCore::InputType::isWeekField):
+ * html/InputType.h:
+ (InputType):
+ * html/MonthInputType.cpp:
+ (WebCore::MonthInputType::isMonthField):
+ (WebCore):
+ * html/MonthInputType.h:
+ (MonthInputType):
+ * html/TimeInputType.cpp:
+ (WebCore::TimeInputType::isTimeField):
+ (WebCore):
+ * html/TimeInputType.h:
+ (TimeInputType):
+ * html/WeekInputType.cpp:
+ (WebCore::WeekInputType::isWeekField):
+ (WebCore):
+ * html/WeekInputType.h:
+ (WeekInputType):
+
+2012-05-09 Nikolas Zimmermann <nzimmermann@rim.com>
+
+ REGRESSION(r105057): Infinite loop inside SVGTextLayoutEngine::currentLogicalCharacterMetrics
+ https://bugs.webkit.org/show_bug.cgi?id=83405
+
+ Reviewed by Darin Adler.
+
+ Dynamically adding tspans carrying position information in the x/y/dx/dy/rotate lists is broken.
+ To avoid mistakes like this in future, simplify the calling code in RenderSVGInlineText and centralize
+ the managment of all caches (text positioning element cache / metrics map / layout attributes) in
+ RenderSVGText. This avoids the hack in SVGRootInlineBox::computePerCharacterLayoutInformation() which
+ called textRoot->rebuildLayoutAttributes(), which was used to fix previous security issues with this code.
+ Instead correctly handle destruction of RenderSVGInlineText in RenderSVGText, keeping the m_layoutAttributes
+ synchronized with the current state of the render tree. Fixes highcharts problems.
+
+ Tests: svg/text/add-tspan-position-bug.html
+ svg/text/modify-tspan-position-bug.html
+
+ * rendering/svg/RenderSVGInline.cpp:
+ (WebCore::RenderSVGInline::addChild):
+ * rendering/svg/RenderSVGInlineText.cpp:
+ (WebCore::RenderSVGInlineText::willBeDestroyed):
+ (WebCore::RenderSVGInlineText::setTextInternal):
+ (WebCore::RenderSVGInlineText::styleDidChange):
+ * rendering/svg/RenderSVGText.cpp:
+ (WebCore::recursiveUpdateMetrics):
+ (WebCore::RenderSVGText::subtreeChildAdded):
+ (WebCore::RenderSVGText::subtreeChildWillBeDestroyed):
+ (WebCore::recursiveCollectLayoutAttributes):
+ (WebCore::checkLayoutAttributesConsistency):
+ (WebCore::RenderSVGText::subtreeChildWasDestroyed):
+ (WebCore::RenderSVGText::subtreeStyleChanged):
+ (WebCore::RenderSVGText::subtreeTextChanged):
+ (WebCore::RenderSVGText::layout):
+ (WebCore::RenderSVGText::addChild):
+ (WebCore::RenderSVGText::rebuildAllLayoutAttributes):
+ (WebCore::RenderSVGText::rebuildLayoutAttributes):
+ * rendering/svg/RenderSVGText.h:
+ (WebCore::RenderSVGText::layoutAttributes):
+ * rendering/svg/SVGRootInlineBox.cpp:
+ (WebCore::SVGRootInlineBox::computePerCharacterLayoutInformation):
+ * rendering/svg/SVGTextLayoutAttributesBuilder.cpp:
+ (WebCore::SVGTextLayoutAttributesBuilder::buildLayoutAttributes):
+
+2012-05-08 Dongwoo Im <dw.im@samsung.com>
+
+ NavigatorRegisterProtocolHandler can call ChromeClient directly.
+ https://bugs.webkit.org/show_bug.cgi?id=85944
+
+ Reviewed by Adam Barth.
+
+ Covered by fast/dom/register-protocol-handler.html
+
+ * page/Chrome.cpp: Remove registerProtocolHandler function.
+ * page/Chrome.h: Remove registerProtocolHandler prototype.
+ (Chrome):
+ * page/NavigatorRegisterProtocolHandler.cpp: Call ChromeClient::registerProtocolHandler directly.
+ (WebCore::NavigatorRegisterProtocolHandler::registerProtocolHandler):
+
+2012-05-08 Mario Sanchez Prada <msanchez@igalia.com>
+
+ Coding style issues present in RenderFrameSet.cpp
+ https://bugs.webkit.org/show_bug.cgi?id=85955
+
+ Reviewed by Eric Seidel.
+
+ Just fixed those coding style issues.
+
+ * rendering/RenderFrameSet.cpp:
+ (WebCore::RenderFrameSet::GridAxis::resize):
+ (WebCore::RenderFrameSet::layOutAxis):
+ (WebCore::RenderFrameSet::continueResizing):
+
+2012-05-08 Jon Lee <jonlee@apple.com>
+
+ Unreviewed build fix.
+
+ * platform/mac/WebCoreSystemInterface.h:
+
+2012-05-08 Jason Liu <jason.liu@torchmobile.com.cn>
+
+ [BlackBerry] Auth credentials set in private mode are reused in public mode.
+ https://bugs.webkit.org/show_bug.cgi?id=84697
+
+ Reviewed by Rob Buis.
+
+ Add setPrivateMode function for CredentialStorage.
+
+ Now, we only save credentials in memory and CredentialBackingStore isn't enabled.
+ When we set private mode from on to off, we clear all these temporary credentials.
+
+ We have to change Private Browsing to test, so have to write a manual test case.
+ Test: ManualTests/blackberry/http-auth-private-mode-changed.html
+
+ * network/CredentialStorage.cpp:
+ (WebCore::CredentialStorage::setPrivateMode):
+ (WebCore):
+ * platform/network/CredentialStorage.h:
+ (CredentialStorage):
+
+2012-05-08 Rakesh KN <rakesh.kn@motorola.com>
+
+ RadioNodeList support in HTMLFormElement::elements
+ https://bugs.webkit.org/show_bug.cgi?id=81854
+
+ Reviewed by Ryosuke Niwa.
+
+ Implement RadioNodeList support spec'ed at
+ http://www.whatwg.org/specs/web-apps/current-work/multipage/common-dom-interfaces.html#radionodelist
+
+ Test: fast/forms/form-collection-radio-node-list.html
+
+ * CMakeLists.txt:
+ Added entries for new files.
+ * DerivedSources.cpp: Ditto.
+ * DerivedSources.make: Ditto.
+ * DerivedSources.pri: Ditto.
+ * GNUmakefile.list.am: Ditto.
+ * Target.pri: Ditto.
+ * WebCore.gypi: Ditto.
+ * WebCore.vcproj/WebCore.vcproj: Ditto.
+ * WebCore.xcodeproj/project.pbxproj: Ditto.
+ * bindings/js/JSHTMLCollectionCustom.cpp:
+ (WebCore::getNamedItems):
+ Modified to create RadioNodeList object when FormControlCollection has more than
+ one element of same name/id.
+ * bindings/scripts/CodeGeneratorJS.pm:
+ (GenerateImplementation):
+ Added code to include Node.h and JSNode.h in JSRadioNodeElement.cpp.
+ * bindings/v8/custom/V8HTMLCollectionCustom.cpp:
+ (WebCore::getNamedItems):
+ Modified to create RadioNodeList object when FormControlCollection has more than
+ one element of same name/id.
+ * dom/Node.cpp:
+ (WebCore::Node::invalidateNodeListsCacheAfterAttributeChanged):
+ Invalidate lists even for change in id, type, checked attributes.
+ (WebCore::NodeListsNodeData::invalidateCachesThatDependOnAttributes):
+ Invalidate radioNodeList cache.
+ (WebCore::NodeListsNodeData::isEmpty):
+ Changes for radioNodeList.
+ (WebCore::Node::radioNodeList):
+ Creates if needed a RadioNodeList and adds it to the cache.
+ (WebCore::Node::removeCachedRadioNodeList):
+ Removes a cached radioNodeList.
+ * dom/Node.h: Ditto
+ * dom/NodeRareData.h:
+ (WebCore):
+ (NodeListsNodeData):
+ Added radioNodeList list.
+ * html/CollectionType.h:
+ Added new FormControls type.
+ * html/HTMLCollection.cpp:
+ (WebCore::HTMLCollection::shouldIncludeChildren):
+ (WebCore::HTMLCollection::isAcceptableElement):
+ Handle FormControls collection type.
+ * html/HTMLFormCollection.cpp:
+ (WebCore::HTMLFormCollection::HTMLFormCollection):
+ Contruct collection of FormControls type.
+ * html/RadioNodeList.cpp: Added.
+ (WebCore):
+ (WebCore::RadioNodeList::RadioNodeList):
+ (WebCore::RadioNodeList::~RadioNodeList):
+ (WebCore::toRadioButtonInputElement):
+ (WebCore::RadioNodeList::value):
+ (WebCore::RadioNodeList::setValue):
+ (WebCore::RadioNodeList::nodeMatches):
+ * html/RadioNodeList.h: Added.
+ (WebCore):
+ (RadioNodeList):
+ (WebCore::RadioNodeList::create):
+ RadioNodeList implementation.
+ * html/RadioNodeList.idl: Added.
+ Idl for generating RadioNodeList JS/V8 bindings.
+
+2012-05-08 Benjamin Poulain <bpoulain@apple.com>
+
+ [JSC] Regression: addEventListener() and removeEventListener() raise an exception on missing args
+ https://bugs.webkit.org/show_bug.cgi?id=85928
+
+ Reviewed by Geoffrey Garen.
+
+ The functions addEventListener() and removeEventListener() raise an exception if there are missin arguments.
+ This behavior breaks existing content.
+
+ This patch change the code generator of JavaScript core to have an exception for addEventListener() and removeEventListener().
+ For those function, we do not raise an exception on missin argument.
+
+ This patch does not modify the V8 code generator because such exceptions are already in place there.
+
+ Tests: fast/dom/Window/window-legacy-event-listener.html
+ fast/dom/XMLHttpRequest-legacy-event-listener.html
+ fast/dom/node-legacy-event-listener.html
+
+ * bindings/scripts/CodeGeneratorJS.pm:
+ (GenerateImplementation):
+
+2012-05-08 Chris Rogers <crogers@google.com>
+
+ AudioParam should directly be given context in create() method
+ https://bugs.webkit.org/show_bug.cgi?id=85905
+
+ Reviewed by James Robinson.
+
+ No new tests. This is a low-level re-factoring and is covered by existing tests.
+
+ * Modules/webaudio/AudioBufferSourceNode.cpp:
+ (WebCore::AudioBufferSourceNode::AudioBufferSourceNode):
+ * Modules/webaudio/AudioGain.h:
+ (WebCore::AudioGain::create):
+ (WebCore::AudioGain::AudioGain):
+ * Modules/webaudio/AudioGainNode.cpp:
+ (WebCore::AudioGainNode::AudioGainNode):
+ * Modules/webaudio/AudioPannerNode.cpp:
+ (WebCore::AudioPannerNode::AudioPannerNode):
+ * Modules/webaudio/AudioParam.h:
+ (WebCore::AudioParam::create):
+ (AudioParam):
+ (WebCore::AudioParam::AudioParam):
+ * Modules/webaudio/BiquadFilterNode.cpp:
+ (WebCore::BiquadFilterNode::BiquadFilterNode):
+ * Modules/webaudio/BiquadProcessor.cpp:
+ (WebCore::BiquadProcessor::BiquadProcessor):
+ * Modules/webaudio/BiquadProcessor.h:
+ * Modules/webaudio/DelayNode.cpp:
+ (WebCore::DelayNode::DelayNode):
+ * Modules/webaudio/DelayProcessor.cpp:
+ (WebCore::DelayProcessor::DelayProcessor):
+ * Modules/webaudio/DelayProcessor.h:
+ (DelayProcessor):
+ * Modules/webaudio/DynamicsCompressorNode.cpp:
+ (WebCore::DynamicsCompressorNode::DynamicsCompressorNode):
+ * Modules/webaudio/Oscillator.cpp:
+ (WebCore::Oscillator::Oscillator):
+
+2012-05-08 Dana Jansens <danakj@chromium.org>
+
+ [chromium] Show borders for partial-draw-culled quads to visualize culling behaviour
+ https://bugs.webkit.org/show_bug.cgi?id=85414
+
+ Reviewed by Adrienne Walker.
+
+ The borders are brown, and are only shown when the quad's visible rect
+ is non-empty and is different from the quad's original rect.
+
+ Adds a flag to CCQuadCuller constructor, to enable showing debug borders
+ around what it leaves after culling (when it culls anything in a quad
+ at all).
+
+ * platform/graphics/chromium/cc/CCDrawQuad.h:
+ (WebCore::CCDrawQuad::isDebugQuad):
+ (WebCore::CCDrawQuad::sharedQuadState):
+ (CCDrawQuad):
+ * platform/graphics/chromium/cc/CCQuadCuller.cpp:
+ (WebCore):
+ (WebCore::CCQuadCuller::CCQuadCuller):
+ (WebCore::appendQuadInternal):
+ (WebCore::CCQuadCuller::append):
+ (WebCore::CCQuadCuller::appendSurface):
+ (WebCore::CCQuadCuller::appendReplica):
+ * platform/graphics/chromium/cc/CCQuadCuller.h:
+ (CCQuadCuller):
+ * platform/graphics/chromium/cc/CCRenderPass.cpp:
+ (WebCore::CCRenderPass::appendQuadsForLayer):
+ (WebCore::CCRenderPass::appendQuadsForRenderSurfaceLayer):
+
+2012-05-08 Julien Chaffraix <jchaffraix@webkit.org>
+
+ Move RenderLayers z-index lists dirtying to post style change
+ https://bugs.webkit.org/show_bug.cgi?id=85437
+
+ Reviewed by Darin Adler.
+
+ No expected change in behavior.
+
+ This change moves the z-order lists to RenderLayer::styleChanged. As part of this
+ change, also added proper handling of stacking context transition. This enabled
+ us to tighten more of the dirtyZOrderLists / clearZOrderLists code.
+
+ * rendering/RenderBoxModelObject.cpp:
+ (WebCore::RenderBoxModelObject::styleWillChange):
+ Removed this code, moved to updateStackingContextsAfterStyleChange.
+
+ * rendering/RenderLayer.cpp:
+ (WebCore::RenderLayer::RenderLayer):
+ Only stacking contexts start with dirty z-order lists.
+
+ (WebCore::RenderLayer::dirtyZOrderLists):
+ Added an ASSERT.
+
+ (WebCore::RenderLayer::updateStackingContextsAfterStyleChange):
+ Refactored the code to handle the transition between stacking context status.
+
+ (WebCore::RenderLayer::styleChanged):
+ Added a call to updateStackingContextsAfterStyleChange.
+
+ * rendering/RenderLayer.h:
+ (WebCore::RenderLayer::isStackingContext):
+ Added a call to the next function.
+
+ (WebCore::RenderLayer::layerWithStyleIsStackingContext):
+ Factored the isStackingContext logic here so that we can reuse it inside
+ updateStackingContextsAfterStyleChange.
+
+ (WebCore::RenderLayer::clearZOrderLists):
+ Added an ASSERT.
+
+2012-05-08 Abhishek Arya <inferno@chromium.org>
+
+ Crash due to owning renderer not removed from custom scrollbar.
+ https://bugs.webkit.org/show_bug.cgi?id=80610
+
+ Reviewed by Eric Seidel.
+
+ Test: scrollbars/scrollbar-owning-renderer-crash.html
+
+ Changed RenderScrollbar to keep pointer to owning node, instead of the
+ renderer. Renderer can get destroyed without informing the scrollbar, causing
+ crashes later. Remove code from r94107 since it is not needed anymore and saves
+ times when RenderBox is getting destroyed.
+
+ * page/FrameView.cpp:
+ (WebCore::FrameView::createScrollbar): pass renderer's node.
+ * page/FrameView.h:
+ * rendering/RenderBox.cpp:
+ (WebCore::RenderBox::willBeDestroyed): no longer need this. came originally from r94107.
+ * rendering/RenderLayer.cpp:
+ (WebCore::RenderLayer::createScrollbar): pass renderer's node.
+ (WebCore::RenderLayer::destroyScrollbar): no longer need to clear owning renderer.
+ * rendering/RenderListBox.cpp:
+ (WebCore::RenderListBox::createScrollbar): pass renderer's node.
+ * rendering/RenderMenuList.cpp:
+ (WebCore::RenderMenuList::createScrollbar): pass renderer's node.
+ * rendering/RenderScrollbar.cpp:
+ (WebCore::RenderScrollbar::createCustomScrollbar): Store owner node instead of renderer.
+ (WebCore::RenderScrollbar::RenderScrollbar): Store owner node instead of renderer.
+ (WebCore::RenderScrollbar::owningRenderer): calculate owning renderer from owner node.
+ * rendering/RenderScrollbar.h:
+ (RenderScrollbar):
+ * rendering/RenderTextControlSingleLine.cpp:
+ (WebCore::RenderTextControlSingleLine::createScrollbar): pass renderer's node.
+
+2012-05-08 Jon Lee <jonlee@apple.com>
+
+ Safari warns that it needs to resend the form in an iFrame when going back
+ https://bugs.webkit.org/show_bug.cgi?id=82658
+ <rdar://problem/11292558>
+
+ Reviewed by Darin Adler.
+
+ Test: http/tests/loading/post-in-iframe-with-back-navigation.html
+
+ * WebCore.exp.in: Add _wkCFURLRequestAllowAllPostCaching.
+ * platform/mac/WebCoreSystemInterface.h: Add wkCFURLRequestAllowAllPostCaching.
+ * platform/mac/WebCoreSystemInterface.mm: Add wkCFURLRequestAllowAllPostCaching.
+ * platform/network/cf/ResourceRequestCFNet.cpp:
+ (WebCore::ResourceRequest::doUpdatePlatformRequest): Set the bit to cache all POST responses.
+ * platform/network/mac/ResourceRequestMac.mm:
+ (WebCore::ResourceRequest::doUpdatePlatformRequest): Set the bit to cache all POST responses.
+
+2012-05-08 Dana Jansens <danakj@chromium.org>
+
+ [chromium] Reflections with masks should not occlude
+ https://bugs.webkit.org/show_bug.cgi?id=85927
+
+ Reviewed by James Robinson.
+
+ When a surface does not have a mask, we make both it and its reflection
+ occlude the things below them. However, if the reflection has a mask
+ applied to it, then we should not consider it as occluding.
+
+ Adds replicaHasMask() to the render surface classes so we can test if
+ the mask is present.
+
+ Unit Tests: CCOcclusionTrackerTestReplicaWithMask
+
+ * platform/graphics/chromium/RenderSurfaceChromium.cpp:
+ (WebCore::RenderSurfaceChromium::hasMask):
+ This is unusued right now, but will allow us to remove a FIXME from
+ CCOcclusionTracker::finishedTargetRenderSurface().
+ (WebCore):
+ (WebCore::RenderSurfaceChromium::replicaHasMask):
+ * platform/graphics/chromium/RenderSurfaceChromium.h:
+ (RenderSurfaceChromium):
+ * platform/graphics/chromium/cc/CCOcclusionTracker.cpp:
+ (WebCore::::leaveToTargetRenderSurface):
+ * platform/graphics/chromium/cc/CCRenderSurface.cpp:
+ (WebCore::CCRenderSurface::hasMask):
+ This is unusued right now, but will allow us to remove a FIXME from
+ CCOcclusionTracker::finishedTargetRenderSurface().
+ (WebCore):
+ (WebCore::CCRenderSurface::replicaHasMask):
+ * platform/graphics/chromium/cc/CCRenderSurface.h:
+ (CCRenderSurface):
+
+2012-05-08 Eric Seidel <eric@webkit.org>
+
+ Add stylesheet inheritance support to IFRAME_SEAMLESS
+ https://bugs.webkit.org/show_bug.cgi?id=85914
+
+ Reviewed by Ojan Vafai.
+
+ This work is already guarded by IFRAME_SEAMLESS, as
+ Document::shouldDisplaySeamlesslyWithParent always returns false
+ when IFRAME_SEAMLESS is off.
+
+ This makes the child document use all author stylesheets from all parent documents,
+ per the seamless spec:
+ http://www.whatwg.org/specs/web-apps/current-work/#attr-iframe-seamless
+
+ This support is slightly inefficient as every time a sheet is added
+ to a parent document, the child document must do a full style selector recalc.
+ Normally author sheet additions have a fast-path which avoids the full selector recalc,
+ but such is not possible in the seamless case as we're inserting the parents sheets
+ earlier in the child's cascade (instead of just appending them to the end of the list).
+
+ The test covers both the static inheritance as well as addition of a stylesheet
+ to the parent and testing that it caused a recalc of the child.
+
+ Covered by fast/frames/seamless/seamless-css-cascade.html
+
+ * css/StyleResolver.cpp:
+ (WebCore::StyleResolver::StyleResolver):
+ (WebCore::StyleResolver::addStylesheetsFromSeamlessParents):
+ (WebCore):
+ * css/StyleResolver.h:
+ (StyleResolver):
+ * dom/Document.cpp:
+ (WebCore::Document::seamlessParentUpdatedStylesheets):
+ (WebCore):
+ (WebCore::Document::notifySeamlessChildDocumentsOfStylesheetUpdate):
+ (WebCore::Document::updateActiveStylesheets):
+ * dom/Document.h:
+ (Document):
+
+2012-05-08 Raphael Kubo da Costa <rakuco@webkit.org>
+
+ [CMake] FindGStreamer: Fix the build with static WebCore.
+ https://bugs.webkit.org/show_bug.cgi?id=85930
+
+ Reviewed by Daniel Bates.
+
+ No new tests, build fix.
+
+ Building WebCore statically was failing because files in
+ WebCore/platform/gstreamer when ENABLE_VIDEO was set required
+ gstreamer-base, which was not being linked to after r116453.
+
+ Fix that by looking for gstreamer-base, requiring and linking
+ against it if GStreamer is used.
+
+ * PlatformEfl.cmake: Link to GSTREAMER_LIBRARIES and
+ GSTREAMER_BASE_LIBRARIES, and include GSTREAMER_INCLUDE_DIRS and
+ GSTREAMER_BASE_INCLUDE_DIRS.
+
+2012-05-08 Raymond Toy <rtoy@google.com>
+
+ JavaScriptAudioNode should not ASSERT if number of input channels is 0
+ https://bugs.webkit.org/show_bug.cgi?id=85818
+
+ Reviewed by Eric Seidel.
+
+ Test: webaudio/javascriptaudionode-zero-input-channels.html
+
+ * Modules/webaudio/JavaScriptAudioNode.cpp:
+ (WebCore::JavaScriptAudioNode::process): Update buffersAreGood.
+ (WebCore::JavaScriptAudioNode::fireProcessEvent): Remove ASSERT.
+
+2012-05-08 Dana Jansens <danakj@chromium.org>
+
+ Region reads past end of spans
+ https://bugs.webkit.org/show_bug.cgi?id=85909
+
+ Reviewed by Anders Carlsson.
+
+ Region currently checks aSpan == aSpanEnd as the indicator that
+ we passed all the spans. When aSpan < aSpanEnd, it uses aSpan+1
+ to find the height of the span.
+
+ If aSpan == aSpanEnd - 1, then aSpan+1 == aSpanEnd. This does not
+ represent a valid span, since aSpanEnd is past the end of the
+ array, not the last element in the array. The loop should terminate
+ in this case.
+
+ Checking aSegment != aSegmentEnd is acceptable in the inner loop since
+ it increments by two each time (segments come in pairs, while spans
+ come in singles).
+
+ Test: RegionTest.ReadPastFullSpanVectorInIntersectsTest
+
+ * platform/graphics/Region.cpp:
+ (WebCore::Region::Shape::compareShapes):
+
+2012-05-08 Philip Rogers <pdr@google.com>
+
+ Prevent crash in animated lists
+ https://bugs.webkit.org/show_bug.cgi?id=85382
+
+ Reviewed by Nikolas Zimmermann.
+
+ Animated lists blindly assign the last list value to m_toAtEndOfDurationType
+ in SVGAnimationElement::startedActiveInterval. If the last list value's length
+ is larger or smaller than the animated "to" length, we crash.
+
+ This change prevents accessing values off the end of toAtEndOfDuration by adding
+ a check for this case. It may seem inefficient to perform this check on every
+ animation update but the "to" value can change (in cardinality) while animating.
+
+ I checked each of the other animation types (e.g., SVGAnimatedAngle,
+ SVGAnimatedBoolean, etc.) and was only able to hit this style of crash
+ in the three types modified in this change:
+ SVGAnimatedLengthList, SVGAnimatedNumberList, and SVGAnimatedPointList.
+
+ Tests: svg/animations/animate-linear-discrete-additive-b-expected.svg
+ svg/animations/animate-linear-discrete-additive-b.svg
+ svg/animations/animate-linear-discrete-additive-c-expected.svg
+ svg/animations/animate-linear-discrete-additive-c.svg
+ svg/animations/animate-linear-discrete-additive-expected.svg
+ svg/animations/animate-linear-discrete-additive.svg
+ svg/animations/animate-list-crash.svg
+
+ * svg/SVGAnimatedLengthList.cpp:
+ (WebCore::SVGAnimatedLengthListAnimator::calculateAnimatedValue):
+ * svg/SVGAnimatedNumberList.cpp:
+ (WebCore::SVGAnimatedNumberListAnimator::calculateAnimatedValue):
+ * svg/SVGAnimatedPointList.cpp:
+ (WebCore::SVGAnimatedPointListAnimator::calculateAnimatedValue):
+
+2012-05-08 Rafael Weinstein <rafaelw@chromium.org>
+
+ HTMLElementStack::hasOnlyHTMLElementsInScope is no longer called
+ https://bugs.webkit.org/show_bug.cgi?id=85908
+
+ Reviewed by Eric Seidel.
+
+ This patch just removes the dead code.
+
+ No tests needed. Cleanup only.
+
+ * html/parser/HTMLElementStack.cpp:
+ * html/parser/HTMLElementStack.h:
+ (HTMLElementStack):
+
+2012-05-08 W. James MacLean <wjmaclean@chromium.org>
+
+ [chromium] Create LinkHighlightLayerChromium class to provide link-highlight preview animations for GraphicsLayerChromium.
+ https://bugs.webkit.org/show_bug.cgi?id=85084
+
+ Reviewed by James Robinson.
+
+ Unit test provided.
+
+ Creates a layer delegate class to provide link highlight animations for link-preview feature.
+ These are added to a GraphicsLayerChromium via provided methods. Moves dispensing of animation
+ ids into a separate class.
+
+ * WebCore.gypi:
+ * platform/graphics/chromium/AnimationIdVendor.cpp: Added.
+ (WebCore):
+ (WebCore::AnimationIdVendor::getNextAnimationId):
+ (WebCore::AnimationIdVendor::getNextGroupId):
+ * platform/graphics/chromium/AnimationIdVendor.h: Added.
+ (WebCore):
+ (AnimationIdVendor):
+ * platform/graphics/chromium/GraphicsLayerChromium.cpp:
+ (WebCore::GraphicsLayerChromium::willBeDestroyed):
+ (WebCore::GraphicsLayerChromium::updateNames):
+ (WebCore::GraphicsLayerChromium::addAnimation):
+ (WebCore::GraphicsLayerChromium::addLinkHighlight):
+ (WebCore):
+ (WebCore::GraphicsLayerChromium::didFinishLinkHighlight):
+ (WebCore::GraphicsLayerChromium::updateChildList):
+ (WebCore::GraphicsLayerChromium::mapAnimationNameToId):
+ * platform/graphics/chromium/GraphicsLayerChromium.h:
+ (WebCore):
+ (GraphicsLayerChromium):
+ * platform/graphics/chromium/LinkHighlight.cpp: Added.
+ (WebCore):
+ (WebCore::LinkHighlight::create):
+ (WebCore::LinkHighlight::LinkHighlight):
+ (WebCore::LinkHighlight::~LinkHighlight):
+ (WebCore::LinkHighlight::contentLayer):
+ (WebCore::LinkHighlight::paintContents):
+ (WebCore::LinkHighlight::notifyAnimationStarted):
+ (WebCore::LinkHighlight::notifyAnimationFinished):
+ * platform/graphics/chromium/LinkHighlight.h: Added.
+ (WebCore):
+ (LinkHighlight):
+
+2012-05-08 Raphael Kubo da Costa <rakuco@webkit.org>
+
+ [CMake] Rewrite FindGStreamer.cmake.
+ https://bugs.webkit.org/show_bug.cgi?id=85857
+
+ Reviewed by Daniel Bates.
+
+ No new tests, build system change.
+
+ We are currently kind of duplicating the same
+ FindGStreamer-Foo.cmake file whenever a new GStreamer plugin needs
+ to be found. Besides this approach not scaling very well, it
+ relies on pkg-config for version checking, uses the LibFindMacros
+ package that we should deprecate and all the find files could be
+ merged into one, with users using the COMPONENTS feature of the
+ FIND_PACKAGE() call to find the desired plugins.
+
+ FindGStreamer.cmake has then been rewritten to take all that into
+ account:
+ - The LibFindMacros.cmake package is not used anymore.
+ - Version check is performed in the CMake file itself by parsing
+ the gstversion.h header.
+ - All GStreamer plugins are searched and the COMPONENTS keyword
+ used in the FIND_PACKAGE() call is used to check which plugins are
+ required.
+ - The plugins-base and base GStreamer plugins are not searched, as
+ they were not used anywhere in the build system.
+
+ * PlatformEfl.cmake: Update GStreamer-related variable names.
+
+2012-05-08 Mikhail Pozdnyakov <mikhail.pozdnyakov@intel.com>
+
+ [EFL] Handling of numeric-pad keys in EFL's PlatformKeyboardEvent
+ https://bugs.webkit.org/show_bug.cgi?id=85479
+
+ Reviewed by Gustavo Noronha Silva.
+
+ EFL's PlatformKeyboardEvent::isKeypad() now returns meaningful value.
+ Added numeric-pad keys to the Key Map and Windows Key Map.
+
+ No new tests.
+
+ * platform/efl/EflKeyboardUtilities.cpp:
+ (WebCore::createKeyMap):
+ (WebCore::createWindowsKeyMap):
+ * platform/efl/PlatformKeyboardEventEfl.cpp:
+ (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
+
+2012-05-04 Nikolas Zimmermann <nzimmermann@rim.com>
+
+ Tie lifetime of SVGAnimateElement::m_animatedType to the duration of the animation
+ https://bugs.webkit.org/show_bug.cgi?id=85627
+
+ Reviewed by Antti Koivisto.
+
+ Example:
+ <rect width="10" height="100">
+ <animate attributeName="width" from="10" to="100" begin="2s" dur="4s" fill="remove"/>
+ </rect>
+
+ At t=0s the <animate> element receives its first interval: begin=2s, end=6s.
+ At this point we've created the 'OwnPtr<SVGAnimatedType> m_animatedType' in
+ SVGAnimateElement, which holds the current animated value of the target type.
+ In this example it contains a SVGLength with '10' as value at t=0s.
+
+ Calling "rect.width.animVal.value" will return the value currently contained in the
+ m_animatedType from the SVGAnimateElement, even though the animation didn't begin
+ yet. This is fine, as the animVal equals to the baseVal, as long as no animation is
+ running.
+
+ At t=6s you'd expect that the whole 'animVal' object is destructed again, as it's no
+ longer needed, as animVal will be equal to baseVal again, but the current code keeps
+ the animVal alive, and just resets it to the baseVal. The animVals will be destructed
+ once the animate element leaves the tree.
+
+ CSS animations suffer from the same problem, we never remove the animated SMIL properties
+ but we only reset them to the base value. This makes integration with CSS Animations and
+ CSS Transitions harder, so this needs to be changed.
+
+ This patch starts tracking the start/end of an animation chain properly, to destruct
+ the animation effect for non-frozen animations at the end of their duration. This has to
+ work properly together with seeking (SVGSVGElement.setCurrentTime), as our testing relies
+ on the ability to drive the SMIL timeline from script.
+
+ Tests: svg/animations/list-wrapper-assertion-expected.svg
+ svg/animations/list-wrapper-assertion.svg
+
+ * svg/SVGAnimateElement.cpp:
+ (WebCore::SVGAnimateElement::resetAnimatedType):
+ (WebCore::applyCSSPropertyToTarget):
+ (WebCore::removeCSSPropertyFromTarget):
+ (WebCore::applyCSSPropertyToTargetAndInstances):
+ (WebCore::removeCSSPropertyFromTargetAndInstances):
+ (WebCore::notifyTargetAboutAnimValChange):
+ (WebCore::notifyTargetAndInstancesAboutAnimValChange):
+ (WebCore::SVGAnimateElement::clearAnimatedType):
+ (WebCore::SVGAnimateElement::applyResultsToTarget):
+ (WebCore::SVGAnimateElement::targetElementWillChange):
+ * svg/SVGAnimateElement.h:
+ (SVGAnimateElement):
+ * svg/SVGAnimateMotionElement.cpp:
+ (WebCore::SVGAnimateMotionElement::resetAnimatedType):
+ (WebCore::SVGAnimateMotionElement::clearAnimatedType):
+ * svg/SVGAnimateMotionElement.h:
+ (SVGAnimateMotionElement):
+ * svg/SVGAnimationElement.cpp:
+ * svg/SVGAnimationElement.h:
+ * svg/animation/SMILTimeContainer.cpp:
+ (WebCore::SMILTimeContainer::updateAnimations):
+ * svg/animation/SVGSMILElement.cpp:
+ (WebCore::SVGSMILElement::reset):
+ (WebCore::SVGSMILElement::targetElementWillChange):
+ (WebCore::SVGSMILElement::determineActiveState):
+ (WebCore::SVGSMILElement::progress):
+ * svg/animation/SVGSMILElement.h:
+ (SVGSMILElement):
+ * svg/properties/SVGAnimatedListPropertyTearOff.h:
+ Remove svgAttributeChanged() calls from animationEnded/animValDidChange.
+ Callers are now required to notify the target about changes. There are cases
+ where we want to call animValDidChange without invoking svgAttributeChanged().
+ That is supported now.
+ (WebCore::SVGAnimatedListPropertyTearOff::animationEnded):
+ (WebCore::SVGAnimatedListPropertyTearOff::animValDidChange):
+ * svg/properties/SVGAnimatedProperty.h: Ditto.
+ (WebCore::SVGAnimatedProperty::commitChange): Add safety guard.
+ * svg/properties/SVGAnimatedPropertyTearOff.h: Ditto.
+ (WebCore::SVGAnimatedPropertyTearOff::animationEnded):
+ (WebCore::SVGAnimatedPropertyTearOff::animValDidChange):
+ * svg/properties/SVGAnimatedStaticPropertyTearOff.h: Ditto.
+ (WebCore::SVGAnimatedStaticPropertyTearOff::animationEnded):
+ (WebCore::SVGAnimatedStaticPropertyTearOff::animValDidChange):
+
+2012-05-08 Ryuan Choi <ryuan.choi@samsung.com>
+
+ [EFL][DRT]Do not create ScrollbarEfl when mockScrollbar is enabled.
+ https://bugs.webkit.org/show_bug.cgi?id=81315
+
+ Reviewed by Chang Shu.
+
+ ScrollbarEfl creates custom scrollbars as separated layer and they are
+ not related to ScrollbarTheme.
+ So, DRT/Efl creates custom scrollbars on webview which paints mockScrollbar.
+
+ This patch prevents creating custom scrollbars when mockScrollbar is enabled.
+
+ Because DRT/Efl only renders the webview now, expected results are same
+ until Bug 79853 is landed.
+
+ * platform/efl/ScrollbarEfl.cpp:
+ (Scrollbar::createNativeScrollbar):
+
+2012-05-08 Timothy Hatcher <timothy@apple.com>
+
+ Fix the SOFT_LINK_STAGED_FRAMEWORK_OPTIONAL macro so it passes the full path to dlopen.
+
+ dyld only considers libraries in the versioned framework path if their install name
+ matches the library that it is attempting to load. The path we were passing to
+ dlopen lacked the Versions/A component of the path so dyld did not recognize that
+ we wanted it to use the staged version if it is newer.
+
+ <rdar://problem/11406517>
+
+ Reviewed by Mark Rowe.
+
+ * platform/mac/SoftLinking.h: Have SOFT_LINK_STAGED_FRAMEWORK_OPTIONAL take the
+ framework version as an argument and use it when constructing the path to dlopen.
+
+2012-05-08 Rafael Brandao <rafael.lobo@openbossa.org>
+
+ Build fix for Qt Snowleopard Release
+ https://bugs.webkit.org/show_bug.cgi?id=85895
+
+ Reviewed by Alexis Menard.
+
+ The enum value JSUint8ClampedArray conflicted with the JSUint8ClampedArray class.
+ I've added the 'Type' suffix to the enum value to make their names different.
+
+ No new tests needed.
+
+ * bridge/qt/qt_runtime_qt4.cpp:
+ (JSC::Bindings::valueRealType):
+ (JSC::Bindings::convertValueToQVariant):
+
+2012-05-08 Shezan Baig <shezbaig.wk@gmail.com>
+
+ offsetLeft broken within CSS3 columns
+ https://bugs.webkit.org/show_bug.cgi?id=34875
+
+ Reviewed by Julien Chaffraix.
+
+ Reimplement offsetLeft and offsetTop in terms of a new method called
+ 'offsetTopLeft'. The new method starts from a reference point (the
+ top-left coordinate of a box or inline) and adjusts this reference
+ point for columns as we traverse each parent. Note that the reference
+ point needs to be adjusted in both dimensions, even though offsetLeft
+ and offsetTop return only one of them.
+
+ A new method called 'offsetForColumns' was added to RenderObject. This
+ method is similar to adjustForColumns, except that it returns the
+ offset instead of modifying a reference. This method is necessary to
+ simplify the implementation of offsetTopLeft.
+
+ Tests: fast/block/positioning/offsetLeft-offsetTop-multicolumn-expected.txt
+ fast/block/positioning/offsetLeft-offsetTop-multicolumn.html
+
+ * rendering/RenderBox.h:
+ (RenderBox):
+ Override offsetLeft and offsetTop.
+ * rendering/RenderBox.cpp:
+ (WebCore::RenderBox::offsetLeft):
+ Implemented in terms of RenderBoxModelObject::offsetTopLeft, using
+ topLeftLocation as startPoint.
+ (WebCore::RenderBox::offsetTop):
+ Implemented in terms of RenderBoxModelObject::offsetTopLeft, using
+ topLeftLocation as startPoint.
+ * rendering/RenderBoxModelObject.cpp:
+ (WebCore::RenderBoxModelObject::offsetTopLeft):
+ New method to compute offsetLeft and offsetTop simultaneously, and
+ adjusting for columns at each parent.
+ (WebCore::RenderBoxModelObject::offsetLeft):
+ Reimplemented in terms of offsetTopLeft.
+ (WebCore::RenderBoxModelObject::offsetTop):
+ Reimplemented in terms of offsetTopLeft.
+ * rendering/RenderBoxModelObject.h:
+ (RenderBoxModelObject):
+ Declare new offsetTopLeft method.
+ * rendering/RenderInline.cpp:
+ (WebCore::RenderInline::offsetLeft):
+ Reimplemented in terms of RenderBoxModelObject::offsetTopLeft.
+ (WebCore::RenderInline::offsetTop):
+ Reimplemented in terms of RenderBoxModelObject::offsetTopLeft.
+ * rendering/RenderObject.h:
+ (RenderObject):
+ (WebCore::RenderObject::offsetForColumns):
+ New helper method to simplify implementation of offsetTopLeft.
+
+2012-03-31 Robert Hogan <robert@webkit.org>
+
+ CSS 2.1 failure: first-letter-nested-004.htm fails
+ https://bugs.webkit.org/show_bug.cgi?id=72987
+
+ Reviewed by Eric Seidel.
+
+ When styling first-letter check each sibling and drill into its inlines until we find either (i) a text node
+ that is not all whitespace, or (ii) a line break.
+
+ This makes our rendering of the following tests compatible with FF and Opera. Our current behaviour is also conformant
+ since the spec allows UAs to style just one element:
+ css2.1/20110323/first-letter-quote-002.htm
+ css2.1/20110323/first-letter-quote-003.htm
+ css2.1/20110323/first-letter-quote-004.htm
+ css2.1/20110323/first-letter-quote-005.htm
+
+ This fixes the following two tests. We now drill into the descendants of an element styled with :first-letter looking
+ for text to style:
+ css2.1/20110323/first-letter-nested-004.htm
+ css2.1/20110323/first-letter-nested-006.htm
+
+ This patch changes our rendering of first-letter-dynamic-001.htm as we now render adjacent quotes in the second line as
+ green. This is consistent with the spec, which allows this behaviour but does not require it. It's the 'right' behaviour
+ since it is consistent with the rendering of such quotes in a single element with :first-letter style.
+
+ * rendering/RenderBlock.cpp:
+ (WebCore::RenderBlock::findLastObjectWithFirstLetterText): Iterate through the child's siblings looking for the last
+ object to be styled :first-letter.
+ (WebCore::RenderBlock::findLastObjectAfterFirstLetterPunctuation): Style any leading punctuation as first-letter, drill
+ down into the child's descendants looking for text if necessary.
+ (WebCore::RenderBlock::updateFirstLetter): Refactor to drill into sibling's children looking for inlines
+ that should be styled as first-letter.
+ (WebCore::RenderBlock::addFirstLetter): Split out from updateFirstLetter so that it can be used when a
+ descendant node inside a sibling is found in findLastObjectWithFirstLetterText() needs to be styled as first-letter.
+ * rendering/RenderBlock.h:
+
+2012-05-08 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r116402.
+ http://trac.webkit.org/changeset/116402
+ https://bugs.webkit.org/show_bug.cgi?id=85898
+
+ Caused a 3% regression on Chromium's bloat-http test on Linux
+ (Requested by ojan_gardening on #webkit).
+
+ * WebCore.exp.in:
+ * bindings/v8/RetainedDOMInfo.cpp:
+ * dom/ContainerNode.h:
+ * dom/Node.cpp:
+ (WebCore::Node::traverseNextNode):
+ (WebCore):
+ (WebCore::Node::traverseNextSibling):
+ * dom/Node.h:
+ (Node):
+
+2012-05-08 Hironori Bono <hbono@chromium.org>
+
+ [Chromium] Fix the position of an RTL resizer
+ https://bugs.webkit.org/show_bug.cgi?id=80640
+
+ Reviewed by Tony Chang.
+
+ When rendering an RTL resizer, my r110073 renders it at the same position as the
+ one used for rendering a LTR resizer. Unfortunately, this code renders the RTL
+ resizer image at an incorrect position on Mac and Linux. This change uses the
+ correct formula to calculate the position of an RTL resizer.
+
+ Test: platform/chromium/scrollbars/rtl-resizer-position.html
+
+ * rendering/RenderLayer.cpp:
+ (WebCore::RenderLayer::drawPlatformResizerImage):
+
+2012-05-08 Andreas Kling <kling@webkit.org>
+
+ Element: isURLAttribute() should take a const Attribute&.
+ <http://webkit.org/b/85890>
+
+ Reviewed by Anders Carlsson.
+
+ Change isURLAttribute(Attribute*) to isURLAttribute(const Attribute&) to enforce
+ the fact that the Attribute can't be null, and shouldn't be mutated, at compile-time.
+ Also sprinkle OVERRIDE while we're at it.
+
+ * dom/Element.cpp:
+ (WebCore::Element::getURLAttribute):
+ (WebCore::Element::getNonEmptyURLAttribute):
+ * dom/Element.h:
+ (WebCore::Element::isURLAttribute):
+ * editing/MarkupAccumulator.cpp:
+ (WebCore::MarkupAccumulator::appendQuotedURLAttributeValue):
+ (WebCore::MarkupAccumulator::appendAttribute):
+ * editing/markup.cpp:
+ (WebCore::completeURLs):
+ * html/HTMLAnchorElement.cpp:
+ (WebCore::HTMLAnchorElement::isURLAttribute):
+ * html/HTMLAnchorElement.h:
+ * html/HTMLBaseElement.cpp:
+ (WebCore::HTMLBaseElement::isURLAttribute):
+ * html/HTMLBaseElement.h:
+ * html/HTMLBodyElement.cpp:
+ (WebCore::HTMLBodyElement::isURLAttribute):
+ * html/HTMLBodyElement.h:
+ * html/HTMLButtonElement.cpp:
+ (WebCore::HTMLButtonElement::isURLAttribute):
+ * html/HTMLButtonElement.h:
+ * html/HTMLElement.cpp:
+ (WebCore::HTMLElement::isURLAttribute):
+ * html/HTMLElement.h:
+ * html/HTMLEmbedElement.cpp:
+ (WebCore::HTMLEmbedElement::isURLAttribute):
+ * html/HTMLEmbedElement.h:
+ * html/HTMLFormElement.cpp:
+ (WebCore::HTMLFormElement::isURLAttribute):
+ * html/HTMLFormElement.h:
+ * html/HTMLFrameElementBase.cpp:
+ (WebCore::HTMLFrameElementBase::isURLAttribute):
+ * html/HTMLFrameElementBase.h:
+ (HTMLFrameElementBase):
+ * html/HTMLHtmlElement.cpp:
+ (WebCore::HTMLHtmlElement::isURLAttribute):
+ * html/HTMLHtmlElement.h:
+ * html/HTMLImageElement.cpp:
+ (WebCore::HTMLImageElement::isURLAttribute):
+ * html/HTMLImageElement.h:
+ * html/HTMLInputElement.cpp:
+ (WebCore::HTMLInputElement::isURLAttribute):
+ * html/HTMLInputElement.h:
+ * html/HTMLLinkElement.cpp:
+ (WebCore::HTMLLinkElement::isURLAttribute):
+ * html/HTMLLinkElement.h:
+ * html/HTMLMediaElement.cpp:
+ (WebCore::HTMLMediaElement::isURLAttribute):
+ * html/HTMLMediaElement.h:
+ * html/HTMLModElement.cpp:
+ (WebCore::HTMLModElement::isURLAttribute):
+ * html/HTMLModElement.h:
+ * html/HTMLObjectElement.cpp:
+ (WebCore::HTMLObjectElement::isURLAttribute):
+ * html/HTMLObjectElement.h:
+ * html/HTMLParamElement.cpp:
+ (WebCore::HTMLParamElement::isURLAttribute):
+ * html/HTMLParamElement.h:
+ * html/HTMLQuoteElement.cpp:
+ (WebCore::HTMLQuoteElement::isURLAttribute):
+ * html/HTMLQuoteElement.h:
+ * html/HTMLScriptElement.cpp:
+ (WebCore::HTMLScriptElement::isURLAttribute):
+ * html/HTMLScriptElement.h:
+ * html/HTMLSourceElement.cpp:
+ (WebCore::HTMLSourceElement::isURLAttribute):
+ * html/HTMLSourceElement.h:
+ * html/HTMLTableCellElement.cpp:
+ (WebCore::HTMLTableCellElement::isURLAttribute):
+ * html/HTMLTableCellElement.h:
+ * html/HTMLTableElement.cpp:
+ (WebCore::HTMLTableElement::isURLAttribute):
+ * html/HTMLTableElement.h:
+ * html/HTMLTrackElement.cpp:
+ (WebCore::HTMLTrackElement::isURLAttribute):
+ * html/HTMLTrackElement.h:
+ * html/HTMLVideoElement.cpp:
+ (WebCore::HTMLVideoElement::isURLAttribute):
+ * html/HTMLVideoElement.h:
+ * svg/SVGScriptElement.cpp:
+ (WebCore::SVGScriptElement::isURLAttribute):
+ * svg/SVGScriptElement.h:
+
+2012-05-08 Stephen Chenney <schenney@chromium.org>
+
+ Shrink ElementAttributeData by factoring out Attr object count.
+ https://bugs.webkit.org/show_bug.cgi?id=85825
+
+ Unreviewed build fix.
+
+ * dom/ElementAttributeData.cpp:
+ (WebCore::attrListForElement): Was returning false instead of 0 for a pointer value. Now returns 0.
+
+2012-05-08 Andreas Kling <kling@webkit.org>
+
+ Element: Merge idAttributeChanged() into attributeChanged().
+ <http://webkit.org/b/85885>
+
+ Reviewed by Antti Koivisto.
+
+ No new tests, code churn only.
+
+ * dom/Element.h:
+ * dom/Element.cpp:
+ (WebCore::Element::attributeChanged): There's no need for this to be a standalone function anymore.
+
+2012-05-08 Andreas Kling <kling@webkit.org>
+
+ Shrink ElementAttributeData by factoring out Attr object count.
+ <http://webkit.org/b/85825>
+
+ Reviewed by Antti Koivisto.
+
+ Stop tracking the number of Attr objects that point to a given Element on the
+ Element itself and manage this by having a global hashmap of Element => AttrList,
+ where AttrList is a vector of (pointers to) the associated Attr objects.
+
+ This shrinks ElementAttributeData by one integer, effectively reducing memory
+ consumption by ~530kB when viewing the full HTML5 spec at <http://whatwg.org/c>.
+
+ * dom/ElementAttributeData.h:
+ (ElementAttributeData):
+
+ Remove m_attrCount...
+
+ * dom/Node.h:
+ (WebCore::Node::hasAttrList):
+ (WebCore::Node::setHasAttrList):
+ (WebCore::Node::clearHasAttrList):
+
+ ...replacing it with a Node flag that tells us whether there's an Attr
+ object map for this Node (only applies to Elements.)
+
+ * dom/ElementAttributeData.cpp:
+ (WebCore::attrListMap):
+ (WebCore::attrListForElement):
+ (WebCore::ensureAttrListForElement):
+ (WebCore::removeAttrListForElement):
+ (WebCore::ElementAttributeData::attrIfExists):
+ (WebCore::ElementAttributeData::ensureAttr):
+ (WebCore::ElementAttributeData::setAttr):
+ (WebCore::ElementAttributeData::removeAttr):
+ (WebCore::ElementAttributeData::detachAttributesFromElement):
+
+ Map Element => per-Element AttrList in a global hash.
+
+2012-05-08 Chris Guan <chris.guan@torchmobile.com.cn>
+
+ [Blackberry] remove m_isRequestedByPlugin in ResourceRequest
+ https://bugs.webkit.org/show_bug.cgi?id=84559
+
+ Reviewed by Antonio Gomes.
+
+ ResourceRequest is a network level abstraction, and it should
+ not know anything about web concepts such as plug-ins, and Blackberry
+ does not need m_isRequestedByPlugin any longer, So clean up all related
+ code.
+
+ Tested on a website of http://edition.cnn.com, a new window should be
+ opened only when user has a singe tap gesture on a plugin element.
+
+ * platform/network/blackberry/ResourceRequest.h:
+ (WebCore::ResourceRequest::ResourceRequest):
+ (ResourceRequest):
+ (CrossThreadResourceRequestData):
+ * platform/network/blackberry/ResourceRequestBlackBerry.cpp:
+ (WebCore::ResourceRequest::doPlatformCopyData):
+ (WebCore::ResourceRequest::doPlatformAdopt):
+
+2012-05-03 Alexander Pavlov <apavlov@chromium.org>
+
+ Extra line-breaks added when copying from source.
+ https://bugs.webkit.org/show_bug.cgi?id=85282
+
+ Reviewed by Ryosuke Niwa.
+
+ The code used to replace any \n by \r\n, even the one that had a preceding \r, resulting in \r\r\n.
+ This change introduces a check for the preceding \r when replacing \n's.
+
+ Test: platform/win/editing/pasteboard/pasting-crlf-isnt-translated-to-crcrlf-win.html
+
+ * platform/chromium/ClipboardUtilitiesChromium.cpp:
+ (WebCore::replaceNewlinesWithWindowsStyleNewlines):
+ * platform/win/ClipboardUtilitiesWin.cpp:
+ (WebCore::replaceNewlinesWithWindowsStyleNewlines):
+
+2012-05-08 Adam Barth <abarth@webkit.org>
+
+ OS(ANDROID) JNI AttachCurrentThread take JNIEnv** as a parameter, not void**
+ https://bugs.webkit.org/show_bug.cgi?id=85869
+
+ Reviewed by Eric Seidel.
+
+ According to
+ http://docs.oracle.com/javase/1.5.0/docs/guide/jni/spec/invocation.html,
+ AttachCurrentThread takes a JNIEnv** rather than a void**. Apparently,
+ most implementations actually take a void**. The OS(ANDROID)
+ implementation, however, actually takes an JNIEnv**. This patch
+ introduces a typedef to give each implementation what it desires.
+
+ * bridge/jni/JNIUtility.cpp:
+ (JSC::Bindings::getJNIEnv):
+
+2012-05-08 Balazs Kelemen <kbalazs@webkit.org>
+
+ [Qt] X11 plugins need to be reworked for Qt5+WK1
+ https://bugs.webkit.org/show_bug.cgi?id=80691
+
+ Reviewed by Simon Hausmann.
+
+ Implement basic windowless plugin support with Qt5.
+ The solution is the same that has been chosen for
+ WebKit2. We get the content drawed by the plugin
+ from the X server as an image, create a QImage
+ from it and paint it to the window surface with QPainter.
+ Performance is sufficient for basic video playback.
+
+ No new tests, covered by existing plugin tests.
+
+ * Target.pri:
+ * WebCore.pri:
+ * platform/qt/QWebPageClient.h:
+ (QWebPageClient):
+ * plugins/PluginView.h:
+ (PluginView):
+ * plugins/qt/PluginPackageQt.cpp:
+ (WebCore::PluginPackage::isPluginBlacklisted):
+ Blacklist plugins that are incompatible with Qt5.
+ The only one I know about currently is skypebuttons
+ but the list can be extended in the future.
+ (WebCore):
+ (WebCore::PluginPackage::load):
+ * plugins/qt/PluginViewQt.cpp:
+ (X11Environment):
+ (WebCore):
+ (WebCore::x11Display):
+ (WebCore::x11Screen):
+ (WebCore::rootWindowID):
+ (WebCore::displayDepth):
+ (WebCore::syncX):
+ (WebCore::PluginView::platformPageClient): Added a safe
+ convenience getter for the QWebpageClient.
+ (WebCore::PluginView::updatePluginWidget):
+ (WebCore::PluginView::setFocus):
+ (WebCore::setupGraphicsExposeEvent):
+ (WebCore::PluginView::paintUsingXPixmap):
+ (WebCore::setSharedXEventFields):
+ (WebCore::PluginView::initXEvent):
+ (WebCore::PluginView::setXKeyEventSpecificFields):
+ (WebCore::setXButtonEventSpecificFields):
+ (WebCore::setXMotionEventSpecificFields):
+ (WebCore::setXCrossingEventSpecificFields):
+ (WebCore::PluginView::setNPWindowIfNeeded):
+ (WebCore::PluginView::setParentVisible):
+ (WebCore::PluginView::platformGetValue):
+ (WebCore::PluginView::invalidateRect):
+ (WebCore::getVisualAndColormap):
+ Refactored this function to make it more clear
+ what does it actually do.
+ (WebCore::PluginView::platformStart):
+ (WebCore::PluginView::platformDestroy):
+
+2012-05-07 Antti Koivisto <antti@apple.com>
+
+ Inline Node::traverseNextNode
+ https://bugs.webkit.org/show_bug.cgi?id=85844
+
+ Reviewed by Ryosuke Niwa.
+
+ Inline traverseNextNode and traverseNextSibling to reduce entry/exit overhead and allow better code generation
+ for many hot loops. Also added separate versions of stayWithin and unscoped cases (the function is
+ so simple that this seemed like the cleanest way to do it, the most reliable too) and used UNLIKELY for the
+ end-of-traversal conditions.
+
+ The traversal function can show up to ~1% in normal page loading profiles.
+
+ run-perf-tests seems to think this is a progression in some subtests though bots will tell for certain.
+
+ * WebCore.exp.in:
+ * dom/ContainerNode.h:
+
+ Following the existing pattern, function bodies go to ContainerNode.h so they can call parentNode().
+ (which returns ContainerNode, not Node).
+
+ (WebCore::Node::traverseNextNode):
+ (WebCore):
+ (WebCore::Node::traverseNextSibling):
+ * dom/Node.cpp:
+ (WebCore):
+ * dom/Node.h:
+ (Node):
+
+2012-05-05 Pavel Feldman <pfeldman@chromium.org>
+
+ Web Inspector: make JavaScriptSourceFrame use breakpoint manager's breakpoints store.
+ https://bugs.webkit.org/show_bug.cgi?id=85714
+
+ Reviewed by Yury Semikhatsky.
+
+ It is currently using its own copy of breakpoints which is not necessary.
+
+ * inspector/front-end/BreakpointManager.js:
+ (WebInspector.BreakpointManager):
+ (WebInspector.BreakpointManager.prototype.restoreBreakpoints):
+ (WebInspector.BreakpointManager.prototype.setBreakpoint):
+ (WebInspector.BreakpointManager.prototype._innerSetBreakpoint):
+ (WebInspector.BreakpointManager.prototype.findBreakpoint):
+ (WebInspector.BreakpointManager.prototype.reset):
+ (WebInspector.BreakpointManager.prototype._debuggerReset):
+ (WebInspector.BreakpointManager.prototype._breakpointResolved):
+ (WebInspector.BreakpointManager.prototype._uiLocationAdded):
+ (WebInspector.BreakpointManager.prototype._uiLocationRemoved):
+ (WebInspector.BreakpointManager.Breakpoint.prototype._breakpointStorageId):
+ (WebInspector.BreakpointManager.Storage.prototype._restoreBreakpoints):
+ (set WebInspector.BreakpointManager.Storage.Item):
+ * inspector/front-end/JavaScriptSource.js:
+ (WebInspector.JavaScriptSource.prototype.consoleMessagesCleared):
+ (WebInspector.JavaScriptSource.prototype.breakpointStorageId):
+ * inspector/front-end/JavaScriptSourceFrame.js:
+ (WebInspector.JavaScriptSourceFrame):
+ (WebInspector.JavaScriptSourceFrame.prototype._onContentChanged):
+ (WebInspector.JavaScriptSourceFrame.prototype.populateLineGutterContextMenu):
+ (WebInspector.JavaScriptSourceFrame.prototype.beforeTextChanged):
+ (WebInspector.JavaScriptSourceFrame.prototype._onMouseDown):
+ (WebInspector.JavaScriptSourceFrame.prototype._breakpointAdded):
+ (WebInspector.JavaScriptSourceFrame.prototype._breakpointRemoved):
+ (WebInspector.JavaScriptSourceFrame.prototype.onTextViewerContentLoaded):
+ (WebInspector.JavaScriptSourceFrame.prototype._continueToLine):
+ (WebInspector.JavaScriptSourceFrame.prototype._updateBreakpointsAfterLiveEdit):
+
+2012-05-07 Pavel Feldman <pfeldman@chromium.org>
+
+ Web Inspector: do not create locations for resolved provisional breakpoints
+ https://bugs.webkit.org/show_bug.cgi?id=85716
+
+ Reviewed by Yury Semikhatsky.
+
+ Marked provisional breakpoints as such.
+
+ * inspector/front-end/BreakpointManager.js:
+ (WebInspector.BreakpointManager.prototype._debuggerReset):
+ (WebInspector.BreakpointManager.prototype._breakpointResolved):
+
+2012-05-07 Simon Fraser <simon.fraser@apple.com>
+
+ Compositing layers with transformed children not large enough to show contents
+ https://bugs.webkit.org/show_bug.cgi?id=85855
+
+ Reviewed by Dan Bernstein.
+
+ r114518 added a code path to RenderLayer::calculateLayerBounds() which
+ does an early return if the layer has clipping. However, this code
+ path omitted to take local transforms into account.
+
+ Fix is to handle transforms as we do in the non-clipped case.
+
+ Test: compositing/geometry/bounds-clipped-composited-child.html
+
+ * rendering/RenderLayer.cpp:
+ (WebCore::RenderLayer::calculateLayerBounds):
+
+2012-05-07 Scott Graham <scottmg@chromium.org>
+
+ Fix signed/unsigned mismatch
+ https://bugs.webkit.org/show_bug.cgi?id=85845
+
+ Make literal in assert be unsigned to match comparison on LHS. Avoids
+ warning on Windows.
+
+ Reviewed by Eric Seidel.
+
+ No new tests. No intended functionality change.
+
+ * rendering/RenderTableSection.cpp:
+ (WebCore::RenderTableSection::splitColumn):
+
+2012-05-07 Emil A Eklund <eae@chromium.org>
+
+ Fix performance regression for floats caused by LayoutUnit change
+ https://bugs.webkit.org/show_bug.cgi?id=85834
+
+ Reviewed by Eric Seidel.
+
+ Fix performance regression caused by r116009 by disabling the use of
+ 64bit math in FractionalLayoutUnit, simplifying the pixelSnappedMaxX/Y
+ math, inlining a couple of methods and replacing the literal 0 (zero)
+ with ZERO_LAYOUT_UNIT.
+
+ No new tests, no change in functionality.
+
+ * platform/FractionalLayoutUnit.h:
+ (WebCore::boundedMultiply):
+ (WebCore::operator*):
+ (WebCore::operator/):
+ Disable the use of 64bit (long long) math in the case where the fraction
+ is set to 1.
+
+ * platform/graphics/FractionalLayoutRect.h:
+ (WebCore::FractionalLayoutRect::pixelSnappedMaxX):
+ (WebCore::FractionalLayoutRect::pixelSnappedMaxY):
+ Simplify the pixel snapping logic for maxX/maxY.
+
+ * rendering/RenderBlock.cpp:
+ (WebCore::RenderBlock::isSelfCollapsingBlock):
+ (WebCore::RenderBlock::layoutBlock):
+ (WebCore::RenderBlock::computeOverflow):
+ (WebCore::RenderBlock::clearFloatsIfNeeded):
+ (WebCore::RenderBlock::paintChildren):
+ (WebCore::RenderBlock::blockSelectionGap):
+ (WebCore::RenderBlock::logicalLeftSelectionGap):
+ (WebCore::RenderBlock::logicalRightSelectionGap):
+ (WebCore::RenderBlock::computeLogicalLocationForFloat):
+ (WebCore::RenderBlock::lowestFloatLogicalBottom):
+ (WebCore::RenderBlock::getClearDelta):
+ (WebCore::RenderBlock::computeBlockPreferredLogicalWidths):
+ (WebCore::RenderBlock::addFocusRingRects):
+ (WebCore::RenderBlock::adjustLinePositionForPagination):
+ * rendering/RenderBlock.h:
+ (WebCore::RenderBlock::availableLogicalWidthForLine):
+ (WebCore::RenderBlock::availableLogicalWidthForContent):
+ (WebCore::RenderBlock::FloatingObject::x):
+ (WebCore::RenderBlock::FloatingObject::maxX):
+ (WebCore::RenderBlock::FloatingObject::y):
+ (WebCore::RenderBlock::FloatingObject::maxY):
+ (WebCore::RenderBlock::FloatingObject::width):
+ (WebCore::RenderBlock::FloatingObject::height):
+ (FloatingObject):
+ (WebCore::RenderBlock::FloatingObject::pixelSnappedX):
+ (WebCore::RenderBlock::FloatingObject::pixelSnappedMaxX):
+ (WebCore::RenderBlock::FloatingObject::pixelSnappedY):
+ (WebCore::RenderBlock::FloatingObject::pixelSnappedMaxY):
+ (WebCore::RenderBlock::FloatingObject::pixelSnappedWidth):
+ (WebCore::RenderBlock::FloatingObject::pixelSnappedHeight):
+ (WebCore::RenderBlock::RenderBlockRareData::positiveMarginBeforeDefault):
+ (WebCore::RenderBlock::RenderBlockRareData::negativeMarginBeforeDefault):
+ (WebCore::RenderBlock::RenderBlockRareData::positiveMarginAfterDefault):
+ (WebCore::RenderBlock::RenderBlockRareData::negativeMarginAfterDefault):
+ * rendering/RenderBoxModelObject.cpp:
+ (WebCore::accumulateRelativePositionOffsets):
+ (WebCore::RenderBoxModelObject::offsetLeft):
+ (WebCore::RenderBoxModelObject::offsetTop):
+ (WebCore::RenderBoxModelObject::computedCSSPaddingTop):
+ (WebCore::RenderBoxModelObject::computedCSSPaddingBottom):
+ (WebCore::RenderBoxModelObject::computedCSSPaddingLeft):
+ (WebCore::RenderBoxModelObject::computedCSSPaddingRight):
+ (WebCore::RenderBoxModelObject::computedCSSPaddingBefore):
+ (WebCore::RenderBoxModelObject::computedCSSPaddingAfter):
+ (WebCore::RenderBoxModelObject::computedCSSPaddingStart):
+ (WebCore::RenderBoxModelObject::computedCSSPaddingEnd):
+
+2012-05-07 Dongwoo Im <dw.im@samsung.com>
+
+ width/height attributes of input element cannot be accessed by JavaScript.
+ https://bugs.webkit.org/show_bug.cgi?id=70304
+
+ Reviewed by Darin Adler.
+
+ If the type of input element is image button, width/height attributes should be supported.
+ These attributes are defined in HTML5 spec.
+ http://www.w3.org/TR/html5/the-map-element.html#attr-dim-width
+
+ Tests: fast/forms/input-width-height-attributes-without-renderer-loaded-image.html
+ fast/forms/input-width-height-attributes-without-renderer-not-loaded-image.html
+ fast/forms/input-width-height-attributes-without-renderer.html
+ fast/forms/input-width-height-attributes.html
+
+ * html/HTMLInputElement.cpp: Add setter/getter functions to query/set width/height of input element.
+ (WebCore):
+ (WebCore::HTMLInputElement::height): Gets height of input element.
+ (WebCore::HTMLInputElement::width): Gets width of input element.
+ (WebCore::HTMLInputElement::setHeight): Sets height of input element.
+ (WebCore::HTMLInputElement::setWidth): Sets width of input element.
+ * html/HTMLInputElement.h: Add public prototype.
+ (HTMLInputElement):
+ * html/HTMLInputElement.idl: Add width/height attributes.
+ * html/ImageInputType.cpp: Add getter functions if the element is an image button.
+ (WebCore):
+ (WebCore::ImageInputType::height): Gets height of input element.
+ (WebCore::ImageInputType::width): Gets width of input element.
+ * html/ImageInputType.h: Add prototype.
+ (ImageInputType):
+ * html/InputType.cpp: Add getter functions.
+ (WebCore::InputType::height): Returns zero.
+ (WebCore):
+ (WebCore::InputType::width): Returns zero.
+ * html/InputType.h: Add prototype.
+ (InputType):
+
+2012-05-07 Kinuko Yasuda <kinuko@chromium.org>
+
+ Support cross-filesystem operations in FileSystem API
+ https://bugs.webkit.org/show_bug.cgi?id=84135
+
+ Reviewed by David Levin.
+
+ Currently we pass Entry's fullPath to AsyncFileSystem layer where
+ we convert the given path to filesystem URL which includes origin and
+ filesystem type information, but in that way we cannot handle
+ cross-filesystem operations (e.g. cross-filesystem copy and move)
+ well since we end up with always attaching the source filesystem's
+ origin and type information for argument paths.
+
+ This patch does:
+ - change AsyncFileSystem's operation methods not to take entry paths
+ but complete filesystem URLs.
+ - move type and rootURL information from AsyncFileSystem instance into
+ DOMFileSystemBase instance (platform layer to Modules/filesystem layer)
+ - move filesystem-type related code in AsyncFileSystemChromium.cpp into
+ DOMFileSystemChromium.cpp, which implements chromioum-specific
+ DOMFileSystem code.
+ - move platform/FileSystemType.h into Modules/filesystem/FileSystemType.h.
+ - adding FileSystemType.h entry to build files (e.g. WebCore.gypi, WebCore.xcodeproj etc)
+
+ Test: fast/filesystem/cross-filesystem-op.html
+
+ * Modules/filesystem/DOMFileSystem.cpp:
+ (WebCore::DOMFileSystem::create):
+ (WebCore::DOMFileSystem::DOMFileSystem):
+ (WebCore::DOMFileSystem::createWriter):
+ (WebCore::DOMFileSystem::createFile):
+ * Modules/filesystem/DOMFileSystem.h:
+ * Modules/filesystem/DOMFileSystemBase.cpp:
+ (WebCore::DOMFileSystemBase::DOMFileSystemBase):
+ (WebCore::DOMFileSystemBase::createFileSystemURL): Added as an internal
+ implementation of Entry.toURL().
+ (WebCore::DOMFileSystemBase::getMetadata):
+ (WebCore::verifyAndGetDestinationPathForCopyOrMove):
+ (WebCore::DOMFileSystemBase::move):
+ (WebCore::DOMFileSystemBase::copy):
+ (WebCore::DOMFileSystemBase::remove):
+ (WebCore::DOMFileSystemBase::removeRecursively):
+ (WebCore::DOMFileSystemBase::getParent):
+ (WebCore::DOMFileSystemBase::getFile):
+ (WebCore::DOMFileSystemBase::getDirectory):
+ (WebCore::DOMFileSystemBase::readDirectory):
+ * Modules/filesystem/DOMFileSystemBase.h: Changed to make each
+ DOMFileSystemBase instance have filesystem type and rootURL (they were
+ held by AsyncFileSystem previously)
+ (WebCore::DOMFileSystemBase::create): Changed to take additional parameters.
+ (WebCore::DOMFileSystemBase::type): Added.(Moved from AsyncFileSystem::type)
+ (WebCore::DOMFileSystemBase::rootURL): Added.(Moved from AsyncFileSystem::rootURL).
+ * Modules/filesystem/DOMFileSystemSync.cpp:
+ (WebCore::DOMFileSystemSync::create):
+ (WebCore::DOMFileSystemSync::DOMFileSystemSync):
+ (WebCore::DOMFileSystemSync::createFile):
+ (WebCore::DOMFileSystemSync::createWriter):
+ * Modules/filesystem/DOMFileSystemSync.h:
+ (WebCore::DOMFileSystemSync::create):
+ * Modules/filesystem/DOMWindowFileSystem.cpp:
+ (WebCore::DOMWindowFileSystem::webkitRequestFileSystem):
+ (WebCore::DOMWindowFileSystem::webkitResolveLocalFileSystemURL):
+ * Modules/filesystem/EntryBase.cpp:
+ (WebCore::EntryBase::toURL):
+ * Modules/filesystem/FileSystemCallbacks.cpp:
+ (WebCore::FileSystemCallbacks::create):
+ (WebCore::FileSystemCallbacks::FileSystemCallbacks):
+ (WebCore::FileSystemCallbacks::didOpenFileSystem):
+ (WebCore::ResolveURICallbacks::create):
+ (WebCore::ResolveURICallbacks::ResolveURICallbacks):
+ (WebCore::ResolveURICallbacks::didOpenFileSystem):
+ * Modules/filesystem/FileSystemCallbacks.h:
+ (FileSystemCallbacks):
+ (ResolveURICallbacks):
+ * Modules/filesystem/FileSystemType.h: Renamed from Source/WebCore/platform/FileSystemType.h.
+ * Modules/filesystem/LocalFileSystem.cpp:
+ (WebCore::openFileSystem):
+ (WebCore::LocalFileSystem::readFileSystem):
+ (WebCore::LocalFileSystem::requestFileSystem):
+ * Modules/filesystem/LocalFileSystem.h:
+ * Modules/filesystem/WorkerContextFileSystem.cpp:
+ (WebCore::WorkerContextFileSystem::webkitRequestFileSystem):
+ (WebCore::WorkerContextFileSystem::webkitRequestFileSystemSync):
+ (WebCore::WorkerContextFileSystem::webkitResolveLocalFileSystemURL):
+ (WebCore::WorkerContextFileSystem::webkitResolveLocalFileSystemSyncURL):
+ * Modules/filesystem/chromium/DOMFileSystemChromium.cpp: Added for chromium-specific
+ implementation. Almost all of the code is moved from AsyncFileSystemChromium.
+ (WebCore::DOMFileSystemBase::isValidType):
+ (WebCore::DOMFileSystemBase::crackFileSystemURL):
+ (WebCore::DOMFileSystemBase::supportsToURL):
+ (WebCore::DOMFileSystemBase::createFileSystemURL):
+ (WebCore::DOMFileSystemChromium::createIsolatedFileSystem):
+ * Modules/filesystem/chromium/DOMFileSystemChromium.h: Added.
+ * Modules/filesystem/chromium/DataTransferItemFileSystemChromium.cpp:
+ (WebCore::DataTransferItemFileSystem::webkitGetAsEntry):
+ * Modules/filesystem/chromium/DraggedIsolatedFileSystem.cpp:
+ (WebCore::DraggedIsolatedFileSystem::getDOMFileSystem):
+ * WebCore.gypi:
+ * platform/AsyncFileSystem.cpp:
+ (WebCore::AsyncFileSystem::openFileSystem):
+ * platform/AsyncFileSystem.h:
+ (AsyncFileSystem):
+ (WebCore::AsyncFileSystem::AsyncFileSystem):
+ * platform/AsyncFileSystemCallbacks.h:
+ (WebCore::AsyncFileSystemCallbacks::didOpenFileSystem):
+ * platform/blackberry/AsyncFileSystemBlackBerry.cpp:
+ (WebCore::AsyncFileSystem::create):
+ (WebCore::AsyncFileSystem::openFileSystem):
+ (WebCore::AsyncFileSystemBlackBerry::AsyncFileSystemBlackBerry):
+ (WebCore::AsyncFileSystemBlackBerry::move):
+ (WebCore::AsyncFileSystemBlackBerry::copy):
+ (WebCore::AsyncFileSystemBlackBerry::remove):
+ (WebCore::AsyncFileSystemBlackBerry::removeRecursively):
+ (WebCore::AsyncFileSystemBlackBerry::readMetadata):
+ (WebCore::AsyncFileSystemBlackBerry::createFile):
+ (WebCore::AsyncFileSystemBlackBerry::createDirectory):
+ (WebCore::AsyncFileSystemBlackBerry::fileExists):
+ (WebCore::AsyncFileSystemBlackBerry::directoryExists):
+ (WebCore::AsyncFileSystemBlackBerry::readDirectory):
+ (WebCore::AsyncFileSystemBlackBerry::createWriter):
+ (WebCore::AsyncFileSystemBlackBerry::createSnapshotFileAndReadMetadata):
+ * platform/blackberry/AsyncFileSystemBlackBerry.h:
+ * platform/chromium/PlatformSupport.h:
+ * platform/gtk/AsyncFileSystemGtk.cpp:
+ (WebCore::AsyncFileSystem::create):
+ (WebCore::AsyncFileSystem::openFileSystem):
+ (WebCore::AsyncFileSystemGtk::AsyncFileSystemGtk):
+ (WebCore::AsyncFileSystemGtk::move):
+ (WebCore::AsyncFileSystemGtk::copy):
+ (WebCore::AsyncFileSystemGtk::remove):
+ (WebCore::AsyncFileSystemGtk::removeRecursively):
+ (WebCore::AsyncFileSystemGtk::readMetadata):
+ (WebCore::AsyncFileSystemGtk::createFile):
+ (WebCore::AsyncFileSystemGtk::createDirectory):
+ (WebCore::AsyncFileSystemGtk::fileExists):
+ (WebCore::AsyncFileSystemGtk::directoryExists):
+ (WebCore::AsyncFileSystemGtk::readDirectory):
+ (WebCore::AsyncFileSystemGtk::createWriter):
+ * platform/gtk/AsyncFileSystemGtk.h:
+
+ * GNUmakefile.list.am: Added FileSystemType.h.
+ * WebCore.gypi: Added FileSystemType.h.
+ * WebCore.vcproj/WebCore.vcproj: Added FileSystemType.h.
+ * WebCore.xcodeproj/project.pbxproj: Added FileSystemType.h.
+
+2012-05-07 Adam Barth <abarth@webkit.org>
+
+ [Chromium] Android wishes to use an empty implementation if AXObjectCache
+ https://bugs.webkit.org/show_bug.cgi?id=85842
+
+ Reviewed by Eric Seidel.
+
+ Add proper HAVE(ACCESSIBILITY) ifdefs so that Chromium builds without
+ accessibility.
+
+ * accessibility/chromium/AXObjectCacheChromium.cpp:
+ * accessibility/chromium/AccessibilityObjectChromium.cpp:
+
+2012-05-07 Greg Billock <gbillock@google.com>
+
+ [Web Intents] Flagged-off implementation of an intent tag for registration.
+ https://bugs.webkit.org/show_bug.cgi?id=73039
+
+ Reviewed by Adam Barth.
+
+ The intent tag is a declarative way for pages to register that they
+ accept delivery of web intent invocations of particular types. See the
+ spec at http://dvcs.w3.org/hg/web-intents/raw-file/tip/spec/Overview.html
+
+ After discussion on the WhatWG list (see thread at
+ http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2012-April/035301.html)
+ the current plan is to combine declarative registration of Web
+ Intents and protocol/content handlers with this tag. Alternatives
+ considered were the meta and link tags.
+
+ * WebCore.gypi:
+ * html/HTMLAttributeNames.in:
+ * html/HTMLElementsAllInOne.cpp:
+ * html/HTMLIntentElement.cpp: Added.
+ (WebCore::HTMLIntentElement::HTMLIntentElement):
+ (WebCore::HTMLIntentElement::create):
+ (WebCore::HTMLIntentElement::insertedIntoDocument):
+ * html/HTMLIntentElement.h: Added.
+ * html/HTMLIntentElement.idl: Added.
+ * html/HTMLTagNames.in:
+ * loader/FrameLoaderClient.h:
+ (WebCore::FrameLoaderClient::registerIntentService):
+ * page/DOMWindow.idl:
+
+2012-05-07 Dana Jansens <danakj@chromium.org>
+
+ Region::intersects() and Region::contains() are slow due to copy overhead
+ https://bugs.webkit.org/show_bug.cgi?id=81076
+
+ Reviewed by Anders Carlsson.
+
+ Testing contains() and intersects() requires a copy which ends up
+ invoking a malloc on sufficiently complicated web pages, and slows down
+ the test unnecessarily. These methods can be done by iterating over the
+ Region::Shape values rather than making a copy of the entire region and
+ manipulating it.
+
+ This uses Region::Shape::compareShapes() to walk the query regions and
+ compute the result of the intersects or contains tests without making a
+ copy.
+
+ This change improves the performance of the Region overlap testing for
+ composited layers, and allows for testing contains() before unite() to
+ avoid unnecessary copies of the Region when inserting into complex
+ Regions. With a layout test that has 225 composited layers, and tests
+ Region.intersects() for 1000 layers above them, this change decreases
+ the running time of the test by 1.2% by avoiding a copy of the 225
+ rects each time.
+
+ Unit test: RegionTest.intersectsRegion
+ RegionTest.containsRegion
+
+ * platform/graphics/Region.cpp:
+ (WebCore::Region::contains):
+ (WebCore::Region::intersects):
+ (WebCore):
+ (WebCore::Region::Shape::compareShapes):
+ (Region::Shape::CompareContainsOperation):
+ (WebCore::Region::Shape::CompareContainsOperation::aOutsideB):
+ (WebCore::Region::Shape::CompareContainsOperation::bOutsideA):
+ (WebCore::Region::Shape::CompareContainsOperation::aOverlapsB):
+ (Region::Shape::CompareIntersectsOperation):
+ (WebCore::Region::Shape::CompareIntersectsOperation::aOutsideB):
+ (WebCore::Region::Shape::CompareIntersectsOperation::bOutsideA):
+ (WebCore::Region::Shape::CompareIntersectsOperation::aOverlapsB):
+ * platform/graphics/Region.h:
+ (Shape):
+
+2012-05-07 David Tseng <dtseng@google.com>
+
+ Correct logical error in accessibilityIsIgnored.
+ https://bugs.webkit.org/show_bug.cgi?id=85828
+
+ Reviewed by Chris Fleizach.
+
+ Covered by existing tests.
+
+ * accessibility/AccessibilityMenuListOption.cpp:
+ (WebCore::AccessibilityMenuListOption::accessibilityIsIgnored):
+ * accessibility/AccessibilityMenuListPopup.cpp:
+ (WebCore::AccessibilityMenuListPopup::accessibilityIsIgnored):
+
+2012-05-04 Zhenyao Mo <zmo@google.com>
+
+ vertexAttribPointer needs to reject large negative offsets
+ https://bugs.webkit.org/show_bug.cgi?id=85117
+
+ Reviewed by Kenneth Russell.
+
+ * html/canvas/WebGLRenderingContext.cpp: Use long long for GLsizeiptr and GLintptr
+ (WebCore):
+ (WebCore::WebGLRenderingContext::bufferData):
+ (WebCore::WebGLRenderingContext::bufferSubData):
+ (WebCore::WebGLRenderingContext::drawElements):
+ (WebCore::WebGLRenderingContext::getVertexAttribOffset):
+ (WebCore::WebGLRenderingContext::vertexAttribPointer):
+ * html/canvas/WebGLRenderingContext.h: Ditto
+ (WebGLRenderingContext):
+ * html/canvas/WebGLRenderingContext.idl: Ditto
+
+2012-05-07 Pravin D <pravind.2k4@gmail.com>
+
+ :first-line text-decorations are not rendered
+ https://bugs.webkit.org/show_bug.cgi?id=6047
+
+ Text-decorations are applied during paint phase. The style was not being properly selected in case of
+ first line box. The patch fixes this.
+
+ Reviewed by Eric Seidel.
+
+ Tests: fast/css/first-line-text-decoration-inherited-from-parent.html
+ fast/css/first-line-text-decoration.html
+
+ * rendering/InlineTextBox.cpp:
+ (WebCore::InlineTextBox::paintDecoration):
+ Inform the decoration color retriever if this box is part of the first line box or not.
+
+ * rendering/RenderObject.cpp:
+ (WebCore::decorationColor):
+ Changed the argument from RenderObject* to RenderStyle*. As this function is just a helper to getTextDecorationColors
+ as used RenderObject solely to retrieve the corresponding RenderStyle, which(RenderStyle*) was already available with the latter function.
+
+ (WebCore::RenderObject::getTextDecorationColors):
+ Take a new variable to check if first line style or the regular style has to be used.
+ Sends RenderStyle* as an argument to decorationColor().
+
+ * rendering/RenderObject.h:
+ (RenderObject):
+
+2012-05-07 Julien Chaffraix <jchaffraix@webkit.org>
+
+ Refactor windowClipRectForLayer to remove the explicit RenderLayer dependency
+ https://bugs.webkit.org/show_bug.cgi?id=84090
+
+ Reviewed by David Hyatt.
+
+ No observable change in behavior.
+
+ The function name was ambiguous as it was not a general purpose function but was
+ working directly on HTMLFrameOwnerElement. The rename makes this more obvious as
+ well as removes the explicit dependency on RenderLayer.
+
+ One of the slight change of this refactoring is that we now always null-check the
+ HTMLFrameOwnerElement's renderer as part windowClipRectForFrameOwner as I don't see
+ any evidence for the other code paths not to hit that. Also we may recur more on our
+ frame tree if we have no layer as we now call windowClipRect() in this case.
+
+ * page/FrameView.h:
+ (FrameView):
+ * plugins/PluginView.cpp:
+ (WebCore::PluginView::windowClipRect):
+ * WebCore.exp.in:
+ * WebCore.order:
+ * page/FrameView.cpp:
+ (WebCore::FrameView::windowClipRect):
+ Updated after windowClipRectForLayer name and signature change.
+
+ (WebCore::FrameView::windowClipRectForFrameOwner):
+ This function now takes the HTMLFrameOwnerElement directly.
+
+ * plugins/PluginView.cpp:
+ (WebCore::PluginView::PluginView):
+ (WebCore::PluginView::create):
+ * plugins/PluginView.h:
+ (PluginView):
+ Updated |m_element| to be an HTMLPlugInElement as this was what was
+ passed by every caller. This makes the conversion to HTMLFrameOwnerElement
+ possible.
+
+2012-05-07 Enrica Casucci <enrica@apple.com>
+
+ REGRESSION (r101575): Chinese input is broken when composing mail in iCloud using Safari.
+ https://bugs.webkit.org/show_bug.cgi?id=85840
+ <rdar://problem/11115520>
+
+ Reviewed by Alexey Proskuryakov.
+
+ The revision that broke this, introduced a way to sanitize the markup when deleting a range selection.
+ iCloud listens for DOM modification events and clears the selection, altering the input method state.
+ The fix consists in adding a paramenter to DeleteSelectionCommand to control when we sanitize the
+ markup.
+
+ * editing/CompositeEditCommand.cpp:
+ (WebCore::CompositeEditCommand::deleteSelection):
+ * editing/CompositeEditCommand.h:
+ * editing/DeleteSelectionCommand.cpp:
+ (WebCore::DeleteSelectionCommand::DeleteSelectionCommand):
+ (WebCore::DeleteSelectionCommand::doApply):
+ * editing/DeleteSelectionCommand.h:
+ (WebCore::DeleteSelectionCommand::create):
+ * editing/InsertTextCommand.cpp:
+ (WebCore::InsertTextCommand::doApply):
+
+2012-05-07 Andy Estes <aestes@apple.com>
+
+ ENABLE_IFRAME_SEAMLESS should be part of FEATURE_DEFINES.
+
+ * Configurations/FeatureDefines.xcconfig:
+
+2012-05-06 Martin Robinson <mrobinson@igalia.com>
+
+ [Cairo] Implement ImageBuffer::copyImage for BackingStoreCopy == DontCopyBackingStore
+ https://bugs.webkit.org/show_bug.cgi?id=85728
+
+ Reviewed by Alejandro G. Castro.
+
+ No new tests. This should not change functionality, only increase performance.
+
+ * platform/graphics/cairo/ImageBufferCairo.cpp:
+ (WebCore::ImageBuffer::copyImage): Add an implementation that knows how to avoid copying the backing store.
+ (WebCore::ImageBuffer::draw): Use the copyImage constructor now that it knows how to
+ avoid copying the backing store.
+ (WebCore::ImageBuffer::drawPattern): Ditto.
+ * platform/graphics/texmap/TextureMapperLayer.cpp:
+ (WebCore::TextureMapperLayer::updateBackingStore): Use DontCopyBackingStore for Cairo
+ as well.
+
+2012-05-07 Noel Gordon <noel.gordon@gmail.com>
+
+ [CG] Separate image encoding from dataURL construction
+ https://bugs.webkit.org/show_bug.cgi?id=85782
+
+ Reviewed by Kenneth Russell.
+
+ Remove the implicit assumption that a dataURL is the only desired output format
+ of the image encoding phase.
+
+ No new tests. No behavioral change. Covered by canvas 2d and 3d tests:
+ canvas/philip/tests/*toDataURL*.html
+ fast/canvas/webgl/premultiplyalpha-test.html
+
+ * platform/graphics/cg/ImageBufferCG.cpp:
+ (WebCore::CGImageEncodeToData): Image encoding helper: encode the image using the
+ uti-defined encoder (PNG/JPEG/etc) and output to the given CFMutableDataRef data.
+ (WebCore):
+ (WebCore::CGImageToDataURL): Refactor to use CGImageEncodeToData().
+
+2012-05-07 Scott Graham <scottmg@chromium.org>
+
+ [Chromium] Suppress switch-without-cases warning
+ https://bugs.webkit.org/show_bug.cgi?id=85830
+
+ Warnings like
+ ...\webkit\CSSGrammar.cpp(2075) : warning C4065: switch statement contains 'default' but no 'case' labels
+ are generated. These are bogus, so just suppress them in the build
+ settings.
+
+ Reviewed by Dirk Pranke
+
+ No new tests, no intended functionlity change. Just changing compiler
+ settings.
+
+ * WebCore.gyp/WebCore.gyp:
+
+2012-05-07 Adrienne Walker <enne@google.com>
+
+ [chromium] Allow for asymmetric tile sizes on composited tiled layers
+ https://bugs.webkit.org/show_bug.cgi?id=85687
+
+ Reviewed by James Robinson.
+
+ Update TiledLayerChromium/CCLayerTilingData/TilingData to allow for a
+ the width and height of tile sizes to differ. Modify TilingData to use
+ IntSize everywhere for these width/height pairs.
+
+ Also, remove some unused functions from TilingData.
+
+ Test: TilingDataTest.*
+
+ * platform/graphics/chromium/TiledLayerChromium.cpp:
+ (WebCore::TiledLayerChromium::TiledLayerChromium):
+ (WebCore::TiledLayerChromium::updateTileSizeAndTilingOption):
+ * platform/graphics/chromium/cc/CCLayerTilingData.cpp:
+ (WebCore::CCLayerTilingData::CCLayerTilingData):
+ (WebCore::CCLayerTilingData::setTileSize):
+ (WebCore):
+ (WebCore::CCLayerTilingData::tileSize):
+ (WebCore::CCLayerTilingData::operator=):
+ (WebCore::CCLayerTilingData::tileRect):
+ (WebCore::CCLayerTilingData::setBounds):
+ (WebCore::CCLayerTilingData::bounds):
+ * platform/graphics/chromium/cc/CCLayerTilingData.h:
+ (CCLayerTilingData):
+ * platform/graphics/gpu/Texture.cpp:
+ (WebCore::Texture::Texture):
+ (WebCore::Texture::create):
+ (WebCore::Texture::load):
+ (WebCore::Texture::updateSubRect):
+ * platform/graphics/gpu/TilingData.cpp:
+ (WebCore::TilingData::TilingData):
+ (WebCore::TilingData::setTotalSize):
+ (WebCore::TilingData::setMaxTextureSize):
+ (WebCore::TilingData::tileXIndexFromSrcCoord):
+ (WebCore::TilingData::tileYIndexFromSrcCoord):
+ (WebCore::TilingData::tileBounds):
+ (WebCore::TilingData::tileSizeX):
+ (WebCore::TilingData::tileSizeY):
+ (WebCore::TilingData::recomputeNumTiles):
+ * platform/graphics/gpu/TilingData.h:
+ (TilingData):
+ (WebCore::TilingData::totalSize):
+ (WebCore::TilingData::maxTextureSize):
+ (WebCore::TilingData::TilingData):
+
+2012-05-07 Raymond Toy <rtoy@google.com>
+
+ ConvolverNode setBuffer() should not ASSERT on null buffer
+ https://bugs.webkit.org/show_bug.cgi?id=85653
+
+ Reviewed by Chris Rogers.
+
+ Test: webaudio/convolver-setBuffer-null.html
+
+ * Modules/webaudio/ConvolverNode.cpp:
+ (WebCore::ConvolverNode::setBuffer): Don't ASSERT on null buffer.
+
+2012-05-07 Ken Buchanan <kenrb@chromium.org>
+
+ Crash due to positioned object list not being cleared during block flow split
+ https://bugs.webkit.org/show_bug.cgi?id=85074
+
+ Reviewed by Abhishek Arya.
+
+ When an element is being split due to a column span element being
+ inserted, any of its ancestors that are underneath the column
+ containing block also get split. If an ancestor has an object in
+ its positioned object list from a previous layout, then the list
+ will have to be cleared because the positioned object could have moved
+ to be under the continuation. This patch causes the list to be
+ cleared.
+
+ * rendering/RenderBlock.cpp:
+ (WebCore::RenderBlock::splitBlocks):
+
+2012-05-07 Eric Seidel <eric@webkit.org>
+
+ Add ENABLE_IFRAME_SEAMLESS so Apple can turn off SEAMLESS if needed
+ https://bugs.webkit.org/show_bug.cgi?id=85822
+
+ Reviewed by Adam Barth.
+
+ * Configurations/FeatureDefines.xcconfig:
+ * dom/Document.cpp:
+ (WebCore::Document::shouldDisplaySeamlesslyWithParent):
+
+2012-05-07 Shezan Baig <shezbaig.wk@gmail.com>
+
+ Selection Background Color Error
+ https://bugs.webkit.org/show_bug.cgi?id=80382
+
+ Reviewed by David Hyatt.
+
+ Determine the text colors and selection colors before painting the
+ background behind the text. This is because when determining whether
+ to invert the selection background, the selection text color should be
+ used instead of the regular text color. With this patch, the selection
+ text color is passed to 'paintSelection' so that the selection
+ background can be compared against it, instead of comparing against the
+ CSSPropertyColor value.
+
+ Test: fast/backgrounds/selection-background-color.html
+
+ * rendering/InlineTextBox.cpp:
+ (WebCore::InlineTextBox::paint):
+ Pass selection text color to paintSelection
+
+ (WebCore::InlineTextBox::paintSelection):
+ Use the selection text color instead of CSSPropertyColor
+
+ * rendering/InlineTextBox.h:
+ (InlineTextBox):
+ Adjust signature of paintSelection to accept text color
+
+2012-05-07 David Reveman <reveman@chromium.org>
+
+ [Chromium] Use GL_CHROMIUM_command_buffer_query to throttle texture uploads.
+ https://bugs.webkit.org/show_bug.cgi?id=81004
+
+ Reviewed by Adrienne Walker.
+
+ Add ThrottledTextureUploader class that uses GL_CHROMIUM_command_buffer_query
+ to throttle texture uploads based on number of currently pending queries.
+
+ Unit test: ThrottledTextureUploaderTest.IsBusy
+
+ * WebCore.gypi:
+ * platform/graphics/chromium/LayerRendererChromium.cpp:
+ (WebCore::LayerRendererChromium::create):
+ (WebCore::LayerRendererChromium::LayerRendererChromium):
+ (WebCore::LayerRendererChromium::initializeSharedObjects):
+ * platform/graphics/chromium/LayerRendererChromium.h:
+ (LayerRendererChromium):
+ * platform/graphics/chromium/TextureUploader.cpp: Removed.
+ * platform/graphics/chromium/TextureUploader.h:
+ (TextureUploader):
+ * platform/graphics/chromium/ThrottledTextureUploader.cpp: Added.
+ (WebCore):
+ (WebCore::ThrottledTextureUploader::Query::Query):
+ (WebCore::ThrottledTextureUploader::Query::~Query):
+ (WebCore::ThrottledTextureUploader::Query::begin):
+ (WebCore::ThrottledTextureUploader::Query::end):
+ (WebCore::ThrottledTextureUploader::Query::isPending):
+ (WebCore::ThrottledTextureUploader::Query::wait):
+ (WebCore::ThrottledTextureUploader::ThrottledTextureUploader):
+ (WebCore::ThrottledTextureUploader::~ThrottledTextureUploader):
+ (WebCore::ThrottledTextureUploader::isBusy):
+ (WebCore::ThrottledTextureUploader::beginUploads):
+ (WebCore::ThrottledTextureUploader::endUploads):
+ (WebCore::ThrottledTextureUploader::uploadTexture):
+ (WebCore::ThrottledTextureUploader::processQueries):
+ * platform/graphics/chromium/ThrottledTextureUploader.h: Copied from Source/WebCore/platform/graphics/chromium/TextureUploader.h.
+ (WebCore):
+ (ThrottledTextureUploader):
+ (WebCore::ThrottledTextureUploader::create):
+ (Query):
+ (WebCore::ThrottledTextureUploader::Query::create):
+ * platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp:
+ (WebCore::CCLayerTreeHostImpl::initializeLayerRenderer):
+ * platform/graphics/chromium/cc/CCLayerTreeHostImpl.h:
+ (CCLayerTreeHostImpl):
+ * platform/graphics/chromium/cc/CCSingleThreadProxy.cpp:
+ (UnthrottledTextureUploader):
+ (WebCore::UnthrottledTextureUploader::create):
+ (WebCore::UnthrottledTextureUploader::~UnthrottledTextureUploader):
+ (WebCore::UnthrottledTextureUploader::isBusy):
+ (WebCore::UnthrottledTextureUploader::beginUploads):
+ (WebCore::UnthrottledTextureUploader::endUploads):
+ (WebCore::UnthrottledTextureUploader::uploadTexture):
+ (WebCore::UnthrottledTextureUploader::UnthrottledTextureUploader):
+ (WebCore):
+ (WebCore::CCSingleThreadProxy::initializeLayerRenderer):
+ (WebCore::CCSingleThreadProxy::recreateContext):
+ (WebCore::CCSingleThreadProxy::doCommit):
+ * platform/graphics/chromium/cc/CCTextureUpdater.cpp:
+ (WebCore::CCTextureUpdater::update):
+ * platform/graphics/chromium/cc/CCTextureUpdater.h:
+ (CCTextureUpdater):
+ * platform/graphics/chromium/cc/CCThreadProxy.cpp:
+ (WebCore):
+ (UnthrottledTextureUploader):
+ (WebCore::UnthrottledTextureUploader::create):
+ (WebCore::UnthrottledTextureUploader::~UnthrottledTextureUploader):
+ (WebCore::UnthrottledTextureUploader::isBusy):
+ (WebCore::UnthrottledTextureUploader::beginUploads):
+ (WebCore::UnthrottledTextureUploader::endUploads):
+ (WebCore::UnthrottledTextureUploader::uploadTexture):
+ (WebCore::UnthrottledTextureUploader::UnthrottledTextureUploader):
+ (WebCore::CCThreadProxy::initializeLayerRendererOnImplThread):
+ (WebCore::CCThreadProxy::recreateContextOnImplThread):
+
+2012-05-07 Rob Buis <rbuis@rim.com>
+
+ Shrink SVGInlineTextBox object size
+ https://bugs.webkit.org/show_bug.cgi?id=85805
+
+ Reviewed by Darin Adler.
+
+ Reduce the object size of SVGInlineTextBox by using bitfields. This
+ should be 4 bytes on 32-bits and 8 bytes on 64-bits systems.
+
+ * rendering/svg/RenderSVGResource.h:
+ * rendering/svg/SVGInlineTextBox.cpp:
+ (ExpectedSVGInlineTextBoxSize):
+ (WebCore):
+ * rendering/svg/SVGInlineTextBox.h:
+ (SVGInlineTextBox):
+
+2012-05-07 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r116334.
+ http://trac.webkit.org/changeset/116334
+ https://bugs.webkit.org/show_bug.cgi?id=85816
+
+ Broke the Chromium Win/Mac compile (Requested by
+ ojan_gardening on #webkit).
+
+ * WebCore.gypi:
+ * platform/graphics/chromium/AnimationIdVendor.cpp: Removed.
+ * platform/graphics/chromium/AnimationIdVendor.h: Removed.
+ * platform/graphics/chromium/GraphicsLayerChromium.cpp:
+ (std):
+ (WebCore::GraphicsLayerChromium::updateNames):
+ (WebCore::GraphicsLayerChromium::addAnimation):
+ (WebCore::GraphicsLayerChromium::updateChildList):
+ (WebCore::GraphicsLayerChromium::mapAnimationNameToId):
+ * platform/graphics/chromium/GraphicsLayerChromium.h:
+ (WebCore):
+ (GraphicsLayerChromium):
+ * platform/graphics/chromium/LinkHighlightLayerDelegate.cpp: Removed.
+ * platform/graphics/chromium/LinkHighlightLayerDelegate.h: Removed.
+
+2012-05-07 Adrienne Walker <enne@google.com>
+
+ Fix containerForRepaint() assumption about non-null enclosingLayer()
+ https://bugs.webkit.org/show_bug.cgi?id=85807
+
+ Reviewed by Simon Fraser.
+
+ * rendering/RenderObject.cpp:
+ (WebCore::RenderObject::containerForRepaint):
+
+2012-05-07 Alec Flett <alecflett@chromium.org>
+
+ IndexedDB: Replace numeric constants with strings
+ https://bugs.webkit.org/show_bug.cgi?id=84894
+
+ Reviewed by Tony Chang.
+
+ Test: storage/indexeddb/legacy-constants.html
+
+ Update IDBObjectStore.openCursor, IDBIndex.openCursor,
+ IDBIndex.openKeyCursor, IDBDatabase.transaction,
+ IDBCursor.direction, IDBTransaction.mode, and
+ IDBRequest.readyState to meet the latest spec. All of these APIs
+ now support string-based values in addition to the
+ legacy/deprecated enum-based values.
+
+ * Modules/indexeddb/IDBCursor.cpp:
+ (WebCore):
+ (WebCore::IDBCursor::direction):
+ (WebCore::IDBCursor::stringToDirection):
+ (WebCore::IDBCursor::directionToString):
+ * Modules/indexeddb/IDBCursor.h:
+ (IDBCursor):
+ * Modules/indexeddb/IDBCursor.idl:
+ * Modules/indexeddb/IDBDatabase.cpp:
+ (WebCore::IDBDatabase::transaction):
+ (WebCore):
+ * Modules/indexeddb/IDBDatabase.h:
+ (IDBDatabase):
+ * Modules/indexeddb/IDBDatabase.idl:
+ * Modules/indexeddb/IDBIndex.cpp:
+ (WebCore::IDBIndex::openCursor):
+ (WebCore):
+ (WebCore::IDBIndex::openKeyCursor):
+ * Modules/indexeddb/IDBIndex.h:
+ (WebCore::IDBIndex::openCursor):
+ (IDBIndex):
+ (WebCore::IDBIndex::openKeyCursor):
+ * Modules/indexeddb/IDBIndex.idl:
+ * Modules/indexeddb/IDBObjectStore.cpp:
+ (WebCore::IDBObjectStore::openCursor):
+ (WebCore):
+ * Modules/indexeddb/IDBObjectStore.h:
+ (WebCore::IDBObjectStore::openCursor):
+ (IDBObjectStore):
+ * Modules/indexeddb/IDBObjectStore.idl:
+ * Modules/indexeddb/IDBRequest.cpp:
+ (WebCore::IDBRequest::IDBRequest):
+ (WebCore::IDBRequest::readyState):
+ (WebCore::IDBRequest::markEarlyDeath):
+ (WebCore::IDBRequest::resetReadyState):
+ (WebCore::IDBRequest::abort):
+ (WebCore::IDBRequest::finishCursor):
+ (WebCore::IDBRequest::onSuccess):
+ (WebCore::IDBRequest::stop):
+ * Modules/indexeddb/IDBRequest.h:
+ * Modules/indexeddb/IDBRequest.idl:
+ * Modules/indexeddb/IDBTransaction.cpp:
+ (WebCore):
+ (WebCore::IDBTransaction::mode):
+ (WebCore::IDBTransaction::stringToMode):
+ (WebCore::IDBTransaction::modeToString):
+ * Modules/indexeddb/IDBTransaction.h:
+ (IDBTransaction):
+ * Modules/indexeddb/IDBTransaction.idl:
+
+2012-05-07 W. James MacLean <wjmaclean@chromium.org>
+
+ [chromium] Create LinkHighlightLayerChromium class to provide link-highlight preview animations for GraphicsLayerChromium.
+ https://bugs.webkit.org/show_bug.cgi?id=85084
+
+ Reviewed by Adrienne Walker.
+
+ Unit test provided.
+
+ Creates a layer delegate class to provide link highlight animations for link-preview feature.
+ These are added to a GraphicsLayerChromium via provided methods. Moves dispensing of animation
+ ids into a separate class.
+
+ * WebCore.gypi:
+ * platform/graphics/chromium/AnimationIdVendor.cpp: Added.
+ (WebCore):
+ (WebCore::AnimationIdVendor::getNextAnimationId):
+ (WebCore::AnimationIdVendor::getNextGroupId):
+ * platform/graphics/chromium/AnimationIdVendor.h: Added.
+ (WebCore):
+ (AnimationIdVendor):
+ * platform/graphics/chromium/GraphicsLayerChromium.cpp:
+ (WebCore::GraphicsLayerChromium::updateNames):
+ (WebCore::GraphicsLayerChromium::addAnimation):
+ (WebCore::GraphicsLayerChromium::addLinkHighlightLayer):
+ (WebCore):
+ (WebCore::GraphicsLayerChromium::didFinishLinkHighlightLayer):
+ (WebCore::GraphicsLayerChromium::updateChildList):
+ (WebCore::GraphicsLayerChromium::mapAnimationNameToId):
+ * platform/graphics/chromium/GraphicsLayerChromium.h:
+ (WebCore):
+ (GraphicsLayerChromium):
+ * platform/graphics/chromium/LinkHighlightLayerDelegate.cpp: Added.
+ (WebCore):
+ (WebCore::LinkHighlightLayerDelegate::create):
+ (WebCore::LinkHighlightLayerDelegate::LinkHighlightLayerDelegate):
+ (WebCore::LinkHighlightLayerDelegate::~LinkHighlightLayerDelegate):
+ (WebCore::LinkHighlightLayerDelegate::getContentLayer):
+ (WebCore::LinkHighlightLayerDelegate::paintContents):
+ (WebCore::LinkHighlightLayerDelegate::didScroll):
+ (WebCore::LinkHighlightLayerDelegate::notifyAnimationStarted):
+ (WebCore::LinkHighlightLayerDelegate::notifyAnimationFinished):
+ * platform/graphics/chromium/LinkHighlightLayerDelegate.h: Added.
+ (WebCore):
+ (LinkHighlightLayerDelegate):
+
+2012-05-07 Joshua Bell <jsbell@chromium.org>
+
+ IndexedDB: LevelDB coding for bools is broken
+ https://bugs.webkit.org/show_bug.cgi?id=85810
+
+ Reviewed by Tony Chang.
+
+ Code was appending to a pre-sized Vector, rather than using an
+ index setter. This caused uninitialized data to be written out.
+ Issue was detected on the Chromium side in http://crbug.com/126388
+
+ Tests: webkit_unit_tests --gtest_filter='IDBLevelDBCodingTest.*codeBool'
+
+ * Modules/indexeddb/IDBLevelDBCoding.cpp:
+ (WebCore::IDBLevelDBCoding::encodeBool):
+
+2012-05-07 Shawn Singh <shawnsingh@chromium.org>
+
+ [chromium] CCMathUtil projectPoint needs to avoid divide-by-zero
+ https://bugs.webkit.org/show_bug.cgi?id=85560
+
+ Reviewed by Adrienne Walker.
+
+ Unit test added: CCMathUtilTest.cpp - verifyProjectionOfPerpendicularPlane
+ Unit test updated/renamed: CCLayerTreeHostCommonTest.cpp - verifyVisibleRectFor3dPerspectiveWhenClippedByW
+
+ The divide-by-zero occurs in an innocuous case where the layers
+ are probably invisible anyway. However, producing Infs and NaNs
+ could cause values to be used when un-intended, so its appropriate
+ to handle the divide-by-zero correctly.
+
+ * platform/graphics/chromium/cc/CCMathUtil.cpp:
+ (WebCore::projectPoint):
+
+2012-05-07 Pravin D <pravind.2k4@gmail.com>
+
+ Wrong positioning due to wrong width calculation wrt width:0
+ https://bugs.webkit.org/show_bug.cgi?id=50135
+
+ Reviewed by Eric Seidel.
+
+ Test: fast/block/block-parent-with-zero-width-child.html
+
+ * rendering/RenderBlock.cpp:
+ (WebCore::RenderBlock::computePreferredLogicalWidths):
+ When width is fixed, the specified width must be taken, provided the value is positive.
+ Width=0 case was being ignored.
+
+2012-05-07 Noel Gordon <noel.gordon@gmail.com>
+
+ [CG] ImageBuffer::ImageDataToDataURL: Remove alpha stuffing when encoding to JPEG
+ https://bugs.webkit.org/show_bug.cgi?id=85779
+
+ Reviewed by Eric Seidel.
+
+ No change in behavior. Covered by fast/canvas/webgl/premultiplyalpha-test.html
+
+ * platform/graphics/cg/ImageBufferCG.cpp:
+ (WebCore::ImageDataToDataURL): Remove the need to stuff the alpha channel with 255.
+ Rename dataVector to premultipliedData and verify that its resize() worked. Rewrite
+ the premultiplication loop without the alpha channel = 255 part and ask the CG JPEG
+ encoder to ignore the alpha channel (kCGImageAlphaNoneSkipLast) instead.
+
+2012-05-07 Dominik Röttsches <dominik.rottsches@linux.intel.com>
+
+ [GTK] media/video-seek-past-end-playing.html times out
+ https://bugs.webkit.org/show_bug.cgi?id=84858
+
+ Reviewed by Philippe Normand.
+
+ Removing the intentional state change to PAUSED on didEnd().
+ My understanding is that the fix works because the additional
+ state transition to PAUSED was resetting the internal m_seeking state to early,
+ so that updatePlayState() in HTMLMediaElement was not able to
+ correctly figure out/recover playstate after seeking.
+
+ No new tests, covered by existing media tests, and fixing
+ video-seek-past-end-playing.html flakiness on GTK, failure on EFL.
+
+ * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
+
+2012-05-07 Abhishek Arya <inferno@chromium.org>
+
+ Crash in RenderBlock::updateFirstLetterStyle.
+ https://bugs.webkit.org/show_bug.cgi?id=85759
+
+ Reviewed by Julien Chaffraix.
+
+ Test: fast/css-generated-content/first-letter-next-sibling-crash.html
+
+ RenderBlock::removeChild can bring up the children from last single anonymous block,
+ causing |nextSibling| in RenderBlock::updateFirstLetterStyle to go stale. We prevent
+ this by removing the child safely using removeChildNode before destroying it.
+
+ * rendering/RenderBlock.cpp:
+ (WebCore::RenderBlock::updateFirstLetterStyle):
+
+2012-05-07 Tommy Widenflycht <tommyw@google.com>
+
+ MediaStream API: Rename MediaStreamCenter::didConstructMediaStream
+ https://bugs.webkit.org/show_bug.cgi?id=85796
+
+ Reviewed by Adam Barth.
+
+ Renamed MediaStreamCenter::didConstructMediaStream to didCreateMediaStream,
+ and change so that it is only called for MediaStreams created from JS.
+
+ Not really testable.
+
+ * Modules/mediastream/MediaStream.cpp:
+ (WebCore::MediaStream::create):
+ * platform/mediastream/MediaStreamCenter.h:
+ (MediaStreamCenter):
+ * platform/mediastream/chromium/MediaStreamCenterChromium.cpp:
+ (WebCore::MediaStreamCenterChromium::didCreateMediaStream):
+ * platform/mediastream/chromium/MediaStreamCenterChromium.h:
+ (MediaStreamCenterChromium):
+ * platform/mediastream/gstreamer/MediaStreamCenterGStreamer.cpp:
+ (WebCore::MediaStreamCenterGStreamer::didCreateMediaStream):
+ * platform/mediastream/gstreamer/MediaStreamCenterGStreamer.h:
+ (MediaStreamCenterGStreamer):
+
+2012-05-07 Nat Duca <nduca@chromium.org>
+
+ Unreviewed, rolling out r115525.
+ http://trac.webkit.org/changeset/115525
+ https://bugs.webkit.org/show_bug.cgi?id=66683
+
+ Too many pages rely on DOMTimeStamp as first argument.
+ Reverting while we consider next steps.
+
+ * WebCore.exp.in:
+ * bindings/js/JSRequestAnimationFrameCallbackCustom.cpp:
+ (WebCore::JSRequestAnimationFrameCallback::handleEvent):
+ * dom/Document.cpp:
+ (WebCore::Document::serviceScriptedAnimations):
+ * dom/Document.h:
+ (Document):
+ * dom/RequestAnimationFrameCallback.h:
+ (RequestAnimationFrameCallback):
+ * dom/RequestAnimationFrameCallback.idl:
+ * dom/ScriptedAnimationController.cpp:
+ (WebCore::ScriptedAnimationController::ScriptedAnimationController):
+ (WebCore::ScriptedAnimationController::serviceScriptedAnimations):
+ (WebCore):
+ (WebCore::ScriptedAnimationController::windowScreenDidChange):
+ (WebCore::ScriptedAnimationController::scheduleAnimation):
+ (WebCore::ScriptedAnimationController::animationTimerFired):
+ * dom/ScriptedAnimationController.h:
+ (ScriptedAnimationController):
+ (WebCore::ScriptedAnimationController::displayRefreshFired):
+ * page/FrameView.cpp:
+ (WebCore::FrameView::serviceScriptedAnimations):
+ * page/FrameView.h:
+ (FrameView):
+ * platform/graphics/DisplayRefreshMonitor.cpp:
+ (WebCore::DisplayRefreshMonitor::DisplayRefreshMonitor):
+ (WebCore::DisplayRefreshMonitor::notifyClients):
+ * platform/graphics/DisplayRefreshMonitor.h:
+ (DisplayRefreshMonitor):
+ * platform/graphics/blackberry/DisplayRefreshMonitorBlackBerry.cpp:
+ (WebCore::DisplayRefreshMonitor::displayLinkFired):
+ * platform/graphics/mac/DisplayRefreshMonitorMac.cpp:
+ (WebCore):
+ (WebCore::DisplayRefreshMonitor::requestRefreshCallback):
+ (WebCore::DisplayRefreshMonitor::displayLinkFired):
+
+2012-05-07 Tommy Widenflycht <tommyw@google.com>
+
+ MediaStream API: Allow UserMediaRequest::succeed to take an MediaStreamDescriptor
+ https://bugs.webkit.org/show_bug.cgi?id=85798
+
+ Reviewed by Adam Barth.
+
+ Adding another UserMediaRequest::succeed function that takes an MediaStreamDescriptor
+ instead of the two MediaStreamSource arrays.
+
+ Not currently testable.
+
+ * Modules/mediastream/LocalMediaStream.cpp:
+ (WebCore::LocalMediaStream::create):
+ (WebCore):
+ (WebCore::LocalMediaStream::LocalMediaStream):
+ * Modules/mediastream/LocalMediaStream.h:
+ (LocalMediaStream):
+ * Modules/mediastream/UserMediaRequest.cpp:
+ (WebCore::UserMediaRequest::succeed):
+ (WebCore):
+ * Modules/mediastream/UserMediaRequest.h:
+ (WebCore):
+ (UserMediaRequest):
+
+2012-05-07 Michal Mocny <mmocny@google.com>
+
+ [chromium] setContentsMemoryAllocationLimitBytes needs to setNeedsCommit.
+ https://bugs.webkit.org/show_bug.cgi?id=85801
+
+ Reviewed by Adrienne Walker.
+
+ CCLayerTreeHost::setContentsMemoryAllocationLimitBytes needs to call setNeedsCommit after adjusting memory
+ limits, so that we push a new frame. In particular, when returning from non visibile state, we adjust
+ memory allocation from 0 to non 0, and we need to push a non blank frame.
+
+ * platform/graphics/chromium/cc/CCLayerTreeHost.cpp:
+ (WebCore::CCLayerTreeHost::setVisible):
+ (WebCore::CCLayerTreeHost::setContentsMemoryAllocationLimitBytes):
+
+2012-05-07 Christophe Dumez <christophe.dumez@intel.com>
+
+ [EFL] media/track/track-cue-rendering-snap-to-lines-not-set.html fails
+ https://bugs.webkit.org/show_bug.cgi?id=85602
+
+ Reviewed by Eric Carlson.
+
+ Fix positioning of the controls panel back to relative, as it is
+ in the parent CSS.
+
+ * css/mediaControlsEfl.css:
+ (audio::-webkit-media-controls-panel, video::-webkit-media-controls-panel):
+
+2012-05-07 Adam Bergkvist <adam.bergkvist@ericsson.com>
+
+ MediaStream should not be an ActiveDOMObject
+ https://bugs.webkit.org/show_bug.cgi?id=85191
+
+ Reviewed by Adam Barth.
+
+ The model with MediaStreamDescriptor and MediaStream (and LocalMediaStream)
+ allows the JavaScript objects (MediaStream and LocalMediaStream) to be
+ cleaned up while the MediaStreamDescriptor lives on to manage the stream in
+ the platform. This happens for example when a URL is created to represent
+ a MediaStream (using createObjectURL()). In that case, the MediaStreamDescriptor
+ is put into the MediaStreamRegistry and even though the MediaStream object is
+ lost, the URL still works since the descriptor is kept in the registry.
+
+ The changes introduced in r113460 (http://webkit.org/b/83143) turned
+ MediaStream and LocalMediaStream into ActiveDOMObjects. For example on page
+ reload, LocalMediaStream calls MediaStreamCenter::didStopLocalMediaStream()
+ via its ActiveDOMObject::stop() method. However, when a page reload occurs,
+ the LocalMediaStream object may have been cleaned up already and
+ MediaStreamCenter::didStopLocalMediaStream() will not be called.
+
+ One way to make the behavior consistent would be to call
+ MediaStreamCenter::didStopLocalMediaStream() when the descriptor is cleaned up,
+ cause then we wouldn't be dependent on the LocalMediaStream object being alive.
+ However, calling MediaStreamCenter::didStopLocalMediaStream() might not be the
+ correct thing to do when all references to the descriptor are lost since there
+ can be MediaStream objects constructed from the tracks of the LocalMediaStream
+ that should continue to work. MediaStreamCenter::didStopLocalMediaStream() was
+ intended for LocalMediaStream.stop() which is used to revoke access to devices;
+ that should not necessarily happen when the descriptor of a LocalMediaStream is
+ cleaned up. If it's necessary for some ports to signal to the platform that a
+ MediaStreamDescriptor is cleaned up, then I would suggest adding a new function,
+ willDestroyMediaStreamDescriptor(), to the MediaStreamCenter interface.
+
+ The current resolution is to make MediaStream a ContextDestructionObserver
+ instead of an ActiveDOMObject.
+
+ Currently not testable.
+
+ * Modules/mediastream/LocalMediaStream.cpp:
+ (WebCore::LocalMediaStream::create):
+ * Modules/mediastream/LocalMediaStream.h:
+ (LocalMediaStream):
+ * Modules/mediastream/LocalMediaStream.idl:
+ * Modules/mediastream/MediaStream.cpp:
+ (WebCore::MediaStream::create):
+ (WebCore::MediaStream::MediaStream):
+ (WebCore::MediaStream::scriptExecutionContext):
+ * Modules/mediastream/MediaStream.h:
+
+2012-05-07 Liam Quinn <lquinn@rim.com>
+
+ [BlackBerry] WWW-Authenticate header on 200 response pops up authentication dialog
+ https://bugs.webkit.org/show_bug.cgi?id=85643
+
+ Reviewed by George Staikos.
+
+ RIM PR: 151992
+ Ignore WWW-Authenticate header if the response code is not 401.
+ Ignore Proxy-Authenticate header if the response code is not 407.
+
+ Manual test added to observe whether the authentication dialog appears on a 200 response with WWW-Authenticate.
+
+ * platform/network/blackberry/NetworkJob.cpp:
+ (WebCore::NetworkJob::handleNotifyHeaderReceived):
+
+2012-05-07 Alexander Pavlov <apavlov@chromium.org>
+
+ Web Inspector: [TextPrompt] Event listeners and CSS style are not removed on detachment
+ https://bugs.webkit.org/show_bug.cgi?id=85789
+
+ Reviewed by Yury Semikhatsky.
+
+ * inspector/front-end/TextPrompt.js:
+ (WebInspector.TextPrompt.prototype._attachInternal):
+ (WebInspector.TextPrompt.prototype.detach):
+
+2012-05-07 Csaba Osztrogonác <ossy@webkit.org>
+
+ Buildfix for buggy GCC
+ https://bugs.webkit.org/show_bug.cgi?id=85781
+
+ Reviewed by Zoltan Herczeg.
+
+ * rendering/RenderBlock.h:
+ (WebCore::RenderBlock::MarginInfo::clearMargin):
+
+2012-05-07 Alexander Pavlov <apavlov@chromium.org>
+
+ Web Inspector: [REGRESSION] Context menu for the left Script view gutter is broken
+ https://bugs.webkit.org/show_bug.cgi?id=85785
+
+ Reviewed by Pavel Feldman.
+
+ Fixed remaining usages of WebInspector.save to be WebInspector.fileManager.save.
+
+ * inspector/front-end/NetworkPanel.js:
+ (WebInspector.NetworkLogView.prototype._exportAll):
+ (WebInspector.NetworkLogView.prototype._exportRequest):
+ * inspector/front-end/ResourcesPanel.js:
+ (WebInspector.FrameResourceTreeElement.prototype._appendSaveAsAction.doSave):
+ (WebInspector.ResourceRevisionTreeElement.prototype._handleContextMenuEvent.doSave):
+ * inspector/front-end/TextViewer.js:
+ (WebInspector.TextViewer.prototype._contextMenu):
+
+
+2012-05-07 Antti Koivisto <antti@apple.com>
+
+ Share stylesheet data structures between documents
+ https://bugs.webkit.org/show_bug.cgi?id=85598
+
+ Reviewed by Darin Adler.
+
+ We currently make a copy of the data structures when restoring a cached stylesheet. This patch lets us share
+ the data until someone uses a mutating CSSOM API to modify the sheet.
+
+ The patch implements copy-on-write for the internal style sheet data structures. If any mutating CSSOM API is
+ invoked, we check if the mutation is safe (there is only one client, the sheet is not cached). If not then the
+ internal structures are copied and any existing CSSOM objects are re-attached to the new style tree. The copied
+ tree is mutated while the other clients stay attached to the original tree.
+
+ Sharing can save significant amount of memory on sites with large stylesheets. For example if you have
+ multiple articles open on wsj.com this saves ~2.6MB per tab.
+
+ Test: http/tests/css/shared-stylesheet-mutation.html
+ http/tests/css/shared-stylesheet-mutation-preconstruct.html
+
+ * css/CSSFontFaceRule.cpp:
+ (WebCore::CSSFontFaceRule::reattach):
+ (WebCore):
+ * css/CSSFontFaceRule.h:
+ (CSSFontFaceRule):
+ * css/CSSMediaRule.cpp:
+ (WebCore::CSSMediaRule::insertRule):
+ (WebCore::CSSMediaRule::deleteRule):
+ (WebCore::CSSMediaRule::reattach):
+ (WebCore):
+ * css/CSSMediaRule.h:
+ (CSSMediaRule):
+ * css/CSSPageRule.cpp:
+ (WebCore::CSSPageRule::setSelectorText):
+ (WebCore::CSSPageRule::reattach):
+ (WebCore):
+ * css/CSSPageRule.h:
+ (CSSPageRule):
+ * css/CSSRule.cpp:
+ (WebCore::CSSRule::reattach):
+
+ After the internal stylerule tree has been copied, the existing wrappers are re-attached using recursive reattach() function.
+
+ * css/CSSRule.h:
+ (WebCore):
+ (CSSRule):
+ * css/CSSStyleRule.cpp:
+ (WebCore::CSSStyleRule::setSelectorText):
+ (WebCore::CSSStyleRule::reattach):
+ (WebCore):
+ * css/CSSStyleRule.h:
+ (CSSStyleRule):
+ * css/CSSStyleSheet.cpp:
+ (WebCore::StyleSheetInternal::StyleSheetInternal):
+ (WebCore::StyleSheetInternal::isCacheable):
+ (WebCore::StyleSheetInternal::ruleAt):
+
+ Add ruleAt(), use it for both wrapper creation and reattaching. Remove createChildRuleCSSOMWrapper .
+
+ (WebCore):
+ (WebCore::StyleSheetInternal::wrapperInsertRule):
+ (WebCore::StyleSheetInternal::wrapperDeleteRule):
+
+ Invalidation moves to the calling wrapper.
+
+ (WebCore::StyleSheetInternal::addedToMemoryCache):
+ (WebCore::StyleSheetInternal::removedFromMemoryCache):
+ (WebCore::CSSStyleSheet::willMutateRules):
+
+ This is called whenever StyleSheetInternal is going to be mutated. It will do copy-on-write if needed.
+
+ Usually invoked by CSSStyleSheet::RuleMutation RAII type.
+
+ (WebCore::CSSStyleSheet::didMutateRules):
+
+ This is called after the mutation is complete and will trigger the style recalc in the document.
+
+ (WebCore::CSSStyleSheet::didMutate):
+
+ This is called directly after mutations that don't change StyleSheetInternal so don't require copy-on-write.
+
+ (WebCore::CSSStyleSheet::reattachChildRuleCSSOMWrappers):
+ (WebCore::CSSStyleSheet::setDisabled):
+ (WebCore::CSSStyleSheet::insertRule):
+ (WebCore::CSSStyleSheet::deleteRule):
+ * css/CSSStyleSheet.h:
+ (StyleSheetInternal):
+ (WebCore::StyleSheetInternal::hasOneClient):
+ (WebCore::StyleSheetInternal::isMutable):
+ (WebCore::StyleSheetInternal::setMutable):
+
+ Track mutability. Mutation is allowed only after willMutate call.
+
+ (WebCore::StyleSheetInternal::isInMemoryCache):
+
+ Track if the object is in memory cache.
+
+ (WebCore::CSSStyleSheet::clearOwnerRule):
+ (CSSStyleSheet):
+ * css/MediaList.cpp:
+ (WebCore::MediaList::setMediaText):
+ (WebCore::MediaList::deleteMedium):
+ (WebCore::MediaList::appendMedium):
+ (WebCore::MediaList::didMutate):
+ (WebCore):
+ (WebCore::MediaList::reattach):
+ * css/MediaList.h:
+ (MediaList):
+ * css/PropertySetCSSStyleDeclaration.cpp:
+ (WebCore::PropertySetCSSStyleDeclaration::setCssText):
+ (WebCore::PropertySetCSSStyleDeclaration::setProperty):
+ (WebCore::PropertySetCSSStyleDeclaration::removeProperty):
+ (WebCore::PropertySetCSSStyleDeclaration::setPropertyInternal):
+ (WebCore):
+ (WebCore::StyleRuleCSSStyleDeclaration::willMutate):
+ (WebCore::StyleRuleCSSStyleDeclaration::didMutate):
+ (WebCore::StyleRuleCSSStyleDeclaration::reattach):
+ (WebCore::InlineCSSStyleDeclaration::didMutate):
+ * css/PropertySetCSSStyleDeclaration.h:
+ (WebCore::PropertySetCSSStyleDeclaration::willMutate):
+ (WebCore::PropertySetCSSStyleDeclaration::didMutate):
+ (StyleRuleCSSStyleDeclaration):
+ * css/WebKitCSSKeyframesRule.cpp:
+ (WebCore::WebKitCSSKeyframesRule::setName):
+ (WebCore::WebKitCSSKeyframesRule::insertRule):
+ (WebCore::WebKitCSSKeyframesRule::deleteRule):
+ (WebCore::WebKitCSSKeyframesRule::reattach):
+ (WebCore):
+ * css/WebKitCSSKeyframesRule.h:
+ (WebKitCSSKeyframesRule):
+ * css/WebKitCSSRegionRule.cpp:
+ (WebCore::WebKitCSSRegionRule::reattach):
+ * css/WebKitCSSRegionRule.h:
+ (WebKitCSSRegionRule):
+ * inspector/InspectorStyleSheet.cpp:
+ (WebCore::InspectorStyleSheet::reparseStyleSheet):
+ * loader/cache/CachedCSSStyleSheet.cpp:
+ (WebCore::CachedCSSStyleSheet::~CachedCSSStyleSheet):
+ (WebCore::CachedCSSStyleSheet::destroyDecodedData):
+ (WebCore::CachedCSSStyleSheet::restoreParsedStyleSheet):
+
+ Don't copy when restoring. It is no longer necessary.
+ Set the cache bit on the stylesheet.
+
+ (WebCore::CachedCSSStyleSheet::saveParsedStyleSheet):
+
2012-05-06 Kinuko Yasuda <kinuko@chromium.org>
Cleanup: Change boolean synchronous flag argument into enum in FileSystem API code
diff --git a/Source/WebCore/Configurations/FeatureDefines.xcconfig b/Source/WebCore/Configurations/FeatureDefines.xcconfig
index 9d76ca226..94526ac8b 100644
--- a/Source/WebCore/Configurations/FeatureDefines.xcconfig
+++ b/Source/WebCore/Configurations/FeatureDefines.xcconfig
@@ -54,6 +54,7 @@ ENABLE_GEOLOCATION = ENABLE_GEOLOCATION;
ENABLE_HIGH_DPI_CANVAS = ENABLE_HIGH_DPI_CANVAS;
ENABLE_ICONDATABASE = $(ENABLE_ICONDATABASE_$(REAL_PLATFORM_NAME));
ENABLE_ICONDATABASE_macosx = ENABLE_ICONDATABASE;
+ENABLE_IFRAME_SEAMLESS = ENABLE_IFRAME_SEAMLESS;
ENABLE_INDEXED_DATABASE = ;
ENABLE_INPUT_SPEECH = ;
ENABLE_INPUT_TYPE_COLOR = ;
@@ -122,4 +123,4 @@ ENABLE_WEB_TIMING = ;
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_CSS_FILTERS) $(ENABLE_CSS_GRID_LAYOUT) $(ENABLE_CSS_SHADERS) $(ENABLE_DASHBOARD_SUPPORT) $(ENABLE_DATALIST) $(ENABLE_DATA_TRANSFER_ITEMS) $(ENABLE_DETAILS) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DIRECTORY_UPLOAD) $(ENABLE_FILE_SYSTEM) $(ENABLE_FILTERS) $(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_PREFENDER) $(ENABLE_MATHML) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_METER_TAG) $(ENABLE_MICRODATA) $(ENABLE_MUTATION_OBSERVERS) $(ENABLE_NOTIFICATIONS) $(ENABLE_PAGE_VISIBILITY_API) $(ENABLE_PROGRESS_TAG) $(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_NOTIFICATIONS_ONLY) $(ENABLE_TOUCH_ICON_LOADING) $(ENABLE_VIDEO) $(ENABLE_VIDEO_TRACK) $(ENABLE_WEBGL) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WEB_TIMING) $(ENABLE_WORKERS) $(ENABLE_XSLT);
+FEATURE_DEFINES = $(ENABLE_3D_RENDERING) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ANIMATION_API) $(ENABLE_BLOB) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CSS_FILTERS) $(ENABLE_CSS_GRID_LAYOUT) $(ENABLE_CSS_SHADERS) $(ENABLE_DASHBOARD_SUPPORT) $(ENABLE_DATALIST) $(ENABLE_DATA_TRANSFER_ITEMS) $(ENABLE_DETAILS) $(ENABLE_DEVICE_ORIENTATION) $(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_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_PREFENDER) $(ENABLE_MATHML) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_METER_TAG) $(ENABLE_MICRODATA) $(ENABLE_MUTATION_OBSERVERS) $(ENABLE_NOTIFICATIONS) $(ENABLE_PAGE_VISIBILITY_API) $(ENABLE_PROGRESS_TAG) $(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_NOTIFICATIONS_ONLY) $(ENABLE_TOUCH_ICON_LOADING) $(ENABLE_VIDEO) $(ENABLE_VIDEO_TRACK) $(ENABLE_WEBGL) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WEB_TIMING) $(ENABLE_WORKERS) $(ENABLE_XSLT);
diff --git a/Source/WebCore/Configurations/Version.xcconfig b/Source/WebCore/Configurations/Version.xcconfig
index 941d916eb..dc5e3d7c9 100644
--- a/Source/WebCore/Configurations/Version.xcconfig
+++ b/Source/WebCore/Configurations/Version.xcconfig
@@ -21,8 +21,8 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-MAJOR_VERSION = 536;
-MINOR_VERSION = 11;
+MAJOR_VERSION = 537;
+MINOR_VERSION = 1;
TINY_VERSION = 0;
FULL_VERSION = $(MAJOR_VERSION).$(MINOR_VERSION);
diff --git a/Source/WebCore/DerivedSources.cpp b/Source/WebCore/DerivedSources.cpp
index ef05a8db5..988d58267 100644
--- a/Source/WebCore/DerivedSources.cpp
+++ b/Source/WebCore/DerivedSources.cpp
@@ -265,6 +265,7 @@
#include "JSPositionErrorCallback.cpp"
#include "JSProcessingInstruction.cpp"
#include "JSProgressEvent.cpp"
+#include "JSRadioNodeList.cpp"
#include "JSRange.cpp"
#include "JSRangeException.cpp"
#include "JSRect.cpp"
diff --git a/Source/WebCore/DerivedSources.make b/Source/WebCore/DerivedSources.make
index 680ae7029..3d07a3062 100644
--- a/Source/WebCore/DerivedSources.make
+++ b/Source/WebCore/DerivedSources.make
@@ -335,6 +335,7 @@ BINDING_IDLS = \
$(WebCore)/html/ImageData.idl \
$(WebCore)/html/MediaController.idl \
$(WebCore)/html/MediaError.idl \
+ $(WebCore)/html/RadioNodeList.idl \
$(WebCore)/html/TextMetrics.idl \
$(WebCore)/html/TimeRanges.idl \
$(WebCore)/html/ValidityState.idl \
diff --git a/Source/WebCore/DerivedSources.pri b/Source/WebCore/DerivedSources.pri
index 70104a8f1..ad0783f0e 100644
--- a/Source/WebCore/DerivedSources.pri
+++ b/Source/WebCore/DerivedSources.pri
@@ -57,7 +57,7 @@ WALDOCSSVALUES = $$PWD/css/CSSValueKeywords.in
INSPECTOR_JSON = $$PWD/inspector/Inspector.json
-INSPECTOR_BACKEND_STUB_QRC = $$PWD/inspector/front-end/InspectorBackendStub.qrc
+INSPECTOR_BACKEND_COMMANDS_QRC = $$PWD/inspector/front-end/InspectorBackendCommands.qrc
INJECTED_SCRIPT_SOURCE = $$PWD/inspector/InjectedScriptSource.js
@@ -383,6 +383,7 @@ IDL_BINDINGS += \
$$PWD/html/ImageData.idl \
$$PWD/html/MediaController.idl \
$$PWD/html/MediaError.idl \
+ $$PWD/html/RadioNodeList.idl \
$$PWD/html/TextMetrics.idl \
$$PWD/html/TimeRanges.idl \
$$PWD/html/ValidityState.idl \
@@ -754,11 +755,11 @@ inspectorJSON.commands = python $$inspectorJSON.script $$PWD/inspector/Inspector
inspectorJSON.depends = $$inspectorJSON.script
GENERATORS += inspectorJSON
-inspectorBackendStub.output = InspectorBackendStub.qrc
-inspectorBackendStub.input = INSPECTOR_BACKEND_STUB_QRC
-inspectorBackendStub.commands = $$QMAKE_COPY $$toSystemPath($$INSPECTOR_BACKEND_STUB_QRC) ${QMAKE_FUNC_FILE_OUT_PATH}$${QMAKE_DIR_SEP}InspectorBackendStub.qrc
-inspectorBackendStub.add_output_to_sources = false
-GENERATORS += inspectorBackendStub
+inspectorBackendCommands.output = InspectorBackendCommands.qrc
+inspectorBackendCommands.input = INSPECTOR_BACKEND_COMMANDS_QRC
+inspectorBackendCommands.commands = $$QMAKE_COPY $$toSystemPath($$INSPECTOR_BACKEND_COMMANDS_QRC) ${QMAKE_FUNC_FILE_OUT_PATH}$${QMAKE_DIR_SEP}InspectorBackendCommands.qrc
+inspectorBackendCommands.add_output_to_sources = false
+GENERATORS += inspectorBackendCommands
# GENERATOR 2-a: inspector injected script source compiler
injectedScriptSource.output = InjectedScriptSource.h
diff --git a/Source/WebCore/English.lproj/Localizable.strings b/Source/WebCore/English.lproj/Localizable.strings
index ca3e1e9c9..6a3864a26 100644
--- a/Source/WebCore/English.lproj/Localizable.strings
+++ b/Source/WebCore/English.lproj/Localizable.strings
Binary files differ
diff --git a/Source/WebCore/GNUmakefile.am b/Source/WebCore/GNUmakefile.am
index f91829875..ef85bd959 100644
--- a/Source/WebCore/GNUmakefile.am
+++ b/Source/WebCore/GNUmakefile.am
@@ -656,6 +656,14 @@ FEATURE_DEFINES += ENABLE_WEB_TIMING=1
webcore_cppflags += -DENABLE_WEB_TIMING=1
endif # END ENABLE_WEB_TIMING
+# ---
+# HTML iframe seamless attribute support
+# ---
+if ENABLE_IFRAME_SEAMLESS
+FEATURE_DEFINES += ENABLE_IFRAME_SEAMLESS=1
+webcore_cppflags += -DENABLE_IFRAME_SEAMLESS=1
+endif # END ENABLE_IFRAME_SEAMLESS
+
DerivedSources/WebCore/CSSPropertyNames.cpp: DerivedSources/WebCore/CSSPropertyNames.h
DerivedSources/WebCore/CSSPropertyNames.h: $(WEBCORE_CSS_PROPERTY_NAMES) $(WebCore)/css/makeprop.pl
$(AM_V_GEN)
@@ -774,8 +782,8 @@ DerivedSources/WebCore/InspectorBackendDispatcher.cpp: $(WebCore)/inspector/Insp
DerivedSources/WebCore/InspectorTypeBuilder.h: DerivedSources/WebCore/InspectorTypeBuilder.cpp
DerivedSources/WebCore/InspectorTypeBuilder.cpp: DerivedSources/WebCore/InspectorFrontend.h
DerivedSources/WebCore/InspectorFrontend.h: DerivedSources/WebCore/InspectorFrontend.cpp
-DerivedSources/WebCore/InspectorFrontend.cpp: DerivedSources/WebCore/InspectorBackendStub.js
-DerivedSources/WebCore/InspectorBackendStub.js: DerivedSources/WebCore/InspectorBackendDispatcher.h
+DerivedSources/WebCore/InspectorFrontend.cpp: DerivedSources/WebCore/InspectorBackendCommands.js
+DerivedSources/WebCore/InspectorBackendCommands.js: DerivedSources/WebCore/InspectorBackendDispatcher.h
DerivedSources/WebCore/InspectorBackendDispatcher.h: DerivedSources/WebCore/InspectorBackendDispatcher.cpp
DerivedSources/WebCore/InjectedScriptSource.h: $(WebCore)/inspector/InjectedScriptSource.js
$(AM_V_GEN)$(PERL) $(WebCore)/inspector/xxd.pl InjectedScriptSource_js $(WebCore)/inspector/InjectedScriptSource.js $(GENSOURCES_WEBCORE)/InjectedScriptSource.h
@@ -1056,7 +1064,7 @@ EXTRA_DIST += \
webinspectordir = ${datadir}/webkitgtk-@WEBKITGTK_API_VERSION@/webinspector
dist_webinspector_DATA = \
$(WebCore)/English.lproj/localizedStrings.js \
- DerivedSources/WebCore/InspectorBackendStub.js \
+ DerivedSources/WebCore/InspectorBackendCommands.js \
$(shell ls $(WebCore)/inspector/front-end/*.js) \
$(shell ls $(WebCore)/inspector/front-end/*.html) \
$(shell ls $(WebCore)/inspector/front-end/*.css)
@@ -1078,7 +1086,7 @@ ${GENSOURCES_INSPECTOR}/inspector.html: $(WebCore)/inspector/front-end/*.html \
$(WebCore)/inspector/front-end/UglifyJS/*.js \
$(WebCore)/inspector/front-end/*.css \
$(WebCore)/inspector/front-end/Images/* \
- DerivedSources/WebCore/InspectorBackendStub.js \
+ DerivedSources/WebCore/InspectorBackendCommands.js \
$(WebCore)/English.lproj/localizedStrings.js
$(AM_V_GEN)
$(AM_V_at)mkdir -p ${GENSOURCES_INSPECTOR}/UglifyJS
diff --git a/Source/WebCore/GNUmakefile.list.am b/Source/WebCore/GNUmakefile.list.am
index 916286de8..99b439866 100644
--- a/Source/WebCore/GNUmakefile.list.am
+++ b/Source/WebCore/GNUmakefile.list.am
@@ -466,6 +466,8 @@ webcore_built_sources += \
DerivedSources/WebCore/JSProcessingInstruction.h \
DerivedSources/WebCore/JSProgressEvent.cpp \
DerivedSources/WebCore/JSProgressEvent.h \
+ DerivedSources/WebCore/JSRadioNodeList.cpp \
+ DerivedSources/WebCore/JSRadioNodeList.h \
DerivedSources/WebCore/JSRange.cpp \
DerivedSources/WebCore/JSRangeException.cpp \
DerivedSources/WebCore/JSRangeException.h \
@@ -879,6 +881,7 @@ dom_binding_idls += \
$(WebCore)/html/MediaError.idl \
$(WebCore)/html/MediaKeyError.idl \
$(WebCore)/html/MediaKeyEvent.idl \
+ $(WebCore)/html/RadioNodeList.idl \
$(WebCore)/html/TextMetrics.idl \
$(WebCore)/html/TimeRanges.idl \
$(WebCore)/html/ValidityState.idl \
@@ -1027,6 +1030,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/FileSystemType.h \
Source/WebCore/Modules/filesystem/FileWriter.cpp \
Source/WebCore/Modules/filesystem/FileWriter.h \
Source/WebCore/Modules/filesystem/FileWriterBase.cpp \
@@ -2531,6 +2535,8 @@ webcore_sources += \
Source/WebCore/html/RadioInputType.h \
Source/WebCore/html/RangeInputType.cpp \
Source/WebCore/html/RangeInputType.h \
+ Source/WebCore/html/RadioNodeList.cpp \
+ Source/WebCore/html/RadioNodeList.h \
Source/WebCore/html/ResetInputType.cpp \
Source/WebCore/html/ResetInputType.h \
Source/WebCore/html/SearchInputType.cpp \
@@ -3090,6 +3096,8 @@ webcore_sources += \
Source/WebCore/platform/DragImage.cpp \
Source/WebCore/platform/DragImage.h \
Source/WebCore/platform/EventLoop.h \
+ Source/WebCore/platform/EventTracer.cpp \
+ Source/WebCore/platform/EventTracer.h \
Source/WebCore/platform/FileChooser.cpp \
Source/WebCore/platform/FileChooser.h \
Source/WebCore/platform/FileIconLoader.cpp \
@@ -3246,7 +3254,6 @@ webcore_sources += \
Source/WebCore/platform/graphics/FractionalLayoutPoint.h \
Source/WebCore/platform/graphics/FractionalLayoutRect.cpp \
Source/WebCore/platform/graphics/FractionalLayoutRect.h \
- Source/WebCore/platform/graphics/FractionalLayoutSize.cpp \
Source/WebCore/platform/graphics/FractionalLayoutSize.h \
Source/WebCore/platform/graphics/GeneratorGeneratedImage.cpp \
Source/WebCore/platform/graphics/GeneratorGeneratedImage.h \
diff --git a/Source/WebCore/Modules/filesystem/DOMFileSystem.cpp b/Source/WebCore/Modules/filesystem/DOMFileSystem.cpp
index d36ee1de5..090bcc052 100644
--- a/Source/WebCore/Modules/filesystem/DOMFileSystem.cpp
+++ b/Source/WebCore/Modules/filesystem/DOMFileSystem.cpp
@@ -53,16 +53,16 @@
namespace WebCore {
// static
-PassRefPtr<DOMFileSystem> DOMFileSystem::create(ScriptExecutionContext* context, const String& name, PassOwnPtr<AsyncFileSystem> asyncFileSystem)
+PassRefPtr<DOMFileSystem> DOMFileSystem::create(ScriptExecutionContext* context, const String& name, FileSystemType type, const KURL& rootURL, PassOwnPtr<AsyncFileSystem> asyncFileSystem)
{
- RefPtr<DOMFileSystem> fileSystem(adoptRef(new DOMFileSystem(context, name, asyncFileSystem)));
+ RefPtr<DOMFileSystem> fileSystem(adoptRef(new DOMFileSystem(context, name, type, rootURL, asyncFileSystem)));
fileSystem->suspendIfNeeded();
InspectorInstrumentation::didOpenFileSystem(fileSystem.get());
return fileSystem.release();
}
-DOMFileSystem::DOMFileSystem(ScriptExecutionContext* context, const String& name, PassOwnPtr<AsyncFileSystem> asyncFileSystem)
- : DOMFileSystemBase(context, name, asyncFileSystem)
+DOMFileSystem::DOMFileSystem(ScriptExecutionContext* context, const String& name, FileSystemType type, const KURL& rootURL, PassOwnPtr<AsyncFileSystem> asyncFileSystem)
+ : DOMFileSystemBase(context, name, type, rootURL, asyncFileSystem)
, ActiveDOMObject(context, this)
{
}
@@ -118,7 +118,7 @@ void DOMFileSystem::createWriter(const FileEntry* fileEntry, PassRefPtr<FileWrit
RefPtr<FileWriter> fileWriter = FileWriter::create(scriptExecutionContext());
RefPtr<FileWriterBaseCallback> conversionCallback = ConvertToFileWriterCallback::create(successCallback);
OwnPtr<FileWriterBaseCallbacks> callbacks = FileWriterBaseCallbacks::create(fileWriter, conversionCallback, errorCallback);
- m_asyncFileSystem->createWriter(fileWriter.get(), fileEntry->fullPath(), callbacks.release());
+ m_asyncFileSystem->createWriter(fileWriter.get(), createFileSystemURL(fileEntry), callbacks.release());
}
namespace {
@@ -158,7 +158,7 @@ private:
void DOMFileSystem::createFile(const FileEntry* fileEntry, PassRefPtr<FileCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback)
{
- m_asyncFileSystem->createSnapshotFileAndReadMetadata(fileEntry->fullPath(), GetPathCallback::create(this, fileEntry->name(), successCallback, errorCallback));
+ m_asyncFileSystem->createSnapshotFileAndReadMetadata(createFileSystemURL(fileEntry), GetPathCallback::create(this, fileEntry->name(), successCallback, errorCallback));
}
} // namespace WebCore
diff --git a/Source/WebCore/Modules/filesystem/DOMFileSystem.h b/Source/WebCore/Modules/filesystem/DOMFileSystem.h
index 74fa9ac18..7f5ebcd41 100644
--- a/Source/WebCore/Modules/filesystem/DOMFileSystem.h
+++ b/Source/WebCore/Modules/filesystem/DOMFileSystem.h
@@ -47,7 +47,7 @@ class FileWriterCallback;
class DOMFileSystem : public DOMFileSystemBase, public ActiveDOMObject {
public:
- static PassRefPtr<DOMFileSystem> create(ScriptExecutionContext*, const String& name, PassOwnPtr<AsyncFileSystem>);
+ static PassRefPtr<DOMFileSystem> create(ScriptExecutionContext*, const String& name, FileSystemType, const KURL& rootURL, PassOwnPtr<AsyncFileSystem>);
PassRefPtr<DirectoryEntry> root();
@@ -71,7 +71,7 @@ public:
}
private:
- DOMFileSystem(ScriptExecutionContext*, const String& name, PassOwnPtr<AsyncFileSystem>);
+ DOMFileSystem(ScriptExecutionContext*, const String& name, FileSystemType, const KURL& rootURL, PassOwnPtr<AsyncFileSystem>);
// A helper template to schedule a callback task.
template <typename CB, typename CBArg>
diff --git a/Source/WebCore/Modules/filesystem/DOMFileSystemBase.cpp b/Source/WebCore/Modules/filesystem/DOMFileSystemBase.cpp
index 4335ab904..62fcea00a 100644
--- a/Source/WebCore/Modules/filesystem/DOMFileSystemBase.cpp
+++ b/Source/WebCore/Modules/filesystem/DOMFileSystemBase.cpp
@@ -50,9 +50,16 @@
namespace WebCore {
-DOMFileSystemBase::DOMFileSystemBase(ScriptExecutionContext* context, const String& name, PassOwnPtr<AsyncFileSystem> asyncFileSystem)
+const char DOMFileSystemBase::persistentPathPrefix[] = "persistent";
+const size_t DOMFileSystemBase::persistentPathPrefixLength = sizeof(DOMFileSystemBase::persistentPathPrefix) - 1;
+const char DOMFileSystemBase::temporaryPathPrefix[] = "temporary";
+const size_t DOMFileSystemBase::temporaryPathPrefixLength = sizeof(DOMFileSystemBase::temporaryPathPrefix) - 1;
+
+DOMFileSystemBase::DOMFileSystemBase(ScriptExecutionContext* context, const String& name, FileSystemType type, const KURL& rootURL, PassOwnPtr<AsyncFileSystem> asyncFileSystem)
: m_context(context)
, m_name(name)
+ , m_type(type)
+ , m_filesystemRootURL(rootURL)
, m_asyncFileSystem(asyncFileSystem)
{
}
@@ -66,9 +73,14 @@ SecurityOrigin* DOMFileSystemBase::securityOrigin() const
return m_context->securityOrigin();
}
+KURL DOMFileSystemBase::createFileSystemURL(const EntryBase* entry) const
+{
+ return createFileSystemURL(entry->fullPath());
+}
+
bool DOMFileSystemBase::getMetadata(const EntryBase* entry, PassRefPtr<MetadataCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback)
{
- m_asyncFileSystem->readMetadata(entry->fullPath(), MetadataCallbacks::create(successCallback, errorCallback));
+ m_asyncFileSystem->readMetadata(createFileSystemURL(entry), MetadataCallbacks::create(successCallback, errorCallback));
return true;
}
@@ -82,12 +94,14 @@ static bool verifyAndGetDestinationPathForCopyOrMove(const EntryBase* source, En
if (!newName.isEmpty() && !DOMFilePath::isValidName(newName))
return false;
+ const bool isSameFileSystem = (*source->filesystem() == *parent->filesystem());
+
// It is an error to try to copy or move an entry inside itself at any depth if it is a directory.
- if (source->isDirectory() && DOMFilePath::isParentOf(source->fullPath(), parent->fullPath()))
+ if (source->isDirectory() && isSameFileSystem && DOMFilePath::isParentOf(source->fullPath(), parent->fullPath()))
return false;
// It is an error to copy or move an entry into its parent if a name different from its current one isn't provided.
- if ((newName.isEmpty() || source->name() == newName) && DOMFilePath::getDirectory(source->fullPath()) == parent->fullPath())
+ if (isSameFileSystem && (newName.isEmpty() || source->name() == newName) && DOMFilePath::getDirectory(source->fullPath()) == parent->fullPath())
return false;
destinationPath = parent->fullPath();
@@ -118,7 +132,7 @@ bool DOMFileSystemBase::move(const EntryBase* source, EntryBase* parent, const S
if (!verifyAndGetDestinationPathForCopyOrMove(source, parent, newName, destinationPath))
return false;
- m_asyncFileSystem->move(source->fullPath(), destinationPath, EntryCallbacks::create(successCallback, errorCallback, this, destinationPath, source->isDirectory()));
+ m_asyncFileSystem->move(createFileSystemURL(source), parent->filesystem()->createFileSystemURL(destinationPath), EntryCallbacks::create(successCallback, errorCallback, parent->filesystem(), destinationPath, source->isDirectory()));
return true;
}
@@ -128,7 +142,7 @@ bool DOMFileSystemBase::copy(const EntryBase* source, EntryBase* parent, const S
if (!verifyAndGetDestinationPathForCopyOrMove(source, parent, newName, destinationPath))
return false;
- m_asyncFileSystem->copy(source->fullPath(), destinationPath, EntryCallbacks::create(successCallback, errorCallback, this, destinationPath, source->isDirectory()));
+ m_asyncFileSystem->copy(createFileSystemURL(source), parent->filesystem()->createFileSystemURL(destinationPath), EntryCallbacks::create(successCallback, errorCallback, parent->filesystem(), destinationPath, source->isDirectory()));
return true;
}
@@ -138,7 +152,7 @@ bool DOMFileSystemBase::remove(const EntryBase* entry, PassRefPtr<VoidCallback>
// We don't allow calling remove() on the root directory.
if (entry->fullPath() == String(DOMFilePath::root))
return false;
- m_asyncFileSystem->remove(entry->fullPath(), VoidCallbacks::create(successCallback, errorCallback));
+ m_asyncFileSystem->remove(createFileSystemURL(entry), VoidCallbacks::create(successCallback, errorCallback));
return true;
}
@@ -148,7 +162,7 @@ bool DOMFileSystemBase::removeRecursively(const EntryBase* entry, PassRefPtr<Voi
// We don't allow calling remove() on the root directory.
if (entry->fullPath() == String(DOMFilePath::root))
return false;
- m_asyncFileSystem->removeRecursively(entry->fullPath(), VoidCallbacks::create(successCallback, errorCallback));
+ m_asyncFileSystem->removeRecursively(createFileSystemURL(entry), VoidCallbacks::create(successCallback, errorCallback));
return true;
}
@@ -157,42 +171,42 @@ bool DOMFileSystemBase::getParent(const EntryBase* entry, PassRefPtr<EntryCallba
ASSERT(entry);
String path = DOMFilePath::getDirectory(entry->fullPath());
- m_asyncFileSystem->directoryExists(path, EntryCallbacks::create(successCallback, errorCallback, this, path, true));
+ m_asyncFileSystem->directoryExists(createFileSystemURL(path), EntryCallbacks::create(successCallback, errorCallback, this, path, true));
return true;
}
bool DOMFileSystemBase::getFile(const EntryBase* entry, const String& path, PassRefPtr<WebKitFlags> flags, PassRefPtr<EntryCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback)
{
String absolutePath;
- if (!pathToAbsolutePath(m_asyncFileSystem->type(), entry, path, 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(absolutePath, flags->isExclusive(), callbacks.release());
+ m_asyncFileSystem->createFile(createFileSystemURL(absolutePath), flags->isExclusive(), callbacks.release());
else
- m_asyncFileSystem->fileExists(absolutePath, callbacks.release());
+ 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)
{
String absolutePath;
- if (!pathToAbsolutePath(m_asyncFileSystem->type(), entry, path, 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(absolutePath, flags->isExclusive(), callbacks.release());
+ m_asyncFileSystem->createDirectory(createFileSystemURL(absolutePath), flags->isExclusive(), callbacks.release());
else
- m_asyncFileSystem->directoryExists(absolutePath, callbacks.release());
+ m_asyncFileSystem->directoryExists(createFileSystemURL(absolutePath), callbacks.release());
return true;
}
bool DOMFileSystemBase::readDirectory(PassRefPtr<DirectoryReaderBase> reader, const String& path, PassRefPtr<EntriesCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback)
{
ASSERT(DOMFilePath::isAbsolute(path));
- m_asyncFileSystem->readDirectory(path, EntriesCallbacks::create(successCallback, errorCallback, reader, path));
+ m_asyncFileSystem->readDirectory(createFileSystemURL(path), EntriesCallbacks::create(successCallback, errorCallback, reader, path));
return true;
}
diff --git a/Source/WebCore/Modules/filesystem/DOMFileSystemBase.h b/Source/WebCore/Modules/filesystem/DOMFileSystemBase.h
index 42f0db570..8ea4fe241 100644
--- a/Source/WebCore/Modules/filesystem/DOMFileSystemBase.h
+++ b/Source/WebCore/Modules/filesystem/DOMFileSystemBase.h
@@ -34,6 +34,8 @@
#if ENABLE(FILE_SYSTEM)
#include "AsyncFileSystem.h"
+#include "FileSystemType.h"
+#include "KURL.h"
#include "PlatformString.h"
#include "WebKitFlags.h"
#include <wtf/PassRefPtr.h>
@@ -47,7 +49,6 @@ class EntriesCallback;
class EntryBase;
class EntryCallback;
class ErrorCallback;
-class KURL;
class MetadataCallback;
class ScriptExecutionContext;
class SecurityOrigin;
@@ -56,16 +57,31 @@ class VoidCallback;
// A common base class for DOMFileSystem and DOMFileSystemSync.
class DOMFileSystemBase : public RefCounted<DOMFileSystemBase> {
public:
- static PassRefPtr<DOMFileSystemBase> create(ScriptExecutionContext* context, const String& name, PassOwnPtr<AsyncFileSystem> asyncFileSystem)
+ // Path prefixes that are used in the filesystem URLs (that can be obtained by toURL()).
+ // http://www.w3.org/TR/file-system-api/#widl-Entry-toURL
+ static const char persistentPathPrefix[];
+ static const size_t persistentPathPrefixLength;
+ static const char temporaryPathPrefix[];
+ static const size_t temporaryPathPrefixLength;
+
+ static PassRefPtr<DOMFileSystemBase> create(ScriptExecutionContext* context, const String& name, FileSystemType type, const KURL& rootURL, PassOwnPtr<AsyncFileSystem> asyncFileSystem)
{
- return adoptRef(new DOMFileSystemBase(context, name, asyncFileSystem));
+ return adoptRef(new DOMFileSystemBase(context, name, type, rootURL, asyncFileSystem));
}
virtual ~DOMFileSystemBase();
const String& name() const { return m_name; }
+ FileSystemType type() const { return m_type; }
+ KURL rootURL() const { return m_filesystemRootURL; }
AsyncFileSystem* asyncFileSystem() const { return m_asyncFileSystem.get(); }
SecurityOrigin* securityOrigin() const;
+ static bool isValidType(FileSystemType);
+ static bool crackFileSystemURL(const KURL&, FileSystemType&, String& filePath);
+ bool supportsToURL() const;
+ KURL createFileSystemURL(const EntryBase*) const;
+ KURL createFileSystemURL(const String& fullPath) const;
+
// Actual FileSystem API implementations. All the validity checks on virtual paths are done at this level.
// They return false for immediate errors that don't involve lower AsyncFileSystem layer (e.g. for name validation errors). Otherwise they return true (but later may call back with an runtime error).
bool getMetadata(const EntryBase*, PassRefPtr<MetadataCallback>, PassRefPtr<ErrorCallback>);
@@ -79,14 +95,19 @@ public:
bool readDirectory(PassRefPtr<DirectoryReaderBase>, const String& path, PassRefPtr<EntriesCallback>, PassRefPtr<ErrorCallback>);
protected:
- DOMFileSystemBase(ScriptExecutionContext*, const String& name, PassOwnPtr<AsyncFileSystem>);
+ DOMFileSystemBase(ScriptExecutionContext*, const String& name, FileSystemType, const KURL& rootURL, PassOwnPtr<AsyncFileSystem>);
friend class DOMFileSystemSync;
ScriptExecutionContext* m_context;
String m_name;
+ FileSystemType m_type;
+ KURL m_filesystemRootURL;
+
mutable OwnPtr<AsyncFileSystem> m_asyncFileSystem;
};
+inline bool operator==(const DOMFileSystemBase& a, const DOMFileSystemBase& b) { return a.name() == b.name() && a.type() == b.type() && a.rootURL() == b.rootURL(); }
+
} // namespace WebCore
#endif // ENABLE(FILE_SYSTEM)
diff --git a/Source/WebCore/Modules/filesystem/DOMFileSystemSync.cpp b/Source/WebCore/Modules/filesystem/DOMFileSystemSync.cpp
index 8b772bb33..8a57d005e 100644
--- a/Source/WebCore/Modules/filesystem/DOMFileSystemSync.cpp
+++ b/Source/WebCore/Modules/filesystem/DOMFileSystemSync.cpp
@@ -53,11 +53,11 @@ class FileWriterBase;
PassRefPtr<DOMFileSystemSync> DOMFileSystemSync::create(DOMFileSystemBase* fileSystem)
{
- return adoptRef(new DOMFileSystemSync(fileSystem->m_context, fileSystem->m_name, fileSystem->m_asyncFileSystem.release()));
+ return adoptRef(new DOMFileSystemSync(fileSystem->m_context, fileSystem->name(), fileSystem->type(), fileSystem->rootURL(), fileSystem->m_asyncFileSystem.release()));
}
-DOMFileSystemSync::DOMFileSystemSync(ScriptExecutionContext* context, const String& name, PassOwnPtr<AsyncFileSystem> asyncFileSystem)
- : DOMFileSystemBase(context, name, asyncFileSystem)
+DOMFileSystemSync::DOMFileSystemSync(ScriptExecutionContext* context, const String& name, FileSystemType type, const KURL& rootURL, PassOwnPtr<AsyncFileSystem> asyncFileSystem)
+ : DOMFileSystemBase(context, name, type, rootURL, asyncFileSystem)
{
}
@@ -134,7 +134,7 @@ PassRefPtr<File> DOMFileSystemSync::createFile(const FileEntrySync* fileEntry, E
{
ec = 0;
RefPtr<CreateFileHelper::CreateFileResult> result(CreateFileHelper::CreateFileResult::create());
- m_asyncFileSystem->createSnapshotFileAndReadMetadata(fileEntry->fullPath(), CreateFileHelper::create(result, fileEntry->name()));
+ m_asyncFileSystem->createSnapshotFileAndReadMetadata(createFileSystemURL(fileEntry), CreateFileHelper::create(result, fileEntry->name()));
if (!m_asyncFileSystem->waitForOperationToComplete()) {
ec = FileException::ABORT_ERR;
return 0;
@@ -223,7 +223,7 @@ PassRefPtr<FileWriterSync> DOMFileSystemSync::createWriter(const FileEntrySync*
RefPtr<LocalErrorCallback> errorCallback = LocalErrorCallback::create();
OwnPtr<FileWriterBaseCallbacks> callbacks = FileWriterBaseCallbacks::create(fileWriter, successCallback, errorCallback);
- m_asyncFileSystem->createWriter(fileWriter.get(), fileEntry->fullPath(), callbacks.release());
+ m_asyncFileSystem->createWriter(fileWriter.get(), createFileSystemURL(fileEntry), callbacks.release());
if (!m_asyncFileSystem->waitForOperationToComplete()) {
ec = FileException::ABORT_ERR;
return 0;
diff --git a/Source/WebCore/Modules/filesystem/DOMFileSystemSync.h b/Source/WebCore/Modules/filesystem/DOMFileSystemSync.h
index 0120fb058..24fbd1594 100644
--- a/Source/WebCore/Modules/filesystem/DOMFileSystemSync.h
+++ b/Source/WebCore/Modules/filesystem/DOMFileSystemSync.h
@@ -46,9 +46,9 @@ typedef int ExceptionCode;
class DOMFileSystemSync : public DOMFileSystemBase {
public:
- static PassRefPtr<DOMFileSystemSync> create(ScriptExecutionContext* context, const String& name, PassOwnPtr<AsyncFileSystem> asyncFileSystem)
+ static PassRefPtr<DOMFileSystemSync> create(ScriptExecutionContext* context, const String& name, FileSystemType type, const KURL& rootURL, PassOwnPtr<AsyncFileSystem> asyncFileSystem)
{
- return adoptRef(new DOMFileSystemSync(context, name, asyncFileSystem));
+ return adoptRef(new DOMFileSystemSync(context, name, type, rootURL, asyncFileSystem));
}
static PassRefPtr<DOMFileSystemSync> create(DOMFileSystemBase*);
@@ -61,7 +61,7 @@ public:
PassRefPtr<FileWriterSync> createWriter(const FileEntrySync*, ExceptionCode&);
private:
- DOMFileSystemSync(ScriptExecutionContext*, const String& name, PassOwnPtr<AsyncFileSystem>);
+ DOMFileSystemSync(ScriptExecutionContext*, const String& name, FileSystemType, const KURL& rootURL, PassOwnPtr<AsyncFileSystem>);
};
}
diff --git a/Source/WebCore/Modules/filesystem/DOMWindowFileSystem.cpp b/Source/WebCore/Modules/filesystem/DOMWindowFileSystem.cpp
index 5e012a242..179ece6f4 100644
--- a/Source/WebCore/Modules/filesystem/DOMWindowFileSystem.cpp
+++ b/Source/WebCore/Modules/filesystem/DOMWindowFileSystem.cpp
@@ -66,12 +66,12 @@ void DOMWindowFileSystem::webkitRequestFileSystem(DOMWindow* window, int type, l
}
FileSystemType fileSystemType = static_cast<FileSystemType>(type);
- if (!AsyncFileSystem::isValidType(fileSystemType)) {
+ if (!DOMFileSystemBase::isValidType(fileSystemType)) {
DOMFileSystem::scheduleCallback(document, errorCallback, FileError::create(FileError::INVALID_MODIFICATION_ERR));
return;
}
- LocalFileSystem::localFileSystem().requestFileSystem(document, fileSystemType, size, FileSystemCallbacks::create(successCallback, errorCallback, document), AsynchronousFileSystem);
+ LocalFileSystem::localFileSystem().requestFileSystem(document, fileSystemType, size, FileSystemCallbacks::create(successCallback, errorCallback, document, fileSystemType), AsynchronousFileSystem);
}
void DOMWindowFileSystem::webkitResolveLocalFileSystemURL(DOMWindow* window, const String& url, PassRefPtr<EntryCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback)
@@ -92,12 +92,12 @@ void DOMWindowFileSystem::webkitResolveLocalFileSystemURL(DOMWindow* window, con
FileSystemType type;
String filePath;
- if (!completedURL.isValid() || !AsyncFileSystem::crackFileSystemURL(completedURL, type, filePath)) {
+ if (!completedURL.isValid() || !DOMFileSystemBase::crackFileSystemURL(completedURL, type, filePath)) {
DOMFileSystem::scheduleCallback(document, errorCallback, FileError::create(FileError::ENCODING_ERR));
return;
}
- LocalFileSystem::localFileSystem().readFileSystem(document, type, ResolveURICallbacks::create(successCallback, errorCallback, document, filePath));
+ LocalFileSystem::localFileSystem().readFileSystem(document, type, ResolveURICallbacks::create(successCallback, errorCallback, document, type, filePath));
}
COMPILE_ASSERT(static_cast<int>(DOMWindowFileSystem::TEMPORARY) == static_cast<int>(FileSystemTypeTemporary), enum_mismatch);
diff --git a/Source/WebCore/Modules/filesystem/EntryBase.cpp b/Source/WebCore/Modules/filesystem/EntryBase.cpp
index 72a22bd85..50e608940 100644
--- a/Source/WebCore/Modules/filesystem/EntryBase.cpp
+++ b/Source/WebCore/Modules/filesystem/EntryBase.cpp
@@ -54,9 +54,13 @@ EntryBase::~EntryBase()
{
}
-KURL EntryBase::toURL() const
+String EntryBase::toURL() const
{
- return m_fileSystem->asyncFileSystem()->toURL(m_fileSystem->securityOrigin()->toString(), m_fullPath);
+ // Some filesystem type may not support toURL.
+ if (!m_fileSystem->supportsToURL())
+ return String();
+
+ return m_fileSystem->createFileSystemURL(this).string();
}
} // namespace WebCore
diff --git a/Source/WebCore/Modules/filesystem/EntryBase.h b/Source/WebCore/Modules/filesystem/EntryBase.h
index 01569cb2a..da21c24aa 100644
--- a/Source/WebCore/Modules/filesystem/EntryBase.h
+++ b/Source/WebCore/Modules/filesystem/EntryBase.h
@@ -33,9 +33,8 @@
#if ENABLE(FILE_SYSTEM)
-#include "KURL.h"
-#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
+#include <wtf/text/WTFString.h>
namespace WebCore {
@@ -55,7 +54,7 @@ public:
const String& fullPath() const { return m_fullPath; }
const String& name() const { return m_name; }
- KURL toURL() const;
+ String toURL() const;
protected:
EntryBase(PassRefPtr<DOMFileSystemBase>, const String& fullPath);
diff --git a/Source/WebCore/Modules/filesystem/FileSystemCallbacks.cpp b/Source/WebCore/Modules/filesystem/FileSystemCallbacks.cpp
index 1e9a99d24..ab0834b12 100644
--- a/Source/WebCore/Modules/filesystem/FileSystemCallbacks.cpp
+++ b/Source/WebCore/Modules/filesystem/FileSystemCallbacks.cpp
@@ -134,23 +134,24 @@ void EntriesCallbacks::didReadDirectoryEntries(bool hasMore)
// FileSystemCallbacks --------------------------------------------------------
-PassOwnPtr<FileSystemCallbacks> FileSystemCallbacks::create(PassRefPtr<FileSystemCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback, ScriptExecutionContext* scriptExecutionContext)
+PassOwnPtr<FileSystemCallbacks> FileSystemCallbacks::create(PassRefPtr<FileSystemCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback, ScriptExecutionContext* scriptExecutionContext, FileSystemType type)
{
- return adoptPtr(new FileSystemCallbacks(successCallback, errorCallback, scriptExecutionContext));
+ return adoptPtr(new FileSystemCallbacks(successCallback, errorCallback, scriptExecutionContext, type));
}
-FileSystemCallbacks::FileSystemCallbacks(PassRefPtr<FileSystemCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback, ScriptExecutionContext* context)
+FileSystemCallbacks::FileSystemCallbacks(PassRefPtr<FileSystemCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback, ScriptExecutionContext* context, FileSystemType type)
: FileSystemCallbacksBase(errorCallback)
, m_successCallback(successCallback)
, m_scriptExecutionContext(context)
+ , m_type(type)
{
}
-void FileSystemCallbacks::didOpenFileSystem(const String& name, PassOwnPtr<AsyncFileSystem> asyncFileSystem)
+void FileSystemCallbacks::didOpenFileSystem(const String& name, const KURL& rootURL, PassOwnPtr<AsyncFileSystem> asyncFileSystem)
{
if (m_successCallback) {
ASSERT(asyncFileSystem);
- RefPtr<DOMFileSystem> fileSystem = DOMFileSystem::create(m_scriptExecutionContext.get(), name, asyncFileSystem);
+ RefPtr<DOMFileSystem> fileSystem = DOMFileSystem::create(m_scriptExecutionContext.get(), name, m_type, rootURL, asyncFileSystem);
m_successCallback->handleEvent(fileSystem.get());
m_scriptExecutionContext.clear();
}
@@ -196,23 +197,24 @@ private:
} // namespace
-PassOwnPtr<ResolveURICallbacks> ResolveURICallbacks::create(PassRefPtr<EntryCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback, ScriptExecutionContext* scriptExecutionContext, const String& filePath)
+PassOwnPtr<ResolveURICallbacks> ResolveURICallbacks::create(PassRefPtr<EntryCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback, ScriptExecutionContext* scriptExecutionContext, FileSystemType type, const String& filePath)
{
- return adoptPtr(new ResolveURICallbacks(successCallback, errorCallback, scriptExecutionContext, filePath));
+ return adoptPtr(new ResolveURICallbacks(successCallback, errorCallback, scriptExecutionContext, type, filePath));
}
-ResolveURICallbacks::ResolveURICallbacks(PassRefPtr<EntryCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback, ScriptExecutionContext* context, const String& filePath)
+ResolveURICallbacks::ResolveURICallbacks(PassRefPtr<EntryCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback, ScriptExecutionContext* context, FileSystemType type, const String& filePath)
: FileSystemCallbacksBase(errorCallback)
, m_successCallback(successCallback)
, m_scriptExecutionContext(context)
+ , m_type(type)
, m_filePath(filePath)
{
}
-void ResolveURICallbacks::didOpenFileSystem(const String& name, PassOwnPtr<AsyncFileSystem> asyncFileSystem)
+void ResolveURICallbacks::didOpenFileSystem(const String& name, const KURL& rootURL, PassOwnPtr<AsyncFileSystem> asyncFileSystem)
{
ASSERT(asyncFileSystem);
- RefPtr<DirectoryEntry> root = DOMFileSystem::create(m_scriptExecutionContext.get(), name, asyncFileSystem)->root();
+ 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));
}
diff --git a/Source/WebCore/Modules/filesystem/FileSystemCallbacks.h b/Source/WebCore/Modules/filesystem/FileSystemCallbacks.h
index 2d19b6a57..ac3292696 100644
--- a/Source/WebCore/Modules/filesystem/FileSystemCallbacks.h
+++ b/Source/WebCore/Modules/filesystem/FileSystemCallbacks.h
@@ -34,6 +34,7 @@
#if ENABLE(FILE_SYSTEM)
#include "AsyncFileSystemCallbacks.h"
+#include "FileSystemType.h"
#include "PlatformString.h"
#include <wtf/PassRefPtr.h>
#include <wtf/Vector.h>
@@ -100,24 +101,26 @@ private:
class FileSystemCallbacks : public FileSystemCallbacksBase {
public:
- static PassOwnPtr<FileSystemCallbacks> create(PassRefPtr<FileSystemCallback>, PassRefPtr<ErrorCallback>, ScriptExecutionContext*);
- virtual void didOpenFileSystem(const String& name, PassOwnPtr<AsyncFileSystem>);
+ static PassOwnPtr<FileSystemCallbacks> create(PassRefPtr<FileSystemCallback>, PassRefPtr<ErrorCallback>, ScriptExecutionContext*, FileSystemType);
+ virtual void didOpenFileSystem(const String& name, const KURL& rootURL, PassOwnPtr<AsyncFileSystem>);
private:
- FileSystemCallbacks(PassRefPtr<FileSystemCallback>, PassRefPtr<ErrorCallback>, ScriptExecutionContext*);
+ FileSystemCallbacks(PassRefPtr<FileSystemCallback>, PassRefPtr<ErrorCallback>, ScriptExecutionContext*, FileSystemType);
RefPtr<FileSystemCallback> m_successCallback;
RefPtr<ScriptExecutionContext> m_scriptExecutionContext;
+ FileSystemType m_type;
};
class ResolveURICallbacks : public FileSystemCallbacksBase {
public:
- static PassOwnPtr<ResolveURICallbacks> create(PassRefPtr<EntryCallback>, PassRefPtr<ErrorCallback>, ScriptExecutionContext*, const String& filePath);
- virtual void didOpenFileSystem(const String& name, PassOwnPtr<AsyncFileSystem>);
+ static PassOwnPtr<ResolveURICallbacks> create(PassRefPtr<EntryCallback>, PassRefPtr<ErrorCallback>, ScriptExecutionContext*, FileSystemType, const String& filePath);
+ virtual void didOpenFileSystem(const String& name, const KURL& rootURL, PassOwnPtr<AsyncFileSystem>);
private:
- ResolveURICallbacks(PassRefPtr<EntryCallback>, PassRefPtr<ErrorCallback>, ScriptExecutionContext*, const String& filePath);
+ ResolveURICallbacks(PassRefPtr<EntryCallback>, PassRefPtr<ErrorCallback>, ScriptExecutionContext*, FileSystemType, const String& filePath);
RefPtr<EntryCallback> m_successCallback;
RefPtr<ScriptExecutionContext> m_scriptExecutionContext;
+ FileSystemType m_type;
String m_filePath;
};
diff --git a/Source/WebCore/platform/FileSystemType.h b/Source/WebCore/Modules/filesystem/FileSystemType.h
index a2fd9ae63..a2fd9ae63 100644
--- a/Source/WebCore/platform/FileSystemType.h
+++ b/Source/WebCore/Modules/filesystem/FileSystemType.h
diff --git a/Source/WebCore/Modules/filesystem/LocalFileSystem.cpp b/Source/WebCore/Modules/filesystem/LocalFileSystem.cpp
index 03c710156..0eaafae19 100644
--- a/Source/WebCore/Modules/filesystem/LocalFileSystem.cpp
+++ b/Source/WebCore/Modules/filesystem/LocalFileSystem.cpp
@@ -77,21 +77,21 @@ String LocalFileSystem::fileSystemBasePath() const
return m_basePath;
}
-static void openFileSystem(ScriptExecutionContext*, const String& basePath, const String& identifier, AsyncFileSystem::Type type, bool create, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
+static void openFileSystem(ScriptExecutionContext*, const String& basePath, const String& identifier, bool create, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
{
- AsyncFileSystem::openFileSystem(basePath, identifier, type, create, callbacks);
+ AsyncFileSystem::openFileSystem(basePath, identifier, create, callbacks);
}
-void LocalFileSystem::readFileSystem(ScriptExecutionContext* context, AsyncFileSystem::Type type, PassOwnPtr<AsyncFileSystemCallbacks> callbacks, bool)
+void LocalFileSystem::readFileSystem(ScriptExecutionContext* context, DOMFileSystemBase::Type, PassOwnPtr<AsyncFileSystemCallbacks> callbacks, FileSystemSynchronousMode)
{
// AsyncFileSystem::openFileSystem calls callbacks synchronously, so the method needs to be called asynchronously.
- context->postTask(createCallbackTask(&openFileSystem, fileSystemBasePath(), context->securityOrigin()->databaseIdentifier(), type, false, callbacks));
+ context->postTask(createCallbackTask(&openFileSystem, fileSystemBasePath(), context->securityOrigin()->databaseIdentifier(), false, callbacks));
}
-void LocalFileSystem::requestFileSystem(ScriptExecutionContext* context, AsyncFileSystem::Type type, long long, PassOwnPtr<AsyncFileSystemCallbacks> callbacks, FileSystemSynchronousType)
+void LocalFileSystem::requestFileSystem(ScriptExecutionContext* context, DOMFileSystemBase::Type, long long, PassOwnPtr<AsyncFileSystemCallbacks> callbacks, FileSystemSynchronousType)
{
// AsyncFileSystem::openFileSystem calls callbacks synchronously, so the method needs to be called asynchronously.
- context->postTask(createCallbackTask(&openFileSystem, fileSystemBasePath(), context->securityOrigin()->databaseIdentifier(), type, true, callbacks));
+ context->postTask(createCallbackTask(&openFileSystem, fileSystemBasePath(), context->securityOrigin()->databaseIdentifier(), true, callbacks));
}
} // namespace
diff --git a/Source/WebCore/Modules/filesystem/LocalFileSystem.h b/Source/WebCore/Modules/filesystem/LocalFileSystem.h
index 485588646..bd71e3e44 100644
--- a/Source/WebCore/Modules/filesystem/LocalFileSystem.h
+++ b/Source/WebCore/Modules/filesystem/LocalFileSystem.h
@@ -33,7 +33,7 @@
#if ENABLE(FILE_SYSTEM)
-#include "AsyncFileSystemCallbacks.h"
+#include "DOMFileSystemBase.h"
#include "FileSystemType.h"
#include "PlatformString.h"
#include <wtf/PassRefPtr.h>
diff --git a/Source/WebCore/Modules/filesystem/WorkerContextFileSystem.cpp b/Source/WebCore/Modules/filesystem/WorkerContextFileSystem.cpp
index f42c80a21..d62ee3273 100644
--- a/Source/WebCore/Modules/filesystem/WorkerContextFileSystem.cpp
+++ b/Source/WebCore/Modules/filesystem/WorkerContextFileSystem.cpp
@@ -31,7 +31,6 @@
#if ENABLE(FILE_SYSTEM)
#include "AsyncFileSystem.h"
-#include "DOMFileSystem.h"
#include "DOMFileSystemBase.h"
#include "DOMFileSystemSync.h"
#include "DirectoryEntrySync.h"
@@ -58,12 +57,12 @@ void WorkerContextFileSystem::webkitRequestFileSystem(WorkerContext* worker, int
}
FileSystemType fileSystemType = static_cast<FileSystemType>(type);
- if (!AsyncFileSystem::isValidType(fileSystemType)) {
+ if (!DOMFileSystemBase::isValidType(fileSystemType)) {
DOMFileSystem::scheduleCallback(worker, errorCallback, FileError::create(FileError::INVALID_MODIFICATION_ERR));
return;
}
- LocalFileSystem::localFileSystem().requestFileSystem(worker, fileSystemType, size, FileSystemCallbacks::create(successCallback, errorCallback, worker), AsynchronousFileSystem);
+ LocalFileSystem::localFileSystem().requestFileSystem(worker, fileSystemType, size, FileSystemCallbacks::create(successCallback, errorCallback, worker, fileSystemType), AsynchronousFileSystem);
}
PassRefPtr<DOMFileSystemSync> WorkerContextFileSystem::webkitRequestFileSystemSync(WorkerContext* worker, int type, long long size, ExceptionCode& ec)
@@ -76,13 +75,13 @@ PassRefPtr<DOMFileSystemSync> WorkerContextFileSystem::webkitRequestFileSystemSy
}
FileSystemType fileSystemType = static_cast<FileSystemType>(type);
- if (!AsyncFileSystem::isValidType(fileSystemType)) {
+ if (!DOMFileSystemBase::isValidType(fileSystemType)) {
ec = FileException::INVALID_MODIFICATION_ERR;
return 0;
}
FileSystemSyncCallbackHelper helper;
- LocalFileSystem::localFileSystem().requestFileSystem(worker, fileSystemType, size, FileSystemCallbacks::create(helper.successCallback(), helper.errorCallback(), worker), SynchronousFileSystem);
+ LocalFileSystem::localFileSystem().requestFileSystem(worker, fileSystemType, size, FileSystemCallbacks::create(helper.successCallback(), helper.errorCallback(), worker, fileSystemType), SynchronousFileSystem);
return helper.getResult(ec);
}
@@ -97,12 +96,12 @@ void WorkerContextFileSystem::webkitResolveLocalFileSystemURL(WorkerContext* wor
FileSystemType type;
String filePath;
- if (!completedURL.isValid() || !AsyncFileSystem::crackFileSystemURL(completedURL, type, filePath)) {
+ if (!completedURL.isValid() || !DOMFileSystemBase::crackFileSystemURL(completedURL, type, filePath)) {
DOMFileSystem::scheduleCallback(worker, errorCallback, FileError::create(FileError::ENCODING_ERR));
return;
}
- LocalFileSystem::localFileSystem().readFileSystem(worker, type, ResolveURICallbacks::create(successCallback, errorCallback, worker, filePath));
+ LocalFileSystem::localFileSystem().readFileSystem(worker, type, ResolveURICallbacks::create(successCallback, errorCallback, worker, type, filePath));
}
PassRefPtr<EntrySync> WorkerContextFileSystem::webkitResolveLocalFileSystemSyncURL(WorkerContext* worker, const String& url, ExceptionCode& ec)
@@ -117,13 +116,13 @@ PassRefPtr<EntrySync> WorkerContextFileSystem::webkitResolveLocalFileSystemSyncU
FileSystemType type;
String filePath;
- if (!completedURL.isValid() || !AsyncFileSystem::crackFileSystemURL(completedURL, type, filePath)) {
+ if (!completedURL.isValid() || !DOMFileSystemBase::crackFileSystemURL(completedURL, type, filePath)) {
ec = FileException::ENCODING_ERR;
return 0;
}
FileSystemSyncCallbackHelper readFileSystemHelper;
- LocalFileSystem::localFileSystem().readFileSystem(worker, type, FileSystemCallbacks::create(readFileSystemHelper.successCallback(), readFileSystemHelper.errorCallback(), worker), SynchronousFileSystem);
+ LocalFileSystem::localFileSystem().readFileSystem(worker, type, FileSystemCallbacks::create(readFileSystemHelper.successCallback(), readFileSystemHelper.errorCallback(), worker, type), SynchronousFileSystem);
RefPtr<DOMFileSystemSync> fileSystem = readFileSystemHelper.getResult(ec);
if (!fileSystem)
return 0;
diff --git a/Source/WebCore/Modules/filesystem/chromium/DOMFileSystemChromium.cpp b/Source/WebCore/Modules/filesystem/chromium/DOMFileSystemChromium.cpp
new file mode 100644
index 000000000..17d15f22e
--- /dev/null
+++ b/Source/WebCore/Modules/filesystem/chromium/DOMFileSystemChromium.cpp
@@ -0,0 +1,133 @@
+/*
+ * 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 "DOMFileSystemChromium.h"
+
+#if ENABLE(FILE_SYSTEM)
+
+#include "DOMFilePath.h"
+#include "FileSystemType.h"
+#include "PlatformSupport.h"
+#include "ScriptExecutionContext.h"
+#include "SecurityOrigin.h"
+#include <wtf/text/StringBuilder.h>
+#include <wtf/text/WTFString.h>
+
+namespace WebCore {
+
+const char isolatedPathPrefix[] = "isolated";
+const char externalPathPrefix[] = "external";
+
+// static
+bool DOMFileSystemBase::isValidType(FileSystemType type)
+{
+ return type == FileSystemTypeTemporary || type == FileSystemTypePersistent || type == FileSystemTypeIsolated || type == FileSystemTypeExternal;
+}
+
+// static
+bool DOMFileSystemBase::crackFileSystemURL(const KURL& url, FileSystemType& type, String& filePath)
+{
+ if (!url.protocolIs("filesystem"))
+ return false;
+
+ if (!url.innerURL())
+ return false;
+
+ String typeString = url.innerURL()->path().substring(1);
+ if (typeString == temporaryPathPrefix)
+ type = FileSystemTypeTemporary;
+ else if (typeString == persistentPathPrefix)
+ type = FileSystemTypePersistent;
+ else if (typeString == externalPathPrefix)
+ type = FileSystemTypeExternal;
+ else
+ return false;
+
+ filePath = decodeURLEscapeSequences(url.path());
+ return true;
+}
+
+bool DOMFileSystemBase::supportsToURL() const
+{
+ ASSERT(isValidType(m_type));
+ return m_type != FileSystemTypeIsolated;
+}
+
+KURL DOMFileSystemBase::createFileSystemURL(const String& fullPath) const
+{
+ ASSERT(DOMFilePath::isAbsolute(fullPath));
+
+ if (type() == FileSystemTypeExternal) {
+ // For external filesystem originString could be different from what we have in m_filesystemRootURL.
+ StringBuilder result;
+ result.append("filesystem:");
+ result.append(securityOrigin()->toString());
+ result.append("/");
+ result.append(externalPathPrefix);
+ result.append(encodeWithURLEscapeSequences(fullPath));
+ return KURL(ParsedURLString, result.toString());
+ }
+
+ // For regular types we can just append the entry's fullPath to the m_filesystemRootURL that should look like 'filesystem:<origin>/<typePrefix>'.
+ ASSERT(!m_filesystemRootURL.isEmpty());
+ KURL url = m_filesystemRootURL;
+ // Remove the extra leading slash.
+ url.setPath(url.path() + encodeWithURLEscapeSequences(fullPath.substring(1)));
+ return url;
+}
+
+// static
+PassRefPtr<DOMFileSystem> DOMFileSystemChromium::createIsolatedFileSystem(ScriptExecutionContext* context, const String& filesystemId)
+{
+ StringBuilder filesystemName;
+ filesystemName.append(context->securityOrigin()->databaseIdentifier());
+ filesystemName.append(":");
+ filesystemName.append(isolatedPathPrefix);
+ filesystemName.append("_");
+ filesystemName.append(filesystemId);
+
+ // The rootURL created here is going to be attached to each filesystem request and
+ // is to be validated each time the request is being handled.
+ StringBuilder rootURL;
+ rootURL.append("filesystem:");
+ rootURL.append(context->securityOrigin()->toString());
+ rootURL.append("/");
+ rootURL.append(isolatedPathPrefix);
+ rootURL.append("/");
+ rootURL.append(filesystemId);
+ rootURL.append("/");
+
+ return DOMFileSystem::create(context, filesystemName.toString(), FileSystemTypeIsolated, KURL(ParsedURLString, rootURL.toString()), PlatformSupport::createAsyncFileSystem());
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(FILE_SYSTEM)
diff --git a/Source/WebCore/platform/graphics/FractionalLayoutSize.cpp b/Source/WebCore/Modules/filesystem/chromium/DOMFileSystemChromium.h
index b10152227..914081cce 100644
--- a/Source/WebCore/platform/graphics/FractionalLayoutSize.cpp
+++ b/Source/WebCore/Modules/filesystem/chromium/DOMFileSystemChromium.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 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,16 +28,22 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "config.h"
-#include "FractionalLayoutSize.h"
+#ifndef DOMFileSystemChromium_h
+#define DOMFileSystemChromium_h
-#include "FractionalLayoutPoint.h"
+#if ENABLE(FILE_SYSTEM)
+
+#include "DOMFileSystem.h"
namespace WebCore {
-IntSize pixelSnappedIntSize(const FractionalLayoutSize& s, const FractionalLayoutPoint& p)
-{
- return IntSize(snapSizeToPixel(s.width(), p.x()), snapSizeToPixel(s.height(), p.y()));
-}
+class DOMFileSystemChromium {
+public:
+ static PassRefPtr<DOMFileSystem> createIsolatedFileSystem(ScriptExecutionContext*, const String& filesystemId);
+};
} // namespace WebCore
+
+#endif // ENABLE(FILE_SYSTEM)
+
+#endif // DOMFileSystemChromium_h
diff --git a/Source/WebCore/Modules/filesystem/chromium/DataTransferItemFileSystemChromium.cpp b/Source/WebCore/Modules/filesystem/chromium/DataTransferItemFileSystemChromium.cpp
index c75554c66..a6bb3cdf9 100644
--- a/Source/WebCore/Modules/filesystem/chromium/DataTransferItemFileSystemChromium.cpp
+++ b/Source/WebCore/Modules/filesystem/chromium/DataTransferItemFileSystemChromium.cpp
@@ -120,7 +120,7 @@ void DataTransferItemFileSystem::webkitGetAsEntry(DataTransferItem* item, Script
// The dropped entries are mapped as top-level entries in the isolated filesystem.
String virtualPath = DOMFilePath::append("/", static_cast<File*>(file)->name());
- domFileSystem->asyncFileSystem()->readMetadata(virtualPath, GetAsEntryCallbacks::create(domFileSystem, virtualPath, callback));
+ domFileSystem->asyncFileSystem()->readMetadata(domFileSystem->createFileSystemURL(virtualPath), GetAsEntryCallbacks::create(domFileSystem, virtualPath, callback));
}
} // namespace WebCore
diff --git a/Source/WebCore/Modules/filesystem/chromium/DraggedIsolatedFileSystem.cpp b/Source/WebCore/Modules/filesystem/chromium/DraggedIsolatedFileSystem.cpp
index df5c14c0c..079514f16 100644
--- a/Source/WebCore/Modules/filesystem/chromium/DraggedIsolatedFileSystem.cpp
+++ b/Source/WebCore/Modules/filesystem/chromium/DraggedIsolatedFileSystem.cpp
@@ -33,7 +33,7 @@
#if ENABLE(FILE_SYSTEM)
-#include "DOMFileSystem.h"
+#include "DOMFileSystemChromium.h"
#include "PlatformSupport.h"
#include "ScriptExecutionContext.h"
#include "SecurityOrigin.h"
@@ -51,9 +51,7 @@ DOMFileSystem* DraggedIsolatedFileSystem::getDOMFileSystem(ScriptExecutionContex
ASSERT(!m_filesystemId.isEmpty());
if (!m_filesystem) {
ASSERT(scriptExecutionContext);
- SecurityOrigin* securityOrigin = scriptExecutionContext->securityOrigin();
- String filesystemName = PlatformSupport::createIsolatedFileSystemName(securityOrigin->databaseIdentifier(), m_filesystemId);
- m_filesystem = DOMFileSystem::create(scriptExecutionContext, filesystemName, PlatformSupport::createIsolatedFileSystem(securityOrigin->toString(), m_filesystemId));
+ m_filesystem = DOMFileSystemChromium::createIsolatedFileSystem(scriptExecutionContext, m_filesystemId);
}
return m_filesystem.get();
}
diff --git a/Source/WebCore/Modules/indexeddb/DOMWindowIndexedDatabase.cpp b/Source/WebCore/Modules/indexeddb/DOMWindowIndexedDatabase.cpp
index 4bade70f2..9f4cbb4f7 100644
--- a/Source/WebCore/Modules/indexeddb/DOMWindowIndexedDatabase.cpp
+++ b/Source/WebCore/Modules/indexeddb/DOMWindowIndexedDatabase.cpp
@@ -58,18 +58,36 @@ DOMWindowIndexedDatabase* DOMWindowIndexedDatabase::from(DOMWindow* window)
return supplement;
}
-void DOMWindowIndexedDatabase::disconnectFrame()
+void DOMWindowIndexedDatabase::disconnectFrameForPageCache()
{
m_suspendedIDBFactory = m_idbFactory.release();
- DOMWindowProperty::disconnectFrame();
+ DOMWindowProperty::disconnectFrameForPageCache();
}
-void DOMWindowIndexedDatabase::reconnectFrame(Frame* frame)
+void DOMWindowIndexedDatabase::reconnectFrameFromPageCache(Frame* frame)
{
- DOMWindowProperty::reconnectFrame(frame);
+ DOMWindowProperty::reconnectFrameFromPageCache(frame);
m_idbFactory = m_suspendedIDBFactory.release();
}
+void DOMWindowIndexedDatabase::willDestroyGlobalObjectInCachedFrame()
+{
+ m_suspendedIDBFactory = nullptr;
+ DOMWindowProperty::willDestroyGlobalObjectInCachedFrame();
+}
+
+void DOMWindowIndexedDatabase::willDestroyGlobalObjectInFrame()
+{
+ m_idbFactory = nullptr;
+ DOMWindowProperty::willDestroyGlobalObjectInFrame();
+}
+
+void DOMWindowIndexedDatabase::willDetachGlobalObjectFromFrame()
+{
+ m_idbFactory = nullptr;
+ DOMWindowProperty::willDetachGlobalObjectFromFrame();
+}
+
IDBFactory* DOMWindowIndexedDatabase::webkitIndexedDB(DOMWindow* window)
{
return from(window)->webkitIndexedDB();
diff --git a/Source/WebCore/Modules/indexeddb/DOMWindowIndexedDatabase.h b/Source/WebCore/Modules/indexeddb/DOMWindowIndexedDatabase.h
index d1a10b153..fd32f9d42 100644
--- a/Source/WebCore/Modules/indexeddb/DOMWindowIndexedDatabase.h
+++ b/Source/WebCore/Modules/indexeddb/DOMWindowIndexedDatabase.h
@@ -43,8 +43,11 @@ public:
static IDBFactory* webkitIndexedDB(DOMWindow*);
- virtual void disconnectFrame() OVERRIDE;
- virtual void reconnectFrame(Frame*) OVERRIDE;
+ virtual void disconnectFrameForPageCache() OVERRIDE;
+ virtual void reconnectFrameFromPageCache(Frame*) OVERRIDE;
+ virtual void willDestroyGlobalObjectInCachedFrame() OVERRIDE;
+ virtual void willDestroyGlobalObjectInFrame() OVERRIDE;
+ virtual void willDetachGlobalObjectFromFrame() OVERRIDE;
private:
explicit DOMWindowIndexedDatabase(DOMWindow*);
diff --git a/Source/WebCore/Modules/indexeddb/IDBBackingStore.h b/Source/WebCore/Modules/indexeddb/IDBBackingStore.h
index 9be26db73..e7b222281 100644
--- a/Source/WebCore/Modules/indexeddb/IDBBackingStore.h
+++ b/Source/WebCore/Modules/indexeddb/IDBBackingStore.h
@@ -113,7 +113,7 @@ public:
public:
virtual ~Transaction() { }
virtual void begin() = 0;
- virtual void commit() = 0;
+ virtual bool commit() = 0;
virtual void rollback() = 0;
};
virtual PassRefPtr<Transaction> createTransaction() = 0;
diff --git a/Source/WebCore/Modules/indexeddb/IDBCursor.cpp b/Source/WebCore/Modules/indexeddb/IDBCursor.cpp
index 8a1bcf7d0..7823042dd 100644
--- a/Source/WebCore/Modules/indexeddb/IDBCursor.cpp
+++ b/Source/WebCore/Modules/indexeddb/IDBCursor.cpp
@@ -45,6 +45,31 @@ PassRefPtr<IDBCursor> IDBCursor::create(PassRefPtr<IDBCursorBackendInterface> ba
return adoptRef(new IDBCursor(backend, request, source, transaction));
}
+const AtomicString& IDBCursor::directionNext()
+{
+ DEFINE_STATIC_LOCAL(AtomicString, next, ("next"));
+ return next;
+}
+
+const AtomicString& IDBCursor::directionNextUnique()
+{
+ DEFINE_STATIC_LOCAL(AtomicString, nextunique, ("nextunique"));
+ return nextunique;
+}
+
+const AtomicString& IDBCursor::directionPrev()
+{
+ DEFINE_STATIC_LOCAL(AtomicString, prev, ("prev"));
+ return prev;
+}
+
+const AtomicString& IDBCursor::directionPrevUnique()
+{
+ DEFINE_STATIC_LOCAL(AtomicString, prevunique, ("prevunique"));
+ return prevunique;
+}
+
+
IDBCursor::IDBCursor(PassRefPtr<IDBCursorBackendInterface> backend, IDBRequest* request, IDBAny* source, IDBTransaction* transaction)
: m_backend(backend)
, m_request(request)
@@ -63,10 +88,13 @@ IDBCursor::~IDBCursor()
{
}
-unsigned short IDBCursor::direction() const
+const String& IDBCursor::direction() const
{
IDB_TRACE("IDBCursor::direction");
- return m_backend->direction();
+ ExceptionCode ec = 0;
+ const AtomicString& direction = directionToString(m_backend->direction(), ec);
+ ASSERT(!ec);
+ return direction;
}
PassRefPtr<IDBKey> IDBCursor::key() const
@@ -208,6 +236,43 @@ void IDBCursor::setValueReady()
m_gotValue = true;
}
+unsigned short IDBCursor::stringToDirection(const String& directionString, ExceptionCode& ec)
+{
+ if (directionString == IDBCursor::directionNext())
+ return IDBCursor::NEXT;
+ if (directionString == IDBCursor::directionNextUnique())
+ return IDBCursor::NEXT_NO_DUPLICATE;
+ if (directionString == IDBCursor::directionPrev())
+ return IDBCursor::PREV;
+ if (directionString == IDBCursor::directionPrevUnique())
+ return IDBCursor::PREV_NO_DUPLICATE;
+
+ // FIXME: should be a JavaScript TypeError. See https://bugs.webkit.org/show_bug.cgi?id=85513
+ ec = IDBDatabaseException::NON_TRANSIENT_ERR;
+ return 0;
+}
+
+const AtomicString& IDBCursor::directionToString(unsigned short direction, ExceptionCode& ec)
+{
+ switch (direction) {
+ case IDBCursor::NEXT:
+ return IDBCursor::directionNext();
+
+ case IDBCursor::NEXT_NO_DUPLICATE:
+ return IDBCursor::directionNextUnique();
+
+ case IDBCursor::PREV:
+ return IDBCursor::directionPrev();
+
+ case IDBCursor::PREV_NO_DUPLICATE:
+ return IDBCursor::directionPrevUnique();
+
+ default:
+ ec = IDBDatabaseException::NON_TRANSIENT_ERR;
+ return IDBCursor::directionNext();
+ }
+}
+
} // namespace WebCore
#endif // ENABLE(INDEXED_DATABASE)
diff --git a/Source/WebCore/Modules/indexeddb/IDBCursor.h b/Source/WebCore/Modules/indexeddb/IDBCursor.h
index 5b9593b9f..cece00a4f 100644
--- a/Source/WebCore/Modules/indexeddb/IDBCursor.h
+++ b/Source/WebCore/Modules/indexeddb/IDBCursor.h
@@ -53,6 +53,15 @@ public:
PREV = 2,
PREV_NO_DUPLICATE = 3,
};
+
+ static const AtomicString& directionNext();
+ static const AtomicString& directionNextUnique();
+ static const AtomicString& directionPrev();
+ static const AtomicString& directionPrevUnique();
+
+ static unsigned short stringToDirection(const String& modeString, ExceptionCode&);
+ static const AtomicString& directionToString(unsigned short mode, ExceptionCode&);
+
static PassRefPtr<IDBCursor> create(PassRefPtr<IDBCursorBackendInterface>, IDBRequest*, IDBAny* source, IDBTransaction*);
virtual ~IDBCursor();
@@ -60,7 +69,7 @@ public:
void continueFunction(ExceptionCode& ec) { continueFunction(0, ec); }
// Implement the IDL
- unsigned short direction() const;
+ const String& direction() const;
PassRefPtr<IDBKey> key() const;
PassRefPtr<IDBKey> primaryKey() const;
PassRefPtr<IDBAny> value() const;
diff --git a/Source/WebCore/Modules/indexeddb/IDBCursor.idl b/Source/WebCore/Modules/indexeddb/IDBCursor.idl
index 80eb6b233..d73d14627 100644
--- a/Source/WebCore/Modules/indexeddb/IDBCursor.idl
+++ b/Source/WebCore/Modules/indexeddb/IDBCursor.idl
@@ -28,12 +28,13 @@ module storage {
interface [
Conditional=INDEXED_DATABASE,
] IDBCursor {
+ // FIXME: Eventually remove legacy enum constants, see https://bugs.webkit.org/show_bug.cgi?id=85315
const unsigned short NEXT = 0;
const unsigned short NEXT_NO_DUPLICATE = 1;
const unsigned short PREV = 2;
const unsigned short PREV_NO_DUPLICATE = 3;
- readonly attribute unsigned short direction;
+ readonly attribute DOMString direction;
readonly attribute IDBKey key;
readonly attribute IDBKey primaryKey;
readonly attribute IDBAny source;
diff --git a/Source/WebCore/Modules/indexeddb/IDBDatabase.cpp b/Source/WebCore/Modules/indexeddb/IDBDatabase.cpp
index ca65907fb..3060cdb69 100644
--- a/Source/WebCore/Modules/indexeddb/IDBDatabase.cpp
+++ b/Source/WebCore/Modules/indexeddb/IDBDatabase.cpp
@@ -137,14 +137,7 @@ PassRefPtr<IDBVersionChangeRequest> IDBDatabase::setVersion(ScriptExecutionConte
return request;
}
-PassRefPtr<IDBTransaction> IDBDatabase::transaction(ScriptExecutionContext* context, const String& storeName, unsigned short mode, ExceptionCode& ec)
-{
- RefPtr<DOMStringList> storeNames = DOMStringList::create();
- storeNames->append(storeName);
- return transaction(context, storeNames, mode, ec);
-}
-
-PassRefPtr<IDBTransaction> IDBDatabase::transaction(ScriptExecutionContext* context, PassRefPtr<DOMStringList> prpStoreNames, unsigned short mode, ExceptionCode& ec)
+PassRefPtr<IDBTransaction> IDBDatabase::transaction(ScriptExecutionContext* context, PassRefPtr<DOMStringList> prpStoreNames, const String& modeString, ExceptionCode& ec)
{
RefPtr<DOMStringList> storeNames = prpStoreNames;
if (!storeNames || storeNames->isEmpty()) {
@@ -152,10 +145,10 @@ PassRefPtr<IDBTransaction> IDBDatabase::transaction(ScriptExecutionContext* cont
return 0;
}
- if (mode != IDBTransaction::READ_WRITE && mode != IDBTransaction::READ_ONLY) {
- ec = IDBDatabaseException::NON_TRANSIENT_ERR;
+ unsigned short mode = IDBTransaction::stringToMode(modeString, ec);
+ if (ec)
return 0;
- }
+
if (m_closePending) {
ec = IDBDatabaseException::NOT_ALLOWED_ERR;
return 0;
@@ -175,6 +168,32 @@ PassRefPtr<IDBTransaction> IDBDatabase::transaction(ScriptExecutionContext* cont
return transaction.release();
}
+PassRefPtr<IDBTransaction> IDBDatabase::transaction(ScriptExecutionContext* context, const String& storeName, const String& mode, ExceptionCode& ec)
+{
+ RefPtr<DOMStringList> storeNames = DOMStringList::create();
+ storeNames->append(storeName);
+ return transaction(context, storeNames, mode, ec);
+}
+
+PassRefPtr<IDBTransaction> IDBDatabase::transaction(ScriptExecutionContext* context, const String& storeName, unsigned short mode, ExceptionCode& ec)
+{
+ RefPtr<DOMStringList> storeNames = DOMStringList::create();
+ storeNames->append(storeName);
+ return transaction(context, storeNames, mode, ec);
+}
+
+PassRefPtr<IDBTransaction> IDBDatabase::transaction(ScriptExecutionContext* context, PassRefPtr<DOMStringList> prpStoreNames, unsigned short mode, ExceptionCode& ec)
+{
+ DEFINE_STATIC_LOCAL(String, consoleMessage, ("Numeric transaction modes are deprecated in IDBDatabase.transaction. Use \"readonly\" or \"readwrite\"."));
+ context->addConsoleMessage(JSMessageSource, LogMessageType, WarningMessageLevel, consoleMessage);
+ AtomicString modeString = IDBTransaction::modeToString(mode, ec);
+ if (ec)
+ return 0;
+
+ return transaction(context, prpStoreNames, modeString, ec);
+}
+
+
void IDBDatabase::close()
{
if (m_closePending)
diff --git a/Source/WebCore/Modules/indexeddb/IDBDatabase.h b/Source/WebCore/Modules/indexeddb/IDBDatabase.h
index 3d0bb9a7a..6656352f3 100644
--- a/Source/WebCore/Modules/indexeddb/IDBDatabase.h
+++ b/Source/WebCore/Modules/indexeddb/IDBDatabase.h
@@ -64,6 +64,8 @@ public:
// FIXME: Try to modify the code generator so this is unneeded.
PassRefPtr<IDBObjectStore> createObjectStore(const String& name, ExceptionCode& ec) { return createObjectStore(name, Dictionary(), ec); }
PassRefPtr<IDBObjectStore> createObjectStore(const String& name, const Dictionary&, ExceptionCode&);
+ PassRefPtr<IDBTransaction> transaction(ScriptExecutionContext*, PassRefPtr<DOMStringList>, const String& mode, ExceptionCode&);
+ PassRefPtr<IDBTransaction> transaction(ScriptExecutionContext*, const String&, const String& mode, ExceptionCode&);
PassRefPtr<IDBTransaction> transaction(ScriptExecutionContext*, PassRefPtr<DOMStringList>, unsigned short mode, ExceptionCode&);
PassRefPtr<IDBTransaction> transaction(ScriptExecutionContext*, const String&, unsigned short mode, ExceptionCode&);
void deleteObjectStore(const String& name, ExceptionCode&);
diff --git a/Source/WebCore/Modules/indexeddb/IDBDatabase.idl b/Source/WebCore/Modules/indexeddb/IDBDatabase.idl
index bd9f7d039..95f6c2360 100644
--- a/Source/WebCore/Modules/indexeddb/IDBDatabase.idl
+++ b/Source/WebCore/Modules/indexeddb/IDBDatabase.idl
@@ -45,12 +45,21 @@ module storage {
raises (IDBDatabaseException);
[CallWith=ScriptExecutionContext] IDBVersionChangeRequest setVersion(in DOMString version)
raises (IDBDatabaseException);
- [CallWith=ScriptExecutionContext] IDBTransaction transaction(in DOMStringList storeNames, in [Optional=DefaultIsUndefined] unsigned short mode)
+ [CallWith=ScriptExecutionContext] IDBTransaction transaction(in DOMStringList storeNames, in [Optional=DefaultIsNullString] DOMString mode)
raises (IDBDatabaseException);
- [CallWith=ScriptExecutionContext] IDBTransaction transaction(in DOMString[] storeNames, in [Optional=DefaultIsUndefined] unsigned short mode)
+ [CallWith=ScriptExecutionContext] IDBTransaction transaction(in DOMString[] storeNames, in [Optional=DefaultIsNullString] DOMString mode)
raises (IDBDatabaseException);
- [CallWith=ScriptExecutionContext] IDBTransaction transaction(in DOMString storeName, in [Optional=DefaultIsUndefined] unsigned short mode)
+ [CallWith=ScriptExecutionContext] IDBTransaction transaction(in DOMString storeName, in [Optional=DefaultIsNullString] DOMString mode)
raises (IDBDatabaseException);
+
+ // FIXME: remove these when https://bugs.webkit.org/show_bug.cgi?id=85326 is fixed.
+ [CallWith=ScriptExecutionContext] IDBTransaction transaction(in DOMStringList storeNames, in unsigned short mode)
+ raises (IDBDatabaseException);
+ [CallWith=ScriptExecutionContext] IDBTransaction transaction(in DOMString[] storeNames, in unsigned short mode)
+ raises (IDBDatabaseException);
+ [CallWith=ScriptExecutionContext] IDBTransaction transaction(in DOMString storeName, in unsigned short mode)
+ raises (IDBDatabaseException);
+
void close();
// EventTarget interface
diff --git a/Source/WebCore/Modules/indexeddb/IDBIndex.cpp b/Source/WebCore/Modules/indexeddb/IDBIndex.cpp
index a88cade20..57cdb1215 100644
--- a/Source/WebCore/Modules/indexeddb/IDBIndex.cpp
+++ b/Source/WebCore/Modules/indexeddb/IDBIndex.cpp
@@ -56,14 +56,12 @@ IDBIndex::~IDBIndex()
{
}
-PassRefPtr<IDBRequest> IDBIndex::openCursor(ScriptExecutionContext* context, PassRefPtr<IDBKeyRange> keyRange, unsigned short direction, ExceptionCode& ec)
+PassRefPtr<IDBRequest> IDBIndex::openCursor(ScriptExecutionContext* context, PassRefPtr<IDBKeyRange> keyRange, const String& directionString, ExceptionCode& ec)
{
IDB_TRACE("IDBIndex::openCursor");
- if (direction != IDBCursor::NEXT && direction != IDBCursor::NEXT_NO_DUPLICATE && direction != IDBCursor::PREV && direction != IDBCursor::PREV_NO_DUPLICATE) {
- // FIXME: May need to change when specced: http://www.w3.org/Bugs/Public/show_bug.cgi?id=11406
- ec = IDBDatabaseException::CONSTRAINT_ERR;
+ unsigned short direction = IDBCursor::stringToDirection(directionString, ec);
+ if (ec)
return 0;
- }
RefPtr<IDBRequest> request = IDBRequest::create(context, IDBAny::create(this), m_transaction.get());
request->setCursorType(IDBCursorBackendInterface::IndexCursor);
@@ -75,9 +73,29 @@ PassRefPtr<IDBRequest> IDBIndex::openCursor(ScriptExecutionContext* context, Pas
return request;
}
+PassRefPtr<IDBRequest> IDBIndex::openCursor(ScriptExecutionContext* context, PassRefPtr<IDBKeyRange> keyRange, unsigned short direction, ExceptionCode& ec)
+{
+ IDB_TRACE("IDBIndex::openCursor");
+ DEFINE_STATIC_LOCAL(String, consoleMessage, ("Numeric direction values are deprecated in IDBIndex.openCursor. Use \"next\", \"nextunique\", \"prev\", or \"prevunique\"."));
+ context->addConsoleMessage(JSMessageSource, LogMessageType, WarningMessageLevel, consoleMessage);
+ const String& directionString = IDBCursor::directionToString(direction, ec);
+ if (ec)
+ return 0;
+ return openCursor(context, keyRange, directionString, ec);
+}
+
+PassRefPtr<IDBRequest> IDBIndex::openCursor(ScriptExecutionContext* context, PassRefPtr<IDBKey> key, const String& direction, ExceptionCode& ec)
+{
+ IDB_TRACE("IDBIndex::openCursor");
+ RefPtr<IDBKeyRange> keyRange = IDBKeyRange::only(key, ec);
+ if (ec)
+ return 0;
+ return openCursor(context, keyRange.release(), ec);
+}
+
PassRefPtr<IDBRequest> IDBIndex::openCursor(ScriptExecutionContext* context, PassRefPtr<IDBKey> key, unsigned short direction, ExceptionCode& ec)
{
- IDB_TRACE("IDBObjectStore::openCursor");
+ IDB_TRACE("IDBIndex::openCursor");
RefPtr<IDBKeyRange> keyRange = IDBKeyRange::only(key, ec);
if (ec)
return 0;
@@ -105,14 +123,13 @@ PassRefPtr<IDBRequest> IDBIndex::count(ScriptExecutionContext* context, PassRefP
return count(context, keyRange.release(), ec);
}
-PassRefPtr<IDBRequest> IDBIndex::openKeyCursor(ScriptExecutionContext* context, PassRefPtr<IDBKeyRange> keyRange, unsigned short direction, ExceptionCode& ec)
+PassRefPtr<IDBRequest> IDBIndex::openKeyCursor(ScriptExecutionContext* context, PassRefPtr<IDBKeyRange> keyRange, const String& directionString, ExceptionCode& ec)
{
IDB_TRACE("IDBIndex::openKeyCursor");
- if (direction != IDBCursor::NEXT && direction != IDBCursor::NEXT_NO_DUPLICATE && direction != IDBCursor::PREV && direction != IDBCursor::PREV_NO_DUPLICATE) {
- // FIXME: May need to change when specced: http://www.w3.org/Bugs/Public/show_bug.cgi?id=11406
- ec = IDBDatabaseException::CONSTRAINT_ERR;
+
+ unsigned short direction = IDBCursor::stringToDirection(directionString, ec);
+ if (ec)
return 0;
- }
RefPtr<IDBRequest> request = IDBRequest::create(context, IDBAny::create(this), m_transaction.get());
request->setCursorType(IDBCursorBackendInterface::IndexKeyCursor);
@@ -124,9 +141,29 @@ PassRefPtr<IDBRequest> IDBIndex::openKeyCursor(ScriptExecutionContext* context,
return request;
}
+PassRefPtr<IDBRequest> IDBIndex::openKeyCursor(ScriptExecutionContext* context, PassRefPtr<IDBKeyRange> keyRange, unsigned short direction, ExceptionCode& ec)
+{
+ IDB_TRACE("IDBIndex::openKeyCursor");
+ DEFINE_STATIC_LOCAL(String, consoleMessage, ("Numeric direction values are deprecated in IDBIndex.openKeyCursor. Use \"next\", \"nextunique\", \"prev\", or \"prevunique\"."));
+ context->addConsoleMessage(JSMessageSource, LogMessageType, WarningMessageLevel, consoleMessage);
+ const String& directionString = IDBCursor::directionToString(direction, ec);
+ if (ec)
+ return 0;
+ return openKeyCursor(context, keyRange, directionString, ec);
+}
+
+PassRefPtr<IDBRequest> IDBIndex::openKeyCursor(ScriptExecutionContext* context, PassRefPtr<IDBKey> key, const String& direction, ExceptionCode& ec)
+{
+ IDB_TRACE("IDBIndex::openKeyCursor");
+ RefPtr<IDBKeyRange> keyRange = IDBKeyRange::only(key, ec);
+ if (ec)
+ return 0;
+ return openKeyCursor(context, keyRange.release(), ec);
+}
+
PassRefPtr<IDBRequest> IDBIndex::openKeyCursor(ScriptExecutionContext* context, PassRefPtr<IDBKey> key, unsigned short direction, ExceptionCode& ec)
{
- IDB_TRACE("IDBObjectStore::openKeyCursor");
+ IDB_TRACE("IDBIndex::openKeyCursor");
RefPtr<IDBKeyRange> keyRange = IDBKeyRange::only(key, ec);
if (ec)
return 0;
diff --git a/Source/WebCore/Modules/indexeddb/IDBIndex.h b/Source/WebCore/Modules/indexeddb/IDBIndex.h
index ebbbf96aa..caa10e9ff 100644
--- a/Source/WebCore/Modules/indexeddb/IDBIndex.h
+++ b/Source/WebCore/Modules/indexeddb/IDBIndex.h
@@ -56,8 +56,10 @@ public:
// FIXME: Try to modify the code generator so this is unneeded.
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::NEXT, ec); }
- PassRefPtr<IDBRequest> openCursor(ScriptExecutionContext* context, PassRefPtr<IDBKey> key, ExceptionCode& ec) { return openCursor(context, key, IDBCursor::NEXT, 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*, 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); }
@@ -65,8 +67,10 @@ public:
PassRefPtr<IDBRequest> count(ScriptExecutionContext*, PassRefPtr<IDBKey>, ExceptionCode&);
PassRefPtr<IDBRequest> openKeyCursor(ScriptExecutionContext* context, ExceptionCode& ec) { return openKeyCursor(context, static_cast<IDBKeyRange*>(0), ec); }
- PassRefPtr<IDBRequest> openKeyCursor(ScriptExecutionContext* context, PassRefPtr<IDBKeyRange> keyRange, ExceptionCode& ec) { return openKeyCursor(context, keyRange, IDBCursor::NEXT, ec); }
- PassRefPtr<IDBRequest> openKeyCursor(ScriptExecutionContext* context, PassRefPtr<IDBKey> key, ExceptionCode& ec) { return openKeyCursor(context, key, IDBCursor::NEXT, ec); }
+ PassRefPtr<IDBRequest> openKeyCursor(ScriptExecutionContext* context, PassRefPtr<IDBKeyRange> keyRange, ExceptionCode& ec) { return openKeyCursor(context, keyRange, IDBCursor::directionNext(), ec); }
+ PassRefPtr<IDBRequest> openKeyCursor(ScriptExecutionContext* context, PassRefPtr<IDBKey> key, ExceptionCode& ec) { return openKeyCursor(context, key, IDBCursor::directionNext(), ec); }
+ PassRefPtr<IDBRequest> openKeyCursor(ScriptExecutionContext*, PassRefPtr<IDBKeyRange>, const String& direction, ExceptionCode&);
+ PassRefPtr<IDBRequest> openKeyCursor(ScriptExecutionContext*, PassRefPtr<IDBKey>, const String& direction, ExceptionCode&);
PassRefPtr<IDBRequest> openKeyCursor(ScriptExecutionContext*, PassRefPtr<IDBKeyRange>, unsigned short direction, ExceptionCode&);
PassRefPtr<IDBRequest> openKeyCursor(ScriptExecutionContext*, PassRefPtr<IDBKey>, unsigned short direction, ExceptionCode&);
diff --git a/Source/WebCore/Modules/indexeddb/IDBIndex.idl b/Source/WebCore/Modules/indexeddb/IDBIndex.idl
index b23e55acd..f18f6b793 100644
--- a/Source/WebCore/Modules/indexeddb/IDBIndex.idl
+++ b/Source/WebCore/Modules/indexeddb/IDBIndex.idl
@@ -34,6 +34,18 @@ module storage {
readonly attribute boolean unique;
readonly attribute boolean multiEntry;
+ [CallWith=ScriptExecutionContext] IDBRequest openCursor(in [Optional] IDBKeyRange range, in [Optional] DOMString direction)
+ raises (IDBDatabaseException);
+ [CallWith=ScriptExecutionContext] IDBRequest openCursor(in IDBKey key, in [Optional] DOMString direction)
+ raises (IDBDatabaseException);
+
+ [CallWith=ScriptExecutionContext] IDBRequest openKeyCursor(in [Optional] IDBKeyRange range, in [Optional] DOMString direction)
+ raises (IDBDatabaseException);
+ [CallWith=ScriptExecutionContext] IDBRequest openKeyCursor(in IDBKey key, in [Optional] DOMString direction)
+ raises (IDBDatabaseException);
+
+ // FIXME: remove these when
+ // https://bugs.webkit.org/show_bug.cgi?id=85326 is fixed.
[CallWith=ScriptExecutionContext] IDBRequest openCursor(in [Optional] IDBKeyRange range, in [Optional] unsigned short direction)
raises (IDBDatabaseException);
[CallWith=ScriptExecutionContext] IDBRequest openCursor(in IDBKey key, in [Optional] unsigned short direction)
@@ -42,6 +54,7 @@ module storage {
raises (IDBDatabaseException);
[CallWith=ScriptExecutionContext] IDBRequest openKeyCursor(in IDBKey key, in [Optional] unsigned short direction)
raises (IDBDatabaseException);
+
[CallWith=ScriptExecutionContext] IDBRequest get(in IDBKeyRange key)
raises (IDBDatabaseException);
[CallWith=ScriptExecutionContext] IDBRequest get(in IDBKey key)
diff --git a/Source/WebCore/Modules/indexeddb/IDBLevelDBBackingStore.cpp b/Source/WebCore/Modules/indexeddb/IDBLevelDBBackingStore.cpp
index 2a7fdfecd..c7ef752cc 100644
--- a/Source/WebCore/Modules/indexeddb/IDBLevelDBBackingStore.cpp
+++ b/Source/WebCore/Modules/indexeddb/IDBLevelDBBackingStore.cpp
@@ -309,8 +309,7 @@ bool IDBLevelDBBackingStore::deleteDatabase(const String& name)
const Vector<char> key = DatabaseNameKey::encode(m_identifier, name);
m_currentTransaction->remove(key);
- transaction->commit();
- return true;
+ return transaction->commit();
}
static bool checkObjectStoreAndMetaDataType(const LevelDBIterator* it, const Vector<char>& stopKey, int64_t objectStoreId, int64_t metaDataType)
@@ -1575,11 +1574,12 @@ void IDBLevelDBBackingStore::Transaction::begin()
m_backingStore->m_currentTransaction = LevelDBTransaction::create(m_backingStore->m_db.get());
}
-void IDBLevelDBBackingStore::Transaction::commit()
+bool IDBLevelDBBackingStore::Transaction::commit()
{
ASSERT(m_backingStore->m_currentTransaction);
- m_backingStore->m_currentTransaction->commit();
+ bool result = m_backingStore->m_currentTransaction->commit();
m_backingStore->m_currentTransaction.clear();
+ return result;
}
void IDBLevelDBBackingStore::Transaction::rollback()
diff --git a/Source/WebCore/Modules/indexeddb/IDBLevelDBBackingStore.h b/Source/WebCore/Modules/indexeddb/IDBLevelDBBackingStore.h
index ec3063b6e..e17a6f1fb 100644
--- a/Source/WebCore/Modules/indexeddb/IDBLevelDBBackingStore.h
+++ b/Source/WebCore/Modules/indexeddb/IDBLevelDBBackingStore.h
@@ -93,7 +93,7 @@ private:
public:
static PassRefPtr<Transaction> create(IDBLevelDBBackingStore*);
virtual void begin();
- virtual void commit();
+ virtual bool commit();
virtual void rollback();
private:
diff --git a/Source/WebCore/Modules/indexeddb/IDBLevelDBCoding.cpp b/Source/WebCore/Modules/indexeddb/IDBLevelDBCoding.cpp
index 1ea561e47..50de12f37 100644
--- a/Source/WebCore/Modules/indexeddb/IDBLevelDBCoding.cpp
+++ b/Source/WebCore/Modules/indexeddb/IDBLevelDBCoding.cpp
@@ -180,7 +180,7 @@ Vector<char> minIDBKey()
Vector<char> encodeBool(bool b)
{
Vector<char> ret(1);
- ret.append(b ? 1 : 0);
+ ret[0] = b ? 1 : 0;
return ret;
}
diff --git a/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp b/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp
index 4319d7f0a..301631497 100644
--- a/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp
+++ b/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp
@@ -255,14 +255,12 @@ void IDBObjectStore::deleteIndex(const String& name, ExceptionCode& ec)
m_backend->deleteIndex(name, m_transaction->backend(), ec);
}
-PassRefPtr<IDBRequest> IDBObjectStore::openCursor(ScriptExecutionContext* context, PassRefPtr<IDBKeyRange> range, unsigned short direction, ExceptionCode& ec)
+PassRefPtr<IDBRequest> IDBObjectStore::openCursor(ScriptExecutionContext* context, PassRefPtr<IDBKeyRange> range, const String& directionString, ExceptionCode& ec)
{
IDB_TRACE("IDBObjectStore::openCursor");
- if (direction != IDBCursor::NEXT && direction != IDBCursor::NEXT_NO_DUPLICATE && direction != IDBCursor::PREV && direction != IDBCursor::PREV_NO_DUPLICATE) {
- // FIXME: May need to change when specced: http://www.w3.org/Bugs/Public/show_bug.cgi?id=11406
- ec = IDBDatabaseException::CONSTRAINT_ERR;
+ unsigned short direction = IDBCursor::stringToDirection(directionString, ec);
+ if (ec)
return 0;
- }
RefPtr<IDBRequest> request = IDBRequest::create(context, IDBAny::create(this), m_transaction.get());
request->setCursorType(IDBCursorBackendInterface::ObjectStoreCursor);
@@ -274,7 +272,18 @@ PassRefPtr<IDBRequest> IDBObjectStore::openCursor(ScriptExecutionContext* contex
return request.release();
}
-PassRefPtr<IDBRequest> IDBObjectStore::openCursor(ScriptExecutionContext* context, PassRefPtr<IDBKey> key, unsigned short direction, ExceptionCode& ec)
+PassRefPtr<IDBRequest> IDBObjectStore::openCursor(ScriptExecutionContext* context, PassRefPtr<IDBKeyRange> range, unsigned short direction, ExceptionCode& ec)
+{
+ IDB_TRACE("IDBObjectStore::openCursor");
+ DEFINE_STATIC_LOCAL(String, consoleMessage, ("Numeric direction values are deprecated in IDBObjectStore.openCursor. Use\"next\", \"nextunique\", \"prev\", or \"prevunique\"."));
+ context->addConsoleMessage(JSMessageSource, LogMessageType, WarningMessageLevel, consoleMessage);
+ const String& directionString = IDBCursor::directionToString(direction, ec);
+ if (ec)
+ return 0;
+ return openCursor(context, range, directionString, ec);
+}
+
+PassRefPtr<IDBRequest> IDBObjectStore::openCursor(ScriptExecutionContext* context, PassRefPtr<IDBKey> key, const String& direction, ExceptionCode& ec)
{
IDB_TRACE("IDBObjectStore::openCursor");
RefPtr<IDBKeyRange> keyRange = IDBKeyRange::only(key, ec);
@@ -283,6 +292,15 @@ PassRefPtr<IDBRequest> IDBObjectStore::openCursor(ScriptExecutionContext* contex
return openCursor(context, keyRange.release(), ec);
}
+PassRefPtr<IDBRequest> IDBObjectStore::openCursor(ScriptExecutionContext* context, PassRefPtr<IDBKey> key, unsigned short direction, ExceptionCode& ec)
+{
+ IDB_TRACE("IDBObjectStore::openCursor");
+ RefPtr<IDBKeyRange> keyRange = IDBKeyRange::only(key, ec);
+ if (ec)
+ return 0;
+ return openCursor(context, key, direction, ec);
+}
+
PassRefPtr<IDBRequest> IDBObjectStore::count(ScriptExecutionContext* context, PassRefPtr<IDBKeyRange> range, ExceptionCode& ec)
{
IDB_TRACE("IDBObjectStore::count");
diff --git a/Source/WebCore/Modules/indexeddb/IDBObjectStore.h b/Source/WebCore/Modules/indexeddb/IDBObjectStore.h
index 5d4d18dc0..8dd292d60 100644
--- a/Source/WebCore/Modules/indexeddb/IDBObjectStore.h
+++ b/Source/WebCore/Modules/indexeddb/IDBObjectStore.h
@@ -65,8 +65,8 @@ public:
PassRefPtr<IDBRequest> put(ScriptExecutionContext* context, PassRefPtr<SerializedScriptValue> value, ExceptionCode& ec) { return put(context, value, 0, ec); }
PassRefPtr<IDBIndex> createIndex(const String& name, const String& keyPath, ExceptionCode& ec) { return createIndex(name, keyPath, Dictionary(), ec); }
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::NEXT, ec); }
- PassRefPtr<IDBRequest> openCursor(ScriptExecutionContext* context, PassRefPtr<IDBKey> key, ExceptionCode& ec) { return openCursor(context, key, IDBCursor::NEXT, 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> get(ScriptExecutionContext*, PassRefPtr<IDBKey>, ExceptionCode&);
PassRefPtr<IDBRequest> get(ScriptExecutionContext*, PassRefPtr<IDBKeyRange>, ExceptionCode&);
@@ -80,6 +80,8 @@ public:
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); }
diff --git a/Source/WebCore/Modules/indexeddb/IDBObjectStore.idl b/Source/WebCore/Modules/indexeddb/IDBObjectStore.idl
index 8ced38cd1..06642c69b 100644
--- a/Source/WebCore/Modules/indexeddb/IDBObjectStore.idl
+++ b/Source/WebCore/Modules/indexeddb/IDBObjectStore.idl
@@ -47,10 +47,17 @@ module storage {
raises (IDBDatabaseException);
[CallWith=ScriptExecutionContext] IDBRequest get(in IDBKey key)
raises (IDBDatabaseException);
+ [CallWith=ScriptExecutionContext] IDBRequest openCursor(in [Optional] IDBKeyRange range, in [Optional] DOMString direction)
+ raises (IDBDatabaseException);
+ [CallWith=ScriptExecutionContext] IDBRequest openCursor(in IDBKey key, in [Optional] DOMString direction)
+ raises (IDBDatabaseException);
+
+ // FIXME: remove these when https://bugs.webkit.org/show_bug.cgi?id=85326 is fixed.
[CallWith=ScriptExecutionContext] IDBRequest openCursor(in [Optional] IDBKeyRange range, in [Optional] unsigned short direction)
raises (IDBDatabaseException);
[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)
raises (IDBDatabaseException);
IDBIndex index(in DOMString name)
diff --git a/Source/WebCore/Modules/indexeddb/IDBRequest.cpp b/Source/WebCore/Modules/indexeddb/IDBRequest.cpp
index 6dc2a2126..37e8b0d4d 100644
--- a/Source/WebCore/Modules/indexeddb/IDBRequest.cpp
+++ b/Source/WebCore/Modules/indexeddb/IDBRequest.cpp
@@ -56,7 +56,7 @@ IDBRequest::IDBRequest(ScriptExecutionContext* context, PassRefPtr<IDBAny> sourc
, m_errorCode(0)
, m_source(source)
, m_transaction(transaction)
- , m_readyState(LOADING)
+ , m_readyState(PENDING)
, m_requestFinished(false)
, m_cursorFinished(false)
, m_contextStopped(false)
@@ -113,15 +113,21 @@ PassRefPtr<IDBTransaction> IDBRequest::transaction() const
return m_transaction;
}
-unsigned short IDBRequest::readyState() const
+const String& IDBRequest::readyState() const
{
- ASSERT(m_readyState == LOADING || m_readyState == DONE);
- return m_readyState;
+ ASSERT(m_readyState == PENDING || m_readyState == DONE);
+ DEFINE_STATIC_LOCAL(AtomicString, pending, ("pending"));
+ DEFINE_STATIC_LOCAL(AtomicString, done, ("done"));
+
+ if (m_readyState == PENDING)
+ return pending;
+
+ return done;
}
void IDBRequest::markEarlyDeath()
{
- ASSERT(m_readyState == LOADING);
+ ASSERT(m_readyState == PENDING);
m_readyState = EarlyDeath;
}
@@ -133,7 +139,7 @@ bool IDBRequest::resetReadyState(IDBTransaction* transaction)
if (m_readyState != DONE)
return false;
- m_readyState = LOADING;
+ m_readyState = PENDING;
m_result.clear();
m_errorCode = 0;
m_errorMessage = String();
@@ -153,7 +159,7 @@ void IDBRequest::abort()
if (m_contextStopped || !scriptExecutionContext())
return;
- if (m_readyState != LOADING) {
+ if (m_readyState != PENDING) {
ASSERT(m_readyState == DONE);
return;
}
@@ -186,7 +192,7 @@ void IDBRequest::setCursor(PassRefPtr<IDBCursor> cursor)
void IDBRequest::finishCursor()
{
m_cursorFinished = true;
- if (m_readyState != LOADING)
+ if (m_readyState != PENDING)
m_requestFinished = true;
}
@@ -268,7 +274,7 @@ void IDBRequest::onSuccess(PassRefPtr<IDBTransactionBackendInterface> prpBackend
m_transaction = frontend;
ASSERT(m_source->type() == IDBAny::IDBDatabaseType);
- ASSERT(m_transaction->mode() == IDBTransaction::VERSION_CHANGE);
+ ASSERT(m_transaction->mode() == IDBTransaction::modeVersionChange());
m_source->idbDatabase()->setVersionChangeTransaction(frontend.get());
IDBPendingTransactionMonitor::removePendingTransaction(m_transaction->backend());
@@ -311,7 +317,7 @@ void IDBRequest::stop()
return;
m_contextStopped = true;
- if (m_readyState == LOADING)
+ if (m_readyState == PENDING)
markEarlyDeath();
}
diff --git a/Source/WebCore/Modules/indexeddb/IDBRequest.h b/Source/WebCore/Modules/indexeddb/IDBRequest.h
index 1a69fa7b7..055d00190 100644
--- a/Source/WebCore/Modules/indexeddb/IDBRequest.h
+++ b/Source/WebCore/Modules/indexeddb/IDBRequest.h
@@ -59,11 +59,12 @@ public:
// Defined in the IDL
enum ReadyState {
- LOADING = 1,
+ PENDING = 1,
DONE = 2,
EarlyDeath = 3
};
- unsigned short readyState() const;
+
+ const String& readyState() const;
DEFINE_ATTRIBUTE_EVENT_LISTENER(success);
DEFINE_ATTRIBUTE_EVENT_LISTENER(error);
diff --git a/Source/WebCore/Modules/indexeddb/IDBRequest.idl b/Source/WebCore/Modules/indexeddb/IDBRequest.idl
index 8c3e38529..7cd341534 100644
--- a/Source/WebCore/Modules/indexeddb/IDBRequest.idl
+++ b/Source/WebCore/Modules/indexeddb/IDBRequest.idl
@@ -44,9 +44,7 @@ module storage {
readonly attribute IDBTransaction transaction;
// States
- const unsigned short LOADING = 1;
- const unsigned short DONE = 2;
- readonly attribute unsigned short readyState;
+ readonly attribute DOMString readyState;
// Events
attribute EventListener onsuccess;
diff --git a/Source/WebCore/Modules/indexeddb/IDBTransaction.cpp b/Source/WebCore/Modules/indexeddb/IDBTransaction.cpp
index 9e0b3a8f7..6388d088e 100644
--- a/Source/WebCore/Modules/indexeddb/IDBTransaction.cpp
+++ b/Source/WebCore/Modules/indexeddb/IDBTransaction.cpp
@@ -48,6 +48,37 @@ PassRefPtr<IDBTransaction> IDBTransaction::create(ScriptExecutionContext* contex
return transaction.release();
}
+const AtomicString& IDBTransaction::modeReadOnly()
+{
+ DEFINE_STATIC_LOCAL(AtomicString, readonly, ("readonly"));
+ return readonly;
+}
+
+const AtomicString& IDBTransaction::modeReadWrite()
+{
+ DEFINE_STATIC_LOCAL(AtomicString, readwrite, ("readwrite"));
+ return readwrite;
+}
+
+const AtomicString& IDBTransaction::modeVersionChange()
+{
+ DEFINE_STATIC_LOCAL(AtomicString, versionchange, ("versionchange"));
+ return versionchange;
+}
+
+const AtomicString& IDBTransaction::modeReadOnlyLegacy()
+{
+ DEFINE_STATIC_LOCAL(AtomicString, readonly, ("0"));
+ return readonly;
+}
+
+const AtomicString& IDBTransaction::modeReadWriteLegacy()
+{
+ DEFINE_STATIC_LOCAL(AtomicString, readwrite, ("1"));
+ return readwrite;
+}
+
+
IDBTransaction::IDBTransaction(ScriptExecutionContext* context, PassRefPtr<IDBTransactionBackendInterface> backend, IDBDatabase* db)
: ActiveDOMObject(context, this)
, m_backend(backend)
@@ -74,9 +105,12 @@ bool IDBTransaction::finished() const
return m_transactionFinished;
}
-unsigned short IDBTransaction::mode() const
+const String& IDBTransaction::mode() const
{
- return m_mode;
+ ExceptionCode ec = 0;
+ const AtomicString& mode = modeToString(m_mode, ec);
+ ASSERT(!ec);
+ return mode;
}
IDBDatabase* IDBTransaction::db() const
@@ -207,6 +241,38 @@ bool IDBTransaction::hasPendingActivity() const
return !m_transactionFinished || ActiveDOMObject::hasPendingActivity();
}
+unsigned short IDBTransaction::stringToMode(const String& modeString, ExceptionCode& ec)
+{
+ if (modeString.isNull()
+ || modeString == IDBTransaction::modeReadOnly())
+ return IDBTransaction::READ_ONLY;
+ if (modeString == IDBTransaction::modeReadWrite())
+ return IDBTransaction::READ_WRITE;
+ ec = IDBDatabaseException::NOT_ALLOWED_ERR;
+ return 0;
+}
+
+const AtomicString& IDBTransaction::modeToString(unsigned short mode, ExceptionCode& ec)
+{
+ switch (mode) {
+ case IDBTransaction::READ_ONLY:
+ return IDBTransaction::modeReadOnly();
+ break;
+
+ case IDBTransaction::READ_WRITE:
+ return IDBTransaction::modeReadWrite();
+ break;
+
+ case IDBTransaction::VERSION_CHANGE:
+ return IDBTransaction::modeVersionChange();
+ break;
+
+ default:
+ ec = IDBDatabaseException::NON_TRANSIENT_ERR;
+ return IDBTransaction::modeReadOnly();
+ }
+}
+
const AtomicString& IDBTransaction::interfaceName() const
{
return eventNames().interfaceForIDBTransaction;
diff --git a/Source/WebCore/Modules/indexeddb/IDBTransaction.h b/Source/WebCore/Modules/indexeddb/IDBTransaction.h
index 3c60350d6..b8038e5c1 100644
--- a/Source/WebCore/Modules/indexeddb/IDBTransaction.h
+++ b/Source/WebCore/Modules/indexeddb/IDBTransaction.h
@@ -56,10 +56,19 @@ public:
VERSION_CHANGE = 2
};
+ static const AtomicString& modeReadOnly();
+ static const AtomicString& modeReadWrite();
+ static const AtomicString& modeVersionChange();
+ static const AtomicString& modeReadOnlyLegacy();
+ static const AtomicString& modeReadWriteLegacy();
+
+ static unsigned short stringToMode(const String&, ExceptionCode&);
+ static const AtomicString& modeToString(unsigned short, ExceptionCode&);
+
IDBTransactionBackendInterface* backend() const;
bool finished() const;
- unsigned short mode() const;
+ const String& mode() const;
IDBDatabase* db() const;
PassRefPtr<IDBObjectStore> objectStore(const String& name, ExceptionCode&);
void abort();
@@ -117,7 +126,7 @@ private:
RefPtr<IDBTransactionBackendInterface> m_backend;
RefPtr<IDBDatabase> m_database;
- unsigned short m_mode;
+ const unsigned short m_mode;
bool m_transactionFinished; // Is it possible that we'll fire any more events or allow any new requests? If not, we're finished.
bool m_contextStopped;
diff --git a/Source/WebCore/Modules/indexeddb/IDBTransaction.idl b/Source/WebCore/Modules/indexeddb/IDBTransaction.idl
index 9e3b0e920..b585108b7 100644
--- a/Source/WebCore/Modules/indexeddb/IDBTransaction.idl
+++ b/Source/WebCore/Modules/indexeddb/IDBTransaction.idl
@@ -31,13 +31,13 @@ module storage {
ActiveDOMObject,
EventTarget
] IDBTransaction {
- // Modes
+ // FIXME: Eventually remove legacy enum constants, see https://bugs.webkit.org/show_bug.cgi?id=85315
const unsigned short READ_ONLY = 0;
const unsigned short READ_WRITE = 1;
const unsigned short VERSION_CHANGE = 2;
// Properties
- readonly attribute unsigned short mode;
+ readonly attribute DOMString mode;
readonly attribute IDBDatabase db;
// Methods
IDBObjectStore objectStore (in DOMString name)
diff --git a/Source/WebCore/Modules/indexeddb/IDBTransactionBackendImpl.cpp b/Source/WebCore/Modules/indexeddb/IDBTransactionBackendImpl.cpp
index 012e6b6dd..0a79a97a1 100644
--- a/Source/WebCore/Modules/indexeddb/IDBTransactionBackendImpl.cpp
+++ b/Source/WebCore/Modules/indexeddb/IDBTransactionBackendImpl.cpp
@@ -197,8 +197,10 @@ void IDBTransactionBackendImpl::commit()
m_state = Finished;
closeOpenCursors();
- m_transaction->commit();
- m_callbacks->onComplete();
+ if (m_transaction->commit())
+ m_callbacks->onComplete();
+ else
+ m_callbacks->onAbort();
m_database->transactionCoordinator()->didFinishTransaction(this);
m_database->transactionFinished(this);
m_database = 0;
diff --git a/Source/WebCore/Modules/mediastream/LocalMediaStream.cpp b/Source/WebCore/Modules/mediastream/LocalMediaStream.cpp
index 76265191c..9bd62ea39 100644
--- a/Source/WebCore/Modules/mediastream/LocalMediaStream.cpp
+++ b/Source/WebCore/Modules/mediastream/LocalMediaStream.cpp
@@ -35,19 +35,17 @@ namespace WebCore {
PassRefPtr<LocalMediaStream> LocalMediaStream::create(ScriptExecutionContext* context, const MediaStreamSourceVector& audioSources, const MediaStreamSourceVector& videoSources)
{
- RefPtr<LocalMediaStream> stream = adoptRef(new LocalMediaStream(context, audioSources, videoSources));
- stream->suspendIfNeeded();
- return stream.release();
+ return adoptRef(new LocalMediaStream(context, MediaStreamDescriptor::create(createCanonicalUUIDString(), audioSources, videoSources)));
}
-LocalMediaStream::LocalMediaStream(ScriptExecutionContext* context, const MediaStreamSourceVector& audioSources, const MediaStreamSourceVector& videoSources)
- : MediaStream(context, MediaStreamDescriptor::create(createCanonicalUUIDString(), audioSources, videoSources))
+PassRefPtr<LocalMediaStream> LocalMediaStream::create(ScriptExecutionContext* context, PassRefPtr<MediaStreamDescriptor> streamDescriptor)
{
+ return adoptRef(new LocalMediaStream(context, streamDescriptor));
}
-void LocalMediaStream::stopFunction()
+LocalMediaStream::LocalMediaStream(ScriptExecutionContext* context, PassRefPtr<MediaStreamDescriptor> streamDescriptor)
+ : MediaStream(context, streamDescriptor)
{
- stop();
}
void LocalMediaStream::stop()
diff --git a/Source/WebCore/Modules/mediastream/LocalMediaStream.h b/Source/WebCore/Modules/mediastream/LocalMediaStream.h
index 77703204d..e76d434f1 100644
--- a/Source/WebCore/Modules/mediastream/LocalMediaStream.h
+++ b/Source/WebCore/Modules/mediastream/LocalMediaStream.h
@@ -35,18 +35,16 @@ namespace WebCore {
class LocalMediaStream : public MediaStream {
public:
static PassRefPtr<LocalMediaStream> create(ScriptExecutionContext*, const MediaStreamSourceVector& audioSources, const MediaStreamSourceVector& videoSources);
+ static PassRefPtr<LocalMediaStream> create(ScriptExecutionContext*, PassRefPtr<MediaStreamDescriptor>);
virtual ~LocalMediaStream();
- void stopFunction();
-
- // ActiveDOMObject
- virtual void stop() OVERRIDE;
+ void stop();
// EventTarget
virtual const AtomicString& interfaceName() const OVERRIDE;
private:
- LocalMediaStream(ScriptExecutionContext*, const MediaStreamSourceVector& audioSources, const MediaStreamSourceVector& videoSources);
+ LocalMediaStream(ScriptExecutionContext*, PassRefPtr<MediaStreamDescriptor>);
};
} // namespace WebCore
diff --git a/Source/WebCore/Modules/mediastream/LocalMediaStream.idl b/Source/WebCore/Modules/mediastream/LocalMediaStream.idl
index 7aaddc36a..e9944cf4c 100644
--- a/Source/WebCore/Modules/mediastream/LocalMediaStream.idl
+++ b/Source/WebCore/Modules/mediastream/LocalMediaStream.idl
@@ -29,7 +29,7 @@ module core {
JSGenerateToNativeObject,
JSGenerateToJSObject
] LocalMediaStream : MediaStream {
- [ImplementedAs=stopFunction] void stop();
+ void stop();
};
}
diff --git a/Source/WebCore/Modules/mediastream/MediaStream.cpp b/Source/WebCore/Modules/mediastream/MediaStream.cpp
index 1227a7e75..8a3f585cb 100644
--- a/Source/WebCore/Modules/mediastream/MediaStream.cpp
+++ b/Source/WebCore/Modules/mediastream/MediaStream.cpp
@@ -32,7 +32,6 @@
#include "ExceptionCode.h"
#include "MediaStreamCenter.h"
#include "MediaStreamSource.h"
-#include "ScriptExecutionContext.h"
#include "UUID.h"
namespace WebCore {
@@ -75,22 +74,18 @@ PassRefPtr<MediaStream> MediaStream::create(ScriptExecutionContext* context, Pas
return 0;
RefPtr<MediaStreamDescriptor> descriptor = MediaStreamDescriptor::create(createCanonicalUUIDString(), audioSources, videoSources);
- MediaStreamCenter::instance().didConstructMediaStream(descriptor.get());
+ MediaStreamCenter::instance().didCreateMediaStream(descriptor.get());
- RefPtr<MediaStream> stream = adoptRef(new MediaStream(context, descriptor.release()));
- stream->suspendIfNeeded();
- return stream.release();
+ return adoptRef(new MediaStream(context, descriptor.release()));
}
PassRefPtr<MediaStream> MediaStream::create(ScriptExecutionContext* context, PassRefPtr<MediaStreamDescriptor> streamDescriptor)
{
- RefPtr<MediaStream> stream = adoptRef(new MediaStream(context, streamDescriptor));
- stream->suspendIfNeeded();
- return stream.release();
+ return adoptRef(new MediaStream(context, streamDescriptor));
}
MediaStream::MediaStream(ScriptExecutionContext* context, PassRefPtr<MediaStreamDescriptor> streamDescriptor)
- : ActiveDOMObject(context, this)
+ : ContextDestructionObserver(context)
, m_descriptor(streamDescriptor)
{
m_descriptor->setOwner(this);
@@ -137,7 +132,7 @@ const AtomicString& MediaStream::interfaceName() const
ScriptExecutionContext* MediaStream::scriptExecutionContext() const
{
- return ActiveDOMObject::scriptExecutionContext();
+ return ContextDestructionObserver::scriptExecutionContext();
}
EventTargetData* MediaStream::eventTargetData()
diff --git a/Source/WebCore/Modules/mediastream/MediaStream.h b/Source/WebCore/Modules/mediastream/MediaStream.h
index b493286eb..f6a98debd 100644
--- a/Source/WebCore/Modules/mediastream/MediaStream.h
+++ b/Source/WebCore/Modules/mediastream/MediaStream.h
@@ -28,7 +28,7 @@
#if ENABLE(MEDIA_STREAM)
-#include "ActiveDOMObject.h"
+#include "ContextDestructionObserver.h"
#include "EventTarget.h"
#include "MediaStreamDescriptor.h"
#include "MediaStreamTrackList.h"
@@ -37,9 +37,7 @@
namespace WebCore {
-class ScriptExecutionContext;
-
-class MediaStream : public RefCounted<MediaStream>, public MediaStreamDescriptorOwner, public EventTarget, public ActiveDOMObject {
+class MediaStream : public RefCounted<MediaStream>, public MediaStreamDescriptorOwner, public EventTarget, public ContextDestructionObserver {
public:
// Must match the constants in the .idl file.
enum ReadyState {
diff --git a/Source/WebCore/Modules/mediastream/PeerConnection00.cpp b/Source/WebCore/Modules/mediastream/PeerConnection00.cpp
index 1f822556f..205616d24 100644
--- a/Source/WebCore/Modules/mediastream/PeerConnection00.cpp
+++ b/Source/WebCore/Modules/mediastream/PeerConnection00.cpp
@@ -96,7 +96,7 @@ PassRefPtr<MediaHints> PeerConnection00::createMediaHints(const Dictionary& dict
bool audio = hasLocalAudioTrack();
bool video = hasLocalVideoTrack();
dictionary.get("has_audio", audio);
- dictionary.get("has_video", audio);
+ dictionary.get("has_video", video);
return MediaHints::create(audio, video);
}
diff --git a/Source/WebCore/Modules/mediastream/SessionDescription.cpp b/Source/WebCore/Modules/mediastream/SessionDescription.cpp
index 982707a9f..1b2d64a1f 100644
--- a/Source/WebCore/Modules/mediastream/SessionDescription.cpp
+++ b/Source/WebCore/Modules/mediastream/SessionDescription.cpp
@@ -34,6 +34,7 @@
#include "SessionDescription.h"
+#include "ExceptionCode.h"
#include "IceCandidate.h"
#include "IceCandidateDescriptor.h"
#include "MediaStreamCenter.h"
@@ -61,8 +62,13 @@ SessionDescription::~SessionDescription()
{
}
-void SessionDescription::addCandidate(PassRefPtr<IceCandidate> candidate)
+void SessionDescription::addCandidate(PassRefPtr<IceCandidate> candidate, ExceptionCode& ec)
{
+ if (!candidate) {
+ ec = TYPE_MISMATCH_ERR;
+ return;
+ }
+
m_descriptor->addCandidate(candidate->descriptor());
}
diff --git a/Source/WebCore/Modules/mediastream/SessionDescription.h b/Source/WebCore/Modules/mediastream/SessionDescription.h
index 6a51901f0..011585376 100644
--- a/Source/WebCore/Modules/mediastream/SessionDescription.h
+++ b/Source/WebCore/Modules/mediastream/SessionDescription.h
@@ -33,6 +33,7 @@
#if ENABLE(MEDIA_STREAM)
+#include "ExceptionBase.h"
#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
#include <wtf/text/WTFString.h>
@@ -48,7 +49,7 @@ public:
static PassRefPtr<SessionDescription> create(PassRefPtr<SessionDescriptionDescriptor>);
virtual ~SessionDescription();
- void addCandidate(PassRefPtr<IceCandidate>);
+ void addCandidate(PassRefPtr<IceCandidate>, ExceptionCode&);
String toSdp();
SessionDescriptionDescriptor* descriptor();
diff --git a/Source/WebCore/Modules/mediastream/SessionDescription.idl b/Source/WebCore/Modules/mediastream/SessionDescription.idl
index 35775be4b..d4afedad9 100644
--- a/Source/WebCore/Modules/mediastream/SessionDescription.idl
+++ b/Source/WebCore/Modules/mediastream/SessionDescription.idl
@@ -34,7 +34,8 @@ module p2p {
Conditional=MEDIA_STREAM,
Constructor(in DOMString sdp)
] SessionDescription {
- void addCandidate(in IceCandidate candidate);
+ [StrictTypeChecking] void addCandidate(in IceCandidate candidate)
+ raises(DOMException);
DOMString toSdp();
};
diff --git a/Source/WebCore/Modules/mediastream/UserMediaRequest.cpp b/Source/WebCore/Modules/mediastream/UserMediaRequest.cpp
index e61956180..63d02e29f 100644
--- a/Source/WebCore/Modules/mediastream/UserMediaRequest.cpp
+++ b/Source/WebCore/Modules/mediastream/UserMediaRequest.cpp
@@ -38,6 +38,7 @@
#include "Dictionary.h"
#include "LocalMediaStream.h"
#include "MediaStreamCenter.h"
+#include "MediaStreamDescriptor.h"
#include "SpaceSplitString.h"
#include "UserMediaController.h"
@@ -88,6 +89,15 @@ void UserMediaRequest::succeed(const MediaStreamSourceVector& audioSources, cons
m_successCallback->handleEvent(stream.get());
}
+void UserMediaRequest::succeed(PassRefPtr<MediaStreamDescriptor> streamDescriptor)
+{
+ if (!m_scriptExecutionContext)
+ return;
+
+ RefPtr<LocalMediaStream> stream = LocalMediaStream::create(m_scriptExecutionContext, streamDescriptor);
+ m_successCallback->handleEvent(stream.get());
+}
+
void UserMediaRequest::fail()
{
if (!m_scriptExecutionContext)
diff --git a/Source/WebCore/Modules/mediastream/UserMediaRequest.h b/Source/WebCore/Modules/mediastream/UserMediaRequest.h
index 7cbce594c..87ca89b7c 100644
--- a/Source/WebCore/Modules/mediastream/UserMediaRequest.h
+++ b/Source/WebCore/Modules/mediastream/UserMediaRequest.h
@@ -45,6 +45,7 @@
namespace WebCore {
class Dictionary;
+class MediaStreamDescriptor;
class UserMediaController;
class UserMediaRequest : public MediaStreamSourcesQueryClient, public ContextDestructionObserver {
@@ -58,6 +59,7 @@ public:
void start();
void succeed(const MediaStreamSourceVector& audioSources, const MediaStreamSourceVector& videoSources);
+ void succeed(PassRefPtr<MediaStreamDescriptor>);
void fail();
// MediaStreamSourcesQueryClient
diff --git a/Source/WebCore/Modules/webaudio/AudioBufferSourceNode.cpp b/Source/WebCore/Modules/webaudio/AudioBufferSourceNode.cpp
index 01f2229bf..0776be9c8 100644
--- a/Source/WebCore/Modules/webaudio/AudioBufferSourceNode.cpp
+++ b/Source/WebCore/Modules/webaudio/AudioBufferSourceNode.cpp
@@ -67,12 +67,9 @@ AudioBufferSourceNode::AudioBufferSourceNode(AudioContext* context, float sample
{
setNodeType(NodeTypeAudioBufferSource);
- m_gain = AudioGain::create("gain", 1.0, 0.0, 1.0);
- m_playbackRate = AudioParam::create("playbackRate", 1.0, 0.0, MaxRate);
+ m_gain = AudioGain::create(context, "gain", 1.0, 0.0, 1.0);
+ m_playbackRate = AudioParam::create(context, "playbackRate", 1.0, 0.0, MaxRate);
- m_gain->setContext(context);
- m_playbackRate->setContext(context);
-
// Default to mono. A call to setBuffer() will set the number of output channels to that of the buffer.
addOutput(adoptPtr(new AudioNodeOutput(this, 1)));
diff --git a/Source/WebCore/Modules/webaudio/AudioGain.h b/Source/WebCore/Modules/webaudio/AudioGain.h
index eb3c52d87..79c73e039 100644
--- a/Source/WebCore/Modules/webaudio/AudioGain.h
+++ b/Source/WebCore/Modules/webaudio/AudioGain.h
@@ -36,14 +36,14 @@ namespace WebCore {
class AudioGain : public AudioParam {
public:
- static PassRefPtr<AudioGain> create(const char* name, double defaultValue, double minValue, double maxValue)
+ static PassRefPtr<AudioGain> create(AudioContext* context, const char* name, double defaultValue, double minValue, double maxValue)
{
- return adoptRef(new AudioGain(name, defaultValue, minValue, maxValue));
+ return adoptRef(new AudioGain(context, name, defaultValue, minValue, maxValue));
}
private:
- AudioGain(const char* name, double defaultValue, double minValue, double maxValue)
- : AudioParam(name, defaultValue, minValue, maxValue)
+ AudioGain(AudioContext* context, const char* name, double defaultValue, double minValue, double maxValue)
+ : AudioParam(context, name, defaultValue, minValue, maxValue)
{
}
};
diff --git a/Source/WebCore/Modules/webaudio/AudioGainNode.cpp b/Source/WebCore/Modules/webaudio/AudioGainNode.cpp
index 7c61432eb..4f513c000 100644
--- a/Source/WebCore/Modules/webaudio/AudioGainNode.cpp
+++ b/Source/WebCore/Modules/webaudio/AudioGainNode.cpp
@@ -39,8 +39,7 @@ AudioGainNode::AudioGainNode(AudioContext* context, float sampleRate)
, m_lastGain(1.0)
, m_sampleAccurateGainValues(AudioNode::ProcessingSizeInFrames) // FIXME: can probably share temp buffer in context
{
- m_gain = AudioGain::create("gain", 1.0, 0.0, 1.0);
- m_gain->setContext(context);
+ m_gain = AudioGain::create(context, "gain", 1.0, 0.0, 1.0);
addInput(adoptPtr(new AudioNodeInput(this)));
addOutput(adoptPtr(new AudioNodeOutput(this, 1)));
diff --git a/Source/WebCore/Modules/webaudio/AudioPannerNode.cpp b/Source/WebCore/Modules/webaudio/AudioPannerNode.cpp
index 110577326..4d0ad189c 100644
--- a/Source/WebCore/Modules/webaudio/AudioPannerNode.cpp
+++ b/Source/WebCore/Modules/webaudio/AudioPannerNode.cpp
@@ -56,8 +56,8 @@ AudioPannerNode::AudioPannerNode(AudioContext* context, float sampleRate)
addInput(adoptPtr(new AudioNodeInput(this)));
addOutput(adoptPtr(new AudioNodeOutput(this, 2)));
- m_distanceGain = AudioGain::create("distanceGain", 1.0, 0.0, 1.0);
- m_coneGain = AudioGain::create("coneGain", 1.0, 0.0, 1.0);
+ m_distanceGain = AudioGain::create(context, "distanceGain", 1.0, 0.0, 1.0);
+ m_coneGain = AudioGain::create(context, "coneGain", 1.0, 0.0, 1.0);
m_position = FloatPoint3D(0, 0, 0);
m_orientation = FloatPoint3D(1, 0, 0);
diff --git a/Source/WebCore/Modules/webaudio/AudioParam.h b/Source/WebCore/Modules/webaudio/AudioParam.h
index c38753c47..3bd27abd8 100644
--- a/Source/WebCore/Modules/webaudio/AudioParam.h
+++ b/Source/WebCore/Modules/webaudio/AudioParam.h
@@ -46,29 +46,14 @@ public:
static const double DefaultSmoothingConstant;
static const double SnapThreshold;
- static PassRefPtr<AudioParam> create(const String& name, double defaultValue, double minValue, double maxValue, unsigned units = 0)
+ static PassRefPtr<AudioParam> create(AudioContext* context, const String& name, double defaultValue, double minValue, double maxValue, unsigned units = 0)
{
- return adoptRef(new AudioParam(name, defaultValue, minValue, maxValue, units));
+ return adoptRef(new AudioParam(context, name, defaultValue, minValue, maxValue, units));
}
- AudioParam(const String& name, double defaultValue, double minValue, double maxValue, unsigned units = 0)
- : m_name(name)
- , m_value(defaultValue)
- , m_defaultValue(defaultValue)
- , m_minValue(minValue)
- , m_maxValue(maxValue)
- , m_units(units)
- , m_smoothedValue(defaultValue)
- , m_smoothingConstant(DefaultSmoothingConstant)
- , m_audioRateSignal(0)
- {
- }
-
- void setContext(AudioContext* context) { m_context = context; }
AudioContext* context() { return m_context.get(); }
float value();
-
void setValue(float);
String name() const { return m_name; }
@@ -109,6 +94,21 @@ public:
void connect(AudioNodeOutput*);
void disconnect(AudioNodeOutput*);
+protected:
+ AudioParam(AudioContext* context, const String& name, double defaultValue, double minValue, double maxValue, unsigned units = 0)
+ : m_context(context)
+ , m_name(name)
+ , m_value(defaultValue)
+ , m_defaultValue(defaultValue)
+ , m_minValue(minValue)
+ , m_maxValue(maxValue)
+ , m_units(units)
+ , m_smoothedValue(defaultValue)
+ , m_smoothingConstant(DefaultSmoothingConstant)
+ , m_audioRateSignal(0)
+ {
+ }
+
private:
void calculateAudioRateSignalValues(float* values, unsigned numberOfValues);
void calculateTimelineValues(float* values, unsigned numberOfValues);
diff --git a/Source/WebCore/Modules/webaudio/BiquadFilterNode.cpp b/Source/WebCore/Modules/webaudio/BiquadFilterNode.cpp
index 9748628b9..d752e2c39 100644
--- a/Source/WebCore/Modules/webaudio/BiquadFilterNode.cpp
+++ b/Source/WebCore/Modules/webaudio/BiquadFilterNode.cpp
@@ -36,10 +36,7 @@ BiquadFilterNode::BiquadFilterNode(AudioContext* context, float sampleRate)
: AudioBasicProcessorNode(context, sampleRate)
{
// Initially setup as lowpass filter.
- m_processor = adoptPtr(new BiquadProcessor(sampleRate, 1, false));
- biquadProcessor()->parameter1()->setContext(context);
- biquadProcessor()->parameter2()->setContext(context);
- biquadProcessor()->parameter3()->setContext(context);
+ m_processor = adoptPtr(new BiquadProcessor(context, sampleRate, 1, false));
setNodeType(NodeTypeBiquadFilter);
}
diff --git a/Source/WebCore/Modules/webaudio/BiquadProcessor.cpp b/Source/WebCore/Modules/webaudio/BiquadProcessor.cpp
index d14b06056..e8677d29e 100644
--- a/Source/WebCore/Modules/webaudio/BiquadProcessor.cpp
+++ b/Source/WebCore/Modules/webaudio/BiquadProcessor.cpp
@@ -32,7 +32,7 @@
namespace WebCore {
-BiquadProcessor::BiquadProcessor(float sampleRate, size_t numberOfChannels, bool autoInitialize)
+BiquadProcessor::BiquadProcessor(AudioContext* context, float sampleRate, size_t numberOfChannels, bool autoInitialize)
: AudioDSPKernelProcessor(sampleRate, numberOfChannels)
, m_type(LowPass)
, m_parameter1(0)
@@ -43,9 +43,9 @@ BiquadProcessor::BiquadProcessor(float sampleRate, size_t numberOfChannels, bool
double nyquist = 0.5 * this->sampleRate();
// Create parameters for BiquadFilterNode.
- m_parameter1 = AudioParam::create("frequency", 350.0, 10.0, nyquist);
- m_parameter2 = AudioParam::create("Q", 1, 0.0001, 1000.0);
- m_parameter3 = AudioParam::create("gain", 0.0, -40, 40);
+ m_parameter1 = AudioParam::create(context, "frequency", 350.0, 10.0, nyquist);
+ m_parameter2 = AudioParam::create(context, "Q", 1, 0.0001, 1000.0);
+ m_parameter3 = AudioParam::create(context, "gain", 0.0, -40, 40);
if (autoInitialize)
initialize();
diff --git a/Source/WebCore/Modules/webaudio/BiquadProcessor.h b/Source/WebCore/Modules/webaudio/BiquadProcessor.h
index 0f3610ab8..408294402 100644
--- a/Source/WebCore/Modules/webaudio/BiquadProcessor.h
+++ b/Source/WebCore/Modules/webaudio/BiquadProcessor.h
@@ -49,7 +49,7 @@ public:
Allpass = 7
};
- BiquadProcessor(float sampleRate, size_t numberOfChannels, bool autoInitialize);
+ BiquadProcessor(AudioContext*, float sampleRate, size_t numberOfChannels, bool autoInitialize);
virtual ~BiquadProcessor();
diff --git a/Source/WebCore/Modules/webaudio/ConvolverNode.cpp b/Source/WebCore/Modules/webaudio/ConvolverNode.cpp
index f263e27ed..c8010d030 100644
--- a/Source/WebCore/Modules/webaudio/ConvolverNode.cpp
+++ b/Source/WebCore/Modules/webaudio/ConvolverNode.cpp
@@ -113,7 +113,6 @@ void ConvolverNode::setBuffer(AudioBuffer* buffer)
{
ASSERT(isMainThread());
- ASSERT(buffer);
if (!buffer)
return;
diff --git a/Source/WebCore/Modules/webaudio/DelayNode.cpp b/Source/WebCore/Modules/webaudio/DelayNode.cpp
index 59341abf5..51cc71e8b 100644
--- a/Source/WebCore/Modules/webaudio/DelayNode.cpp
+++ b/Source/WebCore/Modules/webaudio/DelayNode.cpp
@@ -33,8 +33,7 @@ namespace WebCore {
DelayNode::DelayNode(AudioContext* context, float sampleRate, double maxDelayTime)
: AudioBasicProcessorNode(context, sampleRate)
{
- m_processor = adoptPtr(new DelayProcessor(sampleRate, 1, maxDelayTime));
- delayTime()->setContext(context);
+ m_processor = adoptPtr(new DelayProcessor(context, sampleRate, 1, maxDelayTime));
setNodeType(NodeTypeDelay);
}
diff --git a/Source/WebCore/Modules/webaudio/DelayProcessor.cpp b/Source/WebCore/Modules/webaudio/DelayProcessor.cpp
index b23e8ac1d..4eafb7139 100644
--- a/Source/WebCore/Modules/webaudio/DelayProcessor.cpp
+++ b/Source/WebCore/Modules/webaudio/DelayProcessor.cpp
@@ -32,11 +32,11 @@
namespace WebCore {
-DelayProcessor::DelayProcessor(float sampleRate, unsigned numberOfChannels, double maxDelayTime)
+DelayProcessor::DelayProcessor(AudioContext* context, float sampleRate, unsigned numberOfChannels, double maxDelayTime)
: AudioDSPKernelProcessor(sampleRate, numberOfChannels)
, m_maxDelayTime(maxDelayTime)
{
- m_delayTime = AudioParam::create("delayTime", 0.0, 0.0, maxDelayTime);
+ m_delayTime = AudioParam::create(context, "delayTime", 0.0, 0.0, maxDelayTime);
}
DelayProcessor::~DelayProcessor()
diff --git a/Source/WebCore/Modules/webaudio/DelayProcessor.h b/Source/WebCore/Modules/webaudio/DelayProcessor.h
index 33fb937e0..8b2935352 100644
--- a/Source/WebCore/Modules/webaudio/DelayProcessor.h
+++ b/Source/WebCore/Modules/webaudio/DelayProcessor.h
@@ -37,7 +37,7 @@ class AudioDSPKernel;
class DelayProcessor : public AudioDSPKernelProcessor {
public:
- DelayProcessor(float sampleRate, unsigned numberOfChannels, double maxDelayTime);
+ DelayProcessor(AudioContext*, float sampleRate, unsigned numberOfChannels, double maxDelayTime);
virtual ~DelayProcessor();
virtual PassOwnPtr<AudioDSPKernel> createKernel();
diff --git a/Source/WebCore/Modules/webaudio/DynamicsCompressorNode.cpp b/Source/WebCore/Modules/webaudio/DynamicsCompressorNode.cpp
index c4e389897..d4cf3b772 100644
--- a/Source/WebCore/Modules/webaudio/DynamicsCompressorNode.cpp
+++ b/Source/WebCore/Modules/webaudio/DynamicsCompressorNode.cpp
@@ -46,19 +46,12 @@ DynamicsCompressorNode::DynamicsCompressorNode(AudioContext* context, float samp
setNodeType(NodeTypeDynamicsCompressor);
- m_threshold = AudioParam::create("threshold", -24, -100, 0);
- m_knee = AudioParam::create("knee", 30, 0, 40);
- m_ratio = AudioParam::create("ratio", 12, 1, 20);
- m_reduction = AudioParam::create("reduction", 0, -20, 0);
- m_attack = AudioParam::create("attack", 0.003, 0, 1);
- m_release = AudioParam::create("release", 0.250, 0, 1);
-
- m_threshold->setContext(context);
- m_knee->setContext(context);
- m_ratio->setContext(context);
- m_reduction->setContext(context);
- m_attack->setContext(context);
- m_release->setContext(context);
+ m_threshold = AudioParam::create(context, "threshold", -24, -100, 0);
+ m_knee = AudioParam::create(context, "knee", 30, 0, 40);
+ m_ratio = AudioParam::create(context, "ratio", 12, 1, 20);
+ m_reduction = AudioParam::create(context, "reduction", 0, -20, 0);
+ m_attack = AudioParam::create(context, "attack", 0.003, 0, 1);
+ m_release = AudioParam::create(context, "release", 0.250, 0, 1);
initialize();
}
diff --git a/Source/WebCore/Modules/webaudio/JavaScriptAudioNode.cpp b/Source/WebCore/Modules/webaudio/JavaScriptAudioNode.cpp
index 7f541d5a3..a6eb60146 100644
--- a/Source/WebCore/Modules/webaudio/JavaScriptAudioNode.cpp
+++ b/Source/WebCore/Modules/webaudio/JavaScriptAudioNode.cpp
@@ -151,8 +151,13 @@ void JavaScriptAudioNode::process(size_t framesToProcess)
AudioBuffer* outputBuffer = m_outputBuffers[doubleBufferIndex].get();
// Check the consistency of input and output buffers.
- bool buffersAreGood = inputBuffer && outputBuffer && bufferSize() == inputBuffer->length() && bufferSize() == outputBuffer->length()
- && m_bufferReadWriteIndex + framesToProcess <= bufferSize();
+ unsigned numberOfInputChannels = m_internalInputBus.numberOfChannels();
+ bool buffersAreGood = outputBuffer && bufferSize() == outputBuffer->length() && m_bufferReadWriteIndex + framesToProcess <= bufferSize();
+
+ // If the number of input channels is zero, it's ok to have inputBuffer = 0.
+ if (m_internalInputBus.numberOfChannels())
+ buffersAreGood = buffersAreGood && inputBuffer && bufferSize() == inputBuffer->length();
+
ASSERT(buffersAreGood);
if (!buffersAreGood)
return;
@@ -163,7 +168,6 @@ void JavaScriptAudioNode::process(size_t framesToProcess)
if (!isFramesToProcessGood)
return;
- unsigned numberOfInputChannels = m_internalInputBus.numberOfChannels();
unsigned numberOfOutputChannels = outputBus->numberOfChannels();
bool channelsAreGood = (numberOfInputChannels == m_numberOfInputChannels) && (numberOfOutputChannels == m_numberOfOutputChannels);
@@ -231,8 +235,8 @@ void JavaScriptAudioNode::fireProcessEvent()
AudioBuffer* inputBuffer = m_inputBuffers[m_doubleBufferIndexForEvent].get();
AudioBuffer* outputBuffer = m_outputBuffers[m_doubleBufferIndexForEvent].get();
- ASSERT(inputBuffer && outputBuffer);
- if (!inputBuffer || !outputBuffer)
+ ASSERT(outputBuffer);
+ if (!outputBuffer)
return;
// Avoid firing the event if the document has already gone away.
diff --git a/Source/WebCore/Modules/webaudio/Oscillator.cpp b/Source/WebCore/Modules/webaudio/Oscillator.cpp
index 8aac8c09d..18588a607 100644
--- a/Source/WebCore/Modules/webaudio/Oscillator.cpp
+++ b/Source/WebCore/Modules/webaudio/Oscillator.cpp
@@ -58,11 +58,9 @@ Oscillator::Oscillator(AudioContext* context, float sampleRate)
setNodeType(NodeTypeOscillator);
// Use musical pitch standard A440 as a default.
- m_frequency = AudioParam::create("frequency", 440, 0, 100000);
+ m_frequency = AudioParam::create(context, "frequency", 440, 0, 100000);
// Default to no detuning.
- m_detune = AudioParam::create("detune", 0, -4800, 4800);
- m_frequency->setContext(context);
- m_detune->setContext(context);
+ m_detune = AudioParam::create(context, "detune", 0, -4800, 4800);
// Sets up default wavetable.
setType(m_type);
diff --git a/Source/WebCore/PlatformEfl.cmake b/Source/WebCore/PlatformEfl.cmake
index 1a0084b81..9c718aa46 100644
--- a/Source/WebCore/PlatformEfl.cmake
+++ b/Source/WebCore/PlatformEfl.cmake
@@ -219,9 +219,11 @@ IF (ENABLE_VIDEO OR ENABLE_WEB_AUDIO)
LIST(APPEND WebCore_INCLUDE_DIRECTORIES
"${WEBCORE_DIR}/platform/graphics/gstreamer"
- ${GStreamer-App_INCLUDE_DIRS}
- ${GStreamer-Interfaces_INCLUDE_DIRS}
- ${GStreamer-Pbutils_INCLUDE_DIRS}
+ ${GSTREAMER_INCLUDE_DIRS}
+ ${GSTREAMER_BASE_INCLUDE_DIRS}
+ ${GSTREAMER_APP_INCLUDE_DIRS}
+ ${GSTREAMER_INTERFACES_INCLUDE_DIRS}
+ ${GSTREAMER_PBUTILS_INCLUDE_DIRS}
)
LIST(APPEND WebCore_SOURCES
platform/graphics/gstreamer/GRefPtrGStreamer.cpp
@@ -229,15 +231,17 @@ IF (ENABLE_VIDEO OR ENABLE_WEB_AUDIO)
platform/graphics/gstreamer/GStreamerVersioning.cpp
)
LIST(APPEND WebCore_LIBRARIES
- ${GStreamer-App_LIBRARIES}
- ${GStreamer-Interfaces_LIBRARIES}
- ${GStreamer-Pbutils_LIBRARIES}
+ ${GSTREAMER_LIBRARIES}
+ ${GSTREAMER_BASE_LIBRARIES}
+ ${GSTREAMER_APP_LIBRARIES}
+ ${GSTREAMER_INTERFACES_LIBRARIES}
+ ${GSTREAMER_PBUTILS_LIBRARIES}
)
ENDIF ()
IF (ENABLE_VIDEO)
LIST(APPEND WebCore_INCLUDE_DIRECTORIES
- ${GStreamer-Video_INCLUDE_DIRS}
+ ${GSTREAMER_VIDEO_INCLUDE_DIRS}
)
LIST(APPEND WebCore_SOURCES
platform/graphics/gstreamer/GStreamerGWorld.cpp
@@ -248,7 +252,7 @@ IF (ENABLE_VIDEO)
platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp
)
LIST(APPEND WebCore_LIBRARIES
- ${GStreamer-Video_LIBRARIES}
+ ${GSTREAMER_VIDEO_LIBRARIES}
)
ENDIF ()
@@ -280,8 +284,8 @@ IF (ENABLE_WEB_AUDIO)
LIST(APPEND WebCore_INCLUDE_DIRECTORIES
"${WEBCORE_DIR}/platform/audio/gstreamer"
- ${GStreamer-Audio_INCLUDE_DIRS}
- ${GStreamer-FFT_INCLUDE_DIRS}
+ ${GSTREAMER_AUDIO_INCLUDE_DIRS}
+ ${GSTREAMER_FFT_INCLUDE_DIRS}
)
LIST(APPEND WebCore_SOURCES
platform/audio/efl/AudioBusEfl.cpp
@@ -291,8 +295,8 @@ IF (ENABLE_WEB_AUDIO)
platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp
)
LIST(APPEND WebCore_LIBRARIES
- ${GStreamer-Audio_LIBRARIES}
- ${GStreamer-FFT_LIBRARIES}
+ ${GSTREAMER_AUDIO_LIBRARIES}
+ ${GSTREAMER_FFT_LIBRARIES}
)
SET(WEB_AUDIO_DIR ${CMAKE_INSTALL_PREFIX}/${DATA_INSTALL_DIR}/webaudio/resources)
FILE(GLOB WEB_AUDIO_DATA "${WEBCORE_DIR}/platform/audio/resources/*.wav")
diff --git a/Source/WebCore/Target.pri b/Source/WebCore/Target.pri
index c93219377..f76ae0b9f 100644
--- a/Source/WebCore/Target.pri
+++ b/Source/WebCore/Target.pri
@@ -30,7 +30,7 @@ RESOURCES += \
include_webinspector {
RESOURCES += \
$$PWD/inspector/front-end/WebKit.qrc \
- $${WEBCORE_GENERATED_SOURCES_DIR}/InspectorBackendStub.qrc
+ $${WEBCORE_GENERATED_SOURCES_DIR}/InspectorBackendCommands.qrc
}
SOURCES += \
@@ -832,6 +832,7 @@ SOURCES += \
html/PasswordInputType.cpp \
html/PluginDocument.cpp \
html/RadioInputType.cpp \
+ html/RadioNodeList.cpp \
html/RangeInputType.cpp \
html/ResetInputType.cpp \
html/SearchInputType.cpp \
@@ -1080,6 +1081,7 @@ SOURCES += \
platform/DateComponents.cpp \
platform/DragData.cpp \
platform/DragImage.cpp \
+ platform/EventTracer.cpp \
platform/FileChooser.cpp \
platform/FileIconLoader.cpp \
platform/FileStream.cpp \
@@ -1102,7 +1104,6 @@ SOURCES += \
platform/graphics/Font.cpp \
platform/graphics/FontCache.cpp \
platform/graphics/FractionalLayoutRect.cpp \
- platform/graphics/FractionalLayoutSize.cpp \
platform/graphics/GeneratorGeneratedImage.cpp \
platform/graphics/Gradient.cpp \
platform/graphics/GraphicsContext.cpp \
@@ -1974,6 +1975,7 @@ HEADERS += \
html/MicroDataItemValue.h \
html/PluginDocument.h \
html/PublicURLManager.h \
+ html/RadioNodeList.h \
html/StepRange.h \
html/TextDocument.h \
html/TimeRanges.h \
@@ -2187,6 +2189,7 @@ HEADERS += \
platform/DateComponents.h \
platform/DragData.h \
platform/DragImage.h \
+ platform/EventTracer.h \
platform/FileChooser.h \
platform/FileStream.h \
platform/FileStreamClient.h \
@@ -2970,11 +2973,13 @@ contains(DEFINES, ENABLE_NETSCAPE_PLUGIN_API=1) {
plugins/mac/PluginViewMac.mm
} else {
SOURCES += \
- plugins/qt/PluginContainerQt.cpp \
plugins/qt/PluginPackageQt.cpp \
plugins/qt/PluginViewQt.cpp
- HEADERS += \
- plugins/qt/PluginContainerQt.h
+
+ haveQt(4) {
+ SOURCES += plugins/qt/PluginContainerQt.cpp
+ HEADERS += plugins/qt/PluginContainerQt.h
+ }
}
}
diff --git a/Source/WebCore/UseJSC.cmake b/Source/WebCore/UseJSC.cmake
index 7b592bc46..c790dbe23 100644
--- a/Source/WebCore/UseJSC.cmake
+++ b/Source/WebCore/UseJSC.cmake
@@ -250,7 +250,7 @@ ENDIF ()
IF (ENABLE_NOTIFICATIONS)
LIST(APPEND WebCore_SOURCES
bindings/js/JSDesktopNotificationsCustom.cpp
- bindings/js/JSNotificationsCustom.cpp
+ bindings/js/JSNotificationCustom.cpp
)
ENDIF ()
diff --git a/Source/WebCore/WebCore.exp.in b/Source/WebCore/WebCore.exp.in
index 78fbb73f1..5c5a1d931 100644
--- a/Source/WebCore/WebCore.exp.in
+++ b/Source/WebCore/WebCore.exp.in
@@ -293,7 +293,7 @@ __ZN7WebCore12TextIteratorD1Ev
__ZN7WebCore12WorkerThread17workerThreadCountEv
#endif
__ZN7WebCore12cacheStorageEv
-__ZN7WebCore12createMarkupEPKNS_4NodeENS_13EChildrenOnlyEPN3WTF6VectorIPS0_Lm0EEENS_13EAbsoluteURLsE
+__ZN7WebCore12createMarkupEPKNS_4NodeENS_13EChildrenOnlyEPN3WTF6VectorIPS0_Lm0EEENS_13EAbsoluteURLsEPNS5_INS_13QualifiedNameELm0EEE
__ZN7WebCore12createMarkupEPKNS_5RangeEPN3WTF6VectorIPNS_4NodeELm0EEENS_23EAnnotateForInterchangeEbNS_13EAbsoluteURLsE
__ZN7WebCore12gcControllerEv
__ZN7WebCore12iconDatabaseEv
@@ -302,7 +302,6 @@ __ZN7WebCore13AXObjectCache18rootObjectForFrameEPNS_5FrameE
__ZN7WebCore13AXObjectCache21gAccessibilityEnabledE
__ZN7WebCore13AXObjectCache23focusedUIElementForPageEPKNS_4PageE
__ZN7WebCore13AXObjectCache42gAccessibilityEnhancedUserInterfaceEnabledE
-__ZN7WebCore13ElementShadow20removeAllShadowRootsEv
__ZN7WebCore13HTTPHeaderMapC1Ev
__ZN7WebCore13HTTPHeaderMapD1Ev
__ZN7WebCore13HitTestResultC1ERKS0_
@@ -607,7 +606,6 @@ __ZN7WebCore19TextResourceDecoder6decodeEPKcm
__ZN7WebCore19TextResourceDecoderC1ERKN3WTF6StringERKNS_12TextEncodingEb
__ZN7WebCore19TextResourceDecoderD1Ev
__ZN7WebCore19applicationIsSafariEv
-__ZN7WebCore19pixelSnappedIntRectERKNS_20FractionalLayoutRectE
__ZN7WebCore20DictationAlternativeC1Ejjy
__ZN7WebCore20DictationAlternativeC1Ev
__ZN7WebCore20DisplaySleepDisablerC1EPKc
@@ -616,11 +614,11 @@ __ZN7WebCore20NodeRenderingContextC1EPNS_4NodeE
__ZN7WebCore20NodeRenderingContextD1Ev
__ZN7WebCore20PlatformEventFactory24createPlatformMouseEventEP7NSEventP6NSView
__ZN7WebCore20PlatformEventFactory27createPlatformKeyboardEventEP7NSEvent
-__ZN7WebCore20RenderEmbeddedObject30setShowsCrashedPluginIndicatorEv
__ZN7WebCore20ResourceResponseBase11setMimeTypeERKN3WTF6StringE
__ZN7WebCore20ResourceResponseBase17setHTTPStatusCodeEi
__ZN7WebCore20ResourceResponseBase20setSuggestedFilenameERKN3WTF6StringE
__ZN7WebCore20ResourceResponseBase24setExpectedContentLengthEx
+__ZN7WebCore20RenderEmbeddedObject29setPluginUnavailabilityReasonENS0_26PluginUnavailabilityReasonE
__ZN7WebCore20ResourceResponseBase6setURLERKNS_4KURLE
__ZN7WebCore20ResourceResponseBaseC2Ev
__ZN7WebCore20UserGestureIndicator7s_stateE
@@ -940,6 +938,7 @@ __ZN7WebCore7Element9innerTextEv
__ZN7WebCore7IntRect5scaleEf
__ZN7WebCore7IntRect5uniteERKS0_
__ZN7WebCore7IntRect9intersectERKS0_
+__ZN7WebCore7IntRectC1ERKNS_20FractionalLayoutRectE
__ZN7WebCore7IntRectC1ERKNS_9FloatRectE
__ZN7WebCore7IntSizeC1ERK6CGSize
__ZN7WebCore7RunLoop14runForDurationEd
@@ -1484,7 +1483,6 @@ __ZNK7WebCore6Widget9frameRectEv
__ZNK7WebCore7Element10screenRectEv
__ZNK7WebCore7Element6shadowEv
__ZNK7WebCore7Element12getAttributeERKNS_13QualifiedNameE
-__ZNK7WebCore7Element13hasShadowRootEv
__ZNK7WebCore7IntRect10intersectsERKS0_
__ZNK7WebCore7IntRect8containsERKS0_
__ZNK7WebCore7IntRectcv6CGRectEv
@@ -1530,7 +1528,7 @@ __ZNK7WebCore9FrameView13isTransparentEv
__ZNK7WebCore9FrameView13paintBehaviorEv
__ZNK7WebCore9FrameView19baseBackgroundColorEv
__ZNK7WebCore9FrameView20isSoftwareRenderableEv
-__ZNK7WebCore9FrameView22windowClipRectForLayerEPKNS_11RenderLayerEb
+__ZNK7WebCore9FrameView27windowClipRectForFrameOwnerEPKNS_21HTMLFrameOwnerElementEb
__ZNK7WebCore9FrameView23documentBackgroundColorEv
__ZNK7WebCore9FrameView28isEnclosedInCompositingLayerEv
__ZNK7WebCore9PageCache10frameCountEv
@@ -1553,6 +1551,9 @@ _wkAdvanceDefaultButtonPulseAnimation
#if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
_wkCALayerEnumerateRectsBeingDrawnWithBlock
#endif
+#if !defined(BUILDING_ON_SNOW_LEOPARD)
+_wkCFURLRequestAllowAllPostCaching
+#endif
_wkCGContextGetShouldSmoothFonts
_wkCGContextResetClip
#if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
@@ -2050,7 +2051,7 @@ __ZN7WebCore8createCFERKNS_15ProtectionSpaceE
#endif
#if ENABLE(REQUEST_ANIMATION_FRAME)
-__ZN7WebCore9FrameView25serviceScriptedAnimationsEd
+__ZN7WebCore9FrameView25serviceScriptedAnimationsEy
#endif
#if ENABLE(VIDEO)
diff --git a/Source/WebCore/WebCore.gyp/WebCore.gyp b/Source/WebCore/WebCore.gyp/WebCore.gyp
index 556c123af..10a281ee1 100644
--- a/Source/WebCore/WebCore.gyp/WebCore.gyp
+++ b/Source/WebCore/WebCore.gyp/WebCore.gyp
@@ -367,7 +367,7 @@
'<(SHARED_INTERMEDIATE_DIR)/webkit/InspectorFrontend.h',
'<(SHARED_INTERMEDIATE_DIR)/webcore/InspectorTypeBuilder.cpp',
'<(SHARED_INTERMEDIATE_DIR)/webkit/InspectorTypeBuilder.h',
- '<(SHARED_INTERMEDIATE_DIR)/webcore/InspectorBackendStub.js',
+ '<(SHARED_INTERMEDIATE_DIR)/webcore/InspectorBackendCommands.js',
],
'variables': {
'generator_include_dirs': [
@@ -1178,6 +1178,8 @@
'direct_dependent_settings': {
'include_dirs+++': ['../dom'],
},
+ # In generated bindings code: 'switch contains default but no case'.
+ 'msvs_disabled_warnings': [ 4065 ],
}],
['OS=="linux" and "WTF_USE_WEBAUDIO_IPP=1" in feature_defines', {
'cflags': [
@@ -1361,7 +1363,7 @@
'postbuild_name': 'Check Objective-C Rename',
'variables': {
'class_whitelist_regex':
- 'ChromiumWebCoreObjC|TCMVisibleView|RTCMFlippedView',
+ 'ChromiumWebCoreObjC|TCMVisibleView|RTCMFlippedView|WebCoreTextFieldCell',
'category_whitelist_regex':
'TCMInterposing|ScrollAnimatorChromiumMacExt',
},
@@ -1652,7 +1654,6 @@
['include', 'platform/graphics/cg/IntPointCG\\.cpp$'],
['include', 'platform/graphics/cg/IntRectCG\\.cpp$'],
['include', 'platform/graphics/cg/IntSizeCG\\.cpp$'],
- ['exclude', 'platform/graphics/chromium/ImageChromiumMac\\.mm$'],
['exclude', 'platform/graphics/mac/FontMac\\.mm$'],
['exclude', 'platform/graphics/skia/FontCacheSkia\\.cpp$'],
['exclude', 'platform/graphics/skia/GlyphPageTreeNodeSkia\\.cpp$'],
diff --git a/Source/WebCore/WebCore.gypi b/Source/WebCore/WebCore.gypi
index 66d8134f2..e7746e647 100644
--- a/Source/WebCore/WebCore.gypi
+++ b/Source/WebCore/WebCore.gypi
@@ -273,6 +273,7 @@
'platform/DateComponents.h',
'platform/DragData.h',
'platform/DragImage.h',
+ 'platform/EventTracer.h',
'platform/FileChooser.h',
'platform/FileStream.h',
'platform/FileStreamClient.h',
@@ -1026,6 +1027,7 @@
'html/HTMLIFrameElement.idl',
'html/HTMLImageElement.idl',
'html/HTMLInputElement.idl',
+ 'html/HTMLIntentElement.idl',
'html/HTMLKeygenElement.idl',
'html/HTMLLIElement.idl',
'html/HTMLLabelElement.idl',
@@ -1072,6 +1074,7 @@
'html/MediaError.idl',
'html/MediaKeyError.idl',
'html/MediaKeyEvent.idl',
+ 'html/RadioNodeList.idl',
'html/TextMetrics.idl',
'html/TimeRanges.idl',
'html/ValidityState.idl',
@@ -1393,6 +1396,7 @@
'Modules/filesystem/FileSystemCallback.h',
'Modules/filesystem/FileSystemCallbacks.cpp',
'Modules/filesystem/FileSystemCallbacks.h',
+ 'Modules/filesystem/FileSystemType.h',
'Modules/filesystem/FileWriter.cpp',
'Modules/filesystem/FileWriter.h',
'Modules/filesystem/FileWriterBase.cpp',
@@ -1409,7 +1413,10 @@
'Modules/filesystem/WebKitFlags.h',
'Modules/filesystem/WorkerContextFileSystem.cpp',
'Modules/filesystem/WorkerContextFileSystem.h',
+ 'Modules/filesystem/chromium/DOMFileSystemChromium.cpp',
+ 'Modules/filesystem/chromium/DOMFileSystemChromium.h',
'Modules/filesystem/chromium/DataTransferItemFileSystemChromium.cpp',
+ 'Modules/filesystem/chromium/DOMFileSystemChromium.cpp',
'Modules/filesystem/chromium/DraggedIsolatedFileSystem.cpp',
'Modules/filesystem/chromium/DraggedIsolatedFileSystem.h',
'Modules/gamepad/Gamepad.cpp',
@@ -3293,6 +3300,7 @@
'platform/chromium/DragImageChromiumMac.cpp',
'platform/chromium/DragImageChromiumSkia.cpp',
'platform/chromium/DragImageRef.h',
+ 'platform/chromium/EventTracerChromium.cpp',
'platform/chromium/FileSystemChromium.cpp',
'platform/chromium/FileSystemChromiumLinux.cpp',
'platform/chromium/FileSystemChromiumMac.mm',
@@ -3397,7 +3405,6 @@
'platform/graphics/CrossfadeGeneratedImage.cpp',
'platform/graphics/CrossfadeGeneratedImage.h',
'platform/graphics/Extensions3D.h',
- 'platform/graphics/FractionalLayoutSize.cpp',
'platform/graphics/FloatPoint.cpp',
'platform/graphics/FloatPoint3D.cpp',
'platform/graphics/FloatQuad.cpp',
@@ -3414,7 +3421,6 @@
'platform/graphics/FontPlatformData.cpp',
'platform/graphics/FontPlatformData.h',
'platform/graphics/FractionalLayoutRect.cpp',
- 'platform/graphics/FractionalLayoutSize.cpp',
'platform/graphics/GeneratorGeneratedImage.cpp',
'platform/graphics/GeneratedImage.h',
'platform/graphics/GlyphPageTreeNode.cpp',
@@ -3524,6 +3530,8 @@
'platform/graphics/cg/PathCG.cpp',
'platform/graphics/cg/PatternCG.cpp',
'platform/graphics/cg/TransformationMatrixCG.cpp',
+ 'platform/graphics/chromium/AnimationIdVendor.cpp',
+ 'platform/graphics/chromium/AnimationIdVendor.h',
'platform/graphics/chromium/BitmapCanvasLayerTextureUpdater.cpp',
'platform/graphics/chromium/BitmapCanvasLayerTextureUpdater.h',
'platform/graphics/chromium/BitmapSkPictureCanvasLayerTextureUpdater.cpp',
@@ -3562,7 +3570,6 @@
'platform/graphics/chromium/IconChromiumAndroid.cpp',
'platform/graphics/chromium/ImageBufferDataSkia.h',
'platform/graphics/chromium/ImageChromium.cpp',
- 'platform/graphics/chromium/ImageChromiumMac.mm',
'platform/graphics/chromium/ImageLayerChromium.cpp',
'platform/graphics/chromium/ImageLayerChromium.h',
'platform/graphics/chromium/LayerChromium.cpp',
@@ -3573,6 +3580,8 @@
'platform/graphics/chromium/LayerTextureSubImage.cpp',
'platform/graphics/chromium/LayerTextureSubImage.h',
'platform/graphics/chromium/LayerTextureUpdater.h',
+ 'platform/graphics/chromium/LinkHighlight.cpp',
+ 'platform/graphics/chromium/LinkHighlight.h',
'platform/graphics/chromium/ManagedTexture.cpp',
'platform/graphics/chromium/ManagedTexture.h',
'platform/graphics/chromium/MediaPlayerPrivateChromium.h',
@@ -3603,8 +3612,9 @@
'platform/graphics/chromium/TextureLayerChromium.h',
'platform/graphics/chromium/TextureManager.cpp',
'platform/graphics/chromium/TextureManager.h',
- 'platform/graphics/chromium/TextureUploader.cpp',
'platform/graphics/chromium/TextureUploader.h',
+ 'platform/graphics/chromium/ThrottledTextureUploader.cpp',
+ 'platform/graphics/chromium/ThrottledTextureUploader.h',
'platform/graphics/chromium/TiledLayerChromium.cpp',
'platform/graphics/chromium/TiledLayerChromium.h',
'platform/graphics/chromium/TrackingTextureAllocator.cpp',
@@ -5504,6 +5514,8 @@
'html/HTMLImageLoader.cpp',
'html/HTMLImageLoader.h',
'html/HTMLInputElement.cpp',
+ 'html/HTMLIntentElement.cpp',
+ 'html/HTMLIntentElement.h',
'html/HTMLKeygenElement.cpp',
'html/HTMLKeygenElement.h',
'html/HTMLLIElement.cpp',
@@ -5633,6 +5645,8 @@
'html/PublicURLManager.h',
'html/RadioInputType.cpp',
'html/RadioInputType.h',
+ 'html/RadioNodeList.cpp',
+ 'html/RadioNodeList.h',
'html/RangeInputType.cpp',
'html/RangeInputType.h',
'html/ResetInputType.cpp',
@@ -7193,7 +7207,7 @@
'<(PRODUCT_DIR)/DerivedSources/WebCore/InjectedScriptSource.h',
'<(PRODUCT_DIR)/DerivedSources/WebCore/InspectorBackendDispatcher.cpp',
'<(PRODUCT_DIR)/DerivedSources/WebCore/InspectorBackendDispatcher.h',
- '<(PRODUCT_DIR)/DerivedSources/WebCore/InspectorBackendStub.js',
+ '<(PRODUCT_DIR)/DerivedSources/WebCore/InspectorBackendCommands.js',
'<(PRODUCT_DIR)/DerivedSources/WebCore/InspectorFrontend.cpp',
'<(PRODUCT_DIR)/DerivedSources/WebCore/InspectorFrontend.h',
'<(PRODUCT_DIR)/DerivedSources/WebCore/InspectorTypeBuilder.cpp',
diff --git a/Source/WebCore/WebCore.order b/Source/WebCore/WebCore.order
index 511192773..b27659ac9 100644
--- a/Source/WebCore/WebCore.order
+++ b/Source/WebCore/WebCore.order
@@ -25034,7 +25034,7 @@ __ZN7WebCore9DOMWindow4stopEv
__ZN7WebCore16HTMLInputElement16setIndeterminateEb
__ZNK7WebCore9FrameView23convertToContainingViewERKNS_7IntRectE
__ZNK7WebCore9FrameView19convertFromRendererEPKNS_12RenderObjectERKNS_7IntRectE
-__ZNK7WebCore9FrameView22windowClipRectForLayerEPKNS_11RenderLayerEb
+__ZNK7WebCore9FrameView27windowClipRectForFrameOwnerEPKNS_21HTMLFrameOwnerElementEb
__ZN7WebCore16HTMLMediaElement14setDisplayModeENS0_11DisplayModeE
__ZN7WebCore16HTMLMediaElement18updateDisplayStateEv
__ZN7WebCore17HTMLAppletElement19defaultEventHandlerEPNS_5EventE
diff --git a/Source/WebCore/WebCore.pri b/Source/WebCore/WebCore.pri
index 6f3147279..e8b86c850 100644
--- a/Source/WebCore/WebCore.pri
+++ b/Source/WebCore/WebCore.pri
@@ -134,7 +134,7 @@ contains(DEFINES, ENABLE_NETSCAPE_PLUGIN_API=1) {
INCLUDEPATH += platform/mac
# Note: XP_MACOSX is defined in npapi.h
} else {
- !embedded {
+ xlibAvailable() {
CONFIG += x11
LIBS += -lXrender
DEFINES += MOZ_X11
@@ -233,10 +233,10 @@ contains(DEFINES, WTF_USE_QT_IMAGE_DECODER=0) {
haveQt(5) {
# Qt5 allows us to use config tests to check for the presence of these libraries
!contains(config_test_libjpeg, yes): error("JPEG library not found!")
- !contains(config_test_libpng, yes): error("PNG 1.2 library not found!")
+ !contains(config_test_libpng, yes): error("PNG library not found!")
}
- LIBS += -ljpeg -lpng12
+ LIBS += -ljpeg -lpng
contains(DEFINES, WTF_USE_WEBP=1) {
INCLUDEPATH += $$SOURCE_DIR/platform/image-decoders/webp
diff --git a/Source/WebCore/WebCore.vcproj/WebCore.vcproj b/Source/WebCore/WebCore.vcproj/WebCore.vcproj
index 0d5363573..3735bc8c0 100755
--- a/Source/WebCore/WebCore.vcproj/WebCore.vcproj
+++ b/Source/WebCore/WebCore.vcproj/WebCore.vcproj
@@ -12826,6 +12826,62 @@
>
</File>
<File
+ RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\JSRadioNodeList.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\JSRadioNodeList.h"
+ >
+ </File>
+ <File
RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\JSRange.cpp"
>
<FileConfiguration
@@ -24341,6 +24397,10 @@
>
</File>
<File
+ RelativePath="..\Modules\filesystem\FileSystemType.h"
+ >
+ </File>
+ <File
RelativePath="..\Modules\filesystem\FileWriter.cpp"
>
</File>
@@ -27666,6 +27726,14 @@
>
</File>
<File
+ RelativePath="..\platform\EventTracer.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\platform\EventTracer.h"
+ >
+ </File>
+ <File
RelativePath="..\platform\FileChooser.cpp"
>
</File>
@@ -28769,10 +28837,6 @@
>
</File>
<File
- RelativePath="..\platform\graphics\FractionalLayoutSize.cpp"
- >
- </File>
- <File
RelativePath="..\platform\graphics\FractionalLayoutSize.h"
>
</File>
@@ -62286,6 +62350,14 @@
>
</File>
<File
+ RelativePath="..\html\RadioNodeList.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\html\RadioNodeList.h"
+ >
+ </File>
+ <File
RelativePath="..\html\RangeInputType.cpp"
>
</File>
diff --git a/Source/WebCore/WebCore.vcproj/copyWebCoreResourceFiles.cmd b/Source/WebCore/WebCore.vcproj/copyWebCoreResourceFiles.cmd
index 62d1ffc2a..35d6f8354 100755
--- a/Source/WebCore/WebCore.vcproj/copyWebCoreResourceFiles.cmd
+++ b/Source/WebCore/WebCore.vcproj/copyWebCoreResourceFiles.cmd
@@ -1,6 +1,6 @@
mkdir 2>NUL "%CONFIGURATIONBUILDDIR%\bin\WebKit.resources\inspector"
xcopy /y /d /s /exclude:xcopy.excludes "%ProjectDir%..\inspector\front-end\*" "%CONFIGURATIONBUILDDIR%\bin\WebKit.resources\inspector"
-xcopy /y /d /s /exclude:xcopy.excludes "%CONFIGURATIONBUILDDIR%\obj\WebCore\DerivedSources\InspectorBackendStub.js" "%CONFIGURATIONBUILDDIR%\bin\WebKit.resources\inspector"
+xcopy /y /d /s /exclude:xcopy.excludes "%CONFIGURATIONBUILDDIR%\obj\WebCore\DerivedSources\InspectorBackendCommands.js" "%CONFIGURATIONBUILDDIR%\bin\WebKit.resources\inspector"
mkdir 2>NUL "%CONFIGURATIONBUILDDIR%\bin\WebKit.resources\en.lproj"
xcopy /y /d /s /exclude:xcopy.excludes "%ProjectDir%..\English.lproj\localizedStrings.js" "%CONFIGURATIONBUILDDIR%\bin\WebKit.resources\en.lproj"
xcopy /y /d /s /exclude:xcopy.excludes "%ProjectDir%..\English.lproj\Localizable.strings" "%CONFIGURATIONBUILDDIR%\bin\WebKit.resources\en.lproj"
diff --git a/Source/WebCore/WebCore.xcodeproj/project.pbxproj b/Source/WebCore/WebCore.xcodeproj/project.pbxproj
index 317514cd7..85c84a707 100644
--- a/Source/WebCore/WebCore.xcodeproj/project.pbxproj
+++ b/Source/WebCore/WebCore.xcodeproj/project.pbxproj
@@ -295,7 +295,6 @@
1449E24C107D4A8400B5793F /* JSCallbackData.h in Headers */ = {isa = PBXBuildFile; fileRef = 1449E24A107D4A8400B5793F /* JSCallbackData.h */; };
1449E287107D4DB400B5793F /* JSCallbackData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1449E286107D4DB400B5793F /* JSCallbackData.cpp */; };
144FCE5214EC79BC000D17A3 /* FractionalLayoutUnit.h in Headers */ = {isa = PBXBuildFile; fileRef = 144FCE5114EC79BC000D17A3 /* FractionalLayoutUnit.h */; settings = {ATTRIBUTES = (Private, ); }; };
- 144FCE5C14EC79E7000D17A3 /* FractionalLayoutSize.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 144FCE5714EC79E7000D17A3 /* FractionalLayoutSize.cpp */; };
144FCE5D14EC79E7000D17A3 /* FractionalLayoutSize.h in Headers */ = {isa = PBXBuildFile; fileRef = 144FCE5814EC79E7000D17A3 /* FractionalLayoutSize.h */; settings = {ATTRIBUTES = (Private, ); }; };
144FCFE014EF2509000D17A3 /* FractionalLayoutRect.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 144FCFDE14EF2509000D17A3 /* FractionalLayoutRect.cpp */; };
144FCFE114EF2509000D17A3 /* FractionalLayoutRect.h in Headers */ = {isa = PBXBuildFile; fileRef = 144FCFDF14EF2509000D17A3 /* FractionalLayoutRect.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -2982,6 +2981,7 @@
898785F5122E1EAC003AABDA /* JSFileReaderSync.h in Headers */ = {isa = PBXBuildFile; fileRef = 898785F3122E1EAC003AABDA /* JSFileReaderSync.h */; };
89B5EAA111E8003D00F2367E /* LineEnding.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 89B5EA9F11E8003D00F2367E /* LineEnding.cpp */; };
89B5EAA211E8003D00F2367E /* LineEnding.h in Headers */ = {isa = PBXBuildFile; fileRef = 89B5EAA011E8003D00F2367E /* LineEnding.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 89C7C2E1155804F4007D5A7B /* FileSystemType.h in Headers */ = {isa = PBXBuildFile; fileRef = 89C7C2E0155804F4007D5A7B /* FileSystemType.h */; };
89CD029311C85B870070B791 /* JSWebKitBlobBuilder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 89CD029111C85B870070B791 /* JSWebKitBlobBuilder.cpp */; };
89CD029411C85B870070B791 /* JSWebKitBlobBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = 89CD029211C85B870070B791 /* JSWebKitBlobBuilder.h */; };
89D08D9F12228451001241DF /* AsyncFileSystem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 89D08D9C12228451001241DF /* AsyncFileSystem.cpp */; };
@@ -5126,6 +5126,10 @@
B5D31DFB11CF610B009F22B4 /* ActiveDOMCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = B5D31DF911CF610B009F22B4 /* ActiveDOMCallback.h */; };
B6566270120B1227006EA85C /* JSIDBTransaction.h in Headers */ = {isa = PBXBuildFile; fileRef = B656626E120B1227006EA85C /* JSIDBTransaction.h */; };
B6566271120B1227006EA85C /* JSIDBTransaction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B656626F120B1227006EA85C /* JSIDBTransaction.cpp */; };
+ B658FFA11522EF3A00DD5595 /* JSRadioNodeList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B658FF9F1522EF3A00DD5595 /* JSRadioNodeList.cpp */; };
+ B658FFA21522EF3A00DD5595 /* JSRadioNodeList.h in Headers */ = {isa = PBXBuildFile; fileRef = B658FFA01522EF3A00DD5595 /* JSRadioNodeList.h */; };
+ B658FFA51522EFAA00DD5595 /* RadioNodeList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B658FFA31522EFAA00DD5595 /* RadioNodeList.cpp */; };
+ B658FFA61522EFAA00DD5595 /* RadioNodeList.h in Headers */ = {isa = PBXBuildFile; fileRef = B658FFA41522EFAA00DD5595 /* RadioNodeList.h */; };
B71FE6DF11091CB300DAEF77 /* PrintContext.h in Headers */ = {isa = PBXBuildFile; fileRef = B776D43A1104525D00BEB0EC /* PrintContext.h */; settings = {ATTRIBUTES = (Private, ); }; };
B734B181119B9911006587BD /* FontTranscoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B734B180119B9911006587BD /* FontTranscoder.cpp */; };
B734B183119B991D006587BD /* FontTranscoder.h in Headers */ = {isa = PBXBuildFile; fileRef = B734B182119B991D006587BD /* FontTranscoder.h */; };
@@ -5815,6 +5819,7 @@
D630E2AC149BF344005B2F93 /* HistogramSupport.h in Headers */ = {isa = PBXBuildFile; fileRef = D630E2AB149BF344005B2F93 /* HistogramSupport.h */; };
D630E2AC149BF344005B2F94 /* StatsCounter.h in Headers */ = {isa = PBXBuildFile; fileRef = D630E2AB149BF344005B2F94 /* StatsCounter.h */; };
D630E2AC149BF344005B2F95 /* MemoryUsageSupport.h in Headers */ = {isa = PBXBuildFile; fileRef = D630E2AB149BF344005B2F95 /* MemoryUsageSupport.h */; };
+ D630E2AC149BF344005B2F96 /* EventTracer.h in Headers */ = {isa = PBXBuildFile; fileRef = D630E2AB149BF344005B2F96 /* EventTracer.h */; };
D6E276AF14637455001D280A /* MutationObserverRegistration.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D6E276AD14637455001D280A /* MutationObserverRegistration.cpp */; };
D6E276B014637455001D280A /* MutationObserverRegistration.h in Headers */ = {isa = PBXBuildFile; fileRef = D6E276AE14637455001D280A /* MutationObserverRegistration.h */; };
D6E528A3149A926D00EFE1F3 /* MutationObserverInterestGroup.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D6E528A1149A926D00EFE1F3 /* MutationObserverInterestGroup.cpp */; };
@@ -5822,6 +5827,7 @@
D6FDAEF3149C06190037B1E1 /* HistogramSupport.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D6FDAEF2149C06190037B1E1 /* HistogramSupport.cpp */; };
D6FDAEF3149C06190037B1E2 /* StatsCounter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D6FDAEF2149C06190037B1E2 /* StatsCounter.cpp */; };
D6FDAEF3149C06190037B1E3 /* MemoryUsageSupport.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D6FDAEF2149C06190037B1E3 /* MemoryUsageSupport.cpp */; };
+ D6FDAEF3149C06190037B1E4 /* EventTracer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D6FDAEF2149C06190037B1E4 /* EventTracer.cpp */; };
D70AD65713E1342B005B50B4 /* RenderRegion.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D70AD65513E1342B005B50B4 /* RenderRegion.cpp */; };
D70AD65813E1342B005B50B4 /* RenderRegion.h in Headers */ = {isa = PBXBuildFile; fileRef = D70AD65613E1342B005B50B4 /* RenderRegion.h */; };
D72F6D79153159A3001EE44E /* FlowThreadController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D72F6D77153159A3001EE44E /* FlowThreadController.cpp */; };
@@ -7166,7 +7172,6 @@
1449E286107D4DB400B5793F /* JSCallbackData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSCallbackData.cpp; sourceTree = "<group>"; };
144FCE5114EC79BC000D17A3 /* FractionalLayoutUnit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FractionalLayoutUnit.h; sourceTree = "<group>"; };
144FCE5414EC79E7000D17A3 /* FractionalLayoutPoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FractionalLayoutPoint.h; sourceTree = "<group>"; };
- 144FCE5714EC79E7000D17A3 /* FractionalLayoutSize.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FractionalLayoutSize.cpp; sourceTree = "<group>"; };
144FCE5814EC79E7000D17A3 /* FractionalLayoutSize.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FractionalLayoutSize.h; sourceTree = "<group>"; };
144FCFDE14EF2509000D17A3 /* FractionalLayoutRect.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FractionalLayoutRect.cpp; sourceTree = "<group>"; };
144FCFDF14EF2509000D17A3 /* FractionalLayoutRect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FractionalLayoutRect.h; sourceTree = "<group>"; };
@@ -9977,6 +9982,7 @@
898785F3122E1EAC003AABDA /* JSFileReaderSync.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSFileReaderSync.h; sourceTree = "<group>"; };
89B5EA9F11E8003D00F2367E /* LineEnding.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LineEnding.cpp; sourceTree = "<group>"; };
89B5EAA011E8003D00F2367E /* LineEnding.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LineEnding.h; sourceTree = "<group>"; };
+ 89C7C2E0155804F4007D5A7B /* FileSystemType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FileSystemType.h; path = Modules/filesystem/FileSystemType.h; sourceTree = "<group>"; };
89CD029111C85B870070B791 /* JSWebKitBlobBuilder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWebKitBlobBuilder.cpp; sourceTree = "<group>"; };
89CD029211C85B870070B791 /* JSWebKitBlobBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSWebKitBlobBuilder.h; sourceTree = "<group>"; };
89D08D9C12228451001241DF /* AsyncFileSystem.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AsyncFileSystem.cpp; sourceTree = "<group>"; };
@@ -12219,6 +12225,10 @@
B5D31DF911CF610B009F22B4 /* ActiveDOMCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ActiveDOMCallback.h; path = generic/ActiveDOMCallback.h; sourceTree = "<group>"; };
B656626E120B1227006EA85C /* JSIDBTransaction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSIDBTransaction.h; sourceTree = "<group>"; };
B656626F120B1227006EA85C /* JSIDBTransaction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSIDBTransaction.cpp; sourceTree = "<group>"; };
+ B658FF9F1522EF3A00DD5595 /* JSRadioNodeList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSRadioNodeList.cpp; sourceTree = "<group>"; };
+ B658FFA01522EF3A00DD5595 /* JSRadioNodeList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSRadioNodeList.h; sourceTree = "<group>"; };
+ B658FFA31522EFAA00DD5595 /* RadioNodeList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RadioNodeList.cpp; sourceTree = "<group>"; };
+ B658FFA41522EFAA00DD5595 /* RadioNodeList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RadioNodeList.h; sourceTree = "<group>"; };
B734B180119B9911006587BD /* FontTranscoder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FontTranscoder.cpp; path = transcoder/FontTranscoder.cpp; sourceTree = "<group>"; };
B734B182119B991D006587BD /* FontTranscoder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FontTranscoder.h; path = transcoder/FontTranscoder.h; sourceTree = "<group>"; };
B776D43A1104525D00BEB0EC /* PrintContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PrintContext.h; sourceTree = "<group>"; };
@@ -12962,6 +12972,7 @@
D630E2AB149BF344005B2F93 /* HistogramSupport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HistogramSupport.h; sourceTree = "<group>"; };
D630E2AB149BF344005B2F94 /* StatsCounter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StatsCounter.h; sourceTree = "<group>"; };
D630E2AB149BF344005B2F95 /* MemoryUsageSupport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MemoryUsageSupport.h; sourceTree = "<group>"; };
+ D630E2AB149BF344005B2F96 /* EventTracer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EventTracer.h; sourceTree = "<group>"; };
D6E276AD14637455001D280A /* MutationObserverRegistration.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MutationObserverRegistration.cpp; sourceTree = "<group>"; };
D6E276AE14637455001D280A /* MutationObserverRegistration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MutationObserverRegistration.h; sourceTree = "<group>"; };
D6E528A1149A926D00EFE1F3 /* MutationObserverInterestGroup.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MutationObserverInterestGroup.cpp; sourceTree = "<group>"; };
@@ -12969,6 +12980,7 @@
D6FDAEF2149C06190037B1E1 /* HistogramSupport.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HistogramSupport.cpp; sourceTree = "<group>"; };
D6FDAEF2149C06190037B1E2 /* StatsCounter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StatsCounter.cpp; sourceTree = "<group>"; };
D6FDAEF2149C06190037B1E3 /* MemoryUsageSupport.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MemoryUsageSupport.cpp; sourceTree = "<group>"; };
+ D6FDAEF2149C06190037B1E4 /* EventTracer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EventTracer.cpp; sourceTree = "<group>"; };
D70AD65513E1342B005B50B4 /* RenderRegion.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderRegion.cpp; sourceTree = "<group>"; };
D70AD65613E1342B005B50B4 /* RenderRegion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderRegion.h; sourceTree = "<group>"; };
D72F6D77153159A3001EE44E /* FlowThreadController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FlowThreadController.cpp; sourceTree = "<group>"; };
@@ -16875,6 +16887,8 @@
93EEC1EC09C2877700C515D1 /* html */ = {
isa = PBXGroup;
children = (
+ B658FFA31522EFAA00DD5595 /* RadioNodeList.cpp */,
+ B658FFA41522EFAA00DD5595 /* RadioNodeList.h */,
49484FAE102CF01E00187DD3 /* canvas */,
97C1F5511228558800EDE616 /* parser */,
4150F9ED12B6E0990008C860 /* shadow */,
@@ -17481,6 +17495,7 @@
E1AB1EBE14E9E3B200449E13 /* FileSystemCallback.idl */,
8987854B122CA064003AABDA /* FileSystemCallbacks.cpp */,
8987854C122CA064003AABDA /* FileSystemCallbacks.h */,
+ 89C7C2E0155804F4007D5A7B /* FileSystemType.h */,
976D6C6E122B8A3D001FD1F7 /* FileThread.cpp */,
976D6C6F122B8A3D001FD1F7 /* FileThread.h */,
976D6C70122B8A3D001FD1F7 /* FileThreadTask.h */,
@@ -17779,6 +17794,8 @@
A83B79080CCAFF2B000B0825 /* HTML */ = {
isa = PBXGroup;
children = (
+ B658FF9F1522EF3A00DD5595 /* JSRadioNodeList.cpp */,
+ B658FFA01522EF3A00DD5595 /* JSRadioNodeList.h */,
49EECEF2105070C400099FAB /* JSArrayBuffer.cpp */,
49EECEF3105070C400099FAB /* JSArrayBuffer.h */,
49EECF19105072F300099FAB /* JSArrayBufferView.cpp */,
@@ -19384,7 +19401,6 @@
144FCE5414EC79E7000D17A3 /* FractionalLayoutPoint.h */,
144FCFDE14EF2509000D17A3 /* FractionalLayoutRect.cpp */,
144FCFDF14EF2509000D17A3 /* FractionalLayoutRect.h */,
- 144FCE5714EC79E7000D17A3 /* FractionalLayoutSize.cpp */,
144FCE5814EC79E7000D17A3 /* FractionalLayoutSize.h */,
BC23F0DA0DAFF4A4009FDC91 /* GeneratedImage.h */,
BCE04C890DAFF7A0007A0F41 /* Generator.h */,
@@ -20261,6 +20277,8 @@
A7CFB3CF0B7ED10A0070C32D /* DragImage.cpp */,
A7CFB3D00B7ED10A0070C32D /* DragImage.h */,
1CA19E150DC255CA0065A994 /* EventLoop.h */,
+ D6FDAEF2149C06190037B1E4 /* EventTracer.cpp */,
+ D630E2AB149BF344005B2F96 /* EventTracer.h */,
934FE9E40B5CA539003E4A73 /* FileChooser.cpp */,
066C772A0AB603B700238CC4 /* FileChooser.h */,
414B867113AD074E00B4B373 /* FileIconLoader.cpp */,
@@ -22728,6 +22746,7 @@
E12EDB7B0B308A78002704B6 /* EventTarget.h in Headers */,
97AA3CA5145237CC003E1DA6 /* EventTargetHeaders.h in Headers */,
97AA3CA6145237CC003E1DA6 /* EventTargetInterfaces.h in Headers */,
+ D630E2AC149BF344005B2F96 /* EventTracer.h in Headers */,
BC60D8F30D2A11E000B9918F /* ExceptionBase.h in Headers */,
935FBCF209BA143B00E230B1 /* ExceptionCode.h in Headers */,
973DC640145A9409002842C2 /* ExceptionCodeDescription.h in Headers */,
@@ -22782,6 +22801,7 @@
89878563122CA064003AABDA /* FileSystemCallback.h in Headers */,
89878565122CA064003AABDA /* FileSystemCallbacks.h in Headers */,
26C17A3E1491D2D400D12BA2 /* FileSystemIOS.h in Headers */,
+ 89C7C2E1155804F4007D5A7B /* FileSystemType.h in Headers */,
976D6C8E122B8A3D001FD1F7 /* FileThread.h in Headers */,
976D6C8F122B8A3D001FD1F7 /* FileThreadTask.h in Headers */,
976D6C91122B8A3D001FD1F7 /* FileWriter.h in Headers */,
@@ -24862,6 +24882,8 @@
FD629EA3154B47160006D026 /* AudioBasicInspectorNode.h in Headers */,
31EC1E2914FF60EE00C94662 /* JSNotificationPermissionCallback.h in Headers */,
31FE6DFA15004C2A0004EBC4 /* NotificationPermissionCallback.h in Headers */,
+ B658FFA21522EF3A00DD5595 /* JSRadioNodeList.h in Headers */,
+ B658FFA61522EFAA00DD5595 /* RadioNodeList.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -25048,7 +25070,7 @@
);
inputPaths = (
"$(SRCROOT)/inspector/front-end",
- "${BUILT_PRODUCTS_DIR}/DerivedSources/WebCore/InspectorBackendStub.js",
+ "${BUILT_PRODUCTS_DIR}/DerivedSources/WebCore/InspectorBackendCommands.js",
);
name = "Copy Inspector Resources";
outputPaths = (
@@ -25056,7 +25078,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
- shellScript = "if [[ ${CONFIGURATION:=Production} == \"Production\" ]]; then\n # Don't install the Inspector front-end in Production builds.\n # Keep InspectorBackend*.js files so they can be used by other front-ends.\n ditto \"${SRCROOT}/inspector/front-end/InspectorBackend.js\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/inspector/\"\n ditto \"${BUILT_PRODUCTS_DIR}/DerivedSources/WebCore/InspectorBackendStub.js\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/inspector/\"\n exit\nfi\n\n# Copy all the Inspector front-end resources.\nditto \"${SRCROOT}/inspector/front-end\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/inspector\"\nditto \"${BUILT_PRODUCTS_DIR}/DerivedSources/WebCore/InspectorBackendStub.js\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/inspector/\"\n\n# Remove any qrc files since they are not used on the Mac (they are for Qt).\nrm -f \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/inspector/\"*.qrc\n\n# Remove *.re2js files, they are only used to generate some .js files.\nrm -f \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/inspector/\"*.re2js\n\n# Remove any .svn directories that may have been copied over.\nfind \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/inspector\" -name \".svn\" -type d | xargs rm -rf\n";
+ shellScript = "if [[ ${CONFIGURATION:=Production} == \"Production\" ]]; then\n # Don't install the Inspector front-end in Production builds.\n # Keep InspectorBackend*.js files so they can be used by other front-ends.\n ditto \"${SRCROOT}/inspector/front-end/InspectorBackend.js\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/inspector/\"\n ditto \"${BUILT_PRODUCTS_DIR}/DerivedSources/WebCore/InspectorBackendCommands.js\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/inspector/\"\n exit\nfi\n\n# Copy all the Inspector front-end resources.\nditto \"${SRCROOT}/inspector/front-end\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/inspector\"\nditto \"${BUILT_PRODUCTS_DIR}/DerivedSources/WebCore/InspectorBackendCommands.js\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/inspector/\"\n\n# Remove any qrc files since they are not used on the Mac (they are for Qt).\nrm -f \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/inspector/\"*.qrc\n\n# Remove *.re2js files, they are only used to generate some .js files.\nrm -f \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/inspector/\"*.re2js\n\n# Remove any .svn directories that may have been copied over.\nfind \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/inspector\" -name \".svn\" -type d | xargs rm -rf\n";
};
37A1EAA3142699BC0087F425 /* Check For Inappropriate Objective-C Class Names */ = {
isa = PBXShellScriptBuildPhase;
@@ -25891,6 +25913,7 @@
939885C308B7E3D100E707C4 /* EventNames.cpp in Sources */,
E0FEF372B27C53EAC1C1FBEE /* EventSource.cpp in Sources */,
E12EDBEA0B308E0B002704B6 /* EventTarget.cpp in Sources */,
+ D6FDAEF3149C06190037B1E4 /* EventTracer.cpp in Sources */,
BC60D8F20D2A11E000B9918F /* ExceptionBase.cpp in Sources */,
973DC63F145A9409002842C2 /* ExceptionCodeDescription.cpp in Sources */,
A7CACDB113CE875C00BBBE3F /* ExceptionCodePlaceholder.cpp in Sources */,
@@ -25989,7 +26012,6 @@
656D373B0ADBA5DE00A4554D /* FormState.cpp in Sources */,
41885B9411B6FDA6003383BB /* FormSubmission.cpp in Sources */,
144FCFE014EF2509000D17A3 /* FractionalLayoutRect.cpp in Sources */,
- 144FCE5C14EC79E7000D17A3 /* FractionalLayoutSize.cpp in Sources */,
65BF022E0974816300C43196 /* Frame.cpp in Sources */,
A7B070D2130A409C00A3763C /* FrameActionScheduler.cpp in Sources */,
974A862214B7ADBB003FDC76 /* FrameDestructionObserver.cpp in Sources */,
@@ -27881,6 +27903,8 @@
FD629EA4154B47160006D026 /* AudioBasicInspectorNode.cpp in Sources */,
31EC1E2814FF60EE00C94662 /* JSNotificationPermissionCallback.cpp in Sources */,
31FE6E6D1501A3BF0004EBC4 /* JSNotificationCustom.cpp in Sources */,
+ B658FFA11522EF3A00DD5595 /* JSRadioNodeList.cpp in Sources */,
+ B658FFA51522EFAA00DD5595 /* RadioNodeList.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
diff --git a/Source/WebCore/accessibility/AccessibilityMenuListOption.cpp b/Source/WebCore/accessibility/AccessibilityMenuListOption.cpp
index e6d237a62..889a409da 100644
--- a/Source/WebCore/accessibility/AccessibilityMenuListOption.cpp
+++ b/Source/WebCore/accessibility/AccessibilityMenuListOption.cpp
@@ -98,7 +98,7 @@ bool AccessibilityMenuListOption::canSetSelectedAttribute() const
bool AccessibilityMenuListOption::accessibilityIsIgnored() const
{
- return accessibilityPlatformIncludesObject() != IgnoreObject;
+ return accessibilityPlatformIncludesObject() != IncludeObject;
}
LayoutRect AccessibilityMenuListOption::elementRect() const
diff --git a/Source/WebCore/accessibility/AccessibilityMenuListPopup.cpp b/Source/WebCore/accessibility/AccessibilityMenuListPopup.cpp
index fe5716309..ac3ea1fab 100644
--- a/Source/WebCore/accessibility/AccessibilityMenuListPopup.cpp
+++ b/Source/WebCore/accessibility/AccessibilityMenuListPopup.cpp
@@ -64,7 +64,7 @@ bool AccessibilityMenuListPopup::isEnabled() const
bool AccessibilityMenuListPopup::accessibilityIsIgnored() const
{
- return accessibilityPlatformIncludesObject() != IgnoreObject;
+ return accessibilityPlatformIncludesObject() != IncludeObject;
}
AccessibilityMenuListOption* AccessibilityMenuListPopup::menuListOptionAccessibilityObject(HTMLElement* element) const
diff --git a/Source/WebCore/accessibility/chromium/AXObjectCacheChromium.cpp b/Source/WebCore/accessibility/chromium/AXObjectCacheChromium.cpp
index e01aabaf1..b483058a1 100644
--- a/Source/WebCore/accessibility/chromium/AXObjectCacheChromium.cpp
+++ b/Source/WebCore/accessibility/chromium/AXObjectCacheChromium.cpp
@@ -25,6 +25,9 @@
*/
#include "config.h"
+
+#if HAVE(ACCESSIBILITY)
+
#include "AXObjectCache.h"
#include "AccessibilityObject.h"
@@ -135,3 +138,5 @@ void AXObjectCache::handleScrolledToAnchor(const Node* anchorNode)
}
} // namespace WebCore
+
+#endif // HAVE(ACCESSIBILITY)
diff --git a/Source/WebCore/accessibility/chromium/AccessibilityObjectChromium.cpp b/Source/WebCore/accessibility/chromium/AccessibilityObjectChromium.cpp
index b65e9cf5e..698517b1c 100644
--- a/Source/WebCore/accessibility/chromium/AccessibilityObjectChromium.cpp
+++ b/Source/WebCore/accessibility/chromium/AccessibilityObjectChromium.cpp
@@ -25,6 +25,9 @@
*/
#include "config.h"
+
+#if HAVE(ACCESSIBILITY)
+
#include "AccessibilityObject.h"
namespace WebCore {
@@ -43,3 +46,5 @@ AccessibilityObjectInclusion AccessibilityObject::accessibilityPlatformIncludesO
}
} // namespace WebCore
+
+#endif // HAVE(ACCESSIBILITY)
diff --git a/Source/WebCore/bindings/js/JSHTMLCollectionCustom.cpp b/Source/WebCore/bindings/js/JSHTMLCollectionCustom.cpp
index 4f5f56c10..c62a7dd6a 100644
--- a/Source/WebCore/bindings/js/JSHTMLCollectionCustom.cpp
+++ b/Source/WebCore/bindings/js/JSHTMLCollectionCustom.cpp
@@ -28,7 +28,9 @@
#include "JSHTMLOptionsCollection.h"
#include "JSNode.h"
#include "JSNodeList.h"
+#include "JSRadioNodeList.h"
#include "Node.h"
+#include "RadioNodeList.h"
#include "StaticNodeList.h"
#include <wtf/Vector.h>
#include <wtf/text/AtomicString.h>
@@ -40,13 +42,17 @@ namespace WebCore {
static JSValue getNamedItems(ExecState* exec, JSHTMLCollection* collection, const Identifier& propertyName)
{
Vector<RefPtr<Node> > namedItems;
- collection->impl()->namedItems(identifierToAtomicString(propertyName), namedItems);
+ const AtomicString& name = identifierToAtomicString(propertyName);
+ collection->impl()->namedItems(name, namedItems);
if (namedItems.isEmpty())
return jsUndefined();
if (namedItems.size() == 1)
return toJS(exec, collection->globalObject(), namedItems[0].get());
+ if (collection->impl()->type() == FormControls)
+ return toJS(exec, collection->globalObject(), collection->impl()->base()->radioNodeList(name).get());
+
// FIXME: HTML5 specifies that this should be a DynamicNodeList.
// FIXME: HTML5 specifies that non-HTMLOptionsCollection collections should return
// the first matching item instead of a NodeList.
diff --git a/Source/WebCore/bindings/js/JSRequestAnimationFrameCallbackCustom.cpp b/Source/WebCore/bindings/js/JSRequestAnimationFrameCallbackCustom.cpp
index 67d830833..c6be647f8 100644
--- a/Source/WebCore/bindings/js/JSRequestAnimationFrameCallbackCustom.cpp
+++ b/Source/WebCore/bindings/js/JSRequestAnimationFrameCallbackCustom.cpp
@@ -33,7 +33,7 @@ using namespace JSC;
namespace WebCore {
-bool JSRequestAnimationFrameCallback::handleEvent(double highResNowMs)
+bool JSRequestAnimationFrameCallback::handleEvent(DOMTimeStamp time)
{
if (!canInvokeCallback())
return true;
@@ -43,7 +43,7 @@ bool JSRequestAnimationFrameCallback::handleEvent(double highResNowMs)
JSLock lock(SilenceAssertionsOnly);
MarkedArgumentBuffer args;
- args.append(jsNumber(highResNowMs));
+ args.append(jsNumber(time));
bool raisedException = false;
m_data->invokeCallback(args, &raisedException);
diff --git a/Source/WebCore/bindings/objc/DOMCSS.mm b/Source/WebCore/bindings/objc/DOMCSS.mm
index 660c2a017..7af56458a 100644
--- a/Source/WebCore/bindings/objc/DOMCSS.mm
+++ b/Source/WebCore/bindings/objc/DOMCSS.mm
@@ -28,6 +28,7 @@
#import "config.h"
#import "CSSRule.h"
+#import "CSSStyleSheet.h"
#import "CSSValue.h"
#import "DOMCSSCharsetRule.h"
#import "DOMCSSFontFaceRule.h"
diff --git a/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm b/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
index 1c2065816..9b1f7c489 100644
--- a/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
+++ b/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
@@ -2119,23 +2119,24 @@ sub GenerateImplementation
$implIncludes{"ExceptionCode.h"} = 1;
}
- GenerateArgumentsCountCheck(\@implContent, $function, $dataNode);
-
- if (@{$function->raisesExceptions}) {
- push(@implContent, " ExceptionCode ec = 0;\n");
- }
-
- if ($function->signature->extendedAttributes->{"CheckSecurityForNode"}) {
- push(@implContent, " if (!shouldAllowAccessToNode(exec, impl->" . $function->signature->name . "(" . (@{$function->raisesExceptions} ? "ec" : "") .")))\n");
- push(@implContent, " return JSValue::encode(jsNull());\n");
- $implIncludes{"JSDOMBinding.h"} = 1;
- }
-
+ # For compatibility with legacy content, the EventListener calls are generated without GenerateArgumentsCountCheck.
if ($function->signature->name eq "addEventListener") {
push(@implContent, GenerateEventListenerCall($className, "add"));
} elsif ($function->signature->name eq "removeEventListener") {
push(@implContent, GenerateEventListenerCall($className, "remove"));
} else {
+ GenerateArgumentsCountCheck(\@implContent, $function, $dataNode);
+
+ if (@{$function->raisesExceptions}) {
+ push(@implContent, " ExceptionCode ec = 0;\n");
+ }
+
+ if ($function->signature->extendedAttributes->{"CheckSecurityForNode"}) {
+ push(@implContent, " if (!shouldAllowAccessToNode(exec, impl->" . $function->signature->name . "(" . (@{$function->raisesExceptions} ? "ec" : "") .")))\n");
+ push(@implContent, " return JSValue::encode(jsNull());\n");
+ $implIncludes{"JSDOMBinding.h"} = 1;
+ }
+
my $numParameters = @{$function->parameters};
my ($functionString, $dummy) = GenerateParametersCheck(\@implContent, $function, $dataNode, $numParameters, $implClassName, $functionImplementationName, $svgPropertyType, $svgPropertyOrListPropertyType, $svgListPropertyType);
GenerateImplementationFunctionCall($function, $functionString, " ", $svgPropertyType, $implClassName);
@@ -2222,7 +2223,7 @@ sub GenerateImplementation
push(@implContent, " return toJS(exec, thisObj->globalObject(), static_cast<$implClassName*>(thisObj->impl())->item(index));\n");
}
push(@implContent, "}\n\n");
- if ($interfaceName eq "HTMLCollection" or $interfaceName eq "HTMLAllCollection") {
+ if ($interfaceName eq "HTMLCollection" or $interfaceName eq "HTMLAllCollection" or $interfaceName eq "RadioNodeList") {
$implIncludes{"JSNode.h"} = 1;
$implIncludes{"Node.h"} = 1;
}
diff --git a/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm b/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm
index 3bd3291fa..702ab440c 100644
--- a/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm
+++ b/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm
@@ -2124,11 +2124,6 @@ sub GenerateImplementationIndexer
my $hasCustomSetter = $dataNode->extendedAttributes->{"CustomIndexedSetter"} && !$dataNode->extendedAttributes->{"NumericIndexedGetter"};
my $hasGetter = $dataNode->extendedAttributes->{"IndexedGetter"} || $dataNode->extendedAttributes->{"CustomGetOwnPropertySlot"};
- # FIXME: Find a way to not have to special-case HTMLOptionsCollection.
- if ($interfaceName eq "HTMLOptionsCollection") {
- $hasGetter = 1;
- }
-
# FIXME: Investigate and remove this nastinesss. In V8, named property handling and indexer handling are apparently decoupled,
# which means that object[X] where X is a number doesn't reach named property indexer. So we need to provide
# simplistic, mirrored indexer handling in addition to named property handling.
@@ -2140,6 +2135,14 @@ sub GenerateImplementationIndexer
}
}
+ my $hasEnumerator = !$isSpecialCase && IsNodeSubType($dataNode);
+
+ # FIXME: Find a way to not have to special-case HTMLOptionsCollection.
+ if ($interfaceName eq "HTMLOptionsCollection") {
+ $hasEnumerator = 1;
+ $hasGetter = 1;
+ }
+
if (!$hasGetter) {
return;
}
@@ -2181,7 +2184,6 @@ END
}
my $hasDeleter = $dataNode->extendedAttributes->{"CustomDeleteProperty"};
- my $hasEnumerator = !$isSpecialCase && IsNodeSubType($dataNode);
my $setOn = "Instance";
# V8 has access-check callback API (see ObjectTemplate::SetAccessCheckCallbacks) and it's used on DOMWindow
diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.cpp
index bfa872825..2385a79ff 100644
--- a/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.cpp
+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.cpp
@@ -252,8 +252,6 @@ EncodedJSValue JSC_HOST_CALL jsTestEventTargetPrototypeFunctionAddEventListener(
JSTestEventTarget* castedThis = jsCast<JSTestEventTarget*>(asObject(thisValue));
ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestEventTarget::s_info);
TestEventTarget* impl = static_cast<TestEventTarget*>(castedThis->impl());
- if (exec->argumentCount() < 2)
- return throwVMError(exec, createNotEnoughArgumentsError(exec));
JSValue listener = exec->argument(1);
if (!listener.isObject())
return JSValue::encode(jsUndefined());
@@ -269,8 +267,6 @@ EncodedJSValue JSC_HOST_CALL jsTestEventTargetPrototypeFunctionRemoveEventListen
JSTestEventTarget* castedThis = jsCast<JSTestEventTarget*>(asObject(thisValue));
ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestEventTarget::s_info);
TestEventTarget* impl = static_cast<TestEventTarget*>(castedThis->impl());
- if (exec->argumentCount() < 2)
- return throwVMError(exec, createNotEnoughArgumentsError(exec));
JSValue listener = exec->argument(1);
if (!listener.isObject())
return JSValue::encode(jsUndefined());
diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
index 06828a48a..6a39cf415 100644
--- a/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
@@ -1826,8 +1826,6 @@ EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionAddEventListener(ExecStat
JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue));
ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
TestObj* impl = static_cast<TestObj*>(castedThis->impl());
- if (exec->argumentCount() < 2)
- return throwVMError(exec, createNotEnoughArgumentsError(exec));
JSValue listener = exec->argument(1);
if (!listener.isObject())
return JSValue::encode(jsUndefined());
@@ -1843,8 +1841,6 @@ EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionRemoveEventListener(ExecS
JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue));
ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
TestObj* impl = static_cast<TestObj*>(castedThis->impl());
- if (exec->argumentCount() < 2)
- return throwVMError(exec, createNotEnoughArgumentsError(exec));
JSValue listener = exec->argument(1);
if (!listener.isObject())
return JSValue::encode(jsUndefined());
diff --git a/Source/WebCore/bindings/scripts/test/V8/V8TestException.cpp b/Source/WebCore/bindings/scripts/test/V8/V8TestException.cpp
index 5d1777f01..f3c6b2e3c 100644
--- a/Source/WebCore/bindings/scripts/test/V8/V8TestException.cpp
+++ b/Source/WebCore/bindings/scripts/test/V8/V8TestException.cpp
@@ -112,7 +112,7 @@ v8::Handle<v8::Object> V8TestException::wrapSlow(PassRefPtr<TestException> impl,
if (!hasDependentLifetime)
wrapperHandle.MarkIndependent();
- V8DOMWrapper::setJSWrapperForDOMObject(impl, wrapperHandle);
+ V8DOMWrapper::setJSWrapperForDOMObject(impl, wrapperHandle, isolate);
return wrapper;
}
diff --git a/Source/WebCore/bindings/scripts/test/V8/V8TestException.h b/Source/WebCore/bindings/scripts/test/V8/V8TestException.h
index 86d4a4ff2..7a2f584e8 100644
--- a/Source/WebCore/bindings/scripts/test/V8/V8TestException.h
+++ b/Source/WebCore/bindings/scripts/test/V8/V8TestException.h
@@ -50,7 +50,7 @@ private:
v8::Handle<v8::Object> V8TestException::wrap(TestException* impl, v8::Isolate* isolate)
{
- v8::Handle<v8::Object> wrapper = getDOMObjectMap().get(impl);
+ v8::Handle<v8::Object> wrapper = getDOMObjectMap(isolate).get(impl);
if (!wrapper.IsEmpty())
return wrapper;
return V8TestException::wrapSlow(impl, isolate);
diff --git a/Source/WebCore/bindings/v8/V8IsolatedContext.cpp b/Source/WebCore/bindings/v8/V8IsolatedContext.cpp
index 60766f66d..b24c64553 100644
--- a/Source/WebCore/bindings/v8/V8IsolatedContext.cpp
+++ b/Source/WebCore/bindings/v8/V8IsolatedContext.cpp
@@ -105,6 +105,7 @@ V8IsolatedContext::V8IsolatedContext(V8Proxy* proxy, int extensionGroup, int wor
void V8IsolatedContext::destroy()
{
+ m_perContextData.clear();
m_frame->loader()->client()->willReleaseScriptContext(context(), m_world->id());
m_context->get().MakeWeak(this, &contextWeakReferenceCallback);
m_frame = 0;
diff --git a/Source/WebCore/bindings/v8/custom/V8HTMLCollectionCustom.cpp b/Source/WebCore/bindings/v8/custom/V8HTMLCollectionCustom.cpp
index 87bfcda79..d2416e8eb 100644
--- a/Source/WebCore/bindings/v8/custom/V8HTMLCollectionCustom.cpp
+++ b/Source/WebCore/bindings/v8/custom/V8HTMLCollectionCustom.cpp
@@ -32,12 +32,14 @@
#include "V8HTMLCollection.h"
#include "HTMLCollection.h"
+#include "RadioNodeList.h"
#include "V8Binding.h"
#include "V8HTMLAllCollection.h"
#include "V8NamedNodesCollection.h"
#include "V8Node.h"
#include "V8NodeList.h"
#include "V8Proxy.h"
+#include "V8RadioNodeList.h"
namespace WebCore {
@@ -52,6 +54,9 @@ static v8::Handle<v8::Value> getNamedItems(HTMLCollection* collection, AtomicStr
if (namedItems.size() == 1)
return toV8(namedItems.at(0).release(), isolate);
+ if (collection->type() == FormControls)
+ return toV8(collection->base()->radioNodeList(name).get());
+
return toV8(V8NamedNodesCollection::create(namedItems), isolate);
}
diff --git a/Source/WebCore/bridge/jni/JNIUtility.cpp b/Source/WebCore/bridge/jni/JNIUtility.cpp
index 69d57810e..5eccffc26 100644
--- a/Source/WebCore/bridge/jni/JNIUtility.cpp
+++ b/Source/WebCore/bridge/jni/JNIUtility.cpp
@@ -82,11 +82,23 @@ JavaVM* getJavaVM()
return jvm;
}
+// JDK 1.0 mistakenly declared the first parameter to AttachCurrentThread as
+// void** rather than as JNIEnv**. This quirk appears to have been carried
+// forward in implementations of Java despite what the documentation says.
+// On OS(ANDROID), however, AttachCurrentThread appears to follow the
+// documentation and expects a JNIEnv** parameter. The following typedef should
+// give each implementation what it desires.
+#if OS(ANDROID)
+typedef JNIEnv* JNIEnvDummy;
+#else
+typedef void* JNIEnvDummy;
+#endif
+
JNIEnv* getJNIEnv()
{
union {
JNIEnv* env;
- void* dummy;
+ JNIEnvDummy dummy;
} u;
jint jniError = 0;
diff --git a/Source/WebCore/bridge/qt/qt_runtime_qt4.cpp b/Source/WebCore/bridge/qt/qt_runtime_qt4.cpp
index 1def697e9..a114aee49 100644
--- a/Source/WebCore/bridge/qt/qt_runtime_qt4.cpp
+++ b/Source/WebCore/bridge/qt/qt_runtime_qt4.cpp
@@ -106,7 +106,7 @@ typedef enum {
Object,
Null,
RTArray,
- JSUint8ClampedArray
+ JSUint8ClampedArrayType
} JSRealType;
#if defined(QTWK_RUNTIME_CONVERSION_DEBUG) || defined(QTWK_RUNTIME_MATCH_DEBUG)
@@ -153,7 +153,7 @@ static JSRealType valueRealType(ExecState* exec, JSValue val)
else if (val.isNull())
return Null;
else if (isJSUint8ClampedArray(val))
- return JSUint8ClampedArray;
+ return JSUint8ClampedArrayType;
else if (val.isObject()) {
JSObject *object = val.toObject(exec);
if (object->inherits(&RuntimeArray::s_info)) // RuntimeArray 'inherits' from Array, but not in C++
@@ -260,7 +260,7 @@ QVariant convertValueToQVariant(ExecState* exec, JSValue value, QMetaType::Type
case QObj:
hint = QMetaType::QObjectStar;
break;
- case JSUint8ClampedArray:
+ case JSUint8ClampedArrayType:
hint = QMetaType::QByteArray;
break;
case Array:
@@ -480,7 +480,7 @@ QVariant convertValueToQVariant(ExecState* exec, JSValue value, QMetaType::Type
}
case QMetaType::QByteArray: {
- if (type == JSUint8ClampedArray) {
+ if (type == JSUint8ClampedArrayType) {
WTF::Uint8ClampedArray* arr = toUint8ClampedArray(value);
ret = QVariant(QByteArray(reinterpret_cast<const char*>(arr->data()), arr->length()));
dist = 0;
diff --git a/Source/WebCore/css/CSSComputedStyleDeclaration.cpp b/Source/WebCore/css/CSSComputedStyleDeclaration.cpp
index 3ffb7ff5c..ec20807bf 100644
--- a/Source/WebCore/css/CSSComputedStyleDeclaration.cpp
+++ b/Source/WebCore/css/CSSComputedStyleDeclaration.cpp
@@ -157,6 +157,7 @@ static const CSSPropertyID computedProperties[] = {
CSSPropertyRight,
CSSPropertySpeak,
CSSPropertyTableLayout,
+ CSSPropertyTabSize,
CSSPropertyTextAlign,
CSSPropertyTextDecoration,
CSSPropertyTextIndent,
@@ -1591,6 +1592,8 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(CSSPropert
if (style->hasAutoColumnWidth())
return cssValuePool().createIdentifierValue(CSSValueAuto);
return zoomAdjustedPixelValue(style->columnWidth(), style.get());
+ case CSSPropertyTabSize:
+ return cssValuePool().createValue(style->tabSize(), CSSPrimitiveValue::CSS_NUMBER);
case CSSPropertyWebkitRegionBreakAfter:
return cssValuePool().createValue(style->regionBreakAfter());
case CSSPropertyWebkitRegionBreakBefore:
@@ -2343,12 +2346,8 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(CSSPropert
case CSSPropertyWebkitFilter:
return valueForFilter(style.get());
#endif
- case CSSPropertyBackground: {
- const CSSPropertyID properties[5] = { CSSPropertyBackgroundColor, CSSPropertyBackgroundImage,
- CSSPropertyBackgroundRepeat, CSSPropertyBackgroundAttachment,
- CSSPropertyBackgroundPosition };
- return getCSSPropertyValuesForShorthandProperties(StylePropertyShorthand(properties, WTF_ARRAY_LENGTH(properties)));
- }
+ case CSSPropertyBackground:
+ return getBackgroundShorthandValue();
case CSSPropertyBorder: {
RefPtr<CSSValue> value = getPropertyCSSValue(CSSPropertyBorderTop, DoNotUpdateLayout);
const CSSPropertyID properties[3] = { CSSPropertyBorderRight, CSSPropertyBorderBottom,
@@ -2695,4 +2694,17 @@ void CSSComputedStyleDeclaration::setPropertyInternal(CSSPropertyID, const Strin
ec = NO_MODIFICATION_ALLOWED_ERR;
}
+PassRefPtr<CSSValueList> CSSComputedStyleDeclaration::getBackgroundShorthandValue() const
+{
+ // CSSPropertyBackgroundPosition should be at the end of the array so that CSSPropertyBackgroundSize can be appended followed by '/'.
+ static const CSSPropertyID properties[5] = { CSSPropertyBackgroundColor, CSSPropertyBackgroundImage,
+ CSSPropertyBackgroundRepeat, CSSPropertyBackgroundAttachment,
+ CSSPropertyBackgroundPosition };
+
+ RefPtr<CSSValueList> list = CSSValueList::createSlashSeparated();
+ list->append(getCSSPropertyValuesForShorthandProperties(StylePropertyShorthand(properties, WTF_ARRAY_LENGTH(properties))));
+ list->append(getPropertyCSSValue(CSSPropertyBackgroundSize, DoNotUpdateLayout));
+ return list.release();
+}
+
} // namespace WebCore
diff --git a/Source/WebCore/css/CSSComputedStyleDeclaration.h b/Source/WebCore/css/CSSComputedStyleDeclaration.h
index dcacca87c..a236a7d21 100644
--- a/Source/WebCore/css/CSSComputedStyleDeclaration.h
+++ b/Source/WebCore/css/CSSComputedStyleDeclaration.h
@@ -111,6 +111,7 @@ private:
PassRefPtr<CSSValueList> getCSSPropertyValuesForShorthandProperties(const StylePropertyShorthand&) const;
PassRefPtr<CSSValueList> getCSSPropertyValuesForSidesShorthand(const StylePropertyShorthand&) const;
+ PassRefPtr<CSSValueList> getBackgroundShorthandValue() const;
RefPtr<Node> m_node;
PseudoId m_pseudoElementSpecifier;
diff --git a/Source/WebCore/css/CSSFontFaceRule.cpp b/Source/WebCore/css/CSSFontFaceRule.cpp
index 7b611bb56..8bb94db63 100644
--- a/Source/WebCore/css/CSSFontFaceRule.cpp
+++ b/Source/WebCore/css/CSSFontFaceRule.cpp
@@ -55,4 +55,12 @@ String CSSFontFaceRule::cssText() const
return result;
}
+void CSSFontFaceRule::reattach(StyleRuleFontFace* rule)
+{
+ ASSERT(rule);
+ m_fontFaceRule = rule;
+ if (m_propertiesCSSOMWrapper)
+ m_propertiesCSSOMWrapper->reattach(m_fontFaceRule->properties());
+}
+
} // namespace WebCore
diff --git a/Source/WebCore/css/CSSFontFaceRule.h b/Source/WebCore/css/CSSFontFaceRule.h
index 222fc3133..6414c872c 100644
--- a/Source/WebCore/css/CSSFontFaceRule.h
+++ b/Source/WebCore/css/CSSFontFaceRule.h
@@ -43,6 +43,8 @@ public:
String cssText() const;
+ void reattach(StyleRuleFontFace*);
+
private:
CSSFontFaceRule(StyleRuleFontFace*, CSSStyleSheet* parent);
diff --git a/Source/WebCore/css/CSSImageSetValue.cpp b/Source/WebCore/css/CSSImageSetValue.cpp
index 7917e99a7..0f48d010a 100644
--- a/Source/WebCore/css/CSSImageSetValue.cpp
+++ b/Source/WebCore/css/CSSImageSetValue.cpp
@@ -106,8 +106,8 @@ StyleCachedImageSet* CSSImageSetValue::cachedImageSet(CachedResourceLoader* load
// and any CSS transforms. https://bugs.webkit.org/show_bug.cgi?id=81698
ImageWithScale image = bestImageForScaleFactor();
ResourceRequest request(loader->document()->completeURL(image.imageURL));
- if (CachedImage* cachedImage = loader->requestImage(request)) {
- m_imageSet = StyleCachedImageSet::create(cachedImage, image.scaleFactor, this);
+ if (CachedResourceHandle<CachedImage> cachedImage = loader->requestImage(request)) {
+ m_imageSet = StyleCachedImageSet::create(cachedImage.get(), image.scaleFactor, this);
m_accessedBestFitImage = true;
}
}
diff --git a/Source/WebCore/css/CSSImageValue.cpp b/Source/WebCore/css/CSSImageValue.cpp
index db56bd428..61964630c 100644
--- a/Source/WebCore/css/CSSImageValue.cpp
+++ b/Source/WebCore/css/CSSImageValue.cpp
@@ -82,8 +82,8 @@ StyleCachedImage* CSSImageValue::cachedImage(CachedResourceLoader* loader, const
m_accessedImage = true;
ResourceRequest request(loader->document()->completeURL(url));
- if (CachedImage* cachedImage = loader->requestImage(request))
- m_image = StyleCachedImage::create(cachedImage);
+ if (CachedResourceHandle<CachedImage> cachedImage = loader->requestImage(request))
+ m_image = StyleCachedImage::create(cachedImage.get());
}
return (m_image && m_image->isCachedImage()) ? static_cast<StyleCachedImage*>(m_image.get()) : 0;
diff --git a/Source/WebCore/css/CSSImportRule.cpp b/Source/WebCore/css/CSSImportRule.cpp
index f9d14671b..d150fb935 100644
--- a/Source/WebCore/css/CSSImportRule.cpp
+++ b/Source/WebCore/css/CSSImportRule.cpp
@@ -22,6 +22,7 @@
#include "config.h"
#include "CSSImportRule.h"
+#include "CSSStyleSheet.h"
#include "CachedCSSStyleSheet.h"
#include "CachedResourceLoader.h"
#include "Document.h"
diff --git a/Source/WebCore/css/CSSMediaRule.cpp b/Source/WebCore/css/CSSMediaRule.cpp
index a6ee351f7..e09904209 100644
--- a/Source/WebCore/css/CSSMediaRule.cpp
+++ b/Source/WebCore/css/CSSMediaRule.cpp
@@ -25,6 +25,7 @@
#include "CSSParser.h"
#include "CSSRuleList.h"
+#include "CSSStyleSheet.h"
#include "ExceptionCode.h"
#include "StyleRule.h"
#include <wtf/text/StringBuilder.h>
@@ -80,13 +81,11 @@ unsigned CSSMediaRule::insertRule(const String& ruleString, unsigned index, Exce
ec = HIERARCHY_REQUEST_ERR;
return 0;
}
+ CSSStyleSheet::RuleMutationScope mutationScope(this);
+
m_mediaRule->wrapperInsertRule(index, newRule);
m_childRuleCSSOMWrappers.insert(index, RefPtr<CSSRule>());
-
- if (CSSStyleSheet* styleSheet = parentStyleSheet())
- styleSheet->styleSheetChanged();
-
return index;
}
@@ -100,14 +99,14 @@ void CSSMediaRule::deleteRule(unsigned index, ExceptionCode& ec)
ec = INDEX_SIZE_ERR;
return;
}
+
+ CSSStyleSheet::RuleMutationScope mutationScope(this);
+
m_mediaRule->wrapperRemoveRule(index);
if (m_childRuleCSSOMWrappers[index])
m_childRuleCSSOMWrappers[index]->setParentRule(0);
m_childRuleCSSOMWrappers.remove(index);
-
- if (CSSStyleSheet* styleSheet = parentStyleSheet())
- styleSheet->styleSheetChanged();
}
String CSSMediaRule::cssText() const
@@ -163,4 +162,16 @@ CSSRuleList* CSSMediaRule::cssRules() const
return m_ruleListCSSOMWrapper.get();
}
+void CSSMediaRule::reattach(StyleRuleMedia* rule)
+{
+ ASSERT(rule);
+ m_mediaRule = rule;
+ if (m_mediaCSSOMWrapper)
+ m_mediaCSSOMWrapper->reattach(m_mediaRule->mediaQueries());
+ for (unsigned i = 0; i < m_childRuleCSSOMWrappers.size(); ++i) {
+ if (m_childRuleCSSOMWrappers[i])
+ m_childRuleCSSOMWrappers[i]->reattach(m_mediaRule->childRules()[i].get());
+ }
+}
+
} // namespace WebCore
diff --git a/Source/WebCore/css/CSSMediaRule.h b/Source/WebCore/css/CSSMediaRule.h
index 1aa544252..fda23cae2 100644
--- a/Source/WebCore/css/CSSMediaRule.h
+++ b/Source/WebCore/css/CSSMediaRule.h
@@ -50,6 +50,8 @@ public:
unsigned length() const;
CSSRule* item(unsigned index) const;
+ void reattach(StyleRuleMedia*);
+
private:
CSSMediaRule(StyleRuleMedia*, CSSStyleSheet*);
diff --git a/Source/WebCore/css/CSSPageRule.cpp b/Source/WebCore/css/CSSPageRule.cpp
index 88a089954..70bbab7ba 100644
--- a/Source/WebCore/css/CSSPageRule.cpp
+++ b/Source/WebCore/css/CSSPageRule.cpp
@@ -24,6 +24,7 @@
#include "CSSParser.h"
#include "CSSSelector.h"
+#include "CSSStyleSheet.h"
#include "Document.h"
#include "PropertySetCSSStyleDeclaration.h"
#include "StylePropertySet.h"
@@ -65,24 +66,16 @@ String CSSPageRule::selectorText() const
void CSSPageRule::setSelectorText(const String& selectorText)
{
- Document* doc = 0;
- if (CSSStyleSheet* styleSheet = parentStyleSheet())
- doc = styleSheet->ownerDocument();
- if (!doc)
- return;
-
CSSParser parser(parserContext());
CSSSelectorList selectorList;
parser.parseSelector(selectorText, selectorList);
if (!selectorList.first())
return;
-
+
+ CSSStyleSheet::RuleMutationScope mutationScope(this);
+
String oldSelectorText = this->selectorText();
m_pageRule->wrapperAdoptSelectorList(selectorList);
-
- if (this->selectorText() == oldSelectorText)
- return;
- doc->styleResolverChanged(DeferRecalcStyle);
}
String CSSPageRule::cssText() const
@@ -94,4 +87,12 @@ String CSSPageRule::cssText() const
return result;
}
+void CSSPageRule::reattach(StyleRulePage* rule)
+{
+ ASSERT(rule);
+ m_pageRule = rule;
+ if (m_propertiesCSSOMWrapper)
+ m_propertiesCSSOMWrapper->reattach(m_pageRule->properties());
+}
+
} // namespace WebCore
diff --git a/Source/WebCore/css/CSSPageRule.h b/Source/WebCore/css/CSSPageRule.h
index 69a578d75..163900cd1 100644
--- a/Source/WebCore/css/CSSPageRule.h
+++ b/Source/WebCore/css/CSSPageRule.h
@@ -45,7 +45,9 @@ public:
void setSelectorText(const String&);
String cssText() const;
-
+
+ void reattach(StyleRulePage*);
+
private:
CSSPageRule(StyleRulePage*, CSSStyleSheet*);
diff --git a/Source/WebCore/css/CSSParser.cpp b/Source/WebCore/css/CSSParser.cpp
index 3eef56cf6..6941c126d 100644
--- a/Source/WebCore/css/CSSParser.cpp
+++ b/Source/WebCore/css/CSSParser.cpp
@@ -439,63 +439,46 @@ static inline bool isSimpleLengthPropertyID(CSSPropertyID propertyId, bool& acce
}
}
+template <typename CharType>
+static inline bool parseSimpleLength(const CharType* characters, unsigned& length, CSSPrimitiveValue::UnitTypes& unit, double& number)
+{
+ if (length > 2 && (characters[length - 2] | 0x20) == 'p' && (characters[length - 1] | 0x20) == 'x') {
+ length -= 2;
+ unit = CSSPrimitiveValue::CSS_PX;
+ } else if (length > 1 && characters[length - 1] == '%') {
+ length -= 1;
+ unit = CSSPrimitiveValue::CSS_PERCENTAGE;
+ }
+
+ // We rely on charactersToDouble for validation as well. The function
+ // will set "ok" to "false" if the entire passed-in character range does
+ // not represent a double.
+ bool ok;
+ number = charactersToDouble(characters, length, &ok);
+ return ok;
+}
+
static bool parseSimpleLengthValue(StylePropertySet* declaration, CSSPropertyID propertyId, const String& string, bool important, CSSParserMode cssParserMode)
{
ASSERT(!string.isEmpty());
bool acceptsNegativeNumbers;
- bool strict = isStrictParserMode(cssParserMode);
- unsigned length = string.length();
+ if (!isSimpleLengthPropertyID(propertyId, acceptsNegativeNumbers))
+ return false;
+ unsigned length = string.length();
double number;
- bool ok;
CSSPrimitiveValue::UnitTypes unit = CSSPrimitiveValue::CSS_NUMBER;
if (string.is8Bit()) {
- const LChar* characters8 = string.characters8();
- if (!characters8)
- return false;
-
- if (!isSimpleLengthPropertyID(propertyId, acceptsNegativeNumbers))
+ if (!parseSimpleLength(string.characters8(), length, unit, number))
return false;
-
- if (length > 2 && (characters8[length - 2] | 0x20) == 'p' && (characters8[length - 1] | 0x20) == 'x') {
- length -= 2;
- unit = CSSPrimitiveValue::CSS_PX;
- } else if (length > 1 && characters8[length - 1] == '%') {
- length -= 1;
- unit = CSSPrimitiveValue::CSS_PERCENTAGE;
- }
-
- // We rely on charactersToDouble for validation as well. The function
- // will set "ok" to "false" if the entire passed-in character range does
- // not represent a double.
- number = charactersToDouble(characters8, length, &ok);
} else {
- const UChar* characters16 = string.characters16();
- if (!characters16)
- return false;
-
- if (!isSimpleLengthPropertyID(propertyId, acceptsNegativeNumbers))
+ if (!parseSimpleLength(string.characters16(), length, unit, number))
return false;
-
- if (length > 2 && (characters16[length - 2] | 0x20) == 'p' && (characters16[length - 1] | 0x20) == 'x') {
- length -= 2;
- unit = CSSPrimitiveValue::CSS_PX;
- } else if (length > 1 && characters16[length - 1] == '%') {
- length -= 1;
- unit = CSSPrimitiveValue::CSS_PERCENTAGE;
- }
-
- // We rely on charactersToDouble for validation as well. The function
- // will set "ok" to "false" if the entire passed-in character range does
- // not represent a double.
- number = charactersToDouble(characters16, length, &ok);
}
- if (!ok)
- return false;
if (unit == CSSPrimitiveValue::CSS_NUMBER) {
- if (number && strict)
+ if (number && isStrictParserMode(cssParserMode))
return false;
unit = CSSPrimitiveValue::CSS_PX;
}
@@ -1990,6 +1973,9 @@ bool CSSParser::parseValue(CSSPropertyID propId, bool important)
addProperty(propId, val.release(), important);
return true;
}
+ case CSSPropertyTabSize:
+ validPrimitive = validUnit(value, FInteger | FNonNeg);
+ break;
case CSSPropertyWebkitAspectRatio:
return parseAspectRatio(important);
case CSSPropertyBorderRadius:
@@ -2307,11 +2293,10 @@ bool CSSParser::parseValue(CSSPropertyID propId, bool important)
case CSSPropertyBackground: {
// Position must come before color in this array because a plain old "0" is a legal color
// in quirks mode but it's usually the X coordinate of a position.
- // FIXME: Add CSSPropertyBackgroundSize to the shorthand.
const CSSPropertyID properties[] = { CSSPropertyBackgroundImage, CSSPropertyBackgroundRepeat,
CSSPropertyBackgroundAttachment, CSSPropertyBackgroundPosition, CSSPropertyBackgroundOrigin,
- CSSPropertyBackgroundClip, CSSPropertyBackgroundColor };
- return parseFillShorthand(propId, properties, 7, important);
+ CSSPropertyBackgroundClip, CSSPropertyBackgroundColor, CSSPropertyBackgroundSize };
+ return parseFillShorthand(propId, properties, WTF_ARRAY_LENGTH(properties), important);
}
case CSSPropertyWebkitMask: {
const CSSPropertyID properties[] = { CSSPropertyWebkitMaskImage, CSSPropertyWebkitMaskRepeat,
@@ -2601,6 +2586,7 @@ bool CSSParser::parseFillShorthand(CSSPropertyID propId, const CSSPropertyID* pr
RefPtr<CSSValue> repeatYValue;
bool foundClip = false;
int i;
+ bool foundBackgroundPositionCSSProperty = false;
while (m_valueList->current()) {
CSSParserValue* val = m_valueList->current();
@@ -2630,8 +2616,21 @@ bool CSSParser::parseFillShorthand(CSSPropertyID propId, const CSSPropertyID* pr
break;
}
+ bool backgroundSizeCSSPropertyExpected = false;
+ if ((val->unit == CSSParserValue::Operator && val->iValue == '/') && foundBackgroundPositionCSSProperty) {
+ backgroundSizeCSSPropertyExpected = true;
+ m_valueList->next();
+ }
+
+ foundBackgroundPositionCSSProperty = false;
bool found = false;
for (i = 0; !found && i < numProperties; ++i) {
+
+ if (backgroundSizeCSSPropertyExpected && properties[i] != CSSPropertyBackgroundSize)
+ continue;
+ if (!backgroundSizeCSSPropertyExpected && properties[i] == CSSPropertyBackgroundSize)
+ continue;
+
if (!parsedProperty[i]) {
RefPtr<CSSValue> val1;
RefPtr<CSSValue> val2;
@@ -2656,6 +2655,8 @@ bool CSSParser::parseFillShorthand(CSSPropertyID propId, const CSSPropertyID* pr
addFillValue(clipValue, val1.release());
foundClip = true;
}
+ if (properties[i] == CSSPropertyBackgroundPosition)
+ foundBackgroundPositionCSSProperty = true;
}
}
}
diff --git a/Source/WebCore/css/CSSProperty.cpp b/Source/WebCore/css/CSSProperty.cpp
index ad8797aec..a00e774ad 100644
--- a/Source/WebCore/css/CSSProperty.cpp
+++ b/Source/WebCore/css/CSSProperty.cpp
@@ -279,6 +279,7 @@ bool CSSProperty::isInheritedProperty(CSSPropertyID propertyID)
case CSSPropertyQuotes:
case CSSPropertyResize:
case CSSPropertySpeak:
+ case CSSPropertyTabSize:
case CSSPropertyTextAlign:
case CSSPropertyTextDecoration:
case CSSPropertyTextIndent:
diff --git a/Source/WebCore/css/CSSPropertyNames.in b/Source/WebCore/css/CSSPropertyNames.in
index aee5c06af..1a22f254d 100644
--- a/Source/WebCore/css/CSSPropertyNames.in
+++ b/Source/WebCore/css/CSSPropertyNames.in
@@ -150,6 +150,7 @@ size
src
speak
table-layout
+tab-size
text-align
text-decoration
text-indent
diff --git a/Source/WebCore/css/CSSRule.cpp b/Source/WebCore/css/CSSRule.cpp
index 13ad50ad3..09643ea9e 100644
--- a/Source/WebCore/css/CSSRule.cpp
+++ b/Source/WebCore/css/CSSRule.cpp
@@ -28,11 +28,13 @@
#include "CSSMediaRule.h"
#include "CSSPageRule.h"
#include "CSSStyleRule.h"
+#include "CSSStyleSheet.h"
#include "CSSUnknownRule.h"
#include "WebKitCSSKeyframeRule.h"
#include "WebKitCSSKeyframesRule.h"
#include "WebKitCSSRegionRule.h"
#include "NotImplemented.h"
+#include "StyleRule.h"
namespace WebCore {
@@ -113,4 +115,48 @@ void CSSRule::destroy()
ASSERT_NOT_REACHED();
}
+void CSSRule::reattach(StyleRuleBase* rule)
+{
+ switch (type()) {
+ case UNKNOWN_RULE:
+ return;
+ case STYLE_RULE:
+ static_cast<CSSStyleRule*>(this)->reattach(static_cast<StyleRule*>(rule));
+ return;
+ case PAGE_RULE:
+ static_cast<CSSPageRule*>(this)->reattach(static_cast<StyleRulePage*>(rule));
+ return;
+ case CHARSET_RULE:
+ ASSERT(!rule);
+ return;
+ case IMPORT_RULE:
+ // FIXME: Implement when enabling caching for stylesheets with import rules.
+ ASSERT_NOT_REACHED();
+ return;
+ case MEDIA_RULE:
+ static_cast<CSSMediaRule*>(this)->reattach(static_cast<StyleRuleMedia*>(rule));
+ return;
+ case FONT_FACE_RULE:
+ static_cast<CSSFontFaceRule*>(this)->reattach(static_cast<StyleRuleFontFace*>(rule));
+ return;
+ case WEBKIT_KEYFRAMES_RULE:
+ static_cast<WebKitCSSKeyframesRule*>(this)->reattach(static_cast<StyleRuleKeyframes*>(rule));
+ return;
+ case WEBKIT_KEYFRAME_RULE:
+ // No need to reattach, the underlying data is shareable on mutation.
+ ASSERT_NOT_REACHED();
+ return;
+ case WEBKIT_REGION_RULE:
+ static_cast<WebKitCSSRegionRule*>(this)->reattach(static_cast<StyleRuleRegion*>(rule));
+ return;
+ }
+ ASSERT_NOT_REACHED();
+}
+
+const CSSParserContext& CSSRule::parserContext() const
+{
+ CSSStyleSheet* styleSheet = parentStyleSheet();
+ return styleSheet ? styleSheet->internal()->parserContext() : strictCSSParserContext();
+}
+
} // namespace WebCore
diff --git a/Source/WebCore/css/CSSRule.h b/Source/WebCore/css/CSSRule.h
index 5a50645aa..5ec2f7aa8 100644
--- a/Source/WebCore/css/CSSRule.h
+++ b/Source/WebCore/css/CSSRule.h
@@ -23,12 +23,15 @@
#ifndef CSSRule_h
#define CSSRule_h
-#include "CSSStyleSheet.h"
#include "KURLHash.h"
#include <wtf/ListHashSet.h>
+#include <wtf/RefCounted.h>
namespace WebCore {
+class CSSStyleSheet;
+class StyleRuleBase;
+struct CSSParserContext;
typedef int ExceptionCode;
class CSSRule : public RefCounted<CSSRule> {
@@ -93,6 +96,8 @@ public:
String cssText() const;
void setCssText(const String&, ExceptionCode&);
+ void reattach(StyleRuleBase*);
+
protected:
CSSRule(CSSStyleSheet* parent, Type type)
: m_hasCachedSelectorText(false)
@@ -110,11 +115,7 @@ protected:
bool hasCachedSelectorText() const { return m_hasCachedSelectorText; }
void setHasCachedSelectorText(bool hasCachedSelectorText) const { m_hasCachedSelectorText = hasCachedSelectorText; }
- const CSSParserContext& parserContext() const
- {
- CSSStyleSheet* styleSheet = parentStyleSheet();
- return styleSheet ? styleSheet->internal()->parserContext() : strictCSSParserContext();
- }
+ const CSSParserContext& parserContext() const;
private:
mutable unsigned m_hasCachedSelectorText : 1;
diff --git a/Source/WebCore/css/CSSStyleRule.cpp b/Source/WebCore/css/CSSStyleRule.cpp
index 7357fcf22..5a780264a 100644
--- a/Source/WebCore/css/CSSStyleRule.cpp
+++ b/Source/WebCore/css/CSSStyleRule.cpp
@@ -91,18 +91,14 @@ String CSSStyleRule::selectorText() const
void CSSStyleRule::setSelectorText(const String& selectorText)
{
- Document* doc = 0;
- if (CSSStyleSheet* styleSheet = parentStyleSheet())
- doc = styleSheet->ownerDocument();
- if (!doc)
- return;
-
CSSParser p(parserContext());
CSSSelectorList selectorList;
p.parseSelector(selectorText, selectorList);
if (!selectorList.first())
return;
+ CSSStyleSheet::RuleMutationScope mutationScope(this);
+
String oldSelectorText = this->selectorText();
m_styleRule->wrapperAdoptSelectorList(selectorList);
@@ -110,8 +106,6 @@ void CSSStyleRule::setSelectorText(const String& selectorText)
ASSERT(selectorTextCache().contains(this));
selectorTextCache().set(this, generateSelectorText());
}
-
- doc->styleResolverChanged(DeferRecalcStyle);
}
String CSSStyleRule::cssText() const
@@ -125,4 +119,11 @@ String CSSStyleRule::cssText() const
return result;
}
+void CSSStyleRule::reattach(StyleRule* rule)
+{
+ m_styleRule = rule;
+ if (m_propertiesCSSOMWrapper)
+ m_propertiesCSSOMWrapper->reattach(m_styleRule->properties());
+}
+
} // namespace WebCore
diff --git a/Source/WebCore/css/CSSStyleRule.h b/Source/WebCore/css/CSSStyleRule.h
index ae03b5887..d76a802fa 100644
--- a/Source/WebCore/css/CSSStyleRule.h
+++ b/Source/WebCore/css/CSSStyleRule.h
@@ -48,6 +48,8 @@ public:
// FIXME: Not CSSOM. Remove.
StyleRule* styleRule() const { return m_styleRule.get(); }
+ void reattach(StyleRule*);
+
private:
CSSStyleRule(StyleRule*, CSSStyleSheet*);
diff --git a/Source/WebCore/css/CSSStyleSheet.cpp b/Source/WebCore/css/CSSStyleSheet.cpp
index 3852008db..329fc8d14 100644
--- a/Source/WebCore/css/CSSStyleSheet.cpp
+++ b/Source/WebCore/css/CSSStyleSheet.cpp
@@ -99,7 +99,8 @@ StyleSheetInternal::StyleSheetInternal(StyleRuleImport* ownerRule, const String&
, m_hasSyntacticallyValidCSSHeader(true)
, m_didLoadErrorOccur(false)
, m_usesRemUnits(false)
- , m_hasMutated(false)
+ , m_isMutable(false)
+ , m_isInMemoryCache(false)
, m_parserContext(context)
{
}
@@ -118,7 +119,8 @@ StyleSheetInternal::StyleSheetInternal(const StyleSheetInternal& o)
, m_hasSyntacticallyValidCSSHeader(o.m_hasSyntacticallyValidCSSHeader)
, m_didLoadErrorOccur(false)
, m_usesRemUnits(o.m_usesRemUnits)
- , m_hasMutated(false)
+ , m_isMutable(false)
+ , m_isInMemoryCache(false)
, m_parserContext(o.m_parserContext)
{
ASSERT(o.isCacheable());
@@ -140,13 +142,16 @@ bool StyleSheetInternal::isCacheable() const
// FIXME: Support copying import rules.
if (!m_importRules.isEmpty())
return false;
+ // FIXME: Support cached stylesheets in import rules.
+ if (m_ownerRule)
+ return false;
// This would require dealing with multiple clients for load callbacks.
if (!m_loadCompleted)
return false;
if (m_didLoadErrorOccur)
return false;
// It is not the original sheet anymore.
- if (m_hasMutated)
+ if (m_isMutable)
return false;
// If the header is valid we are not going to need to check the SecurityOrigin.
// FIXME: Valid mime type avoids the check too.
@@ -169,21 +174,21 @@ void StyleSheetInternal::parserAppendRule(PassRefPtr<StyleRuleBase> rule)
m_childRules.append(rule);
}
-PassRefPtr<CSSRule> StyleSheetInternal::createChildRuleCSSOMWrapper(unsigned index, CSSStyleSheet* parentWrapper)
+StyleRuleBase* StyleSheetInternal::ruleAt(unsigned index) const
{
ASSERT(index < ruleCount());
unsigned childVectorIndex = index;
if (hasCharsetRule()) {
if (index == 0)
- return CSSCharsetRule::create(parentWrapper, m_encodingFromCharsetRule);
+ return 0;
--childVectorIndex;
}
if (childVectorIndex < m_importRules.size())
- return m_importRules[childVectorIndex]->createCSSOMWrapper(parentWrapper);
-
+ return m_importRules[childVectorIndex].get();
+
childVectorIndex -= m_importRules.size();
- return m_childRules[childVectorIndex]->createCSSOMWrapper(parentWrapper);
+ return m_childRules[childVectorIndex].get();
}
unsigned StyleSheetInternal::ruleCount() const
@@ -220,6 +225,7 @@ void StyleSheetInternal::parserSetEncodingFromCharsetRule(const String& encoding
bool StyleSheetInternal::wrapperInsertRule(PassRefPtr<StyleRuleBase> rule, unsigned index)
{
+ ASSERT(m_isMutable);
ASSERT(index <= ruleCount());
// Parser::parseRule doesn't currently allow @charset so we don't need to deal with it.
ASSERT(!rule->isCharsetRule());
@@ -242,7 +248,6 @@ bool StyleSheetInternal::wrapperInsertRule(PassRefPtr<StyleRuleBase> rule, unsig
m_importRules[childVectorIndex]->setParentStyleSheet(this);
m_importRules[childVectorIndex]->requestStyleSheet();
// FIXME: Stylesheet doesn't actually change meaningfully before the imported sheets are loaded.
- styleSheetChanged();
return true;
}
// Inserting @import rule after a non-import rule is not allowed.
@@ -251,20 +256,18 @@ bool StyleSheetInternal::wrapperInsertRule(PassRefPtr<StyleRuleBase> rule, unsig
childVectorIndex -= m_importRules.size();
m_childRules.insert(childVectorIndex, rule);
-
- styleSheetChanged();
return true;
}
void StyleSheetInternal::wrapperDeleteRule(unsigned index)
{
+ ASSERT(m_isMutable);
ASSERT(index < ruleCount());
unsigned childVectorIndex = index;
if (hasCharsetRule()) {
if (childVectorIndex == 0) {
clearCharsetRule();
- styleSheetChanged();
return;
}
--childVectorIndex;
@@ -272,13 +275,11 @@ void StyleSheetInternal::wrapperDeleteRule(unsigned index)
if (childVectorIndex < m_importRules.size()) {
m_importRules[childVectorIndex]->clearParentStyleSheet();
m_importRules.remove(childVectorIndex);
- styleSheetChanged();
return;
}
childVectorIndex -= m_importRules.size();
m_childRules.remove(childVectorIndex);
- styleSheetChanged();
}
void StyleSheetInternal::parserAddNamespace(const AtomicString& prefix, const AtomicString& uri)
@@ -415,16 +416,6 @@ Document* StyleSheetInternal::singleOwnerDocument() const
return ownerNode ? ownerNode->document() : 0;
}
-void StyleSheetInternal::styleSheetChanged()
-{
- m_hasMutated = true;
-
- Document* ownerDocument = singleOwnerDocument();
- if (!ownerDocument)
- return;
- ownerDocument->styleResolverChanged(DeferRecalcStyle);
-}
-
KURL StyleSheetInternal::completeURL(const String& url) const
{
return CSSParser::completeURL(m_parserContext, url);
@@ -473,6 +464,20 @@ void StyleSheetInternal::unregisterClient(CSSStyleSheet* sheet)
m_clients.remove(position);
}
+void StyleSheetInternal::addedToMemoryCache()
+{
+ ASSERT(!m_isInMemoryCache);
+ ASSERT(isCacheable());
+ m_isInMemoryCache = true;
+}
+
+void StyleSheetInternal::removedFromMemoryCache()
+{
+ ASSERT(m_isInMemoryCache);
+ ASSERT(isCacheable());
+ m_isInMemoryCache = false;
+}
+
PassRefPtr<CSSStyleSheet> CSSStyleSheet::createInline(Node* ownerNode, const KURL& baseURL, const String& encoding)
{
CSSParserContext parserContext(ownerNode->document(), baseURL, encoding);
@@ -514,14 +519,59 @@ CSSStyleSheet::~CSSStyleSheet()
m_internal->unregisterClient(this);
}
+void CSSStyleSheet::willMutateRules()
+{
+ // If we are the only client it is safe to mutate.
+ if (m_internal->hasOneClient() && !m_internal->isInMemoryCache()) {
+ m_internal->setMutable();
+ return;
+ }
+ // Only cacheable stylesheets should have multiple clients.
+ ASSERT(m_internal->isCacheable());
+
+ // Copy-on-write.
+ m_internal->unregisterClient(this);
+ m_internal = m_internal->copy();
+ m_internal->registerClient(this);
+
+ m_internal->setMutable();
+
+ // Any existing CSSOM wrappers need to be connected to the copied child rules.
+ reattachChildRuleCSSOMWrappers();
+}
+
+void CSSStyleSheet::didMutateRules()
+{
+ ASSERT(m_internal->isMutable());
+ ASSERT(m_internal->hasOneClient());
+
+ didMutate();
+}
+
+void CSSStyleSheet::didMutate()
+{
+ Document* owner = ownerDocument();
+ if (!owner)
+ return;
+ owner->styleResolverChanged(DeferRecalcStyle);
+}
+
+void CSSStyleSheet::reattachChildRuleCSSOMWrappers()
+{
+ for (unsigned i = 0; i < m_childRuleCSSOMWrappers.size(); ++i) {
+ if (!m_childRuleCSSOMWrappers[i])
+ continue;
+ m_childRuleCSSOMWrappers[i]->reattach(m_internal->ruleAt(i));
+ }
+}
+
void CSSStyleSheet::setDisabled(bool disabled)
{
if (disabled == m_isDisabled)
return;
m_isDisabled = disabled;
- Document* owner = ownerDocument();
- if (owner)
- owner->styleResolverChanged(DeferRecalcStyle);
+
+ didMutate();
}
void CSSStyleSheet::setMediaQueries(PassRefPtr<MediaQuerySet> mediaQueries)
@@ -545,8 +595,13 @@ CSSRule* CSSStyleSheet::item(unsigned index)
ASSERT(m_childRuleCSSOMWrappers.size() == ruleCount);
RefPtr<CSSRule>& cssRule = m_childRuleCSSOMWrappers[index];
- if (!cssRule)
- cssRule = m_internal->createChildRuleCSSOMWrapper(index, this);
+ if (!cssRule) {
+ if (index == 0 && m_internal->hasCharsetRule()) {
+ ASSERT(!m_internal->ruleAt(0));
+ cssRule = CSSCharsetRule::create(this, m_internal->encodingFromCharsetRule());
+ } else
+ cssRule = m_internal->ruleAt(index)->createCSSOMWrapper(this);
+ }
return cssRule.get();
}
@@ -584,6 +639,8 @@ unsigned CSSStyleSheet::insertRule(const String& ruleString, unsigned index, Exc
ec = SYNTAX_ERR;
return 0;
}
+ RuleMutationScope mutationScope(this);
+
bool success = m_internal->wrapperInsertRule(rule, index);
if (!success) {
ec = HIERARCHY_REQUEST_ERR;
@@ -591,6 +648,7 @@ unsigned CSSStyleSheet::insertRule(const String& ruleString, unsigned index, Exc
}
if (!m_childRuleCSSOMWrappers.isEmpty())
m_childRuleCSSOMWrappers.insert(index, RefPtr<CSSRule>());
+
return index;
}
@@ -603,6 +661,8 @@ void CSSStyleSheet::deleteRule(unsigned index, ExceptionCode& ec)
ec = INDEX_SIZE_ERR;
return;
}
+ RuleMutationScope mutationScope(this);
+
m_internal->wrapperDeleteRule(index);
if (!m_childRuleCSSOMWrappers.isEmpty()) {
diff --git a/Source/WebCore/css/CSSStyleSheet.h b/Source/WebCore/css/CSSStyleSheet.h
index 9bd30578b..425f675ba 100644
--- a/Source/WebCore/css/CSSStyleSheet.h
+++ b/Source/WebCore/css/CSSStyleSheet.h
@@ -22,8 +22,10 @@
#define CSSStyleSheet_h
#include "CSSParserMode.h"
+#include "CSSRule.h"
#include "StyleSheet.h"
#include <wtf/HashMap.h>
+#include <wtf/Noncopyable.h>
#include <wtf/text/AtomicStringHash.h>
namespace WebCore {
@@ -65,8 +67,6 @@ public:
const AtomicString& determineNamespace(const AtomicString& prefix);
- void styleSheetChanged();
-
void parseAuthorStyleSheet(const CachedCSSStyleSheet*, const SecurityOrigin*);
bool parseString(const String&);
bool parseStringAtLine(const String&, int startLineNumber);
@@ -101,6 +101,8 @@ public:
void clearRules();
+ bool hasCharsetRule() const { return !m_encodingFromCharsetRule.isNull(); }
+ String encodingFromCharsetRule() const { return m_encodingFromCharsetRule; }
// Rules other than @charset and @import.
const Vector<RefPtr<StyleRuleBase> >& childRules() const { return m_childRules; }
const Vector<RefPtr<StyleRuleImport> >& importRules() const { return m_importRules; }
@@ -120,7 +122,8 @@ public:
const KURL& baseURL() const { return m_parserContext.baseURL; }
unsigned ruleCount() const;
-
+ StyleRuleBase* ruleAt(unsigned index) const;
+
bool usesRemUnits() const { return m_usesRemUnits; }
unsigned estimatedSizeInBytes() const;
@@ -128,19 +131,24 @@ public:
bool wrapperInsertRule(PassRefPtr<StyleRuleBase>, unsigned index);
void wrapperDeleteRule(unsigned index);
- PassRefPtr<CSSRule> createChildRuleCSSOMWrapper(unsigned index, CSSStyleSheet* parentWrapper);
-
PassRefPtr<StyleSheetInternal> copy() const { return adoptRef(new StyleSheetInternal(*this)); }
void registerClient(CSSStyleSheet*);
void unregisterClient(CSSStyleSheet*);
+ bool hasOneClient() { return m_clients.size() == 1; }
+
+ bool isMutable() const { return m_isMutable; }
+ void setMutable() { m_isMutable = true; }
+
+ bool isInMemoryCache() const { return m_isInMemoryCache; }
+ void addedToMemoryCache();
+ void removedFromMemoryCache();
private:
StyleSheetInternal(StyleRuleImport* ownerRule, const String& originalURL, const KURL& baseURL, const CSSParserContext&);
StyleSheetInternal(const StyleSheetInternal&);
void clearCharsetRule();
- bool hasCharsetRule() const { return !m_encodingFromCharsetRule.isNull(); }
StyleRuleImport* m_ownerRule;
@@ -158,7 +166,8 @@ private:
bool m_hasSyntacticallyValidCSSHeader : 1;
bool m_didLoadErrorOccur : 1;
bool m_usesRemUnits : 1;
- bool m_hasMutated : 1;
+ bool m_isMutable : 1;
+ bool m_isInMemoryCache : 1;
CSSParserContext m_parserContext;
@@ -207,13 +216,28 @@ public:
virtual bool isLoading() const OVERRIDE { return m_internal->isLoading(); }
void clearOwnerRule() { m_ownerRule = 0; }
- void styleSheetChanged() { m_internal->styleSheetChanged(); }
Document* ownerDocument() const;
MediaQuerySet* mediaQueries() const { return m_mediaQueries.get(); }
void setMediaQueries(PassRefPtr<MediaQuerySet>);
void setTitle(const String& title) { m_title = title; }
+
+ class RuleMutationScope {
+ WTF_MAKE_NONCOPYABLE(RuleMutationScope);
+ public:
+ RuleMutationScope(CSSStyleSheet*);
+ RuleMutationScope(CSSRule*);
+ ~RuleMutationScope();
+
+ private:
+ CSSStyleSheet* m_styleSheet;
+ };
+
+ void willMutateRules();
+ void didMutateRules();
+ void didMutate();
void clearChildRuleCSSOMWrappers();
+ void reattachChildRuleCSSOMWrappers();
StyleSheetInternal* internal() const { return m_internal.get(); }
@@ -237,6 +261,26 @@ private:
mutable OwnPtr<CSSRuleList> m_ruleListCSSOMWrapper;
};
+inline CSSStyleSheet::RuleMutationScope::RuleMutationScope(CSSStyleSheet* sheet)
+ : m_styleSheet(sheet)
+{
+ if (m_styleSheet)
+ m_styleSheet->willMutateRules();
+}
+
+inline CSSStyleSheet::RuleMutationScope::RuleMutationScope(CSSRule* rule)
+ : m_styleSheet(rule ? rule->parentStyleSheet() : 0)
+{
+ if (m_styleSheet)
+ m_styleSheet->willMutateRules();
+}
+
+inline CSSStyleSheet::RuleMutationScope::~RuleMutationScope()
+{
+ if (m_styleSheet)
+ m_styleSheet->didMutateRules();
+}
+
} // namespace
#endif
diff --git a/Source/WebCore/css/MediaList.cpp b/Source/WebCore/css/MediaList.cpp
index 57c6eaa1a..5fc793e31 100644
--- a/Source/WebCore/css/MediaList.cpp
+++ b/Source/WebCore/css/MediaList.cpp
@@ -230,12 +230,15 @@ MediaList::~MediaList()
void MediaList::setMediaText(const String& value, ExceptionCode& ec)
{
+ CSSStyleSheet::RuleMutationScope mutationScope(m_parentRule);
+
bool success = m_mediaQueries->parse(value);
if (!success) {
ec = SYNTAX_ERR;
return;
}
- notifyChanged();
+ if (m_parentStyleSheet)
+ m_parentStyleSheet->didMutate();
}
String MediaList::item(unsigned index) const
@@ -248,31 +251,35 @@ String MediaList::item(unsigned index) const
void MediaList::deleteMedium(const String& medium, ExceptionCode& ec)
{
+ CSSStyleSheet::RuleMutationScope mutationScope(m_parentRule);
+
bool success = m_mediaQueries->remove(medium);
if (!success) {
ec = NOT_FOUND_ERR;
return;
}
- notifyChanged();
+ if (m_parentStyleSheet)
+ m_parentStyleSheet->didMutate();
}
void MediaList::appendMedium(const String& medium, ExceptionCode& ec)
{
+ CSSStyleSheet::RuleMutationScope mutationScope(m_parentRule);
+
bool success = m_mediaQueries->add(medium);
if (!success) {
// FIXME: Should this really be INVALID_CHARACTER_ERR?
ec = INVALID_CHARACTER_ERR;
return;
}
- notifyChanged();
+ if (m_parentStyleSheet)
+ m_parentStyleSheet->didMutate();
}
-void MediaList::notifyChanged()
+void MediaList::reattach(MediaQuerySet* mediaQueries)
{
- CSSStyleSheet* parentStyleSheet = m_parentRule ? m_parentRule->parentStyleSheet() : m_parentStyleSheet;
- if (!parentStyleSheet)
- return;
- parentStyleSheet->styleSheetChanged();
+ ASSERT(mediaQueries);
+ m_mediaQueries = mediaQueries;
}
}
diff --git a/Source/WebCore/css/MediaList.h b/Source/WebCore/css/MediaList.h
index 88bdca242..32d0ec37d 100644
--- a/Source/WebCore/css/MediaList.h
+++ b/Source/WebCore/css/MediaList.h
@@ -104,13 +104,13 @@ public:
void clearParentRule() { ASSERT(m_parentRule); m_parentRule = 0; }
const MediaQuerySet* queries() const { return m_mediaQueries.get(); }
+ void reattach(MediaQuerySet*);
+
private:
MediaList();
MediaList(MediaQuerySet*, CSSStyleSheet* parentSheet);
MediaList(MediaQuerySet*, CSSRule* parentRule);
- void notifyChanged();
-
RefPtr<MediaQuerySet> m_mediaQueries;
CSSStyleSheet* m_parentStyleSheet;
CSSRule* m_parentRule;
diff --git a/Source/WebCore/css/PropertySetCSSStyleDeclaration.cpp b/Source/WebCore/css/PropertySetCSSStyleDeclaration.cpp
index b3e6f1d93..33f21a10a 100644
--- a/Source/WebCore/css/PropertySetCSSStyleDeclaration.cpp
+++ b/Source/WebCore/css/PropertySetCSSStyleDeclaration.cpp
@@ -152,11 +152,14 @@ void PropertySetCSSStyleDeclaration::setCssText(const String& text, ExceptionCod
#if ENABLE(MUTATION_OBSERVERS)
StyleAttributeMutationScope mutationScope(this);
#endif
+ willMutate();
+
ec = 0;
// FIXME: Detect syntax errors and set ec.
m_propertySet->parseDeclaration(text, contextStyleSheet());
- didMutate();
+ didMutate(PropertyChanged);
+
#if ENABLE(MUTATION_OBSERVERS)
mutationScope.enqueueMutationRecord();
#endif
@@ -213,13 +216,19 @@ void PropertySetCSSStyleDeclaration::setProperty(const String& propertyName, con
CSSPropertyID propertyID = cssPropertyID(propertyName);
if (!propertyID)
return;
+
bool important = priority.find("important", 0, false) != notFound;
+
+ willMutate();
+
ec = 0;
bool changed = m_propertySet->setProperty(propertyID, value, important, contextStyleSheet());
+
+ didMutate(changed ? PropertyChanged : NoChanges);
+
if (changed) {
// CSS DOM requires raising SYNTAX_ERR of parsing failed, but this is too dangerous for compatibility,
// see <http://bugs.webkit.org/show_bug.cgi?id=7296>.
- didMutate();
#if ENABLE(MUTATION_OBSERVERS)
mutationScope.enqueueMutationRecord();
#endif
@@ -234,11 +243,16 @@ String PropertySetCSSStyleDeclaration::removeProperty(const String& propertyName
CSSPropertyID propertyID = cssPropertyID(propertyName);
if (!propertyID)
return String();
+
+ willMutate();
+
ec = 0;
String result;
- bool changes = m_propertySet->removeProperty(propertyID, &result);
- if (changes) {
- didMutate();
+ bool changed = m_propertySet->removeProperty(propertyID, &result);
+
+ didMutate(changed ? PropertyChanged : NoChanges);
+
+ if (changed) {
#if ENABLE(MUTATION_OBSERVERS)
mutationScope.enqueueMutationRecord();
#endif
@@ -261,22 +275,20 @@ void PropertySetCSSStyleDeclaration::setPropertyInternal(CSSPropertyID propertyI
#if ENABLE(MUTATION_OBSERVERS)
StyleAttributeMutationScope mutationScope(this);
#endif
+ willMutate();
+
ec = 0;
bool changed = m_propertySet->setProperty(propertyID, value, important, contextStyleSheet());
+
+ didMutate(changed ? PropertyChanged : NoChanges);
+
if (changed) {
- didMutate();
#if ENABLE(MUTATION_OBSERVERS)
mutationScope.enqueueMutationRecord();
#endif
}
}
-void PropertySetCSSStyleDeclaration::didMutate()
-{
- m_cssomCSSValueClones.clear();
- setNeedsStyleRecalc();
-}
-
CSSValue* PropertySetCSSStyleDeclaration::cloneAndCacheForCSSOM(CSSValue* internalValue)
{
if (!internalValue)
@@ -339,12 +351,20 @@ void StyleRuleCSSStyleDeclaration::deref()
delete this;
}
-void StyleRuleCSSStyleDeclaration::setNeedsStyleRecalc()
+void StyleRuleCSSStyleDeclaration::willMutate()
{
- if (CSSStyleSheet* styleSheet = parentStyleSheet()) {
- if (Document* document = styleSheet->ownerDocument())
- document->styleResolverChanged(DeferRecalcStyle);
- }
+ if (m_parentRule && m_parentRule->parentStyleSheet())
+ m_parentRule->parentStyleSheet()->willMutateRules();
+}
+
+void StyleRuleCSSStyleDeclaration::didMutate(MutationType type)
+{
+ if (type == PropertyChanged)
+ m_cssomCSSValueClones.clear();
+
+ // Style sheet mutation needs to be signaled even if the change failed. willMutateRules/didMutateRules must pair.
+ if (m_parentRule && m_parentRule->parentStyleSheet())
+ m_parentRule->parentStyleSheet()->didMutateRules();
}
CSSStyleSheet* StyleRuleCSSStyleDeclaration::parentStyleSheet() const
@@ -352,14 +372,26 @@ CSSStyleSheet* StyleRuleCSSStyleDeclaration::parentStyleSheet() const
return m_parentRule ? m_parentRule->parentStyleSheet() : 0;
}
-void InlineCSSStyleDeclaration::setNeedsStyleRecalc()
+void StyleRuleCSSStyleDeclaration::reattach(StylePropertySet* propertySet)
+{
+ ASSERT(propertySet);
+ m_propertySet->deref();
+ m_propertySet = propertySet;
+ m_propertySet->ref();
+}
+
+void InlineCSSStyleDeclaration::didMutate(MutationType type)
{
+ if (type == NoChanges)
+ return;
+
+ m_cssomCSSValueClones.clear();
+
if (!m_parentElement)
return;
m_parentElement->setNeedsStyleRecalc(InlineStyleChange);
m_parentElement->invalidateStyleAttribute();
StyleAttributeMutationScope(this).didInvalidateStyleAttr();
- return;
}
CSSStyleSheet* InlineCSSStyleDeclaration::parentStyleSheet() const
diff --git a/Source/WebCore/css/PropertySetCSSStyleDeclaration.h b/Source/WebCore/css/PropertySetCSSStyleDeclaration.h
index 2b8f41295..bf9694c2d 100644
--- a/Source/WebCore/css/PropertySetCSSStyleDeclaration.h
+++ b/Source/WebCore/css/PropertySetCSSStyleDeclaration.h
@@ -68,12 +68,14 @@ private:
virtual bool cssPropertyMatches(const CSSProperty*) const OVERRIDE;
virtual PassRefPtr<StylePropertySet> copy() const OVERRIDE;
virtual PassRefPtr<StylePropertySet> makeMutable() OVERRIDE;
- virtual void setNeedsStyleRecalc() { }
-
- void didMutate();
+
CSSValue* cloneAndCacheForCSSOM(CSSValue*);
protected:
+ enum MutationType { NoChanges, PropertyChanged };
+ virtual void willMutate() { }
+ virtual void didMutate(MutationType) { }
+
StylePropertySet* m_propertySet;
OwnPtr<HashMap<CSSValue*, RefPtr<CSSValue> > > m_cssomCSSValueClones;
};
@@ -91,6 +93,8 @@ public:
virtual void ref() OVERRIDE;
virtual void deref() OVERRIDE;
+ void reattach(StylePropertySet*);
+
private:
StyleRuleCSSStyleDeclaration(StylePropertySet*, CSSRule*);
virtual ~StyleRuleCSSStyleDeclaration();
@@ -98,8 +102,10 @@ private:
virtual CSSStyleSheet* parentStyleSheet() const OVERRIDE;
virtual CSSRule* parentRule() const OVERRIDE { return m_parentRule; }
- virtual void setNeedsStyleRecalc() OVERRIDE;
-
+
+ virtual void willMutate() OVERRIDE;
+ virtual void didMutate(MutationType) OVERRIDE;
+
unsigned m_refCount;
CSSRule* m_parentRule;
};
@@ -117,7 +123,8 @@ private:
virtual CSSStyleSheet* parentStyleSheet() const OVERRIDE;
virtual StyledElement* parentElement() const OVERRIDE { return m_parentElement; }
virtual void clearParentElement() OVERRIDE { m_parentElement = 0; }
- virtual void setNeedsStyleRecalc() OVERRIDE;
+
+ virtual void didMutate(MutationType) OVERRIDE;
StyledElement* m_parentElement;
};
diff --git a/Source/WebCore/css/StyleBuilder.cpp b/Source/WebCore/css/StyleBuilder.cpp
index 6a5e1632a..7f6884cf9 100644
--- a/Source/WebCore/css/StyleBuilder.cpp
+++ b/Source/WebCore/css/StyleBuilder.cpp
@@ -1879,6 +1879,7 @@ StyleBuilder::StyleBuilder()
setPropertyHandler(CSSPropertySize, ApplyPropertyPageSize::createHandler());
setPropertyHandler(CSSPropertySpeak, ApplyPropertyDefault<ESpeak, &RenderStyle::speak, ESpeak, &RenderStyle::setSpeak, ESpeak, &RenderStyle::initialSpeak>::createHandler());
setPropertyHandler(CSSPropertyTableLayout, ApplyPropertyDefault<ETableLayout, &RenderStyle::tableLayout, ETableLayout, &RenderStyle::setTableLayout, ETableLayout, &RenderStyle::initialTableLayout>::createHandler());
+ setPropertyHandler(CSSPropertyTabSize, ApplyPropertyDefault<unsigned, &RenderStyle::tabSize, unsigned, &RenderStyle::setTabSize, unsigned, &RenderStyle::initialTabSize>::createHandler());
setPropertyHandler(CSSPropertyTextAlign, ApplyPropertyTextAlign::createHandler());
setPropertyHandler(CSSPropertyTextDecoration, ApplyPropertyTextDecoration::createHandler());
setPropertyHandler(CSSPropertyTextIndent, ApplyPropertyLength<&RenderStyle::textIndent, &RenderStyle::setTextIndent, &RenderStyle::initialTextIndent>::createHandler());
diff --git a/Source/WebCore/css/StylePropertySet.cpp b/Source/WebCore/css/StylePropertySet.cpp
index a5c8806ba..caeda8896 100644
--- a/Source/WebCore/css/StylePropertySet.cpp
+++ b/Source/WebCore/css/StylePropertySet.cpp
@@ -23,6 +23,7 @@
#include "StylePropertySet.h"
#include "CSSParser.h"
+#include "CSSStyleSheet.h"
#include "CSSValueKeywords.h"
#include "CSSValueList.h"
#include "CSSValuePool.h"
@@ -308,6 +309,7 @@ String StylePropertySet::getLayeredShorthandValue(const StylePropertyShorthand&
bool useRepeatXShorthand = false;
bool useRepeatYShorthand = false;
bool useSingleWordShorthand = false;
+ bool foundBackgroundPositionYCSSProperty = false;
for (unsigned j = 0; j < size; j++) {
RefPtr<CSSValue> value;
if (values[j]) {
@@ -359,6 +361,11 @@ String StylePropertySet::getLayeredShorthandValue(const StylePropertyShorthand&
if (value && !value->isImplicitInitialValue()) {
if (!layerRes.isNull())
layerRes += " ";
+ if (foundBackgroundPositionYCSSProperty && shorthand.properties()[j] == CSSPropertyBackgroundSize)
+ layerRes += "/ ";
+ if (!foundBackgroundPositionYCSSProperty && shorthand.properties()[j] == CSSPropertyBackgroundSize)
+ continue;
+
if (useRepeatXShorthand) {
useRepeatXShorthand = false;
layerRes += getValueName(CSSValueRepeatX);
@@ -370,6 +377,9 @@ String StylePropertySet::getLayeredShorthandValue(const StylePropertyShorthand&
layerRes += value->cssText();
} else
layerRes += value->cssText();
+
+ if (shorthand.properties()[j] == CSSPropertyBackgroundPositionY)
+ foundBackgroundPositionYCSSProperty = true;
}
}
diff --git a/Source/WebCore/css/StylePropertyShorthand.cpp b/Source/WebCore/css/StylePropertyShorthand.cpp
index 1aae48d95..6bd0780d4 100644
--- a/Source/WebCore/css/StylePropertyShorthand.cpp
+++ b/Source/WebCore/css/StylePropertyShorthand.cpp
@@ -25,7 +25,6 @@
namespace WebCore {
-// FIXME: Add CSSPropertyBackgroundSize to the shorthand.
const StylePropertyShorthand& backgroundShorthand()
{
static const CSSPropertyID backgroundProperties[] = {
@@ -34,10 +33,11 @@ const StylePropertyShorthand& backgroundShorthand()
CSSPropertyBackgroundRepeatX,
CSSPropertyBackgroundRepeatY,
CSSPropertyBackgroundAttachment,
+ CSSPropertyBackgroundClip,
+ CSSPropertyBackgroundOrigin,
CSSPropertyBackgroundPositionX,
CSSPropertyBackgroundPositionY,
- CSSPropertyBackgroundClip,
- CSSPropertyBackgroundOrigin
+ CSSPropertyBackgroundSize
};
DEFINE_STATIC_LOCAL(StylePropertyShorthand, backgroundShorthand, (backgroundProperties, WTF_ARRAY_LENGTH(backgroundProperties)));
return backgroundShorthand;
diff --git a/Source/WebCore/css/StyleResolver.cpp b/Source/WebCore/css/StyleResolver.cpp
index 2d9933481..24a180f10 100644
--- a/Source/WebCore/css/StyleResolver.cpp
+++ b/Source/WebCore/css/StyleResolver.cpp
@@ -61,7 +61,7 @@
#include "FrameSelection.h"
#include "FrameView.h"
#include "HTMLDocument.h"
-#include "HTMLElement.h"
+#include "HTMLIFrameElement.h"
#include "HTMLInputElement.h"
#include "HTMLNames.h"
#include "HTMLOptionElement.h"
@@ -418,9 +418,25 @@ StyleResolver::StyleResolver(Document* document, bool matchAuthorAndUserStyles)
}
#endif
+ addStylesheetsFromSeamlessParents();
appendAuthorStylesheets(0, document->styleSheets()->vector());
}
+void StyleResolver::addStylesheetsFromSeamlessParents()
+{
+ // Build a list of stylesheet lists from our ancestors, and walk that
+ // list in reverse order so that the root-most sheets are appended first.
+ Document* childDocument = document();
+ Vector<StyleSheetList*> ancestorSheets;
+ while (HTMLIFrameElement* parentIFrame = childDocument->seamlessParentIFrame()) {
+ Document* parentDocument = parentIFrame->document();
+ ancestorSheets.append(parentDocument->styleSheets());
+ childDocument = parentDocument;
+ }
+ for (int i = ancestorSheets.size() - 1; i >= 0; i--)
+ appendAuthorStylesheets(0, ancestorSheets.at(i)->vector());
+}
+
void StyleResolver::addAuthorRulesAndCollectUserRulesFromSheets(const Vector<RefPtr<CSSStyleSheet> >* userSheets, RuleSet& userStyle)
{
if (!userSheets)
@@ -467,14 +483,14 @@ void StyleResolver::collectFeatures()
}
#if ENABLE(STYLE_SCOPED)
-const ContainerNode* StyleResolver::determineScope(const StyleSheetInternal* sheet)
+const ContainerNode* StyleResolver::determineScope(const CSSStyleSheet* sheet)
{
ASSERT(sheet);
if (!RuntimeEnabledFeatures::styleScopedEnabled())
return 0;
- Node* ownerNode = sheet->singleOwnerNode();
+ Node* ownerNode = sheet->ownerNode();
if (!ownerNode || !ownerNode->isHTMLElement() || !ownerNode->hasTagName(HTMLNames::styleTag))
return 0;
@@ -513,7 +529,7 @@ void StyleResolver::appendAuthorStylesheets(unsigned firstNew, const Vector<RefP
continue;
StyleSheetInternal* sheet = cssSheet->internal();
#if ENABLE(STYLE_SCOPED)
- const ContainerNode* scope = determineScope(sheet);
+ const ContainerNode* scope = determineScope(cssSheet);
if (scope) {
ScopedRuleSetMap::AddResult addResult = m_scopedAuthorStyles.add(scope, nullptr);
if (addResult.isNewEntry)
@@ -1022,7 +1038,7 @@ void StyleResolver::collectMatchingRulesForList(const Vector<RuleData>* rules, i
// d) the rule contains shadow-ID pseudo elements
TreeScope* treeScope = m_element->treeScope();
if (!MatchingUARulesScope::isMatchingUARules()
- && !treeScope->applyAuthorSheets()
+ && !treeScope->applyAuthorStyles()
#if ENABLE(STYLE_SCOPED)
&& (!options.scope || options.scope->treeScope() != treeScope)
#endif
@@ -1511,13 +1527,28 @@ PassRefPtr<RenderStyle> StyleResolver::styleForDocument(Document* document, CSSF
{
Frame* frame = document->frame();
+ // HTML5 states that seamless iframes should replace default CSS values
+ // with values inherited from the containing iframe element. However,
+ // some values (such as the case of designMode = "on") still need to
+ // be set by this "document style".
RefPtr<RenderStyle> documentStyle = RenderStyle::create();
+ bool seamlessWithParent = document->shouldDisplaySeamlesslyWithParent();
+ if (seamlessWithParent) {
+ RenderStyle* iframeStyle = document->seamlessParentIFrame()->renderStyle();
+ if (iframeStyle)
+ documentStyle->inheritFrom(iframeStyle);
+ }
+
+ // FIXME: It's not clear which values below we want to override in the seamless case!
documentStyle->setDisplay(BLOCK);
- documentStyle->setRTLOrdering(document->visuallyOrdered() ? VisualOrder : LogicalOrder);
- documentStyle->setZoom(frame && !document->printing() ? frame->pageZoomFactor() : 1);
- documentStyle->setPageScaleTransform(frame ? frame->frameScaleFactor() : 1);
+ if (!seamlessWithParent) {
+ documentStyle->setRTLOrdering(document->visuallyOrdered() ? VisualOrder : LogicalOrder);
+ documentStyle->setZoom(frame && !document->printing() ? frame->pageZoomFactor() : 1);
+ documentStyle->setPageScaleTransform(frame ? frame->frameScaleFactor() : 1);
+ documentStyle->setLocale(document->contentLanguage());
+ }
+ // FIXME: This overrides any -webkit-user-modify inherited from the parent iframe.
documentStyle->setUserModify(document->inDesignMode() ? READ_WRITE : READ_ONLY);
- documentStyle->setLocale(document->contentLanguage());
Element* docElement = document->documentElement();
RenderObject* docElementRenderer = docElement ? docElement->renderer() : 0;
@@ -1546,6 +1577,10 @@ PassRefPtr<RenderStyle> StyleResolver::styleForDocument(Document* document, CSSF
}
}
+ // Seamless iframes want to inherit their font from their parent iframe, so early return before setting the font.
+ if (seamlessWithParent)
+ return documentStyle.release();
+
FontDescription fontDescription;
fontDescription.setUsePrinterFont(document->printing());
fontDescription.setScript(localeToScriptCodeForFontSelection(documentStyle->locale()));
diff --git a/Source/WebCore/css/StyleResolver.h b/Source/WebCore/css/StyleResolver.h
index 3916a7323..2a261448d 100644
--- a/Source/WebCore/css/StyleResolver.h
+++ b/Source/WebCore/css/StyleResolver.h
@@ -401,6 +401,7 @@ public:
private:
static RenderStyle* s_styleNotYetAvailable;
+ void addStylesheetsFromSeamlessParents();
void addAuthorRulesAndCollectUserRulesFromSheets(const Vector<RefPtr<CSSStyleSheet> >*, RuleSet& userStyle);
void cacheBorderAndBackground();
@@ -505,7 +506,7 @@ private:
#endif
#if ENABLE(STYLE_SCOPED)
- static const ContainerNode* determineScope(const StyleSheetInternal*);
+ static const ContainerNode* determineScope(const CSSStyleSheet*);
typedef HashMap<const ContainerNode*, OwnPtr<RuleSet> > ScopedRuleSetMap;
diff --git a/Source/WebCore/css/WebKitCSSKeyframesRule.cpp b/Source/WebCore/css/WebKitCSSKeyframesRule.cpp
index cbf97d5fa..dcd79034f 100644
--- a/Source/WebCore/css/WebKitCSSKeyframesRule.cpp
+++ b/Source/WebCore/css/WebKitCSSKeyframesRule.cpp
@@ -28,6 +28,7 @@
#include "CSSParser.h"
#include "CSSRuleList.h"
+#include "CSSStyleSheet.h"
#include "StylePropertySet.h"
#include "StyleSheet.h"
#include "WebKitCSSKeyframeRule.h"
@@ -104,12 +105,9 @@ WebKitCSSKeyframesRule::~WebKitCSSKeyframesRule()
void WebKitCSSKeyframesRule::setName(const String& name)
{
- m_keyframesRule->setName(name);
+ CSSStyleSheet::RuleMutationScope mutationScope(this);
- // Since the name is used in the keyframe map list in StyleResolver, we need
- // to recompute the style sheet to get the updated name.
- if (CSSStyleSheet* styleSheet = parentStyleSheet())
- styleSheet->styleSheetChanged();
+ m_keyframesRule->setName(name);
}
void WebKitCSSKeyframesRule::insertRule(const String& ruleText)
@@ -122,6 +120,8 @@ void WebKitCSSKeyframesRule::insertRule(const String& ruleText)
if (!keyframe)
return;
+ CSSStyleSheet::RuleMutationScope mutationScope(this);
+
m_keyframesRule->wrapperAppendKeyframe(keyframe);
m_childRuleCSSOMWrappers.grow(length());
@@ -135,6 +135,8 @@ void WebKitCSSKeyframesRule::deleteRule(const String& s)
if (i < 0)
return;
+ CSSStyleSheet::RuleMutationScope mutationScope(this);
+
m_keyframesRule->wrapperRemoveKeyframe(i);
if (m_childRuleCSSOMWrappers[i])
@@ -190,4 +192,10 @@ CSSRuleList* WebKitCSSKeyframesRule::cssRules()
return m_ruleListCSSOMWrapper.get();
}
+void WebKitCSSKeyframesRule::reattach(StyleRuleKeyframes* rule)
+{
+ ASSERT(rule);
+ m_keyframesRule = rule;
+}
+
} // namespace WebCore
diff --git a/Source/WebCore/css/WebKitCSSKeyframesRule.h b/Source/WebCore/css/WebKitCSSKeyframesRule.h
index 81abf879a..2f9365c80 100644
--- a/Source/WebCore/css/WebKitCSSKeyframesRule.h
+++ b/Source/WebCore/css/WebKitCSSKeyframesRule.h
@@ -87,6 +87,8 @@ public:
unsigned length() const;
WebKitCSSKeyframeRule* item(unsigned index) const;
+ void reattach(StyleRuleKeyframes*);
+
private:
WebKitCSSKeyframesRule(StyleRuleKeyframes*, CSSStyleSheet* parent);
diff --git a/Source/WebCore/css/WebKitCSSRegionRule.cpp b/Source/WebCore/css/WebKitCSSRegionRule.cpp
index df1c9b079..677a9f81c 100644
--- a/Source/WebCore/css/WebKitCSSRegionRule.cpp
+++ b/Source/WebCore/css/WebKitCSSRegionRule.cpp
@@ -96,5 +96,14 @@ CSSRuleList* WebKitCSSRegionRule::cssRules() const
return m_ruleListCSSOMWrapper.get();
}
+void WebKitCSSRegionRule::reattach(StyleRuleRegion* rule)
+{
+ ASSERT(rule);
+ m_regionRule = rule;
+ for (unsigned i = 0; i < m_childRuleCSSOMWrappers.size(); ++i) {
+ if (m_childRuleCSSOMWrappers[i])
+ m_childRuleCSSOMWrappers[i]->reattach(m_regionRule->childRules()[i].get());
+ }
+}
} // namespace WebCore
diff --git a/Source/WebCore/css/WebKitCSSRegionRule.h b/Source/WebCore/css/WebKitCSSRegionRule.h
index ff5762384..1987ef2ca 100644
--- a/Source/WebCore/css/WebKitCSSRegionRule.h
+++ b/Source/WebCore/css/WebKitCSSRegionRule.h
@@ -53,6 +53,8 @@ public:
unsigned length() const;
CSSRule* item(unsigned index) const;
+ void reattach(StyleRuleRegion*);
+
private:
WebKitCSSRegionRule(StyleRuleRegion*, CSSStyleSheet* parent);
diff --git a/Source/WebCore/css/WebKitCSSShaderValue.cpp b/Source/WebCore/css/WebKitCSSShaderValue.cpp
index 698f170bc..8651758ed 100644
--- a/Source/WebCore/css/WebKitCSSShaderValue.cpp
+++ b/Source/WebCore/css/WebKitCSSShaderValue.cpp
@@ -59,8 +59,8 @@ StyleCachedShader* WebKitCSSShaderValue::cachedShader(CachedResourceLoader* load
m_accessedShader = true;
ResourceRequest request(loader->document()->completeURL(m_url));
- if (CachedShader* cachedShader = loader->requestShader(request))
- m_shader = StyleCachedShader::create(cachedShader);
+ if (CachedResourceHandle<CachedShader> cachedShader = loader->requestShader(request))
+ m_shader = StyleCachedShader::create(cachedShader.get());
}
return (m_shader && m_shader->isCachedShader()) ? static_cast<StyleCachedShader*>(m_shader.get()) : 0;
diff --git a/Source/WebCore/css/mediaControlsEfl.css b/Source/WebCore/css/mediaControlsEfl.css
index 3a5a95441..55f58d994 100644
--- a/Source/WebCore/css/mediaControlsEfl.css
+++ b/Source/WebCore/css/mediaControlsEfl.css
@@ -35,7 +35,7 @@ audio::-webkit-media-controls-panel, video::-webkit-media-controls-panel {
-webkit-box-orient: horizontal;
-webkit-box-align: center;
-webkit-user-select: none;
- position: absolute;
+ position: relative;
bottom: 0;
width: 100%;
z-index: 0;
diff --git a/Source/WebCore/dom/CharacterData.cpp b/Source/WebCore/dom/CharacterData.cpp
index f8e034dd6..e8f00e4d5 100644
--- a/Source/WebCore/dom/CharacterData.cpp
+++ b/Source/WebCore/dom/CharacterData.cpp
@@ -200,7 +200,7 @@ void CharacterData::dispatchModifiedEvent(const String& oldData)
if (parentNode())
parentNode()->childrenChanged();
if (document()->hasListenerType(Document::DOMCHARACTERDATAMODIFIED_LISTENER))
- dispatchEvent(MutationEvent::create(eventNames().DOMCharacterDataModifiedEvent, true, 0, oldData, m_data));
+ dispatchScopedEvent(MutationEvent::create(eventNames().DOMCharacterDataModifiedEvent, true, 0, oldData, m_data));
dispatchSubtreeModifiedEvent();
#if ENABLE(INSPECTOR)
InspectorInstrumentation::characterDataModified(document(), this);
diff --git a/Source/WebCore/dom/ComposedShadowTreeWalker.cpp b/Source/WebCore/dom/ComposedShadowTreeWalker.cpp
index 5a6936c8c..d1a889e67 100644
--- a/Source/WebCore/dom/ComposedShadowTreeWalker.cpp
+++ b/Source/WebCore/dom/ComposedShadowTreeWalker.cpp
@@ -35,11 +35,6 @@
namespace WebCore {
-static inline bool isShadowHost(const Node* node)
-{
- return node && node->isElementNode() && toElement(node)->hasShadowRoot();
-}
-
static inline ElementShadow* shadowFor(const Node* node)
{
if (node && node->isElementNode())
@@ -99,7 +94,7 @@ Node* ComposedShadowTreeWalker::traverseChild(const Node* node, TraversalDirecti
ASSERT(node);
if (canCrossUpperBoundary()) {
ElementShadow* shadow = shadowFor(node);
- return (shadow && shadow->hasShadowRoot()) ? traverseLightChildren(shadow->youngestShadowRoot(), direction)
+ return shadow ? traverseLightChildren(shadow->youngestShadowRoot(), direction)
: traverseLightChildren(node, direction);
}
if (isShadowHost(node))
diff --git a/Source/WebCore/dom/ContainerNode.cpp b/Source/WebCore/dom/ContainerNode.cpp
index 20d6f2758..3c0e66c2c 100644
--- a/Source/WebCore/dom/ContainerNode.cpp
+++ b/Source/WebCore/dom/ContainerNode.cpp
@@ -307,21 +307,6 @@ bool ContainerNode::replaceChild(PassRefPtr<Node> newChild, Node* oldChild, Exce
return true;
}
-void ContainerNode::willRemove()
-{
- RefPtr<Node> protect(this);
-
- NodeVector children;
- getChildNodes(this, children);
- for (size_t i = 0; i < children.size(); ++i) {
- if (children[i]->parentNode() != this) // Check for child being removed from subtree while removing.
- continue;
- children[i]->willRemove();
- }
-
- Node::willRemove();
-}
-
static void willRemoveChild(Node* child)
{
#if ENABLE(MUTATION_OBSERVERS)
@@ -332,7 +317,7 @@ static void willRemoveChild(Node* child)
dispatchChildRemovalEvents(child);
child->document()->nodeWillBeRemoved(child); // e.g. mutation event listener can create a new range.
- child->willRemove();
+ ChildFrameDisconnector(child).disconnect();
}
static void willRemoveChildren(ContainerNode* container)
@@ -356,10 +341,15 @@ static void willRemoveChildren(ContainerNode* container)
// fire removed from document mutation events.
dispatchChildRemovalEvents(child);
- child->willRemove();
+ ChildFrameDisconnector(child).disconnect();
}
}
+void ContainerNode::disconnectDescendantFrames()
+{
+ ChildFrameDisconnector(this).disconnect();
+}
+
bool ContainerNode::removeChild(Node* oldChild, ExceptionCode& ec)
{
// Check that this node is not "floating".
diff --git a/Source/WebCore/dom/ContainerNode.h b/Source/WebCore/dom/ContainerNode.h
index 98fa705ba..233e034f2 100644
--- a/Source/WebCore/dom/ContainerNode.h
+++ b/Source/WebCore/dom/ContainerNode.h
@@ -72,7 +72,6 @@ public:
virtual void attach() OVERRIDE;
virtual void detach() OVERRIDE;
- virtual void willRemove() OVERRIDE;
virtual LayoutRect getRect() const OVERRIDE;
virtual void setFocus(bool = true) OVERRIDE;
virtual void setActive(bool active = true, bool pause = false) OVERRIDE;
@@ -94,6 +93,8 @@ public:
void detachChildren();
void detachChildrenIfNeeded();
+ void disconnectDescendantFrames();
+
protected:
ContainerNode(Document*, ConstructionType = CreateContainer);
diff --git a/Source/WebCore/dom/ContainerNodeAlgorithms.cpp b/Source/WebCore/dom/ContainerNodeAlgorithms.cpp
index 8c4ce5ead..5063266fe 100644
--- a/Source/WebCore/dom/ContainerNodeAlgorithms.cpp
+++ b/Source/WebCore/dom/ContainerNodeAlgorithms.cpp
@@ -28,6 +28,7 @@
#include "Element.h"
#include "ElementShadow.h"
+#include "HTMLFrameOwnerElement.h"
namespace WebCore {
@@ -111,4 +112,16 @@ void ChildNodeRemovalNotifier::notifyDescendantRemovedFromTree(ContainerNode* no
}
}
+void ChildFrameDisconnector::collectDescendant(ElementShadow* shadow)
+{
+ for (ShadowRoot* root = shadow->youngestShadowRoot(); root; root = root->olderShadowRoot())
+ collectDescendant(root);
+}
+
+void ChildFrameDisconnector::Target::disconnect()
+{
+ ASSERT(isValid());
+ toFrameOwnerElement(m_owner.get())->disconnectContentFrame();
+}
+
}
diff --git a/Source/WebCore/dom/ContainerNodeAlgorithms.h b/Source/WebCore/dom/ContainerNodeAlgorithms.h
index 5c11e8cc7..fccb5eeb1 100644
--- a/Source/WebCore/dom/ContainerNodeAlgorithms.h
+++ b/Source/WebCore/dom/ContainerNodeAlgorithms.h
@@ -265,6 +265,61 @@ inline void ChildNodeRemovalNotifier::notify(Node* node)
notifyNodeRemovedFromTree(toContainerNode(node));
}
+class ChildFrameDisconnector {
+public:
+ explicit ChildFrameDisconnector(Node* root);
+ void disconnect();
+
+private:
+ void collectDescendant(Node* root);
+ void collectDescendant(ElementShadow*);
+
+ class Target {
+ public:
+ Target(Node* element)
+ : m_owner(element)
+ , m_ownerParent(element->parentNode())
+ { }
+
+ bool isValid() const { return m_owner->parentNode() == m_ownerParent; }
+ void disconnect();
+
+ private:
+ RefPtr<Node> m_owner;
+ Node* m_ownerParent;
+ };
+
+ Vector<Target, 10> m_list;
+};
+
+inline ChildFrameDisconnector::ChildFrameDisconnector(Node* root)
+{
+ collectDescendant(root);
+}
+
+inline void ChildFrameDisconnector::collectDescendant(Node* root)
+{
+ for (Node* node = root; node; node = node->traverseNextNode(root)) {
+ if (!node->isElementNode())
+ continue;
+ Element* element = toElement(node);
+ if (element->isFrameOwnerElement())
+ m_list.append(node);
+ if (ElementShadow* shadow = element->shadow())
+ collectDescendant(shadow);
+ }
+}
+
+inline void ChildFrameDisconnector::disconnect()
+{
+ unsigned size = m_list.size();
+ for (unsigned i = 0; i < size; ++i) {
+ Target& target = m_list[i];
+ if (target.isValid())
+ target.disconnect();
+ };
+}
+
} // namespace WebCore
#endif // ContainerNodeAlgorithms_h
diff --git a/Source/WebCore/dom/Document.cpp b/Source/WebCore/dom/Document.cpp
index 014c2536a..30d367f93 100644
--- a/Source/WebCore/dom/Document.cpp
+++ b/Source/WebCore/dom/Document.cpp
@@ -712,8 +712,8 @@ void Document::buildAccessKeyMap(TreeScope* scope)
if (!accessKey.isEmpty())
m_elementsByAccessKey.set(accessKey.impl(), element);
- if (element->hasShadowRoot()) {
- for (ShadowRoot* root = element->shadow()->youngestShadowRoot(); root; root = root->olderShadowRoot())
+ if (ElementShadow* shadow = element->shadow()) {
+ for (ShadowRoot* root = shadow->youngestShadowRoot(); root; root = root->olderShadowRoot())
buildAccessKeyMap(root);
}
}
@@ -771,8 +771,14 @@ void Document::setDocType(PassRefPtr<DocumentType> docType)
// This should never be called more than once.
ASSERT(!m_docType || !docType);
m_docType = docType;
- if (m_docType)
+ if (m_docType) {
this->adoptIfNeeded(m_docType.get());
+#if USE(LEGACY_VIEWPORT_ADAPTION)
+ ASSERT(m_viewportArguments.type == ViewportArguments::Implicit);
+ if (m_docType->publicId().startsWith("-//wapforum//dtd xhtml mobile 1.", /* caseSensitive */ false))
+ processViewport("width=device-width, height=device-height, initial-scale=1");
+#endif
+ }
// Doctype affects the interpretation of the stylesheets.
clearStyleResolver();
}
@@ -1645,6 +1651,9 @@ void Document::scheduleForcedStyleRecalc()
void Document::scheduleStyleRecalc()
{
+ // FIXME: In the seamless case, we should likely schedule a style recalc
+ // on our parent and instead return early here.
+
if (m_styleRecalcTimer.isActive() || inPageCache())
return;
@@ -1698,7 +1707,10 @@ void Document::recalcStyle(StyleChange change)
if (m_inStyleRecalc)
return; // Guard against re-entrancy. -dwh
-
+
+ // FIXME: In the seamless case, we may wish to exit early in the child after recalcing our parent chain.
+ // I have not yet found a test which requires such.
+
if (m_hasDirtyStyleResolver)
updateActiveStylesheets(RecalcStyleImmediately);
@@ -1724,7 +1736,8 @@ void Document::recalcStyle(StyleChange change)
if (m_pendingStyleRecalcShouldForce)
change = Force;
- if (change == Force) {
+ // Recalculating the root style (on the document) is not needed in the common case.
+ if ((change == Force) || (shouldDisplaySeamlesslyWithParent() && (change >= Inherit))) {
// style selector may set this again during recalc
m_hasNodesWithPlaceholderStyle = false;
@@ -2064,6 +2077,14 @@ void Document::detach()
m_renderArena.clear();
}
+void Document::prepareForDestruction()
+{
+ disconnectDescendantFrames();
+ if (DOMWindow* window = this->domWindow())
+ window->willDetachDocumentFromFrame();
+ detach();
+}
+
void Document::removeAllEventListeners()
{
EventTarget::removeAllEventListeners();
@@ -2864,6 +2885,11 @@ void Document::addUserSheet(PassRefPtr<StyleSheetInternal> userSheet)
styleResolverChanged(RecalcStyleImmediately);
}
+void Document::seamlessParentUpdatedStylesheets()
+{
+ styleResolverChanged(RecalcStyleImmediately);
+}
+
CSSStyleSheet* Document::elementSheet()
{
if (!m_elemSheet)
@@ -3490,6 +3516,22 @@ static bool styleSheetsUseRemUnits(const Vector<RefPtr<StyleSheet> >& sheets)
return false;
}
+void Document::notifySeamlessChildDocumentsOfStylesheetUpdate() const
+{
+ // If we're not in a frame yet any potential child documents won't have a StyleResolver to update.
+ if (!frame())
+ return;
+
+ // Seamless child frames are expected to notify their seamless children recursively, so we only do direct children.
+ for (Frame* child = frame()->tree()->firstChild(); child; child = child->tree()->nextSibling()) {
+ Document* childDocument = child->document();
+ if (childDocument->shouldDisplaySeamlesslyWithParent()) {
+ ASSERT(childDocument->seamlessParentIFrame()->document() == this);
+ childDocument->seamlessParentUpdatedStylesheets();
+ }
+ }
+}
+
bool Document::updateActiveStylesheets(StyleResolverUpdateFlag updateFlag)
{
if (m_inStyleRecalc) {
@@ -3521,7 +3563,9 @@ bool Document::updateActiveStylesheets(StyleResolverUpdateFlag updateFlag)
m_usesRemUnits = styleSheetsUseRemUnits(m_styleSheets->vector());
m_didCalculateStyleResolver = true;
m_hasDirtyStyleResolver = false;
-
+
+ notifySeamlessChildDocumentsOfStylesheetUpdate();
+
return requiresFullStyleRecalc;
}
@@ -3609,7 +3653,7 @@ bool Document::setFocusedNode(PassRefPtr<Node> prpNewFocusedNode)
m_focusedNode = 0;
// Remove focus from the existing focus node (if any)
- if (oldFocusedNode && !oldFocusedNode->inDetach()) {
+ if (oldFocusedNode) {
if (oldFocusedNode->active())
oldFocusedNode->setActive(false);
@@ -5805,11 +5849,11 @@ void Document::webkitCancelAnimationFrame(int id)
m_scriptedAnimationController->cancelCallback(id);
}
-void Document::serviceScriptedAnimations(double monotonicAnimationStartTime)
+void Document::serviceScriptedAnimations(DOMTimeStamp time)
{
if (!m_scriptedAnimationController)
return;
- m_scriptedAnimationController->serviceScriptedAnimations(monotonicAnimationStartTime);
+ m_scriptedAnimationController->serviceScriptedAnimations(time);
}
#endif
@@ -5898,10 +5942,14 @@ HTMLIFrameElement* Document::seamlessParentIFrame() const
bool Document::shouldDisplaySeamlesslyWithParent() const
{
+#if ENABLE(IFRAME_SEAMLESS)
HTMLFrameOwnerElement* ownerElement = this->ownerElement();
if (!ownerElement)
return false;
return m_mayDisplaySeamlessWithParent && ownerElement->hasTagName(iframeTag) && ownerElement->fastHasAttribute(seamlessAttr);
+#else
+ return false;
+#endif
}
DocumentLoader* Document::loader() const
diff --git a/Source/WebCore/dom/Document.h b/Source/WebCore/dom/Document.h
index 2cff00d2d..6c684e822 100644
--- a/Source/WebCore/dom/Document.h
+++ b/Source/WebCore/dom/Document.h
@@ -330,6 +330,7 @@ public:
bool didDispatchViewportPropertiesChanged() const { return m_didDispatchViewportPropertiesChanged; }
#endif
+ void setReferrerPolicy(ReferrerPolicy referrerPolicy) { m_referrerPolicy = referrerPolicy; }
ReferrerPolicy referrerPolicy() const { return m_referrerPolicy; }
DocumentType* doctype() const { return m_docType.get(); }
@@ -577,6 +578,7 @@ public:
virtual void attach();
virtual void detach();
+ void prepareForDestruction();
// Override ScriptExecutionContext methods to do additional work
virtual void suspendActiveDOMObjects(ActiveDOMObject::ReasonForSuspension) OVERRIDE;
@@ -1124,7 +1126,7 @@ public:
#if ENABLE(REQUEST_ANIMATION_FRAME)
int webkitRequestAnimationFrame(PassRefPtr<RequestAnimationFrameCallback>);
void webkitCancelAnimationFrame(int id);
- void serviceScriptedAnimations(double monotonicAnimationStartTime);
+ void serviceScriptedAnimations(DOMTimeStamp);
#endif
virtual EventTarget* errorEventTarget();
@@ -1203,6 +1205,9 @@ private:
bool testAddedStylesheetRequiresStyleRecalc(StyleSheetInternal*);
void analyzeStylesheetChange(StyleResolverUpdateFlag, const Vector<RefPtr<StyleSheet> >& newStylesheets, bool& requiresStyleResolverReset, bool& requiresFullStyleRecalc);
+ void seamlessParentUpdatedStylesheets();
+ void notifySeamlessChildDocumentsOfStylesheetUpdate() const;
+
void deleteCustomFonts();
PassRefPtr<NodeList> handleZeroPadding(const HitTestRequest&, HitTestResult&) const;
diff --git a/Source/WebCore/dom/Element.cpp b/Source/WebCore/dom/Element.cpp
index 646ce5e9f..cc49393d8 100644
--- a/Source/WebCore/dom/Element.cpp
+++ b/Source/WebCore/dom/Element.cpp
@@ -704,9 +704,17 @@ void Element::attributeChanged(Attribute* attr)
{
document()->incDOMTreeVersion();
- if (isIdAttributeName(attr->name()))
- idAttributeChanged(attr);
- else if (attr->name() == HTMLNames::nameAttr)
+ if (isIdAttributeName(attr->name())) {
+ if (attributeData()) {
+ if (attr->isNull())
+ attributeData()->setIdForStyleResolution(nullAtom);
+ else if (document()->inQuirksMode())
+ attributeData()->setIdForStyleResolution(attr->value().lower());
+ else
+ attributeData()->setIdForStyleResolution(attr->value());
+ }
+ setNeedsStyleRecalc();
+ } else if (attr->name() == HTMLNames::nameAttr)
setHasName(!attr->isNull());
if (!needsStyleRecalc() && document()->attached()) {
@@ -745,19 +753,6 @@ void Element::attributeChanged(Attribute* attr)
document()->axObjectCache()->postNotification(renderer(), AXObjectCache::AXInvalidStatusChanged, true);
}
-void Element::idAttributeChanged(Attribute* attr)
-{
- if (attributeData()) {
- if (attr->isNull())
- attributeData()->setIdForStyleResolution(nullAtom);
- else if (document()->inQuirksMode())
- attributeData()->setIdForStyleResolution(attr->value().lower());
- else
- attributeData()->setIdForStyleResolution(attr->value());
- }
- setNeedsStyleRecalc();
-}
-
// Returns true is the given attribute is an event handler.
// We consider an event handler any attribute that begins with "on".
// It is a simple solution that has the advantage of not requiring any
@@ -871,11 +866,6 @@ void Element::createAttributeData() const
m_attributeData = ElementAttributeData::create();
}
-bool Element::isURLAttribute(Attribute*) const
-{
- return false;
-}
-
const QualifiedName& Element::imageSourceAttributeName() const
{
return srcAttr;
@@ -902,17 +892,6 @@ void Element::setChangedSinceLastFormControlChangeEvent(bool)
{
}
-void Element::willRemove()
-{
-#if ENABLE(FULLSCREEN_API)
- if (containsFullScreenElement())
- setContainsFullScreenElementOnAncestorsCrossingFrameBoundaries(false);
-#endif
- if (ElementShadow* shadow = this->shadow())
- shadow->willRemove();
- ContainerNode::willRemove();
-}
-
Node::InsertionNotificationRequest Element::insertedInto(Node* insertionPoint)
{
// need to do superclass processing first so inDocument() is true
@@ -945,6 +924,11 @@ Node::InsertionNotificationRequest Element::insertedInto(Node* insertionPoint)
void Element::removedFrom(Node* insertionPoint)
{
+#if ENABLE(FULLSCREEN_API)
+ if (containsFullScreenElement())
+ setContainsFullScreenElementOnAncestorsCrossingFrameBoundaries(false);
+#endif
+
setSavedLayerScrollOffset(IntSize());
if (insertionPoint->inDocument()) {
@@ -1156,8 +1140,7 @@ void Element::recalcStyle(StyleChange change)
StyleResolverParentPusher parentPusher(this);
// FIXME: This does not care about sibling combinators. Will be necessary in XBL2 world.
- if (hasShadowRoot()) {
- ElementShadow* shadow = this->shadow();
+ if (ElementShadow* shadow = this->shadow()) {
if (change >= Inherit || shadow->childNeedsStyleRecalc() || shadow->needsStyleRecalc()) {
parentPusher.push();
shadow->recalcStyle(change);
@@ -1195,13 +1178,6 @@ void Element::recalcStyle(StyleChange change)
didRecalcStyle(change);
}
-bool Element::hasShadowRoot() const
-{
- if (ElementShadow* shadow = this->shadow())
- return shadow->hasShadowRoot();
- return false;
-}
-
ElementShadow* Element::shadow() const
{
if (!hasRareData())
@@ -1221,8 +1197,8 @@ ElementShadow* Element::ensureShadow()
ShadowRoot* Element::ensureShadowRoot()
{
- if (hasShadowRoot())
- return shadow()->oldestShadowRoot();
+ if (ElementShadow* shadow = this->shadow())
+ return shadow->oldestShadowRoot();
return ShadowRoot::create(this, ShadowRoot::CreatingUserAgentShadowRoot).get();
}
@@ -1357,10 +1333,8 @@ void Element::childrenChanged(bool changedByParser, Node* beforeChange, Node* af
else
checkForSiblingStyleChanges(this, renderStyle(), false, beforeChange, afterChange, childCountDelta);
- if (hasRareData()) {
- if (hasShadowRoot())
- shadow()->hostChildrenChanged();
- }
+ if (ElementShadow * shadow = this->shadow())
+ shadow->hostChildrenChanged();
}
void Element::beginParsingChildren()
@@ -1846,7 +1820,7 @@ KURL Element::getURLAttribute(const QualifiedName& name) const
#if !ASSERT_DISABLED
if (m_attributeData) {
if (Attribute* attribute = getAttributeItem(name))
- ASSERT(isURLAttribute(attribute));
+ ASSERT(isURLAttribute(*attribute));
}
#endif
return document()->completeURL(stripLeadingAndTrailingHTMLSpaces(getAttribute(name)));
@@ -1857,7 +1831,7 @@ KURL Element::getNonEmptyURLAttribute(const QualifiedName& name) const
#if !ASSERT_DISABLED
if (m_attributeData) {
if (Attribute* attribute = getAttributeItem(name))
- ASSERT(isURLAttribute(attribute));
+ ASSERT(isURLAttribute(*attribute));
}
#endif
String value = stripLeadingAndTrailingHTMLSpaces(getAttribute(name));
diff --git a/Source/WebCore/dom/Element.h b/Source/WebCore/dom/Element.h
index 7f3d607d7..8bd9cd810 100644
--- a/Source/WebCore/dom/Element.h
+++ b/Source/WebCore/dom/Element.h
@@ -261,7 +261,6 @@ public:
virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
void recalcStyle(StyleChange = NoChange);
- bool hasShadowRoot() const;
ElementShadow* shadow() const;
ElementShadow* ensureShadow();
@@ -281,7 +280,7 @@ public:
virtual void accessKeyAction(bool /*sendToAnyEvent*/) { }
- virtual bool isURLAttribute(Attribute*) const;
+ virtual bool isURLAttribute(const Attribute&) const { return false; }
KURL getURLAttribute(const QualifiedName&) const;
KURL getNonEmptyURLAttribute(const QualifiedName&) const;
@@ -420,7 +419,6 @@ protected:
{
}
- virtual void willRemove();
virtual InsertionNotificationRequest insertedInto(Node*) OVERRIDE;
virtual void removedFrom(Node*) OVERRIDE;
virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0);
@@ -431,8 +429,6 @@ protected:
virtual bool shouldRegisterAsNamedItem() const { return false; }
virtual bool shouldRegisterAsExtraNamedItem() const { return false; }
- void idAttributeChanged(Attribute*);
-
HTMLCollection* ensureCachedHTMLCollection(CollectionType);
private:
@@ -717,6 +713,11 @@ inline bool Node::hasClass() const
return isElementNode() && toElement(this)->hasClass();
}
+inline bool isShadowHost(const Node* node)
+{
+ return node && node->isElementNode() && toElement(node)->shadow();
+}
+
} // namespace
#endif
diff --git a/Source/WebCore/dom/ElementAttributeData.cpp b/Source/WebCore/dom/ElementAttributeData.cpp
index cb8917a45..6527cf90a 100644
--- a/Source/WebCore/dom/ElementAttributeData.cpp
+++ b/Source/WebCore/dom/ElementAttributeData.cpp
@@ -32,47 +32,99 @@
namespace WebCore {
-typedef HashMap<pair<Element*, QualifiedName>, RefPtr<Attr> > AttrMap;
-static AttrMap& attrMap()
+typedef Vector<RefPtr<Attr> > AttrList;
+typedef HashMap<Element*, OwnPtr<AttrList> > AttrListMap;
+
+static AttrListMap& attrListMap()
{
- DEFINE_STATIC_LOCAL(AttrMap, map, ());
+ DEFINE_STATIC_LOCAL(AttrListMap, map, ());
return map;
}
-PassRefPtr<Attr> ElementAttributeData::attrIfExists(Element* element, const QualifiedName& name)
+static AttrList* attrListForElement(Element* element)
{
- if (!m_attrCount)
+ ASSERT(element);
+ if (!element->hasAttrList())
return 0;
- return attrMap().get(std::make_pair(element, name)).get();
+ ASSERT(attrListMap().contains(element));
+ return attrListMap().get(element);
}
-PassRefPtr<Attr> ElementAttributeData::ensureAttr(Element* element, const QualifiedName& name)
+static AttrList* ensureAttrListForElement(Element* element)
{
- AttrMap::AddResult result = attrMap().add(std::make_pair(element, name), 0);
- if (result.isNewEntry) {
- result.iterator->second = Attr::create(element, name);
- ++m_attrCount;
+ ASSERT(element);
+ if (element->hasAttrList()) {
+ ASSERT(attrListMap().contains(element));
+ return attrListMap().get(element);
}
+ ASSERT(!attrListMap().contains(element));
+ element->setHasAttrList();
+ AttrListMap::AddResult result = attrListMap().add(element, adoptPtr(new AttrList));
return result.iterator->second.get();
}
+static void removeAttrListForElement(Element* element)
+{
+ ASSERT(element);
+ ASSERT(element->hasAttrList());
+ ASSERT(attrListMap().contains(element));
+ attrListMap().remove(element);
+ element->clearHasAttrList();
+}
+
+static Attr* findAttrInList(AttrList* attrList, const QualifiedName& name)
+{
+ for (unsigned i = 0; i < attrList->size(); ++i) {
+ if (attrList->at(i)->qualifiedName() == name)
+ return attrList->at(i).get();
+ }
+ return 0;
+}
+
+PassRefPtr<Attr> ElementAttributeData::attrIfExists(Element* element, const QualifiedName& name)
+{
+ if (AttrList* attrList = attrListForElement(element))
+ return findAttrInList(attrList, name);
+ return 0;
+}
+
+PassRefPtr<Attr> ElementAttributeData::ensureAttr(Element* element, const QualifiedName& name)
+{
+ AttrList* attrList = ensureAttrListForElement(element);
+ RefPtr<Attr> attr = findAttrInList(attrList, name);
+ if (!attr) {
+ attr = Attr::create(element, name);
+ attrList->append(attr);
+ }
+ return attr.release();
+}
+
void ElementAttributeData::setAttr(Element* element, const QualifiedName& name, Attr* attr)
{
- ASSERT(!attrMap().contains(std::make_pair(element, name)));
- attrMap().add(std::make_pair(element, name), attr);
+ AttrList* attrList = ensureAttrListForElement(element);
+
+ if (findAttrInList(attrList, name))
+ return;
+
+ attrList->append(attr);
attr->attachToElement(element);
- ++m_attrCount;
}
void ElementAttributeData::removeAttr(Element* element, const QualifiedName& name)
{
- ASSERT(attrMap().contains(std::make_pair(element, name)));
- attrMap().remove(std::make_pair(element, name));
- --m_attrCount;
-}
+ AttrList* attrList = attrListForElement(element);
+ ASSERT(attrList);
+
+ for (unsigned i = 0; i < attrList->size(); ++i) {
+ if (attrList->at(i)->qualifiedName() == name) {
+ attrList->remove(i);
+ if (attrList->isEmpty())
+ removeAttrListForElement(element);
+ return;
+ }
+ }
-ElementAttributeData::~ElementAttributeData()
-{
+ ASSERT_NOT_REACHED();
}
void ElementAttributeData::setClass(const String& className, bool shouldFoldCase)
@@ -170,13 +222,16 @@ bool ElementAttributeData::isEquivalent(const ElementAttributeData* other) const
void ElementAttributeData::detachAttributesFromElement(Element* element)
{
- if (!m_attrCount)
+ if (!element->hasAttrList())
return;
for (unsigned i = 0; i < m_attributes.size(); ++i) {
if (RefPtr<Attr> attr = attrIfExists(element, m_attributes[i].name()))
attr->detachFromElementWithValue(m_attributes[i].value());
}
+
+ // The loop above should have cleaned out this element's Attr map.
+ ASSERT(!element->hasAttrList());
}
size_t ElementAttributeData::getAttributeItemIndexSlowCase(const String& name, bool shouldIgnoreAttributeCase) const
diff --git a/Source/WebCore/dom/ElementAttributeData.h b/Source/WebCore/dom/ElementAttributeData.h
index a849bfe97..67513d26a 100644
--- a/Source/WebCore/dom/ElementAttributeData.h
+++ b/Source/WebCore/dom/ElementAttributeData.h
@@ -55,8 +55,6 @@ public:
return adoptPtr(new ElementAttributeData);
}
- ~ElementAttributeData();
-
void clearClass() { m_classNames.clear(); }
void setClass(const String& className, bool shouldFoldCase);
const SpaceSplitString& classNames() const { return m_classNames; }
@@ -106,7 +104,6 @@ private:
friend class HTMLConstructionSite;
ElementAttributeData()
- : m_attrCount(0)
{
}
@@ -125,8 +122,6 @@ private:
SpaceSplitString m_classNames;
AtomicString m_idForStyleResolution;
Vector<Attribute> m_attributes;
-
- unsigned m_attrCount;
};
inline void ElementAttributeData::removeAttribute(const QualifiedName& name, Element* element)
diff --git a/Source/WebCore/dom/ElementShadow.cpp b/Source/WebCore/dom/ElementShadow.cpp
index 7cc22e946..cc6c86e16 100644
--- a/Source/WebCore/dom/ElementShadow.cpp
+++ b/Source/WebCore/dom/ElementShadow.cpp
@@ -46,8 +46,7 @@ ElementShadow::ElementShadow()
ElementShadow::~ElementShadow()
{
- if (hasShadowRoot())
- removeAllShadowRoots();
+ removeAllShadowRoots();
}
static bool validateShadowRoot(Document* document, ShadowRoot* shadowRoot, ExceptionCode& ec)
@@ -91,9 +90,6 @@ void ElementShadow::addShadowRoot(Element* shadowHost, PassRefPtr<ShadowRoot> sh
void ElementShadow::removeAllShadowRoots()
{
- if (!hasShadowRoot())
- return;
-
// Dont protect this ref count.
Element* shadowHost = host();
@@ -115,13 +111,6 @@ void ElementShadow::removeAllShadowRoots()
shadowHost->attachChildrenLazily();
}
-void ElementShadow::willRemove()
-{
- ShadowRootVector roots(this);
- for (size_t i = 0; i < roots.size(); ++i)
- roots[i]->willRemove();
-}
-
void ElementShadow::setParentTreeScope(TreeScope* scope)
{
for (ShadowRoot* root = youngestShadowRoot(); root; root = root->olderShadowRoot())
diff --git a/Source/WebCore/dom/ElementShadow.h b/Source/WebCore/dom/ElementShadow.h
index 80480b802..4c07a27e0 100644
--- a/Source/WebCore/dom/ElementShadow.h
+++ b/Source/WebCore/dom/ElementShadow.h
@@ -50,15 +50,10 @@ public:
~ElementShadow();
Element* host() const;
-
- bool hasShadowRoot() const;
ShadowRoot* youngestShadowRoot() const;
ShadowRoot* oldestShadowRoot() const;
void addShadowRoot(Element* shadowHost, PassRefPtr<ShadowRoot>, ExceptionCode&);
- void removeAllShadowRoots();
-
- void willRemove();
void setParentTreeScope(TreeScope*);
@@ -84,6 +79,7 @@ public:
const HTMLContentSelector& selector() const;
private:
+ void removeAllShadowRoots();
DoublyLinkedList<ShadowRoot> m_shadowRoots;
HTMLContentSelector m_selector;
@@ -91,11 +87,6 @@ private:
WTF_MAKE_NONCOPYABLE(ElementShadow);
};
-inline bool ElementShadow::hasShadowRoot() const
-{
- return !m_shadowRoots.isEmpty();
-}
-
inline ShadowRoot* ElementShadow::youngestShadowRoot() const
{
return m_shadowRoots.head();
@@ -123,7 +114,7 @@ inline void ElementShadow::clearNeedsReattachHostChildrenAndShadow()
inline Element* ElementShadow::host() const
{
- ASSERT(hasShadowRoot());
+ ASSERT(!m_shadowRoots.isEmpty());
return youngestShadowRoot()->host();
}
diff --git a/Source/WebCore/dom/EventDispatcher.cpp b/Source/WebCore/dom/EventDispatcher.cpp
index 5866e6068..1689e06b8 100644
--- a/Source/WebCore/dom/EventDispatcher.cpp
+++ b/Source/WebCore/dom/EventDispatcher.cpp
@@ -116,11 +116,6 @@ void EventDispatcher::dispatchSimulatedClick(Node* node, PassRefPtr<Event> under
gNodesDispatchingSimulatedClicks->remove(node);
}
-static inline bool isShadowHost(Node* node)
-{
- return node->isElementNode() && toElement(node)->hasShadowRoot();
-}
-
PassRefPtr<EventTarget> EventDispatcher::adjustToShadowBoundaries(PassRefPtr<Node> relatedTarget, const Vector<Node*> relatedTargetAncestors)
{
Vector<EventContext>::const_iterator lowestCommonBoundary = m_ancestors.end();
diff --git a/Source/WebCore/dom/Node.cpp b/Source/WebCore/dom/Node.cpp
index c644ba1f9..94b29d262 100644
--- a/Source/WebCore/dom/Node.cpp
+++ b/Source/WebCore/dom/Node.cpp
@@ -77,6 +77,7 @@
#include "PlatformWheelEvent.h"
#include "ProcessingInstruction.h"
#include "ProgressEvent.h"
+#include "RadioNodeList.h"
#include "RegisteredEventListener.h"
#include "RenderBlock.h"
#include "RenderBox.h"
@@ -835,7 +836,11 @@ bool Node::hasNonEmptyBoundingBox() const
inline static ShadowRoot* oldestShadowRootFor(const Node* node)
{
- return node->isElementNode() && toElement(node)->hasShadowRoot() ? toElement(node)->shadow()->oldestShadowRoot() : 0;
+ if (!node->isElementNode())
+ return 0;
+ if (ElementShadow* shadow = toElement(node)->shadow())
+ return shadow->oldestShadowRoot();
+ return 0;
}
inline void Node::setStyleChange(StyleChangeType changeType)
@@ -991,6 +996,9 @@ void Node::invalidateNodeListsCacheAfterAttributeChanged(const QualifiedName& at
&& attrName != itempropAttr
&& attrName != itemtypeAttr
#endif
+ && attrName != idAttr
+ && attrName != typeAttr
+ && attrName != checkedAttr
&& attrName != nameAttr
&& attrName != forAttr)
return;
@@ -1338,14 +1346,8 @@ void Node::attach()
clearNeedsStyleRecalc();
}
-void Node::willRemove()
-{
-}
-
void Node::detach()
{
- setFlag(InDetachFlag);
-
if (renderer())
renderer()->destroyAndCleanupAnonymousWrappers();
setRenderer(0);
@@ -1360,8 +1362,6 @@ void Node::detach()
clearFlag(IsHoveredFlag);
clearFlag(InActiveChainFlag);
clearFlag(IsAttachedFlag);
-
- clearFlag(InDetachFlag);
}
// FIXME: This code is used by editing. Seems like it could move over there and not pollute Node.
@@ -2329,6 +2329,10 @@ void NodeListsNodeData::invalidateCachesThatDependOnAttributes()
for (MicroDataItemListCache::iterator it = m_microDataItemListCache.begin(); it != itemListCacheEnd; ++it)
it->second->invalidateCache();
#endif
+
+ RadioNodeListCache::iterator radioNodeListCacheEnd = m_radioNodeListCache.end();
+ for (RadioNodeListCache::iterator it = m_radioNodeListCache.begin(); it != radioNodeListCacheEnd; ++it)
+ it->second->invalidateCache();
}
bool NodeListsNodeData::isEmpty() const
@@ -2351,7 +2355,10 @@ bool NodeListsNodeData::isEmpty() const
if (m_labelsNodeListCache)
return false;
-
+
+ if (!m_radioNodeListCache.isEmpty())
+ return false;
+
return true;
}
@@ -2958,6 +2965,31 @@ void NodeRareData::clearChildNodeListCache()
m_childNodeList->invalidateCache();
}
+PassRefPtr<RadioNodeList> Node::radioNodeList(const AtomicString& name)
+{
+ ASSERT(hasTagName(formTag));
+
+ NodeListsNodeData* nodeLists = ensureRareData()->ensureNodeLists(this);
+
+ NodeListsNodeData::RadioNodeListCache::AddResult result = nodeLists->m_radioNodeListCache.add(name, 0);
+ if (!result.isNewEntry)
+ return PassRefPtr<RadioNodeList>(result.iterator->second);
+
+ RefPtr<RadioNodeList> list = RadioNodeList::create(name, toElement(this));
+ result.iterator->second = list.get();
+ return list.release();
+}
+
+void Node::removeCachedRadioNodeList(RadioNodeList* list, const AtomicString& name)
+{
+ ASSERT(rareData());
+ ASSERT(rareData()->nodeLists());
+
+ NodeListsNodeData* data = rareData()->nodeLists();
+ ASSERT_UNUSED(list, list == data->m_radioNodeListCache.get(name));
+ data->m_radioNodeListCache.remove(name);
+}
+
} // namespace WebCore
#ifndef NDEBUG
diff --git a/Source/WebCore/dom/Node.h b/Source/WebCore/dom/Node.h
index bd22c3d68..875c82afa 100644
--- a/Source/WebCore/dom/Node.h
+++ b/Source/WebCore/dom/Node.h
@@ -75,6 +75,7 @@ class PlatformKeyboardEvent;
class PlatformMouseEvent;
class PlatformWheelEvent;
class QualifiedName;
+class RadioNodeList;
class RegisteredEventListener;
class RenderArena;
class RenderBox;
@@ -90,7 +91,7 @@ class HTMLPropertiesCollection;
typedef int ExceptionCode;
-const int nodeStyleChangeShift = 21;
+const int nodeStyleChangeShift = 20;
// SyntheticStyleChange means that we need to go through the entire style change logic even though
// no style property has actually changed. It is used to restructure the tree when, for instance,
@@ -210,12 +211,13 @@ public:
virtual bool isMediaControlElement() const { return false; }
virtual bool isMediaControls() const { return false; }
bool isStyledElement() const { return getFlag(IsStyledElementFlag); }
- virtual bool isFrameOwnerElement() const { return false; }
virtual bool isAttributeNode() const { return false; }
virtual bool isCharacterDataNode() const { return false; }
bool isDocumentNode() const;
bool isShadowRoot() const { return getFlag(IsShadowRootFlag); }
bool inNamedFlow() const { return getFlag(InNamedFlowFlag); }
+ bool hasAttrList() const { return getFlag(HasAttrListFlag); }
+ bool isFrameOwnerElement() const { return getFlag(IsFrameOwnerElementFlag); }
Node* shadowAncestorNode() const;
// Returns 0, a ShadowRoot, or a legacy shadow root.
@@ -296,10 +298,9 @@ public:
bool hasName() const { return getFlag(HasNameFlag); }
bool hasID() const;
bool hasClass() const;
-
+
bool active() const { return getFlag(IsActiveFlag); }
bool inActiveChain() const { return getFlag(InActiveChainFlag); }
- bool inDetach() const { return getFlag(InDetachFlag); }
bool hovered() const { return getFlag(IsHoveredFlag); }
bool focused() const { return hasRareData() ? rareDataFocused() : false; }
bool attached() const { return getFlag(IsAttachedFlag); }
@@ -330,6 +331,9 @@ public:
void setInNamedFlow() { setFlag(InNamedFlowFlag); }
void clearInNamedFlow() { clearFlag(InNamedFlowFlag); }
+ void setHasAttrList() { setFlag(HasAttrListFlag); }
+ void clearHasAttrList() { clearFlag(HasAttrListFlag); }
+
enum ShouldSetAttached {
SetAttached,
DoNotSetAttached
@@ -491,8 +495,6 @@ public:
void reattach();
void reattachIfAttached();
-
- virtual void willRemove();
void createRendererIfNeeded();
virtual bool rendererIsNeeded(const NodeRenderingContext&);
virtual bool childShouldCreateRenderer(const NodeRenderingContext&) const { return true; }
@@ -558,6 +560,9 @@ public:
void removeCachedChildNodeList();
+ PassRefPtr<RadioNodeList> radioNodeList(const AtomicString&);
+ void removeCachedRadioNodeList(RadioNodeList*, const AtomicString&);
+
PassRefPtr<NodeList> getElementsByTagName(const AtomicString&);
PassRefPtr<NodeList> getElementsByTagNameNS(const AtomicString& namespaceURI, const AtomicString& localName);
PassRefPtr<NodeList> getElementsByName(const String& elementName);
@@ -658,39 +663,40 @@ private:
IsActiveFlag = 1 << 10,
IsHoveredFlag = 1 << 11,
InActiveChainFlag = 1 << 12,
- InDetachFlag = 1 << 13,
- HasRareDataFlag = 1 << 14,
- IsShadowRootFlag = 1 << 15,
+ HasRareDataFlag = 1 << 13,
+ IsShadowRootFlag = 1 << 14,
// These bits are used by derived classes, pulled up here so they can
// be stored in the same memory word as the Node bits above.
- IsParsingChildrenFinishedFlag = 1 << 16, // Element
- IsStyleAttributeValidFlag = 1 << 17, // StyledElement
+ IsParsingChildrenFinishedFlag = 1 << 15, // Element
+ IsStyleAttributeValidFlag = 1 << 16, // StyledElement
#if ENABLE(SVG)
- AreSVGAttributesValidFlag = 1 << 18, // Element
- IsSynchronizingSVGAttributesFlag = 1 << 19, // SVGElement
- HasSVGRareDataFlag = 1 << 20, // SVGElement
+ AreSVGAttributesValidFlag = 1 << 17, // Element
+ IsSynchronizingSVGAttributesFlag = 1 << 18, // SVGElement
+ HasSVGRareDataFlag = 1 << 19, // SVGElement
#endif
StyleChangeMask = 1 << nodeStyleChangeShift | 1 << (nodeStyleChangeShift + 1),
- SelfOrAncestorHasDirAutoFlag = 1 << 23,
- HasCustomWillOrDidRecalcStyleFlag = 1 << 24,
- HasCustomStyleForRendererFlag = 1 << 25,
+ SelfOrAncestorHasDirAutoFlag = 1 << 22,
+ HasCustomWillOrDidRecalcStyleFlag = 1 << 23,
+ HasCustomStyleForRendererFlag = 1 << 24,
- HasNameFlag = 1 << 26,
+ HasNameFlag = 1 << 25,
- AttributeStyleDirtyFlag = 1 << 27,
+ AttributeStyleDirtyFlag = 1 << 26,
#if ENABLE(SVG)
DefaultNodeFlags = IsParsingChildrenFinishedFlag | IsStyleAttributeValidFlag | AreSVGAttributesValidFlag,
#else
DefaultNodeFlags = IsParsingChildrenFinishedFlag | IsStyleAttributeValidFlag,
#endif
- InNamedFlowFlag = 1 << 29
+ InNamedFlowFlag = 1 << 28,
+ HasAttrListFlag = 1 << 29,
+ IsFrameOwnerElementFlag = 1 << 30
};
- // 3 bits remaining
+ // 2 bits remaining
bool getFlag(NodeFlags mask) const { return m_nodeFlags & mask; }
void setFlag(bool f, NodeFlags mask) const { m_nodeFlags = (m_nodeFlags & ~mask) | (-(int32_t)f & mask); }
@@ -706,6 +712,7 @@ protected:
CreateShadowRoot = CreateContainer | IsShadowRootFlag,
CreateStyledElement = CreateElement | IsStyledElementFlag,
CreateHTMLElement = CreateStyledElement | IsHTMLFlag,
+ CreateFrameOwnerElement = CreateHTMLElement | IsFrameOwnerElementFlag,
CreateSVGElement = CreateStyledElement | IsSVGFlag,
CreateDocument = CreateContainer | InDocumentFlag
};
diff --git a/Source/WebCore/dom/NodeRareData.h b/Source/WebCore/dom/NodeRareData.h
index fc17f2d2f..eaef9a5a4 100644
--- a/Source/WebCore/dom/NodeRareData.h
+++ b/Source/WebCore/dom/NodeRareData.h
@@ -45,6 +45,7 @@
namespace WebCore {
class LabelsNodeList;
+class RadioNodeList;
class TreeScope;
struct NodeListsNodeData {
@@ -72,6 +73,9 @@ public:
LabelsNodeList* m_labelsNodeListCache;
+ typedef HashMap<String, RadioNodeList*> RadioNodeListCache;
+ RadioNodeListCache m_radioNodeListCache;
+
static PassOwnPtr<NodeListsNodeData> create()
{
return adoptPtr(new NodeListsNodeData);
diff --git a/Source/WebCore/dom/NodeRenderingContext.cpp b/Source/WebCore/dom/NodeRenderingContext.cpp
index 271f5cad0..5898419a6 100644
--- a/Source/WebCore/dom/NodeRenderingContext.cpp
+++ b/Source/WebCore/dom/NodeRenderingContext.cpp
@@ -71,7 +71,7 @@ NodeRenderingContext::NodeRenderingContext(Node* node)
}
if (parent->isElementNode() || parent->isShadowRoot()) {
- if (parent->isElementNode() && toElement(parent)->hasShadowRoot())
+ if (parent->isElementNode())
m_visualParentShadow = toElement(parent)->shadow();
else if (parent->isShadowRoot())
m_visualParentShadow = toShadowRoot(parent)->owner();
diff --git a/Source/WebCore/dom/Position.cpp b/Source/WebCore/dom/Position.cpp
index fd78eb91e..08dea73b6 100644
--- a/Source/WebCore/dom/Position.cpp
+++ b/Source/WebCore/dom/Position.cpp
@@ -33,6 +33,7 @@
#include "PositionIterator.h"
#include "RenderBlock.h"
#include "RenderText.h"
+#include "RuntimeEnabledFeatures.h"
#include "Text.h"
#include "TextIterator.h"
#include "VisiblePosition.h"
@@ -80,7 +81,11 @@ Position::Position(PassRefPtr<Node> anchorNode, LegacyEditingOffset offset)
, m_anchorType(anchorTypeForLegacyEditingPosition(m_anchorNode.get(), m_offset))
, m_isLegacyEditingPosition(true)
{
+#if ENABLE(SHADOW_DOM)
+ ASSERT(RuntimeEnabledFeatures::shadowDOMEnabled() || !m_anchorNode || !m_anchorNode->isShadowRoot());
+#else
ASSERT(!m_anchorNode || !m_anchorNode->isShadowRoot());
+#endif
}
Position::Position(PassRefPtr<Node> anchorNode, AnchorType anchorType)
@@ -89,7 +94,12 @@ Position::Position(PassRefPtr<Node> anchorNode, AnchorType anchorType)
, m_anchorType(anchorType)
, m_isLegacyEditingPosition(false)
{
+#if ENABLE(SHADOW_DOM)
+ ASSERT(RuntimeEnabledFeatures::shadowDOMEnabled() || !m_anchorNode || !m_anchorNode->isShadowRoot());
+#else
ASSERT(!m_anchorNode || !m_anchorNode->isShadowRoot());
+#endif
+
ASSERT(anchorType != PositionIsOffsetInAnchor);
ASSERT(!((anchorType == PositionIsBeforeChildren || anchorType == PositionIsAfterChildren)
&& (m_anchorNode->isTextNode() || editingIgnoresContent(m_anchorNode.get()))));
@@ -101,7 +111,12 @@ Position::Position(PassRefPtr<Node> anchorNode, int offset, AnchorType anchorTyp
, m_anchorType(anchorType)
, m_isLegacyEditingPosition(false)
{
+#if ENABLE(SHADOW_DOM)
+ ASSERT(RuntimeEnabledFeatures::shadowDOMEnabled() || !m_anchorNode || !editingIgnoresContent(m_anchorNode.get()) || !m_anchorNode->isShadowRoot());
+#else
ASSERT(!m_anchorNode || !editingIgnoresContent(m_anchorNode.get()) || !m_anchorNode->isShadowRoot());
+#endif
+
ASSERT(anchorType == PositionIsOffsetInAnchor);
}
@@ -143,7 +158,7 @@ Node* Position::containerNode() const
return m_anchorNode.get();
case PositionIsBeforeAnchor:
case PositionIsAfterAnchor:
- return m_anchorNode->nonShadowBoundaryParentNode();
+ return findParent(m_anchorNode.get());
}
ASSERT_NOT_REACHED();
return 0;
@@ -203,7 +218,7 @@ Position Position::parentAnchoredEquivalent() const
// FIXME: This should only be necessary for legacy positions, but is also needed for positions before and after Tables
if (m_offset <= 0 && (m_anchorType != PositionIsAfterAnchor && m_anchorType != PositionIsAfterChildren)) {
- if (m_anchorNode->nonShadowBoundaryParentNode() && (editingIgnoresContent(m_anchorNode.get()) || isTableElement(m_anchorNode.get())))
+ if (findParent(m_anchorNode.get()) && (editingIgnoresContent(m_anchorNode.get()) || isTableElement(m_anchorNode.get())))
return positionInParentBeforeNode(m_anchorNode.get());
return Position(m_anchorNode.get(), 0, PositionIsOffsetInAnchor);
}
@@ -316,7 +331,7 @@ Position Position::previous(PositionMoveType moveType) const
}
}
- ContainerNode* parent = n->nonShadowBoundaryParentNode();
+ ContainerNode* parent = findParent(n);
if (!parent)
return *this;
@@ -348,7 +363,7 @@ Position Position::next(PositionMoveType moveType) const
return createLegacyEditingPosition(n, (moveType == Character) ? uncheckedNextOffset(n, o) : o + 1);
}
- ContainerNode* parent = n->nonShadowBoundaryParentNode();
+ ContainerNode* parent = findParent(n);
if (!parent)
return *this;
@@ -441,14 +456,14 @@ bool Position::atStartOfTree() const
{
if (isNull())
return true;
- return !deprecatedNode()->nonShadowBoundaryParentNode() && m_offset <= 0;
+ return !findParent(deprecatedNode()) && m_offset <= 0;
}
bool Position::atEndOfTree() const
{
if (isNull())
return true;
- return !deprecatedNode()->nonShadowBoundaryParentNode() && m_offset >= lastOffsetForEditing(deprecatedNode());
+ return !findParent(deprecatedNode()) && m_offset >= lastOffsetForEditing(deprecatedNode());
}
int Position::renderedOffset() const
@@ -834,6 +849,18 @@ bool Position::nodeIsUserSelectNone(Node* node)
return node && node->renderer() && node->renderer()->style()->userSelect() == SELECT_NONE;
}
+ContainerNode* Position::findParent(const Node* node)
+{
+ // FIXME: See http://web.ug/82697
+
+#if ENABLE(SHADOW_DOM)
+ if (RuntimeEnabledFeatures::shadowDOMEnabled())
+ return node->parentNode();
+#endif
+
+ return node->nonShadowBoundaryParentNode();
+}
+
bool Position::isCandidate() const
{
if (isNull())
diff --git a/Source/WebCore/dom/Position.h b/Source/WebCore/dom/Position.h
index 4e244a0d2..27c3f4297 100644
--- a/Source/WebCore/dom/Position.h
+++ b/Source/WebCore/dom/Position.h
@@ -189,6 +189,8 @@ public:
static bool hasRenderedNonAnonymousDescendantsWithHeight(RenderObject*);
static bool nodeIsUserSelectNone(Node*);
+
+ static ContainerNode* findParent(const Node*);
void debugPosition(const char* msg = "") const;
@@ -203,6 +205,7 @@ private:
int renderedOffset() const;
+
Position previousCharacterPosition(EAffinity) const;
Position nextCharacterPosition(EAffinity) const;
@@ -244,13 +247,13 @@ inline Position positionInParentBeforeNode(const Node* node)
// At least one caller currently hits this ASSERT though, which indicates
// that the caller is trying to make a position relative to a disconnected node (which is likely an error)
// Specifically, editing/deleting/delete-ligature-001.html crashes with ASSERT(node->parentNode())
- return Position(node->nonShadowBoundaryParentNode(), node->nodeIndex(), Position::PositionIsOffsetInAnchor);
+ return Position(Position::findParent(node), node->nodeIndex(), Position::PositionIsOffsetInAnchor);
}
inline Position positionInParentAfterNode(const Node* node)
{
- ASSERT(node->nonShadowBoundaryParentNode());
- return Position(node->nonShadowBoundaryParentNode(), node->nodeIndex() + 1, Position::PositionIsOffsetInAnchor);
+ ASSERT(Position::findParent(node));
+ return Position(Position::findParent(node), node->nodeIndex() + 1, Position::PositionIsOffsetInAnchor);
}
// positionBeforeNode and positionAfterNode return neighbor-anchored positions, construction is O(1)
diff --git a/Source/WebCore/dom/RequestAnimationFrameCallback.h b/Source/WebCore/dom/RequestAnimationFrameCallback.h
index f1347268a..a86792249 100644
--- a/Source/WebCore/dom/RequestAnimationFrameCallback.h
+++ b/Source/WebCore/dom/RequestAnimationFrameCallback.h
@@ -31,6 +31,7 @@
#ifndef RequestAnimationFrameCallback_h
#define RequestAnimationFrameCallback_h
+#include "DOMTimeStamp.h"
#include <wtf/RefCounted.h>
namespace WebCore {
@@ -38,7 +39,7 @@ namespace WebCore {
class RequestAnimationFrameCallback : public RefCounted<RequestAnimationFrameCallback> {
public:
virtual ~RequestAnimationFrameCallback() { }
- virtual bool handleEvent(double highResTimeMs) = 0;
+ virtual bool handleEvent(DOMTimeStamp) = 0;
int m_id;
bool m_firedOrCancelled;
@@ -47,3 +48,4 @@ public:
}
#endif // RequestAnimationFrameCallback_h
+
diff --git a/Source/WebCore/dom/RequestAnimationFrameCallback.idl b/Source/WebCore/dom/RequestAnimationFrameCallback.idl
index 7e8e1d798..4da682083 100644
--- a/Source/WebCore/dom/RequestAnimationFrameCallback.idl
+++ b/Source/WebCore/dom/RequestAnimationFrameCallback.idl
@@ -33,13 +33,11 @@ module core {
Callback,
Conditional=REQUEST_ANIMATION_FRAME,
] RequestAnimationFrameCallback{
- // highResTime is passed as high resolution timestamp, see
- // http://www.w3.org/TR/hr-time/ for details.
#if defined(V8_BINDING) && V8_BINDING
- boolean handleEvent(in double highResTime);
+ boolean handleEvent(in DOMTimeStamp time);
#else
- [Custom] boolean handleEvent(in double highResTime);
+ [Custom] boolean handleEvent(in DOMTimeStamp time);
#endif
-
+
};
}
diff --git a/Source/WebCore/dom/ScriptedAnimationController.cpp b/Source/WebCore/dom/ScriptedAnimationController.cpp
index a0b0c9d61..974483dd4 100644
--- a/Source/WebCore/dom/ScriptedAnimationController.cpp
+++ b/Source/WebCore/dom/ScriptedAnimationController.cpp
@@ -29,7 +29,6 @@
#if ENABLE(REQUEST_ANIMATION_FRAME)
#include "Document.h"
-#include "DocumentLoader.h"
#include "FrameView.h"
#include "InspectorInstrumentation.h"
#include "RequestAnimationFrameCallback.h"
@@ -53,7 +52,7 @@ ScriptedAnimationController::ScriptedAnimationController(Document* document, Pla
, m_suspendCount(0)
#if USE(REQUEST_ANIMATION_FRAME_TIMER)
, m_animationTimer(this, &ScriptedAnimationController::animationTimerFired)
- , m_lastAnimationFrameTimeMonotonic(0)
+ , m_lastAnimationFrameTime(0)
#if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
, m_useTimer(false)
#endif
@@ -108,13 +107,11 @@ void ScriptedAnimationController::cancelCallback(CallbackId id)
}
}
-void ScriptedAnimationController::serviceScriptedAnimations(double monotonicTimeNow)
+void ScriptedAnimationController::serviceScriptedAnimations(DOMTimeStamp time)
{
if (!m_callbacks.size() || m_suspendCount || (m_document->settings() && !m_document->settings()->requestAnimationFrameEnabled()))
return;
- double highResNowMs = 1000.0 * m_document->loader()->timing()->convertMonotonicTimeToZeroBasedDocumentTime(monotonicTimeNow);
-
// First, generate a list of callbacks to consider. Callbacks registered from this point
// on are considered only for the "next" frame, not this one.
CallbackList callbacks(m_callbacks);
@@ -128,7 +125,7 @@ void ScriptedAnimationController::serviceScriptedAnimations(double monotonicTime
if (!callback->m_firedOrCancelled) {
callback->m_firedOrCancelled = true;
InspectorInstrumentationCookie cookie = InspectorInstrumentation::willFireAnimationFrame(m_document, callback->m_id);
- callback->handleEvent(highResNowMs);
+ callback->handleEvent(time);
InspectorInstrumentation::didFireAnimationFrame(cookie);
}
}
@@ -144,7 +141,7 @@ void ScriptedAnimationController::serviceScriptedAnimations(double monotonicTime
if (m_callbacks.size())
scheduleAnimation();
}
-
+
void ScriptedAnimationController::windowScreenDidChange(PlatformDisplayID displayID)
{
if (m_document->settings() && !m_document->settings()->requestAnimationFrameEnabled())
@@ -153,7 +150,7 @@ void ScriptedAnimationController::windowScreenDidChange(PlatformDisplayID displa
DisplayRefreshMonitorManager::sharedManager()->windowScreenDidChange(displayID, this);
#else
UNUSED_PARAM(displayID);
-#endif
+#endif
}
void ScriptedAnimationController::scheduleAnimation()
@@ -166,14 +163,14 @@ void ScriptedAnimationController::scheduleAnimation()
if (!m_useTimer) {
if (DisplayRefreshMonitorManager::sharedManager()->scheduleAnimation(this))
return;
-
+
m_useTimer = true;
}
#endif
if (m_animationTimer.isActive())
return;
-
- double scheduleDelay = max<double>(MinimumAnimationInterval - (monotonicallyIncreasingTime() - m_lastAnimationFrameTimeMonotonic), 0);
+
+ double scheduleDelay = max<double>(MinimumAnimationInterval - (currentTime() - m_lastAnimationFrameTime), 0);
m_animationTimer.startOneShot(scheduleDelay);
#else
if (FrameView* frameView = m_document->view())
@@ -184,19 +181,12 @@ void ScriptedAnimationController::scheduleAnimation()
#if USE(REQUEST_ANIMATION_FRAME_TIMER)
void ScriptedAnimationController::animationTimerFired(Timer<ScriptedAnimationController>*)
{
- m_lastAnimationFrameTimeMonotonic = monotonicallyIncreasingTime();
- serviceScriptedAnimations(m_lastAnimationFrameTimeMonotonic);
-}
-#if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
-void ScriptedAnimationController::displayRefreshFired(double monotonicTimeNow)
-{
- serviceScriptedAnimations(monotonicTimeNow);
+ m_lastAnimationFrameTime = currentTime();
+ serviceScriptedAnimations(convertSecondsToDOMTimeStamp(m_lastAnimationFrameTime));
}
#endif
-#endif
-
-
}
#endif
+
diff --git a/Source/WebCore/dom/ScriptedAnimationController.h b/Source/WebCore/dom/ScriptedAnimationController.h
index 450a87b46..51c36b994 100644
--- a/Source/WebCore/dom/ScriptedAnimationController.h
+++ b/Source/WebCore/dom/ScriptedAnimationController.h
@@ -61,7 +61,7 @@ public:
CallbackId registerCallback(PassRefPtr<RequestAnimationFrameCallback>);
void cancelCallback(CallbackId);
- void serviceScriptedAnimations(double monotonicTimeNow);
+ void serviceScriptedAnimations(DOMTimeStamp);
void suspend();
void resume();
@@ -70,7 +70,7 @@ public:
private:
ScriptedAnimationController(Document*, PlatformDisplayID);
-
+
typedef Vector<RefPtr<RequestAnimationFrameCallback> > CallbackList;
CallbackList m_callbacks;
@@ -83,11 +83,11 @@ private:
#if USE(REQUEST_ANIMATION_FRAME_TIMER)
void animationTimerFired(Timer<ScriptedAnimationController>*);
Timer<ScriptedAnimationController> m_animationTimer;
- double m_lastAnimationFrameTimeMonotonic;
+ double m_lastAnimationFrameTime;
#if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
// Override for DisplayRefreshMonitorClient
- virtual void displayRefreshFired(double timestamp);
+ virtual void displayRefreshFired(double timestamp) { serviceScriptedAnimations(convertSecondsToDOMTimeStamp(timestamp)); }
bool m_useTimer;
#endif
@@ -99,3 +99,4 @@ private:
#endif // ENABLE(REQUEST_ANIMATION_FRAME)
#endif // ScriptedAnimationController_h
+
diff --git a/Source/WebCore/dom/ShadowRoot.cpp b/Source/WebCore/dom/ShadowRoot.cpp
index 772613f71..7b246c0b1 100644
--- a/Source/WebCore/dom/ShadowRoot.cpp
+++ b/Source/WebCore/dom/ShadowRoot.cpp
@@ -49,7 +49,7 @@ ShadowRoot::ShadowRoot(Document* document)
, TreeScope(this)
, m_prev(0)
, m_next(0)
- , m_applyAuthorSheets(false)
+ , m_applyAuthorStyles(false)
, m_insertionPointAssignedTo(0)
{
ASSERT(document);
@@ -122,7 +122,7 @@ PassRefPtr<ShadowRoot> ShadowRoot::create(Element* element, ShadowRootCreationPu
if (ec)
return 0;
ASSERT(element == shadowRoot->host());
- ASSERT(element->hasShadowRoot());
+ ASSERT(element->shadow());
return shadowRoot.release();
}
@@ -188,14 +188,14 @@ bool ShadowRoot::hasInsertionPoint() const
return false;
}
-bool ShadowRoot::applyAuthorSheets() const
+bool ShadowRoot::applyAuthorStyles() const
{
- return m_applyAuthorSheets;
+ return m_applyAuthorStyles;
}
-void ShadowRoot::setApplyAuthorSheets(bool value)
+void ShadowRoot::setApplyAuthorStyles(bool value)
{
- m_applyAuthorSheets = value;
+ m_applyAuthorStyles = value;
}
void ShadowRoot::attach()
diff --git a/Source/WebCore/dom/ShadowRoot.h b/Source/WebCore/dom/ShadowRoot.h
index 68bc47af6..c0024c716 100644
--- a/Source/WebCore/dom/ShadowRoot.h
+++ b/Source/WebCore/dom/ShadowRoot.h
@@ -67,8 +67,8 @@ public:
InsertionPoint* insertionPointFor(Node*) const;
void hostChildrenChanged();
- virtual bool applyAuthorSheets() const;
- void setApplyAuthorSheets(bool);
+ virtual bool applyAuthorStyles() const OVERRIDE;
+ void setApplyAuthorStyles(bool);
Element* host() const { return shadowHost(); }
ElementShadow* owner() const;
@@ -104,7 +104,7 @@ private:
ShadowRoot* m_prev;
ShadowRoot* m_next;
- bool m_applyAuthorSheets : 1;
+ bool m_applyAuthorStyles : 1;
InsertionPoint* m_insertionPointAssignedTo;
};
diff --git a/Source/WebCore/dom/ShadowRoot.idl b/Source/WebCore/dom/ShadowRoot.idl
index 5ee566332..55057b680 100644
--- a/Source/WebCore/dom/ShadowRoot.idl
+++ b/Source/WebCore/dom/ShadowRoot.idl
@@ -35,6 +35,7 @@ module core {
readonly attribute Element host;
readonly attribute Element activeElement;
readonly attribute DOMSelection selection;
+ attribute boolean applyAuthorStyles;
attribute [TreatNullAs=NullString] DOMString innerHTML
setter raises(DOMException);
diff --git a/Source/WebCore/dom/TreeScope.cpp b/Source/WebCore/dom/TreeScope.cpp
index 376fbc3bf..998264532 100644
--- a/Source/WebCore/dom/TreeScope.cpp
+++ b/Source/WebCore/dom/TreeScope.cpp
@@ -139,7 +139,7 @@ Element* TreeScope::findAnchor(const String& name)
return 0;
}
-bool TreeScope::applyAuthorSheets() const
+bool TreeScope::applyAuthorStyles() const
{
return true;
}
diff --git a/Source/WebCore/dom/TreeScope.h b/Source/WebCore/dom/TreeScope.h
index 16cf6644e..76c12e5c9 100644
--- a/Source/WebCore/dom/TreeScope.h
+++ b/Source/WebCore/dom/TreeScope.h
@@ -69,7 +69,7 @@ public:
// quirks mode for historical compatibility reasons.
Element* findAnchor(const String& name);
- virtual bool applyAuthorSheets() const;
+ virtual bool applyAuthorStyles() const;
// Used by the basic DOM mutation methods (e.g., appendChild()).
void adoptIfNeeded(Node*);
diff --git a/Source/WebCore/dom/ViewportArguments.cpp b/Source/WebCore/dom/ViewportArguments.cpp
index 0f329ac31..14e58ef30 100644
--- a/Source/WebCore/dom/ViewportArguments.cpp
+++ b/Source/WebCore/dom/ViewportArguments.cpp
@@ -185,6 +185,19 @@ ViewportAttributes computeViewportAttributes(ViewportArguments args, int desktop
return result;
}
+float computeMinimumScaleFactorForContentContained(const ViewportAttributes& result, const IntSize& viewportSize, const IntSize& contentsSize)
+{
+ float availableWidth = viewportSize.width();
+ float availableHeight = viewportSize.height();
+
+ if (result.devicePixelRatio != 1.0) {
+ availableWidth /= result.devicePixelRatio;
+ availableHeight /= result.devicePixelRatio;
+ }
+
+ return max<float>(result.minimumScale, max(availableWidth / contentsSize.width(), availableHeight / contentsSize.height()));
+}
+
void restrictMinimumScaleFactorToViewportSize(ViewportAttributes& result, IntSize visibleViewport)
{
float availableWidth = visibleViewport.width();
diff --git a/Source/WebCore/dom/ViewportArguments.h b/Source/WebCore/dom/ViewportArguments.h
index 79651d25b..92e3172fa 100644
--- a/Source/WebCore/dom/ViewportArguments.h
+++ b/Source/WebCore/dom/ViewportArguments.h
@@ -109,6 +109,7 @@ struct ViewportArguments {
ViewportAttributes computeViewportAttributes(ViewportArguments args, int desktopWidth, int deviceWidth, int deviceHeight, int deviceDPI, IntSize visibleViewport);
void restrictMinimumScaleFactorToViewportSize(ViewportAttributes& result, IntSize visibleViewport);
void restrictScaleFactorToInitialScaleIfNotUserScalable(ViewportAttributes& result);
+float computeMinimumScaleFactorForContentContained(const ViewportAttributes& result, const IntSize& viewportSize, const IntSize& contentSize);
void setViewportFeature(const String& keyString, const String& valueString, Document*, void* data);
void reportViewportWarning(Document*, ViewportErrorCode, const String& replacement1, const String& replacement2);
diff --git a/Source/WebCore/editing/ApplyStyleCommand.cpp b/Source/WebCore/editing/ApplyStyleCommand.cpp
index 403ca570d..72b8027dd 100644
--- a/Source/WebCore/editing/ApplyStyleCommand.cpp
+++ b/Source/WebCore/editing/ApplyStyleCommand.cpp
@@ -320,12 +320,19 @@ void ApplyStyleCommand::applyRelativeFontStyleChange(EditingStyle* style)
start = startPosition();
end = endPosition();
}
+
+ if (start.isNull() || end.isNull())
+ return;
+
if (end.deprecatedNode()->isTextNode() && start.deprecatedNode()->parentNode() != end.deprecatedNode()->parentNode()) {
joinChildTextNodes(end.deprecatedNode()->parentNode(), start, end);
start = startPosition();
end = endPosition();
}
+ if (start.isNull() || end.isNull())
+ return;
+
// Split the start text nodes if needed to apply style.
if (isValidCaretPositionInTextNode(start)) {
splitTextAtStart(start, end);
@@ -542,6 +549,10 @@ void ApplyStyleCommand::applyInlineStyle(EditingStyle* style)
// adjust to the positions we want to use for applying style
Position start = startPosition();
Position end = endPosition();
+
+ if (start.isNull() || end.isNull())
+ return;
+
if (comparePositions(end, start) < 0) {
Position swap = start;
start = end;
@@ -1427,24 +1438,29 @@ void ApplyStyleCommand::joinChildTextNodes(Node* node, const Position& start, co
Position newStart = start;
Position newEnd = end;
- Node* child = node->firstChild();
- while (child) {
- Node* next = child->nextSibling();
- if (child->isTextNode() && next && next->isTextNode()) {
- Text* childText = toText(child);
- Text* nextText = toText(next);
- if (start.anchorType() == Position::PositionIsOffsetInAnchor && next == start.containerNode())
- newStart = Position(childText, childText->length() + start.offsetInContainerNode());
- if (end.anchorType() == Position::PositionIsOffsetInAnchor && next == end.containerNode())
- newEnd = Position(childText, childText->length() + end.offsetInContainerNode());
- String textToMove = nextText->data();
- insertTextIntoNode(childText, childText->length(), textToMove);
- removeNode(next);
- // don't move child node pointer. it may want to merge with more text nodes.
- }
- else {
- child = child->nextSibling();
- }
+ Vector<RefPtr<Text> > textNodes;
+ for (Node* curr = node->firstChild(); curr; curr = curr->nextSibling()) {
+ if (!curr->isTextNode())
+ continue;
+
+ textNodes.append(toText(curr));
+ }
+
+ for (size_t i = 0; i < textNodes.size(); ++i) {
+ Text* childText = textNodes[i].get();
+ Node* next = childText->nextSibling();
+ if (!next || !next->isTextNode())
+ continue;
+
+ Text* nextText = toText(next);
+ if (start.anchorType() == Position::PositionIsOffsetInAnchor && next == start.containerNode())
+ newStart = Position(childText, childText->length() + start.offsetInContainerNode());
+ if (end.anchorType() == Position::PositionIsOffsetInAnchor && next == end.containerNode())
+ newEnd = Position(childText, childText->length() + end.offsetInContainerNode());
+ String textToMove = nextText->data();
+ insertTextIntoNode(childText, childText->length(), textToMove);
+ removeNode(next);
+ // don't move child node pointer. it may want to merge with more text nodes.
}
updateStartEnd(newStart, newEnd);
diff --git a/Source/WebCore/editing/CompositeEditCommand.cpp b/Source/WebCore/editing/CompositeEditCommand.cpp
index 8f112c067..1743713bf 100644
--- a/Source/WebCore/editing/CompositeEditCommand.cpp
+++ b/Source/WebCore/editing/CompositeEditCommand.cpp
@@ -553,16 +553,16 @@ void CompositeEditCommand::insertNodeAtTabSpanPosition(PassRefPtr<Node> node, co
insertNodeAt(node, positionOutsideTabSpan(pos));
}
-void CompositeEditCommand::deleteSelection(bool smartDelete, bool mergeBlocksAfterDelete, bool replace, bool expandForSpecialElements)
+void CompositeEditCommand::deleteSelection(bool smartDelete, bool mergeBlocksAfterDelete, bool replace, bool expandForSpecialElements, bool sanitizeMarkup)
{
if (endingSelection().isRange())
- applyCommandToComposite(DeleteSelectionCommand::create(document(), smartDelete, mergeBlocksAfterDelete, replace, expandForSpecialElements));
+ applyCommandToComposite(DeleteSelectionCommand::create(document(), smartDelete, mergeBlocksAfterDelete, replace, expandForSpecialElements, sanitizeMarkup));
}
-void CompositeEditCommand::deleteSelection(const VisibleSelection &selection, bool smartDelete, bool mergeBlocksAfterDelete, bool replace, bool expandForSpecialElements)
+void CompositeEditCommand::deleteSelection(const VisibleSelection &selection, bool smartDelete, bool mergeBlocksAfterDelete, bool replace, bool expandForSpecialElements, bool sanitizeMarkup)
{
if (selection.isRange())
- applyCommandToComposite(DeleteSelectionCommand::create(selection, smartDelete, mergeBlocksAfterDelete, replace, expandForSpecialElements));
+ applyCommandToComposite(DeleteSelectionCommand::create(selection, smartDelete, mergeBlocksAfterDelete, replace, expandForSpecialElements, sanitizeMarkup));
}
void CompositeEditCommand::removeCSSProperty(PassRefPtr<StyledElement> element, CSSPropertyID property)
diff --git a/Source/WebCore/editing/CompositeEditCommand.h b/Source/WebCore/editing/CompositeEditCommand.h
index 7384cac36..900e52b16 100644
--- a/Source/WebCore/editing/CompositeEditCommand.h
+++ b/Source/WebCore/editing/CompositeEditCommand.h
@@ -101,8 +101,8 @@ protected:
void applyStyle(const EditingStyle*, const Position& start, const Position& end, EditAction = EditActionChangeAttributes);
void applyStyledElement(PassRefPtr<Element>);
void removeStyledElement(PassRefPtr<Element>);
- void deleteSelection(bool smartDelete = false, bool mergeBlocksAfterDelete = true, bool replace = false, bool expandForSpecialElements = true);
- void deleteSelection(const VisibleSelection&, bool smartDelete = false, bool mergeBlocksAfterDelete = true, bool replace = false, bool expandForSpecialElements = true);
+ void deleteSelection(bool smartDelete = false, bool mergeBlocksAfterDelete = true, bool replace = false, bool expandForSpecialElements = true, bool sanitizeMarkup = true);
+ void deleteSelection(const VisibleSelection&, bool smartDelete = false, bool mergeBlocksAfterDelete = true, bool replace = false, bool expandForSpecialElements = true, bool sanitizeMarkup = true);
virtual void deleteTextFromNode(PassRefPtr<Text>, unsigned offset, unsigned count);
bool isRemovableBlock(const Node*);
void insertNodeAfter(PassRefPtr<Node>, PassRefPtr<Node> refChild);
diff --git a/Source/WebCore/editing/DeleteSelectionCommand.cpp b/Source/WebCore/editing/DeleteSelectionCommand.cpp
index 227235edf..4b07363d6 100644
--- a/Source/WebCore/editing/DeleteSelectionCommand.cpp
+++ b/Source/WebCore/editing/DeleteSelectionCommand.cpp
@@ -68,7 +68,7 @@ static bool isTableRowEmpty(Node* row)
return true;
}
-DeleteSelectionCommand::DeleteSelectionCommand(Document *document, bool smartDelete, bool mergeBlocksAfterDelete, bool replace, bool expandForSpecialElements)
+DeleteSelectionCommand::DeleteSelectionCommand(Document *document, bool smartDelete, bool mergeBlocksAfterDelete, bool replace, bool expandForSpecialElements, bool sanitizeMarkup)
: CompositeEditCommand(document)
, m_hasSelectionToDelete(false)
, m_smartDelete(smartDelete)
@@ -78,6 +78,7 @@ DeleteSelectionCommand::DeleteSelectionCommand(Document *document, bool smartDel
, m_expandForSpecialElements(expandForSpecialElements)
, m_pruneStartBlockIfNecessary(false)
, m_startsAtEmptyLine(false)
+ , m_sanitizeMarkup(sanitizeMarkup)
, m_startBlock(0)
, m_endBlock(0)
, m_typingStyle(0)
@@ -85,7 +86,7 @@ DeleteSelectionCommand::DeleteSelectionCommand(Document *document, bool smartDel
{
}
-DeleteSelectionCommand::DeleteSelectionCommand(const VisibleSelection& selection, bool smartDelete, bool mergeBlocksAfterDelete, bool replace, bool expandForSpecialElements)
+DeleteSelectionCommand::DeleteSelectionCommand(const VisibleSelection& selection, bool smartDelete, bool mergeBlocksAfterDelete, bool replace, bool expandForSpecialElements, bool sanitizeMarkup)
: CompositeEditCommand(selection.start().anchorNode()->document())
, m_hasSelectionToDelete(true)
, m_smartDelete(smartDelete)
@@ -95,6 +96,7 @@ DeleteSelectionCommand::DeleteSelectionCommand(const VisibleSelection& selection
, m_expandForSpecialElements(expandForSpecialElements)
, m_pruneStartBlockIfNecessary(false)
, m_startsAtEmptyLine(false)
+ , m_sanitizeMarkup(sanitizeMarkup)
, m_selectionToDelete(selection)
, m_startBlock(0)
, m_endBlock(0)
@@ -579,7 +581,7 @@ void DeleteSelectionCommand::mergeParagraphs()
// m_downstreamEnd's block has been emptied out by deletion. There is no content inside of it to
// move, so just remove it.
- Element* endBlock = static_cast<Element*>(enclosingBlock(m_downstreamEnd.deprecatedNode()));
+ Element* endBlock = enclosingBlock(m_downstreamEnd.deprecatedNode());
if (!endBlock || !endBlock->contains(startOfParagraphToMove.deepEquivalent().deprecatedNode()) || !startOfParagraphToMove.deepEquivalent().deprecatedNode()) {
removeNode(enclosingBlock(m_downstreamEnd.deprecatedNode()));
return;
@@ -814,7 +816,8 @@ void DeleteSelectionCommand::doApply()
RefPtr<Node> placeholder = m_needPlaceholder ? createBreakElement(document()).get() : 0;
if (placeholder) {
- removeRedundantBlocks();
+ if (m_sanitizeMarkup)
+ removeRedundantBlocks();
insertNodeAt(placeholder.get(), m_endingPosition);
}
diff --git a/Source/WebCore/editing/DeleteSelectionCommand.h b/Source/WebCore/editing/DeleteSelectionCommand.h
index d1eafde81..4d3db5f35 100644
--- a/Source/WebCore/editing/DeleteSelectionCommand.h
+++ b/Source/WebCore/editing/DeleteSelectionCommand.h
@@ -34,18 +34,18 @@ class EditingStyle;
class DeleteSelectionCommand : public CompositeEditCommand {
public:
- static PassRefPtr<DeleteSelectionCommand> create(Document* document, bool smartDelete = false, bool mergeBlocksAfterDelete = true, bool replace = false, bool expandForSpecialElements = false)
+ static PassRefPtr<DeleteSelectionCommand> create(Document* document, bool smartDelete = false, bool mergeBlocksAfterDelete = true, bool replace = false, bool expandForSpecialElements = false, bool sanitizeMarkup = true)
{
- return adoptRef(new DeleteSelectionCommand(document, smartDelete, mergeBlocksAfterDelete, replace, expandForSpecialElements));
+ return adoptRef(new DeleteSelectionCommand(document, smartDelete, mergeBlocksAfterDelete, replace, expandForSpecialElements, sanitizeMarkup));
}
- static PassRefPtr<DeleteSelectionCommand> create(const VisibleSelection& selection, bool smartDelete = false, bool mergeBlocksAfterDelete = true, bool replace = false, bool expandForSpecialElements = false)
+ static PassRefPtr<DeleteSelectionCommand> create(const VisibleSelection& selection, bool smartDelete = false, bool mergeBlocksAfterDelete = true, bool replace = false, bool expandForSpecialElements = false, bool sanitizeMarkup = true)
{
- return adoptRef(new DeleteSelectionCommand(selection, smartDelete, mergeBlocksAfterDelete, replace, expandForSpecialElements));
+ return adoptRef(new DeleteSelectionCommand(selection, smartDelete, mergeBlocksAfterDelete, replace, expandForSpecialElements, sanitizeMarkup));
}
private:
- DeleteSelectionCommand(Document*, bool smartDelete, bool mergeBlocksAfterDelete, bool replace, bool expandForSpecialElements);
- DeleteSelectionCommand(const VisibleSelection&, bool smartDelete, bool mergeBlocksAfterDelete, bool replace, bool expandForSpecialElements);
+ DeleteSelectionCommand(Document*, bool smartDelete, bool mergeBlocksAfterDelete, bool replace, bool expandForSpecialElements, bool santizeMarkup);
+ DeleteSelectionCommand(const VisibleSelection&, bool smartDelete, bool mergeBlocksAfterDelete, bool replace, bool expandForSpecialElements, bool sanitizeMarkup);
virtual void doApply();
virtual EditAction editingAction() const;
@@ -80,6 +80,7 @@ private:
bool m_expandForSpecialElements;
bool m_pruneStartBlockIfNecessary;
bool m_startsAtEmptyLine;
+ bool m_sanitizeMarkup;
// This data is transient and should be cleared at the end of the doApply function.
VisibleSelection m_selectionToDelete;
diff --git a/Source/WebCore/editing/IndentOutdentCommand.cpp b/Source/WebCore/editing/IndentOutdentCommand.cpp
index f0c413b9c..63034a8af 100644
--- a/Source/WebCore/editing/IndentOutdentCommand.cpp
+++ b/Source/WebCore/editing/IndentOutdentCommand.cpp
@@ -65,7 +65,7 @@ bool IndentOutdentCommand::tryIndentingAsListItem(const Position& start, const P
return false;
// Find the block that we want to indent. If it's not a list item (e.g., a div inside a list item), we bail out.
- Element* selectedListItem = static_cast<Element*>(enclosingBlock(lastNodeInSelectedParagraph));
+ Element* selectedListItem = enclosingBlock(lastNodeInSelectedParagraph);
// FIXME: we need to deal with the case where there is no li (malformed HTML)
if (!selectedListItem->hasTagName(liTag))
diff --git a/Source/WebCore/editing/InsertParagraphSeparatorCommand.cpp b/Source/WebCore/editing/InsertParagraphSeparatorCommand.cpp
index 0f12dce37..6531bf367 100644
--- a/Source/WebCore/editing/InsertParagraphSeparatorCommand.cpp
+++ b/Source/WebCore/editing/InsertParagraphSeparatorCommand.cpp
@@ -164,17 +164,15 @@ void InsertParagraphSeparatorCommand::doApply()
}
// FIXME: The parentAnchoredEquivalent conversion needs to be moved into enclosingBlock.
- Node* startBlockNode = enclosingBlock(insertionPosition.parentAnchoredEquivalent().containerNode());
+ RefPtr<Element> startBlock = enclosingBlock(insertionPosition.parentAnchoredEquivalent().containerNode());
Position canonicalPos = VisiblePosition(insertionPosition).deepEquivalent();
- Element* startBlock = static_cast<Element*>(startBlockNode);
- if (!startBlockNode
- || !startBlockNode->isElementNode()
- || !startBlock->nonShadowBoundaryParentNode()
- || isTableCell(startBlock)
- || startBlock->hasTagName(formTag)
- // FIXME: If the node is hidden, we don't have a canonical position so we will do the wrong thing for tables and <hr>. https://bugs.webkit.org/show_bug.cgi?id=40342
- || (!canonicalPos.isNull() && canonicalPos.deprecatedNode()->renderer() && canonicalPos.deprecatedNode()->renderer()->isTable())
- || (!canonicalPos.isNull() && canonicalPos.deprecatedNode()->hasTagName(hrTag))) {
+ if (!startBlock
+ || !startBlock->nonShadowBoundaryParentNode()
+ || isTableCell(startBlock.get())
+ || startBlock->hasTagName(formTag)
+ // FIXME: If the node is hidden, we don't have a canonical position so we will do the wrong thing for tables and <hr>. https://bugs.webkit.org/show_bug.cgi?id=40342
+ || (!canonicalPos.isNull() && canonicalPos.deprecatedNode()->renderer() && canonicalPos.deprecatedNode()->renderer()->isTable())
+ || (!canonicalPos.isNull() && canonicalPos.deprecatedNode()->hasTagName(hrTag))) {
applyCommandToComposite(InsertLineBreakCommand::create(document()));
return;
}
@@ -206,7 +204,7 @@ void InsertParagraphSeparatorCommand::doApply()
if (startBlock == startBlock->rootEditableElement()) {
blockToInsert = createDefaultParagraphElement(document());
nestNewBlock = true;
- } else if (shouldUseDefaultParagraphElement(startBlock))
+ } else if (shouldUseDefaultParagraphElement(startBlock.get()))
blockToInsert = createDefaultParagraphElement(document());
else
blockToInsert = startBlock->cloneElementWithoutChildren();
@@ -234,16 +232,16 @@ void InsertParagraphSeparatorCommand::doApply()
// Most of the time we want to stay at the nesting level of the startBlock (e.g., when nesting within lists). However,
// for div nodes, this can result in nested div tags that are hard to break out of.
- Element* siblingNode = startBlock;
+ Element* siblingNode = startBlock.get();
if (blockToInsert->hasTagName(divTag))
- siblingNode = highestVisuallyEquivalentDivBelowRoot(startBlock);
+ siblingNode = highestVisuallyEquivalentDivBelowRoot(startBlock.get());
insertNodeAfter(blockToInsert, siblingNode);
}
// Recreate the same structure in the new paragraph.
Vector<Element*> ancestors;
- getAncestorsInsideBlock(positionOutsideTabSpan(insertionPosition).deprecatedNode(), startBlock, ancestors);
+ getAncestorsInsideBlock(positionOutsideTabSpan(insertionPosition).deprecatedNode(), startBlock.get(), ancestors);
RefPtr<Element> parent = cloneHierarchyUnderNewBlock(ancestors, blockToInsert);
appendBlockPlaceholder(parent);
@@ -262,7 +260,7 @@ void InsertParagraphSeparatorCommand::doApply()
insertionPosition = positionOutsideTabSpan(insertionPosition);
if (isFirstInBlock && !nestNewBlock)
- refNode = startBlock;
+ refNode = startBlock.get();
else if (isFirstInBlock && nestNewBlock) {
// startBlock should always have children, otherwise isLastInBlock would be true and it's handled above.
ASSERT(startBlock->firstChild());
@@ -282,7 +280,7 @@ void InsertParagraphSeparatorCommand::doApply()
// Recreate the same structure in the new paragraph.
Vector<Element*> ancestors;
- getAncestorsInsideBlock(positionAvoidingSpecialElementBoundary(positionOutsideTabSpan(insertionPosition)).deprecatedNode(), startBlock, ancestors);
+ getAncestorsInsideBlock(positionAvoidingSpecialElementBoundary(positionOutsideTabSpan(insertionPosition)).deprecatedNode(), startBlock.get(), ancestors);
appendBlockPlaceholder(cloneHierarchyUnderNewBlock(ancestors, blockToInsert));
@@ -342,6 +340,10 @@ void InsertParagraphSeparatorCommand::doApply()
}
}
+ // If we got detached due to mutation events, just bail out.
+ if (!startBlock->parentNode())
+ return;
+
// Put the added block in the tree.
if (nestNewBlock)
appendNode(blockToInsert.get(), startBlock);
@@ -364,9 +366,9 @@ void InsertParagraphSeparatorCommand::doApply()
else {
Node* splitTo = insertionPosition.containerNode();
if (splitTo->isTextNode() && insertionPosition.offsetInContainerNode() >= caretMaxOffset(splitTo))
- splitTo = splitTo->traverseNextNode(startBlock);
+ splitTo = splitTo->traverseNextNode(startBlock.get());
ASSERT(splitTo);
- splitTreeToNode(splitTo, startBlock);
+ splitTreeToNode(splitTo, startBlock.get());
for (n = startBlock->firstChild(); n; n = n->nextSibling()) {
if (comparePositions(VisiblePosition(insertionPosition), positionBeforeNode(n)) <= 0)
@@ -397,7 +399,7 @@ void InsertParagraphSeparatorCommand::doApply()
}
setEndingSelection(VisibleSelection(firstPositionInNode(blockToInsert.get()), DOWNSTREAM, endingSelection().isDirectional()));
- applyStyleAfterInsertion(startBlock);
+ applyStyleAfterInsertion(startBlock.get());
}
} // namespace WebCore
diff --git a/Source/WebCore/editing/InsertTextCommand.cpp b/Source/WebCore/editing/InsertTextCommand.cpp
index cf2497fd2..ac5b6ef94 100644
--- a/Source/WebCore/editing/InsertTextCommand.cpp
+++ b/Source/WebCore/editing/InsertTextCommand.cpp
@@ -116,7 +116,7 @@ void InsertTextCommand::doApply()
if (endingSelection().isRange()) {
if (performTrivialReplace(m_text, m_selectInsertedText))
return;
- deleteSelection(false, true, true, false);
+ deleteSelection(false, true, true, false, false);
// deleteSelection eventually makes a new endingSelection out of a Position. If that Position doesn't have
// a renderer (e.g. it is on a <frameset> in the DOM), the VisibleSelection cannot be canonicalized to
// anything other than NoSelection. The rest of this function requires a real endingSelection, so bail out.
diff --git a/Source/WebCore/editing/MarkupAccumulator.cpp b/Source/WebCore/editing/MarkupAccumulator.cpp
index 15752bcba..3734b5e20 100644
--- a/Source/WebCore/editing/MarkupAccumulator.cpp
+++ b/Source/WebCore/editing/MarkupAccumulator.cpp
@@ -86,14 +86,26 @@ MarkupAccumulator::~MarkupAccumulator()
String MarkupAccumulator::serializeNodes(Node* targetNode, Node* nodeToSkip, EChildrenOnly childrenOnly)
{
- serializeNodesWithNamespaces(targetNode, nodeToSkip, childrenOnly, 0);
+ return serializeNodes(targetNode, nodeToSkip, childrenOnly, 0);
+}
+
+String MarkupAccumulator::serializeNodes(Node* targetNode, Node* nodeToSkip, EChildrenOnly childrenOnly, Vector<QualifiedName>* tagNamesToSkip)
+{
+ serializeNodesWithNamespaces(targetNode, nodeToSkip, childrenOnly, 0, tagNamesToSkip);
return m_markup.toString();
}
-void MarkupAccumulator::serializeNodesWithNamespaces(Node* targetNode, Node* nodeToSkip, EChildrenOnly childrenOnly, const Namespaces* namespaces)
+void MarkupAccumulator::serializeNodesWithNamespaces(Node* targetNode, Node* nodeToSkip, EChildrenOnly childrenOnly, const Namespaces* namespaces, Vector<QualifiedName>* tagNamesToSkip)
{
if (targetNode == nodeToSkip)
return;
+
+ if (tagNamesToSkip) {
+ for (size_t i = 0; i < tagNamesToSkip->size(); ++i) {
+ if (targetNode->hasTagName(tagNamesToSkip->at(i)))
+ return;
+ }
+ }
Namespaces namespaceHash;
if (namespaces)
@@ -104,7 +116,7 @@ void MarkupAccumulator::serializeNodesWithNamespaces(Node* targetNode, Node* nod
if (!(targetNode->document()->isHTMLDocument() && elementCannotHaveEndTag(targetNode))) {
for (Node* current = targetNode->firstChild(); current; current = current->nextSibling())
- serializeNodesWithNamespaces(current, nodeToSkip, IncludeNode, &namespaceHash);
+ serializeNodesWithNamespaces(current, nodeToSkip, IncludeNode, &namespaceHash, tagNamesToSkip);
}
if (!childrenOnly)
@@ -170,7 +182,7 @@ void MarkupAccumulator::appendCustomAttributes(StringBuilder&, Element*, Namespa
void MarkupAccumulator::appendQuotedURLAttributeValue(StringBuilder& result, const Element* element, const Attribute& attribute)
{
- ASSERT(element->isURLAttribute(const_cast<Attribute*>(&attribute)));
+ ASSERT(element->isURLAttribute(attribute));
const String resolvedURLString = resolveURLIfNeeded(element, attribute.value());
UChar quoteChar = '"';
String strippedURLString = resolvedURLString.stripWhiteSpace();
@@ -419,7 +431,7 @@ void MarkupAccumulator::appendAttribute(StringBuilder& result, Element* element,
result.append('=');
- if (element->isURLAttribute(const_cast<Attribute*>(&attribute)))
+ if (element->isURLAttribute(attribute))
appendQuotedURLAttributeValue(result, element, attribute);
else {
result.append('"');
diff --git a/Source/WebCore/editing/MarkupAccumulator.h b/Source/WebCore/editing/MarkupAccumulator.h
index 367b79fa6..4de18328b 100644
--- a/Source/WebCore/editing/MarkupAccumulator.h
+++ b/Source/WebCore/editing/MarkupAccumulator.h
@@ -71,6 +71,7 @@ public:
virtual ~MarkupAccumulator();
String serializeNodes(Node* targetNode, Node* nodeToSkip, EChildrenOnly);
+ String serializeNodes(Node* targetNode, Node* nodeToSkip, EChildrenOnly, Vector<QualifiedName>* tagNamesToSkip);
static void appendComment(StringBuilder&, const String&);
@@ -108,7 +109,7 @@ protected:
private:
String resolveURLIfNeeded(const Element*, const String&) const;
void appendQuotedURLAttributeValue(StringBuilder&, const Element*, const Attribute&);
- void serializeNodesWithNamespaces(Node* targetNode, Node* nodeToSkip, EChildrenOnly, const Namespaces*);
+ void serializeNodesWithNamespaces(Node* targetNode, Node* nodeToSkip, EChildrenOnly, const Namespaces*, Vector<QualifiedName>* tagNamesToSkip);
StringBuilder m_markup;
const EAbsoluteURLs m_resolveURLsMethod;
diff --git a/Source/WebCore/editing/ReplaceNodeWithSpanCommand.cpp b/Source/WebCore/editing/ReplaceNodeWithSpanCommand.cpp
index 17a709dd9..1ef83d4d9 100644
--- a/Source/WebCore/editing/ReplaceNodeWithSpanCommand.cpp
+++ b/Source/WebCore/editing/ReplaceNodeWithSpanCommand.cpp
@@ -56,10 +56,10 @@ static void swapInNodePreservingAttributesAndChildren(HTMLElement* newNode, HTML
parentNode->insertBefore(newNode, nodeToReplace, ec);
ASSERT(!ec);
- RefPtr<Node> nextChild;
- for (Node* child = nodeToReplace->firstChild(); child; child = nextChild.get()) {
- nextChild = child->nextSibling();
- newNode->appendChild(child, ec);
+ NodeVector children;
+ getChildNodes(nodeToReplace, children);
+ for (size_t i = 0; i < children.size(); ++i) {
+ newNode->appendChild(children[i], ec);
ASSERT(!ec);
}
diff --git a/Source/WebCore/editing/ReplaceSelectionCommand.cpp b/Source/WebCore/editing/ReplaceSelectionCommand.cpp
index 2c699fe67..75f4434f3 100644
--- a/Source/WebCore/editing/ReplaceSelectionCommand.cpp
+++ b/Source/WebCore/editing/ReplaceSelectionCommand.cpp
@@ -1299,7 +1299,7 @@ bool ReplaceSelectionCommand::performTrivialReplace(const ReplacementFragment& f
if (nodeToSplitToAvoidPastingIntoInlineNodesWithStyle(endingSelection().start()))
return false;
- Node* nodeAfterInsertionPos = endingSelection().end().downstream().anchorNode();
+ RefPtr<Node> nodeAfterInsertionPos = endingSelection().end().downstream().anchorNode();
Text* textNode = toText(fragment.firstChild());
// Our fragment creation code handles tabs, spaces, and newlines, so we don't have to worry about those here.
@@ -1308,8 +1308,9 @@ bool ReplaceSelectionCommand::performTrivialReplace(const ReplacementFragment& f
if (end.isNull())
return false;
- if (nodeAfterInsertionPos && nodeAfterInsertionPos->hasTagName(brTag) && shouldRemoveEndBR(nodeAfterInsertionPos, positionBeforeNode(nodeAfterInsertionPos)))
- removeNodeAndPruneAncestors(nodeAfterInsertionPos);
+ if (nodeAfterInsertionPos && nodeAfterInsertionPos->parentNode() && nodeAfterInsertionPos->hasTagName(brTag)
+ && shouldRemoveEndBR(nodeAfterInsertionPos.get(), positionBeforeNode(nodeAfterInsertionPos.get())))
+ removeNodeAndPruneAncestors(nodeAfterInsertionPos.get());
VisibleSelection selectionAfterReplace(m_selectReplacement ? start : end, end);
diff --git a/Source/WebCore/editing/htmlediting.cpp b/Source/WebCore/editing/htmlediting.cpp
index f4d91e9ce..3b1d44c02 100644
--- a/Source/WebCore/editing/htmlediting.cpp
+++ b/Source/WebCore/editing/htmlediting.cpp
@@ -310,9 +310,10 @@ bool isInline(const Node* node)
// FIXME: Pass a position to this function. The enclosing block of [table, x] for example, should be the
// block that contains the table and not the table, and this function should be the only one responsible for
// knowing about these kinds of special cases.
-Node* enclosingBlock(Node* node, EditingBoundaryCrossingRule rule)
+Element* enclosingBlock(Node* node, EditingBoundaryCrossingRule rule)
{
- return static_cast<Element*>(enclosingNodeOfType(firstPositionInOrBeforeNode(node), isBlock, rule));
+ Node* enclosingNode = enclosingNodeOfType(firstPositionInOrBeforeNode(node), isBlock, rule);
+ return enclosingNode && enclosingNode->isElementNode() ? toElement(enclosingNode) : 0;
}
TextDirection directionOfEnclosingBlock(const Position& position)
diff --git a/Source/WebCore/editing/htmlediting.h b/Source/WebCore/editing/htmlediting.h
index abb49e312..c2cf4563b 100644
--- a/Source/WebCore/editing/htmlediting.h
+++ b/Source/WebCore/editing/htmlediting.h
@@ -61,7 +61,7 @@ Node* highestEnclosingNodeOfType(const Position&, bool (*nodeIsOfType)(const Nod
Node* highestNodeToRemoveInPruning(Node*);
Node* lowestEditableAncestor(Node*);
-Node* enclosingBlock(Node*, EditingBoundaryCrossingRule = CannotCrossEditingBoundary);
+Element* enclosingBlock(Node*, EditingBoundaryCrossingRule = CannotCrossEditingBoundary);
Node* enclosingTableCell(const Position&);
Node* enclosingEmptyListItem(const VisiblePosition&);
Node* enclosingAnchorElement(const Position&);
diff --git a/Source/WebCore/editing/markup.cpp b/Source/WebCore/editing/markup.cpp
index bb49b372f..a1c5a3362 100644
--- a/Source/WebCore/editing/markup.cpp
+++ b/Source/WebCore/editing/markup.cpp
@@ -110,7 +110,7 @@ static void completeURLs(Node* node, const String& baseURL)
unsigned length = e->attributeCount();
for (unsigned i = 0; i < length; i++) {
Attribute* attribute = e->attributeItem(i);
- if (e->isURLAttribute(attribute))
+ if (e->isURLAttribute(*attribute))
changes.append(AttributeChange(e, attribute->name(), KURL(parsedBaseURL, attribute->value()).string()));
}
}
@@ -759,7 +759,7 @@ PassRefPtr<DocumentFragment> createFragmentFromMarkupWithContext(Document* docum
return fragment;
}
-String createMarkup(const Node* node, EChildrenOnly childrenOnly, Vector<Node*>* nodes, EAbsoluteURLs shouldResolveURLs)
+String createMarkup(const Node* node, EChildrenOnly childrenOnly, Vector<Node*>* nodes, EAbsoluteURLs shouldResolveURLs, Vector<QualifiedName>* tagNamesToSkip)
{
if (!node)
return "";
@@ -772,7 +772,7 @@ String createMarkup(const Node* node, EChildrenOnly childrenOnly, Vector<Node*>*
}
MarkupAccumulator accumulator(nodes, shouldResolveURLs);
- return accumulator.serializeNodes(const_cast<Node*>(node), deleteButtonContainerElement, childrenOnly);
+ return accumulator.serializeNodes(const_cast<Node*>(node), deleteButtonContainerElement, childrenOnly, tagNamesToSkip);
}
static void fillContainerFromString(ContainerNode* paragraph, const String& string)
diff --git a/Source/WebCore/editing/markup.h b/Source/WebCore/editing/markup.h
index 918ae9b13..625fd6eb4 100644
--- a/Source/WebCore/editing/markup.h
+++ b/Source/WebCore/editing/markup.h
@@ -39,6 +39,7 @@ namespace WebCore {
class Element;
class KURL;
class Node;
+ class QualifiedName;
class Range;
typedef int ExceptionCode;
@@ -60,7 +61,7 @@ namespace WebCore {
String createMarkup(const Range*,
Vector<Node*>* = 0, EAnnotateForInterchange = DoNotAnnotateForInterchange, bool convertBlocksToInlines = false, EAbsoluteURLs = DoNotResolveURLs);
- String createMarkup(const Node*, EChildrenOnly = IncludeNode, Vector<Node*>* = 0, EAbsoluteURLs = DoNotResolveURLs);
+ String createMarkup(const Node*, EChildrenOnly = IncludeNode, Vector<Node*>* = 0, EAbsoluteURLs = DoNotResolveURLs, Vector<QualifiedName>* tagNamesToSkip = 0);
String createFullMarkup(const Node*);
String createFullMarkup(const Range*);
diff --git a/Source/WebCore/gyp/copy-inspector-resources.sh b/Source/WebCore/gyp/copy-inspector-resources.sh
index 97956245a..6d304ca6b 100755
--- a/Source/WebCore/gyp/copy-inspector-resources.sh
+++ b/Source/WebCore/gyp/copy-inspector-resources.sh
@@ -2,7 +2,7 @@
# Copy all the Inspector front-end resources.
ditto "${SRCROOT}/../inspector/front-end" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/inspector"
-ditto "${BUILT_PRODUCTS_DIR}/DerivedSources/WebCore/InspectorBackendStub.js" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/inspector"
+ditto "${BUILT_PRODUCTS_DIR}/DerivedSources/WebCore/InspectorBackendCommands.js" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/inspector"
# Remove the WebKit.qrc file since it is not used on the Mac (this file is for Qt).
rm -f "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/inspector/WebKit.qrc"
diff --git a/Source/WebCore/history/CachedFrame.cpp b/Source/WebCore/history/CachedFrame.cpp
index 3c30b4086..87d4af1ad 100644
--- a/Source/WebCore/history/CachedFrame.cpp
+++ b/Source/WebCore/history/CachedFrame.cpp
@@ -250,6 +250,8 @@ void CachedFrame::destroy()
ASSERT(m_view);
ASSERT(m_document->frame() == m_view->frame());
+ m_domWindow->willDestroyCachedFrame();
+
if (!m_isMainFrame) {
m_view->frame()->detachFromPage();
m_view->frame()->loader()->detachViewsAndDocumentLoader();
diff --git a/Source/WebCore/history/HistoryItem.cpp b/Source/WebCore/history/HistoryItem.cpp
index 38cd6268f..fe11eabb1 100644
--- a/Source/WebCore/history/HistoryItem.cpp
+++ b/Source/WebCore/history/HistoryItem.cpp
@@ -61,7 +61,7 @@ void (*notifyHistoryItemChanged)(HistoryItem*) = defaultNotifyHistoryItemChanged
HistoryItem::HistoryItem()
: m_lastVisitedTime(0)
, m_lastVisitWasHTTPNonGet(false)
- , m_pageScaleFactor(1)
+ , m_pageScaleFactor(0)
, m_lastVisitWasFailure(false)
, m_isTargetItem(false)
, m_visitCount(0)
@@ -78,7 +78,7 @@ HistoryItem::HistoryItem(const String& urlString, const String& title, double ti
, m_title(title)
, m_lastVisitedTime(time)
, m_lastVisitWasHTTPNonGet(false)
- , m_pageScaleFactor(1)
+ , m_pageScaleFactor(0)
, m_lastVisitWasFailure(false)
, m_isTargetItem(false)
, m_visitCount(0)
@@ -97,7 +97,7 @@ HistoryItem::HistoryItem(const String& urlString, const String& title, const Str
, m_displayTitle(alternateTitle)
, m_lastVisitedTime(time)
, m_lastVisitWasHTTPNonGet(false)
- , m_pageScaleFactor(1)
+ , m_pageScaleFactor(0)
, m_lastVisitWasFailure(false)
, m_isTargetItem(false)
, m_visitCount(0)
@@ -117,7 +117,7 @@ HistoryItem::HistoryItem(const KURL& url, const String& target, const String& pa
, m_title(title)
, m_lastVisitedTime(0)
, m_lastVisitWasHTTPNonGet(false)
- , m_pageScaleFactor(1)
+ , m_pageScaleFactor(0)
, m_lastVisitWasFailure(false)
, m_isTargetItem(false)
, m_visitCount(0)
diff --git a/Source/WebCore/history/PageCache.cpp b/Source/WebCore/history/PageCache.cpp
index d710a5896..1a4eada19 100644
--- a/Source/WebCore/history/PageCache.cpp
+++ b/Source/WebCore/history/PageCache.cpp
@@ -535,7 +535,6 @@ void PageCache::releaseAutoreleasedPagesNow()
m_autoreleaseTimer.stop();
// Postpone dead pruning until all our resources have gone dead.
- bool pruneWasEnabled = memoryCache()->pruneEnabled();
memoryCache()->setPruneEnabled(false);
CachedPageSet tmp;
@@ -546,10 +545,8 @@ void PageCache::releaseAutoreleasedPagesNow()
(*it)->destroy();
// Now do the prune.
- if (pruneWasEnabled) {
- memoryCache()->setPruneEnabled(true);
- memoryCache()->prune();
- }
+ memoryCache()->setPruneEnabled(true);
+ memoryCache()->prune();
}
void PageCache::autorelease(PassRefPtr<CachedPage> page)
diff --git a/Source/WebCore/html/CollectionType.h b/Source/WebCore/html/CollectionType.h
index 4ed981998..5bed4d89a 100644
--- a/Source/WebCore/html/CollectionType.h
+++ b/Source/WebCore/html/CollectionType.h
@@ -59,6 +59,7 @@ enum CollectionType {
ItemProperties, // Microdata item properties in the document
#endif
+ FormControls,
OtherCollection
};
diff --git a/Source/WebCore/html/ColorInputType.cpp b/Source/WebCore/html/ColorInputType.cpp
index 4eb3922dd..1ececc2b6 100644
--- a/Source/WebCore/html/ColorInputType.cpp
+++ b/Source/WebCore/html/ColorInputType.cpp
@@ -107,7 +107,7 @@ Color ColorInputType::valueAsColor() const
void ColorInputType::createShadowSubtree()
{
- ASSERT(element()->hasShadowRoot());
+ ASSERT(element()->shadow());
Document* document = element()->document();
RefPtr<HTMLDivElement> wrapperElement = HTMLDivElement::create(document);
diff --git a/Source/WebCore/html/DateInputType.cpp b/Source/WebCore/html/DateInputType.cpp
index 9ca981826..7810e96aa 100644
--- a/Source/WebCore/html/DateInputType.cpp
+++ b/Source/WebCore/html/DateInputType.cpp
@@ -106,6 +106,11 @@ bool DateInputType::setMillisecondToDateComponents(double value, DateComponents*
return date->setMillisecondsSinceEpochForDate(value);
}
+bool DateInputType::isDateField() const
+{
+ return true;
+}
+
#if ENABLE(CALENDAR_PICKER)
void DateInputType::createShadowSubtree()
{
diff --git a/Source/WebCore/html/DateInputType.h b/Source/WebCore/html/DateInputType.h
index 692cb7914..d2373a867 100644
--- a/Source/WebCore/html/DateInputType.h
+++ b/Source/WebCore/html/DateInputType.h
@@ -55,6 +55,7 @@ private:
virtual bool parsedStepValueShouldBeInteger() const OVERRIDE;
virtual bool parseToDateComponentsInternal(const UChar*, unsigned length, DateComponents*) const OVERRIDE;
virtual bool setMillisecondToDateComponents(double, DateComponents*) const OVERRIDE;
+ virtual bool isDateField() const OVERRIDE;
#if ENABLE(CALENDAR_PICKER)
virtual void createShadowSubtree() OVERRIDE;
virtual void destroyShadowSubtree() OVERRIDE;
diff --git a/Source/WebCore/html/DateTimeInputType.cpp b/Source/WebCore/html/DateTimeInputType.cpp
index 35695d6a1..09b5bd7f9 100644
--- a/Source/WebCore/html/DateTimeInputType.cpp
+++ b/Source/WebCore/html/DateTimeInputType.cpp
@@ -104,6 +104,11 @@ bool DateTimeInputType::setMillisecondToDateComponents(double value, DateCompone
return date->setMillisecondsSinceEpochForDateTime(value);
}
+bool DateTimeInputType::isDateTimeField() const
+{
+ return true;
+}
+
} // namespace WebCore
#endif
diff --git a/Source/WebCore/html/DateTimeInputType.h b/Source/WebCore/html/DateTimeInputType.h
index 90265e953..e21790edf 100644
--- a/Source/WebCore/html/DateTimeInputType.h
+++ b/Source/WebCore/html/DateTimeInputType.h
@@ -53,6 +53,7 @@ private:
virtual bool scaledStepValueShouldBeInteger() const OVERRIDE;
virtual bool parseToDateComponentsInternal(const UChar*, unsigned length, DateComponents*) const OVERRIDE;
virtual bool setMillisecondToDateComponents(double, DateComponents*) const OVERRIDE;
+ virtual bool isDateTimeField() const OVERRIDE;
};
} // namespace WebCore
diff --git a/Source/WebCore/html/DateTimeLocalInputType.cpp b/Source/WebCore/html/DateTimeLocalInputType.cpp
index e8c1fd602..2a1ad8fbf 100644
--- a/Source/WebCore/html/DateTimeLocalInputType.cpp
+++ b/Source/WebCore/html/DateTimeLocalInputType.cpp
@@ -110,6 +110,11 @@ bool DateTimeLocalInputType::setMillisecondToDateComponents(double value, DateCo
return date->setMillisecondsSinceEpochForDateTimeLocal(value);
}
+bool DateTimeLocalInputType::isDateTimeLocalField() const
+{
+ return true;
+}
+
} // namespace WebCore
#endif
diff --git a/Source/WebCore/html/DateTimeLocalInputType.h b/Source/WebCore/html/DateTimeLocalInputType.h
index 2641d8439..25671de79 100644
--- a/Source/WebCore/html/DateTimeLocalInputType.h
+++ b/Source/WebCore/html/DateTimeLocalInputType.h
@@ -54,6 +54,7 @@ private:
virtual bool scaledStepValueShouldBeInteger() const OVERRIDE;
virtual bool parseToDateComponentsInternal(const UChar*, unsigned length, DateComponents*) const OVERRIDE;
virtual bool setMillisecondToDateComponents(double, DateComponents*) const OVERRIDE;
+ virtual bool isDateTimeLocalField() const OVERRIDE;
};
} // namespace WebCore
diff --git a/Source/WebCore/html/FileInputType.cpp b/Source/WebCore/html/FileInputType.cpp
index 44bd13ff2..421185dfa 100644
--- a/Source/WebCore/html/FileInputType.cpp
+++ b/Source/WebCore/html/FileInputType.cpp
@@ -188,6 +188,9 @@ void FileInputType::handleDOMActivateEvent(Event* event)
#endif
settings.acceptMIMETypes = input->acceptMIMETypes();
settings.selectedFiles = m_fileList->paths();
+#if ENABLE(MEDIA_CAPTURE)
+ settings.capture = input->capture();
+#endif
chrome->runOpenPanel(input->document()->frame(), newFileChooser(settings));
}
event->setDefaultHandled();
@@ -292,14 +295,14 @@ bool FileInputType::isFileUpload() const
void FileInputType::createShadowSubtree()
{
- ASSERT(element()->hasShadowRoot());
+ ASSERT(element()->shadow());
ExceptionCode ec = 0;
element()->shadow()->oldestShadowRoot()->appendChild(element()->multiple() ? UploadButtonElement::createForMultiple(element()->document()): UploadButtonElement::create(element()->document()), ec);
}
void FileInputType::multipleAttributeChanged()
{
- ASSERT(element()->hasShadowRoot());
+ ASSERT(element()->shadow());
UploadButtonElement* button = static_cast<UploadButtonElement*>(element()->shadow()->oldestShadowRoot()->firstChild());
if (button)
button->setValue(element()->multiple() ? fileButtonChooseMultipleFilesLabel() : fileButtonChooseFileLabel());
diff --git a/Source/WebCore/html/HTMLAnchorElement.cpp b/Source/WebCore/html/HTMLAnchorElement.cpp
index 4960747e9..a5b3e0899 100644
--- a/Source/WebCore/html/HTMLAnchorElement.cpp
+++ b/Source/WebCore/html/HTMLAnchorElement.cpp
@@ -245,9 +245,9 @@ void HTMLAnchorElement::accessKeyAction(bool sendMouseEvents)
dispatchSimulatedClick(0, sendMouseEvents);
}
-bool HTMLAnchorElement::isURLAttribute(Attribute *attr) const
+bool HTMLAnchorElement::isURLAttribute(const Attribute& attribute) const
{
- return attr->name() == hrefAttr || HTMLElement::isURLAttribute(attr);
+ return attribute.name() == hrefAttr || HTMLElement::isURLAttribute(attribute);
}
bool HTMLAnchorElement::canStartSelection() const
diff --git a/Source/WebCore/html/HTMLAnchorElement.h b/Source/WebCore/html/HTMLAnchorElement.h
index 1fec65864..baebdc67b 100644
--- a/Source/WebCore/html/HTMLAnchorElement.h
+++ b/Source/WebCore/html/HTMLAnchorElement.h
@@ -112,7 +112,7 @@ private:
virtual void defaultEventHandler(Event*);
virtual void setActive(bool active = true, bool pause = false);
virtual void accessKeyAction(bool sendMouseEvents);
- virtual bool isURLAttribute(Attribute*) const;
+ virtual bool isURLAttribute(const Attribute&) const OVERRIDE;
virtual bool canStartSelection() const;
virtual String target() const;
virtual short tabIndex() const;
diff --git a/Source/WebCore/html/HTMLAttributeNames.in b/Source/WebCore/html/HTMLAttributeNames.in
index d78ce05b6..888e1958f 100644
--- a/Source/WebCore/html/HTMLAttributeNames.in
+++ b/Source/WebCore/html/HTMLAttributeNames.in
@@ -58,6 +58,7 @@ bgcolor
bgproperties
border
bordercolor
+capture
cellpadding
cellspacing
char
@@ -92,6 +93,7 @@ dir
direction
dirname
disabled
+disposition
download
draggable
webkitdropzone
diff --git a/Source/WebCore/html/HTMLBaseElement.cpp b/Source/WebCore/html/HTMLBaseElement.cpp
index 3c1c3f347..b76b61a90 100644
--- a/Source/WebCore/html/HTMLBaseElement.cpp
+++ b/Source/WebCore/html/HTMLBaseElement.cpp
@@ -65,9 +65,9 @@ void HTMLBaseElement::removedFrom(Node* insertionPoint)
document()->processBaseElement();
}
-bool HTMLBaseElement::isURLAttribute(Attribute* attribute) const
+bool HTMLBaseElement::isURLAttribute(const Attribute& attribute) const
{
- return attribute->name() == hrefAttr || HTMLElement::isURLAttribute(attribute);
+ return attribute.name() == hrefAttr || HTMLElement::isURLAttribute(attribute);
}
String HTMLBaseElement::target() const
diff --git a/Source/WebCore/html/HTMLBaseElement.h b/Source/WebCore/html/HTMLBaseElement.h
index 2334d7e77..97343ac3d 100644
--- a/Source/WebCore/html/HTMLBaseElement.h
+++ b/Source/WebCore/html/HTMLBaseElement.h
@@ -35,7 +35,7 @@ private:
HTMLBaseElement(const QualifiedName&, Document*);
virtual String target() const;
- virtual bool isURLAttribute(Attribute*) const;
+ virtual bool isURLAttribute(const Attribute&) const OVERRIDE;
virtual void parseAttribute(Attribute*) OVERRIDE;
virtual InsertionNotificationRequest insertedInto(Node*) OVERRIDE;
virtual void removedFrom(Node*) OVERRIDE;
diff --git a/Source/WebCore/html/HTMLBodyElement.cpp b/Source/WebCore/html/HTMLBodyElement.cpp
index bb40b0004..4c3862d89 100644
--- a/Source/WebCore/html/HTMLBodyElement.cpp
+++ b/Source/WebCore/html/HTMLBodyElement.cpp
@@ -183,9 +183,9 @@ void HTMLBodyElement::didNotifyDescendantInseretions(Node* insertionPoint)
view->scheduleRelayout();
}
-bool HTMLBodyElement::isURLAttribute(Attribute *attr) const
+bool HTMLBodyElement::isURLAttribute(const Attribute& attribute) const
{
- return attr->name() == backgroundAttr || HTMLElement::isURLAttribute(attr);
+ return attribute.name() == backgroundAttr || HTMLElement::isURLAttribute(attribute);
}
bool HTMLBodyElement::supportsFocus() const
diff --git a/Source/WebCore/html/HTMLBodyElement.h b/Source/WebCore/html/HTMLBodyElement.h
index b18bd6d33..bdebda956 100644
--- a/Source/WebCore/html/HTMLBodyElement.h
+++ b/Source/WebCore/html/HTMLBodyElement.h
@@ -77,7 +77,7 @@ private:
virtual InsertionNotificationRequest insertedInto(Node*) OVERRIDE;
virtual void didNotifyDescendantInseretions(Node*) OVERRIDE;
- virtual bool isURLAttribute(Attribute*) const;
+ virtual bool isURLAttribute(const Attribute&) const OVERRIDE;
virtual bool supportsFocus() const;
diff --git a/Source/WebCore/html/HTMLButtonElement.cpp b/Source/WebCore/html/HTMLButtonElement.cpp
index d91bd49aa..24ee7769b 100644
--- a/Source/WebCore/html/HTMLButtonElement.cpp
+++ b/Source/WebCore/html/HTMLButtonElement.cpp
@@ -177,9 +177,9 @@ void HTMLButtonElement::accessKeyAction(bool sendMouseEvents)
dispatchSimulatedClick(0, sendMouseEvents);
}
-bool HTMLButtonElement::isURLAttribute(Attribute* attr) const
+bool HTMLButtonElement::isURLAttribute(const Attribute& attribute) const
{
- return attr->name() == formactionAttr || HTMLFormControlElement::isURLAttribute(attr);
+ return attribute.name() == formactionAttr || HTMLFormControlElement::isURLAttribute(attribute);
}
String HTMLButtonElement::value() const
diff --git a/Source/WebCore/html/HTMLButtonElement.h b/Source/WebCore/html/HTMLButtonElement.h
index 2d296cb11..8ddb03efe 100644
--- a/Source/WebCore/html/HTMLButtonElement.h
+++ b/Source/WebCore/html/HTMLButtonElement.h
@@ -56,7 +56,7 @@ private:
virtual void setActivatedSubmit(bool flag);
virtual void accessKeyAction(bool sendMouseEvents);
- virtual bool isURLAttribute(Attribute*) const;
+ virtual bool isURLAttribute(const Attribute&) const OVERRIDE;
virtual bool canStartSelection() const { return false; }
diff --git a/Source/WebCore/html/HTMLCollection.cpp b/Source/WebCore/html/HTMLCollection.cpp
index 1b9cc31f7..a908da0a3 100644
--- a/Source/WebCore/html/HTMLCollection.cpp
+++ b/Source/WebCore/html/HTMLCollection.cpp
@@ -67,6 +67,7 @@ bool HTMLCollection::shouldIncludeChildren(CollectionType type)
#if ENABLE(MICRODATA)
case ItemProperties:
#endif
+ case FormControls:
return true;
case NodeChildren:
case TRCells:
@@ -151,6 +152,7 @@ inline bool HTMLCollection::isAcceptableElement(Element* element) const
case ItemProperties:
return element->fastHasAttribute(itempropAttr);
#endif
+ case FormControls:
case DocumentNamedItems:
case OtherCollection:
case WindowNamedItems:
diff --git a/Source/WebCore/html/HTMLDetailsElement.cpp b/Source/WebCore/html/HTMLDetailsElement.cpp
index e4e4a9248..6101501ef 100644
--- a/Source/WebCore/html/HTMLDetailsElement.cpp
+++ b/Source/WebCore/html/HTMLDetailsElement.cpp
@@ -110,7 +110,7 @@ RenderObject* HTMLDetailsElement::createRenderer(RenderArena* arena, RenderStyle
void HTMLDetailsElement::createShadowSubtree()
{
- ASSERT(!hasShadowRoot());
+ ASSERT(!shadow());
RefPtr<ShadowRoot> root = ShadowRoot::create(this, ShadowRoot::CreatingUserAgentShadowRoot);
root->appendChild(DetailsSummaryElement::create(document()), ASSERT_NO_EXCEPTION, true);
diff --git a/Source/WebCore/html/HTMLElement.cpp b/Source/WebCore/html/HTMLElement.cpp
index 5f8b223da..d367f9bba 100644
--- a/Source/WebCore/html/HTMLElement.cpp
+++ b/Source/WebCore/html/HTMLElement.cpp
@@ -956,10 +956,10 @@ void HTMLElement::adjustDirectionalityIfNeededAfterChildrenChanged(Node* beforeC
}
}
-bool HTMLElement::isURLAttribute(Attribute* attribute) const
+bool HTMLElement::isURLAttribute(const Attribute& attribute) const
{
#if ENABLE(MICRODATA)
- return attribute->name() == itemidAttr;
+ return attribute.name() == itemidAttr;
#else
UNUSED_PARAM(attribute);
return false;
diff --git a/Source/WebCore/html/HTMLElement.h b/Source/WebCore/html/HTMLElement.h
index 8b6aef452..2529d2bf1 100644
--- a/Source/WebCore/html/HTMLElement.h
+++ b/Source/WebCore/html/HTMLElement.h
@@ -106,7 +106,7 @@ public:
virtual bool isLabelable() const { return false; }
protected:
- HTMLElement(const QualifiedName& tagName, Document*);
+ HTMLElement(const QualifiedName& tagName, Document*, ConstructionType);
void addHTMLLengthToStyle(StylePropertySet*, CSSPropertyID, const String& value);
void addHTMLColorToStyle(StylePropertySet*, CSSPropertyID, const String& color);
@@ -121,7 +121,7 @@ protected:
virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0);
void calculateAndAdjustDirectionality();
- virtual bool isURLAttribute(Attribute*) const;
+ virtual bool isURLAttribute(const Attribute&) const OVERRIDE;
private:
virtual String nodeName() const;
@@ -161,8 +161,8 @@ inline const HTMLElement* toHTMLElement(const Node* node)
// This will catch anyone doing an unnecessary cast.
void toHTMLElement(const HTMLElement*);
-inline HTMLElement::HTMLElement(const QualifiedName& tagName, Document* document)
- : StyledElement(tagName, document, CreateHTMLElement)
+inline HTMLElement::HTMLElement(const QualifiedName& tagName, Document* document, ConstructionType type = CreateHTMLElement)
+ : StyledElement(tagName, document, type)
{
ASSERT(tagName.localName().impl());
}
diff --git a/Source/WebCore/html/HTMLElementsAllInOne.cpp b/Source/WebCore/html/HTMLElementsAllInOne.cpp
index 3fe0da498..cd89b4687 100644
--- a/Source/WebCore/html/HTMLElementsAllInOne.cpp
+++ b/Source/WebCore/html/HTMLElementsAllInOne.cpp
@@ -65,6 +65,7 @@
#include "HTMLIFrameElement.cpp"
#include "HTMLImageElement.cpp"
#include "HTMLInputElement.cpp"
+#include "HTMLIntentElement.cpp"
#include "HTMLKeygenElement.cpp"
#include "HTMLLIElement.cpp"
#include "HTMLLabelElement.cpp"
diff --git a/Source/WebCore/html/HTMLEmbedElement.cpp b/Source/WebCore/html/HTMLEmbedElement.cpp
index 0fc0b17a1..ffaabcd2a 100644
--- a/Source/WebCore/html/HTMLEmbedElement.cpp
+++ b/Source/WebCore/html/HTMLEmbedElement.cpp
@@ -132,7 +132,7 @@ void HTMLEmbedElement::parametersForPlugin(Vector<String>& paramNames, Vector<St
// moved down into HTMLPluginImageElement.cpp
void HTMLEmbedElement::updateWidget(PluginCreationOption pluginCreationOption)
{
- ASSERT(!renderEmbeddedObject()->pluginCrashedOrWasMissing());
+ ASSERT(!renderEmbeddedObject()->showsUnavailablePluginIndicator());
ASSERT(needsWidgetUpdate());
setNeedsWidgetUpdate(false);
@@ -208,9 +208,9 @@ bool HTMLEmbedElement::rendererIsNeeded(const NodeRenderingContext& context)
return HTMLPlugInImageElement::rendererIsNeeded(context);
}
-bool HTMLEmbedElement::isURLAttribute(Attribute* attr) const
+bool HTMLEmbedElement::isURLAttribute(const Attribute& attribute) const
{
- return attr->name() == srcAttr || HTMLPlugInImageElement::isURLAttribute(attr);
+ return attribute.name() == srcAttr || HTMLPlugInImageElement::isURLAttribute(attribute);
}
const QualifiedName& HTMLEmbedElement::imageSourceAttributeName() const
diff --git a/Source/WebCore/html/HTMLEmbedElement.h b/Source/WebCore/html/HTMLEmbedElement.h
index 86bf8eddc..8597dfdf2 100644
--- a/Source/WebCore/html/HTMLEmbedElement.h
+++ b/Source/WebCore/html/HTMLEmbedElement.h
@@ -40,7 +40,7 @@ private:
virtual bool rendererIsNeeded(const NodeRenderingContext&);
- virtual bool isURLAttribute(Attribute*) const;
+ virtual bool isURLAttribute(const Attribute&) const OVERRIDE;
virtual const QualifiedName& imageSourceAttributeName() const;
virtual RenderWidget* renderWidgetForJSBindings();
diff --git a/Source/WebCore/html/HTMLFormCollection.cpp b/Source/WebCore/html/HTMLFormCollection.cpp
index 684e3a5aa..c688d8d6e 100644
--- a/Source/WebCore/html/HTMLFormCollection.cpp
+++ b/Source/WebCore/html/HTMLFormCollection.cpp
@@ -36,7 +36,7 @@ using namespace HTMLNames;
// calculation every time if anything has changed.
HTMLFormCollection::HTMLFormCollection(HTMLFormElement* form)
- : HTMLCollection(form, OtherCollection)
+ : HTMLCollection(form, FormControls)
, currentPos(0)
{
}
diff --git a/Source/WebCore/html/HTMLFormControlElement.cpp b/Source/WebCore/html/HTMLFormControlElement.cpp
index 974938f0c..2f9f225bc 100644
--- a/Source/WebCore/html/HTMLFormControlElement.cpp
+++ b/Source/WebCore/html/HTMLFormControlElement.cpp
@@ -50,17 +50,17 @@ HTMLFormControlElement::HTMLFormControlElement(const QualifiedName& tagName, Doc
: LabelableElement(tagName, document)
, m_fieldSetAncestor(0)
, m_legendAncestor(0)
- , m_ancestorsValid(false)
+ , m_fieldSetAncestorValid(false)
, m_disabled(false)
, m_readOnly(false)
, m_required(false)
, m_valueMatchesRenderer(false)
+ , m_dataListAncestorState(Unknown)
, m_willValidateInitialized(false)
, m_willValidate(true)
, m_isValid(true)
, m_wasChangedSinceLastFormControlChangeEvent(false)
, m_hasAutofocused(false)
- , m_hasDataListAncestor(false)
{
setForm(form ? form : findFormAncestor());
setHasCustomWillOrDidRecalcStyle();
@@ -101,22 +101,19 @@ bool HTMLFormControlElement::formNoValidate() const
return fastHasAttribute(formnovalidateAttr);
}
-void HTMLFormControlElement::updateAncestors() const
+void HTMLFormControlElement::updateFieldSetAndLegendAncestor() const
{
m_fieldSetAncestor = 0;
m_legendAncestor = 0;
- m_hasDataListAncestor = false;
for (ContainerNode* ancestor = parentNode(); ancestor; ancestor = ancestor->parentNode()) {
if (!m_legendAncestor && ancestor->hasTagName(legendTag))
m_legendAncestor = static_cast<HTMLLegendElement*>(ancestor);
- if (!m_fieldSetAncestor && ancestor->hasTagName(fieldsetTag))
+ if (ancestor->hasTagName(fieldsetTag)) {
m_fieldSetAncestor = static_cast<HTMLFieldSetElement*>(ancestor);
- if (!m_hasDataListAncestor && ancestor->hasTagName(datalistTag))
- m_hasDataListAncestor = true;
- if (m_hasDataListAncestor && m_fieldSetAncestor)
break;
+ }
}
- m_ancestorsValid = true;
+ m_fieldSetAncestorValid = true;
}
void HTMLFormControlElement::parseAttribute(Attribute* attr)
@@ -227,18 +224,19 @@ void HTMLFormControlElement::didMoveToNewDocument(Document* oldDocument)
Node::InsertionNotificationRequest HTMLFormControlElement::insertedInto(Node* insertionPoint)
{
+ m_dataListAncestorState = Unknown;
+ setNeedsWillValidateCheck();
HTMLElement::insertedInto(insertionPoint);
FormAssociatedElement::insertedInto(insertionPoint);
- m_ancestorsValid = false;
- setNeedsWillValidateCheck();
return InsertionDone;
}
void HTMLFormControlElement::removedFrom(Node* insertionPoint)
{
+ m_fieldSetAncestorValid = false;
+ m_dataListAncestorState = Unknown;
HTMLElement::removedFrom(insertionPoint);
FormAssociatedElement::removedFrom(insertionPoint);
- m_ancestorsValid = false;
}
const AtomicString& HTMLFormControlElement::formControlName() const
@@ -279,8 +277,8 @@ bool HTMLFormControlElement::disabled() const
if (m_disabled)
return true;
- if (!m_ancestorsValid)
- updateAncestors();
+ if (!m_fieldSetAncestorValid)
+ updateFieldSetAndLegendAncestor();
// Form controls in the first legend element inside a fieldset are not affected by fieldset.disabled.
if (m_fieldSetAncestor && m_fieldSetAncestor->disabled())
@@ -359,15 +357,22 @@ short HTMLFormControlElement::tabIndex() const
bool HTMLFormControlElement::recalcWillValidate() const
{
- return !m_hasDataListAncestor && !m_disabled && !m_readOnly;
+ if (m_dataListAncestorState == Unknown) {
+ for (ContainerNode* ancestor = parentNode(); ancestor; ancestor = ancestor->parentNode()) {
+ if (!m_legendAncestor && ancestor->hasTagName(datalistTag)) {
+ m_dataListAncestorState = InsideDataList;
+ break;
+ }
+ }
+ if (m_dataListAncestorState == Unknown)
+ m_dataListAncestorState = NotInsideDataList;
+ }
+ return m_dataListAncestorState == NotInsideDataList && !m_disabled && !m_readOnly;
}
bool HTMLFormControlElement::willValidate() const
{
- if (!m_willValidateInitialized || !m_ancestorsValid) {
- if (!m_ancestorsValid)
- updateAncestors();
-
+ if (!m_willValidateInitialized || m_dataListAncestorState == Unknown) {
m_willValidateInitialized = true;
m_willValidate = recalcWillValidate();
} else {
@@ -381,9 +386,6 @@ bool HTMLFormControlElement::willValidate() const
void HTMLFormControlElement::setNeedsWillValidateCheck()
{
- if (!m_ancestorsValid)
- updateAncestors();
-
// We need to recalculate willValidate immediately because willValidate change can causes style change.
bool newWillValidate = recalcWillValidate();
if (m_willValidateInitialized && m_willValidate == newWillValidate)
diff --git a/Source/WebCore/html/HTMLFormControlElement.h b/Source/WebCore/html/HTMLFormControlElement.h
index 3647968da..608411f36 100644
--- a/Source/WebCore/html/HTMLFormControlElement.h
+++ b/Source/WebCore/html/HTMLFormControlElement.h
@@ -51,7 +51,7 @@ public:
void setFormMethod(const String&);
bool formNoValidate() const;
- void updateAncestors() const;
+ void updateFieldSetAndLegendAncestor() const;
virtual void reset() { }
@@ -153,12 +153,15 @@ private:
mutable HTMLFieldSetElement* m_fieldSetAncestor;
mutable HTMLLegendElement* m_legendAncestor;
OwnPtr<ValidationMessage> m_validationMessage;
- mutable bool m_ancestorsValid : 1;
+ mutable bool m_fieldSetAncestorValid : 1;
bool m_disabled : 1;
bool m_readOnly : 1;
bool m_required : 1;
bool m_valueMatchesRenderer : 1;
+ enum DataListAncestorState { Unknown, InsideDataList, NotInsideDataList };
+ mutable enum DataListAncestorState m_dataListAncestorState;
+
// The initial value of m_willValidate depends on the derived class. We can't
// initialize it with a virtual function in the constructor. m_willValidate
// is not deterministic as long as m_willValidateInitialized is false.
@@ -172,7 +175,6 @@ private:
bool m_wasChangedSinceLastFormControlChangeEvent : 1;
bool m_hasAutofocused : 1;
- mutable bool m_hasDataListAncestor : 1;
};
} // namespace
diff --git a/Source/WebCore/html/HTMLFormElement.cpp b/Source/WebCore/html/HTMLFormElement.cpp
index df78d661f..774be4c14 100644
--- a/Source/WebCore/html/HTMLFormElement.cpp
+++ b/Source/WebCore/html/HTMLFormElement.cpp
@@ -515,9 +515,9 @@ void HTMLFormElement::removeFormElement(FormAssociatedElement* e)
removeFromVector(m_associatedElements, e);
}
-bool HTMLFormElement::isURLAttribute(Attribute* attr) const
+bool HTMLFormElement::isURLAttribute(const Attribute& attribute) const
{
- return attr->name() == actionAttr || HTMLElement::isURLAttribute(attr);
+ return attribute.name() == actionAttr || HTMLElement::isURLAttribute(attribute);
}
void HTMLFormElement::registerImgElement(HTMLImageElement* e)
diff --git a/Source/WebCore/html/HTMLFormElement.h b/Source/WebCore/html/HTMLFormElement.h
index c3013bf4a..6bfe5cb88 100644
--- a/Source/WebCore/html/HTMLFormElement.h
+++ b/Source/WebCore/html/HTMLFormElement.h
@@ -124,8 +124,7 @@ private:
virtual void handleLocalEvents(Event*);
virtual void parseAttribute(Attribute*) OVERRIDE;
-
- virtual bool isURLAttribute(Attribute*) const;
+ virtual bool isURLAttribute(const Attribute&) const OVERRIDE;
virtual void documentDidResumeFromPageCache();
diff --git a/Source/WebCore/html/HTMLFrameElementBase.cpp b/Source/WebCore/html/HTMLFrameElementBase.cpp
index c34ddeb47..3b6037dcd 100644
--- a/Source/WebCore/html/HTMLFrameElementBase.cpp
+++ b/Source/WebCore/html/HTMLFrameElementBase.cpp
@@ -225,9 +225,9 @@ void HTMLFrameElementBase::setFocus(bool received)
}
}
-bool HTMLFrameElementBase::isURLAttribute(Attribute *attr) const
+bool HTMLFrameElementBase::isURLAttribute(const Attribute& attribute) const
{
- return attr->name() == srcAttr || HTMLFrameOwnerElement::isURLAttribute(attr);
+ return attribute.name() == srcAttr || HTMLFrameOwnerElement::isURLAttribute(attribute);
}
int HTMLFrameElementBase::width()
diff --git a/Source/WebCore/html/HTMLFrameElementBase.h b/Source/WebCore/html/HTMLFrameElementBase.h
index 54891a4ba..081b446fa 100644
--- a/Source/WebCore/html/HTMLFrameElementBase.h
+++ b/Source/WebCore/html/HTMLFrameElementBase.h
@@ -62,7 +62,7 @@ private:
virtual bool supportsFocus() const;
virtual void setFocus(bool);
- virtual bool isURLAttribute(Attribute*) const;
+ virtual bool isURLAttribute(const Attribute&) const OVERRIDE;
virtual bool isFrameElementBase() const { return true; }
bool viewSourceMode() const { return m_viewSource; }
diff --git a/Source/WebCore/html/HTMLFrameOwnerElement.cpp b/Source/WebCore/html/HTMLFrameOwnerElement.cpp
index b84c449b5..58f385b29 100644
--- a/Source/WebCore/html/HTMLFrameOwnerElement.cpp
+++ b/Source/WebCore/html/HTMLFrameOwnerElement.cpp
@@ -34,7 +34,7 @@
namespace WebCore {
HTMLFrameOwnerElement::HTMLFrameOwnerElement(const QualifiedName& tagName, Document* document)
- : HTMLElement(tagName, document)
+ : HTMLElement(tagName, document, CreateFrameOwnerElement)
, m_contentFrame(0)
, m_sandboxFlags(SandboxNone)
{
@@ -49,17 +49,14 @@ RenderPart* HTMLFrameOwnerElement::renderPart() const
return toRenderPart(renderer());
}
-void HTMLFrameOwnerElement::willRemove()
+void HTMLFrameOwnerElement::disconnectContentFrame()
{
- // FIXME: It is unclear why this can't be moved to removedFromDocument()
- // this is the only implementation of willRemove in WebCore!
+ // This causes an unload event thus cannot be a part of removedFrom().
if (Frame* frame = contentFrame()) {
RefPtr<Frame> protect(frame);
frame->loader()->frameDetached();
frame->disconnectOwnerElement();
}
-
- HTMLElement::willRemove();
}
HTMLFrameOwnerElement::~HTMLFrameOwnerElement()
diff --git a/Source/WebCore/html/HTMLFrameOwnerElement.h b/Source/WebCore/html/HTMLFrameOwnerElement.h
index de9d15320..227622f17 100644
--- a/Source/WebCore/html/HTMLFrameOwnerElement.h
+++ b/Source/WebCore/html/HTMLFrameOwnerElement.h
@@ -54,24 +54,27 @@ public:
virtual ScrollbarMode scrollingMode() const { return ScrollbarAuto; }
SandboxFlags sandboxFlags() const { return m_sandboxFlags; }
+ void disconnectContentFrame();
protected:
HTMLFrameOwnerElement(const QualifiedName& tagName, Document*);
-
void setSandboxFlags(SandboxFlags);
- virtual void willRemove();
-
private:
friend class Frame;
- virtual bool isFrameOwnerElement() const { return true; }
virtual bool isKeyboardFocusable(KeyboardEvent*) const;
Frame* m_contentFrame;
SandboxFlags m_sandboxFlags;
};
+inline HTMLFrameOwnerElement* toFrameOwnerElement(Node* node)
+{
+ ASSERT(!node || node->isFrameOwnerElement());
+ return static_cast<HTMLFrameOwnerElement*>(node);
+}
+
} // namespace WebCore
#endif // HTMLFrameOwnerElement_h
diff --git a/Source/WebCore/html/HTMLHtmlElement.cpp b/Source/WebCore/html/HTMLHtmlElement.cpp
index a27b0dfc5..8f6ec74eb 100644
--- a/Source/WebCore/html/HTMLHtmlElement.cpp
+++ b/Source/WebCore/html/HTMLHtmlElement.cpp
@@ -51,9 +51,9 @@ PassRefPtr<HTMLHtmlElement> HTMLHtmlElement::create(const QualifiedName& tagName
return adoptRef(new HTMLHtmlElement(tagName, document));
}
-bool HTMLHtmlElement::isURLAttribute(Attribute* attribute) const
+bool HTMLHtmlElement::isURLAttribute(const Attribute& attribute) const
{
- return attribute->name() == manifestAttr || HTMLElement::isURLAttribute(attribute);
+ return attribute.name() == manifestAttr || HTMLElement::isURLAttribute(attribute);
}
void HTMLHtmlElement::insertedByParser()
diff --git a/Source/WebCore/html/HTMLHtmlElement.h b/Source/WebCore/html/HTMLHtmlElement.h
index 982627a5a..40f8bad93 100644
--- a/Source/WebCore/html/HTMLHtmlElement.h
+++ b/Source/WebCore/html/HTMLHtmlElement.h
@@ -38,7 +38,7 @@ public:
private:
HTMLHtmlElement(const QualifiedName&, Document*);
- virtual bool isURLAttribute(Attribute*) const;
+ virtual bool isURLAttribute(const Attribute&) const OVERRIDE;
};
} // namespace
diff --git a/Source/WebCore/html/HTMLIFrameElement.cpp b/Source/WebCore/html/HTMLIFrameElement.cpp
index 04529c83e..c7e157e73 100644
--- a/Source/WebCore/html/HTMLIFrameElement.cpp
+++ b/Source/WebCore/html/HTMLIFrameElement.cpp
@@ -41,6 +41,7 @@ inline HTMLIFrameElement::HTMLIFrameElement(const QualifiedName& tagName, Docume
: HTMLFrameElementBase(tagName, document)
{
ASSERT(hasTagName(iframeTag));
+ setHasCustomWillOrDidRecalcStyle();
}
PassRefPtr<HTMLIFrameElement> HTMLIFrameElement::create(const QualifiedName& tagName, Document* document)
@@ -120,6 +121,15 @@ bool HTMLIFrameElement::shouldDisplaySeamlessly() const
return contentDocument() && contentDocument()->mayDisplaySeamlessWithParent() && hasAttribute(seamlessAttr);
}
+void HTMLIFrameElement::didRecalcStyle(StyleChange styleChange)
+{
+ if (!shouldDisplaySeamlessly())
+ return;
+ Document* childDocument = contentDocument();
+ if (styleChange >= Inherit || childDocument->childNeedsStyleRecalc() || childDocument->needsStyleRecalc())
+ contentDocument()->recalcStyle(styleChange);
+}
+
#if ENABLE(MICRODATA)
String HTMLIFrameElement::itemValueText() const
{
diff --git a/Source/WebCore/html/HTMLIFrameElement.h b/Source/WebCore/html/HTMLIFrameElement.h
index 5d55359ba..ff889b060 100644
--- a/Source/WebCore/html/HTMLIFrameElement.h
+++ b/Source/WebCore/html/HTMLIFrameElement.h
@@ -43,10 +43,12 @@ private:
virtual InsertionNotificationRequest insertedInto(Node*) OVERRIDE;
virtual void removedFrom(Node*) OVERRIDE;
-
+
virtual bool rendererIsNeeded(const NodeRenderingContext&);
virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
-
+
+ virtual void didRecalcStyle(StyleChange) OVERRIDE;
+
#if ENABLE(MICRODATA)
virtual String itemValueText() const OVERRIDE;
virtual void setItemValueText(const String&, ExceptionCode&) OVERRIDE;
diff --git a/Source/WebCore/html/HTMLImageElement.cpp b/Source/WebCore/html/HTMLImageElement.cpp
index e08fb577f..7bf618881 100644
--- a/Source/WebCore/html/HTMLImageElement.cpp
+++ b/Source/WebCore/html/HTMLImageElement.cpp
@@ -259,13 +259,13 @@ int HTMLImageElement::naturalHeight() const
return m_imageLoader.image()->imageSizeForRenderer(renderer(), 1.0f).height();
}
-bool HTMLImageElement::isURLAttribute(Attribute* attr) const
+bool HTMLImageElement::isURLAttribute(const Attribute& attribute) const
{
- return attr->name() == srcAttr
- || attr->name() == lowsrcAttr
- || attr->name() == longdescAttr
- || (attr->name() == usemapAttr && attr->value().string()[0] != '#')
- || HTMLElement::isURLAttribute(attr);
+ return attribute.name() == srcAttr
+ || attribute.name() == lowsrcAttr
+ || attribute.name() == longdescAttr
+ || (attribute.name() == usemapAttr && attribute.value().string()[0] != '#')
+ || HTMLElement::isURLAttribute(attribute);
}
const AtomicString& HTMLImageElement::alt() const
diff --git a/Source/WebCore/html/HTMLImageElement.h b/Source/WebCore/html/HTMLImageElement.h
index 3ab95a32d..62554f6f7 100644
--- a/Source/WebCore/html/HTMLImageElement.h
+++ b/Source/WebCore/html/HTMLImageElement.h
@@ -93,7 +93,7 @@ private:
virtual bool canStartSelection() const { return false; }
- virtual bool isURLAttribute(Attribute*) const;
+ virtual bool isURLAttribute(const Attribute&) const OVERRIDE;
virtual bool draggable() const;
diff --git a/Source/WebCore/html/HTMLInputElement.cpp b/Source/WebCore/html/HTMLInputElement.cpp
index b3b0a7204..778ed257a 100644
--- a/Source/WebCore/html/HTMLInputElement.cpp
+++ b/Source/WebCore/html/HTMLInputElement.cpp
@@ -7,6 +7,7 @@
* Copyright (C) 2007 Samuel Weinig (sam@webkit.org)
* Copyright (C) 2010 Google Inc. All rights reserved.
* Copyright (C) 2008 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/)
+ * Copyright (C) 2012 Samsung Electronics. 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
@@ -109,7 +110,7 @@ PassRefPtr<HTMLInputElement> HTMLInputElement::create(const QualifiedName& tagNa
void HTMLInputElement::createShadowSubtree()
{
- ASSERT(!hasShadowRoot());
+ ASSERT(!shadow());
ShadowRoot::create(this, ShadowRoot::CreatingUserAgentShadowRoot, ASSERT_NO_EXCEPTION);
m_inputType->createShadowSubtree();
@@ -297,136 +298,17 @@ String HTMLInputElement::valueMissingText() const
bool HTMLInputElement::getAllowedValueStep(double* step) const
{
- return getAllowedValueStepWithDecimalPlaces(RejectAny, step, 0);
-}
-
-bool HTMLInputElement::getAllowedValueStepWithDecimalPlaces(AnyStepHandling anyStepHandling, double* step, unsigned* decimalPlaces) const
-{
- ASSERT(step);
- double defaultStep = m_inputType->defaultStep();
- double stepScaleFactor = m_inputType->stepScaleFactor();
- if (!isfinite(defaultStep) || !isfinite(stepScaleFactor))
- return false;
- const AtomicString& stepString = fastGetAttribute(stepAttr);
- if (stepString.isEmpty()) {
- *step = defaultStep * stepScaleFactor;
- if (decimalPlaces)
- *decimalPlaces = 0;
- return true;
- }
-
- if (equalIgnoringCase(stepString, "any")) {
- switch (anyStepHandling) {
- case RejectAny:
- return false;
- case AnyIsDefaultStep:
- *step = defaultStep * stepScaleFactor;
- if (decimalPlaces)
- *decimalPlaces = 0;
- return true;
- default:
- ASSERT_NOT_REACHED();
- }
- }
-
- double parsed;
- if (!decimalPlaces) {
- if (!parseToDoubleForNumberType(stepString, &parsed) || parsed <= 0.0) {
- *step = defaultStep * stepScaleFactor;
- return true;
- }
- } else {
- if (!parseToDoubleForNumberTypeWithDecimalPlaces(stepString, &parsed, decimalPlaces) || parsed <= 0.0) {
- *step = defaultStep * stepScaleFactor;
- *decimalPlaces = 0;
- return true;
- }
- }
- // For date, month, week, the parsed value should be an integer for some types.
- if (m_inputType->parsedStepValueShouldBeInteger())
- parsed = max(round(parsed), 1.0);
- double result = parsed * stepScaleFactor;
- // For datetime, datetime-local, time, the result should be an integer.
- if (m_inputType->scaledStepValueShouldBeInteger())
- result = max(round(result), 1.0);
- ASSERT(result > 0);
- *step = result;
- return true;
-}
-
-void HTMLInputElement::applyStep(double count, AnyStepHandling anyStepHandling, TextFieldEventBehavior eventBehavior, ExceptionCode& ec)
-{
- double step;
- unsigned stepDecimalPlaces, currentDecimalPlaces;
- if (!getAllowedValueStepWithDecimalPlaces(anyStepHandling, &step, &stepDecimalPlaces)) {
- ec = INVALID_STATE_ERR;
- return;
- }
-
- const double nan = numeric_limits<double>::quiet_NaN();
- double current = m_inputType->parseToDoubleWithDecimalPlaces(value(), nan, &currentDecimalPlaces);
- if (!isfinite(current)) {
- ec = INVALID_STATE_ERR;
- return;
- }
- double newValue = current + step * count;
- if (isinf(newValue)) {
- ec = INVALID_STATE_ERR;
- return;
- }
-
- double acceptableError = m_inputType->acceptableError(step);
- if (newValue - m_inputType->minimum() < -acceptableError) {
- ec = INVALID_STATE_ERR;
- return;
- }
- if (newValue < m_inputType->minimum())
- newValue = m_inputType->minimum();
-
- const AtomicString& stepString = fastGetAttribute(stepAttr);
- if (!equalIgnoringCase(stepString, "any"))
- newValue = alignValueForStep(newValue, step, currentDecimalPlaces, stepDecimalPlaces);
-
- if (newValue - m_inputType->maximum() > acceptableError) {
- ec = INVALID_STATE_ERR;
- return;
- }
- if (newValue > m_inputType->maximum())
- newValue = m_inputType->maximum();
-
- setValueAsNumber(newValue, ec, eventBehavior);
-
- if (AXObjectCache::accessibilityEnabled())
- document()->axObjectCache()->postNotification(renderer(), AXObjectCache::AXValueChanged, true);
-}
-
-double HTMLInputElement::alignValueForStep(double newValue, double step, unsigned currentDecimalPlaces, unsigned stepDecimalPlaces)
-{
- if (newValue >= pow(10.0, 21.0))
- return newValue;
-
- unsigned baseDecimalPlaces;
- double base = m_inputType->stepBaseWithDecimalPlaces(&baseDecimalPlaces);
- baseDecimalPlaces = min(baseDecimalPlaces, 16u);
- if (stepMismatch(value())) {
- double scale = pow(10.0, static_cast<double>(max(stepDecimalPlaces, currentDecimalPlaces)));
- newValue = round(newValue * scale) / scale;
- } else {
- double scale = pow(10.0, static_cast<double>(max(stepDecimalPlaces, baseDecimalPlaces)));
- newValue = round((base + round((newValue - base) / step) * step) * scale) / scale;
- }
-
- return newValue;
+ return m_inputType->getAllowedValueStep(step);
}
void HTMLInputElement::stepUp(int n, ExceptionCode& ec)
{
- applyStep(n, RejectAny, DispatchNoEvent, ec);
+ m_inputType->stepUp(n, ec);
}
void HTMLInputElement::stepDown(int n, ExceptionCode& ec)
{
- applyStep(-n, RejectAny, DispatchNoEvent, ec);
+ m_inputType->stepUp(-n, ec);
}
bool HTMLInputElement::isKeyboardFocusable(KeyboardEvent* event) const
@@ -1234,9 +1116,9 @@ void HTMLInputElement::defaultEventHandler(Event* evt)
HTMLTextFormControlElement::defaultEventHandler(evt);
}
-bool HTMLInputElement::isURLAttribute(Attribute *attr) const
+bool HTMLInputElement::isURLAttribute(const Attribute& attribute) const
{
- return attr->name() == srcAttr || attr->name() == formactionAttr || HTMLTextFormControlElement::isURLAttribute(attr);
+ return attribute.name() == srcAttr || attribute.name() == formactionAttr || HTMLTextFormControlElement::isURLAttribute(attribute);
}
String HTMLInputElement::defaultValue() const
@@ -1552,108 +1434,7 @@ bool HTMLInputElement::isSteppable() const
void HTMLInputElement::stepUpFromRenderer(int n)
{
- // The differences from stepUp()/stepDown():
- //
- // Difference 1: the current value
- // If the current value is not a number, including empty, the current value is assumed as 0.
- // * If 0 is in-range, and matches to step value
- // - The value should be the +step if n > 0
- // - The value should be the -step if n < 0
- // If -step or +step is out of range, new value should be 0.
- // * If 0 is smaller than the minimum value
- // - The value should be the minimum value for any n
- // * If 0 is larger than the maximum value
- // - The value should be the maximum value for any n
- // * If 0 is in-range, but not matched to step value
- // - The value should be the larger matched value nearest to 0 if n > 0
- // e.g. <input type=number min=-100 step=3> -> 2
- // - The value should be the smaler matched value nearest to 0 if n < 0
- // e.g. <input type=number min=-100 step=3> -> -1
- // As for date/datetime-local/month/time/week types, the current value is assumed as "the current local date/time".
- // As for datetime type, the current value is assumed as "the current date/time in UTC".
- // If the current value is smaller than the minimum value:
- // - The value should be the minimum value if n > 0
- // - Nothing should happen if n < 0
- // If the current value is larger than the maximum value:
- // - The value should be the maximum value if n < 0
- // - Nothing should happen if n > 0
- //
- // Difference 2: clamping steps
- // If the current value is not matched to step value:
- // - The value should be the larger matched value nearest to 0 if n > 0
- // e.g. <input type=number value=3 min=-100 step=3> -> 5
- // - The value should be the smaler matched value nearest to 0 if n < 0
- // e.g. <input type=number value=3 min=-100 step=3> -> 2
- //
- // n is assumed as -n if step < 0.
-
- ASSERT(isSteppable());
- if (!isSteppable())
- return;
- ASSERT(n);
- if (!n)
- return;
-
- unsigned stepDecimalPlaces, baseDecimalPlaces;
- double step, base;
- // FIXME: Not any changes after stepping, even if it is an invalid value, may be better.
- // (e.g. Stepping-up for <input type="number" value="foo" step="any" /> => "foo")
- if (!getAllowedValueStepWithDecimalPlaces(AnyIsDefaultStep, &step, &stepDecimalPlaces))
- return;
- base = m_inputType->stepBaseWithDecimalPlaces(&baseDecimalPlaces);
- baseDecimalPlaces = min(baseDecimalPlaces, 16u);
-
- int sign;
- if (step > 0)
- sign = n;
- else if (step < 0)
- sign = -n;
- else
- sign = 0;
-
- const double nan = numeric_limits<double>::quiet_NaN();
- String currentStringValue = value();
- double current = m_inputType->parseToDouble(currentStringValue, nan);
- if (!isfinite(current)) {
- ExceptionCode ec;
- current = m_inputType->defaultValueForStepUp();
- double nextDiff = step * n;
- if (current < m_inputType->minimum() - nextDiff)
- current = m_inputType->minimum() - nextDiff;
- if (current > m_inputType->maximum() - nextDiff)
- current = m_inputType->maximum() - nextDiff;
- setValueAsNumber(current, ec, DispatchInputAndChangeEvent);
- }
- if ((sign > 0 && current < m_inputType->minimum()) || (sign < 0 && current > m_inputType->maximum()))
- setValue(m_inputType->serialize(sign > 0 ? m_inputType->minimum() : m_inputType->maximum()), DispatchInputAndChangeEvent);
- else {
- ExceptionCode ec;
- if (stepMismatch(value())) {
- ASSERT(step);
- double newValue;
- double scale = pow(10.0, static_cast<double>(max(stepDecimalPlaces, baseDecimalPlaces)));
-
- if (sign < 0)
- newValue = round((base + floor((current - base) / step) * step) * scale) / scale;
- else if (sign > 0)
- newValue = round((base + ceil((current - base) / step) * step) * scale) / scale;
- else
- newValue = current;
-
- if (newValue < m_inputType->minimum())
- newValue = m_inputType->minimum();
- if (newValue > m_inputType->maximum())
- newValue = m_inputType->maximum();
-
- setValueAsNumber(newValue, ec, n == 1 || n == -1 ? DispatchInputAndChangeEvent : DispatchNoEvent);
- current = newValue;
- if (n > 1)
- applyStep(n - 1, AnyIsDefaultStep, DispatchInputAndChangeEvent, ec);
- else if (n < -1)
- applyStep(n + 1, AnyIsDefaultStep, DispatchInputAndChangeEvent, ec);
- } else
- applyStep(n, AnyIsDefaultStep, DispatchInputAndChangeEvent, ec);
- }
+ m_inputType->stepUpFromRenderer(n);
}
#if ENABLE(INPUT_SPEECH)
@@ -1741,6 +1522,36 @@ bool HTMLInputElement::isURLField() const
return m_inputType->isURLField();
}
+bool HTMLInputElement::isDateField() const
+{
+ return m_inputType->isDateField();
+}
+
+bool HTMLInputElement::isDateTimeField() const
+{
+ return m_inputType->isDateTimeField();
+}
+
+bool HTMLInputElement::isDateTimeLocalField() const
+{
+ return m_inputType->isDateTimeLocalField();
+}
+
+bool HTMLInputElement::isMonthField() const
+{
+ return m_inputType->isMonthField();
+}
+
+bool HTMLInputElement::isTimeField() const
+{
+ return m_inputType->isTimeField();
+}
+
+bool HTMLInputElement::isWeekField() const
+{
+ return m_inputType->isWeekField();
+}
+
bool HTMLInputElement::isEnumeratable() const
{
return m_inputType->isEnumeratable();
@@ -1806,6 +1617,29 @@ bool HTMLInputElement::isIndeterminate() const
return m_inputType->supportsIndeterminateAppearance() && indeterminate();
}
+#if ENABLE(MEDIA_CAPTURE)
+String HTMLInputElement::capture() const
+{
+ if (!isFileUpload())
+ return String();
+
+ String capture = fastGetAttribute(captureAttr).lower();
+ if (capture == "camera"
+ || capture == "camcorder"
+ || capture == "microphone"
+ || capture == "filesystem")
+ return capture;
+
+ return "filesystem";
+}
+
+void HTMLInputElement::setCapture(const String& value)
+{
+ setAttribute(captureAttr, value);
+}
+
+#endif
+
bool HTMLInputElement::isInRequiredRadioButtonGroup() const
{
ASSERT(isRadioButton());
@@ -1843,4 +1677,25 @@ inline void HTMLInputElement::removeFromRadioButtonGroup()
if (CheckedRadioButtons* buttons = checkedRadioButtons())
buttons->removeButton(this);
}
+
+unsigned HTMLInputElement::height() const
+{
+ return m_inputType->height();
+}
+
+unsigned HTMLInputElement::width() const
+{
+ return m_inputType->width();
+}
+
+void HTMLInputElement::setHeight(unsigned height)
+{
+ setAttribute(heightAttr, String::number(height));
+}
+
+void HTMLInputElement::setWidth(unsigned width)
+{
+ setAttribute(widthAttr, String::number(width));
+}
+
} // namespace
diff --git a/Source/WebCore/html/HTMLInputElement.h b/Source/WebCore/html/HTMLInputElement.h
index 3abf193ef..e34a03e63 100644
--- a/Source/WebCore/html/HTMLInputElement.h
+++ b/Source/WebCore/html/HTMLInputElement.h
@@ -3,6 +3,7 @@
* (C) 1999 Antti Koivisto (koivisto@kde.org)
* (C) 2000 Dirk Mueller (mueller@kde.org)
* Copyright (C) 2004, 2005, 2006, 2007, 2010 Apple Inc. All rights reserved.
+ * Copyright (C) 2012 Samsung Electronics. 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
@@ -104,6 +105,12 @@ public:
bool isSubmitButton() const;
bool isTelephoneField() const;
bool isURLField() const;
+ bool isDateField() const;
+ bool isDateTimeField() const;
+ bool isDateTimeLocalField() const;
+ bool isMonthField() const;
+ bool isTimeField() const;
+ bool isWeekField() const;
#if ENABLE(INPUT_SPEECH)
bool isSpeechEnabled() const;
@@ -234,8 +241,18 @@ public:
String defaultToolTip() const;
+#if ENABLE(MEDIA_CAPTURE)
+ String capture() const;
+ void setCapture(const String& value);
+#endif
+
static const int maximumLength;
+ unsigned height() const;
+ unsigned width() const;
+ void setHeight(unsigned);
+ void setWidth(unsigned);
+
protected:
HTMLInputElement(const QualifiedName&, Document*, HTMLFormElement*, bool createdByParser);
void createShadowSubtree();
@@ -243,7 +260,6 @@ protected:
private:
enum AutoCompleteSetting { Uninitialized, On, Off };
- enum AnyStepHandling { RejectAny, AnyIsDefaultStep };
virtual void willChangeForm() OVERRIDE;
virtual void didChangeForm() OVERRIDE;
@@ -292,7 +308,7 @@ private:
virtual void* preDispatchEventHandler(Event*);
virtual void postDispatchEventHandler(Event*, void* dataFromPreDispatch);
- virtual bool isURLAttribute(Attribute*) const;
+ virtual bool isURLAttribute(const Attribute&) const OVERRIDE;
virtual bool hasUnacceptableValue() const;
@@ -327,11 +343,6 @@ private:
virtual void subtreeHasChanged();
- bool getAllowedValueStepWithDecimalPlaces(AnyStepHandling, double*, unsigned*) const;
-
- // Helper for stepUp()/stepDown(). Adds step value * count to the current value.
- void applyStep(double count, AnyStepHandling, TextFieldEventBehavior, ExceptionCode&);
- double alignValueForStep(double value, double step, unsigned currentDecimalPlaces, unsigned stepDecimalPlaces);
#if ENABLE(DATALIST)
HTMLDataListElement* dataList() const;
diff --git a/Source/WebCore/html/HTMLInputElement.idl b/Source/WebCore/html/HTMLInputElement.idl
index 3c11990b2..cca40365f 100644
--- a/Source/WebCore/html/HTMLInputElement.idl
+++ b/Source/WebCore/html/HTMLInputElement.idl
@@ -1,6 +1,7 @@
/*
* Copyright (C) 2006, 2010 Apple Inc. All rights reserved.
* Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
+ * Copyright (C) 2012 Samsung Electronics. 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
@@ -36,6 +37,7 @@ module html {
attribute [TreatNullAs=NullString] DOMString formMethod;
attribute [Reflect] boolean formNoValidate;
attribute [Reflect] DOMString formTarget;
+ attribute unsigned long height;
attribute boolean indeterminate;
readonly attribute [Conditional=DATALIST] HTMLElement list;
attribute [Reflect] DOMString max;
@@ -65,6 +67,7 @@ module html {
void stepUp(in [Optional] long n) raises(DOMException);
void stepDown(in [Optional] long n) raises(DOMException);
+ attribute unsigned long width;
readonly attribute boolean willValidate;
readonly attribute ValidityState validity;
readonly attribute DOMString validationMessage;
@@ -112,5 +115,7 @@ module html {
readonly attribute URL absoluteImageURL;
#endif
+ // See http://www.w3.org/TR/html-media-capture/
+ attribute [Conditional=MEDIA_CAPTURE] DOMString capture;
};
}
diff --git a/Source/WebCore/html/HTMLIntentElement.cpp b/Source/WebCore/html/HTMLIntentElement.cpp
new file mode 100644
index 000000000..aec2dbf73
--- /dev/null
+++ b/Source/WebCore/html/HTMLIntentElement.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 "HTMLIntentElement.h"
+
+#if ENABLE(WEB_INTENTS_TAG)
+
+#include "Chrome.h"
+#include "Document.h"
+#include "Frame.h"
+#include "FrameLoaderClient.h"
+#include "HTMLNames.h"
+#include "Page.h"
+#include "QualifiedName.h"
+
+namespace WebCore {
+
+using namespace HTMLNames;
+
+HTMLIntentElement::HTMLIntentElement(const QualifiedName& tagName, Document* document)
+ : HTMLElement(tagName, document)
+{
+ ASSERT(hasTagName(intentTag));
+}
+
+PassRefPtr<HTMLIntentElement> HTMLIntentElement::create(const QualifiedName& tagName, Document* document)
+{
+ return adoptRef(new HTMLIntentElement(tagName, document));
+}
+
+Node::InsertionNotificationRequest HTMLIntentElement::insertedInto(Node* insertionPoint)
+{
+ HTMLElement::insertedInto(insertionPoint);
+
+ if (insertionPoint->inDocument() && document()->frame()) {
+ KURL url = document()->completeURL(fastGetAttribute(hrefAttr));
+ document()->frame()->loader()->client()->registerIntentService(
+ fastGetAttribute(actionAttr), fastGetAttribute(typeAttr), url, fastGetAttribute(titleAttr), fastGetAttribute(dispositionAttr));
+ }
+
+ return InsertionDone;
+}
+
+}
+
+#endif // ENABLE(WEB_INTENTS_TAG)
diff --git a/Source/WebCore/platform/graphics/chromium/TextureUploader.cpp b/Source/WebCore/html/HTMLIntentElement.h
index 556fe0e0c..badb5057e 100644
--- a/Source/WebCore/platform/graphics/chromium/TextureUploader.cpp
+++ b/Source/WebCore/html/HTMLIntentElement.h
@@ -1,45 +1,52 @@
/*
- * Copyright (C) 2012, Google Inc. All rights reserved.
+ * Copyright (C) 2011 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
+ *
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
+ * 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 INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * 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.
+ * 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"
+#ifndef HTMLIntentElement_h
+#define HTMLIntentElement_h
+
+#if ENABLE(WEB_INTENTS_TAG)
-#include "TextureUploader.h"
+#include "HTMLElement.h"
namespace WebCore {
-AcceleratedTextureUploader::AcceleratedTextureUploader(PassRefPtr<GraphicsContext3D> context)
- : m_context(context)
-{
-}
+class Document;
+class QualifiedName;
+
+class HTMLIntentElement : public HTMLElement {
+public:
+ static PassRefPtr<HTMLIntentElement> create(const QualifiedName&, Document*);
+
+private:
+ HTMLIntentElement(const QualifiedName&, Document*);
+
+ virtual InsertionNotificationRequest insertedInto(Node*) OVERRIDE;
+};
-AcceleratedTextureUploader::~AcceleratedTextureUploader()
-{
-}
+} // namespace WebCore
-void AcceleratedTextureUploader::uploadTexture(GraphicsContext3D* context, LayerTextureUpdater::Texture* texture, TextureAllocator* allocator, const IntRect sourceRect, const IntRect destRect)
-{
- texture->updateRect(context, allocator, sourceRect, destRect);
-}
+#endif
-}
+#endif
diff --git a/Source/WebCore/html/HTMLIntentElement.idl b/Source/WebCore/html/HTMLIntentElement.idl
new file mode 100644
index 000000000..608c5acdd
--- /dev/null
+++ b/Source/WebCore/html/HTMLIntentElement.idl
@@ -0,0 +1,38 @@
+/*
+ * 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.
+ */
+
+module html {
+
+ interface [
+ Conditional=WEB_INTENTS_TAG
+ ] HTMLIntentElement : HTMLElement {
+ attribute [Reflect] DOMString action;
+ attribute [Reflect] DOMString type;
+ attribute [Reflect, URL] DOMString href;
+ attribute [Reflect] DOMString title;
+ attribute [Reflect] DOMString disposition;
+ };
+
+}
diff --git a/Source/WebCore/html/HTMLKeygenElement.cpp b/Source/WebCore/html/HTMLKeygenElement.cpp
index b1099f197..db4d283fd 100644
--- a/Source/WebCore/html/HTMLKeygenElement.cpp
+++ b/Source/WebCore/html/HTMLKeygenElement.cpp
@@ -86,7 +86,7 @@ inline HTMLKeygenElement::HTMLKeygenElement(const QualifiedName& tagName, Docume
option->appendChild(Text::create(document, keys[i]), ec);
}
- ASSERT(!hasShadowRoot());
+ ASSERT(!shadow());
RefPtr<ShadowRoot> root = ShadowRoot::create(this, ShadowRoot::CreatingUserAgentShadowRoot);
root->appendChild(select, ec);
}
@@ -131,7 +131,6 @@ void HTMLKeygenElement::reset()
HTMLSelectElement* HTMLKeygenElement::shadowSelect() const
{
- ASSERT(hasShadowRoot());
ShadowRoot* root = this->shadow()->oldestShadowRoot();
return root ? toHTMLSelectElement(root->firstChild()) : 0;
}
diff --git a/Source/WebCore/html/HTMLLinkElement.cpp b/Source/WebCore/html/HTMLLinkElement.cpp
index 0db663604..e17925fbe 100644
--- a/Source/WebCore/html/HTMLLinkElement.cpp
+++ b/Source/WebCore/html/HTMLLinkElement.cpp
@@ -390,9 +390,9 @@ void HTMLLinkElement::startLoadingDynamicSheet()
addPendingSheet(Blocking);
}
-bool HTMLLinkElement::isURLAttribute(Attribute *attr) const
+bool HTMLLinkElement::isURLAttribute(const Attribute& attribute) const
{
- return attr->name() == hrefAttr || HTMLElement::isURLAttribute(attr);
+ return attribute.name() == hrefAttr || HTMLElement::isURLAttribute(attribute);
}
KURL HTMLLinkElement::href() const
diff --git a/Source/WebCore/html/HTMLLinkElement.h b/Source/WebCore/html/HTMLLinkElement.h
index 8cb91770d..82398505b 100644
--- a/Source/WebCore/html/HTMLLinkElement.h
+++ b/Source/WebCore/html/HTMLLinkElement.h
@@ -91,7 +91,7 @@ private:
void setDisabledState(bool);
- virtual bool isURLAttribute(Attribute*) const;
+ virtual bool isURLAttribute(const Attribute&) const OVERRIDE;
private:
virtual void addSubresourceAttributeURLs(ListHashSet<KURL>&) const;
diff --git a/Source/WebCore/html/HTMLMediaElement.cpp b/Source/WebCore/html/HTMLMediaElement.cpp
index 1e27cd4a2..049922628 100644
--- a/Source/WebCore/html/HTMLMediaElement.cpp
+++ b/Source/WebCore/html/HTMLMediaElement.cpp
@@ -3189,14 +3189,14 @@ void HTMLMediaElement::sourceWasAdded(HTMLSourceElement* source)
scheduleNextSourceChild();
}
-void HTMLMediaElement::sourceWillBeRemoved(HTMLSourceElement* source)
+void HTMLMediaElement::sourceWasRemoved(HTMLSourceElement* source)
{
- LOG(Media, "HTMLMediaElement::sourceWillBeRemoved(%p)", source);
+ LOG(Media, "HTMLMediaElement::sourceWasRemoved(%p)", source);
#if !LOG_DISABLED
if (source->hasTagName(sourceTag)) {
KURL url = source->getNonEmptyURLAttribute(srcAttr);
- LOG(Media, "HTMLMediaElement::sourceWillBeRemoved - 'src' is %s", urlForLogging(url).utf8().data());
+ LOG(Media, "HTMLMediaElement::sourceWasRemoved - 'src' is %s", urlForLogging(url).utf8().data());
}
#endif
@@ -3204,9 +3204,8 @@ void HTMLMediaElement::sourceWillBeRemoved(HTMLSourceElement* source)
return;
if (source == m_nextChildNodeToConsider) {
- m_nextChildNodeToConsider = m_nextChildNodeToConsider->nextSibling();
- if (!m_nextChildNodeToConsider)
- m_nextChildNodeToConsider = 0;
+ if (m_currentSourceNode)
+ m_nextChildNodeToConsider = m_currentSourceNode->nextSibling();
LOG(Media, "HTMLMediaElement::sourceRemoved - m_nextChildNodeToConsider set to %p", m_nextChildNodeToConsider.get());
} else if (source == m_currentSourceNode) {
// Clear the current source node pointer, but don't change the movie as the spec says:
@@ -4021,9 +4020,9 @@ void HTMLMediaElement::mediaCanStart()
loadInternal();
}
-bool HTMLMediaElement::isURLAttribute(Attribute* attribute) const
+bool HTMLMediaElement::isURLAttribute(const Attribute& attribute) const
{
- return attribute->name() == srcAttr || HTMLElement::isURLAttribute(attribute);
+ return attribute.name() == srcAttr || HTMLElement::isURLAttribute(attribute);
}
void HTMLMediaElement::setShouldDelayLoadEvent(bool shouldDelay)
@@ -4074,10 +4073,11 @@ MediaControls* HTMLMediaElement::mediaControls()
bool HTMLMediaElement::hasMediaControls()
{
- if (!hasShadowRoot())
+ ElementShadow* elementShadow = shadow();
+ if (!elementShadow)
return false;
- Node* node = shadow()->oldestShadowRoot()->firstChild();
+ Node* node = elementShadow->oldestShadowRoot()->firstChild();
return node && node->isMediaControls();
}
diff --git a/Source/WebCore/html/HTMLMediaElement.h b/Source/WebCore/html/HTMLMediaElement.h
index 6de35dba1..ddb08c2c2 100644
--- a/Source/WebCore/html/HTMLMediaElement.h
+++ b/Source/WebCore/html/HTMLMediaElement.h
@@ -287,7 +287,7 @@ public:
MediaControls* mediaControls();
- void sourceWillBeRemoved(HTMLSourceElement*);
+ void sourceWasRemoved(HTMLSourceElement*);
void sourceWasAdded(HTMLSourceElement*);
void privateBrowsingStateDidChange();
@@ -325,7 +325,7 @@ protected:
virtual void parseAttribute(Attribute*) OVERRIDE;
virtual void finishParsingChildren();
- virtual bool isURLAttribute(Attribute*) const;
+ virtual bool isURLAttribute(const Attribute&) const OVERRIDE;
virtual void attach();
virtual void didMoveToNewDocument(Document* oldDocument) OVERRIDE;
@@ -679,6 +679,17 @@ struct ValueToString<TextTrackCue*> {
#endif
#endif
+inline bool isMediaElement(Node* node)
+{
+ return node && node->isElementNode() && toElement(node)->isMediaElement();
+}
+
+inline HTMLMediaElement* toMediaElement(Node* node)
+{
+ ASSERT(!node || isMediaElement(node));
+ return static_cast<HTMLMediaElement*>(node);
+}
+
} //namespace
#endif
diff --git a/Source/WebCore/html/HTMLMeterElement.cpp b/Source/WebCore/html/HTMLMeterElement.cpp
index ce910e1a4..684eb5ba3 100644
--- a/Source/WebCore/html/HTMLMeterElement.cpp
+++ b/Source/WebCore/html/HTMLMeterElement.cpp
@@ -228,7 +228,7 @@ void HTMLMeterElement::didElementStateChange()
void HTMLMeterElement::createShadowSubtree()
{
- ASSERT(!hasShadowRoot());
+ ASSERT(!shadow());
RefPtr<MeterBarElement> bar = MeterBarElement::create(document());
m_value = MeterValueElement::create(document());
diff --git a/Source/WebCore/html/HTMLModElement.cpp b/Source/WebCore/html/HTMLModElement.cpp
index 9d0961c11..33185c7ce 100644
--- a/Source/WebCore/html/HTMLModElement.cpp
+++ b/Source/WebCore/html/HTMLModElement.cpp
@@ -39,9 +39,9 @@ PassRefPtr<HTMLModElement> HTMLModElement::create(const QualifiedName& tagName,
return adoptRef(new HTMLModElement(tagName, document));
}
-bool HTMLModElement::isURLAttribute(Attribute* attribute) const
+bool HTMLModElement::isURLAttribute(const Attribute& attribute) const
{
- return attribute->name() == citeAttr || HTMLElement::isURLAttribute(attribute);
+ return attribute.name() == citeAttr || HTMLElement::isURLAttribute(attribute);
}
}
diff --git a/Source/WebCore/html/HTMLModElement.h b/Source/WebCore/html/HTMLModElement.h
index cdb6dceaa..c1be99b61 100644
--- a/Source/WebCore/html/HTMLModElement.h
+++ b/Source/WebCore/html/HTMLModElement.h
@@ -35,7 +35,7 @@ public:
private:
HTMLModElement(const QualifiedName&, Document*);
- virtual bool isURLAttribute(Attribute*) const;
+ virtual bool isURLAttribute(const Attribute&) const OVERRIDE;
};
} //namespace
diff --git a/Source/WebCore/html/HTMLObjectElement.cpp b/Source/WebCore/html/HTMLObjectElement.cpp
index e09349c75..b9e9447c9 100644
--- a/Source/WebCore/html/HTMLObjectElement.cpp
+++ b/Source/WebCore/html/HTMLObjectElement.cpp
@@ -276,7 +276,7 @@ bool HTMLObjectElement::hasValidClassId()
// moved down into HTMLPluginImageElement.cpp
void HTMLObjectElement::updateWidget(PluginCreationOption pluginCreationOption)
{
- ASSERT(!renderEmbeddedObject()->pluginCrashedOrWasMissing());
+ ASSERT(!renderEmbeddedObject()->showsUnavailablePluginIndicator());
ASSERT(needsWidgetUpdate());
setNeedsWidgetUpdate(false);
// FIXME: This should ASSERT isFinishedParsingChildren() instead.
@@ -351,9 +351,9 @@ void HTMLObjectElement::childrenChanged(bool changedByParser, Node* beforeChange
HTMLPlugInImageElement::childrenChanged(changedByParser, beforeChange, afterChange, childCountDelta);
}
-bool HTMLObjectElement::isURLAttribute(Attribute *attr) const
+bool HTMLObjectElement::isURLAttribute(const Attribute& attribute) const
{
- return attr->name() == dataAttr || (attr->name() == usemapAttr && attr->value().string()[0] != '#') || HTMLPlugInImageElement::isURLAttribute(attr);
+ return attribute.name() == dataAttr || (attribute.name() == usemapAttr && attribute.value().string()[0] != '#') || HTMLPlugInImageElement::isURLAttribute(attribute);
}
const QualifiedName& HTMLObjectElement::imageSourceAttributeName() const
diff --git a/Source/WebCore/html/HTMLObjectElement.h b/Source/WebCore/html/HTMLObjectElement.h
index b50045dc5..a0e66377a 100644
--- a/Source/WebCore/html/HTMLObjectElement.h
+++ b/Source/WebCore/html/HTMLObjectElement.h
@@ -78,7 +78,7 @@ private:
virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0);
- virtual bool isURLAttribute(Attribute*) const;
+ virtual bool isURLAttribute(const Attribute&) const OVERRIDE;
virtual const QualifiedName& imageSourceAttributeName() const;
virtual RenderWidget* renderWidgetForJSBindings();
diff --git a/Source/WebCore/html/HTMLParamElement.cpp b/Source/WebCore/html/HTMLParamElement.cpp
index 39df4641e..9f609ce22 100644
--- a/Source/WebCore/html/HTMLParamElement.cpp
+++ b/Source/WebCore/html/HTMLParamElement.cpp
@@ -59,11 +59,11 @@ bool HTMLParamElement::isURLParameter(const String& name)
return equalIgnoringCase(name, "data") || equalIgnoringCase(name, "movie") || equalIgnoringCase(name, "src");
}
-bool HTMLParamElement::isURLAttribute(Attribute* attr) const
+bool HTMLParamElement::isURLAttribute(const Attribute& attribute) const
{
- if (attr->name() == valueAttr && isURLParameter(name()))
+ if (attribute.name() == valueAttr && isURLParameter(name()))
return true;
- return HTMLElement::isURLAttribute(attr);
+ return HTMLElement::isURLAttribute(attribute);
}
void HTMLParamElement::addSubresourceAttributeURLs(ListHashSet<KURL>& urls) const
diff --git a/Source/WebCore/html/HTMLParamElement.h b/Source/WebCore/html/HTMLParamElement.h
index 09e2dfdc1..f868e13e2 100644
--- a/Source/WebCore/html/HTMLParamElement.h
+++ b/Source/WebCore/html/HTMLParamElement.h
@@ -39,7 +39,7 @@ public:
private:
HTMLParamElement(const QualifiedName&, Document*);
- virtual bool isURLAttribute(Attribute*) const;
+ virtual bool isURLAttribute(const Attribute&) const OVERRIDE;
virtual void addSubresourceAttributeURLs(ListHashSet<KURL>&) const;
};
diff --git a/Source/WebCore/html/HTMLPlugInElement.cpp b/Source/WebCore/html/HTMLPlugInElement.cpp
index 458d15758..a6c24522c 100644
--- a/Source/WebCore/html/HTMLPlugInElement.cpp
+++ b/Source/WebCore/html/HTMLPlugInElement.cpp
@@ -169,8 +169,8 @@ void HTMLPlugInElement::defaultEventHandler(Event* event)
// FIXME: Mouse down and scroll events are passed down to plug-in via custom code in EventHandler; these code paths should be united.
RenderObject* r = renderer();
- if (r && r->isEmbeddedObject() && toRenderEmbeddedObject(r)->showsMissingPluginIndicator()) {
- toRenderEmbeddedObject(r)->handleMissingPluginIndicatorEvent(event);
+ if (r && r->isEmbeddedObject() && toRenderEmbeddedObject(r)->showsUnavailablePluginIndicator()) {
+ toRenderEmbeddedObject(r)->handleUnavailablePluginIndicatorEvent(event);
return;
}
diff --git a/Source/WebCore/html/HTMLPlugInImageElement.cpp b/Source/WebCore/html/HTMLPlugInImageElement.cpp
index 13e8e3f2f..4471c63d5 100644
--- a/Source/WebCore/html/HTMLPlugInImageElement.cpp
+++ b/Source/WebCore/html/HTMLPlugInImageElement.cpp
@@ -189,7 +189,7 @@ void HTMLPlugInImageElement::updateWidgetIfNecessary()
if (!needsWidgetUpdate() || useFallbackContent() || isImageType())
return;
- if (!renderEmbeddedObject() || renderEmbeddedObject()->pluginCrashedOrWasMissing())
+ if (!renderEmbeddedObject() || renderEmbeddedObject()->showsUnavailablePluginIndicator())
return;
updateWidget(CreateOnlyNonNetscapePlugins);
diff --git a/Source/WebCore/html/HTMLProgressElement.cpp b/Source/WebCore/html/HTMLProgressElement.cpp
index 600b185d0..af8191f3e 100644
--- a/Source/WebCore/html/HTMLProgressElement.cpp
+++ b/Source/WebCore/html/HTMLProgressElement.cpp
@@ -151,7 +151,7 @@ void HTMLProgressElement::didElementStateChange()
void HTMLProgressElement::createShadowSubtree()
{
- ASSERT(!hasShadowRoot());
+ ASSERT(!shadow());
RefPtr<ProgressBarElement> bar = ProgressBarElement::create(document());
m_value = ProgressValueElement::create(document());
diff --git a/Source/WebCore/html/HTMLQuoteElement.cpp b/Source/WebCore/html/HTMLQuoteElement.cpp
index d629bc975..cd7211543 100644
--- a/Source/WebCore/html/HTMLQuoteElement.cpp
+++ b/Source/WebCore/html/HTMLQuoteElement.cpp
@@ -49,9 +49,9 @@ Node::InsertionNotificationRequest HTMLQuoteElement::insertedInto(Node* insertio
return HTMLElement::insertedInto(insertionPoint);
}
-bool HTMLQuoteElement::isURLAttribute(Attribute* attribute) const
+bool HTMLQuoteElement::isURLAttribute(const Attribute& attribute) const
{
- return attribute->name() == citeAttr || HTMLElement::isURLAttribute(attribute);
+ return attribute.name() == citeAttr || HTMLElement::isURLAttribute(attribute);
}
}
diff --git a/Source/WebCore/html/HTMLQuoteElement.h b/Source/WebCore/html/HTMLQuoteElement.h
index 21cf50d36..72b82caa4 100644
--- a/Source/WebCore/html/HTMLQuoteElement.h
+++ b/Source/WebCore/html/HTMLQuoteElement.h
@@ -37,7 +37,7 @@ private:
HTMLQuoteElement(const QualifiedName&, Document*);
virtual InsertionNotificationRequest insertedInto(Node*) OVERRIDE;
- virtual bool isURLAttribute(Attribute*) const;
+ virtual bool isURLAttribute(const Attribute&) const OVERRIDE;
};
} //namespace
diff --git a/Source/WebCore/html/HTMLScriptElement.cpp b/Source/WebCore/html/HTMLScriptElement.cpp
index 244fc4f00..0e37be8d7 100644
--- a/Source/WebCore/html/HTMLScriptElement.cpp
+++ b/Source/WebCore/html/HTMLScriptElement.cpp
@@ -47,9 +47,9 @@ PassRefPtr<HTMLScriptElement> HTMLScriptElement::create(const QualifiedName& tag
return adoptRef(new HTMLScriptElement(tagName, document, wasInsertedByParser, false));
}
-bool HTMLScriptElement::isURLAttribute(Attribute* attr) const
+bool HTMLScriptElement::isURLAttribute(const Attribute& attribute) const
{
- return attr->name() == srcAttr || HTMLElement::isURLAttribute(attr);
+ return attribute.name() == srcAttr || HTMLElement::isURLAttribute(attribute);
}
void HTMLScriptElement::childrenChanged(bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta)
diff --git a/Source/WebCore/html/HTMLScriptElement.h b/Source/WebCore/html/HTMLScriptElement.h
index 2e3146e42..038cbe191 100644
--- a/Source/WebCore/html/HTMLScriptElement.h
+++ b/Source/WebCore/html/HTMLScriptElement.h
@@ -48,7 +48,7 @@ private:
virtual InsertionNotificationRequest insertedInto(Node*) OVERRIDE;
virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0);
- virtual bool isURLAttribute(Attribute*) const;
+ virtual bool isURLAttribute(const Attribute&) const OVERRIDE;
virtual void addSubresourceAttributeURLs(ListHashSet<KURL>&) const;
diff --git a/Source/WebCore/html/HTMLSourceElement.cpp b/Source/WebCore/html/HTMLSourceElement.cpp
index c2f93621f..2b331c8bb 100644
--- a/Source/WebCore/html/HTMLSourceElement.cpp
+++ b/Source/WebCore/html/HTMLSourceElement.cpp
@@ -63,14 +63,16 @@ Node::InsertionNotificationRequest HTMLSourceElement::insertedInto(Node* inserti
return InsertionDone;
}
-void HTMLSourceElement::willRemove()
+void HTMLSourceElement::removedFrom(Node* removalRoot)
{
Element* parent = parentElement();
+ if (!parent && removalRoot->isElementNode())
+ parent = toElement(removalRoot);
if (parent && parent->isMediaElement())
- static_cast<HTMLMediaElement*>(parentNode())->sourceWillBeRemoved(this);
- HTMLElement::willRemove();
+ toMediaElement(parent)->sourceWasRemoved(this);
+ HTMLElement::removedFrom(removalRoot);
}
-
+
void HTMLSourceElement::setSrc(const String& url)
{
setAttribute(srcAttr, url);
@@ -117,9 +119,9 @@ void HTMLSourceElement::errorEventTimerFired(Timer<HTMLSourceElement>*)
dispatchEvent(Event::create(eventNames().errorEvent, false, true));
}
-bool HTMLSourceElement::isURLAttribute(Attribute* attribute) const
+bool HTMLSourceElement::isURLAttribute(const Attribute& attribute) const
{
- return attribute->name() == srcAttr || HTMLElement::isURLAttribute(attribute);
+ return attribute.name() == srcAttr || HTMLElement::isURLAttribute(attribute);
}
#if ENABLE(MICRODATA)
diff --git a/Source/WebCore/html/HTMLSourceElement.h b/Source/WebCore/html/HTMLSourceElement.h
index 379183ee9..cb9f413a5 100644
--- a/Source/WebCore/html/HTMLSourceElement.h
+++ b/Source/WebCore/html/HTMLSourceElement.h
@@ -50,8 +50,8 @@ private:
HTMLSourceElement(const QualifiedName&, Document*);
virtual InsertionNotificationRequest insertedInto(Node*) OVERRIDE;
- virtual void willRemove();
- virtual bool isURLAttribute(Attribute*) const;
+ virtual void removedFrom(Node*) OVERRIDE;
+ virtual bool isURLAttribute(const Attribute&) const OVERRIDE;
void errorEventTimerFired(Timer<HTMLSourceElement>*);
diff --git a/Source/WebCore/html/HTMLStyleElement.cpp b/Source/WebCore/html/HTMLStyleElement.cpp
index 86141b651..d1afa1b90 100644
--- a/Source/WebCore/html/HTMLStyleElement.cpp
+++ b/Source/WebCore/html/HTMLStyleElement.cpp
@@ -166,32 +166,19 @@ void HTMLStyleElement::removedFrom(Node* insertionPoint)
{
HTMLElement::removedFrom(insertionPoint);
- if (insertionPoint->inDocument()) {
#if ENABLE(STYLE_SCOPED)
- // In come cases on teardown willRemove is not called - test here for unregistering again
- // FIXME: Do we need to bother?
- if (m_isRegisteredWithScopingNode)
- unregisterWithScopingNode();
-#endif
- StyleElement::removedFromDocument(document(), this);
- }
-}
-
-
-#if ENABLE(STYLE_SCOPED)
-void HTMLStyleElement::willRemove()
-{
// In the current implementation, <style scoped> is only registered if the node is in the document.
// That is, because willRemove() is also called if an ancestor is removed from the document.
// Now, if we want to register <style scoped> even if it's not inDocument,
// we'd need to find a way to discern whether that is the case, or whether <style scoped> itself is about to be removed.
- ASSERT(!scoped() || !inDocument() || m_isRegisteredWithScopingNode || !RuntimeEnabledFeatures::styleScopedEnabled());
if (m_isRegisteredWithScopingNode)
unregisterWithScopingNode();
- HTMLElement::willRemove();
-}
#endif
+ if (insertionPoint->inDocument())
+ StyleElement::removedFromDocument(document(), this);
+}
+
void HTMLStyleElement::childrenChanged(bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta)
{
HTMLElement::childrenChanged(changedByParser, beforeChange, afterChange, childCountDelta);
diff --git a/Source/WebCore/html/HTMLStyleElement.h b/Source/WebCore/html/HTMLStyleElement.h
index 2dc13d836..1ff57c82d 100644
--- a/Source/WebCore/html/HTMLStyleElement.h
+++ b/Source/WebCore/html/HTMLStyleElement.h
@@ -62,9 +62,6 @@ private:
virtual void parseAttribute(Attribute*) OVERRIDE;
virtual InsertionNotificationRequest insertedInto(Node*) OVERRIDE;
virtual void removedFrom(Node*) OVERRIDE;
-#if ENABLE(STYLE_SCOPED)
- virtual void willRemove();
-#endif
virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0);
virtual void finishParsingChildren();
diff --git a/Source/WebCore/html/HTMLSummaryElement.cpp b/Source/WebCore/html/HTMLSummaryElement.cpp
index 1331963f4..f7caeb6af 100644
--- a/Source/WebCore/html/HTMLSummaryElement.cpp
+++ b/Source/WebCore/html/HTMLSummaryElement.cpp
@@ -80,7 +80,7 @@ bool HTMLSummaryElement::childShouldCreateRenderer(const NodeRenderingContext& c
void HTMLSummaryElement::createShadowSubtree()
{
- ASSERT(!hasShadowRoot());
+ ASSERT(!shadow());
RefPtr<ShadowRoot> root = ShadowRoot::create(this, ShadowRoot::CreatingUserAgentShadowRoot);
root->appendChild(DetailsMarkerControl::create(document()), ASSERT_NO_EXCEPTION, true);
root->appendChild(SummaryContentElement::create(document()), ASSERT_NO_EXCEPTION, true);
diff --git a/Source/WebCore/html/HTMLTableCellElement.cpp b/Source/WebCore/html/HTMLTableCellElement.cpp
index 9bf0c91f4..ff0b3c8ed 100644
--- a/Source/WebCore/html/HTMLTableCellElement.cpp
+++ b/Source/WebCore/html/HTMLTableCellElement.cpp
@@ -121,9 +121,9 @@ StylePropertySet* HTMLTableCellElement::additionalAttributeStyle()
return 0;
}
-bool HTMLTableCellElement::isURLAttribute(Attribute *attr) const
+bool HTMLTableCellElement::isURLAttribute(const Attribute& attribute) const
{
- return attr->name() == backgroundAttr || HTMLTablePartElement::isURLAttribute(attr);
+ return attribute.name() == backgroundAttr || HTMLTablePartElement::isURLAttribute(attribute);
}
String HTMLTableCellElement::abbr() const
diff --git a/Source/WebCore/html/HTMLTableCellElement.h b/Source/WebCore/html/HTMLTableCellElement.h
index d1f74fd91..2f41d604e 100644
--- a/Source/WebCore/html/HTMLTableCellElement.h
+++ b/Source/WebCore/html/HTMLTableCellElement.h
@@ -59,7 +59,7 @@ private:
virtual StylePropertySet* additionalAttributeStyle() OVERRIDE;
- virtual bool isURLAttribute(Attribute*) const;
+ virtual bool isURLAttribute(const Attribute&) const OVERRIDE;
virtual void addSubresourceAttributeURLs(ListHashSet<KURL>&) const;
};
diff --git a/Source/WebCore/html/HTMLTableElement.cpp b/Source/WebCore/html/HTMLTableElement.cpp
index b91302f9e..98f76bd99 100644
--- a/Source/WebCore/html/HTMLTableElement.cpp
+++ b/Source/WebCore/html/HTMLTableElement.cpp
@@ -555,9 +555,9 @@ StylePropertySet* HTMLTableElement::additionalGroupStyle(bool rows)
return columnBorderStyle;
}
-bool HTMLTableElement::isURLAttribute(Attribute *attr) const
+bool HTMLTableElement::isURLAttribute(const Attribute& attribute) const
{
- return attr->name() == backgroundAttr || HTMLElement::isURLAttribute(attr);
+ return attribute.name() == backgroundAttr || HTMLElement::isURLAttribute(attribute);
}
HTMLCollection* HTMLTableElement::rows()
diff --git a/Source/WebCore/html/HTMLTableElement.h b/Source/WebCore/html/HTMLTableElement.h
index 895c4fdf3..463e8a4f8 100644
--- a/Source/WebCore/html/HTMLTableElement.h
+++ b/Source/WebCore/html/HTMLTableElement.h
@@ -74,7 +74,7 @@ private:
virtual void parseAttribute(Attribute*) OVERRIDE;
virtual bool isPresentationAttribute(const QualifiedName&) const OVERRIDE;
virtual void collectStyleForAttribute(Attribute*, StylePropertySet*) OVERRIDE;
- virtual bool isURLAttribute(Attribute*) const;
+ virtual bool isURLAttribute(const Attribute&) const OVERRIDE;
// Used to obtain either a solid or outset border decl and to deal with the frame and rules attributes.
virtual StylePropertySet* additionalAttributeStyle() OVERRIDE;
diff --git a/Source/WebCore/html/HTMLTagNames.in b/Source/WebCore/html/HTMLTagNames.in
index 455350b5b..a8cff73ec 100644
--- a/Source/WebCore/html/HTMLTagNames.in
+++ b/Source/WebCore/html/HTMLTagNames.in
@@ -68,6 +68,7 @@ iframe interfaceName=HTMLIFrameElement
image mapToTagName=img
img interfaceName=HTMLImageElement, constructorNeedsFormElement
input constructorNeedsFormElement, constructorNeedsCreatedByParser
+intent conditional=WEB_INTENTS_TAG
ins interfaceName=HTMLModElement
isindex interfaceName=HTMLUnknownElement
kbd interfaceName=HTMLElement
diff --git a/Source/WebCore/html/HTMLTextAreaElement.cpp b/Source/WebCore/html/HTMLTextAreaElement.cpp
index 63663a97f..8257d0f93 100644
--- a/Source/WebCore/html/HTMLTextAreaElement.cpp
+++ b/Source/WebCore/html/HTMLTextAreaElement.cpp
@@ -85,7 +85,7 @@ PassRefPtr<HTMLTextAreaElement> HTMLTextAreaElement::create(const QualifiedName&
void HTMLTextAreaElement::createShadowSubtree()
{
- ASSERT(!hasShadowRoot());
+ ASSERT(!shadow());
RefPtr<ShadowRoot> root = ShadowRoot::create(this, ShadowRoot::CreatingUserAgentShadowRoot);
root->appendChild(TextControlInnerTextElement::create(document()), ASSERT_NO_EXCEPTION);
}
diff --git a/Source/WebCore/html/HTMLTrackElement.cpp b/Source/WebCore/html/HTMLTrackElement.cpp
index afd1dc3de..767320a97 100644
--- a/Source/WebCore/html/HTMLTrackElement.cpp
+++ b/Source/WebCore/html/HTMLTrackElement.cpp
@@ -83,12 +83,15 @@ Node::InsertionNotificationRequest HTMLTrackElement::insertedInto(Node* insertio
return InsertionDone;
}
-void HTMLTrackElement::willRemove()
+void HTMLTrackElement::removedFrom(Node* insertionPoint)
{
- if (HTMLMediaElement* parent = mediaElement())
+ HTMLMediaElement* parent = mediaElement();
+ if (!parent && WebCore::isMediaElement(insertionPoint))
+ parent = toMediaElement(insertionPoint);
+ if (parent)
parent->willRemoveTrack(this);
- HTMLElement::willRemove();
+ HTMLElement::removedFrom(insertionPoint);
}
void HTMLTrackElement::parseAttribute(Attribute* attribute)
@@ -184,9 +187,9 @@ TextTrack* HTMLTrackElement::track()
return ensureTrack();
}
-bool HTMLTrackElement::isURLAttribute(Attribute* attribute) const
+bool HTMLTrackElement::isURLAttribute(const Attribute& attribute) const
{
- return attribute->name() == srcAttr || HTMLElement::isURLAttribute(attribute);
+ return attribute.name() == srcAttr || HTMLElement::isURLAttribute(attribute);
}
void HTMLTrackElement::scheduleLoad()
diff --git a/Source/WebCore/html/HTMLTrackElement.h b/Source/WebCore/html/HTMLTrackElement.h
index a85863d06..f78dae596 100644
--- a/Source/WebCore/html/HTMLTrackElement.h
+++ b/Source/WebCore/html/HTMLTrackElement.h
@@ -78,8 +78,9 @@ private:
virtual void parseAttribute(Attribute*) OVERRIDE;
virtual InsertionNotificationRequest insertedInto(Node*) OVERRIDE;
- virtual void willRemove() OVERRIDE;
- virtual bool isURLAttribute(Attribute*) const;
+
+ virtual void removedFrom(Node*) OVERRIDE;
+ virtual bool isURLAttribute(const Attribute&) const OVERRIDE;
#if ENABLE(MICRODATA)
virtual String itemValueText() const OVERRIDE;
diff --git a/Source/WebCore/html/HTMLVideoElement.cpp b/Source/WebCore/html/HTMLVideoElement.cpp
index d6d74565a..86fe85ef0 100644
--- a/Source/WebCore/html/HTMLVideoElement.cpp
+++ b/Source/WebCore/html/HTMLVideoElement.cpp
@@ -182,10 +182,9 @@ unsigned HTMLVideoElement::height() const
return ok ? h : 0;
}
-bool HTMLVideoElement::isURLAttribute(Attribute* attribute) const
+bool HTMLVideoElement::isURLAttribute(const Attribute& attribute) const
{
- return HTMLMediaElement::isURLAttribute(attribute)
- || attribute->name() == posterAttr;
+ return attribute.name() == posterAttr || HTMLMediaElement::isURLAttribute(attribute);
}
const QualifiedName& HTMLVideoElement::imageSourceAttributeName() const
diff --git a/Source/WebCore/html/HTMLVideoElement.h b/Source/WebCore/html/HTMLVideoElement.h
index 056b83561..67bbe352d 100644
--- a/Source/WebCore/html/HTMLVideoElement.h
+++ b/Source/WebCore/html/HTMLVideoElement.h
@@ -81,7 +81,7 @@ private:
virtual bool isVideo() const { return true; }
virtual bool hasVideo() const { return player() && player()->hasVideo(); }
virtual bool supportsFullscreen() const;
- virtual bool isURLAttribute(Attribute*) const;
+ virtual bool isURLAttribute(const Attribute&) const OVERRIDE;
virtual const QualifiedName& imageSourceAttributeName() const;
virtual bool hasAvailableVideoFrame() const;
diff --git a/Source/WebCore/html/ImageInputType.cpp b/Source/WebCore/html/ImageInputType.cpp
index fc37e29c6..456f22c75 100644
--- a/Source/WebCore/html/ImageInputType.cpp
+++ b/Source/WebCore/html/ImageInputType.cpp
@@ -1,6 +1,7 @@
/*
* Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
* Copyright (C) 2010 Google Inc. All rights reserved.
+ * Copyright (C) 2012 Samsung Electronics. 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
@@ -26,12 +27,16 @@
#include "HTMLFormElement.h"
#include "HTMLImageLoader.h"
#include "HTMLInputElement.h"
+#include "HTMLNames.h"
+#include "HTMLParserIdioms.h"
#include "MouseEvent.h"
#include "RenderImage.h"
#include <wtf/PassOwnPtr.h>
namespace WebCore {
+using namespace HTMLNames;
+
inline ImageInputType::ImageInputType(HTMLInputElement* element)
: BaseButtonInputType(element)
{
@@ -174,4 +179,46 @@ bool ImageInputType::shouldRespectHeightAndWidthAttributes()
return true;
}
+unsigned ImageInputType::height() const
+{
+ RefPtr<HTMLInputElement> element = this->element();
+
+ if (!element->renderer()) {
+ // Check the attribute first for an explicit pixel value.
+ unsigned height;
+ if (parseHTMLNonNegativeInteger(element->fastGetAttribute(heightAttr), height))
+ return height;
+
+ // If the image is available, use its height.
+ if (m_imageLoader->image())
+ return m_imageLoader->image()->imageSizeForRenderer(element->renderer(), 1).height();
+ }
+
+ element->document()->updateLayout();
+
+ RenderBox* box = element->renderBox();
+ return box ? adjustForAbsoluteZoom(box->contentHeight(), box) : 0;
+}
+
+unsigned ImageInputType::width() const
+{
+ RefPtr<HTMLInputElement> element = this->element();
+
+ if (!element->renderer()) {
+ // Check the attribute first for an explicit pixel value.
+ unsigned width;
+ if (parseHTMLNonNegativeInteger(element->fastGetAttribute(widthAttr), width))
+ return width;
+
+ // If the image is available, use its width.
+ if (m_imageLoader->image())
+ return m_imageLoader->image()->imageSizeForRenderer(element->renderer(), 1).width();
+ }
+
+ element->document()->updateLayout();
+
+ RenderBox* box = element->renderBox();
+ return box ? adjustForAbsoluteZoom(box->contentWidth(), box) : 0;
+}
+
} // namespace WebCore
diff --git a/Source/WebCore/html/ImageInputType.h b/Source/WebCore/html/ImageInputType.h
index 93db075d6..5ec97e430 100644
--- a/Source/WebCore/html/ImageInputType.h
+++ b/Source/WebCore/html/ImageInputType.h
@@ -1,6 +1,7 @@
/*
* Copyright (C) 2010 Google Inc. All rights reserved.
* Copyright (C) 2011 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 are
@@ -61,6 +62,8 @@ private:
virtual bool isImageButton() const OVERRIDE;
virtual bool isEnumeratable() OVERRIDE;
virtual bool shouldRespectHeightAndWidthAttributes() OVERRIDE;
+ virtual unsigned height() const OVERRIDE;
+ virtual unsigned width() const OVERRIDE;
OwnPtr<HTMLImageLoader> m_imageLoader;
IntPoint m_clickLocation; // Valid only during HTMLFormElement::prepareForSubmission().
diff --git a/Source/WebCore/html/InputType.cpp b/Source/WebCore/html/InputType.cpp
index 9a3f1629a..cf125c9e0 100644
--- a/Source/WebCore/html/InputType.cpp
+++ b/Source/WebCore/html/InputType.cpp
@@ -5,7 +5,8 @@
* Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
* (C) 2006 Alexey Proskuryakov (ap@nypop.com)
* Copyright (C) 2007 Samuel Weinig (sam@webkit.org)
- * Copyright (C) 2010 Google Inc. All rights reserved.
+ * Copyright (C) 2009, 2010, 2011, 2012 Google Inc. All rights reserved.
+ * Copyright (C) 2012 Samsung Electronics. 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
@@ -27,6 +28,7 @@
#include "config.h"
#include "InputType.h"
+#include "AXObjectCache.h"
#include "BeforeTextInsertedEvent.h"
#include "ButtonInputType.h"
#include "CheckboxInputType.h"
@@ -42,6 +44,8 @@
#include "FormDataList.h"
#include "HTMLFormElement.h"
#include "HTMLInputElement.h"
+#include "HTMLNames.h"
+#include "HTMLParserIdioms.h"
#include "HTMLShadowElement.h"
#include "HiddenInputType.h"
#include "ImageInputType.h"
@@ -391,11 +395,11 @@ void InputType::createShadowSubtree()
void InputType::destroyShadowSubtree()
{
- if (!element()->hasShadowRoot())
+ ElementShadow* shadow = element()->shadow();
+ if (!shadow)
return;
- ShadowRoot* root = element()->shadow()->oldestShadowRoot();
- ASSERT(root);
+ ShadowRoot* root = shadow->oldestShadowRoot();
root->removeAllChildren();
// It's ok to clear contents of all other ShadowRoots because they must have
@@ -704,6 +708,36 @@ bool InputType::isURLField() const
return false;
}
+bool InputType::isDateField() const
+{
+ return false;
+}
+
+bool InputType::isDateTimeField() const
+{
+ return false;
+}
+
+bool InputType::isDateTimeLocalField() const
+{
+ return false;
+}
+
+bool InputType::isMonthField() const
+{
+ return false;
+}
+
+bool InputType::isTimeField() const
+{
+ return false;
+}
+
+bool InputType::isWeekField() const
+{
+ return false;
+}
+
bool InputType::isEnumeratable()
{
return true;
@@ -772,6 +806,251 @@ bool InputType::supportsIndeterminateAppearance() const
return false;
}
+unsigned InputType::height() const
+{
+ return 0;
+}
+
+unsigned InputType::width() const
+{
+ return 0;
+}
+
+void InputType::applyStep(double count, AnyStepHandling anyStepHandling, TextFieldEventBehavior eventBehavior, ExceptionCode& ec)
+{
+ double step;
+ unsigned stepDecimalPlaces, currentDecimalPlaces;
+ if (!getAllowedValueStepWithDecimalPlaces(anyStepHandling, &step, &stepDecimalPlaces)) {
+ ec = INVALID_STATE_ERR;
+ return;
+ }
+
+ const double nan = numeric_limits<double>::quiet_NaN();
+ double current = parseToDoubleWithDecimalPlaces(element()->value(), nan, &currentDecimalPlaces);
+ if (!isfinite(current)) {
+ ec = INVALID_STATE_ERR;
+ return;
+ }
+ double newValue = current + step * count;
+ if (isinf(newValue)) {
+ ec = INVALID_STATE_ERR;
+ return;
+ }
+
+ double acceptableErrorValue = acceptableError(step);
+ if (newValue - minimum() < -acceptableErrorValue) {
+ ec = INVALID_STATE_ERR;
+ return;
+ }
+ if (newValue < minimum())
+ newValue = minimum();
+
+ const AtomicString& stepString = element()->fastGetAttribute(stepAttr);
+ if (!equalIgnoringCase(stepString, "any"))
+ newValue = alignValueForStep(newValue, step, currentDecimalPlaces, stepDecimalPlaces);
+
+ if (newValue - maximum() > acceptableErrorValue) {
+ ec = INVALID_STATE_ERR;
+ return;
+ }
+ if (newValue > maximum())
+ newValue = maximum();
+
+ element()->setValueAsNumber(newValue, ec, eventBehavior);
+
+ if (AXObjectCache::accessibilityEnabled())
+ element()->document()->axObjectCache()->postNotification(element()->renderer(), AXObjectCache::AXValueChanged, true);
+}
+
+double InputType::alignValueForStep(double newValue, double step, unsigned currentDecimalPlaces, unsigned stepDecimalPlaces)
+{
+ if (newValue >= pow(10.0, 21.0))
+ return newValue;
+
+ unsigned baseDecimalPlaces;
+ double base = stepBaseWithDecimalPlaces(&baseDecimalPlaces);
+ baseDecimalPlaces = min(baseDecimalPlaces, 16u);
+ if (element()->stepMismatch(element()->value())) {
+ double scale = pow(10.0, static_cast<double>(max(stepDecimalPlaces, currentDecimalPlaces)));
+ newValue = round(newValue * scale) / scale;
+ } else {
+ double scale = pow(10.0, static_cast<double>(max(stepDecimalPlaces, baseDecimalPlaces)));
+ newValue = round((base + round((newValue - base) / step) * step) * scale) / scale;
+ }
+
+ return newValue;
+}
+
+bool InputType::getAllowedValueStep(double* step) const
+{
+ return getAllowedValueStepWithDecimalPlaces(RejectAny, step, 0);
+}
+
+bool InputType::getAllowedValueStepWithDecimalPlaces(AnyStepHandling anyStepHandling, double* step, unsigned* decimalPlaces) const
+{
+ ASSERT(step);
+ double defaultStepValue = defaultStep();
+ double stepScaleFactorValue = stepScaleFactor();
+ if (!isfinite(defaultStepValue) || !isfinite(stepScaleFactorValue))
+ return false;
+ const AtomicString& stepString = element()->fastGetAttribute(stepAttr);
+ if (stepString.isEmpty()) {
+ *step = defaultStepValue * stepScaleFactorValue;
+ if (decimalPlaces)
+ *decimalPlaces = 0;
+ return true;
+ }
+
+ if (equalIgnoringCase(stepString, "any")) {
+ switch (anyStepHandling) {
+ case RejectAny:
+ return false;
+ case AnyIsDefaultStep:
+ *step = defaultStepValue * stepScaleFactorValue;
+ if (decimalPlaces)
+ *decimalPlaces = 0;
+ return true;
+ default:
+ ASSERT_NOT_REACHED();
+ }
+ }
+
+ double parsed;
+ if (!decimalPlaces) {
+ if (!parseToDoubleForNumberType(stepString, &parsed) || parsed <= 0.0) {
+ *step = defaultStepValue * stepScaleFactorValue;
+ return true;
+ }
+ } else {
+ if (!parseToDoubleForNumberTypeWithDecimalPlaces(stepString, &parsed, decimalPlaces) || parsed <= 0.0) {
+ *step = defaultStepValue * stepScaleFactorValue;
+ *decimalPlaces = 0;
+ return true;
+ }
+ }
+ // For date, month, week, the parsed value should be an integer for some types.
+ if (parsedStepValueShouldBeInteger())
+ parsed = max(round(parsed), 1.0);
+ double result = parsed * stepScaleFactorValue;
+ // For datetime, datetime-local, time, the result should be an integer.
+ if (scaledStepValueShouldBeInteger())
+ result = max(round(result), 1.0);
+ ASSERT(result > 0);
+ *step = result;
+ return true;
+}
+
+void InputType::stepUp(int n, ExceptionCode& ec)
+{
+ applyStep(n, RejectAny, DispatchNoEvent, ec);
+}
+
+void InputType::stepUpFromRenderer(int n)
+{
+ // The differences from stepUp()/stepDown():
+ //
+ // Difference 1: the current value
+ // If the current value is not a number, including empty, the current value is assumed as 0.
+ // * If 0 is in-range, and matches to step value
+ // - The value should be the +step if n > 0
+ // - The value should be the -step if n < 0
+ // If -step or +step is out of range, new value should be 0.
+ // * If 0 is smaller than the minimum value
+ // - The value should be the minimum value for any n
+ // * If 0 is larger than the maximum value
+ // - The value should be the maximum value for any n
+ // * If 0 is in-range, but not matched to step value
+ // - The value should be the larger matched value nearest to 0 if n > 0
+ // e.g. <input type=number min=-100 step=3> -> 2
+ // - The value should be the smaler matched value nearest to 0 if n < 0
+ // e.g. <input type=number min=-100 step=3> -> -1
+ // As for date/datetime-local/month/time/week types, the current value is assumed as "the current local date/time".
+ // As for datetime type, the current value is assumed as "the current date/time in UTC".
+ // If the current value is smaller than the minimum value:
+ // - The value should be the minimum value if n > 0
+ // - Nothing should happen if n < 0
+ // If the current value is larger than the maximum value:
+ // - The value should be the maximum value if n < 0
+ // - Nothing should happen if n > 0
+ //
+ // Difference 2: clamping steps
+ // If the current value is not matched to step value:
+ // - The value should be the larger matched value nearest to 0 if n > 0
+ // e.g. <input type=number value=3 min=-100 step=3> -> 5
+ // - The value should be the smaler matched value nearest to 0 if n < 0
+ // e.g. <input type=number value=3 min=-100 step=3> -> 2
+ //
+ // n is assumed as -n if step < 0.
+
+ ASSERT(isSteppable());
+ if (!isSteppable())
+ return;
+ ASSERT(n);
+ if (!n)
+ return;
+
+ unsigned stepDecimalPlaces, baseDecimalPlaces;
+ double step, base;
+ // FIXME: Not any changes after stepping, even if it is an invalid value, may be better.
+ // (e.g. Stepping-up for <input type="number" value="foo" step="any" /> => "foo")
+ if (!getAllowedValueStepWithDecimalPlaces(AnyIsDefaultStep, &step, &stepDecimalPlaces))
+ return;
+ base = stepBaseWithDecimalPlaces(&baseDecimalPlaces);
+ baseDecimalPlaces = min(baseDecimalPlaces, 16u);
+
+ int sign;
+ if (step > 0)
+ sign = n;
+ else if (step < 0)
+ sign = -n;
+ else
+ sign = 0;
+
+ const double nan = numeric_limits<double>::quiet_NaN();
+ String currentStringValue = element()->value();
+ double current = parseToDouble(currentStringValue, nan);
+ if (!isfinite(current)) {
+ ExceptionCode ec;
+ current = defaultValueForStepUp();
+ double nextDiff = step * n;
+ if (current < minimum() - nextDiff)
+ current = minimum() - nextDiff;
+ if (current > maximum() - nextDiff)
+ current = maximum() - nextDiff;
+ element()->setValueAsNumber(current, ec, DispatchInputAndChangeEvent);
+ }
+ if ((sign > 0 && current < minimum()) || (sign < 0 && current > maximum()))
+ element()->setValue(serialize(sign > 0 ? minimum() : maximum()), DispatchInputAndChangeEvent);
+ else {
+ ExceptionCode ec;
+ if (element()->stepMismatch(element()->value())) {
+ ASSERT(step);
+ double newValue;
+ double scale = pow(10.0, static_cast<double>(max(stepDecimalPlaces, baseDecimalPlaces)));
+
+ if (sign < 0)
+ newValue = round((base + floor((current - base) / step) * step) * scale) / scale;
+ else if (sign > 0)
+ newValue = round((base + ceil((current - base) / step) * step) * scale) / scale;
+ else
+ newValue = current;
+
+ if (newValue < minimum())
+ newValue = minimum();
+ if (newValue > maximum())
+ newValue = maximum();
+
+ element()->setValueAsNumber(newValue, ec, n == 1 || n == -1 ? DispatchInputAndChangeEvent : DispatchNoEvent);
+ current = newValue;
+ if (n > 1)
+ applyStep(n - 1, AnyIsDefaultStep, DispatchInputAndChangeEvent, ec);
+ else if (n < -1)
+ applyStep(n + 1, AnyIsDefaultStep, DispatchInputAndChangeEvent, ec);
+ } else
+ applyStep(n, AnyIsDefaultStep, DispatchInputAndChangeEvent, ec);
+ }
+}
+
namespace InputTypeNames {
// The type names must be lowercased because they will be the return values of
diff --git a/Source/WebCore/html/InputType.h b/Source/WebCore/html/InputType.h
index e9032c0fd..1c86cb0fc 100644
--- a/Source/WebCore/html/InputType.h
+++ b/Source/WebCore/html/InputType.h
@@ -1,6 +1,7 @@
/*
* Copyright (C) 2010 Google Inc. All rights reserved.
* Copyright (C) 2011 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 are
@@ -98,11 +99,15 @@ public:
virtual bool isColorControl() const;
#endif
virtual bool isCheckbox() const;
+ virtual bool isDateField() const;
+ virtual bool isDateTimeField() const;
+ virtual bool isDateTimeLocalField() const;
virtual bool isEmailField() const;
virtual bool isFileUpload() const;
virtual bool isHiddenType() const;
virtual bool isImageButton() const;
virtual bool supportLabels() const;
+ virtual bool isMonthField() const;
virtual bool isNumberField() const;
virtual bool isPasswordField() const;
virtual bool isRadioButton() const;
@@ -113,7 +118,9 @@ public:
virtual bool isTextButton() const;
virtual bool isTextField() const;
virtual bool isTextType() const;
+ virtual bool isTimeField() const;
virtual bool isURLField() const;
+ virtual bool isWeekField() const;
// Form value functions
@@ -153,6 +160,9 @@ public:
virtual bool stepMismatch(const String&, double step) const;
virtual double stepBase() const;
virtual double stepBaseWithDecimalPlaces(unsigned*) const;
+ virtual bool getAllowedValueStep(double*) const;
+ virtual void stepUp(int, ExceptionCode&);
+ virtual void stepUpFromRenderer(int);
virtual double defaultStep() const;
virtual double stepScaleFactor() const;
virtual bool parsedStepValueShouldBeInteger() const;
@@ -275,6 +285,11 @@ public:
virtual bool supportsIndeterminateAppearance() const;
+ // Gets width and height of the input element if the type of the
+ // element is image. It returns 0 if the element is not image type.
+ virtual unsigned height() const;
+ virtual unsigned width() const;
+
protected:
InputType(HTMLInputElement* element) : m_element(element) { }
HTMLInputElement* element() const { return m_element; }
@@ -284,6 +299,13 @@ protected:
Chrome* chrome() const;
private:
+ enum AnyStepHandling { RejectAny, AnyIsDefaultStep };
+
+ // Helper for stepUp()/stepDown(). Adds step value * count to the current value.
+ void applyStep(double count, AnyStepHandling, TextFieldEventBehavior, ExceptionCode&);
+ double alignValueForStep(double value, double step, unsigned currentDecimalPlaces, unsigned stepDecimalPlaces);
+ bool getAllowedValueStepWithDecimalPlaces(AnyStepHandling, double*, unsigned*) const;
+
// Raw pointer because the HTMLInputElement object owns this InputType object.
HTMLInputElement* m_element;
};
diff --git a/Source/WebCore/html/MonthInputType.cpp b/Source/WebCore/html/MonthInputType.cpp
index f61c3989f..40cbb2af4 100644
--- a/Source/WebCore/html/MonthInputType.cpp
+++ b/Source/WebCore/html/MonthInputType.cpp
@@ -144,6 +144,11 @@ bool MonthInputType::setMillisecondToDateComponents(double value, DateComponents
return date->setMonthsSinceEpoch(value);
}
+bool MonthInputType::isMonthField() const
+{
+ return true;
+}
+
} // namespace WebCore
#endif
diff --git a/Source/WebCore/html/MonthInputType.h b/Source/WebCore/html/MonthInputType.h
index 031096ef6..2f95b87cc 100644
--- a/Source/WebCore/html/MonthInputType.h
+++ b/Source/WebCore/html/MonthInputType.h
@@ -56,6 +56,7 @@ private:
virtual bool parsedStepValueShouldBeInteger() const OVERRIDE;
virtual bool parseToDateComponentsInternal(const UChar*, unsigned length, DateComponents*) const OVERRIDE;
virtual bool setMillisecondToDateComponents(double, DateComponents*) const OVERRIDE;
+ virtual bool isMonthField() const OVERRIDE;
};
} // namespace WebCore
diff --git a/Source/WebCore/html/RadioNodeList.cpp b/Source/WebCore/html/RadioNodeList.cpp
new file mode 100644
index 000000000..b72a3d42c
--- /dev/null
+++ b/Source/WebCore/html/RadioNodeList.cpp
@@ -0,0 +1,103 @@
+/*
+ * Copyright (c) 2012 Motorola Mobility, 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 MOTOROLA MOBILITY, 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 MOTOROLA MOBILITY, 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 "RadioNodeList.h"
+
+#include "Element.h"
+#include "HTMLFormElement.h"
+#include "HTMLInputElement.h"
+#include "HTMLNames.h"
+
+namespace WebCore {
+
+using namespace HTMLNames;
+
+RadioNodeList::RadioNodeList(const AtomicString& name, Element* formElement)
+ : DynamicSubtreeNodeList(formElement->document())
+ , m_name(name)
+ , m_formElement(formElement)
+{
+ m_formElement->document()->registerDynamicSubtreeNodeList(this);
+}
+
+RadioNodeList::~RadioNodeList()
+{
+ m_formElement->removeCachedRadioNodeList(this, m_name);
+ m_formElement->document()->unregisterDynamicSubtreeNodeList(this);
+}
+
+static inline HTMLInputElement* toRadioButtonInputElement(Node* node)
+{
+ ASSERT(node->isElementNode());
+ HTMLInputElement* inputElement = node->toInputElement();
+ if (!inputElement || !inputElement->isRadioButton() || inputElement->value().isEmpty())
+ return 0;
+ return inputElement;
+}
+
+String RadioNodeList::value() const
+{
+ for (unsigned i = 0; i < length(); ++i) {
+ Node* node = item(i);
+ const HTMLInputElement* inputElement = toRadioButtonInputElement(node);
+ if (!inputElement || !inputElement->checked())
+ continue;
+ return inputElement->value();
+ }
+ return String();
+}
+
+void RadioNodeList::setValue(const String& value)
+{
+ for (unsigned i = 0; i < length(); ++i) {
+ Node* node = item(i);
+ HTMLInputElement* inputElement = toRadioButtonInputElement(node);
+ if (!inputElement || inputElement->value() != value)
+ continue;
+ inputElement->setChecked(true);
+ return;
+ }
+}
+
+bool RadioNodeList::nodeMatches(Element* testElement) const
+{
+ if (!testElement->isFormControlElement())
+ return false;
+
+ HTMLFormElement* formElement = static_cast<HTMLFormControlElement*>(testElement)->form();
+ if (!formElement || formElement != m_formElement)
+ return false;
+
+ if (HTMLInputElement* inputElement = testElement->toInputElement()) {
+ if (inputElement->isImageButton())
+ return false;
+ }
+
+ return equalIgnoringCase(testElement->getIdAttribute(), m_name) || equalIgnoringCase(testElement->getNameAttribute(), m_name);
+}
+
+} // namspace
+
diff --git a/Source/WebCore/html/RadioNodeList.h b/Source/WebCore/html/RadioNodeList.h
new file mode 100644
index 000000000..ebde79792
--- /dev/null
+++ b/Source/WebCore/html/RadioNodeList.h
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2012 Motorola Mobility, 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 MOTOROLA MOBILITY, 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 MOTOROLA MOBILITY, 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 RadioNodeList_h
+#define RadioNodeList_h
+
+#include "DynamicNodeList.h"
+#include <wtf/PassRefPtr.h>
+#include <wtf/RefPtr.h>
+#include <wtf/Vector.h>
+#include <wtf/text/AtomicString.h>
+
+namespace WebCore {
+
+class RadioNodeList : public DynamicSubtreeNodeList {
+public:
+ static PassRefPtr<RadioNodeList> create(const AtomicString& name, Element* formElement)
+ {
+ return adoptRef(new RadioNodeList(name, formElement));
+ }
+
+ ~RadioNodeList();
+
+ String value() const;
+ void setValue(const String&);
+
+protected:
+ virtual bool nodeMatches(Element*) const;
+
+private:
+ RadioNodeList(const AtomicString& name, Element*);
+
+ AtomicString m_name;
+ RefPtr<Element> m_formElement;
+};
+
+} // namepsace
+
+#endif
+
diff --git a/Source/WebCore/html/RadioNodeList.idl b/Source/WebCore/html/RadioNodeList.idl
new file mode 100644
index 000000000..8ed57bacd
--- /dev/null
+++ b/Source/WebCore/html/RadioNodeList.idl
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2012 Motorola Mobility, 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 MOTOROLA MOBILITY, 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 MOTOROLA MOBILITY, 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 html {
+
+ interface [
+ JSGenerateToJSObject,
+ IndexedGetter,
+ ] RadioNodeList : NodeList {
+ attribute DOMString value;
+ };
+}
+
diff --git a/Source/WebCore/html/RangeInputType.cpp b/Source/WebCore/html/RangeInputType.cpp
index 4949b0a4e..6f1d1924b 100644
--- a/Source/WebCore/html/RangeInputType.cpp
+++ b/Source/WebCore/html/RangeInputType.cpp
@@ -160,7 +160,7 @@ void RangeInputType::handleMouseDownEvent(MouseEvent* event)
Node* targetNode = event->target()->toNode();
if (event->button() != LeftButton || !targetNode)
return;
- ASSERT(element()->hasShadowRoot());
+ ASSERT(element()->shadow());
if (targetNode != element() && !targetNode->isDescendantOf(element()->shadow()->oldestShadowRoot()))
return;
SliderThumbElement* thumb = sliderThumbElementOf(element());
@@ -237,7 +237,7 @@ void RangeInputType::handleKeydownEvent(KeyboardEvent* event)
void RangeInputType::createShadowSubtree()
{
- ASSERT(element()->hasShadowRoot());
+ ASSERT(element()->shadow());
Document* document = element()->document();
RefPtr<HTMLDivElement> track = HTMLDivElement::create(document);
diff --git a/Source/WebCore/html/TextFieldInputType.cpp b/Source/WebCore/html/TextFieldInputType.cpp
index d63f7ef8a..9a3b25aba 100644
--- a/Source/WebCore/html/TextFieldInputType.cpp
+++ b/Source/WebCore/html/TextFieldInputType.cpp
@@ -221,7 +221,7 @@ bool TextFieldInputType::shouldHaveSpinButton() const
void TextFieldInputType::createShadowSubtree()
{
- ASSERT(element()->hasShadowRoot());
+ ASSERT(element()->shadow());
ASSERT(!m_innerText);
ASSERT(!m_innerBlock);
diff --git a/Source/WebCore/html/TimeInputType.cpp b/Source/WebCore/html/TimeInputType.cpp
index 71092d0a8..d4fd2a443 100644
--- a/Source/WebCore/html/TimeInputType.cpp
+++ b/Source/WebCore/html/TimeInputType.cpp
@@ -116,6 +116,11 @@ bool TimeInputType::setMillisecondToDateComponents(double value, DateComponents*
return date->setMillisecondsSinceMidnight(value);
}
+bool TimeInputType::isTimeField() const
+{
+ return true;
+}
+
} // namespace WebCore
#endif
diff --git a/Source/WebCore/html/TimeInputType.h b/Source/WebCore/html/TimeInputType.h
index c06709e66..02c9553d0 100644
--- a/Source/WebCore/html/TimeInputType.h
+++ b/Source/WebCore/html/TimeInputType.h
@@ -53,6 +53,7 @@ private:
virtual bool scaledStepValueShouldBeInteger() const OVERRIDE;
virtual bool parseToDateComponentsInternal(const UChar*, unsigned length, DateComponents*) const OVERRIDE;
virtual bool setMillisecondToDateComponents(double, DateComponents*) const OVERRIDE;
+ virtual bool isTimeField() const OVERRIDE;
};
} // namespace WebCore
diff --git a/Source/WebCore/html/WeekInputType.cpp b/Source/WebCore/html/WeekInputType.cpp
index 4e2bc2991..cd5456c23 100644
--- a/Source/WebCore/html/WeekInputType.cpp
+++ b/Source/WebCore/html/WeekInputType.cpp
@@ -104,6 +104,11 @@ bool WeekInputType::setMillisecondToDateComponents(double value, DateComponents*
return date->setMillisecondsSinceEpochForWeek(value);
}
+bool WeekInputType::isWeekField() const
+{
+ return true;
+}
+
} // namespace WebCore
#endif
diff --git a/Source/WebCore/html/WeekInputType.h b/Source/WebCore/html/WeekInputType.h
index 5eb11069d..11626f772 100644
--- a/Source/WebCore/html/WeekInputType.h
+++ b/Source/WebCore/html/WeekInputType.h
@@ -53,6 +53,7 @@ private:
virtual bool parsedStepValueShouldBeInteger() const OVERRIDE;
virtual bool parseToDateComponentsInternal(const UChar*, unsigned length, DateComponents*) const OVERRIDE;
virtual bool setMillisecondToDateComponents(double, DateComponents*) const OVERRIDE;
+ virtual bool isWeekField() const OVERRIDE;
};
} // namespace WebCore
diff --git a/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp b/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp
index e5d8742f9..efd0d727b 100644
--- a/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp
+++ b/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp
@@ -2053,10 +2053,7 @@ void CanvasRenderingContext2D::drawTextInternal(const String& text, float x, flo
bool isRTL = direction == RTL;
bool override = computedStyle ? isOverride(computedStyle->unicodeBidi()) : false;
- unsigned length = text.length();
- const UChar* string = text.characters();
- TextRun textRun(string, length, false, 0, 0, TextRun::AllowTrailingExpansion, direction, override, true, TextRun::NoRounding);
-
+ TextRun textRun(text, 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) {
@@ -2077,7 +2074,7 @@ void CanvasRenderingContext2D::drawTextInternal(const String& text, float x, flo
break;
}
- float fontWidth = font.width(TextRun(text, false, 0, 0, TextRun::AllowTrailingExpansion, direction, override));
+ float fontWidth = font.width(TextRun(text, 0, 0, TextRun::AllowTrailingExpansion, direction, override));
useMaxWidth = (useMaxWidth && maxWidth < fontWidth);
float width = useMaxWidth ? maxWidth : fontWidth;
diff --git a/Source/WebCore/html/canvas/WebGLRenderingContext.cpp b/Source/WebCore/html/canvas/WebGLRenderingContext.cpp
index 70a4b118d..46ed8b756 100644
--- a/Source/WebCore/html/canvas/WebGLRenderingContext.cpp
+++ b/Source/WebCore/html/canvas/WebGLRenderingContext.cpp
@@ -1036,7 +1036,7 @@ void WebGLRenderingContext::blendFuncSeparate(GC3Denum srcRGB, GC3Denum dstRGB,
cleanupAfterGraphicsCall(false);
}
-void WebGLRenderingContext::bufferData(GC3Denum target, GC3Dsizeiptr size, GC3Denum usage, ExceptionCode& ec)
+void WebGLRenderingContext::bufferData(GC3Denum target, long long size, GC3Denum usage, ExceptionCode& ec)
{
UNUSED_PARAM(ec);
if (isContextLost())
@@ -1049,13 +1049,13 @@ void WebGLRenderingContext::bufferData(GC3Denum target, GC3Dsizeiptr size, GC3De
return;
}
if (!isErrorGeneratedOnOutOfBoundsAccesses()) {
- if (!buffer->associateBufferData(size)) {
+ if (!buffer->associateBufferData(static_cast<GC3Dsizeiptr>(size))) {
synthesizeGLError(GraphicsContext3D::INVALID_VALUE, "bufferData", "invalid buffer");
return;
}
}
- m_context->bufferData(target, size, usage);
+ m_context->bufferData(target, static_cast<GC3Dsizeiptr>(size), usage);
cleanupAfterGraphicsCall(false);
}
@@ -1105,7 +1105,7 @@ void WebGLRenderingContext::bufferData(GC3Denum target, ArrayBufferView* data, G
cleanupAfterGraphicsCall(false);
}
-void WebGLRenderingContext::bufferSubData(GC3Denum target, GC3Dintptr offset, ArrayBuffer* data, ExceptionCode& ec)
+void WebGLRenderingContext::bufferSubData(GC3Denum target, long long offset, ArrayBuffer* data, ExceptionCode& ec)
{
UNUSED_PARAM(ec);
if (isContextLost())
@@ -1120,17 +1120,17 @@ void WebGLRenderingContext::bufferSubData(GC3Denum target, GC3Dintptr offset, Ar
if (!data)
return;
if (!isErrorGeneratedOnOutOfBoundsAccesses()) {
- if (!buffer->associateBufferSubData(offset, data)) {
+ if (!buffer->associateBufferSubData(static_cast<GC3Dintptr>(offset), data)) {
synthesizeGLError(GraphicsContext3D::INVALID_VALUE, "bufferSubData", "offset out of range");
return;
}
}
- m_context->bufferSubData(target, offset, data->byteLength(), data->data());
+ m_context->bufferSubData(target, static_cast<GC3Dintptr>(offset), data->byteLength(), data->data());
cleanupAfterGraphicsCall(false);
}
-void WebGLRenderingContext::bufferSubData(GC3Denum target, GC3Dintptr offset, ArrayBufferView* data, ExceptionCode& ec)
+void WebGLRenderingContext::bufferSubData(GC3Denum target, long long offset, ArrayBufferView* data, ExceptionCode& ec)
{
UNUSED_PARAM(ec);
if (isContextLost())
@@ -1145,13 +1145,13 @@ void WebGLRenderingContext::bufferSubData(GC3Denum target, GC3Dintptr offset, Ar
if (!data)
return;
if (!isErrorGeneratedOnOutOfBoundsAccesses()) {
- if (!buffer->associateBufferSubData(offset, data)) {
+ if (!buffer->associateBufferSubData(static_cast<GC3Dintptr>(offset), data)) {
synthesizeGLError(GraphicsContext3D::INVALID_VALUE, "bufferSubData", "offset out of range");
return;
}
}
- m_context->bufferSubData(target, offset, data->byteLength(), data->baseAddress());
+ m_context->bufferSubData(target, static_cast<GC3Dintptr>(offset), data->byteLength(), data->baseAddress());
cleanupAfterGraphicsCall(false);
}
@@ -1898,7 +1898,7 @@ void WebGLRenderingContext::drawArrays(GC3Denum mode, GC3Dint first, GC3Dsizei c
cleanupAfterGraphicsCall(true);
}
-void WebGLRenderingContext::drawElements(GC3Denum mode, GC3Dsizei count, GC3Denum type, GC3Dintptr offset, ExceptionCode& ec)
+void WebGLRenderingContext::drawElements(GC3Denum mode, GC3Dsizei count, GC3Denum type, long long offset, ExceptionCode& ec)
{
UNUSED_PARAM(ec);
@@ -1933,14 +1933,14 @@ void WebGLRenderingContext::drawElements(GC3Denum mode, GC3Dsizei count, GC3Denu
int numElements = 0;
if (!isErrorGeneratedOnOutOfBoundsAccesses()) {
// Ensure we have a valid rendering state
- if (!validateElementArraySize(count, type, offset)) {
+ if (!validateElementArraySize(count, type, static_cast<GC3Dintptr>(offset))) {
synthesizeGLError(GraphicsContext3D::INVALID_OPERATION, "drawElements", "request out of bounds for current ELEMENT_ARRAY_BUFFER");
return;
}
if (!count)
return;
if (!validateIndexArrayConservative(type, numElements) || !validateRenderingState(numElements)) {
- if (!validateIndexArrayPrecise(count, type, offset, numElements) || !validateRenderingState(numElements)) {
+ if (!validateIndexArrayPrecise(count, type, static_cast<GC3Dintptr>(offset), numElements) || !validateRenderingState(numElements)) {
synthesizeGLError(GraphicsContext3D::INVALID_OPERATION, "drawElements", "attempt to access out of bounds arrays");
return;
}
@@ -1961,12 +1961,12 @@ void WebGLRenderingContext::drawElements(GC3Denum mode, GC3Dsizei count, GC3Denu
bool vertexAttrib0Simulated = false;
if (!isGLES2Compliant()) {
if (!numElements)
- validateIndexArrayPrecise(count, type, offset, numElements);
+ validateIndexArrayPrecise(count, type, static_cast<GC3Dintptr>(offset), numElements);
vertexAttrib0Simulated = simulateVertexAttrib0(numElements);
}
if (!isGLES2NPOTStrict())
handleNPOTTextures(true);
- m_context->drawElements(mode, count, type, offset);
+ m_context->drawElements(mode, count, type, static_cast<GC3Dintptr>(offset));
if (!isGLES2Compliant() && vertexAttrib0Simulated)
restoreStatesAfterVertexAttrib0Simulation();
if (!isGLES2NPOTStrict())
@@ -3038,13 +3038,13 @@ WebGLGetInfo WebGLRenderingContext::getVertexAttrib(GC3Duint index, GC3Denum pna
}
}
-GC3Dsizeiptr WebGLRenderingContext::getVertexAttribOffset(GC3Duint index, GC3Denum pname)
+long long WebGLRenderingContext::getVertexAttribOffset(GC3Duint index, GC3Denum pname)
{
if (isContextLost())
return 0;
GC3Dsizeiptr result = m_context->getVertexAttribOffset(index, pname);
cleanupAfterGraphicsCall(false);
- return result;
+ return static_cast<long long>(result);
}
void WebGLRenderingContext::hint(GC3Denum target, GC3Denum mode)
@@ -4250,7 +4250,7 @@ void WebGLRenderingContext::vertexAttrib4fv(GC3Duint index, GC3Dfloat* v, GC3Dsi
vertexAttribfvImpl("vertexAttrib4fv", index, v, size, 4);
}
-void WebGLRenderingContext::vertexAttribPointer(GC3Duint index, GC3Dint size, GC3Denum type, GC3Dboolean normalized, GC3Dsizei stride, GC3Dintptr offset, ExceptionCode& ec)
+void WebGLRenderingContext::vertexAttribPointer(GC3Duint index, GC3Dint size, GC3Denum type, GC3Dboolean normalized, GC3Dsizei stride, long long offset, ExceptionCode& ec)
{
UNUSED_PARAM(ec);
if (isContextLost())
@@ -4284,7 +4284,7 @@ void WebGLRenderingContext::vertexAttribPointer(GC3Duint index, GC3Dint size, GC
synthesizeGLError(GraphicsContext3D::INVALID_ENUM, "vertexAttribPointer", "invalid type");
return;
}
- if ((stride % typeSize) || (offset % typeSize)) {
+ if ((stride % typeSize) || (static_cast<GC3Dintptr>(offset) % typeSize)) {
synthesizeGLError(GraphicsContext3D::INVALID_OPERATION, "vertexAttribPointer", "stride or offset not valid for type");
return;
}
@@ -4300,8 +4300,8 @@ void WebGLRenderingContext::vertexAttribPointer(GC3Duint index, GC3Dint size, GC
state.normalized = normalized;
state.stride = validatedStride;
state.originalStride = stride;
- state.offset = offset;
- m_context->vertexAttribPointer(index, size, type, normalized, stride, offset);
+ state.offset = static_cast<GC3Dintptr>(offset);
+ m_context->vertexAttribPointer(index, size, type, normalized, stride, static_cast<GC3Dintptr>(offset));
cleanupAfterGraphicsCall(false);
}
diff --git a/Source/WebCore/html/canvas/WebGLRenderingContext.h b/Source/WebCore/html/canvas/WebGLRenderingContext.h
index b7d0ab4bf..f18cb1753 100644
--- a/Source/WebCore/html/canvas/WebGLRenderingContext.h
+++ b/Source/WebCore/html/canvas/WebGLRenderingContext.h
@@ -96,11 +96,11 @@ public:
void blendFunc(GC3Denum sfactor, GC3Denum dfactor);
void blendFuncSeparate(GC3Denum srcRGB, GC3Denum dstRGB, GC3Denum srcAlpha, GC3Denum dstAlpha);
- void bufferData(GC3Denum target, GC3Dsizeiptr size, GC3Denum usage, ExceptionCode&);
+ void bufferData(GC3Denum target, long long size, GC3Denum usage, ExceptionCode&);
void bufferData(GC3Denum target, ArrayBuffer* data, GC3Denum usage, ExceptionCode&);
void bufferData(GC3Denum target, ArrayBufferView* data, GC3Denum usage, ExceptionCode&);
- void bufferSubData(GC3Denum target, GC3Dintptr offset, ArrayBuffer* data, ExceptionCode&);
- void bufferSubData(GC3Denum target, GC3Dintptr offset, ArrayBufferView* data, ExceptionCode&);
+ void bufferSubData(GC3Denum target, long long offset, ArrayBuffer* data, ExceptionCode&);
+ void bufferSubData(GC3Denum target, long long offset, ArrayBufferView* data, ExceptionCode&);
GC3Denum checkFramebufferStatus(GC3Denum target);
void clear(GC3Dbitfield mask);
@@ -141,7 +141,7 @@ public:
void disable(GC3Denum cap);
void disableVertexAttribArray(GC3Duint index, ExceptionCode&);
void drawArrays(GC3Denum mode, GC3Dint first, GC3Dsizei count, ExceptionCode&);
- void drawElements(GC3Denum mode, GC3Dsizei count, GC3Denum type, GC3Dintptr offset, ExceptionCode&);
+ void drawElements(GC3Denum mode, GC3Dsizei count, GC3Denum type, long long offset, ExceptionCode&);
void enable(GC3Denum cap);
void enableVertexAttribArray(GC3Duint index, ExceptionCode&);
@@ -174,7 +174,7 @@ public:
WebGLGetInfo getUniform(WebGLProgram*, const WebGLUniformLocation*, ExceptionCode&);
PassRefPtr<WebGLUniformLocation> getUniformLocation(WebGLProgram*, const String&, ExceptionCode&);
WebGLGetInfo getVertexAttrib(GC3Duint index, GC3Denum pname, ExceptionCode&);
- GC3Dsizeiptr getVertexAttribOffset(GC3Duint index, GC3Denum pname);
+ long long getVertexAttribOffset(GC3Duint index, GC3Denum pname);
void hint(GC3Denum target, GC3Denum mode);
GC3Dboolean isBuffer(WebGLBuffer*);
@@ -281,7 +281,7 @@ public:
void vertexAttrib4fv(GC3Duint index, Float32Array* values);
void vertexAttrib4fv(GC3Duint index, GC3Dfloat* values, GC3Dsizei size);
void vertexAttribPointer(GC3Duint index, GC3Dint size, GC3Denum type, GC3Dboolean normalized,
- GC3Dsizei stride, GC3Dintptr offset, ExceptionCode&);
+ GC3Dsizei stride, long long offset, ExceptionCode&);
void viewport(GC3Dint x, GC3Dint y, GC3Dsizei width, GC3Dsizei height);
diff --git a/Source/WebCore/html/canvas/WebGLRenderingContext.idl b/Source/WebCore/html/canvas/WebGLRenderingContext.idl
index 9f0893fe3..0f73fbd28 100644
--- a/Source/WebCore/html/canvas/WebGLRenderingContext.idl
+++ b/Source/WebCore/html/canvas/WebGLRenderingContext.idl
@@ -463,9 +463,9 @@ module html {
[StrictTypeChecking] void blendFuncSeparate(in unsigned long srcRGB, in unsigned long dstRGB, in unsigned long srcAlpha, in unsigned long dstAlpha);
[StrictTypeChecking] void bufferData(in unsigned long target, in ArrayBuffer data, in unsigned long usage) raises (DOMException);
[StrictTypeChecking] void bufferData(in unsigned long target, in ArrayBufferView data, in unsigned long usage) raises (DOMException);
- [StrictTypeChecking] void bufferData(in unsigned long target, in long size, in unsigned long usage) raises (DOMException);
- [StrictTypeChecking] void bufferSubData(in unsigned long target, in long offset, in ArrayBuffer data) raises (DOMException);
- [StrictTypeChecking] void bufferSubData(in unsigned long target, in long offset, in ArrayBufferView data) raises (DOMException);
+ [StrictTypeChecking] void bufferData(in unsigned long target, in long long size, in unsigned long usage) raises (DOMException);
+ [StrictTypeChecking] void bufferSubData(in unsigned long target, in long long offset, in ArrayBuffer data) raises (DOMException);
+ [StrictTypeChecking] void bufferSubData(in unsigned long target, in long long offset, in ArrayBufferView data) raises (DOMException);
[StrictTypeChecking] unsigned long checkFramebufferStatus(in unsigned long target);
[StrictTypeChecking] void clear(in unsigned long mask);
@@ -507,7 +507,7 @@ module html {
[StrictTypeChecking] void disable(in unsigned long cap);
[StrictTypeChecking] void disableVertexAttribArray(in unsigned long index) raises(DOMException);
[StrictTypeChecking] void drawArrays(in unsigned long mode, in long first, in long count) raises(DOMException);
- [StrictTypeChecking] void drawElements(in unsigned long mode, in long count, in unsigned long type, in long offset) raises(DOMException);
+ [StrictTypeChecking] void drawElements(in unsigned long mode, in long count, in unsigned long type, in long long offset) raises(DOMException);
[StrictTypeChecking] void enable(in unsigned long cap);
[StrictTypeChecking] void enableVertexAttribArray(in unsigned long index) raises(DOMException);
@@ -567,7 +567,7 @@ module html {
// any getVertexAttrib(in unsigned long index, in unsigned long pname) raises(DOMException);
[StrictTypeChecking, Custom] void getVertexAttrib();
- [StrictTypeChecking] long getVertexAttribOffset(in unsigned long index, in unsigned long pname);
+ [StrictTypeChecking] long long getVertexAttribOffset(in unsigned long index, in unsigned long pname);
[StrictTypeChecking] void hint(in unsigned long target, in unsigned long mode);
[StrictTypeChecking] boolean isBuffer(in WebGLBuffer buffer);
@@ -661,7 +661,7 @@ module html {
[StrictTypeChecking] void vertexAttrib4f(in unsigned long indx, in float x, in float y, in float z, in float w);
[StrictTypeChecking, Custom] void vertexAttrib4fv(in unsigned long indx, in Float32Array values);
[StrictTypeChecking] void vertexAttribPointer(in unsigned long indx, in long size, in unsigned long type, in boolean normalized,
- in long stride, in long offset) raises(DOMException);
+ in long stride, in long long offset) raises(DOMException);
[StrictTypeChecking] void viewport(in long x, in long y, in long width, in long height);
};
diff --git a/Source/WebCore/html/parser/HTMLElementStack.cpp b/Source/WebCore/html/parser/HTMLElementStack.cpp
index 2b57e3436..cd5d08a55 100644
--- a/Source/WebCore/html/parser/HTMLElementStack.cpp
+++ b/Source/WebCore/html/parser/HTMLElementStack.cpp
@@ -462,19 +462,6 @@ bool inScopeCommon(HTMLElementStack::ElementRecord* top, const AtomicString& tar
return false;
}
-bool HTMLElementStack::hasOnlyHTMLElementsInScope() const
-{
- for (ElementRecord* record = m_top.get(); record; record = record->next()) {
- ContainerNode* node = record->node();
- if (!isInHTMLNamespace(node))
- return false;
- if (isScopeMarker(node))
- return true;
- }
- ASSERT_NOT_REACHED(); // <html> is always on the stack and is a scope marker.
- return true;
-}
-
bool HTMLElementStack::hasNumberedHeaderElementInScope() const
{
for (ElementRecord* record = m_top.get(); record; record = record->next()) {
diff --git a/Source/WebCore/html/parser/HTMLElementStack.h b/Source/WebCore/html/parser/HTMLElementStack.h
index 5697e80c8..f7baa3644 100644
--- a/Source/WebCore/html/parser/HTMLElementStack.h
+++ b/Source/WebCore/html/parser/HTMLElementStack.h
@@ -140,7 +140,6 @@ public:
bool inSelectScope(const AtomicString& tagName) const;
bool inSelectScope(const QualifiedName&) const;
- bool hasOnlyHTMLElementsInScope() const;
bool hasNumberedHeaderElementInScope() const;
bool hasOnlyOneElement() const;
diff --git a/Source/WebCore/html/shadow/CalendarPickerElement.cpp b/Source/WebCore/html/shadow/CalendarPickerElement.cpp
index 75eeef638..1a7b49fa6 100644
--- a/Source/WebCore/html/shadow/CalendarPickerElement.cpp
+++ b/Source/WebCore/html/shadow/CalendarPickerElement.cpp
@@ -68,6 +68,12 @@ PassRefPtr<CalendarPickerElement> CalendarPickerElement::create(Document* docume
return adoptRef(new CalendarPickerElement(document));
}
+CalendarPickerElement::~CalendarPickerElement()
+{
+ closePopup();
+ ASSERT(!m_popup);
+}
+
RenderObject* CalendarPickerElement::createRenderer(RenderArena* arena, RenderStyle*)
{
return new (arena) RenderDetailsMarker(this);
diff --git a/Source/WebCore/html/shadow/CalendarPickerElement.h b/Source/WebCore/html/shadow/CalendarPickerElement.h
index 6bd208e8f..e6f6a4d1d 100644
--- a/Source/WebCore/html/shadow/CalendarPickerElement.h
+++ b/Source/WebCore/html/shadow/CalendarPickerElement.h
@@ -43,6 +43,7 @@ class PagePopup;
class CalendarPickerElement : public HTMLDivElement, public PagePopupClient {
public:
static PassRefPtr<CalendarPickerElement> create(Document*);
+ virtual ~CalendarPickerElement();
void openPopup();
void closePopup();
diff --git a/Source/WebCore/html/shadow/SliderThumbElement.cpp b/Source/WebCore/html/shadow/SliderThumbElement.cpp
index fee991d91..7f1f1d5c0 100644
--- a/Source/WebCore/html/shadow/SliderThumbElement.cpp
+++ b/Source/WebCore/html/shadow/SliderThumbElement.cpp
@@ -358,7 +358,7 @@ const AtomicString& TrackLimiterElement::shadowPseudoId() const
TrackLimiterElement* trackLimiterElementOf(Node* node)
{
ASSERT(node);
- ASSERT(node->toInputElement()->hasShadowRoot());
+ ASSERT(node->toInputElement()->shadow());
ShadowRoot* shadow = node->toInputElement()->shadow()->oldestShadowRoot();
ASSERT(shadow);
Node* limiter = shadow->firstChild()->lastChild();
diff --git a/Source/WebCore/inspector/CodeGeneratorInspector.py b/Source/WebCore/inspector/CodeGeneratorInspector.py
index d629cafeb..74aa14c90 100755
--- a/Source/WebCore/inspector/CodeGeneratorInspector.py
+++ b/Source/WebCore/inspector/CodeGeneratorInspector.py
@@ -2912,7 +2912,7 @@ frontend_cpp_file = open(output_cpp_dirname + "/InspectorFrontend.cpp", "w")
typebuilder_h_file = open(output_header_dirname + "/InspectorTypeBuilder.h", "w")
typebuilder_cpp_file = open(output_cpp_dirname + "/InspectorTypeBuilder.cpp", "w")
-backend_js_file = open(output_cpp_dirname + "/InspectorBackendStub.js", "w")
+backend_js_file = open(output_cpp_dirname + "/InspectorBackendCommands.js", "w")
backend_h_file.write(Templates.backend_h.substitute(None,
diff --git a/Source/WebCore/inspector/InspectorDOMAgent.cpp b/Source/WebCore/inspector/InspectorDOMAgent.cpp
index 61030770f..8996f66e1 100644
--- a/Source/WebCore/inspector/InspectorDOMAgent.cpp
+++ b/Source/WebCore/inspector/InspectorDOMAgent.cpp
@@ -340,9 +340,11 @@ void InspectorDOMAgent::unbind(Node* node, NodeToIdMap* nodesMap)
unbind(contentDocument, nodesMap);
}
- if (node->isElementNode() && toElement(node)->hasShadowRoot()) {
- for (ShadowRoot* root = toElement(node)->shadow()->youngestShadowRoot(); root; root = root->olderShadowRoot())
- unbind(root, nodesMap);
+ if (node->isElementNode()) {
+ if (ElementShadow* shadow = toElement(node)->shadow()) {
+ for (ShadowRoot* root = shadow->youngestShadowRoot(); root; root = root->olderShadowRoot())
+ unbind(root, nodesMap);
+ }
}
nodesMap->remove(node);
@@ -1226,9 +1228,11 @@ PassRefPtr<TypeBuilder::DOM::Node> InspectorDOMAgent::buildObjectForNode(Node* n
if (doc)
value->setContentDocument(buildObjectForNode(doc, 0, nodesMap));
}
- if (element->hasShadowRoot()) {
+
+ ElementShadow* shadow = element->shadow();
+ if (shadow) {
RefPtr<TypeBuilder::Array<TypeBuilder::DOM::Node> > shadowRoots = TypeBuilder::Array<TypeBuilder::DOM::Node>::create();
- for (ShadowRoot* root = element->shadow()->youngestShadowRoot(); root; root = root->olderShadowRoot())
+ for (ShadowRoot* root = shadow->youngestShadowRoot(); root; root = root->olderShadowRoot())
shadowRoots->addItem(buildObjectForNode(root, 0, nodesMap));
value->setShadowRoots(shadowRoots);
}
diff --git a/Source/WebCore/inspector/InspectorStyleSheet.cpp b/Source/WebCore/inspector/InspectorStyleSheet.cpp
index 32a5c22ea..0565ff44e 100644
--- a/Source/WebCore/inspector/InspectorStyleSheet.cpp
+++ b/Source/WebCore/inspector/InspectorStyleSheet.cpp
@@ -718,10 +718,10 @@ String InspectorStyleSheet::finalURL() const
void InspectorStyleSheet::reparseStyleSheet(const String& text)
{
+ CSSStyleSheet::RuleMutationScope mutationScope(m_pageStyleSheet.get());
m_pageStyleSheet->internal()->clearRules();
m_pageStyleSheet->internal()->parseString(text);
m_pageStyleSheet->clearChildRuleCSSOMWrappers();
- m_pageStyleSheet->styleSheetChanged();
m_inspectorStyles.clear();
fireStyleSheetChanged();
}
diff --git a/Source/WebCore/inspector/front-end/BreakpointManager.js b/Source/WebCore/inspector/front-end/BreakpointManager.js
index 65b2fb228..d1c0e9936 100644
--- a/Source/WebCore/inspector/front-end/BreakpointManager.js
+++ b/Source/WebCore/inspector/front-end/BreakpointManager.js
@@ -43,8 +43,8 @@ WebInspector.BreakpointManager = function(breakpointStorage, debuggerModel, sour
this._breakpoints = [];
this._breakpointForDebuggerId = {};
- this._breakpointForUILocation = {};
- this._uiSourceCodeIds = {};
+ this._breakpointsForUILocation = {};
+ this._sourceFilesWithRestoredBreakpoints = {};
this._debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.BreakpointResolved, this._breakpointResolved, this);
this._debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.GlobalObjectCleared, this._debuggerReset, this);
@@ -61,9 +61,10 @@ WebInspector.BreakpointManager.prototype = {
*/
restoreBreakpoints: function(uiSourceCode)
{
- if (!uiSourceCode.id || this._uiSourceCodeIds[uiSourceCode.id])
+ var sourceFileId = uiSourceCode.breakpointStorageId();
+ if (!sourceFileId || this._sourceFilesWithRestoredBreakpoints[sourceFileId])
return;
- this._uiSourceCodeIds[uiSourceCode.id] = true;
+ this._sourceFilesWithRestoredBreakpoints[sourceFileId] = true;
// Erase provisional breakpoints prior to restoring them.
for (var debuggerId in this._breakpointForDebuggerId) {
@@ -73,7 +74,7 @@ WebInspector.BreakpointManager.prototype = {
this._debuggerModel.removeBreakpoint(debuggerId);
delete this._breakpointForDebuggerId[debuggerId];
}
- this._storage.restoreBreakpoints(uiSourceCode);
+ this._storage._restoreBreakpoints(uiSourceCode);
},
/**
@@ -81,14 +82,23 @@ WebInspector.BreakpointManager.prototype = {
* @param {number} lineNumber
* @param {string} condition
* @param {boolean} enabled
- * @param {boolean=} doNotActivateBreakpoints
* @return {WebInspector.BreakpointManager.Breakpoint}
*/
- setBreakpoint: function(uiSourceCode, lineNumber, condition, enabled, doNotActivateBreakpoints)
+ setBreakpoint: function(uiSourceCode, lineNumber, condition, enabled)
{
- if (!doNotActivateBreakpoints)
- this._debuggerModel.setBreakpointsActive(true);
+ this._debuggerModel.setBreakpointsActive(true);
+ return this._innerSetBreakpoint(uiSourceCode, lineNumber, condition, enabled);
+ },
+ /**
+ * @param {WebInspector.UISourceCode} uiSourceCode
+ * @param {number} lineNumber
+ * @param {string} condition
+ * @param {boolean} enabled
+ * @return {WebInspector.BreakpointManager.Breakpoint}
+ */
+ _innerSetBreakpoint: function(uiSourceCode, lineNumber, condition, enabled)
+ {
var breakpoint = this.findBreakpoint(uiSourceCode, lineNumber);
if (breakpoint) {
breakpoint._updateBreakpoint(condition, enabled);
@@ -106,7 +116,8 @@ WebInspector.BreakpointManager.prototype = {
*/
findBreakpoint: function(uiSourceCode, lineNumber)
{
- return this._breakpointForUILocation[uiSourceCode.id + ":" + lineNumber];
+ var breakpoints = this._breakpointsForUILocation[uiSourceCode.id + ":" + lineNumber];
+ return breakpoints ? breakpoints[0] : null;
},
/**
@@ -146,17 +157,19 @@ WebInspector.BreakpointManager.prototype = {
for (var debuggerId in this._breakpointForDebuggerId)
this._debuggerModel.removeBreakpoint(debuggerId);
this._breakpointForDebuggerId = {};
- this._uiSourceCodeIds = {};
+ this._sourceFilesWithRestoredBreakpoints = {};
},
_debuggerReset: function()
{
var breakpoints = this._breakpoints.slice();
- for (var i = 0; i < breakpoints.length; ++i)
+ for (var i = 0; i < breakpoints.length; ++i) {
breakpoints[i]._resetLocations();
+ breakpoints[i]._isProvisional = true;
+ }
this._breakpoints = [];
- this._breakpointForUILocation = {};
- this._uiSourceCodeIds = {};
+ this._breakpointsForUILocation = {};
+ this._sourceFilesWithRestoredBreakpoints = {};
},
_breakpointResolved: function(event)
@@ -164,10 +177,8 @@ WebInspector.BreakpointManager.prototype = {
var breakpointId = /** @type {DebuggerAgent.BreakpointId} */ event.data.breakpointId;
var location = /** @type {DebuggerAgent.Location} */ event.data.location;
var breakpoint = this._breakpointForDebuggerId[breakpointId];
- if (!breakpoint) {
- // Provisional breakpoint.
+ if (!breakpoint || breakpoint._isProvisional)
return;
- }
breakpoint._addResolvedLocation(location);
},
@@ -189,7 +200,13 @@ WebInspector.BreakpointManager.prototype = {
*/
_uiLocationAdded: function(breakpoint, uiLocation)
{
- this._breakpointForUILocation[uiLocation.uiSourceCode.id + ":" + uiLocation.lineNumber] = breakpoint;
+ var key = uiLocation.uiSourceCode.id + ":" + uiLocation.lineNumber;
+ var breakpoints = this._breakpointsForUILocation[key];
+ if (!breakpoints) {
+ breakpoints = [];
+ this._breakpointsForUILocation[key] = breakpoints;
+ }
+ breakpoints.push(breakpoint);
this.dispatchEventToListeners(WebInspector.BreakpointManager.Events.BreakpointAdded, {breakpoint: breakpoint, uiLocation: uiLocation});
},
@@ -199,7 +216,13 @@ WebInspector.BreakpointManager.prototype = {
*/
_uiLocationRemoved: function(breakpoint, uiLocation)
{
- delete this._breakpointForUILocation[uiLocation.uiSourceCode.id + ":" + uiLocation.lineNumber];
+ var key = uiLocation.uiSourceCode.id + ":" + uiLocation.lineNumber;
+ var breakpoints = this._breakpointsForUILocation[key];
+ if (!breakpoints)
+ return;
+ breakpoints.remove(breakpoint);
+ if (!breakpoints.length)
+ delete this._breakpointsForUILocation[key];
this.dispatchEventToListeners(WebInspector.BreakpointManager.Events.BreakpointRemoved, {breakpoint: breakpoint, uiLocation: uiLocation});
}
}
@@ -388,7 +411,7 @@ WebInspector.BreakpointManager.Breakpoint.prototype = {
*/
_breakpointStorageId: function()
{
- return this._primaryUILocation.uiSourceCode.id + ":" + this._primaryUILocation.lineNumber;
+ return this._primaryUILocation.uiSourceCode.breakpointStorageId() + ":" + this._primaryUILocation.lineNumber;
},
_fakeBreakpointAtPrimaryLocation: function()
@@ -421,13 +444,14 @@ WebInspector.BreakpointManager.Storage.prototype = {
/**
* @param {WebInspector.UISourceCode} uiSourceCode
*/
- restoreBreakpoints: function(uiSourceCode)
+ _restoreBreakpoints: function(uiSourceCode)
{
this._muted = true;
+ var breakpointStorageId = uiSourceCode.breakpointStorageId();
for (var id in this._breakpoints) {
var breakpoint = this._breakpoints[id];
- if (breakpoint.sourceFileId === uiSourceCode.id)
- this._breakpointManager.setBreakpoint(uiSourceCode, breakpoint.lineNumber, breakpoint.condition, breakpoint.enabled, true);
+ if (breakpoint.sourceFileId === breakpointStorageId)
+ this._breakpointManager._innerSetBreakpoint(uiSourceCode, breakpoint.lineNumber, breakpoint.condition, breakpoint.enabled);
}
delete this._muted;
},
@@ -470,7 +494,7 @@ WebInspector.BreakpointManager.Storage.prototype = {
WebInspector.BreakpointManager.Storage.Item = function(breakpoint)
{
var primaryUILocation = breakpoint.primaryUILocation();
- this.sourceFileId = primaryUILocation.uiSourceCode.id;
+ this.sourceFileId = primaryUILocation.uiSourceCode.breakpointStorageId();
this.lineNumber = primaryUILocation.lineNumber;
this.condition = breakpoint.condition();
this.enabled = breakpoint.enabled();
diff --git a/Source/WebCore/inspector/front-end/HeapSnapshotView.js b/Source/WebCore/inspector/front-end/HeapSnapshotView.js
index 6c51480fc..9becab3ae 100644
--- a/Source/WebCore/inspector/front-end/HeapSnapshotView.js
+++ b/Source/WebCore/inspector/front-end/HeapSnapshotView.js
@@ -790,12 +790,12 @@ WebInspector.HeapProfileHeader = function(profileType, title, uid, maxJSObjectId
WebInspector.HeapProfileHeader.prototype = {
/**
* @override
- * @param {Function} callback
+ * @param {function(WebInspector.HeapSnapshotProxy):void} callback
*/
load: function(callback)
{
if (this._loaded) {
- callback.call(null);
+ callback(this._proxy);
return;
}
diff --git a/Source/WebCore/inspector/front-end/InspectorBackendStub.qrc b/Source/WebCore/inspector/front-end/InspectorBackendCommands.qrc
index 30f6d7577..5b1488b7c 100644
--- a/Source/WebCore/inspector/front-end/InspectorBackendStub.qrc
+++ b/Source/WebCore/inspector/front-end/InspectorBackendCommands.qrc
@@ -1,6 +1,6 @@
<!DOCTYPE RCC><RCC version="1.0">
<qresource prefix="/webkit/inspector">
- <file>InspectorBackendStub.js</file>
+ <file>InspectorBackendCommands.js</file>
</qresource>
</RCC>
diff --git a/Source/WebCore/inspector/front-end/JavaScriptSource.js b/Source/WebCore/inspector/front-end/JavaScriptSource.js
index 352e650ed..b36653600 100644
--- a/Source/WebCore/inspector/front-end/JavaScriptSource.js
+++ b/Source/WebCore/inspector/front-end/JavaScriptSource.js
@@ -67,6 +67,14 @@ WebInspector.JavaScriptSource.prototype = {
{
this._consoleMessages = [];
this.dispatchEventToListeners(WebInspector.UISourceCode.Events.ConsoleMessagesCleared);
+ },
+
+ /**
+ * @return {string}
+ */
+ breakpointStorageId: function()
+ {
+ return this.id;
}
}
diff --git a/Source/WebCore/inspector/front-end/JavaScriptSourceFrame.js b/Source/WebCore/inspector/front-end/JavaScriptSourceFrame.js
index f0dd97a47..da390af20 100644
--- a/Source/WebCore/inspector/front-end/JavaScriptSourceFrame.js
+++ b/Source/WebCore/inspector/front-end/JavaScriptSourceFrame.js
@@ -41,7 +41,6 @@ WebInspector.JavaScriptSourceFrame = function(scriptsPanel, model, uiSourceCode)
this._model = model;
this._breakpointManager = this._model.breakpointManager;
this._uiSourceCode = uiSourceCode;
- this._breakpoints = {};
var locations = this._breakpointManager.breakpointLocationsForUISourceCode(this._uiSourceCode);
for (var i = 0; i < locations.length; ++i)
@@ -121,20 +120,18 @@ WebInspector.JavaScriptSourceFrame.prototype = {
var oldContent = /** @type {string} */ event.data.oldContent;
var content = /** @type {string} */ event.data.content;
- var breakpoints = {};
- for (var lineNumber in this._breakpoints) {
- breakpoints[lineNumber] = this._breakpoints[lineNumber];
- this._breakpoints[lineNumber].remove();
- }
+ var breakpointLocations = this._breakpointManager.breakpointLocationsForUISourceCode(this._uiSourceCode);
+ for (var i = 0; i < breakpointLocations.length; ++i)
+ breakpointLocations[i].breakpoint.remove();
this.setContent(content, false, "text/javascript");
- this._updateBreakpointsAfterLiveEdit(oldContent, content, breakpoints);
+ this._updateBreakpointsAfterLiveEdit(oldContent, content, breakpointLocations);
},
populateLineGutterContextMenu: function(contextMenu, lineNumber)
{
contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Continue to here" : "Continue to Here"), this._continueToLine.bind(this, lineNumber));
- var breakpoint = this._breakpoints[lineNumber];
+ var breakpoint = this._breakpointManager.findBreakpoint(this._uiSourceCode, lineNumber);
if (!breakpoint) {
// This row doesn't have a breakpoint: We want to show Add Breakpoint and Add and Edit Breakpoint.
contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Add breakpoint" : "Add Breakpoint"), this._setBreakpoint.bind(this, lineNumber, "", true));
@@ -181,15 +178,13 @@ WebInspector.JavaScriptSourceFrame.prototype = {
{
if (!this._isDirty) {
// Disable all breakpoints in the model, store them as muted breakpoints.
- for (var lineNumber = 0; lineNumber < this.textModel.linesCount; ++lineNumber) {
- var breakpointAttribute = this.textModel.getAttribute(lineNumber, "breakpoint");
- if (breakpointAttribute) {
- var breakpoint = this._breakpoints[lineNumber];
- if (breakpoint)
- breakpoint.remove();
- // Re-adding decoration only.
- this._addBreakpointDecoration(lineNumber, breakpointAttribute.condition, breakpointAttribute.enabled, true);
- }
+ var breakpointLocations = this._breakpointManager.breakpointLocationsForUISourceCode(this._uiSourceCode);
+ var lineNumbers = {};
+ 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);
}
}
@@ -387,7 +382,7 @@ WebInspector.JavaScriptSourceFrame.prototype = {
return;
var lineNumber = target.lineNumber;
- var breakpoint = this._breakpoints[lineNumber];
+ var breakpoint = this._breakpointManager.findBreakpoint(this._uiSourceCode, lineNumber);
if (breakpoint) {
if (event.shiftKey)
breakpoint.setEnabled(!breakpoint.enabled());
@@ -503,7 +498,6 @@ WebInspector.JavaScriptSourceFrame.prototype = {
return;
var breakpoint = /** @type {WebInspector.BreakpointManager.Breakpoint} */ event.data.breakpoint;
- this._breakpoints[uiLocation.lineNumber] = breakpoint;
if (this.loaded)
this._addBreakpointDecoration(uiLocation.lineNumber, breakpoint.condition(), breakpoint.enabled(), false);
},
@@ -515,11 +509,10 @@ WebInspector.JavaScriptSourceFrame.prototype = {
return;
var breakpoint = /** @type {WebInspector.BreakpointManager.Breakpoint} */ event.data.breakpoint;
- if (this._breakpoints[uiLocation.lineNumber] !== breakpoint)
- return;
- delete this._breakpoints[uiLocation.lineNumber];
- if (this.loaded)
+ var remainingBreakpoint = this._breakpointManager.findBreakpoint(this._uiSourceCode, uiLocation.lineNumber);
+ if (!remainingBreakpoint && this.loaded) {
this._removeBreakpointDecoration(uiLocation.lineNumber);
+ }
},
_consoleMessageAdded: function(event)
@@ -539,9 +532,10 @@ WebInspector.JavaScriptSourceFrame.prototype = {
if (typeof this._executionLineNumber === "number")
this.setExecutionLine(this._executionLineNumber);
- for (var lineNumber in this._breakpoints) {
- var breakpoint = this._breakpoints[lineNumber];
- this._addBreakpointDecoration(parseInt(lineNumber, 10), breakpoint.condition(), breakpoint.enabled(), false);
+ var breakpointLocations = this._breakpointManager.breakpointLocationsForUISourceCode(this._uiSourceCode);
+ for (var i = 0; i < breakpointLocations.length; ++i) {
+ var breakpoint = breakpointLocations[i].breakpoint;
+ this._addBreakpointDecoration(breakpointLocations[i].uiLocation.lineNumber, breakpoint.condition(), breakpoint.enabled(), false);
}
var messages = this._uiSourceCode.consoleMessages();
@@ -572,13 +566,14 @@ WebInspector.JavaScriptSourceFrame.prototype = {
/**
* @param {string} oldSource
* @param {string} newSource
- * @param {Object.<string, WebInspector.BreakpointManager.Breakpoint>} breakpoints
+ * @param {Array.<Object>} breakpointLocations
*/
- _updateBreakpointsAfterLiveEdit: function(oldSource, newSource, breakpoints)
+ _updateBreakpointsAfterLiveEdit: function(oldSource, newSource, breakpointLocations)
{
// Clear and re-create breakpoints according to text diff.
var diff = Array.diff(oldSource.split("\n"), newSource.split("\n"));
- for (var lineNumber in breakpoints) {
+ for (var i = 0; i < breakpointLocations.length; ++i) {
+ var lineNumber = breakpointLocations[i].uiLocation.lineNumber;
var newLineNumber = diff.left[lineNumber].row;
if (newLineNumber === undefined) {
for (var i = lineNumber - 1; i >= 0; --i) {
@@ -594,7 +589,7 @@ WebInspector.JavaScriptSourceFrame.prototype = {
}
}
if (newLineNumber !== undefined) {
- var breakpoint = breakpoints[lineNumber];
+ var breakpoint = breakpointLocations[i].breakpoint;
this._setBreakpoint(newLineNumber, breakpoint.condition(), breakpoint.enabled());
}
}
diff --git a/Source/WebCore/inspector/front-end/NetworkPanel.js b/Source/WebCore/inspector/front-end/NetworkPanel.js
index 7e07f534d..c4acdad7a 100644
--- a/Source/WebCore/inspector/front-end/NetworkPanel.js
+++ b/Source/WebCore/inspector/front-end/NetworkPanel.js
@@ -1000,13 +1000,13 @@ WebInspector.NetworkLogView.prototype = {
log: (new WebInspector.HARLog(this._requests)).build()
};
- WebInspector.save(WebInspector.inspectedPageDomain + ".har", JSON.stringify(harArchive, null, 2), true);
+ WebInspector.fileManager.save(WebInspector.inspectedPageDomain + ".har", JSON.stringify(harArchive, null, 2), true);
},
_exportRequest: function(request)
{
var har = (new WebInspector.HAREntry(request)).build();
- WebInspector.save(request.displayName + ".har", JSON.stringify(har, null, 2), true);
+ WebInspector.fileManager.save(request.displayName + ".har", JSON.stringify(har, null, 2), true);
},
_clearBrowserCache: function(event)
diff --git a/Source/WebCore/inspector/front-end/ResourcesPanel.js b/Source/WebCore/inspector/front-end/ResourcesPanel.js
index af46d8683..22e552042 100644
--- a/Source/WebCore/inspector/front-end/ResourcesPanel.js
+++ b/Source/WebCore/inspector/front-end/ResourcesPanel.js
@@ -1278,7 +1278,7 @@ WebInspector.FrameResourceTreeElement.prototype = {
function doSave(forceSaveAs, content)
{
- WebInspector.save(this._resource.url, content, forceSaveAs);
+ WebInspector.fileManager.save(this._resource.url, content, forceSaveAs);
}
function save(forceSaveAs)
@@ -2049,7 +2049,7 @@ WebInspector.ResourceRevisionTreeElement.prototype = {
if (InspectorFrontendHost.canSave()) {
function doSave(forceSaveAs, content)
{
- WebInspector.save(this._revision.resource.url, content, forceSaveAs);
+ WebInspector.fileManager.save(this._revision.resource.url, content, forceSaveAs);
}
function save(forceSaveAs)
diff --git a/Source/WebCore/inspector/front-end/SearchController.js b/Source/WebCore/inspector/front-end/SearchController.js
index f0ce3fca2..98a59a05c 100644
--- a/Source/WebCore/inspector/front-end/SearchController.js
+++ b/Source/WebCore/inspector/front-end/SearchController.js
@@ -36,7 +36,7 @@ WebInspector.SearchController = function()
{
this.element = document.getElementById("search");
this._matchesElement = document.getElementById("search-results-matches");
- this._toolbarLabelElement = document.getElementById("search-toolbar-label");
+ this._searchItemElement = document.getElementById("toolbar-search-item");
this._searchControlBoxElement = document.getElementById("toolbar-search-navigation-control");
this.element.addEventListener("search", this._onSearch.bind(this), false); // when the search is emptied
@@ -70,12 +70,7 @@ WebInspector.SearchController.prototype = {
if (!panelName)
return;
var newLabel = WebInspector.UIString("Search %s", panelName);
- if (WebInspector.isCompactMode())
- this.element.setAttribute("placeholder", newLabel);
- else {
- this.element.removeAttribute("placeholder");
- this._toolbarLabelElement.textContent = newLabel;
- }
+ this.element.setAttribute("placeholder", newLabel);
},
cancelSearch: function()
@@ -156,13 +151,10 @@ WebInspector.SearchController.prototype = {
_updateSearchNavigationButtonState: function(visible)
{
- if (visible) {
- this._searchNavigationNext.removeStyleClass("hidden");
- this._searchNavigationPrev.removeStyleClass("hidden");
- } else {
- this._searchNavigationNext.addStyleClass("hidden");
- this._searchNavigationPrev.addStyleClass("hidden");
- }
+ if (visible)
+ this._searchItemElement.addStyleClass("with-navigation-buttons");
+ else
+ this._searchItemElement.removeStyleClass("with-navigation-buttons");
},
/**
@@ -338,7 +330,7 @@ WebInspector.SearchController.prototype = {
var searchNavigationControlElement = document.createElement("div");
var searchNavigationIconElement = document.createElement("div");
- searchNavigationControlElement.className = "toolbar-search-navigation-label hidden";
+ searchNavigationControlElement.className = "toolbar-search-navigation-label";
switch (direction) {
case "prev":
diff --git a/Source/WebCore/inspector/front-end/StylesSidebarPane.js b/Source/WebCore/inspector/front-end/StylesSidebarPane.js
index 3f07e0071..26a3fb818 100644
--- a/Source/WebCore/inspector/front-end/StylesSidebarPane.js
+++ b/Source/WebCore/inspector/front-end/StylesSidebarPane.js
@@ -2561,6 +2561,9 @@ WebInspector.StylesSidebarPane.CSSPropertyPrompt.prototype = {
var wordRange = selectionRange.startContainer.rangeOfWord(selectionRange.startOffset, WebInspector.StylesSidebarPane.StyleValueDelimiters, this._sidebarPane.valueElement);
var wordString = wordRange.toString();
+ if (this._isValueSuggestion(wordString))
+ return false;
+
var replacementString;
var prefix, suffix, number;
@@ -2611,6 +2614,14 @@ WebInspector.StylesSidebarPane.CSSPropertyPrompt.prototype = {
return false;
},
+ _isValueSuggestion: function(word)
+ {
+ if (!word)
+ return false;
+ word = word.toLowerCase();
+ return this._cssCompletions.keySet().hasOwnProperty(word);
+ },
+
_buildPropertyCompletions: function(textPrompt, wordRange, force, completionsReadyCallback)
{
var prefix = wordRange.toString().toLowerCase();
diff --git a/Source/WebCore/inspector/front-end/TextPrompt.js b/Source/WebCore/inspector/front-end/TextPrompt.js
index 4be2c840a..84bbe05d2 100644
--- a/Source/WebCore/inspector/front-end/TextPrompt.js
+++ b/Source/WebCore/inspector/front-end/TextPrompt.js
@@ -112,7 +112,7 @@ WebInspector.TextPrompt.prototype = {
this.proxyElement.appendChild(element);
this._element.addStyleClass("text-prompt");
this._element.addEventListener("keydown", this._boundOnKeyDown, false);
- this._element.addEventListener("selectstart", this._selectStart.bind(this), false);
+ this._element.addEventListener("selectstart", this._boundSelectStart, false);
if (typeof this._suggestBoxClassName === "string")
this._suggestBox = new WebInspector.TextPrompt.SuggestBox(this, this._element, this._suggestBoxClassName);
@@ -125,6 +125,9 @@ WebInspector.TextPrompt.prototype = {
this._removeFromElement();
this.proxyElement.parentElement.insertBefore(this._element, this.proxyElement);
this.proxyElement.parentElement.removeChild(this.proxyElement);
+ this._element.removeStyleClass("text-prompt");
+ this._element.removeEventListener("keydown", this._boundOnKeyDown, false);
+ this._element.removeEventListener("selectstart", this._boundSelectStart, false);
delete this._proxyElement;
WebInspector.restoreFocusFromElement(this._element);
},
diff --git a/Source/WebCore/inspector/front-end/TextViewer.js b/Source/WebCore/inspector/front-end/TextViewer.js
index 745c494e1..32ef7bc55 100644
--- a/Source/WebCore/inspector/front-end/TextViewer.js
+++ b/Source/WebCore/inspector/front-end/TextViewer.js
@@ -291,8 +291,8 @@ WebInspector.TextViewer.prototype = {
this._delegate.populateTextAreaContextMenu(contextMenu, target && target.lineNumber);
}
if (this._url) {
- contextMenu.appendItem(WebInspector.UIString("Save"), WebInspector.save.bind(WebInspector, this._url, this._textModel.text, false));
- contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Save as..." : "Save As..."), WebInspector.save.bind(WebInspector, this._url, this._textModel.text, true));
+ contextMenu.appendItem(WebInspector.UIString("Save"), WebInspector.fileManager.save.bind(WebInspector, this._url, this._textModel.text, false));
+ contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Save as..." : "Save As..."), WebInspector.fileManager.save.bind(WebInspector, this._url, this._textModel.text, true));
}
contextMenu.show(event);
diff --git a/Source/WebCore/inspector/front-end/inspector.css b/Source/WebCore/inspector/front-end/inspector.css
index 52c58b09c..70b9a99dc 100644
--- a/Source/WebCore/inspector/front-end/inspector.css
+++ b/Source/WebCore/inspector/front-end/inspector.css
@@ -259,7 +259,7 @@ body.detached.platform-mac-snowleopard #toolbar-dropdown {
border-radius: 5px;
}
-.toolbar-search-item {
+#toolbar-search-item {
display: -webkit-box;
-webkit-box-orient: horizontal;
-webkit-box-align: center;
@@ -271,11 +271,12 @@ body.detached.platform-mac-snowleopard #toolbar-dropdown {
font-size: 16px;
}
-#toolbar-search-navigation-control {
- width: 40px;
+.with-navigation-buttons #search {
+ width: 165px;
}
.toolbar-search-navigation-label {
+ display: none;
border: 1px solid transparent;
border-radius: 2px;
padding: 3px;
@@ -285,6 +286,10 @@ body.detached.platform-mac-snowleopard #toolbar-dropdown {
float: right;
}
+.with-navigation-buttons .toolbar-search-navigation-label {
+ display: block;
+}
+
.toolbar-search-navigation-label:hover {
border: 1px solid rgba(120, 120, 120, 0.6);
}
diff --git a/Source/WebCore/inspector/front-end/inspector.html b/Source/WebCore/inspector/front-end/inspector.html
index 5bb990269..61259a3df 100644
--- a/Source/WebCore/inspector/front-end/inspector.html
+++ b/Source/WebCore/inspector/front-end/inspector.html
@@ -41,7 +41,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
<script type="text/javascript" src="inspector.js"></script>
<script type="text/javascript" src="UIUtils.js"></script>
<script type="text/javascript" src="InspectorBackend.js"></script>
- <script type="text/javascript" src="InspectorBackendStub.js"></script>
+ <script type="text/javascript" src="InspectorBackendCommands.js"></script>
<script type="text/javascript" src="ExtensionRegistryStub.js"></script>
<script type="text/javascript" src="InspectorFrontendAPI.js"></script>
<script type="text/javascript" src="Object.js"></script>
@@ -219,9 +219,9 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
<div id="toolbar-controls">
<div class="toolbar-item"><button id="toolbar-dropdown-arrow" class="toolbar-label">&raquo;</button></div>
<div class="toolbar-item hidden" id="search-results-matches"></div>
- <div class="toolbar-item toolbar-search-item" >
+ <div class="toolbar-item" id="toolbar-search-item">
<input id="search" type="search" incremental results="0">
- <div id="search-toolbar-label" class="toolbar-label"></div><div id="toolbar-search-navigation-control"></div>
+ <div id="toolbar-search-navigation-control"></div>
</div>
<div class="toolbar-item close-right"><button id="close-button-right"></button></div>
</div>
diff --git a/Source/WebCore/loader/FrameLoader.cpp b/Source/WebCore/loader/FrameLoader.cpp
index 930bb2bb5..68302915f 100644
--- a/Source/WebCore/loader/FrameLoader.cpp
+++ b/Source/WebCore/loader/FrameLoader.cpp
@@ -515,9 +515,7 @@ void FrameLoader::clear(bool clearWindowProperties, bool clearScriptObjects, boo
m_frame->document()->cancelParsing();
m_frame->document()->stopActiveDOMObjects();
if (m_frame->document()->attached()) {
- m_frame->document()->willRemove();
- m_frame->document()->detach();
-
+ m_frame->document()->prepareForDestruction();
m_frame->document()->removeFocusedNodeOfSubtree(m_frame->document());
}
}
@@ -2119,6 +2117,7 @@ void FrameLoader::checkLoadCompleteForThisFrame()
}
case FrameStateComplete:
+ m_loadType = FrameLoadTypeStandard;
frameLoadCompleted();
return;
}
@@ -2775,8 +2774,10 @@ void FrameLoader::continueLoadAfterNewWindowPolicy(const ResourceRequest& reques
mainFrame->page()->setOpenedByDOM();
mainFrame->loader()->m_client->dispatchShow();
- if (!m_suppressOpenerInNewFrame)
+ if (!m_suppressOpenerInNewFrame) {
mainFrame->loader()->setOpener(frame.get());
+ mainFrame->document()->setReferrerPolicy(frame->document()->referrerPolicy());
+ }
mainFrame->loader()->loadWithNavigationAction(request, NavigationAction(request), false, FrameLoadTypeStandard, formState);
}
diff --git a/Source/WebCore/loader/FrameLoaderClient.h b/Source/WebCore/loader/FrameLoaderClient.h
index a4bbe2ccb..b15ce0082 100644
--- a/Source/WebCore/loader/FrameLoaderClient.h
+++ b/Source/WebCore/loader/FrameLoaderClient.h
@@ -330,6 +330,9 @@ namespace WebCore {
#if ENABLE(WEB_INTENTS)
virtual void dispatchIntent(PassRefPtr<IntentRequest>) = 0;
#endif
+#if ENABLE(WEB_INTENTS_TAG)
+ virtual void registerIntentService(const String& action, const String& type, const KURL& href, const String& title, const String& disposition) { }
+#endif
virtual void dispatchWillOpenSocketStream(SocketStreamHandle*) { }
diff --git a/Source/WebCore/loader/HistoryController.cpp b/Source/WebCore/loader/HistoryController.cpp
index ec478a792..d5df639bc 100644
--- a/Source/WebCore/loader/HistoryController.cpp
+++ b/Source/WebCore/loader/HistoryController.cpp
@@ -126,7 +126,7 @@ void HistoryController::restoreScrollPositionAndViewState()
if (!view->wasScrolledByUser()) {
view->setScrollPosition(m_currentItem->scrollPoint());
Page* page = m_frame->page();
- if (page && page->mainFrame() == m_frame)
+ if (page && page->mainFrame() == m_frame && m_currentItem->pageScaleFactor())
page->setPageScaleFactor(m_currentItem->pageScaleFactor(), m_currentItem->scrollPoint());
}
}
diff --git a/Source/WebCore/loader/ImageLoader.cpp b/Source/WebCore/loader/ImageLoader.cpp
index a670ad415..c71d31a3c 100644
--- a/Source/WebCore/loader/ImageLoader.cpp
+++ b/Source/WebCore/loader/ImageLoader.cpp
@@ -154,7 +154,7 @@ void ImageLoader::updateFromElement()
// Do not load any image if the 'src' attribute is missing or if it is
// an empty string.
- CachedImage* newImage = 0;
+ CachedResourceHandle<CachedImage> newImage = 0;
if (!attr.isNull() && !stripLeadingAndTrailingHTMLSpaces(attr).isEmpty()) {
ResourceRequest request = ResourceRequest(document->completeURL(sourceURI(attr)));
@@ -170,7 +170,7 @@ void ImageLoader::updateFromElement()
newImage = new CachedImage(request);
newImage->setLoading(true);
newImage->setOwningCachedResourceLoader(document->cachedResourceLoader());
- document->cachedResourceLoader()->m_documentResources.set(newImage->url(), newImage);
+ document->cachedResourceLoader()->m_documentResources.set(newImage->url(), newImage.get());
document->cachedResourceLoader()->setAutoLoadImages(autoLoadOtherImages);
} else
newImage = document->cachedResourceLoader()->requestImage(request);
diff --git a/Source/WebCore/loader/SubframeLoader.cpp b/Source/WebCore/loader/SubframeLoader.cpp
index 4b5b1ddb8..5153f4ef4 100644
--- a/Source/WebCore/loader/SubframeLoader.cpp
+++ b/Source/WebCore/loader/SubframeLoader.cpp
@@ -376,7 +376,8 @@ bool SubframeLoader::loadPlugin(HTMLPlugInImageElement* pluginElement, const KUR
pluginElement, url, paramNames, paramValues, mimeType, loadManually);
if (!widget) {
- renderer->setShowsMissingPluginIndicator();
+ if (!renderer->showsUnavailablePluginIndicator())
+ renderer->setPluginUnavailabilityReason(RenderEmbeddedObject::PluginMissing);
return false;
}
diff --git a/Source/WebCore/loader/TextTrackLoader.cpp b/Source/WebCore/loader/TextTrackLoader.cpp
index e99ac4006..7cb9c6906 100644
--- a/Source/WebCore/loader/TextTrackLoader.cpp
+++ b/Source/WebCore/loader/TextTrackLoader.cpp
@@ -167,7 +167,7 @@ bool TextTrackLoader::load(const KURL& url, const String& crossOriginMode)
}
CachedResourceLoader* cachedResourceLoader = document->cachedResourceLoader();
- m_cachedCueData = static_cast<CachedTextTrack*>(cachedResourceLoader->requestTextTrack(cueRequest));
+ m_cachedCueData = cachedResourceLoader->requestTextTrack(cueRequest);
if (m_cachedCueData)
m_cachedCueData->addClient(this);
diff --git a/Source/WebCore/loader/appcache/DOMApplicationCache.cpp b/Source/WebCore/loader/appcache/DOMApplicationCache.cpp
index 11dcbb89f..aee577cea 100644
--- a/Source/WebCore/loader/appcache/DOMApplicationCache.cpp
+++ b/Source/WebCore/loader/appcache/DOMApplicationCache.cpp
@@ -47,22 +47,27 @@ DOMApplicationCache::DOMApplicationCache(Frame* frame)
cacheHost->setDOMApplicationCache(this);
}
-void DOMApplicationCache::disconnectFrame()
+void DOMApplicationCache::disconnectFrameForPageCache()
{
- ApplicationCacheHost* cacheHost = applicationCacheHost();
- if (cacheHost)
+ if (ApplicationCacheHost* cacheHost = applicationCacheHost())
cacheHost->setDOMApplicationCache(0);
- DOMWindowProperty::disconnectFrame();
+ DOMWindowProperty::disconnectFrameForPageCache();
}
-void DOMApplicationCache::reconnectFrame(Frame* frame)
+void DOMApplicationCache::reconnectFrameFromPageCache(Frame* frame)
{
- DOMWindowProperty::reconnectFrame(frame);
- ApplicationCacheHost* cacheHost = applicationCacheHost();
- if (cacheHost)
+ DOMWindowProperty::reconnectFrameFromPageCache(frame);
+ if (ApplicationCacheHost* cacheHost = applicationCacheHost())
cacheHost->setDOMApplicationCache(this);
}
+void DOMApplicationCache::willDestroyGlobalObjectInFrame()
+{
+ if (ApplicationCacheHost* cacheHost = applicationCacheHost())
+ cacheHost->setDOMApplicationCache(0);
+ DOMWindowProperty::willDestroyGlobalObjectInFrame();
+}
+
ApplicationCacheHost* DOMApplicationCache::applicationCacheHost() const
{
if (!m_frame || !m_frame->loader()->documentLoader())
diff --git a/Source/WebCore/loader/appcache/DOMApplicationCache.h b/Source/WebCore/loader/appcache/DOMApplicationCache.h
index e3b2a2e82..2e80318e8 100644
--- a/Source/WebCore/loader/appcache/DOMApplicationCache.h
+++ b/Source/WebCore/loader/appcache/DOMApplicationCache.h
@@ -47,8 +47,9 @@ public:
static PassRefPtr<DOMApplicationCache> create(Frame* frame) { return adoptRef(new DOMApplicationCache(frame)); }
~DOMApplicationCache() { ASSERT(!m_frame); }
- virtual void disconnectFrame() OVERRIDE;
- virtual void reconnectFrame(Frame*) OVERRIDE;
+ virtual void disconnectFrameForPageCache() OVERRIDE;
+ virtual void reconnectFrameFromPageCache(Frame*) OVERRIDE;
+ virtual void willDestroyGlobalObjectInFrame() OVERRIDE;
unsigned short status() const;
void update(ExceptionCode&);
diff --git a/Source/WebCore/loader/archive/cf/LegacyWebArchive.cpp b/Source/WebCore/loader/archive/cf/LegacyWebArchive.cpp
index 9be88d24a..942452650 100644
--- a/Source/WebCore/loader/archive/cf/LegacyWebArchive.cpp
+++ b/Source/WebCore/loader/archive/cf/LegacyWebArchive.cpp
@@ -44,7 +44,9 @@
#include "Logging.h"
#include "markup.h"
#include "Node.h"
+#include "Page.h"
#include "Range.h"
+#include "Settings.h"
#include "SharedBuffer.h"
#include <wtf/text/CString.h>
#include <wtf/text/WTFString.h>
@@ -438,9 +440,18 @@ PassRefPtr<LegacyWebArchive> LegacyWebArchive::create(Node* node, FrameFilter* f
Frame* frame = document ? document->frame() : 0;
if (!frame)
return create();
+
+ // If the page was loaded with javascript enabled, we don't want to archive <noscript> tags
+ // In practice we don't actually know whether scripting was enabled when the page was originally loaded
+ // but we can approximate that by checking if scripting is enabled right now.
+ OwnPtr<Vector<QualifiedName> > tagNamesToFilter;
+ if (frame->page() && frame->page()->settings()->isScriptEnabled()) {
+ tagNamesToFilter = adoptPtr(new Vector<QualifiedName>);
+ tagNamesToFilter->append(HTMLNames::noscriptTag);
+ }
Vector<Node*> nodeList;
- String markupString = createMarkup(node, IncludeNode, &nodeList);
+ String markupString = createMarkup(node, IncludeNode, &nodeList, DoNotResolveURLs, tagNamesToFilter.get());
Node::NodeType nodeType = node->nodeType();
if (nodeType != Node::DOCUMENT_NODE && nodeType != Node::DOCUMENT_TYPE_NODE)
markupString = frame->documentTypeString() + markupString;
diff --git a/Source/WebCore/loader/cache/CachedCSSStyleSheet.cpp b/Source/WebCore/loader/cache/CachedCSSStyleSheet.cpp
index 41fa61744..ea3d04aef 100644
--- a/Source/WebCore/loader/cache/CachedCSSStyleSheet.cpp
+++ b/Source/WebCore/loader/cache/CachedCSSStyleSheet.cpp
@@ -50,6 +50,8 @@ CachedCSSStyleSheet::CachedCSSStyleSheet(const ResourceRequest& resourceRequest,
CachedCSSStyleSheet::~CachedCSSStyleSheet()
{
+ if (m_parsedStyleSheetCache)
+ m_parsedStyleSheetCache->removedFromMemoryCache();
}
void CachedCSSStyleSheet::didAddClient(CachedResourceClient* c)
@@ -153,7 +155,12 @@ bool CachedCSSStyleSheet::canUseSheet(bool enforceMIMEType, bool* hasValidMIMETy
void CachedCSSStyleSheet::destroyDecodedData()
{
+ if (!m_parsedStyleSheetCache)
+ return;
+
+ m_parsedStyleSheetCache->removedFromMemoryCache();
m_parsedStyleSheetCache.clear();
+
setDecodedSize(0);
}
@@ -161,25 +168,26 @@ PassRefPtr<StyleSheetInternal> CachedCSSStyleSheet::restoreParsedStyleSheet(cons
{
if (!m_parsedStyleSheetCache)
return 0;
- // Cached parsed stylesheet has mutated, kick it out.
- if (!m_parsedStyleSheetCache->isCacheable()) {
- m_parsedStyleSheetCache.clear();
- setDecodedSize(0);
- return 0;
- }
+ ASSERT(m_parsedStyleSheetCache->isCacheable());
+ ASSERT(m_parsedStyleSheetCache->isInMemoryCache());
+
// Contexts must be identical so we know we would get the same exact result if we parsed again.
if (m_parsedStyleSheetCache->parserContext() != context)
return 0;
didAccessDecodedData(currentTime());
- // FIXME: Implement copy-on-write to avoid copying when not necessary.
- return m_parsedStyleSheetCache->copy();
+
+ return m_parsedStyleSheetCache;
}
void CachedCSSStyleSheet::saveParsedStyleSheet(PassRefPtr<StyleSheetInternal> sheet)
{
ASSERT(sheet && sheet->isCacheable());
+
+ if (m_parsedStyleSheetCache)
+ m_parsedStyleSheetCache->removedFromMemoryCache();
m_parsedStyleSheetCache = sheet;
+ m_parsedStyleSheetCache->addedToMemoryCache();
setDecodedSize(m_parsedStyleSheetCache->estimatedSizeInBytes());
}
diff --git a/Source/WebCore/loader/cache/CachedResourceHandle.h b/Source/WebCore/loader/cache/CachedResourceHandle.h
index aea410aa6..95cd0ff7f 100644
--- a/Source/WebCore/loader/cache/CachedResourceHandle.h
+++ b/Source/WebCore/loader/cache/CachedResourceHandle.h
@@ -61,12 +61,15 @@ namespace WebCore {
CachedResourceHandle() { }
CachedResourceHandle(R* res) : CachedResourceHandleBase(res) { }
CachedResourceHandle(const CachedResourceHandle<R>& o) : CachedResourceHandleBase(o) { }
+ template<typename U> CachedResourceHandle(const CachedResourceHandle<U>& o) : CachedResourceHandleBase(o.get()) { }
R* get() const { return reinterpret_cast<R*>(CachedResourceHandleBase::get()); }
R* operator->() const { return get(); }
CachedResourceHandle& operator=(R* res) { setResource(res); return *this; }
CachedResourceHandle& operator=(const CachedResourceHandle& o) { setResource(o.get()); return *this; }
+ template<typename U> CachedResourceHandle& operator=(const CachedResourceHandle<U>& o) { setResource(o.get()); return *this; }
+
bool operator==(const CachedResourceHandleBase& o) const { return get() == o.get(); }
bool operator!=(const CachedResourceHandleBase& o) const { return get() != o.get(); }
};
diff --git a/Source/WebCore/loader/cache/CachedResourceLoader.cpp b/Source/WebCore/loader/cache/CachedResourceLoader.cpp
index 846f3a739..9e39c1e48 100644
--- a/Source/WebCore/loader/cache/CachedResourceLoader.cpp
+++ b/Source/WebCore/loader/cache/CachedResourceLoader.cpp
@@ -151,7 +151,7 @@ Frame* CachedResourceLoader::frame() const
return m_document ? m_document->frame() : 0;
}
-CachedImage* CachedResourceLoader::requestImage(ResourceRequest& request)
+CachedResourceHandle<CachedImage> CachedResourceLoader::requestImage(ResourceRequest& request)
{
if (Frame* f = frame()) {
if (f->loader()->pageDismissalEventBeingDispatched() != FrameLoader::NoDismissal) {
@@ -161,37 +161,37 @@ CachedImage* CachedResourceLoader::requestImage(ResourceRequest& request)
return 0;
}
}
- CachedImage* resource = static_cast<CachedImage*>(requestResource(CachedResource::ImageResource, request, String(), defaultCachedResourceOptions()));
+ CachedResourceHandle<CachedImage> resource(static_cast<CachedImage*>(requestResource(CachedResource::ImageResource, request, String(), defaultCachedResourceOptions()).get()));
if (autoLoadImages() && resource && resource->stillNeedsLoad())
resource->load(this, defaultCachedResourceOptions());
return resource;
}
-CachedFont* CachedResourceLoader::requestFont(ResourceRequest& request)
+CachedResourceHandle<CachedFont> CachedResourceLoader::requestFont(ResourceRequest& request)
{
- return static_cast<CachedFont*>(requestResource(CachedResource::FontResource, request, String(), defaultCachedResourceOptions()));
+ return static_cast<CachedFont*>(requestResource(CachedResource::FontResource, request, String(), defaultCachedResourceOptions()).get());
}
#if ENABLE(VIDEO_TRACK)
-CachedTextTrack* CachedResourceLoader::requestTextTrack(ResourceRequest& request)
+CachedResourceHandle<CachedTextTrack> CachedResourceLoader::requestTextTrack(ResourceRequest& request)
{
- return static_cast<CachedTextTrack*>(requestResource(CachedResource::TextTrackResource, request, String(), defaultCachedResourceOptions()));
+ return static_cast<CachedTextTrack*>(requestResource(CachedResource::TextTrackResource, request, String(), defaultCachedResourceOptions()).get());
}
#endif
#if ENABLE(CSS_SHADERS)
-CachedShader* CachedResourceLoader::requestShader(ResourceRequest& request)
+CachedResourceHandle<CachedShader> CachedResourceLoader::requestShader(ResourceRequest& request)
{
- return static_cast<CachedShader*>(requestResource(CachedResource::ShaderResource, request, String(), defaultCachedResourceOptions()));
+ return static_cast<CachedShader*>(requestResource(CachedResource::ShaderResource, request, String(), defaultCachedResourceOptions()).get());
}
#endif
-CachedCSSStyleSheet* CachedResourceLoader::requestCSSStyleSheet(ResourceRequest& request, const String& charset, ResourceLoadPriority priority)
+CachedResourceHandle<CachedCSSStyleSheet> CachedResourceLoader::requestCSSStyleSheet(ResourceRequest& request, const String& charset, ResourceLoadPriority priority)
{
- return static_cast<CachedCSSStyleSheet*>(requestResource(CachedResource::CSSStyleSheet, request, charset, defaultCachedResourceOptions(), priority));
+ return static_cast<CachedCSSStyleSheet*>(requestResource(CachedResource::CSSStyleSheet, request, charset, defaultCachedResourceOptions(), priority).get());
}
-CachedCSSStyleSheet* CachedResourceLoader::requestUserCSSStyleSheet(ResourceRequest& request, const String& charset)
+CachedResourceHandle<CachedCSSStyleSheet> CachedResourceLoader::requestUserCSSStyleSheet(ResourceRequest& request, const String& charset)
{
KURL url = MemoryCache::removeFragmentIdentifierIfNeeded(request.url());
@@ -203,41 +203,37 @@ CachedCSSStyleSheet* CachedResourceLoader::requestUserCSSStyleSheet(ResourceRequ
if (url.string() != request.url())
request.setURL(url);
- CachedCSSStyleSheet* userSheet = new CachedCSSStyleSheet(request, charset);
-
- bool inCache = memoryCache()->add(userSheet);
- if (!inCache)
- userSheet->setInCache(true);
+ CachedResourceHandle<CachedCSSStyleSheet> userSheet = new CachedCSSStyleSheet(request, charset);
- userSheet->load(this, ResourceLoaderOptions(DoNotSendCallbacks, SniffContent, BufferData, AllowStoredCredentials, AskClientForCrossOriginCredentials, SkipSecurityCheck));
+ memoryCache()->add(userSheet.get());
+ // FIXME: loadResource calls setOwningCachedResourceLoader() if the resource couldn't be added to cache. Does this function need to call it, too?
- if (!inCache)
- userSheet->setInCache(false);
+ userSheet->load(this, ResourceLoaderOptions(DoNotSendCallbacks, SniffContent, BufferData, AllowStoredCredentials, AskClientForCrossOriginCredentials, SkipSecurityCheck));
return userSheet;
}
-CachedScript* CachedResourceLoader::requestScript(ResourceRequest& request, const String& charset)
+CachedResourceHandle<CachedScript> CachedResourceLoader::requestScript(ResourceRequest& request, const String& charset)
{
- return static_cast<CachedScript*>(requestResource(CachedResource::Script, request, charset, defaultCachedResourceOptions()));
+ return static_cast<CachedScript*>(requestResource(CachedResource::Script, request, charset, defaultCachedResourceOptions()).get());
}
#if ENABLE(XSLT)
-CachedXSLStyleSheet* CachedResourceLoader::requestXSLStyleSheet(ResourceRequest& request)
+CachedResourceHandle<CachedXSLStyleSheet> CachedResourceLoader::requestXSLStyleSheet(ResourceRequest& request)
{
- return static_cast<CachedXSLStyleSheet*>(requestResource(CachedResource::XSLStyleSheet, request, String(), defaultCachedResourceOptions()));
+ return static_cast<CachedXSLStyleSheet*>(requestResource(CachedResource::XSLStyleSheet, request, String(), defaultCachedResourceOptions()).get());
}
#endif
#if ENABLE(SVG)
-CachedSVGDocument* CachedResourceLoader::requestSVGDocument(ResourceRequest& request)
+CachedResourceHandle<CachedSVGDocument> CachedResourceLoader::requestSVGDocument(ResourceRequest& request)
{
- return static_cast<CachedSVGDocument*>(requestResource(CachedResource::SVGDocumentResource, request, request.url(), defaultCachedResourceOptions()));
+ return static_cast<CachedSVGDocument*>(requestResource(CachedResource::SVGDocumentResource, request, request.url(), defaultCachedResourceOptions()).get());
}
#endif
#if ENABLE(LINK_PREFETCH)
-CachedResource* CachedResourceLoader::requestLinkResource(CachedResource::Type type, ResourceRequest& request, ResourceLoadPriority priority)
+CachedResourceHandle<CachedResource> CachedResourceLoader::requestLinkResource(CachedResource::Type type, ResourceRequest& request, ResourceLoadPriority priority)
{
ASSERT(frame());
ASSERT(type == CachedResource::LinkPrefetch || type == CachedResource::LinkPrerender || type == CachedResource::LinkSubresource);
@@ -245,9 +241,9 @@ CachedResource* CachedResourceLoader::requestLinkResource(CachedResource::Type t
}
#endif
-CachedRawResource* CachedResourceLoader::requestRawResource(ResourceRequest& request, const ResourceLoaderOptions& options)
+CachedResourceHandle<CachedRawResource> CachedResourceLoader::requestRawResource(ResourceRequest& request, const ResourceLoaderOptions& options)
{
- return static_cast<CachedRawResource*>(requestResource(CachedResource::RawResource, request, String(), options, ResourceLoadPriorityUnresolved, false));
+ return static_cast<CachedRawResource*>(requestResource(CachedResource::RawResource, request, String(), options, ResourceLoadPriorityUnresolved, false).get());
}
bool CachedResourceLoader::checkInsecureContent(CachedResource::Type type, const KURL& url) const
@@ -410,7 +406,7 @@ bool CachedResourceLoader::canRequest(CachedResource::Type type, const KURL& url
return true;
}
-CachedResource* CachedResourceLoader::requestResource(CachedResource::Type type, ResourceRequest& request, const String& charset, const ResourceLoaderOptions& options, ResourceLoadPriority priority, bool forPreload)
+CachedResourceHandle<CachedResource> CachedResourceLoader::requestResource(CachedResource::Type type, ResourceRequest& request, const String& charset, const ResourceLoaderOptions& options, ResourceLoadPriority priority, bool forPreload)
{
KURL url = request.url();
@@ -434,25 +430,25 @@ CachedResource* CachedResourceLoader::requestResource(CachedResource::Type type,
}
// See if we can use an existing resource from the cache.
- CachedResource* resource = memoryCache()->resourceForURL(url);
+ CachedResourceHandle<CachedResource> resource = memoryCache()->resourceForURL(url);
if (request.url() != url)
request.setURL(url);
- switch (determineRevalidationPolicy(type, request, forPreload, resource)) {
+ switch (determineRevalidationPolicy(type, request, forPreload, resource.get())) {
case Load:
resource = loadResource(type, request, charset, priority, options);
break;
case Reload:
- memoryCache()->remove(resource);
+ memoryCache()->remove(resource.get());
resource = loadResource(type, request, charset, priority, options);
break;
case Revalidate:
- resource = revalidateResource(resource, priority, options);
+ resource = revalidateResource(resource.get(), priority, options);
break;
case Use:
- memoryCache()->resourceAccessed(resource);
- notifyLoadedFromMemoryCache(resource);
+ memoryCache()->resourceAccessed(resource.get());
+ notifyLoadedFromMemoryCache(resource.get());
break;
}
@@ -463,8 +459,8 @@ CachedResource* CachedResourceLoader::requestResource(CachedResource::Type type,
m_documentResources.set(resource->url(), resource);
return resource;
}
-
-CachedResource* CachedResourceLoader::revalidateResource(CachedResource* resource, ResourceLoadPriority priority, const ResourceLoaderOptions& options)
+
+CachedResourceHandle<CachedResource> CachedResourceLoader::revalidateResource(CachedResource* resource, ResourceLoadPriority priority, const ResourceLoaderOptions& options)
{
ASSERT(resource);
ASSERT(resource->inCache());
@@ -475,13 +471,13 @@ CachedResource* CachedResourceLoader::revalidateResource(CachedResource* resourc
// Copy the URL out of the resource to be revalidated in case it gets deleted by the remove() call below.
String url = resource->url();
bool urlProtocolIsData = resource->url().protocolIsData();
- CachedResource* newResource = createResource(resource->type(), resource->resourceRequest(), resource->encoding());
+ CachedResourceHandle<CachedResource> newResource = createResource(resource->type(), resource->resourceRequest(), resource->encoding());
- LOG(ResourceLoading, "Resource %p created to revalidate %p", newResource, resource);
+ LOG(ResourceLoading, "Resource %p created to revalidate %p", newResource.get(), resource);
newResource->setResourceToRevalidate(resource);
memoryCache()->remove(resource);
- memoryCache()->add(newResource);
+ memoryCache()->add(newResource.get());
newResource->setLoadPriority(priority);
newResource->load(this, options);
@@ -491,39 +487,26 @@ CachedResource* CachedResourceLoader::revalidateResource(CachedResource* resourc
return newResource;
}
-CachedResource* CachedResourceLoader::loadResource(CachedResource::Type type, ResourceRequest& request, const String& charset, ResourceLoadPriority priority, const ResourceLoaderOptions& options)
+CachedResourceHandle<CachedResource> CachedResourceLoader::loadResource(CachedResource::Type type, ResourceRequest& request, const String& charset, ResourceLoadPriority priority, const ResourceLoaderOptions& options)
{
ASSERT(!memoryCache()->resourceForURL(request.url()));
LOG(ResourceLoading, "Loading CachedResource for '%s'.", request.url().string().latin1().data());
- CachedResource* resource = createResource(type, request, charset);
-
- bool inCache = memoryCache()->add(resource);
+ CachedResourceHandle<CachedResource> resource = createResource(type, request, charset);
- // Pretend the resource is in the cache, to prevent it from being deleted during the load() call.
- // FIXME: CachedResource should just use normal refcounting instead.
- if (!inCache)
- resource->setInCache(true);
+ bool inCache = memoryCache()->add(resource.get());
resource->setLoadPriority(priority);
-
- bool wasPruneEnabled = memoryCache()->pruneEnabled();
- memoryCache()->setPruneEnabled(false);
resource->load(this, options);
- memoryCache()->setPruneEnabled(wasPruneEnabled);
- if (!inCache) {
+ if (!inCache)
resource->setOwningCachedResourceLoader(this);
- resource->setInCache(false);
- }
// We don't support immediate loads, but we do support immediate failure.
if (resource->errorOccurred()) {
if (inCache)
- memoryCache()->remove(resource);
- else
- delete resource;
+ memoryCache()->remove(resource.get());
return 0;
}
@@ -781,14 +764,14 @@ void CachedResourceLoader::requestPreload(CachedResource::Type type, ResourceReq
if (type == CachedResource::Script || type == CachedResource::CSSStyleSheet)
encoding = charset.isEmpty() ? m_document->charset() : charset;
- CachedResource* resource = requestResource(type, request, encoding, defaultCachedResourceOptions(), ResourceLoadPriorityUnresolved, true);
- if (!resource || (m_preloads && m_preloads->contains(resource)))
+ CachedResourceHandle<CachedResource> resource = requestResource(type, request, encoding, defaultCachedResourceOptions(), ResourceLoadPriorityUnresolved, true);
+ if (!resource || (m_preloads && m_preloads->contains(resource.get())))
return;
resource->increasePreloadCount();
if (!m_preloads)
m_preloads = adoptPtr(new ListHashSet<CachedResource*>);
- m_preloads->add(resource);
+ m_preloads->add(resource.get());
#if PRELOAD_DEBUG
printf("PRELOADING %s\n", resource->url().latin1().data());
diff --git a/Source/WebCore/loader/cache/CachedResourceLoader.h b/Source/WebCore/loader/cache/CachedResourceLoader.h
index b8bdacac2..d82b3bf42 100644
--- a/Source/WebCore/loader/cache/CachedResourceLoader.h
+++ b/Source/WebCore/loader/cache/CachedResourceLoader.h
@@ -63,27 +63,27 @@ public:
CachedResourceLoader(Document*);
~CachedResourceLoader();
- CachedImage* requestImage(ResourceRequest&);
- CachedCSSStyleSheet* requestCSSStyleSheet(ResourceRequest&, const String& charset, ResourceLoadPriority = ResourceLoadPriorityUnresolved);
- CachedCSSStyleSheet* requestUserCSSStyleSheet(ResourceRequest&, const String& charset);
- CachedScript* requestScript(ResourceRequest&, const String& charset);
- CachedFont* requestFont(ResourceRequest&);
- CachedRawResource* requestRawResource(ResourceRequest&, const ResourceLoaderOptions&);
+ CachedResourceHandle<CachedImage> requestImage(ResourceRequest&);
+ CachedResourceHandle<CachedCSSStyleSheet> requestCSSStyleSheet(ResourceRequest&, const String& charset, ResourceLoadPriority = ResourceLoadPriorityUnresolved);
+ CachedResourceHandle<CachedCSSStyleSheet> requestUserCSSStyleSheet(ResourceRequest&, const String& charset);
+ CachedResourceHandle<CachedScript> requestScript(ResourceRequest&, const String& charset);
+ CachedResourceHandle<CachedFont> requestFont(ResourceRequest&);
+ CachedResourceHandle<CachedRawResource> requestRawResource(ResourceRequest&, const ResourceLoaderOptions&);
#if ENABLE(SVG)
- CachedSVGDocument* requestSVGDocument(ResourceRequest&);
+ CachedResourceHandle<CachedSVGDocument> requestSVGDocument(ResourceRequest&);
#endif
#if ENABLE(XSLT)
- CachedXSLStyleSheet* requestXSLStyleSheet(ResourceRequest&);
+ CachedResourceHandle<CachedXSLStyleSheet> requestXSLStyleSheet(ResourceRequest&);
#endif
#if ENABLE(LINK_PREFETCH)
- CachedResource* requestLinkResource(CachedResource::Type, ResourceRequest&, ResourceLoadPriority = ResourceLoadPriorityUnresolved);
+ CachedResourceHandle<CachedResource> requestLinkResource(CachedResource::Type, ResourceRequest&, ResourceLoadPriority = ResourceLoadPriorityUnresolved);
#endif
#if ENABLE(VIDEO_TRACK)
- CachedTextTrack* requestTextTrack(ResourceRequest&);
+ CachedResourceHandle<CachedTextTrack> requestTextTrack(ResourceRequest&);
#endif
#if ENABLE(CSS_SHADERS)
- CachedShader* requestShader(ResourceRequest&);
+ CachedResourceHandle<CachedShader> requestShader(ResourceRequest&);
#endif
// Logs an access denied message to the console for the specified URL.
@@ -119,9 +119,9 @@ public:
bool canRequest(CachedResource::Type, const KURL&, bool forPreload = false);
private:
- CachedResource* requestResource(CachedResource::Type, ResourceRequest&, const String& charset, const ResourceLoaderOptions&, ResourceLoadPriority = ResourceLoadPriorityUnresolved, bool isPreload = false);
- CachedResource* revalidateResource(CachedResource*, ResourceLoadPriority, const ResourceLoaderOptions&);
- CachedResource* loadResource(CachedResource::Type, ResourceRequest&, const String& charset, ResourceLoadPriority, const ResourceLoaderOptions&);
+ CachedResourceHandle<CachedResource> requestResource(CachedResource::Type, ResourceRequest&, const String& charset, const ResourceLoaderOptions&, ResourceLoadPriority = ResourceLoadPriorityUnresolved, bool isPreload = false);
+ CachedResourceHandle<CachedResource> revalidateResource(CachedResource*, ResourceLoadPriority, const ResourceLoaderOptions&);
+ CachedResourceHandle<CachedResource> loadResource(CachedResource::Type, ResourceRequest&, const String& charset, ResourceLoadPriority, const ResourceLoaderOptions&);
void requestPreload(CachedResource::Type, ResourceRequest&, const String& charset);
enum RevalidationPolicy { Use, Revalidate, Reload, Load };
diff --git a/Source/WebCore/loader/cache/MemoryCache.h b/Source/WebCore/loader/cache/MemoryCache.h
index 477d778e1..2538214cd 100644
--- a/Source/WebCore/loader/cache/MemoryCache.h
+++ b/Source/WebCore/loader/cache/MemoryCache.h
@@ -129,7 +129,6 @@ public:
void evictResources();
void setPruneEnabled(bool enabled) { m_pruneEnabled = enabled; }
- bool pruneEnabled() const { return m_pruneEnabled; }
void prune();
void pruneToPercentage(float targetPercentLive);
diff --git a/Source/WebCore/notifications/DOMWindowNotifications.cpp b/Source/WebCore/notifications/DOMWindowNotifications.cpp
index 86ca028ac..40173ee75 100644
--- a/Source/WebCore/notifications/DOMWindowNotifications.cpp
+++ b/Source/WebCore/notifications/DOMWindowNotifications.cpp
@@ -63,18 +63,36 @@ NotificationCenter* DOMWindowNotifications::webkitNotifications(DOMWindow* windo
return DOMWindowNotifications::from(window)->webkitNotifications();
}
-void DOMWindowNotifications::disconnectFrame()
+void DOMWindowNotifications::disconnectFrameForPageCache()
{
m_suspendedNotificationCenter = m_notificationCenter.release();
- DOMWindowProperty::disconnectFrame();
+ DOMWindowProperty::disconnectFrameForPageCache();
}
-void DOMWindowNotifications::reconnectFrame(Frame* frame)
+void DOMWindowNotifications::reconnectFrameFromPageCache(Frame* frame)
{
- DOMWindowProperty::reconnectFrame(frame);
+ DOMWindowProperty::reconnectFrameFromPageCache(frame);
m_notificationCenter = m_suspendedNotificationCenter.release();
}
+void DOMWindowNotifications::willDestroyGlobalObjectInCachedFrame()
+{
+ m_suspendedNotificationCenter = nullptr;
+ DOMWindowProperty::willDestroyGlobalObjectInCachedFrame();
+}
+
+void DOMWindowNotifications::willDestroyGlobalObjectInFrame()
+{
+ m_notificationCenter = nullptr;
+ DOMWindowProperty::willDestroyGlobalObjectInFrame();
+}
+
+void DOMWindowNotifications::willDetachGlobalObjectFromFrame()
+{
+ m_notificationCenter = nullptr;
+ DOMWindowProperty::willDetachGlobalObjectFromFrame();
+}
+
NotificationCenter* DOMWindowNotifications::webkitNotifications()
{
if (!m_window->isCurrentlyDisplayedInFrame())
diff --git a/Source/WebCore/notifications/DOMWindowNotifications.h b/Source/WebCore/notifications/DOMWindowNotifications.h
index dbedef62c..22e26dd60 100644
--- a/Source/WebCore/notifications/DOMWindowNotifications.h
+++ b/Source/WebCore/notifications/DOMWindowNotifications.h
@@ -45,8 +45,11 @@ public:
static NotificationCenter* webkitNotifications(DOMWindow*);
static DOMWindowNotifications* from(DOMWindow*);
- virtual void disconnectFrame() OVERRIDE;
- virtual void reconnectFrame(Frame*) OVERRIDE;
+ virtual void disconnectFrameForPageCache() OVERRIDE;
+ virtual void reconnectFrameFromPageCache(Frame*) OVERRIDE;
+ virtual void willDestroyGlobalObjectInCachedFrame() OVERRIDE;
+ virtual void willDestroyGlobalObjectInFrame() OVERRIDE;
+ virtual void willDetachGlobalObjectFromFrame() OVERRIDE;
private:
explicit DOMWindowNotifications(DOMWindow*);
diff --git a/Source/WebCore/page/Chrome.cpp b/Source/WebCore/page/Chrome.cpp
index 2a3192bb8..f9fa194ae 100644
--- a/Source/WebCore/page/Chrome.cpp
+++ b/Source/WebCore/page/Chrome.cpp
@@ -1,6 +1,7 @@
/*
* Copyright (C) 2006, 2007, 2009, 2011 Apple Inc. All rights reserved.
* Copyright (C) 2008, 2010 Nokia Corporation and/or its subsidiary(-ies)
+ * Copyright (C) 2012, Samsung Electronics. 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
@@ -356,13 +357,6 @@ bool Chrome::shouldInterruptJavaScript()
return m_client->shouldInterruptJavaScript();
}
-#if ENABLE(REGISTER_PROTOCOL_HANDLER)
-void Chrome::registerProtocolHandler(const String& scheme, const String& baseURL, const String& url, const String& title)
-{
- m_client->registerProtocolHandler(scheme, baseURL, url, title);
-}
-#endif
-
IntRect Chrome::windowResizerRect() const
{
return m_client->windowResizerRect();
diff --git a/Source/WebCore/page/Chrome.h b/Source/WebCore/page/Chrome.h
index d2fe0bea8..5638f3a48 100644
--- a/Source/WebCore/page/Chrome.h
+++ b/Source/WebCore/page/Chrome.h
@@ -1,6 +1,7 @@
/*
* Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
* Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ * Copyright (C) 2012, Samsung Electronics. 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
@@ -137,10 +138,6 @@ namespace WebCore {
void setStatusbarText(Frame*, const String&);
bool shouldInterruptJavaScript();
-#if ENABLE(REGISTER_PROTOCOL_HANDLER)
- void registerProtocolHandler(const String& scheme, const String& baseURL, const String& url, const String& title);
-#endif
-
IntRect windowResizerRect() const;
void mouseDidMoveOverElement(const HitTestResult&, unsigned modifierFlags);
diff --git a/Source/WebCore/page/ChromeClient.h b/Source/WebCore/page/ChromeClient.h
index 5b9259b12..bb2aee4b8 100644
--- a/Source/WebCore/page/ChromeClient.h
+++ b/Source/WebCore/page/ChromeClient.h
@@ -30,6 +30,7 @@
#include "HostWindow.h"
#include "PopupMenu.h"
#include "PopupMenuClient.h"
+#include "RenderEmbeddedObject.h"
#include "ScrollTypes.h"
#include "SearchPopupMenu.h"
#include "WebCoreKeyboardUIMode.h"
@@ -170,8 +171,8 @@ namespace WebCore {
virtual void layoutUpdated(Frame*) const { }
virtual void scrollRectIntoView(const IntRect&) const { }; // Currently only Mac has a non empty implementation.
- virtual bool shouldMissingPluginMessageBeButton() const { return false; }
- virtual void missingPluginButtonClicked(Element*) const { }
+ virtual bool shouldUnavailablePluginMessageBeButton(RenderEmbeddedObject::PluginUnavailabilityReason) const { return false; }
+ virtual void unavailablePluginButtonClicked(Element*, RenderEmbeddedObject::PluginUnavailabilityReason) const { }
virtual void mouseDidMoveOverElement(const HitTestResult&, unsigned modifierFlags) = 0;
virtual void setToolTip(const String&, TextDirection) = 0;
diff --git a/Source/WebCore/page/DOMWindow.cpp b/Source/WebCore/page/DOMWindow.cpp
index 9b84b677e..1b8d44c92 100644
--- a/Source/WebCore/page/DOMWindow.cpp
+++ b/Source/WebCore/page/DOMWindow.cpp
@@ -427,6 +427,11 @@ DOMWindow::~DOMWindow()
}
#endif
+ if (m_suspendedForPageCache)
+ willDestroyCachedFrame();
+ else
+ willDestroyDocumentInFrame();
+
// As the ASSERTs above indicate, this clear should only be necesary 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();
@@ -467,6 +472,7 @@ Page* DOMWindow::page()
void DOMWindow::frameDestroyed()
{
+ willDestroyDocumentInFrame();
FrameDestructionObserver::frameDestroyed();
clearDOMWindowProperties();
}
@@ -474,11 +480,36 @@ void DOMWindow::frameDestroyed()
void DOMWindow::willDetachPage()
{
InspectorInstrumentation::frameWindowDiscarded(m_frame, this);
+}
+
+void DOMWindow::willDestroyCachedFrame()
+{
+ // It is necessary to copy m_properties to a separate vector because the DOMWindowProperties may
+ // unregister themselves from the DOMWindow as a result of the call to willDestroyGlobalObjectInCachedFrame.
+ Vector<DOMWindowProperty*> properties;
+ copyToVector(m_properties, properties);
+ for (size_t i = 0; i < properties.size(); ++i)
+ properties[i]->willDestroyGlobalObjectInCachedFrame();
+}
+
+void DOMWindow::willDestroyDocumentInFrame()
+{
+ // It is necessary to copy m_properties to a separate vector because the DOMWindowProperties may
+ // unregister themselves from the DOMWindow as a result of the call to willDestroyGlobalObjectInFrame.
+ Vector<DOMWindowProperty*> properties;
+ copyToVector(m_properties, properties);
+ for (size_t i = 0; i < properties.size(); ++i)
+ properties[i]->willDestroyGlobalObjectInFrame();
+}
+void DOMWindow::willDetachDocumentFromFrame()
+{
+ // It is necessary to copy m_properties to a separate vector because the DOMWindowProperties may
+ // unregister themselves from the DOMWindow as a result of the call to willDetachGlobalObjectFromFrame.
Vector<DOMWindowProperty*> properties;
copyToVector(m_properties, properties);
for (size_t i = 0; i < properties.size(); ++i)
- properties[i]->willDetachPage();
+ properties[i]->willDetachGlobalObjectFromFrame();
}
void DOMWindow::registerProperty(DOMWindowProperty* property)
@@ -499,6 +530,7 @@ void DOMWindow::clear()
if (m_suspendedForPageCache)
return;
+ willDestroyDocumentInFrame();
clearDOMWindowProperties();
}
@@ -516,24 +548,27 @@ void DOMWindow::resumeFromPageCache()
void DOMWindow::disconnectDOMWindowProperties()
{
+ // It is necessary to copy m_properties to a separate vector because the DOMWindowProperties may
+ // unregister themselves from the DOMWindow as a result of the call to disconnectFrameForPageCache.
Vector<DOMWindowProperty*> properties;
copyToVector(m_properties, properties);
for (size_t i = 0; i < properties.size(); ++i)
- properties[i]->disconnectFrame();
+ properties[i]->disconnectFrameForPageCache();
}
void DOMWindow::reconnectDOMWindowProperties()
{
ASSERT(m_suspendedForPageCache);
+ // It is necessary to copy m_properties to a separate vector because the DOMWindowProperties may
+ // unregister themselves from the DOMWindow as a result of the call to reconnectFromPageCache.
Vector<DOMWindowProperty*> properties;
copyToVector(m_properties, properties);
for (size_t i = 0; i < properties.size(); ++i)
- properties[i]->reconnectFrame(m_frame);
+ properties[i]->reconnectFrameFromPageCache(m_frame);
}
void DOMWindow::clearDOMWindowProperties()
{
- disconnectDOMWindowProperties();
m_properties.clear();
m_screen = 0;
@@ -831,12 +866,17 @@ void DOMWindow::postMessageTimerFired(PassOwnPtr<PostMessageTimer> t)
if (m_frame->loader()->client()->willCheckAndDispatchMessageEvent(timer->targetOrigin(), event.get()))
return;
- if (timer->targetOrigin()) {
+ dispatchMessageEventWithOriginCheck(timer->targetOrigin(), event, timer->stackTrace());
+}
+
+void DOMWindow::dispatchMessageEventWithOriginCheck(SecurityOrigin* intendedTargetOrigin, PassRefPtr<Event> event, PassRefPtr<ScriptCallStack> stackTrace)
+{
+ if (intendedTargetOrigin) {
// Check target origin now since the target document may have changed since the timer was scheduled.
- if (!timer->targetOrigin()->isSameSchemeHostPort(document()->securityOrigin())) {
- String message = "Unable to post message to " + timer->targetOrigin()->toString() +
+ if (!intendedTargetOrigin->isSameSchemeHostPort(document()->securityOrigin())) {
+ String message = "Unable to post message to " + intendedTargetOrigin->toString() +
". Recipient has origin " + document()->securityOrigin()->toString() + ".\n";
- console()->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, message, timer->stackTrace());
+ console()->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, message, stackTrace);
return;
}
}
diff --git a/Source/WebCore/page/DOMWindow.h b/Source/WebCore/page/DOMWindow.h
index 4d5897d95..bb6df85b0 100644
--- a/Source/WebCore/page/DOMWindow.h
+++ b/Source/WebCore/page/DOMWindow.h
@@ -54,6 +54,7 @@ namespace WebCore {
class IDBFactory;
class Location;
class MediaQueryList;
+ class MessageEvent;
class Navigator;
class Node;
class Page;
@@ -61,6 +62,7 @@ namespace WebCore {
class PostMessageTimer;
class ScheduledAction;
class Screen;
+ class ScriptCallStack;
class SecurityOrigin;
class SerializedScriptValue;
class Storage;
@@ -233,6 +235,7 @@ namespace WebCore {
// FIXME: remove this when we update the ObjC bindings (bug #28774).
void postMessage(PassRefPtr<SerializedScriptValue> message, MessagePort*, const String& targetOrigin, DOMWindow* source, ExceptionCode&);
void postMessageTimerFired(PassOwnPtr<PostMessageTimer>);
+ void dispatchMessageEventWithOriginCheck(SecurityOrigin* intendedTargetOrigin, PassRefPtr<Event>, PassRefPtr<ScriptCallStack>);
void scrollBy(int x, int y) const;
void scrollTo(int x, int y) const;
@@ -390,6 +393,9 @@ namespace WebCore {
// by the document that is currently active in m_frame.
bool isCurrentlyDisplayedInFrame() const;
+ void willDetachDocumentFromFrame();
+ void willDestroyCachedFrame();
+
private:
explicit DOMWindow(Frame*);
@@ -411,6 +417,7 @@ namespace WebCore {
void clearDOMWindowProperties();
void disconnectDOMWindowProperties();
void reconnectDOMWindowProperties();
+ void willDestroyDocumentInFrame();
RefPtr<SecurityOrigin> m_securityOrigin;
KURL m_url;
diff --git a/Source/WebCore/page/DOMWindow.idl b/Source/WebCore/page/DOMWindow.idl
index 7051e31b1..9a512d076 100644
--- a/Source/WebCore/page/DOMWindow.idl
+++ b/Source/WebCore/page/DOMWindow.idl
@@ -486,6 +486,8 @@ module window {
attribute [Conditional=VIDEO, V8EnabledAtRuntime] HTMLSourceElementConstructor HTMLSourceElement;
attribute [Conditional=VIDEO, V8EnabledAtRuntime] MediaControllerConstructor MediaController;
+ attribute [Conditional=WEB_INTENTS_TAG] HTMLIntentElementConstructor HTMLIntentElement;
+
attribute CanvasPatternConstructor CanvasPattern;
attribute CanvasGradientConstructor CanvasGradient;
attribute CanvasRenderingContext2DConstructor CanvasRenderingContext2D;
diff --git a/Source/WebCore/page/DOMWindowExtension.cpp b/Source/WebCore/page/DOMWindowExtension.cpp
index 4a9a41a8b..e475538b2 100644
--- a/Source/WebCore/page/DOMWindowExtension.cpp
+++ b/Source/WebCore/page/DOMWindowExtension.cpp
@@ -36,90 +36,82 @@ namespace WebCore {
DOMWindowExtension::DOMWindowExtension(Frame* frame, DOMWrapperWorld* world)
: DOMWindowProperty(frame)
, m_world(world)
- , m_disconnectedDOMWindow(0)
, m_wasDetached(false)
{
ASSERT(this->frame());
ASSERT(m_world);
}
-DOMWindowExtension::~DOMWindowExtension()
+void DOMWindowExtension::disconnectFrameForPageCache()
{
- // DOMWindowExtension lifetime isn't tied directly to the DOMWindow itself so it is important that it unregister
- // itself from any DOMWindow it is associated with when destroyed.
- // This might happen if the DOMWindowExtension is destroyed while its DOMWindow is in a CachedPage.
- if (m_disconnectedDOMWindow)
- m_disconnectedDOMWindow->unregisterProperty(this);
-}
-
-void DOMWindowExtension::disconnectFrame()
-{
- // The DOMWindow destructor calls disconnectFrame on all its DOMWindowProperties, even if it
- // did that already when entering the page cache.
- if (m_disconnectedFrame) {
- ASSERT(!frame());
- return;
- }
-
// Calling out to the client might result in this DOMWindowExtension being destroyed
// while there is still work to do.
RefPtr<DOMWindowExtension> protector = this;
- // DOMWindowProperties are disconnected from frames after they are detached.
- // DOMWindowExtensions only want to stay prepared for client callbacks if they've never been detached.
- if (!m_wasDetached) {
- Frame* frame = this->frame();
- frame->loader()->client()->dispatchWillDisconnectDOMWindowExtensionFromGlobalObject(this);
+ Frame* frame = this->frame();
+ frame->loader()->client()->dispatchWillDisconnectDOMWindowExtensionFromGlobalObject(this);
- m_disconnectedFrame = frame;
- m_disconnectedDOMWindow = frame->domWindow();
- }
+ m_disconnectedFrame = frame;
- DOMWindowProperty::disconnectFrame();
+ DOMWindowProperty::disconnectFrameForPageCache();
}
-void DOMWindowExtension::reconnectFrame(Frame* frame)
+void DOMWindowExtension::reconnectFrameFromPageCache(Frame* frame)
{
- // DOMWindowProperties should never reconnect to a frame after they've been detached from the page.
- ASSERT(!m_wasDetached);
ASSERT(m_disconnectedFrame == frame);
- DOMWindowProperty::reconnectFrame(frame);
+ DOMWindowProperty::reconnectFrameFromPageCache(frame);
m_disconnectedFrame = 0;
- m_disconnectedDOMWindow = 0;
this->frame()->loader()->client()->dispatchDidReconnectDOMWindowExtensionToGlobalObject(this);
}
-void DOMWindowExtension::willDetachPage()
+void DOMWindowExtension::willDestroyGlobalObjectInCachedFrame()
{
- // willDetachPage might be called multiple times but we only want to react once.
- if (m_wasDetached)
- return;
-
+ ASSERT(m_disconnectedFrame);
+
// Calling out to the client might result in this DOMWindowExtension being destroyed
// while there is still work to do.
RefPtr<DOMWindowExtension> protector = this;
- Frame* frame = m_disconnectedFrame.get();
- if (!frame)
- frame = this->frame();
- ASSERT(frame);
+ m_disconnectedFrame->loader()->client()->dispatchWillDestroyGlobalObjectForDOMWindowExtension(this);
+ m_disconnectedFrame = 0;
- // DOMWindowExtension lifetime isn't tied directly to the DOMWindow itself so it is important that it unregister
- // itself from any DOMWindow it is associated with when detached.
- // This might be the disconnected DOMWindow if the DOMWindow is in a CachedPage that is pruned.
- DOMWindow* associatedDOMWindow = m_disconnectedDOMWindow ? m_disconnectedDOMWindow : frame->domWindow();
- associatedDOMWindow->unregisterProperty(this);
- m_disconnectedDOMWindow = 0;
-
- frame->loader()->client()->dispatchWillDestroyGlobalObjectForDOMWindowExtension(this);
+ DOMWindowProperty::willDestroyGlobalObjectInCachedFrame();
+}
- m_disconnectedFrame = 0;
+void DOMWindowExtension::willDestroyGlobalObjectInFrame()
+{
+ ASSERT(!m_disconnectedFrame);
+
+ // Calling out to the client might result in this DOMWindowExtension being destroyed
+ // while there is still work to do.
+ RefPtr<DOMWindowExtension> protector = this;
+
+ if (!m_wasDetached) {
+ Frame* frame = this->frame();
+ ASSERT(frame);
+ frame->loader()->client()->dispatchWillDestroyGlobalObjectForDOMWindowExtension(this);
+ }
+
+ DOMWindowProperty::willDestroyGlobalObjectInFrame();
+}
+
+void DOMWindowExtension::willDetachGlobalObjectFromFrame()
+{
+ ASSERT(!m_disconnectedFrame);
+ ASSERT(!m_wasDetached);
+
+ // Calling out to the client might result in this DOMWindowExtension being destroyed
+ // while there is still work to do.
+ RefPtr<DOMWindowExtension> protector = this;
+
+ Frame* frame = this->frame();
+ ASSERT(frame);
+ frame->loader()->client()->dispatchWillDestroyGlobalObjectForDOMWindowExtension(this);
- DOMWindowProperty::willDetachPage();
-
m_wasDetached = true;
+ DOMWindowProperty::willDetachGlobalObjectFromFrame();
}
} // namespace WebCore
diff --git a/Source/WebCore/page/DOMWindowExtension.h b/Source/WebCore/page/DOMWindowExtension.h
index c20a4f746..53b873cce 100644
--- a/Source/WebCore/page/DOMWindowExtension.h
+++ b/Source/WebCore/page/DOMWindowExtension.h
@@ -33,7 +33,6 @@
namespace WebCore {
-class DOMWindow;
class DOMWindowExtension;
class DOMWrapperWorld;
class Frame;
@@ -45,11 +44,11 @@ public:
return adoptRef(new DOMWindowExtension(frame, world));
}
- ~DOMWindowExtension();
-
- virtual void disconnectFrame() OVERRIDE;
- virtual void reconnectFrame(Frame*) OVERRIDE;
- virtual void willDetachPage() OVERRIDE;
+ virtual void disconnectFrameForPageCache() OVERRIDE;
+ virtual void reconnectFrameFromPageCache(Frame*) OVERRIDE;
+ virtual void willDestroyGlobalObjectInCachedFrame() OVERRIDE;
+ virtual void willDestroyGlobalObjectInFrame() OVERRIDE;
+ virtual void willDetachGlobalObjectFromFrame() OVERRIDE;
DOMWrapperWorld* world() const { return m_world.get(); }
@@ -58,7 +57,6 @@ private:
RefPtr<DOMWrapperWorld> m_world;
RefPtr<Frame> m_disconnectedFrame;
- DOMWindow* m_disconnectedDOMWindow;
bool m_wasDetached;
};
diff --git a/Source/WebCore/page/DOMWindowProperty.cpp b/Source/WebCore/page/DOMWindowProperty.cpp
index 31ea44e7d..f4f32c29e 100644
--- a/Source/WebCore/page/DOMWindowProperty.cpp
+++ b/Source/WebCore/page/DOMWindowProperty.cpp
@@ -33,6 +33,7 @@ namespace WebCore {
DOMWindowProperty::DOMWindowProperty(Frame* frame)
: m_frame(frame)
+ , m_disconnectedDOMWindow(0)
{
if (m_frame)
m_frame->domWindow()->registerProperty(this);
@@ -40,25 +41,53 @@ DOMWindowProperty::DOMWindowProperty(Frame* frame)
DOMWindowProperty::~DOMWindowProperty()
{
- if (m_frame)
+ if (m_frame) {
+ ASSERT(!m_disconnectedDOMWindow);
m_frame->domWindow()->unregisterProperty(this);
+ } else if (m_disconnectedDOMWindow)
+ m_disconnectedDOMWindow->unregisterProperty(this);
}
-void DOMWindowProperty::disconnectFrame()
+void DOMWindowProperty::disconnectFrameForPageCache()
{
+ ASSERT(m_frame);
+ ASSERT(!m_disconnectedDOMWindow);
+ m_disconnectedDOMWindow = m_frame->domWindow();
m_frame = 0;
}
-void DOMWindowProperty::reconnectFrame(Frame* frame)
+void DOMWindowProperty::reconnectFrameFromPageCache(Frame* frame)
{
ASSERT(frame);
ASSERT(!m_frame);
+ ASSERT(m_disconnectedDOMWindow);
m_frame = frame;
+ m_disconnectedDOMWindow = 0;
+}
+
+void DOMWindowProperty::willDestroyGlobalObjectInCachedFrame()
+{
+ ASSERT(m_disconnectedDOMWindow);
+ // DOMWindowProperty lifetime isn't tied directly to the DOMWindow itself so it is important
+ // that it unregister itself from any DOMWindow it is associated with.
+ m_disconnectedDOMWindow->unregisterProperty(this);
+ m_disconnectedDOMWindow = 0;
+}
+
+void DOMWindowProperty::willDestroyGlobalObjectInFrame()
+{
+ ASSERT(m_frame);
+ ASSERT(!m_disconnectedDOMWindow);
+ // DOMWindowProperty lifetime isn't tied directly to the DOMWindow itself so it is important that it unregister
+ // itself from any DOMWindow it is associated with.
+ m_frame->domWindow()->unregisterProperty(this);
+ m_frame = 0;
}
-void DOMWindowProperty::willDetachPage()
+void DOMWindowProperty::willDetachGlobalObjectFromFrame()
{
- // Subclasses should override this function to handle this notification.
+ ASSERT(m_frame);
+ ASSERT(!m_disconnectedDOMWindow);
}
}
diff --git a/Source/WebCore/page/DOMWindowProperty.h b/Source/WebCore/page/DOMWindowProperty.h
index bc6600df8..441bc242e 100644
--- a/Source/WebCore/page/DOMWindowProperty.h
+++ b/Source/WebCore/page/DOMWindowProperty.h
@@ -28,15 +28,18 @@
namespace WebCore {
+class DOMWindow;
class Frame;
class DOMWindowProperty {
public:
explicit DOMWindowProperty(Frame*);
- virtual void disconnectFrame();
- virtual void reconnectFrame(Frame*);
- virtual void willDetachPage();
+ virtual void disconnectFrameForPageCache();
+ virtual void reconnectFrameFromPageCache(Frame*);
+ virtual void willDestroyGlobalObjectInCachedFrame();
+ virtual void willDestroyGlobalObjectInFrame();
+ virtual void willDetachGlobalObjectFromFrame();
Frame* frame() const { return m_frame; }
@@ -44,6 +47,7 @@ protected:
virtual ~DOMWindowProperty();
Frame* m_frame;
+ DOMWindow* m_disconnectedDOMWindow;
};
}
diff --git a/Source/WebCore/page/EventHandler.cpp b/Source/WebCore/page/EventHandler.cpp
index 290e58f3a..5cf991f96 100644
--- a/Source/WebCore/page/EventHandler.cpp
+++ b/Source/WebCore/page/EventHandler.cpp
@@ -2478,7 +2478,8 @@ bool EventHandler::handleGestureScrollCore(const PlatformGestureEvent& gestureEv
bool EventHandler::bestClickableNodeForTouchPoint(const IntPoint& touchCenter, const IntSize& touchRadius, IntPoint& targetPoint, Node*& targetNode)
{
HitTestRequest::HitTestRequestType hitType = HitTestRequest::ReadOnly | HitTestRequest::Active;
- HitTestResult result = hitTestResultAtPoint(touchCenter, /*allowShadowContent*/ false, /*ignoreClipping*/ false, DontHitTestScrollbars, hitType, touchRadius);
+ IntPoint hitTestPoint = m_frame->view()->windowToContents(touchCenter);
+ HitTestResult result = hitTestResultAtPoint(hitTestPoint, /*allowShadowContent*/ false, /*ignoreClipping*/ false, DontHitTestScrollbars, hitType, touchRadius);
IntRect touchRect = result.rectForPoint(touchCenter);
RefPtr<StaticHashSetNodeList> nodeList = StaticHashSetNodeList::adopt(result.rectBasedTestResult());
@@ -2488,7 +2489,8 @@ bool EventHandler::bestClickableNodeForTouchPoint(const IntPoint& touchCenter, c
bool EventHandler::bestZoomableAreaForTouchPoint(const IntPoint& touchCenter, const IntSize& touchRadius, IntRect& targetArea, Node*& targetNode)
{
HitTestRequest::HitTestRequestType hitType = HitTestRequest::ReadOnly | HitTestRequest::Active;
- HitTestResult result = hitTestResultAtPoint(touchCenter, /*allowShadowContent*/ false, /*ignoreClipping*/ false, DontHitTestScrollbars, hitType, touchRadius);
+ IntPoint hitTestPoint = m_frame->view()->windowToContents(touchCenter);
+ HitTestResult result = hitTestResultAtPoint(hitTestPoint, /*allowShadowContent*/ false, /*ignoreClipping*/ false, DontHitTestScrollbars, hitType, touchRadius);
IntRect touchRect = result.rectForPoint(touchCenter);
RefPtr<StaticHashSetNodeList> nodeList = StaticHashSetNodeList::adopt(result.rectBasedTestResult());
@@ -2597,6 +2599,18 @@ bool EventHandler::sendContextMenuEventForKey()
return dispatchMouseEvent(eventNames().contextmenuEvent, targetNode, true, 0, mouseEvent, false);
}
+#if ENABLE(GESTURE_EVENTS)
+bool EventHandler::sendContextMenuEventForGesture(const PlatformGestureEvent& event)
+{
+#if OS(WINDOWS)
+ PlatformEvent::Type eventType = PlatformEvent::MouseReleased;
+#else
+ PlatformEvent::Type eventType = PlatformEvent::MousePressed;
+#endif
+ PlatformMouseEvent mouseEvent(event.position(), event.globalPosition(), RightButton, eventType, 1, false, false, false, false, WTF::currentTime());
+ return sendContextMenuEvent(mouseEvent);
+}
+#endif // ENABLE(GESTURE_EVENTS)
#endif // ENABLE(CONTEXT_MENUS)
void EventHandler::scheduleHoverStateUpdate()
diff --git a/Source/WebCore/page/EventHandler.h b/Source/WebCore/page/EventHandler.h
index 5aa61c9e2..53f360802 100644
--- a/Source/WebCore/page/EventHandler.h
+++ b/Source/WebCore/page/EventHandler.h
@@ -175,6 +175,9 @@ public:
#if ENABLE(CONTEXT_MENUS)
bool sendContextMenuEvent(const PlatformMouseEvent&);
bool sendContextMenuEventForKey();
+#if ENABLE(GESTURE_EVENTS)
+ bool sendContextMenuEventForGesture(const PlatformGestureEvent&);
+#endif
#endif
void setMouseDownMayStartAutoscroll() { m_mouseDownMayStartAutoscroll = true; }
diff --git a/Source/WebCore/page/FocusController.cpp b/Source/WebCore/page/FocusController.cpp
index 9292ab10d..41f979523 100644
--- a/Source/WebCore/page/FocusController.cpp
+++ b/Source/WebCore/page/FocusController.cpp
@@ -65,11 +65,6 @@ namespace WebCore {
using namespace HTMLNames;
using namespace std;
-static inline bool isShadowHost(const Node* node)
-{
- return node && node->isElementNode() && toElement(node)->hasShadowRoot();
-}
-
static inline ComposedShadowTreeWalker walkerFrom(const Node* node)
{
return ComposedShadowTreeWalker(node, ComposedShadowTreeWalker::DoNotCrossUpperBoundary);
diff --git a/Source/WebCore/page/Frame.cpp b/Source/WebCore/page/Frame.cpp
index b061c3b46..d67a76ef3 100644
--- a/Source/WebCore/page/Frame.cpp
+++ b/Source/WebCore/page/Frame.cpp
@@ -262,12 +262,12 @@ void Frame::setView(PassRefPtr<FrameView> view)
if (m_view)
m_view->detachCustomScrollbars();
- // Detach the document now, so any onUnload handlers get run - if
- // we wait until the view is destroyed, then things won't be
- // hooked up enough for some JavaScript calls to work.
+ // Prepare for destruction now, so any unload event handlers get run and the DOMWindow is
+ // notified. If we wait until the view is destroyed, then things won't be hooked up enough for
+ // these calls to work.
if (!view && m_doc && m_doc->attached() && !m_doc->inPageCache()) {
// FIXME: We don't call willRemove here. Why is that OK?
- m_doc->detach();
+ m_doc->prepareForDestruction();
}
if (m_view)
diff --git a/Source/WebCore/page/FrameView.cpp b/Source/WebCore/page/FrameView.cpp
index bbe2e8577..25531b08b 100644
--- a/Source/WebCore/page/FrameView.cpp
+++ b/Source/WebCore/page/FrameView.cpp
@@ -482,12 +482,12 @@ PassRefPtr<Scrollbar> FrameView::createScrollbar(ScrollbarOrientation orientatio
// Try the <body> element first as a scrollbar source.
Element* body = doc ? doc->body() : 0;
if (body && body->renderer() && body->renderer()->style()->hasPseudoStyle(SCROLLBAR))
- return RenderScrollbar::createCustomScrollbar(this, orientation, body->renderer()->enclosingBox());
+ return RenderScrollbar::createCustomScrollbar(this, orientation, body);
// If the <body> didn't have a custom style, then the root element might.
Element* docElement = doc ? doc->documentElement() : 0;
if (docElement && docElement->renderer() && docElement->renderer()->style()->hasPseudoStyle(SCROLLBAR))
- return RenderScrollbar::createCustomScrollbar(this, orientation, docElement->renderBox());
+ return RenderScrollbar::createCustomScrollbar(this, orientation, docElement);
// If we have an owning iframe/frame element, then it can set the custom scrollbar also.
RenderPart* frameRenderer = m_frame->ownerRenderer();
@@ -2161,7 +2161,7 @@ void FrameView::unscheduleRelayout()
}
#if ENABLE(REQUEST_ANIMATION_FRAME)
-void FrameView::serviceScriptedAnimations(double monotonicAnimationStartTime)
+void FrameView::serviceScriptedAnimations(DOMTimeStamp time)
{
for (Frame* frame = m_frame.get(); frame; frame = frame->tree()->traverseNext()) {
frame->view()->serviceScrollAnimations();
@@ -2173,7 +2173,7 @@ void FrameView::serviceScriptedAnimations(double monotonicAnimationStartTime)
documents.append(frame->document());
for (size_t i = 0; i < documents.size(); ++i)
- documents[i]->serviceScriptedAnimations(monotonicAnimationStartTime);
+ documents[i]->serviceScriptedAnimations(time);
}
#endif
@@ -2279,7 +2279,7 @@ void FrameView::updateWidget(RenderEmbeddedObject* object)
return;
// No need to update if it's already crashed or known to be missing.
- if (object->pluginCrashedOrWasMissing())
+ if (object->showsUnavailablePluginIndicator())
return;
// FIXME: This could turn into a real virtual dispatch if we defined
@@ -2558,30 +2558,31 @@ IntRect FrameView::windowClipRect(bool clipToContents) const
if (!m_frame || !m_frame->ownerElement())
return clipRect;
- // Take our owner element and get the clip rect from the enclosing layer.
- Element* elt = m_frame->ownerElement();
- // The renderer can sometimes be null when style="display:none" interacts
- // with external content and plugins.
- RenderLayer* layer = elt->renderer() ? elt->renderer()->enclosingLayer() : 0;
- if (!layer)
- return clipRect;
- FrameView* parentView = elt->document()->view();
- clipRect.intersect(parentView->windowClipRectForLayer(layer, true));
+ // Take our owner element and get its clip rect.
+ HTMLFrameOwnerElement* ownerElement = m_frame->ownerElement();
+ FrameView* parentView = ownerElement->document()->view();
+ clipRect.intersect(parentView->windowClipRectForFrameOwner(ownerElement, true));
return clipRect;
}
-IntRect FrameView::windowClipRectForLayer(const RenderLayer* layer, bool clipToLayerContents) const
+IntRect FrameView::windowClipRectForFrameOwner(const HTMLFrameOwnerElement* ownerElement, bool clipToLayerContents) const
{
+ // The renderer can sometimes be null when style="display:none" interacts
+ // with external content and plugins.
+ if (!ownerElement->renderer())
+ return windowClipRect();
+
// If we have no layer, just return our window clip rect.
- if (!layer)
+ const RenderLayer* enclosingLayer = ownerElement->renderer()->enclosingLayer();
+ if (!enclosingLayer)
return windowClipRect();
// Apply the clip from the layer.
IntRect clipRect;
if (clipToLayerContents)
- clipRect = pixelSnappedIntRect(layer->childrenClipRect());
+ clipRect = pixelSnappedIntRect(enclosingLayer->childrenClipRect());
else
- clipRect = pixelSnappedIntRect(layer->selfClipRect());
+ clipRect = pixelSnappedIntRect(enclosingLayer->selfClipRect());
clipRect = contentsToWindow(clipRect);
return intersection(clipRect, windowClipRect());
}
@@ -2912,23 +2913,6 @@ bool FrameView::hasCustomScrollbars() const
return false;
}
-void FrameView::clearOwningRendererForCustomScrollbars(RenderBox* box)
-{
- const HashSet<RefPtr<Widget> >* viewChildren = children();
- HashSet<RefPtr<Widget> >::const_iterator end = viewChildren->end();
- for (HashSet<RefPtr<Widget> >::const_iterator current = viewChildren->begin(); current != end; ++current) {
- Widget* widget = current->get();
- if (widget->isScrollbar()) {
- Scrollbar* scrollbar = static_cast<Scrollbar*>(widget);
- if (scrollbar->isCustomScrollbar()) {
- RenderScrollbar* customScrollbar = toRenderScrollbar(scrollbar);
- if (customScrollbar->owningRenderer() == box)
- customScrollbar->clearOwningRenderer();
- }
- }
- }
-}
-
FrameView* FrameView::parentFrameView() const
{
if (Widget* parentView = parent()) {
diff --git a/Source/WebCore/page/FrameView.h b/Source/WebCore/page/FrameView.h
index c5f94afdd..50232755c 100644
--- a/Source/WebCore/page/FrameView.h
+++ b/Source/WebCore/page/FrameView.h
@@ -112,7 +112,7 @@ public:
bool needsFullRepaint() const { return m_doFullRepaint; }
#if ENABLE(REQUEST_ANIMATION_FRAME)
- void serviceScriptedAnimations(double monotonicAnimationStartTime);
+ void serviceScriptedAnimations(DOMTimeStamp);
#endif
#if USE(ACCELERATED_COMPOSITING)
@@ -168,7 +168,7 @@ public:
void adjustViewSize();
virtual IntRect windowClipRect(bool clipToContents = true) const;
- IntRect windowClipRectForLayer(const RenderLayer*, bool clipToLayerContents) const;
+ IntRect windowClipRectForFrameOwner(const HTMLFrameOwnerElement*, bool clipToLayerContents) const;
virtual IntRect windowResizerRect() const;
@@ -318,8 +318,6 @@ public:
void setAnimatorsAreActive();
RenderBox* embeddedContentBox() const;
-
- void clearOwningRendererForCustomScrollbars(RenderBox*);
void setTracksRepaints(bool);
bool isTrackingRepaints() const { return m_isTrackingRepaints; }
diff --git a/Source/WebCore/page/NavigatorRegisterProtocolHandler.cpp b/Source/WebCore/page/NavigatorRegisterProtocolHandler.cpp
index 8635b9075..61f410abe 100644
--- a/Source/WebCore/page/NavigatorRegisterProtocolHandler.cpp
+++ b/Source/WebCore/page/NavigatorRegisterProtocolHandler.cpp
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2011, Google 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 are met:
@@ -29,6 +30,7 @@
#if ENABLE(REGISTER_PROTOCOL_HANDLER)
#include "Chrome.h"
+#include "ChromeClient.h"
#include "Document.h"
#include "ExceptionCode.h"
#include "Frame.h"
@@ -137,7 +139,7 @@ void NavigatorRegisterProtocolHandler::registerProtocolHandler(Navigator* naviga
if (!page)
return;
- page->chrome()->registerProtocolHandler(scheme, baseURL, url, navigator->frame()->displayStringModifiedByEncoding(title));
+ page->chrome()->client()->registerProtocolHandler(scheme, baseURL, url, navigator->frame()->displayStringModifiedByEncoding(title));
}
} // namespace WebCore
diff --git a/Source/WebCore/page/Page.cpp b/Source/WebCore/page/Page.cpp
index 0c40f3373..d30900f60 100644
--- a/Source/WebCore/page/Page.cpp
+++ b/Source/WebCore/page/Page.cpp
@@ -641,10 +641,16 @@ void Page::setMediaVolume(float volume)
void Page::setPageScaleFactor(float scale, const IntPoint& origin)
{
- if (scale == m_pageScaleFactor)
- return;
-
Document* document = mainFrame()->document();
+ FrameView* view = document->view();
+
+ if (scale == m_pageScaleFactor) {
+ if (view && view->scrollPosition() != origin) {
+ document->updateLayoutIgnorePendingStylesheets();
+ view->setScrollPosition(origin);
+ }
+ return;
+ }
m_pageScaleFactor = scale;
@@ -657,12 +663,10 @@ void Page::setPageScaleFactor(float scale, const IntPoint& origin)
mainFrame()->deviceOrPageScaleFactorChanged();
#endif
- if (FrameView* view = document->view()) {
- if (view->scrollPosition() != origin) {
- if (document->renderer() && document->renderer()->needsLayout() && view->didFirstLayout())
- view->layout();
- view->setScrollPosition(origin);
- }
+ if (view && view->scrollPosition() != origin) {
+ if (document->renderer() && document->renderer()->needsLayout() && view->didFirstLayout())
+ view->layout();
+ view->setScrollPosition(origin);
}
}
diff --git a/Source/WebCore/page/PointerLock.cpp b/Source/WebCore/page/PointerLock.cpp
index 72311e0f2..9cff8ed0c 100644
--- a/Source/WebCore/page/PointerLock.cpp
+++ b/Source/WebCore/page/PointerLock.cpp
@@ -46,9 +46,15 @@ PointerLock::~PointerLock()
ASSERT(!m_controller);
}
-void PointerLock::disconnectFrame()
+void PointerLock::disconnectFrameForPageCache()
{
- DOMWindowProperty::disconnectFrame();
+ DOMWindowProperty::disconnectFrameForPageCache();
+ m_controller = 0;
+}
+
+void PointerLock::willDestroyGlobalObjectInFrame()
+{
+ DOMWindowProperty::willDestroyGlobalObjectInFrame();
m_controller = 0;
}
diff --git a/Source/WebCore/page/PointerLock.h b/Source/WebCore/page/PointerLock.h
index 240d79ac8..d1e25fb64 100644
--- a/Source/WebCore/page/PointerLock.h
+++ b/Source/WebCore/page/PointerLock.h
@@ -45,7 +45,8 @@ public:
~PointerLock();
// DOMWindowProperty Interface
- virtual void disconnectFrame() OVERRIDE;
+ virtual void disconnectFrameForPageCache() OVERRIDE;
+ virtual void willDestroyGlobalObjectInFrame() OVERRIDE;
void lock(Element* target, PassRefPtr<VoidCallback> successCallback, PassRefPtr<VoidCallback> failureCallback);
void unlock();
diff --git a/Source/WebCore/page/TouchAdjustment.cpp b/Source/WebCore/page/TouchAdjustment.cpp
index 5a1bf2bb0..587003b2f 100644
--- a/Source/WebCore/page/TouchAdjustment.cpp
+++ b/Source/WebCore/page/TouchAdjustment.cpp
@@ -265,6 +265,10 @@ bool findNodeWithLowestDistanceMetric(Node*& targetNode, IntPoint& targetPoint,
}
}
}
+ if (targetNode) {
+ targetArea = targetNode->document()->view()->contentsToWindow(targetArea);
+ targetPoint = targetNode->document()->view()->contentsToWindow(targetPoint);
+ }
return (targetNode);
}
diff --git a/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp b/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp
index 5373f00b2..9cf96153b 100644
--- a/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp
+++ b/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp
@@ -114,13 +114,22 @@ static Region computeNonFastScrollableRegion(Frame* mainFrame)
if (!frameView)
continue;
- const FrameView::ScrollableAreaSet* scrollableAreas = frameView->scrollableAreas();
- if (!scrollableAreas)
- continue;
+ if (const FrameView::ScrollableAreaSet* scrollableAreas = frameView->scrollableAreas()) {
+ for (FrameView::ScrollableAreaSet::const_iterator it = scrollableAreas->begin(), end = scrollableAreas->end(); it != end; ++it) {
+ ScrollableArea* scrollableArea = *it;
+ nonFastScrollableRegion.unite(scrollableArea->scrollableAreaBoundingBox());
+ }
+ }
- for (FrameView::ScrollableAreaSet::const_iterator it = scrollableAreas->begin(), end = scrollableAreas->end(); it != end; ++it) {
- ScrollableArea* scrollableArea = *it;
- nonFastScrollableRegion.unite(scrollableArea->scrollableAreaBoundingBox());
+ if (const HashSet<RefPtr<Widget> >* children = frameView->children()) {
+ for (HashSet<RefPtr<Widget> >::const_iterator it = children->begin(), end = children->end(); it != end; ++it) {
+ if (!(*it)->isPluginViewBase())
+ continue;
+
+ PluginViewBase* pluginViewBase = static_cast<PluginViewBase*>((*it).get());
+ if (pluginViewBase->wantsWheelEvents())
+ nonFastScrollableRegion.unite(pluginViewBase->frameRect());
+ }
}
}
@@ -149,6 +158,7 @@ void ScrollingCoordinator::frameViewLayoutUpdated(FrameView* frameView)
scrollParameters.horizontalScrollbarMode = frameView->horizontalScrollbarMode();
scrollParameters.verticalScrollbarMode = frameView->verticalScrollbarMode();
+ scrollParameters.scrollOrigin = frameView->scrollOrigin();
scrollParameters.viewportRect = IntRect(IntPoint(), frameView->visibleContentRect().size());
scrollParameters.contentsSize = frameView->contentsSize();
@@ -360,6 +370,7 @@ void ScrollingCoordinator::setScrollParameters(const ScrollParameters& scrollPar
m_scrollingTreeState->setHorizontalScrollbarMode(scrollParameters.horizontalScrollbarMode);
m_scrollingTreeState->setVerticalScrollbarMode(scrollParameters.verticalScrollbarMode);
+ m_scrollingTreeState->setScrollOrigin(scrollParameters.scrollOrigin);
m_scrollingTreeState->setViewportRect(scrollParameters.viewportRect);
m_scrollingTreeState->setContentsSize(scrollParameters.contentsSize);
scheduleTreeStateCommit();
diff --git a/Source/WebCore/page/scrolling/ScrollingCoordinator.h b/Source/WebCore/page/scrolling/ScrollingCoordinator.h
index 14923c922..b471e2aae 100644
--- a/Source/WebCore/page/scrolling/ScrollingCoordinator.h
+++ b/Source/WebCore/page/scrolling/ScrollingCoordinator.h
@@ -135,6 +135,8 @@ private:
ScrollbarMode horizontalScrollbarMode;
ScrollbarMode verticalScrollbarMode;
+ IntPoint scrollOrigin;
+
IntRect viewportRect;
IntSize contentsSize;
};
diff --git a/Source/WebCore/page/scrolling/ScrollingTreeNode.cpp b/Source/WebCore/page/scrolling/ScrollingTreeNode.cpp
index 02eba8bf3..28402ce16 100644
--- a/Source/WebCore/page/scrolling/ScrollingTreeNode.cpp
+++ b/Source/WebCore/page/scrolling/ScrollingTreeNode.cpp
@@ -76,6 +76,9 @@ void ScrollingTreeNode::update(ScrollingTreeState* state)
if (state->changedProperties() & ScrollingTreeState::VerticalScrollbarMode)
m_verticalScrollbarMode = state->verticalScrollbarMode();
+
+ if (state->changedProperties() & ScrollingTreeState::ScrollOrigin)
+ m_scrollOrigin = state->scrollOrigin();
}
} // namespace WebCore
diff --git a/Source/WebCore/page/scrolling/ScrollingTreeNode.h b/Source/WebCore/page/scrolling/ScrollingTreeNode.h
index a15752114..f69ae9f41 100644
--- a/Source/WebCore/page/scrolling/ScrollingTreeNode.h
+++ b/Source/WebCore/page/scrolling/ScrollingTreeNode.h
@@ -65,11 +65,14 @@ protected:
bool canHaveScrollbars() const { return m_horizontalScrollbarMode != ScrollbarAlwaysOff || m_verticalScrollbarMode != ScrollbarAlwaysOff; }
+ const IntPoint& scrollOrigin() const { return m_scrollOrigin; }
+
private:
ScrollingTree* m_scrollingTree;
IntRect m_viewportRect;
IntSize m_contentsSize;
+ IntPoint m_scrollOrigin;
bool m_shouldUpdateScrollLayerPositionOnMainThread;
diff --git a/Source/WebCore/page/scrolling/ScrollingTreeState.cpp b/Source/WebCore/page/scrolling/ScrollingTreeState.cpp
index a1a3e162f..5eb53abe6 100644
--- a/Source/WebCore/page/scrolling/ScrollingTreeState.cpp
+++ b/Source/WebCore/page/scrolling/ScrollingTreeState.cpp
@@ -157,6 +157,15 @@ void ScrollingTreeState::setRequestedScrollPosition(const IntPoint& requestedScr
m_changedProperties |= RequestedScrollPosition;
}
+void ScrollingTreeState::setScrollOrigin(const IntPoint& scrollOrigin)
+{
+ if (m_scrollOrigin == scrollOrigin)
+ return;
+
+ m_scrollOrigin = scrollOrigin;
+ m_changedProperties |= ScrollOrigin;
+}
+
PassOwnPtr<ScrollingTreeState> ScrollingTreeState::commit()
{
OwnPtr<ScrollingTreeState> treeState = adoptPtr(new ScrollingTreeState(*this));
diff --git a/Source/WebCore/page/scrolling/ScrollingTreeState.h b/Source/WebCore/page/scrolling/ScrollingTreeState.h
index 18bba6f41..3b4a8d68b 100644
--- a/Source/WebCore/page/scrolling/ScrollingTreeState.h
+++ b/Source/WebCore/page/scrolling/ScrollingTreeState.h
@@ -61,8 +61,9 @@ public:
HasEnabledVerticalScrollbar = 1 << 8,
HorizontalScrollbarMode = 1 << 9,
VerticalScrollbarMode = 1 << 10,
- ScrollLayer = 1 << 11,
- RequestedScrollPosition = 1 << 12,
+ ScrollOrigin = 1 << 11,
+ ScrollLayer = 1 << 12,
+ RequestedScrollPosition = 1 << 13,
};
bool hasChangedProperties() const { return m_changedProperties; }
@@ -107,6 +108,9 @@ public:
const IntPoint& requestedScrollPosition() const { return m_requestedScrollPosition; }
void setRequestedScrollPosition(const IntPoint&);
+ const IntPoint& scrollOrigin() const { return m_scrollOrigin; }
+ void setScrollOrigin(const IntPoint&);
+
// Copies the current tree state and clears the changed properties mask in the original.
PassOwnPtr<ScrollingTreeState> commit();
@@ -134,6 +138,7 @@ private:
ScrollbarMode m_verticalScrollbarMode;
IntPoint m_requestedScrollPosition;
+ IntPoint m_scrollOrigin;
#if PLATFORM(MAC)
RetainPtr<PlatformLayer> m_platformScrollLayer;
diff --git a/Source/WebCore/page/scrolling/mac/ScrollingTreeNodeMac.mm b/Source/WebCore/page/scrolling/mac/ScrollingTreeNodeMac.mm
index 622eb8cd4..b87e446d9 100644
--- a/Source/WebCore/page/scrolling/mac/ScrollingTreeNodeMac.mm
+++ b/Source/WebCore/page/scrolling/mac/ScrollingTreeNodeMac.mm
@@ -237,24 +237,22 @@ IntPoint ScrollingTreeNodeMac::scrollPosition() const
return m_probableMainThreadScrollPosition;
CGPoint scrollLayerPosition = m_scrollLayer.get().position;
- return IntPoint(-scrollLayerPosition.x, -scrollLayerPosition.y);
+ return IntPoint(-scrollLayerPosition.x + scrollOrigin().x(), -scrollLayerPosition.y + scrollOrigin().y());
}
void ScrollingTreeNodeMac::setScrollLayerPosition(const IntPoint& position)
{
ASSERT(!shouldUpdateScrollLayerPositionOnMainThread());
- m_scrollLayer.get().position = CGPointMake(-position.x(), -position.y());
+ m_scrollLayer.get().position = CGPointMake(-position.x() + scrollOrigin().x(), -position.y() + scrollOrigin().y());
}
IntPoint ScrollingTreeNodeMac::minimumScrollPosition() const
{
- // FIXME: This should take the scroll origin into account.
return IntPoint(0, 0);
}
IntPoint ScrollingTreeNodeMac::maximumScrollPosition() const
{
- // FIXME: This should take the scroll origin into account.
IntPoint position(contentsSize().width() - viewportRect().width(),
contentsSize().height() - viewportRect().height());
diff --git a/Source/WebCore/platform/AsyncFileSystem.cpp b/Source/WebCore/platform/AsyncFileSystem.cpp
index 13c282e20..a3fb07f86 100644
--- a/Source/WebCore/platform/AsyncFileSystem.cpp
+++ b/Source/WebCore/platform/AsyncFileSystem.cpp
@@ -35,16 +35,10 @@
#include "AsyncFileSystemCallbacks.h"
#include "ExceptionCode.h"
-#include "FileSystem.h"
#include "NotImplemented.h"
namespace WebCore {
-const char AsyncFileSystem::persistentPathPrefix[] = "persistent";
-const size_t AsyncFileSystem::persistentPathPrefixLength = sizeof(AsyncFileSystem::persistentPathPrefix) - 1;
-const char AsyncFileSystem::temporaryPathPrefix[] = "temporary";
-const size_t AsyncFileSystem::temporaryPathPrefixLength = sizeof(AsyncFileSystem::temporaryPathPrefix) - 1;
-
#if !PLATFORM(CHROMIUM) && !PLATFORM(GTK) && !PLATFORM(BLACKBERRY)
bool AsyncFileSystem::isAvailable()
{
@@ -52,18 +46,7 @@ bool AsyncFileSystem::isAvailable()
return false;
}
-bool AsyncFileSystem::isValidType(FileSystemType type)
-{
- return type == FileSystemTypeTemporary || type == FileSystemTypePersistent;
-}
-
-PassOwnPtr<AsyncFileSystem> AsyncFileSystem::create(FileSystemType)
-{
- notImplemented();
- return nullptr;
-}
-
-void AsyncFileSystem::openFileSystem(const String& basePath, const String& storageIdentifier, FileSystemType, bool, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
+void AsyncFileSystem::openFileSystem(const String& basePath, const String& storageIdentifier, bool, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
{
notImplemented();
callbacks->didFail(NOT_SUPPORTED_ERR);
diff --git a/Source/WebCore/platform/AsyncFileSystem.h b/Source/WebCore/platform/AsyncFileSystem.h
index 683297924..6e53a9aa5 100644
--- a/Source/WebCore/platform/AsyncFileSystem.h
+++ b/Source/WebCore/platform/AsyncFileSystem.h
@@ -51,106 +51,86 @@ class AsyncFileSystem {
public:
virtual ~AsyncFileSystem() { }
- // Path prefixes that are used in the filesystem URLs (that can be obtained by toURL()).
- // http://www.w3.org/TR/file-system-api/#widl-Entry-toURL
- static const char persistentPathPrefix[];
- static const size_t persistentPathPrefixLength;
- static const char temporaryPathPrefix[];
- static const size_t temporaryPathPrefixLength;
-
virtual void stop() { }
virtual bool hasPendingActivity() { return false; }
static bool isAvailable();
- static bool isValidType(FileSystemType);
-
- static bool crackFileSystemURL(const KURL&, FileSystemType&, String& filePath);
-
- virtual KURL toURL(const String& originString, const String& fullPath) const = 0;
-
// Subclass must implement this if it supports synchronous operations.
// This should return false if there are no pending operations.
virtual bool waitForOperationToComplete() { return false; }
// Creates and returns a new platform-specific AsyncFileSystem instance if the platform has its own implementation.
- static PassOwnPtr<AsyncFileSystem> create(FileSystemType);
+ static PassOwnPtr<AsyncFileSystem> create();
// Opens a new file system. The create parameter specifies whether or not to create the path if it does not already exists.
- static void openFileSystem(const String& basePath, const String& storageIdentifier, FileSystemType, bool create, PassOwnPtr<AsyncFileSystemCallbacks>);
+ static void openFileSystem(const String& basePath, const String& storageIdentifier, bool create, PassOwnPtr<AsyncFileSystemCallbacks>);
// Moves a file or directory from srcPath to destPath.
// AsyncFileSystemCallbacks::didSucceed() is called when the operation is completed successfully.
// AsyncFileSystemCallbacks::didFail() is called otherwise.
- virtual void move(const String& srcPath, const String& destPath, PassOwnPtr<AsyncFileSystemCallbacks>) = 0;
+ virtual void move(const KURL& srcPath, const KURL& destPath, PassOwnPtr<AsyncFileSystemCallbacks>) = 0;
// Copies a file or directory from srcPath to destPath.
// AsyncFileSystemCallbacks::didSucceed() is called when the operation is completed successfully.
// AsyncFileSystemCallbacks::didFail() is called otherwise.
- virtual void copy(const String& srcPath, const String& destPath, PassOwnPtr<AsyncFileSystemCallbacks>) = 0;
+ virtual void copy(const KURL& srcPath, const KURL& destPath, PassOwnPtr<AsyncFileSystemCallbacks>) = 0;
// Deletes a file or directory at a given path.
// It is an error to try to remove a directory that is not empty.
// AsyncFileSystemCallbacks::didSucceed() is called when the operation is completed successfully.
// AsyncFileSystemCallbacks::didFail() is called otherwise.
- virtual void remove(const String& path, PassOwnPtr<AsyncFileSystemCallbacks>) = 0;
+ virtual void remove(const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks>) = 0;
// Recursively deletes a directory at a given path.
// AsyncFileSystemCallbacks::didSucceed() is called when the operation is completed successfully.
// AsyncFileSystemCallbacks::didFail() is called otherwise.
- virtual void removeRecursively(const String& path, PassOwnPtr<AsyncFileSystemCallbacks>) = 0;
+ virtual void removeRecursively(const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks>) = 0;
// Retrieves the metadata information of the file or directory at a given path.
// AsyncFileSystemCallbacks::didReadMetadata() is called when the operation is completed successfully.
// AsyncFileSystemCallbacks::didFail() is called otherwise.
- virtual void readMetadata(const String& path, PassOwnPtr<AsyncFileSystemCallbacks>) = 0;
+ virtual void readMetadata(const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks>) = 0;
// Creates a file at a given path. If exclusive flag is true, it fails if the path already exists.
// AsyncFileSystemCallbacks::didSucceed() is called when the operation is completed successfully.
// AsyncFileSystemCallbacks::didFail() is called otherwise.
- virtual void createFile(const String& path, bool exclusive, PassOwnPtr<AsyncFileSystemCallbacks>) = 0;
+ virtual void createFile(const KURL& path, bool exclusive, PassOwnPtr<AsyncFileSystemCallbacks>) = 0;
// Creates a directory at a given path. If exclusive flag is true, it fails if the path already exists.
// AsyncFileSystemCallbacks::didSucceed() is called when the operation is completed successfully.
// AsyncFileSystemCallbacks::didFail() is called otherwise.
- virtual void createDirectory(const String& path, bool exclusive, PassOwnPtr<AsyncFileSystemCallbacks>) = 0;
+ virtual void createDirectory(const KURL& path, bool exclusive, PassOwnPtr<AsyncFileSystemCallbacks>) = 0;
// Checks if a file exists at a given path.
// AsyncFileSystemCallbacks::didSucceed() is called if the file exists.
// AsyncFileSystemCallbacks::didFail() is called otherwise.
- virtual void fileExists(const String& path, PassOwnPtr<AsyncFileSystemCallbacks>) = 0;
+ virtual void fileExists(const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks>) = 0;
// Checks if a directory exists at a given path.
// AsyncFileSystemCallbacks::didSucceed() is called if the directory exists.
// AsyncFileSystemCallbacks::didFail() is called otherwise.
- virtual void directoryExists(const String& path, PassOwnPtr<AsyncFileSystemCallbacks>) = 0;
+ virtual void directoryExists(const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks>) = 0;
// Reads directory entries of a given directory at path.
// AsyncFileSystemCallbacks::didReadDirectoryEntry() is called when each directory entry is called. AsyncFileSystemCallbacks::didReadDirectoryEntries() is called after a chunk of directory entries have been read.
// AsyncFileSystemCallbacks::didFail() is when there is an error.
- virtual void readDirectory(const String& path, PassOwnPtr<AsyncFileSystemCallbacks>) = 0;
+ virtual void readDirectory(const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks>) = 0;
// Creates an AsyncFileWriter for a given file path.
// AsyncFileSystemCallbacks::didCreateFileWriter() is called when an AsyncFileWriter is created successfully.
// AsyncFileSystemCallbacks::didFail() is called otherwise.
- virtual void createWriter(AsyncFileWriterClient* client, const String& path, PassOwnPtr<AsyncFileSystemCallbacks>) = 0;
+ virtual void createWriter(AsyncFileWriterClient*, const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks>) = 0;
// Creates a snapshot file and read its metadata for a new File object.
// In local filesystem cases the backend may simply return the metadata of the file itself (as well as readMetadata does),
// while in remote filesystem case the backend may download the file into a temporary snapshot file and return the metadata of the temporary file.
// AsyncFileSystemCallbacks::didReadMetadata() is called when the metadata for the snapshot file is successfully returned.
// AsyncFileSystemCallbacks::didFail() is called otherwise.
- virtual void createSnapshotFileAndReadMetadata(const String& path, PassOwnPtr<AsyncFileSystemCallbacks>) = 0;
-
- FileSystemType type() const { return m_type; }
+ virtual void createSnapshotFileAndReadMetadata(const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks>) = 0;
protected:
- AsyncFileSystem(FileSystemType type)
- : m_type(type)
- {
- }
-
- FileSystemType m_type;
+ AsyncFileSystem() { }
};
} // namespace WebCore
diff --git a/Source/WebCore/platform/AsyncFileSystemCallbacks.h b/Source/WebCore/platform/AsyncFileSystemCallbacks.h
index d8a85e747..61b338624 100644
--- a/Source/WebCore/platform/AsyncFileSystemCallbacks.h
+++ b/Source/WebCore/platform/AsyncFileSystemCallbacks.h
@@ -49,7 +49,7 @@ public:
virtual void didSucceed() { ASSERT_NOT_REACHED(); }
// Called when a requested file system is opened.
- virtual void didOpenFileSystem(const String& name, PassOwnPtr<AsyncFileSystem>) { ASSERT_NOT_REACHED(); }
+ virtual void didOpenFileSystem(const String& name, const KURL& rootURL, PassOwnPtr<AsyncFileSystem>) { ASSERT_NOT_REACHED(); }
// Called when a file metadata is read successfully.
virtual void didReadMetadata(const FileMetadata&) { ASSERT_NOT_REACHED(); }
diff --git a/Source/WebKit/chromium/src/StorageEventDispatcherImpl.h b/Source/WebCore/platform/EventTracer.cpp
index d3433851f..97267a480 100644
--- a/Source/WebKit/chromium/src/StorageEventDispatcherImpl.h
+++ b/Source/WebCore/platform/EventTracer.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2009 Google Inc. All rights reserved.
+ * 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
@@ -28,30 +28,29 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef StorageEventDispatcherImpl_h
-#define StorageEventDispatcherImpl_h
-
-#include "PlatformString.h"
-#include "StorageArea.h"
+#include "config.h"
+#include "EventTracer.h"
namespace WebCore {
-class KURL;
-class PageGroup;
-class SecurityOrigin;
-
-class StorageEventDispatcherImpl {
-public:
- StorageEventDispatcherImpl(const String& groupName);
-
- void dispatchStorageEvent(const String& key, const String& oldValue,
- const String& newValue, SecurityOrigin*,
- const KURL&, StorageType);
-
-private:
- PageGroup* m_pageGroup;
-};
+const unsigned char* EventTracer::getTraceCategoryEnabledFlag(const char*)
+{
+ return 0;
+}
+
+int EventTracer::addTraceEvent(char,
+ const unsigned char*,
+ const char*,
+ unsigned long long,
+ int,
+ const char**,
+ const unsigned char*,
+ const unsigned long long*,
+ int,
+ long long,
+ unsigned char)
+{
+ return -1;
+}
} // namespace WebCore
-
-#endif // StorageEventDispatcherImpl_h
diff --git a/Source/WebCore/platform/graphics/chromium/ImageChromiumMac.mm b/Source/WebCore/platform/EventTracer.h
index a6bbe3431..27b6e9dad 100644
--- a/Source/WebCore/platform/graphics/chromium/ImageChromiumMac.mm
+++ b/Source/WebCore/platform/EventTracer.h
@@ -1,10 +1,10 @@
/*
- * Copyright (c) 2008, 2009, Google Inc. All rights reserved.
- *
+ * 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:
- *
+ *
* * 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,31 +28,27 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// A wrapper around Uniscribe that provides a reasonable API.
-
-#include "config.h"
-#include "BitmapImage.h"
-
-#include "Image.h"
-#include "PlatformSupport.h"
+#ifndef EventTracer_h
+#define EventTracer_h
namespace WebCore {
-PassRefPtr<Image> Image::loadPlatformResource(const char* name)
-{
- return PlatformSupport::loadPlatformImageResource(name);
-}
-
-// FIXME: These are temporary stubs, we need real implementations which
-// may come in the form of ImageChromium.cpp. The Windows Chromium
-// implementation is currently in ImageSkia.cpp.
-
-void BitmapImage::initPlatformData()
-{
-}
-
-void BitmapImage::invalidatePlatformData()
-{
-}
-
-} // namespace WebCore
+class EventTracer {
+public:
+ static const unsigned char* getTraceCategoryEnabledFlag(const char*);
+ static int addTraceEvent(char phase,
+ const unsigned char* categoryEnabledFlag,
+ const char* name,
+ unsigned long long id,
+ int numArgs,
+ const char** argNames,
+ const unsigned char* argTypes,
+ const unsigned long long* argValues,
+ int thresholdBeginId,
+ long long threshold,
+ unsigned char flags);
+};
+
+} // namespace WebCore
+
+#endif // EventTracer_h
diff --git a/Source/WebCore/platform/FileChooser.h b/Source/WebCore/platform/FileChooser.h
index 98dc99cc8..5815c20da 100644
--- a/Source/WebCore/platform/FileChooser.h
+++ b/Source/WebCore/platform/FileChooser.h
@@ -56,6 +56,9 @@ struct FileChooserSettings {
#endif
Vector<String> acceptMIMETypes;
Vector<String> selectedFiles;
+#if ENABLE(MEDIA_CAPTURE)
+ String capture;
+#endif
};
class FileChooserClient {
diff --git a/Source/WebCore/platform/FractionalLayoutUnit.h b/Source/WebCore/platform/FractionalLayoutUnit.h
index 193ec984d..1899b992f 100644
--- a/Source/WebCore/platform/FractionalLayoutUnit.h
+++ b/Source/WebCore/platform/FractionalLayoutUnit.h
@@ -66,24 +66,38 @@ public:
// However due to compiler and platform differences adding those are non-trivial.
// See https://bugs.webkit.org/show_bug.cgi?id=83848 for details.
- FractionalLayoutUnit() : m_value(0) { }
- FractionalLayoutUnit(int value) { REPORT_OVERFLOW(isInBounds(value)); m_value = value * kFixedPointDenominator; }
- FractionalLayoutUnit(unsigned short value) { REPORT_OVERFLOW(isInBounds(value)); m_value = value * kFixedPointDenominator; }
- FractionalLayoutUnit(unsigned int value) { REPORT_OVERFLOW(isInBounds(value)); m_value = value * kFixedPointDenominator; }
- FractionalLayoutUnit(float value) { REPORT_OVERFLOW(isInBounds(value)); m_value = value * kFixedPointDenominator; }
- FractionalLayoutUnit(double value) { REPORT_OVERFLOW(isInBounds(value)); m_value = value * kFixedPointDenominator; }
- FractionalLayoutUnit(const FractionalLayoutUnit& value) { m_value = value.rawValue(); }
+ inline FractionalLayoutUnit() : m_value(0) { }
+#if ENABLE(SUBPIXEL_LAYOUT)
+ inline FractionalLayoutUnit(int value) { REPORT_OVERFLOW(isInBounds(value)); m_value = value * kFixedPointDenominator; }
+ inline FractionalLayoutUnit(unsigned short value) { REPORT_OVERFLOW(isInBounds(value)); m_value = value * kFixedPointDenominator; }
+ inline FractionalLayoutUnit(unsigned int value) { REPORT_OVERFLOW(isInBounds(value)); m_value = value * kFixedPointDenominator; }
+ inline FractionalLayoutUnit(float value) { REPORT_OVERFLOW(isInBounds(value)); m_value = value * kFixedPointDenominator; }
+ inline FractionalLayoutUnit(double value) { REPORT_OVERFLOW(isInBounds(value)); m_value = value * kFixedPointDenominator; }
+#else
+ inline FractionalLayoutUnit(int value) { REPORT_OVERFLOW(isInBounds(value)); m_value = value; }
+ inline FractionalLayoutUnit(unsigned short value) { REPORT_OVERFLOW(isInBounds(value)); m_value = value; }
+ inline FractionalLayoutUnit(unsigned int value) { REPORT_OVERFLOW(isInBounds(value)); m_value = value; }
+ inline FractionalLayoutUnit(float value) { REPORT_OVERFLOW(isInBounds(value)); m_value = value; }
+ inline FractionalLayoutUnit(double value) { REPORT_OVERFLOW(isInBounds(value)); m_value = value; }
+#endif
+ inline FractionalLayoutUnit(const FractionalLayoutUnit& value) { m_value = value.rawValue(); }
+#if ENABLE(SUBPIXEL_LAYOUT)
inline int toInt() const { return m_value / kFixedPointDenominator; }
- inline unsigned toUnsigned() const { REPORT_OVERFLOW(m_value >= 0); return toInt(); }
inline float toFloat() const { return static_cast<float>(m_value) / kFixedPointDenominator; }
inline double toDouble() const { return static_cast<double>(m_value) / kFixedPointDenominator; }
+#else
+ inline int toInt() const { return m_value; }
+ inline float toFloat() const { return static_cast<float>(m_value); }
+ inline double toDouble() const { return static_cast<double>(m_value); }
+#endif
+ inline unsigned toUnsigned() const { REPORT_OVERFLOW(m_value >= 0); return toInt(); }
- operator int() const { return toInt(); }
- operator unsigned() const { return toUnsigned(); }
- operator float() const { return toFloat(); }
- operator double() const { return toDouble(); }
- operator bool() const { return m_value; }
+ inline operator int() const { return toInt(); }
+ inline operator unsigned() const { return toUnsigned(); }
+ inline operator float() const { return toFloat(); }
+ inline operator double() const { return toDouble(); }
+ inline operator bool() const { return m_value; }
inline FractionalLayoutUnit operator++(int)
{
@@ -111,15 +125,23 @@ public:
inline int ceil() const
#endif
{
+#if ENABLE(SUBPIXEL_LAYOUT)
if (m_value > 0)
return (m_value + kFixedPointDenominator - 1) / kFixedPointDenominator;
return (m_value - kFixedPointDenominator + 1) / kFixedPointDenominator;
+#else
+ return m_value;
+#endif
}
inline int round() const
{
+#if ENABLE(SUBPIXEL_LAYOUT)
if (m_value > 0)
return (m_value + (kFixedPointDenominator / 2)) / kFixedPointDenominator;
return (m_value - (kFixedPointDenominator / 2)) / kFixedPointDenominator;
+#else
+ return m_value;
+#endif
}
inline int floor() const
@@ -321,6 +343,7 @@ inline bool operator==(const float a, const FractionalLayoutUnit& b)
// For multiplication that's prone to overflow, this bounds it to FractionalLayoutUnit::max() and ::min()
inline FractionalLayoutUnit boundedMultiply(const FractionalLayoutUnit& a, const FractionalLayoutUnit& b)
{
+#if ENABLE(SUBPIXEL_LAYOUT)
FractionalLayoutUnit returnVal;
long long rawVal = static_cast<long long>(a.rawValue()) * b.rawValue() / kFixedPointDenominator;
if (rawVal > std::numeric_limits<int>::max())
@@ -329,14 +352,21 @@ inline FractionalLayoutUnit boundedMultiply(const FractionalLayoutUnit& a, const
return FractionalLayoutUnit::min();
returnVal.setRawValue(rawVal);
return returnVal;
+#else
+ return a.rawValue() * b.rawValue();
+#endif
}
inline FractionalLayoutUnit operator*(const FractionalLayoutUnit& a, const FractionalLayoutUnit& b)
{
+#if ENABLE(SUBPIXEL_LAYOUT)
FractionalLayoutUnit returnVal;
long long rawVal = static_cast<long long>(a.rawValue()) * b.rawValue() / kFixedPointDenominator;
returnVal.setRawValue(rawVal);
return returnVal;
+#else
+ return a.rawValue() * b.rawValue();
+#endif
}
inline double operator*(const FractionalLayoutUnit& a, double b)
@@ -381,10 +411,14 @@ inline double operator*(const double a, const FractionalLayoutUnit& b)
inline FractionalLayoutUnit operator/(const FractionalLayoutUnit& a, const FractionalLayoutUnit& b)
{
+#if ENABLE(SUBPIXEL_LAYOUT)
FractionalLayoutUnit returnVal;
long long rawVal = static_cast<long long>(kFixedPointDenominator) * a.rawValue() / b.rawValue();
returnVal.setRawValue(rawVal);
return returnVal;
+#else
+ return a.rawValue() / b.rawValue();
+#endif
}
inline float operator/(const FractionalLayoutUnit& a, float b)
diff --git a/Source/WebCore/platform/LocalizedStrings.cpp b/Source/WebCore/platform/LocalizedStrings.cpp
index 24c9aa415..3cb519c08 100644
--- a/Source/WebCore/platform/LocalizedStrings.cpp
+++ b/Source/WebCore/platform/LocalizedStrings.cpp
@@ -673,6 +673,11 @@ String crashedPluginText()
return WEB_UI_STRING("Plug-in Failure", "Label text to be used if plugin host process has crashed");
}
+String insecurePluginVersionText()
+{
+ return WEB_UI_STRING("Insecure Plug-In Version", "Label text to be used when an insecure plug-in version was blocked from loading");
+}
+
String multipleFileUploadText(unsigned numberOfFiles)
{
return formatLocalizedString(WEB_UI_STRING("%d files", "Label to describe the number of files selected in a file upload control that allows multiple files"), numberOfFiles);
diff --git a/Source/WebCore/platform/LocalizedStrings.h b/Source/WebCore/platform/LocalizedStrings.h
index cda8bd69d..fe6686dba 100644
--- a/Source/WebCore/platform/LocalizedStrings.h
+++ b/Source/WebCore/platform/LocalizedStrings.h
@@ -167,6 +167,7 @@ namespace WebCore {
String missingPluginText();
String crashedPluginText();
+ String insecurePluginVersionText();
String multipleFileUploadText(unsigned numberOfFiles);
String unknownFileSizeText();
diff --git a/Source/WebCore/platform/ScrollView.h b/Source/WebCore/platform/ScrollView.h
index e7873f916..ec03125cd 100644
--- a/Source/WebCore/platform/ScrollView.h
+++ b/Source/WebCore/platform/ScrollView.h
@@ -145,6 +145,7 @@ public:
// which usually will happen when panning, pinching and rotation ends, or when scale or position are changed manually.
virtual IntRect visibleContentRect(bool includeScrollbars = false) const;
virtual void setFixedVisibleContentRect(const IntRect& visibleContentRect) { m_fixedVisibleContentRect = visibleContentRect; }
+ IntRect fixedVisibleContentRect() const { return m_fixedVisibleContentRect; }
int visibleWidth() const { return visibleContentRect().width(); }
int visibleHeight() const { return visibleContentRect().height(); }
@@ -294,9 +295,6 @@ protected:
virtual void visibleContentsResized() = 0;
virtual void delegatesScrollingDidChange() { }
-
- IntRect fixedVisibleContentRect() const { return m_fixedVisibleContentRect; }
-
// These functions are used to create/destroy scrollbars.
void setHasHorizontalScrollbar(bool);
void setHasVerticalScrollbar(bool);
diff --git a/Source/WebCore/platform/audio/AudioBus.cpp b/Source/WebCore/platform/audio/AudioBus.cpp
index b486a38b4..58a5e340d 100644
--- a/Source/WebCore/platform/audio/AudioBus.cpp
+++ b/Source/WebCore/platform/audio/AudioBus.cpp
@@ -45,13 +45,19 @@
namespace WebCore {
using namespace VectorMath;
-
+
+const unsigned MaxBusChannels = 32;
+
AudioBus::AudioBus(unsigned numberOfChannels, size_t length, bool allocate)
: m_length(length)
, m_busGain(1)
, m_isFirstTime(true)
, m_sampleRate(0)
{
+ ASSERT(numberOfChannels <= MaxBusChannels);
+ if (numberOfChannels > MaxBusChannels)
+ return;
+
m_channels.reserveInitialCapacity(numberOfChannels);
for (unsigned i = 0; i < numberOfChannels; ++i) {
@@ -307,106 +313,37 @@ void AudioBus::sumFrom(const AudioBus &sourceBus)
}
}
-// Slowly change gain to desired gain.
-#define GAIN_DEZIPPER \
- gain += (totalDesiredGain - gain) * DezipperRate; \
- gain = DenormalDisabler::flushDenormalFloatToZero(gain);
-
-// De-zipper for the first framesToDezipper frames and skip de-zippering for the remaining frames
-// because the gain is close enough to the target gain.
-#define PROCESS_WITH_GAIN(OP) \
- for (k = 0; k < framesToDezipper; ++k) { \
- OP \
- GAIN_DEZIPPER \
- } \
- if (!framesToDezipper) \
- gain = totalDesiredGain; \
- OP##_V
-
-#define STEREO_SUM \
- { \
- float sumL = DenormalDisabler::flushDenormalFloatToZero(*destinationL + gain * *sourceL++); \
- float sumR = DenormalDisabler::flushDenormalFloatToZero(*destinationR + gain * *sourceR++); \
- *destinationL++ = sumL; \
- *destinationR++ = sumR; \
- }
-
-#define STEREO_SUM_V \
- { \
- vsma(sourceL, 1, &gain, destinationL, 1, framesToProcess - k); \
- vsma(sourceR, 1, &gain, destinationR, 1, framesToProcess - k); \
- }
-
-// Mono -> stereo (mix equally into L and R)
-// FIXME: Really we should apply an equal-power scaling factor here, since we're effectively panning center...
-#define MONO2STEREO_SUM \
- { \
- float scaled = gain * *sourceL++; \
- float sumL = DenormalDisabler::flushDenormalFloatToZero(*destinationL + scaled); \
- float sumR = DenormalDisabler::flushDenormalFloatToZero(*destinationR + scaled); \
- *destinationL++ = sumL; \
- *destinationR++ = sumR; \
- }
-
-#define MONO2STEREO_SUM_V \
- { \
- vsma(sourceL, 1, &gain, destinationL, 1, framesToProcess - k); \
- vsma(sourceL, 1, &gain, destinationR, 1, framesToProcess - k); \
- }
-
-#define MONO_SUM \
- { \
- float sum = DenormalDisabler::flushDenormalFloatToZero(*destinationL + gain * *sourceL++); \
- *destinationL++ = sum; \
+void AudioBus::copyWithGainFrom(const AudioBus &sourceBus, float* lastMixGain, float targetGain)
+{
+ if (!topologyMatches(sourceBus)) {
+ ASSERT_NOT_REACHED();
+ zero();
+ return;
}
-#define MONO_SUM_V \
- { \
- vsma(sourceL, 1, &gain, destinationL, 1, framesToProcess - k); \
- }
-
-#define STEREO_NO_SUM \
- { \
- float sampleL = *sourceL++; \
- float sampleR = *sourceR++; \
- *destinationL++ = DenormalDisabler::flushDenormalFloatToZero(gain * sampleL); \
- *destinationR++ = DenormalDisabler::flushDenormalFloatToZero(gain * sampleR); \
+ if (sourceBus.isSilent()) {
+ zero();
+ return;
}
-#define STEREO_NO_SUM_V \
- { \
- vsmul(sourceL, 1, &gain, destinationL, 1, framesToProcess - k); \
- vsmul(sourceR, 1, &gain, destinationR, 1, framesToProcess - k); \
- }
+ unsigned numberOfChannels = this->numberOfChannels();
+ ASSERT(numberOfChannels <= MaxBusChannels);
+ if (numberOfChannels > MaxBusChannels)
+ return;
-// Mono -> stereo (mix equally into L and R)
-// FIXME: Really we should apply an equal-power scaling factor here, since we're effectively panning center...
-#define MONO2STEREO_NO_SUM \
- { \
- float sample = *sourceL++; \
- *destinationL++ = DenormalDisabler::flushDenormalFloatToZero(gain * sample); \
- *destinationR++ = DenormalDisabler::flushDenormalFloatToZero(gain * sample); \
- }
+ // If it is copying from the same bus and no need to change gain, just return.
+ if (this == &sourceBus && *lastMixGain == targetGain && targetGain == 1)
+ return;
-#define MONO2STEREO_NO_SUM_V \
- { \
- vsmul(sourceL, 1, &gain, destinationL, 1, framesToProcess - k); \
- vsmul(sourceL, 1, &gain, destinationR, 1, framesToProcess - k); \
- }
+ AudioBus& sourceBusSafe = const_cast<AudioBus&>(sourceBus);
+ const float* sources[MaxBusChannels];
+ float* destinations[MaxBusChannels];
-#define MONO_NO_SUM \
- { \
- float sampleL = *sourceL++; \
- *destinationL++ = DenormalDisabler::flushDenormalFloatToZero(gain * sampleL); \
+ for (unsigned i = 0; i < numberOfChannels; ++i) {
+ sources[i] = sourceBusSafe.channel(i)->data();
+ destinations[i] = channel(i)->mutableData();
}
-#define MONO_NO_SUM_V \
- { \
- vsmul(sourceL, 1, &gain, destinationL, 1, framesToProcess - k); \
- }
-
-void AudioBus::processWithGainFromMonoStereo(const AudioBus &sourceBus, float* lastMixGain, float targetGain, bool sumToBus)
-{
// We don't want to suddenly change the gain from mixing one time slice to the next,
// so we "de-zipper" by slowly changing the gain each sample-frame until we've achieved the target gain.
@@ -417,24 +354,8 @@ void AudioBus::processWithGainFromMonoStereo(const AudioBus &sourceBus, float* l
float gain = static_cast<float>(m_isFirstTime ? totalDesiredGain : *lastMixGain);
m_isFirstTime = false;
- int numberOfSourceChannels = sourceBus.numberOfChannels();
- int numberOfDestinationChannels = numberOfChannels();
-
- AudioBus& sourceBusSafe = const_cast<AudioBus&>(sourceBus);
- const float* sourceL = sourceBusSafe.channelByType(ChannelLeft)->data();
- const float* sourceR = numberOfSourceChannels > 1 ? sourceBusSafe.channelByType(ChannelRight)->data() : 0;
-
- if (sourceBusSafe.isSilent()) {
- if (!sumToBus)
- zero();
- return;
- }
-
- float* destinationL = channelByType(ChannelLeft)->mutableData();
- float* destinationR = numberOfDestinationChannels > 1 ? channelByType(ChannelRight)->mutableData() : 0;
-
const float DezipperRate = 0.005f;
- int framesToProcess = length();
+ unsigned framesToProcess = length();
// If the gain is within epsilon of totalDesiredGain, we can skip dezippering.
// FIXME: this value may need tweaking.
@@ -442,66 +363,41 @@ void AudioBus::processWithGainFromMonoStereo(const AudioBus &sourceBus, float* l
float gainDiff = fabs(totalDesiredGain - gain);
// Number of frames to de-zipper before we are close enough to the target gain.
- int framesToDezipper = (gainDiff < epsilon) ? 0 : framesToProcess;
-
- int k = 0;
-
- if (sumToBus) {
- // Sum to our bus
- if (sourceR && destinationR) {
- // Stereo
- PROCESS_WITH_GAIN(STEREO_SUM)
- } else if (destinationR) {
- // Mono -> stereo
- PROCESS_WITH_GAIN(MONO2STEREO_SUM)
- } else {
- // Mono
- PROCESS_WITH_GAIN(MONO_SUM)
+ // FIXME: framesToDezipper could be smaller when target gain is close enough within this process loop.
+ unsigned framesToDezipper = (gainDiff < epsilon) ? 0 : framesToProcess;
+
+ if (framesToDezipper) {
+ if (!m_dezipperGainValues.get() || m_dezipperGainValues->size() < framesToDezipper)
+ m_dezipperGainValues = adoptPtr(new AudioFloatArray(framesToDezipper));
+
+ float* gainValues = m_dezipperGainValues->data();
+ for (unsigned i = 0; i < framesToDezipper; ++i) {
+ gain += (totalDesiredGain - gain) * DezipperRate;
+
+ // FIXME: If we are clever enough in calculating the framesToDezipper value, we can probably get
+ // rid of this DenormalDisabler::flushDenormalFloatToZero() call.
+ gain = DenormalDisabler::flushDenormalFloatToZero(gain);
+ *gainValues++ = gain;
}
- } else {
- // Process directly (without summing) to our bus
- if (sourceR && destinationR) {
- // Stereo
- PROCESS_WITH_GAIN(STEREO_NO_SUM)
- } else if (destinationR) {
- // Mono -> stereo
- PROCESS_WITH_GAIN(MONO2STEREO_NO_SUM)
- } else {
- // Mono
- PROCESS_WITH_GAIN(MONO_NO_SUM)
+
+ for (unsigned channelIndex = 0; channelIndex < numberOfChannels; ++channelIndex) {
+ vmul(sources[channelIndex], 1, m_dezipperGainValues->data(), 1, destinations[channelIndex], 1, framesToDezipper);
+ sources[channelIndex] += framesToDezipper;
+ destinations[channelIndex] += framesToDezipper;
}
+ } else
+ gain = totalDesiredGain;
+
+ // Apply constant gain after de-zippering has converged on target gain.
+ if (framesToDezipper < framesToProcess) {
+ for (unsigned channelIndex = 0; channelIndex < numberOfChannels; ++channelIndex)
+ vsmul(sources[channelIndex], 1, &gain, destinations[channelIndex], 1, framesToProcess - framesToDezipper);
}
// Save the target gain as the starting point for next time around.
*lastMixGain = gain;
}
-void AudioBus::processWithGainFrom(const AudioBus &sourceBus, float* lastMixGain, float targetGain, bool sumToBus)
-{
- // Make sure we're summing from same type of bus.
- // We *are* able to sum from mono -> stereo
- if (sourceBus.numberOfChannels() != 1 && !topologyMatches(sourceBus)) {
- ASSERT_NOT_REACHED();
- return;
- }
- // If it is copying from the same bus and no need to change gain, just return
- if (!sumToBus && this == &sourceBus && *lastMixGain == targetGain && targetGain == 1.0)
- return;
-
- // Dispatch for different channel layouts
- switch (numberOfChannels()) {
- case 1: // mono
- case 2: // stereo
- processWithGainFromMonoStereo(sourceBus, lastMixGain, targetGain, sumToBus);
- break;
- case 4: // FIXME: implement quad
- case 5: // FIXME: implement 5.0
- default:
- ASSERT_NOT_REACHED();
- break;
- }
-}
-
void AudioBus::copyWithSampleAccurateGainValuesFrom(const AudioBus &sourceBus, float* gainValues, unsigned numberOfGainValues)
{
// Make sure we're processing from the same type of bus.
@@ -531,16 +427,6 @@ void AudioBus::copyWithSampleAccurateGainValuesFrom(const AudioBus &sourceBus, f
}
}
-void AudioBus::copyWithGainFrom(const AudioBus &sourceBus, float* lastMixGain, float targetGain)
-{
- processWithGainFrom(sourceBus, lastMixGain, targetGain, false);
-}
-
-void AudioBus::sumWithGainFrom(const AudioBus &sourceBus, float* lastMixGain, float targetGain)
-{
- processWithGainFrom(sourceBus, lastMixGain, targetGain, true);
-}
-
PassOwnPtr<AudioBus> AudioBus::createBySampleRateConverting(const AudioBus* sourceBus, bool mixToMono, double newSampleRate)
{
// sourceBus's sample-rate must be known.
diff --git a/Source/WebCore/platform/audio/AudioBus.h b/Source/WebCore/platform/audio/AudioBus.h
index 4dd3fd626..b80a488a2 100644
--- a/Source/WebCore/platform/audio/AudioBus.h
+++ b/Source/WebCore/platform/audio/AudioBus.h
@@ -109,10 +109,6 @@ public:
// Scales all samples by the same amount.
void scale(float scale);
- // Master gain for this bus - used with sumWithGainFrom() below
- void setGain(float gain) { m_busGain = gain; }
- float gain() const { return m_busGain; }
-
void reset() { m_isFirstTime = true; } // for de-zippering
// Assuming sourceBus has the same topology, copies sample data from each channel of sourceBus to our corresponding channel.
@@ -122,12 +118,11 @@ public:
// Our own internal gain m_busGain is ignored.
void sumFrom(const AudioBus &sourceBus);
- // Copy or sum each channel from sourceBus into our corresponding channel.
+ // Copy each channel from sourceBus into our corresponding channel.
// We scale by targetGain (and our own internal gain m_busGain), performing "de-zippering" to smoothly change from *lastMixGain to (targetGain*m_busGain).
- // The caller is responsible for setting up lastMixGain to point to storage which is unique for every "stream" which will be summed to this bus.
+ // The caller is responsible for setting up lastMixGain to point to storage which is unique for every "stream" which will be applied to this bus.
// This represents the dezippering memory.
void copyWithGainFrom(const AudioBus &sourceBus, float* lastMixGain, float targetGain);
- void sumWithGainFrom(const AudioBus &sourceBus, float* lastMixGain, float targetGain);
// Copies the sourceBus by scaling with sample-accurate gain values.
void copyWithSampleAccurateGainValuesFrom(const AudioBus &sourceBus, float* gainValues, unsigned numberOfGainValues);
@@ -143,16 +138,11 @@ public:
protected:
AudioBus() { };
- void processWithGainFrom(const AudioBus &sourceBus, float* lastMixGain, float targetGain, bool sumToBus);
- void processWithGainFromMonoStereo(const AudioBus &sourceBus, float* lastMixGain, float targetGain, bool sumToBus);
-
size_t m_length;
-
Vector<OwnPtr<AudioChannel> > m_channels;
-
int m_layout;
-
float m_busGain;
+ OwnPtr<AudioFloatArray> m_dezipperGainValues;
bool m_isFirstTime;
float m_sampleRate; // 0.0 if unknown or N/A
};
diff --git a/Source/WebCore/platform/blackberry/AsyncFileSystemBlackBerry.cpp b/Source/WebCore/platform/blackberry/AsyncFileSystemBlackBerry.cpp
index dc26bb5dc..71601ec7a 100644
--- a/Source/WebCore/platform/blackberry/AsyncFileSystemBlackBerry.cpp
+++ b/Source/WebCore/platform/blackberry/AsyncFileSystemBlackBerry.cpp
@@ -35,42 +35,22 @@ bool AsyncFileSystem::isAvailable()
return false;
}
-bool AsyncFileSystem::isValidType(FileSystemType type)
+PassOwnPtr<AsyncFileSystem> AsyncFileSystem::create()
{
- UNUSED_PARAM(type);
-
- notImplemented();
- return false;
+ return adoptPtr(new AsyncFileSystemBlackBerry());
}
-PassOwnPtr<AsyncFileSystem> AsyncFileSystem::create(FileSystemType type)
-{
- return adoptPtr(new AsyncFileSystemBlackBerry(type));
-}
-
-void AsyncFileSystem::openFileSystem(const String& basePath, const String& storageIdentifier, FileSystemType type, bool, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
+void AsyncFileSystem::openFileSystem(const KURL& basePath, const String& storageIdentifier, bool, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
{
UNUSED_PARAM(basePath);
UNUSED_PARAM(storageIdentifier);
- UNUSED_PARAM(type);
UNUSED_PARAM(callbacks);
notImplemented();
callbacks->didFail(NOT_SUPPORTED_ERR);
}
-bool AsyncFileSystem::crackFileSystemURL(const KURL& url, FileSystemType& type, String& filePath)
-{
- UNUSED_PARAM(url);
- UNUSED_PARAM(type);
- UNUSED_PARAM(filePath);
-
- notImplemented();
- return false;
-}
-
-AsyncFileSystemBlackBerry::AsyncFileSystemBlackBerry(FileSystemType type)
- : AsyncFileSystem(type)
+AsyncFileSystemBlackBerry::AsyncFileSystemBlackBerry()
{
notImplemented();
}
@@ -80,16 +60,7 @@ AsyncFileSystemBlackBerry::~AsyncFileSystemBlackBerry()
notImplemented();
}
-KURL AsyncFileSystemBlackBerry::toURL(const String& originString, const String& fullPath) const
-{
- UNUSED_PARAM(originString);
- UNUSED_PARAM(fullPath);
-
- notImplemented();
- return KURL();
-}
-
-void AsyncFileSystemBlackBerry::move(const String& sourcePath, const String& destinationPath, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
+void AsyncFileSystemBlackBerry::move(const KURL& sourcePath, const KURL& destinationPath, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
{
UNUSED_PARAM(sourcePath);
UNUSED_PARAM(destinationPath);
@@ -98,7 +69,7 @@ void AsyncFileSystemBlackBerry::move(const String& sourcePath, const String& des
notImplemented();
}
-void AsyncFileSystemBlackBerry::copy(const String& sourcePath, const String& destinationPath, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
+void AsyncFileSystemBlackBerry::copy(const KURL& sourcePath, const KURL& destinationPath, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
{
UNUSED_PARAM(sourcePath);
UNUSED_PARAM(destinationPath);
@@ -107,7 +78,7 @@ void AsyncFileSystemBlackBerry::copy(const String& sourcePath, const String& des
notImplemented();
}
-void AsyncFileSystemBlackBerry::remove(const String& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
+void AsyncFileSystemBlackBerry::remove(const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
{
UNUSED_PARAM(path);
UNUSED_PARAM(callbacks);
@@ -115,7 +86,7 @@ void AsyncFileSystemBlackBerry::remove(const String& path, PassOwnPtr<AsyncFileS
notImplemented();
}
-void AsyncFileSystemBlackBerry::removeRecursively(const String& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
+void AsyncFileSystemBlackBerry::removeRecursively(const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
{
UNUSED_PARAM(path);
UNUSED_PARAM(callbacks);
@@ -123,7 +94,7 @@ void AsyncFileSystemBlackBerry::removeRecursively(const String& path, PassOwnPtr
notImplemented();
}
-void AsyncFileSystemBlackBerry::readMetadata(const String& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
+void AsyncFileSystemBlackBerry::readMetadata(const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
{
UNUSED_PARAM(path);
UNUSED_PARAM(callbacks);
@@ -131,7 +102,7 @@ void AsyncFileSystemBlackBerry::readMetadata(const String& path, PassOwnPtr<Asyn
notImplemented();
}
-void AsyncFileSystemBlackBerry::createFile(const String& path, bool exclusive, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
+void AsyncFileSystemBlackBerry::createFile(const KURL& path, bool exclusive, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
{
UNUSED_PARAM(path);
UNUSED_PARAM(exclusive);
@@ -140,7 +111,7 @@ void AsyncFileSystemBlackBerry::createFile(const String& path, bool exclusive, P
notImplemented();
}
-void AsyncFileSystemBlackBerry::createDirectory(const String& path, bool exclusive, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
+void AsyncFileSystemBlackBerry::createDirectory(const KURL& path, bool exclusive, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
{
UNUSED_PARAM(path);
UNUSED_PARAM(exclusive);
@@ -149,7 +120,7 @@ void AsyncFileSystemBlackBerry::createDirectory(const String& path, bool exclusi
notImplemented();
}
-void AsyncFileSystemBlackBerry::fileExists(const String& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
+void AsyncFileSystemBlackBerry::fileExists(const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
{
UNUSED_PARAM(path);
UNUSED_PARAM(callbacks);
@@ -157,7 +128,7 @@ void AsyncFileSystemBlackBerry::fileExists(const String& path, PassOwnPtr<AsyncF
notImplemented();
}
-void AsyncFileSystemBlackBerry::directoryExists(const String& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
+void AsyncFileSystemBlackBerry::directoryExists(const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
{
UNUSED_PARAM(path);
UNUSED_PARAM(callbacks);
@@ -165,7 +136,7 @@ void AsyncFileSystemBlackBerry::directoryExists(const String& path, PassOwnPtr<A
notImplemented();
}
-void AsyncFileSystemBlackBerry::readDirectory(const String& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
+void AsyncFileSystemBlackBerry::readDirectory(const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
{
UNUSED_PARAM(path);
UNUSED_PARAM(callbacks);
@@ -174,7 +145,7 @@ void AsyncFileSystemBlackBerry::readDirectory(const String& path, PassOwnPtr<Asy
}
-void AsyncFileSystemBlackBerry::createWriter(AsyncFileWriterClient* client, const String& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
+void AsyncFileSystemBlackBerry::createWriter(AsyncFileWriterClient* client, const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
{
UNUSED_PARAM(client);
UNUSED_PARAM(path);
@@ -183,7 +154,7 @@ void AsyncFileSystemBlackBerry::createWriter(AsyncFileWriterClient* client, cons
notImplemented();
}
-void AsyncFileSystemBlackBerry::createSnapshotFileAndReadMetadata(const String& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
+void AsyncFileSystemBlackBerry::createSnapshotFileAndReadMetadata(const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
{
UNUSED_PARAM(path);
UNUSED_PARAM(callbacks);
diff --git a/Source/WebCore/platform/blackberry/AsyncFileSystemBlackBerry.h b/Source/WebCore/platform/blackberry/AsyncFileSystemBlackBerry.h
index 38b17c70f..e477bdc02 100644
--- a/Source/WebCore/platform/blackberry/AsyncFileSystemBlackBerry.h
+++ b/Source/WebCore/platform/blackberry/AsyncFileSystemBlackBerry.h
@@ -27,21 +27,20 @@ namespace WebCore {
class AsyncFileSystemBlackBerry : public AsyncFileSystem {
public:
- AsyncFileSystemBlackBerry(FileSystemType);
+ AsyncFileSystemBlackBerry();
virtual ~AsyncFileSystemBlackBerry();
- virtual KURL toURL(const String& originString, const String& fullPath) const;
- virtual void move(const String& sourcePath, const String& destinationPath, PassOwnPtr<AsyncFileSystemCallbacks>);
- virtual void copy(const String& sourcePath, const String& destinationPath, PassOwnPtr<AsyncFileSystemCallbacks>);
- virtual void remove(const String& path, PassOwnPtr<AsyncFileSystemCallbacks>);
- virtual void removeRecursively(const String& path, PassOwnPtr<AsyncFileSystemCallbacks>);
- virtual void readMetadata(const String& path, PassOwnPtr<AsyncFileSystemCallbacks>);
- virtual void createFile(const String& path, bool exclusive, PassOwnPtr<AsyncFileSystemCallbacks>);
- virtual void createDirectory(const String& path, bool exclusive, PassOwnPtr<AsyncFileSystemCallbacks>);
- virtual void fileExists(const String& path, PassOwnPtr<AsyncFileSystemCallbacks>);
- virtual void directoryExists(const String& path, PassOwnPtr<AsyncFileSystemCallbacks>);
- virtual void readDirectory(const String& path, PassOwnPtr<AsyncFileSystemCallbacks>);
- virtual void createWriter(AsyncFileWriterClient*, const String& path, PassOwnPtr<AsyncFileSystemCallbacks>);
- virtual void createSnapshotFileAndReadMetadata(const String& path, PassOwnPtr<AsyncFileSystemCallbacks>);
+ virtual void move(const KURL& sourcePath, const KURL& destinationPath, PassOwnPtr<AsyncFileSystemCallbacks>);
+ virtual void copy(const KURL& sourcePath, const KURL& destinationPath, PassOwnPtr<AsyncFileSystemCallbacks>);
+ virtual void remove(const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks>);
+ virtual void removeRecursively(const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks>);
+ virtual void readMetadata(const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks>);
+ virtual void createFile(const KURL& path, bool exclusive, PassOwnPtr<AsyncFileSystemCallbacks>);
+ virtual void createDirectory(const KURL& path, bool exclusive, PassOwnPtr<AsyncFileSystemCallbacks>);
+ virtual void fileExists(const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks>);
+ virtual void directoryExists(const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks>);
+ virtual void readDirectory(const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks>);
+ virtual void createWriter(AsyncFileWriterClient*, const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks>);
+ virtual void createSnapshotFileAndReadMetadata(const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks>);
};
} // namespace WebCore
diff --git a/Source/WebCore/platform/blackberry/CookieParser.cpp b/Source/WebCore/platform/blackberry/CookieParser.cpp
index b2177c665..e089da095 100644
--- a/Source/WebCore/platform/blackberry/CookieParser.cpp
+++ b/Source/WebCore/platform/blackberry/CookieParser.cpp
@@ -109,16 +109,21 @@ ParsedCookie* CookieParser::parseOneCookie(const String& cookie, unsigned start,
unsigned tokenEnd = start; // Token end contains the position of the '=' or the end of a token
unsigned pairEnd = start; // Pair end contains always the position of the ';'
- // find the *first* ';' and the '=' (if they exist)
- bool quoteFound = false;
+ // Find the first ';' which is not double-quoted and the '=' (if they exist).
bool foundEqual = false;
- while (pairEnd < end && (cookie[pairEnd] != ';' || quoteFound)) {
- if (tokenEnd == start && cookie[pairEnd] == '=') {
- tokenEnd = pairEnd;
- foundEqual = true;
+ while (pairEnd < end && cookie[pairEnd] != ';') {
+ if (cookie[pairEnd] == '=') {
+ if (tokenEnd == start) {
+ tokenEnd = pairEnd;
+ foundEqual = true;
+ }
+ } else if (cookie[pairEnd] == '"') {
+ size_t secondQuotePosition = cookie.find('"', pairEnd + 1);
+ if (secondQuotePosition != notFound && secondQuotePosition <= end) {
+ pairEnd = secondQuotePosition + 1;
+ continue;
+ }
}
- if (cookie[pairEnd] == '"')
- quoteFound = !quoteFound;
pairEnd++;
}
diff --git a/Source/WebCore/platform/blackberry/LocalizedStringsBlackBerry.cpp b/Source/WebCore/platform/blackberry/LocalizedStringsBlackBerry.cpp
index 2207f3aa2..ec9d2e604 100644
--- a/Source/WebCore/platform/blackberry/LocalizedStringsBlackBerry.cpp
+++ b/Source/WebCore/platform/blackberry/LocalizedStringsBlackBerry.cpp
@@ -572,6 +572,12 @@ String crashedPluginText()
return String();
}
+String insecurePluginVersionText()
+{
+ notImplemented();
+ return String();
+}
+
String multipleFileUploadText(unsigned)
{
return String(", ...");
diff --git a/Source/WebCore/platform/chromium/ClipboardUtilitiesChromium.cpp b/Source/WebCore/platform/chromium/ClipboardUtilitiesChromium.cpp
index 62cf99ce0..c8f9035e4 100644
--- a/Source/WebCore/platform/chromium/ClipboardUtilitiesChromium.cpp
+++ b/Source/WebCore/platform/chromium/ClipboardUtilitiesChromium.cpp
@@ -47,9 +47,20 @@ PasteboardPrivate::ClipboardBuffer currentPasteboardBuffer()
#if OS(WINDOWS)
void replaceNewlinesWithWindowsStyleNewlines(String& str)
{
- static const UChar Newline = '\n';
- static const char* const WindowsNewline("\r\n");
- str.replace(Newline, WindowsNewline);
+ DEFINE_STATIC_LOCAL(String, windowsNewline, ("\r\n"));
+ const static unsigned windowsNewlineLength = windowsNewline.length();
+
+ unsigned index = 0;
+ unsigned strLength = str.length();
+ while (index < strLength) {
+ if (str[index] != '\n' || (index > 0 && str[index - 1] == '\r')) {
+ ++index;
+ continue;
+ }
+ str.replace(index, 1, windowsNewline);
+ strLength = str.length();
+ index += windowsNewlineLength;
+ }
}
#endif
diff --git a/Source/WebCore/platform/chromium/EventTracerChromium.cpp b/Source/WebCore/platform/chromium/EventTracerChromium.cpp
new file mode 100644
index 000000000..e669e81f6
--- /dev/null
+++ b/Source/WebCore/platform/chromium/EventTracerChromium.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:
+ *
+ * * 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 "EventTracer.h"
+
+#include <public/Platform.h>
+
+namespace WebCore {
+
+const unsigned char* EventTracer::getTraceCategoryEnabledFlag(const char* categoryName)
+{
+ return WebKit::Platform::current()->getTraceCategoryEnabledFlag(categoryName);
+}
+
+int EventTracer::addTraceEvent(char phase,
+ const unsigned char* categoryEnabledFlag,
+ const char* name,
+ unsigned long long id,
+ int numArgs,
+ const char** argNames,
+ const unsigned char* argTypes,
+ const unsigned long long* argValues,
+ int thresholdBeginId,
+ long long threshold,
+ unsigned char flags)
+{
+ return WebKit::Platform::current()->addTraceEvent(phase, categoryEnabledFlag, name, id, numArgs, argNames, argTypes, argValues, thresholdBeginId, threshold, flags);
+}
+
+} // namespace WebCore
diff --git a/Source/WebCore/platform/chromium/PlatformSupport.h b/Source/WebCore/platform/chromium/PlatformSupport.h
index baeab05ec..f44fd42b8 100644
--- a/Source/WebCore/platform/chromium/PlatformSupport.h
+++ b/Source/WebCore/platform/chromium/PlatformSupport.h
@@ -142,8 +142,7 @@ public:
static int writeToFile(PlatformFileHandle, const char* data, int length);
#if ENABLE(FILE_SYSTEM)
- static String createIsolatedFileSystemName(const String& storageIdentifier, const String& filesystemId);
- static PassOwnPtr<AsyncFileSystem> createIsolatedFileSystem(const String& originString, const String& filesystemId);
+ static PassOwnPtr<AsyncFileSystem> createAsyncFileSystem();
#endif
// Font ---------------------------------------------------------------
@@ -197,8 +196,6 @@ public:
static bool popupsAllowed(NPP);
// Resources ----------------------------------------------------------
- static PassRefPtr<Image> loadPlatformImageResource(const char* name);
-
#if ENABLE(WEB_AUDIO)
static PassOwnPtr<AudioBus> decodeAudioFileData(const char* data, size_t, double sampleRate);
#endif
@@ -368,20 +365,6 @@ public:
static void paintThemePart(GraphicsContext*, ThemePart, ThemePaintState, const IntRect&, const ThemePaintExtraParams*);
#endif
- // Trace Event --------------------------------------------------------
- static const unsigned char* getTraceCategoryEnabledFlag(const char* categoryName);
- static int addTraceEvent(char phase,
- const unsigned char* categoryEnabledFlag,
- const char* name,
- unsigned long long id,
- int numArgs,
- const char** argNames,
- const unsigned char* argTypes,
- const unsigned long long* argValues,
- int thresholdBeginId,
- long long threshold,
- unsigned char flags);
-
// Visited links ------------------------------------------------------
static LinkHash visitedLinkHash(const UChar* url, unsigned length);
static LinkHash visitedLinkHash(const KURL& base, const AtomicString& attributeURL);
diff --git a/Source/WebCore/platform/chromium/PopupListBox.cpp b/Source/WebCore/platform/chromium/PopupListBox.cpp
index a7527ea93..d437bc882 100644
--- a/Source/WebCore/platform/chromium/PopupListBox.cpp
+++ b/Source/WebCore/platform/chromium/PopupListBox.cpp
@@ -479,7 +479,7 @@ void PopupListBox::paintRow(GraphicsContext* gc, const IntRect& rect, int rowInd
}
// Prepare the directionality to draw text.
- TextRun textRun(itemText.characters(), itemText.length(), false, 0, 0, TextRun::AllowTrailingExpansion, style.textDirection(), style.hasTextDirectionOverride());
+ TextRun textRun(itemText, 0, 0, TextRun::AllowTrailingExpansion, style.textDirection(), style.hasTextDirectionOverride());
// If the text is right-to-left, make it right-aligned by adjusting its
// beginning position.
if (rightAligned)
@@ -517,7 +517,7 @@ void PopupListBox::paintRow(GraphicsContext* gc, const IntRect& rect, int rowInd
itemFont.update(0);
}
- TextRun labelTextRun(itemLabel.characters(), itemLabel.length(), false, 0, 0, TextRun::AllowTrailingExpansion, style.textDirection(), style.hasTextDirectionOverride());
+ TextRun labelTextRun(itemLabel, 0, 0, TextRun::AllowTrailingExpansion, style.textDirection(), style.hasTextDirectionOverride());
if (rightAligned)
textX = max<int>(0, m_popupClient->clientPaddingLeft() - m_popupClient->clientInsetLeft());
else
diff --git a/Source/WebCore/platform/chromium/TraceEvent.h b/Source/WebCore/platform/chromium/TraceEvent.h
index 206d941f1..f784a596d 100644
--- a/Source/WebCore/platform/chromium/TraceEvent.h
+++ b/Source/WebCore/platform/chromium/TraceEvent.h
@@ -163,7 +163,7 @@
#ifndef TraceEvent_h
#define TraceEvent_h
-#include "PlatformSupport.h"
+#include "EventTracer.h"
#include <wtf/DynamicAnnotations.h>
#include <wtf/text/CString.h>
@@ -463,7 +463,7 @@
// const unsigned char*
// TRACE_EVENT_API_GET_CATEGORY_ENABLED(const char* category_name)
#define TRACE_EVENT_API_GET_CATEGORY_ENABLED \
- WebCore::PlatformSupport::getTraceCategoryEnabledFlag
+ WebCore::EventTracer::getTraceCategoryEnabledFlag
// Add a trace event to the platform tracing system. Returns thresholdBeginId
// for use in a corresponding end TRACE_EVENT_API_ADD_TRACE_EVENT call.
@@ -480,7 +480,7 @@
// long long threshold,
// unsigned char flags)
#define TRACE_EVENT_API_ADD_TRACE_EVENT \
- WebCore::PlatformSupport::addTraceEvent
+ WebCore::EventTracer::addTraceEvent
////////////////////////////////////////////////////////////////////////////////
diff --git a/Source/WebCore/platform/chromium/support/WebMediaStreamDescriptor.cpp b/Source/WebCore/platform/chromium/support/WebMediaStreamDescriptor.cpp
index f7e3c6b1a..8e7a3a7e2 100644
--- a/Source/WebCore/platform/chromium/support/WebMediaStreamDescriptor.cpp
+++ b/Source/WebCore/platform/chromium/support/WebMediaStreamDescriptor.cpp
@@ -40,6 +40,8 @@
#include <public/WebMediaStreamComponent.h>
#include <public/WebMediaStreamSource.h>
#include <public/WebString.h>
+#include <wtf/OwnPtr.h>
+#include <wtf/PassOwnPtr.h>
#include <wtf/Vector.h>
using namespace WebCore;
@@ -66,6 +68,29 @@ WebString WebMediaStreamDescriptor::label() const
return m_private->label();
}
+class ExtraDataContainer : public WebCore::MediaStreamDescriptor::ExtraData {
+public:
+ ExtraDataContainer(WebMediaStreamDescriptor::ExtraData* extraData) : m_extraData(WTF::adoptPtr(extraData)) { }
+
+ WebMediaStreamDescriptor::ExtraData* extraData() { return m_extraData.get(); }
+
+private:
+ OwnPtr<WebMediaStreamDescriptor::ExtraData> m_extraData;
+};
+
+WebMediaStreamDescriptor::ExtraData* WebMediaStreamDescriptor::extraData() const
+{
+ RefPtr<MediaStreamDescriptor::ExtraData> data = m_private->extraData();
+ if (!data)
+ return 0;
+ return static_cast<ExtraDataContainer*>(data.get())->extraData();
+}
+
+void WebMediaStreamDescriptor::setExtraData(ExtraData* extraData)
+{
+ m_private->setExtraData(adoptRef(new ExtraDataContainer(extraData)));
+}
+
// FIXME: Cleanup when the chromium code has switched to the split sources implementation.
void WebMediaStreamDescriptor::sources(WebVector<WebMediaStreamSource>& webSources) const
{
diff --git a/Source/WebCore/platform/efl/EflKeyboardUtilities.cpp b/Source/WebCore/platform/efl/EflKeyboardUtilities.cpp
index aa1b5e869..9e8eb102a 100644
--- a/Source/WebCore/platform/efl/EflKeyboardUtilities.cpp
+++ b/Source/WebCore/platform/efl/EflKeyboardUtilities.cpp
@@ -78,6 +78,17 @@ static void createKeyMap()
keyMap().set("ISO_Left_Tab", "U+0009");
keyMap().set("BackSpace", "U+0008");
keyMap().set("space", "U+0020");
+ // Keypad location
+ keyMap().set("KP_Left", "Left");
+ keyMap().set("KP_Right", "Right");
+ keyMap().set("KP_Up", "Up");
+ keyMap().set("KP_Down", "Down");
+ keyMap().set("KP_Prior", "PageUp");
+ keyMap().set("KP_Next", "PageDown");
+ keyMap().set("KP_Home", "Home");
+ keyMap().set("KP_End", "End");
+ keyMap().set("KP_Insert", "Insert");
+ keyMap().set("KP_Delete", "U+007F");
}
static void createWindowsKeyMap()
@@ -131,6 +142,17 @@ static void createWindowsKeyMap()
windowsKeyMap().set("braceright", VK_OEM_6);
windowsKeyMap().set("apostrophe", VK_OEM_7);
windowsKeyMap().set("quotedbl", VK_OEM_7);
+ // Keypad location
+ windowsKeyMap().set("KP_Left", VK_LEFT);
+ windowsKeyMap().set("KP_Right", VK_RIGHT);
+ windowsKeyMap().set("KP_Up", VK_UP);
+ windowsKeyMap().set("KP_Down", VK_DOWN);
+ windowsKeyMap().set("KP_Prior", VK_PRIOR);
+ windowsKeyMap().set("KP_Next", VK_NEXT);
+ windowsKeyMap().set("KP_Home", VK_HOME);
+ windowsKeyMap().set("KP_End", VK_END);
+ windowsKeyMap().set("KP_Insert", VK_INSERT);
+ windowsKeyMap().set("KP_Delete", VK_DELETE);
// Set alphabet to the windowsKeyMap.
const char* alphabet = "abcdefghijklmnopqrstuvwxyz";
diff --git a/Source/WebCore/platform/efl/LocalizedStringsEfl.cpp b/Source/WebCore/platform/efl/LocalizedStringsEfl.cpp
index 32aefe1a3..263b5b3bc 100644
--- a/Source/WebCore/platform/efl/LocalizedStringsEfl.cpp
+++ b/Source/WebCore/platform/efl/LocalizedStringsEfl.cpp
@@ -560,6 +560,12 @@ String crashedPluginText()
return String::fromUTF8("plugin crashed");
}
+String insecurePluginVersionText()
+{
+ notImplemented();
+ return String();
+}
+
String localizedString(const char* key)
{
return String::fromUTF8(key, strlen(key));
diff --git a/Source/WebCore/platform/efl/PlatformKeyboardEventEfl.cpp b/Source/WebCore/platform/efl/PlatformKeyboardEventEfl.cpp
index 656564d2c..7487948d2 100644
--- a/Source/WebCore/platform/efl/PlatformKeyboardEventEfl.cpp
+++ b/Source/WebCore/platform/efl/PlatformKeyboardEventEfl.cpp
@@ -49,7 +49,7 @@ PlatformKeyboardEvent::PlatformKeyboardEvent(const Evas_Event_Key_Down* event)
, m_nativeVirtualKeyCode(0)
, m_macCharCode(0)
, m_autoRepeat(false)
- , m_isKeypad(false)
+ , m_isKeypad(String(event->key).startsWith("KP_"))
, m_isSystemKey(false)
{
}
@@ -63,7 +63,7 @@ PlatformKeyboardEvent::PlatformKeyboardEvent(const Evas_Event_Key_Up* event)
, m_nativeVirtualKeyCode(0)
, m_macCharCode(0)
, m_autoRepeat(false)
- , m_isKeypad(false)
+ , m_isKeypad(String(event->key).startsWith("KP_"))
, m_isSystemKey(false)
{
}
diff --git a/Source/WebCore/platform/efl/ScrollbarEfl.cpp b/Source/WebCore/platform/efl/ScrollbarEfl.cpp
index 183691a5d..65dd68d46 100644
--- a/Source/WebCore/platform/efl/ScrollbarEfl.cpp
+++ b/Source/WebCore/platform/efl/ScrollbarEfl.cpp
@@ -29,9 +29,9 @@
#include "GraphicsContext.h"
#include "HostWindow.h"
#include "IntRect.h"
-#include "NotImplemented.h"
#include "Page.h"
#include "ScrollbarTheme.h"
+#include "Settings.h"
#include <Ecore.h>
#include <Edje.h>
@@ -44,6 +44,9 @@ using namespace WebCore;
PassRefPtr<Scrollbar> Scrollbar::createNativeScrollbar(ScrollableArea* scrollableArea, ScrollbarOrientation orientation, ScrollbarControlSize size)
{
+ if (Settings::mockScrollbarsEnabled())
+ return adoptRef(new Scrollbar(scrollableArea, orientation, size));
+
return adoptRef(new ScrollbarEfl(scrollableArea, orientation, size));
}
diff --git a/Source/WebCore/platform/graphics/DisplayRefreshMonitor.cpp b/Source/WebCore/platform/graphics/DisplayRefreshMonitor.cpp
index 27699070f..366aca326 100644
--- a/Source/WebCore/platform/graphics/DisplayRefreshMonitor.cpp
+++ b/Source/WebCore/platform/graphics/DisplayRefreshMonitor.cpp
@@ -53,7 +53,7 @@ void DisplayRefreshMonitorClient::fireDisplayRefreshIfNeeded(double timestamp)
}
DisplayRefreshMonitor::DisplayRefreshMonitor(PlatformDisplayID displayID)
- : m_monotonicAnimationStartTime(0)
+ : m_timestamp(0)
, m_active(true)
, m_scheduled(false)
, m_previousFrameDone(true)
@@ -75,15 +75,15 @@ void DisplayRefreshMonitor::refreshDisplayOnMainThread(void* data)
void DisplayRefreshMonitor::notifyClients()
{
- double monotonicAnimationStartTime;
+ double timestamp;
{
MutexLocker lock(m_mutex);
m_scheduled = false;
- monotonicAnimationStartTime = m_monotonicAnimationStartTime;
+ timestamp = m_timestamp;
}
for (size_t i = 0; i < m_clients.size(); ++i)
- m_clients[i]->fireDisplayRefreshIfNeeded(monotonicAnimationStartTime);
+ m_clients[i]->fireDisplayRefreshIfNeeded(timestamp);
{
MutexLocker lock(m_mutex);
diff --git a/Source/WebCore/platform/graphics/DisplayRefreshMonitor.h b/Source/WebCore/platform/graphics/DisplayRefreshMonitor.h
index 0ee8101a2..ca6cebdfd 100644
--- a/Source/WebCore/platform/graphics/DisplayRefreshMonitor.h
+++ b/Source/WebCore/platform/graphics/DisplayRefreshMonitor.h
@@ -113,7 +113,7 @@ private:
void notifyClients();
static void refreshDisplayOnMainThread(void* data);
- double m_monotonicAnimationStartTime;
+ double m_timestamp;
bool m_active;
bool m_scheduled;
bool m_previousFrameDone;
diff --git a/Source/WebCore/platform/graphics/Font.h b/Source/WebCore/platform/graphics/Font.h
index 5b73404e6..d80660da4 100644
--- a/Source/WebCore/platform/graphics/Font.h
+++ b/Source/WebCore/platform/graphics/Font.h
@@ -160,7 +160,9 @@ public:
// Metrics that we query the FontFallbackList for.
const FontMetrics& fontMetrics() const { return primaryFont()->fontMetrics(); }
float spaceWidth() const { return primaryFont()->spaceWidth() + m_letterSpacing; }
- float tabWidth(const SimpleFontData& fontData) const { return 8 * fontData.spaceWidth() + letterSpacing(); }
+ float tabWidth(const SimpleFontData&, unsigned tabSize, float position) const;
+ float tabWidth(unsigned tabSize, float position) const { return tabWidth(*primaryFont(), tabSize, position); }
+
int emphasisMarkAscent(const AtomicString&) const;
int emphasisMarkDescent(const AtomicString&) const;
int emphasisMarkHeight(const AtomicString&) const;
@@ -303,6 +305,14 @@ inline FontSelector* Font::fontSelector() const
return m_fontList ? m_fontList->fontSelector() : 0;
}
+inline float Font::tabWidth(const SimpleFontData& fontData, unsigned tabSize, float position) const
+{
+ if (!tabSize)
+ return letterSpacing();
+ float tabWidth = tabSize * fontData.spaceWidth() + letterSpacing();
+ return tabWidth - fmodf(position, tabWidth);
+}
+
}
#endif
diff --git a/Source/WebCore/platform/graphics/FontDescription.h b/Source/WebCore/platform/graphics/FontDescription.h
index 86b8dfb8d..534f46057 100644
--- a/Source/WebCore/platform/graphics/FontDescription.h
+++ b/Source/WebCore/platform/graphics/FontDescription.h
@@ -138,8 +138,8 @@ public:
FontDescription makeNormalFeatureSettings() const;
void setFamily(const FontFamily& family) { m_familyList = family; }
- void setComputedSize(float s) { ASSERT(isfinite(s)); m_computedSize = s; }
- void setSpecifiedSize(float s) { ASSERT(isfinite(s)); m_specifiedSize = s; }
+ void setComputedSize(float s) { m_computedSize = clampToFloat(s); }
+ void setSpecifiedSize(float s) { m_specifiedSize = clampToFloat(s); }
void setItalic(FontItalic i) { m_italic = i; }
void setItalic(bool i) { setItalic(i ? FontItalicOn : FontItalicOff); }
void setSmallCaps(FontSmallCaps c) { m_smallCaps = c; }
diff --git a/Source/WebCore/platform/graphics/FractionalLayoutRect.cpp b/Source/WebCore/platform/graphics/FractionalLayoutRect.cpp
index 9f723bbd8..7c925564e 100644
--- a/Source/WebCore/platform/graphics/FractionalLayoutRect.cpp
+++ b/Source/WebCore/platform/graphics/FractionalLayoutRect.cpp
@@ -148,11 +148,4 @@ FractionalLayoutRect enclosingFractionalLayoutRect(const FloatRect& rect)
#endif
}
-IntRect pixelSnappedIntRect(const FractionalLayoutRect& rect)
-{
- IntPoint roundedLocation = roundedIntPoint(rect.location());
- return IntRect(roundedLocation, IntSize((rect.x() + rect.width()).round() - roundedLocation.x(),
- (rect.y() + rect.height()).round() - roundedLocation.y()));
-}
-
} // namespace WebCore
diff --git a/Source/WebCore/platform/graphics/FractionalLayoutRect.h b/Source/WebCore/platform/graphics/FractionalLayoutRect.h
index 67dfb4593..ed5212d9e 100644
--- a/Source/WebCore/platform/graphics/FractionalLayoutRect.h
+++ b/Source/WebCore/platform/graphics/FractionalLayoutRect.h
@@ -56,7 +56,7 @@ public:
FractionalLayoutSize size() const { return m_size; }
IntPoint pixelSnappedLocation() const { return roundedIntPoint(m_location); }
- IntSize pixelSnappedSize() const { return pixelSnappedIntSize(m_size, m_location); }
+ IntSize pixelSnappedSize() const { return IntSize(snapSizeToPixel(m_size.width(), m_location.x()), snapSizeToPixel(m_size.height(), m_location.y())); }
void setLocation(const FractionalLayoutPoint& location) { m_location = location; }
void setSize(const FractionalLayoutSize& size) { m_size = size; }
@@ -72,8 +72,8 @@ public:
int pixelSnappedY() const { return y().round(); }
int pixelSnappedWidth() const { return snapSizeToPixel(width(), x()); }
int pixelSnappedHeight() const { return snapSizeToPixel(height(), y()); }
- int pixelSnappedMaxX() const { return pixelSnappedX() + pixelSnappedWidth(); }
- int pixelSnappedMaxY() const { return pixelSnappedY() + pixelSnappedHeight(); }
+ int pixelSnappedMaxX() const { return (m_location.x() + m_size.width()).round(); }
+ int pixelSnappedMaxY() const { return (m_location.y() + m_size.height()).round(); }
void setX(FractionalLayoutUnit x) { m_location.setX(x); }
void setY(FractionalLayoutUnit y) { m_location.setY(y); }
@@ -184,9 +184,19 @@ inline bool operator!=(const FractionalLayoutRect& a, const FractionalLayoutRect
return a.location() != b.location() || a.size() != b.size();
}
+inline IntRect pixelSnappedIntRect(const FractionalLayoutRect& rect)
+{
+#if ENABLE(SUBPIXEL_LAYOUT)
+ IntPoint roundedLocation = roundedIntPoint(rect.location());
+ return IntRect(roundedLocation, IntSize((rect.x() + rect.width()).round() - roundedLocation.x(),
+ (rect.y() + rect.height()).round() - roundedLocation.y()));
+#else
+ return IntRect(rect);
+#endif
+}
+
IntRect enclosingIntRect(const FractionalLayoutRect&);
FractionalLayoutRect enclosingFractionalLayoutRect(const FloatRect&);
-IntRect pixelSnappedIntRect(const FractionalLayoutRect&);
} // namespace WebCore
diff --git a/Source/WebCore/platform/graphics/FractionalLayoutSize.h b/Source/WebCore/platform/graphics/FractionalLayoutSize.h
index 1b9e942ff..c2f0ae89a 100644
--- a/Source/WebCore/platform/graphics/FractionalLayoutSize.h
+++ b/Source/WebCore/platform/graphics/FractionalLayoutSize.h
@@ -145,8 +145,6 @@ inline IntSize roundedIntSize(const FractionalLayoutSize& s)
return IntSize(s.width().round(), s.height().round());
}
-IntSize pixelSnappedIntSize(const FractionalLayoutSize&, const FractionalLayoutPoint&);
-
} // namespace WebCore
#endif // FractionalLayoutSize_h
diff --git a/Source/WebCore/platform/graphics/Region.cpp b/Source/WebCore/platform/graphics/Region.cpp
index c4d2f5600..5e4c046c3 100644
--- a/Source/WebCore/platform/graphics/Region.cpp
+++ b/Source/WebCore/platform/graphics/Region.cpp
@@ -70,7 +70,7 @@ bool Region::contains(const Region& region) const
if (!m_bounds.contains(region.m_bounds))
return false;
- return WebCore::intersect(region, *this) == region;
+ return Shape::compareShapes<Shape::CompareContainsOperation>(m_shape, region.m_shape);
}
bool Region::contains(const IntPoint& point) const
@@ -106,10 +106,7 @@ bool Region::intersects(const Region& region) const
if (!m_bounds.intersects(region.m_bounds))
return false;
- // FIXME: this could be optimized.
- Region tempRegion(*this);
- tempRegion.intersect(region);
- return !tempRegion.isEmpty();
+ return Shape::compareShapes<Shape::CompareIntersectsOperation>(m_shape, region.m_shape);
}
unsigned Region::totalArea() const
@@ -126,6 +123,104 @@ unsigned Region::totalArea() const
return totalArea;
}
+template<typename CompareOperation>
+bool Region::Shape::compareShapes(const Shape& aShape, const Shape& bShape)
+{
+ bool result = CompareOperation::defaultResult;
+
+ Shape::SpanIterator aSpan = aShape.spans_begin();
+ Shape::SpanIterator aSpanEnd = aShape.spans_end();
+ Shape::SpanIterator bSpan = bShape.spans_begin();
+ Shape::SpanIterator bSpanEnd = bShape.spans_end();
+
+ bool aHadSegmentInPreviousSpan = false;
+ bool bHadSegmentInPreviousSpan = false;
+ while (aSpan != aSpanEnd && aSpan + 1 != aSpanEnd && bSpan != bSpanEnd && bSpan + 1 != bSpanEnd) {
+ int aY = aSpan->y;
+ int aMaxY = (aSpan + 1)->y;
+ int bY = bSpan->y;
+ int bMaxY = (bSpan + 1)->y;
+
+ Shape::SegmentIterator aSegment = aShape.segments_begin(aSpan);
+ Shape::SegmentIterator aSegmentEnd = aShape.segments_end(aSpan);
+ Shape::SegmentIterator bSegment = bShape.segments_begin(bSpan);
+ Shape::SegmentIterator bSegmentEnd = bShape.segments_end(bSpan);
+
+ // Look for a non-overlapping part of the spans. If B had a segment in its previous span, then we already tested A against B within that span.
+ bool aHasSegmentInSpan = aSegment != aSegmentEnd;
+ bool bHasSegmentInSpan = bSegment != bSegmentEnd;
+ if (aY < bY && !bHadSegmentInPreviousSpan && aHasSegmentInSpan && CompareOperation::aOutsideB(result))
+ return result;
+ if (bY < aY && !aHadSegmentInPreviousSpan && bHasSegmentInSpan && CompareOperation::bOutsideA(result))
+ return result;
+
+ aHadSegmentInPreviousSpan = aHasSegmentInSpan;
+ bHadSegmentInPreviousSpan = bHasSegmentInSpan;
+
+ bool spansOverlap = bMaxY > aY && bY < aMaxY;
+ if (spansOverlap) {
+ while (aSegment != aSegmentEnd && bSegment != bSegmentEnd) {
+ int aX = *aSegment;
+ int aMaxX = *(aSegment + 1);
+ int bX = *bSegment;
+ int bMaxX = *(bSegment + 1);
+
+ bool segmentsOverlap = bMaxX > aX && bX < aMaxX;
+ if (segmentsOverlap && CompareOperation::aOverlapsB(result))
+ return result;
+ if (aX < bX && CompareOperation::aOutsideB(result))
+ return result;
+ if (bX < aX && CompareOperation::bOutsideA(result))
+ return result;
+
+ if (aMaxX < bMaxX)
+ aSegment += 2;
+ else if (bMaxX < aMaxX)
+ bSegment += 2;
+ else {
+ aSegment += 2;
+ bSegment += 2;
+ }
+ }
+
+ if (aSegment != aSegmentEnd && CompareOperation::aOutsideB(result))
+ return result;
+ if (bSegment != bSegmentEnd && CompareOperation::bOutsideA(result))
+ return result;
+ }
+
+ if (aMaxY < bMaxY)
+ aSpan += 1;
+ else if (bMaxY < aMaxY)
+ bSpan += 1;
+ else {
+ aSpan += 1;
+ bSpan += 1;
+ }
+ }
+
+ if (aSpan != aSpanEnd && aSpan + 1 != aSpanEnd && CompareOperation::aOutsideB(result))
+ return result;
+ if (bSpan != bSpanEnd && bSpan + 1 != bSpanEnd && CompareOperation::bOutsideA(result))
+ return result;
+
+ return result;
+}
+
+struct Region::Shape::CompareContainsOperation {
+ const static bool defaultResult = true;
+ inline static bool aOutsideB(bool& /* result */) { return false; }
+ inline static bool bOutsideA(bool& result) { result = false; return true; }
+ inline static bool aOverlapsB(bool& /* result */) { return false; }
+};
+
+struct Region::Shape::CompareIntersectsOperation {
+ const static bool defaultResult = false;
+ inline static bool aOutsideB(bool& /* result */) { return false; }
+ inline static bool bOutsideA(bool& /* result */) { return false; }
+ inline static bool aOverlapsB(bool& result) { result = true; return true; }
+};
+
Region::Shape::Shape()
{
}
@@ -392,11 +487,6 @@ struct Region::Shape::UnionOperation {
return true;
}
- if (shape2.isEmpty()) {
- result = shape1;
- return true;
- }
-
return false;
}
@@ -414,18 +504,8 @@ Region::Shape Region::Shape::unionShapes(const Shape& shape1, const Shape& shape
}
struct Region::Shape::IntersectOperation {
- static bool trySimpleOperation(const Shape& shape1, const Shape& shape2, Shape& result)
+ static bool trySimpleOperation(const Shape&, const Shape&, Shape&)
{
- if (shape1.isEmpty()) {
- result = Shape();
- return true;
- }
-
- if (shape2.isEmpty()) {
- result = shape1;
- return true;
- }
-
return false;
}
@@ -443,14 +523,8 @@ Region::Shape Region::Shape::intersectShapes(const Shape& shape1, const Shape& s
}
struct Region::Shape::SubtractOperation {
- static bool trySimpleOperation(const Shape& shape1, const Shape& shape2, Region::Shape& result)
+ static bool trySimpleOperation(const Shape&, const Shape&, Region::Shape&)
{
-
- if (shape1.isEmpty() || shape2.isEmpty()) {
- result = Shape();
- return true;
- }
-
return false;
}
@@ -478,6 +552,8 @@ void Region::dump() const
void Region::intersect(const Region& region)
{
+ if (m_bounds.isEmpty())
+ return;
if (!m_bounds.intersects(region.m_bounds)) {
m_shape = Shape();
m_bounds = IntRect();
@@ -494,6 +570,16 @@ void Region::unite(const Region& region)
{
if (region.isEmpty())
return;
+ if (isRect() && m_bounds.contains(region.m_bounds))
+ return;
+ if (region.isRect() && region.m_bounds.contains(m_bounds)) {
+ m_shape = region.m_shape;
+ m_bounds = region.m_bounds;
+ return;
+ }
+ // FIXME: We may want another way to construct a Region without doing this test when we expect it to be false.
+ if (!isRect() && contains(region))
+ return;
Shape unitedShape = Shape::unionShapes(m_shape, region.m_shape);
@@ -503,6 +589,8 @@ void Region::unite(const Region& region)
void Region::subtract(const Region& region)
{
+ if (m_bounds.isEmpty())
+ return;
if (region.isEmpty())
return;
if (!m_bounds.intersects(region.m_bounds))
diff --git a/Source/WebCore/platform/graphics/Region.h b/Source/WebCore/platform/graphics/Region.h
index a87269567..90ab43482 100644
--- a/Source/WebCore/platform/graphics/Region.h
+++ b/Source/WebCore/platform/graphics/Region.h
@@ -38,6 +38,7 @@ public:
IntRect bounds() const { return m_bounds; }
bool isEmpty() const { return m_bounds.isEmpty(); }
+ bool isRect() const { return m_shape.isRect(); }
Vector<IntRect> rects() const;
@@ -79,6 +80,7 @@ private:
IntRect bounds() const;
bool isEmpty() const { return m_spans.isEmpty(); }
+ bool isRect() const { return m_spans.size() <= 2 && m_segments.size() <= 2; }
typedef const Span* SpanIterator;
SpanIterator spans_begin() const;
@@ -95,6 +97,12 @@ private:
void translate(const IntSize&);
void swap(Shape&);
+ struct CompareContainsOperation;
+ struct CompareIntersectsOperation;
+
+ template<typename CompareOperation>
+ static bool compareShapes(const Shape& shape1, const Shape& shape2);
+
#ifndef NDEBUG
void dump() const;
#endif
diff --git a/Source/WebCore/platform/graphics/TextRun.cpp b/Source/WebCore/platform/graphics/TextRun.cpp
index 3ab810833..aa39e9f71 100644
--- a/Source/WebCore/platform/graphics/TextRun.cpp
+++ b/Source/WebCore/platform/graphics/TextRun.cpp
@@ -37,6 +37,7 @@ class ExpectedTextRunSize {
#endif
float float3;
uint32_t bitfields : 9;
+ unsigned anUnsigned;
RefPtr<TextRun::RenderingContext> renderingContext;
};
diff --git a/Source/WebCore/platform/graphics/TextRun.h b/Source/WebCore/platform/graphics/TextRun.h
index c2d86d6e5..66c0e2616 100644
--- a/Source/WebCore/platform/graphics/TextRun.h
+++ b/Source/WebCore/platform/graphics/TextRun.h
@@ -58,7 +58,7 @@ public:
typedef unsigned RoundingHacks;
- TextRun(const UChar* c, int len, bool allowTabs = false, float xpos = 0, float expansion = 0, ExpansionBehavior expansionBehavior = AllowTrailingExpansion | ForbidLeadingExpansion, TextDirection direction = LTR, bool directionalOverride = false, bool characterScanForCodePath = true, RoundingHacks roundingHacks = RunRounding | WordRounding)
+ TextRun(const UChar* c, int len, float xpos = 0, float expansion = 0, ExpansionBehavior expansionBehavior = AllowTrailingExpansion | ForbidLeadingExpansion, TextDirection direction = LTR, bool directionalOverride = false, bool characterScanForCodePath = true, RoundingHacks roundingHacks = RunRounding | WordRounding)
: m_characters(c)
, m_charactersLength(len)
, m_len(len)
@@ -68,17 +68,18 @@ public:
#endif
, m_expansion(expansion)
, m_expansionBehavior(expansionBehavior)
- , m_allowTabs(allowTabs)
+ , m_allowTabs(false)
, m_direction(direction)
, m_directionalOverride(directionalOverride)
, m_characterScanForCodePath(characterScanForCodePath)
, m_applyRunRounding((roundingHacks & RunRounding) && s_allowsRoundingHacks)
, m_applyWordRounding((roundingHacks & WordRounding) && s_allowsRoundingHacks)
, m_disableSpacing(false)
+ , m_tabSize(0)
{
}
- TextRun(const String& s, bool allowTabs = false, float xpos = 0, float expansion = 0, ExpansionBehavior expansionBehavior = AllowTrailingExpansion | ForbidLeadingExpansion, TextDirection direction = LTR, bool directionalOverride = false, bool characterScanForCodePath = true, RoundingHacks roundingHacks = RunRounding | WordRounding)
+ TextRun(const String& s, float xpos = 0, float expansion = 0, ExpansionBehavior expansionBehavior = AllowTrailingExpansion | ForbidLeadingExpansion, TextDirection direction = LTR, bool directionalOverride = false, bool characterScanForCodePath = true, RoundingHacks roundingHacks = RunRounding | WordRounding)
: m_characters(s.characters())
, m_charactersLength(s.length())
, m_len(s.length())
@@ -88,13 +89,14 @@ public:
#endif
, m_expansion(expansion)
, m_expansionBehavior(expansionBehavior)
- , m_allowTabs(allowTabs)
+ , m_allowTabs(false)
, m_direction(direction)
, m_directionalOverride(directionalOverride)
, m_characterScanForCodePath(characterScanForCodePath)
, m_applyRunRounding((roundingHacks & RunRounding) && s_allowsRoundingHacks)
, m_applyWordRounding((roundingHacks & WordRounding) && s_allowsRoundingHacks)
, m_disableSpacing(false)
+ , m_tabSize(0)
{
}
@@ -114,7 +116,9 @@ public:
#endif
bool allowTabs() const { return m_allowTabs; }
- void setAllowTabs(bool allowTabs) { m_allowTabs = allowTabs; }
+ unsigned tabSize() const { return m_tabSize; }
+ void setTabSize(bool, unsigned);
+
float xPos() const { return m_xpos; }
void setXPos(float xPos) { m_xpos = xPos; }
float expansion() const { return m_expansion; }
@@ -166,6 +170,7 @@ private:
#if ENABLE(SVG)
float m_horizontalGlyphStretch;
#endif
+
float m_expansion;
ExpansionBehavior m_expansionBehavior : 2;
unsigned m_allowTabs : 1;
@@ -175,9 +180,16 @@ private:
unsigned m_applyRunRounding : 1;
unsigned m_applyWordRounding : 1;
unsigned m_disableSpacing : 1;
+ unsigned m_tabSize;
RefPtr<RenderingContext> m_renderingContext;
};
+inline void TextRun::setTabSize(bool allow, unsigned size)
+{
+ m_allowTabs = allow;
+ m_tabSize = size;
+}
+
}
#endif
diff --git a/Source/WebCore/platform/graphics/WidthIterator.cpp b/Source/WebCore/platform/graphics/WidthIterator.cpp
index d749a4f46..8d975b7b3 100644
--- a/Source/WebCore/platform/graphics/WidthIterator.cpp
+++ b/Source/WebCore/platform/graphics/WidthIterator.cpp
@@ -117,10 +117,9 @@ unsigned WidthIterator::advance(int offset, GlyphBuffer* glyphBuffer)
// Now that we have a glyph and font data, get its width.
float width;
- if (character == '\t' && m_run.allowTabs()) {
- float tabWidth = m_font->tabWidth(*fontData);
- width = tabWidth - fmodf(m_run.xPos() + m_runWidthSoFar + widthSinceLastRounding, tabWidth);
- } else {
+ if (character == '\t' && m_run.allowTabs())
+ width = m_font->tabWidth(*fontData, m_run.tabSize(), m_run.xPos() + m_runWidthSoFar + widthSinceLastRounding);
+ else {
width = fontData->widthForGlyph(glyph);
#if ENABLE(SVG)
diff --git a/Source/WebCore/platform/graphics/blackberry/DisplayRefreshMonitorBlackBerry.cpp b/Source/WebCore/platform/graphics/blackberry/DisplayRefreshMonitorBlackBerry.cpp
index daf2b3960..f704e2a8b 100644
--- a/Source/WebCore/platform/graphics/blackberry/DisplayRefreshMonitorBlackBerry.cpp
+++ b/Source/WebCore/platform/graphics/blackberry/DisplayRefreshMonitorBlackBerry.cpp
@@ -81,7 +81,7 @@ void DisplayRefreshMonitor::displayLinkFired()
m_previousFrameDone = false;
- m_monotonicAnimationStartTime = monotonicallyIncreasingTime();
+ m_timestamp = currentTime();
callOnMainThread(refreshDisplayOnMainThread, this);
}
diff --git a/Source/WebCore/platform/graphics/ca/mac/TileCache.mm b/Source/WebCore/platform/graphics/ca/mac/TileCache.mm
index 9fa6a48c0..8c90f986c 100644
--- a/Source/WebCore/platform/graphics/ca/mac/TileCache.mm
+++ b/Source/WebCore/platform/graphics/ca/mac/TileCache.mm
@@ -275,7 +275,10 @@ IntRect TileCache::tileCoverageRect() const
{
IntRect tileCoverageRect = m_visibleRect;
- if (m_isInWindow) {
+ // If the page is not in a window (for example if it's in a background tab), we limit the tile coverage rect to the visible rect.
+ // Furthermore, if the page can't have scrollbars (for example if its body element has overflow:hidden) it's very unlikely that the
+ // page will ever be scrolled so we limit the tile coverage rect as well.
+ if (m_isInWindow && m_canHaveScrollbars) {
// Inflate the coverage rect so that it covers 2x of the visible width and 3x of the visible height.
// These values were chosen because it's more common to have tall pages and to scroll vertically,
// so we keep more tiles above and below the current area.
@@ -351,7 +354,8 @@ void TileCache::revalidateTiles()
[m_tileContainerLayer.get() addSublayer:tileLayer.get()];
} else {
// We already have a layer for this tile. Ensure that its size is correct.
- if (CGSizeEqualToSize([tileLayer.get() frame].size, tileRect.size()))
+ CGSize tileLayerSize = [tileLayer.get() frame].size;
+ if (tileLayerSize.width >= tileRect.width() && tileLayerSize.height >= tileRect.height())
continue;
[tileLayer.get() setFrame:tileRect];
}
@@ -369,6 +373,8 @@ void TileCache::revalidateTiles()
m_tileCoverageRect.unite(rectForTileIndex(tileIndex));
}
+ if (dirtyRects.isEmpty())
+ return;
platformLayer->owner()->platformCALayerDidCreateTiles(dirtyRects);
}
diff --git a/Source/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp b/Source/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp
index af157a297..2ed6bd69a 100644
--- a/Source/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp
+++ b/Source/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp
@@ -84,9 +84,11 @@ GraphicsContext* ImageBuffer::context() const
PassRefPtr<Image> ImageBuffer::copyImage(BackingStoreCopy copyBehavior) const
{
- ASSERT(copyBehavior == CopyBackingStore);
+ if (copyBehavior == CopyBackingStore)
+ return BitmapImage::create(copyCairoImageSurface(m_data.m_surface).leakRef());
+
// BitmapImage will release the passed in surface on destruction
- return BitmapImage::create(copyCairoImageSurface(m_data.m_surface).leakRef());
+ return BitmapImage::create(cairo_surface_reference(m_data.m_surface));
}
void ImageBuffer::clip(GraphicsContext* context, const FloatRect& maskRect) const
@@ -97,16 +99,14 @@ void ImageBuffer::clip(GraphicsContext* context, const FloatRect& maskRect) cons
void ImageBuffer::draw(GraphicsContext* context, ColorSpace styleColorSpace, const FloatRect& destRect, const FloatRect& srcRect,
CompositeOperator op , bool useLowQualityScale)
{
- // BitmapImage will release the passed in surface on destruction
- RefPtr<Image> image = BitmapImage::create(cairo_surface_reference(m_data.m_surface));
+ RefPtr<Image> image = copyImage(DontCopyBackingStore);
context->drawImage(image.get(), styleColorSpace, destRect, srcRect, op, DoNotRespectImageOrientation, useLowQualityScale);
}
void ImageBuffer::drawPattern(GraphicsContext* context, const FloatRect& srcRect, const AffineTransform& patternTransform,
const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator op, const FloatRect& destRect)
{
- // BitmapImage will release the passed in surface on destruction
- RefPtr<Image> image = BitmapImage::create(cairo_surface_reference(m_data.m_surface));
+ RefPtr<Image> image = copyImage(DontCopyBackingStore);
image->drawPattern(context, srcRect, patternTransform, phase, styleColorSpace, op, destRect);
}
diff --git a/Source/WebCore/platform/graphics/cg/ImageBufferCG.cpp b/Source/WebCore/platform/graphics/cg/ImageBufferCG.cpp
index 30ece1ee3..81982a188 100644
--- a/Source/WebCore/platform/graphics/cg/ImageBufferCG.cpp
+++ b/Source/WebCore/platform/graphics/cg/ImageBufferCG.cpp
@@ -399,24 +399,17 @@ static RetainPtr<CFStringRef> utiFromMIMEType(const String& mimeType)
#endif
}
-static String CGImageToDataURL(CGImageRef image, const String& mimeType, const double* quality)
+static bool CGImageEncodeToData(CGImageRef image, CFStringRef uti, const double* quality, CFMutableDataRef data)
{
- if (!image)
- return "data:,";
-
- RetainPtr<CFMutableDataRef> data(AdoptCF, CFDataCreateMutable(kCFAllocatorDefault, 0));
- if (!data)
- return "data:,";
+ if (!image || !uti || !data)
+ return false;
- RetainPtr<CFStringRef> uti = utiFromMIMEType(mimeType);
- ASSERT(uti);
-
- RetainPtr<CGImageDestinationRef> destination(AdoptCF, CGImageDestinationCreateWithData(data.get(), uti.get(), 1, 0));
+ RetainPtr<CGImageDestinationRef> destination(AdoptCF, CGImageDestinationCreateWithData(data, uti, 1, 0));
if (!destination)
- return "data:,";
+ return false;
RetainPtr<CFDictionaryRef> imageProperties = 0;
- if (CFEqual(uti.get(), jpegUTI()) && quality && *quality >= 0.0 && *quality <= 1.0) {
+ if (CFEqual(uti, jpegUTI()) && quality && *quality >= 0.0 && *quality <= 1.0) {
// Apply the compression quality to the JPEG image destination.
RetainPtr<CFNumberRef> compressionQuality(AdoptCF, CFNumberCreate(kCFAllocatorDefault, kCFNumberDoubleType, quality));
const void* key = kCGImageDestinationLossyCompressionQuality;
@@ -428,7 +421,17 @@ static String CGImageToDataURL(CGImageRef image, const String& mimeType, const d
// in the calling functions, but it doesn't seem to work.
CGImageDestinationAddImage(destination.get(), image, imageProperties.get());
- CGImageDestinationFinalize(destination.get());
+ return CGImageDestinationFinalize(destination.get());
+}
+
+static String CGImageToDataURL(CGImageRef image, const String& mimeType, const double* quality)
+{
+ RetainPtr<CFStringRef> uti = utiFromMIMEType(mimeType);
+ ASSERT(uti);
+
+ RetainPtr<CFMutableDataRef> data(AdoptCF, CFDataCreateMutable(kCFAllocatorDefault, 0));
+ if (!CGImageEncodeToData(image, uti.get(), quality, data.get()))
+ return "data:,";
Vector<char> base64Data;
base64Encode(reinterpret_cast<const char*>(CFDataGetBytePtr(data.get())), CFDataGetLength(data.get()), base64Data);
@@ -480,30 +483,32 @@ String ImageDataToDataURL(const ImageData& source, const String& mimeType, const
RetainPtr<CFStringRef> uti = utiFromMIMEType(mimeType);
ASSERT(uti);
+ CGImageAlphaInfo dataAlphaInfo = kCGImageAlphaLast;
unsigned char* data = source.data()->data();
- Vector<uint8_t> dataVector;
+ Vector<uint8_t> premultipliedData;
if (CFEqual(uti.get(), jpegUTI())) {
// JPEGs don't have an alpha channel, so we have to manually composite on top of black.
- dataVector.resize(4 * source.width() * source.height());
- unsigned char *out = dataVector.data();
-
- for (int i = 0; i < source.width() * source.height(); i++) {
- // Multiply color data by alpha, and set alpha to 255.
- int alpha = data[4 * i + 3];
+ size_t size = 4 * source.width() * source.height();
+ if (!premultipliedData.tryReserveCapacity(size))
+ return "data:,";
+
+ unsigned char *buffer = premultipliedData.data();
+ for (size_t i = 0; i < size; i += 4) {
+ unsigned alpha = data[i + 3];
if (alpha != 255) {
- out[4 * i + 0] = data[4 * i + 0] * alpha / 255;
- out[4 * i + 1] = data[4 * i + 1] * alpha / 255;
- out[4 * i + 2] = data[4 * i + 2] * alpha / 255;
+ buffer[i + 0] = data[i + 0] * alpha / 255;
+ buffer[i + 1] = data[i + 1] * alpha / 255;
+ buffer[i + 2] = data[i + 2] * alpha / 255;
} else {
- out[4 * i + 0] = data[4 * i + 0];
- out[4 * i + 1] = data[4 * i + 1];
- out[4 * i + 2] = data[4 * i + 2];
+ buffer[i + 0] = data[i + 0];
+ buffer[i + 1] = data[i + 1];
+ buffer[i + 2] = data[i + 2];
}
- out[4 * i + 3] = 255;
}
- data = out;
+ dataAlphaInfo = kCGImageAlphaNoneSkipLast; // Ignore the alpha channel.
+ data = premultipliedData.data();
}
RetainPtr<CGDataProviderRef> dataProvider;
@@ -513,7 +518,7 @@ String ImageDataToDataURL(const ImageData& source, const String& mimeType, const
RetainPtr<CGImageRef> image;
image.adoptCF(CGImageCreate(source.width(), source.height(), 8, 32, 4 * source.width(),
- deviceRGBColorSpaceRef(), kCGBitmapByteOrderDefault | kCGImageAlphaLast,
+ deviceRGBColorSpaceRef(), kCGBitmapByteOrderDefault | dataAlphaInfo,
dataProvider.get(), 0, false, kCGRenderingIntentDefault));
return CGImageToDataURL(image.get(), mimeType, quality);
diff --git a/Source/WebCore/platform/graphics/chromium/AnimationIdVendor.cpp b/Source/WebCore/platform/graphics/chromium/AnimationIdVendor.cpp
new file mode 100644
index 000000000..41aecea03
--- /dev/null
+++ b/Source/WebCore/platform/graphics/chromium/AnimationIdVendor.cpp
@@ -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 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 "AnimationIdVendor.h"
+
+namespace WebCore {
+
+int AnimationIdVendor::s_nextAnimationId = FirstAvailableAnimationId;
+int AnimationIdVendor::s_nextGroupId = FirstAvailableGroupId;
+
+int AnimationIdVendor::getNextAnimationId()
+{
+ int id = s_nextAnimationId++;
+ if (s_nextAnimationId == DontUseAnimationId)
+ s_nextAnimationId = FirstAvailableAnimationId;
+
+ return id;
+}
+
+int AnimationIdVendor::getNextGroupId()
+{
+ int id = s_nextGroupId++;
+ if (s_nextGroupId == DontUseGroupId)
+ s_nextGroupId = FirstAvailableGroupId;
+
+ return id;
+}
+
+} // namespace WebCore
diff --git a/Source/WebCore/platform/graphics/chromium/AnimationIdVendor.h b/Source/WebCore/platform/graphics/chromium/AnimationIdVendor.h
new file mode 100644
index 000000000..69a43532e
--- /dev/null
+++ b/Source/WebCore/platform/graphics/chromium/AnimationIdVendor.h
@@ -0,0 +1,46 @@
+/*
+ 2 * Copyright (C) 2012 Google Inc. All rights reserved.
+ 3 *
+* 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 AnimationIdVendor_h
+#define AnimationIdVendor_h
+
+namespace WebCore {
+
+class AnimationIdVendor {
+public:
+ enum AnimationIdSequence { DontUseAnimationId = 0, LinkHighlightAnimationId, FirstAvailableAnimationId };
+ enum GroupIdSequence { DontUseGroupId = 0, FirstAvailableGroupId };
+
+ static int getNextAnimationId();
+ static int getNextGroupId();
+
+private:
+ static int s_nextAnimationId;
+ static int s_nextGroupId;
+};
+
+} // namespace WebCore
+
+#endif
diff --git a/Source/WebCore/platform/graphics/chromium/GraphicsLayerChromium.cpp b/Source/WebCore/platform/graphics/chromium/GraphicsLayerChromium.cpp
index 3c6d924bb..9ef31b25b 100644
--- a/Source/WebCore/platform/graphics/chromium/GraphicsLayerChromium.cpp
+++ b/Source/WebCore/platform/graphics/chromium/GraphicsLayerChromium.cpp
@@ -45,6 +45,7 @@
#include "GraphicsLayerChromium.h"
+#include "AnimationIdVendor.h"
#include "Canvas2DLayerChromium.h"
#include "ContentLayerChromium.h"
#include "FloatConversion.h"
@@ -52,6 +53,7 @@
#include "Image.h"
#include "ImageLayerChromium.h"
#include "LayerChromium.h"
+#include "LinkHighlight.h"
#include "PlatformString.h"
#include "SystemTime.h"
@@ -61,11 +63,6 @@
using namespace std;
-namespace {
-static int s_nextGroupId = 1;
-static int s_nextAnimationId = 1;
-}
-
namespace WebCore {
PassOwnPtr<GraphicsLayer> GraphicsLayer::create(GraphicsLayerClient* client)
@@ -111,6 +108,9 @@ void GraphicsLayerChromium::willBeDestroyed()
m_transformLayer->setLayerAnimationDelegate(0);
}
+ if (m_linkHighlight)
+ m_linkHighlight.clear();
+
GraphicsLayer::willBeDestroyed();
}
@@ -130,6 +130,8 @@ void GraphicsLayerChromium::updateNames()
m_transformLayer->setDebugName("TransformLayer for " + m_nameBase);
if (m_contentsLayer)
m_contentsLayer->setDebugName("ContentsLayer for " + m_nameBase);
+ if (m_linkHighlight)
+ m_linkHighlight->contentLayer()->setDebugName("LinkHighlight for " + m_nameBase);
}
bool GraphicsLayerChromium::setChildren(const Vector<GraphicsLayer*>& children)
@@ -407,7 +409,7 @@ void GraphicsLayerChromium::setContentsToCanvas(PlatformLayer* platformLayer)
bool GraphicsLayerChromium::addAnimation(const KeyframeValueList& values, const IntSize& boxSize, const Animation* animation, const String& animationName, double timeOffset)
{
primaryLayer()->setLayerAnimationDelegate(this);
- return primaryLayer()->addAnimation(values, boxSize, animation, mapAnimationNameToId(animationName), s_nextGroupId++, timeOffset);
+ return primaryLayer()->addAnimation(values, boxSize, animation, mapAnimationNameToId(animationName), AnimationIdVendor::getNextGroupId(), timeOffset);
}
void GraphicsLayerChromium::pauseAnimation(const String& animationName, double timeOffset)
@@ -433,6 +435,20 @@ void GraphicsLayerChromium::resumeAnimations()
primaryLayer()->resumeAnimations(monotonicallyIncreasingTime());
}
+void GraphicsLayerChromium::addLinkHighlight(const Path& 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;
@@ -513,6 +529,9 @@ void GraphicsLayerChromium::updateChildList()
newChildren.append(childLayer);
}
+ if (m_linkHighlight)
+ newChildren.append(m_linkHighlight->contentLayer());
+
for (size_t i = 0; i < newChildren.size(); ++i)
newChildren[i]->removeFromParent();
@@ -749,7 +768,7 @@ int GraphicsLayerChromium::mapAnimationNameToId(const String& animationName)
return 0;
if (!m_animationIdMap.contains(animationName))
- m_animationIdMap.add(animationName, s_nextAnimationId++);
+ m_animationIdMap.add(animationName, AnimationIdVendor::getNextAnimationId());
return m_animationIdMap.find(animationName)->second;
}
diff --git a/Source/WebCore/platform/graphics/chromium/GraphicsLayerChromium.h b/Source/WebCore/platform/graphics/chromium/GraphicsLayerChromium.h
index be2b3ae65..8ce1fc48e 100644
--- a/Source/WebCore/platform/graphics/chromium/GraphicsLayerChromium.h
+++ b/Source/WebCore/platform/graphics/chromium/GraphicsLayerChromium.h
@@ -44,6 +44,7 @@
namespace WebCore {
class LayerChromium;
+class LinkHighlight;
class GraphicsLayerChromium : public GraphicsLayer, public ContentLayerDelegate, public CCLayerAnimationDelegate {
public:
@@ -105,6 +106,9 @@ public:
virtual void suspendAnimations(double wallClockTime);
virtual void resumeAnimations();
+ virtual void addLinkHighlight(const Path&);
+ virtual void didFinishLinkHighlight();
+
virtual PlatformLayer* platformLayer() const;
virtual void setDebugBackgroundColor(const Color&);
@@ -157,6 +161,7 @@ private:
RefPtr<ContentLayerChromium> m_layer;
RefPtr<LayerChromium> m_transformLayer;
RefPtr<LayerChromium> m_contentsLayer;
+ RefPtr<LinkHighlight> m_linkHighlight;
enum ContentsLayerPurpose {
NoContentsLayer = 0,
diff --git a/Source/WebCore/platform/graphics/chromium/ImageChromium.cpp b/Source/WebCore/platform/graphics/chromium/ImageChromium.cpp
index c8a7ef5ec..b9afa9edb 100644
--- a/Source/WebCore/platform/graphics/chromium/ImageChromium.cpp
+++ b/Source/WebCore/platform/graphics/chromium/ImageChromium.cpp
@@ -29,9 +29,12 @@
*/
#include "config.h"
+#include "BitmapImage.h"
#include "Image.h"
+#include "SharedBuffer.h"
-#include "PlatformSupport.h"
+#include <public/Platform.h>
+#include <public/WebData.h>
namespace WebCore {
@@ -39,7 +42,13 @@ namespace WebCore {
PassRefPtr<Image> Image::loadPlatformResource(const char *name)
{
- return PlatformSupport::loadPlatformImageResource(name);
+ const WebKit::WebData& resource = WebKit::Platform::current()->loadResource(name);
+ if (resource.isEmpty())
+ return Image::nullImage();
+
+ RefPtr<Image> image = BitmapImage::create();
+ image->setData(resource, true);
+ return image.release();
}
} // namespace WebCore
diff --git a/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp b/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp
index 28f572098..9f3edd0ae 100644
--- a/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp
+++ b/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp
@@ -48,6 +48,7 @@
#include "RenderSurfaceChromium.h"
#include "TextureCopier.h"
#include "TextureManager.h"
+#include "ThrottledTextureUploader.h"
#include "TraceEvent.h"
#include "TrackingTextureAllocator.h"
#include "cc/CCCheckerboardDrawQuad.h"
@@ -193,9 +194,9 @@ private:
};
-PassOwnPtr<LayerRendererChromium> LayerRendererChromium::create(LayerRendererChromiumClient* client, PassRefPtr<GraphicsContext3D> context)
+PassOwnPtr<LayerRendererChromium> LayerRendererChromium::create(LayerRendererChromiumClient* client, PassRefPtr<GraphicsContext3D> context, PassOwnPtr<TextureUploader> uploader)
{
- OwnPtr<LayerRendererChromium> layerRenderer(adoptPtr(new LayerRendererChromium(client, context)));
+ OwnPtr<LayerRendererChromium> layerRenderer(adoptPtr(new LayerRendererChromium(client, context, uploader)));
if (!layerRenderer->initialize())
return nullptr;
@@ -203,11 +204,13 @@ PassOwnPtr<LayerRendererChromium> LayerRendererChromium::create(LayerRendererChr
}
LayerRendererChromium::LayerRendererChromium(LayerRendererChromiumClient* client,
- PassRefPtr<GraphicsContext3D> context)
+ PassRefPtr<GraphicsContext3D> context,
+ PassOwnPtr<TextureUploader> uploader)
: m_client(client)
, m_currentRenderSurface(0)
, m_currentManagedTexture(0)
, m_offscreenFramebufferId(0)
+ , m_textureUploader(uploader)
, m_context(context)
, m_defaultRenderSurface(0)
, m_sharedGeometryQuad(FloatRect(-0.5f, -0.5f, 1.0f, 1.0f))
@@ -1379,7 +1382,6 @@ bool LayerRendererChromium::initializeSharedObjects()
TextureManager::reclaimLimitBytes(viewportSize()),
m_capabilities.maxTextureSize);
m_textureCopier = AcceleratedTextureCopier::create(m_context.get());
- m_textureUploader = AcceleratedTextureUploader::create(m_context.get());
m_contentsTextureAllocator = TrackingTextureAllocator::create(m_context.get());
m_renderSurfaceTextureAllocator = TrackingTextureAllocator::create(m_context.get());
if (m_capabilities.usingTextureUsageHint)
diff --git a/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.h b/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.h
index 530ba848e..d73f71ae7 100644
--- a/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.h
+++ b/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.h
@@ -37,7 +37,7 @@
#include "FloatQuad.h"
#include "IntRect.h"
#include "TextureCopier.h"
-#include "TextureUploader.h"
+#include "ThrottledTextureUploader.h"
#include "TrackingTextureAllocator.h"
#include "cc/CCLayerTreeHost.h"
#include <wtf/HashMap.h>
@@ -78,7 +78,7 @@ public:
class LayerRendererChromium {
WTF_MAKE_NONCOPYABLE(LayerRendererChromium);
public:
- static PassOwnPtr<LayerRendererChromium> create(LayerRendererChromiumClient*, PassRefPtr<GraphicsContext3D>);
+ static PassOwnPtr<LayerRendererChromium> create(LayerRendererChromiumClient*, PassRefPtr<GraphicsContext3D>, PassOwnPtr<TextureUploader>);
~LayerRendererChromium();
@@ -144,7 +144,7 @@ protected:
void ensureFramebuffer();
bool isFramebufferDiscarded() const { return m_isFramebufferDiscarded; }
- LayerRendererChromium(LayerRendererChromiumClient*, PassRefPtr<GraphicsContext3D>);
+ LayerRendererChromium(LayerRendererChromiumClient*, PassRefPtr<GraphicsContext3D>, PassOwnPtr<TextureUploader>);
bool initialize();
private:
@@ -286,7 +286,7 @@ private:
OwnPtr<TextureManager> m_renderSurfaceTextureManager;
OwnPtr<AcceleratedTextureCopier> m_textureCopier;
- OwnPtr<AcceleratedTextureUploader> m_textureUploader;
+ OwnPtr<TextureUploader> m_textureUploader;
OwnPtr<TrackingTextureAllocator> m_contentsTextureAllocator;
OwnPtr<TrackingTextureAllocator> m_renderSurfaceTextureAllocator;
diff --git a/Source/WebCore/platform/graphics/chromium/LinkHighlight.cpp b/Source/WebCore/platform/graphics/chromium/LinkHighlight.cpp
new file mode 100644
index 000000000..53536b32c
--- /dev/null
+++ b/Source/WebCore/platform/graphics/chromium/LinkHighlight.cpp
@@ -0,0 +1,115 @@
+/*
+ * 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 "LinkHighlight.h"
+
+#include "GraphicsLayerChromium.h"
+#include "cc/CCKeyframedAnimationCurve.h"
+#include <wtf/CurrentTime.h>
+#include <wtf/OwnPtr.h>
+
+#if USE(ACCELERATED_COMPOSITING)
+
+namespace WebCore {
+
+PassRefPtr<LinkHighlight> LinkHighlight::create(GraphicsLayerChromium* parent, const Path& path, int animationId, int groupId)
+{
+ return adoptRef(new LinkHighlight(parent, path, animationId, groupId));
+}
+
+LinkHighlight::LinkHighlight(GraphicsLayerChromium* parent, const Path& path, int animationId, int groupId)
+ : m_contentLayer(ContentLayerChromium::create(this))
+ , m_parent(parent)
+ , m_path(path)
+{
+ m_contentLayer->setIsDrawable(true);
+
+ IntRect rect = enclosingIntRect(path.boundingRect());
+
+ m_contentLayer->setBounds(rect.size());
+
+ TransformationMatrix transform;
+ transform.translate(rect.x() + rect.width() / 2, rect.y() + rect.height() / 2);
+ m_contentLayer->setTransform(transform);
+
+ m_path.translate(FloatSize(-rect.x(), -rect.y()));
+
+ m_contentLayer->setLayerAnimationDelegate(this);
+
+ // FIXME: Should these be configurable?
+ const float startOpacity = 0.25;
+ const float duration = 2;
+
+ m_contentLayer->setOpacity(startOpacity);
+
+ OwnPtr<CCKeyframedFloatAnimationCurve> curve(CCKeyframedFloatAnimationCurve::create());
+ curve->addKeyframe(CCFloatKeyframe::create(0, startOpacity, nullptr));
+ curve->addKeyframe(CCFloatKeyframe::create(duration / 2, startOpacity, nullptr));
+ curve->addKeyframe(CCFloatKeyframe::create(duration, 0, nullptr));
+
+ // animationId = 1 is reserved for us.
+ OwnPtr<CCActiveAnimation> animation(CCActiveAnimation::create(curve.release(), animationId, groupId, CCActiveAnimation::Opacity));
+ animation->setNeedsSynchronizedStartTime(true);
+ m_contentLayer->layerAnimationController()->add(animation.release());
+}
+
+LinkHighlight::~LinkHighlight()
+{
+ m_contentLayer->removeFromParent();
+ m_contentLayer->clearDelegate();
+ m_contentLayer->setLayerAnimationDelegate(0);
+}
+
+ContentLayerChromium* LinkHighlight::contentLayer()
+{
+ return m_contentLayer.get();
+}
+
+void LinkHighlight::paintContents(GraphicsContext& gc, const IntRect&)
+{
+ // FIXME: make colour configurable?
+ gc.setStrokeColor(Color(0, 0, 255, 255), ColorSpaceDeviceRGB);
+ gc.setStrokeThickness(2);
+ gc.strokePath(m_path);
+ gc.setFillColor(Color(255, 0, 255, 255), ColorSpaceDeviceRGB);
+ gc.fillPath(m_path);
+}
+
+void LinkHighlight::notifyAnimationStarted(double)
+{
+}
+
+void LinkHighlight::notifyAnimationFinished(double)
+{
+ // Allow null parent pointer to facilitate testing.
+ if (m_parent)
+ m_parent->didFinishLinkHighlight();
+}
+
+} // namespace WebCore
+
+#endif // USE(ACCELERATED_COMPOSITING)
diff --git a/Source/WebCore/platform/graphics/chromium/LinkHighlight.h b/Source/WebCore/platform/graphics/chromium/LinkHighlight.h
new file mode 100644
index 000000000..8d7889fce
--- /dev/null
+++ b/Source/WebCore/platform/graphics/chromium/LinkHighlight.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 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 LinkHighlight_h
+#define LinkHighlight_h
+
+#include "ContentLayerChromium.h"
+#include "Path.h"
+#include "cc/CCLayerAnimationDelegate.h"
+#include <wtf/RefPtr.h>
+
+#if USE(ACCELERATED_COMPOSITING)
+
+namespace WebCore {
+
+class GraphicsLayerChromium;
+
+class LinkHighlight : public RefCounted<LinkHighlight>, public ContentLayerDelegate, public CCLayerAnimationDelegate {
+public:
+ static PassRefPtr<LinkHighlight> create(GraphicsLayerChromium* parent, const Path&, int animationId, int groupId);
+ virtual ~LinkHighlight();
+
+ ContentLayerChromium* contentLayer();
+
+ // ContentLayerDelegate implementation.
+ virtual void paintContents(GraphicsContext&, const IntRect& clipRect) OVERRIDE;
+
+ // CCLayerAnimationDelegate implementation.
+ virtual void notifyAnimationStarted(double time) OVERRIDE;
+ virtual void notifyAnimationFinished(double time) OVERRIDE;
+
+private:
+ LinkHighlight(GraphicsLayerChromium* parent, const Path&, int animationId, int groupId);
+
+ RefPtr<ContentLayerChromium> m_contentLayer;
+ GraphicsLayerChromium* m_parent;
+ Path m_path;
+};
+
+} // namespace WebCore
+
+#endif // USE(ACCELERATED_COMPOSITING)
+
+#endif
diff --git a/Source/WebCore/platform/graphics/chromium/RenderSurfaceChromium.cpp b/Source/WebCore/platform/graphics/chromium/RenderSurfaceChromium.cpp
index 4e5528ec8..f5fe9a7b5 100644
--- a/Source/WebCore/platform/graphics/chromium/RenderSurfaceChromium.cpp
+++ b/Source/WebCore/platform/graphics/chromium/RenderSurfaceChromium.cpp
@@ -69,5 +69,15 @@ bool RenderSurfaceChromium::hasReplica() const
return m_owningLayer->replicaLayer();
}
+bool RenderSurfaceChromium::hasMask() const
+{
+ return m_maskLayer;
+}
+
+bool RenderSurfaceChromium::replicaHasMask() const
+{
+ return hasReplica() && (m_maskLayer || m_owningLayer->replicaLayer()->maskLayer());
+}
+
}
#endif // USE(ACCELERATED_COMPOSITING)
diff --git a/Source/WebCore/platform/graphics/chromium/RenderSurfaceChromium.h b/Source/WebCore/platform/graphics/chromium/RenderSurfaceChromium.h
index c89521567..4d3997346 100644
--- a/Source/WebCore/platform/graphics/chromium/RenderSurfaceChromium.h
+++ b/Source/WebCore/platform/graphics/chromium/RenderSurfaceChromium.h
@@ -109,6 +109,9 @@ public:
bool hasReplica() const;
+ bool hasMask() const;
+ bool replicaHasMask() const;
+
private:
LayerChromium* m_owningLayer;
LayerChromium* m_maskLayer;
diff --git a/Source/WebCore/platform/graphics/chromium/TextureLayerChromium.cpp b/Source/WebCore/platform/graphics/chromium/TextureLayerChromium.cpp
index b0a1ec4c6..738449264 100644
--- a/Source/WebCore/platform/graphics/chromium/TextureLayerChromium.cpp
+++ b/Source/WebCore/platform/graphics/chromium/TextureLayerChromium.cpp
@@ -54,8 +54,12 @@ TextureLayerChromium::TextureLayerChromium(TextureLayerChromiumClient* client)
TextureLayerChromium::~TextureLayerChromium()
{
- if (m_rateLimitContext && m_client && layerTreeHost())
- layerTreeHost()->stopRateLimiter(m_client->context());
+ if (layerTreeHost()) {
+ if (m_textureId)
+ layerTreeHost()->acquireLayerTextures();
+ if (m_rateLimitContext && m_client)
+ layerTreeHost()->stopRateLimiter(m_client->context());
+ }
}
PassOwnPtr<CCLayerImpl> TextureLayerChromium::createCCLayerImpl()
@@ -91,6 +95,10 @@ void TextureLayerChromium::setRateLimitContext(bool rateLimit)
void TextureLayerChromium::setTextureId(unsigned id)
{
+ if (m_textureId == id)
+ return;
+ if (m_textureId && layerTreeHost())
+ layerTreeHost()->acquireLayerTextures();
m_textureId = id;
setNeedsCommit();
}
@@ -103,6 +111,13 @@ void TextureLayerChromium::setNeedsDisplayRect(const FloatRect& dirtyRect)
layerTreeHost()->startRateLimiter(m_client->context());
}
+void TextureLayerChromium::setLayerTreeHost(CCLayerTreeHost* host)
+{
+ if (m_textureId && layerTreeHost() && host != layerTreeHost())
+ layerTreeHost()->acquireLayerTextures();
+ LayerChromium::setLayerTreeHost(host);
+}
+
bool TextureLayerChromium::drawsContent() const
{
return (m_client || m_textureId) && !m_contextLost && LayerChromium::drawsContent();
diff --git a/Source/WebCore/platform/graphics/chromium/TextureLayerChromium.h b/Source/WebCore/platform/graphics/chromium/TextureLayerChromium.h
index a306012f0..43f492703 100644
--- a/Source/WebCore/platform/graphics/chromium/TextureLayerChromium.h
+++ b/Source/WebCore/platform/graphics/chromium/TextureLayerChromium.h
@@ -79,6 +79,7 @@ public:
virtual void setNeedsDisplayRect(const FloatRect&) OVERRIDE;
+ virtual void setLayerTreeHost(CCLayerTreeHost*) OVERRIDE;
virtual bool drawsContent() const OVERRIDE;
virtual void update(CCTextureUpdater&, const CCOcclusionTracker*) OVERRIDE;
virtual void pushPropertiesTo(CCLayerImpl*) OVERRIDE;
diff --git a/Source/WebCore/platform/graphics/chromium/TextureUploader.h b/Source/WebCore/platform/graphics/chromium/TextureUploader.h
index afed54a4a..e3b44fd6b 100644
--- a/Source/WebCore/platform/graphics/chromium/TextureUploader.h
+++ b/Source/WebCore/platform/graphics/chromium/TextureUploader.h
@@ -31,27 +31,12 @@ namespace WebCore {
class TextureUploader {
public:
- virtual void uploadTexture(GraphicsContext3D*, LayerTextureUpdater::Texture*, TextureAllocator*, const IntRect sourceRect, const IntRect destRect) = 0;
-
-protected:
virtual ~TextureUploader() { }
-};
-
-class AcceleratedTextureUploader : public TextureUploader {
- WTF_MAKE_NONCOPYABLE(AcceleratedTextureUploader);
-public:
- static PassOwnPtr<AcceleratedTextureUploader> create(PassRefPtr<GraphicsContext3D> context)
- {
- return adoptPtr(new AcceleratedTextureUploader(context));
- }
- virtual ~AcceleratedTextureUploader();
-
- virtual void uploadTexture(GraphicsContext3D*, LayerTextureUpdater::Texture*, TextureAllocator*, const IntRect sourceRect, const IntRect destRect);
-protected:
- explicit AcceleratedTextureUploader(PassRefPtr<GraphicsContext3D>);
-
- RefPtr<GraphicsContext3D> m_context;
+ virtual bool isBusy() = 0;
+ virtual void beginUploads() = 0;
+ virtual void endUploads() = 0;
+ virtual void uploadTexture(GraphicsContext3D*, LayerTextureUpdater::Texture*, TextureAllocator*, const IntRect sourceRect, const IntRect destRect) = 0;
};
}
diff --git a/Source/WebCore/platform/graphics/chromium/ThrottledTextureUploader.cpp b/Source/WebCore/platform/graphics/chromium/ThrottledTextureUploader.cpp
new file mode 100644
index 000000000..51813c5cb
--- /dev/null
+++ b/Source/WebCore/platform/graphics/chromium/ThrottledTextureUploader.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:
+ * 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 "ThrottledTextureUploader.h"
+
+#include "Extensions3DChromium.h"
+
+namespace {
+
+// Number of pending texture update queries to allow.
+static const size_t maxPendingQueries = 2;
+
+} // anonymous namespace
+
+namespace WebCore {
+
+ThrottledTextureUploader::Query::Query(PassRefPtr<GraphicsContext3D> context)
+ : m_context(context)
+ , m_queryId(0)
+{
+ Extensions3DChromium* extensions = static_cast<Extensions3DChromium*>(m_context->getExtensions());
+ m_queryId = extensions->createQueryEXT();
+}
+
+ThrottledTextureUploader::Query::~Query()
+{
+ Extensions3DChromium* extensions = static_cast<Extensions3DChromium*>(m_context->getExtensions());
+ extensions->deleteQueryEXT(m_queryId);
+}
+
+void ThrottledTextureUploader::Query::begin()
+{
+ Extensions3DChromium* extensions = static_cast<Extensions3DChromium*>(m_context->getExtensions());
+ extensions->beginQueryEXT(Extensions3DChromium::COMMANDS_ISSUED_CHROMIUM, m_queryId);
+}
+
+void ThrottledTextureUploader::Query::end()
+{
+ Extensions3DChromium* extensions = static_cast<Extensions3DChromium*>(m_context->getExtensions());
+ extensions->endQueryEXT(Extensions3DChromium::COMMANDS_ISSUED_CHROMIUM);
+}
+
+bool ThrottledTextureUploader::Query::isPending()
+{
+ Extensions3DChromium* extensions = static_cast<Extensions3DChromium*>(m_context->getExtensions());
+ unsigned available = 1;
+ extensions->getQueryObjectuivEXT(m_queryId, Extensions3DChromium::QUERY_RESULT_AVAILABLE_EXT, &available);
+ return !available;
+}
+
+void ThrottledTextureUploader::Query::wait()
+{
+ Extensions3DChromium* extensions = static_cast<Extensions3DChromium*>(m_context->getExtensions());
+ unsigned result;
+ extensions->getQueryObjectuivEXT(m_queryId, Extensions3DChromium::QUERY_RESULT_EXT, &result);
+}
+
+ThrottledTextureUploader::ThrottledTextureUploader(PassRefPtr<GraphicsContext3D> context)
+ : m_context(context)
+ , m_maxPendingQueries(maxPendingQueries)
+{
+}
+
+ThrottledTextureUploader::ThrottledTextureUploader(PassRefPtr<GraphicsContext3D> context, size_t pendingUploadLimit)
+ : m_context(context)
+ , m_maxPendingQueries(pendingUploadLimit)
+{
+}
+
+ThrottledTextureUploader::~ThrottledTextureUploader()
+{
+}
+
+bool ThrottledTextureUploader::isBusy()
+{
+ processQueries();
+
+ if (!m_availableQueries.isEmpty())
+ return false;
+
+ if (m_pendingQueries.size() == m_maxPendingQueries)
+ return true;
+
+ m_availableQueries.append(Query::create(m_context));
+ return false;
+}
+
+void ThrottledTextureUploader::beginUploads()
+{
+ // Wait for query to become available.
+ while (isBusy())
+ m_pendingQueries.first()->wait();
+
+ ASSERT(!m_availableQueries.isEmpty());
+ m_availableQueries.first()->begin();
+}
+
+void ThrottledTextureUploader::endUploads()
+{
+ m_availableQueries.first()->end();
+ m_pendingQueries.append(m_availableQueries.takeFirst());
+}
+
+void ThrottledTextureUploader::uploadTexture(GraphicsContext3D* context, LayerTextureUpdater::Texture* texture, TextureAllocator* allocator, const IntRect sourceRect, const IntRect destRect)
+{
+ texture->updateRect(context, allocator, sourceRect, destRect);
+}
+
+void ThrottledTextureUploader::processQueries()
+{
+ while (!m_pendingQueries.isEmpty()) {
+ if (m_pendingQueries.first()->isPending())
+ break;
+
+ m_availableQueries.append(m_pendingQueries.takeFirst());
+ }
+}
+
+}
diff --git a/Source/WebCore/platform/graphics/chromium/ThrottledTextureUploader.h b/Source/WebCore/platform/graphics/chromium/ThrottledTextureUploader.h
new file mode 100644
index 000000000..a72058649
--- /dev/null
+++ b/Source/WebCore/platform/graphics/chromium/ThrottledTextureUploader.h
@@ -0,0 +1,84 @@
+/*
+ * 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 ThrottledTextureUploader_h
+#define ThrottledTextureUploader_h
+
+#include "TextureUploader.h"
+
+#include <wtf/Deque.h>
+
+namespace WebCore {
+
+class ThrottledTextureUploader : public TextureUploader {
+ WTF_MAKE_NONCOPYABLE(ThrottledTextureUploader);
+public:
+ static PassOwnPtr<ThrottledTextureUploader> create(PassRefPtr<GraphicsContext3D> context)
+ {
+ return adoptPtr(new ThrottledTextureUploader(context));
+ }
+ static PassOwnPtr<ThrottledTextureUploader> create(PassRefPtr<GraphicsContext3D> context, size_t pendingUploadLimit)
+ {
+ return adoptPtr(new ThrottledTextureUploader(context, pendingUploadLimit));
+ }
+ virtual ~ThrottledTextureUploader();
+
+ virtual bool isBusy() OVERRIDE;
+ virtual void beginUploads() OVERRIDE;
+ virtual void endUploads() OVERRIDE;
+ virtual void uploadTexture(GraphicsContext3D*, LayerTextureUpdater::Texture*, TextureAllocator*, const IntRect sourceRect, const IntRect destRect) OVERRIDE;
+
+private:
+ class Query {
+ public:
+ static PassOwnPtr<Query> create(PassRefPtr<GraphicsContext3D> context) { return adoptPtr(new Query(context)); }
+
+ virtual ~Query();
+
+ void begin();
+ void end();
+ bool isPending();
+ void wait();
+
+ private:
+ explicit Query(PassRefPtr<GraphicsContext3D>);
+
+ RefPtr<GraphicsContext3D> m_context;
+ unsigned m_queryId;
+ };
+
+ ThrottledTextureUploader(PassRefPtr<GraphicsContext3D>);
+ ThrottledTextureUploader(PassRefPtr<GraphicsContext3D>, size_t pendingUploadLimit);
+
+ void processQueries();
+
+ RefPtr<GraphicsContext3D> m_context;
+ size_t m_maxPendingQueries;
+ Deque<OwnPtr<Query> > m_pendingQueries;
+ Deque<OwnPtr<Query> > m_availableQueries;
+};
+
+}
+
+#endif
diff --git a/Source/WebCore/platform/graphics/chromium/TiledLayerChromium.cpp b/Source/WebCore/platform/graphics/chromium/TiledLayerChromium.cpp
index 68f4964ba..71a874b18 100644
--- a/Source/WebCore/platform/graphics/chromium/TiledLayerChromium.cpp
+++ b/Source/WebCore/platform/graphics/chromium/TiledLayerChromium.cpp
@@ -46,8 +46,9 @@
// Start tiling when the width and height of a layer are larger than this size.
static int maxUntiledSize = 512;
-// When tiling is enabled, use tiles of this dimension squared.
-static int defaultTileSize = 256;
+// When tiling is enabled, use tiles of this size:
+static int defaultTileWidth = 256;
+static int defaultTileHeight = 256;
using namespace std;
@@ -100,7 +101,7 @@ TiledLayerChromium::TiledLayerChromium()
, m_didPaint(false)
, m_tilingOption(AutoTile)
{
- m_tiler = CCLayerTilingData::create(IntSize(defaultTileSize, defaultTileSize), CCLayerTilingData::HasBorderTexels);
+ m_tiler = CCLayerTilingData::create(IntSize(defaultTileWidth, defaultTileHeight), CCLayerTilingData::HasBorderTexels);
}
TiledLayerChromium::~TiledLayerChromium()
@@ -114,13 +115,13 @@ PassOwnPtr<CCLayerImpl> TiledLayerChromium::createCCLayerImpl()
void TiledLayerChromium::updateTileSizeAndTilingOption()
{
- const IntSize tileSize(min(defaultTileSize, contentBounds().width()), min(defaultTileSize, contentBounds().height()));
+ const IntSize tileSize(min(defaultTileWidth, contentBounds().width()), min(defaultTileHeight, contentBounds().height()));
// Tile if both dimensions large, or any one dimension large and the other
// extends into a second tile. This heuristic allows for long skinny layers
// (e.g. scrollbars) that are Nx1 tiles to minimize wasted texture space.
const bool anyDimensionLarge = contentBounds().width() > maxUntiledSize || contentBounds().height() > maxUntiledSize;
- const bool anyDimensionOneTile = contentBounds().width() <= defaultTileSize || contentBounds().height() <= defaultTileSize;
+ const bool anyDimensionOneTile = contentBounds().width() <= defaultTileWidth || contentBounds().height() <= defaultTileHeight;
const bool autoTiled = anyDimensionLarge && !anyDimensionOneTile;
bool isTiled;
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCActiveAnimation.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCActiveAnimation.cpp
index ccffdbc72..1eccb8f08 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCActiveAnimation.cpp
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCActiveAnimation.cpp
@@ -45,6 +45,7 @@ CCActiveAnimation::CCActiveAnimation(PassOwnPtr<CCAnimationCurve> curve, int ani
, m_runState(WaitingForTargetAvailability)
, m_iterations(1)
, m_startTime(0)
+ , m_alternatesDirection(false)
, m_timeOffset(0)
, m_needsSynchronizedStartTime(false)
, m_suspended(false)
@@ -119,11 +120,23 @@ double CCActiveAnimation::trimTimeToCurrentIteration(double monotonicTime) const
return trimmed;
// If greater than or equal to the total duration, return iteration duration.
- if (m_iterations >= 0 && trimmed >= m_curve->duration() * m_iterations)
+ if (m_iterations >= 0 && trimmed >= m_curve->duration() * m_iterations) {
+ if (m_alternatesDirection && !(m_iterations % 2))
+ return 0;
return m_curve->duration();
+ }
+
+ // We need to know the current iteration if we're alternating.
+ int iteration = static_cast<int>(trimmed / m_curve->duration());
+
+ // Calculate x where trimmed = x + n * m_curve->duration() for some positive integer n.
+ trimmed = fmod(trimmed, m_curve->duration());
+
+ // If we're alternating and on an odd iteration, reverse the direction.
+ if (m_alternatesDirection && iteration % 2 == 1)
+ return m_curve->duration() - trimmed;
- // Finally, return x where trimmed = x + n * m_animation->duration() for some positive integer n.
- return fmod(trimmed, m_curve->duration());
+ return trimmed;
}
PassOwnPtr<CCActiveAnimation> CCActiveAnimation::cloneForImplThread() const
@@ -135,6 +148,7 @@ PassOwnPtr<CCActiveAnimation> CCActiveAnimation::cloneForImplThread() const
toReturn->m_pauseTime = m_pauseTime;
toReturn->m_totalPausedTime = m_totalPausedTime;
toReturn->m_timeOffset = m_timeOffset;
+ toReturn->m_alternatesDirection = m_alternatesDirection;
return toReturn.release();
}
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCActiveAnimation.h b/Source/WebCore/platform/graphics/chromium/cc/CCActiveAnimation.h
index 531eb464f..02255702a 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCActiveAnimation.h
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCActiveAnimation.h
@@ -90,6 +90,10 @@ public:
void suspend(double monotonicTime);
void resume(double monotonicTime);
+ // If alternatesDirection is true, on odd numbered iterations we reverse the curve.
+ bool alternatesDirection() const { return m_alternatesDirection; }
+ void setAlternatesDirection(bool alternates) { m_alternatesDirection = alternates; }
+
bool isFinishedAt(double monotonicTime) const;
bool isFinished() const { return m_runState == Finished || m_runState == Aborted; }
@@ -128,6 +132,7 @@ private:
RunState m_runState;
int m_iterations;
double m_startTime;
+ bool m_alternatesDirection;
// The time offset effectively pushes the start of the animation back in time. This is
// used for resuming paused animations -- an animation is added with a non-zero time
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCDrawQuad.h b/Source/WebCore/platform/graphics/chromium/cc/CCDrawQuad.h
index b78882e6a..f4ef2d3f2 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCDrawQuad.h
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCDrawQuad.h
@@ -75,6 +75,7 @@ public:
};
Material material() const { return m_material; }
+ bool isDebugQuad() const { return m_material == DebugBorder; }
const CCCheckerboardDrawQuad* toCheckerboardDrawQuad() const;
const CCDebugBorderDrawQuad* toDebugBorderDrawQuad() const;
@@ -85,6 +86,8 @@ public:
const CCTileDrawQuad* toTileDrawQuad() const;
const CCVideoDrawQuad* toVideoDrawQuad() const;
+ const CCSharedQuadState* sharedQuadState() const { return m_sharedQuadState; }
+
protected:
CCDrawQuad(const CCSharedQuadState*, Material, const IntRect&);
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCLayerAnimationController.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCLayerAnimationController.cpp
index 199192d52..df50be834 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCLayerAnimationController.cpp
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCLayerAnimationController.cpp
@@ -52,19 +52,23 @@ void appendKeyframe<TransformAnimationValue, CCTransformKeyframe, CCKeyframedTra
template <class Value, class Keyframe, class Curve>
PassOwnPtr<CCActiveAnimation> createActiveAnimation(const KeyframeValueList& valueList, const Animation* animation, size_t animationId, size_t groupId, double timeOffset, CCActiveAnimation::TargetProperty targetProperty)
{
- // FIXME: add support for different directions.
- if (animation && animation->isDirectionSet() && animation->direction() != Animation::AnimationDirectionNormal)
- return nullptr;
-
- // FIXME: add support for fills forwards and fills backwards
- if (animation && animation->isFillModeSet() && (animation->fillsForwards() || animation->fillsBackwards()))
- return nullptr;
+ bool alternate = false;
+ bool reverse = false;
+ if (animation && animation->isDirectionSet()) {
+ Animation::AnimationDirection direction = animation->direction();
+ if (direction == Animation::AnimationDirectionAlternate || direction == Animation::AnimationDirectionAlternateReverse)
+ alternate = true;
+ if (direction == Animation::AnimationDirectionReverse || direction == Animation::AnimationDirectionAlternateReverse)
+ reverse = true;
+ }
OwnPtr<Curve> curve = Curve::create();
Vector<Keyframe> keyframes;
for (size_t i = 0; i < valueList.size(); i++) {
- const Value* originalValue = static_cast<const Value*>(valueList.at(i));
+ size_t index = reverse ? valueList.size() - i - 1 : i;
+
+ const Value* originalValue = static_cast<const Value*>(valueList.at(index));
OwnPtr<CCTimingFunction> timingFunction;
const TimingFunction* originalTimingFunction = originalValue->timingFunction();
@@ -91,7 +95,10 @@ PassOwnPtr<CCActiveAnimation> createActiveAnimation(const KeyframeValueList& val
timingFunction = CCEaseTimingFunction::create();
double duration = (animation && animation->isDurationSet()) ? animation->duration() : 1;
- appendKeyframe<Value, Keyframe, Curve>(*curve, originalValue->keyTime() * duration, originalValue, timingFunction.release());
+ double keyTime = originalValue->keyTime() * duration;
+ if (reverse)
+ keyTime = duration - keyTime;
+ appendKeyframe<Value, Keyframe, Curve>(*curve, keyTime, originalValue, timingFunction.release());
}
OwnPtr<CCActiveAnimation> anim = CCActiveAnimation::create(curve.release(), animationId, groupId, targetProperty);
@@ -101,6 +108,7 @@ PassOwnPtr<CCActiveAnimation> createActiveAnimation(const KeyframeValueList& val
if (anim.get()) {
int iterations = (animation && animation->isIterationCountSet()) ? animation->iterationCount() : 1;
anim->setIterations(iterations);
+ anim->setAlternatesDirection(alternate);
}
// In order to avoid skew, the main thread animation cannot tick until it has received the start time of
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCLayerTilingData.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCLayerTilingData.cpp
index ab132ae14..823a316a3 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCLayerTilingData.cpp
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCLayerTilingData.cpp
@@ -40,20 +40,24 @@ PassOwnPtr<CCLayerTilingData> CCLayerTilingData::create(const IntSize& tileSize,
}
CCLayerTilingData::CCLayerTilingData(const IntSize& tileSize, BorderTexelOption border)
- : m_tilingData(max(tileSize.width(), tileSize.height()), 0, 0, border == HasBorderTexels)
+ : m_tilingData(tileSize, IntSize(), border == HasBorderTexels)
{
setTileSize(tileSize);
}
void CCLayerTilingData::setTileSize(const IntSize& size)
{
- if (m_tileSize == size)
+ if (tileSize() == size)
return;
reset();
- m_tileSize = size;
- m_tilingData.setMaxTextureSize(max(size.width(), size.height()));
+ m_tilingData.setMaxTextureSize(size);
+}
+
+const IntSize& CCLayerTilingData::tileSize() const
+{
+ return m_tilingData.maxTextureSize();
}
void CCLayerTilingData::setBorderTexelOption(BorderTexelOption borderTexelOption)
@@ -68,7 +72,6 @@ void CCLayerTilingData::setBorderTexelOption(BorderTexelOption borderTexelOption
const CCLayerTilingData& CCLayerTilingData::operator=(const CCLayerTilingData& tiler)
{
- m_tileSize = tiler.m_tileSize;
m_tilingData = tiler.m_tilingData;
return *this;
@@ -107,7 +110,7 @@ void CCLayerTilingData::layerRectToTileIndices(const IntRect& layerRect, int& le
IntRect CCLayerTilingData::tileRect(const Tile* tile) const
{
IntRect tileRect = m_tilingData.tileBoundsWithBorder(tile->i(), tile->j());
- tileRect.setSize(m_tileSize);
+ tileRect.setSize(tileSize());
return tileRect;
}
@@ -134,7 +137,7 @@ Region CCLayerTilingData::opaqueRegionInLayerRect(const IntRect& layerRect) cons
void CCLayerTilingData::setBounds(const IntSize& size)
{
- m_tilingData.setTotalSize(size.width(), size.height());
+ m_tilingData.setTotalSize(size);
// Any tiles completely outside our new bounds are invalid and should be dropped.
int left, top, right, bottom;
@@ -150,7 +153,7 @@ void CCLayerTilingData::setBounds(const IntSize& size)
IntSize CCLayerTilingData::bounds() const
{
- return IntSize(m_tilingData.totalSizeX(), m_tilingData.totalSizeY());
+ return m_tilingData.totalSize();
}
} // namespace WebCore
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCLayerTilingData.h b/Source/WebCore/platform/graphics/chromium/cc/CCLayerTilingData.h
index d87dcd260..081fe844e 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCLayerTilingData.h
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCLayerTilingData.h
@@ -52,7 +52,7 @@ public:
// Change the tile size. This may invalidate all the existing tiles.
void setTileSize(const IntSize&);
- const IntSize& tileSize() const { return m_tileSize; }
+ const IntSize& tileSize() const;
// Change the border texel setting. This may invalidate all existing tiles.
void setBorderTexelOption(BorderTexelOption);
bool hasBorderTexels() const { return m_tilingData.borderTexels(); }
@@ -109,7 +109,6 @@ protected:
CCLayerTilingData(const IntSize& tileSize, BorderTexelOption);
TileMap m_tiles;
- IntSize m_tileSize;
TilingData m_tilingData;
};
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp
index 39d2a1658..9e576ac37 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp
@@ -420,6 +420,7 @@ void CCLayerTreeHost::setContentsMemoryAllocationLimitBytes(size_t bytes)
return;
m_contentsTextureManager->setMemoryAllocationLimitBytes(bytes);
+ setNeedsCommit();
}
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.h b/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.h
index 40612eaf0..8edac781b 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.h
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.h
@@ -162,7 +162,7 @@ public:
void didCommitAndDrawFrame() { m_client->didCommitAndDrawFrame(); }
void didCompleteSwapBuffers() { m_client->didCompleteSwapBuffers(); }
void deleteContentsTexturesOnImplThread(TextureAllocator*);
- void acquireLayerTextures();
+ virtual void acquireLayerTextures();
// Returns false if we should abort this frame due to initialization failure.
bool updateLayers(CCTextureUpdater&);
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp
index 3ea5fb19a..ec564f5f6 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp
@@ -380,13 +380,11 @@ IntSize CCLayerTreeHostImpl::contentSize() const
bool CCLayerTreeHostImpl::prepareToDraw(FrameData& frame)
{
TRACE_EVENT("CCLayerTreeHostImpl::prepareToDraw", this, 0);
+ ASSERT(canDraw());
frame.renderPasses.clear();
frame.renderSurfaceLayerList.clear();
- if (!m_rootLayerImpl)
- return false;
-
if (!calculateRenderPasses(frame.renderPasses, frame.renderSurfaceLayerList)) {
// We're missing textures on an animating layer. Request a commit.
m_client->setNeedsCommitOnImplThread();
@@ -405,10 +403,7 @@ void CCLayerTreeHostImpl::setContentsMemoryAllocationLimitBytes(size_t bytes)
void CCLayerTreeHostImpl::drawLayers(const FrameData& frame)
{
TRACE_EVENT("CCLayerTreeHostImpl::drawLayers", this, 0);
- ASSERT(m_layerRenderer);
-
- if (!m_rootLayerImpl)
- return;
+ ASSERT(canDraw());
// FIXME: use the frame begin time from the overall compositor scheduler.
// This value is currently inaccessible because it is up in Chromium's
@@ -531,10 +526,10 @@ void CCLayerTreeHostImpl::setVisible(bool visible)
m_timeSourceClientAdapter->setActive(shouldTickInBackground);
}
-bool CCLayerTreeHostImpl::initializeLayerRenderer(PassRefPtr<GraphicsContext3D> context)
+bool CCLayerTreeHostImpl::initializeLayerRenderer(PassRefPtr<GraphicsContext3D> context, PassOwnPtr<TextureUploader> uploader)
{
OwnPtr<LayerRendererChromium> layerRenderer;
- layerRenderer = LayerRendererChromium::create(this, context);
+ layerRenderer = LayerRendererChromium::create(this, context, uploader);
// Since we now have a new context/layerRenderer, we cannot continue to use the old
// resources (i.e. renderSurfaces and texture IDs).
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.h b/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.h
index dde27f68b..8f16f9fd4 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.h
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.h
@@ -122,7 +122,7 @@ public:
void finishAllRendering();
int frameNumber() const { return m_frameNumber; }
- bool initializeLayerRenderer(PassRefPtr<GraphicsContext3D>);
+ bool initializeLayerRenderer(PassRefPtr<GraphicsContext3D>, PassOwnPtr<TextureUploader>);
bool isContextLost();
LayerRendererChromium* layerRenderer() { return m_layerRenderer.get(); }
const LayerRendererCapabilities& layerRendererCapabilities() const;
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCMathUtil.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCMathUtil.cpp
index ee803da69..42933688b 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCMathUtil.cpp
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCMathUtil.cpp
@@ -66,6 +66,13 @@ struct HomogeneousCoordinate {
static HomogeneousCoordinate projectPoint(const TransformationMatrix& transform, const FloatPoint& p)
{
+ // In this case, the layer we are trying to project onto is perpendicular to ray
+ // (point p and z-axis direction) that we are trying to project. This happens when the
+ // layer is rotated so that it is infinitesimally thin, or when it is co-planar with
+ // the camera origin -- i.e. when the layer is invisible anyway.
+ if (!transform.m33())
+ return HomogeneousCoordinate(0, 0, 0, 1);
+
double x = p.x();
double y = p.y();
double z = -(transform.m13() * x + transform.m23() * y + transform.m43()) / transform.m33();
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCOcclusionTracker.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCOcclusionTracker.cpp
index 3d04cfa54..792f8629a 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCOcclusionTracker.cpp
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCOcclusionTracker.cpp
@@ -230,7 +230,7 @@ void CCOcclusionTrackerBase<LayerType, RenderSurfaceType>::leaveToTargetRenderSu
const RenderSurfaceType* oldTarget = m_stack[lastIndex].surface;
Region oldTargetOcclusionInNewTarget = transformSurfaceOpaqueRegion<RenderSurfaceType>(oldTarget, m_stack[lastIndex].occlusionInTarget, oldTarget->originTransform());
- if (oldTarget->hasReplica())
+ if (oldTarget->hasReplica() && !oldTarget->replicaHasMask())
oldTargetOcclusionInNewTarget.unite(transformSurfaceOpaqueRegion<RenderSurfaceType>(oldTarget, m_stack[lastIndex].occlusionInTarget, oldTarget->replicaOriginTransform()));
IntRect unoccludedSurfaceRect;
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCQuadCuller.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCQuadCuller.cpp
index e5fd690cc..364624866 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCQuadCuller.cpp
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCQuadCuller.cpp
@@ -31,6 +31,7 @@
#include "Region.h"
#include "TransformationMatrix.h"
+#include "cc/CCDebugBorderDrawQuad.h"
#include "cc/CCLayerImpl.h"
#include "cc/CCOverdrawMetrics.h"
#include "cc/CCRenderPass.h"
@@ -40,14 +41,21 @@ using namespace std;
namespace WebCore {
-CCQuadCuller::CCQuadCuller(CCQuadList& quadList, CCLayerImpl* layer, const CCOcclusionTrackerImpl* occlusionTracker)
+static const int debugTileBorderWidth = 1;
+static const int debugTileBorderAlpha = 120;
+static const int debugTileBorderColorRed = 160;
+static const int debugTileBorderColorGreen = 100;
+static const int debugTileBorderColorBlue = 0;
+
+CCQuadCuller::CCQuadCuller(CCQuadList& quadList, CCLayerImpl* layer, const CCOcclusionTrackerImpl* occlusionTracker, bool showCullingWithDebugBorderQuads)
: m_quadList(quadList)
, m_layer(layer)
, m_occlusionTracker(occlusionTracker)
+ , m_showCullingWithDebugBorderQuads(showCullingWithDebugBorderQuads)
{
}
-static inline bool appendQuadInternal(PassOwnPtr<CCDrawQuad> passDrawQuad, const IntRect& culledRect, CCQuadList& quadList, const CCOcclusionTrackerImpl& occlusionTracker)
+static inline bool appendQuadInternal(PassOwnPtr<CCDrawQuad> passDrawQuad, const IntRect& culledRect, CCQuadList& quadList, const CCOcclusionTrackerImpl& occlusionTracker, bool createDebugBorderQuads)
{
OwnPtr<CCDrawQuad> drawQuad(passDrawQuad);
bool keepQuad = !culledRect.isEmpty();
@@ -57,28 +65,34 @@ static inline bool appendQuadInternal(PassOwnPtr<CCDrawQuad> passDrawQuad, const
occlusionTracker.overdrawMetrics().didCullForDrawing(drawQuad->quadTransform(), drawQuad->quadRect(), culledRect);
occlusionTracker.overdrawMetrics().didDraw(drawQuad->quadTransform(), culledRect, drawQuad->opaqueRect());
- // Release the quad after we're done using it.
- if (keepQuad)
+ if (keepQuad) {
+ if (createDebugBorderQuads && !drawQuad->isDebugQuad() && drawQuad->quadVisibleRect() != drawQuad->quadRect()) {
+ Color borderColor = Color(debugTileBorderColorRed, debugTileBorderColorGreen, debugTileBorderColorBlue, debugTileBorderAlpha);
+ quadList.append(CCDebugBorderDrawQuad::create(drawQuad->sharedQuadState(), drawQuad->quadVisibleRect(), borderColor, debugTileBorderWidth));
+ }
+
+ // Release the quad after we're done using it.
quadList.append(drawQuad.release());
+ }
return keepQuad;
}
bool CCQuadCuller::append(PassOwnPtr<CCDrawQuad> passDrawQuad)
{
IntRect culledRect = m_occlusionTracker->unoccludedContentRect(m_layer, passDrawQuad->quadRect());
- return appendQuadInternal(passDrawQuad, culledRect, m_quadList, *m_occlusionTracker);
+ return appendQuadInternal(passDrawQuad, culledRect, m_quadList, *m_occlusionTracker, m_showCullingWithDebugBorderQuads);
}
bool CCQuadCuller::appendSurface(PassOwnPtr<CCDrawQuad> passDrawQuad)
{
IntRect culledRect = m_occlusionTracker->unoccludedContributingSurfaceContentRect(m_layer->renderSurface(), false, passDrawQuad->quadRect());
- return appendQuadInternal(passDrawQuad, culledRect, m_quadList, *m_occlusionTracker);
+ return appendQuadInternal(passDrawQuad, culledRect, m_quadList, *m_occlusionTracker, m_showCullingWithDebugBorderQuads);
}
bool CCQuadCuller::appendReplica(PassOwnPtr<CCDrawQuad> passDrawQuad)
{
IntRect culledRect = m_occlusionTracker->unoccludedContributingSurfaceContentRect(m_layer->renderSurface(), true, passDrawQuad->quadRect());
- return appendQuadInternal(passDrawQuad, culledRect, m_quadList, *m_occlusionTracker);
+ return appendQuadInternal(passDrawQuad, culledRect, m_quadList, *m_occlusionTracker, m_showCullingWithDebugBorderQuads);
}
} // namespace WebCore
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCQuadCuller.h b/Source/WebCore/platform/graphics/chromium/cc/CCQuadCuller.h
index 5db0a98c5..2d2d80166 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCQuadCuller.h
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCQuadCuller.h
@@ -36,7 +36,7 @@ class CCQuadCuller {
public:
// Passing 0 for CCOverdrawCounts* is valid, and disable the extra computation
// done to estimate over draw statistics.
- CCQuadCuller(CCQuadList&, CCLayerImpl*, const CCOcclusionTrackerImpl*);
+ CCQuadCuller(CCQuadList&, CCLayerImpl*, const CCOcclusionTrackerImpl*, bool showCullingWithDebugBorderQuads);
// Returns true if the quad is added to the list, and false if the quad is entirely culled.
virtual bool append(PassOwnPtr<CCDrawQuad> passDrawQuad);
@@ -47,6 +47,7 @@ private:
CCQuadList& m_quadList;
CCLayerImpl* m_layer;
const CCOcclusionTrackerImpl* m_occlusionTracker;
+ bool m_showCullingWithDebugBorderQuads;
};
}
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCRenderPass.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCRenderPass.cpp
index 33b5e7310..848730a2c 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCRenderPass.cpp
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCRenderPass.cpp
@@ -60,7 +60,7 @@ CCRenderPass::CCRenderPass(CCRenderSurface* targetSurface)
void CCRenderPass::appendQuadsForLayer(CCLayerImpl* layer, CCOcclusionTrackerImpl* occlusionTracker, bool& hadMissingTiles)
{
- CCQuadCuller quadCuller(m_quadList, layer, occlusionTracker);
+ CCQuadCuller quadCuller(m_quadList, layer, occlusionTracker, layer->hasDebugBorders());
OwnPtr<CCSharedQuadState> sharedQuadState = layer->createSharedQuadState();
layer->appendDebugBorderQuad(quadCuller, sharedQuadState.get());
@@ -72,7 +72,7 @@ void CCRenderPass::appendQuadsForRenderSurfaceLayer(CCLayerImpl* layer, CCOcclus
{
// FIXME: render surface layers should be a CCLayerImpl-derived class and
// not be handled specially here.
- CCQuadCuller quadCuller(m_quadList, layer, occlusionTracker);
+ CCQuadCuller quadCuller(m_quadList, layer, occlusionTracker, layer->hasDebugBorders());
CCRenderSurface* surface = layer->renderSurface();
OwnPtr<CCSharedQuadState> sharedQuadState = surface->createSharedQuadState();
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCRenderSurface.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCRenderSurface.cpp
index ec1ac167a..a7b42c54d 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCRenderSurface.cpp
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCRenderSurface.cpp
@@ -396,6 +396,16 @@ bool CCRenderSurface::hasReplica() const
return m_owningLayer->replicaLayer();
}
+bool CCRenderSurface::hasMask() const
+{
+ return m_maskLayer;
+}
+
+bool CCRenderSurface::replicaHasMask() const
+{
+ return hasReplica() && (m_maskLayer || m_owningLayer->replicaLayer()->maskLayer());
+}
+
void CCRenderSurface::setClipRect(const IntRect& clipRect)
{
if (m_clipRect == clipRect)
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCRenderSurface.h b/Source/WebCore/platform/graphics/chromium/cc/CCRenderSurface.h
index 10a5f365e..f77945c51 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCRenderSurface.h
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCRenderSurface.h
@@ -141,6 +141,9 @@ public:
bool hasReplica() const;
+ bool hasMask() const;
+ bool replicaHasMask() const;
+
void resetPropertyChangedFlag() { m_surfacePropertyChanged = false; }
bool surfacePropertyChanged() const;
bool surfacePropertyChangedOnlyFromDescendant() const;
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCSingleThreadProxy.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCSingleThreadProxy.cpp
index b39736dd0..d5318ae36 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCSingleThreadProxy.cpp
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCSingleThreadProxy.cpp
@@ -34,11 +34,28 @@
#include "cc/CCTextureUpdater.h"
#include <wtf/CurrentTime.h>
-using namespace std;
using namespace WTF;
namespace WebCore {
+class UnthrottledTextureUploader : public TextureUploader {
+ WTF_MAKE_NONCOPYABLE(UnthrottledTextureUploader);
+public:
+ static PassOwnPtr<UnthrottledTextureUploader> create()
+ {
+ return adoptPtr(new UnthrottledTextureUploader());
+ }
+ virtual ~UnthrottledTextureUploader() { }
+
+ virtual bool isBusy() { return false; }
+ virtual void beginUploads() { }
+ virtual void endUploads() { }
+ virtual void uploadTexture(GraphicsContext3D* context, LayerTextureUpdater::Texture* texture, TextureAllocator* allocator, const IntRect sourceRect, const IntRect destRect) { texture->updateRect(context, allocator, sourceRect, destRect); }
+
+protected:
+ UnthrottledTextureUploader() { }
+};
+
PassOwnPtr<CCProxy> CCSingleThreadProxy::create(CCLayerTreeHost* layerTreeHost)
{
return adoptPtr(new CCSingleThreadProxy(layerTreeHost));
@@ -138,7 +155,7 @@ bool CCSingleThreadProxy::initializeLayerRenderer()
ASSERT(m_contextBeforeInitialization);
{
DebugScopedSetImplThread impl;
- bool ok = m_layerTreeHostImpl->initializeLayerRenderer(m_contextBeforeInitialization.release());
+ bool ok = m_layerTreeHostImpl->initializeLayerRenderer(m_contextBeforeInitialization.release(), UnthrottledTextureUploader::create());
if (ok) {
m_layerRendererInitialized = true;
m_layerRendererCapabilitiesForMainThread = m_layerTreeHostImpl->layerRendererCapabilities();
@@ -162,7 +179,7 @@ bool CCSingleThreadProxy::recreateContext()
{
DebugScopedSetImplThread impl;
m_layerTreeHost->deleteContentsTexturesOnImplThread(m_layerTreeHostImpl->contentsTextureAllocator());
- initialized = m_layerTreeHostImpl->initializeLayerRenderer(context);
+ initialized = m_layerTreeHostImpl->initializeLayerRenderer(context, UnthrottledTextureUploader::create());
if (initialized) {
m_layerRendererCapabilitiesForMainThread = m_layerTreeHostImpl->layerRendererCapabilities();
}
@@ -203,8 +220,14 @@ void CCSingleThreadProxy::doCommit(CCTextureUpdater& updater)
m_layerTreeHostImpl->beginCommit();
m_layerTreeHost->beginCommitOnImplThread(m_layerTreeHostImpl.get());
- updater.update(m_layerTreeHostImpl->context(), m_layerTreeHostImpl->contentsTextureAllocator(), m_layerTreeHostImpl->layerRenderer()->textureCopier(), m_layerTreeHostImpl->layerRenderer()->textureUploader(), numeric_limits<size_t>::max());
- ASSERT(!updater.hasMoreUpdates());
+
+ // CCTextureUpdater is non-blocking and will return without updating
+ // any textures if the uploader is busy. This shouldn't be a problem
+ // here as the throttled uploader isn't used in single thread mode.
+ // For correctness, loop until no more updates are pending.
+ while (updater.hasMoreUpdates())
+ updater.update(m_layerTreeHostImpl->context(), m_layerTreeHostImpl->contentsTextureAllocator(), m_layerTreeHostImpl->layerRenderer()->textureCopier(), m_layerTreeHostImpl->layerRenderer()->textureUploader(), maxPartialTextureUpdates());
+
m_layerTreeHostImpl->setVisible(m_layerTreeHost->visible());
m_layerTreeHost->finishCommitOnImplThread(m_layerTreeHostImpl.get());
@@ -325,8 +348,14 @@ bool CCSingleThreadProxy::doComposite()
DebugScopedSetImplThread impl;
double monotonicTime = monotonicallyIncreasingTime();
double wallClockTime = currentTime();
-
m_layerTreeHostImpl->animate(monotonicTime, wallClockTime);
+
+ // We guard prepareToDraw() with canDraw() because it always returns a valid frame, so can only
+ // be used when such a frame is possible. Since drawLayers() depends on the result of
+ // prepareToDraw(), it is guarded on canDraw() as well.
+ if (!m_layerTreeHostImpl->canDraw())
+ return false;
+
CCLayerTreeHostImpl::FrameData frame;
m_layerTreeHostImpl->prepareToDraw(frame);
m_layerTreeHostImpl->drawLayers(frame);
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCTextureUpdater.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCTextureUpdater.cpp
index e1743a8c9..ab56d1f37 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCTextureUpdater.cpp
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCTextureUpdater.cpp
@@ -92,31 +92,42 @@ bool CCTextureUpdater::hasMoreUpdates() const
return m_entries.size() || m_partialEntries.size() || m_copyEntries.size() || m_managedCopyEntries.size();
}
-bool CCTextureUpdater::update(GraphicsContext3D* context, TextureAllocator* allocator, TextureCopier* copier, TextureUploader* uploader, size_t count)
+void CCTextureUpdater::update(GraphicsContext3D* context, TextureAllocator* allocator, TextureCopier* copier, TextureUploader* uploader, size_t count)
{
size_t index;
- size_t maxIndex = min(m_entryIndex + count, m_entries.size());
- for (index = m_entryIndex; index < maxIndex; ++index) {
- UpdateEntry& entry = m_entries[index];
- uploader->uploadTexture(context, entry.texture, allocator, entry.sourceRect, entry.destRect);
- }
- bool moreUpdates = maxIndex < m_entries.size();
+ if (m_entries.size() || m_partialEntries.size()) {
+ if (uploader->isBusy())
+ return;
- ASSERT(m_partialEntries.size() <= count);
- // Make sure the number of updates including partial updates are not more
- // than |count|.
- if ((count - (index - m_entryIndex)) < m_partialEntries.size())
- moreUpdates = true;
+ uploader->beginUploads();
- if (moreUpdates) {
- m_entryIndex = index;
- return true;
- }
+ size_t maxIndex = min(m_entryIndex + count, m_entries.size());
+ for (index = m_entryIndex; index < maxIndex; ++index) {
+ UpdateEntry& entry = m_entries[index];
+ uploader->uploadTexture(context, entry.texture, allocator, entry.sourceRect, entry.destRect);
+ }
+
+ bool moreUploads = maxIndex < m_entries.size();
+
+ ASSERT(m_partialEntries.size() <= count);
+ // We need another update batch if the number of updates remaining
+ // in |count| is greater than the remaining partial entries.
+ if ((count - (index - m_entryIndex)) < m_partialEntries.size())
+ moreUploads = true;
+
+ if (moreUploads) {
+ m_entryIndex = index;
+ uploader->endUploads();
+ return;
+ }
+
+ for (index = 0; index < m_partialEntries.size(); ++index) {
+ UpdateEntry& entry = m_partialEntries[index];
+ uploader->uploadTexture(context, entry.texture, allocator, entry.sourceRect, entry.destRect);
+ }
- for (index = 0; index < m_partialEntries.size(); ++index) {
- UpdateEntry& entry = m_partialEntries[index];
- uploader->uploadTexture(context, entry.texture, allocator, entry.sourceRect, entry.destRect);
+ uploader->endUploads();
}
for (index = 0; index < m_copyEntries.size(); ++index) {
@@ -136,7 +147,6 @@ bool CCTextureUpdater::update(GraphicsContext3D* context, TextureAllocator* allo
// If no entries left to process, auto-clear.
clear();
- return false;
}
void CCTextureUpdater::clear()
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCTextureUpdater.h b/Source/WebCore/platform/graphics/chromium/cc/CCTextureUpdater.h
index 01508bfa2..24d896f2b 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCTextureUpdater.h
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCTextureUpdater.h
@@ -49,8 +49,8 @@ public:
bool hasMoreUpdates() const;
- // Update some textures. Returns true if more textures left to process.
- bool update(GraphicsContext3D*, TextureAllocator*, TextureCopier*, TextureUploader*, size_t count);
+ // Update some textures.
+ void update(GraphicsContext3D*, TextureAllocator*, TextureCopier*, TextureUploader*, size_t count);
void clear();
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.cpp
index eaf2f89a9..078490581 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.cpp
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.cpp
@@ -57,6 +57,25 @@ static const double contextRecreationTickRate = 0.03;
namespace WebCore {
+// FIXME: remove when ThrottledTextureUploader is ready to be used.
+class UnthrottledTextureUploader : public TextureUploader {
+ WTF_MAKE_NONCOPYABLE(UnthrottledTextureUploader);
+public:
+ static PassOwnPtr<UnthrottledTextureUploader> create(PassRefPtr<GraphicsContext3D> context)
+ {
+ return adoptPtr(new UnthrottledTextureUploader(context));
+ }
+ virtual ~UnthrottledTextureUploader() { }
+
+ virtual bool isBusy() { return false; }
+ virtual void beginUploads() { }
+ virtual void endUploads() { }
+ virtual void uploadTexture(GraphicsContext3D* context, LayerTextureUpdater::Texture* texture, TextureAllocator* allocator, const IntRect sourceRect, const IntRect destRect) { texture->updateRect(context, allocator, sourceRect, destRect); }
+
+protected:
+ explicit UnthrottledTextureUploader(PassRefPtr<GraphicsContext3D>) { }
+};
+
PassOwnPtr<CCProxy> CCThreadProxy::create(CCLayerTreeHost* layerTreeHost)
{
return adoptPtr(new CCThreadProxy(layerTreeHost));
@@ -620,8 +639,18 @@ CCScheduledActionDrawAndSwapResult CCThreadProxy::scheduledActionDrawAndSwapInte
m_inputHandlerOnImplThread->animate(monotonicTime);
m_layerTreeHostImpl->animate(monotonicTime, wallClockTime);
+
+ // This method is called on a forced draw, regardless of whether we are able to produce a frame,
+ // as the calling site on main thread is blocked until its request completes, and we signal
+ // completion here. If canDraw() is false, we will indicate success=false to the caller, but we
+ // must still signal completion to avoid deadlock.
+
+ // We guard prepareToDraw() with canDraw() because it always returns a valid frame, so can only
+ // be used when such a frame is possible. Since drawLayers() depends on the result of
+ // prepareToDraw(), it is guarded on canDraw() as well.
+
CCLayerTreeHostImpl::FrameData frame;
- bool drawFrame = m_layerTreeHostImpl->prepareToDraw(frame) || forcedDraw;
+ bool drawFrame = m_layerTreeHostImpl->canDraw() && (m_layerTreeHostImpl->prepareToDraw(frame) || forcedDraw);
if (drawFrame) {
m_layerTreeHostImpl->drawLayers(frame);
result.didDraw = true;
@@ -630,9 +659,11 @@ CCScheduledActionDrawAndSwapResult CCThreadProxy::scheduledActionDrawAndSwapInte
// Check for a pending compositeAndReadback.
if (m_readbackRequestOnImplThread) {
- ASSERT(drawFrame); // This should be a forcedDraw
- m_layerTreeHostImpl->readback(m_readbackRequestOnImplThread->pixels, m_readbackRequestOnImplThread->rect);
- m_readbackRequestOnImplThread->success = !m_layerTreeHostImpl->isContextLost();
+ m_readbackRequestOnImplThread->success = false;
+ if (drawFrame) {
+ m_layerTreeHostImpl->readback(m_readbackRequestOnImplThread->pixels, m_readbackRequestOnImplThread->rect);
+ m_readbackRequestOnImplThread->success = !m_layerTreeHostImpl->isContextLost();
+ }
m_readbackRequestOnImplThread->completion.signal();
m_readbackRequestOnImplThread = 0;
}
@@ -642,7 +673,6 @@ CCScheduledActionDrawAndSwapResult CCThreadProxy::scheduledActionDrawAndSwapInte
// Process any finish request
if (m_finishAllRenderingCompletionEventOnImplThread) {
- ASSERT(drawFrame); // This should be a forcedDraw
m_layerTreeHostImpl->finishAllRendering();
m_finishAllRenderingCompletionEventOnImplThread->signal();
m_finishAllRenderingCompletionEventOnImplThread = 0;
@@ -654,7 +684,6 @@ CCScheduledActionDrawAndSwapResult CCThreadProxy::scheduledActionDrawAndSwapInte
m_mainThreadProxy->postTask(createCCThreadTask(this, &CCThreadProxy::didCommitAndDrawFrame));
}
- ASSERT(drawFrame || (!drawFrame && !forcedDraw));
return result;
}
@@ -805,7 +834,8 @@ void CCThreadProxy::initializeLayerRendererOnImplThread(CCCompletionEvent* compl
TRACE_EVENT("CCThreadProxy::initializeLayerRendererOnImplThread", this, 0);
ASSERT(isImplThread());
ASSERT(m_contextBeforeInitializationOnImplThread);
- *initializeSucceeded = m_layerTreeHostImpl->initializeLayerRenderer(m_contextBeforeInitializationOnImplThread.release());
+ OwnPtr<TextureUploader> uploader = UnthrottledTextureUploader::create(m_contextBeforeInitializationOnImplThread.get());
+ *initializeSucceeded = m_layerTreeHostImpl->initializeLayerRenderer(m_contextBeforeInitializationOnImplThread.release(), uploader.release());
if (*initializeSucceeded) {
*capabilities = m_layerTreeHostImpl->layerRendererCapabilities();
if (capabilities->usingSwapCompleteCallback)
@@ -855,7 +885,8 @@ void CCThreadProxy::recreateContextOnImplThread(CCCompletionEvent* completion, G
TRACE_EVENT0("cc", "CCThreadProxy::recreateContextOnImplThread");
ASSERT(isImplThread());
m_layerTreeHost->deleteContentsTexturesOnImplThread(m_layerTreeHostImpl->contentsTextureAllocator());
- *recreateSucceeded = m_layerTreeHostImpl->initializeLayerRenderer(adoptRef(contextPtr));
+ OwnPtr<TextureUploader> uploader = UnthrottledTextureUploader::create(contextPtr);
+ *recreateSucceeded = m_layerTreeHostImpl->initializeLayerRenderer(adoptRef(contextPtr), uploader.release());
if (*recreateSucceeded) {
*capabilities = m_layerTreeHostImpl->layerRendererCapabilities();
m_schedulerOnImplThread->didRecreateContext();
diff --git a/Source/WebCore/platform/graphics/glx/GLContextGLX.cpp b/Source/WebCore/platform/graphics/glx/GLContextGLX.cpp
index 6062e4381..e0f3cdd17 100644
--- a/Source/WebCore/platform/graphics/glx/GLContextGLX.cpp
+++ b/Source/WebCore/platform/graphics/glx/GLContextGLX.cpp
@@ -240,8 +240,8 @@ GLContextGLX::~GLContextGLX()
// This may be necessary to prevent crashes with NVidia's closed source drivers. Originally
// from Mozilla's 3D canvas implementation at: http://bitbucket.org/ilmari/canvas3d/
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
- glXMakeCurrent(m_display, None, None);
- glXDestroyContext(m_display, m_context);
+ glXMakeCurrent(sharedDisplay(), None, None);
+ glXDestroyContext(sharedDisplay(), m_context);
}
if (m_pbuffer) {
diff --git a/Source/WebCore/platform/graphics/glx/GLContextGLX.h b/Source/WebCore/platform/graphics/glx/GLContextGLX.h
index 0a7a924f9..01a884f2c 100644
--- a/Source/WebCore/platform/graphics/glx/GLContextGLX.h
+++ b/Source/WebCore/platform/graphics/glx/GLContextGLX.h
@@ -63,7 +63,6 @@ private:
GLContextGLX(GLXContext, Pixmap, GLXPixmap);
GLXContext m_context;
- Display* m_display;
XID m_window;
GLXPbuffer m_pbuffer;
Pixmap m_pixmap;
diff --git a/Source/WebCore/platform/graphics/gpu/Texture.cpp b/Source/WebCore/platform/graphics/gpu/Texture.cpp
index 7c2b86e21..9ade3527d 100644
--- a/Source/WebCore/platform/graphics/gpu/Texture.cpp
+++ b/Source/WebCore/platform/graphics/gpu/Texture.cpp
@@ -50,7 +50,7 @@ namespace WebCore {
Texture::Texture(GraphicsContext3D* context, PassOwnPtr<Vector<unsigned int> > tileTextureIds, Format format, int width, int height, int maxTextureSize)
: m_context(context)
, m_format(format)
- , m_tiles(maxTextureSize, width, height, true)
+ , m_tiles(IntSize(maxTextureSize, maxTextureSize), IntSize(width, height), true)
, m_tileTextureIds(tileTextureIds)
{
}
@@ -89,12 +89,12 @@ PassRefPtr<Texture> Texture::create(GraphicsContext3D* context, Format format, i
{
int maxTextureSize = 0;
context->getIntegerv(GraphicsContext3D::MAX_TEXTURE_SIZE, &maxTextureSize);
- TilingData tiling(maxTextureSize, width, height, true);
+ TilingData tiling(IntSize(maxTextureSize, maxTextureSize), IntSize(width, height), true);
// Check for overflow.
int numTiles = tiling.numTilesX() * tiling.numTilesY();
if (numTiles / tiling.numTilesX() != tiling.numTilesY()) {
- tiling.setTotalSize(0, 0);
+ tiling.setTotalSize(IntSize());
numTiles = 0;
}
@@ -154,13 +154,13 @@ static uint32_t* copySubRect(uint32_t* src, int srcX, int srcY, uint32_t* dst, i
void Texture::load(void* pixels)
{
- updateSubRect(pixels, IntRect(0, 0, m_tiles.totalSizeX(), m_tiles.totalSizeY()));
+ updateSubRect(pixels, IntRect(0, 0, m_tiles.totalSize().width(), m_tiles.totalSize().height()));
}
void Texture::updateSubRect(void* pixels, const IntRect& updateRect)
{
IntRect updateRectSanitized(updateRect);
- updateRectSanitized.intersect(IntRect(0, 0, m_tiles.totalSizeX(), m_tiles.totalSizeY()));
+ updateRectSanitized.intersect(IntRect(0, 0, m_tiles.totalSize().width(), m_tiles.totalSize().height()));
uint32_t* pixels32 = static_cast<uint32_t*>(pixels);
unsigned int glFormat = 0;
@@ -172,8 +172,8 @@ void Texture::updateSubRect(void* pixels, const IntRect& updateRect)
// FIXME: This could use PBO's to save doing an extra copy here.
}
int tempBuffSize = // Temporary buffer size is the smaller of the max texture size or the updateRectSanitized
- min(m_tiles.maxTextureSize(), m_tiles.borderTexels() + updateRectSanitized.width()) *
- min(m_tiles.maxTextureSize(), m_tiles.borderTexels() + updateRectSanitized.height());
+ min(m_tiles.maxTextureSize().width(), m_tiles.borderTexels() + updateRectSanitized.width()) *
+ min(m_tiles.maxTextureSize().height(), m_tiles.borderTexels() + updateRectSanitized.height());
OwnArrayPtr<uint32_t> tempBuff = adoptArrayPtr(new uint32_t[tempBuffSize]);
for (int tile = 0; tile < m_tiles.numTilesX() * m_tiles.numTilesY(); tile++) {
@@ -197,11 +197,11 @@ void Texture::updateSubRect(void* pixels, const IntRect& updateRect)
if (swizzle) {
uploadBuff = copySubRect<true>(
pixels32, updateRectIntersected.x(), updateRectIntersected.y(),
- tempBuff.get(), updateRectIntersected.width(), updateRectIntersected.height(), m_tiles.totalSizeX());
+ tempBuff.get(), updateRectIntersected.width(), updateRectIntersected.height(), m_tiles.totalSize().width());
} else {
uploadBuff = copySubRect<false>(
pixels32, updateRectIntersected.x(), updateRectIntersected.y(),
- tempBuff.get(), updateRectIntersected.width(), updateRectIntersected.height(), m_tiles.totalSizeX());
+ tempBuff.get(), updateRectIntersected.width(), updateRectIntersected.height(), m_tiles.totalSize().width());
}
m_context->bindTexture(GraphicsContext3D::TEXTURE_2D, m_tileTextureIds->at(tile));
diff --git a/Source/WebCore/platform/graphics/gpu/TilingData.cpp b/Source/WebCore/platform/graphics/gpu/TilingData.cpp
index 6bad62844..8c230b362 100644
--- a/Source/WebCore/platform/graphics/gpu/TilingData.cpp
+++ b/Source/WebCore/platform/graphics/gpu/TilingData.cpp
@@ -51,23 +51,21 @@ static int computeNumTiles(int maxTextureSize, int totalSize, int borderTexels)
return totalSize > 0 ? numTiles : 0;
}
-TilingData::TilingData(int maxTextureSize, int totalSizeX, int totalSizeY, bool hasBorderTexels)
+TilingData::TilingData(const IntSize& maxTextureSize, const IntSize& totalSize, bool hasBorderTexels)
: m_maxTextureSize(maxTextureSize)
- , m_totalSizeX(totalSizeX)
- , m_totalSizeY(totalSizeY)
+ , m_totalSize(totalSize)
, m_borderTexels(hasBorderTexels ? 1 : 0)
{
recomputeNumTiles();
}
-void TilingData::setTotalSize(int totalSizeX, int totalSizeY)
+void TilingData::setTotalSize(const IntSize& totalSize)
{
- m_totalSizeX = totalSizeX;
- m_totalSizeY = totalSizeY;
+ m_totalSize = totalSize;
recomputeNumTiles();
}
-void TilingData::setMaxTextureSize(int maxTextureSize)
+void TilingData::setMaxTextureSize(const IntSize& maxTextureSize)
{
m_maxTextureSize = maxTextureSize;
recomputeNumTiles();
@@ -84,8 +82,8 @@ int TilingData::tileXIndexFromSrcCoord(int srcPos) const
if (numTilesX() <= 1)
return 0;
- ASSERT(m_maxTextureSize - 2 * m_borderTexels);
- int x = (srcPos - m_borderTexels) / (m_maxTextureSize - 2 * m_borderTexels);
+ ASSERT(m_maxTextureSize.width() - 2 * m_borderTexels);
+ int x = (srcPos - m_borderTexels) / (m_maxTextureSize.width() - 2 * m_borderTexels);
return min(max(x, 0), numTilesX() - 1);
}
@@ -94,8 +92,8 @@ int TilingData::tileYIndexFromSrcCoord(int srcPos) const
if (numTilesY() <= 1)
return 0;
- ASSERT(m_maxTextureSize - 2 * m_borderTexels);
- int y = (srcPos - m_borderTexels) / (m_maxTextureSize - 2 * m_borderTexels);
+ ASSERT(m_maxTextureSize.height() - 2 * m_borderTexels);
+ int y = (srcPos - m_borderTexels) / (m_maxTextureSize.height() - 2 * m_borderTexels);
return min(max(y, 0), numTilesY() - 1);
}
@@ -107,7 +105,7 @@ IntRect TilingData::tileBounds(int i, int j) const
int width = tileSizeX(i);
int height = tileSizeY(j);
ASSERT(x >= 0 && y >= 0 && width >= 0 && height >= 0);
- ASSERT(x <= totalSizeX() && y <= totalSizeY());
+ ASSERT(x <= m_totalSize.width() && y <= m_totalSize.height());
return IntRect(x, y, width, height);
}
@@ -136,14 +134,6 @@ IntRect TilingData::tileBoundsWithBorder(int i, int j) const
return bounds;
}
-FloatRect TilingData::tileBoundsNormalized(int i, int j) const
-{
- assertTile(i, j);
- FloatRect bounds(tileBounds(i, j));
- bounds.scale(1.0f / m_totalSizeX, 1.0f / m_totalSizeY);
- return bounds;
-}
-
int TilingData::tilePositionX(int xIndex) const
{
ASSERT(xIndex >= 0 && xIndex < numTilesX());
@@ -171,13 +161,13 @@ int TilingData::tileSizeX(int xIndex) const
ASSERT(xIndex >= 0 && xIndex < numTilesX());
if (!xIndex && m_numTilesX == 1)
- return m_totalSizeX;
+ return m_totalSize.width();
if (!xIndex && m_numTilesX > 1)
- return m_maxTextureSize - m_borderTexels;
+ return m_maxTextureSize.width() - m_borderTexels;
if (xIndex < numTilesX() - 1)
- return m_maxTextureSize - 2 * m_borderTexels;
+ return m_maxTextureSize.width() - 2 * m_borderTexels;
if (xIndex == numTilesX() - 1)
- return m_totalSizeX - tilePositionX(xIndex);
+ return m_totalSize.width() - tilePositionX(xIndex);
ASSERT_NOT_REACHED();
return 0;
@@ -188,32 +178,18 @@ int TilingData::tileSizeY(int yIndex) const
ASSERT(yIndex >= 0 && yIndex < numTilesY());
if (!yIndex && m_numTilesY == 1)
- return m_totalSizeY;
+ return m_totalSize.height();
if (!yIndex && m_numTilesY > 1)
- return m_maxTextureSize - m_borderTexels;
+ return m_maxTextureSize.height() - m_borderTexels;
if (yIndex < numTilesY() - 1)
- return m_maxTextureSize - 2 * m_borderTexels;
+ return m_maxTextureSize.height() - 2 * m_borderTexels;
if (yIndex == numTilesY() - 1)
- return m_totalSizeY - tilePositionY(yIndex);
+ return m_totalSize.height() - tilePositionY(yIndex);
ASSERT_NOT_REACHED();
return 0;
}
-IntRect TilingData::overlappedTileIndices(const WebCore::IntRect &srcRect) const
-{
- int x = tileXIndexFromSrcCoord(srcRect.x());
- int y = tileYIndexFromSrcCoord(srcRect.y());
- int r = tileXIndexFromSrcCoord(srcRect.maxX());
- int b = tileYIndexFromSrcCoord(srcRect.maxY());
- return IntRect(x, y, r - x, b - y);
-}
-
-IntRect TilingData::overlappedTileIndices(const WebCore::FloatRect &srcRect) const
-{
- return overlappedTileIndices(enclosingIntRect(srcRect));
-}
-
IntPoint TilingData::textureOffset(int xIndex, int yIndex) const
{
int left = (!xIndex || m_numTilesX == 1) ? 0 : m_borderTexels;
@@ -224,8 +200,8 @@ IntPoint TilingData::textureOffset(int xIndex, int yIndex) const
void TilingData::recomputeNumTiles()
{
- m_numTilesX = computeNumTiles(m_maxTextureSize, m_totalSizeX, m_borderTexels);
- m_numTilesY = computeNumTiles(m_maxTextureSize, m_totalSizeY, m_borderTexels);
+ m_numTilesX = computeNumTiles(m_maxTextureSize.width(), m_totalSize.width(), m_borderTexels);
+ m_numTilesY = computeNumTiles(m_maxTextureSize.height(), m_totalSize.height(), m_borderTexels);
}
}
diff --git a/Source/WebCore/platform/graphics/gpu/TilingData.h b/Source/WebCore/platform/graphics/gpu/TilingData.h
index 146dfe19b..c5bfe8e97 100644
--- a/Source/WebCore/platform/graphics/gpu/TilingData.h
+++ b/Source/WebCore/platform/graphics/gpu/TilingData.h
@@ -31,6 +31,7 @@
#ifndef TilingData_h
#define TilingData_h
+#include "IntSize.h"
#include <wtf/Noncopyable.h>
namespace WebCore {
@@ -41,12 +42,12 @@ class IntPoint;
class TilingData {
public:
- TilingData(int maxTextureSize, int totalSizeX, int totalSizeY, bool hasBorderTexels);
- void setTotalSize(int totalSizeX, int totalSizeY);
- void setMaxTextureSize(int);
- int maxTextureSize() const { return m_maxTextureSize; }
- int totalSizeX() const { return m_totalSizeX; }
- int totalSizeY() const { return m_totalSizeY; }
+ TilingData(const IntSize& maxTextureSize, const IntSize& totalSize, bool hasBorderTexels);
+
+ void setTotalSize(const IntSize&);
+ const IntSize& totalSize() const { return m_totalSize; }
+ void setMaxTextureSize(const IntSize&);
+ const IntSize& maxTextureSize() const { return m_maxTextureSize; }
void setHasBorderTexels(bool);
int borderTexels() const { return m_borderTexels; }
@@ -58,25 +59,21 @@ public:
IntRect tileBounds(int, int) const;
IntRect tileBoundsWithBorder(int, int) const;
- FloatRect tileBoundsNormalized(int, int) const;
int tilePositionX(int xIndex) const;
int tilePositionY(int yIndex) const;
int tileSizeX(int xIndex) const;
int tileSizeY(int yIndex) const;
- IntRect overlappedTileIndices(const IntRect& srcRect) const;
- IntRect overlappedTileIndices(const FloatRect& srcRect) const;
// Difference between tileBound's and tileBoundWithBorder's location().
IntPoint textureOffset(int xIndex, int yIndex) const;
private:
- TilingData() : m_maxTextureSize(0), m_totalSizeX(0), m_totalSizeY(0) {}
+ TilingData() : m_borderTexels(0) { }
void assertTile(int i, int j) const { ASSERT_UNUSED(i, i >= 0 && i < numTilesX()); ASSERT_UNUSED(j, j >= 0 && j < numTilesY()); }
void recomputeNumTiles();
- int m_maxTextureSize;
- int m_totalSizeX;
- int m_totalSizeY;
+ IntSize m_maxTextureSize;
+ IntSize m_totalSize;
int m_borderTexels; // 0 or 1
// computed values:
diff --git a/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp b/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp
index d0993c25c..62f53536a 100644
--- a/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp
+++ b/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp
@@ -1368,8 +1368,6 @@ void MediaPlayerPrivateGStreamer::didEnd()
m_isEndReached = true;
- gst_element_set_state(m_playBin, GST_STATE_PAUSED);
-
timeChanged();
}
diff --git a/Source/WebCore/platform/graphics/mac/ComplexTextController.cpp b/Source/WebCore/platform/graphics/mac/ComplexTextController.cpp
index 715f6fec4..6614adbde 100644
--- a/Source/WebCore/platform/graphics/mac/ComplexTextController.cpp
+++ b/Source/WebCore/platform/graphics/mac/ComplexTextController.cpp
@@ -516,10 +516,9 @@ void ComplexTextController::adjustGlyphsAndAdvances()
CGGlyph glyph = treatAsSpace ? fontData->spaceGlyph() : glyphs[i];
CGSize advance = treatAsSpace ? CGSizeMake(spaceWidth, advances[i].height) : advances[i];
- if (ch == '\t' && m_run.allowTabs()) {
- float tabWidth = m_font.tabWidth(*fontData);
- advance.width = tabWidth - fmodf(m_run.xPos() + m_totalWidth + widthSinceLastCommit, tabWidth);
- } else if (Font::treatAsZeroWidthSpace(ch) && !treatAsSpace) {
+ if (ch == '\t' && m_run.allowTabs())
+ advance.width = m_font.tabWidth(*fontData, m_run.tabSize(), m_run.xPos() + m_totalWidth + widthSinceLastCommit);
+ else if (Font::treatAsZeroWidthSpace(ch) && !treatAsSpace) {
advance.width = 0;
glyph = fontData->spaceGlyph();
}
diff --git a/Source/WebCore/platform/graphics/mac/DisplayRefreshMonitorMac.cpp b/Source/WebCore/platform/graphics/mac/DisplayRefreshMonitorMac.cpp
index 0546f34b5..edf630892 100644
--- a/Source/WebCore/platform/graphics/mac/DisplayRefreshMonitorMac.cpp
+++ b/Source/WebCore/platform/graphics/mac/DisplayRefreshMonitorMac.cpp
@@ -45,7 +45,7 @@ static CVReturn displayLinkCallback(CVDisplayLinkRef, const CVTimeStamp* now, co
return kCVReturnSuccess;
}
-
+
DisplayRefreshMonitor::~DisplayRefreshMonitor()
{
if (m_displayLink) {
@@ -61,7 +61,7 @@ bool DisplayRefreshMonitor::requestRefreshCallback()
{
if (!m_active)
return false;
-
+
if (!m_displayLink) {
m_active = false;
CVReturn error = CVDisplayLinkCreateWithCGDisplay(m_displayID, &m_displayLink);
@@ -78,7 +78,7 @@ bool DisplayRefreshMonitor::requestRefreshCallback()
m_active = true;
}
-
+
MutexLocker lock(m_mutex);
m_scheduled = true;
return true;
@@ -92,11 +92,9 @@ void DisplayRefreshMonitor::displayLinkFired(double nowSeconds, double outputTim
m_previousFrameDone = false;
- double webKitMonotonicNow = monotonicallyIncreasingTime();
- double timeUntilOutput = outputTimeSeconds - nowSeconds;
- // FIXME: Should this be using webKitMonotonicNow?
- m_monotonicAnimationStartTime = webKitMonotonicNow + timeUntilOutput;
-
+ double webKitNow = currentTime();
+ m_timestamp = webKitNow - nowSeconds + outputTimeSeconds;
+
callOnMainThread(refreshDisplayOnMainThread, this);
}
diff --git a/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.cpp b/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.cpp
index 4b996e98d..84a6601f2 100644
--- a/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.cpp
+++ b/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.cpp
@@ -122,15 +122,7 @@ void TextureMapperLayer::updateBackingStore(TextureMapper* textureMapper, Graphi
context->translate(-dirtyRect.x(), -dirtyRect.y());
layer->paintGraphicsLayerContents(*context, dirtyRect);
- RefPtr<Image> image;
-
-#if PLATFORM(QT)
- image = imageBuffer->copyImage(DontCopyBackingStore);
-#else
- // FIXME: support DontCopyBackingStore in non-Qt ports that use TextureMapper.
- image = imageBuffer->copyImage(CopyBackingStore);
-#endif
-
+ RefPtr<Image> image = imageBuffer->copyImage(DontCopyBackingStore);
static_cast<TextureMapperTiledBackingStore*>(m_backingStore.get())->updateContents(textureMapper, image.get(), m_size, dirtyRect);
m_state.needsDisplay = false;
m_state.needsDisplayRect = IntRect();
diff --git a/Source/WebCore/platform/graphics/transforms/TransformationMatrix.cpp b/Source/WebCore/platform/graphics/transforms/TransformationMatrix.cpp
index 24d960fe3..b91ca1164 100644
--- a/Source/WebCore/platform/graphics/transforms/TransformationMatrix.cpp
+++ b/Source/WebCore/platform/graphics/transforms/TransformationMatrix.cpp
@@ -551,6 +551,12 @@ FloatPoint TransformationMatrix::projectPoint(const FloatPoint& p, bool* clamped
// d = -dot (Pn', R0) / dot (Pn', Rd)
if (clamped)
*clamped = false;
+
+ if (m33() == 0) {
+ // In this case, the projection plane is parallel to the ray we are trying to
+ // trace, and there is no well-defined value for the projection.
+ return FloatPoint();
+ }
double x = p.x();
double y = p.y();
@@ -562,8 +568,12 @@ FloatPoint TransformationMatrix::projectPoint(const FloatPoint& p, bool* clamped
double w = x * m14() + y * m24() + z * m34() + m44();
if (w <= 0) {
- outX = copysign(numeric_limits<int>::max(), outX);
- outY = copysign(numeric_limits<int>::max(), outY);
+ // Using int max causes overflow when other code uses the projected point. To
+ // represent infinity yet reduce the risk of overflow, we use a large but
+ // not-too-large number here when clamping.
+ const int kLargeNumber = 100000000;
+ outX = copysign(kLargeNumber, outX);
+ outY = copysign(kLargeNumber, outY);
if (clamped)
*clamped = true;
} else if (w != 1) {
@@ -577,11 +587,22 @@ FloatPoint TransformationMatrix::projectPoint(const FloatPoint& p, bool* clamped
FloatQuad TransformationMatrix::projectQuad(const FloatQuad& q) const
{
FloatQuad projectedQuad;
- projectedQuad.setP1(projectPoint(q.p1()));
- projectedQuad.setP2(projectPoint(q.p2()));
- projectedQuad.setP3(projectPoint(q.p3()));
- projectedQuad.setP4(projectPoint(q.p4()));
-
+
+ bool clamped1 = false;
+ bool clamped2 = false;
+ bool clamped3 = false;
+ bool clamped4 = false;
+
+ projectedQuad.setP1(projectPoint(q.p1(), &clamped1));
+ projectedQuad.setP2(projectPoint(q.p2(), &clamped2));
+ projectedQuad.setP3(projectPoint(q.p3(), &clamped3));
+ projectedQuad.setP4(projectPoint(q.p4(), &clamped4));
+
+ // If all points on the quad had w < 0, then the entire quad would not be visible to the projected surface.
+ bool everythingWasClipped = clamped1 && clamped2 && clamped3 && clamped4;
+ if (everythingWasClipped)
+ return FloatQuad();
+
return projectedQuad;
}
diff --git a/Source/WebCore/platform/gtk/AsyncFileSystemGtk.cpp b/Source/WebCore/platform/gtk/AsyncFileSystemGtk.cpp
index 6b018843f..aa60ba456 100644
--- a/Source/WebCore/platform/gtk/AsyncFileSystemGtk.cpp
+++ b/Source/WebCore/platform/gtk/AsyncFileSystemGtk.cpp
@@ -35,31 +35,18 @@ bool AsyncFileSystem::isAvailable()
return false;
}
-bool AsyncFileSystem::isValidType(FileSystemType type)
+PassOwnPtr<AsyncFileSystem> AsyncFileSystem::create()
{
- notImplemented();
- return false;
+ return adoptPtr(new AsyncFileSystemGtk());
}
-PassOwnPtr<AsyncFileSystem> AsyncFileSystem::create(FileSystemType type)
-{
- return adoptPtr(new AsyncFileSystemGtk(type));
-}
-
-void AsyncFileSystem::openFileSystem(const String& basePath, const String& storageIdentifier, FileSystemType type, bool, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
+void AsyncFileSystem::openFileSystem(const KURL& basePath, const String& storageIdentifier, bool, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
{
notImplemented();
callbacks->didFail(NOT_SUPPORTED_ERR);
}
-bool AsyncFileSystem::crackFileSystemURL(const KURL& url, FileSystemType& type, String& filePath)
-{
- notImplemented();
- return false;
-}
-
-AsyncFileSystemGtk::AsyncFileSystemGtk(FileSystemType type)
- : AsyncFileSystem(type)
+AsyncFileSystemGtk::AsyncFileSystemGtk()
{
notImplemented();
}
@@ -69,64 +56,58 @@ AsyncFileSystemGtk::~AsyncFileSystemGtk()
notImplemented();
}
-KURL AsyncFileSystemGtk::toURL(const String& originString, const String& fullPath) const
-{
- notImplemented();
- return KURL();
-}
-
-void AsyncFileSystemGtk::move(const String& sourcePath, const String& destinationPath, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
+void AsyncFileSystemGtk::move(const KURL& sourcePath, const KURL& destinationPath, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
{
notImplemented();
}
-void AsyncFileSystemGtk::copy(const String& sourcePath, const String& destinationPath, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
+void AsyncFileSystemGtk::copy(const KURL& sourcePath, const KURL& destinationPath, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
{
notImplemented();
}
-void AsyncFileSystemGtk::remove(const String& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
+void AsyncFileSystemGtk::remove(const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
{
notImplemented();
}
-void AsyncFileSystemGtk::removeRecursively(const String& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
+void AsyncFileSystemGtk::removeRecursively(const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
{
notImplemented();
}
-void AsyncFileSystemGtk::readMetadata(const String& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
+void AsyncFileSystemGtk::readMetadata(const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
{
notImplemented();
}
-void AsyncFileSystemGtk::createFile(const String& path, bool exclusive, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
+void AsyncFileSystemGtk::createFile(const KURL& path, bool exclusive, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
{
notImplemented();
}
-void AsyncFileSystemGtk::createDirectory(const String& path, bool exclusive, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
+void AsyncFileSystemGtk::createDirectory(const KURL& path, bool exclusive, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
{
notImplemented();
}
-void AsyncFileSystemGtk::fileExists(const String& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
+void AsyncFileSystemGtk::fileExists(const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
{
notImplemented();
}
-void AsyncFileSystemGtk::directoryExists(const String& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
+void AsyncFileSystemGtk::directoryExists(const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
{
notImplemented();
}
-void AsyncFileSystemGtk::readDirectory(const String& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
+void AsyncFileSystemGtk::readDirectory(const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
{
notImplemented();
}
-void AsyncFileSystemGtk::createWriter(AsyncFileWriterClient* client, const String& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
+void AsyncFileSystemGtk::createWriter(AsyncFileWriterClient* client, const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
{
notImplemented();
}
diff --git a/Source/WebCore/platform/gtk/AsyncFileSystemGtk.h b/Source/WebCore/platform/gtk/AsyncFileSystemGtk.h
index 0bda3674f..39f573708 100644
--- a/Source/WebCore/platform/gtk/AsyncFileSystemGtk.h
+++ b/Source/WebCore/platform/gtk/AsyncFileSystemGtk.h
@@ -31,21 +31,20 @@ class AsyncFileSystemCallbacks;
class AsyncFileSystemGtk : public AsyncFileSystem {
public:
- AsyncFileSystemGtk(FileSystemType);
+ AsyncFileSystemGtk();
virtual ~AsyncFileSystemGtk();
- virtual KURL toURL(const String& originString, const String& fullPath) const;
- virtual void move(const String& sourcePath, const String& destinationPath, PassOwnPtr<AsyncFileSystemCallbacks>);
- virtual void copy(const String& sourcePath, const String& destinationPath, PassOwnPtr<AsyncFileSystemCallbacks>);
- virtual void remove(const String& path, PassOwnPtr<AsyncFileSystemCallbacks>);
- virtual void removeRecursively(const String& path, PassOwnPtr<AsyncFileSystemCallbacks>);
- virtual void readMetadata(const String& path, PassOwnPtr<AsyncFileSystemCallbacks>);
- virtual void createFile(const String& path, bool exclusive, PassOwnPtr<AsyncFileSystemCallbacks>);
- virtual void createDirectory(const String& path, bool exclusive, PassOwnPtr<AsyncFileSystemCallbacks>);
- virtual void fileExists(const String& path, PassOwnPtr<AsyncFileSystemCallbacks>);
- virtual void directoryExists(const String& path, PassOwnPtr<AsyncFileSystemCallbacks>);
- virtual void readDirectory(const String& path, PassOwnPtr<AsyncFileSystemCallbacks>);
- virtual void createWriter(AsyncFileWriterClient*, const String& path, PassOwnPtr<AsyncFileSystemCallbacks>);
+ virtual void move(const KURL& sourcePath, const KURL& destinationPath, PassOwnPtr<AsyncFileSystemCallbacks>);
+ virtual void copy(const KURL& sourcePath, const KURL& destinationPath, PassOwnPtr<AsyncFileSystemCallbacks>);
+ virtual void remove(const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks>);
+ virtual void removeRecursively(const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks>);
+ virtual void readMetadata(const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks>);
+ virtual void createFile(const KURL& path, bool exclusive, PassOwnPtr<AsyncFileSystemCallbacks>);
+ virtual void createDirectory(const KURL& path, bool exclusive, PassOwnPtr<AsyncFileSystemCallbacks>);
+ virtual void fileExists(const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks>);
+ virtual void directoryExists(const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks>);
+ virtual void readDirectory(const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks>);
+ virtual void createWriter(AsyncFileWriterClient*, const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks>);
};
} // namespace WebCore
diff --git a/Source/WebCore/platform/gtk/LocalizedStringsGtk.cpp b/Source/WebCore/platform/gtk/LocalizedStringsGtk.cpp
index 824938e09..4bb2ce086 100644
--- a/Source/WebCore/platform/gtk/LocalizedStringsGtk.cpp
+++ b/Source/WebCore/platform/gtk/LocalizedStringsGtk.cpp
@@ -473,6 +473,12 @@ String crashedPluginText()
return String::fromUTF8(_("Plug-in Failure"));
}
+String insecurePluginVersionText()
+{
+ notImplemented();
+ return String();
+}
+
String multipleFileUploadText(unsigned numberOfFiles)
{
// FIXME: If this file gets localized, this should really be localized as one string with a wildcard for the number.
diff --git a/Source/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.cpp b/Source/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.cpp
index fb867532b..bf3998bf8 100644
--- a/Source/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.cpp
+++ b/Source/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.cpp
@@ -70,7 +70,6 @@ extern "C" {
#endif
#if defined(JCS_ALPHA_EXTENSIONS) && ASSUME_LITTLE_ENDIAN
-inline J_DCT_METHOD dctMethod() { return JDCT_IFAST; }
#define TURBO_JPEG_RGB_SWIZZLE
#if USE(SKIA) && (!SK_R32_SHIFT && SK_G32_SHIFT == 8 && SK_B32_SHIFT == 16)
inline J_COLOR_SPACE rgbOutputColorSpace() { return JCS_EXT_RGBA; }
@@ -79,14 +78,15 @@ inline J_COLOR_SPACE rgbOutputColorSpace() { return JCS_EXT_BGRA; }
#endif
inline bool turboSwizzled(J_COLOR_SPACE colorSpace) { return colorSpace == rgbOutputColorSpace(); }
#else
-inline J_DCT_METHOD dctMethod() { return JDCT_ISLOW; }
inline J_COLOR_SPACE rgbOutputColorSpace() { return JCS_RGB; }
#endif
#if OS(ANDROID)
+inline J_DCT_METHOD dctMethod() { return JDCT_IFAST; }
inline J_DITHER_MODE ditherMode() { return JDITHER_NONE; }
inline bool doFancyUpsampling() { return false; }
#else
+inline J_DCT_METHOD dctMethod() { return JDCT_ISLOW; }
inline J_DITHER_MODE ditherMode() { return JDITHER_FS; }
inline bool doFancyUpsampling() { return true; }
#endif
diff --git a/Source/WebCore/platform/mac/SoftLinking.h b/Source/WebCore/platform/mac/SoftLinking.h
index a102ae538..7aef20f9e 100644
--- a/Source/WebCore/platform/mac/SoftLinking.h
+++ b/Source/WebCore/platform/mac/SoftLinking.h
@@ -52,13 +52,13 @@
return frameworkLibrary; \
}
-#define SOFT_LINK_STAGED_FRAMEWORK_OPTIONAL(framework, unstagedLocation) \
+#define SOFT_LINK_STAGED_FRAMEWORK_OPTIONAL(framework, unstagedLocation, version) \
static void* framework##Library() \
{ \
static void* frameworkLibrary = ^{ \
- void* result = dlopen("/System/Library/" #unstagedLocation "/" #framework ".framework/" #framework, RTLD_LAZY); \
+ void* result = dlopen("/System/Library/" #unstagedLocation "/" #framework ".framework/Versions/" #version "/" #framework, RTLD_LAZY); \
if (!result) \
- result = dlopen("/System/Library/StagedFrameworks/Safari/" #framework ".framework/" #framework, RTLD_LAZY); \
+ result = dlopen("/System/Library/StagedFrameworks/Safari/" #framework ".framework/Versions/" #version "/" #framework, RTLD_LAZY); \
return result; \
}(); \
return frameworkLibrary; \
diff --git a/Source/WebCore/platform/mac/WebCoreSystemInterface.h b/Source/WebCore/platform/mac/WebCoreSystemInterface.h
index 12efb9848..dd16fa182 100644
--- a/Source/WebCore/platform/mac/WebCoreSystemInterface.h
+++ b/Source/WebCore/platform/mac/WebCoreSystemInterface.h
@@ -312,6 +312,10 @@ extern bool (*wkExecutableWasLinkedOnOrBeforeLion)(void);
extern void (*wkCGPathAddRoundedRect)(CGMutablePathRef path, const CGAffineTransform* matrix, CGRect rect, CGFloat cornerWidth, CGFloat cornerHeight);
#endif
+#if !defined(BUILDING_ON_SNOW_LEOPARD)
+extern void (*wkCFURLRequestAllowAllPostCaching)(CFURLRequestRef);
+#endif
+
#if !defined(BUILDING_ON_SNOW_LEOPARD) && !defined(BUILDING_ON_LION) && !PLATFORM(IOS)
extern BOOL (*wkFilterIsManagedSession)(void);
extern WebFilterEvaluator *(*wkFilterCreateInstance)(NSURLResponse *);
diff --git a/Source/WebCore/platform/mac/WebCoreSystemInterface.mm b/Source/WebCore/platform/mac/WebCoreSystemInterface.mm
index 2cd6af2d3..439a2f24f 100644
--- a/Source/WebCore/platform/mac/WebCoreSystemInterface.mm
+++ b/Source/WebCore/platform/mac/WebCoreSystemInterface.mm
@@ -191,6 +191,10 @@ bool (*wkExecutableWasLinkedOnOrBeforeLion)(void);
void (*wkCGPathAddRoundedRect)(CGMutablePathRef path, const CGAffineTransform* matrix, CGRect rect, CGFloat cornerWidth, CGFloat cornerHeight);
#endif
+#if !defined(BUILDING_ON_SNOW_LEOPARD)
+void (*wkCFURLRequestAllowAllPostCaching)(CFURLRequestRef);
+#endif
+
#if !defined(BUILDING_ON_SNOW_LEOPARD) && !defined(BUILDING_ON_LION) && !PLATFORM(IOS)
BOOL (*wkFilterIsManagedSession)(void);
WebFilterEvaluator *(*wkFilterCreateInstance)(NSURLResponse *);
diff --git a/Source/WebCore/platform/mediastream/MediaStreamCenter.h b/Source/WebCore/platform/mediastream/MediaStreamCenter.h
index 76a8b556e..b3278c734 100644
--- a/Source/WebCore/platform/mediastream/MediaStreamCenter.h
+++ b/Source/WebCore/platform/mediastream/MediaStreamCenter.h
@@ -58,7 +58,7 @@ public:
// Calls from the DOM objects to notify the platform
virtual void didSetMediaStreamTrackEnabled(MediaStreamDescriptor*, MediaStreamComponent*) = 0;
virtual void didStopLocalMediaStream(MediaStreamDescriptor*) = 0;
- virtual void didConstructMediaStream(MediaStreamDescriptor*) = 0;
+ virtual void didCreateMediaStream(MediaStreamDescriptor*) = 0;
virtual String constructSDP(IceCandidateDescriptor*) = 0;
virtual String constructSDP(SessionDescriptionDescriptor*) = 0;
diff --git a/Source/WebCore/platform/mediastream/MediaStreamDescriptor.h b/Source/WebCore/platform/mediastream/MediaStreamDescriptor.h
index b3b273fa7..46332af31 100644
--- a/Source/WebCore/platform/mediastream/MediaStreamDescriptor.h
+++ b/Source/WebCore/platform/mediastream/MediaStreamDescriptor.h
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2011 Ericsson AB. 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
@@ -48,6 +49,11 @@ public:
class MediaStreamDescriptor : public RefCounted<MediaStreamDescriptor> {
public:
+ class ExtraData : public RefCounted<ExtraData> {
+ public:
+ virtual ~ExtraData() { }
+ };
+
static PassRefPtr<MediaStreamDescriptor> create(const String& label, const MediaStreamSourceVector& audioSources, const MediaStreamSourceVector& videoSources)
{
return adoptRef(new MediaStreamDescriptor(label, audioSources, videoSources));
@@ -67,6 +73,9 @@ public:
bool ended() const { return m_ended; }
void setEnded() { m_ended = true; }
+ PassRefPtr<ExtraData> extraData() const { return m_extraData; }
+ void setExtraData(PassRefPtr<ExtraData> extraData) { m_extraData = extraData; }
+
private:
MediaStreamDescriptor(const String& label, const MediaStreamSourceVector& audioSources, const MediaStreamSourceVector& videoSources)
: m_owner(0)
@@ -85,6 +94,8 @@ private:
Vector<RefPtr<MediaStreamComponent> > m_audioComponents;
Vector<RefPtr<MediaStreamComponent> > m_videoComponents;
bool m_ended;
+
+ RefPtr<ExtraData> m_extraData;
};
typedef Vector<RefPtr<MediaStreamDescriptor> > MediaStreamDescriptorVector;
diff --git a/Source/WebCore/platform/mediastream/chromium/MediaStreamCenterChromium.cpp b/Source/WebCore/platform/mediastream/chromium/MediaStreamCenterChromium.cpp
index 152d392bf..1317d2d83 100644
--- a/Source/WebCore/platform/mediastream/chromium/MediaStreamCenterChromium.cpp
+++ b/Source/WebCore/platform/mediastream/chromium/MediaStreamCenterChromium.cpp
@@ -89,10 +89,15 @@ void MediaStreamCenterChromium::didStopLocalMediaStream(MediaStreamDescriptor* s
m_private->didStopLocalMediaStream(stream);
}
-void MediaStreamCenterChromium::didConstructMediaStream(MediaStreamDescriptor* stream)
+void MediaStreamCenterChromium::didCreateMediaStream(MediaStreamDescriptor* stream)
{
- if (m_private)
+ if (m_private) {
+ // FIXME: Remove when Chromium have switched to the new API.
m_private->didConstructMediaStream(stream);
+
+ WebKit::WebMediaStreamDescriptor webStream(stream);
+ m_private->didCreateMediaStream(webStream);
+ }
}
String MediaStreamCenterChromium::constructSDP(IceCandidateDescriptor* iceCandidate)
diff --git a/Source/WebCore/platform/mediastream/chromium/MediaStreamCenterChromium.h b/Source/WebCore/platform/mediastream/chromium/MediaStreamCenterChromium.h
index ec858d149..d284a86fa 100644
--- a/Source/WebCore/platform/mediastream/chromium/MediaStreamCenterChromium.h
+++ b/Source/WebCore/platform/mediastream/chromium/MediaStreamCenterChromium.h
@@ -62,7 +62,7 @@ public:
virtual void queryMediaStreamSources(PassRefPtr<MediaStreamSourcesQueryClient>) OVERRIDE;
virtual void didSetMediaStreamTrackEnabled(MediaStreamDescriptor*, MediaStreamComponent*) OVERRIDE;
virtual void didStopLocalMediaStream(MediaStreamDescriptor*) OVERRIDE;
- virtual void didConstructMediaStream(MediaStreamDescriptor*) OVERRIDE;
+ virtual void didCreateMediaStream(MediaStreamDescriptor*) OVERRIDE;
virtual String constructSDP(IceCandidateDescriptor*) OVERRIDE;
virtual String constructSDP(SessionDescriptionDescriptor*) OVERRIDE;
diff --git a/Source/WebCore/platform/mediastream/gstreamer/MediaStreamCenterGStreamer.cpp b/Source/WebCore/platform/mediastream/gstreamer/MediaStreamCenterGStreamer.cpp
index 8836f57c3..fe8bb460d 100644
--- a/Source/WebCore/platform/mediastream/gstreamer/MediaStreamCenterGStreamer.cpp
+++ b/Source/WebCore/platform/mediastream/gstreamer/MediaStreamCenterGStreamer.cpp
@@ -72,7 +72,7 @@ void MediaStreamCenterGStreamer::didStopLocalMediaStream(MediaStreamDescriptor*)
{
}
-void MediaStreamCenterGStreamer::didConstructMediaStream(MediaStreamDescriptor*)
+void MediaStreamCenterGStreamer::didCreateMediaStream(MediaStreamDescriptor*)
{
}
diff --git a/Source/WebCore/platform/mediastream/gstreamer/MediaStreamCenterGStreamer.h b/Source/WebCore/platform/mediastream/gstreamer/MediaStreamCenterGStreamer.h
index c17e55886..1564e33bd 100644
--- a/Source/WebCore/platform/mediastream/gstreamer/MediaStreamCenterGStreamer.h
+++ b/Source/WebCore/platform/mediastream/gstreamer/MediaStreamCenterGStreamer.h
@@ -56,7 +56,7 @@ public:
virtual void queryMediaStreamSources(PassRefPtr<MediaStreamSourcesQueryClient>) OVERRIDE;
virtual void didSetMediaStreamTrackEnabled(MediaStreamDescriptor*, MediaStreamComponent*) OVERRIDE;
virtual void didStopLocalMediaStream(MediaStreamDescriptor*) OVERRIDE;
- virtual void didConstructMediaStream(MediaStreamDescriptor*) OVERRIDE;
+ virtual void didCreateMediaStream(MediaStreamDescriptor*) OVERRIDE;
virtual String constructSDP(IceCandidateDescriptor*) OVERRIDE;
virtual String constructSDP(SessionDescriptionDescriptor*) OVERRIDE;
};
diff --git a/Source/WebCore/platform/network/CredentialStorage.cpp b/Source/WebCore/platform/network/CredentialStorage.cpp
index f0984f885..f624d4fcb 100644
--- a/Source/WebCore/platform/network/CredentialStorage.cpp
+++ b/Source/WebCore/platform/network/CredentialStorage.cpp
@@ -159,4 +159,10 @@ Credential CredentialStorage::get(const KURL& url)
return protectionSpaceToCredentialMap().get(iter->second);
}
+void CredentialStorage::setPrivateMode(bool mode)
+{
+ if (!mode)
+ protectionSpaceToCredentialMap().clear();
+}
+
} // namespace WebCore
diff --git a/Source/WebCore/platform/network/CredentialStorage.h b/Source/WebCore/platform/network/CredentialStorage.h
index d11384df5..49af45251 100644
--- a/Source/WebCore/platform/network/CredentialStorage.h
+++ b/Source/WebCore/platform/network/CredentialStorage.h
@@ -46,6 +46,8 @@ public:
// a client should assume that all paths at or deeper than the depth of a known protected resource share are within the same protection space.
static bool set(const Credential&, const KURL&); // Returns true if the URL corresponds to a known protection space, so credentials could be updated.
static Credential get(const KURL&);
+
+ static void setPrivateMode(bool);
};
} // namespace WebCore
diff --git a/Source/WebCore/platform/network/blackberry/NetworkJob.cpp b/Source/WebCore/platform/network/blackberry/NetworkJob.cpp
index 6de5e4dbd..8354b10c1 100644
--- a/Source/WebCore/platform/network/blackberry/NetworkJob.cpp
+++ b/Source/WebCore/platform/network/blackberry/NetworkJob.cpp
@@ -20,7 +20,6 @@
#include "NetworkJob.h"
#include "AboutData.h"
-#include "Base64.h"
#include "Chrome.h"
#include "ChromeClient.h"
#include "CookieManager.h"
@@ -41,10 +40,9 @@
#include <BlackBerryPlatformLog.h>
#include <BlackBerryPlatformWebKitCredits.h>
#include <BuildInformation.h>
+#include <LocalizeResource.h>
#include <network/MultipartStream.h>
-#include <network/NetworkRequest.h>
#include <network/NetworkStreamFactory.h>
-#include <wtf/ASCIICType.h>
namespace WebCore {
@@ -65,39 +63,12 @@ inline static bool isUnauthorized(int statusCode)
return statusCode == 401;
}
-static void escapeDecode(const char* src, int length, Vector<char>& out)
-{
- out.resize(length);
- const char* const srcEnd = src + length;
- char* dst = out.data();
- for (; src < srcEnd; ) {
- char inputChar = *src++;
- if (inputChar == '%' && src + 2 <= srcEnd) {
- int digit1 = 0;
- char character = *src++;
- if (isASCIIHexDigit(character))
- digit1 = toASCIIHexValue(character);
-
- int digit2 = 0;
- character = *src++;
- if (isASCIIHexDigit(character))
- digit2 = toASCIIHexValue(character);
-
- *dst++ = (digit1 << 4) | digit2;
- } else
- *dst++ = inputChar;
- }
- out.resize(dst - out.data());
-}
-
NetworkJob::NetworkJob()
: m_playerId(0)
- , m_loadDataTimer(this, &NetworkJob::fireLoadDataTimer)
, m_loadAboutTimer(this, &NetworkJob::fireLoadAboutTimer)
, m_deleteJobTimer(this, &NetworkJob::fireDeleteJobTimer)
, m_streamFactory(0)
, m_isFile(false)
- , m_isData(false)
, m_isAbout(false)
, m_isFTP(false)
, m_isFTPDir(true)
@@ -134,7 +105,6 @@ bool NetworkJob::initialize(int playerId,
m_response.setURL(url);
m_isFile = url.protocolIs("file") || url.protocolIs("local");
- m_isData = url.protocolIs("data");
m_isAbout = url.protocolIs("about");
m_isFTP = url.protocolIs("ftp");
@@ -160,8 +130,8 @@ bool NetworkJob::initialize(int playerId,
m_isOverrideContentType = true;
}
- // No need to create the streams for data and about.
- if (m_isData || m_isAbout)
+ // No need to create the streams for about.
+ if (m_isAbout)
return true;
if (!request.getSuggestedSaveName().empty()) {
@@ -188,11 +158,6 @@ int NetworkJob::cancelJob()
// Cancel jobs loading local data by killing the timer, and jobs
// getting data from the network by calling the inherited URLStream::cancel.
- if (m_loadDataTimer.isActive()) {
- m_loadDataTimer.stop();
- notifyClose(BlackBerry::Platform::FilterStream::StatusCancelled);
- return 0;
- }
if (m_loadAboutTimer.isActive()) {
m_loadAboutTimer.stop();
@@ -314,9 +279,9 @@ void NetworkJob::handleNotifyHeaderReceived(const String& key, const String& val
m_response.setHTTPHeaderField(key, m_response.httpHeaderField(key) + "\r\n" + value);
return;
}
- } else if (lowerKey == "www-authenticate")
+ } else if (m_extendedStatusCode == 401 && lowerKey == "www-authenticate")
handleAuthHeader(ProtectionSpaceServerHTTP, value);
- else if (lowerKey == "proxy-authenticate" && !BlackBerry::Platform::Client::get()->getProxyAddress().empty())
+ else if (m_extendedStatusCode == 407 && lowerKey == "proxy-authenticate" && !BlackBerry::Platform::Client::get()->getProxyAddress().empty())
handleAuthHeader(ProtectionSpaceProxyHTTP, value);
else if (equalIgnoringCase(key, BlackBerry::Platform::NetworkRequest::HEADER_BLACKBERRY_FTP))
handleFTPHeader(value);
@@ -612,7 +577,9 @@ void NetworkJob::sendResponseIfNeeded()
if (isError(m_extendedStatusCode) && !m_dataReceived)
return;
- String urlFilename = m_response.url().lastPathComponent();
+ String urlFilename;
+ if (!m_response.url().protocolIsData() && !m_response.url().protocolIs("about"))
+ urlFilename = m_response.url().lastPathComponent();
// Get the MIME type that was set by the content sniffer
// if there's no custom sniffer header, try to set it from the Content-Type header
@@ -635,18 +602,18 @@ void NetworkJob::sendResponseIfNeeded()
m_response.setExpectedContentLength(contentLength.toInt64());
// Set suggested filename for downloads from the Content-Disposition header; if this fails,
- // fill it in from the url and sniffed mime type;Skip this for data and about URLs,
+ // fill it in from the url and sniffed mime type;Skip this for about URLs,
// because they have no Content-Disposition header and the format is wrong to be a filename.
- if (!m_isData && !m_isAbout) {
+ if (!m_isAbout) {
String suggestedFilename = filenameFromHTTPContentDisposition(m_contentDisposition);
if (suggestedFilename.isEmpty()) {
// Check and see if an extension already exists.
String mimeExtension = MIMETypeRegistry::getPreferredExtensionForMIMEType(mimeType);
if (urlFilename.isEmpty()) {
if (mimeExtension.isEmpty()) // No extension found for the mimeType.
- suggestedFilename = String("Untitled");
+ suggestedFilename = String(BlackBerry::Platform::LocalizeResource::getString(BlackBerry::Platform::FILENAME_UNTITLED));
else
- suggestedFilename = String("Untitled") + "." + mimeExtension;
+ suggestedFilename = String(BlackBerry::Platform::LocalizeResource::getString(BlackBerry::Platform::FILENAME_UNTITLED)) + "." + mimeExtension;
} else {
if (urlFilename.reverseFind('.') == notFound && !mimeExtension.isEmpty())
suggestedFilename = urlFilename + '.' + mimeExtension;
@@ -675,72 +642,6 @@ void NetworkJob::sendMultipartResponseIfNeeded()
}
}
-void NetworkJob::parseData()
-{
- Vector<char> result;
-
- String contentType("text/plain;charset=US-ASCII");
-
- String data(m_response.url().string().substring(5));
- Vector<String> hparts;
- bool isBase64 = false;
-
- size_t index = data.find(',');
- if (index != notFound && index > 0) {
- contentType = data.left(index).lower();
- data = data.substring(index + 1);
-
- contentType.split(';', hparts);
- Vector<String>::iterator i;
- for (i = hparts.begin(); i != hparts.end(); ++i) {
- if (i->stripWhiteSpace().lower() == "base64") {
- isBase64 = true;
- String value = *i;
- do {
- if (*i == value) {
- int position = i - hparts.begin();
- hparts.remove(position);
- i = hparts.begin() + position;
- } else
- ++i;
- } while (i != hparts.end());
- break;
- }
- }
- contentType = String();
- for (i = hparts.begin(); i != hparts.end(); ++i) {
- if (i > hparts.begin())
- contentType += ",";
-
- contentType += *i;
- }
- } else if (!index)
- data = data.substring(1); // Broken header.
-
- {
- CString latin = data.latin1();
- escapeDecode(latin.data(), latin.length(), result);
- }
-
- if (isBase64) {
- String s(result.data(), result.size());
- CString latin = s.removeCharacters(isSpaceOrNewline).latin1();
- result.clear();
- result.append(latin.data(), latin.length());
- Vector<char> bytesOut;
- if (base64Decode(result, bytesOut))
- result.swap(bytesOut);
- else
- result.clear();
- }
-
- notifyStatusReceived(result.isEmpty() ? 404 : 200, 0);
- notifyStringHeaderReceived("Content-Type", contentType);
- notifyStringHeaderReceived("Content-Length", String::number(result.size()));
- notifyDataReceivedPlain(result.data(), result.size());
- notifyClose(BlackBerry::Platform::FilterStream::StatusSuccess);
-}
-
bool NetworkJob::handleAuthHeader(const ProtectionSpaceServerType space, const String& header)
{
if (!m_handle)
diff --git a/Source/WebCore/platform/network/blackberry/NetworkJob.h b/Source/WebCore/platform/network/blackberry/NetworkJob.h
index a16117ac0..2bb557960 100644
--- a/Source/WebCore/platform/network/blackberry/NetworkJob.h
+++ b/Source/WebCore/platform/network/blackberry/NetworkJob.h
@@ -60,7 +60,6 @@ public:
bool isRunning() const { return m_isRunning; }
#endif
bool isCancelled() const { return m_cancelled; }
- void loadDataURL() { m_loadDataTimer.startOneShot(0); }
void loadAboutURL();
int cancelJob();
bool isDeferringLoading() const { return m_deferLoadingCount > 0; }
@@ -113,11 +112,6 @@ private:
void sendResponseIfNeeded();
void sendMultipartResponseIfNeeded();
- void fireLoadDataTimer(Timer<NetworkJob>*)
- {
- parseData();
- }
-
void fireLoadAboutTimer(Timer<NetworkJob>*)
{
handleAbout();
@@ -125,8 +119,6 @@ private:
void fireDeleteJobTimer(Timer<NetworkJob>*);
- void parseData();
-
void handleAbout();
// The server needs authentication credentials. Search in the
@@ -151,7 +143,6 @@ private:
String m_pageGroupName;
RefPtr<ResourceHandle> m_handle;
ResourceResponse m_response;
- Timer<NetworkJob> m_loadDataTimer;
Timer<NetworkJob> m_loadAboutTimer;
OwnPtr<ResourceResponse> m_multipartResponse;
Timer<NetworkJob> m_deleteJobTimer;
@@ -160,7 +151,6 @@ private:
String m_contentDisposition;
BlackBerry::Platform::NetworkStreamFactory* m_streamFactory;
bool m_isFile;
- bool m_isData;
bool m_isAbout;
bool m_isFTP;
bool m_isFTPDir;
diff --git a/Source/WebCore/platform/network/blackberry/NetworkManager.cpp b/Source/WebCore/platform/network/blackberry/NetworkManager.cpp
index 458efb032..bceb1da18 100644
--- a/Source/WebCore/platform/network/blackberry/NetworkManager.cpp
+++ b/Source/WebCore/platform/network/blackberry/NetworkManager.cpp
@@ -136,11 +136,6 @@ bool NetworkManager::startJob(int playerId, const String& pageGroupName, PassRef
m_jobs.append(networkJob);
- if (url.protocolIs("data")) {
- networkJob->loadDataURL();
- return true;
- }
-
if (url.protocolIs("about")) {
// If the protocol matches "about", loadAboutURL should recognize and handle it.
networkJob->loadAboutURL();
diff --git a/Source/WebCore/platform/network/blackberry/ResourceRequest.h b/Source/WebCore/platform/network/blackberry/ResourceRequest.h
index 29bb25c1a..964c35c74 100644
--- a/Source/WebCore/platform/network/blackberry/ResourceRequest.h
+++ b/Source/WebCore/platform/network/blackberry/ResourceRequest.h
@@ -55,7 +55,6 @@ public:
: ResourceRequestBase(KURL(ParsedURLString, url), UseProtocolCachePolicy)
, m_isXMLHTTPRequest(false)
, m_mustHandleInternally(false)
- , m_isRequestedByPlugin(false)
, m_forceDownload(false)
, m_targetType(TargetIsUnspecified)
{
@@ -65,7 +64,6 @@ public:
: ResourceRequestBase(url, UseProtocolCachePolicy)
, m_isXMLHTTPRequest(false)
, m_mustHandleInternally(false)
- , m_isRequestedByPlugin(false)
, m_forceDownload(false)
, m_targetType(TargetIsUnspecified)
{
@@ -75,7 +73,6 @@ public:
: ResourceRequestBase(url, policy)
, m_isXMLHTTPRequest(false)
, m_mustHandleInternally(false)
- , m_isRequestedByPlugin(false)
, m_forceDownload(false)
, m_targetType(TargetIsUnspecified)
{
@@ -86,7 +83,6 @@ public:
: ResourceRequestBase(KURL(), UseProtocolCachePolicy)
, m_isXMLHTTPRequest(false)
, m_mustHandleInternally(false)
- , m_isRequestedByPlugin(false)
, m_forceDownload(false)
, m_targetType(TargetIsUnspecified)
{
@@ -107,9 +103,6 @@ public:
void setIsXMLHTTPRequest(bool isXMLHTTPRequest) { m_isXMLHTTPRequest = isXMLHTTPRequest; }
bool isXMLHTTPRequest() const { return m_isXMLHTTPRequest; }
- void setIsRequestedByPlugin(bool isRequestedByPlugin) { m_isRequestedByPlugin = isRequestedByPlugin; }
- bool isRequestedByPlugin() const { return m_isRequestedByPlugin; }
-
// Marks requests which must be handled by webkit even if LinksHandledExternally is set.
void setMustHandleInternally(bool mustHandleInternally) { m_mustHandleInternally = mustHandleInternally; }
bool mustHandleInternally() const { return m_mustHandleInternally; }
@@ -138,7 +131,6 @@ private:
String m_suggestedSaveName;
bool m_isXMLHTTPRequest;
bool m_mustHandleInternally;
- bool m_isRequestedByPlugin;
bool m_forceDownload;
TargetType m_targetType;
@@ -156,7 +148,6 @@ struct CrossThreadResourceRequestData : public CrossThreadResourceRequestDataBas
String m_suggestedSaveName;
bool m_isXMLHTTPRequest;
bool m_mustHandleInternally;
- bool m_isRequestedByPlugin;
bool m_forceDownload;
ResourceRequest::TargetType m_targetType;
};
diff --git a/Source/WebCore/platform/network/blackberry/ResourceRequestBlackBerry.cpp b/Source/WebCore/platform/network/blackberry/ResourceRequestBlackBerry.cpp
index 948534647..5844f3db8 100644
--- a/Source/WebCore/platform/network/blackberry/ResourceRequestBlackBerry.cpp
+++ b/Source/WebCore/platform/network/blackberry/ResourceRequestBlackBerry.cpp
@@ -238,7 +238,6 @@ PassOwnPtr<CrossThreadResourceRequestData> ResourceRequest::doPlatformCopyData(P
data->m_suggestedSaveName = m_suggestedSaveName;
data->m_isXMLHTTPRequest = m_isXMLHTTPRequest;
data->m_mustHandleInternally = m_mustHandleInternally;
- data->m_isRequestedByPlugin = m_isRequestedByPlugin;
data->m_forceDownload = m_forceDownload;
data->m_targetType = m_targetType;
return data;
@@ -252,7 +251,6 @@ void ResourceRequest::doPlatformAdopt(PassOwnPtr<CrossThreadResourceRequestData>
m_suggestedSaveName = data->m_suggestedSaveName;
m_isXMLHTTPRequest = data->m_isXMLHTTPRequest;
m_mustHandleInternally = data->m_mustHandleInternally;
- m_isRequestedByPlugin = data->m_isRequestedByPlugin;
m_forceDownload = data->m_forceDownload;
m_targetType = data->m_targetType;
}
diff --git a/Source/WebCore/platform/network/cf/ResourceRequestCFNet.cpp b/Source/WebCore/platform/network/cf/ResourceRequestCFNet.cpp
index 279d755b2..7ce9b6039 100644
--- a/Source/WebCore/platform/network/cf/ResourceRequestCFNet.cpp
+++ b/Source/WebCore/platform/network/cf/ResourceRequestCFNet.cpp
@@ -151,6 +151,9 @@ void ResourceRequest::doUpdatePlatformRequest()
if (httpPipeliningEnabled())
wkSetHTTPPipeliningPriority(cfRequest, toHTTPPipeliningPriority(m_priority));
+#if !PLATFORM(WIN)
+ wkCFURLRequestAllowAllPostCaching(cfRequest);
+#endif
setHeaderFields(cfRequest, httpHeaderFields());
RefPtr<FormData> formData = httpBody();
diff --git a/Source/WebCore/platform/network/mac/ResourceRequestMac.mm b/Source/WebCore/platform/network/mac/ResourceRequestMac.mm
index 120f4acb5..262fdb446 100644
--- a/Source/WebCore/platform/network/mac/ResourceRequestMac.mm
+++ b/Source/WebCore/platform/network/mac/ResourceRequestMac.mm
@@ -135,6 +135,9 @@ void ResourceRequest::doUpdatePlatformRequest()
#endif
[nsRequest setCachePolicy:(NSURLRequestCachePolicy)cachePolicy()];
+#if !defined(BUILDING_ON_SNOW_LEOPARD)
+ wkCFURLRequestAllowAllPostCaching([nsRequest _CFURLRequest]);
+#endif
double timeoutInterval = ResourceRequestBase::timeoutInterval();
if (timeoutInterval)
diff --git a/Source/WebCore/platform/qt/KURLQt.cpp b/Source/WebCore/platform/qt/KURLQt.cpp
index ddc558020..2e75774f8 100644
--- a/Source/WebCore/platform/qt/KURLQt.cpp
+++ b/Source/WebCore/platform/qt/KURLQt.cpp
@@ -34,11 +34,15 @@ KURL::KURL(const QUrl& url)
KURL::operator QUrl() const
{
+#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
QString str = QString::fromRawData(reinterpret_cast<const QChar*>(m_string.characters()), m_string.length());
QByteArray ba = str.toUtf8();
QUrl url = QUrl::fromEncoded(ba);
return url;
+#else
+ return QUrl(m_string);
+#endif
}
String KURL::fileSystemPath() const
diff --git a/Source/WebCore/platform/qt/LocalizedStringsQt.cpp b/Source/WebCore/platform/qt/LocalizedStringsQt.cpp
index 1ff8006cc..b82fc5c74 100644
--- a/Source/WebCore/platform/qt/LocalizedStringsQt.cpp
+++ b/Source/WebCore/platform/qt/LocalizedStringsQt.cpp
@@ -445,6 +445,12 @@ String crashedPluginText()
return String();
}
+String insecurePluginVersionText()
+{
+ notImplemented();
+ return String();
+}
+
String multipleFileUploadText(unsigned)
{
notImplemented();
diff --git a/Source/WebCore/platform/qt/QWebPageClient.h b/Source/WebCore/platform/qt/QWebPageClient.h
index 30c3b48ea..9541c64e2 100644
--- a/Source/WebCore/platform/qt/QWebPageClient.h
+++ b/Source/WebCore/platform/qt/QWebPageClient.h
@@ -43,6 +43,7 @@
QT_BEGIN_NAMESPACE
class QStyle;
+class QWindow;
QT_END_NAMESPACE
namespace WebCore {
@@ -109,6 +110,9 @@ public:
virtual void createPlatformGraphicsContext3D(PlatformGraphicsContext3D*,
PlatformGraphicsSurface3D*) = 0;
#endif
+#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
+ virtual QWindow* ownerWindow() const;
+#endif
protected:
#ifndef QT_NO_CURSOR
diff --git a/Source/WebCore/platform/text/BidiResolver.h b/Source/WebCore/platform/text/BidiResolver.h
index 5f4ce15d6..793f4f9f5 100644
--- a/Source/WebCore/platform/text/BidiResolver.h
+++ b/Source/WebCore/platform/text/BidiResolver.h
@@ -403,7 +403,8 @@ template <class Iterator, class Run>
bool BidiResolver<Iterator, Run>::commitExplicitEmbedding()
{
// This gets called from bidiFirst when setting up our start position.
- ASSERT(!inIsolate() || m_currentExplicitEmbeddingSequence.isEmpty());
+ // FIXME: Re-enable this assert once https://bugs.webkit.org/show_bug.cgi?id=76574 is fixed.
+ // ASSERT(!inIsolate() || m_currentExplicitEmbeddingSequence.isEmpty());
using namespace WTF::Unicode;
diff --git a/Source/WebCore/platform/win/ClipboardUtilitiesWin.cpp b/Source/WebCore/platform/win/ClipboardUtilitiesWin.cpp
index d61c01432..d8d77f319 100644
--- a/Source/WebCore/platform/win/ClipboardUtilitiesWin.cpp
+++ b/Source/WebCore/platform/win/ClipboardUtilitiesWin.cpp
@@ -298,9 +298,20 @@ void markupToCFHTML(const String& markup, const String& srcURL, Vector<char>& re
void replaceNewlinesWithWindowsStyleNewlines(String& str)
{
- static const UChar Newline = '\n';
- static const char* const WindowsNewline("\r\n");
- str.replace(Newline, WindowsNewline);
+ DEFINE_STATIC_LOCAL(String, windowsNewline, ("\r\n"));
+ const static unsigned windowsNewlineLength = windowsNewline.length();
+
+ unsigned index = 0;
+ unsigned strLength = str.length();
+ while (index < strLength) {
+ if (str[index] != '\n' || (index > 0 && str[index - 1] == '\r')) {
+ ++index;
+ continue;
+ }
+ str.replace(index, 1, windowsNewline);
+ strLength = str.length();
+ index += windowsNewlineLength;
+ }
}
void replaceNBSPWithSpace(String& str)
diff --git a/Source/WebCore/platform/win/PopupMenuWin.cpp b/Source/WebCore/platform/win/PopupMenuWin.cpp
index 7ebcfdc02..b18c53feb 100644
--- a/Source/WebCore/platform/win/PopupMenuWin.cpp
+++ b/Source/WebCore/platform/win/PopupMenuWin.cpp
@@ -636,10 +636,8 @@ void PopupMenuWin::paint(const IntRect& damageRect, HDC hdc)
String itemText = client()->itemText(index);
- unsigned length = itemText.length();
- const UChar* string = itemText.characters();
TextDirection direction = (itemText.defaultWritingDirection() == WTF::Unicode::RightToLeft) ? RTL : LTR;
- TextRun textRun(string, length, false, 0, 0, TextRun::AllowTrailingExpansion, direction);
+ TextRun textRun(itemText, 0, 0, TextRun::AllowTrailingExpansion, direction);
context.setFillColor(optionTextColor, ColorSpaceDeviceRGB);
diff --git a/Source/WebCore/plugins/PluginView.cpp b/Source/WebCore/plugins/PluginView.cpp
index 9a5ffa8fc..d37573e67 100644
--- a/Source/WebCore/plugins/PluginView.cpp
+++ b/Source/WebCore/plugins/PluginView.cpp
@@ -126,9 +126,8 @@ IntRect PluginView::windowClipRect() const
IntRect clipRect(m_windowRect);
// Take our element and get the clip rect from the enclosing layer and frame view.
- RenderLayer* layer = m_element->renderer()->enclosingLayer();
FrameView* parentView = m_element->document()->view();
- clipRect.intersect(parentView->windowClipRectForLayer(layer, true));
+ clipRect.intersect(parentView->windowClipRectForFrameOwner(m_element, true));
return clipRect;
}
@@ -812,7 +811,7 @@ void PluginView::setParameters(const Vector<String>& paramNames, const Vector<St
m_paramCount = paramCount;
}
-PluginView::PluginView(Frame* parentFrame, const IntSize& size, PluginPackage* plugin, Element* element, const KURL& url, const Vector<String>& paramNames, const Vector<String>& paramValues, const String& mimeType, bool loadManually)
+PluginView::PluginView(Frame* parentFrame, const IntSize& size, PluginPackage* plugin, HTMLPlugInElement* element, const KURL& url, const Vector<String>& paramNames, const Vector<String>& paramValues, const String& mimeType, bool loadManually)
: m_parentFrame(parentFrame)
, m_plugin(plugin)
, m_element(element)
@@ -965,7 +964,7 @@ bool PluginView::isCallingPlugin()
return s_callingPlugin > 0;
}
-PassRefPtr<PluginView> PluginView::create(Frame* parentFrame, const IntSize& size, Element* element, const KURL& url, const Vector<String>& paramNames, const Vector<String>& paramValues, const String& mimeType, bool loadManually)
+PassRefPtr<PluginView> PluginView::create(Frame* parentFrame, const IntSize& size, HTMLPlugInElement* element, const KURL& url, const Vector<String>& paramNames, const Vector<String>& paramValues, const String& mimeType, bool loadManually)
{
// if we fail to find a plugin for this MIME type, findPlugin will search for
// a plugin by the file extension and update the MIME type, so pass a mutable String
diff --git a/Source/WebCore/plugins/PluginView.h b/Source/WebCore/plugins/PluginView.h
index 1128522d0..aaf87c104 100644
--- a/Source/WebCore/plugins/PluginView.h
+++ b/Source/WebCore/plugins/PluginView.h
@@ -84,9 +84,9 @@ namespace JSC {
#endif
namespace WebCore {
- class Element;
class Frame;
class Image;
+ class HTMLPlugInElement;
class KeyboardEvent;
class MouseEvent;
class KURL;
@@ -141,7 +141,7 @@ namespace WebCore {
, public PluginManualLoader
, private MediaCanStartListener {
public:
- static PassRefPtr<PluginView> create(Frame* parentFrame, const IntSize&, Element*, const KURL&, const Vector<String>& paramNames, const Vector<String>& paramValues, const String& mimeType, bool loadManually);
+ static PassRefPtr<PluginView> create(Frame* parentFrame, const IntSize&, HTMLPlugInElement*, const KURL&, const Vector<String>& paramNames, const Vector<String>& paramValues, const String& mimeType, bool loadManually);
virtual ~PluginView();
PluginPackage* plugin() const { return m_plugin.get(); }
@@ -265,7 +265,7 @@ namespace WebCore {
#endif
private:
- PluginView(Frame* parentFrame, const IntSize&, PluginPackage*, Element*, const KURL&, const Vector<String>& paramNames, const Vector<String>& paramValues, const String& mimeType, bool loadManually);
+ PluginView(Frame* parentFrame, const IntSize&, PluginPackage*, HTMLPlugInElement*, const KURL&, const Vector<String>& paramNames, const Vector<String>& paramValues, const String& mimeType, bool loadManually);
void setParameters(const Vector<String>& paramNames, const Vector<String>& paramValues);
bool startOrAddToUnstartedList();
@@ -299,7 +299,7 @@ namespace WebCore {
RefPtr<Frame> m_parentFrame;
RefPtr<PluginPackage> m_plugin;
- Element* m_element;
+ HTMLPlugInElement* m_element;
bool m_isStarted;
KURL m_url;
PluginStatus m_status;
@@ -426,6 +426,7 @@ private:
static bool s_isRunningUnderDRT;
static void setXKeyEventSpecificFields(XEvent*, KeyboardEvent*);
void paintUsingXPixmap(QPainter* painter, const QRect &exposedRect);
+ QWebPageClient* platformPageClient() const;
#endif
#if USE(ACCELERATED_COMPOSITING_PLUGIN_LAYER)
OwnPtr<PlatformLayer> m_platformLayer;
diff --git a/Source/WebCore/plugins/PluginViewBase.h b/Source/WebCore/plugins/PluginViewBase.h
index fa839d444..5f13c8846 100644
--- a/Source/WebCore/plugins/PluginViewBase.h
+++ b/Source/WebCore/plugins/PluginViewBase.h
@@ -57,6 +57,9 @@ public:
virtual Scrollbar* horizontalScrollbar() { return 0; }
virtual Scrollbar* verticalScrollbar() { return 0; }
+ // FIXME: This is a hack that works around the fact that the WebKit2 PluginView isn't a ScrollableArea.
+ virtual bool wantsWheelEvents() { return false; }
+
protected:
PluginViewBase(PlatformWidget widget = 0) : Widget(widget) { }
diff --git a/Source/WebCore/plugins/qt/PluginPackageQt.cpp b/Source/WebCore/plugins/qt/PluginPackageQt.cpp
index 4e9a717b8..b9824fae0 100644
--- a/Source/WebCore/plugins/qt/PluginPackageQt.cpp
+++ b/Source/WebCore/plugins/qt/PluginPackageQt.cpp
@@ -31,6 +31,7 @@
#include "npruntime_impl.h"
#include "PluginDatabase.h"
#include "PluginDebug.h"
+#include <QFileInfo>
#include <wtf/text/CString.h>
namespace WebCore {
@@ -129,6 +130,23 @@ static void initializeGtk(QLibrary* module = 0)
}
}
+bool PluginPackage::isPluginBlacklisted()
+{
+#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
+ // TODO: enumerate all plugins that are incompatible with Qt5.
+ const QLatin1String pluginBlacklist[] = {
+ QLatin1String("skypebuttons")
+ };
+
+ QString baseName = QFileInfo(static_cast<QString>(m_path)).baseName();
+ for (unsigned i = 0; i < sizeof(pluginBlacklist) / sizeof(QLatin1String); ++i) {
+ if (baseName == pluginBlacklist[i])
+ return true;
+ }
+#endif
+ return false;
+}
+
bool PluginPackage::load()
{
if (m_isLoaded) {
@@ -136,6 +154,9 @@ bool PluginPackage::load()
return true;
}
+ if (isPluginBlacklisted())
+ return false;
+
m_module = new QLibrary((QString)m_path);
m_module->setLoadHints(QLibrary::ResolveAllSymbolsHint);
if (!m_module->load()) {
diff --git a/Source/WebCore/plugins/qt/PluginViewQt.cpp b/Source/WebCore/plugins/qt/PluginViewQt.cpp
index ac31cf002..6bafe0122 100644
--- a/Source/WebCore/plugins/qt/PluginViewQt.cpp
+++ b/Source/WebCore/plugins/qt/PluginViewQt.cpp
@@ -58,7 +58,6 @@
#include "Page.h"
#include "PlatformMouseEvent.h"
#include "PlatformKeyboardEvent.h"
-#include "PluginContainerQt.h"
#include "PluginDebug.h"
#include "PluginPackage.h"
#include "PluginMainThreadScheduler.h"
@@ -69,15 +68,8 @@
#if USE(JSC)
#include "runtime_root.h"
#endif
-
-#include <QApplication>
-#include <QDesktopWidget>
-#include <QGraphicsWidget>
#include <QKeyEvent>
#include <QPainter>
-#include <QStyleOptionGraphicsItem>
-#include <QWidget>
-#include <QX11Info>
#include <X11/X.h>
#ifndef QT_NO_XRENDER
#define Bool int
@@ -87,6 +79,23 @@
#include <runtime/JSLock.h>
#include <runtime/JSValue.h>
+#define HAVE_QT5 (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
+
+#if HAVE(QT5)
+#include "QtX11ImageConversion.h"
+#include <QGuiApplication>
+#include <QPlatformNativeInterface>
+#include <QWindow>
+#else
+#include "PluginContainerQt.h"
+#include <QApplication>
+#include <QDesktopWidget>
+#include <QGraphicsWidget>
+#include <QStyleOptionGraphicsItem>
+#include <QWidget>
+#include <QX11Info>
+#endif
+
using JSC::ExecState;
#if USE(JSC)
using JSC::Interpreter;
@@ -105,7 +114,37 @@ bool PluginView::s_isRunningUnderDRT = false;
using namespace HTMLNames;
-#if USE(ACCELERATED_COMPOSITING)
+struct X11Environment {
+ Display* display;
+ int screenID;
+ unsigned long rootWindowID;
+ int displayDepth;
+};
+
+static X11Environment x11Environment = { 0, 0, 0, 0 };
+
+static inline Display* x11Display() { return x11Environment.display; }
+static inline int x11Screen() { return x11Environment.screenID; }
+static inline unsigned long rootWindowID() { return x11Environment.rootWindowID; }
+static inline int displayDepth() { return x11Environment.displayDepth; }
+
+static inline void syncX()
+{
+ XSync(x11Display(), false);
+}
+
+QWebPageClient* PluginView::platformPageClient() const
+{
+ FrameView* view = m_parentFrame->view();
+ if (!view)
+ return 0;
+ HostWindow* hostWindow = view->hostWindow();
+ if (!hostWindow)
+ return 0;
+ return hostWindow->platformPageClient();
+}
+
+#if !HAVE(QT5) && USE(ACCELERATED_COMPOSITING)
// Qt's GraphicsLayer (GraphicsLayerQt) requires layers to be QGraphicsWidgets
class PluginGraphicsLayerQt : public QGraphicsWidget {
public:
@@ -154,11 +193,11 @@ void PluginView::updatePluginWidget()
if (!m_isWindowed && m_windowRect.size() != oldWindowRect.size()) {
if (m_drawable)
- XFreePixmap(QX11Info::display(), m_drawable);
+ XFreePixmap(x11Display(), m_drawable);
- m_drawable = XCreatePixmap(QX11Info::display(), QX11Info::appRootWindow(), m_windowRect.width(), m_windowRect.height(),
+ m_drawable = XCreatePixmap(x11Display(), rootWindowID(), m_windowRect.width(), m_windowRect.height(),
((NPSetWindowCallbackStruct*)m_npWindow.ws_info)->depth);
- QApplication::syncX(); // make sure that the server knows about the Drawable
+ syncX(); // make sure that the server knows about the Drawable
}
// do not call setNPWindowIfNeeded immediately, will be called on paint()
@@ -187,12 +226,13 @@ void PluginView::updatePluginWidget()
void PluginView::setFocus(bool focused)
{
+#if !HAVE(QT5) // Windowed mode is not supported with Qt5 yet (so platformPluginWidget() is always null).
if (platformPluginWidget()) {
if (focused)
static_cast<QWidget*>(platformPluginWidget())->setFocus(Qt::OtherFocusReason);
- } else {
+ } else
+#endif
Widget::setFocus(focused);
- }
}
void PluginView::show()
@@ -207,12 +247,30 @@ void PluginView::hide()
Widget::hide();
}
+static void setupGraphicsExposeEvent(Pixmap drawable, const QRect& exposedRect, XEvent& xevent)
+{
+ memset(&xevent, 0, sizeof(XEvent));
+ XGraphicsExposeEvent& exposeEvent = xevent.xgraphicsexpose;
+ exposeEvent.type = GraphicsExpose;
+ exposeEvent.display = x11Display();
+ exposeEvent.drawable = drawable;
+ exposeEvent.x = exposedRect.x();
+ exposeEvent.y = exposedRect.y();
+ exposeEvent.width = exposedRect.x() + exposedRect.width(); // flash bug? it thinks width is the right in transparent mode
+ exposeEvent.height = exposedRect.y() + exposedRect.height(); // flash bug? it thinks height is the bottom in transparent mode
+}
+
void PluginView::paintUsingXPixmap(QPainter* painter, const QRect &exposedRect)
{
+ bool shouldSyncX = m_pluginDisplay && m_pluginDisplay != x11Display();
+ XEvent xevent;
+
+#if HAVE(QT5)
+ setupGraphicsExposeEvent(m_drawable, exposedRect, xevent);
+#else
QPixmap qtDrawable = QPixmap::fromX11Pixmap(m_drawable, QPixmap::ExplicitlyShared);
const int drawableDepth = ((NPSetWindowCallbackStruct*)m_npWindow.ws_info)->depth;
ASSERT(drawableDepth == qtDrawable.depth());
- const bool syncX = m_pluginDisplay && m_pluginDisplay != QX11Info::display();
// When printing, Qt uses a QPicture to capture the output in preview mode. The
// QPicture holds a reference to the X Pixmap. As a result, the print preview would
@@ -232,7 +290,7 @@ void PluginView::paintUsingXPixmap(QPainter* painter, const QRect &exposedRect)
// We cannot grab contents from the backing store when painting on QGraphicsView items
// (because backing store contents are already transformed). What we really mean to do
// here is to check if we are painting on QWebView, but let's be a little permissive :)
- QWebPageClient* client = m_parentFrame->view()->hostWindow()->platformPageClient();
+ QWebPageClient* client = platformPageClient();
const bool backingStoreHasUntransformedContents = client && qobject_cast<QWidget*>(client->pluginParent());
if (hasValidBackingStore && backingStorePixmap->depth() == drawableDepth
@@ -246,27 +304,26 @@ void PluginView::paintUsingXPixmap(QPainter* painter, const QRect &exposedRect)
painter.fillRect(exposedRect, Qt::white);
}
- if (syncX)
- QApplication::syncX();
+ if (shouldSyncX)
+ syncX();
}
- XEvent xevent;
- memset(&xevent, 0, sizeof(XEvent));
- XGraphicsExposeEvent& exposeEvent = xevent.xgraphicsexpose;
- exposeEvent.type = GraphicsExpose;
- exposeEvent.display = QX11Info::display();
- exposeEvent.drawable = qtDrawable.handle();
- exposeEvent.x = exposedRect.x();
- exposeEvent.y = exposedRect.y();
- exposeEvent.width = exposedRect.x() + exposedRect.width(); // flash bug? it thinks width is the right in transparent mode
- exposeEvent.height = exposedRect.y() + exposedRect.height(); // flash bug? it thinks height is the bottom in transparent mode
+ setupGraphicsExposeEvent(qtDrawable.handle(), exposedRect, xevent);
+#endif
dispatchNPEvent(xevent);
- if (syncX)
+ if (shouldSyncX)
XSync(m_pluginDisplay, false); // sync changes by plugin
+#if HAVE(QT5)
+ XImage* xImage = XGetImage(x11Display(), m_drawable, exposedRect.x(), exposedRect.y(),
+ exposedRect.width(), exposedRect.height(), ULONG_MAX, ZPixmap);
+ painter->drawImage(QPoint(exposedRect.x(), exposedRect.y()), qimageFromXImage(xImage), exposedRect);
+ XDestroyImage(xImage);
+#else
painter->drawPixmap(QPoint(exposedRect.x(), exposedRect.y()), qtDrawable, exposedRect);
+#endif
}
void PluginView::paint(GraphicsContext* context, const IntRect& rect)
@@ -331,24 +388,29 @@ bool PluginView::dispatchNPEvent(NPEvent& event)
return accepted;
}
-void setSharedXEventFields(XEvent* xEvent, QWidget* ownerWidget)
+void setSharedXEventFields(XEvent* xEvent, QWebPageClient* pageClient)
{
xEvent->xany.serial = 0; // we are unaware of the last request processed by X Server
xEvent->xany.send_event = false;
- xEvent->xany.display = QX11Info::display();
+ xEvent->xany.display = x11Display();
// NOTE: event->xany.window doesn't always respond to the .window property of other XEvent's
// but does in the case of KeyPress, KeyRelease, ButtonPress, ButtonRelease, and MotionNotify
// events; thus, this is right:
- xEvent->xany.window = ownerWidget ? ownerWidget->window()->handle() : 0;
+#if HAVE(QT5)
+ QWindow* window = pageClient ? pageClient->ownerWindow() : 0;
+ xEvent->xany.window = window ? window->winId() : 0;
+#else
+ QWidget* ownerWidget = pageClient ? pageClient->ownerWidget() : 0;
+ xEvent->xany.window = ownerWidget ? ownerWidget->window()->winId() : 0;
+#endif
}
void PluginView::initXEvent(XEvent* xEvent)
{
memset(xEvent, 0, sizeof(XEvent));
- QWebPageClient* client = m_parentFrame->view()->hostWindow()->platformPageClient();
- QWidget* ownerWidget = client ? client->ownerWidget() : 0;
- setSharedXEventFields(xEvent, ownerWidget);
+ QWebPageClient* client = platformPageClient();
+ setSharedXEventFields(xEvent, client);
}
void PluginView::setXKeyEventSpecificFields(XEvent* xEvent, KeyboardEvent* event)
@@ -356,7 +418,7 @@ void PluginView::setXKeyEventSpecificFields(XEvent* xEvent, KeyboardEvent* event
const PlatformKeyboardEvent* keyEvent = event->keyEvent();
xEvent->type = (event->type() == eventNames().keydownEvent) ? 2 : 3; // ints as Qt unsets KeyPress and KeyRelease
- xEvent->xkey.root = QX11Info::appRootWindow();
+ xEvent->xkey.root = rootWindowID();
xEvent->xkey.subwindow = 0; // we have no child window
xEvent->xkey.time = event->timeStamp();
xEvent->xkey.state = keyEvent->nativeModifiers();
@@ -370,7 +432,7 @@ void PluginView::setXKeyEventSpecificFields(XEvent* xEvent, KeyboardEvent* event
QKeyEvent* qKeyEvent = keyEvent->qtEvent();
ASSERT(qKeyEvent);
QString keyText = qKeyEvent->text().left(1);
- xEvent->xkey.keycode = XKeysymToKeycode(QX11Info::display(), XStringToKeysym(keyText.toUtf8().constData()));
+ xEvent->xkey.keycode = XKeysymToKeycode(x11Display(), XStringToKeysym(keyText.toUtf8().constData()));
}
xEvent->xkey.same_screen = true;
@@ -419,7 +481,7 @@ static void setXButtonEventSpecificFields(XEvent* xEvent, MouseEvent* event, con
{
XButtonEvent& xbutton = xEvent->xbutton;
xbutton.type = event->type() == eventNames().mousedownEvent ? ButtonPress : ButtonRelease;
- xbutton.root = QX11Info::appRootWindow();
+ xbutton.root = rootWindowID();
xbutton.subwindow = 0;
xbutton.time = event->timeStamp();
xbutton.x = postZoomPos.x();
@@ -446,7 +508,7 @@ static void setXMotionEventSpecificFields(XEvent* xEvent, MouseEvent* event, con
{
XMotionEvent& xmotion = xEvent->xmotion;
xmotion.type = MotionNotify;
- xmotion.root = QX11Info::appRootWindow();
+ xmotion.root = rootWindowID();
xmotion.subwindow = 0;
xmotion.time = event->timeStamp();
xmotion.x = postZoomPos.x();
@@ -462,7 +524,7 @@ static void setXCrossingEventSpecificFields(XEvent* xEvent, MouseEvent* event, c
{
XCrossingEvent& xcrossing = xEvent->xcrossing;
xcrossing.type = event->type() == eventNames().mouseoverEvent ? EnterNotify : LeaveNotify;
- xcrossing.root = QX11Info::appRootWindow();
+ xcrossing.root = rootWindowID();
xcrossing.subwindow = 0;
xcrossing.time = event->timeStamp();
xcrossing.x = postZoomPos.y();
@@ -571,6 +633,7 @@ void PluginView::setNPWindowIfNeeded()
return;
m_hasPendingGeometryChange = false;
+#if !HAVE(QT5) // Windowed mode is not supported with Qt5 yet
if (m_isWindowed) {
QWidget* widget = static_cast<QWidget*>(platformPluginWidget());
widget->setGeometry(m_windowRect);
@@ -590,7 +653,9 @@ void PluginView::setNPWindowIfNeeded()
m_npWindow.x = m_windowRect.x();
m_npWindow.y = m_windowRect.y();
- } else {
+ } else
+#endif
+ {
m_npWindow.x = 0;
m_npWindow.y = 0;
}
@@ -639,8 +704,10 @@ void PluginView::setParentVisible(bool visible)
Widget::setParentVisible(visible);
+#if !HAVE(QT5) // Windowed mode is not supported with Qt5 yet.
if (isSelfVisible() && platformPluginWidget())
static_cast<QWidget*>(platformPluginWidget())->setVisible(visible);
+#endif
}
NPError PluginView::handlePostReadFile(Vector<char>& buffer, uint32_t len, const char* buf)
@@ -701,7 +768,7 @@ bool PluginView::platformGetValue(NPNVariable variable, void* value, NPError* re
{
switch (variable) {
case NPNVxDisplay:
- *(void **)value = QX11Info::display();
+ *reinterpret_cast<void**>(value) = x11Display();
*result = NPERR_NO_ERROR;
return true;
@@ -710,9 +777,13 @@ bool PluginView::platformGetValue(NPNVariable variable, void* value, NPError* re
return true;
case NPNVnetscapeWindow: {
- void* w = reinterpret_cast<void*>(value);
- QWebPageClient* client = m_parentFrame->view()->hostWindow()->platformPageClient();
- *((XID *)w) = client ? client->ownerWidget()->window()->winId() : 0;
+ QWebPageClient* client = platformPageClient();
+#if HAVE(QT5)
+ QWindow* window = client ? client->ownerWindow() : 0;
+ *reinterpret_cast<XID*>(value) = window ? window->winId() : 0;
+#else
+ *reinterpret_cast<XID*>(value) = client ? client->ownerWidget()->window()->winId() : 0;
+#endif
*result = NPERR_NO_ERROR;
return true;
}
@@ -739,6 +810,7 @@ void PluginView::invalidateRect(const IntRect& rect)
}
#endif
+#if !HAVE(QT5) // Windowed mode is not supported with Qt5 yet.
if (m_isWindowed) {
if (platformWidget()) {
// update() will schedule a repaint of the widget so ensure
@@ -749,6 +821,7 @@ void PluginView::invalidateRect(const IntRect& rect)
}
return;
}
+#endif
invalidateWindowlessPluginRect(rect);
}
@@ -803,47 +876,53 @@ static Display *getPluginDisplay()
return (Display*)gdk_x11_display_get_xdisplay(gdk_display_get_default());
}
-static void getVisualAndColormap(int depth, Visual **visual, Colormap *colormap)
+static bool getVisualAndColormap(int depth, Visual*& visual, Colormap& colormap, bool forceARGB32)
{
- *visual = 0;
- *colormap = 0;
+ ASSERT(depth == 32 || !forceARGB32);
-#ifndef QT_NO_XRENDER
+ visual = 0;
+ colormap = 0;
+
+#if !HAVE(QT5) && !defined(QT_NO_XRENDER)
static const bool useXRender = qgetenv("QT_X11_NO_XRENDER").isNull(); // Should also check for XRender >= 0.5
#else
static const bool useXRender = false;
#endif
-
- if (!useXRender && depth == 32)
- return;
+ if (!useXRender && forceARGB32)
+ return false;
int nvi;
XVisualInfo templ;
- templ.screen = QX11Info::appScreen();
+ templ.screen = x11Screen();
templ.depth = depth;
templ.c_class = TrueColor;
- XVisualInfo* xvi = XGetVisualInfo(QX11Info::display(), VisualScreenMask | VisualDepthMask | VisualClassMask, &templ, &nvi);
-
+ XVisualInfo* xvi = XGetVisualInfo(x11Display(), VisualScreenMask | VisualDepthMask | VisualClassMask, &templ, &nvi);
+ ASSERT(xvi || forceARGB32);
if (!xvi)
- return;
+ return false;
-#ifndef QT_NO_XRENDER
- if (depth == 32) {
+#if !HAVE(QT5) && !defined(QT_NO_XRENDER)
+ if (forceARGB32) {
for (int idx = 0; idx < nvi; ++idx) {
- XRenderPictFormat* format = XRenderFindVisualFormat(QX11Info::display(), xvi[idx].visual);
+ XRenderPictFormat* format = XRenderFindVisualFormat(x11Display(), xvi[idx].visual);
if (format->type == PictTypeDirect && format->direct.alphaMask) {
- *visual = xvi[idx].visual;
+ visual = xvi[idx].visual;
break;
}
- }
+ }
+ if (!visual)
+ return false;
} else
-#endif // QT_NO_XRENDER
- *visual = xvi[0].visual;
+#endif
+ {
+ visual = xvi[0].visual;
+ }
+ ASSERT(visual);
XFree(xvi);
- if (*visual)
- *colormap = XCreateColormap(QX11Info::display(), QX11Info::appRootWindow(), *visual, AllocNone);
+ colormap = XCreateColormap(x11Display(), rootWindowID(), visual, AllocNone);
+ return true;
}
bool PluginView::platformStart()
@@ -851,6 +930,24 @@ bool PluginView::platformStart()
ASSERT(m_isStarted);
ASSERT(m_status == PluginStatusLoadedSuccessfully);
+ if (!x11Environment.display) {
+ Display* display;
+#if HAVE(QT5)
+ display = static_cast<Display*>(QGuiApplication::platformNativeInterface()->nativeResourceForWindow("display", 0));
+#else
+ display = QX11Info::display();
+#endif
+ x11Environment.display = display;
+ x11Environment.screenID = XDefaultScreen(display);
+ x11Environment.displayDepth = XDefaultDepth(display, x11Environment.screenID);
+ x11Environment.rootWindowID = XDefaultRootWindow(display);
+ }
+
+#if HAVE(QT5)
+ // Windowed mode is not supported with Qt5 yet.
+ if (m_isWindowed)
+ return false;
+#else
if (m_plugin->pluginFuncs()->getvalue) {
PluginView::setCurrentPluginView(this);
#if USE(JSC)
@@ -863,7 +960,7 @@ bool PluginView::platformStart()
}
if (m_isWindowed) {
- QWebPageClient* client = m_parentFrame->view()->hostWindow()->platformPageClient();
+ QWebPageClient* client = platformPageClient();
if (m_needsXEmbed && client) {
setPlatformWidget(new PluginContainerQt(this, client->ownerWidget()));
// sync our XEmbed container window creation before sending the xid to plugins.
@@ -873,7 +970,9 @@ bool PluginView::platformStart()
m_status = PluginStatusCanNotLoadPlugin;
return false;
}
- } else {
+ } else
+#endif // HAVE(QT5)
+ {
setPlatformWidget(0);
m_pluginDisplay = getPluginDisplay();
@@ -893,6 +992,7 @@ bool PluginView::platformStart()
NPSetWindowCallbackStruct* wsi = new NPSetWindowCallbackStruct();
wsi->type = 0;
+#if !HAVE(QT5)
if (m_isWindowed) {
const QX11Info* x11Info = &static_cast<QWidget*>(platformPluginWidget())->x11Info();
@@ -905,20 +1005,24 @@ bool PluginView::platformStart()
m_npWindow.window = (void*)static_cast<QWidget*>(platformPluginWidget())->winId();
m_npWindow.width = -1;
m_npWindow.height = -1;
- } else {
+ } else
+#endif
+ {
+#if !HAVE(QT5)
const QX11Info* x11Info = &QApplication::desktop()->x11Info();
-
- if (x11Info->depth() == 32 || !m_plugin->quirks().contains(PluginQuirkRequiresDefaultScreenDepth)) {
- getVisualAndColormap(32, &m_visual, &m_colormap);
+ if ((x11Info->depth() == 32 || !m_plugin->quirks().contains(PluginQuirkRequiresDefaultScreenDepth))
+ && getVisualAndColormap(32, m_visual, m_colormap, /* forceARGB32 = */ true))
wsi->depth = 32;
+ else
+#endif
+ {
+ int depth = displayDepth();
+ bool found = getVisualAndColormap(depth, m_visual, m_colormap, /* forceARGB32 = */ false);
+ ASSERT_UNUSED(found, found);
+ wsi->depth = depth;
}
- if (!m_visual) {
- getVisualAndColormap(x11Info->depth(), &m_visual, &m_colormap);
- wsi->depth = x11Info->depth();
- }
-
- wsi->display = x11Info->display();
+ wsi->display = x11Display();
wsi->visual = m_visual;
wsi->colormap = m_colormap;
@@ -946,10 +1050,10 @@ void PluginView::platformDestroy()
delete platformPluginWidget();
if (m_drawable)
- XFreePixmap(QX11Info::display(), m_drawable);
+ XFreePixmap(x11Display(), m_drawable);
if (m_colormap)
- XFreeColormap(QX11Info::display(), m_colormap);
+ XFreeColormap(x11Display(), m_colormap);
}
#if USE(ACCELERATED_COMPOSITING)
diff --git a/Source/WebCore/rendering/InlineTextBox.cpp b/Source/WebCore/rendering/InlineTextBox.cpp
index d6ed33287..9550edb59 100644
--- a/Source/WebCore/rendering/InlineTextBox.cpp
+++ b/Source/WebCore/rendering/InlineTextBox.cpp
@@ -534,46 +534,7 @@ void InlineTextBox::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset,
bool containsComposition = renderer()->node() && renderer()->frame()->editor()->compositionNode() == renderer()->node();
bool useCustomUnderlines = containsComposition && renderer()->frame()->editor()->compositionUsesCustomUnderlines();
- // Set our font.
- const Font& font = styleToUse->font();
-
- FloatPoint textOrigin = FloatPoint(boxOrigin.x(), boxOrigin.y() + font.fontMetrics().ascent());
-
- if (combinedText)
- combinedText->adjustTextOrigin(textOrigin, boxRect);
-
- // 1. Paint backgrounds behind text if needed. Examples of such backgrounds include selection
- // and composition underlines.
- if (paintInfo.phase != PaintPhaseSelection && paintInfo.phase != PaintPhaseTextClip && !isPrinting) {
-#if PLATFORM(MAC)
- // Custom highlighters go behind everything else.
- if (styleToUse->highlight() != nullAtom && !context->paintingDisabled())
- paintCustomHighlight(adjustedPaintOffset, styleToUse->highlight());
-#endif
-
- if (containsComposition && !useCustomUnderlines)
- paintCompositionBackground(context, boxOrigin, styleToUse, font,
- renderer()->frame()->editor()->compositionStart(),
- renderer()->frame()->editor()->compositionEnd());
-
- paintDocumentMarkers(context, boxOrigin, styleToUse, font, true);
-
- if (haveSelection && !useCustomUnderlines)
- paintSelection(context, boxOrigin, styleToUse, font);
- }
-
- if (Frame* frame = renderer()->frame()) {
- if (Page* page = frame->page()) {
- // FIXME: Right now, InlineTextBoxes never call addRelevantUnpaintedObject() even though they might
- // legitimately be unpainted if they are waiting on a slow-loading web font. We should fix that, and
- // when we do, we will have to account for the fact the InlineTextBoxes do not always have unique
- // renderers and Page currently relies on each unpainted object having a unique renderer.
- if (paintInfo.phase == PaintPhaseForeground)
- page->addRelevantRepaintedObject(renderer(), IntRect(boxOrigin.x(), boxOrigin.y(), logicalWidth(), logicalHeight()));
- }
- }
-
- // 2. Now paint the foreground, including text and decorations like underline/overline (in quirks mode only).
+ // Determine the text colors and selection colors.
Color textFillColor;
Color textStrokeColor;
Color emphasisMarkColor;
@@ -660,6 +621,46 @@ void InlineTextBox::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset,
}
}
+ // Set our font.
+ const Font& font = styleToUse->font();
+
+ FloatPoint textOrigin = FloatPoint(boxOrigin.x(), boxOrigin.y() + font.fontMetrics().ascent());
+
+ if (combinedText)
+ combinedText->adjustTextOrigin(textOrigin, boxRect);
+
+ // 1. Paint backgrounds behind text if needed. Examples of such backgrounds include selection
+ // and composition underlines.
+ if (paintInfo.phase != PaintPhaseSelection && paintInfo.phase != PaintPhaseTextClip && !isPrinting) {
+#if PLATFORM(MAC)
+ // Custom highlighters go behind everything else.
+ if (styleToUse->highlight() != nullAtom && !context->paintingDisabled())
+ paintCustomHighlight(adjustedPaintOffset, styleToUse->highlight());
+#endif
+
+ if (containsComposition && !useCustomUnderlines)
+ paintCompositionBackground(context, boxOrigin, styleToUse, font,
+ renderer()->frame()->editor()->compositionStart(),
+ renderer()->frame()->editor()->compositionEnd());
+
+ paintDocumentMarkers(context, boxOrigin, styleToUse, font, true);
+
+ if (haveSelection && !useCustomUnderlines)
+ paintSelection(context, boxOrigin, styleToUse, font, selectionFillColor);
+ }
+
+ if (Frame* frame = renderer()->frame()) {
+ if (Page* page = frame->page()) {
+ // FIXME: Right now, InlineTextBoxes never call addRelevantUnpaintedObject() even though they might
+ // legitimately be unpainted if they are waiting on a slow-loading web font. We should fix that, and
+ // when we do, we will have to account for the fact the InlineTextBoxes do not always have unique
+ // renderers and Page currently relies on each unpainted object having a unique renderer.
+ if (paintInfo.phase == PaintPhaseForeground)
+ page->addRelevantRepaintedObject(renderer(), IntRect(boxOrigin.x(), boxOrigin.y(), logicalWidth(), logicalHeight()));
+ }
+ }
+
+ // 2. Now paint the foreground, including text and decorations like underline/overline (in quirks mode only).
int length = m_len;
int maximumLength;
const UChar* characters;
@@ -806,7 +807,7 @@ void InlineTextBox::selectionStartEnd(int& sPos, int& ePos)
ePos = min(endPos - m_start, (int)m_len);
}
-void InlineTextBox::paintSelection(GraphicsContext* context, const FloatPoint& boxOrigin, RenderStyle* style, const Font& font)
+void InlineTextBox::paintSelection(GraphicsContext* context, const FloatPoint& boxOrigin, RenderStyle* style, const Font& font, Color textColor)
{
if (context->paintingDisabled())
return;
@@ -817,13 +818,12 @@ void InlineTextBox::paintSelection(GraphicsContext* context, const FloatPoint& b
if (sPos >= ePos)
return;
- Color textColor = style->visitedDependentColor(CSSPropertyColor);
Color c = renderer()->selectionBackgroundColor();
if (!c.isValid() || c.alpha() == 0)
return;
// If the text color ends up being the same as the selection background, invert the selection
- // background. This should basically never happen, since the selection has transparency.
+ // background.
if (textColor == c)
c = Color(0xff - c.red(), 0xff - c.green(), 0xff - c.blue());
@@ -915,7 +915,7 @@ void InlineTextBox::paintDecoration(GraphicsContext* context, const FloatPoint&
// Get the text decoration colors.
Color underline, overline, linethrough;
- renderer()->getTextDecorationColors(deco, underline, overline, linethrough, true);
+ renderer()->getTextDecorationColors(deco, underline, overline, linethrough, true, isFirstLineStyle());
// Use a special function for underlines to get the positioning exactly right.
bool isPrinting = textRenderer()->document()->printing();
@@ -1331,7 +1331,8 @@ TextRun InlineTextBox::constructTextRun(RenderStyle* style, const Font& font, co
ASSERT(maximumLength >= length);
- TextRun run(characters, length, textRenderer->allowTabs(), textPos(), expansion(), expansionBehavior(), direction(), dirOverride() || style->rtlOrdering() == VisualOrder, !textRenderer->canUseSimpleFontCodePath());
+ TextRun run(characters, length, textPos(), expansion(), expansionBehavior(), direction(), dirOverride() || style->rtlOrdering() == VisualOrder, !textRenderer->canUseSimpleFontCodePath());
+ run.setTabSize(!style->collapseWhiteSpace(), style->tabSize());
if (textRunNeedsRenderingContext(font))
run.setRenderingContext(SVGTextRunRenderingContext::create(textRenderer));
diff --git a/Source/WebCore/rendering/InlineTextBox.h b/Source/WebCore/rendering/InlineTextBox.h
index a9bde74f0..1b7a3ad03 100644
--- a/Source/WebCore/rendering/InlineTextBox.h
+++ b/Source/WebCore/rendering/InlineTextBox.h
@@ -181,7 +181,7 @@ protected:
private:
void paintDecoration(GraphicsContext*, const FloatPoint& boxOrigin, int decoration, const ShadowData*);
- void paintSelection(GraphicsContext*, const FloatPoint& boxOrigin, RenderStyle*, const Font&);
+ void paintSelection(GraphicsContext*, const FloatPoint& boxOrigin, RenderStyle*, const Font&, Color textColor);
void paintDocumentMarker(GraphicsContext*, const FloatPoint& boxOrigin, DocumentMarker*, RenderStyle*, const Font&, bool grammar);
void paintTextMatchMarker(GraphicsContext*, const FloatPoint& boxOrigin, DocumentMarker*, RenderStyle*, const Font&);
void computeRectForReplacementMarker(DocumentMarker*, RenderStyle*, const Font&);
diff --git a/Source/WebCore/rendering/LayoutTypes.h b/Source/WebCore/rendering/LayoutTypes.h
index dd56ad710..14906be47 100644
--- a/Source/WebCore/rendering/LayoutTypes.h
+++ b/Source/WebCore/rendering/LayoutTypes.h
@@ -155,6 +155,11 @@ inline LayoutUnit clampToLayoutUnit(double value)
return clampTo<FractionalLayoutUnit>(value, FractionalLayoutUnit::min(), FractionalLayoutUnit::max());
}
+inline IntSize pixelSnappedIntSize(const FractionalLayoutSize& s, const FractionalLayoutPoint& p)
+{
+ return IntSize(snapSizeToPixel(s.width(), p.x()), snapSizeToPixel(s.height(), p.y()));
+}
+
inline IntRect pixelSnappedIntRect(LayoutPoint location, LayoutSize size)
{
return IntRect(roundedIntPoint(location), pixelSnappedIntSize(size, location));
diff --git a/Source/WebCore/rendering/RenderBlock.cpp b/Source/WebCore/rendering/RenderBlock.cpp
index d03463b51..4c2899e0f 100755
--- a/Source/WebCore/rendering/RenderBlock.cpp
+++ b/Source/WebCore/rendering/RenderBlock.cpp
@@ -634,6 +634,13 @@ void RenderBlock::splitBlocks(RenderBlock* fromBlock, RenderBlock* toBlock,
currChildNextSibling = 0; // We destroyed the last child, so now we need to update
// the value of currChildNextSibling.
+ // It is possible that positioned objects under blockCurr are going to be moved to cloneBlock.
+ // Since we are doing layout anyway, it is easier to blow away the entire list, than
+ // traversing down the subtree looking for positioned children and then remove them
+ // from our positioned objects list.
+ if (currChildNextSibling)
+ blockCurr->removePositionedObjects(0);
+
// Now we need to take all of the children starting from the first child
// *after* currChild and append them all to the clone.
blockCurr->moveChildrenTo(cloneBlock, currChildNextSibling, 0, true);
@@ -1229,7 +1236,7 @@ bool RenderBlock::isSelfCollapsingBlock() const
// (c) have border/padding,
// (d) have a min-height
// (e) have specified that one of our margins can't collapse using a CSS extension
- if (logicalHeight() > 0
+ if (logicalHeight() > ZERO_LAYOUT_UNIT
|| isTable() || borderAndPaddingLogicalHeight()
|| style()->logicalMinHeight().isPositive()
|| style()->marginBeforeCollapse() == MSEPARATE || style()->marginAfterCollapse() == MSEPARATE)
@@ -1374,7 +1381,7 @@ void RenderBlock::layoutBlock(bool relayoutChildren, LayoutUnit pageLogicalHeigh
clearFloats();
LayoutUnit previousHeight = logicalHeight();
- setLogicalHeight(0);
+ setLogicalHeight(ZERO_LAYOUT_UNIT);
bool hasSpecifiedPageLogicalHeight = false;
bool pageLogicalHeightChanged = false;
ColumnInfo* colInfo = columnInfo();
@@ -1384,11 +1391,11 @@ void RenderBlock::layoutBlock(bool relayoutChildren, LayoutUnit pageLogicalHeigh
// avoid doing two layout passes.
computeLogicalHeight();
LayoutUnit columnHeight = contentLogicalHeight();
- if (columnHeight > 0) {
+ if (columnHeight > ZERO_LAYOUT_UNIT) {
pageLogicalHeight = columnHeight;
hasSpecifiedPageLogicalHeight = true;
}
- setLogicalHeight(0);
+ setLogicalHeight(ZERO_LAYOUT_UNIT);
}
if (colInfo->columnHeight() != pageLogicalHeight && everHadLayout()) {
colInfo->setColumnHeight(pageLogicalHeight);
@@ -1447,9 +1454,9 @@ void RenderBlock::layoutBlock(bool relayoutChildren, LayoutUnit pageLogicalHeigh
layer()->setHasVerticalScrollbar(true);
}
- LayoutUnit repaintLogicalTop = 0;
- LayoutUnit repaintLogicalBottom = 0;
- LayoutUnit maxFloatLogicalBottom = 0;
+ LayoutUnit repaintLogicalTop = ZERO_LAYOUT_UNIT;
+ LayoutUnit repaintLogicalBottom = ZERO_LAYOUT_UNIT;
+ LayoutUnit maxFloatLogicalBottom = ZERO_LAYOUT_UNIT;
if (!firstChild() && !isAnonymousBlock())
setChildrenInline(true);
if (childrenInline())
@@ -1586,9 +1593,9 @@ void RenderBlock::computeOverflow(LayoutUnit oldClientAfterEdge, bool recomputeF
LayoutRect clientRect(clientBoxRect());
LayoutRect rectToApply;
if (isHorizontalWritingMode())
- rectToApply = LayoutRect(clientRect.x(), clientRect.y(), 1, max<LayoutUnit>(0, oldClientAfterEdge - clientRect.y()));
+ rectToApply = LayoutRect(clientRect.x(), clientRect.y(), 1, max(ZERO_LAYOUT_UNIT, oldClientAfterEdge - clientRect.y()));
else
- rectToApply = LayoutRect(clientRect.x(), clientRect.y(), max<LayoutUnit>(0, oldClientAfterEdge - clientRect.x()), 1);
+ rectToApply = LayoutRect(clientRect.x(), clientRect.y(), max(ZERO_LAYOUT_UNIT, oldClientAfterEdge - clientRect.x()), 1);
addLayoutOverflow(rectToApply);
}
@@ -1949,7 +1956,7 @@ LayoutUnit RenderBlock::clearFloatsIfNeeded(RenderBox* child, MarginInfo& margin
// Adjust our height such that we are ready to be collapsed with subsequent siblings (or the bottom
// of the parent block).
- setLogicalHeight(child->y() - max<LayoutUnit>(0, marginInfo.margin()));
+ setLogicalHeight(child->y() - max(ZERO_LAYOUT_UNIT, marginInfo.margin()));
} else
// Increase our height by the amount we had to clear.
setLogicalHeight(height() + heightIncrease);
@@ -2713,7 +2720,7 @@ void RenderBlock::paintChildren(PaintInfo& paintInfo, const LayoutPoint& paintOf
if (checkAfterAlways
&& (absoluteChildY + child->height()) > paintInfo.rect.y()
&& (absoluteChildY + child->height()) < paintInfo.rect.maxY()) {
- view()->setBestTruncatedAt(absoluteChildY + child->height() + max<LayoutUnit>(0, child->collapsedMarginAfter()), this, true);
+ view()->setBestTruncatedAt(absoluteChildY + child->height() + max(ZERO_LAYOUT_UNIT, child->collapsedMarginAfter()), this, true);
return;
}
}
@@ -3261,14 +3268,14 @@ LayoutRect RenderBlock::blockSelectionGap(RenderBlock* rootBlock, const LayoutPo
{
LayoutUnit logicalTop = lastLogicalTop;
LayoutUnit logicalHeight = blockDirectionOffset(rootBlock, offsetFromRootBlock) + logicalBottom - logicalTop;
- if (logicalHeight <= static_cast<LayoutUnit>(0))
+ if (logicalHeight <= ZERO_LAYOUT_UNIT)
return LayoutRect();
// Get the selection offsets for the bottom of the gap
LayoutUnit logicalLeft = max(lastLogicalLeft, logicalLeftSelectionOffset(rootBlock, logicalBottom));
LayoutUnit logicalRight = min(lastLogicalRight, logicalRightSelectionOffset(rootBlock, logicalBottom));
LayoutUnit logicalWidth = logicalRight - logicalLeft;
- if (logicalWidth <= static_cast<LayoutUnit>(0))
+ if (logicalWidth <= ZERO_LAYOUT_UNIT)
return LayoutRect();
LayoutRect gapRect = rootBlock->logicalRectToPhysicalRect(rootBlockPhysicalPosition, LayoutRect(logicalLeft, logicalTop, logicalWidth, logicalHeight));
@@ -3284,7 +3291,7 @@ LayoutRect RenderBlock::logicalLeftSelectionGap(RenderBlock* rootBlock, const La
LayoutUnit rootBlockLogicalLeft = max(logicalLeftSelectionOffset(rootBlock, logicalTop), logicalLeftSelectionOffset(rootBlock, logicalTop + logicalHeight));
LayoutUnit rootBlockLogicalRight = min(inlineDirectionOffset(rootBlock, offsetFromRootBlock) + logicalLeft, min(logicalRightSelectionOffset(rootBlock, logicalTop), logicalRightSelectionOffset(rootBlock, logicalTop + logicalHeight)));
LayoutUnit rootBlockLogicalWidth = rootBlockLogicalRight - rootBlockLogicalLeft;
- if (rootBlockLogicalWidth <= static_cast<LayoutUnit>(0))
+ if (rootBlockLogicalWidth <= ZERO_LAYOUT_UNIT)
return LayoutRect();
LayoutRect gapRect = rootBlock->logicalRectToPhysicalRect(rootBlockPhysicalPosition, LayoutRect(rootBlockLogicalLeft, rootBlockLogicalTop, rootBlockLogicalWidth, logicalHeight));
@@ -3300,7 +3307,7 @@ LayoutRect RenderBlock::logicalRightSelectionGap(RenderBlock* rootBlock, const L
LayoutUnit rootBlockLogicalLeft = max(inlineDirectionOffset(rootBlock, offsetFromRootBlock) + logicalRight, max(logicalLeftSelectionOffset(rootBlock, logicalTop), logicalLeftSelectionOffset(rootBlock, logicalTop + logicalHeight)));
LayoutUnit rootBlockLogicalRight = min(logicalRightSelectionOffset(rootBlock, logicalTop), logicalRightSelectionOffset(rootBlock, logicalTop + logicalHeight));
LayoutUnit rootBlockLogicalWidth = rootBlockLogicalRight - rootBlockLogicalLeft;
- if (rootBlockLogicalWidth <= static_cast<LayoutUnit>(0))
+ if (rootBlockLogicalWidth <= ZERO_LAYOUT_UNIT)
return LayoutRect();
LayoutRect gapRect = rootBlock->logicalRectToPhysicalRect(rootBlockPhysicalPosition, LayoutRect(rootBlockLogicalLeft, rootBlockLogicalTop, rootBlockLogicalWidth, logicalHeight));
@@ -3568,7 +3575,7 @@ LayoutPoint RenderBlock::computeLogicalLocationForFloat(const FloatingObject* fl
floatLogicalWidth = min(logicalWidthForFloat(floatingObject), logicalRightOffset - logicalLeftOffset);
}
}
- floatLogicalLeft = max<LayoutUnit>(logicalLeftOffset - borderAndPaddingLogicalLeft(), floatLogicalLeft);
+ floatLogicalLeft = max(logicalLeftOffset - borderAndPaddingLogicalLeft(), floatLogicalLeft);
} else {
LayoutUnit heightRemainingLeft = 1;
LayoutUnit heightRemainingRight = 1;
@@ -3962,8 +3969,8 @@ LayoutUnit RenderBlock::nextFloatLogicalBottomBelow(LayoutUnit logicalHeight) co
LayoutUnit RenderBlock::lowestFloatLogicalBottom(FloatingObject::Type floatType) const
{
if (!m_floatingObjects)
- return 0;
- LayoutUnit lowestFloatBottom = 0;
+ return ZERO_LAYOUT_UNIT;
+ LayoutUnit lowestFloatBottom = ZERO_LAYOUT_UNIT;
const FloatingObjectSet& floatingObjectSet = m_floatingObjects->set();
FloatingObjectSetIterator end = floatingObjectSet.end();
for (FloatingObjectSetIterator it = floatingObjectSet.begin(); it != end; ++it) {
@@ -4340,7 +4347,7 @@ LayoutUnit RenderBlock::getClearDelta(RenderBox* child, LayoutUnit logicalTop)
}
// We also clear floats if we are too big to sit on the same line as a float (and wish to avoid floats by default).
- LayoutUnit result = clearSet ? max<LayoutUnit>(0, logicalBottom - logicalTop) : ZERO_LAYOUT_UNIT;
+ LayoutUnit result = clearSet ? max(ZERO_LAYOUT_UNIT, logicalBottom - logicalTop) : ZERO_LAYOUT_UNIT;
if (!result && child->avoidsFloats()) {
LayoutUnit newLogicalTop = logicalTop;
while (true) {
@@ -5160,7 +5167,7 @@ void RenderBlock::computePreferredLogicalWidths()
updateFirstLetter();
RenderStyle* styleToUse = style();
- if (!isTableCell() && styleToUse->logicalWidth().isFixed() && styleToUse->logicalWidth().value() > 0 && style()->marqueeBehavior() != MALTERNATE)
+ if (!isTableCell() && styleToUse->logicalWidth().isFixed() && styleToUse->logicalWidth().value() >= 0 && style()->marqueeBehavior() != MALTERNATE)
m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = computeContentBoxLogicalWidth(styleToUse->logicalWidth().value());
else {
m_minPreferredLogicalWidth = 0;
@@ -5683,8 +5690,8 @@ void RenderBlock::computeBlockPreferredLogicalWidths()
}
// Always make sure these values are non-negative.
- m_minPreferredLogicalWidth = max<LayoutUnit>(0, m_minPreferredLogicalWidth);
- m_maxPreferredLogicalWidth = max<LayoutUnit>(0, m_maxPreferredLogicalWidth);
+ m_minPreferredLogicalWidth = max(ZERO_LAYOUT_UNIT, m_minPreferredLogicalWidth);
+ m_maxPreferredLogicalWidth = max(ZERO_LAYOUT_UNIT, m_maxPreferredLogicalWidth);
m_maxPreferredLogicalWidth = max(floatLeftWidth + floatRightWidth, m_maxPreferredLogicalWidth);
}
@@ -5883,6 +5890,58 @@ static inline bool shouldSkipForFirstLetter(UChar c)
return isSpaceOrNewline(c) || c == noBreakSpace || isPunctuationForFirstLetter(c);
}
+RenderObject* RenderBlock::findLastObjectWithFirstLetterText(RenderObject* child, RenderObject* &firstLetterBlock)
+{
+ while (child) {
+ RenderObject* nextChild = child->nextSibling();
+ // Style and skip over any objects such as quotes or punctuation
+ child = findLastObjectAfterFirstLetterPunctuation(child, firstLetterBlock);
+ if (child)
+ break;
+ child = nextChild;
+ }
+ return child;
+}
+
+RenderObject* RenderBlock::findLastObjectAfterFirstLetterPunctuation(RenderObject* child, RenderObject* &firstLetterBlock)
+{
+ if (child->isText()) {
+ // CSS 2.1 http://www.w3.org/TR/CSS21/selector.html#first-letter
+ // "The first letter must occur on the first formatted line."
+ if (child->isBR())
+ return child;
+
+ // If child is a single punctuation mark or a Render Quote then style it as first-letter now and keep looking for further text,
+ bool textQuote = toRenderText(child)->textLength() == 1 && isPunctuationForFirstLetter(toRenderText(child)->characters()[0]);
+ if (child->isQuote() || textQuote)
+ addFirstLetter(child, firstLetterBlock);
+ else if (!toRenderText(child)->isAllCollapsibleWhitespace())
+ return child;
+ return 0;
+ }
+
+ if (child->isListMarker())
+ return 0;
+
+ if (child->isFloatingOrPositioned()) {
+ // Floats and positioned objects do not inherit their style from parents so if it is styled
+ // inspect its children for text, otherwise move on to its sibling.
+ if (child->style()->styleType() == FIRST_LETTER)
+ return findLastObjectWithFirstLetterText(child->firstChild(), firstLetterBlock);
+ return 0;
+ }
+
+ if (child->isReplaced() || child->isRenderButton() || child->isMenuList())
+ return child;
+
+ if (child->style()->hasPseudoStyle(FIRST_LETTER) && child->canHaveChildren()) {
+ // We found a lower-level node with first-letter, which supersedes the higher-level style.
+ firstLetterBlock = child;
+ return findLastObjectWithFirstLetterText(child->firstChild(), firstLetterBlock);
+ }
+ return findLastObjectWithFirstLetterText(child->firstChild(), firstLetterBlock);
+}
+
static inline RenderObject* findFirstLetterBlock(RenderBlock* start)
{
RenderObject* firstLetterBlock = start;
@@ -5938,6 +5997,9 @@ void RenderBlock::updateFirstLetterStyle(RenderObject* firstLetterBlock, RenderO
remainingText->setFirstLetter(newFirstLetter);
toRenderBoxModelObject(newFirstLetter)->setFirstLetterRemainingText(remainingText);
}
+ // To prevent removal of single anonymous block in RenderBlock::removeChild and causing
+ // |nextSibling| to go stale, we remove the old first letter using removeChildNode first.
+ firstLetterContainer->virtualChildren()->removeChildNode(firstLetterContainer, firstLetter);
firstLetter->destroy();
firstLetter = newFirstLetter;
firstLetterContainer->addChild(firstLetter, nextSibling);
@@ -6029,47 +6091,36 @@ void RenderBlock::updateFirstLetter()
if (!firstLetterBlock)
return;
- // Drill into inlines looking for our first text child.
- RenderObject* currChild = firstLetterBlock->firstChild();
- while (currChild) {
- if (currChild->isText())
- break;
- if (currChild->isListMarker())
- currChild = currChild->nextSibling();
- else if (currChild->isFloatingOrPositioned()) {
- if (currChild->style()->styleType() == FIRST_LETTER) {
- currChild = currChild->firstChild();
- break;
- }
- currChild = currChild->nextSibling();
- } else if (currChild->isReplaced() || currChild->isRenderButton() || currChild->isMenuList())
- break;
- else if (currChild->style()->hasPseudoStyle(FIRST_LETTER) && canHaveGeneratedChildren(currChild)) {
- // We found a lower-level node with first-letter, which supersedes the higher-level style
- firstLetterBlock = currChild;
- currChild = currChild->firstChild();
- } else
- currChild = currChild->firstChild();
- }
+ // Check each sibling and drill into its inlines until we find a text node that is not all whitespace
+ // or is a line break.
+ RenderObject* firstLetterObject = firstLetterBlock->firstChild();
+
+ firstLetterObject = findLastObjectWithFirstLetterText(firstLetterObject, firstLetterBlock);
- if (!currChild)
+ if (!firstLetterObject)
return;
+
+ addFirstLetter(firstLetterObject, firstLetterBlock);
+}
+
+void RenderBlock::addFirstLetter(RenderObject* firstLetterObject, RenderObject* &firstLetterBlock)
+{
// If the child already has style, then it has already been created, so we just want
// to update it.
- if (currChild->parent()->style()->styleType() == FIRST_LETTER) {
- updateFirstLetterStyle(firstLetterBlock, currChild);
+ if (firstLetterObject->parent()->style()->styleType() == FIRST_LETTER) {
+ updateFirstLetterStyle(firstLetterBlock, firstLetterObject);
return;
}
- if (!currChild->isText() || currChild->isBR())
+ if (!firstLetterObject->isText() || firstLetterObject->isBR())
return;
// Our layout state is not valid for the repaints we are going to trigger by
// adding and removing children of firstLetterContainer.
LayoutStateDisabler layoutStateDisabler(view());
- createFirstLetterRenderer(firstLetterBlock, currChild);
+ createFirstLetterRenderer(firstLetterBlock, firstLetterObject);
}
// Helper methods for obtaining the last line, computing line counts and heights for line counts
@@ -6480,8 +6531,8 @@ void RenderBlock::addFocusRingRects(Vector<IntRect>& rects, const LayoutPoint& a
// FIXME: This is wrong for block-flows that are horizontal.
// https://bugs.webkit.org/show_bug.cgi?id=46781
bool prevInlineHasLineBox = toRenderInline(inlineElementContinuation()->node()->renderer())->firstLineBox();
- float topMargin = prevInlineHasLineBox ? collapsedMarginBefore() : static_cast<LayoutUnit>(0);
- float bottomMargin = nextInlineHasLineBox ? collapsedMarginAfter() : static_cast<LayoutUnit>(0);
+ float topMargin = prevInlineHasLineBox ? collapsedMarginBefore() : ZERO_LAYOUT_UNIT;
+ float bottomMargin = nextInlineHasLineBox ? collapsedMarginAfter() : ZERO_LAYOUT_UNIT;
LayoutRect rect(additionalOffset.x(), additionalOffset.y() - topMargin, width(), height() + topMargin + bottomMargin);
if (!rect.isEmpty())
rects.append(pixelSnappedIntRect(rect));
@@ -6733,10 +6784,10 @@ void RenderBlock::adjustLinePositionForPagination(RootInlineBox* lineBox, Layout
// If we have a non-uniform page height, then we have to shift further possibly.
if (!hasUniformPageLogicalHeight && !pushToNextPageWithMinimumLogicalHeight(remainingLogicalHeight, logicalOffset, lineHeight))
return;
- LayoutUnit totalLogicalHeight = lineHeight + max<LayoutUnit>(0, logicalOffset);
+ LayoutUnit totalLogicalHeight = lineHeight + max(ZERO_LAYOUT_UNIT, logicalOffset);
LayoutUnit pageLogicalHeightAtNewOffset = hasUniformPageLogicalHeight ? pageLogicalHeight : pageLogicalHeightForOffset(logicalOffset + remainingLogicalHeight);
if (lineBox == firstRootBox() && totalLogicalHeight < pageLogicalHeightAtNewOffset && !isPositioned() && !isTableCell())
- setPaginationStrut(remainingLogicalHeight + max<LayoutUnit>(0, logicalOffset));
+ setPaginationStrut(remainingLogicalHeight + max(ZERO_LAYOUT_UNIT, logicalOffset));
else {
delta += remainingLogicalHeight;
lineBox->setPaginationStrut(remainingLogicalHeight);
@@ -7223,7 +7274,7 @@ TextRun RenderBlock::constructTextRun(RenderObject* context, const Font& font, c
directionalOverride |= isOverride(style->unicodeBidi());
}
- TextRun run(characters, length, false, 0, 0, expansion, textDirection, directionalOverride);
+ TextRun run(characters, length, 0, 0, expansion, textDirection, directionalOverride);
if (textRunNeedsRenderingContext(font))
run.setRenderingContext(SVGTextRunRenderingContext::create(context));
diff --git a/Source/WebCore/rendering/RenderBlock.h b/Source/WebCore/rendering/RenderBlock.h
index 2f6f4b6de..a3cc33ea6 100644
--- a/Source/WebCore/rendering/RenderBlock.h
+++ b/Source/WebCore/rendering/RenderBlock.h
@@ -131,7 +131,7 @@ public:
// compute the region all over again when you already know it.
LayoutUnit availableLogicalWidthForLine(LayoutUnit position, bool firstLine, RenderRegion* region, LayoutUnit offsetFromLogicalTopOfFirstPage) const
{
- return max<LayoutUnit>(0, logicalRightOffsetForLine(position, firstLine, region, offsetFromLogicalTopOfFirstPage)
+ return max(ZERO_LAYOUT_UNIT, logicalRightOffsetForLine(position, firstLine, region, offsetFromLogicalTopOfFirstPage)
- logicalLeftOffsetForLine(position, firstLine, region, offsetFromLogicalTopOfFirstPage));
}
LayoutUnit logicalRightOffsetForLine(LayoutUnit position, bool firstLine, RenderRegion* region, LayoutUnit offsetFromLogicalTopOfFirstPage) const
@@ -332,7 +332,7 @@ public:
LayoutUnit logicalRightOffsetForContent(RenderRegion*, LayoutUnit offsetFromLogicalTopOfFirstPage) const;
LayoutUnit availableLogicalWidthForContent(RenderRegion* region, LayoutUnit offsetFromLogicalTopOfFirstPage) const
{
- return max<LayoutUnit>(0, logicalRightOffsetForContent(region, offsetFromLogicalTopOfFirstPage) -
+ return max(ZERO_LAYOUT_UNIT, logicalRightOffsetForContent(region, offsetFromLogicalTopOfFirstPage) -
logicalLeftOffsetForContent(region, offsetFromLogicalTopOfFirstPage)); }
LayoutUnit startOffsetForContent(RenderRegion* region, LayoutUnit offsetFromLogicalTopOfFirstPage) const
{
@@ -505,6 +505,9 @@ private:
void createFirstLetterRenderer(RenderObject* firstLetterBlock, RenderObject* currentChild);
void updateFirstLetterStyle(RenderObject* firstLetterBlock, RenderObject* firstLetterContainer);
+ RenderObject* findLastObjectWithFirstLetterText(RenderObject* child, RenderObject* &firstLetterBlock);
+ RenderObject* findLastObjectAfterFirstLetterPunctuation(RenderObject* child, RenderObject* &firstLetterBlock);
+ void addFirstLetter(RenderObject* firstLetterObject, RenderObject* &firstLetterBlock);
struct FloatWithRect {
FloatWithRect(RenderBox* f)
@@ -564,19 +567,19 @@ private:
bool isPlaced() const { return m_isPlaced; }
void setIsPlaced(bool placed = true) { m_isPlaced = placed; }
- LayoutUnit x() const { ASSERT(isPlaced()); return m_frameRect.x(); }
- LayoutUnit maxX() const { ASSERT(isPlaced()); return m_frameRect.maxX(); }
- LayoutUnit y() const { ASSERT(isPlaced()); return m_frameRect.y(); }
- LayoutUnit maxY() const { ASSERT(isPlaced()); return m_frameRect.maxY(); }
- LayoutUnit width() const { return m_frameRect.width(); }
- LayoutUnit height() const { return m_frameRect.height(); }
+ inline LayoutUnit x() const { ASSERT(isPlaced()); return m_frameRect.x(); }
+ inline LayoutUnit maxX() const { ASSERT(isPlaced()); return m_frameRect.maxX(); }
+ inline LayoutUnit y() const { ASSERT(isPlaced()); return m_frameRect.y(); }
+ inline LayoutUnit maxY() const { ASSERT(isPlaced()); return m_frameRect.maxY(); }
+ inline LayoutUnit width() const { return m_frameRect.width(); }
+ inline LayoutUnit height() const { return m_frameRect.height(); }
- int pixelSnappedX() const { ASSERT(isPlaced()); return m_frameRect.pixelSnappedX(); }
- int pixelSnappedMaxX() const { ASSERT(isPlaced()); return m_frameRect.pixelSnappedMaxX(); }
- int pixelSnappedY() const { ASSERT(isPlaced()); return m_frameRect.pixelSnappedY(); }
- int pixelSnappedMaxY() const { ASSERT(isPlaced()); return m_frameRect.pixelSnappedMaxY(); }
- int pixelSnappedWidth() const { return m_frameRect.pixelSnappedWidth(); }
- int pixelSnappedHeight() const { return m_frameRect.pixelSnappedHeight(); }
+ inline int pixelSnappedX() const { ASSERT(isPlaced()); return m_frameRect.pixelSnappedX(); }
+ inline int pixelSnappedMaxX() const { ASSERT(isPlaced()); return m_frameRect.pixelSnappedMaxX(); }
+ inline int pixelSnappedY() const { ASSERT(isPlaced()); return m_frameRect.pixelSnappedY(); }
+ inline int pixelSnappedMaxY() const { ASSERT(isPlaced()); return m_frameRect.pixelSnappedMaxY(); }
+ inline int pixelSnappedWidth() const { return m_frameRect.pixelSnappedWidth(); }
+ inline int pixelSnappedHeight() const { return m_frameRect.pixelSnappedHeight(); }
void setX(LayoutUnit x) { ASSERT(!isInPlacedTree()); m_frameRect.setX(x); }
void setY(LayoutUnit y) { ASSERT(!isInPlacedTree()); m_frameRect.setY(y); }
@@ -865,7 +868,11 @@ private:
void setAtBeforeSideOfBlock(bool b) { m_atBeforeSideOfBlock = b; }
void setAtAfterSideOfBlock(bool b) { m_atAfterSideOfBlock = b; }
- void clearMargin() { m_positiveMargin = m_negativeMargin = 0; }
+ void clearMargin()
+ {
+ m_positiveMargin = 0;
+ m_negativeMargin = 0;
+ }
void setMarginBeforeQuirk(bool b) { m_marginBeforeQuirk = b; }
void setMarginAfterQuirk(bool b) { m_marginAfterQuirk = b; }
void setDeterminedMarginBeforeQuirk(bool b) { m_determinedMarginBeforeQuirk = b; }
@@ -1068,20 +1075,20 @@ protected:
static LayoutUnit positiveMarginBeforeDefault(const RenderBlock* block)
{
- return std::max<LayoutUnit>(block->marginBefore(), 0);
+ return std::max(block->marginBefore(), ZERO_LAYOUT_UNIT);
}
static LayoutUnit negativeMarginBeforeDefault(const RenderBlock* block)
{
- return std::max<LayoutUnit>(-block->marginBefore(), 0);
+ return std::max(-block->marginBefore(), ZERO_LAYOUT_UNIT);
}
static LayoutUnit positiveMarginAfterDefault(const RenderBlock* block)
{
- return std::max<LayoutUnit>(block->marginAfter(), 0);
+ return std::max(block->marginAfter(), ZERO_LAYOUT_UNIT);
}
static LayoutUnit negativeMarginAfterDefault(const RenderBlock* block)
{
- return std::max<LayoutUnit>(-block->marginAfter(), 0);
+ return std::max(-block->marginAfter(), ZERO_LAYOUT_UNIT);
}
MarginValues m_margins;
diff --git a/Source/WebCore/rendering/RenderBlockLineLayout.cpp b/Source/WebCore/rendering/RenderBlockLineLayout.cpp
index bceb24ac7..362d31fc7 100755
--- a/Source/WebCore/rendering/RenderBlockLineLayout.cpp
+++ b/Source/WebCore/rendering/RenderBlockLineLayout.cpp
@@ -1948,7 +1948,7 @@ static inline float textWidth(RenderText* text, unsigned from, unsigned len, con
ASSERT(run.charactersLength() >= run.length());
run.setCharacterScanForCodePath(!text->canUseSimpleFontCodePath());
- run.setAllowTabs(!collapseWhiteSpace);
+ run.setTabSize(!collapseWhiteSpace, text->style()->tabSize());
run.setXPos(xPos);
return font.width(run);
}
@@ -1980,7 +1980,7 @@ static void tryHyphenating(RenderText* text, const Font& font, const AtomicStrin
run.setCharactersLength(text->textLength() - lastSpace);
ASSERT(run.charactersLength() >= run.length());
- run.setAllowTabs(!collapseWhiteSpace);
+ run.setTabSize(!collapseWhiteSpace, text->style()->tabSize());
run.setXPos(xPos + lastSpaceWordSpacing);
unsigned prefixLength = font.offsetForPosition(run, maxPrefixWidth, false);
diff --git a/Source/WebCore/rendering/RenderBox.cpp b/Source/WebCore/rendering/RenderBox.cpp
index b906ec94d..199deb6b2 100644
--- a/Source/WebCore/rendering/RenderBox.cpp
+++ b/Source/WebCore/rendering/RenderBox.cpp
@@ -256,11 +256,6 @@ void RenderBox::willBeDestroyed()
if (styleToUse) {
if (RenderView* view = this->view()) {
if (FrameView* frameView = view->frameView()) {
- // If this renderer is owning renderer for the FrameView's custom scrollbars,
- // we need to clear it from the scrollbar. See webkit bug 64737.
- if (styleToUse->hasPseudoStyle(SCROLLBAR))
- frameView->clearOwningRendererForCustomScrollbars(this);
-
if (styleToUse->position() == FixedPosition)
frameView->removeFixedObject();
}
@@ -3912,6 +3907,16 @@ LayoutRect RenderBox::layoutOverflowRectForPropagation(RenderStyle* parentStyle)
return rect;
}
+LayoutUnit RenderBox::offsetLeft() const
+{
+ return offsetTopLeft(topLeftLocation()).x();
+}
+
+LayoutUnit RenderBox::offsetTop() const
+{
+ return offsetTopLeft(topLeftLocation()).y();
+}
+
LayoutPoint RenderBox::flipForWritingModeForChild(const RenderBox* child, const LayoutPoint& point) const
{
if (!style()->isFlippedBlocksWritingMode())
diff --git a/Source/WebCore/rendering/RenderBox.h b/Source/WebCore/rendering/RenderBox.h
index 794ed39e2..9f00a44e3 100644
--- a/Source/WebCore/rendering/RenderBox.h
+++ b/Source/WebCore/rendering/RenderBox.h
@@ -433,6 +433,9 @@ public:
virtual LayoutUnit lineHeight(bool firstLine, LineDirectionMode, LinePositionMode = PositionOnContainingLine) const;
virtual LayoutUnit baselinePosition(FontBaseline, bool firstLine, LineDirectionMode, LinePositionMode = PositionOnContainingLine) const;
+ virtual LayoutUnit offsetLeft() const OVERRIDE;
+ virtual LayoutUnit offsetTop() const OVERRIDE;
+
LayoutPoint flipForWritingModeForChild(const RenderBox* child, const LayoutPoint&) const;
LayoutUnit flipForWritingMode(LayoutUnit position) const; // The offset is in the block direction (y for horizontal writing modes, x for vertical writing modes).
LayoutPoint flipForWritingMode(const LayoutPoint&) const;
diff --git a/Source/WebCore/rendering/RenderBoxModelObject.cpp b/Source/WebCore/rendering/RenderBoxModelObject.cpp
index eed3577a3..fcca1b3d5 100644
--- a/Source/WebCore/rendering/RenderBoxModelObject.cpp
+++ b/Source/WebCore/rendering/RenderBoxModelObject.cpp
@@ -411,15 +411,6 @@ void RenderBoxModelObject::styleWillChange(StyleDifference diff, const RenderSty
repaint();
}
}
-
- if (hasLayer()
- && (oldStyle->hasAutoZIndex() != newStyle->hasAutoZIndex()
- || oldStyle->zIndex() != newStyle->zIndex()
- || oldStyle->visibility() != newStyle->visibility())) {
- layer()->dirtyStackingContextZOrderLists();
- if (oldStyle->hasAutoZIndex() != newStyle->hasAutoZIndex() || oldStyle->visibility() != newStyle->visibility())
- layer()->dirtyZOrderLists();
- }
}
RenderObject::styleWillChange(diff, newStyle);
@@ -478,7 +469,7 @@ static LayoutUnit accumulateRelativePositionOffsets(const RenderObject* child, R
{
if (!child->isAnonymousBlock() || !child->isRelPositioned())
return 0;
- LayoutUnit offset = 0;
+ LayoutUnit offset = ZERO_LAYOUT_UNIT;
RenderObject* p = toRenderBlock(child)->inlineElementContinuation();
while (p && p->isRenderInline()) {
if (p->isRelPositioned())
@@ -535,71 +526,53 @@ LayoutUnit RenderBoxModelObject::relativePositionOffsetY() const
return offset;
}
-LayoutUnit RenderBoxModelObject::offsetLeft() const
+LayoutPoint RenderBoxModelObject::offsetTopLeft(const LayoutPoint& startPoint) const
{
// If the element is the HTML body element or does not have an associated box
// return 0 and stop this algorithm.
if (isBody())
- return 0;
+ return LayoutPoint();
- RenderBoxModelObject* offsetPar = offsetParent();
- LayoutUnit xPos = (isBox() ? toRenderBox(this)->left() : ZERO_LAYOUT_UNIT);
+ LayoutPoint referencePoint = startPoint;
+ referencePoint.move(parent()->offsetForColumns(referencePoint));
// If the offsetParent of the element is null, or is the HTML body element,
// return the distance between the canvas origin and the left border edge
// of the element and stop this algorithm.
- if (offsetPar) {
- if (offsetPar->isBox() && !offsetPar->isBody())
- xPos -= toRenderBox(offsetPar)->borderLeft();
+ if (const RenderBoxModelObject* offsetParent = this->offsetParent()) {
+ if (offsetParent->isBox() && !offsetParent->isBody())
+ referencePoint.move(-toRenderBox(offsetParent)->borderLeft(), -toRenderBox(offsetParent)->borderTop());
if (!isPositioned()) {
if (isRelPositioned())
- xPos += relativePositionOffsetX();
- RenderObject* curr = parent();
- while (curr && curr != offsetPar) {
+ referencePoint.move(relativePositionOffset());
+ const RenderObject* curr = parent();
+ while (curr != offsetParent) {
// FIXME: What are we supposed to do inside SVG content?
if (curr->isBox() && !curr->isTableRow())
- xPos += toRenderBox(curr)->left();
+ referencePoint.moveBy(toRenderBox(curr)->topLeftLocation());
+ referencePoint.move(curr->parent()->offsetForColumns(referencePoint));
curr = curr->parent();
}
- if (offsetPar->isBox() && offsetPar->isBody() && !offsetPar->isRelPositioned() && !offsetPar->isPositioned())
- xPos += toRenderBox(offsetPar)->left();
+ if (offsetParent->isBox() && offsetParent->isBody() && !offsetParent->isRelPositioned() && !offsetParent->isPositioned())
+ referencePoint.moveBy(toRenderBox(offsetParent)->topLeftLocation());
}
}
- return xPos;
+ return referencePoint;
+}
+
+LayoutUnit RenderBoxModelObject::offsetLeft() const
+{
+ // Note that RenderInline and RenderBox override this to pass a different
+ // startPoint to offsetTopLeft.
+ return offsetTopLeft(LayoutPoint()).x();
}
LayoutUnit RenderBoxModelObject::offsetTop() const
{
- // If the element is the HTML body element or does not have an associated box
- // return 0 and stop this algorithm.
- if (isBody())
- return 0;
-
- RenderBoxModelObject* offsetPar = offsetParent();
- LayoutUnit yPos = (isBox() ? toRenderBox(this)->top() : ZERO_LAYOUT_UNIT);
-
- // If the offsetParent of the element is null, or is the HTML body element,
- // return the distance between the canvas origin and the top border edge
- // of the element and stop this algorithm.
- if (offsetPar) {
- if (offsetPar->isBox() && !offsetPar->isBody())
- yPos -= toRenderBox(offsetPar)->borderTop();
- if (!isPositioned()) {
- if (isRelPositioned())
- yPos += relativePositionOffsetY();
- RenderObject* curr = parent();
- while (curr && curr != offsetPar) {
- // FIXME: What are we supposed to do inside SVG content?
- if (curr->isBox() && !curr->isTableRow())
- yPos += toRenderBox(curr)->top();
- curr = curr->parent();
- }
- if (offsetPar->isBox() && offsetPar->isBody() && !offsetPar->isRelPositioned() && !offsetPar->isPositioned())
- yPos += toRenderBox(offsetPar)->top();
- }
- }
- return yPos;
+ // Note that RenderInline and RenderBox override this to pass a different
+ // startPoint to offsetTopLeft.
+ return offsetTopLeft(LayoutPoint()).y();
}
int RenderBoxModelObject::pixelSnappedOffsetWidth() const
@@ -614,7 +587,7 @@ int RenderBoxModelObject::pixelSnappedOffsetHeight() const
LayoutUnit RenderBoxModelObject::computedCSSPaddingTop() const
{
- LayoutUnit w = 0;
+ LayoutUnit w = ZERO_LAYOUT_UNIT;
RenderView* renderView = 0;
Length padding = style()->paddingTop();
if (padding.isPercent())
@@ -626,7 +599,7 @@ LayoutUnit RenderBoxModelObject::computedCSSPaddingTop() const
LayoutUnit RenderBoxModelObject::computedCSSPaddingBottom() const
{
- LayoutUnit w = 0;
+ LayoutUnit w = ZERO_LAYOUT_UNIT;
RenderView* renderView = 0;
Length padding = style()->paddingBottom();
if (padding.isPercent())
@@ -638,7 +611,7 @@ LayoutUnit RenderBoxModelObject::computedCSSPaddingBottom() const
LayoutUnit RenderBoxModelObject::computedCSSPaddingLeft() const
{
- LayoutUnit w = 0;
+ LayoutUnit w = ZERO_LAYOUT_UNIT;
RenderView* renderView = 0;
Length padding = style()->paddingLeft();
if (padding.isPercent())
@@ -650,7 +623,7 @@ LayoutUnit RenderBoxModelObject::computedCSSPaddingLeft() const
LayoutUnit RenderBoxModelObject::computedCSSPaddingRight() const
{
- LayoutUnit w = 0;
+ LayoutUnit w = ZERO_LAYOUT_UNIT;
RenderView* renderView = 0;
Length padding = style()->paddingRight();
if (padding.isPercent())
@@ -662,7 +635,7 @@ LayoutUnit RenderBoxModelObject::computedCSSPaddingRight() const
LayoutUnit RenderBoxModelObject::computedCSSPaddingBefore() const
{
- LayoutUnit w = 0;
+ LayoutUnit w = ZERO_LAYOUT_UNIT;
RenderView* renderView = 0;
Length padding = style()->paddingBefore();
if (padding.isPercent())
@@ -674,7 +647,7 @@ LayoutUnit RenderBoxModelObject::computedCSSPaddingBefore() const
LayoutUnit RenderBoxModelObject::computedCSSPaddingAfter() const
{
- LayoutUnit w = 0;
+ LayoutUnit w = ZERO_LAYOUT_UNIT;
RenderView* renderView = 0;
Length padding = style()->paddingAfter();
if (padding.isPercent())
@@ -686,7 +659,7 @@ LayoutUnit RenderBoxModelObject::computedCSSPaddingAfter() const
LayoutUnit RenderBoxModelObject::computedCSSPaddingStart() const
{
- LayoutUnit w = 0;
+ LayoutUnit w = ZERO_LAYOUT_UNIT;
RenderView* renderView = 0;
Length padding = style()->paddingStart();
if (padding.isPercent())
@@ -698,7 +671,7 @@ LayoutUnit RenderBoxModelObject::computedCSSPaddingStart() const
LayoutUnit RenderBoxModelObject::computedCSSPaddingEnd() const
{
- LayoutUnit w = 0;
+ LayoutUnit w = ZERO_LAYOUT_UNIT;
RenderView* renderView = 0;
Length padding = style()->paddingEnd();
if (padding.isPercent())
diff --git a/Source/WebCore/rendering/RenderBoxModelObject.h b/Source/WebCore/rendering/RenderBoxModelObject.h
index 8e7fdb088..6c88f0fbf 100644
--- a/Source/WebCore/rendering/RenderBoxModelObject.h
+++ b/Source/WebCore/rendering/RenderBoxModelObject.h
@@ -227,6 +227,8 @@ protected:
IntSize m_tileSize;
};
+ LayoutPoint offsetTopLeft(const LayoutPoint&) const;
+
void calculateBackgroundImageGeometry(const FillLayer*, const LayoutRect& paintRect, BackgroundImageGeometry&);
void getBorderEdgeInfo(class BorderEdge[], const RenderStyle*, bool includeLogicalLeftEdge = true, bool includeLogicalRightEdge = true) const;
bool borderObscuresBackgroundEdge(const FloatSize& contextScale) const;
diff --git a/Source/WebCore/rendering/RenderEmbeddedObject.cpp b/Source/WebCore/rendering/RenderEmbeddedObject.cpp
index 2168a400a..55cfcfd4d 100644
--- a/Source/WebCore/rendering/RenderEmbeddedObject.cpp
+++ b/Source/WebCore/rendering/RenderEmbeddedObject.cpp
@@ -74,9 +74,9 @@ static const Color& replacementTextRoundedRectPressedColor()
RenderEmbeddedObject::RenderEmbeddedObject(Element* element)
: RenderPart(element)
, m_hasFallbackContent(false)
- , m_showsMissingPluginIndicator(false)
- , m_missingPluginIndicatorIsPressed(false)
- , m_mouseDownWasInMissingPluginIndicator(false)
+ , m_showsUnavailablePluginIndicator(false)
+ , m_unavailablePluginIndicatorIsPressed(false)
+ , m_mouseDownWasInUnavailablePluginIndicator(false)
{
view()->frameView()->setIsVisuallyNonEmpty();
}
@@ -102,30 +102,24 @@ bool RenderEmbeddedObject::allowsAcceleratedCompositing() const
}
#endif
-void RenderEmbeddedObject::setShowsMissingPluginIndicator()
+void RenderEmbeddedObject::setPluginUnavailabilityReason(PluginUnavailabilityReason pluginUnavailabilityReason)
{
- ASSERT(m_replacementText.isEmpty());
- m_replacementText = missingPluginText();
- m_showsMissingPluginIndicator = true;
+ ASSERT(!m_showsUnavailablePluginIndicator);
+ m_showsUnavailablePluginIndicator = true;
+ m_pluginUnavailabilityReason = pluginUnavailabilityReason;
}
-void RenderEmbeddedObject::setShowsCrashedPluginIndicator()
+bool RenderEmbeddedObject::showsUnavailablePluginIndicator() const
{
- ASSERT(m_replacementText.isEmpty());
- m_replacementText = crashedPluginText();
+ return m_showsUnavailablePluginIndicator;
}
-bool RenderEmbeddedObject::pluginCrashedOrWasMissing() const
+void RenderEmbeddedObject::setUnavailablePluginIndicatorIsPressed(bool pressed)
{
- return !m_replacementText.isNull();
-}
-
-void RenderEmbeddedObject::setMissingPluginIndicatorIsPressed(bool pressed)
-{
- if (m_missingPluginIndicatorIsPressed == pressed)
+ if (m_unavailablePluginIndicatorIsPressed == pressed)
return;
- m_missingPluginIndicatorIsPressed = pressed;
+ m_unavailablePluginIndicatorIsPressed = pressed;
repaint();
}
@@ -135,7 +129,7 @@ void RenderEmbeddedObject::paint(PaintInfo& paintInfo, const LayoutPoint& paintO
if (Frame* frame = this->frame())
page = frame->page();
- if (pluginCrashedOrWasMissing()) {
+ if (showsUnavailablePluginIndicator()) {
if (page && paintInfo.phase == PaintPhaseForeground)
page->addRelevantUnpaintedObject(this, visualOverflowRect());
RenderReplaced::paint(paintInfo, paintOffset);
@@ -150,7 +144,7 @@ void RenderEmbeddedObject::paint(PaintInfo& paintInfo, const LayoutPoint& paintO
void RenderEmbeddedObject::paintReplaced(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
{
- if (!pluginCrashedOrWasMissing())
+ if (!showsUnavailablePluginIndicator())
return;
if (paintInfo.phase == PaintPhaseSelection)
@@ -171,14 +165,14 @@ void RenderEmbeddedObject::paintReplaced(PaintInfo& paintInfo, const LayoutPoint
GraphicsContextStateSaver stateSaver(*context);
context->clip(contentRect);
- context->setAlpha(m_missingPluginIndicatorIsPressed ? replacementTextPressedRoundedRectOpacity : replacementTextRoundedRectOpacity);
- context->setFillColor(m_missingPluginIndicatorIsPressed ? replacementTextRoundedRectPressedColor() : Color::white, style()->colorSpace());
+ context->setAlpha(m_unavailablePluginIndicatorIsPressed ? replacementTextPressedRoundedRectOpacity : replacementTextRoundedRectOpacity);
+ context->setFillColor(m_unavailablePluginIndicatorIsPressed ? replacementTextRoundedRectPressedColor() : Color::white, style()->colorSpace());
context->fillPath(path);
const FontMetrics& fontMetrics = font.fontMetrics();
float labelX = roundf(replacementTextRect.location().x() + (replacementTextRect.size().width() - textWidth) / 2);
float labelY = roundf(replacementTextRect.location().y() + (replacementTextRect.size().height() - fontMetrics.height()) / 2 + fontMetrics.ascent());
- context->setAlpha(m_missingPluginIndicatorIsPressed ? replacementTextPressedTextOpacity : replacementTextTextOpacity);
+ context->setAlpha(m_unavailablePluginIndicatorIsPressed ? replacementTextPressedTextOpacity : replacementTextTextOpacity);
context->setFillColor(Color::black, style()->colorSpace());
context->drawBidiText(font, run, FloatPoint(labelX, labelY));
}
@@ -200,7 +194,7 @@ bool RenderEmbeddedObject::getReplacementTextGeometry(const LayoutPoint& accumul
font = Font(fontDescription, 0, 0);
font.update(0);
- run = TextRun(m_replacementText);
+ run = TextRun(unavailablePluginReplacementText());
textWidth = font.width(run);
replacementTextRect.setSize(FloatSize(textWidth + replacementTextRoundedRectLeftRightTextMargin * 2, replacementTextRoundedRectHeight));
@@ -213,6 +207,21 @@ bool RenderEmbeddedObject::getReplacementTextGeometry(const LayoutPoint& accumul
return true;
}
+String RenderEmbeddedObject::unavailablePluginReplacementText() const
+{
+ switch (m_pluginUnavailabilityReason) {
+ case PluginMissing:
+ return missingPluginText();
+ case PluginCrashed:
+ return crashedPluginText();
+ case InsecurePluginVersion:
+ return insecurePluginVersionText();
+ }
+
+ ASSERT_NOT_REACHED();
+ return String();
+}
+
void RenderEmbeddedObject::layout()
{
ASSERT(needsLayout());
@@ -295,7 +304,7 @@ bool RenderEmbeddedObject::logicalScroll(ScrollLogicalDirection direction, Scrol
}
-bool RenderEmbeddedObject::isInMissingPluginIndicator(const LayoutPoint& point) const
+bool RenderEmbeddedObject::isInUnavailablePluginIndicator(const LayoutPoint& point) const
{
FloatRect contentRect;
Path path;
@@ -307,20 +316,20 @@ bool RenderEmbeddedObject::isInMissingPluginIndicator(const LayoutPoint& point)
&& path.contains(point);
}
-bool RenderEmbeddedObject::isInMissingPluginIndicator(MouseEvent* event) const
+bool RenderEmbeddedObject::isInUnavailablePluginIndicator(MouseEvent* event) const
{
- return isInMissingPluginIndicator(roundedLayoutPoint(absoluteToLocal(event->absoluteLocation(), false, true)));
+ return isInUnavailablePluginIndicator(roundedLayoutPoint(absoluteToLocal(event->absoluteLocation(), false, true)));
}
-static bool shouldMissingPluginMessageBeButton(Document* document)
+static bool shouldUnavailablePluginMessageBeButton(Document* document, RenderEmbeddedObject::PluginUnavailabilityReason pluginUnavailabilityReason)
{
Page* page = document->page();
- return page && page->chrome()->client()->shouldMissingPluginMessageBeButton();
+ return page && page->chrome()->client()->shouldUnavailablePluginMessageBeButton(pluginUnavailabilityReason);
}
-void RenderEmbeddedObject::handleMissingPluginIndicatorEvent(Event* event)
+void RenderEmbeddedObject::handleUnavailablePluginIndicatorEvent(Event* event)
{
- if (!shouldMissingPluginMessageBeButton(document()))
+ if (!shouldUnavailablePluginMessageBeButton(document(), m_pluginUnavailabilityReason))
return;
if (!event->isMouseEvent())
@@ -329,40 +338,40 @@ void RenderEmbeddedObject::handleMissingPluginIndicatorEvent(Event* event)
MouseEvent* mouseEvent = static_cast<MouseEvent*>(event);
HTMLPlugInElement* element = static_cast<HTMLPlugInElement*>(node());
if (event->type() == eventNames().mousedownEvent && static_cast<MouseEvent*>(event)->button() == LeftButton) {
- m_mouseDownWasInMissingPluginIndicator = isInMissingPluginIndicator(mouseEvent);
- if (m_mouseDownWasInMissingPluginIndicator) {
+ m_mouseDownWasInUnavailablePluginIndicator = isInUnavailablePluginIndicator(mouseEvent);
+ if (m_mouseDownWasInUnavailablePluginIndicator) {
if (Frame* frame = document()->frame()) {
frame->eventHandler()->setCapturingMouseEventsNode(element);
element->setIsCapturingMouseEvents(true);
}
- setMissingPluginIndicatorIsPressed(true);
+ setUnavailablePluginIndicatorIsPressed(true);
}
event->setDefaultHandled();
}
if (event->type() == eventNames().mouseupEvent && static_cast<MouseEvent*>(event)->button() == LeftButton) {
- if (m_missingPluginIndicatorIsPressed) {
+ if (m_unavailablePluginIndicatorIsPressed) {
if (Frame* frame = document()->frame()) {
frame->eventHandler()->setCapturingMouseEventsNode(0);
element->setIsCapturingMouseEvents(false);
}
- setMissingPluginIndicatorIsPressed(false);
+ setUnavailablePluginIndicatorIsPressed(false);
}
- if (m_mouseDownWasInMissingPluginIndicator && isInMissingPluginIndicator(mouseEvent)) {
+ if (m_mouseDownWasInUnavailablePluginIndicator && isInUnavailablePluginIndicator(mouseEvent)) {
if (Page* page = document()->page())
- page->chrome()->client()->missingPluginButtonClicked(element);
+ page->chrome()->client()->unavailablePluginButtonClicked(element, m_pluginUnavailabilityReason);
}
- m_mouseDownWasInMissingPluginIndicator = false;
+ m_mouseDownWasInUnavailablePluginIndicator = false;
event->setDefaultHandled();
}
if (event->type() == eventNames().mousemoveEvent) {
- setMissingPluginIndicatorIsPressed(m_mouseDownWasInMissingPluginIndicator && isInMissingPluginIndicator(mouseEvent));
+ setUnavailablePluginIndicatorIsPressed(m_mouseDownWasInUnavailablePluginIndicator && isInUnavailablePluginIndicator(mouseEvent));
event->setDefaultHandled();
}
}
CursorDirective RenderEmbeddedObject::getCursor(const LayoutPoint& point, Cursor& cursor) const
{
- if (m_showsMissingPluginIndicator && shouldMissingPluginMessageBeButton(document()) && isInMissingPluginIndicator(point)) {
+ if (showsUnavailablePluginIndicator() && shouldUnavailablePluginMessageBeButton(document(), m_pluginUnavailabilityReason) && isInUnavailablePluginIndicator(point)) {
cursor = handCursor();
return SetCursor;
}
diff --git a/Source/WebCore/rendering/RenderEmbeddedObject.h b/Source/WebCore/rendering/RenderEmbeddedObject.h
index c57916087..3564ff287 100644
--- a/Source/WebCore/rendering/RenderEmbeddedObject.h
+++ b/Source/WebCore/rendering/RenderEmbeddedObject.h
@@ -36,17 +36,19 @@ public:
RenderEmbeddedObject(Element*);
virtual ~RenderEmbeddedObject();
- bool pluginCrashedOrWasMissing() const;
-
- void setShowsMissingPluginIndicator();
- void setShowsCrashedPluginIndicator();
- bool showsMissingPluginIndicator() const { return m_showsMissingPluginIndicator; }
+ enum PluginUnavailabilityReason {
+ PluginMissing,
+ PluginCrashed,
+ InsecurePluginVersion
+ };
+ void setPluginUnavailabilityReason(PluginUnavailabilityReason);
+ bool showsUnavailablePluginIndicator() const;
// FIXME: This belongs on HTMLObjectElement.
bool hasFallbackContent() const { return m_hasFallbackContent; }
void setHasFallbackContent(bool hasFallbackContent) { m_hasFallbackContent = hasFallbackContent; }
- void handleMissingPluginIndicatorEvent(Event*);
+ void handleUnavailablePluginIndicatorEvent(Event*);
#if USE(ACCELERATED_COMPOSITING)
virtual bool allowsAcceleratedCompositing() const;
@@ -72,16 +74,18 @@ private:
virtual bool scroll(ScrollDirection, ScrollGranularity, float multiplier, Node** stopNode);
virtual bool logicalScroll(ScrollLogicalDirection, ScrollGranularity, float multiplier, Node** stopNode);
- void setMissingPluginIndicatorIsPressed(bool);
- bool isInMissingPluginIndicator(MouseEvent*) const;
- bool isInMissingPluginIndicator(const LayoutPoint&) const;
+ void setUnavailablePluginIndicatorIsPressed(bool);
+ bool isInUnavailablePluginIndicator(MouseEvent*) const;
+ bool isInUnavailablePluginIndicator(const LayoutPoint&) const;
bool getReplacementTextGeometry(const LayoutPoint& accumulatedOffset, FloatRect& contentRect, Path&, FloatRect& replacementTextRect, Font&, TextRun&, float& textWidth) const;
+ String unavailablePluginReplacementText() const;
- String m_replacementText;
bool m_hasFallbackContent; // FIXME: This belongs on HTMLObjectElement.
- bool m_showsMissingPluginIndicator;
- bool m_missingPluginIndicatorIsPressed;
- bool m_mouseDownWasInMissingPluginIndicator;
+
+ bool m_showsUnavailablePluginIndicator;
+ PluginUnavailabilityReason m_pluginUnavailabilityReason;
+ bool m_unavailablePluginIndicatorIsPressed;
+ bool m_mouseDownWasInUnavailablePluginIndicator;
};
inline RenderEmbeddedObject* toRenderEmbeddedObject(RenderObject* object)
diff --git a/Source/WebCore/rendering/RenderFileUploadControl.cpp b/Source/WebCore/rendering/RenderFileUploadControl.cpp
index fd62630a8..db4e6c5cd 100644
--- a/Source/WebCore/rendering/RenderFileUploadControl.cpp
+++ b/Source/WebCore/rendering/RenderFileUploadControl.cpp
@@ -223,7 +223,7 @@ HTMLInputElement* RenderFileUploadControl::uploadButton() const
{
HTMLInputElement* input = static_cast<HTMLInputElement*>(node());
- ASSERT(input->hasShadowRoot());
+ ASSERT(input->shadow());
Node* buttonNode = input->shadow()->oldestShadowRoot()->firstChild();
return buttonNode && buttonNode->isHTMLElement() && buttonNode->hasTagName(inputTag) ? static_cast<HTMLInputElement*>(buttonNode) : 0;
diff --git a/Source/WebCore/rendering/RenderFrameSet.cpp b/Source/WebCore/rendering/RenderFrameSet.cpp
index e02c06689..ac449a240 100644
--- a/Source/WebCore/rendering/RenderFrameSet.cpp
+++ b/Source/WebCore/rendering/RenderFrameSet.cpp
@@ -181,9 +181,9 @@ void RenderFrameSet::GridAxis::resize(int size)
m_deltas.resize(size);
m_deltas.fill(0);
- // To track edges for resizability and borders, we need to be (size + 1). This is because a parent frameset
+ // To track edges for resizability and borders, we need to be (size + 1). This is because a parent frameset
// may ask us for information about our left/top/right/bottom edges in order to make its own decisions about
- // what to do. We are capable of tainting that parent frameset's borders, so we have to cache this info.
+ // what to do. We are capable of tainting that parent frameset's borders, so we have to cache this info.
m_preventResize.resize(size + 1);
m_allowBorder.resize(size + 1);
}
@@ -342,11 +342,10 @@ void RenderFrameSet::layOutAxis(GridAxis& axis, const Length* grid, int availabl
remainingLen -= changePercent;
}
}
- }
-
- // If we don't have any percentage columns/rows we only have fixed columns. Spread
- // the remainder equally over all fixed columns/rows.
- else if (remainingLen && countFixed) {
+ } else if (remainingLen && countFixed) {
+ // If we don't have any percentage columns/rows we only have
+ // fixed columns. Spread the remainder equally over all fixed
+ // columns/rows.
int remainingFixed = remainingLen;
int changeFixed = 0;
@@ -684,7 +683,7 @@ void RenderFrameSet::continueResizing(GridAxis& axis, int position)
return;
int currentSplitPosition = splitPosition(axis, axis.m_splitBeingResized);
int delta = (position - currentSplitPosition) - axis.m_splitResizeOffset;
- if (delta == 0)
+ if (!delta)
return;
axis.m_deltas[axis.m_splitBeingResized - 1] += delta;
axis.m_deltas[axis.m_splitBeingResized] -= delta;
diff --git a/Source/WebCore/rendering/RenderImage.cpp b/Source/WebCore/rendering/RenderImage.cpp
index 35caaff29..09d4e0d31 100644
--- a/Source/WebCore/rendering/RenderImage.cpp
+++ b/Source/WebCore/rendering/RenderImage.cpp
@@ -188,29 +188,33 @@ bool RenderImage::updateIntrinsicSizeIfNeeded(const IntSize& newSize, bool image
void RenderImage::imageDimensionsChanged(bool imageSizeChanged, const IntRect* rect)
{
- bool shouldRepaint = true;
- if (updateIntrinsicSizeIfNeeded(m_imageResource->imageSize(style()->effectiveZoom()), imageSizeChanged)) {
- // In the case of generated image content using :before/:after, we might not be in the
- // render tree yet. In that case, we don't need to worry about check for layout, since we'll get a
- // layout when we get added in to the render tree hierarchy later.
- if (containingBlock()) {
- // lets see if we need to relayout at all..
- int oldwidth = width();
- int oldheight = height();
- if (!preferredLogicalWidthsDirty())
- setPreferredLogicalWidthsDirty(true);
- computeLogicalWidth();
- computeLogicalHeight();
-
- if (imageSizeChanged || width() != oldwidth || height() != oldheight) {
- shouldRepaint = false;
- if (!selfNeedsLayout())
- setNeedsLayout(true);
- }
+ bool intrinsicSizeChanged = updateIntrinsicSizeIfNeeded(m_imageResource->imageSize(style()->effectiveZoom()), imageSizeChanged);
+
+ // In the case of generated image content using :before/:after/content, we might not be
+ // in the render tree yet. In that case, we just need to update our intrinsic size.
+ // layout() will be called after we are inserted in the tree which will take care of
+ // what we are doing here.
+ if (!containingBlock())
+ return;
- setWidth(oldwidth);
- setHeight(oldheight);
+ bool shouldRepaint = true;
+ if (intrinsicSizeChanged) {
+ // lets see if we need to relayout at all..
+ int oldwidth = width();
+ int oldheight = height();
+ if (!preferredLogicalWidthsDirty())
+ setPreferredLogicalWidthsDirty(true);
+ computeLogicalWidth();
+ computeLogicalHeight();
+
+ if (imageSizeChanged || width() != oldwidth || height() != oldheight) {
+ shouldRepaint = false;
+ if (!selfNeedsLayout())
+ setNeedsLayout(true);
}
+
+ setWidth(oldwidth);
+ setHeight(oldheight);
}
if (shouldRepaint) {
diff --git a/Source/WebCore/rendering/RenderInline.cpp b/Source/WebCore/rendering/RenderInline.cpp
index 4449d72e3..6804383ed 100644
--- a/Source/WebCore/rendering/RenderInline.cpp
+++ b/Source/WebCore/rendering/RenderInline.cpp
@@ -505,33 +505,28 @@ void RenderInline::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
m_lineBoxes.paint(this, paintInfo, paintOffset);
}
-void RenderInline::absoluteRects(Vector<IntRect>& rects, const LayoutPoint& accumulatedOffset) const
+template<typename GeneratorContext>
+void RenderInline::generateLineBoxRects(GeneratorContext yield) const
{
if (!alwaysCreateLineBoxes())
- culledInlineAbsoluteRects(this, rects, toLayoutSize(accumulatedOffset));
+ generateCulledLineBoxRects(yield, this);
else if (InlineFlowBox* curr = firstLineBox()) {
for (; curr; curr = curr->nextLineBox())
- rects.append(enclosingIntRect(FloatRect(accumulatedOffset + curr->topLeft(), curr->size())));
+ yield(FloatRect(curr->topLeft(), curr->size()));
} else
- rects.append(IntRect(roundedIntPoint(accumulatedOffset), IntSize()));
-
- if (continuation()) {
- if (continuation()->isBox()) {
- RenderBox* box = toRenderBox(continuation());
- continuation()->absoluteRects(rects, toLayoutPoint(accumulatedOffset - containingBlock()->location() + box->size()));
- } else
- continuation()->absoluteRects(rects, toLayoutPoint(accumulatedOffset - containingBlock()->location()));
- }
+ yield(FloatRect());
}
-void RenderInline::culledInlineAbsoluteRects(const RenderInline* container, Vector<IntRect>& rects, const LayoutSize& offset) const
+template<typename GeneratorContext>
+void RenderInline::generateCulledLineBoxRects(GeneratorContext yield, const RenderInline* container) const
{
if (!culledInlineFirstLineBox()) {
- rects.append(IntRect(offset.width(), offset.height(), 0, 0));
+ yield(FloatRect());
return;
}
bool isHorizontal = style()->isHorizontalWritingMode();
+
for (RenderObject* curr = firstChild(); curr; curr = curr->nextSibling()) {
if (curr->isFloatingOrPositioned())
continue;
@@ -544,35 +539,31 @@ void RenderInline::culledInlineAbsoluteRects(const RenderInline* container, Vect
RootInlineBox* rootBox = currBox->inlineBoxWrapper()->root();
int logicalTop = rootBox->logicalTop() + (rootBox->renderer()->style(rootBox->isFirstLineStyle())->font().fontMetrics().ascent() - container->style(rootBox->isFirstLineStyle())->font().fontMetrics().ascent());
int logicalHeight = container->style(rootBox->isFirstLineStyle())->font().fontMetrics().height();
- FloatRect result;
if (isHorizontal)
- result = FloatRect(offset.width() + currBox->inlineBoxWrapper()->x() - currBox->marginLeft(), offset.height() + logicalTop, currBox->width() + currBox->marginWidth(), logicalHeight);
+ yield(FloatRect(currBox->inlineBoxWrapper()->x() - currBox->marginLeft(), logicalTop, currBox->width() + currBox->marginWidth(), logicalHeight));
else
- result = FloatRect(offset.width() + logicalTop, offset.height() + currBox->inlineBoxWrapper()->y() - currBox->marginTop(), logicalHeight, currBox->height() + currBox->marginHeight());
- rects.append(enclosingIntRect(result));
+ yield(FloatRect(logicalTop, currBox->inlineBoxWrapper()->y() - currBox->marginTop(), logicalHeight, currBox->height() + currBox->marginHeight()));
}
} else if (curr->isRenderInline()) {
// If the child doesn't need line boxes either, then we can recur.
RenderInline* currInline = toRenderInline(curr);
if (!currInline->alwaysCreateLineBoxes())
- currInline->culledInlineAbsoluteRects(container, rects, offset);
+ currInline->generateCulledLineBoxRects(yield, container);
else {
for (InlineFlowBox* childLine = currInline->firstLineBox(); childLine; childLine = childLine->nextLineBox()) {
RootInlineBox* rootBox = childLine->root();
int logicalTop = rootBox->logicalTop() + (rootBox->renderer()->style(rootBox->isFirstLineStyle())->font().fontMetrics().ascent() - container->style(rootBox->isFirstLineStyle())->font().fontMetrics().ascent());
int logicalHeight = container->style(rootBox->isFirstLineStyle())->font().fontMetrics().height();
- FloatRect result;
if (isHorizontal)
- result = FloatRect(offset.width() + childLine->x() - childLine->marginLogicalLeft(),
- offset.height() + logicalTop,
+ yield(FloatRect(childLine->x() - childLine->marginLogicalLeft(),
+ logicalTop,
childLine->logicalWidth() + childLine->marginLogicalLeft() + childLine->marginLogicalRight(),
- logicalHeight);
+ logicalHeight));
else
- result = FloatRect(offset.width() + logicalTop,
- offset.height() + childLine->y() - childLine->marginLogicalLeft(),
+ yield(FloatRect(logicalTop,
+ childLine->y() - childLine->marginLogicalLeft(),
logicalHeight,
- childLine->logicalWidth() + childLine->marginLogicalLeft() + childLine->marginLogicalRight());
- rects.append(enclosingIntRect(result));
+ childLine->logicalWidth() + childLine->marginLogicalLeft() + childLine->marginLogicalRight()));
}
}
} else if (curr->isText()) {
@@ -581,115 +572,93 @@ void RenderInline::culledInlineAbsoluteRects(const RenderInline* container, Vect
RootInlineBox* rootBox = childText->root();
int logicalTop = rootBox->logicalTop() + (rootBox->renderer()->style(rootBox->isFirstLineStyle())->font().fontMetrics().ascent() - container->style(rootBox->isFirstLineStyle())->font().fontMetrics().ascent());
int logicalHeight = container->style(rootBox->isFirstLineStyle())->font().fontMetrics().height();
- FloatRect result;
if (isHorizontal)
- result = FloatRect(offset.width() + childText->x(), offset.height() + logicalTop, childText->logicalWidth(), logicalHeight);
+ yield(FloatRect(childText->x(), logicalTop, childText->logicalWidth(), logicalHeight));
else
- result = FloatRect(offset.width() + logicalTop, offset.height() + childText->y(), logicalHeight, childText->logicalWidth());
- rects.append(enclosingIntRect(result));
+ yield(FloatRect(logicalTop, childText->y(), logicalHeight, childText->logicalWidth()));
}
}
}
}
-void RenderInline::absoluteQuads(Vector<FloatQuad>& quads, bool* wasFixed) const
-{
- if (!alwaysCreateLineBoxes())
- culledInlineAbsoluteQuads(this, quads);
- else if (InlineFlowBox* curr = firstLineBox()) {
- for (; curr; curr = curr->nextLineBox()) {
- FloatRect localRect(curr->x(), curr->y(), curr->width(), curr->height());
- quads.append(localToAbsoluteQuad(localRect, false, wasFixed));
- }
- } else
- quads.append(localToAbsoluteQuad(FloatRect(), false, wasFixed));
+namespace {
- if (continuation())
- continuation()->absoluteQuads(quads, wasFixed);
-}
+class AbsoluteRectsGeneratorContext {
+public:
+ AbsoluteRectsGeneratorContext(Vector<IntRect>& rects, const LayoutPoint& accumulatedOffset)
+ : m_rects(rects)
+ , m_accumulatedOffset(accumulatedOffset) { }
-void RenderInline::culledInlineAbsoluteQuads(const RenderInline* container, Vector<FloatQuad>& quads) const
+ void operator()(const FloatRect& rect)
+ {
+ IntRect intRect = enclosingIntRect(rect);
+ intRect.move(m_accumulatedOffset.x(), m_accumulatedOffset.y());
+ m_rects.append(intRect);
+ }
+private:
+ Vector<IntRect>& m_rects;
+ const LayoutPoint& m_accumulatedOffset;
+};
+
+} // unnamed namespace
+
+void RenderInline::absoluteRects(Vector<IntRect>& rects, const LayoutPoint& accumulatedOffset) const
{
- if (!culledInlineFirstLineBox()) {
- quads.append(localToAbsoluteQuad(FloatRect()));
- return;
+ generateLineBoxRects(AbsoluteRectsGeneratorContext(rects, accumulatedOffset));
+
+ if (continuation()) {
+ if (continuation()->isBox()) {
+ RenderBox* box = toRenderBox(continuation());
+ continuation()->absoluteRects(rects, toLayoutPoint(accumulatedOffset - containingBlock()->location() + box->size()));
+ } else
+ continuation()->absoluteRects(rects, toLayoutPoint(accumulatedOffset - containingBlock()->location()));
}
+}
- bool isHorizontal = style()->isHorizontalWritingMode();
- for (RenderObject* curr = firstChild(); curr; curr = curr->nextSibling()) {
- if (curr->isFloatingOrPositioned())
- continue;
-
- // We want to get the margin box in the inline direction, and then use our font ascent/descent in the block
- // direction (aligned to the root box's baseline).
- if (curr->isBox()) {
- RenderBox* currBox = toRenderBox(curr);
- if (currBox->inlineBoxWrapper()) {
- RootInlineBox* rootBox = currBox->inlineBoxWrapper()->root();
- int logicalTop = rootBox->logicalTop() + (rootBox->renderer()->style(rootBox->isFirstLineStyle())->font().fontMetrics().ascent() - container->style(rootBox->isFirstLineStyle())->font().fontMetrics().ascent());
- int logicalHeight = container->style(rootBox->isFirstLineStyle())->font().fontMetrics().height();
- FloatRect result;
- if (isHorizontal)
- result = FloatRect(currBox->inlineBoxWrapper()->x() - currBox->marginLeft(), logicalTop, currBox->width() + currBox->marginWidth(), logicalHeight);
- else
- result = FloatRect(logicalTop, currBox->inlineBoxWrapper()->y() - currBox->marginTop(), logicalHeight, currBox->height() + currBox->marginHeight());
- quads.append(localToAbsoluteQuad(result));
- }
- } else if (curr->isRenderInline()) {
- // If the child doesn't need line boxes either, then we can recur.
- RenderInline* currInline = toRenderInline(curr);
- if (!currInline->alwaysCreateLineBoxes())
- currInline->culledInlineAbsoluteQuads(container, quads);
- else {
- for (InlineFlowBox* childLine = currInline->firstLineBox(); childLine; childLine = childLine->nextLineBox()) {
- RootInlineBox* rootBox = childLine->root();
- int logicalTop = rootBox->logicalTop() + (rootBox->renderer()->style(rootBox->isFirstLineStyle())->font().fontMetrics().ascent() - container->style(rootBox->isFirstLineStyle())->font().fontMetrics().ascent());
- int logicalHeight = container->style(rootBox->isFirstLineStyle())->font().fontMetrics().height();
- FloatRect result;
- if (isHorizontal)
- result = FloatRect(childLine->x() - childLine->marginLogicalLeft(),
- logicalTop,
- childLine->logicalWidth() + childLine->marginLogicalLeft() + childLine->marginLogicalRight(),
- logicalHeight);
- else
- result = FloatRect(logicalTop,
- childLine->y() - childLine->marginLogicalLeft(),
- logicalHeight,
- childLine->logicalWidth() + childLine->marginLogicalLeft() + childLine->marginLogicalRight());
- quads.append(localToAbsoluteQuad(result));
- }
- }
- } else if (curr->isText()) {
- RenderText* currText = toRenderText(curr);
- for (InlineTextBox* childText = currText->firstTextBox(); childText; childText = childText->nextTextBox()) {
- RootInlineBox* rootBox = childText->root();
- int logicalTop = rootBox->logicalTop() + (rootBox->renderer()->style(rootBox->isFirstLineStyle())->font().fontMetrics().ascent() - container->style(rootBox->isFirstLineStyle())->font().fontMetrics().ascent());
- int logicalHeight = container->style(rootBox->isFirstLineStyle())->font().fontMetrics().height();
- FloatRect result;
- if (isHorizontal)
- result = FloatRect(childText->x(), logicalTop, childText->logicalWidth(), logicalHeight);
- else
- result = FloatRect(logicalTop, childText->y(), logicalHeight, childText->logicalWidth());
- quads.append(localToAbsoluteQuad(result));
- }
- }
+
+namespace {
+
+class AbsoluteQuadsGeneratorContext {
+public:
+ AbsoluteQuadsGeneratorContext(const RenderInline* renderer, Vector<FloatQuad>& quads, bool* wasFixed)
+ : m_renderer(renderer)
+ , m_quads(quads)
+ , m_wasFixed(wasFixed) { }
+
+ void operator()(const FloatRect& rect)
+ {
+ m_quads.append(m_renderer->localToAbsoluteQuad(rect));
}
+private:
+ const RenderInline* m_renderer;
+ Vector<FloatQuad>& m_quads;
+ bool* m_wasFixed;
+};
+
+} // unnamed namespace
+
+void RenderInline::absoluteQuads(Vector<FloatQuad>& quads, bool* wasFixed) const
+{
+ generateLineBoxRects(AbsoluteQuadsGeneratorContext(this, quads, wasFixed));
+
+ if (continuation())
+ continuation()->absoluteQuads(quads, wasFixed);
}
LayoutUnit RenderInline::offsetLeft() const
{
- LayoutUnit x = RenderBoxModelObject::offsetLeft();
+ LayoutPoint topLeft;
if (InlineBox* firstBox = firstLineBoxIncludingCulling())
- x += firstBox->x();
- return x;
+ topLeft = flooredLayoutPoint(firstBox->topLeft());
+ return offsetTopLeft(topLeft).x();
}
LayoutUnit RenderInline::offsetTop() const
{
- LayoutUnit y = RenderBoxModelObject::offsetTop();
+ LayoutPoint topLeft;
if (InlineBox* firstBox = firstLineBoxIncludingCulling())
- y += firstBox->y();
- return y;
+ topLeft = flooredLayoutPoint(firstBox->topLeft());
+ return offsetTopLeft(topLeft).y();
}
static LayoutUnit computeMargin(const RenderInline* renderer, const Length& margin)
@@ -785,11 +754,28 @@ VisiblePosition RenderInline::positionForPoint(const LayoutPoint& point)
return RenderBoxModelObject::positionForPoint(point);
}
+namespace {
+
+class LinesBoundingBoxGeneratorContext {
+public:
+ LinesBoundingBoxGeneratorContext(FloatRect& rect) : m_rect(rect) { }
+ void operator()(const FloatRect& rect)
+ {
+ m_rect.uniteIfNonZero(rect);
+ }
+private:
+ FloatRect& m_rect;
+};
+
+} // unnamed namespace
+
IntRect RenderInline::linesBoundingBox() const
{
if (!alwaysCreateLineBoxes()) {
ASSERT(!firstLineBox());
- return enclosingIntRect(culledInlineBoundingBox(this));
+ FloatRect floatResult;
+ generateCulledLineBoxRects(LinesBoundingBoxGeneratorContext(floatResult), this);
+ return enclosingIntRect(floatResult);
}
IntRect result;
@@ -821,66 +807,6 @@ IntRect RenderInline::linesBoundingBox() const
return result;
}
-FloatRect RenderInline::culledInlineBoundingBox(const RenderInline* container) const
-{
- FloatRect result;
- bool isHorizontal = style()->isHorizontalWritingMode();
- for (RenderObject* curr = firstChild(); curr; curr = curr->nextSibling()) {
- if (curr->isFloatingOrPositioned())
- continue;
-
- // We want to get the margin box in the inline direction, and then use our font ascent/descent in the block
- // direction (aligned to the root box's baseline).
- if (curr->isBox()) {
- RenderBox* currBox = toRenderBox(curr);
- if (currBox->inlineBoxWrapper()) {
- RootInlineBox* rootBox = currBox->inlineBoxWrapper()->root();
- int logicalTop = rootBox->logicalTop() + (rootBox->renderer()->style(rootBox->isFirstLineStyle())->font().fontMetrics().ascent() - container->style(rootBox->isFirstLineStyle())->font().fontMetrics().ascent());
- int logicalHeight = container->style(rootBox->isFirstLineStyle())->font().fontMetrics().height();
- if (isHorizontal)
- result.uniteIfNonZero(FloatRect(currBox->inlineBoxWrapper()->x() - currBox->marginLeft(), logicalTop, currBox->width() + currBox->marginWidth(), logicalHeight));
- else
- result.uniteIfNonZero(FloatRect(logicalTop, currBox->inlineBoxWrapper()->y() - currBox->marginTop(), logicalHeight, currBox->height() + currBox->marginHeight()));
- }
- } else if (curr->isRenderInline()) {
- // If the child doesn't need line boxes either, then we can recur.
- RenderInline* currInline = toRenderInline(curr);
- if (!currInline->alwaysCreateLineBoxes())
- result.uniteIfNonZero(currInline->culledInlineBoundingBox(container));
- else {
- for (InlineFlowBox* childLine = currInline->firstLineBox(); childLine; childLine = childLine->nextLineBox()) {
- RootInlineBox* rootBox = childLine->root();
- int logicalTop = rootBox->logicalTop() + (rootBox->renderer()->style(rootBox->isFirstLineStyle())->font().fontMetrics().ascent() - container->style(rootBox->isFirstLineStyle())->font().fontMetrics().ascent());
- int logicalHeight = container->style(rootBox->isFirstLineStyle())->font().fontMetrics().height();
- if (isHorizontal)
- result.uniteIfNonZero(FloatRect(childLine->x() - childLine->marginLogicalLeft(),
- logicalTop,
- childLine->logicalWidth() + childLine->marginLogicalLeft() + childLine->marginLogicalRight(),
- logicalHeight));
- else
- result.uniteIfNonZero(FloatRect(logicalTop,
- childLine->y() - childLine->marginLogicalLeft(),
- logicalHeight,
- childLine->logicalWidth() + childLine->marginLogicalLeft() + childLine->marginLogicalRight()));
-
- }
- }
- } else if (curr->isText()) {
- RenderText* currText = toRenderText(curr);
- for (InlineTextBox* childText = currText->firstTextBox(); childText; childText = childText->nextTextBox()) {
- RootInlineBox* rootBox = childText->root();
- int logicalTop = rootBox->logicalTop() + (rootBox->renderer()->style(rootBox->isFirstLineStyle())->font().fontMetrics().ascent() - container->style(rootBox->isFirstLineStyle())->font().fontMetrics().ascent());
- int logicalHeight = container->style(rootBox->isFirstLineStyle())->font().fontMetrics().height();
- if (isHorizontal)
- result.uniteIfNonZero(FloatRect(childText->x(), logicalTop, childText->logicalWidth(), logicalHeight));
- else
- result.uniteIfNonZero(FloatRect(logicalTop, childText->y(), logicalHeight, childText->logicalWidth()));
- }
- }
- }
- return enclosingLayoutRect(result);
-}
-
InlineBox* RenderInline::culledInlineFirstLineBox() const
{
for (RenderObject* curr = firstChild(); curr; curr = curr->nextSibling()) {
@@ -931,7 +857,9 @@ InlineBox* RenderInline::culledInlineLastLineBox() const
LayoutRect RenderInline::culledInlineVisualOverflowBoundingBox() const
{
- LayoutRect result(culledInlineBoundingBox(this));
+ FloatRect floatResult;
+ generateCulledLineBoxRects(LinesBoundingBoxGeneratorContext(floatResult), this);
+ LayoutRect result(enclosingLayoutRect(floatResult));
bool isHorizontal = style()->isHorizontalWritingMode();
for (RenderObject* curr = firstChild(); curr; curr = curr->nextSibling()) {
if (curr->isFloatingOrPositioned())
@@ -1366,12 +1294,7 @@ void RenderInline::imageChanged(WrappedImagePtr, const IntRect*)
void RenderInline::addFocusRingRects(Vector<IntRect>& rects, const LayoutPoint& additionalOffset)
{
- if (!alwaysCreateLineBoxes())
- culledInlineAbsoluteRects(this, rects, toLayoutSize(additionalOffset));
- else {
- for (InlineFlowBox* curr = firstLineBox(); curr; curr = curr->nextLineBox())
- rects.append(enclosingIntRect(FloatRect(additionalOffset.x() + curr->x(), additionalOffset.y() + curr->y(), curr->width(), curr->height())));
- }
+ generateLineBoxRects(AbsoluteRectsGeneratorContext(rects, additionalOffset));
for (RenderObject* curr = firstChild(); curr; curr = curr->nextSibling()) {
if (!curr->isText() && !curr->isListMarker()) {
diff --git a/Source/WebCore/rendering/RenderInline.h b/Source/WebCore/rendering/RenderInline.h
index 190cbec41..c1532cf56 100644
--- a/Source/WebCore/rendering/RenderInline.h
+++ b/Source/WebCore/rendering/RenderInline.h
@@ -98,12 +98,14 @@ private:
virtual bool isRenderInline() const { return true; }
- FloatRect culledInlineBoundingBox(const RenderInline* container) const;
LayoutRect culledInlineVisualOverflowBoundingBox() const;
InlineBox* culledInlineFirstLineBox() const;
InlineBox* culledInlineLastLineBox() const;
- void culledInlineAbsoluteRects(const RenderInline* container, Vector<IntRect>&, const LayoutSize&) const;
- void culledInlineAbsoluteQuads(const RenderInline* container, Vector<FloatQuad>&) const;
+
+ template<typename GeneratorContext>
+ void generateLineBoxRects(GeneratorContext yield) const;
+ template<typename GeneratorContext>
+ void generateCulledLineBoxRects(GeneratorContext yield, const RenderInline* container) const;
void addChildToContinuation(RenderObject* newChild, RenderObject* beforeChild);
virtual void addChildIgnoringContinuation(RenderObject* newChild, RenderObject* beforeChild = 0);
diff --git a/Source/WebCore/rendering/RenderLayer.cpp b/Source/WebCore/rendering/RenderLayer.cpp
index 33379cf24..1c1103ce9 100644
--- a/Source/WebCore/rendering/RenderLayer.cpp
+++ b/Source/WebCore/rendering/RenderLayer.cpp
@@ -147,7 +147,6 @@ void ClipRects::destroy(RenderArena* renderArena)
RenderLayer::RenderLayer(RenderBoxModelObject* renderer)
: m_inResizeMode(false)
, m_scrollDimensionsDirty(true)
- , m_zOrderListsDirty(true)
, m_normalFlowListDirty(true)
, m_usedTransparency(false)
, m_paintingInsideReflection(false)
@@ -193,6 +192,9 @@ RenderLayer::RenderLayer(RenderBoxModelObject* renderer)
, m_resizer(0)
{
m_isNormalFlowOnly = shouldBeNormalFlowOnly();
+ // Non-stacking contexts should have empty z-order lists. As this is already the case,
+ // there is no need to dirty / recompute these lists.
+ m_zOrderListsDirty = isStackingContext();
ScrollableArea::setConstrainsScrollingToContentEdge(false);
@@ -2194,7 +2196,7 @@ PassRefPtr<Scrollbar> RenderLayer::createScrollbar(ScrollbarOrientation orientat
RenderObject* actualRenderer = renderer()->node() ? renderer()->node()->shadowAncestorNode()->renderer() : renderer();
bool hasCustomScrollbarStyle = actualRenderer->isBox() && actualRenderer->style()->hasPseudoStyle(SCROLLBAR);
if (hasCustomScrollbarStyle)
- widget = RenderScrollbar::createCustomScrollbar(this, orientation, toRenderBox(actualRenderer));
+ widget = RenderScrollbar::createCustomScrollbar(this, orientation, actualRenderer->node());
else {
widget = Scrollbar::createNativeScrollbar(this, orientation, RegularScrollbar);
if (orientation == HorizontalScrollbar)
@@ -2210,14 +2212,10 @@ void RenderLayer::destroyScrollbar(ScrollbarOrientation orientation)
{
RefPtr<Scrollbar>& scrollbar = orientation == HorizontalScrollbar ? m_hBar : m_vBar;
if (scrollbar) {
- if (scrollbar->isCustomScrollbar())
- toRenderScrollbar(scrollbar.get())->clearOwningRenderer();
- else {
- if (orientation == HorizontalScrollbar)
- willRemoveHorizontalScrollbar(scrollbar.get());
- else
- willRemoveVerticalScrollbar(scrollbar.get());
- }
+ if (orientation == HorizontalScrollbar)
+ willRemoveHorizontalScrollbar(scrollbar.get());
+ else
+ willRemoveVerticalScrollbar(scrollbar.get());
scrollbar->removeFromParent();
scrollbar->disconnectFromScrollableArea();
@@ -2561,9 +2559,14 @@ void RenderLayer::paintOverflowControls(GraphicsContext* context, const IntPoint
// and we'll paint the scrollbars then. In the meantime, cache tx and ty so that the
// second pass doesn't need to re-enter the RenderTree to get it right.
if (hasOverlayScrollbars() && !paintingOverlayControls) {
+ m_cachedOverlayScrollbarOffset = paintOffset;
+#if USE(ACCELERATED_COMPOSITING)
+ // It's not necessary to do the second pass if the scrollbars paint into layers.
+ if ((m_hBar && layerForHorizontalScrollbar()) || (m_vBar && layerForVerticalScrollbar()))
+ return;
+#endif
RenderView* renderView = renderer()->view();
renderView->layer()->setContainsDirtyOverlayScrollbars(true);
- m_cachedOverlayScrollbarOffset = paintOffset;
renderView->frameView()->setContainsScrollableAreaWithOverlayScrollbars(true);
return;
}
@@ -2651,17 +2654,15 @@ void RenderLayer::drawPlatformResizerImage(GraphicsContext* context, IntRect res
cornerResizerSize = resizeCornerImage->size();
}
- IntRect imageRect(resizerCornerRect.maxXMaxYCorner() - cornerResizerSize, cornerResizerSize);
if (renderer()->style()->shouldPlaceBlockDirectionScrollbarOnLogicalLeft()) {
context->save();
- context->translate(imageRect.x(), imageRect.y());
- imageRect.setX(0);
- imageRect.setY(0);
+ context->translate(resizerCornerRect.x() + cornerResizerSize.width(), resizerCornerRect.y() + resizerCornerRect.height() - cornerResizerSize.height());
context->scale(FloatSize(-1.0, 1.0));
- context->drawImage(resizeCornerImage.get(), renderer()->style()->colorSpace(), imageRect);
+ context->drawImage(resizeCornerImage.get(), renderer()->style()->colorSpace(), IntRect(IntPoint(), cornerResizerSize));
context->restore();
return;
}
+ IntRect imageRect(resizerCornerRect.maxXMaxYCorner() - cornerResizerSize, cornerResizerSize);
context->drawImage(resizeCornerImage.get(), renderer()->style()->colorSpace(), imageRect);
}
@@ -2886,7 +2887,7 @@ void RenderLayer::paintLayer(RenderLayer* rootLayer, GraphicsContext* context,
// but we need to ensure that we don't cache clip rects computed with the wrong root in this case.
if (context->updatingControlTints() || (paintBehavior & PaintBehaviorFlattenCompositingLayers))
paintFlags |= PaintLayerTemporaryClipRects;
- else if (!backing()->paintsIntoWindow() && !backing()->paintsIntoCompositedAncestor() && !shouldDoSoftwarePaint(this, paintFlags & PaintLayerPaintingReflection)) {
+ else if (!backing()->paintsIntoWindow() && !backing()->paintsIntoCompositedAncestor() && !shouldDoSoftwarePaint(this, paintFlags & PaintLayerPaintingReflection) && !rootLayer->containsDirtyOverlayScrollbars()) {
// If this RenderLayer should paint into its backing, that will be done via RenderLayerBacking::paintIntoLayer().
return;
}
@@ -4159,6 +4160,9 @@ IntRect RenderLayer::calculateLayerBounds(const RenderLayer* layer, const Render
if (flags & UseLocalClipRectIfPossible) {
LayoutRect localClipRect = layer->localClipRect();
if (localClipRect != PaintInfo::infiniteRect()) {
+ if ((flags & IncludeSelfTransform) && layer->paintsWithTransform(PaintBehaviorNormal))
+ localClipRect = layer->transform()->mapRect(localClipRect);
+
LayoutPoint ancestorRelOffset;
layer->convertToLayerCoords(ancestorLayer, ancestorRelOffset);
localClipRect.moveBy(ancestorRelOffset);
@@ -4462,8 +4466,7 @@ static inline bool compareZIndex(RenderLayer* first, RenderLayer* second)
void RenderLayer::dirtyZOrderLists()
{
ASSERT(m_layerListMutationAllowed);
- // We cannot assume that we are called on a stacking context as it
- // is called when we just got demoted from being a stacking context.
+ ASSERT(isStackingContext());
if (m_posZOrderList)
m_posZOrderList->clear();
@@ -4679,6 +4682,31 @@ bool RenderLayer::isSelfPaintingLayer() const
|| renderer()->isRenderIFrame();
}
+void RenderLayer::updateStackingContextsAfterStyleChange(const RenderStyle* oldStyle)
+{
+ if (!oldStyle)
+ return;
+
+ bool wasStackingContext = isStackingContext(oldStyle);
+ bool isStackingContext = this->isStackingContext();
+ if (isStackingContext != wasStackingContext) {
+ dirtyStackingContextZOrderLists();
+ if (isStackingContext)
+ dirtyZOrderLists();
+ else
+ clearZOrderLists();
+ return;
+ }
+
+ // FIXME: RenderLayer already handles visibility changes through our visiblity dirty bits. This logic could
+ // likely be folded along with the rest.
+ if (oldStyle->zIndex() != renderer()->style()->zIndex() || oldStyle->visibility() != renderer()->style()->visibility()) {
+ dirtyStackingContextZOrderLists();
+ if (isStackingContext)
+ dirtyZOrderLists();
+ }
+}
+
static bool overflowCanHaveAScrollbar(EOverflow overflow)
{
return overflow == OAUTO || overflow == OSCROLL || overflow == OOVERLAY;
@@ -4733,7 +4761,8 @@ void RenderLayer::styleChanged(StyleDifference, const RenderStyle* oldStyle)
delete m_marquee;
m_marquee = 0;
}
-
+
+ updateStackingContextsAfterStyleChange(oldStyle);
updateScrollbarsAfterStyleChange(oldStyle);
if (!hasReflection() && m_reflection)
diff --git a/Source/WebCore/rendering/RenderLayer.h b/Source/WebCore/rendering/RenderLayer.h
index 95c0f3933..9b34e7f66 100644
--- a/Source/WebCore/rendering/RenderLayer.h
+++ b/Source/WebCore/rendering/RenderLayer.h
@@ -382,7 +382,7 @@ public:
// Get the enclosing stacking context for this layer. A stacking context is a layer
// that has a non-auto z-index.
RenderLayer* stackingContext() const;
- bool isStackingContext() const { return !hasAutoZIndex() || renderer()->isRenderView(); }
+ bool isStackingContext() const { return isStackingContext(renderer()->style()); }
void dirtyZOrderLists();
void dirtyStackingContextZOrderLists();
@@ -443,7 +443,6 @@ public:
void convertToLayerCoords(const RenderLayer* ancestorLayer, LayoutPoint& location) const;
void convertToLayerCoords(const RenderLayer* ancestorLayer, LayoutRect&) const;
- bool hasAutoZIndex() const { return renderer()->style()->hasAutoZIndex(); }
int zIndex() const { return renderer()->style()->zIndex(); }
enum PaintLayerFlag {
@@ -618,6 +617,7 @@ private:
void updateNormalFlowList();
+ bool isStackingContext(const RenderStyle* style) const { return !style->hasAutoZIndex() || renderer()->isRenderView(); }
bool isDirtyStackingContext() const { return m_zOrderListsDirty && isStackingContext(); }
void computeRepaintRects(LayoutPoint* offsetFromRoot = 0);
@@ -629,6 +629,8 @@ private:
bool shouldRepaintAfterLayout() const;
+ void updateStackingContextsAfterStyleChange(const RenderStyle* oldStyle);
+
void updateScrollbarsAfterStyleChange(const RenderStyle* oldStyle);
void updateScrollbarsAfterLayout();
@@ -936,6 +938,8 @@ private:
inline void RenderLayer::clearZOrderLists()
{
+ ASSERT(!isStackingContext());
+
if (m_posZOrderList) {
delete m_posZOrderList;
m_posZOrderList = 0;
diff --git a/Source/WebCore/rendering/RenderLayerBacking.cpp b/Source/WebCore/rendering/RenderLayerBacking.cpp
index 10a16aff2..524aaf30a 100644
--- a/Source/WebCore/rendering/RenderLayerBacking.cpp
+++ b/Source/WebCore/rendering/RenderLayerBacking.cpp
@@ -262,7 +262,7 @@ void RenderLayerBacking::updateCompositedBounds()
RenderLayer* rootLayer = view->layer();
// Start by clipping to the view's bounds.
- LayoutRect clippingBounds = view->layoutOverflowRect();
+ LayoutRect clippingBounds = view->unscaledDocumentRect();
if (m_owningLayer != rootLayer)
clippingBounds.intersect(m_owningLayer->backgroundClipRect(rootLayer, 0, true).rect()); // FIXME: Incorrect for CSS regions.
@@ -1169,6 +1169,9 @@ void RenderLayerBacking::paintIntoLayer(RenderLayer* rootLayer, GraphicsContext*
// FIXME: GraphicsLayers need a way to split for RenderRegions.
m_owningLayer->paintLayerContents(rootLayer, context, paintDirtyRect, paintBehavior, paintingRoot, 0, 0, paintFlags);
+ if (m_owningLayer->containsDirtyOverlayScrollbars())
+ m_owningLayer->paintOverlayScrollbars(context, paintDirtyRect, paintBehavior, paintingRoot);
+
ASSERT(!m_owningLayer->m_usedTransparency);
}
diff --git a/Source/WebCore/rendering/RenderLayerCompositor.cpp b/Source/WebCore/rendering/RenderLayerCompositor.cpp
index 84ef04bcd..fbed9ae9a 100644
--- a/Source/WebCore/rendering/RenderLayerCompositor.cpp
+++ b/Source/WebCore/rendering/RenderLayerCompositor.cpp
@@ -1040,8 +1040,11 @@ void RenderLayerCompositor::frameViewDidScroll()
FrameView* frameView = m_renderView->frameView();
IntPoint scrollPosition = frameView->scrollPosition();
- if (TiledBacking* tiledBacking = frameView->tiledBacking())
- tiledBacking->visibleRectChanged(frameView->visibleContentRect(false /* exclude scrollbars */));
+ if (TiledBacking* tiledBacking = frameView->tiledBacking()) {
+ IntRect visibleContentRect = frameView->visibleContentRect(false /* exclude scrollbars */);
+ visibleContentRect.move(toSize(frameView->scrollOrigin()));
+ tiledBacking->visibleRectChanged(visibleContentRect);
+ }
if (!m_scrollLayer)
return;
diff --git a/Source/WebCore/rendering/RenderListBox.cpp b/Source/WebCore/rendering/RenderListBox.cpp
index 8cb7d7bb4..aa591de66 100644
--- a/Source/WebCore/rendering/RenderListBox.cpp
+++ b/Source/WebCore/rendering/RenderListBox.cpp
@@ -407,9 +407,7 @@ void RenderListBox::paintItemForeground(PaintInfo& paintInfo, const LayoutPoint&
ColorSpace colorSpace = itemStyle->colorSpace();
paintInfo.context->setFillColor(textColor, colorSpace);
- unsigned length = itemText.length();
- const UChar* string = itemText.characters();
- TextRun textRun(string, length, false, 0, 0, TextRun::AllowTrailingExpansion, itemStyle->direction(), isOverride(itemStyle->unicodeBidi()), true, TextRun::NoRounding);
+ TextRun textRun(itemText, 0, 0, TextRun::AllowTrailingExpansion, itemStyle->direction(), isOverride(itemStyle->unicodeBidi()), true, TextRun::NoRounding);
Font itemFont = style()->font();
LayoutRect r = itemBoundingBoxRect(paintOffset, listIndex);
r.move(itemOffsetForAlignment(textRun, itemStyle, itemFont, r));
@@ -831,7 +829,7 @@ PassRefPtr<Scrollbar> RenderListBox::createScrollbar()
RefPtr<Scrollbar> widget;
bool hasCustomScrollbarStyle = style()->hasPseudoStyle(SCROLLBAR);
if (hasCustomScrollbarStyle)
- widget = RenderScrollbar::createCustomScrollbar(this, VerticalScrollbar, this);
+ widget = RenderScrollbar::createCustomScrollbar(this, VerticalScrollbar, this->node());
else {
widget = Scrollbar::createNativeScrollbar(this, VerticalScrollbar, theme()->scrollbarControlSizeForPart(ListboxPart));
didAddVerticalScrollbar(widget.get());
diff --git a/Source/WebCore/rendering/RenderMediaControlsChromium.cpp b/Source/WebCore/rendering/RenderMediaControlsChromium.cpp
index 89383c0d1..c28049c2b 100644
--- a/Source/WebCore/rendering/RenderMediaControlsChromium.cpp
+++ b/Source/WebCore/rendering/RenderMediaControlsChromium.cpp
@@ -33,6 +33,7 @@
#include "HTMLMediaElement.h"
#include "HTMLNames.h"
#include "PaintInfo.h"
+#include "TimeRanges.h"
namespace WebCore {
@@ -127,19 +128,26 @@ static bool paintMediaSlider(RenderObject* object, const PaintInfo& paintInfo, c
context->restore();
// Draw the buffered ranges.
- // FIXME: Draw multiple ranges if there are multiple buffered ranges.
+ // FIXME: Draw multiple ranges if there are multiple buffered ranges. http://webkit.org/b/85925
IntRect bufferedRect = rect;
bufferedRect.inflate(-style->borderLeftWidth());
double bufferedWidth = 0.0;
- if (mediaElement->percentLoaded() > 0.0) {
+ RefPtr<TimeRanges> bufferedTimeRanges = mediaElement->buffered();
+ if (bufferedTimeRanges->length() > 0) {
// Account for the width of the slider thumb.
Image* mediaSliderThumb = getMediaSliderThumb();
double thumbWidth = mediaSliderThumb->width() / 2.0 + 1.0;
double rectWidth = bufferedRect.width() - thumbWidth;
if (rectWidth < 0.0)
rectWidth = 0.0;
- bufferedWidth = rectWidth * mediaElement->percentLoaded() + thumbWidth;
+ // Preserve old behavior pending resolution of UI design of multiple ranges (see FIXME above).
+ // http://webkit.org/b/85926
+ double fakePercentLoaded = 0;
+ float duration = mediaElement->duration();
+ if (duration && !isinf(duration))
+ fakePercentLoaded = bufferedTimeRanges->end(bufferedTimeRanges->length() - 1, ASSERT_NO_EXCEPTION) / duration;
+ bufferedWidth = rectWidth * fakePercentLoaded + thumbWidth;
}
bufferedRect.setWidth(bufferedWidth);
diff --git a/Source/WebCore/rendering/RenderMenuList.cpp b/Source/WebCore/rendering/RenderMenuList.cpp
index 6d25c3572..ae78af399 100644
--- a/Source/WebCore/rendering/RenderMenuList.cpp
+++ b/Source/WebCore/rendering/RenderMenuList.cpp
@@ -495,7 +495,7 @@ PassRefPtr<Scrollbar> RenderMenuList::createScrollbar(ScrollableArea* scrollable
RefPtr<Scrollbar> widget;
bool hasCustomScrollbarStyle = style()->hasPseudoStyle(SCROLLBAR);
if (hasCustomScrollbarStyle)
- widget = RenderScrollbar::createCustomScrollbar(scrollableArea, orientation, this);
+ widget = RenderScrollbar::createCustomScrollbar(scrollableArea, orientation, this->node());
else
widget = Scrollbar::createNativeScrollbar(scrollableArea, orientation, controlSize);
return widget.release();
diff --git a/Source/WebCore/rendering/RenderObject.cpp b/Source/WebCore/rendering/RenderObject.cpp
index cc80bae9b..13f62f431 100755
--- a/Source/WebCore/rendering/RenderObject.cpp
+++ b/Source/WebCore/rendering/RenderObject.cpp
@@ -327,12 +327,6 @@ void RenderObject::removeChild(RenderObject* oldChild)
if (!children)
return;
- // We do this here instead of in removeChildNode, since the only extremely low-level uses of remove/appendChildNode
- // cannot affect the positioned object list, and the floating object list is irrelevant (since the list gets cleared on
- // layout anyway).
- if (oldChild->isFloatingOrPositioned())
- toRenderBox(oldChild)->removeFloatingOrPositionedChildFromBlockLists();
-
children->removeChildNode(this, oldChild);
}
@@ -1255,9 +1249,11 @@ RenderBoxModelObject* RenderObject::containerForRepaint() const
#if USE(ACCELERATED_COMPOSITING)
if (v->usesCompositing()) {
- RenderLayer* compLayer = enclosingLayer()->enclosingCompositingLayerForRepaint();
- if (compLayer)
- repaintContainer = compLayer->renderer();
+ if (RenderLayer* parentLayer = enclosingLayer()) {
+ RenderLayer* compLayer = parentLayer->enclosingCompositingLayerForRepaint();
+ if (compLayer)
+ repaintContainer = compLayer->renderer();
+ }
}
#endif
@@ -2569,38 +2565,40 @@ PassRefPtr<RenderStyle> RenderObject::getUncachedPseudoStyle(PseudoId pseudo, Re
return document()->styleResolver()->pseudoStyleForElement(pseudo, element, parentStyle);
}
-static Color decorationColor(RenderObject* renderer)
+static Color decorationColor(RenderStyle* style)
{
Color result;
- if (renderer->style()->textStrokeWidth() > 0) {
+ if (style->textStrokeWidth() > 0) {
// Prefer stroke color if possible but not if it's fully transparent.
- result = renderer->style()->visitedDependentColor(CSSPropertyWebkitTextStrokeColor);
+ result = style->visitedDependentColor(CSSPropertyWebkitTextStrokeColor);
if (result.alpha())
return result;
}
- result = renderer->style()->visitedDependentColor(CSSPropertyWebkitTextFillColor);
+ result = style->visitedDependentColor(CSSPropertyWebkitTextFillColor);
return result;
}
void RenderObject::getTextDecorationColors(int decorations, Color& underline, Color& overline,
- Color& linethrough, bool quirksMode)
+ Color& linethrough, bool quirksMode, bool firstlineStyle)
{
RenderObject* curr = this;
+ RenderStyle* styleToUse = 0;
do {
- int currDecs = curr->style()->textDecoration();
+ styleToUse = curr->style(firstlineStyle);
+ int currDecs = styleToUse->textDecoration();
if (currDecs) {
if (currDecs & UNDERLINE) {
decorations &= ~UNDERLINE;
- underline = decorationColor(curr);
+ underline = decorationColor(styleToUse);
}
if (currDecs & OVERLINE) {
decorations &= ~OVERLINE;
- overline = decorationColor(curr);
+ overline = decorationColor(styleToUse);
}
if (currDecs & LINE_THROUGH) {
decorations &= ~LINE_THROUGH;
- linethrough = decorationColor(curr);
+ linethrough = decorationColor(styleToUse);
}
}
if (curr->isFloating() || curr->isPositioned() || curr->isRubyText())
@@ -2613,12 +2611,13 @@ void RenderObject::getTextDecorationColors(int decorations, Color& underline, Co
// If we bailed out, use the element we bailed out at (typically a <font> or <a> element).
if (decorations && curr) {
+ styleToUse = curr->style(firstlineStyle);
if (decorations & UNDERLINE)
- underline = decorationColor(curr);
+ underline = decorationColor(styleToUse);
if (decorations & OVERLINE)
- overline = decorationColor(curr);
+ overline = decorationColor(styleToUse);
if (decorations & LINE_THROUGH)
- linethrough = decorationColor(curr);
+ linethrough = decorationColor(styleToUse);
}
}
diff --git a/Source/WebCore/rendering/RenderObject.h b/Source/WebCore/rendering/RenderObject.h
index a4a0596fb..6af6e9a2f 100644
--- a/Source/WebCore/rendering/RenderObject.h
+++ b/Source/WebCore/rendering/RenderObject.h
@@ -389,6 +389,7 @@ public:
if (!s_ancestorLineboxDirtySet)
s_ancestorLineboxDirtySet = new RenderObjectAncestorLineboxDirtySet;
s_ancestorLineboxDirtySet->add(this);
+ setNeedsLayout(true);
} else if (s_ancestorLineboxDirtySet) {
s_ancestorLineboxDirtySet->remove(this);
if (s_ancestorLineboxDirtySet->isEmpty()) {
@@ -417,7 +418,6 @@ public:
virtual bool isSVGGradientStop() const { return false; }
virtual bool isSVGHiddenContainer() const { return false; }
virtual bool isSVGPath() const { return false; }
- virtual bool isSVGRect() const { return false; }
virtual bool isSVGShape() const { return false; }
virtual bool isSVGText() const { return false; }
virtual bool isSVGTextPath() const { return false; }
@@ -713,7 +713,7 @@ public:
virtual CursorDirective getCursor(const LayoutPoint&, Cursor&) const;
- void getTextDecorationColors(int decorations, Color& underline, Color& overline, Color& linethrough, bool quirksMode = false);
+ void getTextDecorationColors(int decorations, Color& underline, Color& overline, Color& linethrough, bool quirksMode = false, bool firstlineStyle = false);
// Return the RenderBox in the container chain which is responsible for painting this object, or 0
// if painting is root-relative. This is the container that should be passed to the 'forRepaint'
@@ -765,6 +765,12 @@ public:
// If multiple-column layout results in applying an offset to the given point, add the same
// offset to the given size.
virtual void adjustForColumns(LayoutSize&, const LayoutPoint&) const { }
+ LayoutSize offsetForColumns(const LayoutPoint& point) const
+ {
+ LayoutSize offset;
+ adjustForColumns(offset, point);
+ return offset;
+ }
virtual unsigned int length() const { return 1; }
diff --git a/Source/WebCore/rendering/RenderObjectChildList.cpp b/Source/WebCore/rendering/RenderObjectChildList.cpp
index 265596c2b..868d7423e 100644
--- a/Source/WebCore/rendering/RenderObjectChildList.cpp
+++ b/Source/WebCore/rendering/RenderObjectChildList.cpp
@@ -75,6 +75,9 @@ RenderObject* RenderObjectChildList::removeChildNode(RenderObject* owner, Render
{
ASSERT(oldChild->parent() == owner);
+ if (oldChild->isFloatingOrPositioned())
+ toRenderBox(oldChild)->removeFloatingOrPositionedChildFromBlockLists();
+
// 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.
diff --git a/Source/WebCore/rendering/RenderScrollbar.cpp b/Source/WebCore/rendering/RenderScrollbar.cpp
index 0c50c0d39..68d4a3bee 100644
--- a/Source/WebCore/rendering/RenderScrollbar.cpp
+++ b/Source/WebCore/rendering/RenderScrollbar.cpp
@@ -34,16 +34,18 @@
namespace WebCore {
-PassRefPtr<Scrollbar> RenderScrollbar::createCustomScrollbar(ScrollableArea* scrollableArea, ScrollbarOrientation orientation, RenderBox* renderer, Frame* owningFrame)
+PassRefPtr<Scrollbar> RenderScrollbar::createCustomScrollbar(ScrollableArea* scrollableArea, ScrollbarOrientation orientation, Node* ownerNode, Frame* owningFrame)
{
- return adoptRef(new RenderScrollbar(scrollableArea, orientation, renderer, owningFrame));
+ return adoptRef(new RenderScrollbar(scrollableArea, orientation, ownerNode, owningFrame));
}
-RenderScrollbar::RenderScrollbar(ScrollableArea* scrollableArea, ScrollbarOrientation orientation, RenderBox* renderer, Frame* owningFrame)
+RenderScrollbar::RenderScrollbar(ScrollableArea* scrollableArea, ScrollbarOrientation orientation, Node* ownerNode, Frame* owningFrame)
: Scrollbar(scrollableArea, orientation, RegularScrollbar, RenderScrollbarTheme::renderScrollbarTheme())
- , m_owner(renderer)
+ , m_owner(ownerNode)
, m_owningFrame(owningFrame)
{
+ ASSERT(ownerNode || owningFrame);
+
// FIXME: We need to do this because RenderScrollbar::styleChanged is called as soon as the scrollbar is created.
// Update the scrollbar size.
@@ -81,7 +83,7 @@ RenderBox* RenderScrollbar::owningRenderer() const
RenderBox* currentRenderer = m_owningFrame->ownerRenderer();
return currentRenderer;
}
- return m_owner;
+ return m_owner && m_owner->renderer() ? m_owner->renderer()->enclosingBox() : 0;
}
void RenderScrollbar::setParent(ScrollView* parent)
@@ -268,9 +270,11 @@ void RenderScrollbar::updateScrollbarPart(ScrollbarPart partType, bool destroy)
RenderScrollbarPart* partRenderer = m_parts.get(partType);
if (!partRenderer && needRenderer) {
partRenderer = new (owningRenderer()->renderArena()) RenderScrollbarPart(owningRenderer()->document(), this, partType);
+ partRenderer->setParent(owningRenderer());
m_parts.set(partType, partRenderer);
} else if (partRenderer && !needRenderer) {
m_parts.remove(partType);
+ partRenderer->setParent(0);
partRenderer->destroy();
partRenderer = 0;
}
diff --git a/Source/WebCore/rendering/RenderScrollbar.h b/Source/WebCore/rendering/RenderScrollbar.h
index 7fe2fac8b..61d980347 100644
--- a/Source/WebCore/rendering/RenderScrollbar.h
+++ b/Source/WebCore/rendering/RenderScrollbar.h
@@ -26,6 +26,7 @@
#ifndef RenderScrollbar_h
#define RenderScrollbar_h
+#include "Node.h"
#include "RenderStyleConstants.h"
#include "Scrollbar.h"
#include <wtf/HashMap.h>
@@ -39,18 +40,17 @@ class RenderStyle;
class RenderScrollbar : public Scrollbar {
protected:
- RenderScrollbar(ScrollableArea*, ScrollbarOrientation, RenderBox*, Frame*);
+ RenderScrollbar(ScrollableArea*, ScrollbarOrientation, Node*, Frame*);
public:
friend class Scrollbar;
- static PassRefPtr<Scrollbar> createCustomScrollbar(ScrollableArea*, ScrollbarOrientation, RenderBox*, Frame* owningFrame = 0);
+ static PassRefPtr<Scrollbar> createCustomScrollbar(ScrollableArea*, ScrollbarOrientation, Node*, Frame* owningFrame = 0);
virtual ~RenderScrollbar();
static ScrollbarPart partForStyleResolve();
static RenderScrollbar* scrollbarForStyleResolve();
RenderBox* owningRenderer() const;
- void clearOwningRenderer() { m_owner = 0; }
void paintPart(GraphicsContext*, ScrollbarPart, const IntRect&);
@@ -80,7 +80,12 @@ private:
PassRefPtr<RenderStyle> getScrollbarPseudoStyle(ScrollbarPart, PseudoId);
void updateScrollbarPart(ScrollbarPart, bool destroy = false);
- RenderBox* m_owner;
+ // This Scrollbar(Widget) may outlive the DOM which created it (during tear down),
+ // so we keep a reference to the Node which caused this custom scrollbar creation.
+ // This will not create a reference cycle as the Widget tree is owned by our containing
+ // FrameView which this Node pointer can in no way keep alive. See webkit bug 80610.
+ RefPtr<Node> m_owner;
+
Frame* m_owningFrame;
HashMap<unsigned, RenderScrollbarPart*> m_parts;
};
diff --git a/Source/WebCore/rendering/RenderScrollbarPart.h b/Source/WebCore/rendering/RenderScrollbarPart.h
index fba180e0f..f481f5a2c 100644
--- a/Source/WebCore/rendering/RenderScrollbarPart.h
+++ b/Source/WebCore/rendering/RenderScrollbarPart.h
@@ -35,6 +35,8 @@ class RenderScrollbar;
class RenderScrollbarPart : public RenderBlock {
public:
+ friend class RenderScrollbar;
+
RenderScrollbarPart(Node*, RenderScrollbar* = 0, ScrollbarPart = NoPart);
virtual ~RenderScrollbarPart();
diff --git a/Source/WebCore/rendering/RenderTableSection.cpp b/Source/WebCore/rendering/RenderTableSection.cpp
index 0651c77af..a6f544ab5 100644
--- a/Source/WebCore/rendering/RenderTableSection.cpp
+++ b/Source/WebCore/rendering/RenderTableSection.cpp
@@ -1294,7 +1294,7 @@ void RenderTableSection::splitColumn(unsigned pos, unsigned first)
r[pos + 1].cells.append(r[pos].cells);
RenderTableCell* cell = r[pos].primaryCell();
ASSERT(cell);
- ASSERT(cell->colSpan() >= (r[pos].inColSpan ? 1 : 0));
+ ASSERT(cell->colSpan() >= (r[pos].inColSpan ? 1u : 0));
unsigned colleft = cell->colSpan() - r[pos].inColSpan;
if (first > colleft)
r[pos + 1].inColSpan = 0;
diff --git a/Source/WebCore/rendering/RenderText.cpp b/Source/WebCore/rendering/RenderText.cpp
index 063efd5b8..16c1ea172 100644
--- a/Source/WebCore/rendering/RenderText.cpp
+++ b/Source/WebCore/rendering/RenderText.cpp
@@ -729,7 +729,6 @@ ALWAYS_INLINE float RenderText::widthFromCache(const Font& f, int start, int len
if (f.isFixedPitch() && !f.isSmallCaps() && m_isAllASCII && (!glyphOverflow || !glyphOverflow->computeBounds)) {
float monospaceCharacterWidth = f.spaceWidth();
- float tabWidth = allowTabs() ? monospaceCharacterWidth * 8 : 0;
float w = 0;
bool isSpace;
bool previousCharWasSpace = true; // FIXME: Preserves historical behavior, but seems wrong for start > 0.
@@ -742,7 +741,7 @@ ALWAYS_INLINE float RenderText::widthFromCache(const Font& f, int start, int len
w += monospaceCharacterWidth;
isSpace = true;
} else if (c == '\t') {
- w += tabWidth ? tabWidth - fmodf(xPos + w, tabWidth) : monospaceCharacterWidth;
+ w += style()->collapseWhiteSpace() ? monospaceCharacterWidth : f.tabWidth(style()->tabSize(), xPos + w);
isSpace = true;
} else
isSpace = false;
@@ -762,7 +761,7 @@ ALWAYS_INLINE float RenderText::widthFromCache(const Font& f, int start, int len
ASSERT(run.charactersLength() >= run.length());
run.setCharacterScanForCodePath(!canUseSimpleFontCodePath());
- run.setAllowTabs(allowTabs());
+ run.setTabSize(!style()->collapseWhiteSpace(), style()->tabSize());
run.setXPos(xPos);
return f.width(run, fallbackFonts, glyphOverflow);
}
@@ -1061,8 +1060,7 @@ void RenderText::computePreferredLogicalWidths(float leadWidth, HashSet<const Si
TextRun run = RenderBlock::constructTextRun(this, f, txt + i, 1, styleToUse);
run.setCharactersLength(len - i);
ASSERT(run.charactersLength() >= run.length());
-
- run.setAllowTabs(allowTabs());
+ run.setTabSize(!style()->collapseWhiteSpace(), style()->tabSize());
run.setXPos(leadWidth + currMaxWidth);
currMaxWidth += f.width(run);
@@ -1477,7 +1475,7 @@ float RenderText::width(unsigned from, unsigned len, const Font& f, float xPos,
ASSERT(run.charactersLength() >= run.length());
run.setCharacterScanForCodePath(!canUseSimpleFontCodePath());
- run.setAllowTabs(allowTabs());
+ run.setTabSize(!style()->collapseWhiteSpace(), style()->tabSize());
run.setXPos(xPos);
w = f.width(run, fallbackFonts, glyphOverflow);
}
diff --git a/Source/WebCore/rendering/RenderText.h b/Source/WebCore/rendering/RenderText.h
index 9043b0954..8157e37eb 100644
--- a/Source/WebCore/rendering/RenderText.h
+++ b/Source/WebCore/rendering/RenderText.h
@@ -123,8 +123,6 @@ public:
InlineTextBox* findNextInlineTextBox(int offset, int& pos) const;
- bool allowTabs() const { return !style()->collapseWhiteSpace(); }
-
void checkConsistency() const;
virtual void computePreferredLogicalWidths(float leadWidth);
diff --git a/Source/WebCore/rendering/RenderTextControlSingleLine.cpp b/Source/WebCore/rendering/RenderTextControlSingleLine.cpp
index 229fed994..f04f3c1fa 100644
--- a/Source/WebCore/rendering/RenderTextControlSingleLine.cpp
+++ b/Source/WebCore/rendering/RenderTextControlSingleLine.cpp
@@ -750,7 +750,7 @@ PassRefPtr<Scrollbar> RenderTextControlSingleLine::createScrollbar(ScrollableAre
RefPtr<Scrollbar> widget;
bool hasCustomScrollbarStyle = style()->hasPseudoStyle(SCROLLBAR);
if (hasCustomScrollbarStyle)
- widget = RenderScrollbar::createCustomScrollbar(scrollableArea, orientation, this);
+ widget = RenderScrollbar::createCustomScrollbar(scrollableArea, orientation, this->node());
else
widget = Scrollbar::createNativeScrollbar(scrollableArea, orientation, controlSize);
return widget.release();
diff --git a/Source/WebCore/rendering/RenderThemeMac.h b/Source/WebCore/rendering/RenderThemeMac.h
index ebbb2352c..22a614a0c 100644
--- a/Source/WebCore/rendering/RenderThemeMac.h
+++ b/Source/WebCore/rendering/RenderThemeMac.h
@@ -219,7 +219,7 @@ private:
NSMenu* searchMenuTemplate() const;
NSSliderCell* sliderThumbHorizontal() const;
NSSliderCell* sliderThumbVertical() const;
- NSTextFieldCell* textField() const;
+ NSTextFieldCell* textField(bool useNewGradient) const;
#if ENABLE(METER_TAG)
NSLevelIndicatorStyle levelIndicatorStyleFor(ControlPart) const;
diff --git a/Source/WebCore/rendering/RenderThemeMac.mm b/Source/WebCore/rendering/RenderThemeMac.mm
index 801b235a9..5e2d26738 100644
--- a/Source/WebCore/rendering/RenderThemeMac.mm
+++ b/Source/WebCore/rendering/RenderThemeMac.mm
@@ -105,6 +105,25 @@ const double progressAnimationNumFrames = 256;
@end
+@interface NSTextFieldCell (WKDetails)
+- (CFDictionaryRef)_coreUIDrawOptionsWithFrame:(NSRect)cellFrame inView:(NSView *)controlView includeFocus:(BOOL)includeFocus;
+@end
+
+
+@interface WebCoreTextFieldCell : NSTextFieldCell
+- (CFDictionaryRef)_coreUIDrawOptionsWithFrame:(NSRect)cellFrame inView:(NSView *)controlView includeFocus:(BOOL)includeFocus;
+@end
+
+@implementation WebCoreTextFieldCell
+- (CFDictionaryRef)_coreUIDrawOptionsWithFrame:(NSRect)cellFrame inView:(NSView *)controlView includeFocus:(BOOL)includeFocus
+{
+ // FIXME: This is a post-Lion-only workaround for <rdar://problem/11385461>. When that bug is resolved, we should remove this code.
+ CFMutableDictionaryRef coreUIDrawOptions = CFDictionaryCreateMutableCopy(NULL, 0, [super _coreUIDrawOptionsWithFrame:cellFrame inView:controlView includeFocus:includeFocus]);
+ CFDictionarySetValue(coreUIDrawOptions, @"borders only", kCFBooleanTrue);
+ return (CFDictionaryRef)[NSMakeCollectable(coreUIDrawOptions) autorelease];
+}
+@end
+
namespace WebCore {
using namespace HTMLNames;
@@ -489,7 +508,7 @@ NSView* RenderThemeMac::documentViewFor(RenderObject* o) const
bool RenderThemeMac::isControlStyled(const RenderStyle* style, const BorderData& border,
const FillLayer& background, const Color& backgroundColor) const
{
- if (style->appearance() == TextAreaPart || style->appearance() == ListboxPart)
+ if (style->appearance() == TextFieldPart || style->appearance() == TextAreaPart || style->appearance() == ListboxPart)
return style->border() != border;
// FIXME: This is horrible, but there is not much else that can be done. Menu lists cannot draw properly when
@@ -714,7 +733,19 @@ NSControlSize RenderThemeMac::controlSizeForSystemFont(RenderStyle* style) const
bool RenderThemeMac::paintTextField(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
{
LocalCurrentGraphicsContext localContext(paintInfo.context);
- NSTextFieldCell* textField = this->textField();
+
+ bool useNewGradient = true;
+#if defined(BUILDING_ON_LION) || defined(BUILDING_ON_SNOW_LEOPARD)
+ // See comment in RenderThemeMac::textField() for a complete explanation of this.
+ useNewGradient = WebCore::deviceScaleFactor(o->frame()) != 1;
+ if (useNewGradient) {
+ useNewGradient = o->style()->hasAppearance()
+ && o->style()->visitedDependentColor(CSSPropertyBackgroundColor) == Color::white
+ && !o->style()->hasBackgroundImage();
+ }
+#endif
+
+ NSTextFieldCell* textField = this->textField(useNewGradient);
GraphicsContextStateSaver stateSaver(*paintInfo.context);
@@ -2133,15 +2164,36 @@ NSSliderCell* RenderThemeMac::sliderThumbVertical() const
return m_sliderThumbVertical.get();
}
-NSTextFieldCell* RenderThemeMac::textField() const
+NSTextFieldCell* RenderThemeMac::textField(bool useNewGradient) const
{
if (!m_textField) {
- m_textField.adoptNS([[NSTextFieldCell alloc] initTextCell:@""]);
+ m_textField.adoptNS([[WebCoreTextFieldCell alloc] initTextCell:@""]);
[m_textField.get() setBezeled:YES];
[m_textField.get() setEditable:YES];
[m_textField.get() setFocusRingType:NSFocusRingTypeExterior];
+#if defined(BUILDING_ON_LION) || defined(BUILDING_ON_SNOW_LEOPARD)
+ [m_textField.get() setDrawsBackground:YES];
+#else
+ UNUSED_PARAM(useNewGradient);
+ [m_textField.get() setDrawsBackground:NO];
+#endif
}
+#if defined(BUILDING_ON_LION) || defined(BUILDING_ON_SNOW_LEOPARD)
+ // This is a workaround for <rdar://problem/11385461> on Lion and SnowLeopard. Newer versions of the
+ // OS can always use the newer version of the text field with the workaround above in
+ // _coreUIDrawOptionsWithFrame. With this workaround for older OS's, when the deviceScaleFactor is 1,
+ // we have an old-school gradient bezel in text fields whether they are styled or not. This is fine and
+ // matches shipping Safari. When the deviceScaleFactor is greater than 1, text fields will have newer,
+ // AppKit-matching gradients that look much more appropriate at the higher resolutions. However, if the
+ // text field is styled in any way, we'll revert to the old-school bezel, which doesn't look great in
+ // HiDPI, but it looks better than the CSS border, which is the only alternative until 11385461 is resolved.
+ if (useNewGradient)
+ [m_textField.get() setBackgroundColor:[NSColor whiteColor]];
+ else
+ [m_textField.get() setBackgroundColor:[NSColor clearColor]];
+#endif
+
return m_textField.get();
}
diff --git a/Source/WebCore/rendering/style/RenderStyle.cpp b/Source/WebCore/rendering/style/RenderStyle.cpp
index a98d558a1..2ffb5eb17 100644
--- a/Source/WebCore/rendering/style/RenderStyle.cpp
+++ b/Source/WebCore/rendering/style/RenderStyle.cpp
@@ -462,6 +462,7 @@ StyleDifference RenderStyle::diff(const RenderStyle* other, unsigned& changedCon
|| rareInheritedData->textEmphasisMark != other->rareInheritedData->textEmphasisMark
|| rareInheritedData->textEmphasisPosition != other->rareInheritedData->textEmphasisPosition
|| rareInheritedData->textEmphasisCustomMark != other->rareInheritedData->textEmphasisCustomMark
+ || rareInheritedData->m_tabSize != other->rareInheritedData->m_tabSize
|| rareInheritedData->m_lineBoxContain != other->rareInheritedData->m_lineBoxContain
|| rareInheritedData->m_lineGrid != other->rareInheritedData->m_lineGrid
|| rareInheritedData->m_lineSnap != other->rareInheritedData->m_lineSnap
diff --git a/Source/WebCore/rendering/style/RenderStyle.h b/Source/WebCore/rendering/style/RenderStyle.h
index d57551497..8654f1930 100644
--- a/Source/WebCore/rendering/style/RenderStyle.h
+++ b/Source/WebCore/rendering/style/RenderStyle.h
@@ -909,6 +909,9 @@ public:
TextCombine textCombine() const { return static_cast<TextCombine>(rareNonInheritedData->m_textCombine); }
bool hasTextCombine() const { return textCombine() != TextCombineNone; }
+
+ unsigned tabSize() const { return rareInheritedData->m_tabSize; }
+
// End CSS3 Getters
const AtomicString& flowThread() const { return rareNonInheritedData->m_flowThread; }
@@ -1325,6 +1328,8 @@ public:
void setFilter(const FilterOperations& ops) { SET_VAR(rareNonInheritedData.access()->m_filter, m_operations, ops); }
#endif
+ void setTabSize(unsigned size) { SET_VAR(rareInheritedData, m_tabSize, size); }
+
// End CSS3 Setters
void setLineGrid(const AtomicString& lineGrid) { SET_VAR(rareInheritedData, m_lineGrid, lineGrid); }
@@ -1664,6 +1669,8 @@ public:
static Length initialGridItemRow() { return Length(); }
#endif
+ static unsigned initialTabSize() { return 8; }
+
static const AtomicString& initialLineGrid() { return nullAtom; }
static LineSnap initialLineSnap() { return LineSnapNone; }
static LineAlign initialLineAlign() { return LineAlignNone; }
diff --git a/Source/WebCore/rendering/style/StyleRareInheritedData.cpp b/Source/WebCore/rendering/style/StyleRareInheritedData.cpp
index 5d73793ce..9918e0ede 100644
--- a/Source/WebCore/rendering/style/StyleRareInheritedData.cpp
+++ b/Source/WebCore/rendering/style/StyleRareInheritedData.cpp
@@ -62,6 +62,7 @@ StyleRareInheritedData::StyleRareInheritedData()
, hyphenationLimitAfter(-1)
, hyphenationLimitLines(-1)
, m_lineGrid(RenderStyle::initialLineGrid())
+ , m_tabSize(RenderStyle::initialTabSize())
#if ENABLE(TOUCH_EVENTS)
, tapHighlightColor(RenderStyle::initialTapHighlightColor())
#endif
@@ -113,6 +114,7 @@ StyleRareInheritedData::StyleRareInheritedData(const StyleRareInheritedData& o)
, locale(o.locale)
, textEmphasisCustomMark(o.textEmphasisCustomMark)
, m_lineGrid(o.m_lineGrid)
+ , m_tabSize(o.m_tabSize)
#if ENABLE(TOUCH_EVENTS)
, tapHighlightColor(o.tapHighlightColor)
#endif
@@ -177,6 +179,7 @@ bool StyleRareInheritedData::operator==(const StyleRareInheritedData& o) const
&& locale == o.locale
&& textEmphasisCustomMark == o.textEmphasisCustomMark
&& QuotesData::equal(quotes.get(), o.quotes.get())
+ && m_tabSize == o.m_tabSize
&& m_lineGrid == o.m_lineGrid
&& m_imageRendering == o.m_imageRendering
&& m_lineSnap == o.m_lineSnap
diff --git a/Source/WebCore/rendering/style/StyleRareInheritedData.h b/Source/WebCore/rendering/style/StyleRareInheritedData.h
index 570dbb573..df8879a11 100644
--- a/Source/WebCore/rendering/style/StyleRareInheritedData.h
+++ b/Source/WebCore/rendering/style/StyleRareInheritedData.h
@@ -106,8 +106,9 @@ public:
AtomicString textEmphasisCustomMark;
RefPtr<QuotesData> quotes;
-
+
AtomicString m_lineGrid;
+ unsigned m_tabSize;
#if ENABLE(TOUCH_EVENTS)
Color tapHighlightColor;
diff --git a/Source/WebCore/rendering/svg/RenderSVGEllipse.h b/Source/WebCore/rendering/svg/RenderSVGEllipse.h
index 76295c686..3720e9a31 100644
--- a/Source/WebCore/rendering/svg/RenderSVGEllipse.h
+++ b/Source/WebCore/rendering/svg/RenderSVGEllipse.h
@@ -39,7 +39,6 @@ public:
virtual ~RenderSVGEllipse();
private:
- virtual bool isSVGEllipse() const { return true; }
virtual const char* renderName() const { return "RenderSVGEllipse"; }
virtual void createShape();
diff --git a/Source/WebCore/rendering/svg/RenderSVGInline.cpp b/Source/WebCore/rendering/svg/RenderSVGInline.cpp
index ab8cc1a87..98af8e958 100644
--- a/Source/WebCore/rendering/svg/RenderSVGInline.cpp
+++ b/Source/WebCore/rendering/svg/RenderSVGInline.cpp
@@ -124,7 +124,7 @@ void RenderSVGInline::addChild(RenderObject* child, RenderObject* beforeChild)
{
RenderInline::addChild(child, beforeChild);
if (RenderSVGText* textRenderer = RenderSVGText::locateRenderSVGTextAncestor(this))
- textRenderer->layoutAttributesChanged(child);
+ textRenderer->subtreeChildAdded(child);
}
}
diff --git a/Source/WebCore/rendering/svg/RenderSVGInlineText.cpp b/Source/WebCore/rendering/svg/RenderSVGInlineText.cpp
index 09d446b7d..a0df4113e 100644
--- a/Source/WebCore/rendering/svg/RenderSVGInlineText.cpp
+++ b/Source/WebCore/rendering/svg/RenderSVGInlineText.cpp
@@ -81,28 +81,16 @@ void RenderSVGInlineText::willBeDestroyed()
}
Vector<SVGTextLayoutAttributes*> affectedAttributes;
- textRenderer->layoutAttributesWillBeDestroyed(this, affectedAttributes);
-
+ textRenderer->subtreeChildWillBeDestroyed(this, affectedAttributes);
RenderText::willBeDestroyed();
- if (affectedAttributes.isEmpty())
- return;
-
- if (!documentBeingDestroyed())
- textRenderer->rebuildLayoutAttributes(affectedAttributes);
+ textRenderer->subtreeChildWasDestroyed(this, affectedAttributes);
}
void RenderSVGInlineText::setTextInternal(PassRefPtr<StringImpl> text)
{
RenderText::setTextInternal(text);
-
- // When the underlying text content changes, call both textDOMChanged() & layoutAttributesChanged()
- // The former will clear the SVGTextPositioningElement cache, which depends on the textLength() of
- // the RenderSVGInlineText objects, and thus needs to be rebuild. The latter will assure that the
- // SVGTextLayoutAttributes associated with the RenderSVGInlineText will be updated.
- if (RenderSVGText* textRenderer = RenderSVGText::locateRenderSVGTextAncestor(this)) {
- textRenderer->invalidateTextPositioningElements();
- textRenderer->layoutAttributesChanged(this);
- }
+ if (RenderSVGText* textRenderer = RenderSVGText::locateRenderSVGTextAncestor(this))
+ textRenderer->subtreeTextChanged(this);
}
void RenderSVGInlineText::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle)
@@ -127,7 +115,7 @@ void RenderSVGInlineText::styleDidChange(StyleDifference diff, const RenderStyle
// The text metrics may be influenced by style changes.
if (RenderSVGText* textRenderer = RenderSVGText::locateRenderSVGTextAncestor(this))
- textRenderer->layoutAttributesChanged(this);
+ textRenderer->subtreeStyleChanged(this);
}
InlineTextBox* RenderSVGInlineText::createTextBox()
diff --git a/Source/WebCore/rendering/svg/RenderSVGRect.h b/Source/WebCore/rendering/svg/RenderSVGRect.h
index ab6eb2343..bd21538c2 100644
--- a/Source/WebCore/rendering/svg/RenderSVGRect.h
+++ b/Source/WebCore/rendering/svg/RenderSVGRect.h
@@ -40,7 +40,6 @@ public:
virtual ~RenderSVGRect();
private:
- virtual bool isSVGRect() const { return true; }
virtual const char* renderName() const { return "RenderSVGRect"; }
virtual void createShape();
diff --git a/Source/WebCore/rendering/svg/RenderSVGResource.h b/Source/WebCore/rendering/svg/RenderSVGResource.h
index e02015410..47e5dbea6 100644
--- a/Source/WebCore/rendering/svg/RenderSVGResource.h
+++ b/Source/WebCore/rendering/svg/RenderSVGResource.h
@@ -38,6 +38,7 @@ enum RenderSVGResourceType {
ClipperResourceType
};
+// If this enum changes change the unsigned bitfields using it.
enum RenderSVGResourceMode {
ApplyToDefaultMode = 1 << 0, // used for all resources except gradient/pattern
ApplyToFillMode = 1 << 1,
diff --git a/Source/WebCore/rendering/svg/RenderSVGShape.h b/Source/WebCore/rendering/svg/RenderSVGShape.h
index ab9b1cb5a..3814129c4 100644
--- a/Source/WebCore/rendering/svg/RenderSVGShape.h
+++ b/Source/WebCore/rendering/svg/RenderSVGShape.h
@@ -109,7 +109,6 @@ private:
virtual bool isSVGShape() const { return true; }
virtual const char* renderName() const { return "RenderSVGShape"; }
- virtual bool isRoundedRect() { return false; }
virtual void layout();
virtual void paint(PaintInfo&, const LayoutPoint&);
diff --git a/Source/WebCore/rendering/svg/RenderSVGText.cpp b/Source/WebCore/rendering/svg/RenderSVGText.cpp
index f512ab87b..f0f0b9c32 100644
--- a/Source/WebCore/rendering/svg/RenderSVGText.cpp
+++ b/Source/WebCore/rendering/svg/RenderSVGText.cpp
@@ -110,24 +110,22 @@ void RenderSVGText::mapLocalToContainer(RenderBoxModelObject* repaintContainer,
SVGRenderSupport::mapLocalToContainer(this, repaintContainer, transformState, wasFixed);
}
-static inline void recursiveUpdateLayoutAttributes(RenderObject* start, SVGTextLayoutAttributesBuilder& builder)
-{
- if (start->isSVGInlineText()) {
- builder.buildLayoutAttributesForTextRenderer(toRenderSVGInlineText(start));
- return;
- }
-
- for (RenderObject* child = start->firstChild(); child; child = child->nextSibling())
- recursiveUpdateLayoutAttributes(child, builder);
-}
-
-void RenderSVGText::layoutAttributesChanged(RenderObject* child)
+void RenderSVGText::subtreeChildAdded(RenderObject* child)
{
ASSERT(child);
if (m_needsPositioningValuesUpdate)
return;
+
+ // The positioning elements cache doesn't include the new 'child' yet. Clear the
+ // cache, as the next buildLayoutAttributesForTextRenderer() call rebuilds it.
+ invalidateTextPositioningElements();
+
FontCachePurgePreventer fontCachePurgePreventer;
- recursiveUpdateLayoutAttributes(child, m_layoutAttributesBuilder);
+ for (RenderObject* descendant = child; descendant; descendant = descendant->nextInPreOrder(child)) {
+ if (descendant->isSVGInlineText())
+ m_layoutAttributesBuilder.buildLayoutAttributesForTextRenderer(toRenderSVGInlineText(descendant));
+ }
+
rebuildLayoutAttributes();
}
@@ -162,12 +160,18 @@ static inline bool findPreviousAndNextAttributes(RenderObject* start, RenderSVGI
return false;
}
-void RenderSVGText::layoutAttributesWillBeDestroyed(RenderSVGInlineText* text, Vector<SVGTextLayoutAttributes*>& affectedAttributes)
+void RenderSVGText::subtreeChildWillBeDestroyed(RenderSVGInlineText* text, Vector<SVGTextLayoutAttributes*>& affectedAttributes)
{
ASSERT(text);
+
+ // The positioning elements cache depends on the size of each text renderer in the
+ // subtree. If this changes, clear the cache. It's going to be rebuilt below.
+ invalidateTextPositioningElements();
+
if (m_needsPositioningValuesUpdate)
return;
+ // This logic requires that the 'text' child is still inserted in the tree.
bool stopAfterNext = false;
SVGTextLayoutAttributes* previous = 0;
SVGTextLayoutAttributes* next = 0;
@@ -176,29 +180,94 @@ void RenderSVGText::layoutAttributesWillBeDestroyed(RenderSVGInlineText* text, V
affectedAttributes.append(previous);
if (next)
affectedAttributes.append(next);
-}
-void RenderSVGText::invalidateTextPositioningElements()
-{
- // Clear the text positioning elements. This should be called when either the children
- // of a DOM text element have changed, or the length of the text in any child element
- // has changed. Failure to clear may leave us with invalid elements, as other code paths
- // do not always cause the position elements to be marked invalid before use.
- m_layoutAttributesBuilder.clearTextPositioningElements();
+ SVGTextLayoutAttributes* currentLayoutAttributes = text->layoutAttributes();
+
+ size_t position = m_layoutAttributes.find(currentLayoutAttributes);
+ ASSERT(position != notFound);
+ m_layoutAttributes.remove(position);
+
+ ASSERT(!m_layoutAttributes.contains(currentLayoutAttributes));
}
-static inline void recursiveUpdateScaledFont(RenderObject* start)
+static inline void recursiveCollectLayoutAttributes(RenderObject* start, Vector<SVGTextLayoutAttributes*>& attributes)
{
for (RenderObject* child = start->firstChild(); child; child = child->nextSibling()) {
if (child->isSVGInlineText()) {
- toRenderSVGInlineText(child)->updateScaledFont();
+ attributes.append(toRenderSVGInlineText(child)->layoutAttributes());
continue;
}
- recursiveUpdateScaledFont(child);
+ recursiveCollectLayoutAttributes(child, attributes);
+ }
+}
+
+static inline void checkLayoutAttributesConsistency(RenderSVGText* text, Vector<SVGTextLayoutAttributes*>& expectedLayoutAttributes)
+{
+#ifndef NDEBUG
+ Vector<SVGTextLayoutAttributes*> newLayoutAttributes;
+ recursiveCollectLayoutAttributes(text, newLayoutAttributes);
+ ASSERT(newLayoutAttributes == expectedLayoutAttributes);
+#else
+ UNUSED_PARAM(text);
+ UNUSED_PARAM(expectedLayoutAttributes);
+#endif
+}
+
+void RenderSVGText::subtreeChildWasDestroyed(RenderSVGInlineText*, Vector<SVGTextLayoutAttributes*>& affectedAttributes)
+{
+ if (documentBeingDestroyed() || affectedAttributes.isEmpty())
+ return;
+
+ checkLayoutAttributesConsistency(this, m_layoutAttributes);
+
+ size_t size = affectedAttributes.size();
+ for (size_t i = 0; i < size; ++i)
+ m_layoutAttributesBuilder.rebuildMetricsForTextRenderer(affectedAttributes[i]->context());
+}
+
+void RenderSVGText::subtreeStyleChanged(RenderSVGInlineText* text)
+{
+ ASSERT(text);
+ if (m_needsPositioningValuesUpdate)
+ return;
+
+ // Only update the metrics cache, but not the text positioning element cache
+ // nor the layout attributes cached in the leaf #text renderers.
+ FontCachePurgePreventer fontCachePurgePreventer;
+ for (RenderObject* descendant = text; descendant; descendant = descendant->nextInPreOrder(text)) {
+ if (descendant->isSVGInlineText())
+ m_layoutAttributesBuilder.rebuildMetricsForTextRenderer(toRenderSVGInlineText(descendant));
+ }
+}
+
+void RenderSVGText::subtreeTextChanged(RenderSVGInlineText* text)
+{
+ ASSERT(text);
+
+ // The positioning elements cache depends on the size of each text renderer in the
+ // subtree. If this changes, clear the cache. It's going to be rebuilt below.
+ invalidateTextPositioningElements();
+
+ if (m_needsPositioningValuesUpdate)
+ return;
+
+ FontCachePurgePreventer fontCachePurgePreventer;
+ for (RenderObject* descendant = text; descendant; descendant = descendant->nextInPreOrder(text)) {
+ if (descendant->isSVGInlineText())
+ m_layoutAttributesBuilder.buildLayoutAttributesForTextRenderer(toRenderSVGInlineText(descendant));
}
}
+void RenderSVGText::invalidateTextPositioningElements()
+{
+ // Clear the text positioning elements. This should be called when either the children
+ // of a DOM text element have changed, or the length of the text in any child element
+ // has changed. Failure to clear may leave us with invalid elements, as other code paths
+ // do not always cause the position elements to be marked invalid before use.
+ m_layoutAttributesBuilder.clearTextPositioningElements();
+}
+
void RenderSVGText::layout()
{
ASSERT(needsLayout());
@@ -215,8 +284,12 @@ void RenderSVGText::layout()
// If the root layout size changed (eg. window size changes) or the positioning values change
// or the transform to the root context has changed then recompute the on-screen font size.
if (m_needsTextMetricsUpdate || SVGRenderSupport::findTreeRootObject(this)->isLayoutSizeChanged()) {
- recursiveUpdateScaledFont(this);
- rebuildLayoutAttributes(true);
+ for (RenderObject* descendant = this; descendant; descendant = descendant->nextInPreOrder(this)) {
+ if (descendant->isSVGInlineText())
+ toRenderSVGInlineText(descendant)->updateScaledFont();
+ }
+
+ rebuildAllLayoutAttributes();
updateCachedBoundariesInParents = true;
m_needsTextMetricsUpdate = false;
}
@@ -364,7 +437,7 @@ FloatRect RenderSVGText::repaintRectInLocalCoordinates() const
void RenderSVGText::addChild(RenderObject* child, RenderObject* beforeChild)
{
RenderSVGBlock::addChild(child, beforeChild);
- layoutAttributesChanged(child);
+ subtreeChildAdded(child);
}
// Fix for <rdar://problem/8048875>. We should not render :first-line CSS Style
@@ -380,38 +453,23 @@ void RenderSVGText::updateFirstLetter()
{
}
-static inline void recursiveCollectLayoutAttributes(RenderObject* start, Vector<SVGTextLayoutAttributes*>& attributes)
+void RenderSVGText::rebuildAllLayoutAttributes()
{
- for (RenderObject* child = start->firstChild(); child; child = child->nextSibling()) {
- if (child->isSVGInlineText()) {
- attributes.append(toRenderSVGInlineText(child)->layoutAttributes());
- continue;
- }
+ m_layoutAttributes.clear();
+ recursiveCollectLayoutAttributes(this, m_layoutAttributes);
+ if (m_layoutAttributes.isEmpty())
+ return;
- recursiveCollectLayoutAttributes(child, attributes);
- }
+ m_layoutAttributesBuilder.rebuildMetricsForWholeTree(this);
}
-void RenderSVGText::rebuildLayoutAttributes(bool performFullRebuild)
+void RenderSVGText::rebuildLayoutAttributes()
{
- if (performFullRebuild)
- m_layoutAttributes.clear();
-
if (m_layoutAttributes.isEmpty()) {
- recursiveCollectLayoutAttributes(this, m_layoutAttributes);
- if (m_layoutAttributes.isEmpty() || !performFullRebuild)
- return;
-
- m_layoutAttributesBuilder.rebuildMetricsForWholeTree(this);
+ rebuildAllLayoutAttributes();
return;
}
- Vector<SVGTextLayoutAttributes*> affectedAttributes;
- rebuildLayoutAttributes(affectedAttributes);
-}
-
-void RenderSVGText::rebuildLayoutAttributes(Vector<SVGTextLayoutAttributes*>& affectedAttributes)
-{
// Detect changes in layout attributes and only measure those text parts that have changed!
Vector<SVGTextLayoutAttributes*> newLayoutAttributes;
recursiveCollectLayoutAttributes(this, newLayoutAttributes);
@@ -420,7 +478,7 @@ void RenderSVGText::rebuildLayoutAttributes(Vector<SVGTextLayoutAttributes*>& af
return;
}
- // Compare m_layoutAttributes with newLayoutAttributes to figure out which attributes got added/removed.
+ // Compare m_layoutAttributes with newLayoutAttributes to figure out which attributes got added.
size_t size = newLayoutAttributes.size();
for (size_t i = 0; i < size; ++i) {
SVGTextLayoutAttributes* attributes = newLayoutAttributes[i];
@@ -428,10 +486,6 @@ void RenderSVGText::rebuildLayoutAttributes(Vector<SVGTextLayoutAttributes*>& af
m_layoutAttributesBuilder.rebuildMetricsForTextRenderer(attributes->context());
}
- size = affectedAttributes.size();
- for (size_t i = 0; i < size; ++i)
- m_layoutAttributesBuilder.rebuildMetricsForTextRenderer(affectedAttributes[i]->context());
-
m_layoutAttributes = newLayoutAttributes;
}
diff --git a/Source/WebCore/rendering/svg/RenderSVGText.h b/Source/WebCore/rendering/svg/RenderSVGText.h
index 5665b4442..23a0b6a9a 100644
--- a/Source/WebCore/rendering/svg/RenderSVGText.h
+++ b/Source/WebCore/rendering/svg/RenderSVGText.h
@@ -48,18 +48,18 @@ public:
static const RenderSVGText* locateRenderSVGTextAncestor(const RenderObject*);
bool needsReordering() const { return m_needsReordering; }
+ Vector<SVGTextLayoutAttributes*>& layoutAttributes() { return m_layoutAttributes; }
+
+ void subtreeChildAdded(RenderObject*);
+ void subtreeChildWillBeDestroyed(RenderSVGInlineText*, Vector<SVGTextLayoutAttributes*>& affectedAttributes);
+ void subtreeChildWasDestroyed(RenderSVGInlineText*, Vector<SVGTextLayoutAttributes*>& affectedAttributes);
+ void subtreeStyleChanged(RenderSVGInlineText*);
+ void subtreeTextChanged(RenderSVGInlineText*);
// Call this method when either the children of a DOM text element have changed, or the length of
// the text in any child element has changed.
void invalidateTextPositioningElements();
- void layoutAttributesChanged(RenderObject*);
- void layoutAttributesWillBeDestroyed(RenderSVGInlineText*, Vector<SVGTextLayoutAttributes*>& affectedAttributes);
- void rebuildLayoutAttributes(bool performFullRebuild = false);
- void rebuildLayoutAttributes(Vector<SVGTextLayoutAttributes*>& affectedAttributes);
-
- Vector<SVGTextLayoutAttributes*>& layoutAttributes() { return m_layoutAttributes; }
-
private:
virtual const char* renderName() const { return "RenderSVGText"; }
virtual bool isSVGText() const { return true; }
@@ -91,6 +91,9 @@ private:
virtual RenderBlock* firstLineBlock() const;
virtual void updateFirstLetter();
+ void rebuildAllLayoutAttributes();
+ void rebuildLayoutAttributes();
+
bool m_needsReordering : 1;
bool m_needsPositioningValuesUpdate : 1;
bool m_needsTransformUpdate : 1;
diff --git a/Source/WebCore/rendering/svg/SVGInlineTextBox.cpp b/Source/WebCore/rendering/svg/SVGInlineTextBox.cpp
index 27ba5fbce..24e9a82f7 100644
--- a/Source/WebCore/rendering/svg/SVGInlineTextBox.cpp
+++ b/Source/WebCore/rendering/svg/SVGInlineTextBox.cpp
@@ -44,6 +44,15 @@ using namespace std;
namespace WebCore {
+class ExpectedSVGInlineTextBoxSize : public InlineTextBox {
+ float float1;
+ uint32_t bitfields : 5;
+ void* pointer;
+ Vector<SVGTextFragment> vector;
+};
+
+COMPILE_ASSERT(sizeof(SVGInlineTextBox) == sizeof(ExpectedSVGInlineTextBoxSize), SVGInlineTextBox_is_not_of_expected_size);
+
SVGInlineTextBox::SVGInlineTextBox(RenderObject* object)
: InlineTextBox(object)
, m_logicalHeight(0)
@@ -422,7 +431,6 @@ TextRun SVGInlineTextBox::constructTextRun(RenderStyle* style, const SVGTextFrag
TextRun run(text->characters() + fragment.characterOffset
, fragment.length
- , false /* allowTabs */
, 0 /* xPos, only relevant with allowTabs=true */
, 0 /* padding, only relevant for justified text, not relevant for SVG */
, TextRun::AllowTrailingExpansion
diff --git a/Source/WebCore/rendering/svg/SVGInlineTextBox.h b/Source/WebCore/rendering/svg/SVGInlineTextBox.h
index d3b9d799d..079601d2c 100644
--- a/Source/WebCore/rendering/svg/SVGInlineTextBox.h
+++ b/Source/WebCore/rendering/svg/SVGInlineTextBox.h
@@ -83,8 +83,8 @@ private:
private:
float m_logicalHeight;
- int m_paintingResourceMode;
- bool m_startsNewTextChunk : 1;
+ unsigned m_paintingResourceMode : 4;
+ unsigned m_startsNewTextChunk : 1;
RenderSVGResource* m_paintingResource;
Vector<SVGTextFragment> m_textFragments;
};
diff --git a/Source/WebCore/rendering/svg/SVGRootInlineBox.cpp b/Source/WebCore/rendering/svg/SVGRootInlineBox.cpp
index 57146c90c..34e93a02e 100644
--- a/Source/WebCore/rendering/svg/SVGRootInlineBox.cpp
+++ b/Source/WebCore/rendering/svg/SVGRootInlineBox.cpp
@@ -73,7 +73,6 @@ void SVGRootInlineBox::computePerCharacterLayoutInformation()
RenderSVGText* textRoot = toRenderSVGText(block());
ASSERT(textRoot);
- textRoot->rebuildLayoutAttributes();
Vector<SVGTextLayoutAttributes*>& layoutAttributes = textRoot->layoutAttributes();
if (layoutAttributes.isEmpty())
return;
diff --git a/Source/WebCore/rendering/svg/SVGTextLayoutAttributesBuilder.cpp b/Source/WebCore/rendering/svg/SVGTextLayoutAttributesBuilder.cpp
index 02a2123eb..067bf6bb9 100644
--- a/Source/WebCore/rendering/svg/SVGTextLayoutAttributesBuilder.cpp
+++ b/Source/WebCore/rendering/svg/SVGTextLayoutAttributesBuilder.cpp
@@ -26,9 +26,6 @@
#include "RenderSVGText.h"
#include "SVGTextPositioningElement.h"
-// Set to a value > 0 to dump the text layout attributes
-#define DUMP_TEXT_LAYOUT_ATTRIBUTES 0
-
namespace WebCore {
SVGTextLayoutAttributesBuilder::SVGTextLayoutAttributesBuilder()
@@ -173,11 +170,6 @@ void SVGTextLayoutAttributesBuilder::buildLayoutAttributes(RenderSVGText* textRo
unsigned size = m_textPositions.size();
for (unsigned i = 0; i < size; ++i)
fillCharacterDataMap(m_textPositions[i]);
-
-#if DUMP_TEXT_LAYOUT_ATTRIBUTES > 0
- fprintf(stderr, "\nDumping ALL layout attributes for RenderSVGText, renderer=%p, node=%p (m_textLength: %i)\n", textRoot, textRoot->node(), m_textLength);
- m_characterDataMap.dump();
-#endif
}
static inline void updateCharacterData(unsigned i, float& lastRotation, SVGCharacterData& data, const SVGLengthContext& lengthContext, const SVGLengthList* xList, const SVGLengthList* yList, const SVGLengthList* dxList, const SVGLengthList* dyList, const SVGNumberList* rotateList)
diff --git a/Source/WebCore/rendering/svg/SVGTextMetrics.cpp b/Source/WebCore/rendering/svg/SVGTextMetrics.cpp
index 8d155d8f4..d6cbe4c50 100644
--- a/Source/WebCore/rendering/svg/SVGTextMetrics.cpp
+++ b/Source/WebCore/rendering/svg/SVGTextMetrics.cpp
@@ -70,7 +70,6 @@ TextRun SVGTextMetrics::constructTextRun(RenderSVGInlineText* text, const UChar*
TextRun run(characters + position
, length
- , false /* allowTabs */
, 0 /* xPos, only relevant with allowTabs=true */
, 0 /* padding, only relevant for justified text, not relevant for SVG */
, TextRun::AllowTrailingExpansion
diff --git a/Source/WebCore/storage/StorageArea.h b/Source/WebCore/storage/StorageArea.h
index e2d082eb8..5da1bc150 100644
--- a/Source/WebCore/storage/StorageArea.h
+++ b/Source/WebCore/storage/StorageArea.h
@@ -49,9 +49,9 @@ namespace WebCore {
virtual unsigned length(Frame* sourceFrame) const = 0;
virtual String key(unsigned index, Frame* sourceFrame) const = 0;
virtual String getItem(const String& key, Frame* sourceFrame) const = 0;
- virtual String setItem(const String& key, const String& value, ExceptionCode& ec, Frame* sourceFrame) = 0;
- virtual String removeItem(const String& key, Frame* sourceFrame) = 0;
- virtual bool clear(Frame* sourceFrame) = 0;
+ virtual void setItem(const String& key, const String& value, ExceptionCode&, Frame* sourceFrame) = 0;
+ virtual void removeItem(const String& key, Frame* sourceFrame) = 0;
+ virtual void clear(Frame* sourceFrame) = 0;
virtual bool contains(const String& key, Frame* sourceFrame) const = 0;
virtual bool disabledByPrivateBrowsingInFrame(const Frame* sourceFrame) const = 0;
diff --git a/Source/WebCore/storage/StorageAreaImpl.cpp b/Source/WebCore/storage/StorageAreaImpl.cpp
index 07748302b..72e865718 100644
--- a/Source/WebCore/storage/StorageAreaImpl.cpp
+++ b/Source/WebCore/storage/StorageAreaImpl.cpp
@@ -102,13 +102,6 @@ StorageAreaImpl::StorageAreaImpl(StorageAreaImpl* area)
bool StorageAreaImpl::disabledByPrivateBrowsingInFrame(const Frame* frame) const
{
-#if PLATFORM(CHROMIUM)
- // The frame pointer can be NULL in Chromium since this call is made in a different
- // process from where the Frame object exists. Luckily, private browseing is
- // implemented differently in Chromium, so it'd never return true anyway.
- ASSERT(!frame);
- return false;
-#else
if (!frame->page())
return true;
if (!frame->page()->settings()->privateBrowsingEnabled())
@@ -116,7 +109,6 @@ bool StorageAreaImpl::disabledByPrivateBrowsingInFrame(const Frame* frame) const
if (m_storageType != LocalStorage)
return true;
return !SchemeRegistry::allowsLocalStorageAccessInPrivateBrowsing(frame->document()->securityOrigin()->protocol());
-#endif
}
unsigned StorageAreaImpl::length(Frame*) const
@@ -143,7 +135,7 @@ String StorageAreaImpl::getItem(const String& key, Frame*) const
return m_storageMap->getItem(key);
}
-String StorageAreaImpl::setItem(const String& key, const String& value, ExceptionCode& ec, Frame* frame)
+void StorageAreaImpl::setItem(const String& key, const String& value, ExceptionCode& ec, Frame* frame)
{
ASSERT(!m_isShutdown);
ASSERT(!value.isNull());
@@ -151,7 +143,7 @@ String StorageAreaImpl::setItem(const String& key, const String& value, Exceptio
if (disabledByPrivateBrowsingInFrame(frame)) {
ec = QUOTA_EXCEEDED_ERR;
- return String();
+ return;
}
String oldValue;
@@ -162,25 +154,24 @@ String StorageAreaImpl::setItem(const String& key, const String& value, Exceptio
if (quotaException) {
ec = QUOTA_EXCEEDED_ERR;
- return oldValue;
+ return;
}
if (oldValue == value)
- return oldValue;
+ return;
if (m_storageAreaSync)
m_storageAreaSync->scheduleItemForSync(key, value);
StorageEventDispatcher::dispatch(key, oldValue, value, m_storageType, m_securityOrigin.get(), frame);
- return oldValue;
}
-String StorageAreaImpl::removeItem(const String& key, Frame* frame)
+void StorageAreaImpl::removeItem(const String& key, Frame* frame)
{
ASSERT(!m_isShutdown);
blockUntilImportComplete();
if (disabledByPrivateBrowsingInFrame(frame))
- return String();
+ return;
String oldValue;
RefPtr<StorageMap> newMap = m_storageMap->removeItem(key, oldValue);
@@ -188,24 +179,23 @@ String StorageAreaImpl::removeItem(const String& key, Frame* frame)
m_storageMap = newMap.release();
if (oldValue.isNull())
- return oldValue;
+ return;
if (m_storageAreaSync)
m_storageAreaSync->scheduleItemForSync(key, String());
StorageEventDispatcher::dispatch(key, oldValue, String(), m_storageType, m_securityOrigin.get(), frame);
- return oldValue;
}
-bool StorageAreaImpl::clear(Frame* frame)
+void StorageAreaImpl::clear(Frame* frame)
{
ASSERT(!m_isShutdown);
blockUntilImportComplete();
if (disabledByPrivateBrowsingInFrame(frame))
- return false;
+ return;
if (!m_storageMap->length())
- return false;
+ return;
unsigned quota = m_storageMap->quota();
m_storageMap = StorageMap::create(quota);
@@ -213,7 +203,6 @@ bool StorageAreaImpl::clear(Frame* frame)
if (m_storageAreaSync)
m_storageAreaSync->scheduleClear();
StorageEventDispatcher::dispatch(String(), String(), String(), m_storageType, m_securityOrigin.get(), frame);
- return true;
}
bool StorageAreaImpl::contains(const String& key, Frame*) const
diff --git a/Source/WebCore/storage/StorageAreaImpl.h b/Source/WebCore/storage/StorageAreaImpl.h
index 79b27d60b..a56361f2e 100644
--- a/Source/WebCore/storage/StorageAreaImpl.h
+++ b/Source/WebCore/storage/StorageAreaImpl.h
@@ -46,9 +46,9 @@ namespace WebCore {
virtual unsigned length(Frame* sourceFrame) const;
virtual String key(unsigned index, Frame* sourceFrame) const;
virtual String getItem(const String& key, Frame* sourceFrame) const;
- virtual String setItem(const String& key, const String& value, ExceptionCode& ec, Frame* sourceFrame);
- virtual String removeItem(const String& key, Frame* sourceFrame);
- virtual bool clear(Frame* sourceFrame);
+ virtual void setItem(const String& key, const String& value, ExceptionCode&, Frame* sourceFrame);
+ virtual void removeItem(const String& key, Frame* sourceFrame);
+ virtual void clear(Frame* sourceFrame);
virtual bool contains(const String& key, Frame* sourceFrame) const;
virtual bool disabledByPrivateBrowsingInFrame(const Frame* sourceFrame) const;
diff --git a/Source/WebCore/svg/SVGAnimateElement.cpp b/Source/WebCore/svg/SVGAnimateElement.cpp
index 1a3250e4e..34dd9bcf1 100644
--- a/Source/WebCore/svg/SVGAnimateElement.cpp
+++ b/Source/WebCore/svg/SVGAnimateElement.cpp
@@ -196,7 +196,7 @@ static inline bool propertyTypesAreConsistent(AnimatedPropertyType expectedPrope
}
#endif
-void SVGAnimateElement::resetToBaseValue()
+void SVGAnimateElement::resetAnimatedType()
{
SVGAnimatedTypeAnimator* animator = ensureAnimator();
ASSERT(m_animatedPropertyType == animator->type());
@@ -212,8 +212,10 @@ void SVGAnimateElement::resetToBaseValue()
ASSERT(propertyTypesAreConsistent(m_animatedPropertyType, m_animatedProperties));
if (!m_animatedType)
m_animatedType = animator->startAnimValAnimation(m_animatedProperties);
- else
+ else {
animator->resetAnimValToBaseVal(m_animatedProperties, m_animatedType.get());
+ animator->animValDidChange(m_animatedProperties);
+ }
return;
}
@@ -232,21 +234,137 @@ void SVGAnimateElement::resetToBaseValue()
m_animatedType->setValueAsString(attributeName, baseValue);
}
+static inline void applyCSSPropertyToTarget(SVGElement* targetElement, CSSPropertyID id, const String& value)
+{
+ ASSERT(!targetElement->m_deletionHasBegun);
+
+ StylePropertySet* propertySet = targetElement->ensureAnimatedSMILStyleProperties();
+ if (!propertySet->setProperty(id, value, false, 0))
+ return;
+
+ targetElement->setNeedsStyleRecalc(SyntheticStyleChange);
+}
+
+static inline void removeCSSPropertyFromTarget(SVGElement* targetElement, CSSPropertyID id)
+{
+ ASSERT(!targetElement->m_deletionHasBegun);
+ targetElement->ensureAnimatedSMILStyleProperties()->removeProperty(id);
+ targetElement->setNeedsStyleRecalc(SyntheticStyleChange);
+}
+
+static inline void applyCSSPropertyToTargetAndInstances(SVGElement* targetElement, const QualifiedName& attributeName, const String& valueAsString)
+{
+ ASSERT(targetElement);
+ if (attributeName == anyQName() || !targetElement->inDocument() || !targetElement->parentNode())
+ return;
+
+ CSSPropertyID id = cssPropertyID(attributeName.localName());
+
+ SVGElementInstance::InstanceUpdateBlocker blocker(targetElement);
+ applyCSSPropertyToTarget(targetElement, id, valueAsString);
+
+ // If the target element has instances, update them as well, w/o requiring the <use> tree to be rebuilt.
+ const HashSet<SVGElementInstance*>& instances = targetElement->instancesForElement();
+ const HashSet<SVGElementInstance*>::const_iterator end = instances.end();
+ for (HashSet<SVGElementInstance*>::const_iterator it = instances.begin(); it != end; ++it) {
+ if (SVGElement* shadowTreeElement = (*it)->shadowTreeElement())
+ applyCSSPropertyToTarget(shadowTreeElement, id, valueAsString);
+ }
+}
+
+static inline void removeCSSPropertyFromTargetAndInstances(SVGElement* targetElement, const QualifiedName& attributeName)
+{
+ ASSERT(targetElement);
+ if (attributeName == anyQName() || !targetElement->inDocument() || !targetElement->parentNode())
+ return;
+
+ CSSPropertyID id = cssPropertyID(attributeName.localName());
+
+ SVGElementInstance::InstanceUpdateBlocker blocker(targetElement);
+ removeCSSPropertyFromTarget(targetElement, id);
+
+ // If the target element has instances, update them as well, w/o requiring the <use> tree to be rebuilt.
+ const HashSet<SVGElementInstance*>& instances = targetElement->instancesForElement();
+ const HashSet<SVGElementInstance*>::const_iterator end = instances.end();
+ for (HashSet<SVGElementInstance*>::const_iterator it = instances.begin(); it != end; ++it) {
+ if (SVGElement* shadowTreeElement = (*it)->shadowTreeElement())
+ removeCSSPropertyFromTarget(shadowTreeElement, id);
+ }
+}
+
+static inline void notifyTargetAboutAnimValChange(SVGElement* targetElement, const QualifiedName& attributeName)
+{
+ ASSERT(!targetElement->m_deletionHasBegun);
+ targetElement->svgAttributeChanged(attributeName);
+}
+
+static inline void notifyTargetAndInstancesAboutAnimValChange(SVGElement* targetElement, const QualifiedName& attributeName)
+{
+ ASSERT(targetElement);
+ if (attributeName == anyQName() || !targetElement->inDocument() || !targetElement->parentNode())
+ return;
+
+ SVGElementInstance::InstanceUpdateBlocker blocker(targetElement);
+ notifyTargetAboutAnimValChange(targetElement, attributeName);
+
+ // If the target element has instances, update them as well, w/o requiring the <use> tree to be rebuilt.
+ const HashSet<SVGElementInstance*>& instances = targetElement->instancesForElement();
+ const HashSet<SVGElementInstance*>::const_iterator end = instances.end();
+ for (HashSet<SVGElementInstance*>::const_iterator it = instances.begin(); it != end; ++it) {
+ if (SVGElement* shadowTreeElement = (*it)->shadowTreeElement())
+ notifyTargetAboutAnimValChange(shadowTreeElement, attributeName);
+ }
+}
+
+void SVGAnimateElement::clearAnimatedType(SVGElement* targetElement)
+{
+ if (!m_animatedType)
+ return;
+
+ if (!targetElement) {
+ m_animatedType.clear();
+ return;
+ }
+
+ if (m_animatedProperties.isEmpty()) {
+ // CSS properties animation code-path.
+ removeCSSPropertyFromTargetAndInstances(targetElement, attributeName());
+ m_animatedType.clear();
+ return;
+ }
+
+ // SVG DOM animVal animation code-path.
+ if (m_animator) {
+ m_animator->stopAnimValAnimation(m_animatedProperties);
+ notifyTargetAndInstancesAboutAnimValChange(targetElement, attributeName());
+ }
+
+ m_animatedProperties.clear();
+ m_animatedType.clear();
+}
+
void SVGAnimateElement::applyResultsToTarget()
{
ASSERT(m_animatedPropertyType != AnimatedTransformList || hasTagName(SVGNames::animateTransformTag));
ASSERT(m_animatedPropertyType != AnimatedUnknown);
- ASSERT(m_animatedType);
ASSERT(m_animator);
+ // Early exit if our animated type got destructed by a previous endedActiveInterval().
+ if (!m_animatedType)
+ return;
+
if (m_animatedProperties.isEmpty()) {
// CSS properties animation code-path.
- setTargetAttributeAnimatedCSSValue(m_animatedType.get());
+ // Convert the result of the animation to a String and apply it as CSS property on the target & all instances.
+ applyCSSPropertyToTargetAndInstances(targetElement(), attributeName(), m_animatedType->valueAsString());
return;
}
// SVG DOM animVal animation code-path.
+ // At this point the SVG DOM values are already changed, unlike for CSS.
+ // We only have to trigger update notifications here.
m_animator->animValDidChange(m_animatedProperties);
+ notifyTargetAndInstancesAboutAnimValChange(targetElement(), attributeName());
}
bool SVGAnimateElement::isAdditive() const
@@ -282,12 +400,7 @@ void SVGAnimateElement::targetElementWillChange(SVGElement* currentTarget, SVGEl
{
SVGSMILElement::targetElementWillChange(currentTarget, newTarget);
- if (!m_animatedProperties.isEmpty()) {
- ensureAnimator()->stopAnimValAnimation(m_animatedProperties);
- m_animatedProperties.clear();
- }
-
- m_animatedType.clear();
+ ASSERT(!m_animatedType);
m_fromType.clear();
m_toType.clear();
m_toAtEndOfDurationType.clear();
diff --git a/Source/WebCore/svg/SVGAnimateElement.h b/Source/WebCore/svg/SVGAnimateElement.h
index 2c141052b..1b8293742 100644
--- a/Source/WebCore/svg/SVGAnimateElement.h
+++ b/Source/WebCore/svg/SVGAnimateElement.h
@@ -43,7 +43,8 @@ public:
protected:
SVGAnimateElement(const QualifiedName&, Document*);
- virtual void resetToBaseValue();
+ virtual void resetAnimatedType();
+ virtual void clearAnimatedType(SVGElement* targetElement);
virtual bool calculateToAtEndOfDurationValue(const String& toAtEndOfDurationString);
virtual bool calculateFromAndToValues(const String& fromString, const String& toString);
virtual bool calculateFromAndByValues(const String& fromString, const String& byString);
diff --git a/Source/WebCore/svg/SVGAnimateMotionElement.cpp b/Source/WebCore/svg/SVGAnimateMotionElement.cpp
index b74d2e15e..34399ee26 100644
--- a/Source/WebCore/svg/SVGAnimateMotionElement.cpp
+++ b/Source/WebCore/svg/SVGAnimateMotionElement.cpp
@@ -164,14 +164,23 @@ static bool parsePoint(const String& s, FloatPoint& point)
return !skipOptionalSVGSpaces(cur, end);
}
-void SVGAnimateMotionElement::resetToBaseValue()
+void SVGAnimateMotionElement::resetAnimatedType()
{
if (!hasValidAttributeType())
return;
- AffineTransform* transform = targetElement()->supplementalTransform();
- if (!transform)
+ SVGElement* targetElement = this->targetElement();
+ if (!targetElement)
+ return;
+ if (AffineTransform* transform = targetElement->supplementalTransform())
+ transform->makeIdentity();
+}
+
+void SVGAnimateMotionElement::clearAnimatedType(SVGElement* targetElement)
+{
+ if (!targetElement)
return;
- transform->makeIdentity();
+ if (AffineTransform* transform = targetElement->supplementalTransform())
+ transform->makeIdentity();
}
bool SVGAnimateMotionElement::calculateToAtEndOfDurationValue(const String& toAtEndOfDurationString)
diff --git a/Source/WebCore/svg/SVGAnimateMotionElement.h b/Source/WebCore/svg/SVGAnimateMotionElement.h
index e57e8b71a..9def47303 100644
--- a/Source/WebCore/svg/SVGAnimateMotionElement.h
+++ b/Source/WebCore/svg/SVGAnimateMotionElement.h
@@ -39,7 +39,8 @@ private:
bool isSupportedAttribute(const QualifiedName&);
virtual void parseAttribute(Attribute*) OVERRIDE;
- virtual void resetToBaseValue();
+ virtual void resetAnimatedType();
+ virtual void clearAnimatedType(SVGElement* targetElement);
virtual bool calculateToAtEndOfDurationValue(const String& toAtEndOfDurationString);
virtual bool calculateFromAndToValues(const String& fromString, const String& toString);
virtual bool calculateFromAndByValues(const String& fromString, const String& byString);
diff --git a/Source/WebCore/svg/SVGAnimatedLengthList.cpp b/Source/WebCore/svg/SVGAnimatedLengthList.cpp
index 965191a89..812b90af8 100644
--- a/Source/WebCore/svg/SVGAnimatedLengthList.cpp
+++ b/Source/WebCore/svg/SVGAnimatedLengthList.cpp
@@ -111,6 +111,7 @@ void SVGAnimatedLengthListAnimator::calculateAnimatedValue(float percentage, uns
unsigned fromLengthListSize = fromLengthList.size();
unsigned toLengthListSize = toLengthList.size();
+ unsigned toAtEndOfDurationListSize = toAtEndOfDurationLengthList.size();
SVGLengthContext lengthContext(m_contextElement);
ExceptionCode ec = 0;
@@ -123,8 +124,9 @@ void SVGAnimatedLengthListAnimator::calculateAnimatedValue(float percentage, uns
unitType = fromLengthList[i].unitType();
effectiveFrom = fromLengthList[i].value(lengthContext);
}
+ float effectiveToAtEnd = i < toAtEndOfDurationListSize ? toAtEndOfDurationLengthList[i].value(lengthContext) : 0;
- m_animationElement->animateAdditiveNumber(percentage, repeatCount, effectiveFrom, toLengthList[i].value(lengthContext), toAtEndOfDurationLengthList[i].value(lengthContext), animatedNumber);
+ m_animationElement->animateAdditiveNumber(percentage, repeatCount, effectiveFrom, toLengthList[i].value(lengthContext), effectiveToAtEnd, animatedNumber);
animatedLengthList[i].setValue(lengthContext, animatedNumber, m_lengthMode, unitType, ec);
ASSERT(!ec);
}
diff --git a/Source/WebCore/svg/SVGAnimatedNumberList.cpp b/Source/WebCore/svg/SVGAnimatedNumberList.cpp
index a2d60181a..8b2ca4c85 100644
--- a/Source/WebCore/svg/SVGAnimatedNumberList.cpp
+++ b/Source/WebCore/svg/SVGAnimatedNumberList.cpp
@@ -93,10 +93,12 @@ void SVGAnimatedNumberListAnimator::calculateAnimatedValue(float percentage, uns
unsigned fromNumberListSize = fromNumberList.size();
unsigned toNumberListSize = toNumberList.size();
+ unsigned toAtEndOfDurationSize = toAtEndOfDurationNumberList.size();
for (unsigned i = 0; i < toNumberListSize; ++i) {
float effectiveFrom = fromNumberListSize ? fromNumberList[i] : 0;
- m_animationElement->animateAdditiveNumber(percentage, repeatCount, effectiveFrom, toNumberList[i], toAtEndOfDurationNumberList[i], animatedNumberList[i]);
+ float effectiveToAtEnd = i < toAtEndOfDurationSize ? toAtEndOfDurationNumberList[i] : 0;
+ m_animationElement->animateAdditiveNumber(percentage, repeatCount, effectiveFrom, toNumberList[i], effectiveToAtEnd, animatedNumberList[i]);
}
}
diff --git a/Source/WebCore/svg/SVGAnimatedPointList.cpp b/Source/WebCore/svg/SVGAnimatedPointList.cpp
index 15d9c01fe..3d7afc208 100644
--- a/Source/WebCore/svg/SVGAnimatedPointList.cpp
+++ b/Source/WebCore/svg/SVGAnimatedPointList.cpp
@@ -94,16 +94,18 @@ void SVGAnimatedPointListAnimator::calculateAnimatedValue(float percentage, unsi
unsigned fromPointListSize = fromPointList.size();
unsigned toPointListSize = toPointList.size();
+ unsigned toAtEndOfDurationSize = toAtEndOfDurationPointList.size();
for (unsigned i = 0; i < toPointListSize; ++i) {
FloatPoint effectiveFrom;
if (fromPointListSize)
effectiveFrom = fromPointList[i];
+ FloatPoint effectiveToAtEnd = i < toAtEndOfDurationSize ? toAtEndOfDurationPointList[i] : FloatPoint();
float animatedX = animatedPointList[i].x();
float animatedY = animatedPointList[i].y();
- m_animationElement->animateAdditiveNumber(percentage, repeatCount, effectiveFrom.x(), toPointList[i].x(), toAtEndOfDurationPointList[i].x(), animatedX);
- m_animationElement->animateAdditiveNumber(percentage, repeatCount, effectiveFrom.y(), toPointList[i].y(), toAtEndOfDurationPointList[i].y(), animatedY);
+ m_animationElement->animateAdditiveNumber(percentage, repeatCount, effectiveFrom.x(), toPointList[i].x(), effectiveToAtEnd.x(), animatedX);
+ m_animationElement->animateAdditiveNumber(percentage, repeatCount, effectiveFrom.y(), toPointList[i].y(), effectiveToAtEnd.y(), animatedY);
animatedPointList[i] = FloatPoint(animatedX, animatedY);
}
}
diff --git a/Source/WebCore/svg/SVGAnimationElement.cpp b/Source/WebCore/svg/SVGAnimationElement.cpp
index 07e4a9449..31849c792 100644
--- a/Source/WebCore/svg/SVGAnimationElement.cpp
+++ b/Source/WebCore/svg/SVGAnimationElement.cpp
@@ -31,24 +31,14 @@
#include "CSSComputedStyleDeclaration.h"
#include "CSSParser.h"
#include "CSSPropertyNames.h"
-#include "Color.h"
#include "Document.h"
-#include "Event.h"
-#include "EventListener.h"
#include "FloatConversion.h"
-#include "HTMLNames.h"
-#include "PlatformString.h"
+#include "RenderObject.h"
#include "SVGAnimateElement.h"
#include "SVGElementInstance.h"
#include "SVGNames.h"
#include "SVGParserUtilities.h"
#include "SVGStyledElement.h"
-#include "SVGURIReference.h"
-#include "SVGUseElement.h"
-#include "XLinkNames.h"
-#include <wtf/StdLibExtras.h>
-
-using namespace std;
namespace WebCore {
@@ -341,36 +331,6 @@ bool SVGAnimationElement::isTargetAttributeCSSProperty(SVGElement* targetElement
return SVGStyledElement::isAnimatableCSSProperty(attributeName);
}
-static inline void applyCSSPropertyToTarget(SVGElement* targetElement, CSSPropertyID id, const String& value)
-{
- StylePropertySet* propertySet = targetElement->ensureAnimatedSMILStyleProperties();
- if (propertySet->setProperty(id, value, false, 0))
- targetElement->setNeedsStyleRecalc(SyntheticStyleChange);
-}
-
-void SVGAnimationElement::setTargetAttributeAnimatedCSSValue(SVGAnimatedType* animatedType)
-{
- ASSERT(animatedType);
- SVGElement* targetElement = this->targetElement();
- ASSERT(targetElement);
-
- const QualifiedName& attributeName = this->attributeName();
- ASSERT(attributeName != anyQName());
- CSSPropertyID id = cssPropertyID(attributeName.localName());
-
- const String& valueAsString = animatedType->valueAsString();
- SVGElementInstance::InstanceUpdateBlocker blocker(targetElement);
- applyCSSPropertyToTarget(targetElement, id, valueAsString);
-
- // If the target element has instances, update them as well, w/o requiring the <use> tree to be rebuilt.
- const HashSet<SVGElementInstance*>& instances = targetElement->instancesForElement();
- const HashSet<SVGElementInstance*>::const_iterator end = instances.end();
- for (HashSet<SVGElementInstance*>::const_iterator it = instances.begin(); it != end; ++it) {
- if (SVGElement* shadowTreeElement = (*it)->shadowTreeElement())
- applyCSSPropertyToTarget(shadowTreeElement, id, valueAsString);
- }
-}
-
SVGAnimationElement::ShouldApplyAnimation SVGAnimationElement::shouldApplyAnimation(SVGElement* targetElement, const QualifiedName& attributeName)
{
if (!hasValidAttributeType() || !targetElement || attributeName == anyQName())
diff --git a/Source/WebCore/svg/SVGAnimationElement.h b/Source/WebCore/svg/SVGAnimationElement.h
index 5c6429da5..8a662b33f 100644
--- a/Source/WebCore/svg/SVGAnimationElement.h
+++ b/Source/WebCore/svg/SVGAnimationElement.h
@@ -190,11 +190,10 @@ protected:
String fromValue() const;
String targetAttributeBaseValue();
- void setTargetAttributeAnimatedCSSValue(SVGAnimatedType*);
// from SVGSMILElement
- virtual void startedActiveInterval();
- virtual void updateAnimation(float percent, unsigned repeat, SVGSMILElement* resultElement);
+ virtual void startedActiveInterval() OVERRIDE;
+ virtual void updateAnimation(float percent, unsigned repeat, SVGSMILElement* resultElement) OVERRIDE;
AnimatedPropertyValueType m_fromPropertyValueType;
AnimatedPropertyValueType m_toPropertyValueType;
diff --git a/Source/WebCore/svg/SVGElement.cpp b/Source/WebCore/svg/SVGElement.cpp
index 628ea5a02..de38209de 100644
--- a/Source/WebCore/svg/SVGElement.cpp
+++ b/Source/WebCore/svg/SVGElement.cpp
@@ -26,19 +26,13 @@
#if ENABLE(SVG)
#include "SVGElement.h"
-#include "Attribute.h"
#include "CSSCursorImageValue.h"
#include "DOMImplementation.h"
#include "Document.h"
#include "Event.h"
-#include "EventListener.h"
-#include "EventNames.h"
-#include "FrameView.h"
#include "HTMLNames.h"
#include "NodeRenderingContext.h"
-#include "RegisteredEventListener.h"
#include "RenderObject.h"
-#include "ShadowRoot.h"
#include "SVGCursorElement.h"
#include "SVGDocumentExtensions.h"
#include "SVGElementInstance.h"
@@ -47,10 +41,7 @@
#include "SVGSVGElement.h"
#include "SVGStyledLocatableElement.h"
#include "SVGTextElement.h"
-#include "SVGURIReference.h"
-#include "SVGUseElement.h"
#include "ScriptEventListener.h"
-#include "StyleResolver.h"
#include "XMLNames.h"
namespace WebCore {
@@ -423,9 +414,6 @@ bool SVGElement::childShouldCreateRenderer(const NodeRenderingContext& childCont
void SVGElement::attributeChanged(Attribute* attr)
{
ASSERT(attr);
- if (!attr)
- return;
-
StyledElement::attributeChanged(attr);
// When an animated SVG property changes through SVG DOM, svgAttributeChanged() is called, not attributeChanged().
@@ -542,7 +530,7 @@ bool SVGElement::isAnimatableAttribute(const QualifiedName& name)
DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, animatableAttributes, ());
if (animatableAttributes.isEmpty()) {
- animatableAttributes.add(HTMLNames::classAttr);
+ animatableAttributes.add(classAttr);
animatableAttributes.add(XLinkNames::hrefAttr);
animatableAttributes.add(SVGNames::amplitudeAttr);
animatableAttributes.add(SVGNames::azimuthAttr);
diff --git a/Source/WebCore/svg/SVGFilterElement.cpp b/Source/WebCore/svg/SVGFilterElement.cpp
index 9f871c93b..2f3e80a17 100644
--- a/Source/WebCore/svg/SVGFilterElement.cpp
+++ b/Source/WebCore/svg/SVGFilterElement.cpp
@@ -27,6 +27,7 @@
#include "SVGFilterElement.h"
#include "Attr.h"
+#include "NodeRenderingContext.h"
#include "RenderSVGResourceFilter.h"
#include "SVGElementInstance.h"
#include "SVGFilterBuilder.h"
@@ -193,6 +194,45 @@ RenderObject* SVGFilterElement::createRenderer(RenderArena* arena, RenderStyle*)
return new (arena) RenderSVGResourceFilter(this);
}
+bool SVGFilterElement::childShouldCreateRenderer(const NodeRenderingContext& childContext) const
+{
+ if (!childContext.node()->isSVGElement())
+ return false;
+
+ Element* element = static_cast<Element*>(childContext.node());
+
+ DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, allowedChildElementTags, ());
+ if (allowedChildElementTags.isEmpty()) {
+ allowedChildElementTags.add(SVGNames::feBlendTag);
+ allowedChildElementTags.add(SVGNames::feColorMatrixTag);
+ allowedChildElementTags.add(SVGNames::feComponentTransferTag);
+ allowedChildElementTags.add(SVGNames::feCompositeTag);
+ allowedChildElementTags.add(SVGNames::feConvolveMatrixTag);
+ allowedChildElementTags.add(SVGNames::feDiffuseLightingTag);
+ allowedChildElementTags.add(SVGNames::feDisplacementMapTag);
+ allowedChildElementTags.add(SVGNames::feDistantLightTag);
+ allowedChildElementTags.add(SVGNames::feDropShadowTag);
+ allowedChildElementTags.add(SVGNames::feFloodTag);
+ allowedChildElementTags.add(SVGNames::feFuncATag);
+ allowedChildElementTags.add(SVGNames::feFuncBTag);
+ allowedChildElementTags.add(SVGNames::feFuncGTag);
+ allowedChildElementTags.add(SVGNames::feFuncRTag);
+ allowedChildElementTags.add(SVGNames::feGaussianBlurTag);
+ allowedChildElementTags.add(SVGNames::feImageTag);
+ allowedChildElementTags.add(SVGNames::feMergeTag);
+ allowedChildElementTags.add(SVGNames::feMergeNodeTag);
+ allowedChildElementTags.add(SVGNames::feMorphologyTag);
+ allowedChildElementTags.add(SVGNames::feOffsetTag);
+ allowedChildElementTags.add(SVGNames::fePointLightTag);
+ allowedChildElementTags.add(SVGNames::feSpecularLightingTag);
+ allowedChildElementTags.add(SVGNames::feSpotLightTag);
+ allowedChildElementTags.add(SVGNames::feTileTag);
+ allowedChildElementTags.add(SVGNames::feTurbulenceTag);
+ }
+
+ return allowedChildElementTags.contains<QualifiedName, SVGAttributeHashTranslator>(element->tagQName());
+}
+
bool SVGFilterElement::selfHasRelativeLengths() const
{
return x().isRelative()
diff --git a/Source/WebCore/svg/SVGFilterElement.h b/Source/WebCore/svg/SVGFilterElement.h
index e865a519c..603c69aaa 100644
--- a/Source/WebCore/svg/SVGFilterElement.h
+++ b/Source/WebCore/svg/SVGFilterElement.h
@@ -55,7 +55,8 @@ private:
virtual void svgAttributeChanged(const QualifiedName&);
virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0);
- virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
+ virtual RenderObject* createRenderer(RenderArena*, RenderStyle*) OVERRIDE;
+ virtual bool childShouldCreateRenderer(const NodeRenderingContext&) const OVERRIDE;
virtual bool selfHasRelativeLengths() const;
diff --git a/Source/WebCore/svg/SVGFilterPrimitiveStandardAttributes.h b/Source/WebCore/svg/SVGFilterPrimitiveStandardAttributes.h
index 58dc09237..f73441d0a 100644
--- a/Source/WebCore/svg/SVGFilterPrimitiveStandardAttributes.h
+++ b/Source/WebCore/svg/SVGFilterPrimitiveStandardAttributes.h
@@ -68,8 +68,9 @@ protected:
private:
virtual bool isFilterEffect() const { return true; }
- virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
- virtual bool rendererIsNeeded(const NodeRenderingContext&);
+ virtual RenderObject* createRenderer(RenderArena*, RenderStyle*) OVERRIDE;
+ virtual bool rendererIsNeeded(const NodeRenderingContext&) OVERRIDE;
+ virtual bool childShouldCreateRenderer(const NodeRenderingContext&) const OVERRIDE { return false; }
BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGFilterPrimitiveStandardAttributes)
DECLARE_ANIMATED_LENGTH(X, x)
diff --git a/Source/WebCore/svg/SVGScriptElement.cpp b/Source/WebCore/svg/SVGScriptElement.cpp
index d43a137f5..a469ff1cb 100644
--- a/Source/WebCore/svg/SVGScriptElement.cpp
+++ b/Source/WebCore/svg/SVGScriptElement.cpp
@@ -132,9 +132,9 @@ void SVGScriptElement::childrenChanged(bool changedByParser, Node* beforeChange,
ScriptElement::childrenChanged();
}
-bool SVGScriptElement::isURLAttribute(Attribute* attr) const
+bool SVGScriptElement::isURLAttribute(const Attribute& attribute) const
{
- return attr->name() == sourceAttributeValue();
+ return attribute.name() == sourceAttributeValue();
}
void SVGScriptElement::finishParsingChildren()
diff --git a/Source/WebCore/svg/SVGScriptElement.h b/Source/WebCore/svg/SVGScriptElement.h
index eb1669847..57b748475 100644
--- a/Source/WebCore/svg/SVGScriptElement.h
+++ b/Source/WebCore/svg/SVGScriptElement.h
@@ -50,7 +50,7 @@ private:
virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0);
virtual void svgAttributeChanged(const QualifiedName&);
- virtual bool isURLAttribute(Attribute*) const;
+ virtual bool isURLAttribute(const Attribute&) const OVERRIDE;
virtual void finishParsingChildren();
virtual void addSubresourceAttributeURLs(ListHashSet<KURL>&) const;
diff --git a/Source/WebCore/svg/SVGTRefElement.cpp b/Source/WebCore/svg/SVGTRefElement.cpp
index d774e5de5..455e8278d 100644
--- a/Source/WebCore/svg/SVGTRefElement.cpp
+++ b/Source/WebCore/svg/SVGTRefElement.cpp
@@ -164,7 +164,7 @@ void SVGTRefElement::updateReferencedText()
if (Element* target = SVGURIReference::targetElementFromIRIString(href(), document()))
textContent = target->textContent();
- ASSERT(hasShadowRoot());
+ ASSERT(shadow());
ShadowRoot* root = shadow()->oldestShadowRoot();
if (!root->firstChild())
root->appendChild(SVGShadowText::create(document(), textContent), ASSERT_NO_EXCEPTION);
@@ -180,7 +180,7 @@ void SVGTRefElement::detachTarget()
String emptyContent;
ExceptionCode ignore = 0;
- ASSERT(hasShadowRoot());
+ ASSERT(shadow());
Node* container = shadow()->oldestShadowRoot()->firstChild();
if (container)
container->setTextContent(emptyContent, ignore);
diff --git a/Source/WebCore/svg/animation/SMILTimeContainer.cpp b/Source/WebCore/svg/animation/SMILTimeContainer.cpp
index 90578289a..f421c8c47 100644
--- a/Source/WebCore/svg/animation/SMILTimeContainer.cpp
+++ b/Source/WebCore/svg/animation/SMILTimeContainer.cpp
@@ -224,6 +224,7 @@ void SMILTimeContainer::updateAnimations(SMILTime elapsed, bool seekToTime)
typedef pair<SVGElement*, QualifiedName> ElementAttributePair;
typedef HashMap<ElementAttributePair, RefPtr<SVGSMILElement> > ResultElementMap;
ResultElementMap resultsElements;
+ HashSet<SVGSMILElement*> contributingElements;
for (unsigned n = 0; n < toAnimate.size(); ++n) {
SVGSMILElement* animation = toAnimate[n];
ASSERT(animation->timeContainer() == this);
@@ -247,12 +248,12 @@ void SMILTimeContainer::updateAnimations(SMILTime elapsed, bool seekToTime)
if (!animation->hasValidAttributeType())
continue;
resultElement = animation;
- resultElement->resetToBaseValue();
resultsElements.add(key, resultElement);
}
// This will calculate the contribution from the animation and add it to the resultsElement.
- animation->progress(elapsed, resultElement, seekToTime);
+ if (animation->progress(elapsed, resultElement, seekToTime))
+ contributingElements.add(resultElement);
SMILTime nextFireTime = animation->nextProgressTime();
if (nextFireTime.isFinite())
@@ -261,19 +262,27 @@ void SMILTimeContainer::updateAnimations(SMILTime elapsed, bool seekToTime)
Vector<SVGSMILElement*> animationsToApply;
ResultElementMap::iterator end = resultsElements.end();
- for (ResultElementMap::iterator it = resultsElements.begin(); it != end; ++it)
- animationsToApply.append(it->second.get());
+ for (ResultElementMap::iterator it = resultsElements.begin(); it != end; ++it) {
+ SVGSMILElement* animation = it->second.get();
+ if (contributingElements.contains(animation))
+ animationsToApply.append(animation);
+ }
+
+ unsigned animationsToApplySize = animationsToApply.size();
+ if (!animationsToApplySize) {
+ startTimer(earliersFireTime, animationFrameDelay);
+ return;
+ }
// Sort <animateTranform> to be the last one to be applied. <animate> may change transform attribute as
// well (directly or indirectly by modifying <use> x/y) and this way transforms combine properly.
sortByApplyOrder(animationsToApply);
-
+
// Apply results to target elements.
- for (unsigned n = 0; n < animationsToApply.size(); ++n)
- animationsToApply[n]->applyResultsToTarget();
+ for (unsigned i = 0; i < animationsToApplySize; ++i)
+ animationsToApply[i]->applyResultsToTarget();
startTimer(earliersFireTime, animationFrameDelay);
-
Document::updateStyleForAllDocuments();
}
diff --git a/Source/WebCore/svg/animation/SVGSMILElement.cpp b/Source/WebCore/svg/animation/SVGSMILElement.cpp
index ff80f0716..e75d0fa41 100644
--- a/Source/WebCore/svg/animation/SVGSMILElement.cpp
+++ b/Source/WebCore/svg/animation/SVGSMILElement.cpp
@@ -178,6 +178,10 @@ static inline void clearTimesWithDynamicOrigins(Vector<SMILTimeWithOrigin>& time
void SVGSMILElement::reset()
{
+ // Don't clear the animated type if we're frozen, only take action here if we're active.
+ if (m_activeState == Active)
+ clearAnimatedType(m_targetElement);
+
m_activeState = Inactive;
m_isWaitingForFirstInterval = true;
m_intervalBegin = SMILTime::unresolved();
@@ -560,10 +564,14 @@ SVGElement* SVGSMILElement::targetElement()
return m_targetElement;
}
-void SVGSMILElement::targetElementWillChange(SVGElement*, SVGElement*)
+void SVGSMILElement::targetElementWillChange(SVGElement* currentTarget, SVGElement*)
{
- // If the animation state is Active, always reset to a clear state before leaving the old target element.
- if (m_activeState == Active)
+ // Only clear the animated type, if we had a target before.
+ if (currentTarget)
+ clearAnimatedType(currentTarget);
+
+ // If the animation state is not Inactive, always reset to a clear state before leaving the old target element.
+ if (m_activeState != Inactive)
endedActiveInterval();
}
@@ -990,10 +998,7 @@ SVGSMILElement::ActiveState SVGSMILElement::determineActiveState(SMILTime elapse
if (elapsed >= m_intervalBegin && elapsed < m_intervalEnd)
return Active;
- if (m_activeState == Active)
- return fill() == FillFreeze ? Frozen : Inactive;
-
- return m_activeState;
+ return fill() == FillFreeze ? Frozen : Inactive;
}
bool SVGSMILElement::isContributing(SMILTime elapsed) const
@@ -1002,8 +1007,9 @@ bool SVGSMILElement::isContributing(SMILTime elapsed) const
return (m_activeState == Active && (fill() == FillFreeze || elapsed <= m_intervalBegin + repeatingDuration())) || m_activeState == Frozen;
}
-void SVGSMILElement::progress(SMILTime elapsed, SVGSMILElement* resultElement, bool seekToTime)
+bool SVGSMILElement::progress(SMILTime elapsed, SVGSMILElement* resultElement, bool seekToTime)
{
+ ASSERT(resultElement);
ASSERT(m_timeContainer);
ASSERT(m_isWaitingForFirstInterval || m_intervalBegin.isFinite());
@@ -1013,23 +1019,22 @@ void SVGSMILElement::progress(SMILTime elapsed, SVGSMILElement* resultElement, b
if (!m_intervalBegin.isFinite()) {
ASSERT(m_activeState == Inactive);
m_nextProgressTime = SMILTime::unresolved();
- return;
+ return false;
}
-
+
if (elapsed < m_intervalBegin) {
ASSERT(m_activeState != Active);
- if (m_activeState == Frozen && resultElement)
+ if (m_activeState == Frozen)
updateAnimation(m_lastPercent, m_lastRepeat, resultElement);
m_nextProgressTime = m_intervalBegin;
- return;
+ return false;
}
m_previousIntervalBegin = m_intervalBegin;
-
- if (m_activeState == Inactive) {
+
+ if (m_isWaitingForFirstInterval) {
m_isWaitingForFirstInterval = false;
- m_activeState = Active;
- startedActiveInterval();
+ resolveFirstInterval();
}
// This call may obtain a new interval -- never call calculateAnimationPercentAndRepeat() before!
@@ -1044,17 +1049,29 @@ void SVGSMILElement::progress(SMILTime elapsed, SVGSMILElement* resultElement, b
ActiveState oldActiveState = m_activeState;
m_activeState = determineActiveState(elapsed);
- if (isContributing(elapsed)) {
- if (resultElement)
- updateAnimation(percent, repeat, resultElement);
+ bool animationIsContributing = isContributing(elapsed);
+
+ // Only reset the animated type to the base value once for the lowest priority animation that animates a particular element/attribute pair.
+ if (this == resultElement)
+ resetAnimatedType();
+
+ if (animationIsContributing) {
+ if (oldActiveState == Inactive)
+ startedActiveInterval();
+
+ updateAnimation(percent, repeat, resultElement);
m_lastPercent = percent;
m_lastRepeat = repeat;
}
- if (oldActiveState == Active && m_activeState != Active)
+ if (oldActiveState == Active && m_activeState != Active) {
endedActiveInterval();
+ if (m_activeState != Frozen)
+ clearAnimatedType(m_targetElement);
+ }
m_nextProgressTime = calculateNextProgressTime(elapsed);
+ return animationIsContributing;
}
void SVGSMILElement::notifyDependentsIntervalChanged(NewOrExistingInterval newOrExisting)
diff --git a/Source/WebCore/svg/animation/SVGSMILElement.h b/Source/WebCore/svg/animation/SVGSMILElement.h
index fb3b213a7..0f7c6ae95 100644
--- a/Source/WebCore/svg/animation/SVGSMILElement.h
+++ b/Source/WebCore/svg/animation/SVGSMILElement.h
@@ -90,7 +90,7 @@ public:
SMILTime simpleDuration() const;
void seekToIntervalCorrespondingToTime(SMILTime elapsed);
- void progress(SMILTime elapsed, SVGSMILElement* resultsElement, bool seekToTime);
+ bool progress(SMILTime elapsed, SVGSMILElement* resultsElement, bool seekToTime);
SMILTime nextProgressTime() const;
void reset();
@@ -106,7 +106,8 @@ public:
void setDocumentOrderIndex(unsigned index) { m_documentOrderIndex = index; }
virtual bool isAdditive() const = 0;
- virtual void resetToBaseValue() = 0;
+ virtual void resetAnimatedType() = 0;
+ virtual void clearAnimatedType(SVGElement* targetElement) = 0;
virtual void applyResultsToTarget() = 0;
protected:
@@ -117,10 +118,10 @@ protected:
// Sub-classes may need to take action when the target is changed.
virtual void targetElementWillChange(SVGElement* currentTarget, SVGElement* newTarget);
- virtual void endedActiveInterval();
private:
virtual void startedActiveInterval() = 0;
+ void endedActiveInterval();
virtual void updateAnimation(float percent, unsigned repeat, SVGSMILElement* resultElement) = 0;
enum BeginOrEnd {
diff --git a/Source/WebCore/svg/properties/SVGAnimatedListPropertyTearOff.h b/Source/WebCore/svg/properties/SVGAnimatedListPropertyTearOff.h
index f17d8593a..8b6dc6992 100644
--- a/Source/WebCore/svg/properties/SVGAnimatedListPropertyTearOff.h
+++ b/Source/WebCore/svg/properties/SVGAnimatedListPropertyTearOff.h
@@ -116,9 +116,6 @@ public:
m_animatedWrappers.clear();
m_isAnimating = false;
-
- ASSERT(contextElement());
- contextElement()->svgAttributeChanged(attributeName());
}
void synchronizeWrappersIfNeeded()
@@ -149,9 +146,6 @@ public:
ASSERT(m_animVal);
ASSERT(m_values.size() == m_wrappers.size());
synchronizeWrappersIfNeeded();
-
- ASSERT(contextElement());
- contextElement()->svgAttributeChanged(attributeName());
}
static PassRefPtr<SVGAnimatedListPropertyTearOff<PropertyType> > create(SVGElement* contextElement, const QualifiedName& attributeName, AnimatedPropertyType animatedPropertyType, PropertyType& values)
diff --git a/Source/WebCore/svg/properties/SVGAnimatedProperty.h b/Source/WebCore/svg/properties/SVGAnimatedProperty.h
index f701a8230..c64bac531 100644
--- a/Source/WebCore/svg/properties/SVGAnimatedProperty.h
+++ b/Source/WebCore/svg/properties/SVGAnimatedProperty.h
@@ -40,6 +40,7 @@ public:
void commitChange()
{
ASSERT(m_contextElement);
+ ASSERT(!m_contextElement->m_deletionHasBegun);
m_contextElement->invalidateSVGAttributes();
m_contextElement->svgAttributeChanged(m_attributeName);
}
diff --git a/Source/WebCore/svg/properties/SVGAnimatedPropertyTearOff.h b/Source/WebCore/svg/properties/SVGAnimatedPropertyTearOff.h
index 71457457a..913f401b0 100644
--- a/Source/WebCore/svg/properties/SVGAnimatedPropertyTearOff.h
+++ b/Source/WebCore/svg/properties/SVGAnimatedPropertyTearOff.h
@@ -78,12 +78,6 @@ public:
ASSERT(m_animVal);
m_animVal->setValue(m_property);
m_isAnimating = false;
-
- SVGElement* element = contextElement();
- if (!element || !element->inDocument() || !element->parentNode())
- return;
- ASSERT(!element->m_deletionHasBegun);
- element->svgAttributeChanged(attributeName());
}
void animValWillChange()
@@ -95,11 +89,9 @@ public:
void animValDidChange()
{
+ // no-op for non list types.
ASSERT(m_isAnimating);
ASSERT(m_animVal);
-
- ASSERT(contextElement());
- contextElement()->svgAttributeChanged(attributeName());
}
private:
diff --git a/Source/WebCore/svg/properties/SVGAnimatedStaticPropertyTearOff.h b/Source/WebCore/svg/properties/SVGAnimatedStaticPropertyTearOff.h
index 59fcd8500..e3efcd06a 100644
--- a/Source/WebCore/svg/properties/SVGAnimatedStaticPropertyTearOff.h
+++ b/Source/WebCore/svg/properties/SVGAnimatedStaticPropertyTearOff.h
@@ -81,12 +81,6 @@ public:
ASSERT(m_animatedProperty);
m_animatedProperty = 0;
m_isAnimating = false;
-
- SVGElement* element = contextElement();
- if (!element || !element->inDocument() || !element->parentNode())
- return;
- ASSERT(!element->m_deletionHasBegun);
- element->svgAttributeChanged(attributeName());
}
void animValWillChange()
@@ -98,11 +92,9 @@ public:
void animValDidChange()
{
+ // no-op for non list types.
ASSERT(m_isAnimating);
ASSERT(m_animatedProperty);
-
- ASSERT(contextElement());
- contextElement()->svgAttributeChanged(attributeName());
}
protected:
diff --git a/Source/WebCore/testing/Internals.cpp b/Source/WebCore/testing/Internals.cpp
index 67839f6ca..bf7deb9f0 100644
--- a/Source/WebCore/testing/Internals.cpp
+++ b/Source/WebCore/testing/Internals.cpp
@@ -302,8 +302,8 @@ Internals::ShadowRootIfShadowDOMEnabledOrNode* Internals::ensureShadowRoot(Eleme
return 0;
}
- if (host->hasShadowRoot())
- return host->shadow()->youngestShadowRoot();
+ if (ElementShadow* shadow = host->shadow())
+ return shadow->youngestShadowRoot();
return ShadowRoot::create(host, ec).get();
}
@@ -322,10 +322,9 @@ Internals::ShadowRootIfShadowDOMEnabledOrNode* Internals::youngestShadowRoot(Ele
return 0;
}
- if (!host->hasShadowRoot())
- return 0;
-
- return host->shadow()->youngestShadowRoot();
+ if (ElementShadow* shadow = host->shadow())
+ return shadow->youngestShadowRoot();
+ return 0;
}
Internals::ShadowRootIfShadowDOMEnabledOrNode* Internals::oldestShadowRoot(Element* host, ExceptionCode& ec)
@@ -335,10 +334,9 @@ Internals::ShadowRootIfShadowDOMEnabledOrNode* Internals::oldestShadowRoot(Eleme
return 0;
}
- if (!host->hasShadowRoot())
- return 0;
-
- return host->shadow()->oldestShadowRoot();
+ if (ElementShadow* shadow = host->shadow())
+ return shadow->oldestShadowRoot();
+ return 0;
}
Internals::ShadowRootIfShadowDOMEnabledOrNode* Internals::youngerShadowRoot(Node* shadow, ExceptionCode& ec)
@@ -361,17 +359,6 @@ Internals::ShadowRootIfShadowDOMEnabledOrNode* Internals::olderShadowRoot(Node*
return toShadowRoot(shadow)->olderShadowRoot();
}
-void Internals::removeShadowRoot(Element* host, ExceptionCode& ec)
-{
- if (!host) {
- ec = INVALID_ACCESS_ERR;
- return;
- }
-
- if (host->hasShadowRoot())
- host->shadow()->removeAllShadowRoots();
-}
-
Element* Internals::includerFor(Node* node, ExceptionCode& ec)
{
if (!node) {
@@ -774,8 +761,6 @@ PassRefPtr<ClientRect> Internals::bestZoomableAreaForTouchPoint(long x, long y,
Node* targetNode;
IntRect zoomableArea;
document->frame()->eventHandler()->bestZoomableAreaForTouchPoint(point, radius, zoomableArea, targetNode);
- if (targetNode)
- zoomableArea = targetNode->document()->view()->contentsToWindow(zoomableArea);
return ClientRect::create(zoomableArea);
}
@@ -1008,6 +993,35 @@ bool Internals::isPageBoxVisible(Document* document, int pageNumber, ExceptionCo
return document->isPageBoxVisible(pageNumber);
}
+void Internals::suspendAnimations(Document* document, ExceptionCode& ec) const
+{
+ if (!document || !document->frame()) {
+ ec = INVALID_ACCESS_ERR;
+ return;
+ }
+
+ AnimationController* controller = document->frame()->animation();
+ if (!controller)
+ return;
+
+ controller->suspendAnimations();
+}
+
+void Internals::resumeAnimations(Document* document, ExceptionCode& ec) const
+{
+ if (!document || !document->frame()) {
+ ec = INVALID_ACCESS_ERR;
+ return;
+ }
+
+ AnimationController* controller = document->frame()->animation();
+ if (!controller)
+ return;
+
+ controller->resumeAnimations();
+}
+
+
#if ENABLE(FULLSCREEN_API)
void Internals::webkitWillEnterFullScreenForElement(Document* document, Element* element)
{
diff --git a/Source/WebCore/testing/Internals.h b/Source/WebCore/testing/Internals.h
index 391d375fa..fd8747daa 100644
--- a/Source/WebCore/testing/Internals.h
+++ b/Source/WebCore/testing/Internals.h
@@ -75,7 +75,6 @@ public:
ShadowRootIfShadowDOMEnabledOrNode* oldestShadowRoot(Element* host, ExceptionCode&);
ShadowRootIfShadowDOMEnabledOrNode* youngerShadowRoot(Node* shadow, ExceptionCode&);
ShadowRootIfShadowDOMEnabledOrNode* olderShadowRoot(Node* shadow, ExceptionCode&);
- void removeShadowRoot(Element* host, ExceptionCode&);
Element* includerFor(Node*, ExceptionCode&);
String shadowPseudoId(Element*, ExceptionCode&);
PassRefPtr<Element> createContentElement(Document*, ExceptionCode&);
@@ -163,6 +162,9 @@ public:
void setNetworkInformation(Document*, const String& eventType, long bandwidth, bool metered, ExceptionCode&);
+ void suspendAnimations(Document*, ExceptionCode&) const;
+ void resumeAnimations(Document*, ExceptionCode&) const;
+
#if ENABLE(INSPECTOR)
unsigned numberOfLiveNodes() const;
unsigned numberOfLiveDocuments() const;
diff --git a/Source/WebCore/testing/Internals.idl b/Source/WebCore/testing/Internals.idl
index 05f6d34f8..7f5a2114d 100644
--- a/Source/WebCore/testing/Internals.idl
+++ b/Source/WebCore/testing/Internals.idl
@@ -49,7 +49,6 @@ module window {
Node youngerShadowRoot(in Node root) raises (DOMException);
#endif
Element includerFor(in Node node) raises (DOMException);
- void removeShadowRoot(in Element host) raises (DOMException);
DOMString shadowPseudoId(in Element element) raises (DOMException);
Element createContentElement(in Document document) raises(DOMException);
Element getElementByIdInShadowRoot(in Node shadowRoot, in DOMString id) raises(DOMException);
@@ -132,6 +131,9 @@ module window {
readonly attribute InternalSettings settings;
+ void suspendAnimations(in Document document) raises (DOMException);
+ void resumeAnimations(in Document document) raises (DOMException);
+
#if defined(ENABLE_BATTERY_STATUS) && ENABLE_BATTERY_STATUS
void setBatteryStatus(in Document document, in DOMString eventType, in boolean charging, in double chargingTime, in double dischargingTime, in double level) raises (DOMException);
#endif
diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog
index 5c7dafc88..020355f3f 100644
--- a/Source/WebKit/ChangeLog
+++ b/Source/WebKit/ChangeLog
@@ -1,3 +1,66 @@
+2012-05-10 Sam D <dsam2912@gmail.com>
+
+ Web Inspector: rename InspectorBackendStub.js to InspectorBackendCommands.js
+ https://bugs.webkit.org/show_bug.cgi?id=72306
+
+ Changed name for InspectorBackendStub.js to
+ InspectorBackendCommands.js
+
+ Reviewed by Yury Semikhatsky.
+
+ * PlatformBlackBerry.cmake:
+
+2012-05-08 Crystal Zhang <haizhang@rim.com>
+
+ [BlackBerry] Implement a popup client for HTML controls
+ https://bugs.webkit.org/show_bug.cgi?id=85670
+
+ Reviewed by Rob Buis.
+
+ Add popup client file to build system.
+
+ * PlatformBlackBerry.cmake:
+
+2012-05-08 Raphael Kubo da Costa <rakuco@webkit.org>
+
+ [CMake] Rewrite FindGStreamer.cmake.
+ https://bugs.webkit.org/show_bug.cgi?id=85857
+
+ Reviewed by Daniel Bates.
+
+ We are currently kind of duplicating the same
+ FindGStreamer-Foo.cmake file whenever a new GStreamer plugin needs
+ to be found. Besides this approach not scaling very well, it
+ relies on pkg-config for version checking, uses the LibFindMacros
+ package that we should deprecate and all the find files could be
+ merged into one, with users using the COMPONENTS feature of the
+ FIND_PACKAGE() call to find the desired plugins.
+
+ FindGStreamer.cmake has then been rewritten to take all that into
+ account:
+ - The LibFindMacros.cmake package is not used anymore.
+ - Version check is performed in the CMake file itself by parsing
+ the gstversion.h header.
+ - All GStreamer plugins are searched and the COMPONENTS keyword
+ used in the FIND_PACKAGE() call is used to check which plugins are
+ required.
+ - The plugins-base and base GStreamer plugins are not searched, as
+ they were not used anywhere in the build system.
+
+ * PlatformEfl.cmake: Update GStreamer-related variable names.
+
+2012-05-08 Jonathan Dong <jonathan.dong@torchmobile.com.cn>
+
+ [BlackBerry] AutofillManager implementation upstream
+ https://bugs.webkit.org/show_bug.cgi?id=85576
+
+ Reviewed by Rob Buis.
+
+ Added WebKit/blackberry/WebCoreSupport/AutofillManager.cpp
+ into building system of BlackBerry porting.
+
+ * PlatformBlackBerry.cmake:
+
2012-05-03 Jer Noble <jer.noble@apple.com>
Move WebKitFullScreenListener into its own file.
diff --git a/Source/WebKit/PlatformBlackBerry.cmake b/Source/WebKit/PlatformBlackBerry.cmake
index fcff9cb67..ae287dfb5 100644
--- a/Source/WebKit/PlatformBlackBerry.cmake
+++ b/Source/WebKit/PlatformBlackBerry.cmake
@@ -56,6 +56,7 @@ LIST(APPEND WebKit_SOURCES
blackberry/Api/WebSettings.cpp
blackberry/Api/WebViewportArguments.cpp
blackberry/WebCoreSupport/AboutData.cpp
+ blackberry/WebCoreSupport/AutofillManager.cpp
blackberry/WebCoreSupport/CacheClientBlackBerry.cpp
blackberry/WebCoreSupport/ChromeClientBlackBerry.cpp
blackberry/WebCoreSupport/ClientExtension.cpp
@@ -74,6 +75,7 @@ LIST(APPEND WebKit_SOURCES
blackberry/WebCoreSupport/JavaScriptDebuggerBlackBerry.cpp
blackberry/WebCoreSupport/NotificationPresenterImpl.cpp
blackberry/WebCoreSupport/VibrationClientBlackBerry.cpp
+ blackberry/WebCoreSupport/PagePopupBlackBerry.cpp
blackberry/WebKitSupport/BackingStoreCompositingSurface.cpp
blackberry/WebKitSupport/BackingStoreTile.cpp
blackberry/WebKitSupport/BackingStoreClient.cpp
@@ -186,9 +188,9 @@ FILE (STRINGS ${WEBCORE_DIR}/inspector/front-end/inspector.html SCRIPT_TAGS REGE
FOREACH (_line IN LISTS SCRIPT_TAGS)
STRING (STRIP ${_line} _stripped_line)
STRING (REGEX REPLACE "<script.* src=\"(.*\\.js)\".*></script>" "\\1" _js_file ${_stripped_line})
- STRING (COMPARE EQUAL ${_js_file} "InspectorBackendStub.js" _comp_result)
+ STRING (COMPARE EQUAL ${_js_file} "InspectorBackendCommands.js" _comp_result)
IF ( ${_comp_result} )
- # InspectorBackendStub.js was generated with the build, should get it from DERIVED_SOURCES_WEBCORE_DIR.
+ # InspectorBackendCommands.js was generated with the build, should get it from DERIVED_SOURCES_WEBCORE_DIR.
SET (_js_file "${DERIVED_SOURCES_WEBCORE_DIR}/${_js_file}")
ELSE ()
SET (_js_file "${WEBCORE_DIR}/inspector/front-end/${_js_file}")
diff --git a/Source/WebKit/PlatformEfl.cmake b/Source/WebKit/PlatformEfl.cmake
index c4d20cc70..fc43b467c 100644
--- a/Source/WebKit/PlatformEfl.cmake
+++ b/Source/WebKit/PlatformEfl.cmake
@@ -37,10 +37,10 @@ ENDIF ()
IF (ENABLE_VIDEO)
LIST(APPEND WebKit_INCLUDE_DIRECTORIES
"${WEBCORE_DIR}/platform/graphics/gstreamer"
- ${GStreamer-App_INCLUDE_DIRS}
- ${GStreamer-Interfaces_INCLUDE_DIRS}
- ${GStreamer-Pbutils_INCLUDE_DIRS}
- ${GStreamer-Video_INCLUDE_DIRS}
+ ${GSTREAMER_APP_INCLUDE_DIRS}
+ ${GSTREAMER_INTERFACES_INCLUDE_DIRS}
+ ${GSTREAMER_PBUTILS_INCLUDE_DIRS}
+ ${GSTREAMER_VIDEO_INCLUDE_DIRS}
)
ENDIF()
diff --git a/Source/WebKit/blackberry/Api/BackingStore.cpp b/Source/WebKit/blackberry/Api/BackingStore.cpp
index eeda7dd8a..ddc873fe0 100644
--- a/Source/WebKit/blackberry/Api/BackingStore.cpp
+++ b/Source/WebKit/blackberry/Api/BackingStore.cpp
@@ -79,6 +79,7 @@ const int s_renderTimerTimeout = 1.0;
WebPage* BackingStorePrivate::s_currentBackingStoreOwner = 0;
Platform::Graphics::Buffer* BackingStorePrivate::s_overScrollImage = 0;
std::string BackingStorePrivate::s_overScrollImagePath;
+Platform::IntSize BackingStorePrivate::s_overScrollImageSize;
typedef std::pair<int, int> Divisor;
typedef Vector<Divisor> DivisorList;
@@ -1207,43 +1208,38 @@ bool BackingStorePrivate::ensureOverScrollImage()
if (s_overScrollImage && path == s_overScrollImagePath)
return true;
- std::string imagePath = Platform::Client::get()->getApplicationDirectory() + path;
+ std::string imagePath = Platform::Client::get()->getApplicationLocalDirectory() + path;
SkBitmap bitmap;
-
if (!SkImageDecoder::DecodeFile(imagePath.c_str(), &bitmap)) {
BlackBerry::Platform::log(BlackBerry::Platform::LogLevelCritical,
"BackingStorePrivate::ensureOverScrollImage could not decode overscroll image: %s", imagePath.c_str());
return false;
}
- // FIXME: Make it orientation and resolution agnostic
- if (bitmap.width() != surfaceSize().width() || bitmap.height() != surfaceSize().height())
- return false;
-
- // FIXME: For now we fallback to solid color if sizes don't match, later we can implement tiling
+ destroyBuffer(s_overScrollImage);
s_overScrollImage = createBuffer(Platform::IntSize(bitmap.width(), bitmap.height()), Platform::Graphics::TemporaryBuffer);
SkCanvas* canvas = Platform::Graphics::lockBufferDrawable(s_overScrollImage);
-
if (!canvas) {
destroyBuffer(s_overScrollImage);
s_overScrollImage = 0;
return false;
}
+
SkPaint paint;
paint.setXfermodeMode(SkXfermode::kSrc_Mode);
paint.setFlags(SkPaint::kAntiAlias_Flag);
paint.setFilterBitmap(true);
SkRect rect = SkRect::MakeXYWH(0, 0, bitmap.width(), bitmap.height());
-
canvas->save();
canvas->drawBitmapRect(bitmap, 0, rect, &paint);
canvas->restore();
Platform::Graphics::releaseBufferDrawable(s_overScrollImage);
+ s_overScrollImageSize = Platform::IntSize(bitmap.width(), bitmap.height());
s_overScrollImagePath = path;
return true;
@@ -1278,9 +1274,20 @@ void BackingStorePrivate::paintDefaultBackground(const Platform::IntRect& conten
overScrollRect.intersect(Platform::IntRect(Platform::IntPoint(0, 0), surfaceSize()));
}
- if (ensureOverScrollImage())
- blitToWindow(overScrollRect, s_overScrollImage, overScrollRect, false, 255);
- else
+ if (ensureOverScrollImage()) {
+ // Tile the image on the window region.
+ Platform::IntRect dstRect;
+ for (int y = overScrollRect.y(); y < overScrollRect.y() + overScrollRect.height(); y += dstRect.height()) {
+ for (int x = overScrollRect.x(); x < overScrollRect.x() + overScrollRect.width(); x += dstRect.width()) {
+ Platform::IntRect imageRect = Platform::IntRect(Platform::IntPoint(x - (x % s_overScrollImageSize.width()),
+ y - (y % s_overScrollImageSize.height())), s_overScrollImageSize);
+ dstRect = imageRect;
+ dstRect.intersect(overScrollRect);
+ Platform::IntRect srcRect = Platform::IntRect(x - imageRect.x(), y - imageRect.y(), dstRect.width(), dstRect.height());
+ blitToWindow(dstRect, s_overScrollImage, srcRect, false, 255);
+ }
+ }
+ } else
clearWindow(overScrollRect, color.red(), color.green(), color.blue(), color.alpha());
}
}
diff --git a/Source/WebKit/blackberry/Api/BackingStore_p.h b/Source/WebKit/blackberry/Api/BackingStore_p.h
index 25b6c8c6b..24e94659b 100644
--- a/Source/WebKit/blackberry/Api/BackingStore_p.h
+++ b/Source/WebKit/blackberry/Api/BackingStore_p.h
@@ -371,6 +371,7 @@ public:
static Platform::Graphics::Buffer* s_overScrollImage;
static std::string s_overScrollImagePath;
+ static Platform::IntSize s_overScrollImageSize;
protected:
virtual ~BackingStorePrivate();
diff --git a/Source/WebKit/blackberry/Api/WebPage.cpp b/Source/WebKit/blackberry/Api/WebPage.cpp
index 21e906a3b..b1255d1ba 100644
--- a/Source/WebKit/blackberry/Api/WebPage.cpp
+++ b/Source/WebKit/blackberry/Api/WebPage.cpp
@@ -20,6 +20,7 @@
#include "WebPage.h"
#include "ApplicationCacheStorage.h"
+#include "AutofillManager.h"
#include "BackForwardController.h"
#include "BackForwardListImpl.h"
#include "BackingStoreClient.h"
@@ -35,6 +36,7 @@
#include "ContextMenuClientBlackBerry.h"
#include "CookieManager.h"
#include "CredentialManager.h"
+#include "CredentialStorage.h"
#include "CredentialTransformData.h"
#include "DOMSupport.h"
#include "Database.h"
@@ -82,6 +84,7 @@
#include "Page.h"
#include "PageCache.h"
#include "PageGroup.h"
+#include "PagePopupBlackBerry.h"
#include "PlatformTouchEvent.h"
#include "PlatformWheelEvent.h"
#include "PluginDatabase.h"
@@ -304,6 +307,11 @@ protected:
typedef DeferredTask<isActive> DeferredTaskType;
};
+void WebPage::autofillTextField(const string& item)
+{
+ d->m_autofillManager->autofillTextField(item.c_str());
+}
+
WebPagePrivate::WebPagePrivate(WebPage* webPage, WebPageClient* client, const IntRect& rect)
: m_webPage(webPage)
, m_client(client)
@@ -372,6 +380,9 @@ WebPagePrivate::WebPagePrivate(WebPage* webPage, WebPageClient* client, const In
, m_hasInRegionScrollableAreas(false)
, m_updateDelegatedOverlaysDispatched(false)
, m_deferredTasksTimer(this, &WebPagePrivate::deferredTasksTimerFired)
+ , m_selectPopup(0)
+ , m_parentPopup(0)
+ , m_autofillManager(AutofillManager::create(this))
{
static bool isInitialized = false;
if (!isInitialized) {
@@ -2121,6 +2132,14 @@ PageClientBlackBerry::SaveCredentialType WebPagePrivate::notifyShouldSaveCredent
return static_cast<PageClientBlackBerry::SaveCredentialType>(m_client->notifyShouldSaveCredential(isNew));
}
+void WebPagePrivate::notifyPopupAutofillDialog(const Vector<String>& candidates, const WebCore::IntRect& screenRect)
+{
+ vector<string> textItems;
+ for (size_t i = 0; i < candidates.size(); i++)
+ textItems.push_back(candidates[i].utf8().data());
+ m_client->notifyPopupAutofillDialog(textItems, screenRect);
+}
+
bool WebPagePrivate::useFixedLayout() const
{
return true;
@@ -3806,6 +3825,9 @@ bool WebPagePrivate::handleMouseEvent(PlatformMouseEvent& mouseEvent)
if (mouseEvent.type() == WebCore::PlatformEvent::MouseScroll)
return true;
+ if (m_parentPopup)
+ m_parentPopup->handleMouseEvent(mouseEvent);
+
Node* node = 0;
if (mouseEvent.inputMethod() == TouchScreen) {
const FatFingersResult lastFatFingersResult = m_touchEventHandler->lastFatFingersResult();
@@ -5171,6 +5193,11 @@ void WebPage::clearCredentials()
#endif
}
+void WebPage::clearAutofillData()
+{
+ AutofillManager::clear();
+}
+
void WebPage::clearNeverRememberSites()
{
#if ENABLE(BLACKBERRY_CREDENTIAL_PERSIST)
@@ -5277,6 +5304,11 @@ bool WebPage::nodeHasHover(const WebDOMNode& node)
}
#endif
+void WebPage::initPopupWebView(BlackBerry::WebKit::WebPage* webPage)
+{
+ d->m_selectPopup->init(webPage);
+}
+
String WebPagePrivate::findPatternStringForUrl(const KURL& url) const
{
if ((m_webSettings->shouldHandlePatternUrls() && protocolIs(url, "pattern"))
@@ -5994,6 +6026,8 @@ void WebPagePrivate::didChangeSettings(WebSettings* webSettings)
cookieManager().setPrivateMode(webSettings->isPrivateBrowsingEnabled());
+ CredentialStorage::setPrivateMode(webSettings->isPrivateBrowsingEnabled());
+
if (m_mainFrame && m_mainFrame->view()) {
Color backgroundColor(webSettings->backgroundColor());
m_mainFrame->view()->updateBackgroundRecursively(backgroundColor, backgroundColor.hasAlpha());
@@ -6077,5 +6111,32 @@ const String& WebPagePrivate::defaultUserAgent()
return *defaultUserAgent;
}
+void WebPage::popupOpened(PagePopupBlackBerry* webPopup)
+{
+ ASSERT(!d->m_selectPopup);
+ d->m_selectPopup = webPopup;
+}
+
+void WebPage::popupClosed()
+{
+ ASSERT(d->m_selectPopup);
+ d->m_selectPopup = 0;
+}
+
+bool WebPage::hasOpenedPopup() const
+{
+ return d->m_selectPopup;
+}
+
+PagePopupBlackBerry* WebPage::popup()
+{
+ return d->m_selectPopup;
+}
+
+void WebPagePrivate::setParentPopup(PagePopupBlackBerry* webPopup)
+{
+ m_parentPopup = webPopup;
+}
+
}
}
diff --git a/Source/WebKit/blackberry/Api/WebPage.h b/Source/WebKit/blackberry/Api/WebPage.h
index 82d4ef6ea..b01e66424 100644
--- a/Source/WebKit/blackberry/Api/WebPage.h
+++ b/Source/WebKit/blackberry/Api/WebPage.h
@@ -38,6 +38,7 @@ namespace WebCore {
class ChromeClientBlackBerry;
class Frame;
class FrameLoaderClientBlackBerry;
+class PagePopupBlackBerry;
}
class WebDOMDocument;
@@ -195,6 +196,7 @@ public:
void clearCache();
void clearLocalStorage();
void clearCredentials();
+ void clearAutofillData();
void clearNeverRememberSites();
void runLayoutTests();
@@ -332,6 +334,14 @@ public:
void setUserViewportArguments(const WebViewportArguments&);
void resetUserViewportArguments();
+ // Popup client
+ void initPopupWebView(BlackBerry::WebKit::WebPage*);
+ void popupOpened(WebCore::PagePopupBlackBerry* webPopup);
+ void popupClosed();
+ bool hasOpenedPopup() const;
+ WebCore::PagePopupBlackBerry* popup();
+
+ void autofillTextField(const std::string&);
private:
virtual ~WebPage();
@@ -344,6 +354,7 @@ private:
friend class WebKit::WebPagePrivate;
friend class WebCore::ChromeClientBlackBerry;
friend class WebCore::FrameLoaderClientBlackBerry;
+ friend class WebCore::PagePopupBlackBerry;
WebPagePrivate* d;
};
}
diff --git a/Source/WebKit/blackberry/Api/WebPageClient.h b/Source/WebKit/blackberry/Api/WebPageClient.h
index 329660963..2ae973fdd 100644
--- a/Source/WebKit/blackberry/Api/WebPageClient.h
+++ b/Source/WebKit/blackberry/Api/WebPageClient.h
@@ -213,6 +213,7 @@ public:
virtual void setPreventsScreenIdleDimming(bool noDimming) = 0;
virtual void authenticationChallenge(const unsigned short* realm, unsigned int realmLength, WebString& username, WebString& password) = 0;
virtual SaveCredentialType notifyShouldSaveCredential(bool isNew) = 0;
+ virtual void notifyPopupAutofillDialog(const std::vector<std::string>&, const Platform::IntRect&) = 0;
virtual bool shouldPluginEnterFullScreen() = 0;
virtual void didPluginEnterFullScreen() = 0;
@@ -251,6 +252,8 @@ public:
virtual void clearCache() = 0;
virtual bool hasKeyboardFocus() = 0;
+ virtual void createPopupWebView(const Platform::IntRect& webViewRect) = 0;
+ virtual void closePopupWebView() = 0;
};
} // namespace WebKit
} // namespace BlackBerry
diff --git a/Source/WebKit/blackberry/Api/WebPage_p.h b/Source/WebKit/blackberry/Api/WebPage_p.h
index 1c86c1a4a..c688c6de6 100644
--- a/Source/WebKit/blackberry/Api/WebPage_p.h
+++ b/Source/WebKit/blackberry/Api/WebPage_p.h
@@ -36,6 +36,7 @@
#include <BlackBerryPlatformMessage.h>
namespace WebCore {
+class AutofillManager;
class DOMWrapperWorld;
class Document;
class Frame;
@@ -48,6 +49,7 @@ class RenderLayer;
class RenderObject;
class ScrollView;
class TransformationMatrix;
+class PagePopupBlackBerry;
template<typename T> class Timer;
}
@@ -189,6 +191,7 @@ public:
void overflowExceedsContentsSize() { m_overflowExceedsContentsSize = true; }
void layoutFinished();
void setNeedTouchEvents(bool);
+ void notifyPopupAutofillDialog(const Vector<String>&, const WebCore::IntRect&);
// Called according to our heuristic or from setLoadState depending on whether we have a virtual viewport.
void zoomToInitialScaleOnLoad();
@@ -398,6 +401,8 @@ public:
void addBackingStoreClientForFrame(const WebCore::Frame*, BackingStoreClient*);
void removeBackingStoreClientForFrame(const WebCore::Frame*);
+ void setParentPopup(WebCore::PagePopupBlackBerry* webPopup);
+
// Clean up any document related data we might be holding.
void clearDocumentData(const WebCore::Document*);
@@ -579,6 +584,12 @@ public:
Vector<OwnPtr<DeferredTaskBase> > m_deferredTasks;
WebCore::Timer<WebPagePrivate> m_deferredTasksTimer;
+ // The popup that opened in this webpage
+ WebCore::PagePopupBlackBerry* m_selectPopup;
+ // The popup that owned this webpage
+ WebCore::PagePopupBlackBerry* m_parentPopup;
+
+ RefPtr<WebCore::AutofillManager> m_autofillManager;
protected:
virtual ~WebPagePrivate();
};
diff --git a/Source/WebKit/blackberry/ChangeLog b/Source/WebKit/blackberry/ChangeLog
index 49f6d0909..e401ed012 100644
--- a/Source/WebKit/blackberry/ChangeLog
+++ b/Source/WebKit/blackberry/ChangeLog
@@ -1,3 +1,256 @@
+2012-05-10 Mike Fenton <mifenton@rim.com>
+
+ Caret node boundary should be adjusted to account for the visible region.
+ https://bugs.webkit.org/show_bug.cgi?id=86116
+
+ Reviewed by Antonio Gomes.
+
+ PR 138988.
+
+ Update the node bounding box to be clipped and adjusted
+ for the visible region of the frame.
+
+ Reviewed Internally by Gen Mak.
+
+ * WebKitSupport/SelectionHandler.cpp:
+ (BlackBerry::WebKit::SelectionHandler::caretPositionChanged):
+
+2012-05-10 Antonio Gomes <agomes@rim.com>
+
+ [BlackBerry] Assertions and assumptions in BackingStoreClient around m_frame and m_frame->view() are invalid
+ https://bugs.webkit.org/show_bug.cgi?id=86096
+
+ Reviewed by Rob Buis.
+
+ A Frame's FrameView has always to be checked since it is
+ a volatile object, and gets created and destroyed all the time.
+
+ We have been facing a particular issue, where during our automated
+ interaction tests, the main frame object was being pinch zoomed in
+ the middle of it creation, and WebKit thread was blocked by a mutex.
+ In practice, it is a case that would not be possible in a real
+ world scenario, but shows that the ASSERTs are bogus regardless.
+
+ * WebKitSupport/BackingStoreClient.cpp:
+ (BlackBerry::WebKit::BackingStoreClient::scrollPosition):
+ (BlackBerry::WebKit::BackingStoreClient::setScrollPosition):
+ (BlackBerry::WebKit::BackingStoreClient::maximumScrollPosition):
+ (BlackBerry::WebKit::BackingStoreClient::viewportSize):
+ (BlackBerry::WebKit::BackingStoreClient::transformedViewportSize):
+ (BlackBerry::WebKit::BackingStoreClient::visibleContentsRect):
+ (BlackBerry::WebKit::BackingStoreClient::contentsSize):
+
+2012-05-09 Jonathan Dong <jonathan.dong@torchmobile.com.cn>
+
+ [BlackBerry] Autofill feature implementation for BlackBerry porting
+ https://bugs.webkit.org/show_bug.cgi?id=85577
+
+ Reviewed by Rob Buis.
+
+ * Api/WebPage.cpp:
+ (BlackBerry::WebKit::WebPage::autofillTextField): Added this interface
+ function to auto fill the inputting text field when user selects
+ a autofill candidate value from autofill context dialog.
+ (WebKit):
+ (BlackBerry::WebKit::WebPagePrivate::WebPagePrivate):
+ (BlackBerry::WebKit::WebPagePrivate::notifyPopupAutofillDialog): Added
+ this interface function to notify WebPageClient to pop up the autofill
+ context dialog with the suggested input items.
+ (BlackBerry::WebKit::WebPage::clearAutofillData):
+ * Api/WebPage.h:
+ * Api/WebPageClient.h:
+ * Api/WebPage_p.h:
+ (WebCore):
+ (WebPagePrivate):
+ * WebCoreSupport/AutofillManager.cpp:
+ (WebCore::AutofillManager::didChangeInTextField):
+ * WebCoreSupport/EditorClientBlackBerry.cpp:
+ (WebCore::EditorClientBlackBerry::textDidChangeInTextField): Implemented
+ this function to listen to the notification of text field change, and
+ notify AutofillManager to handle the autofill.
+ * WebCoreSupport/FrameLoaderClientBlackBerry.cpp:
+ (WebCore::FrameLoaderClientBlackBerry::dispatchWillSubmitForm):
+ (WebCore::FrameLoaderClientBlackBerry::dispatchWillSendSubmitEvent):
+ Save the name and value pair of every autofillable input text field when
+ user submitting a form.
+
+2012-05-09 Crystal Zhang <haizhang@rim.com>
+
+ [BlackBerry] Enable PAGE_POPUP in make file, and implement required methods
+ https://bugs.webkit.org/show_bug.cgi?id=85907
+
+ Reviewed by Rob Buis.
+
+ Internal reviewed by Yong Li.
+
+ Enable PAGE_POPUP so we can use WebCore::PagePopup and WebCore::PagePopupClient interface.
+ Implement virtual methods in WebCore::ChromeClientBlackBerry that required for the
+ implementation and add methods in WebKit::WebPage that needed for PagePopupClient.
+
+ * Api/WebPage.cpp:
+ (BlackBerry::WebKit::WebPagePrivate::WebPagePrivate):
+ (BlackBerry::WebKit::WebPagePrivate::handleMouseEvent):
+ (BlackBerry::WebKit::WebPage::initPopupWebView):
+ (WebKit):
+ (BlackBerry::WebKit::WebPage::popupOpened):
+ (BlackBerry::WebKit::WebPage::popupClosed):
+ (BlackBerry::WebKit::WebPage::hasOpenedPopup):
+ (BlackBerry::WebKit::WebPage::popup):
+ (BlackBerry::WebKit::WebPagePrivate::setParentPopup):
+ * Api/WebPage.h:
+ (WebCore):
+ * Api/WebPage_p.h:
+ (WebCore):
+ (WebPagePrivate):
+ * WebCoreSupport/ChromeClientBlackBerry.cpp:
+ (WebCore::ChromeClientBlackBerry::hasOpenedPopup):
+ (WebCore::ChromeClientBlackBerry::openPagePopup):
+ (WebCore):
+ (WebCore::ChromeClientBlackBerry::closePagePopup):
+ * WebCoreSupport/ChromeClientBlackBerry.h:
+ (WebCore):
+ (ChromeClientBlackBerry):
+
+2012-05-08 Jason Liu <jason.liu@torchmobile.com.cn>
+
+ [BlackBerry] Auth credentials set in private mode are reused in public mode.
+ https://bugs.webkit.org/show_bug.cgi?id=84697
+
+ Reviewed by Rob Buis.
+
+ Add setPrivateMode function for CredentialStorage.
+
+ We have to change Private Browsing to test, so have to write a manual test case.
+ Test: ManualTests/blackberry/http-auth-private-mode-changed.html
+
+ * Api/WebPage.cpp:
+ (BlackBerry::WebKit::WebPagePrivate::didChangeSettings):
+
+2012-05-08 Crystal Zhang <haizhang@rim.com>
+
+ [BlackBerry] Implement a popup client for HTML controls
+ https://bugs.webkit.org/show_bug.cgi?id=85670
+
+ Reviewed by Rob Buis.
+
+ Implement a popup client for HTML controls, which would be used to load
+ different popups according to popup type.
+
+ * WebCoreSupport/PagePopupBlackBerry.cpp: Added.
+ (WebCore):
+ (PagePopupChromeClient):
+ (WebCore::PagePopupChromeClient::PagePopupChromeClient):
+ (WebCore::PagePopupChromeClient::closeWindowSoon):
+ (WebCore::PagePopupChromeClient::webPage):
+ (WebCore::PagePopupBlackBerry::PagePopupBlackBerry):
+ (WebCore::PagePopupBlackBerry::~PagePopupBlackBerry):
+ (WebCore::PagePopupBlackBerry::sendCreatePopupWebViewRequest):
+ (WebCore::PagePopupBlackBerry::init):
+ (WebCore::setValueAndClosePopupCallback):
+ (WebCore::popUpExtensionInitialize):
+ (WebCore::popUpExtensionFinalize):
+ (WebCore::PagePopupBlackBerry::installDomFunction):
+ (WebCore::PagePopupBlackBerry::handleMouseEvent):
+ (WebCore::PagePopupBlackBerry::closePopup):
+ (WebCore::PagePopupBlackBerry::closeWebPage):
+ * WebCoreSupport/PagePopupBlackBerry.h: Added.
+ (WebKit):
+ (WebCore):
+ (PagePopupBlackBerry):
+
+2012-05-08 Andrew Lo <anlo@rim.com>
+
+ [BlackBerry] Over-scroll image should be tiled
+ https://bugs.webkit.org/show_bug.cgi?id=85860
+
+ Reviewed by Rob Buis.
+
+ Implement tiling for over-scroll image if image dimension don't match
+ the surface dimensions.
+
+ * Api/BackingStore.cpp:
+ (WebKit):
+ (BlackBerry::WebKit::BackingStorePrivate::ensureOverScrollImage):
+ (BlackBerry::WebKit::BackingStorePrivate::paintDefaultBackground):
+ * Api/BackingStore_p.h:
+ (BackingStorePrivate):
+
+2012-05-08 Chris Guan <chris.guan@torchmobile.com.cn>
+
+ [Blackberry] remove m_isRequestedByPlugin in ResourceRequest
+ https://bugs.webkit.org/show_bug.cgi?id=84559
+
+ Reviewed by Antonio Gomes.
+
+ * WebCoreSupport/FrameLoaderClientBlackBerry.cpp:
+ (WebCore::FrameLoaderClientBlackBerry::dispatchDecidePolicyForNewWindowAction):
+
+2012-05-08 Jonathan Dong <jonathan.dong@torchmobile.com.cn>
+
+ [BlackBerry] AutofillManager implementation upstream
+ https://bugs.webkit.org/show_bug.cgi?id=85576
+
+ Reviewed by Rob Buis.
+
+ RIM PR: 136405
+ Implemented class AutofillManager to handle the form autofill
+ interactions.
+ It listens to text changed notification from text input, searches
+ autofill database for the suggested autofill candidate value,
+ and notifies WebPageClient to pop up a context dialog for user;
+ it also responds to user's choice by autofilling the text input.
+
+ * WebCoreSupport/AutofillManager.cpp: Added.
+ (WebCore):
+ (WebCore::AutofillManager::create):
+ (WebCore::AutofillManager::didChangeInTextField):
+ (WebCore::AutofillManager::autofillTextField):
+ (WebCore::AutofillManager::saveTextFields):
+ (WebCore::AutofillManager::clear):
+ * WebCoreSupport/AutofillManager.h: Added.
+ (WTF):
+ (WebKit):
+ (WebCore):
+ (AutofillManager):
+ (WebCore::AutofillManager::m_element):
+
+2012-05-07 Andrew Lo <anlo@rim.com>
+
+ [BlackBerry] Delete previous buffer when new over-scroll image path is set
+ https://bugs.webkit.org/show_bug.cgi?id=85812
+
+ Reviewed by Rob Buis.
+
+ When a new over-scroll image path is set, delete old buffer before creating
+ a new one.
+
+ * Api/BackingStore.cpp:
+ (BlackBerry::WebKit::BackingStorePrivate::ensureOverScrollImage):
+
+2012-05-07 Andrew Lo <anlo@rim.com>
+
+ [BlackBerry] Over-scroll image path property should be relative to local application directory
+ https://bugs.webkit.org/show_bug.cgi?id=85814
+
+ Reviewed by Rob Buis.
+
+ Over-scroll image path web setting should be relative to the local directory.
+
+ * Api/BackingStore.cpp:
+ (BlackBerry::WebKit::BackingStorePrivate::ensureOverScrollImage):
+
+2012-05-07 Crystal Zhang <haizhang@rim.com>
+
+ [BlackBerry] Add methods need by client side
+ https://bugs.webkit.org/show_bug.cgi?id=85661
+
+ Reviewed by Antonio Gomes.
+
+ Add methods needed by client side when create and close HTML popup dialogs.
+ PR 154360
+
+ * Api/WebPageClient.h:
+
2012-05-06 Mary Wu <mary.wu@torchmobile.com.cn>
[BlackBerry] Support html5 download attribute.
diff --git a/Source/WebKit/blackberry/WebCoreSupport/AutofillManager.cpp b/Source/WebKit/blackberry/WebCoreSupport/AutofillManager.cpp
new file mode 100644
index 000000000..e3fc27d32
--- /dev/null
+++ b/Source/WebKit/blackberry/WebCoreSupport/AutofillManager.cpp
@@ -0,0 +1,80 @@
+/*
+ * 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 "AutofillManager.h"
+
+#include "AutofillBackingStore.h"
+#include "HTMLCollection.h"
+#include "HTMLFormElement.h"
+#include "HTMLInputElement.h"
+#include "WebPage_p.h"
+
+namespace WebCore {
+
+static bool isAutofillable(HTMLInputElement* element)
+{
+ return element && element->isTextField() && !element->isPasswordField()
+ && !element->isAutofilled() && element->shouldAutocomplete();
+}
+
+PassRefPtr<AutofillManager> AutofillManager::create(BlackBerry::WebKit::WebPagePrivate* page)
+{
+ return adoptRef(new AutofillManager(page));
+}
+
+void AutofillManager::didChangeInTextField(HTMLInputElement* element)
+{
+ if (!isAutofillable(element))
+ return;
+
+ if (m_element != element)
+ m_element = element;
+
+ Vector<String> candidates = autofillBackingStore().get(element->getAttribute(HTMLNames::nameAttr).string(), element->value());
+ m_webPagePrivate->notifyPopupAutofillDialog(candidates, element->screenRect());
+}
+
+void AutofillManager::autofillTextField(const String& value)
+{
+ if (!m_element)
+ return;
+
+ m_element->setValue(value);
+ m_element->setAutofilled();
+}
+
+void AutofillManager::saveTextFields(HTMLFormElement* form)
+{
+ RefPtr<HTMLCollection> elements = form->elements();
+ size_t itemCount = elements->length();
+ for (size_t i = 0; i < itemCount; ++i) {
+ HTMLInputElement* element = form->item(i)->toInputElement();
+ if (!isAutofillable(element))
+ continue;
+ autofillBackingStore().add(element->getAttribute(HTMLNames::nameAttr).string(), element->value());
+ }
+}
+
+void AutofillManager::clear()
+{
+ autofillBackingStore().clear();
+}
+
+} // namespace WebCore
diff --git a/Source/WebKit/blackberry/WebCoreSupport/AutofillManager.h b/Source/WebKit/blackberry/WebCoreSupport/AutofillManager.h
new file mode 100644
index 000000000..397f17f65
--- /dev/null
+++ b/Source/WebKit/blackberry/WebCoreSupport/AutofillManager.h
@@ -0,0 +1,58 @@
+/*
+ * 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 AutofillManager_h
+#define AutofillManager_h
+
+#include <wtf/PassRefPtr.h>
+#include <wtf/RefCounted.h>
+
+namespace WTF {
+class String;
+}
+
+namespace BlackBerry {
+namespace WebKit {
+class WebPagePrivate;
+}
+}
+
+namespace WebCore {
+class HTMLFormElement;
+class HTMLInputElement;
+
+class AutofillManager : public RefCounted<AutofillManager> {
+public:
+ static PassRefPtr<AutofillManager> create(BlackBerry::WebKit::WebPagePrivate*);
+
+ void didChangeInTextField(HTMLInputElement*);
+ void autofillTextField(const WTF::String&);
+ void saveTextFields(HTMLFormElement*);
+
+ static void clear();
+
+private:
+ AutofillManager(BlackBerry::WebKit::WebPagePrivate* page) : m_webPagePrivate(page), m_element(0) { }
+
+ BlackBerry::WebKit::WebPagePrivate* m_webPagePrivate;
+ HTMLInputElement* m_element;
+};
+
+} // WebCore
+
+#endif // AutofillManager_h
diff --git a/Source/WebKit/blackberry/WebCoreSupport/ChromeClientBlackBerry.cpp b/Source/WebKit/blackberry/WebCoreSupport/ChromeClientBlackBerry.cpp
index 23368d5bf..df89aa52a 100644
--- a/Source/WebKit/blackberry/WebCoreSupport/ChromeClientBlackBerry.cpp
+++ b/Source/WebKit/blackberry/WebCoreSupport/ChromeClientBlackBerry.cpp
@@ -47,6 +47,8 @@
#include "Page.h"
#include "PageGroup.h"
#include "PageGroupLoadDeferrer.h"
+#include "PagePopupBlackBerry.h"
+#include "PagePopupClient.h"
#include "PlatformString.h"
#include "PopupMenuBlackBerry.h"
#include "RenderView.h"
@@ -58,6 +60,7 @@
#include "WebPage.h"
#include "WebPageClient.h"
#include "WebPage_p.h"
+#include "WebPopupType.h"
#include "WebSettings.h"
#include "WebString.h"
#include "WindowFeatures.h"
@@ -282,8 +285,7 @@ bool ChromeClientBlackBerry::selectItemAlignmentFollowsMenuWritingDirection()
bool ChromeClientBlackBerry::hasOpenedPopup() const
{
- notImplemented();
- return false;
+ return m_webPagePrivate->m_webPage->hasOpenedPopup();
}
PassRefPtr<PopupMenu> ChromeClientBlackBerry::createPopupMenu(PopupMenuClient* client) const
@@ -296,6 +298,31 @@ PassRefPtr<SearchPopupMenu> ChromeClientBlackBerry::createSearchPopupMenu(PopupM
return adoptRef(new SearchPopupMenuBlackBerry(client));
}
+PagePopup* ChromeClientBlackBerry::openPagePopup(PagePopupClient* client, const IntRect& originBoundsInRootView)
+{
+ PagePopupBlackBerry* webPopup;
+
+ if (!hasOpenedPopup()) {
+ webPopup = new PagePopupBlackBerry(m_webPagePrivate, client,
+ rootViewToScreen(originBoundsInRootView));
+ m_webPagePrivate->m_webPage->popupOpened(webPopup);
+ } else {
+ webPopup = m_webPagePrivate->m_webPage->popup();
+ webPopup->closeWebPage();
+ }
+ webPopup->sendCreatePopupWebViewRequest();
+ return webPopup;
+}
+
+void ChromeClientBlackBerry::closePagePopup(PagePopup* popup)
+{
+ if (!popup)
+ return;
+
+ PagePopupBlackBerry* webPopup = m_webPagePrivate->m_webPage->popup();
+ webPopup->closePopup();
+ m_webPagePrivate->m_webPage->popupClosed();
+}
void ChromeClientBlackBerry::setToolbarsVisible(bool)
{
diff --git a/Source/WebKit/blackberry/WebCoreSupport/ChromeClientBlackBerry.h b/Source/WebKit/blackberry/WebCoreSupport/ChromeClientBlackBerry.h
index d1e6b3de4..904c4187b 100644
--- a/Source/WebKit/blackberry/WebCoreSupport/ChromeClientBlackBerry.h
+++ b/Source/WebKit/blackberry/WebCoreSupport/ChromeClientBlackBerry.h
@@ -28,6 +28,8 @@ class WebPagePrivate;
}
namespace WebCore {
+class PagePopup;
+class PagePopupClient;
class ChromeClientBlackBerry : public ChromeClient {
public:
@@ -137,6 +139,9 @@ public:
virtual PassRefPtr<PopupMenu> createPopupMenu(PopupMenuClient*) const;
virtual PassRefPtr<SearchPopupMenu> createSearchPopupMenu(PopupMenuClient*) const;
+ virtual WebCore::PagePopup* openPagePopup(WebCore::PagePopupClient*, const WebCore::IntRect&);
+ virtual void closePagePopup(WebCore::PagePopup*);
+
#if USE(ACCELERATED_COMPOSITING)
virtual void attachRootGraphicsLayer(Frame*, GraphicsLayer*);
virtual void setNeedsOneShotDrawingSynchronization();
diff --git a/Source/WebKit/blackberry/WebCoreSupport/EditorClientBlackBerry.cpp b/Source/WebKit/blackberry/WebCoreSupport/EditorClientBlackBerry.cpp
index 148be1663..b576c0396 100644
--- a/Source/WebKit/blackberry/WebCoreSupport/EditorClientBlackBerry.cpp
+++ b/Source/WebKit/blackberry/WebCoreSupport/EditorClientBlackBerry.cpp
@@ -20,6 +20,7 @@
#include "config.h"
#include "EditorClientBlackBerry.h"
+#include "AutofillManager.h"
#include "DOMSupport.h"
#include "DumpRenderTreeClient.h"
#include "EditCommand.h"
@@ -511,9 +512,10 @@ void EditorClientBlackBerry::textFieldDidEndEditing(Element*)
notImplemented();
}
-void EditorClientBlackBerry::textDidChangeInTextField(Element*)
+void EditorClientBlackBerry::textDidChangeInTextField(Element* element)
{
- notImplemented();
+ if (HTMLInputElement* inputElement = element->toInputElement())
+ m_webPagePrivate->m_autofillManager->didChangeInTextField(inputElement);
}
bool EditorClientBlackBerry::doTextFieldCommandFromEvent(Element*, KeyboardEvent*)
diff --git a/Source/WebKit/blackberry/WebCoreSupport/FrameLoaderClientBlackBerry.cpp b/Source/WebKit/blackberry/WebCoreSupport/FrameLoaderClientBlackBerry.cpp
index b2de76e39..6ef4e4490 100644
--- a/Source/WebKit/blackberry/WebCoreSupport/FrameLoaderClientBlackBerry.cpp
+++ b/Source/WebKit/blackberry/WebCoreSupport/FrameLoaderClientBlackBerry.cpp
@@ -19,6 +19,7 @@
#include "config.h"
#include "FrameLoaderClientBlackBerry.h"
+#include "AutofillManager.h"
#include "BackForwardController.h"
#include "BackForwardListImpl.h"
#include "BackingStoreClient.h"
@@ -276,8 +277,10 @@ void FrameLoaderClientBlackBerry::doPendingFragmentScroll()
void FrameLoaderClientBlackBerry::dispatchDecidePolicyForNewWindowAction(FramePolicyFunction function, const NavigationAction&, const ResourceRequest& request, PassRefPtr<FormState>, const String& frameName)
{
- if (request.isRequestedByPlugin() && ScriptController::processingUserGesture() && !m_webPagePrivate->m_pluginMayOpenNewTab)
+ if (ScriptController::processingUserGesture() && !m_webPagePrivate->m_pluginMayOpenNewTab) {
(m_frame->loader()->policyChecker()->*function)(PolicyIgnore);
+ return;
+ }
// A new window can never be a fragment scroll.
PolicyAction decision = decidePolicyForExternalLoad(request, false);
@@ -702,10 +705,12 @@ void FrameLoaderClientBlackBerry::dispatchDidFailProvisionalLoad(const ResourceE
void FrameLoaderClientBlackBerry::dispatchWillSubmitForm(FramePolicyFunction function, PassRefPtr<FormState> formState)
{
+ if (!m_webPagePrivate->m_webSettings->isPrivateBrowsingEnabled()) {
+ m_webPagePrivate->m_autofillManager->saveTextFields(formState->form());
#if ENABLE(BLACKBERRY_CREDENTIAL_PERSIST)
- if (!m_webPagePrivate->m_webSettings->isPrivateBrowsingEnabled())
credentialManager().saveCredentialIfConfirmed(m_webPagePrivate, CredentialTransformData(formState->form()));
#endif
+ }
// FIXME: Stub.
(m_frame->loader()->policyChecker()->*function)(PolicyUse);
@@ -713,12 +718,12 @@ void FrameLoaderClientBlackBerry::dispatchWillSubmitForm(FramePolicyFunction fun
void FrameLoaderClientBlackBerry::dispatchWillSendSubmitEvent(PassRefPtr<FormState> prpFormState)
{
+ if (!m_webPagePrivate->m_webSettings->isPrivateBrowsingEnabled()) {
+ m_webPagePrivate->m_autofillManager->saveTextFields(prpFormState->form());
#if ENABLE(BLACKBERRY_CREDENTIAL_PERSIST)
- if (!m_webPagePrivate->m_webSettings->isPrivateBrowsingEnabled())
- credentialManager().saveCredentialIfConfirmed(m_webPagePrivate, CredentialTransformData(prpFormState->form()));
-#else
- notImplemented();
+ credentialManager().saveCredentialIfConfirmed(m_webPagePrivate, CredentialTransformData(prpFormState->form()));
#endif
+ }
}
PassRefPtr<Frame> FrameLoaderClientBlackBerry::createFrame(const KURL& url, const String& name
diff --git a/Source/WebKit/blackberry/WebCoreSupport/PagePopupBlackBerry.cpp b/Source/WebKit/blackberry/WebCoreSupport/PagePopupBlackBerry.cpp
new file mode 100644
index 000000000..b570c5b35
--- /dev/null
+++ b/Source/WebKit/blackberry/WebCoreSupport/PagePopupBlackBerry.cpp
@@ -0,0 +1,254 @@
+/*
+ * 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 "PagePopupBlackBerry.h"
+
+#include "ChromeClientBlackBerry.h"
+#include "EmptyClients.h"
+#include "FrameView.h"
+#include "InspectorClientBlackBerry.h"
+#include "JSDOMBinding.h"
+#include "JSDOMWindowBase.h"
+#include "JSObject.h"
+#include "JSRetainPtr.h"
+#include "Page.h"
+#include "PageGroup.h"
+#include "PagePopupClient.h"
+#include "PlatformMouseEvent.h"
+#include "Settings.h"
+#include "WebPage.h"
+#include "WebPage_p.h"
+
+#include <JavaScriptCore/API/JSCallbackObject.h>
+#include <JavaScriptCore/JSObjectRef.h>
+#include <JavaScriptCore/JSStringRef.h>
+#include <JavaScriptCore/JSValueRef.h>
+
+// Fixme: should get the height from runtime.
+#define URL_BAR_HEIGHT 70
+
+using namespace BlackBerry::Platform::Graphics;
+using namespace BlackBerry::WebKit;
+namespace WebCore {
+
+class PagePopupChromeClient : public ChromeClientBlackBerry {
+public:
+ explicit PagePopupChromeClient(WebPagePrivate* webpage, PagePopupBlackBerry* popup)
+ : ChromeClientBlackBerry(webpage)
+ , m_popup(popup)
+ , m_webPage(webpage)
+ {
+ }
+
+ virtual void closeWindowSoon()
+ {
+ m_popup->closePopup();
+ }
+
+ WebPagePrivate* webPage()
+ {
+ return m_webPage;
+ }
+
+ PagePopupBlackBerry* m_popup;
+ WebPagePrivate* m_webPage;
+ IntRect m_rect;
+};
+
+PagePopupBlackBerry::PagePopupBlackBerry(BlackBerry::WebKit::WebPagePrivate* webPage, PagePopupClient* client, const IntRect& rect)
+ : m_webPagePrivate(webPage)
+ , m_client(adoptPtr(client))
+{
+ m_rect = IntRect(rect.x(), rect.y() - URL_BAR_HEIGHT, client->contentSize().width(), client->contentSize().height());
+}
+
+PagePopupBlackBerry::~PagePopupBlackBerry()
+{
+}
+
+void PagePopupBlackBerry::sendCreatePopupWebViewRequest()
+{
+ m_webPagePrivate->client()->createPopupWebView(m_rect);
+}
+
+bool PagePopupBlackBerry::init(WebPage* webpage)
+{
+ static FrameLoaderClient* emptyFrameLoaderClient = new EmptyFrameLoaderClient;
+ Page::PageClients pageClients;
+ m_chromeClient = adoptPtr(new PagePopupChromeClient(webpage->d, this));
+ static EditorClient* emptyEditorClient = new EmptyEditorClient;
+ pageClients.chromeClient = m_chromeClient.get();
+ pageClients.editorClient = emptyEditorClient;
+#if ENABLE(CONTEXT_MENUS)
+ static ContextMenuClient* emptyContextMenuClient = new EmptyContextMenuClient;
+ pageClients.contextMenuClient = emptyContextMenuClient;
+#endif
+#if ENABLE(DRAG_SUPPORT)
+ static DragClient* emptyDragClient = new EmptyDragClient;
+ pageClients.dragClient = emptyDragClient;
+#endif
+#if ENABLE(INSPECTOR)
+ static InspectorClient* emptyInspectorClient = new EmptyInspectorClient;
+ pageClients.inspectorClient = emptyInspectorClient;
+#endif
+
+ m_page = adoptPtr(new Page(pageClients));
+ m_page->settings()->setScriptEnabled(true);
+ m_page->settings()->setAllowScriptsToCloseWindows(true);
+
+ RefPtr<Frame> frame = Frame::create(m_page.get(), 0,
+ emptyFrameLoaderClient);
+ frame->setView(FrameView::create(frame.get()));
+ frame->init();
+ frame->view()->resize(m_client->contentSize());
+
+ CString htmlSource = m_client->htmlSource().utf8();
+ DocumentWriter* writer = frame->loader()->activeDocumentLoader()->writer();
+ m_client->writeDocument(*writer);
+
+ installDomFunction(frame.get());
+
+ webpage->d->setParentPopup(this);
+
+ return true;
+}
+
+static JSValueRef setValueAndClosePopupCallback(JSContextRef context,
+ JSObjectRef, JSObjectRef, size_t argumentCount,
+ const JSValueRef arguments[], JSValueRef*)
+{
+ JSValueRef jsRetVal = JSValueMakeUndefined(context);
+ if (argumentCount <= 0)
+ return jsRetVal;
+
+ JSStringRef string = JSValueToStringCopy(context, arguments[0], 0);
+ size_t sizeUTF8 = JSStringGetMaximumUTF8CStringSize(string);
+ WTF::Vector<char> strArgs(sizeUTF8 + 1);
+ strArgs[sizeUTF8] = 0;
+ JSStringGetUTF8CString(string, strArgs.data(), sizeUTF8);
+ JSStringRelease(string);
+ JSObjectRef popUpObject = JSValueToObject(context,
+ arguments[argumentCount - 1], 0);
+ PagePopupClient* client =
+ reinterpret_cast<PagePopupClient*>(JSObjectGetPrivate(popUpObject));
+
+ ASSERT(client);
+ client->setValueAndClosePopup(0, strArgs.data());
+
+ return jsRetVal;
+}
+
+static void popUpExtensionInitialize(JSContextRef context, JSObjectRef object)
+{
+ UNUSED_PARAM(context);
+ UNUSED_PARAM(object);
+}
+
+static void popUpExtensionFinalize(JSObjectRef object)
+{
+ UNUSED_PARAM(object);
+}
+
+static JSStaticFunction popUpExtensionStaticFunctions[] =
+{
+{ 0, 0, 0 },
+{ 0, 0, 0 }
+};
+
+static JSStaticValue popUpExtensionStaticValues[] =
+{
+{ 0, 0, 0, 0 }
+};
+
+void PagePopupBlackBerry::installDomFunction(Frame* frame)
+{
+ JSC::JSLock lock(JSC::SilenceAssertionsOnly);
+
+ JSDOMWindow* window = toJSDOMWindow(frame, mainThreadNormalWorld());
+ ASSERT(window);
+
+ JSC::ExecState* exec = window->globalExec();
+ ASSERT(exec);
+
+ JSContextRef context = ::toRef(exec);
+ JSObjectRef globalObject = JSContextGetGlobalObject(context);
+ JSStringRef functionName = JSStringCreateWithUTF8CString(
+ "setValueAndClosePopup");
+ JSObjectRef function = JSObjectMakeFunctionWithCallback(context,
+ functionName, setValueAndClosePopupCallback);
+ JSObjectSetProperty(context, globalObject, functionName, function,
+ kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly, 0);
+
+ // Register client into DOM
+ JSClassDefinition definition = kJSClassDefinitionEmpty;
+ definition.staticValues = popUpExtensionStaticValues;
+ definition.staticFunctions = popUpExtensionStaticFunctions;
+ definition.initialize = popUpExtensionInitialize;
+ definition.finalize = popUpExtensionFinalize;
+ JSClassRef clientClass = JSClassCreate(&definition);
+
+ JSObjectRef clientClassObject = JSObjectMake(context, clientClass, 0);
+ JSObjectSetPrivate(clientClassObject, reinterpret_cast<void*>(m_client.get()));
+
+ JSC::UString name("popUp");
+
+ JSC::PutPropertySlot slot;
+ window->put(window, exec, JSC::Identifier(exec, name),
+ toJS(clientClassObject), slot);
+
+ JSClassRelease(clientClass);
+}
+
+bool PagePopupBlackBerry::handleMouseEvent(PlatformMouseEvent& event)
+{
+ if (!m_page->mainFrame() || !m_page->mainFrame()->view())
+ return false;
+
+ switch (event.type()) {
+ case PlatformEvent::MouseMoved:
+ return m_page->mainFrame()->eventHandler()->handleMouseMoveEvent(event);
+ case PlatformEvent::MousePressed:
+ return m_page->mainFrame()->eventHandler()->handleMousePressEvent(event);
+ case PlatformEvent::MouseReleased:
+ return m_page->mainFrame()->eventHandler()->handleMouseReleaseEvent(event);
+ default:
+ return false;
+ }
+}
+
+void PagePopupBlackBerry::closePopup()
+{
+ closeWebPage();
+ m_client->didClosePopup();
+ m_webPagePrivate->client()->closePopupWebView();
+}
+
+void PagePopupBlackBerry::closeWebPage()
+{
+ if (!m_page)
+ return;
+
+ m_page->setGroupName(String());
+ m_page->mainFrame()->loader()->stopAllLoaders();
+ m_page->mainFrame()->loader()->stopLoading(UnloadEventPolicyNone);
+ m_page->mainFrame()->view()->clear();
+ m_page.clear();
+}
+}
+
diff --git a/Source/WebKit/blackberry/WebCoreSupport/PagePopupBlackBerry.h b/Source/WebKit/blackberry/WebCoreSupport/PagePopupBlackBerry.h
new file mode 100644
index 000000000..d5c72cee5
--- /dev/null
+++ b/Source/WebKit/blackberry/WebCoreSupport/PagePopupBlackBerry.h
@@ -0,0 +1,67 @@
+/*
+ * 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 PagePopupBlackBerry_h
+#define PagePopupBlackBerry_h
+
+#include "IntRect.h"
+#include "PagePopup.h"
+
+
+namespace BlackBerry {
+namespace WebKit {
+class WebPage;
+class WebPagePrivate;
+}
+}
+
+namespace WebCore {
+class Frame;
+class Page;
+class PagePopupChromeClient;
+class PagePopupClient;
+class PlatformMouseEvent;
+
+class PagePopupBlackBerry : public PagePopup {
+public:
+ PagePopupBlackBerry(BlackBerry::WebKit::WebPagePrivate*, PagePopupClient*, const IntRect&);
+ ~PagePopupBlackBerry();
+
+ void sendCreatePopupWebViewRequest();
+ bool init(BlackBerry::WebKit::WebPage*);
+ void closePopup();
+ void installDomFunction(Frame*);
+ void setRect();
+ void closeWebPage();
+
+ bool handleMouseEvent(PlatformMouseEvent&);
+
+
+private:
+ BlackBerry::WebKit::WebPagePrivate* m_webPagePrivate;
+ OwnPtr<PagePopupClient> m_client;
+ IntRect m_rect;
+ OwnPtr<WebCore::Page> m_page;
+ OwnPtr<PagePopupChromeClient> m_chromeClient;
+
+ friend class PagePopupChromeClient;
+};
+
+}
+
+#endif // PagePopupBlackBerry_h
diff --git a/Source/WebKit/blackberry/WebKitSupport/BackingStoreClient.cpp b/Source/WebKit/blackberry/WebKitSupport/BackingStoreClient.cpp
index c7de7716c..e7e4d6539 100644
--- a/Source/WebKit/blackberry/WebKitSupport/BackingStoreClient.cpp
+++ b/Source/WebKit/blackberry/WebKitSupport/BackingStoreClient.cpp
@@ -168,6 +168,9 @@ IntPoint BackingStoreClient::transformedAbsoluteLocation() const
IntPoint BackingStoreClient::scrollPosition() const
{
ASSERT(m_frame);
+ if (!m_frame->view())
+ return IntPoint();
+
return m_frame->view()->scrollPosition() - pointToSize(m_frame->view()->minimumScrollPosition());
}
@@ -178,7 +181,10 @@ IntPoint BackingStoreClient::transformedScrollPosition() const
void BackingStoreClient::setScrollPosition(const IntPoint& pos)
{
- ASSERT(m_frame->view());
+ ASSERT(m_frame);
+ if (!m_frame->view())
+ return;
+
if (pos == scrollPosition())
return;
@@ -196,7 +202,10 @@ void BackingStoreClient::setScrollPosition(const IntPoint& pos)
IntPoint BackingStoreClient::maximumScrollPosition() const
{
- ASSERT(m_frame->view());
+ ASSERT(m_frame);
+ if (!m_frame->view())
+ return IntPoint();
+
return m_frame->view()->maximumScrollPosition() - pointToSize(m_frame->view()->minimumScrollPosition());
}
@@ -220,7 +229,10 @@ IntSize BackingStoreClient::transformedActualVisibleSize() const
IntSize BackingStoreClient::viewportSize() const
{
- ASSERT(m_frame->view());
+ ASSERT(m_frame);
+ if (!m_frame->view())
+ return IntSize();
+
if (isMainFrame())
return m_webPage->d->viewportSize();
@@ -229,10 +241,13 @@ IntSize BackingStoreClient::viewportSize() const
IntSize BackingStoreClient::transformedViewportSize() const
{
+ ASSERT(m_frame);
+ if (!m_frame->view())
+ return IntSize();
+
if (isMainFrame())
return m_webPage->d->transformedViewportSize();
- ASSERT(m_frame->view());
const IntSize untransformedViewportSize = m_frame->view()->visibleContentRect().size();
const FloatPoint transformedBottomRight = m_webPage->d->m_transformationMatrix->mapPoint(
FloatPoint(untransformedViewportSize.width(), untransformedViewportSize.height()));
@@ -241,7 +256,10 @@ IntSize BackingStoreClient::transformedViewportSize() const
IntRect BackingStoreClient::visibleContentsRect() const
{
- ASSERT(m_frame->view());
+ ASSERT(m_frame);
+ if (!m_frame->view())
+ return IntRect();
+
IntRect visibleContentRect = m_frame->view()->visibleContentRect();
if (isMainFrame())
return visibleContentRect;
@@ -273,7 +291,10 @@ IntRect BackingStoreClient::transformedVisibleContentsRect() const
IntSize BackingStoreClient::contentsSize() const
{
- ASSERT(m_frame->view());
+ ASSERT(m_frame);
+ if (!m_frame->view())
+ return IntSize();
+
return m_frame->view()->contentsSize();
}
diff --git a/Source/WebKit/blackberry/WebKitSupport/SelectionHandler.cpp b/Source/WebKit/blackberry/WebKitSupport/SelectionHandler.cpp
index b65babaee..1d4cbb9a5 100644
--- a/Source/WebKit/blackberry/WebKitSupport/SelectionHandler.cpp
+++ b/Source/WebKit/blackberry/WebKitSupport/SelectionHandler.cpp
@@ -955,14 +955,14 @@ void SelectionHandler::caretPositionChanged()
// This function should only reach this point if input mode is active.
ASSERT(m_webPage->m_inputHandler->isInputMode());
+ WebCore::IntPoint frameOffset(m_webPage->frameOffset(m_webPage->focusedOrMainFrame()));
+ WebCore::IntRect clippingRectForContent(clippingRectForVisibleContent());
if (m_webPage->focusedOrMainFrame()->selection()->selectionType() == VisibleSelection::CaretSelection) {
- WebCore::IntPoint frameOffset = m_webPage->frameOffset(m_webPage->focusedOrMainFrame());
-
caretLocation = m_webPage->focusedOrMainFrame()->selection()->selection().visibleStart().absoluteCaretBounds();
caretLocation.move(frameOffset.x(), frameOffset.y());
// Clip against the containing frame and node boundaries.
- caretLocation.intersect(clippingRectForVisibleContent());
+ caretLocation.intersect(clippingRectForContent);
}
m_caretActive = !caretLocation.isEmpty();
@@ -976,6 +976,19 @@ void SelectionHandler::caretPositionChanged()
bool singleLineInput = !m_webPage->m_inputHandler->isMultilineInputMode();
WebCore::IntRect nodeBoundingBox = singleLineInput ? m_webPage->m_inputHandler->boundingBoxForInputField() : WebCore::IntRect();
+ if (!nodeBoundingBox.isEmpty()) {
+ nodeBoundingBox.move(frameOffset.x(), frameOffset.y());
+
+ // Clip against the containing frame and node boundaries.
+ nodeBoundingBox.intersect(clippingRectForContent);
+
+ nodeBoundingBox = m_webPage->mapToTransformed(nodeBoundingBox);
+ m_webPage->clipToTransformedContentsRect(nodeBoundingBox);
+ }
+
+ DEBUG_SELECTION(LogLevelInfo, "SelectionHandler::single line %s single line bounding box %d, %d, %dx%d",
+ singleLineInput ? "true" : "false", nodeBoundingBox.x(), nodeBoundingBox.y(), nodeBoundingBox.width(), nodeBoundingBox.height());
+
m_webPage->m_client->notifyCaretChanged(caretLocation, m_webPage->m_touchEventHandler->lastFatFingersResult().isTextInput() /* userTouchTriggered */, singleLineInput, nodeBoundingBox);
}
diff --git a/Source/WebKit/chromium/ChangeLog b/Source/WebKit/chromium/ChangeLog
index 4b8508c40..b373ff1c0 100644
--- a/Source/WebKit/chromium/ChangeLog
+++ b/Source/WebKit/chromium/ChangeLog
@@ -1,3 +1,1099 @@
+2012-05-11 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r116727.
+ http://trac.webkit.org/changeset/116727
+ https://bugs.webkit.org/show_bug.cgi?id=86181
+
+ Build error on Chromium-Android (Requested by tkent on
+ #webkit).
+
+ * public/WebMediaPlayer.h:
+ (WebMediaPlayer):
+ (WebKit::WebMediaPlayer::enterFullscreen):
+ (WebKit::WebMediaPlayer::exitFullscreen):
+ * src/WebMediaPlayerClientImpl.cpp:
+ (WebKit::WebMediaPlayerClientImpl::enterFullscreen):
+ (WebKit::WebMediaPlayerClientImpl::exitFullscreen):
+ * src/WebMediaPlayerClientImpl.h:
+ (WebMediaPlayerClientImpl):
+ * src/WebViewImpl.cpp:
+ (WebKit::WebViewImpl::enterFullScreenForElement):
+
+2012-05-11 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r116731.
+ http://trac.webkit.org/changeset/116731
+ https://bugs.webkit.org/show_bug.cgi?id=86178
+
+ Build failure on Chromium-mac (Requested by tkent on #webkit).
+
+ * tests/CCLayerTreeHostImplTest.cpp:
+ (WebKitTests::CCLayerTreeHostImplTest::CCLayerTreeHostImplTest):
+ (WebKitTests::TEST_F):
+ * tests/LayerRendererChromiumTest.cpp:
+ (FakeLayerRendererChromium::FakeLayerRendererChromium):
+ (LayerRendererChromiumTest::LayerRendererChromiumTest):
+ (TEST):
+
+2012-05-10 David Reveman <reveman@chromium.org>
+
+ [Chromium] Move instantiation of texture uploader to LayerRendererChromium.
+ https://bugs.webkit.org/show_bug.cgi?id=85893
+
+ Reviewed by Adrienne Walker.
+
+ * tests/CCLayerTreeHostImplTest.cpp:
+ (WebKitTests::CCLayerTreeHostImplTest::CCLayerTreeHostImplTest):
+ (WebKitTests::TEST_F):
+ * tests/LayerRendererChromiumTest.cpp:
+ (FakeLayerRendererChromium::FakeLayerRendererChromium):
+ (LayerRendererChromiumTest::LayerRendererChromiumTest):
+ (TEST):
+
+2012-05-10 Min Qin <qinmin@google.com>
+
+ split MediaPlayer::enterFullscreen into 2 seperate functions
+ https://bugs.webkit.org/show_bug.cgi?id=86052
+
+ Reviewed by Benjamin Poulain.
+
+ It is confusing that enterFullscreen returns a boolean while exitFullscreen does
+ not do the same. And ios does not need the return value.
+ So remove the return value on enterFullscreen and make a seperate canEnterFullscreen()
+ function for android.
+ No behavior change, just refactoring.
+
+ * public/WebMediaPlayer.h:
+ (WebMediaPlayer):
+ (WebKit::WebMediaPlayer::enterFullscreen):
+ (WebKit::WebMediaPlayer::canEnterFullscreen):
+ * src/WebMediaPlayerClientImpl.cpp:
+ (WebKit::WebMediaPlayerClientImpl::enterFullscreen):
+ (WebKit):
+ (WebKit::WebMediaPlayerClientImpl::exitFullscreen):
+ * src/WebMediaPlayerClientImpl.h:
+ (WebMediaPlayerClientImpl):
+ * src/WebViewImpl.cpp:
+ (WebKit::WebViewImpl::enterFullScreenForElement):
+
+2012-05-10 Hajime Morrita <morrita@google.com>
+
+ WebKit should support tab-size.
+ https://bugs.webkit.org/show_bug.cgi?id=52994
+
+ Reviewed by Simon Fraser.
+
+ * src/WebTextRun.cpp:
+ (WebKit::WebTextRun::operator WebCore::TextRun):
+
+2012-05-10 Kent Tamura <tkent@chromium.org>
+
+ Unreviewed, rolling out r116594.
+ http://trac.webkit.org/changeset/116594
+ https://bugs.webkit.org/show_bug.cgi?id=86013
+
+ r116594 might have made some composition tests flaky.
+
+ * tests/CCLayerTreeHostTest.cpp:
+ (WTF::CCLayerTreeHostTestTickAnimationWhileBackgrounded::animateLayers):
+ (WTF):
+ (WTF::TEST_F):
+
+2012-05-10 Jian Li <jianli@chromium.org>
+
+ Unreviewed. Fix chromium build break.
+
+ * src/LocalizedStrings.cpp:
+ (WebCore::insecurePluginVersionText):
+
+2012-05-10 Michael Nordman <michaeln@google.com>
+
+ [chromium] DomStorage events handling needs TLC (2)
+ https://bugs.webkit.org/show_bug.cgi?id=85221
+ Alter the WebStorageArea virtual interface such that the mutators no longer
+ return old values. This is to allow implementations of the interface to operate
+ more asynchronously.
+
+ Also clean up from the last patch, remove support for the DEPRECATED event
+ dispatching API.
+
+ Reviewed by Adam Barth.
+
+ * WebKit.gyp: delete three files indicated below
+ * public/WebStorageArea.h:
+ (WebKit::WebStorageArea::setItem): no longer returns the old value
+ (WebKit::WebStorageArea::removeItem): no longer returns the old value
+ (WebKit::WebStorageArea::clear): no longer returns a bool indicated if something was cleared
+ * public/WebStorageEventDispatcher.h: removed the DEPRECATED instance methods
+ * public/WebStorageNamespace.h: removed the DEPRECATED close() method
+ * public/platform/WebKitPlatformSupport.h: removed the DEPRECATED dispatchStorageEvent() method
+ * src/StorageAreaProxy.cpp: removed the DEPREACTED storageEvent() method
+ (WebCore::StorageAreaProxy::setItem): no return value
+ (WebCore::StorageAreaProxy::removeItem): no return value
+ (WebCore::StorageAreaProxy::clear): no return value
+ (WebCore::StorageAreaProxy::dispatchLocalStorageEvent): remove an early return thats no longer needed
+ (WebCore::findPageWithSessionStorageNamespace): switched to passing pageGroup by ptr value instead of by name
+ (WebCore::StorageAreaProxy::dispatchSessionStorageEvent): remove an early return thats no longer needed
+ * src/StorageAreaProxy.h:
+ (WebCore):
+ (StorageAreaProxy):
+ * src/StorageEventDispatcherImpl.cpp: Deleted the file.
+ * src/StorageEventDispatcherImpl.h: Deleted the file.
+ * src/WebStorageEventDispatcherImpl.cpp: Deleted the DEPRECATED instance methods.
+ (WebKit::WebStorageEventDispatcher::dispatchLocalStorageEvent): use WebViewImpl::defaultPageGroup
+ (WebKit::WebStorageEventDispatcher::dispatchSessionStorageEvent): use WebViewImpl::defaultPageGroup
+ * src/WebStorageEventDispatcherImpl.h: Deleted the file.
+ * src/WebViewImpl.cpp: added a static method to retrieve a ptr to the default page group,
+ (WebKit::WebViewImpl::defaultPageGroup):
+ * src/WebViewImpl.h:
+
+
+2012-05-10 Anders Carlsson <andersca@apple.com>
+
+ Add insecurePluginVersionText stub here too.
+
+ * src/LocalizedStrings.cpp:
+
+2012-05-10 Mark Pilgrim <pilgrim@chromium.org>
+
+ [Chromium] Call addTraceEvent and getTraceCategoryEnabledFlag directly
+ https://bugs.webkit.org/show_bug.cgi?id=85399
+
+ Reviewed by Adam Barth.
+
+ Part of a refactoring series. See tracking bug 82948.
+
+ * src/PlatformSupport.cpp:
+ (WebCore):
+
+2012-05-10 Mark Pilgrim <pilgrim@chromium.org>
+
+ [Chromium] Remove WEBKIT_USING_SKIA ifdefs that are always true
+ https://bugs.webkit.org/show_bug.cgi?id=86121
+
+ Reviewed by Adam Barth.
+
+ Chromium always uses Skia now, so this just removes the barriers
+ around code that was previously #if'd.
+
+ * README:
+ * src/DragClientImpl.cpp:
+ (WebKit::DragClientImpl::startDrag):
+ * src/PageOverlay.cpp:
+ * src/PlatformSupport.cpp:
+ (WebCore::PlatformSupport::clipboardWriteImage):
+ (WebCore::PlatformSupport::paintScrollbarThumb):
+ * src/WebContentLayerImpl.cpp:
+ (WebKit::WebContentLayerImpl::paintContents):
+ * src/WebFontImpl.cpp:
+ (WebKit::WebFontImpl::drawText):
+ * src/WebFrameImpl.cpp:
+ (WebKit::WebFrameImpl::printPage):
+ (WebKit::WebFrameImpl::printPagesWithBoundaries):
+ * src/WebGraphicsContext3D.cpp:
+ (WebKit::WebGraphicsContext3D::createGrGLInterface):
+ * src/WebImageDecoder.cpp:
+ (WebKit::WebImageDecoder::getFrameAtIndex):
+ * src/WebPluginContainerImpl.cpp:
+ (WebKit::WebPluginContainerImpl::paint):
+ (WebKit::WebPluginContainerImpl::printPage):
+ * src/painting/GraphicsContextBuilder.h:
+ (WebKit):
+
+2012-05-10 Tom Sepez <tsepez@chromium.org>
+
+ [Chromium] WebFrameTest.ChromePageNoJavascript isn't catching regressions
+ https://bugs.webkit.org/show_bug.cgi?id=86046
+
+ Reviewed by Adam Barth.
+
+ Test both cases for registerURLSchemeAsNotAllowingJavascriptURLs. Also add
+ a call to layout() to ensure the javascript result is seen.
+
+ * tests/WebFrameTest.cpp:
+ (WebKit::TEST_F):
+ (WebKit):
+
+2012-05-10 Varun Jain <varunjain@google.com>
+
+ [chromium] Trigger context menu for long press gesture
+ https://bugs.webkit.org/show_bug.cgi?id=85919
+
+ Reviewed by Adam Barth.
+
+ * src/PageWidgetDelegate.cpp:
+ (WebKit::PageWidgetDelegate::handleInputEvent):
+ * src/WebViewImpl.cpp:
+ (WebKit::WebViewImpl::handleGestureEvent):
+
+2012-05-10 Mark Pilgrim <pilgrim@chromium.org>
+
+ [Chromium] Remove dead code behind unused WEBKIT_USING_CG
+ https://bugs.webkit.org/show_bug.cgi?id=86018
+
+ Reviewed by Adam Barth.
+
+ We never use CoreGraphics as the backend for GraphicsContext in
+ Chromium, so this is all dead code.
+
+ * README:
+ * src/PageOverlay.cpp:
+ * src/WebContentLayerImpl.cpp:
+ (WebKit::WebContentLayerImpl::paintContents):
+ * src/WebFontImpl.cpp:
+ (WebKit::WebFontImpl::drawText):
+ * src/WebImageDecoder.cpp:
+ (WebKit::WebImageDecoder::getFrameAtIndex):
+ * src/WebPluginContainerImpl.cpp:
+ (WebKit::WebPluginContainerImpl::paint):
+ (WebKit::WebPluginContainerImpl::printPage):
+ * src/painting/GraphicsContextBuilder.h:
+ (WebKit):
+
+2012-05-10 Sam D <dsam2912@gmail.com>
+
+ Web Inspector: rename InspectorBackendStub.js to InspectorBackendCommands.js
+ https://bugs.webkit.org/show_bug.cgi?id=72306
+
+ Changed name for InspectorBackendStub.js to InspectorBackendCommands.js
+
+ Reviewed by Yury Semikhatsky.
+
+ * WebKit.gyp:
+
+2012-05-09 Kent Tamura <tkent@chromium.org>
+
+ [Chromium] Mark CCLayerTreeHostTestSetNeedsCommit2.runMultiThread and
+ CCLayerTreeHostTestDoNotSkipLayersWithAnimatedOpacity.runMultiThread flaky.
+
+ * tests/CCLayerTreeHostTest.cpp:
+
+2012-05-09 Dan Alcantara <dfalcantara@chromium.org>
+
+ [chromium] Add ability to override user agent string per-WebFrameClient
+ https://bugs.webkit.org/show_bug.cgi?id=83959
+
+ Reviewed by Adam Barth.
+
+ Adds a method that can be used to override the normal user agent in
+ chromium. Also adds a unit test to check if the override is taking effect.
+
+ * WebKit.gypi:
+ * public/WebFrameClient.h:
+ (WebFrameClient):
+ (WebKit::WebFrameClient::userAgent):
+ * src/FrameLoaderClientImpl.cpp:
+ (WebKit::FrameLoaderClientImpl::userAgent):
+ * tests/FrameLoaderClientImplTest.cpp: Added.
+ (WebKit):
+ (TestWebFrameClient):
+ (WebKit::TestWebFrameClient::setUserAgentOverride):
+ (FrameLoaderClientImplTest):
+ (WebKit::FrameLoaderClientImplTest::SetUp):
+ (WebKit::FrameLoaderClientImplTest::TearDown):
+ (WebKit::FrameLoaderClientImplTest::setUserAgentOverride):
+ (WebKit::FrameLoaderClientImplTest::userAgent):
+ (WebKit::TEST_F):
+
+2012-05-09 Charlie Reis <creis@chromium.org>
+
+ Add dispatchMessageEventWithOriginCheck to WebFrame
+ https://bugs.webkit.org/show_bug.cgi?id=85815
+
+ Reviewed by Adam Barth.
+
+ Tested by WebFrameTest.DispatchMessageEventWithOriginCheck.
+ Also fixes source frame bug in willCheckAndDispatchMessageEvent.
+
+ * public/WebFrame.h:
+ (WebFrame):
+ * src/FrameLoaderClientImpl.cpp:
+ (WebKit::FrameLoaderClientImpl::willCheckAndDispatchMessageEvent):
+ * src/WebFrameImpl.cpp:
+ (WebKit::WebFrameImpl::checkAndDispatchMessageEvent):
+ (WebKit):
+ * src/WebFrameImpl.h:
+ (WebFrameImpl):
+
+2012-05-09 Hironori Bono <hbono@chromium.org>
+
+ Fix a crash in ContextMenuClientImpl::getCustomMenuFromDefaultItems
+ https://bugs.webkit.org/show_bug.cgi?id=85866
+
+ Reviewed by Ryosuke Niwa.
+
+ DocumentMarkerController::markersInRange crashes if the input range is NULL.
+ This change adds a NULL check before getCustomMenuFromDefaultItems() calls this
+ function to avoid this crash.
+
+ * src/ContextMenuClientImpl.cpp:
+ (WebKit::ContextMenuClientImpl::getCustomMenuFromDefaultItems): Added a NULL check.
+
+2012-05-09 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r116602.
+ http://trac.webkit.org/changeset/116602
+ https://bugs.webkit.org/show_bug.cgi?id=86057
+
+ Build error on Windows (Requested by tkent on #webkit).
+
+ * WebKit.gypi:
+ * public/WebFrameClient.h:
+ * src/FrameLoaderClientImpl.cpp:
+ (WebKit::FrameLoaderClientImpl::userAgent):
+ * tests/FrameLoaderClientImplTest.cpp: Removed.
+
+2012-05-09 Kent Tamura <tkent@chromium.org>
+
+ [Chromium] Fix compilation warning on Android.
+ https://bugs.webkit.org/show_bug.cgi?id=85958
+
+ * features.gypi: Move ENABLE_MEDIA_CAPTURE=0 to non-Android block.
+
+2012-05-09 Dan Alcantara <dfalcantara@chromium.org>
+
+ [chromium] Add ability to override user agent string per-WebFrameClient
+ https://bugs.webkit.org/show_bug.cgi?id=83959
+
+ Reviewed by Adam Barth.
+
+ Adds a method that can be used to override the normal user agent in
+ chromium. Also adds a unit test to check if the override is taking effect.
+
+ * WebKit.gypi:
+ * public/WebFrameClient.h:
+ (WebFrameClient):
+ (WebKit::WebFrameClient::userAgent):
+ * src/FrameLoaderClientImpl.cpp:
+ (WebKit::FrameLoaderClientImpl::userAgent):
+ * tests/FrameLoaderClientImplTest.cpp: Added.
+ (WebKit):
+ (TestWebFrameClient):
+ (WebKit::TestWebFrameClient::setUserAgentOverride):
+ (FrameLoaderClientImplTest):
+ (WebKit::FrameLoaderClientImplTest::SetUp):
+ (WebKit::FrameLoaderClientImplTest::TearDown):
+ (WebKit::FrameLoaderClientImplTest::setUserAgentOverride):
+ (WebKit::FrameLoaderClientImplTest::userAgent):
+ (WebKit::TEST_F):
+
+2012-05-09 Ian Vollick <vollick@chromium.org>
+
+ [chromium] Ensure animations get ticked at least once when added.
+ https://bugs.webkit.org/show_bug.cgi?id=86013
+
+ Reviewed by James Robinson.
+
+ * tests/CCLayerTreeHostTest.cpp:
+ (WTF::CCLayerTreeHostTestTickAnimationWhileBackgrounded::animateLayers):
+ (WTF):
+
+2012-05-09 Adam Barth <abarth@webkit.org>
+
+ Implement HTML Media Capture
+ https://bugs.webkit.org/show_bug.cgi?id=85958
+
+ Reviewed by Eric Seidel.
+
+ * features.gypi:
+ * public/WebFileChooserParams.h:
+ (WebFileChooserParams):
+ * src/ChromeClientImpl.cpp:
+ (WebKit::ChromeClientImpl::runOpenPanel):
+
+2012-05-09 Dana Jansens <danakj@chromium.org>
+
+ [chromium] Don't draw when canDraw() is false
+ https://bugs.webkit.org/show_bug.cgi?id=85829
+
+ Reviewed by Adrienne Walker.
+
+ * tests/CCLayerTreeHostImplTest.cpp:
+ (WebKitTests::CCLayerTreeHostImplTest::CCLayerTreeHostImplTest):
+ (WebKitTests::TEST_F):
+ * tests/CCLayerTreeHostTest.cpp:
+ (WTF):
+ (CCLayerTreeHostTestCanDrawBlocksDrawing):
+ (WTF::CCLayerTreeHostTestCanDrawBlocksDrawing::CCLayerTreeHostTestCanDrawBlocksDrawing):
+ (WTF::CCLayerTreeHostTestCanDrawBlocksDrawing::beginTest):
+ (WTF::CCLayerTreeHostTestCanDrawBlocksDrawing::commitCompleteOnCCThread):
+ (WTF::CCLayerTreeHostTestCanDrawBlocksDrawing::drawLayersOnCCThread):
+ (WTF::CCLayerTreeHostTestCanDrawBlocksDrawing::didCommitAndDrawFrame):
+ (WTF::CCLayerTreeHostTestCanDrawBlocksDrawing::afterTest):
+ (WTF::TEST_F):
+
+2012-05-09 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r116573.
+ http://trac.webkit.org/changeset/116573
+ https://bugs.webkit.org/show_bug.cgi?id=86038
+
+ Broke the Chromium Mac compile (Requested by ojan_gardening on
+ #webkit).
+
+ * public/WebPlugin.h:
+ (WebPlugin):
+
+2012-05-09 Fady Samuel <fsamuel@chromium.org>
+
+ [Chromium] Expose WebPluginContainer of WebPlugin to embedder
+ https://bugs.webkit.org/show_bug.cgi?id=85916
+
+ Reviewed by Darin Fisher.
+
+ The browser plugin needs to access its current guest's WebPluginContainer
+ so that it can replace the guest with another guest WebPlugin when navigating
+ across processes.
+
+ * public/WebPlugin.h:
+ (WebPlugin):
+ (WebKit::WebPlugin::container):
+
+2012-05-09 Mark Pilgrim <pilgrim@chromium.org>
+
+ [Chromium] Move clipboard to Platform.h
+ https://bugs.webkit.org/show_bug.cgi?id=85758
+
+ Reviewed by Adam Barth.
+
+ Part of a refactoring series. See tracking bug 82948.
+
+ * WebKit.gyp:
+ * public/platform/WebClipboard.h:
+ * public/platform/WebDragData.h:
+ * public/platform/WebImage.h:
+ * public/platform/WebKitPlatformSupport.h:
+ (WebKit):
+ (WebKitPlatformSupport):
+ * src/AssertMatchingEnums.cpp:
+ * src/DragClientImpl.cpp:
+ * src/PlatformSupport.cpp:
+ * src/WebDragData.cpp:
+ * src/WebImageCG.cpp:
+ * src/WebImageDecoder.cpp:
+ * src/WebImageSkia.cpp:
+ * src/WebPluginContainerImpl.cpp:
+ (WebKit::WebPluginContainerImpl::copy):
+ * src/WebViewImpl.cpp:
+
+2012-05-09 Mark Pilgrim <pilgrim@chromium.org>
+
+ [Chromium] Remove PlatformSupport::loadPlatformImageResource, call loadResource directly
+ https://bugs.webkit.org/show_bug.cgi?id=84417
+
+ Reviewed by Adam Barth.
+
+ Part of a refactoring series. See tracking bug 82948.
+
+ * src/PlatformSupport.cpp:
+ (WebCore):
+
+2012-05-09 Jochen Eisinger <jochen@chromium.org>
+
+ [chromium] remove the obsolete WebFrame::referrerPolicy method
+ https://bugs.webkit.org/show_bug.cgi?id=86003
+
+ Reviewed by Adam Barth.
+
+ * public/WebFrame.h:
+ * src/WebFrameImpl.cpp:
+ * src/WebFrameImpl.h:
+ (WebFrameImpl):
+
+2012-05-09 Jochen Eisinger <jochen@chromium.org>
+
+ [chromium] Check whether an active document loader exists before accessing it
+ https://bugs.webkit.org/show_bug.cgi?id=85892
+
+ Reviewed by Eric Seidel.
+
+ Although FrameLoader::loadInSameDocument which invokes this
+ method does not have a provisional document loader, we're seeing crashes
+ where the FrameLoader is in provisional state, and thus
+ activeDocumentLoader returns 0. Lacking any understanding of how this
+ can happen, we do this check here to avoid crashing.
+
+ * src/FrameLoaderClientImpl.cpp:
+ (WebKit::FrameLoaderClientImpl::dispatchDidNavigateWithinPage):
+
+2012-05-09 Ian Vollick <vollick@chromium.org>
+
+ [chromium] Add impl-thread support for fill-mode and direction css animation properties
+ https://bugs.webkit.org/show_bug.cgi?id=77662
+
+ Reviewed by James Robinson.
+
+ * tests/CCActiveAnimationTest.cpp:
+ (WebCore::TEST):
+ (WebCore):
+ * tests/CCLayerAnimationControllerTest.cpp:
+ (WebKitTests::TEST):
+ (WebKitTests):
+
+2012-05-09 Ojan Vafai <ojan@chromium.org>
+
+ Unreviewed. Rolled DEPS.
+
+ * DEPS:
+
+2012-05-09 Marcus Bulach <bulach@chromium.org>
+
+ [chromium] Exposes OrientationChangeEvent.
+ https://bugs.webkit.org/show_bug.cgi?id=85976
+
+ Reviewed by Adam Barth.
+
+ This is used by the android port, we need to expose the existing
+ WebCore API.
+
+ * public/WebFrame.h:
+ (WebFrame):
+ * src/WebFrameImpl.cpp:
+ (WebKit::WebFrameImpl::sendOrientationChangeEvent):
+ (WebKit):
+ * src/WebFrameImpl.h:
+ (WebFrameImpl):
+
+2012-05-09 Dana Jansens <danakj@chromium.org>
+
+ Early-out and avoid any copying when possible for Region operations
+ https://bugs.webkit.org/show_bug.cgi?id=85260
+
+ Reviewed by Anders Carlsson.
+
+ * tests/RegionTest.cpp:
+ (WebCore::TEST):
+ (WebCore):
+
+2012-05-09 Tommy Widenflycht <tommyw@google.com>
+
+ [chromium] MediaStream API: Fixing a memory leak in WebUserMediaRequest
+ https://bugs.webkit.org/show_bug.cgi?id=85992
+
+ Reviewed by Adam Barth.
+
+ * src/WebUserMediaRequest.cpp:
+ (WebKit::WebUserMediaRequest::assign):
+
+2012-05-09 Kent Tamura <tkent@chromium.org>
+
+ [Chromium] Disable WebViewTest.TextInputType because the test is incomplete.
+
+ * tests/WebViewTest.cpp:
+
+2012-05-09 Kent Tamura <tkent@chromium.org>
+
+ [Chromium] Some of *.runMultiThread tests intermittently crash.
+ Mark them flaky.
+
+ * tests/CCLayerTreeHostTest.cpp:
+
+2012-05-09 Oli Lan <olilan@chromium.org>
+
+ Adds date/time input types to WebTextInputType, and adds support for these
+ to WebViewImpl.textInputType().
+
+ Adds a new test WebViewTest.TextInputType to test WebViewImpl.textInputType(),
+ including the new types.
+
+ https://bugs.webkit.org/show_bug.cgi?id=78746
+
+ Reviewed by Kent Tamura.
+
+ * public/WebTextInputType.h:
+ * src/WebViewImpl.cpp:
+ (WebKit::WebViewImpl::textInputType):
+ * tests/WebViewTest.cpp:
+ (WebViewTest):
+ (WebKit::WebViewTest::testTextInputType):
+ (WebKit):
+ (WebKit::TEST_F):
+ * tests/data/input_field_date.html: Added.
+ * tests/data/input_field_datetime.html: Added.
+ * tests/data/input_field_default.html: Added.
+ * tests/data/input_field_email.html: Added.
+ * tests/data/input_field_number.html: Added.
+ * tests/data/input_field_search.html: Added.
+ * tests/data/input_field_time.html: Added.
+ * tests/data/input_field_week.html: Added.
+
+2012-05-08 Jochen Eisinger <jochen@chromium.org>
+
+ Unreviewed. Rolled DEPS.
+
+ * DEPS:
+
+2012-05-08 Dana Jansens <danakj@chromium.org>
+
+ [chromium] Show borders for partial-draw-culled quads to visualize culling behaviour
+ https://bugs.webkit.org/show_bug.cgi?id=85414
+
+ Reviewed by Adrienne Walker.
+
+ * tests/CCQuadCullerTest.cpp:
+ (WebCore::appendQuads):
+ * tests/MockCCQuadCuller.h:
+ (WebCore::MockCCQuadCuller::MockCCQuadCuller):
+
+2012-05-08 Tony Chang <tony@chromium.org>
+
+ [chromium] force ENABLE_REGISTER_PROTOCOL_HANDLER=1 in features.gypi
+ https://bugs.webkit.org/show_bug.cgi?id=85924
+
+ Reviewed by Adam Barth.
+
+ This has been enabled for a few months on Chromium trunk so remove the
+ ability to turn it off via a gyp flag. This simplifies features.gypi.
+
+ * features.gypi:
+
+2012-05-08 Dana Jansens <danakj@chromium.org>
+
+ [chromium] Reflections with masks should not occlude
+ https://bugs.webkit.org/show_bug.cgi?id=85927
+
+ Reviewed by James Robinson.
+
+ * tests/CCOcclusionTrackerTest.cpp:
+ (WebKitTests::CCOcclusionTrackerTest::TearDown):
+ (WebKitTests::CCOcclusionTrackerTest::createMaskLayer):
+ (CCOcclusionTrackerTest):
+ (WebKitTests::CCOcclusionTrackerTest::setMask):
+ (CCOcclusionTrackerTestReplicaWithMask):
+ (WebKitTests::CCOcclusionTrackerTestReplicaWithMask::runMyTest):
+ (WebKitTests):
+
+2012-05-08 Dana Jansens <danakj@chromium.org>
+
+ Region reads past end of spans
+ https://bugs.webkit.org/show_bug.cgi?id=85909
+
+ Reviewed by Anders Carlsson.
+
+ * tests/RegionTest.cpp:
+ (WebCore::TEST):
+ (WebCore):
+
+2012-05-08 Tony Chang <tony@chromium.org>
+
+ move listener_leak_test to webkit_unit_tests
+ https://bugs.webkit.org/show_bug.cgi?id=85922
+
+ Reviewed by Ojan Vafai.
+
+ Porting the test from src/webkit/tools/test_shell/listener_leak_test.cc.
+ All I did was change the style and use the FrameTestHelper to load the file.
+
+ * WebKit.gyp: Exclude file in components build.
+ * WebKit.gypi: Add new file.
+ * tests/ListenerLeakTest.cpp: Added.
+ (WebKit):
+ (WebKit::GetProperty):
+ (WebKit::GetNumObjects):
+ (ListenerLeakTest):
+ (WebKit::ListenerLeakTest::ListenerLeakTest):
+ (WebKit::ListenerLeakTest::RunTest):
+ (WebKit::TEST_F):
+ * tests/data/listener/listener_leak1.html: Added.
+ * tests/data/listener/listener_leak2.html: Added.
+
+2012-05-08 W. James MacLean <wjmaclean@chromium.org>
+
+ [chromium] Create LinkHighlightLayerChromium class to provide link-highlight preview animations for GraphicsLayerChromium.
+ https://bugs.webkit.org/show_bug.cgi?id=85084
+
+ Reviewed by James Robinson.
+
+ * WebKit.gypi:
+ * tests/LinkHighlightTest.cpp: Added.
+ (WebCore):
+ (MockGraphicsLayerClient):
+ (WebCore::MockGraphicsLayerClient::notifyAnimationStarted):
+ (WebCore::MockGraphicsLayerClient::notifySyncRequired):
+ (WebCore::MockGraphicsLayerClient::paintContents):
+ (WebCore::MockGraphicsLayerClient::showDebugBorders):
+ (WebCore::MockGraphicsLayerClient::showRepaintCounter):
+ (WebCore::TEST):
+
+2012-05-08 Tony Chang <tony@chromium.org>
+
+ [chromium] move event_listener_unittest to webkit_unit_tests
+ https://bugs.webkit.org/show_bug.cgi?id=85836
+
+ Reviewed by James Robinson.
+
+ Porting the test from src/webkit/tools/test_shell/event_listener_unittest.cc.
+ All I did was change the style and use the FrameTestHelper to load the file.
+
+ * WebKit.gyp: Exclude file in components build.
+ * WebKit.gypi: Add new file.
+ * tests/EventListenerTest.cpp: Added.
+ (WebKit):
+ (TestWebDOMEventListener):
+ (WebKit::TestWebDOMEventListener::TestWebDOMEventListener):
+ (WebKit::TestWebDOMEventListener::~TestWebDOMEventListener):
+ (WebKit::TestWebDOMEventListener::eventCount):
+ (WebKit::TestWebDOMEventListener::eventAt):
+ (WebKit::TestWebDOMEventListener::clearEvents):
+ (WebDOMEventListenerTest):
+ (WebKit::WebDOMEventListenerTest::WebDOMEventListenerTest):
+ (WebKit::WebDOMEventListenerTest::SetUp):
+ (WebKit::WebDOMEventListenerTest::TearDown):
+ (WebKit::WebDOMEventListenerTest::mainFrame):
+ (WebKit::WebDOMEventListenerTest::document):
+ (WebKit::WebDOMEventListenerTest::executeScript):
+ (WebKit::WebDOMEventListenerTest::GetNodeID):
+ (WebKit::TEST_F):
+ * tests/data/listener/mutation_event_listener.html: Added.
+
+2012-05-07 Kinuko Yasuda <kinuko@chromium.org>
+
+ Unreviewed build fix: didOpenFileSystem hides overloaded virtual function
+
+ * src/WorkerAsyncFileSystemChromium.cpp:
+
+2012-05-07 Kinuko Yasuda <kinuko@chromium.org>
+
+ Unreviewed build fix: adding missing include.
+
+ * src/AsyncFileSystemChromium.cpp:
+
+2012-05-07 Kinuko Yasuda <kinuko@chromium.org>
+
+ Support cross-filesystem operations in FileSystem API
+ https://bugs.webkit.org/show_bug.cgi?id=84135
+
+ Reviewed by David Levin.
+
+ Currently we pass Entry's fullPath to AsyncFileSystem layer where
+ we convert the given path to filesystem URL which includes origin and
+ filesystem type information, but in that way we cannot handle
+ cross-filesystem operations (e.g. cross-filesystem copy and move)
+ well since we end up with always attaching the source filesystem's
+ origin and type information for argument paths.
+
+ This patch does:
+ - move filesystem-type related code out of AsyncFileSystemChromium.cpp
+ (moving into DOMFileSystemChromium.cpp)
+ - change AsyncFileSystemChromium's methods implementation not to take
+ entry paths but complete filesystem URLs.
+
+ * src/AsyncFileSystemChromium.cpp:
+ (WebCore::AsyncFileSystemChromium::AsyncFileSystemChromium):
+ (WebCore::AsyncFileSystemChromium::move):
+ (WebCore::AsyncFileSystemChromium::copy):
+ (WebCore::AsyncFileSystemChromium::remove):
+ (WebCore::AsyncFileSystemChromium::removeRecursively):
+ (WebCore::AsyncFileSystemChromium::readMetadata):
+ (WebCore::AsyncFileSystemChromium::createFile):
+ (WebCore::AsyncFileSystemChromium::createDirectory):
+ (WebCore::AsyncFileSystemChromium::fileExists):
+ (WebCore::AsyncFileSystemChromium::directoryExists):
+ (WebCore::AsyncFileSystemChromium::readDirectory):
+ (WebCore::AsyncFileSystemChromium::createWriter):
+ (WebCore::AsyncFileSystemChromium::createSnapshotFileAndReadMetadata):
+ * src/AsyncFileSystemChromium.h:
+ (WebCore::AsyncFileSystemChromium::create):
+ (AsyncFileSystemChromium):
+ * src/LocalFileSystemChromium.cpp:
+ (WebCore::openFileSystemHelper):
+ * src/PlatformSupport.cpp:
+ (WebCore::PlatformSupport::createAsyncFileSystem):
+ * src/WebFileSystemCallbacksImpl.cpp:
+ (WebKit::WebFileSystemCallbacksImpl::WebFileSystemCallbacksImpl):
+ (WebKit::WebFileSystemCallbacksImpl::didOpenFileSystem):
+ * src/WebFileSystemCallbacksImpl.h:
+ (WebFileSystemCallbacksImpl):
+ * src/WebFrameImpl.cpp:
+ (WebKit::WebFrameImpl::createFileSystem):
+ (WebKit::WebFrameImpl::createFileEntry):
+ * src/WorkerAsyncFileSystemChromium.cpp:
+ (WebCore::WorkerAsyncFileSystemChromium::WorkerAsyncFileSystemChromium):
+ (WebCore::WorkerAsyncFileSystemChromium::move):
+ (WebCore::WorkerAsyncFileSystemChromium::copy):
+ (WebCore::WorkerAsyncFileSystemChromium::remove):
+ (WebCore::WorkerAsyncFileSystemChromium::removeRecursively):
+ (WebCore::WorkerAsyncFileSystemChromium::readMetadata):
+ (WebCore::WorkerAsyncFileSystemChromium::createFile):
+ (WebCore::WorkerAsyncFileSystemChromium::createDirectory):
+ (WebCore::WorkerAsyncFileSystemChromium::fileExists):
+ (WebCore::WorkerAsyncFileSystemChromium::directoryExists):
+ (WebCore::WorkerAsyncFileSystemChromium::readDirectory):
+ (WebCore::WorkerAsyncFileSystemChromium::createWriter):
+ (WebCore::WorkerAsyncFileSystemChromium::createSnapshotFileAndReadMetadata):
+ * src/WorkerAsyncFileSystemChromium.h:
+ (WebCore::WorkerAsyncFileSystemChromium::create):
+ (WorkerAsyncFileSystemChromium):
+
+2012-05-07 Greg Billock <gbillock@google.com>
+
+ [Web Intents] Flagged-off implementation of an intent tag for registration.
+ https://bugs.webkit.org/show_bug.cgi?id=73039
+
+ Reviewed by Adam Barth.
+
+ The intent tag allows web pages to mark themselves declaratively as accepting
+ web intent delivery of particular characteristics (action/type).
+ See the spec at:
+ http://dvcs.w3.org/hg/web-intents/raw-file/tip/spec/Overview.html
+
+ * WebKit.gyp:
+ * src/FrameLoaderClientImpl.cpp:
+ (WebKit::FrameLoaderClientImpl::registerIntentService):
+ * src/FrameLoaderClientImpl.h:
+
+2012-05-07 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r116375.
+ http://trac.webkit.org/changeset/116375
+ https://bugs.webkit.org/show_bug.cgi?id=85850
+
+ Build break on Chromium-win and Chromium-mac. (Requested by
+ tkent on #webkit).
+
+ * WebKit.gyp:
+ * WebKit.gypi:
+ * tests/EventListenerTest.cpp: Removed.
+ * tests/data/listener/mutation_event_listener.html: Removed.
+
+2012-05-07 Dana Jansens <danakj@chromium.org>
+
+ Region::intersects() and Region::contains() are slow due to copy overhead
+ https://bugs.webkit.org/show_bug.cgi?id=81076
+
+ Reviewed by Anders Carlsson.
+
+ * tests/RegionTest.cpp:
+ (WebCore):
+ (WebCore::TEST):
+
+2012-05-07 Tony Chang <tony@chromium.org>
+
+ [chromium] move event_listener_unittest to webkit_unit_tests
+ https://bugs.webkit.org/show_bug.cgi?id=85836
+
+ Reviewed by James Robinson.
+
+ Porting the test from src/webkit/tools/test_shell/event_listener_unittest.cc.
+ All I did was change the style and use the FrameTestHelper to load the file.
+
+ * WebKit.gyp: Exclude file in components build.
+ * WebKit.gypi: Add new file.
+ * tests/EventListenerTest.cpp: Added.
+ (WebKit):
+ (TestWebDOMEventListener):
+ (WebKit::TestWebDOMEventListener::TestWebDOMEventListener):
+ (WebKit::TestWebDOMEventListener::~TestWebDOMEventListener):
+ (WebKit::TestWebDOMEventListener::eventCount):
+ (WebKit::TestWebDOMEventListener::eventAt):
+ (WebKit::TestWebDOMEventListener::clearEvents):
+ (WebDOMEventListenerTest):
+ (WebKit::WebDOMEventListenerTest::WebDOMEventListenerTest):
+ (WebKit::WebDOMEventListenerTest::SetUp):
+ (WebKit::WebDOMEventListenerTest::TearDown):
+ (WebKit::WebDOMEventListenerTest::mainFrame):
+ (WebKit::WebDOMEventListenerTest::document):
+ (WebKit::WebDOMEventListenerTest::executeScript):
+ (WebKit::WebDOMEventListenerTest::GetNodeID):
+ (WebKit::TEST_F):
+ * tests/data/listener/mutation_event_listener.html: Added.
+
+2012-05-07 Julien Chaffraix <jchaffraix@webkit.org>
+
+ Refactor windowClipRectForLayer to remove the explicit RenderLayer dependency
+ https://bugs.webkit.org/show_bug.cgi?id=84090
+
+ Reviewed by David Hyatt.
+
+ * src/WebPluginContainerImpl.cpp:
+ Updated after windowClipRectForLayer name and signature change.
+
+2012-05-07 Dana Jansens <danakj@chromium.org>
+
+ [chromium] Ensure synchronization in threaded unit tests by checking the sourceFrameNumber() to count commits
+ https://bugs.webkit.org/show_bug.cgi?id=85390
+
+ Reviewed by Adrienne Walker.
+
+ * tests/CCLayerTreeHostTest.cpp:
+ (WTF::CCLayerTreeHostTestScrollMultipleRedraw::beginCommitOnCCThread):
+ (WTF::CCLayerTreeHostTestAtomicCommit::commitCompleteOnCCThread):
+ (WTF::CCLayerTreeHostTestAtomicCommitWithPartialUpdate::commitCompleteOnCCThread):
+ (WTF::CCLayerTreeHostTestScrollChildLayer::beginCommitOnCCThread):
+
+2012-05-07 Adrienne Walker <enne@google.com>
+
+ [chromium] Allow for asymmetric tile sizes on composited tiled layers
+ https://bugs.webkit.org/show_bug.cgi?id=85687
+
+ Reviewed by James Robinson.
+
+ Update tests for new constructor and function args. Add a few more
+ tests that use non-square tile sizes.
+
+ * tests/TilingDataTest.cpp:
+ (WebCore::TestTiling::TestTiling):
+ (WebCore::TEST):
+ (WebCore):
+
+2012-05-07 David Reveman <reveman@chromium.org>
+
+ [Chromium] Use GL_CHROMIUM_command_buffer_query to throttle texture uploads.
+ https://bugs.webkit.org/show_bug.cgi?id=81004
+
+ Reviewed by Adrienne Walker.
+
+ * WebKit.gypi:
+ * tests/CCLayerTreeHostImplTest.cpp:
+ (WebKitTests::TEST_F):
+ * tests/CCTiledLayerTestCommon.h:
+ (WebKitTests::FakeTextureUploader::isBusy):
+ (WebKitTests::FakeTextureUploader::beginUploads):
+ (WebKitTests::FakeTextureUploader::endUploads):
+ * tests/Canvas2DLayerChromiumTest.cpp:
+ * tests/LayerRendererChromiumTest.cpp:
+ (FakeLayerRendererChromium::FakeLayerRendererChromium):
+ (LayerRendererChromiumTest::LayerRendererChromiumTest):
+ (TEST):
+ * tests/ThrottledTextureUploaderTest.cpp: Added.
+ (WebKit):
+ (FakeWebGraphicsContext3DWithQueryTesting):
+ (WebKit::FakeWebGraphicsContext3DWithQueryTesting::FakeWebGraphicsContext3DWithQueryTesting):
+ (WebKit::FakeWebGraphicsContext3DWithQueryTesting::getQueryObjectuivEXT):
+ (WebKit::FakeWebGraphicsContext3DWithQueryTesting::setResultAvailable):
+ (WebKit::TEST):
+ * tests/TiledLayerChromiumTest.cpp:
+ (WTF::TEST):
+
+2012-05-07 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r116334.
+ http://trac.webkit.org/changeset/116334
+ https://bugs.webkit.org/show_bug.cgi?id=85816
+
+ Broke the Chromium Win/Mac compile (Requested by
+ ojan_gardening on #webkit).
+
+ * WebKit.gypi:
+ * tests/LinkHighlightLayerDelegateTest.cpp: Removed.
+
+2012-05-07 Mark Pilgrim <pilgrim@chromium.org>
+
+ [Chromium] Move fileSystem to Platform.h
+ https://bugs.webkit.org/show_bug.cgi?id=85760
+
+ Reviewed by Adam Barth.
+
+ Part of a refactoring series. See tracking bug 82948.
+
+ * WebKit.gyp:
+ * public/platform/WebFileSystem.h:
+ * public/platform/WebKitPlatformSupport.h:
+ (WebKit):
+ (WebKitPlatformSupport):
+ * src/AssertMatchingEnums.cpp:
+ * src/AsyncFileSystemChromium.cpp:
+ (WebCore::AsyncFileSystemChromium::AsyncFileSystemChromium):
+ * src/LocalFileSystemChromium.cpp:
+ * src/WebFileSystemCallbacksImpl.cpp:
+ * src/WebFileSystemCallbacksImpl.h:
+ * src/WebFrameImpl.cpp:
+ * src/WebWorkerClientImpl.h:
+ * src/WorkerAsyncFileSystemChromium.cpp:
+ * src/WorkerAsyncFileWriterChromium.cpp:
+ * src/WorkerFileSystemCallbacksBridge.h:
+ * src/WorkerFileWriterCallbacksBridge.cpp:
+ (WebKit::WorkerFileWriterCallbacksBridge::initOnMainThread):
+
+2012-05-07 W. James MacLean <wjmaclean@chromium.org>
+
+ [chromium] Create LinkHighlightLayerChromium class to provide link-highlight preview animations for GraphicsLayerChromium.
+ https://bugs.webkit.org/show_bug.cgi?id=85084
+
+ Reviewed by Adrienne Walker.
+
+ * WebKit.gypi:
+ * tests/LinkHighlightLayerDelegateTest.cpp: Added.
+ (WebCore):
+ (MockGraphicsLayerClient):
+ (WebCore::MockGraphicsLayerClient::notifyAnimationStarted):
+ (WebCore::MockGraphicsLayerClient::notifySyncRequired):
+ (WebCore::MockGraphicsLayerClient::paintContents):
+ (WebCore::MockGraphicsLayerClient::showDebugBorders):
+ (WebCore::MockGraphicsLayerClient::showRepaintCounter):
+ (WebCore::TEST):
+
+2012-05-07 Joshua Bell <jsbell@chromium.org>
+
+ IndexedDB: LevelDB coding for bools is broken
+ https://bugs.webkit.org/show_bug.cgi?id=85810
+
+ Reviewed by Tony Chang.
+
+ Added tests for encodeBool/decodeBool.
+
+ * tests/IDBLevelDBCodingTest.cpp:
+ (IDBLevelDBCoding::TEST):
+ (IDBLevelDBCoding):
+
+2012-05-07 Shawn Singh <shawnsingh@chromium.org>
+
+ [chromium] CCMathUtil projectPoint needs to avoid divide-by-zero
+ https://bugs.webkit.org/show_bug.cgi?id=85560
+
+ Reviewed by Adrienne Walker.
+
+ * tests/CCLayerTreeHostCommonTest.cpp:
+ (WebKitTests::TEST):
+ * tests/CCMathUtilTest.cpp:
+ (WebCore::TEST):
+ (WebCore):
+
+2012-05-07 Nat Duca <nduca@chromium.org>
+
+ Unreviewed, rolling out r115525.
+ http://trac.webkit.org/changeset/115525
+ https://bugs.webkit.org/show_bug.cgi?id=66683
+
+ Too many pages rely on DOMTimeStamp as first argument.
+ Reverting while we consider next steps.
+
+ * src/PageWidgetDelegate.cpp:
+ (WebKit::PageWidgetDelegate::animate):
+ * src/WebViewImpl.cpp:
+ (WebKit::WebViewImpl::updateAnimations):
+
+2012-05-07 Tommy Widenflycht <tommyw@google.com>
+
+ MediaStream API: Allow UserMediaRequest::succeed to take an MediaStreamDescriptor
+ https://bugs.webkit.org/show_bug.cgi?id=85798
+
+ Reviewed by Adam Barth.
+
+ Adding another WebUserMediaRequest::requestSucceed function that takes an
+ WebMediaStreamDescriptor instead of the two WebMediaStreamSource arrays.
+
+ * public/WebUserMediaRequest.h:
+ (WebKit):
+ (WebUserMediaRequest):
+ * src/WebUserMediaRequest.cpp:
+ (WebKit::WebUserMediaRequest::requestSucceeded):
+
+2012-05-07 Kinuko Yasuda <kinuko@chromium.org>
+
+ Unreviewed: the same fix in another file for chromium win build. Adding WebCore namespace to FileSystemTypes.
+
+ * src/WebFrameImpl.cpp:
+ (WebKit::WebFrameImpl::createFileSystem):
+ (WebKit::WebFrameImpl::createFileEntry):
+
+2012-05-07 Kinuko Yasuda <kinuko@chromium.org>
+
+ Not reviewed: chromium win build fix attempt; adding WebCore namespace to ambiguous type name.
+
+ * src/WebFileSystemCallbacksImpl.cpp:
+ (WebKit::WebFileSystemCallbacksImpl::WebFileSystemCallbacksImpl):
+
2012-05-06 Kinuko Yasuda <kinuko@chromium.org>
Cleanup: Change boolean synchronous flag argument into enum in FileSystem API code
diff --git a/Source/WebKit/chromium/DEPS b/Source/WebKit/chromium/DEPS
index 15044b59e..1346d5045 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': '135601'
+ 'chromium_rev': '136044'
}
deps = {
diff --git a/Source/WebKit/chromium/README b/Source/WebKit/chromium/README
index f540d343a..bbb1748bb 100644
--- a/Source/WebKit/chromium/README
+++ b/Source/WebKit/chromium/README
@@ -35,10 +35,6 @@ DEFINES
called by a public inline-defined method should be annotated with
WEBKIT_EXPORT. WEBKIT_EXPORT is not used to export whole classes.
- WEBKIT_USING_SKIA is defined when using Skia as the graphics library.
-
- WEBKIT_USING_CG is defined when using CG as the graphics library.
-
WEBKIT_USING_V8 is defined when using V8 as the JavaScript library.
WEBKIT_USING_JSC is defined when using JSC as the JavaScript library.
diff --git a/Source/WebKit/chromium/WebKit.gyp b/Source/WebKit/chromium/WebKit.gyp
index ea966b1f1..a775f545d 100644
--- a/Source/WebKit/chromium/WebKit.gyp
+++ b/Source/WebKit/chromium/WebKit.gyp
@@ -299,7 +299,6 @@
'public/platform/WebBlobData.h',
'public/platform/WebBlobRegistry.h',
'public/platform/WebCanvas.h',
- 'public/platform/WebClipboard.h',
'public/platform/WebColor.h',
'public/platform/WebCommon.h',
'public/platform/WebContentLayer.h',
@@ -307,9 +306,7 @@
'public/platform/WebCookie.h',
'public/platform/WebCookieJar.h',
'public/platform/WebData.h',
- 'public/platform/WebDragData.h',
'public/platform/WebExternalTextureLayer.h',
- 'public/platform/WebFileSystem.h',
'public/platform/WebFloatPoint.h',
'public/platform/WebFloatQuad.h',
'public/platform/WebFloatRect.h',
@@ -319,7 +316,6 @@
'public/platform/WebHTTPBody.h',
'public/platform/WebHTTPHeaderVisitor.h',
'public/platform/WebHTTPLoadInfo.h',
- 'public/platform/WebImage.h',
'public/platform/WebKitPlatformSupport.h',
'public/platform/WebLayer.h',
'public/platform/WebLayerTreeView.h',
@@ -477,8 +473,6 @@
'src/SpeechRecognitionClientProxy.h',
'src/StorageAreaProxy.cpp',
'src/StorageAreaProxy.h',
- 'src/StorageEventDispatcherImpl.cpp',
- 'src/StorageEventDispatcherImpl.h',
'src/StorageInfoChromium.cpp',
'src/StorageNamespaceProxy.cpp',
'src/StorageNamespaceProxy.h',
@@ -656,7 +650,6 @@
'src/WebSpeechRecognitionHandle.cpp',
'src/WebSpeechRecognitionResult.cpp',
'src/WebStorageEventDispatcherImpl.cpp',
- 'src/WebStorageEventDispatcherImpl.h',
'src/WebStorageQuotaCallbacksImpl.cpp',
'src/WebStorageQuotaCallbacksImpl.h',
'src/WebSurroundingText.cpp',
@@ -736,8 +729,10 @@
# These tests depend on webkit_support and
# functions defined only in !WEBKIT_IMPLEMENTATION.
'tests/AssociatedURLLoaderTest.cpp',
+ 'tests/EventListenerTest.cpp',
'tests/FrameTestHelpers.cpp',
'tests/LevelDBTest.cpp',
+ 'tests/ListenerLeakTest.cpp',
'tests/PopupMenuTest.cpp',
'tests/RenderTableCellTest.cpp',
'tests/RenderTableRowTest.cpp',
@@ -883,7 +878,7 @@
'files': [
'<@(devtools_files)',
'<@(webinspector_files)',
- '<(SHARED_INTERMEDIATE_DIR)/webcore/InspectorBackendStub.js',
+ '<(SHARED_INTERMEDIATE_DIR)/webcore/InspectorBackendCommands.js',
],
'conditions': [
['debug_devtools==0', {
@@ -1014,7 +1009,7 @@
'<@(_inspector_html)',
'<@(devtools_files)',
'<@(webinspector_files)',
- '<(SHARED_INTERMEDIATE_DIR)/webcore/InspectorBackendStub.js',
+ '<(SHARED_INTERMEDIATE_DIR)/webcore/InspectorBackendCommands.js',
'<@(_workers_files)',
'<@(webinspector_image_files)',
'<@(devtools_image_files)',
@@ -1077,7 +1072,7 @@
'<@(_input_page)',
'<@(webinspector_files)',
'<@(devtools_files)',
- '<(SHARED_INTERMEDIATE_DIR)/webcore/InspectorBackendStub.js'
+ '<(SHARED_INTERMEDIATE_DIR)/webcore/InspectorBackendCommands.js'
],
'search_path': [
'../../WebCore/inspector/front-end',
diff --git a/Source/WebKit/chromium/WebKit.gypi b/Source/WebKit/chromium/WebKit.gypi
index f85d97920..f40951afe 100644
--- a/Source/WebKit/chromium/WebKit.gypi
+++ b/Source/WebKit/chromium/WebKit.gypi
@@ -97,10 +97,12 @@
'tests/CompositorFakeWebGraphicsContext3D.h',
'tests/DragImageTest.cpp',
'tests/DrawingBufferChromiumTest.cpp',
+ 'tests/EventListenerTest.cpp',
'tests/FakeCCLayerTreeHostClient.h',
'tests/FakeGraphicsContext3DTest.cpp',
'tests/FakeWebGraphicsContext3D.h',
'tests/FloatQuadTest.cpp',
+ 'tests/FrameLoaderClientImplTest.cpp',
'tests/FrameTestHelpers.cpp',
'tests/FrameTestHelpers.h',
'tests/IDBBindingUtilitiesTest.cpp',
@@ -113,6 +115,8 @@
'tests/LayerRendererChromiumTest.cpp',
'tests/LayerTextureUpdaterTest.cpp',
'tests/LevelDBTest.cpp',
+ 'tests/LinkHighlightTest.cpp',
+ 'tests/ListenerLeakTest.cpp',
'tests/LocalizedNumberICUTest.cpp',
'tests/MockCCQuadCuller.h',
'tests/PaintAggregatorTest.cpp',
@@ -126,7 +130,9 @@
'tests/RenderTableRowTest.cpp',
'tests/ScrollbarLayerChromiumTest.cpp',
'tests/TextureCopierTest.cpp',
+ 'tests/TextureLayerChromiumTest.cpp',
'tests/TextureManagerTest.cpp',
+ 'tests/ThrottledTextureUploaderTest.cpp',
'tests/TiledLayerChromiumTest.cpp',
'tests/TilingDataTest.cpp',
'tests/TreeSynchronizerTest.cpp',
diff --git a/Source/WebKit/chromium/features.gypi b/Source/WebKit/chromium/features.gypi
index 86054fac1..3947a3826 100644
--- a/Source/WebKit/chromium/features.gypi
+++ b/Source/WebKit/chromium/features.gypi
@@ -55,6 +55,7 @@
'ENABLE_GEOLOCATION=1',
'ENABLE_GESTURE_EVENTS=1',
'ENABLE_ICONDATABASE=0',
+ 'ENABLE_IFRAME_SEAMLESS=1',
'ENABLE_INDEXED_DATABASE=1',
'ENABLE_INPUT_SPEECH=1',
'ENABLE_INPUT_TYPE_DATE=1',
@@ -84,6 +85,7 @@
'ENABLE_POINTER_LOCK=1',
'ENABLE_PROGRESS_TAG=1',
'ENABLE_QUOTA=1',
+ 'ENABLE_REGISTER_PROTOCOL_HANDLER=1',
'ENABLE_REQUEST_ANIMATION_FRAME=1',
'ENABLE_RUBY=1',
'ENABLE_SANDBOX=1',
@@ -137,6 +139,7 @@
['OS=="android"', {
'feature_defines': [
'ENABLE_CALENDAR_PICKER=0',
+ 'ENABLE_MEDIA_CAPTURE=1',
'ENABLE_PAGE_POPUP=0',
'ENABLE_WEB_AUDIO=0',
'WTF_USE_NATIVE_FULLSCREEN_VIDEO=1',
@@ -144,6 +147,7 @@
}, {
'feature_defines': [
'ENABLE_CALENDAR_PICKER=1',
+ 'ENABLE_MEDIA_CAPTURE=0',
'ENABLE_PAGE_POPUP=1',
'ENABLE_WEB_AUDIO=1',
],
@@ -174,14 +178,14 @@
'WTF_USE_WEBAUDIO_FFMPEG=1',
],
}],
- ['enable_register_protocol_handler==1', {
+ ['enable_web_intents==1', {
'feature_defines': [
- 'ENABLE_REGISTER_PROTOCOL_HANDLER=1',
+ 'ENABLE_WEB_INTENTS=1',
],
}],
- ['enable_web_intents==1', {
+ ['enable_web_intents_tag==1', {
'feature_defines': [
- 'ENABLE_WEB_INTENTS=1',
+ 'ENABLE_WEB_INTENTS_TAG=1',
],
}],
['OS=="mac"', {
diff --git a/Source/WebKit/chromium/public/WebFileChooserParams.h b/Source/WebKit/chromium/public/WebFileChooserParams.h
index da462ef98..31e37b55e 100644
--- a/Source/WebKit/chromium/public/WebFileChooserParams.h
+++ b/Source/WebKit/chromium/public/WebFileChooserParams.h
@@ -62,6 +62,14 @@ struct WebFileChooserParams {
// - replacing with other files
// before opening a file chooser dialog.
WebVector<WebString> selectedFiles;
+ // See http://www.w3.org/TR/html-media-capture/ for the semantics of the
+ // capture attribute. This string will either be empty (meaning the feature
+ // is disabled) or one of the following values:
+ // - filesystem (default)
+ // - camera
+ // - camcorder
+ // - microphone
+ WebString capture;
WebFileChooserParams()
: multiSelect(false)
diff --git a/Source/WebKit/chromium/public/WebFrame.h b/Source/WebKit/chromium/public/WebFrame.h
index da795ae8d..017cb0de8 100644
--- a/Source/WebKit/chromium/public/WebFrame.h
+++ b/Source/WebKit/chromium/public/WebFrame.h
@@ -143,9 +143,6 @@ public:
// URLs
virtual WebVector<WebIconURL> iconURLs(int iconTypes) const = 0;
- // The referrer policy of the document associated with this frame.
- virtual WebReferrerPolicy referrerPolicy() const = 0;
-
// Geometry -----------------------------------------------------------
@@ -565,6 +562,13 @@ public:
// of matches found during the scoping effort.
virtual void resetMatchCount() = 0;
+ // OrientationChange event ---------------------------------------------
+
+ // Orientation is the interface orientation in degrees.
+ // Some examples are:
+ // 0 is straight up; -90 is when the device is rotated 90 clockwise;
+ // 90 is when rotated counter clockwise.
+ virtual void sendOrientationChangeEvent(int orientation) = 0;
// Events --------------------------------------------------------------
@@ -577,6 +581,9 @@ public:
virtual void removeEventListener(const WebString& eventType,
WebDOMEventListener*, bool useCapture) = 0;
virtual bool dispatchEvent(const WebDOMEvent&) = 0;
+ virtual void dispatchMessageEventWithOriginCheck(
+ const WebSecurityOrigin& intendedTargetOrigin,
+ const WebDOMEvent&) = 0;
// Web Intents ---------------------------------------------------------
diff --git a/Source/WebKit/chromium/public/WebFrameClient.h b/Source/WebKit/chromium/public/WebFrameClient.h
index 9270d1ab9..662c7c1c5 100644
--- a/Source/WebKit/chromium/public/WebFrameClient.h
+++ b/Source/WebKit/chromium/public/WebFrameClient.h
@@ -397,6 +397,11 @@ public:
WebSecurityOrigin target,
WebDOMMessageEvent) { return false; }
+ // Asks the embedder if a specific user agent should be used for the given
+ // URL. Returns true if it should, along with the user agent. If false,
+ // WebKitPlatformSupport::userAgent() will be called to provide one.
+ virtual bool userAgent(const WebURL& url, WebString* userAgent) { return false; }
+
protected:
~WebFrameClient() { }
};
diff --git a/Source/WebKit/chromium/public/WebStorageArea.h b/Source/WebKit/chromium/public/WebStorageArea.h
index cb5ee8d36..23b799af1 100644
--- a/Source/WebKit/chromium/public/WebStorageArea.h
+++ b/Source/WebKit/chromium/public/WebStorageArea.h
@@ -38,9 +38,6 @@ namespace WebKit {
class WebURL;
-// In WebCore, there's one distinct StorageArea per origin per StorageNamespace. This
-// class wraps a StorageArea. All the methods have obvious connections to the spec:
-// http://dev.w3.org/html5/webstorage/
class WebStorageArea {
public:
virtual ~WebStorageArea() { }
@@ -63,16 +60,34 @@ public:
virtual WebString getItem(const WebString& key) = 0;
// Set the value that corresponds to a specific key. Result will either be ResultOK
- // or some particular error. The value is NOT set when there's an error. url is the
+ // or some particular error. The value is NOT set when there's an error. |pageUrl| is the
// url that should be used if a storage event fires.
- virtual void setItem(const WebString& key, const WebString& newValue, const WebURL&, Result&, WebString& oldValue) = 0;
+ virtual void setItem(const WebString& key, const WebString& newValue, const WebURL& pageUrl, Result& result)
+ {
+ WebString unused;
+ setItem(key, newValue, pageUrl, result, unused);
+ }
+
- // Remove the value associated with a particular key. url is the url that should be used
+ // Remove the value associated with a particular key. |pageUrl| is the url that should be used
// if a storage event fires.
- virtual void removeItem(const WebString& key, const WebURL& url, WebString& oldValue) = 0;
+ virtual void removeItem(const WebString& key, const WebURL& pageUrl)
+ {
+ WebString unused;
+ removeItem(key, pageUrl, unused);
+ }
- // Clear all key/value pairs. url is the url that should be used if a storage event fires.
- virtual void clear(const WebURL& url, bool& somethingCleared) = 0;
+ // Clear all key/value pairs. |pageUrl| is the url that should be used if a storage event fires.
+ virtual void clear(const WebURL& pageUrl)
+ {
+ bool unused;
+ clear(pageUrl, unused);
+ }
+
+ // DEPRECATED - being replaced by the async variants above which do not return oldValues or block until completion.
+ virtual void setItem(const WebString& key, const WebString& newValue, const WebURL&, Result&, WebString& oldValue) = 0;
+ virtual void removeItem(const WebString& key, const WebURL& pageUrl, WebString& oldValue) = 0;
+ virtual void clear(const WebURL& pageUrl, bool& somethingCleared) = 0;
};
} // namespace WebKit
diff --git a/Source/WebKit/chromium/public/WebStorageEventDispatcher.h b/Source/WebKit/chromium/public/WebStorageEventDispatcher.h
index 4fbc596b2..b321bf0e9 100644
--- a/Source/WebKit/chromium/public/WebStorageEventDispatcher.h
+++ b/Source/WebKit/chromium/public/WebStorageEventDispatcher.h
@@ -55,13 +55,8 @@ public:
const WebURL& pageUrl, const WebStorageNamespace&,
WebStorageArea* sourceAreaInstance, bool originatedInProcess);
- // DEPRECATED - The instance methods are going away soon in favor
- // of the two static dispatch methods above.
- WEBKIT_EXPORT static WebStorageEventDispatcher* create();
- virtual ~WebStorageEventDispatcher() { }
- virtual void dispatchStorageEvent(const WebString& key, const WebString& oldValue,
- const WebString& newValue, const WebString& origin,
- const WebURL& url, bool isLocalStorage) = 0;
+ private:
+ WebStorageEventDispatcher() { }
};
} // namespace WebKit
diff --git a/Source/WebKit/chromium/public/WebStorageNamespace.h b/Source/WebKit/chromium/public/WebStorageNamespace.h
index 894330717..dd4a8fd44 100644
--- a/Source/WebKit/chromium/public/WebStorageNamespace.h
+++ b/Source/WebKit/chromium/public/WebStorageNamespace.h
@@ -55,9 +55,6 @@ public:
// Returns true of the two instances represent the same storage namespace.
virtual bool isSameNamespace(const WebStorageNamespace&) const { return false; }
-
- // DEPRECATED
- virtual void close() { }
};
} // namespace WebKit
diff --git a/Source/WebKit/chromium/public/WebTextInputType.h b/Source/WebKit/chromium/public/WebTextInputType.h
index 428cf5549..b7212758e 100644
--- a/Source/WebKit/chromium/public/WebTextInputType.h
+++ b/Source/WebKit/chromium/public/WebTextInputType.h
@@ -48,6 +48,12 @@ enum WebTextInputType {
WebTextInputTypeNumber,
WebTextInputTypeTelephone,
WebTextInputTypeURL,
+ WebTextInputTypeDate,
+ WebTextInputTypeDateTime,
+ WebTextInputTypeDateTimeLocal,
+ WebTextInputTypeMonth,
+ WebTextInputTypeTime,
+ WebTextInputTypeWeek,
};
} // namespace WebKit
diff --git a/Source/WebKit/chromium/public/WebUserMediaRequest.h b/Source/WebKit/chromium/public/WebUserMediaRequest.h
index 54b534e7b..54949407f 100644
--- a/Source/WebKit/chromium/public/WebUserMediaRequest.h
+++ b/Source/WebKit/chromium/public/WebUserMediaRequest.h
@@ -41,6 +41,7 @@ class UserMediaRequest;
namespace WebKit {
+class WebMediaStreamDescriptor;
class WebMediaStreamSource;
class WebString;
template <typename T> class WebVector;
@@ -67,7 +68,11 @@ public:
WEBKIT_EXPORT WebSecurityOrigin securityOrigin() const;
+ // DEPRECATED
WEBKIT_EXPORT void requestSucceeded(const WebVector<WebMediaStreamSource>& audioSources, const WebVector<WebMediaStreamSource>& videoSources);
+
+ WEBKIT_EXPORT void requestSucceeded(const WebMediaStreamDescriptor&);
+
WEBKIT_EXPORT void requestFailed();
#if WEBKIT_IMPLEMENTATION
diff --git a/Source/WebKit/chromium/public/platform/WebClipboard.h b/Source/WebKit/chromium/public/platform/WebClipboard.h
index 503213952..5f8822336 100644
--- a/Source/WebKit/chromium/public/platform/WebClipboard.h
+++ b/Source/WebKit/chromium/public/platform/WebClipboard.h
@@ -28,71 +28,4 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef WebClipboard_h
-#define WebClipboard_h
-
-#include "WebCommon.h"
-#include "WebData.h"
-#include "WebString.h"
-#include "WebVector.h"
-
-namespace WebKit {
-
-class WebDragData;
-class WebImage;
-class WebURL;
-
-class WebClipboard {
-public:
- enum Format {
- FormatPlainText,
- FormatHTML,
- FormatBookmark,
- FormatSmartPaste
- };
-
- enum Buffer {
- BufferStandard,
- // Used on platforms like the X Window System that treat selection
- // as a type of clipboard.
- BufferSelection,
- };
-
- // Returns an identifier which can be used to determine whether the data
- // contained within the clipboard has changed.
- virtual uint64 sequenceNumber(Buffer) { return 0; }
-
- virtual bool isFormatAvailable(Format, Buffer) { return false; }
-
- virtual WebVector<WebString> readAvailableTypes(
- Buffer, bool* containsFilenames) { return WebVector<WebString>(); }
- virtual WebString readPlainText(Buffer) { return WebString(); }
- // fragmentStart and fragmentEnd are indexes into the returned markup that
- // indicate the start and end of the fragment if the returned markup
- // contains additional context. If there is no additional context,
- // fragmentStart will be zero and fragmentEnd will be the same as the length
- // of the returned markup.
- virtual WebString readHTML(
- Buffer buffer, WebURL* pageURL, unsigned* fragmentStart,
- unsigned* fragmentEnd) { return WebString(); }
- virtual WebData readImage(Buffer) { return WebData(); }
- virtual WebString readCustomData(
- Buffer, const WebString& type) { return WebString(); }
-
- virtual void writePlainText(const WebString&) { }
- virtual void writeHTML(
- const WebString& htmlText, const WebURL&,
- const WebString& plainText, bool writeSmartPaste) { }
- virtual void writeURL(
- const WebURL&, const WebString& title) { }
- virtual void writeImage(
- const WebImage&, const WebURL&, const WebString& title) { }
- virtual void writeDataObject(const WebDragData&) { }
-
-protected:
- ~WebClipboard() {}
-};
-
-} // namespace WebKit
-
-#endif
+#include "../../../../Platform/chromium/public/WebClipboard.h"
diff --git a/Source/WebKit/chromium/public/platform/WebDragData.h b/Source/WebKit/chromium/public/platform/WebDragData.h
index 9666fe4b1..80cada276 100644
--- a/Source/WebKit/chromium/public/platform/WebDragData.h
+++ b/Source/WebKit/chromium/public/platform/WebDragData.h
@@ -28,96 +28,4 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef WebDragData_h
-#define WebDragData_h
-
-#include "WebCommon.h"
-#include "WebData.h"
-#include "WebString.h"
-#include "WebURL.h"
-
-#if WEBKIT_IMPLEMENTATION
-namespace WebCore { class ChromiumDataObject; }
-namespace WTF { template <typename T> class PassRefPtr; }
-#endif
-
-namespace WebKit {
-
-class WebDragDataPrivate;
-template <typename T> class WebVector;
-
-// Holds data that may be exchanged through a drag-n-drop operation. It is
-// inexpensive to copy a WebDragData object.
-class WebDragData {
-public:
- struct Item {
- enum StorageType {
- // String data with an associated MIME type. Depending on the MIME type, there may be
- // optional metadata attributes as well.
- StorageTypeString,
- // Stores the name of one file being dragged into the renderer.
- StorageTypeFilename,
- // An image being dragged out of the renderer. Contains a buffer holding the image data
- // as well as the suggested name for saving the image to.
- StorageTypeBinaryData,
- };
-
- StorageType storageType;
-
- // Only valid when storageType == StorageTypeString.
- WebString stringType;
- WebString stringData;
-
- // Only valid when storageType == StorageTypeFilename.
- WebString filenameData;
- WebString displayNameData;
-
- // Only valid when storageType == StorageTypeBinaryData.
- WebData binaryData;
-
- // Title associated with a link when stringType == "text/uri-list".
- // Filename when storageType == StorageTypeBinaryData.
- WebString title;
-
- // Only valid when stringType == "text/html".
- WebURL baseURL;
- };
-
- ~WebDragData() { reset(); }
-
- WebDragData() : m_private(0) { }
- WebDragData(const WebDragData& d) : m_private(0) { assign(d); }
- WebDragData& operator=(const WebDragData& d)
- {
- assign(d);
- return *this;
- }
-
- WEBKIT_EXPORT void initialize();
- WEBKIT_EXPORT void reset();
- WEBKIT_EXPORT void assign(const WebDragData&);
-
- bool isNull() const { return !m_private; }
-
- WEBKIT_EXPORT WebVector<Item> items() const;
- WEBKIT_EXPORT void setItems(const WebVector<Item>&);
- WEBKIT_EXPORT void addItem(const Item&);
-
- WEBKIT_EXPORT WebString filesystemId() const;
- WEBKIT_EXPORT void setFilesystemId(const WebString&);
-
-#if WEBKIT_IMPLEMENTATION
- WebDragData(const WTF::PassRefPtr<WebCore::ChromiumDataObject>&);
- WebDragData& operator=(const WTF::PassRefPtr<WebCore::ChromiumDataObject>&);
- operator WTF::PassRefPtr<WebCore::ChromiumDataObject>() const;
-#endif
-
-private:
- void assign(WebDragDataPrivate*);
- void ensureMutable();
- WebDragDataPrivate* m_private;
-};
-
-} // namespace WebKit
-
-#endif
+#include "../../../../Platform/chromium/public/WebDragData.h"
diff --git a/Source/WebKit/chromium/public/platform/WebFileSystem.h b/Source/WebKit/chromium/public/platform/WebFileSystem.h
index 25afb49f0..ad651e77c 100644
--- a/Source/WebKit/chromium/public/platform/WebFileSystem.h
+++ b/Source/WebKit/chromium/public/platform/WebFileSystem.h
@@ -28,111 +28,4 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef WebFileSystem_h
-#define WebFileSystem_h
-
-#include "WebCommon.h"
-#include "WebURL.h"
-
-namespace WebKit {
-
-// FIXME: Move these classes into platform.
-class WebFileSystemCallbacks;
-class WebFileWriter;
-class WebFileWriterClient;
-
-class WebFileSystem {
-public:
- enum Type {
- TypeTemporary,
- TypePersistent,
-
- // Indicates an isolated filesystem which only exposes a set of files.
- TypeIsolated,
-
- // Indicates a non-sandboxed filesystem.
- TypeExternal,
- };
-
- // Moves a file or directory at |srcPath| to |destPath|.
- // WebFileSystemCallbacks::didSucceed() must be called when the operation is completed successfully.
- // WebFileSystemCallbacks::didFail() must be called otherwise.
- virtual void move(const WebURL& srcPath, const WebURL& destPath, WebFileSystemCallbacks*) { WEBKIT_ASSERT_NOT_REACHED(); }
-
- // Copies a file or directory at |srcPath| to |destPath|.
- // WebFileSystemCallbacks::didSucceed() must be called when the operation is completed successfully.
- // WebFileSystemCallbacks::didFail() must be called otherwise.
- virtual void copy(const WebURL& srcPath, const WebURL& destPath, WebFileSystemCallbacks*) { WEBKIT_ASSERT_NOT_REACHED(); }
-
- // Deletes a file or directory at a given |path|.
- // It is an error to try to remove a directory that is not empty.
- // WebFileSystemCallbacks::didSucceed() must be called when the operation is completed successfully.
- // WebFileSystemCallbacks::didFail() must be called otherwise.
- virtual void remove(const WebURL& path, WebFileSystemCallbacks*) { WEBKIT_ASSERT_NOT_REACHED(); }
-
- // Deletes a file or directory recursively at a given |path|.
- // WebFileSystemCallbacks::didSucceed() must be called when the operation is completed successfully.
- // WebFileSystemCallbacks::didFail() must be called otherwise.
- virtual void removeRecursively(const WebURL& path, WebFileSystemCallbacks*) { WEBKIT_ASSERT_NOT_REACHED(); }
-
- // Retrieves the metadata information of the file or directory at the given |path|.
- // This may not always return the local platform path in remote filesystem cases.
- // WebFileSystemCallbacks::didReadMetadata() must be called with a valid metadata when the retrieval is completed successfully.
- // WebFileSystemCallbacks::didFail() must be called otherwise.
- virtual void readMetadata(const WebURL& path, WebFileSystemCallbacks*) { WEBKIT_ASSERT_NOT_REACHED(); }
-
- // Creates a file at given |path|.
- // If the |path| doesn't exist, it creates a new file at |path|.
- // If |exclusive| is true, it fails if the |path| already exists.
- // If |exclusive| is false, it succeeds if the |path| already exists or
- // it has successfully created a new file at |path|.
- //
- // WebFileSystemCallbacks::didSucceed() must be called when the operation is completed successfully.
- // WebFileSystemCallbacks::didFail() must be called otherwise.
- virtual void createFile(const WebURL& path, bool exclusive, WebFileSystemCallbacks*) { WEBKIT_ASSERT_NOT_REACHED(); }
-
- // Creates a directory at a given |path|.
- // If the |path| doesn't exist, it creates a new directory at |path|.
- // If |exclusive| is true, it fails if the |path| already exists.
- // If |exclusive| is false, it succeeds if the |path| already exists or it has successfully created a new directory at |path|.
- //
- // WebFileSystemCallbacks::didSucceed() must be called when
- // the operation is completed successfully.
- // WebFileSystemCallbacks::didFail() must be called otherwise.
- virtual void createDirectory(const WebURL& path, bool exclusive, WebFileSystemCallbacks*) { WEBKIT_ASSERT_NOT_REACHED(); }
-
- // Checks if a file exists at a given |path|.
- // WebFileSystemCallbacks::didSucceed() must be called when the operation is completed successfully.
- // WebFileSystemCallbacks::didFail() must be called otherwise.
- virtual void fileExists(const WebURL& path, WebFileSystemCallbacks*) { WEBKIT_ASSERT_NOT_REACHED(); }
-
- // Checks if a directory exists at a given |path|.
- // WebFileSystemCallbacks::didSucceed() must be called when the operation is completed successfully.
- // WebFileSystemCallbacks::didFail() must be called otherwise.
- virtual void directoryExists(const WebURL& path, WebFileSystemCallbacks*) { WEBKIT_ASSERT_NOT_REACHED(); }
-
- // Reads directory entries of a given directory at |path|.
- // WebFileSystemCallbacks::didReadDirectory() must be called when the operation is completed successfully.
- // WebFileSystemCallbacks::didFail() must be called otherwise.
- virtual void readDirectory(const WebURL& path, WebFileSystemCallbacks*) { WEBKIT_ASSERT_NOT_REACHED(); }
-
- // Creates a WebFileWriter that can be used to write to the given file.
- // This is a fast, synchronous call, and should not stat the filesystem.
- virtual WebFileWriter* createFileWriter(const WebURL& path, WebFileWriterClient*) { WEBKIT_ASSERT_NOT_REACHED(); return 0; }
-
- // Creates a snapshot file for a given file specified by |path| and registers the file with the |blobURL|. It returns the metadata of the created snapshot file.
- // The returned metadata should include a local platform path to the snapshot image.
- // In local filesystem cases the backend may simply return the metadata of the file itself (as well as readMetadata does), while in remote filesystem case the backend may download the file into a temporary snapshot file and return the metadata of the temporary file.
- // The returned metadata is used to create a File object for the |path|.
- // The snapshot file is supposed to be deleted when the last reference to the |blobURL| is dropped.
- // WebFileSystemCallbacks::didReadMetadata() with the metadata of the snapshot file must be called when the operation is completed successfully.
- // WebFileSystemCallbacks::didFail() must be called otherwise.
- virtual void createSnapshotFileAndReadMetadata(const WebURL& blobURL, const WebURL& path, WebFileSystemCallbacks*) { WEBKIT_ASSERT_NOT_REACHED(); }
-
-protected:
- virtual ~WebFileSystem() { }
-};
-
-} // namespace WebKit
-
-#endif
+#include "../../../../Platform/chromium/public/WebFileSystem.h"
diff --git a/Source/WebKit/chromium/public/platform/WebImage.h b/Source/WebKit/chromium/public/platform/WebImage.h
index bf0e9722e..2593f6b3a 100644
--- a/Source/WebKit/chromium/public/platform/WebImage.h
+++ b/Source/WebKit/chromium/public/platform/WebImage.h
@@ -28,99 +28,4 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef WebImage_h
-#define WebImage_h
-
-#include "WebCommon.h"
-
-#if WEBKIT_USING_SKIA
-#include <SkBitmap.h>
-#elif WEBKIT_USING_CG
-typedef struct CGImage* CGImageRef;
-#endif
-
-#if WEBKIT_IMPLEMENTATION
-namespace WebCore { class Image; }
-namespace WTF { template <typename T> class PassRefPtr; }
-#endif
-
-namespace WebKit {
-
-class WebData;
-struct WebSize;
-
-// A container for an ARGB bitmap.
-class WebImage {
-public:
- ~WebImage() { reset(); }
-
- WebImage() { init(); }
- WebImage(const WebImage& image)
- {
- init();
- assign(image);
- }
-
- WebImage& operator=(const WebImage& image)
- {
- assign(image);
- return *this;
- }
-
- // Decodes the given image data. If the image has multiple frames,
- // then the frame whose size is desiredSize is returned. Otherwise,
- // the first frame is returned.
- WEBKIT_EXPORT static WebImage fromData(const WebData&, const WebSize& desiredSize);
-
- WEBKIT_EXPORT void reset();
- WEBKIT_EXPORT void assign(const WebImage&);
-
- WEBKIT_EXPORT bool isNull() const;
- WEBKIT_EXPORT WebSize size() const;
-
-#if WEBKIT_IMPLEMENTATION
- WebImage(const WTF::PassRefPtr<WebCore::Image>&);
- WebImage& operator=(const WTF::PassRefPtr<WebCore::Image>&);
-#endif
-
-#if WEBKIT_USING_SKIA
- WebImage(const SkBitmap& bitmap) : m_bitmap(bitmap) { }
-
- WebImage& operator=(const SkBitmap& bitmap)
- {
- m_bitmap = bitmap;
- return *this;
- }
-
- SkBitmap& getSkBitmap() { return m_bitmap; }
- const SkBitmap& getSkBitmap() const { return m_bitmap; }
-
-private:
- void init() { }
- SkBitmap m_bitmap;
-
-#elif WEBKIT_USING_CG
- WebImage(CGImageRef imageRef)
- {
- init();
- assign(imageRef);
- }
-
- WebImage& operator=(CGImageRef imageRef)
- {
- assign(imageRef);
- return *this;
- }
-
- CGImageRef getCGImageRef() const { return m_imageRef; }
-
-private:
- void init() { m_imageRef = 0; }
- WEBKIT_EXPORT void assign(CGImageRef);
- CGImageRef m_imageRef;
-#endif
-};
-
-} // namespace WebKit
-
-#endif
+#include "../../../../Platform/chromium/public/WebImage.h"
diff --git a/Source/WebKit/chromium/public/platform/WebKitPlatformSupport.h b/Source/WebKit/chromium/public/platform/WebKitPlatformSupport.h
index ca3762dcb..cc5571ea6 100644
--- a/Source/WebKit/chromium/public/platform/WebKitPlatformSupport.h
+++ b/Source/WebKit/chromium/public/platform/WebKitPlatformSupport.h
@@ -51,9 +51,7 @@ namespace WebKit {
class WebApplicationCacheHost; // FIXME: Does this belong in platform?
class WebApplicationCacheHostClient; // FIXME: Does this belong in platform?
class WebBlobRegistry;
-class WebClipboard;
class WebCookieJar;
-class WebFileSystem;
class WebFileUtilities;
class WebIDBFactory; // FIXME: Does this belong in platform?
class WebIDBKey; // FIXME: Does this belong in platform?
@@ -69,9 +67,6 @@ class WebWorkerRunLoop;
class WebKitPlatformSupport : public Platform {
public:
// Must return non-null.
- virtual WebClipboard* clipboard() { return 0; }
-
- // Must return non-null.
virtual WebFileUtilities* fileUtilities() { return 0; }
// May return null if sandbox support is not necessary
@@ -93,11 +88,6 @@ public:
// Return a LocalStorage namespace that corresponds to the following path.
virtual WebStorageNamespace* createLocalStorageNamespace(const WebString& path, unsigned quota) { return 0; }
- // DEPRECATED
- virtual void dispatchStorageEvent(const WebString& key, const WebString& oldValue,
- const WebString& newValue, const WebString& origin,
- const WebURL& url, bool isLocalStorage) { }
-
// HTML5 Database ------------------------------------------------------
@@ -177,11 +167,6 @@ public:
virtual bool canAccelerate2dCanvas() { return false; }
- // FileSystem ----------------------------------------------------------
-
- // Must return non-null.
- virtual WebFileSystem* fileSystem() { return 0; }
-
// WebWorker ----------------------------------------------------------
virtual void didStartWorkerRunLoop(const WebWorkerRunLoop&) { }
diff --git a/Source/WebKit/chromium/src/AssertMatchingEnums.cpp b/Source/WebKit/chromium/src/AssertMatchingEnums.cpp
index 9f39fc372..322f15046 100644
--- a/Source/WebKit/chromium/src/AssertMatchingEnums.cpp
+++ b/Source/WebKit/chromium/src/AssertMatchingEnums.cpp
@@ -99,12 +99,12 @@
#include "WebTextCheckingResult.h"
#include "WebTextCheckingType.h"
#include "WebView.h"
-#include "platform/WebClipboard.h"
-#include "platform/WebFileSystem.h"
#include "platform/WebICEOptions.h"
#include "platform/WebMediaStreamSource.h"
#include "platform/WebPeerConnection00Handler.h"
#include "platform/WebPeerConnection00HandlerClient.h"
+#include <public/WebClipboard.h>
+#include <public/WebFileSystem.h>
#include <public/WebFilterOperation.h>
#include <public/WebReferrerPolicy.h>
#include <wtf/Assertions.h>
diff --git a/Source/WebKit/chromium/src/AsyncFileSystemChromium.cpp b/Source/WebKit/chromium/src/AsyncFileSystemChromium.cpp
index d2026d330..eb5021003 100644
--- a/Source/WebKit/chromium/src/AsyncFileSystemChromium.cpp
+++ b/Source/WebKit/chromium/src/AsyncFileSystemChromium.cpp
@@ -44,6 +44,8 @@
#include "WebKit.h"
#include "platform/WebFileSystem.h"
#include "platform/WebKitPlatformSupport.h"
+#include <public/Platform.h>
+#include <public/WebFileSystem.h>
#include <wtf/text/CString.h>
#include <wtf/text/StringBuilder.h>
@@ -51,12 +53,6 @@ namespace WebCore {
namespace {
-// For isolated filesystem.
-const char isolatedPathPrefix[] = "isolated";
-
-// For external filesystem.
-const char externalPathPrefix[] = "external";
-
// Specialized callback class for createSnapshotFileAndReadMetadata.
class SnapshotFileCallbacks : public AsyncFileSystemCallbacks {
public:
@@ -101,149 +97,64 @@ bool AsyncFileSystem::isAvailable()
return true;
}
-// static
-bool AsyncFileSystem::crackFileSystemURL(const KURL& url, FileSystemType& type, String& filePath)
-{
- if (!url.protocolIs("filesystem"))
- return false;
-
- if (url.innerURL()) {
- String typeString = url.innerURL()->path().substring(1);
- if (typeString == temporaryPathPrefix)
- type = FileSystemTypeTemporary;
- else if (typeString == persistentPathPrefix)
- type = FileSystemTypePersistent;
- else if (typeString == externalPathPrefix)
- type = FileSystemTypeExternal;
- else
- return false;
-
- filePath = decodeURLEscapeSequences(url.path());
- }
- return true;
-}
-
-// static
-bool AsyncFileSystem::isValidType(FileSystemType type)
-{
- return type == FileSystemTypeTemporary || type == FileSystemTypePersistent || type == FileSystemTypeExternal;
-}
-
-AsyncFileSystemChromium::AsyncFileSystemChromium(FileSystemType type, const KURL& rootURL)
- : AsyncFileSystem(type)
- , m_webFileSystem(WebKit::webKitPlatformSupport()->fileSystem())
- , m_filesystemRootURL(rootURL)
+AsyncFileSystemChromium::AsyncFileSystemChromium()
+ : m_webFileSystem(WebKit::webKitPlatformSupport()->fileSystem())
{
ASSERT(m_webFileSystem);
}
-// static
-String AsyncFileSystemChromium::createIsolatedFileSystemName(const String& storageIdentifier, const String& filesystemId)
-{
- StringBuilder filesystemName;
- filesystemName.append(storageIdentifier);
- filesystemName.append(":");
- filesystemName.append(isolatedPathPrefix);
- filesystemName.append("_");
- filesystemName.append(filesystemId);
- return filesystemName.toString();
-}
-
-// static
-PassOwnPtr<AsyncFileSystem> AsyncFileSystemChromium::createIsolatedFileSystem(const String& originString, const String& filesystemId)
-{
- // The rootURL is used in succeeding filesystem requests sent to the
- // chromium and is validated each time in the browser process.
- StringBuilder rootURL;
- rootURL.append("filesystem:");
- rootURL.append(originString);
- rootURL.append("/");
- rootURL.append(isolatedPathPrefix);
- rootURL.append("/");
- rootURL.append(filesystemId);
- rootURL.append("/");
-
- return AsyncFileSystemChromium::create(FileSystemTypeIsolated, KURL(ParsedURLString, rootURL.toString()));
-}
-
AsyncFileSystemChromium::~AsyncFileSystemChromium()
{
}
-KURL AsyncFileSystemChromium::toURL(const String& originString, const String& fullPath) const
-{
- ASSERT(!originString.isEmpty());
- if (originString == "null")
- return KURL();
-
- // For now we don't support toURL for isolated filesystem (until we resolve the isolated filesystem lifetime issue).
- if (type() == FileSystemTypeIsolated)
- return KURL();
-
- if (type() == FileSystemTypeExternal) {
- // For external filesystem originString could be different from what we have in m_filesystemRootURL.
- StringBuilder result;
- result.append("filesystem:");
- result.append(originString);
- result.append("/");
- result.append(externalPathPrefix);
- result.append(encodeWithURLEscapeSequences(fullPath));
- return KURL(ParsedURLString, result.toString());
- }
-
- // For regular types we can just call virtualPathToFileSystemURL which appends the fullPath to the m_filesystemRootURL that should look like 'filesystem:<origin>/<typePrefix>'.
- ASSERT(SecurityOrigin::create(m_filesystemRootURL)->toString() == originString);
- return KURL(ParsedURLString, virtualPathToFileSystemURL(fullPath));
-}
-
-void AsyncFileSystemChromium::move(const String& sourcePath, const String& destinationPath, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
+void AsyncFileSystemChromium::move(const KURL& sourcePath, const KURL& destinationPath, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
{
- m_webFileSystem->move(virtualPathToFileSystemURL(sourcePath), virtualPathToFileSystemURL(destinationPath), new WebKit::WebFileSystemCallbacksImpl(callbacks));
+ m_webFileSystem->move(sourcePath, destinationPath, new WebKit::WebFileSystemCallbacksImpl(callbacks));
}
-void AsyncFileSystemChromium::copy(const String& sourcePath, const String& destinationPath, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
+void AsyncFileSystemChromium::copy(const KURL& sourcePath, const KURL& destinationPath, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
{
- m_webFileSystem->copy(virtualPathToFileSystemURL(sourcePath), virtualPathToFileSystemURL(destinationPath), new WebKit::WebFileSystemCallbacksImpl(callbacks));
+ m_webFileSystem->copy(sourcePath, destinationPath, new WebKit::WebFileSystemCallbacksImpl(callbacks));
}
-void AsyncFileSystemChromium::remove(const String& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
+void AsyncFileSystemChromium::remove(const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
{
- m_webFileSystem->remove(virtualPathToFileSystemURL(path), new WebKit::WebFileSystemCallbacksImpl(callbacks));
+ m_webFileSystem->remove(path, new WebKit::WebFileSystemCallbacksImpl(callbacks));
}
-void AsyncFileSystemChromium::removeRecursively(const String& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
+void AsyncFileSystemChromium::removeRecursively(const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
{
- m_webFileSystem->removeRecursively(virtualPathToFileSystemURL(path), new WebKit::WebFileSystemCallbacksImpl(callbacks));
+ m_webFileSystem->removeRecursively(path, new WebKit::WebFileSystemCallbacksImpl(callbacks));
}
-void AsyncFileSystemChromium::readMetadata(const String& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
+void AsyncFileSystemChromium::readMetadata(const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
{
- m_webFileSystem->readMetadata(virtualPathToFileSystemURL(path), new WebKit::WebFileSystemCallbacksImpl(callbacks));
+ m_webFileSystem->readMetadata(path, new WebKit::WebFileSystemCallbacksImpl(callbacks));
}
-void AsyncFileSystemChromium::createFile(const String& path, bool exclusive, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
+void AsyncFileSystemChromium::createFile(const KURL& path, bool exclusive, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
{
- m_webFileSystem->createFile(virtualPathToFileSystemURL(path), exclusive, new WebKit::WebFileSystemCallbacksImpl(callbacks));
+ m_webFileSystem->createFile(path, exclusive, new WebKit::WebFileSystemCallbacksImpl(callbacks));
}
-void AsyncFileSystemChromium::createDirectory(const String& path, bool exclusive, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
+void AsyncFileSystemChromium::createDirectory(const KURL& path, bool exclusive, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
{
- m_webFileSystem->createDirectory(virtualPathToFileSystemURL(path), exclusive, new WebKit::WebFileSystemCallbacksImpl(callbacks));
+ m_webFileSystem->createDirectory(path, exclusive, new WebKit::WebFileSystemCallbacksImpl(callbacks));
}
-void AsyncFileSystemChromium::fileExists(const String& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
+void AsyncFileSystemChromium::fileExists(const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
{
- m_webFileSystem->fileExists(virtualPathToFileSystemURL(path), new WebKit::WebFileSystemCallbacksImpl(callbacks));
+ m_webFileSystem->fileExists(path, new WebKit::WebFileSystemCallbacksImpl(callbacks));
}
-void AsyncFileSystemChromium::directoryExists(const String& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
+void AsyncFileSystemChromium::directoryExists(const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
{
- m_webFileSystem->directoryExists(virtualPathToFileSystemURL(path), new WebKit::WebFileSystemCallbacksImpl(callbacks));
+ m_webFileSystem->directoryExists(path, new WebKit::WebFileSystemCallbacksImpl(callbacks));
}
-void AsyncFileSystemChromium::readDirectory(const String& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
+void AsyncFileSystemChromium::readDirectory(const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
{
- m_webFileSystem->readDirectory(virtualPathToFileSystemURL(path), new WebKit::WebFileSystemCallbacksImpl(callbacks));
+ m_webFileSystem->readDirectory(path, new WebKit::WebFileSystemCallbacksImpl(callbacks));
}
class FileWriterHelperCallbacks : public WebKit::WebFileSystemCallbacks {
@@ -300,28 +211,17 @@ private:
OwnPtr<WebCore::AsyncFileSystemCallbacks> m_callbacks;
};
-void AsyncFileSystemChromium::createWriter(AsyncFileWriterClient* client, const String& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
+void AsyncFileSystemChromium::createWriter(AsyncFileWriterClient* client, const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
{
- KURL pathAsURL = virtualPathToFileSystemURL(path);
- m_webFileSystem->readMetadata(pathAsURL, new FileWriterHelperCallbacks(client, pathAsURL, m_webFileSystem, callbacks));
+ m_webFileSystem->readMetadata(path, new FileWriterHelperCallbacks(client, path, m_webFileSystem, callbacks));
}
-void AsyncFileSystemChromium::createSnapshotFileAndReadMetadata(const String& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
+void AsyncFileSystemChromium::createSnapshotFileAndReadMetadata(const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
{
- KURL pathAsURL = virtualPathToFileSystemURL(path);
KURL internalBlobURL = BlobURL::createInternalURL();
// This will create a snapshot file and register the file to a blob using the given internalBlobURL.
- m_webFileSystem->createSnapshotFileAndReadMetadata(internalBlobURL, pathAsURL, new WebKit::WebFileSystemCallbacksImpl(createSnapshotFileCallback(internalBlobURL, callbacks)));
-}
-
-KURL AsyncFileSystemChromium::virtualPathToFileSystemURL(const String& virtualPath) const
-{
- ASSERT(!m_filesystemRootURL.isEmpty());
- KURL url = m_filesystemRootURL;
- // Remove the extra leading slash.
- url.setPath(url.path() + encodeWithURLEscapeSequences(virtualPath.substring(1)));
- return url;
+ m_webFileSystem->createSnapshotFileAndReadMetadata(internalBlobURL, path, new WebKit::WebFileSystemCallbacksImpl(createSnapshotFileCallback(internalBlobURL, callbacks)));
}
PassOwnPtr<AsyncFileSystemCallbacks> AsyncFileSystemChromium::createSnapshotFileCallback(const KURL& internalBlobURL, PassOwnPtr<AsyncFileSystemCallbacks> callbacks) const
diff --git a/Source/WebKit/chromium/src/AsyncFileSystemChromium.h b/Source/WebKit/chromium/src/AsyncFileSystemChromium.h
index e827855a0..7e1af3278 100644
--- a/Source/WebKit/chromium/src/AsyncFileSystemChromium.h
+++ b/Source/WebKit/chromium/src/AsyncFileSystemChromium.h
@@ -43,45 +43,35 @@ class WebFileSystem;
namespace WebCore {
class AsyncFileSystemCallbacks;
-class KURL;
class AsyncFileSystemChromium : public AsyncFileSystem {
public:
- static PassOwnPtr<AsyncFileSystem> create(FileSystemType type, const KURL& rootURL)
+ static PassOwnPtr<AsyncFileSystem> create()
{
- return adoptPtr(new AsyncFileSystemChromium(type, rootURL));
+ return adoptPtr(new AsyncFileSystemChromium());
}
- static String createIsolatedFileSystemName(const String& storageIdentifier, const String& filesystemId);
- static PassOwnPtr<AsyncFileSystem> createIsolatedFileSystem(const String& originString, const String& filesystemId);
-
virtual ~AsyncFileSystemChromium();
- virtual KURL toURL(const String& originString, const String& fullPath) const;
- virtual void move(const String& sourcePath, const String& destinationPath, PassOwnPtr<AsyncFileSystemCallbacks>);
- virtual void copy(const String& sourcePath, const String& destinationPath, PassOwnPtr<AsyncFileSystemCallbacks>);
- virtual void remove(const String& path, PassOwnPtr<AsyncFileSystemCallbacks>);
- virtual void removeRecursively(const String& path, PassOwnPtr<AsyncFileSystemCallbacks>);
- virtual void readMetadata(const String& path, PassOwnPtr<AsyncFileSystemCallbacks>);
- virtual void createFile(const String& path, bool exclusive, PassOwnPtr<AsyncFileSystemCallbacks>);
- virtual void createDirectory(const String& path, bool exclusive, PassOwnPtr<AsyncFileSystemCallbacks>);
- virtual void fileExists(const String& path, PassOwnPtr<AsyncFileSystemCallbacks>);
- virtual void directoryExists(const String& path, PassOwnPtr<AsyncFileSystemCallbacks>);
- virtual void readDirectory(const String& path, PassOwnPtr<AsyncFileSystemCallbacks>);
- virtual void createWriter(AsyncFileWriterClient* client, const String& path, PassOwnPtr<AsyncFileSystemCallbacks>);
- virtual void createSnapshotFileAndReadMetadata(const String& path, PassOwnPtr<AsyncFileSystemCallbacks>);
+ virtual void move(const KURL& sourcePath, const KURL& destinationPath, PassOwnPtr<AsyncFileSystemCallbacks>);
+ virtual void copy(const KURL& sourcePath, const KURL& destinationPath, PassOwnPtr<AsyncFileSystemCallbacks>);
+ virtual void remove(const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks>);
+ virtual void removeRecursively(const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks>);
+ virtual void readMetadata(const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks>);
+ virtual void createFile(const KURL& path, bool exclusive, PassOwnPtr<AsyncFileSystemCallbacks>);
+ virtual void createDirectory(const KURL& path, bool exclusive, PassOwnPtr<AsyncFileSystemCallbacks>);
+ virtual void fileExists(const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks>);
+ virtual void directoryExists(const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks>);
+ virtual void readDirectory(const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks>);
+ virtual void createWriter(AsyncFileWriterClient*, const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks>);
+ virtual void createSnapshotFileAndReadMetadata(const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks>);
protected:
- AsyncFileSystemChromium(FileSystemType, const KURL& rootURL);
+ AsyncFileSystemChromium();
PassOwnPtr<AsyncFileSystemCallbacks> createSnapshotFileCallback(const KURL& internalBlobURL, PassOwnPtr<AsyncFileSystemCallbacks>) const;
WebKit::WebFileSystem* m_webFileSystem;
-
- // Converts a given absolute virtual path to a full origin-qualified FileSystem URL.
- KURL virtualPathToFileSystemURL(const String& virtualPath) const;
-
- KURL m_filesystemRootURL;
};
} // namespace WebCore
diff --git a/Source/WebKit/chromium/src/ChromeClientImpl.cpp b/Source/WebKit/chromium/src/ChromeClientImpl.cpp
index fac80d993..8808e5d6a 100644
--- a/Source/WebKit/chromium/src/ChromeClientImpl.cpp
+++ b/Source/WebKit/chromium/src/ChromeClientImpl.cpp
@@ -738,6 +738,11 @@ void ChromeClientImpl::runOpenPanel(Frame* frame, PassRefPtr<FileChooser> fileCh
params.selectedFiles = fileChooser->settings().selectedFiles;
if (params.selectedFiles.size() > 0)
params.initialValue = params.selectedFiles[0];
+#if ENABLE(MEDIA_CAPTURE)
+ params.capture = fileChooser->settings().capture;
+#else
+ params.capture = WebString();
+#endif
WebFileChooserCompletionImpl* chooserCompletion =
new WebFileChooserCompletionImpl(fileChooser);
diff --git a/Source/WebKit/chromium/src/ContextMenuClientImpl.cpp b/Source/WebKit/chromium/src/ContextMenuClientImpl.cpp
index 4491ea1ca..d35eb0e6c 100644
--- a/Source/WebKit/chromium/src/ContextMenuClientImpl.cpp
+++ b/Source/WebKit/chromium/src/ContextMenuClientImpl.cpp
@@ -279,18 +279,20 @@ 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()) {
RefPtr<Range> range = selectedFrame->selection()->toNormalizedRange();
- Vector<DocumentMarker*> markers = selectedFrame->document()->markers()->markersInRange(range.get(), DocumentMarker::Spelling);
- if (!markers.isEmpty()) {
- Vector<String> suggestions;
- for (size_t i = 0; i < markers.size(); ++i) {
- if (!markers[i]->description().isEmpty()) {
- Vector<String> descriptions;
- markers[i]->description().split('\n', descriptions);
- suggestions.append(descriptions);
+ if (range.get()) {
+ Vector<DocumentMarker*> markers = selectedFrame->document()->markers()->markersInRange(range.get(), DocumentMarker::Spelling);
+ if (!markers.isEmpty()) {
+ Vector<String> suggestions;
+ for (size_t i = 0; i < markers.size(); ++i) {
+ if (!markers[i]->description().isEmpty()) {
+ Vector<String> descriptions;
+ markers[i]->description().split('\n', descriptions);
+ suggestions.append(descriptions);
+ }
}
+ data.dictionarySuggestions = suggestions;
+ data.misspelledWord = selectMisspelledWord(defaultMenu, selectedFrame);
}
- data.dictionarySuggestions = suggestions;
- data.misspelledWord = selectMisspelledWord(defaultMenu, selectedFrame);
}
} else if (m_webView->focusedWebCoreFrame()->editor()->isContinuousSpellCheckingEnabled()) {
data.isSpellCheckingEnabled = true;
diff --git a/Source/WebKit/chromium/src/DragClientImpl.cpp b/Source/WebKit/chromium/src/DragClientImpl.cpp
index f4b9e160d..afa570611 100644
--- a/Source/WebKit/chromium/src/DragClientImpl.cpp
+++ b/Source/WebKit/chromium/src/DragClientImpl.cpp
@@ -36,11 +36,12 @@
#include "Frame.h"
#include "NativeImageSkia.h"
#include "platform/WebCommon.h"
-#include "platform/WebDragData.h"
#include "platform/WebImage.h"
#include "WebViewClient.h"
#include "WebViewImpl.h"
+#include <public/WebDragData.h>
+
using namespace WebCore;
namespace WebKit {
@@ -88,11 +89,7 @@ void DragClientImpl::startDrag(DragImageRef dragImage,
WebPoint offsetPoint(offsetSize.width(), offsetSize.height());
m_webView->startDragging(
dragData, static_cast<WebDragOperationsMask>(dragOperationMask),
-#if WEBKIT_USING_SKIA
dragImage ? WebImage(*dragImage) : WebImage(),
-#else
- dragImage ? WebImage(dragImage) : WebImage(),
-#endif
offsetPoint);
}
diff --git a/Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp b/Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp
index abe1e98b4..d0602a9a0 100644
--- a/Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp
+++ b/Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp
@@ -68,6 +68,7 @@
#include "WebFrameClient.h"
#include "WebFrameImpl.h"
#include "WebIntentRequest.h"
+#include "WebIntentServiceInfo.h"
#include "WebKit.h"
#include "WebNode.h"
#include "WebPermissionClient.h"
@@ -634,8 +635,14 @@ void FrameLoaderClientImpl::dispatchDidNavigateWithinPage()
// didStopLoading only when loader is completed so that we don't fire
// them for fragment redirection that happens in window.onload handler.
// See https://bugs.webkit.org/show_bug.cgi?id=31838
- bool loaderCompleted =
- !webView->page()->mainFrame()->loader()->activeDocumentLoader()->isLoadingInAPISense();
+ //
+ // FIXME: Although FrameLoader::loadInSameDocument which invokes this
+ // method does not have a provisional document loader, we're seeing crashes
+ // where the FrameLoader is in provisional state, and thus
+ // activeDocumentLoader returns 0. Lacking any understanding of how this
+ // can happen, we do this check here to avoid crashing.
+ FrameLoader* loader = webView->page()->mainFrame()->loader();
+ bool loaderCompleted = !(loader->activeDocumentLoader() && loader->activeDocumentLoader()->isLoadingInAPISense());
// Generate didStartLoading if loader is completed.
if (webView->client() && loaderCompleted)
@@ -1376,6 +1383,10 @@ void FrameLoaderClientImpl::setTitle(const StringWithDirection& title, const KUR
String FrameLoaderClientImpl::userAgent(const KURL& url)
{
+ WebString override;
+ if (m_webFrame->client()->userAgent(WebURL(url), &override))
+ return override;
+
return WebKit::Platform::current()->userAgent(url);
}
@@ -1591,10 +1602,28 @@ bool FrameLoaderClientImpl::willCheckAndDispatchMessageEvent(
if (!m_webFrame->client())
return false;
+ WebFrame* source = 0;
+ if (event && event->source() && event->source()->document())
+ source = WebFrameImpl::fromFrame(event->source()->document()->frame());
return m_webFrame->client()->willCheckAndDispatchMessageEvent(
- m_webFrame, WebSecurityOrigin(target), WebDOMMessageEvent(event));
+ source, WebSecurityOrigin(target), WebDOMMessageEvent(event));
}
+#if ENABLE(WEB_INTENTS_TAG)
+void FrameLoaderClientImpl::registerIntentService(
+ const String& action,
+ const String& type,
+ const KURL& href,
+ const String& title,
+ const String& disposition) {
+ if (!m_webFrame->client())
+ return;
+
+ WebIntentServiceInfo service(action, type, href, title, disposition);
+ m_webFrame->client()->registerIntentService(m_webFrame, service);
+}
+#endif
+
#if ENABLE(WEB_INTENTS)
void FrameLoaderClientImpl::dispatchIntent(PassRefPtr<WebCore::IntentRequest> intentRequest)
{
diff --git a/Source/WebKit/chromium/src/FrameLoaderClientImpl.h b/Source/WebKit/chromium/src/FrameLoaderClientImpl.h
index df7e0f123..ecb20a2fb 100644
--- a/Source/WebKit/chromium/src/FrameLoaderClientImpl.h
+++ b/Source/WebKit/chromium/src/FrameLoaderClientImpl.h
@@ -205,6 +205,13 @@ public:
virtual PassRefPtr<WebCore::FrameNetworkingContext> createNetworkingContext();
virtual bool willCheckAndDispatchMessageEvent(WebCore::SecurityOrigin* target, WebCore::MessageEvent*) const;
+#if ENABLE(WEB_INTENTS_TAG)
+ virtual void registerIntentService(const String& action,
+ const String& type,
+ const WebCore::KURL& href,
+ const String& title,
+ const String& disposition);
+#endif
#if ENABLE(WEB_INTENTS)
virtual void dispatchIntent(PassRefPtr<WebCore::IntentRequest>) OVERRIDE;
#endif
diff --git a/Source/WebKit/chromium/src/LocalFileSystemChromium.cpp b/Source/WebKit/chromium/src/LocalFileSystemChromium.cpp
index 5f6d52750..6fded29ff 100644
--- a/Source/WebKit/chromium/src/LocalFileSystemChromium.cpp
+++ b/Source/WebKit/chromium/src/LocalFileSystemChromium.cpp
@@ -41,7 +41,6 @@
#include "FileSystemType.h"
#include "PlatformString.h"
#include "WebFileError.h"
-#include "platform/WebFileSystem.h"
#include "WebFileSystemCallbacksImpl.h"
#include "WebFrameClient.h"
#include "WebFrameImpl.h"
@@ -51,6 +50,7 @@
#include "WorkerContext.h"
#include "WorkerFileSystemCallbacksBridge.h"
#include "WorkerThread.h"
+#include <public/WebFileSystem.h>
#include <wtf/Threading.h>
using namespace WebKit;
@@ -194,7 +194,7 @@ static void openFileSystemHelper(ScriptExecutionContext* context, FileSystemType
if (webView->permissionClient() && !webView->permissionClient()->allowFileSystem(webFrame))
allowed = false;
else
- webFrame->client()->openFileSystem(webFrame, static_cast<WebFileSystem::Type>(type), size, create == CreateIfNotPresent, new WebFileSystemCallbacksImpl(callbacks, type));
+ webFrame->client()->openFileSystem(webFrame, static_cast<WebFileSystem::Type>(type), size, create == CreateIfNotPresent, new WebFileSystemCallbacksImpl(callbacks));
} else {
#if ENABLE(WORKERS)
WorkerContext* workerContext = static_cast<WorkerContext*>(context);
@@ -203,7 +203,7 @@ static void openFileSystemHelper(ScriptExecutionContext* context, FileSystemType
if (!allowFileSystemForWorker(webWorker->commonClient()))
allowed = false;
else
- openFileSystemForWorker(webWorker->commonClient(), static_cast<WebFileSystem::Type>(type), size, create == CreateIfNotPresent, new WebFileSystemCallbacksImpl(callbacks, type, context, synchronousType), synchronousType);
+ openFileSystemForWorker(webWorker->commonClient(), static_cast<WebFileSystem::Type>(type), size, create == CreateIfNotPresent, new WebFileSystemCallbacksImpl(callbacks, context, synchronousType), synchronousType);
#else
ASSERT_NOT_REACHED();
diff --git a/Source/WebKit/chromium/src/LocalizedStrings.cpp b/Source/WebKit/chromium/src/LocalizedStrings.cpp
index 6af49515f..75b3a2847 100644
--- a/Source/WebKit/chromium/src/LocalizedStrings.cpp
+++ b/Source/WebKit/chromium/src/LocalizedStrings.cpp
@@ -215,6 +215,12 @@ String crashedPluginText()
return String("Plug-in Failure");
}
+String insecurePluginVersionText()
+{
+ notImplemented();
+ return String();
+}
+
String multipleFileUploadText(unsigned numberOfFiles)
{
return query(WebLocalizedString::MultipleFileUploadText, String::number(numberOfFiles));
diff --git a/Source/WebKit/chromium/src/PageOverlay.cpp b/Source/WebKit/chromium/src/PageOverlay.cpp
index 5f16d29c2..b5d157a4b 100644
--- a/Source/WebKit/chromium/src/PageOverlay.cpp
+++ b/Source/WebKit/chromium/src/PageOverlay.cpp
@@ -46,11 +46,7 @@ namespace {
WebCanvas* ToWebCanvas(GraphicsContext* gc)
{
-#if WEBKIT_USING_SKIA
return gc->platformContext()->canvas();
-#elif WEBKIT_USING_CG
- return gc->platformContext();
-#endif
}
} // namespace
diff --git a/Source/WebKit/chromium/src/PageWidgetDelegate.cpp b/Source/WebKit/chromium/src/PageWidgetDelegate.cpp
index 058bae024..cb9e95fc3 100644
--- a/Source/WebKit/chromium/src/PageWidgetDelegate.cpp
+++ b/Source/WebKit/chromium/src/PageWidgetDelegate.cpp
@@ -59,7 +59,8 @@ void PageWidgetDelegate::animate(Page* page, double monotonicFrameBeginTime)
FrameView* view = mainFrameView(page);
if (!view)
return;
- view->serviceScriptedAnimations(monotonicFrameBeginTime);
+ double timeShift = currentTime() - monotonicallyIncreasingTime();
+ view->serviceScriptedAnimations(convertSecondsToDOMTimeStamp(monotonicFrameBeginTime + timeShift));
#endif
}
@@ -152,6 +153,7 @@ bool PageWidgetDelegate::handleInputEvent(Page* page, PageWidgetEventHandler& ha
case WebInputEvent::GestureTap:
case WebInputEvent::GestureTapDown:
case WebInputEvent::GestureDoubleTap:
+ case WebInputEvent::GestureLongPress:
return handler.handleGestureEvent(*static_cast<const WebGestureEvent*>(&event));
#endif
diff --git a/Source/WebKit/chromium/src/PlatformSupport.cpp b/Source/WebKit/chromium/src/PlatformSupport.cpp
index de9810dbd..717455688 100644
--- a/Source/WebKit/chromium/src/PlatformSupport.cpp
+++ b/Source/WebKit/chromium/src/PlatformSupport.cpp
@@ -50,7 +50,6 @@
#include "WebWorkerClientImpl.h"
#include "WebWorkerRunLoop.h"
#include "platform/WebAudioBus.h"
-#include "platform/WebClipboard.h"
#include "platform/WebCookie.h"
#include "platform/WebCookieJar.h"
#include "platform/WebData.h"
@@ -81,9 +80,7 @@
#include "platform/android/WebThemeEngine.h"
#endif
-#if WEBKIT_USING_SKIA
#include "NativeImageSkia.h"
-#endif
#include "AsyncFileSystemChromium.h"
#include "BitmapImage.h"
@@ -101,6 +98,7 @@
#include "Worker.h"
#include "WorkerContextProxy.h"
+#include <public/WebClipboard.h>
#include <public/WebMimeRegistry.h>
#include <wtf/Assertions.h>
@@ -224,11 +222,7 @@ void PlatformSupport::clipboardWriteImage(NativeImagePtr image,
const KURL& sourceURL,
const String& title)
{
-#if WEBKIT_USING_SKIA
WebImage webImage(image->bitmap());
-#else
- WebImage webImage(image);
-#endif
webKitPlatformSupport()->clipboard()->writeImage(webImage, sourceURL, title);
}
@@ -404,14 +398,9 @@ int PlatformSupport::writeToFile(PlatformFileHandle handle, const char* data, in
}
#if ENABLE(FILE_SYSTEM)
-String PlatformSupport::createIsolatedFileSystemName(const String& storageIdentifier, const String& filesystemId)
+PassOwnPtr<AsyncFileSystem> PlatformSupport::createAsyncFileSystem()
{
- return AsyncFileSystemChromium::createIsolatedFileSystemName(storageIdentifier, filesystemId);
-}
-
-PassOwnPtr<AsyncFileSystem> PlatformSupport::createIsolatedFileSystem(const String& originString, const String& filesystemId)
-{
- return AsyncFileSystemChromium::createIsolatedFileSystem(originString, filesystemId);
+ return AsyncFileSystemChromium::create();
}
#endif
@@ -558,17 +547,6 @@ NPObject* PlatformSupport::pluginScriptableObject(Widget* widget)
// Resources ------------------------------------------------------------------
-PassRefPtr<Image> PlatformSupport::loadPlatformImageResource(const char* name)
-{
- const WebData& resource = webKitPlatformSupport()->loadResource(name);
- if (resource.isEmpty())
- return Image::nullImage();
-
- RefPtr<Image> image = BitmapImage::create();
- image->setData(resource, true);
- return image;
-}
-
#if ENABLE(WEB_AUDIO)
PassOwnPtr<AudioBus> PlatformSupport::decodeAudioFileData(const char* data, size_t size, double sampleRate)
@@ -688,11 +666,7 @@ void PlatformSupport::paintScrollbarThumb(
webThemeScrollbarInfo.visibleSize = scrollbarInfo.visibleSize;
webThemeScrollbarInfo.totalSize = scrollbarInfo.totalSize;
-#if WEBKIT_USING_SKIA
WebKit::WebCanvas* webCanvas = gc->platformContext()->canvas();
-#else
- WebKit::WebCanvas* webCanvas = gc->platformContext();
-#endif
webKitPlatformSupport()->themeEngine()->paintScrollbarThumb(
webCanvas,
static_cast<WebThemeEngine::State>(state),
@@ -811,28 +785,6 @@ void PlatformSupport::paintThemePart(
#endif
-// Trace Event ----------------------------------------------------------------
-
-const unsigned char* PlatformSupport::getTraceCategoryEnabledFlag(const char* categoryName)
-{
- return webKitPlatformSupport()->getTraceCategoryEnabledFlag(categoryName);
-}
-int PlatformSupport::addTraceEvent(char phase,
- const unsigned char* categoryEnabledFlag,
- const char* name,
- unsigned long long id,
- int numArgs,
- const char** argNames,
- const unsigned char* argTypes,
- const unsigned long long* argValues,
- int thresholdBeginId,
- long long threshold,
- unsigned char flags)
-{
- return webKitPlatformSupport()->addTraceEvent(
- phase, categoryEnabledFlag, name, id, numArgs, argNames, argTypes, argValues, thresholdBeginId, threshold, flags);
-}
-
// Visited Links --------------------------------------------------------------
LinkHash PlatformSupport::visitedLinkHash(const UChar* url, unsigned length)
diff --git a/Source/WebKit/chromium/src/StorageAreaProxy.cpp b/Source/WebKit/chromium/src/StorageAreaProxy.cpp
index 11eb7cec3..00cc4433b 100644
--- a/Source/WebKit/chromium/src/StorageAreaProxy.cpp
+++ b/Source/WebKit/chromium/src/StorageAreaProxy.cpp
@@ -80,42 +80,29 @@ String StorageAreaProxy::getItem(const String& key, Frame* frame) const
return String();
}
-String StorageAreaProxy::setItem(const String& key, const String& value, ExceptionCode& ec, Frame* frame)
+void StorageAreaProxy::setItem(const String& key, const String& value, ExceptionCode& ec, Frame* frame)
{
- WebKit::WebStorageArea::Result result = WebKit::WebStorageArea::ResultOK;
- WebKit::WebString oldValue;
if (!canAccessStorage(frame))
ec = QUOTA_EXCEEDED_ERR;
else {
- m_storageArea->setItem(key, value, frame->document()->url(), result, oldValue);
+ WebKit::WebStorageArea::Result result = WebKit::WebStorageArea::ResultOK;
+ m_storageArea->setItem(key, value, frame->document()->url(), result);
ec = (result == WebKit::WebStorageArea::ResultOK) ? 0 : QUOTA_EXCEEDED_ERR;
- String oldValueString = oldValue;
- if (oldValueString != value && result == WebKit::WebStorageArea::ResultOK)
- storageEvent(key, oldValue, value, m_storageType, frame->document()->securityOrigin(), frame);
}
- return oldValue;
}
-String StorageAreaProxy::removeItem(const String& key, Frame* frame)
+void StorageAreaProxy::removeItem(const String& key, Frame* frame)
{
if (!canAccessStorage(frame))
- return String();
- WebKit::WebString oldValue;
- m_storageArea->removeItem(key, frame->document()->url(), oldValue);
- if (!oldValue.isNull())
- storageEvent(key, oldValue, String(), m_storageType, frame->document()->securityOrigin(), frame);
- return oldValue;
+ return;
+ m_storageArea->removeItem(key, frame->document()->url());
}
-bool StorageAreaProxy::clear(Frame* frame)
+void StorageAreaProxy::clear(Frame* frame)
{
if (!canAccessStorage(frame))
- return false;
- bool clearedSomething;
- m_storageArea->clear(frame->document()->url(), clearedSomething);
- if (clearedSomething)
- storageEvent(String(), String(), String(), m_storageType, frame->document()->securityOrigin(), frame);
- return clearedSomething;
+ return;
+ m_storageArea->clear(frame->document()->url());
}
bool StorageAreaProxy::contains(const String& key, Frame* frame) const
@@ -123,54 +110,6 @@ bool StorageAreaProxy::contains(const String& key, Frame* frame) const
return !getItem(key, frame).isNull();
}
-// FIXME: remove this method and the calls to it from our setters after multi-side patch landing is done.
-// Copied from WebCore/storage/StorageEventDispatcher.cpp out of necessity. It's probably best to keep it current.
-void StorageAreaProxy::storageEvent(const String& key, const String& oldValue, const String& newValue, StorageType storageType, SecurityOrigin* securityOrigin, Frame* sourceFrame)
-{
- Page* page = sourceFrame->page();
- if (!page)
- return;
-
- // We need to copy all relevant frames from every page to a vector since sending the event to one frame might mutate the frame tree
- // of any given page in the group or mutate the page group itself.
- Vector<RefPtr<Frame> > frames;
- if (storageType == SessionStorage) {
- // Send events only to our page.
- for (Frame* frame = page->mainFrame(); frame; frame = frame->tree()->traverseNext()) {
- if (sourceFrame != frame && frame->document()->securityOrigin()->equal(securityOrigin))
- frames.append(frame);
- }
-
- for (unsigned i = 0; i < frames.size(); ++i) {
- // FIXME: maybe only raise if the window has an onstorage listener
- // attached to avoid creating the Storage instance.
- ExceptionCode ec = 0;
- Storage* storage = frames[i]->domWindow()->sessionStorage(ec);
- if (!ec)
- frames[i]->document()->enqueueWindowEvent(StorageEvent::create(eventNames().storageEvent, key, oldValue, newValue, sourceFrame->document()->url(), storage));
- }
- } else {
- // Send events to every page.
- const HashSet<Page*>& pages = page->group().pages();
- HashSet<Page*>::const_iterator end = pages.end();
- for (HashSet<Page*>::const_iterator it = pages.begin(); it != end; ++it) {
- for (Frame* frame = (*it)->mainFrame(); frame; frame = frame->tree()->traverseNext()) {
- if (sourceFrame != frame && frame->document()->securityOrigin()->equal(securityOrigin))
- frames.append(frame);
- }
- }
-
- for (unsigned i = 0; i < frames.size(); ++i) {
- // FIXME: maybe only raise if the window has an onstorage listener
- // attached to avoid creating the Storage instance.
- ExceptionCode ec = 0;
- Storage* storage = frames[i]->domWindow()->localStorage(ec);
- if (!ec)
- frames[i]->document()->enqueueWindowEvent(StorageEvent::create(eventNames().storageEvent, key, oldValue, newValue, sourceFrame->document()->url(), storage));
- }
- }
-}
-
bool StorageAreaProxy::canAccessStorage(Frame* frame) const
{
if (!frame->page())
@@ -180,18 +119,10 @@ bool StorageAreaProxy::canAccessStorage(Frame* frame) const
return !webView->permissionClient() || webView->permissionClient()->allowStorage(webFrame, m_storageType == LocalStorage);
}
-void StorageAreaProxy::dispatchLocalStorageEvent(const String& pageGroupName, const String& key, const String& oldValue, const String& newValue,
+void StorageAreaProxy::dispatchLocalStorageEvent(PageGroup* pageGroup, const String& key, const String& oldValue, const String& newValue,
SecurityOrigin* securityOrigin, const KURL& pageURL, WebKit::WebStorageArea* sourceAreaInstance, bool originatedInProcess)
{
- // FIXME: Multi-sided patch engineering alert !
- // step 1: this method gets defined and implemented in webkit/webcore with the early return.
- // step 2: this method starts getting called by chromium still with the early return.
- // step 3: This class's setters are modified to no longer raise SessionStorage
- // events for inprocess changes and this early return is removed.
- if (originatedInProcess)
- return;
-
- const HashSet<Page*>& pages = PageGroup::pageGroup(pageGroupName)->pages();
+ 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()) {
if (frame->document()->securityOrigin()->equal(securityOrigin) && !isEventSource(frame->domWindow()->optionalLocalStorage(), sourceAreaInstance)) {
@@ -205,9 +136,9 @@ void StorageAreaProxy::dispatchLocalStorageEvent(const String& pageGroupName, co
}
}
-static Page* findPageWithSessionStorageNamespace(const String& pageGroupName, const WebKit::WebStorageNamespace& sessionNamespace)
+static Page* findPageWithSessionStorageNamespace(PageGroup* pageGroup, const WebKit::WebStorageNamespace& sessionNamespace)
{
- const HashSet<Page*>& pages = PageGroup::pageGroup(pageGroupName)->pages();
+ const HashSet<Page*>& pages = pageGroup->pages();
for (HashSet<Page*>::const_iterator it = pages.begin(); it != pages.end(); ++it) {
const bool createIfNeeded = true;
StorageNamespaceProxy* proxy = static_cast<StorageNamespaceProxy*>((*it)->sessionStorage(createIfNeeded));
@@ -217,19 +148,11 @@ static Page* findPageWithSessionStorageNamespace(const String& pageGroupName, co
return 0;
}
-void StorageAreaProxy::dispatchSessionStorageEvent(const String& pageGroupName, const String& key, const String& oldValue, const String& newValue,
+void StorageAreaProxy::dispatchSessionStorageEvent(PageGroup* pageGroup, const String& key, const String& oldValue, const String& newValue,
SecurityOrigin* securityOrigin, const KURL& pageURL, const WebKit::WebStorageNamespace& sessionNamespace,
WebKit::WebStorageArea* sourceAreaInstance, bool originatedInProcess)
{
- // FIXME: Multi-sided patch engineering alert !
- // step 1: this method gets defined and implemented in webkit/webcore with the early return.
- // step 2: this method starts getting called by chromium still with the early return.
- // step 3: This class's setters are modified to no longer raise SessionStorage
- // events for inprocess changes and this early return is removed.
- if (originatedInProcess)
- return;
-
- Page* page = findPageWithSessionStorageNamespace(pageGroupName, sessionNamespace);
+ Page* page = findPageWithSessionStorageNamespace(pageGroup, sessionNamespace);
if (!page)
return;
diff --git a/Source/WebKit/chromium/src/StorageAreaProxy.h b/Source/WebKit/chromium/src/StorageAreaProxy.h
index ab2357470..83f2eae17 100644
--- a/Source/WebKit/chromium/src/StorageAreaProxy.h
+++ b/Source/WebKit/chromium/src/StorageAreaProxy.h
@@ -38,6 +38,7 @@ namespace WebCore {
class Frame;
class KURL;
class Page;
+class PageGroup;
class SecurityOrigin;
class Storage;
@@ -50,23 +51,22 @@ public:
virtual unsigned length(Frame* sourceFrame) const;
virtual String key(unsigned index, Frame* sourceFrame) const;
virtual String getItem(const String& key, Frame* sourceFrame) const;
- virtual String setItem(const String& key, const String& value, ExceptionCode& ec, Frame* sourceFrame);
- virtual String removeItem(const String& key, Frame* sourceFrame);
- virtual bool clear(Frame* sourceFrame);
+ virtual void setItem(const String& key, const String& value, ExceptionCode&, Frame* sourceFrame);
+ virtual void removeItem(const String& key, Frame* sourceFrame);
+ virtual void clear(Frame* sourceFrame);
virtual bool contains(const String& key, Frame* sourceFrame) const;
virtual bool disabledByPrivateBrowsingInFrame(const Frame*) const { return false; }
static void dispatchLocalStorageEvent(
- const String& pageGroupName, const String& key, const String& oldValue, const String& newValue,
+ PageGroup*, const String& key, const String& oldValue, const String& newValue,
SecurityOrigin*, const KURL& pageURL, WebKit::WebStorageArea* sourceAreaInstance, bool originatedInProcess);
static void dispatchSessionStorageEvent(
- const String& pageGroupName, const String& key, const String& oldValue, const String& newValue,
+ PageGroup*, const String& key, const String& oldValue, const String& newValue,
SecurityOrigin*, const KURL& pageURL, const WebKit::WebStorageNamespace&,
WebKit::WebStorageArea* sourceAreaInstance, bool originatedInProcess);
private:
- void storageEvent(const String& key, const String& oldValue, const String& newValue, StorageType, SecurityOrigin*, Frame* sourceFrame);
bool canAccessStorage(Frame*) const;
static bool isEventSource(Storage*, WebKit::WebStorageArea* sourceAreaInstance);
diff --git a/Source/WebKit/chromium/src/StorageEventDispatcherImpl.cpp b/Source/WebKit/chromium/src/StorageEventDispatcherImpl.cpp
deleted file mode 100644
index e948b597c..000000000
--- a/Source/WebKit/chromium/src/StorageEventDispatcherImpl.cpp
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Copyright (C) 2009 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "StorageEventDispatcherImpl.h"
-
-#include "DOMWindow.h"
-#include "Document.h"
-#include "EventNames.h"
-#include "Frame.h"
-#include "KURL.h"
-#include "Page.h"
-#include "PageGroup.h"
-#include "SecurityOrigin.h"
-#include "StorageEvent.h"
-
-// FIXME: delete this almost obsolete file soon
-
-namespace WebCore {
-
-StorageEventDispatcherImpl::StorageEventDispatcherImpl(const String& groupName)
- : m_pageGroup(PageGroup::pageGroup(groupName))
-{
- ASSERT(m_pageGroup);
-}
-
-void StorageEventDispatcherImpl::dispatchStorageEvent(const String& key, const String& oldValue,
- const String& newValue, SecurityOrigin* securityOrigin,
- const KURL& url, StorageType storageType)
-{
- // FIXME: Implement
- if (storageType == SessionStorage)
- return;
-
- // We need to copy all relevant frames from every page to a vector since sending the event to one frame might mutate the frame tree
- // of any given page in the group or mutate the page group itself.
- Vector<RefPtr<Frame> > frames;
-
- const HashSet<Page*>& pages = m_pageGroup->pages();
- HashSet<Page*>::const_iterator end = pages.end();
- for (HashSet<Page*>::const_iterator it = pages.begin(); it != end; ++it) {
- for (Frame* frame = (*it)->mainFrame(); frame; frame = frame->tree()->traverseNext()) {
- if (frame->document()->securityOrigin()->equal(securityOrigin))
- frames.append(frame);
- }
- }
-
- for (unsigned i = 0; i < frames.size(); ++i) {
- ExceptionCode ec = 0;
- Storage* storage = frames[i]->domWindow()->localStorage(ec);
- if (!ec)
- frames[i]->document()->dispatchWindowEvent(StorageEvent::create(eventNames().storageEvent, key, oldValue, newValue, url, storage));
- }
-}
-
-} // namespace WebCore
diff --git a/Source/WebKit/chromium/src/WebContentLayerImpl.cpp b/Source/WebKit/chromium/src/WebContentLayerImpl.cpp
index 4f64d5471..4d476095d 100644
--- a/Source/WebKit/chromium/src/WebContentLayerImpl.cpp
+++ b/Source/WebKit/chromium/src/WebContentLayerImpl.cpp
@@ -30,9 +30,7 @@
#include "platform/WebRect.h"
#include "GraphicsContext.h"
#include "platform/WebCanvas.h"
-#if WEBKIT_USING_SKIA
#include "PlatformContextSkia.h"
-#endif
using namespace WebCore;
@@ -64,11 +62,7 @@ void WebContentLayerImpl::paintContents(GraphicsContext& gc, const IntRect& clip
{
if (!m_contentClient)
return;
-#if WEBKIT_USING_SKIA
WebCanvas* canvas = gc.platformContext()->canvas();
-#elif WEBKIT_USING_CG
- WebCanvas* canvas = gc.platformContext();
-#endif
m_contentClient->paintContents(canvas, WebRect(clip));
}
diff --git a/Source/WebKit/chromium/src/WebDragData.cpp b/Source/WebKit/chromium/src/WebDragData.cpp
index 61d86a388..f9846efd8 100644
--- a/Source/WebKit/chromium/src/WebDragData.cpp
+++ b/Source/WebKit/chromium/src/WebDragData.cpp
@@ -29,7 +29,6 @@
*/
#include "config.h"
-#include "platform/WebDragData.h"
#include "ChromiumDataObject.h"
#include "ClipboardMimeTypes.h"
@@ -40,6 +39,7 @@
#include "platform/WebURL.h"
#include "platform/WebVector.h"
+#include <public/WebDragData.h>
#include <wtf/HashMap.h>
#include <wtf/PassRefPtr.h>
diff --git a/Source/WebKit/chromium/src/WebFileSystemCallbacksImpl.cpp b/Source/WebKit/chromium/src/WebFileSystemCallbacksImpl.cpp
index c110e7c22..06809e54b 100644
--- a/Source/WebKit/chromium/src/WebFileSystemCallbacksImpl.cpp
+++ b/Source/WebKit/chromium/src/WebFileSystemCallbacksImpl.cpp
@@ -37,19 +37,18 @@
#include "FileMetadata.h"
#include "ScriptExecutionContext.h"
#include "WebFileInfo.h"
-#include "platform/WebFileSystem.h"
#include "WebFileSystemEntry.h"
#include "platform/WebString.h"
#include "WorkerAsyncFileSystemChromium.h"
+#include <public/WebFileSystem.h>
#include <wtf/Vector.h>
using namespace WebCore;
namespace WebKit {
-WebFileSystemCallbacksImpl::WebFileSystemCallbacksImpl(PassOwnPtr<AsyncFileSystemCallbacks> callbacks, FileSystemType type, WebCore::ScriptExecutionContext* context, FileSystemSynchronousType synchronousType)
+WebFileSystemCallbacksImpl::WebFileSystemCallbacksImpl(PassOwnPtr<AsyncFileSystemCallbacks> callbacks, ScriptExecutionContext* context, FileSystemSynchronousType synchronousType)
: m_callbacks(callbacks)
- , m_type(type)
, m_context(context)
, m_synchronousType(synchronousType)
{
@@ -92,11 +91,11 @@ void WebFileSystemCallbacksImpl::didOpenFileSystem(const WebString& name, const
#if ENABLE(WORKERS)
if (m_context && m_context->isWorkerContext()) {
- m_callbacks->didOpenFileSystem(name, WorkerAsyncFileSystemChromium::create(m_context, m_type, rootURL, m_synchronousType));
+ m_callbacks->didOpenFileSystem(name, rootURL, WorkerAsyncFileSystemChromium::create(m_context, m_synchronousType));
return;
}
#endif
- m_callbacks->didOpenFileSystem(name, AsyncFileSystemChromium::create(m_type, rootURL));
+ m_callbacks->didOpenFileSystem(name, rootURL, AsyncFileSystemChromium::create());
}
void WebFileSystemCallbacksImpl::didFail(WebFileError error)
diff --git a/Source/WebKit/chromium/src/WebFileSystemCallbacksImpl.h b/Source/WebKit/chromium/src/WebFileSystemCallbacksImpl.h
index 76e8cdf8f..e5f04081f 100644
--- a/Source/WebKit/chromium/src/WebFileSystemCallbacksImpl.h
+++ b/Source/WebKit/chromium/src/WebFileSystemCallbacksImpl.h
@@ -33,8 +33,8 @@
#include "FileSystemType.h"
#include "WebFileSystemCallbacks.h"
-#include "platform/WebFileSystem.h"
#include "platform/WebVector.h"
+#include <public/WebFileSystem.h>
#include <wtf/OwnPtr.h>
#include <wtf/PassOwnPtr.h>
@@ -52,7 +52,7 @@ class WebURL;
class WebFileSystemCallbacksImpl : public WebFileSystemCallbacks {
public:
- WebFileSystemCallbacksImpl(PassOwnPtr<WebCore::AsyncFileSystemCallbacks>, WebCore::FileSystemType = WebCore::FileSystemTypeTemporary, WebCore::ScriptExecutionContext* = 0, WebCore::FileSystemSynchronousType = WebCore::AsynchronousFileSystem);
+ WebFileSystemCallbacksImpl(PassOwnPtr<WebCore::AsyncFileSystemCallbacks>, WebCore::ScriptExecutionContext* = 0, WebCore::FileSystemSynchronousType = WebCore::AsynchronousFileSystem);
virtual ~WebFileSystemCallbacksImpl();
virtual void didSucceed();
@@ -64,9 +64,6 @@ public:
private:
OwnPtr<WebCore::AsyncFileSystemCallbacks> m_callbacks;
- // Used for openFileSystem callbacks.
- WebCore::FileSystemType m_type;
-
// Used for worker's openFileSystem callbacks.
WebCore::ScriptExecutionContext* m_context;
WebCore::FileSystemSynchronousType m_synchronousType;
diff --git a/Source/WebKit/chromium/src/WebFontImpl.cpp b/Source/WebKit/chromium/src/WebFontImpl.cpp
index f6cf39dbe..8a05aed84 100644
--- a/Source/WebKit/chromium/src/WebFontImpl.cpp
+++ b/Source/WebKit/chromium/src/WebFontImpl.cpp
@@ -99,12 +99,7 @@ void WebFontImpl::drawText(WebCanvas* canvas, const WebTextRun& run, const WebFl
GraphicsContextBuilder builder(canvas);
GraphicsContext& gc = builder.context();
-#if WEBKIT_USING_SKIA
gc.platformContext()->setDrawingToImageBuffer(!canvasIsOpaque);
-#elif WEBKIT_USING_CG
- // FIXME hook canvasIsOpaque up to the platform-specific indicators for
- // whether subpixel AA can be used for this draw.
-#endif
gc.save();
gc.setFillColor(color, ColorSpaceDeviceRGB);
diff --git a/Source/WebKit/chromium/src/WebFrameImpl.cpp b/Source/WebKit/chromium/src/WebFrameImpl.cpp
index d0e6fe238..6cccb9316 100644
--- a/Source/WebKit/chromium/src/WebFrameImpl.cpp
+++ b/Source/WebKit/chromium/src/WebFrameImpl.cpp
@@ -122,6 +122,7 @@
#include "ResourceHandle.h"
#include "ResourceRequest.h"
#include "SchemeRegistry.h"
+#include "ScriptCallStack.h"
#include "ScriptController.h"
#include "ScriptSourceCode.h"
#include "ScriptValue.h"
@@ -178,7 +179,7 @@
#include "V8DirectoryEntry.h"
#include "V8DOMFileSystem.h"
#include "V8FileEntry.h"
-#include "platform/WebFileSystem.h"
+#include <public/WebFileSystem.h>
#endif
using namespace WebCore;
@@ -595,11 +596,6 @@ WebVector<WebIconURL> WebFrameImpl::iconURLs(int iconTypes) const
return WebVector<WebIconURL>();
}
-WebReferrerPolicy WebFrameImpl::referrerPolicy() const
-{
- return static_cast<WebReferrerPolicy>(m_frame->document()->referrerPolicy());
-}
-
WebSize WebFrameImpl::scrollOffset() const
{
FrameView* view = frameView();
@@ -939,7 +935,7 @@ v8::Handle<v8::Value> WebFrameImpl::createFileSystem(WebFileSystem::Type type,
const WebString& name,
const WebString& path)
{
- return toV8(DOMFileSystem::create(frame()->document(), name, AsyncFileSystemChromium::create(static_cast<FileSystemType>(type), KURL(ParsedURLString, path.utf8().data()))));
+ return toV8(DOMFileSystem::create(frame()->document(), name, static_cast<WebCore::FileSystemType>(type), KURL(ParsedURLString, path.utf8().data()), AsyncFileSystemChromium::create()));
}
v8::Handle<v8::Value> WebFrameImpl::createFileEntry(WebFileSystem::Type type,
@@ -948,7 +944,7 @@ v8::Handle<v8::Value> WebFrameImpl::createFileEntry(WebFileSystem::Type type,
const WebString& filePath,
bool isDirectory)
{
- RefPtr<DOMFileSystemBase> fileSystem = DOMFileSystem::create(frame()->document(), fileSystemName, AsyncFileSystemChromium::create(static_cast<FileSystemType>(type), KURL(ParsedURLString, fileSystemPath.utf8().data())));
+ RefPtr<DOMFileSystemBase> fileSystem = DOMFileSystem::create(frame()->document(), fileSystemName, static_cast<WebCore::FileSystemType>(type), KURL(ParsedURLString, fileSystemPath.utf8().data()), AsyncFileSystemChromium::create());
if (isDirectory)
return toV8(DirectoryEntry::create(fileSystem, filePath));
return toV8(FileEntry::create(fileSystem, filePath));
@@ -1497,9 +1493,7 @@ float WebFrameImpl::printPage(int page, WebCanvas* canvas)
GraphicsContextBuilder builder(canvas);
GraphicsContext& gc = builder.context();
-#if WEBKIT_USING_SKIA
gc.platformContext()->setPrinting(true);
-#endif
return m_printContext->spoolPage(gc, page);
}
@@ -1865,6 +1859,14 @@ void WebFrameImpl::handleIntentFailure(int intentIdentifier, const WebString& re
{
}
+void WebFrameImpl::sendOrientationChangeEvent(int orientation)
+{
+#if ENABLE(ORIENTATION_EVENTS)
+ if (m_frame)
+ m_frame->sendOrientationChangeEvent(orientation);
+#endif
+}
+
void WebFrameImpl::addEventListener(const WebString& eventType, WebDOMEventListener* listener, bool useCapture)
{
DOMWindow* window = m_frame->domWindow();
@@ -1890,6 +1892,13 @@ bool WebFrameImpl::dispatchEvent(const WebDOMEvent& event)
return m_frame->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);
+}
+
WebString WebFrameImpl::contentAsText(size_t maxChars) const
{
if (!m_frame)
@@ -1960,9 +1969,7 @@ void WebFrameImpl::printPagesWithBoundaries(WebCanvas* canvas, const WebSize& pa
GraphicsContextBuilder builder(canvas);
GraphicsContext& graphicsContext = builder.context();
-#if WEBKIT_USING_SKIA
graphicsContext.platformContext()->setPrinting(true);
-#endif
m_printContext->spoolAllPagesWithBoundaries(graphicsContext,
FloatSize(pageSizeInPixels.width, pageSizeInPixels.height));
diff --git a/Source/WebKit/chromium/src/WebFrameImpl.h b/Source/WebKit/chromium/src/WebFrameImpl.h
index c3acc1afb..389946d05 100644
--- a/Source/WebKit/chromium/src/WebFrameImpl.h
+++ b/Source/WebKit/chromium/src/WebFrameImpl.h
@@ -72,7 +72,6 @@ public:
virtual void setName(const WebString&);
virtual long long identifier() const;
virtual WebVector<WebIconURL> iconURLs(int iconTypes) const;
- virtual WebReferrerPolicy referrerPolicy() const;
virtual WebSize scrollOffset() const;
virtual void setScrollOffset(const WebSize&);
virtual WebSize minimumScrollOffset() const;
@@ -208,11 +207,16 @@ public:
virtual void handleIntentResult(int, const WebString&);
virtual void handleIntentFailure(int, const WebString&);
+ virtual void sendOrientationChangeEvent(int orientation);
+
virtual void addEventListener(const WebString& eventType,
WebDOMEventListener*, bool useCapture);
virtual void removeEventListener(const WebString& eventType,
WebDOMEventListener*, bool useCapture);
virtual bool dispatchEvent(const WebDOMEvent&);
+ virtual void dispatchMessageEventWithOriginCheck(
+ const WebSecurityOrigin& intendedTargetOrigin,
+ const WebDOMEvent&);
virtual WebString contentAsText(size_t maxChars) const;
virtual WebString contentAsMarkup() const;
diff --git a/Source/WebKit/chromium/src/WebGraphicsContext3D.cpp b/Source/WebKit/chromium/src/WebGraphicsContext3D.cpp
index 51fbfb70d..f9e051852 100644
--- a/Source/WebKit/chromium/src/WebGraphicsContext3D.cpp
+++ b/Source/WebKit/chromium/src/WebGraphicsContext3D.cpp
@@ -30,8 +30,6 @@
namespace WebKit {
-#if WEBKIT_USING_SKIA
-
namespace {
void bindWebGraphicsContext3DGLContextCallback(const GrGLInterface* interface)
{
@@ -49,6 +47,4 @@ GrGLInterface* WebGraphicsContext3D::createGrGLInterface()
return interface;
}
-#endif
-
} // namespace WebKit
diff --git a/Source/WebKit/chromium/src/WebImageCG.cpp b/Source/WebKit/chromium/src/WebImageCG.cpp
index 0f2c0c473..242a68304 100644
--- a/Source/WebKit/chromium/src/WebImageCG.cpp
+++ b/Source/WebKit/chromium/src/WebImageCG.cpp
@@ -29,7 +29,6 @@
*/
#include "config.h"
-#include "platform/WebImage.h"
#include "Image.h"
#include "ImageSource.h"
@@ -40,6 +39,7 @@
#include <CoreGraphics/CGImage.h>
+#include <public/WebImage.h>
#include <wtf/PassRefPtr.h>
#include <wtf/RetainPtr.h>
diff --git a/Source/WebKit/chromium/src/WebImageDecoder.cpp b/Source/WebKit/chromium/src/WebImageDecoder.cpp
index 0588314ec..ad0a67e51 100644
--- a/Source/WebKit/chromium/src/WebImageDecoder.cpp
+++ b/Source/WebKit/chromium/src/WebImageDecoder.cpp
@@ -35,13 +35,12 @@
#include "ICOImageDecoder.h"
#include "SharedBuffer.h"
#include "platform/WebData.h"
-#include "platform/WebImage.h"
#include "platform/WebSize.h"
-#if WEBKIT_USING_SKIA
+#include <public/WebImage.h>
+
#include <wtf/OwnPtr.h>
#include <wtf/PassOwnPtr.h>
-#endif
#include <wtf/PassRefPtr.h>
@@ -111,13 +110,8 @@ WebImage WebImageDecoder::getFrameAtIndex(int index = 0) const
ImageFrame* const frameBuffer = m_private->frameBufferAtIndex(index);
if (!frameBuffer)
return WebImage();
-#if WEBKIT_USING_SKIA
OwnPtr<NativeImageSkia> image = adoptPtr(frameBuffer->asNewNativeImage());
return WebImage(image->bitmap());
-#elif WEBKIT_USING_CG
- // FIXME: Implement CG side of this.
- return WebImage(frameBuffer->asNewNativeImage());
-#endif
}
} // namespace WebKit
diff --git a/Source/WebKit/chromium/src/WebImageSkia.cpp b/Source/WebKit/chromium/src/WebImageSkia.cpp
index 9755f3802..36dabac3e 100644
--- a/Source/WebKit/chromium/src/WebImageSkia.cpp
+++ b/Source/WebKit/chromium/src/WebImageSkia.cpp
@@ -29,7 +29,6 @@
*/
#include "config.h"
-#include "platform/WebImage.h"
#include "Image.h"
#include "ImageSource.h"
@@ -39,6 +38,7 @@
#include "platform/WebData.h"
#include "platform/WebSize.h"
+#include <public/WebImage.h>
#include <wtf/OwnPtr.h>
#include <wtf/PassOwnPtr.h>
#include <wtf/PassRefPtr.h>
diff --git a/Source/WebKit/chromium/src/WebPluginContainerImpl.cpp b/Source/WebKit/chromium/src/WebPluginContainerImpl.cpp
index a4a585b96..6ee01efdd 100644
--- a/Source/WebKit/chromium/src/WebPluginContainerImpl.cpp
+++ b/Source/WebKit/chromium/src/WebPluginContainerImpl.cpp
@@ -34,14 +34,12 @@
#include "Chrome.h"
#include "ChromeClientImpl.h"
#include "ScrollbarGroup.h"
-#include "platform/WebClipboard.h"
#include "WebCursorInfo.h"
#include "WebDataSourceImpl.h"
#include "WebElement.h"
#include "WebInputEvent.h"
#include "WebInputEventConversion.h"
#include "WebKit.h"
-#include "platform/WebKitPlatformSupport.h"
#include "WebPlugin.h"
#include "platform/WebRect.h"
#include "platform/WebString.h"
@@ -75,14 +73,14 @@
#include "ScrollbarTheme.h"
#include "UserGestureIndicator.h"
#include "WheelEvent.h"
+#include <public/Platform.h>
+#include <public/WebClipboard.h>
#if ENABLE(GESTURE_EVENTS)
#include "PlatformGestureEvent.h"
#endif
-#if WEBKIT_USING_SKIA
#include "PlatformContextSkia.h"
-#endif
using namespace WebCore;
@@ -126,11 +124,7 @@ void WebPluginContainerImpl::paint(GraphicsContext* gc, const IntRect& damageRec
IntPoint origin = view->windowToContents(IntPoint(0, 0));
gc->translate(static_cast<float>(origin.x()), static_cast<float>(origin.y()));
-#if WEBKIT_USING_SKIA
WebCanvas* canvas = gc->platformContext()->canvas();
-#elif WEBKIT_USING_CG
- WebCanvas* canvas = gc->platformContext();
-#endif
IntRect windowRect =
IntRect(view->contentsToWindow(damageRect.location()), damageRect.size());
@@ -259,11 +253,7 @@ bool WebPluginContainerImpl::printPage(int pageNumber,
WebCore::GraphicsContext* gc)
{
gc->save();
-#if WEBKIT_USING_SKIA
WebCanvas* canvas = gc->platformContext()->canvas();
-#elif WEBKIT_USING_CG
- WebCanvas* canvas = gc->platformContext();
-#endif
bool ret = m_webPlugin->printPage(pageNumber, canvas);
gc->restore();
return ret;
@@ -279,7 +269,7 @@ void WebPluginContainerImpl::copy()
if (!m_webPlugin->hasSelection())
return;
- webKitPlatformSupport()->clipboard()->writeHTML(m_webPlugin->selectionAsMarkup(), WebURL(), m_webPlugin->selectionAsText(), false);
+ WebKit::Platform::current()->clipboard()->writeHTML(m_webPlugin->selectionAsMarkup(), WebURL(), m_webPlugin->selectionAsText(), false);
}
WebElement WebPluginContainerImpl::element()
@@ -714,9 +704,8 @@ WebCore::IntRect WebPluginContainerImpl::windowClipRect() const
if (m_element->renderer()->document()->renderer()) {
// Take our element and get the clip rect from the enclosing layer and
// frame view.
- RenderLayer* layer = m_element->renderer()->enclosingLayer();
clipRect.intersect(
- m_element->document()->view()->windowClipRectForLayer(layer, true));
+ m_element->document()->view()->windowClipRectForFrameOwner(m_element, true));
}
return clipRect;
diff --git a/Source/WebKit/chromium/src/WebStorageEventDispatcherImpl.cpp b/Source/WebKit/chromium/src/WebStorageEventDispatcherImpl.cpp
index c8036aa74..cd77cb46b 100644
--- a/Source/WebKit/chromium/src/WebStorageEventDispatcherImpl.cpp
+++ b/Source/WebKit/chromium/src/WebStorageEventDispatcherImpl.cpp
@@ -29,18 +29,19 @@
*/
#include "config.h"
-#include "WebStorageEventDispatcherImpl.h"
+#include "WebStorageEventDispatcher.h"
#include "KURL.h"
#include "SecurityOrigin.h"
#include "StorageAreaProxy.h"
+#include "WebViewImpl.h"
#include "platform/WebURL.h"
#include <wtf/PassOwnPtr.h>
-namespace WebKit {
+// FIXME: move this file to WebStorageEventDispatcher.cpp
-extern const char* pageGroupName;
+namespace WebKit {
void WebStorageEventDispatcher::dispatchLocalStorageEvent(
const WebString& key, const WebString& oldValue,
@@ -50,7 +51,7 @@ void WebStorageEventDispatcher::dispatchLocalStorageEvent(
{
RefPtr<WebCore::SecurityOrigin> securityOrigin = WebCore::SecurityOrigin::create(origin);
WebCore::StorageAreaProxy::dispatchLocalStorageEvent(
- pageGroupName, key, oldValue, newValue, securityOrigin.get(), pageURL,
+ WebViewImpl::defaultPageGroup(), key, oldValue, newValue, securityOrigin.get(), pageURL,
sourceAreaInstance, originatedInProcess);
}
@@ -62,31 +63,8 @@ void WebStorageEventDispatcher::dispatchSessionStorageEvent(
{
RefPtr<WebCore::SecurityOrigin> securityOrigin = WebCore::SecurityOrigin::create(origin);
WebCore::StorageAreaProxy::dispatchSessionStorageEvent(
- pageGroupName, key, oldValue, newValue, securityOrigin.get(), pageURL,
+ WebViewImpl::defaultPageGroup(), key, oldValue, newValue, securityOrigin.get(), pageURL,
sessionNamespace, sourceAreaInstance, originatedInProcess);
}
-
-// FIXME: remove the WebStorageEventDispatcherImpl class soon.
-
-WebStorageEventDispatcher* WebStorageEventDispatcher::create()
-{
- return new WebStorageEventDispatcherImpl();
-}
-
-WebStorageEventDispatcherImpl::WebStorageEventDispatcherImpl()
- : m_eventDispatcher(adoptPtr(new WebCore::StorageEventDispatcherImpl(pageGroupName)))
-{
- ASSERT(m_eventDispatcher);
-}
-
-void WebStorageEventDispatcherImpl::dispatchStorageEvent(const WebString& key, const WebString& oldValue,
- const WebString& newValue, const WebString& origin,
- const WebURL& pageURL, bool isLocalStorage)
-{
- WebCore::StorageType storageType = isLocalStorage ? WebCore::LocalStorage : WebCore::SessionStorage;
- RefPtr<WebCore::SecurityOrigin> securityOrigin = WebCore::SecurityOrigin::createFromString(origin);
- m_eventDispatcher->dispatchStorageEvent(key, oldValue, newValue, securityOrigin.get(), pageURL, storageType);
-}
-
} // namespace WebKit
diff --git a/Source/WebKit/chromium/src/WebTextRun.cpp b/Source/WebKit/chromium/src/WebTextRun.cpp
index d2652405c..e8037d24b 100644
--- a/Source/WebKit/chromium/src/WebTextRun.cpp
+++ b/Source/WebKit/chromium/src/WebTextRun.cpp
@@ -39,7 +39,7 @@ namespace WebKit {
WebTextRun::operator WebCore::TextRun() const
{
- return TextRun(text, false, 0, 0, TextRun::AllowTrailingExpansion, rtl ? RTL : LTR, directionalOverride);
+ return TextRun(text, 0, 0, TextRun::AllowTrailingExpansion, rtl ? RTL : LTR, directionalOverride);
}
} // namespace WebKit
diff --git a/Source/WebKit/chromium/src/WebUserMediaRequest.cpp b/Source/WebKit/chromium/src/WebUserMediaRequest.cpp
index dcd270385..c9c0eccb3 100644
--- a/Source/WebKit/chromium/src/WebUserMediaRequest.cpp
+++ b/Source/WebKit/chromium/src/WebUserMediaRequest.cpp
@@ -36,11 +36,13 @@
#include "Document.h"
#include "Frame.h"
+#include "MediaStreamDescriptor.h"
#include "MediaStreamSource.h"
#include "Page.h"
#include "SecurityOrigin.h"
#include "UserMediaRequest.h"
#include "WebSecurityOrigin.h"
+#include "platform/WebMediaStreamDescriptor.h"
#include "platform/WebMediaStreamSource.h"
#include "platform/WebString.h"
#include "platform/WebVector.h"
@@ -95,6 +97,15 @@ void WebUserMediaRequest::requestSucceeded(const WebVector<WebMediaStreamSource>
m_private->succeed(audio, video);
}
+void WebUserMediaRequest::requestSucceeded(const WebMediaStreamDescriptor& streamDescriptor)
+{
+ ASSERT(!streamDescriptor.isNull());
+ if (m_private.isNull())
+ return;
+
+ m_private->succeed(streamDescriptor);
+}
+
void WebUserMediaRequest::requestFailed()
{
m_private->fail();
@@ -109,10 +120,7 @@ bool WebUserMediaRequest::equals(const WebUserMediaRequest& other) const
void WebUserMediaRequest::assign(const WebUserMediaRequest& other)
{
- UserMediaRequest* p = other.m_private.get();
- if (p)
- p->ref();
- m_private = p;
+ m_private = other.m_private;
}
WebUserMediaRequest::operator UserMediaRequest*() const
diff --git a/Source/WebKit/chromium/src/WebViewImpl.cpp b/Source/WebKit/chromium/src/WebViewImpl.cpp
index 4318dc79d..626da8a21 100644
--- a/Source/WebKit/chromium/src/WebViewImpl.cpp
+++ b/Source/WebKit/chromium/src/WebViewImpl.cpp
@@ -143,14 +143,14 @@
#include "WheelEvent.h"
#include "cc/CCProxy.h"
#include "painting/GraphicsContextBuilder.h"
-#include "platform/WebDragData.h"
-#include "platform/WebImage.h"
#include "platform/WebKitPlatformSupport.h"
#include "platform/WebString.h"
#include "platform/WebVector.h"
#include <public/Platform.h>
+#include <public/WebDragData.h>
#include <public/WebFloatPoint.h>
#include <public/WebGraphicsContext3D.h>
+#include <public/WebImage.h>
#include <public/WebLayer.h>
#include <public/WebLayerTreeView.h>
#include <public/WebPoint.h>
@@ -658,12 +658,22 @@ bool WebViewImpl::handleGestureEvent(const WebGestureEvent& event)
}
return gestureHandled;
}
+ case WebInputEvent::GestureLongPress: {
+ if (!mainFrameImpl() || !mainFrameImpl()->frameView())
+ return false;
+
+ m_page->contextMenuController()->clearContextMenu();
+ m_contextMenuAllowed = true;
+ PlatformGestureEventBuilder platformEvent(mainFrameImpl()->frameView(), event);
+ bool handled = mainFrameImpl()->frame()->eventHandler()->sendContextMenuEventForGesture(platformEvent);
+ m_contextMenuAllowed = false;
+ return handled;
+ }
case WebInputEvent::GestureScrollBegin:
case WebInputEvent::GestureScrollEnd:
case WebInputEvent::GestureScrollUpdate:
case WebInputEvent::GestureTapDown:
case WebInputEvent::GestureDoubleTap:
- case WebInputEvent::GestureLongPress:
case WebInputEvent::GesturePinchBegin:
case WebInputEvent::GesturePinchEnd:
case WebInputEvent::GesturePinchUpdate: {
@@ -1251,6 +1261,11 @@ WebViewImpl* WebViewImpl::fromPage(Page* page)
return static_cast<WebViewImpl*>(chromeClient->webView());
}
+PageGroup* WebViewImpl::defaultPageGroup()
+{
+ return PageGroup::pageGroup(pageGroupName);
+}
+
// WebWidget ------------------------------------------------------------------
void WebViewImpl::close()
@@ -1432,6 +1447,13 @@ void WebViewImpl::updateAnimations(double monotonicFrameBeginTime)
#if ENABLE(REQUEST_ANIMATION_FRAME)
TRACE_EVENT("WebViewImpl::updateAnimations", this, 0);
+ WebFrameImpl* webframe = mainFrameImpl();
+ if (!webframe)
+ return;
+ FrameView* view = webframe->frameView();
+ if (!view)
+ return;
+
// Create synthetic wheel events as necessary for fling.
if (m_gestureAnimation) {
if (m_gestureAnimation->animate(monotonicFrameBeginTime))
@@ -1440,9 +1462,6 @@ void WebViewImpl::updateAnimations(double monotonicFrameBeginTime)
m_gestureAnimation.clear();
}
- if (!m_page)
- return;
-
PageWidgetDelegate::animate(m_page.get(), monotonicFrameBeginTime);
#endif
}
@@ -1872,8 +1891,21 @@ WebTextInputType WebViewImpl::textInputType()
return WebTextInputTypeTelephone;
if (input->isURLField())
return WebTextInputTypeURL;
+ if (input->isDateField())
+ return WebTextInputTypeDate;
+ if (input->isDateTimeField())
+ return WebTextInputTypeDateTime;
+ if (input->isDateTimeLocalField())
+ return WebTextInputTypeDateTimeLocal;
+ if (input->isMonthField())
+ return WebTextInputTypeMonth;
+ if (input->isTimeField())
+ return WebTextInputTypeTime;
+ if (input->isWeekField())
+ return WebTextInputTypeWeek;
if (input->isTextField())
return WebTextInputTypeText;
+
return WebTextInputTypeNone;
}
diff --git a/Source/WebKit/chromium/src/WebViewImpl.h b/Source/WebKit/chromium/src/WebViewImpl.h
index 9383ba28d..9b44fb68d 100644
--- a/Source/WebKit/chromium/src/WebViewImpl.h
+++ b/Source/WebKit/chromium/src/WebViewImpl.h
@@ -69,6 +69,7 @@ class HistoryItem;
class HitTestResult;
class KeyboardEvent;
class Page;
+class PageGroup;
class PagePopup;
class PagePopupClient;
class PlatformGestureCurveTarget;
@@ -300,6 +301,12 @@ public:
static WebViewImpl* fromPage(WebCore::Page*);
+ // A pageGroup identifies a namespace of pages. Page groups are used on PLATFORM(MAC)
+ // for some programs that use HTML views to display things that don't seem like
+ // web pages to the user (so shouldn't have visited link coloring). We only use
+ // one page group.
+ static WebCore::PageGroup* defaultPageGroup();
+
WebViewClient* client()
{
return m_client;
diff --git a/Source/WebKit/chromium/src/WebWorkerClientImpl.h b/Source/WebKit/chromium/src/WebWorkerClientImpl.h
index 2a865488d..f6779083b 100644
--- a/Source/WebKit/chromium/src/WebWorkerClientImpl.h
+++ b/Source/WebKit/chromium/src/WebWorkerClientImpl.h
@@ -39,8 +39,8 @@
#include "WorkerMessagingProxy.h"
#include "WorkerObjectProxy.h"
-#include "platform/WebFileSystem.h"
#include "WebWorkerBase.h"
+#include <public/WebFileSystem.h>
#include <wtf/OwnPtr.h>
#include <wtf/PassOwnPtr.h>
#include <wtf/RefPtr.h>
diff --git a/Source/WebKit/chromium/src/WorkerAsyncFileSystemChromium.cpp b/Source/WebKit/chromium/src/WorkerAsyncFileSystemChromium.cpp
index bcbca5651..09021ef44 100644
--- a/Source/WebKit/chromium/src/WorkerAsyncFileSystemChromium.cpp
+++ b/Source/WebKit/chromium/src/WorkerAsyncFileSystemChromium.cpp
@@ -38,7 +38,6 @@
#include "FileMetadata.h"
#include "FileSystem.h"
#include "NotImplemented.h"
-#include "platform/WebFileSystem.h"
#include "WebFileSystemCallbacksImpl.h"
#include "WebFileWriter.h"
#include "WebKit.h"
@@ -49,6 +48,7 @@
#include "WorkerFileSystemCallbacksBridge.h"
#include "WorkerScriptController.h"
#include "WorkerThread.h"
+#include <public/WebFileSystem.h>
#include <wtf/text/CString.h>
using namespace WebKit;
@@ -57,9 +57,8 @@ namespace WebCore {
static const char fileSystemOperationsMode[] = "fileSystemOperationsMode";
-WorkerAsyncFileSystemChromium::WorkerAsyncFileSystemChromium(ScriptExecutionContext* context, FileSystemType type, const WebKit::WebURL& rootURL, FileSystemSynchronousType synchronousType)
- : AsyncFileSystemChromium(type, rootURL)
- , m_scriptExecutionContext(context)
+WorkerAsyncFileSystemChromium::WorkerAsyncFileSystemChromium(ScriptExecutionContext* context, FileSystemSynchronousType synchronousType)
+ : m_scriptExecutionContext(context)
, m_workerContext(static_cast<WorkerContext*>(context))
, m_synchronousType(synchronousType)
{
@@ -86,54 +85,54 @@ bool WorkerAsyncFileSystemChromium::waitForOperationToComplete()
return true;
}
-void WorkerAsyncFileSystemChromium::move(const String& sourcePath, const String& destinationPath, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
+void WorkerAsyncFileSystemChromium::move(const KURL& sourcePath, const KURL& destinationPath, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
{
- createWorkerFileSystemCallbacksBridge(callbacks)->postMoveToMainThread(m_webFileSystem, virtualPathToFileSystemURL(sourcePath), virtualPathToFileSystemURL(destinationPath), m_modeForCurrentOperation);
+ createWorkerFileSystemCallbacksBridge(callbacks)->postMoveToMainThread(m_webFileSystem, sourcePath, destinationPath, m_modeForCurrentOperation);
}
-void WorkerAsyncFileSystemChromium::copy(const String& sourcePath, const String& destinationPath, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
+void WorkerAsyncFileSystemChromium::copy(const KURL& sourcePath, const KURL& destinationPath, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
{
- createWorkerFileSystemCallbacksBridge(callbacks)->postCopyToMainThread(m_webFileSystem, virtualPathToFileSystemURL(sourcePath), virtualPathToFileSystemURL(destinationPath), m_modeForCurrentOperation);
+ createWorkerFileSystemCallbacksBridge(callbacks)->postCopyToMainThread(m_webFileSystem, sourcePath, destinationPath, m_modeForCurrentOperation);
}
-void WorkerAsyncFileSystemChromium::remove(const String& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
+void WorkerAsyncFileSystemChromium::remove(const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
{
- createWorkerFileSystemCallbacksBridge(callbacks)->postRemoveToMainThread(m_webFileSystem, virtualPathToFileSystemURL(path), m_modeForCurrentOperation);
+ createWorkerFileSystemCallbacksBridge(callbacks)->postRemoveToMainThread(m_webFileSystem, path, m_modeForCurrentOperation);
}
-void WorkerAsyncFileSystemChromium::removeRecursively(const String& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
+void WorkerAsyncFileSystemChromium::removeRecursively(const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
{
- createWorkerFileSystemCallbacksBridge(callbacks)->postRemoveRecursivelyToMainThread(m_webFileSystem, virtualPathToFileSystemURL(path), m_modeForCurrentOperation);
+ createWorkerFileSystemCallbacksBridge(callbacks)->postRemoveRecursivelyToMainThread(m_webFileSystem, path, m_modeForCurrentOperation);
}
-void WorkerAsyncFileSystemChromium::readMetadata(const String& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
+void WorkerAsyncFileSystemChromium::readMetadata(const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
{
- createWorkerFileSystemCallbacksBridge(callbacks)->postReadMetadataToMainThread(m_webFileSystem, virtualPathToFileSystemURL(path), m_modeForCurrentOperation);
+ createWorkerFileSystemCallbacksBridge(callbacks)->postReadMetadataToMainThread(m_webFileSystem, path, m_modeForCurrentOperation);
}
-void WorkerAsyncFileSystemChromium::createFile(const String& path, bool exclusive, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
+void WorkerAsyncFileSystemChromium::createFile(const KURL& path, bool exclusive, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
{
- createWorkerFileSystemCallbacksBridge(callbacks)->postCreateFileToMainThread(m_webFileSystem, virtualPathToFileSystemURL(path), exclusive, m_modeForCurrentOperation);
+ createWorkerFileSystemCallbacksBridge(callbacks)->postCreateFileToMainThread(m_webFileSystem, path, exclusive, m_modeForCurrentOperation);
}
-void WorkerAsyncFileSystemChromium::createDirectory(const String& path, bool exclusive, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
+void WorkerAsyncFileSystemChromium::createDirectory(const KURL& path, bool exclusive, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
{
- createWorkerFileSystemCallbacksBridge(callbacks)->postCreateDirectoryToMainThread(m_webFileSystem, virtualPathToFileSystemURL(path), exclusive, m_modeForCurrentOperation);
+ createWorkerFileSystemCallbacksBridge(callbacks)->postCreateDirectoryToMainThread(m_webFileSystem, path, exclusive, m_modeForCurrentOperation);
}
-void WorkerAsyncFileSystemChromium::fileExists(const String& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
+void WorkerAsyncFileSystemChromium::fileExists(const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
{
- createWorkerFileSystemCallbacksBridge(callbacks)->postFileExistsToMainThread(m_webFileSystem, virtualPathToFileSystemURL(path), m_modeForCurrentOperation);
+ createWorkerFileSystemCallbacksBridge(callbacks)->postFileExistsToMainThread(m_webFileSystem, path, m_modeForCurrentOperation);
}
-void WorkerAsyncFileSystemChromium::directoryExists(const String& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
+void WorkerAsyncFileSystemChromium::directoryExists(const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
{
- createWorkerFileSystemCallbacksBridge(callbacks)->postDirectoryExistsToMainThread(m_webFileSystem, virtualPathToFileSystemURL(path), m_modeForCurrentOperation);
+ createWorkerFileSystemCallbacksBridge(callbacks)->postDirectoryExistsToMainThread(m_webFileSystem, path, m_modeForCurrentOperation);
}
-void WorkerAsyncFileSystemChromium::readDirectory(const String& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
+void WorkerAsyncFileSystemChromium::readDirectory(const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
{
- createWorkerFileSystemCallbacksBridge(callbacks)->postReadDirectoryToMainThread(m_webFileSystem, virtualPathToFileSystemURL(path), m_modeForCurrentOperation);
+ createWorkerFileSystemCallbacksBridge(callbacks)->postReadDirectoryToMainThread(m_webFileSystem, path, m_modeForCurrentOperation);
}
class WorkerFileWriterHelperCallbacks : public AsyncFileSystemCallbacks {
@@ -143,11 +142,6 @@ public:
return adoptPtr(new WorkerFileWriterHelperCallbacks(client, path, webFileSystem, callbacks, workerContext));
}
- virtual void didSucceed()
- {
- ASSERT_NOT_REACHED();
- }
-
virtual void didReadMetadata(const FileMetadata& metadata)
{
ASSERT(m_callbacks);
@@ -159,27 +153,6 @@ public:
}
}
- virtual void didReadDirectoryEntry(const String& name, bool isDirectory)
- {
- ASSERT_NOT_REACHED();
- }
-
- virtual void didReadDirectoryEntries(bool hasMore)
- {
- ASSERT_NOT_REACHED();
- }
-
- virtual void didOpenFileSystem(const String&, PassOwnPtr<AsyncFileSystem>)
- {
- ASSERT_NOT_REACHED();
- }
-
- // Called when an AsyncFileWrter has been created successfully.
- virtual void didCreateFileWriter(PassOwnPtr<AsyncFileWriter>, long long)
- {
- ASSERT_NOT_REACHED();
- }
-
virtual void didFail(int code)
{
ASSERT(m_callbacks);
@@ -203,18 +176,16 @@ private:
WorkerContext* m_workerContext;
};
-void WorkerAsyncFileSystemChromium::createWriter(AsyncFileWriterClient* client, const String& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
+void WorkerAsyncFileSystemChromium::createWriter(AsyncFileWriterClient* client, const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
{
- KURL pathAsURL = virtualPathToFileSystemURL(path);
- createWorkerFileSystemCallbacksBridge(WorkerFileWriterHelperCallbacks::create(client, pathAsURL, m_webFileSystem, callbacks, m_workerContext))->postReadMetadataToMainThread(m_webFileSystem, pathAsURL, m_modeForCurrentOperation);
+ createWorkerFileSystemCallbacksBridge(WorkerFileWriterHelperCallbacks::create(client, path, m_webFileSystem, callbacks, m_workerContext))->postReadMetadataToMainThread(m_webFileSystem, path, m_modeForCurrentOperation);
}
-void WorkerAsyncFileSystemChromium::createSnapshotFileAndReadMetadata(const String& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
+void WorkerAsyncFileSystemChromium::createSnapshotFileAndReadMetadata(const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
{
- KURL pathAsURL = virtualPathToFileSystemURL(path);
KURL internalBlobURL = BlobURL::createInternalURL();
- createWorkerFileSystemCallbacksBridge(createSnapshotFileCallback(internalBlobURL, callbacks))->postCreateSnapshotFileToMainThread(m_webFileSystem, internalBlobURL, pathAsURL, m_modeForCurrentOperation);
+ createWorkerFileSystemCallbacksBridge(createSnapshotFileCallback(internalBlobURL, callbacks))->postCreateSnapshotFileToMainThread(m_webFileSystem, internalBlobURL, path, m_modeForCurrentOperation);
}
PassRefPtr<WorkerFileSystemCallbacksBridge> WorkerAsyncFileSystemChromium::createWorkerFileSystemCallbacksBridge(PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
diff --git a/Source/WebKit/chromium/src/WorkerAsyncFileSystemChromium.h b/Source/WebKit/chromium/src/WorkerAsyncFileSystemChromium.h
index 2618c48b9..6727d1e47 100644
--- a/Source/WebKit/chromium/src/WorkerAsyncFileSystemChromium.h
+++ b/Source/WebKit/chromium/src/WorkerAsyncFileSystemChromium.h
@@ -53,9 +53,9 @@ class WorkerContext;
class WorkerAsyncFileSystemChromium : public AsyncFileSystemChromium {
public:
- static PassOwnPtr<AsyncFileSystem> create(ScriptExecutionContext* context, FileSystemType type, const WebKit::WebURL& rootURL, FileSystemSynchronousType synchronousType)
+ static PassOwnPtr<AsyncFileSystem> create(ScriptExecutionContext* context, FileSystemSynchronousType synchronousType)
{
- return adoptPtr(new WorkerAsyncFileSystemChromium(context, type, rootURL, synchronousType));
+ return adoptPtr(new WorkerAsyncFileSystemChromium(context, synchronousType));
}
virtual ~WorkerAsyncFileSystemChromium();
@@ -63,21 +63,21 @@ public:
// Runs one pending operation (to wait for completion in the sync-mode).
virtual bool waitForOperationToComplete();
- virtual void move(const String& sourcePath, const String& destinationPath, PassOwnPtr<AsyncFileSystemCallbacks>);
- virtual void copy(const String& sourcePath, const String& destinationPath, PassOwnPtr<AsyncFileSystemCallbacks>);
- virtual void remove(const String& path, PassOwnPtr<AsyncFileSystemCallbacks>);
- virtual void removeRecursively(const String& path, PassOwnPtr<AsyncFileSystemCallbacks>);
- virtual void readMetadata(const String& path, PassOwnPtr<AsyncFileSystemCallbacks>);
- virtual void createFile(const String& path, bool exclusive, PassOwnPtr<AsyncFileSystemCallbacks>);
- virtual void createDirectory(const String& path, bool exclusive, PassOwnPtr<AsyncFileSystemCallbacks>);
- virtual void fileExists(const String& path, PassOwnPtr<AsyncFileSystemCallbacks>);
- virtual void directoryExists(const String& path, PassOwnPtr<AsyncFileSystemCallbacks>);
- virtual void readDirectory(const String& path, PassOwnPtr<AsyncFileSystemCallbacks>);
- virtual void createWriter(AsyncFileWriterClient* client, const String& path, PassOwnPtr<AsyncFileSystemCallbacks>);
- virtual void createSnapshotFileAndReadMetadata(const String& path, PassOwnPtr<AsyncFileSystemCallbacks>);
+ virtual void move(const KURL& sourcePath, const KURL& destinationPath, PassOwnPtr<AsyncFileSystemCallbacks>);
+ virtual void copy(const KURL& sourcePath, const KURL& destinationPath, PassOwnPtr<AsyncFileSystemCallbacks>);
+ virtual void remove(const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks>);
+ virtual void removeRecursively(const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks>);
+ virtual void readMetadata(const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks>);
+ virtual void createFile(const KURL& path, bool exclusive, PassOwnPtr<AsyncFileSystemCallbacks>);
+ virtual void createDirectory(const KURL& path, bool exclusive, PassOwnPtr<AsyncFileSystemCallbacks>);
+ virtual void fileExists(const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks>);
+ virtual void directoryExists(const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks>);
+ virtual void readDirectory(const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks>);
+ virtual void createWriter(AsyncFileWriterClient*, const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks>);
+ virtual void createSnapshotFileAndReadMetadata(const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks>);
private:
- WorkerAsyncFileSystemChromium(ScriptExecutionContext*, FileSystemType, const WebKit::WebURL& rootURL, FileSystemSynchronousType);
+ WorkerAsyncFileSystemChromium(ScriptExecutionContext*, FileSystemSynchronousType);
PassRefPtr<WebKit::WorkerFileSystemCallbacksBridge> createWorkerFileSystemCallbacksBridge(PassOwnPtr<AsyncFileSystemCallbacks>);
diff --git a/Source/WebKit/chromium/src/WorkerAsyncFileWriterChromium.cpp b/Source/WebKit/chromium/src/WorkerAsyncFileWriterChromium.cpp
index 054ecbb1f..6d62098a6 100644
--- a/Source/WebKit/chromium/src/WorkerAsyncFileWriterChromium.cpp
+++ b/Source/WebKit/chromium/src/WorkerAsyncFileWriterChromium.cpp
@@ -36,7 +36,6 @@
#include "AsyncFileSystem.h"
#include "Blob.h"
#include "ScriptExecutionContext.h"
-#include "platform/WebFileSystem.h"
#include "WebFileWriter.h"
#include "platform/WebURL.h"
#include "WebWorkerBase.h"
@@ -44,6 +43,7 @@
#include "WorkerFileWriterCallbacksBridge.h"
#include "WorkerLoaderProxy.h"
#include "WorkerThread.h"
+#include <public/WebFileSystem.h>
#include <wtf/Assertions.h>
using namespace WebKit;
diff --git a/Source/WebKit/chromium/src/WorkerFileSystemCallbacksBridge.h b/Source/WebKit/chromium/src/WorkerFileSystemCallbacksBridge.h
index e496de2ef..fa70dd261 100644
--- a/Source/WebKit/chromium/src/WorkerFileSystemCallbacksBridge.h
+++ b/Source/WebKit/chromium/src/WorkerFileSystemCallbacksBridge.h
@@ -36,8 +36,8 @@
#include "PlatformString.h"
#include "ScriptExecutionContext.h"
#include "WebFileError.h"
-#include "platform/WebFileSystem.h"
#include "platform/WebVector.h"
+#include <public/WebFileSystem.h>
#include <wtf/PassOwnPtr.h>
#include <wtf/PassRefPtr.h>
#include <wtf/Threading.h>
diff --git a/Source/WebKit/chromium/src/WorkerFileWriterCallbacksBridge.cpp b/Source/WebKit/chromium/src/WorkerFileWriterCallbacksBridge.cpp
index 26a0ae34f..3ffb178c5 100644
--- a/Source/WebKit/chromium/src/WorkerFileWriterCallbacksBridge.cpp
+++ b/Source/WebKit/chromium/src/WorkerFileWriterCallbacksBridge.cpp
@@ -36,14 +36,14 @@
#include "AsyncFileWriterClient.h"
#include "CrossThreadTask.h"
#include "platform/WebCString.h"
-#include "platform/WebFileSystem.h"
#include "WebFileWriter.h"
#include "WebKit.h"
-#include "platform/WebKitPlatformSupport.h"
#include "WebWorkerBase.h"
#include "WorkerContext.h"
#include "WorkerLoaderProxy.h"
#include "WorkerThread.h"
+#include <public/Platform.h>
+#include <public/WebFileSystem.h>
#include <wtf/MainThread.h>
#include <wtf/Threading.h>
@@ -104,7 +104,7 @@ void WorkerFileWriterCallbacksBridge::abortOnMainThread(ScriptExecutionContext*,
void WorkerFileWriterCallbacksBridge::initOnMainThread(ScriptExecutionContext*, PassRefPtr<WorkerFileWriterCallbacksBridge> bridge, const KURL& path)
{
ASSERT(!bridge->m_writer);
- bridge->m_writer = adoptPtr(webKitPlatformSupport()->fileSystem()->createFileWriter(path, bridge.get()));
+ bridge->m_writer = adoptPtr(WebKit::Platform::current()->fileSystem()->createFileWriter(path, bridge.get()));
}
void WorkerFileWriterCallbacksBridge::shutdownOnMainThread(ScriptExecutionContext*, PassRefPtr<WorkerFileWriterCallbacksBridge> bridge)
diff --git a/Source/WebKit/chromium/src/painting/GraphicsContextBuilder.h b/Source/WebKit/chromium/src/painting/GraphicsContextBuilder.h
index 5ffae8ebc..79708b396 100644
--- a/Source/WebKit/chromium/src/painting/GraphicsContextBuilder.h
+++ b/Source/WebKit/chromium/src/painting/GraphicsContextBuilder.h
@@ -33,33 +33,10 @@
#include "GraphicsContext.h"
-#if WEBKIT_USING_CG
-#include "LocalCurrentGraphicsContext.h"
-#elif WEBKIT_USING_SKIA
#include "PlatformContextSkia.h"
-#endif
namespace WebKit {
-#if WEBKIT_USING_CG
-
-class GraphicsContextBuilder {
-public:
- GraphicsContextBuilder(WebCanvas* canvas)
- : m_graphicsContext(canvas)
- , m_localContext(&m_graphicsContext)
- {
- }
-
- WebCore::GraphicsContext& context() { return m_graphicsContext; }
-
-private:
- WebCore::GraphicsContext m_graphicsContext;
- WebCore::LocalCurrentGraphicsContext m_localContext;
-};
-
-#elif WEBKIT_USING_SKIA
-
class GraphicsContextBuilder {
public:
GraphicsContextBuilder(WebCanvas* canvas)
@@ -75,10 +52,6 @@ private:
WebCore::GraphicsContext m_graphicsContext;
};
-#else
-#error "Need to define GraphicsContextBuilder!"
-#endif
-
} // namespace WebKit
#endif
diff --git a/Source/WebKit/chromium/tests/CCActiveAnimationTest.cpp b/Source/WebKit/chromium/tests/CCActiveAnimationTest.cpp
index a1ab770b7..af9fde1d5 100644
--- a/Source/WebKit/chromium/tests/CCActiveAnimationTest.cpp
+++ b/Source/WebKit/chromium/tests/CCActiveAnimationTest.cpp
@@ -69,6 +69,16 @@ TEST(CCActiveAnimationTest, TrimTimeInfiniteIterations)
EXPECT_EQ(0.5, anim->trimTimeToCurrentIteration(1.5));
}
+TEST(CCActiveAnimationTest, TrimTimeAlternating)
+{
+ OwnPtr<CCActiveAnimation> anim(createActiveAnimation(-1));
+ anim->setAlternatesDirection(true);
+ EXPECT_EQ(0, anim->trimTimeToCurrentIteration(0));
+ EXPECT_EQ(0.5, anim->trimTimeToCurrentIteration(0.5));
+ EXPECT_EQ(1, anim->trimTimeToCurrentIteration(1));
+ EXPECT_EQ(0.75, anim->trimTimeToCurrentIteration(1.25));
+}
+
TEST(CCActiveAnimationTest, TrimTimeStartTime)
{
OwnPtr<CCActiveAnimation> anim(createActiveAnimation(1));
diff --git a/Source/WebKit/chromium/tests/CCLayerAnimationControllerTest.cpp b/Source/WebKit/chromium/tests/CCLayerAnimationControllerTest.cpp
index fa95a2ac5..1d5409f98 100644
--- a/Source/WebKit/chromium/tests/CCLayerAnimationControllerTest.cpp
+++ b/Source/WebKit/chromium/tests/CCLayerAnimationControllerTest.cpp
@@ -86,34 +86,45 @@ TEST(CCLayerAnimationControllerTest, createOpacityAnimation)
EXPECT_EQ(1, curve->getValue(duration));
}
-TEST(CCLayerAnimationControllerTest, ignoreUnsupportedAnimationDirections)
+TEST(CCLayerAnimationControllerTest, createTransformAnimation)
{
FakeLayerAnimationControllerClient dummy;
OwnPtr<CCLayerAnimationController> controller(CCLayerAnimationController::create(&dummy));
const double duration = 1;
- WebCore::KeyframeValueList values(AnimatedPropertyOpacity);
- values.insert(new FloatAnimationValue(0, 0));
- values.insert(new FloatAnimationValue(duration, 1));
+ WebCore::KeyframeValueList values(AnimatedPropertyWebkitTransform);
+
+ TransformOperations operations1;
+ operations1.operations().append(TranslateTransformOperation::create(Length(2, Fixed), Length(0, Fixed), TransformOperation::TRANSLATE_X));
+ values.insert(new TransformAnimationValue(0, &operations1));
+
+ TransformOperations operations2;
+ operations2.operations().append(TranslateTransformOperation::create(Length(4, Fixed), Length(0, Fixed), TransformOperation::TRANSLATE_X));
+ values.insert(new TransformAnimationValue(duration, &operations2));
RefPtr<Animation> animation = Animation::create();
animation->setDuration(duration);
IntSize boxSize;
+ controller->addAnimation(values, boxSize, animation.get(), 0, 0, 0);
- animation->setDirection(Animation::AnimationDirectionAlternate);
- EXPECT_FALSE(controller->addAnimation(values, boxSize, animation.get(), 0, 0, 0));
+ EXPECT_TRUE(controller->hasActiveAnimation());
- animation->setDirection(Animation::AnimationDirectionAlternateReverse);
- EXPECT_FALSE(controller->addAnimation(values, boxSize, animation.get(), 0, 0, 0));
+ CCActiveAnimation* activeAnimation = controller->getActiveAnimation(0, CCActiveAnimation::Transform);
+ EXPECT_TRUE(activeAnimation);
- animation->setDirection(Animation::AnimationDirectionReverse);
- EXPECT_FALSE(controller->addAnimation(values, boxSize, animation.get(), 0, 0, 0));
+ EXPECT_EQ(1, activeAnimation->iterations());
+ EXPECT_EQ(CCActiveAnimation::Transform, activeAnimation->targetProperty());
+
+ EXPECT_EQ(CCAnimationCurve::Transform, activeAnimation->curve()->type());
- animation->setDirection(Animation::AnimationDirectionNormal);
- EXPECT_TRUE(controller->addAnimation(values, boxSize, animation.get(), 0, 0, 0));
+ const CCTransformAnimationCurve* curve = activeAnimation->curve()->toTransformAnimationCurve();
+ EXPECT_TRUE(curve);
+
+ expectTranslateX(2, curve->getValue(0, boxSize));
+ expectTranslateX(4, curve->getValue(duration, boxSize));
}
-TEST(CCLayerAnimationControllerTest, createTransformAnimation)
+TEST(CCLayerAnimationControllerTest, createReversedAnimation)
{
FakeLayerAnimationControllerClient dummy;
OwnPtr<CCLayerAnimationController> controller(CCLayerAnimationController::create(&dummy));
@@ -130,6 +141,7 @@ TEST(CCLayerAnimationControllerTest, createTransformAnimation)
RefPtr<Animation> animation = Animation::create();
animation->setDuration(duration);
+ animation->setDirection(Animation::AnimationDirectionReverse);
IntSize boxSize;
controller->addAnimation(values, boxSize, animation.get(), 0, 0, 0);
@@ -147,10 +159,92 @@ TEST(CCLayerAnimationControllerTest, createTransformAnimation)
const CCTransformAnimationCurve* curve = activeAnimation->curve()->toTransformAnimationCurve();
EXPECT_TRUE(curve);
+ expectTranslateX(4, curve->getValue(0, boxSize));
+ expectTranslateX(2, curve->getValue(duration, boxSize));
+}
+
+TEST(CCLayerAnimationControllerTest, createAlternatingAnimation)
+{
+ FakeLayerAnimationControllerClient dummy;
+ OwnPtr<CCLayerAnimationController> controller(CCLayerAnimationController::create(&dummy));
+ const double duration = 1;
+ WebCore::KeyframeValueList values(AnimatedPropertyWebkitTransform);
+
+ TransformOperations operations1;
+ operations1.operations().append(TranslateTransformOperation::create(Length(2, Fixed), Length(0, Fixed), TransformOperation::TRANSLATE_X));
+ values.insert(new TransformAnimationValue(0, &operations1));
+
+ TransformOperations operations2;
+ operations2.operations().append(TranslateTransformOperation::create(Length(4, Fixed), Length(0, 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;
+ controller->addAnimation(values, boxSize, animation.get(), 0, 0, 0);
+
+ EXPECT_TRUE(controller->hasActiveAnimation());
+
+ CCActiveAnimation* activeAnimation = controller->getActiveAnimation(0, 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, boxSize));
expectTranslateX(4, curve->getValue(duration, boxSize));
}
+TEST(CCLayerAnimationControllerTest, createReversedAlternatingAnimation)
+{
+ FakeLayerAnimationControllerClient dummy;
+ OwnPtr<CCLayerAnimationController> controller(CCLayerAnimationController::create(&dummy));
+ const double duration = 1;
+ WebCore::KeyframeValueList values(AnimatedPropertyWebkitTransform);
+
+ TransformOperations operations1;
+ operations1.operations().append(TranslateTransformOperation::create(Length(2, Fixed), Length(0, Fixed), TransformOperation::TRANSLATE_X));
+ values.insert(new TransformAnimationValue(0, &operations1));
+
+ TransformOperations operations2;
+ operations2.operations().append(TranslateTransformOperation::create(Length(4, Fixed), Length(0, 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;
+ controller->addAnimation(values, boxSize, animation.get(), 0, 0, 0);
+
+ EXPECT_TRUE(controller->hasActiveAnimation());
+
+ CCActiveAnimation* activeAnimation = controller->getActiveAnimation(0, 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, boxSize));
+ expectTranslateX(2, curve->getValue(duration, boxSize));
+}
+
TEST(CCLayerAnimationControllerTest, syncNewAnimation)
{
FakeLayerAnimationControllerClient dummyImpl;
diff --git a/Source/WebKit/chromium/tests/CCLayerTreeHostCommonTest.cpp b/Source/WebKit/chromium/tests/CCLayerTreeHostCommonTest.cpp
index 51a032618..d243aee4a 100644
--- a/Source/WebKit/chromium/tests/CCLayerTreeHostCommonTest.cpp
+++ b/Source/WebKit/chromium/tests/CCLayerTreeHostCommonTest.cpp
@@ -1172,7 +1172,7 @@ TEST(CCLayerTreeHostCommonTest, verifyVisibleRectFor3dOrthographicIsNotClippedBe
EXPECT_INT_RECT_EQ(expected, actual);
}
-TEST(CCLayerTreeHostCommonTest, verifyVisibleRectFor3dPerspectiveIsClipped)
+TEST(CCLayerTreeHostCommonTest, verifyVisibleRectFor3dPerspectiveWhenClippedByW)
{
// Test the calculateVisibleRect() function works correctly when projecting a surface
// onto a layer, but the layer is partially behind the camera (not just behind the
@@ -1190,7 +1190,7 @@ TEST(CCLayerTreeHostCommonTest, verifyVisibleRectFor3dPerspectiveIsClipped)
// center of the layer.
layerToSurfaceTransform.makeIdentity();
layerToSurfaceTransform.applyPerspective(1);
- layerToSurfaceTransform.translate3d(0, 0, 1);
+ layerToSurfaceTransform.translate3d(-1, 0, 1);
layerToSurfaceTransform.rotate3d(0, 45, 0);
// Sanity check that this transform does indeed cause w < 0 when applying the
@@ -1199,7 +1199,7 @@ TEST(CCLayerTreeHostCommonTest, verifyVisibleRectFor3dPerspectiveIsClipped)
CCMathUtil::mapQuad(layerToSurfaceTransform, FloatQuad(FloatRect(layerContentRect)), clipped);
ASSERT_TRUE(clipped);
- int expectedXPosition = -10;
+ int expectedXPosition = 0;
int expectedWidth = 10;
IntRect actual = CCLayerTreeHostCommon::calculateVisibleRect(targetSurfaceRect, layerContentRect, layerToSurfaceTransform);
EXPECT_EQ(expectedXPosition, actual.x());
diff --git a/Source/WebKit/chromium/tests/CCLayerTreeHostImplTest.cpp b/Source/WebKit/chromium/tests/CCLayerTreeHostImplTest.cpp
index ff2497085..58668d0ef 100644
--- a/Source/WebKit/chromium/tests/CCLayerTreeHostImplTest.cpp
+++ b/Source/WebKit/chromium/tests/CCLayerTreeHostImplTest.cpp
@@ -28,6 +28,7 @@
#include "CCAnimationTestCommon.h"
#include "CCLayerTestCommon.h"
+#include "CCTiledLayerTestCommon.h"
#include "FakeWebGraphicsContext3D.h"
#include "GraphicsContext3DPrivate.h"
#include "LayerRendererChromium.h"
@@ -59,6 +60,8 @@ public:
{
CCSettings settings;
m_hostImpl = CCLayerTreeHostImpl::create(settings, this);
+ m_hostImpl->initializeLayerRenderer(createContext(), adoptPtr(new FakeTextureUploader));
+ m_hostImpl->setViewportSize(IntSize(10, 10));
}
virtual void didLoseContextOnImplThread() OVERRIDE { }
@@ -254,8 +257,6 @@ TEST_F(CCLayerTreeHostImplTest, nonFastScrollableRegionBasic)
TEST_F(CCLayerTreeHostImplTest, nonFastScrollableRegionWithOffset)
{
- m_hostImpl->initializeLayerRenderer(createContext());
-
OwnPtr<CCLayerImpl> root = CCLayerImpl::create(0);
root->setScrollable(true);
root->setScrollPosition(IntPoint(0, 0));
@@ -440,49 +441,51 @@ private:
TEST_F(CCLayerTreeHostImplTest, didDrawNotCalledOnHiddenLayer)
{
- m_hostImpl->initializeLayerRenderer(createContext());
-
- // Ensure visibleLayerRect for root layer is empty
- m_hostImpl->setViewportSize(IntSize(0, 0));
-
+ // The root layer is always drawn, so run this test on a child layer that
+ // will be masked out by the root layer's bounds.
m_hostImpl->setRootLayer(DidDrawCheckLayer::create(0));
DidDrawCheckLayer* root = static_cast<DidDrawCheckLayer*>(m_hostImpl->rootLayer());
+ root->setMasksToBounds(true);
+
+ root->addChild(DidDrawCheckLayer::create(1));
+ DidDrawCheckLayer* layer = static_cast<DidDrawCheckLayer*>(root->children()[0].get());
+ // Ensure visibleLayerRect for layer is empty
+ layer->setPosition(FloatPoint(100, 100));
+ layer->setBounds(IntSize(10, 10));
+ layer->setContentBounds(IntSize(10, 10));
CCLayerTreeHostImpl::FrameData frame;
- EXPECT_FALSE(root->willDrawCalled());
- EXPECT_FALSE(root->didDrawCalled());
+ EXPECT_FALSE(layer->willDrawCalled());
+ EXPECT_FALSE(layer->didDrawCalled());
EXPECT_TRUE(m_hostImpl->prepareToDraw(frame));
m_hostImpl->drawLayers(frame);
m_hostImpl->didDrawAllLayers(frame);
- EXPECT_FALSE(root->willDrawCalled());
- EXPECT_FALSE(root->didDrawCalled());
+ EXPECT_FALSE(layer->willDrawCalled());
+ EXPECT_FALSE(layer->didDrawCalled());
- EXPECT_TRUE(root->visibleLayerRect().isEmpty());
+ EXPECT_TRUE(layer->visibleLayerRect().isEmpty());
- // Ensure visibleLayerRect for root layer is not empty
- m_hostImpl->setViewportSize(IntSize(10, 10));
+ // Ensure visibleLayerRect for layer layer is not empty
+ layer->setPosition(FloatPoint(0, 0));
- EXPECT_FALSE(root->willDrawCalled());
- EXPECT_FALSE(root->didDrawCalled());
+ EXPECT_FALSE(layer->willDrawCalled());
+ EXPECT_FALSE(layer->didDrawCalled());
EXPECT_TRUE(m_hostImpl->prepareToDraw(frame));
m_hostImpl->drawLayers(frame);
m_hostImpl->didDrawAllLayers(frame);
- EXPECT_TRUE(root->willDrawCalled());
- EXPECT_TRUE(root->didDrawCalled());
+ EXPECT_TRUE(layer->willDrawCalled());
+ EXPECT_TRUE(layer->didDrawCalled());
- EXPECT_FALSE(root->visibleLayerRect().isEmpty());
+ EXPECT_FALSE(layer->visibleLayerRect().isEmpty());
}
TEST_F(CCLayerTreeHostImplTest, didDrawCalledOnAllLayers)
{
- m_hostImpl->initializeLayerRenderer(createContext());
- m_hostImpl->setViewportSize(IntSize(10, 10));
-
m_hostImpl->setRootLayer(DidDrawCheckLayer::create(0));
DidDrawCheckLayer* root = static_cast<DidDrawCheckLayer*>(m_hostImpl->rootLayer());
@@ -533,9 +536,6 @@ private:
TEST_F(CCLayerTreeHostImplTest, prepareToDrawFailsWhenAnimationUsesCheckerboard)
{
- m_hostImpl->initializeLayerRenderer(createContext());
- m_hostImpl->setViewportSize(IntSize(10, 10));
-
// When the texture is not missing, we draw as usual.
m_hostImpl->setRootLayer(DidDrawCheckLayer::create(0));
DidDrawCheckLayer* root = static_cast<DidDrawCheckLayer*>(m_hostImpl->rootLayer());
@@ -660,8 +660,6 @@ private:
// https://bugs.webkit.org/show_bug.cgi?id=75783
TEST_F(CCLayerTreeHostImplTest, blendingOffWhenDrawingOpaqueLayers)
{
- m_hostImpl->initializeLayerRenderer(createContext());
- m_hostImpl->setViewportSize(IntSize(10, 10));
{
OwnPtr<CCLayerImpl> root = CCLayerImpl::create(0);
@@ -878,7 +876,7 @@ TEST_F(CCLayerTreeHostImplTest, blendingOffWhenDrawingOpaqueLayers)
TEST_F(CCLayerTreeHostImplTest, viewportCovered)
{
- m_hostImpl->initializeLayerRenderer(createContext());
+ m_hostImpl->initializeLayerRenderer(createContext(), adoptPtr(new FakeTextureUploader));
m_hostImpl->setBackgroundColor(Color::gray);
IntSize viewportSize(1000, 1000);
@@ -989,8 +987,7 @@ TEST_F(CCLayerTreeHostImplTest, reshapeNotCalledUntilDraw)
{
ReshapeTrackerContext* reshapeTracker = new ReshapeTrackerContext();
RefPtr<GraphicsContext3D> context = GraphicsContext3DPrivate::createGraphicsContextFromWebContext(adoptPtr(reshapeTracker), GraphicsContext3D::RenderDirectlyToHostWindow);
- m_hostImpl->initializeLayerRenderer(context);
- m_hostImpl->setViewportSize(IntSize(10, 10));
+ m_hostImpl->initializeLayerRenderer(context, adoptPtr(new FakeTextureUploader));
CCLayerImpl* root = new FakeDrawableCCLayerImpl(1);
root->setAnchorPoint(FloatPoint(0, 0));
@@ -1039,7 +1036,7 @@ TEST_F(CCLayerTreeHostImplTest, partialSwapReceivesDamageRect)
CCSettings settings;
settings.partialSwapEnabled = true;
OwnPtr<CCLayerTreeHostImpl> layerTreeHostImpl = CCLayerTreeHostImpl::create(settings, this);
- layerTreeHostImpl->initializeLayerRenderer(context);
+ layerTreeHostImpl->initializeLayerRenderer(context, adoptPtr(new FakeTextureUploader()));
layerTreeHostImpl->setViewportSize(IntSize(500, 500));
CCLayerImpl* root = new FakeDrawableCCLayerImpl(1);
@@ -1125,9 +1122,6 @@ private:
TEST_F(CCLayerTreeHostImplTest, contextLostAndRestoredNotificationSentToAllLayers)
{
- m_hostImpl->initializeLayerRenderer(createContext());
- m_hostImpl->setViewportSize(IntSize(10, 10));
-
m_hostImpl->setRootLayer(ContextLostNotificationCheckLayer::create(0));
ContextLostNotificationCheckLayer* root = static_cast<ContextLostNotificationCheckLayer*>(m_hostImpl->rootLayer());
@@ -1141,7 +1135,7 @@ TEST_F(CCLayerTreeHostImplTest, contextLostAndRestoredNotificationSentToAllLayer
EXPECT_FALSE(layer1->didLoseContextCalled());
EXPECT_FALSE(layer2->didLoseContextCalled());
- m_hostImpl->initializeLayerRenderer(createContext());
+ m_hostImpl->initializeLayerRenderer(createContext(), adoptPtr(new FakeTextureUploader));
EXPECT_TRUE(root->didLoseContextCalled());
EXPECT_TRUE(layer1->didLoseContextCalled());
@@ -1156,7 +1150,7 @@ public:
TEST_F(CCLayerTreeHostImplTest, finishAllRenderingAfterContextLost)
{
// The context initialization will fail, but we should still be able to call finishAllRendering() without any ill effects.
- m_hostImpl->initializeLayerRenderer(GraphicsContext3DPrivate::createGraphicsContextFromWebContext(adoptPtr(new FakeWebGraphicsContext3DMakeCurrentFails), GraphicsContext3D::RenderDirectlyToHostWindow));
+ m_hostImpl->initializeLayerRenderer(GraphicsContext3DPrivate::createGraphicsContextFromWebContext(adoptPtr(new FakeWebGraphicsContext3DMakeCurrentFails), GraphicsContext3D::RenderDirectlyToHostWindow), adoptPtr(new FakeTextureUploader));
m_hostImpl->finishAllRendering();
}
@@ -1172,9 +1166,6 @@ private:
TEST_F(CCLayerTreeHostImplTest, scrollbarLayerLostContext)
{
- m_hostImpl->initializeLayerRenderer(createContext());
- m_hostImpl->setViewportSize(IntSize(10, 10));
-
m_hostImpl->setRootLayer(ScrollbarLayerFakePaint::create(0));
ScrollbarLayerFakePaint* scrollbar = static_cast<ScrollbarLayerFakePaint*>(m_hostImpl->rootLayer());
scrollbar->setBounds(IntSize(1, 1));
@@ -1189,7 +1180,7 @@ TEST_F(CCLayerTreeHostImplTest, scrollbarLayerLostContext)
// Scrollbar layer should always generate quads, even after lost context
EXPECT_GT(renderPass->quadList().size(), 0u);
m_hostImpl->didDrawAllLayers(frame);
- m_hostImpl->initializeLayerRenderer(createContext());
+ m_hostImpl->initializeLayerRenderer(createContext(), adoptPtr(new FakeTextureUploader));
}
}
@@ -1322,9 +1313,6 @@ private:
TEST_F(CCLayerTreeHostImplTest, dontUseOldResourcesAfterLostContext)
{
- m_hostImpl->initializeLayerRenderer(createContext());
- m_hostImpl->setViewportSize(IntSize(10, 10));
-
OwnPtr<CCLayerImpl> rootLayer(CCLayerImpl::create(0));
rootLayer->setBounds(IntSize(10, 10));
rootLayer->setAnchorPoint(FloatPoint(0, 0));
@@ -1367,7 +1355,7 @@ TEST_F(CCLayerTreeHostImplTest, dontUseOldResourcesAfterLostContext)
// Lose the context, replacing it with a StrictWebGraphicsContext3D, that
// will warn if any resource from the previous context gets used.
- m_hostImpl->initializeLayerRenderer(StrictWebGraphicsContext3D::createGraphicsContext());
+ m_hostImpl->initializeLayerRenderer(StrictWebGraphicsContext3D::createGraphicsContext(), adoptPtr(new FakeTextureUploader));
EXPECT_TRUE(m_hostImpl->prepareToDraw(frame));
m_hostImpl->drawLayers(frame);
m_hostImpl->didDrawAllLayers(frame);
diff --git a/Source/WebKit/chromium/tests/CCLayerTreeHostTest.cpp b/Source/WebKit/chromium/tests/CCLayerTreeHostTest.cpp
index f2382b359..44f87c6a9 100644
--- a/Source/WebKit/chromium/tests/CCLayerTreeHostTest.cpp
+++ b/Source/WebKit/chromium/tests/CCLayerTreeHostTest.cpp
@@ -788,7 +788,12 @@ private:
int m_numDraws;
};
+#if OS(WINDOWS)
+// http://webkit.org/b/74623
+TEST_F(CCLayerTreeHostTestSetNeedsCommit2, FLAKY_runMultiThread)
+#else
TEST_F(CCLayerTreeHostTestSetNeedsCommit2, runMultiThread)
+#endif
{
runTestThreaded();
}
@@ -840,6 +845,62 @@ TEST_F(CCLayerTreeHostTestSetNeedsRedraw, runMultiThread)
runTestThreaded();
}
+// If the layerTreeHost says it can't draw, then we should not try to draw.
+// FIXME: Make this run in single threaded mode too. http://crbug.com/127481
+class CCLayerTreeHostTestCanDrawBlocksDrawing : public CCLayerTreeHostTestThreadOnly {
+public:
+ CCLayerTreeHostTestCanDrawBlocksDrawing()
+ : m_numCommits(0)
+ {
+ }
+
+ virtual void beginTest()
+ {
+ }
+
+ virtual void drawLayersOnCCThread(CCLayerTreeHostImpl* impl)
+ {
+ // Only the initial draw should bring us here.
+ EXPECT_TRUE(impl->canDraw());
+ EXPECT_EQ(0, impl->sourceFrameNumber());
+ }
+
+ virtual void commitCompleteOnCCThread(CCLayerTreeHostImpl* impl)
+ {
+ if (m_numCommits >= 1) {
+ // After the first commit, we should not be able to draw.
+ EXPECT_FALSE(impl->canDraw());
+ }
+ }
+
+ virtual void didCommitAndDrawFrame()
+ {
+ m_numCommits++;
+ if (m_numCommits == 1) {
+ // Make the viewport empty so the host says it can't draw.
+ m_layerTreeHost->setViewportSize(IntSize(0, 0));
+
+ OwnArrayPtr<char> pixels(adoptArrayPtr(new char[4]));
+ m_layerTreeHost->compositeAndReadback(static_cast<void*>(pixels.get()), IntRect(0, 0, 1, 1));
+ } else if (m_numCommits == 2) {
+ m_layerTreeHost->setNeedsCommit();
+ m_layerTreeHost->finishAllRendering();
+ endTest();
+ }
+ }
+
+ virtual void afterTest()
+ {
+ }
+
+private:
+ int m_numCommits;
+};
+
+TEST_F(CCLayerTreeHostTestCanDrawBlocksDrawing, runMultiThread)
+{
+ runTestThreaded();
+}
// beginLayerWrite should prevent draws from executing until a commit occurs
class CCLayerTreeHostTestWriteLayersRedraw : public CCLayerTreeHostTestThreadOnly {
@@ -1096,7 +1157,12 @@ private:
int m_numAnimates;
};
+#if OS(WINDOWS)
+// http://webkit.org/b/74623
+TEST_F(CCLayerTreeHostTestTickAnimationWhileBackgrounded, FLAKY_runMultiThread)
+#else
TEST_F(CCLayerTreeHostTestTickAnimationWhileBackgrounded, runMultiThread)
+#endif
{
runTestThreaded();
}
@@ -1134,7 +1200,12 @@ public:
private:
};
+#if OS(WINDOWS)
+// http://webkit.org/b/74623
+TEST_F(CCLayerTreeHostTestAddAnimationWithTimingFunction, FLAKY_runMultiThread)
+#else
TEST_F(CCLayerTreeHostTestAddAnimationWithTimingFunction, runMultiThread)
+#endif
{
runTestThreaded();
}
@@ -1168,7 +1239,12 @@ public:
}
};
+#if OS(WINDOWS)
+// http://webkit.org/b/74623
+TEST_F(CCLayerTreeHostTestDoNotSkipLayersWithAnimatedOpacity, FLAKY_runMultiThread)
+#else
TEST_F(CCLayerTreeHostTestDoNotSkipLayersWithAnimatedOpacity, runMultiThread)
+#endif
{
runTestThreaded();
}
@@ -1340,11 +1416,11 @@ public:
virtual void beginCommitOnCCThread(CCLayerTreeHostImpl* impl)
{
LayerChromium* root = m_layerTreeHost->rootLayer();
- if (!m_layerTreeHost->frameNumber())
+ if (!impl->sourceFrameNumber())
EXPECT_EQ(root->scrollPosition(), m_initialScroll);
- else if (m_layerTreeHost->frameNumber() == 1)
+ else if (impl->sourceFrameNumber() == 1)
EXPECT_EQ(root->scrollPosition(), m_initialScroll + m_scrollAmount + m_scrollAmount);
- else if (m_layerTreeHost->frameNumber() == 2)
+ else if (impl->sourceFrameNumber() == 2)
EXPECT_EQ(root->scrollPosition(), m_initialScroll + m_scrollAmount + m_scrollAmount);
}
@@ -1711,10 +1787,10 @@ public:
{
CompositorFakeWebGraphicsContext3DWithTextureTracking* context = static_cast<CompositorFakeWebGraphicsContext3DWithTextureTracking*>(GraphicsContext3DPrivate::extractWebGraphicsContext3D(impl->context()));
- switch (impl->frameNumber()) {
+ switch (impl->sourceFrameNumber()) {
case 0:
// Number of textures should be one.
- EXPECT_EQ(1, context->numTextures());
+ ASSERT_EQ(1, context->numTextures());
// Number of textures used for commit should be one.
EXPECT_EQ(1, context->numUsedTextures());
// Verify that used texture is correct.
@@ -1725,7 +1801,7 @@ public:
case 1:
// Number of textures should be two as the first texture
// is used by impl thread and cannot by used for update.
- EXPECT_EQ(2, context->numTextures());
+ ASSERT_EQ(2, context->numTextures());
// Number of textures used for commit should still be one.
EXPECT_EQ(1, context->numUsedTextures());
// First texture should not have been used.
@@ -1748,7 +1824,7 @@ public:
// Number of textures used for draw should always be one.
EXPECT_EQ(1, context->numUsedTextures());
- if (impl->frameNumber() < 2) {
+ if (impl->sourceFrameNumber() < 1) {
context->resetUsedTextures();
postSetNeedsAnimateAndCommitToMainThread();
postSetNeedsRedrawToMainThread();
@@ -1815,10 +1891,10 @@ public:
{
CompositorFakeWebGraphicsContext3DWithTextureTracking* context = static_cast<CompositorFakeWebGraphicsContext3DWithTextureTracking*>(GraphicsContext3DPrivate::extractWebGraphicsContext3D(impl->context()));
- switch (impl->frameNumber()) {
+ switch (impl->sourceFrameNumber()) {
case 0:
// Number of textures should be two.
- EXPECT_EQ(2, context->numTextures());
+ ASSERT_EQ(2, context->numTextures());
// Number of textures used for commit should be two.
EXPECT_EQ(2, context->numUsedTextures());
// Verify that used textures are correct.
@@ -1830,7 +1906,7 @@ public:
case 1:
// Number of textures should be four as the first two
// textures are used by the impl thread.
- EXPECT_EQ(4, context->numTextures());
+ ASSERT_EQ(4, context->numTextures());
// Number of textures used for commit should still be two.
EXPECT_EQ(2, context->numUsedTextures());
// First two textures should not have been used.
@@ -1846,7 +1922,7 @@ public:
// Number of textures should be three as we allow one
// partial update and the first two textures are used by
// the impl thread.
- EXPECT_EQ(3, context->numTextures());
+ ASSERT_EQ(3, context->numTextures());
// Number of textures used for commit should still be two.
EXPECT_EQ(2, context->numUsedTextures());
// First texture should have been used.
@@ -1886,12 +1962,12 @@ public:
// Number of textures used for drawing should two except for frame 4
// where the viewport only contains one layer.
- if (impl->frameNumber() == 4)
+ if (impl->sourceFrameNumber() == 3)
EXPECT_EQ(1, context->numUsedTextures());
else
EXPECT_EQ(2, context->numUsedTextures());
- if (impl->frameNumber() < 5) {
+ if (impl->sourceFrameNumber() < 4) {
context->resetUsedTextures();
postSetNeedsAnimateAndCommitToMainThread();
postSetNeedsRedrawToMainThread();
diff --git a/Source/WebKit/chromium/tests/CCMathUtilTest.cpp b/Source/WebKit/chromium/tests/CCMathUtilTest.cpp
index db0a4e53f..3909677a5 100644
--- a/Source/WebKit/chromium/tests/CCMathUtilTest.cpp
+++ b/Source/WebKit/chromium/tests/CCMathUtilTest.cpp
@@ -99,4 +99,21 @@ TEST(CCMathUtilTest, verifyBackfaceVisibilityForPerspective)
EXPECT_TRUE(layerSpaceToProjectionPlane.isBackFaceVisible());
}
+TEST(CCMathUtilTest, verifyProjectionOfPerpendicularPlane)
+{
+ // In this case, the m33() element of the transform becomes zero, which could cause a
+ // divide-by-zero when projecting points/quads.
+
+ TransformationMatrix transform;
+ transform.makeIdentity();
+ transform.setM33(0);
+
+ FloatRect rect = FloatRect(0, 0, 1, 1);
+ FloatRect projectedRect = CCMathUtil::projectClippedRect(transform, rect);
+
+ EXPECT_EQ(0, projectedRect.x());
+ EXPECT_EQ(0, projectedRect.y());
+ EXPECT_TRUE(projectedRect.isEmpty());
+}
+
} // namespace
diff --git a/Source/WebKit/chromium/tests/CCOcclusionTrackerTest.cpp b/Source/WebKit/chromium/tests/CCOcclusionTrackerTest.cpp
index 73b4d8273..891c305b0 100644
--- a/Source/WebKit/chromium/tests/CCOcclusionTrackerTest.cpp
+++ b/Source/WebKit/chromium/tests/CCOcclusionTrackerTest.cpp
@@ -172,6 +172,7 @@ protected:
m_renderSurfaceLayerListChromium.clear();
m_renderSurfaceLayerListImpl.clear();
m_replicaLayers.clear();
+ m_maskLayers.clear();
CCLayerTreeHost::setNeedsFilterContext(false);
}
@@ -233,6 +234,15 @@ protected:
return layerPtr;
}
+ typename Types::LayerType* createMaskLayer(typename Types::LayerType* owningLayer, const IntSize& bounds)
+ {
+ typename Types::ContentLayerPtrType layer(Types::createContentLayer());
+ typename Types::ContentLayerType* layerPtr = layer.get();
+ setProperties(layerPtr, identityMatrix, FloatPoint(), bounds);
+ setMask(owningLayer, layer.release());
+ return layerPtr;
+ }
+
typename Types::ContentLayerType* createDrawingSurface(typename Types::LayerType* parent, const TransformationMatrix& transform, const FloatPoint& position, const IntSize& bounds, bool opaque)
{
typename Types::ContentLayerType* layer = createDrawingLayer(parent, transform, position, bounds, opaque);
@@ -360,6 +370,17 @@ private:
owningLayer->setReplicaLayer(layer);
}
+ void setMask(LayerChromium* owningLayer, PassRefPtr<LayerChromium> layer)
+ {
+ owningLayer->setMaskLayer(layer.get());
+ m_maskLayers.append(layer);
+ }
+
+ void setMask(CCLayerImpl* owningLayer, PassOwnPtr<CCLayerImpl> layer)
+ {
+ owningLayer->setMaskLayer(layer);
+ }
+
// These hold ownership of the layers for the duration of the test.
typename Types::LayerPtrType m_root;
Vector<RefPtr<LayerChromium> > m_renderSurfaceLayerListChromium;
@@ -368,6 +389,7 @@ private:
typename Types::LayerIterator m_layerIterator;
typename Types::LayerType* m_lastLayerVisited;
Vector<RefPtr<LayerChromium> > m_replicaLayers;
+ Vector<RefPtr<LayerChromium> > m_maskLayers;
};
#define RUN_TEST_MAIN_THREAD_OPAQUE_LAYERS(ClassName) \
@@ -1330,6 +1352,38 @@ protected:
ALL_CCOCCLUSIONTRACKER_TEST(CCOcclusionTrackerTestReplicaWithClipping);
template<class Types, bool opaqueLayers>
+class CCOcclusionTrackerTestReplicaWithMask : public CCOcclusionTrackerTest<Types, opaqueLayers> {
+protected:
+ void runMyTest()
+ {
+ typename Types::ContentLayerType* parent = this->createRoot(this->identityMatrix, FloatPoint(0, 0), IntSize(100, 200));
+ typename Types::LayerType* surface = this->createDrawingSurface(parent, this->identityMatrix, FloatPoint(0, 100), IntSize(50, 50), true);
+ typename Types::LayerType* replica = this->createReplicaLayer(surface, this->identityMatrix, FloatPoint(50, 50), IntSize());
+ this->createMaskLayer(replica, IntSize(10, 10));
+ this->calcDrawEtc(parent);
+
+ TestCCOcclusionTrackerWithScissor<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(IntRect(0, 0, 1000, 1000));
+ occlusion.setLayerScissorRect(IntRect(0, 0, 1000, 1000));
+
+ this->visitLayer(surface, occlusion);
+
+ EXPECT_EQ_RECT(IntRect(0, 100, 50, 50), occlusion.occlusionInScreenSpace().bounds());
+ EXPECT_EQ(1u, occlusion.occlusionInScreenSpace().rects().size());
+ EXPECT_EQ_RECT(IntRect(0, 0, 50, 50), occlusion.occlusionInTargetSurface().bounds());
+ EXPECT_EQ(1u, occlusion.occlusionInTargetSurface().rects().size());
+
+ this->visitContributingSurface(surface, occlusion);
+ this->enterLayer(parent, occlusion);
+
+ // The replica should not be occluding the parent, since it has a mask applied to it.
+ EXPECT_EQ_RECT(IntRect(0, 100, 50, 50), occlusion.occlusionInTargetSurface().bounds());
+ EXPECT_EQ(1u, occlusion.occlusionInTargetSurface().rects().size());
+ }
+};
+
+ALL_CCOCCLUSIONTRACKER_TEST(CCOcclusionTrackerTestReplicaWithMask);
+
+template<class Types, bool opaqueLayers>
class CCOcclusionTrackerTestLayerScissorRectOutsideChild : public CCOcclusionTrackerTest<Types, opaqueLayers> {
protected:
void runMyTest()
diff --git a/Source/WebKit/chromium/tests/CCQuadCullerTest.cpp b/Source/WebKit/chromium/tests/CCQuadCullerTest.cpp
index 991cddc46..634a25c7a 100644
--- a/Source/WebKit/chromium/tests/CCQuadCullerTest.cpp
+++ b/Source/WebKit/chromium/tests/CCQuadCullerTest.cpp
@@ -91,7 +91,7 @@ static PassOwnPtr<CCTiledLayerImpl> makeLayer(CCTiledLayerImpl* parent, const Tr
static void appendQuads(CCQuadList& quadList, Vector<OwnPtr<CCSharedQuadState> >& sharedStateList, CCTiledLayerImpl* layer, CCLayerIteratorType& it, CCOcclusionTrackerImpl& occlusionTracker)
{
occlusionTracker.enterLayer(it);
- CCQuadCuller quadCuller(quadList, layer, &occlusionTracker);
+ CCQuadCuller quadCuller(quadList, layer, &occlusionTracker, false);
OwnPtr<CCSharedQuadState> sharedQuadState = layer->createSharedQuadState();
bool hadMissingTiles = false;
layer->appendQuads(quadCuller, sharedQuadState.get(), hadMissingTiles);
diff --git a/Source/WebKit/chromium/tests/CCTiledLayerTestCommon.h b/Source/WebKit/chromium/tests/CCTiledLayerTestCommon.h
index c028ea725..4eb875b1e 100644
--- a/Source/WebKit/chromium/tests/CCTiledLayerTestCommon.h
+++ b/Source/WebKit/chromium/tests/CCTiledLayerTestCommon.h
@@ -161,6 +161,9 @@ public:
class FakeTextureUploader : public WebCore::TextureUploader {
public:
+ virtual bool isBusy() { return false; }
+ virtual void beginUploads() { }
+ virtual void endUploads() { }
virtual void uploadTexture(WebCore::GraphicsContext3D* context, WebCore::LayerTextureUpdater::Texture* texture, WebCore::TextureAllocator* allocator, const WebCore::IntRect sourceRect, const WebCore::IntRect destRect) { texture->updateRect(context, allocator, sourceRect, destRect); }
};
diff --git a/Source/WebKit/chromium/tests/Canvas2DLayerChromiumTest.cpp b/Source/WebKit/chromium/tests/Canvas2DLayerChromiumTest.cpp
index f464dcbbc..b42485b71 100644
--- a/Source/WebKit/chromium/tests/Canvas2DLayerChromiumTest.cpp
+++ b/Source/WebKit/chromium/tests/Canvas2DLayerChromiumTest.cpp
@@ -90,6 +90,9 @@ public:
class MockTextureUploader : public TextureUploader {
public:
+ MOCK_METHOD0(isBusy, bool());
+ MOCK_METHOD0(beginUploads, void());
+ MOCK_METHOD0(endUploads, void());
MOCK_METHOD5(uploadTexture, void(GraphicsContext3D*, LayerTextureUpdater::Texture*, TextureAllocator*, const IntRect, const IntRect));
};
diff --git a/Source/WebKit/chromium/tests/EventListenerTest.cpp b/Source/WebKit/chromium/tests/EventListenerTest.cpp
new file mode 100644
index 000000000..799ac4007
--- /dev/null
+++ b/Source/WebKit/chromium/tests/EventListenerTest.cpp
@@ -0,0 +1,251 @@
+/*
+ * 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 "FrameTestHelpers.h"
+#include "WebDOMEvent.h"
+#include "WebDOMEventListener.h"
+#include "WebDOMMutationEvent.h"
+#include "WebDocument.h"
+#include "WebElement.h"
+#include "WebFrame.h"
+#include "WebScriptSource.h"
+#include "WebView.h"
+#include <gtest/gtest.h>
+#include <webkit/support/webkit_support.h>
+
+using namespace WebKit;
+
+namespace {
+
+class TestWebDOMEventListener : public WebDOMEventListener {
+public:
+ TestWebDOMEventListener() { }
+ virtual ~TestWebDOMEventListener() { }
+
+ virtual void handleEvent(const WebDOMEvent& event) OVERRIDE
+ {
+ m_events.push_back(event);
+ }
+
+ size_t eventCount() const { return m_events.size(); }
+
+ WebDOMEvent eventAt(int index) const { return m_events.at(index); }
+
+ void clearEvents() { m_events.clear(); }
+
+private:
+ std::vector<WebDOMEvent> m_events;
+};
+
+class WebDOMEventListenerTest : public testing::Test {
+public:
+ WebDOMEventListenerTest()
+ : m_webView(0)
+ {
+ }
+
+ virtual void SetUp() OVERRIDE
+ {
+ std::string baseURL("http://www.example.com/");
+ std::string fileName("listener/mutation_event_listener.html");
+ bool executeScript = true;
+ FrameTestHelpers::registerMockedURLLoad(baseURL, fileName);
+ m_webView = FrameTestHelpers::createWebViewAndLoad(baseURL + fileName, executeScript);
+ }
+
+ virtual void TearDown() OVERRIDE
+ {
+ m_webView->close();
+ webkit_support::UnregisterAllMockedURLs();
+ }
+
+ WebFrame* mainFrame() const
+ {
+ return m_webView->mainFrame();
+ }
+
+ WebDocument document() const
+ {
+ return mainFrame()->document();
+ }
+
+ void executeScript(const char* code)
+ {
+ mainFrame()->executeScript(WebScriptSource(WebString::fromUTF8(code)));
+ }
+
+
+ static WebString GetNodeID(const WebNode& node)
+ {
+ if (node.nodeType() != WebNode::ElementNode)
+ return WebString();
+ WebElement element = node.toConst<WebElement>();
+ return element.getAttribute("id");
+ }
+
+protected:
+ WebView* m_webView;
+};
+
+
+// Tests that the right mutation events are fired when a node is added/removed.
+// Note that the DOMSubtreeModified event is fairly vage, it only tells you
+// something changed for the target node.
+TEST_F(WebDOMEventListenerTest, NodeAddedRemovedMutationEvent)
+{
+ TestWebDOMEventListener eventListener;
+ document().addEventListener("DOMSubtreeModified", &eventListener, false);
+
+ // Test adding a node.
+ executeScript("addElement('newNode')");
+ ASSERT_EQ(1U, eventListener.eventCount());
+ WebDOMEvent event = eventListener.eventAt(0);
+ ASSERT_TRUE(event.isMutationEvent());
+ // No need to check any of the MutationEvent, WebKit does not set any.
+ EXPECT_EQ("DIV", event.target().nodeName());
+ EXPECT_EQ("topDiv", GetNodeID(event.target()));
+ eventListener.clearEvents();
+
+ // Test removing a node.
+ executeScript("removeNode('div1')");
+ ASSERT_EQ(1U, eventListener.eventCount());
+ event = eventListener.eventAt(0);
+ ASSERT_TRUE(event.isMutationEvent());
+ EXPECT_EQ("DIV", event.target().nodeName());
+ EXPECT_EQ("topDiv", GetNodeID(event.target()));
+}
+
+// Tests the right mutation event is fired when a text node is modified.
+TEST_F(WebDOMEventListenerTest, TextNodeModifiedMutationEvent)
+{
+ TestWebDOMEventListener eventListener;
+ document().addEventListener("DOMSubtreeModified", &eventListener, false);
+ executeScript("changeText('div2', 'Hello')");
+ ASSERT_EQ(1U, eventListener.eventCount());
+ WebDOMEvent event = eventListener.eventAt(0);
+ ASSERT_TRUE(event.isMutationEvent());
+ ASSERT_EQ(WebNode::TextNode, event.target().nodeType());
+}
+
+// Tests the right mutation events are fired when an attribute is added/removed.
+TEST_F(WebDOMEventListenerTest, AttributeMutationEvent)
+{
+ TestWebDOMEventListener eventListener;
+ document().addEventListener("DOMSubtreeModified", &eventListener, false);
+ executeScript("document.getElementById('div2').setAttribute('myAttr',"
+ "'some value')");
+ ASSERT_EQ(1U, eventListener.eventCount());
+ WebDOMEvent event = eventListener.eventAt(0);
+ ASSERT_TRUE(event.isMutationEvent());
+ EXPECT_EQ("DIV", event.target().nodeName());
+ EXPECT_EQ("div2", GetNodeID(event.target()));
+ eventListener.clearEvents();
+
+ executeScript("document.getElementById('div2').removeAttribute('myAttr')");
+ ASSERT_EQ(1U, eventListener.eventCount());
+ event = eventListener.eventAt(0);
+ ASSERT_TRUE(event.isMutationEvent());
+ EXPECT_EQ("DIV", event.target().nodeName());
+ EXPECT_EQ("div2", GetNodeID(event.target()));
+}
+
+// Tests destroying WebDOMEventListener and triggering events, we shouldn't
+// crash.
+TEST_F(WebDOMEventListenerTest, FireEventDeletedListener)
+{
+ TestWebDOMEventListener* eventListener = new TestWebDOMEventListener();
+ document().addEventListener("DOMSubtreeModified", eventListener, false);
+ delete eventListener;
+ executeScript("addElement('newNode')"); // That should fire an event.
+}
+
+// Tests registering several events on the same WebDOMEventListener and
+// triggering events.
+TEST_F(WebDOMEventListenerTest, SameListenerMultipleEvents)
+{
+ TestWebDOMEventListener eventListener;
+ const WebString kDOMSubtreeModifiedType("DOMSubtreeModified");
+ const WebString kDOMNodeRemovedType("DOMNodeRemoved");
+ document().addEventListener(kDOMSubtreeModifiedType, &eventListener, false);
+ WebElement div1Elem = document().getElementById("div1");
+ div1Elem.addEventListener(kDOMNodeRemovedType, &eventListener, false);
+
+ // Trigger a DOMSubtreeModified event by adding a node.
+ executeScript("addElement('newNode')");
+ ASSERT_EQ(1U, eventListener.eventCount());
+ WebDOMEvent event = eventListener.eventAt(0);
+ ASSERT_TRUE(event.isMutationEvent());
+ EXPECT_EQ("DIV", event.target().nodeName());
+ EXPECT_EQ("topDiv", GetNodeID(event.target()));
+ eventListener.clearEvents();
+
+ // Trigger for both event listener by removing the div1 node.
+ executeScript("removeNode('div1')");
+ ASSERT_EQ(2U, eventListener.eventCount());
+ // Not sure if the order of the events is important. Assuming no specific
+ // order.
+ WebString type1 = eventListener.eventAt(0).type();
+ WebString type2 = eventListener.eventAt(1).type();
+ EXPECT_TRUE(type1 == kDOMSubtreeModifiedType || type1 == kDOMNodeRemovedType);
+ EXPECT_TRUE(type2 == kDOMSubtreeModifiedType || type2 == kDOMNodeRemovedType);
+ EXPECT_TRUE(type1 != type2);
+}
+
+// Tests removing event listeners.
+TEST_F(WebDOMEventListenerTest, RemoveEventListener)
+{
+ TestWebDOMEventListener eventListener;
+ const WebString kDOMSubtreeModifiedType("DOMSubtreeModified");
+ // Adding twice the same listener for the same event, should be supported.
+ document().addEventListener(kDOMSubtreeModifiedType, &eventListener, false);
+ document().addEventListener(kDOMSubtreeModifiedType, &eventListener, false);
+
+ // Add a node, that should trigger 2 events.
+ executeScript("addElement('newNode')");
+ EXPECT_EQ(2U, eventListener.eventCount());
+ eventListener.clearEvents();
+
+ // Remove one listener and trigger an event again.
+ document().removeEventListener(
+ kDOMSubtreeModifiedType, &eventListener, false);
+ executeScript("addElement('newerNode')");
+ EXPECT_EQ(1U, eventListener.eventCount());
+ eventListener.clearEvents();
+
+ // Remove the last listener and trigger yet another event.
+ document().removeEventListener(
+ kDOMSubtreeModifiedType, &eventListener, false);
+ executeScript("addElement('newererNode')");
+ EXPECT_EQ(0U, eventListener.eventCount());
+}
+
+} // namespace
diff --git a/Source/WebKit/chromium/tests/FrameLoaderClientImplTest.cpp b/Source/WebKit/chromium/tests/FrameLoaderClientImplTest.cpp
new file mode 100644
index 000000000..8fc9e42b2
--- /dev/null
+++ b/Source/WebKit/chromium/tests/FrameLoaderClientImplTest.cpp
@@ -0,0 +1,115 @@
+/*
+ * Copyright (C) 2011, 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 "FrameLoaderClientImpl.h"
+
+#include "KURL.h"
+#include "WebFrameClient.h"
+#include "WebFrameImpl.h"
+#include "WebView.h"
+
+#include <gtest/gtest.h>
+#include <wtf/text/WTFString.h>
+
+using namespace WebKit;
+
+namespace {
+
+class TestWebFrameClient : public WebFrameClient {
+public:
+ bool userAgent(const WebURL& url, WebString* userAgent) OVERRIDE
+ {
+ if (m_userAgentOverride.isEmpty())
+ return false;
+
+ *userAgent = m_userAgentOverride;
+ return true;
+ }
+
+ void setUserAgentOverride(const WebString& userAgent)
+ {
+ m_userAgentOverride = userAgent;
+ }
+
+private:
+ WebString m_userAgentOverride;
+};
+
+class FrameLoaderClientImplTest : public testing::Test {
+public:
+ void SetUp()
+ {
+ m_webView = WebView::create(0);
+ m_webView->initializeMainFrame(&m_webFrameClient);
+ WebFrameImpl* frame = static_cast<WebFrameImpl*>(m_webView->mainFrame());
+ m_frameLoaderClientImpl = static_cast<FrameLoaderClientImpl*>(frame->frame()->loader()->client());
+ }
+
+ void TearDown()
+ {
+ m_webView->close();
+ }
+
+ void setUserAgentOverride(const WebString& userAgent)
+ {
+ return m_webFrameClient.setUserAgentOverride(userAgent);
+ }
+
+ const WebString userAgent()
+ {
+ // The test always returns the same user agent, regardless of the URL passed in.
+ WebCore::KURL dummyURL(WebCore::ParsedURLString, "about:blank");
+ WTF::CString userAgent = m_frameLoaderClientImpl->userAgent(dummyURL).utf8();
+ return WebString::fromUTF8(userAgent.data(), userAgent.length());
+ }
+
+protected:
+ TestWebFrameClient m_webFrameClient;
+ FrameLoaderClientImpl* m_frameLoaderClientImpl;
+ WebView* m_webView;
+};
+
+TEST_F(FrameLoaderClientImplTest, UserAgentOverride)
+{
+ const WebString defaultUserAgent = userAgent();
+ const WebString override = WebString::fromUTF8("dummy override");
+
+ // Override the user agent and make sure we get it back.
+ setUserAgentOverride(override);
+ EXPECT_TRUE(override.equals(userAgent()));
+
+ // Remove the override and make sure we get the original back.
+ setUserAgentOverride(WebString());
+ EXPECT_TRUE(defaultUserAgent.equals(userAgent()));
+}
+
+} // namespace
diff --git a/Source/WebKit/chromium/tests/IDBLevelDBCodingTest.cpp b/Source/WebKit/chromium/tests/IDBLevelDBCodingTest.cpp
index 60331051f..eb9962d58 100644
--- a/Source/WebKit/chromium/tests/IDBLevelDBCodingTest.cpp
+++ b/Source/WebKit/chromium/tests/IDBLevelDBCodingTest.cpp
@@ -83,6 +83,20 @@ TEST(IDBLevelDBCodingTest, EncodeByte)
EXPECT_EQ(expected, encodeByte(c));
}
+TEST(IDBLevelDBCodingTest, EncodeBool)
+{
+ {
+ Vector<char> expected;
+ expected.append(1);
+ EXPECT_EQ(expected, encodeBool(true));
+ }
+ {
+ Vector<char> expected;
+ expected.append(0);
+ EXPECT_EQ(expected, encodeBool(false));
+ }
+}
+
TEST(IDBLevelDBCodingTest, MaxIDBKey)
{
Vector<char> maxKey = maxIDBKey();
@@ -126,6 +140,20 @@ TEST(IDBLevelDBCodingTest, EncodeInt)
EXPECT_EQ(static_cast<size_t>(4), encodeInt(0xffffffff).size());
}
+TEST(IDBLevelDBCodingTest, DecodeBool)
+{
+ {
+ Vector<char> encoded;
+ encoded.append(1);
+ EXPECT_TRUE(decodeBool(encoded.data(), encoded.data() + encoded.size()));
+ }
+ {
+ Vector<char> encoded;
+ encoded.append(0);
+ EXPECT_FALSE(decodeBool(encoded.data(), encoded.data() + encoded.size()));
+ }
+}
+
TEST(IDBLevelDBCodingTest, DecodeInt)
{
Vector<int64_t> testCases;
diff --git a/Source/WebKit/chromium/tests/LayerRendererChromiumTest.cpp b/Source/WebKit/chromium/tests/LayerRendererChromiumTest.cpp
index ddab17564..69d0ff5ff 100644
--- a/Source/WebKit/chromium/tests/LayerRendererChromiumTest.cpp
+++ b/Source/WebKit/chromium/tests/LayerRendererChromiumTest.cpp
@@ -25,6 +25,7 @@
#include "config.h"
#include "LayerRendererChromium.h"
+#include "CCTiledLayerTestCommon.h"
#include "FakeWebGraphicsContext3D.h"
#include "GraphicsContext3D.h"
#include "GraphicsContext3DPrivate.h"
@@ -35,6 +36,7 @@
using namespace WebCore;
using namespace WebKit;
+using namespace WebKitTests;
class FrameCountingMemoryAllocationSettingContext : public FakeWebGraphicsContext3D {
public:
@@ -91,7 +93,7 @@ private:
class FakeLayerRendererChromium : public LayerRendererChromium {
public:
- FakeLayerRendererChromium(LayerRendererChromiumClient* client, PassRefPtr<GraphicsContext3D> context) : LayerRendererChromium(client, context) { }
+ FakeLayerRendererChromium(LayerRendererChromiumClient* client, PassRefPtr<GraphicsContext3D> context, PassOwnPtr<TextureUploader> uploader) : LayerRendererChromium(client, context, uploader) { }
// LayerRendererChromium methods.
@@ -107,7 +109,7 @@ protected:
, m_suggestHaveBackbufferNo(1, false)
, m_context(GraphicsContext3DPrivate::createGraphicsContextFromWebContext(adoptPtr(new FrameCountingMemoryAllocationSettingContext()), GraphicsContext3D::RenderDirectlyToHostWindow))
, m_mockContext(*static_cast<FrameCountingMemoryAllocationSettingContext*>(GraphicsContext3DPrivate::extractWebGraphicsContext3D(m_context.get())))
- , m_layerRendererChromium(&m_mockClient, m_context.release())
+ , m_layerRendererChromium(&m_mockClient, m_context.release(), adoptPtr(new FakeTextureUploader()))
{
}
@@ -271,7 +273,7 @@ public:
TEST(LayerRendererChromiumTest2, initializationDoesNotMakeSynchronousCalls)
{
FakeLayerRendererChromiumClient mockClient;
- FakeLayerRendererChromium layerRendererChromium(&mockClient, GraphicsContext3DPrivate::createGraphicsContextFromWebContext(adoptPtr(new ForbidSynchronousCallContext), GraphicsContext3D::RenderDirectlyToHostWindow));
+ FakeLayerRendererChromium layerRendererChromium(&mockClient, GraphicsContext3DPrivate::createGraphicsContextFromWebContext(adoptPtr(new ForbidSynchronousCallContext), GraphicsContext3D::RenderDirectlyToHostWindow), adoptPtr(new FakeTextureUploader()));
EXPECT_TRUE(layerRendererChromium.initialize());
}
diff --git a/Source/WebKit/chromium/tests/LinkHighlightTest.cpp b/Source/WebKit/chromium/tests/LinkHighlightTest.cpp
new file mode 100644
index 000000000..edcfd4a63
--- /dev/null
+++ b/Source/WebKit/chromium/tests/LinkHighlightTest.cpp
@@ -0,0 +1,87 @@
+/*
+ * 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 "LinkHighlight.h"
+
+#include "AnimationIdVendor.h"
+#include "GraphicsLayerChromium.h"
+#include "GraphicsLayerClient.h"
+#include "IntRect.h"
+#include "Path.h"
+#include "TransformationMatrix.h"
+#include <gtest/gtest.h>
+#include <wtf/PassOwnPtr.h>
+
+using namespace WebCore;
+
+namespace {
+
+class MockGraphicsLayerClient : public GraphicsLayerClient {
+public:
+ virtual void notifyAnimationStarted(const GraphicsLayer*, double time) OVERRIDE { }
+ virtual void notifySyncRequired(const GraphicsLayer*) OVERRIDE { }
+ virtual void paintContents(const GraphicsLayer*, GraphicsContext&, GraphicsLayerPaintingPhase, const IntRect& inClip) OVERRIDE { }
+ virtual bool showDebugBorders(const GraphicsLayer*) const OVERRIDE { return false; }
+ virtual bool showRepaintCounter(const GraphicsLayer*) const OVERRIDE { return false; }
+};
+
+TEST(LinkHighlightTest, verifyLinkHighlightLayer)
+{
+ Path highlightPath;
+ highlightPath.addRect(FloatRect(5, 6, 12, 8));
+ IntRect pathBoundingRect = enclosingIntRect(highlightPath.boundingRect());
+
+ RefPtr<LinkHighlight> highlight = LinkHighlight::create(0, highlightPath, AnimationIdVendor::LinkHighlightAnimationId, AnimationIdVendor::getNextGroupId());
+ ASSERT_TRUE(highlight.get());
+ ContentLayerChromium* contentLayer = highlight->contentLayer();
+ ASSERT_TRUE(contentLayer);
+
+ EXPECT_EQ(pathBoundingRect.size(), contentLayer->bounds());
+ EXPECT_TRUE(contentLayer->transform().isIdentityOrTranslation());
+ EXPECT_TRUE(contentLayer->transform().isIntegerTranslation());
+
+ TransformationMatrix::DecomposedType decomposition;
+ EXPECT_TRUE(contentLayer->transform().decompose(decomposition));
+
+ FloatPoint expectedTranslation(pathBoundingRect.x() + pathBoundingRect.width() / 2, pathBoundingRect.y() + pathBoundingRect.height() / 2);
+ EXPECT_EQ(FloatPoint(decomposition.translateX, decomposition.translateY), expectedTranslation);
+}
+
+TEST(LinkHighlightTest, verifyGraphicsLayerChromiumEmbedding)
+{
+ MockGraphicsLayerClient client;
+ OwnPtr<GraphicsLayerChromium> graphicsLayer = static_pointer_cast<GraphicsLayerChromium>(GraphicsLayer::create(&client));
+ ASSERT_TRUE(graphicsLayer.get());
+
+ Path highlightPath;
+ highlightPath.addRect(FloatRect(5, 5, 10, 8));
+
+ // Neither of the following operations should crash.
+ graphicsLayer->addLinkHighlight(highlightPath);
+ graphicsLayer->didFinishLinkHighlight();
+}
+
+} // namespace
diff --git a/Source/WebKit/chromium/tests/ListenerLeakTest.cpp b/Source/WebKit/chromium/tests/ListenerLeakTest.cpp
new file mode 100644
index 000000000..5e321c70d
--- /dev/null
+++ b/Source/WebKit/chromium/tests/ListenerLeakTest.cpp
@@ -0,0 +1,125 @@
+/*
+ * 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 "FrameTestHelpers.h"
+#include "WebView.h"
+#include <gtest/gtest.h>
+#include <v8/include/v8-profiler.h>
+#include <v8/include/v8.h>
+#include <webkit/support/webkit_support.h>
+
+using namespace WebKit;
+
+namespace {
+
+const v8::HeapGraphNode* GetProperty(const v8::HeapGraphNode* node, v8::HeapGraphEdge::Type type, const char* name)
+{
+ for (int i = 0, count = node->GetChildrenCount(); i < count; ++i) {
+ const v8::HeapGraphEdge* prop = node->GetChild(i);
+ if (prop->GetType() == type) {
+ v8::String::AsciiValue propName(prop->GetName());
+ if (!strcmp(name, *propName))
+ return prop->GetToNode();
+ }
+ }
+ return 0;
+}
+
+int GetNumObjects(const char* constructor)
+{
+ v8::HandleScope scope;
+ const v8::HeapSnapshot* snapshot = v8::HeapProfiler::TakeSnapshot(v8::String::New(""), v8::HeapSnapshot::kFull);
+ if (!snapshot)
+ return -1;
+ int count = 0;
+ for (int i = 0; i < snapshot->GetNodesCount(); ++i) {
+ const v8::HeapGraphNode* node = snapshot->GetNode(i);
+ if (node->GetType() != v8::HeapGraphNode::kObject)
+ continue;
+ v8::String::AsciiValue nodeName(node->GetName());
+ if (!strcmp(constructor, *nodeName)) {
+ const v8::HeapGraphNode* constructorProp = GetProperty(node, v8::HeapGraphEdge::kProperty, "constructor");
+ // Skip an Object instance named after the constructor.
+ if (constructorProp) {
+ v8::String::AsciiValue constructorName(constructorProp->GetName());
+ if (!strcmp(constructor, *constructorName))
+ continue;
+ }
+ ++count;
+ }
+ }
+ return count;
+}
+
+
+class ListenerLeakTest : public testing::Test {
+public:
+ ListenerLeakTest() : m_webView(0) { }
+
+ void RunTest(const std::string& filename)
+ {
+ std::string baseURL("http://www.example.com/");
+ std::string fileName(filename);
+ bool executeScript = true;
+ FrameTestHelpers::registerMockedURLLoad(baseURL, fileName);
+ m_webView = FrameTestHelpers::createWebViewAndLoad(baseURL + fileName, executeScript);
+ }
+
+ virtual void TearDown() OVERRIDE
+ {
+ if (m_webView)
+ m_webView->close();
+ webkit_support::UnregisterAllMockedURLs();
+ }
+
+protected:
+ WebView* m_webView;
+};
+
+
+// This test tries to create a reference cycle between node and its listener.
+// See http://crbug/17400.
+TEST_F(ListenerLeakTest, ReferenceCycle)
+{
+ RunTest("listener/listener_leak1.html");
+ ASSERT_EQ(0, GetNumObjects("EventListenerLeakTestObject1"));
+}
+
+// This test sets node onclick many times to expose a possible memory
+// leak where all listeners get referenced by the node.
+TEST_F(ListenerLeakTest, HiddenReferences)
+{
+ RunTest("listener/listener_leak2.html");
+ ASSERT_EQ(1, GetNumObjects("EventListenerLeakTestObject2"));
+}
+
+} // namespace
diff --git a/Source/WebKit/chromium/tests/MockCCQuadCuller.h b/Source/WebKit/chromium/tests/MockCCQuadCuller.h
index d9cd31326..385507e2c 100644
--- a/Source/WebKit/chromium/tests/MockCCQuadCuller.h
+++ b/Source/WebKit/chromium/tests/MockCCQuadCuller.h
@@ -35,12 +35,12 @@ namespace WebCore {
class MockCCQuadCuller : public WebCore::CCQuadCuller {
public:
MockCCQuadCuller()
- : CCQuadCuller(m_quadListStorage, 0, 0)
+ : CCQuadCuller(m_quadListStorage, 0, 0, false)
, m_activeQuadList(m_quadListStorage)
{ }
explicit MockCCQuadCuller(CCQuadList& externalQuadList)
- : CCQuadCuller(externalQuadList, 0, 0)
+ : CCQuadCuller(externalQuadList, 0, 0, false)
, m_activeQuadList(externalQuadList)
{ }
diff --git a/Source/WebKit/chromium/tests/RegionTest.cpp b/Source/WebKit/chromium/tests/RegionTest.cpp
index d202ab40c..105d1c3ed 100644
--- a/Source/WebKit/chromium/tests/RegionTest.cpp
+++ b/Source/WebKit/chromium/tests/RegionTest.cpp
@@ -124,4 +124,271 @@ TEST(RegionTest, emptySpan)
EXPECT_FALSE(rects[i].isEmpty());
}
+#define TEST_NO_INTERSECT(a, b) \
+{ \
+ Region ar = a; \
+ Region br = b; \
+ EXPECT_FALSE(ar.intersects(br)); \
+ EXPECT_FALSE(br.intersects(ar)); \
+}
+
+#define TEST_INTERSECT(a, b) \
+{ \
+ Region ar = a; \
+ Region br = b; \
+ EXPECT_TRUE(ar.intersects(br)); \
+ EXPECT_TRUE(br.intersects(ar)); \
+}
+
+TEST(RegionTest, intersectsRegion)
+{
+ Region r;
+
+ TEST_NO_INTERSECT(IntRect(), IntRect());
+ TEST_NO_INTERSECT(IntRect(), IntRect(0, 0, 1, 1));
+ TEST_NO_INTERSECT(IntRect(), IntRect(1, 1, 1, 1));
+
+ r.unite(IntRect(0, 0, 1, 1));
+ TEST_NO_INTERSECT(r, IntRect());
+ TEST_INTERSECT(r, IntRect(0, 0, 1, 1));
+ TEST_INTERSECT(r, IntRect(0, 0, 2, 2));
+ TEST_INTERSECT(r, IntRect(-1, 0, 2, 2));
+ TEST_INTERSECT(r, IntRect(-1, -1, 2, 2));
+ TEST_INTERSECT(r, IntRect(0, -1, 2, 2));
+ TEST_INTERSECT(r, IntRect(-1, -1, 3, 3));
+
+ r.unite(IntRect(0, 0, 3, 3));
+ r.unite(IntRect(10, 0, 3, 3));
+ r.unite(IntRect(0, 10, 13, 3));
+ TEST_NO_INTERSECT(r, IntRect());
+ TEST_INTERSECT(r, IntRect(1, 1, 1, 1));
+ TEST_INTERSECT(r, IntRect(0, 0, 2, 2));
+ TEST_INTERSECT(r, IntRect(1, 0, 2, 2));
+ TEST_INTERSECT(r, IntRect(1, 1, 2, 2));
+ TEST_INTERSECT(r, IntRect(0, 1, 2, 2));
+ TEST_INTERSECT(r, IntRect(0, 0, 3, 3));
+ TEST_INTERSECT(r, IntRect(-1, -1, 2, 2));
+ TEST_INTERSECT(r, IntRect(2, -1, 2, 2));
+ TEST_INTERSECT(r, IntRect(2, 2, 2, 2));
+ TEST_INTERSECT(r, IntRect(-1, 2, 2, 2));
+
+ TEST_INTERSECT(r, IntRect(11, 1, 1, 1));
+ TEST_INTERSECT(r, IntRect(10, 0, 2, 2));
+ TEST_INTERSECT(r, IntRect(11, 0, 2, 2));
+ TEST_INTERSECT(r, IntRect(11, 1, 2, 2));
+ TEST_INTERSECT(r, IntRect(10, 1, 2, 2));
+ TEST_INTERSECT(r, IntRect(10, 0, 3, 3));
+ TEST_INTERSECT(r, IntRect(9, -1, 2, 2));
+ TEST_INTERSECT(r, IntRect(12, -1, 2, 2));
+ TEST_INTERSECT(r, IntRect(12, 2, 2, 2));
+ TEST_INTERSECT(r, IntRect(9, 2, 2, 2));
+
+ TEST_INTERSECT(r, IntRect(0, -1, 13, 5));
+ TEST_INTERSECT(r, IntRect(1, -1, 11, 5));
+ TEST_INTERSECT(r, IntRect(2, -1, 9, 5));
+ TEST_INTERSECT(r, IntRect(2, -1, 8, 5));
+ TEST_INTERSECT(r, IntRect(3, -1, 8, 5));
+ TEST_NO_INTERSECT(r, IntRect(3, -1, 7, 5));
+
+ TEST_INTERSECT(r, IntRect(0, 1, 13, 1));
+ TEST_INTERSECT(r, IntRect(1, 1, 11, 1));
+ TEST_INTERSECT(r, IntRect(2, 1, 9, 1));
+ TEST_INTERSECT(r, IntRect(2, 1, 8, 1));
+ TEST_INTERSECT(r, IntRect(3, 1, 8, 1));
+ TEST_NO_INTERSECT(r, IntRect(3, 1, 7, 1));
+
+ TEST_INTERSECT(r, IntRect(0, 0, 13, 13));
+ TEST_INTERSECT(r, IntRect(0, 1, 13, 11));
+ TEST_INTERSECT(r, IntRect(0, 2, 13, 9));
+ TEST_INTERSECT(r, IntRect(0, 2, 13, 8));
+ TEST_INTERSECT(r, IntRect(0, 3, 13, 8));
+ TEST_NO_INTERSECT(r, IntRect(0, 3, 13, 7));
+}
+
+TEST(RegionTest, ReadPastFullSpanVectorInIntersectsTest)
+{
+ Region r;
+
+ // This region has enough spans to fill its allocated Vector exactly.
+ r.unite(IntRect(400, 300, 1, 800));
+ r.unite(IntRect(785, 585, 1, 1));
+ r.unite(IntRect(787, 585, 1, 1));
+ r.unite(IntRect(0, 587, 16, 162));
+ r.unite(IntRect(26, 590, 300, 150));
+ r.unite(IntRect(196, 750, 1, 1));
+ r.unite(IntRect(0, 766, 1, 1));
+ r.unite(IntRect(0, 782, 1, 1));
+ r.unite(IntRect(745, 798, 1, 1));
+ r.unite(IntRect(795, 882, 10, 585));
+ r.unite(IntRect(100, 1499, 586, 1));
+ r.unite(IntRect(100, 1500, 585, 784));
+ // This query rect goes past the bottom of the Region, causing the
+ // test to reach the last span and try go past it. It should not read
+ // memory off the end of the span Vector.
+ TEST_NO_INTERSECT(r, IntRect(0, 2184, 1, 150));
+}
+
+#define TEST_NO_CONTAINS(a, b) \
+{ \
+ Region ar = a; \
+ Region br = b; \
+ EXPECT_FALSE(ar.contains(br)); \
+}
+
+#define TEST_CONTAINS(a, b) \
+{ \
+ Region ar = a; \
+ Region br = b; \
+ EXPECT_TRUE(ar.contains(br)); \
+}
+
+TEST(RegionTest, containsRegion)
+{
+ TEST_CONTAINS(IntRect(), IntRect());
+ TEST_NO_CONTAINS(IntRect(), IntRect(0, 0, 1, 1));
+ TEST_NO_CONTAINS(IntRect(), IntRect(1, 1, 1, 1));
+
+ TEST_NO_CONTAINS(IntRect(10, 10, 1, 1), IntRect(11, 10, 1, 1));
+ TEST_NO_CONTAINS(IntRect(10, 10, 1, 1), IntRect(10, 11, 1, 1));
+ TEST_NO_CONTAINS(IntRect(10, 10, 1, 1), IntRect(9, 10, 1, 1));
+ TEST_NO_CONTAINS(IntRect(10, 10, 1, 1), IntRect(10, 9, 1, 1));
+ TEST_NO_CONTAINS(IntRect(10, 10, 1, 1), IntRect(9, 9, 2, 2));
+ TEST_NO_CONTAINS(IntRect(10, 10, 1, 1), IntRect(10, 9, 2, 2));
+ TEST_NO_CONTAINS(IntRect(10, 10, 1, 1), IntRect(9, 10, 2, 2));
+ TEST_NO_CONTAINS(IntRect(10, 10, 1, 1), IntRect(10, 10, 2, 2));
+ TEST_NO_CONTAINS(IntRect(10, 10, 1, 1), IntRect(9, 9, 3, 3));
+
+ Region hLines;
+ for (int i = 10; i < 20; i += 2)
+ hLines.unite(IntRect(i, 10, 1, 10));
+
+ TEST_CONTAINS(IntRect(10, 10, 9, 10), hLines);
+ TEST_NO_CONTAINS(IntRect(10, 10, 9, 9), hLines);
+ TEST_NO_CONTAINS(IntRect(10, 11, 9, 9), hLines);
+ TEST_NO_CONTAINS(IntRect(10, 10, 8, 10), hLines);
+ TEST_NO_CONTAINS(IntRect(11, 10, 8, 10), hLines);
+
+ Region vLines;
+ for (int i = 10; i < 20; i += 2)
+ vLines.unite(IntRect(10, i, 10, 1));
+
+ TEST_CONTAINS(IntRect(10, 10, 10, 9), vLines);
+ TEST_NO_CONTAINS(IntRect(10, 10, 9, 9), vLines);
+ TEST_NO_CONTAINS(IntRect(11, 10, 9, 9), vLines);
+ TEST_NO_CONTAINS(IntRect(10, 10, 10, 8), vLines);
+ TEST_NO_CONTAINS(IntRect(10, 11, 10, 8), vLines);
+
+ Region grid;
+ for (int i = 10; i < 20; i += 2)
+ for (int j = 10; j < 20; j += 2)
+ grid.unite(IntRect(i, j, 1, 1));
+
+ TEST_CONTAINS(IntRect(10, 10, 9, 9), grid);
+ TEST_NO_CONTAINS(IntRect(10, 10, 9, 8), grid);
+ TEST_NO_CONTAINS(IntRect(10, 11, 9, 8), grid);
+ TEST_NO_CONTAINS(IntRect(10, 10, 8, 9), grid);
+ TEST_NO_CONTAINS(IntRect(11, 10, 8, 9), grid);
+
+ TEST_CONTAINS(hLines, hLines);
+ TEST_CONTAINS(vLines, vLines);
+ TEST_NO_CONTAINS(vLines, hLines);
+ TEST_NO_CONTAINS(hLines, vLines);
+ TEST_CONTAINS(grid, grid);
+ TEST_CONTAINS(hLines, grid);
+ TEST_CONTAINS(vLines, grid);
+ TEST_NO_CONTAINS(grid, hLines);
+ TEST_NO_CONTAINS(grid, vLines);
+
+ for (int i = 10; i < 20; i += 2)
+ TEST_CONTAINS(hLines, IntRect(i, 10, 1, 10));
+
+ for (int i = 10; i < 20; i += 2)
+ TEST_CONTAINS(vLines, IntRect(10, i, 10, 1));
+
+ for (int i = 10; i < 20; i += 2)
+ for (int j = 10; j < 20; j += 2)
+ TEST_CONTAINS(grid, IntRect(i, j, 1, 1));
+
+ Region container;
+ container.unite(IntRect(0, 0, 40, 20));
+ container.unite(IntRect(0, 20, 41, 20));
+ TEST_CONTAINS(container, IntRect(5, 5, 30, 30));
+
+ container = Region();
+ container.unite(IntRect(0, 0, 10, 10));
+ container.unite(IntRect(0, 30, 10, 10));
+ container.unite(IntRect(30, 30, 10, 10));
+ container.unite(IntRect(30, 0, 10, 10));
+ TEST_NO_CONTAINS(container, IntRect(5, 5, 30, 30));
+
+ container = Region();
+ container.unite(IntRect(0, 0, 10, 10));
+ container.unite(IntRect(0, 30, 10, 10));
+ container.unite(IntRect(30, 0, 10, 40));
+ TEST_NO_CONTAINS(container, IntRect(5, 5, 30, 30));
+
+ container = Region();
+ container.unite(IntRect(30, 0, 10, 10));
+ container.unite(IntRect(30, 30, 10, 10));
+ container.unite(IntRect(0, 0, 10, 40));
+ TEST_NO_CONTAINS(container, IntRect(5, 5, 30, 30));
+
+ container = Region();
+ container.unite(IntRect(0, 0, 10, 40));
+ container.unite(IntRect(30, 0, 10, 40));
+ TEST_NO_CONTAINS(container, IntRect(5, 5, 30, 30));
+
+ container = Region();
+ container.unite(IntRect(0, 0, 40, 40));
+ TEST_NO_CONTAINS(container, IntRect(10, -1, 20, 10));
+
+ container = Region();
+ container.unite(IntRect(0, 0, 40, 40));
+ TEST_NO_CONTAINS(container, IntRect(10, 31, 20, 10));
+
+ container = Region();
+ container.unite(IntRect(0, 0, 40, 20));
+ container.unite(IntRect(0, 20, 41, 20));
+ TEST_NO_CONTAINS(container, IntRect(-1, 10, 10, 20));
+
+ container = Region();
+ container.unite(IntRect(0, 0, 40, 20));
+ container.unite(IntRect(0, 20, 41, 20));
+ TEST_NO_CONTAINS(container, IntRect(31, 10, 10, 20));
+
+ container = Region();
+ container.unite(IntRect(0, 0, 40, 40));
+ container.subtract(IntRect(0, 20, 60, 0));
+ TEST_NO_CONTAINS(container, IntRect(31, 10, 10, 20));
+}
+
+TEST(RegionTest, unite)
+{
+ Region r;
+ Region r2;
+
+ // A rect uniting a contained rect does not change the region.
+ r2 = r = IntRect(0, 0, 50, 50);
+ r2.unite(IntRect(20, 20, 10, 10));
+ EXPECT_EQ(r, r2);
+
+ // A rect uniting a containing rect gives back the containing rect.
+ r = IntRect(0, 0, 50, 50);
+ r.unite(IntRect(0, 0, 100, 100));
+ EXPECT_EQ(Region(IntRect(0, 0, 100, 100)), r);
+
+ // A complex region uniting a contained rect does not change the region.
+ r = IntRect(0, 0, 50, 50);
+ r.unite(IntRect(100, 0, 50, 50));
+ r2 = r;
+ r2.unite(IntRect(20, 20, 10, 10));
+ EXPECT_EQ(r, r2);
+
+ // A complex region uniting a containing rect gives back the containing rect.
+ r = IntRect(0, 0, 50, 50);
+ r.unite(IntRect(100, 0, 50, 50));
+ r. unite(IntRect(0, 0, 500, 500));
+ EXPECT_EQ(Region(IntRect(0, 0, 500, 500)), r);
+}
+
} // namespace
diff --git a/Source/WebKit/chromium/tests/TextureLayerChromiumTest.cpp b/Source/WebKit/chromium/tests/TextureLayerChromiumTest.cpp
new file mode 100644
index 000000000..b60017fd9
--- /dev/null
+++ b/Source/WebKit/chromium/tests/TextureLayerChromiumTest.cpp
@@ -0,0 +1,136 @@
+/*
+ * 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 "TextureLayerChromium.h"
+
+#include "FakeCCLayerTreeHostClient.h"
+#include "WebCompositor.h"
+#include "cc/CCLayerTreeHost.h"
+#include <gmock/gmock.h>
+#include <gtest/gtest.h>
+
+using namespace WebCore;
+using ::testing::Mock;
+using ::testing::_;
+using ::testing::AtLeast;
+using ::testing::AnyNumber;
+
+namespace {
+
+class MockCCLayerTreeHost : public CCLayerTreeHost {
+public:
+ MockCCLayerTreeHost()
+ : CCLayerTreeHost(&m_fakeClient, CCSettings())
+ {
+ initialize();
+ }
+
+ MOCK_METHOD0(acquireLayerTextures, void());
+
+private:
+ FakeCCLayerTreeHostClient m_fakeClient;
+};
+
+
+class TextureLayerChromiumTest : public testing::Test {
+protected:
+ virtual void SetUp()
+ {
+ // Initialize without threading support.
+ WebKit::WebCompositor::initialize(0);
+ m_layerTreeHost = adoptPtr(new MockCCLayerTreeHost);
+ }
+
+ virtual void TearDown()
+ {
+ Mock::VerifyAndClearExpectations(m_layerTreeHost.get());
+ EXPECT_CALL(*m_layerTreeHost, acquireLayerTextures()).Times(AnyNumber());
+
+ m_layerTreeHost->setRootLayer(0);
+ m_layerTreeHost.clear();
+ WebKit::WebCompositor::shutdown();
+ }
+
+ OwnPtr<MockCCLayerTreeHost> m_layerTreeHost;
+};
+
+TEST_F(TextureLayerChromiumTest, syncImplWhenChangingTextureId)
+{
+ RefPtr<TextureLayerChromium> testLayer = TextureLayerChromium::create(0);
+ ASSERT_TRUE(testLayer);
+
+ EXPECT_CALL(*m_layerTreeHost, acquireLayerTextures()).Times(AnyNumber());
+ m_layerTreeHost->setRootLayer(testLayer);
+ Mock::VerifyAndClearExpectations(m_layerTreeHost.get());
+ EXPECT_EQ(testLayer->layerTreeHost(), m_layerTreeHost.get());
+
+ EXPECT_CALL(*m_layerTreeHost, acquireLayerTextures()).Times(0);
+ testLayer->setTextureId(1);
+ Mock::VerifyAndClearExpectations(m_layerTreeHost.get());
+
+ EXPECT_CALL(*m_layerTreeHost, acquireLayerTextures()).Times(AtLeast(1));
+ testLayer->setTextureId(2);
+ Mock::VerifyAndClearExpectations(m_layerTreeHost.get());
+
+ EXPECT_CALL(*m_layerTreeHost, acquireLayerTextures()).Times(AtLeast(1));
+ testLayer->setTextureId(0);
+ Mock::VerifyAndClearExpectations(m_layerTreeHost.get());
+}
+
+TEST_F(TextureLayerChromiumTest, syncImplWhenRemovingFromTree)
+{
+ RefPtr<LayerChromium> rootLayer = LayerChromium::create();
+ ASSERT_TRUE(rootLayer);
+ RefPtr<LayerChromium> childLayer = LayerChromium::create();
+ ASSERT_TRUE(childLayer);
+ rootLayer->addChild(childLayer);
+ RefPtr<TextureLayerChromium> testLayer = TextureLayerChromium::create(0);
+ ASSERT_TRUE(testLayer);
+ testLayer->setTextureId(0);
+ childLayer->addChild(testLayer);
+
+ EXPECT_CALL(*m_layerTreeHost, acquireLayerTextures()).Times(AnyNumber());
+ m_layerTreeHost->setRootLayer(rootLayer);
+ Mock::VerifyAndClearExpectations(m_layerTreeHost.get());
+
+ EXPECT_CALL(*m_layerTreeHost, acquireLayerTextures()).Times(0);
+ testLayer->removeFromParent();
+ Mock::VerifyAndClearExpectations(m_layerTreeHost.get());
+
+ EXPECT_CALL(*m_layerTreeHost, acquireLayerTextures()).Times(0);
+ childLayer->addChild(testLayer);
+ Mock::VerifyAndClearExpectations(m_layerTreeHost.get());
+
+ EXPECT_CALL(*m_layerTreeHost, acquireLayerTextures()).Times(0);
+ testLayer->setTextureId(1);
+ Mock::VerifyAndClearExpectations(m_layerTreeHost.get());
+
+ EXPECT_CALL(*m_layerTreeHost, acquireLayerTextures()).Times(AtLeast(1));
+ testLayer->removeFromParent();
+ Mock::VerifyAndClearExpectations(m_layerTreeHost.get());
+}
+
+} // anonymous namespace
diff --git a/Source/WebKit/chromium/tests/ThrottledTextureUploaderTest.cpp b/Source/WebKit/chromium/tests/ThrottledTextureUploaderTest.cpp
new file mode 100644
index 000000000..4b0dfd059
--- /dev/null
+++ b/Source/WebKit/chromium/tests/ThrottledTextureUploaderTest.cpp
@@ -0,0 +1,93 @@
+/*
+ * 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 "ThrottledTextureUploader.h"
+
+#include "FakeWebGraphicsContext3D.h"
+#include "GraphicsContext3DPrivate.h"
+
+#include <gmock/gmock.h>
+#include <gtest/gtest.h>
+#include <wtf/RefPtr.h>
+
+using namespace WebCore;
+using namespace WebKit;
+
+namespace {
+
+class FakeWebGraphicsContext3DWithQueryTesting : public FakeWebGraphicsContext3D {
+public:
+ FakeWebGraphicsContext3DWithQueryTesting() : m_resultAvailable(0)
+ {
+ }
+
+ virtual void getQueryObjectuivEXT(WebGLId, GC3Denum type, GC3Duint* value)
+ {
+ switch (type) {
+ case Extensions3DChromium::QUERY_RESULT_AVAILABLE_EXT:
+ *value = m_resultAvailable;
+ break;
+ default:
+ *value = 0;
+ break;
+ }
+ }
+
+ void setResultAvailable(unsigned resultAvailable) { m_resultAvailable = resultAvailable; }
+
+private:
+ unsigned m_resultAvailable;
+};
+
+TEST(ThrottledTextureUploaderTest, IsBusy)
+{
+ GraphicsContext3D::Attributes attrs;
+ RefPtr<GraphicsContext3D> context = GraphicsContext3DPrivate::createGraphicsContextFromWebContext(adoptPtr(new FakeWebGraphicsContext3DWithQueryTesting()), GraphicsContext3D::RenderDirectlyToHostWindow);
+ FakeWebGraphicsContext3DWithQueryTesting& fakeContext = *static_cast<FakeWebGraphicsContext3DWithQueryTesting*>(GraphicsContext3DPrivate::extractWebGraphicsContext3D(context.get()));
+ OwnPtr<ThrottledTextureUploader> uploader = ThrottledTextureUploader::create(context, 2);
+
+ fakeContext.setResultAvailable(0);
+ EXPECT_FALSE(uploader->isBusy());
+ uploader->beginUploads();
+ uploader->endUploads();
+ EXPECT_FALSE(uploader->isBusy());
+ uploader->beginUploads();
+ uploader->endUploads();
+ EXPECT_TRUE(uploader->isBusy());
+
+ fakeContext.setResultAvailable(1);
+ EXPECT_FALSE(uploader->isBusy());
+ uploader->beginUploads();
+ uploader->endUploads();
+ EXPECT_FALSE(uploader->isBusy());
+ uploader->beginUploads();
+ uploader->endUploads();
+ EXPECT_FALSE(uploader->isBusy());
+ uploader->beginUploads();
+ uploader->endUploads();
+}
+
+} // namespace
diff --git a/Source/WebKit/chromium/tests/TiledLayerChromiumTest.cpp b/Source/WebKit/chromium/tests/TiledLayerChromiumTest.cpp
index 5b7cb0df7..c9125a852 100644
--- a/Source/WebKit/chromium/tests/TiledLayerChromiumTest.cpp
+++ b/Source/WebKit/chromium/tests/TiledLayerChromiumTest.cpp
@@ -957,7 +957,7 @@ TEST(TiledLayerChromiumTest, partialUpdates)
}
ccLayerTreeHost->commitComplete();
- // Partail update of 6 checkerboard tiles.
+ // Partial update of 6 checkerboard tiles.
layer->invalidateRect(IntRect(50, 50, 200, 100));
{
DebugScopedSetImplThread implThread;
@@ -975,6 +975,20 @@ TEST(TiledLayerChromiumTest, partialUpdates)
}
ccLayerTreeHost->commitComplete();
+ // Partial update of 4 tiles.
+ layer->invalidateRect(IntRect(50, 50, 100, 100));
+ {
+ DebugScopedSetImplThread implThread;
+ OwnPtr<FakeCCTiledLayerImpl> layerImpl(adoptPtr(new FakeCCTiledLayerImpl(0)));
+ ccLayerTreeHost->updateLayers(updater);
+ updater.update(0, &allocator, &copier, &uploader, 4);
+ EXPECT_EQ(4, layer->fakeLayerTextureUpdater()->updateCount());
+ EXPECT_FALSE(updater.hasMoreUpdates());
+ layer->fakeLayerTextureUpdater()->clearUpdateCount();
+ layer->pushPropertiesTo(layerImpl.get());
+ }
+ ccLayerTreeHost->commitComplete();
+
ccLayerTreeHost->setRootLayer(0);
ccLayerTreeHost.clear();
WebKit::WebCompositor::shutdown();
diff --git a/Source/WebKit/chromium/tests/TilingDataTest.cpp b/Source/WebKit/chromium/tests/TilingDataTest.cpp
index 47c0361ea..060bc7767 100755
--- a/Source/WebKit/chromium/tests/TilingDataTest.cpp
+++ b/Source/WebKit/chromium/tests/TilingDataTest.cpp
@@ -30,6 +30,7 @@
#include "config.h"
+#include "IntSize.h"
#include "TilingData.h"
#include <wtf/Assertions.h>
@@ -41,8 +42,8 @@ namespace {
class TestTiling : public TilingData {
public:
- TestTiling(int maxTextureSize, int totalSizeX, int totalSizeY, bool hasBorderTexels)
- : TilingData(maxTextureSize, totalSizeX, totalSizeY, hasBorderTexels)
+ TestTiling(IntSize maxTextureSize, IntSize totalSize, bool hasBorderTexels)
+ : TilingData(maxTextureSize, totalSize, hasBorderTexels)
{
}
@@ -62,402 +63,413 @@ public:
TEST(TilingDataTest, numTiles_NoTiling)
{
- EXPECT_EQ(1, TestTiling(16, 16, 16, false).numTiles());
- EXPECT_EQ(1, TestTiling(16, 15, 15, true).numTiles());
- EXPECT_EQ(1, TestTiling(16, 16, 16, true).numTiles());
- EXPECT_EQ(1, TestTiling(16, 1, 16, false).numTiles());
- EXPECT_EQ(1, TestTiling(15, 15, 15, true).numTiles());
+ EXPECT_EQ(1, TestTiling(IntSize(16, 16), IntSize(16, 16), false).numTiles());
+ EXPECT_EQ(1, TestTiling(IntSize(16, 16), IntSize(15, 15), true).numTiles());
+ EXPECT_EQ(1, TestTiling(IntSize(16, 16), IntSize(16, 16), true).numTiles());
+ EXPECT_EQ(1, TestTiling(IntSize(16, 16), IntSize(1, 16), false).numTiles());
+ EXPECT_EQ(1, TestTiling(IntSize(15, 15), IntSize(15, 15), true).numTiles());
+ EXPECT_EQ(1, TestTiling(IntSize(32, 16), IntSize(32, 16), false).numTiles());
+ EXPECT_EQ(1, TestTiling(IntSize(32, 16), IntSize(32, 16), true).numTiles());
}
TEST(TilingDataTest, numTiles_TilingNoBorders)
{
- EXPECT_EQ(0, TestTiling(0, 0, 0, false).numTiles());
- EXPECT_EQ(0, TestTiling(0, 4, 0, false).numTiles());
- EXPECT_EQ(0, TestTiling(0, 0, 4, false).numTiles());
- EXPECT_EQ(0, TestTiling(4, 4, 0, false).numTiles());
- EXPECT_EQ(0, TestTiling(4, 0, 4, false).numTiles());
- EXPECT_EQ(0, TestTiling(-8, 1, 1, false).numTiles());
- EXPECT_EQ(0, TestTiling(-1, 1, 1, false).numTiles());
- EXPECT_EQ(0, TestTiling(0, 1, 1, false).numTiles());
-
- EXPECT_EQ(1, TestTiling(1, 1, 1, false).numTiles());
- EXPECT_EQ(2, TestTiling(1, 1, 2, false).numTiles());
- EXPECT_EQ(2, TestTiling(1, 2, 1, false).numTiles());
- EXPECT_EQ(1, TestTiling(2, 1, 1, false).numTiles());
- EXPECT_EQ(1, TestTiling(2, 1, 2, false).numTiles());
- EXPECT_EQ(1, TestTiling(2, 2, 1, false).numTiles());
- EXPECT_EQ(1, TestTiling(2, 2, 2, false).numTiles());
- EXPECT_EQ(1, TestTiling(3, 3, 3, false).numTiles());
-
- EXPECT_EQ(1, TestTiling(4, 1, 4, false).numTiles());
- EXPECT_EQ(1, TestTiling(4, 2, 4, false).numTiles());
- EXPECT_EQ(1, TestTiling(4, 3, 4, false).numTiles());
- EXPECT_EQ(1, TestTiling(4, 4, 4, false).numTiles());
- EXPECT_EQ(2, TestTiling(4, 5, 4, false).numTiles());
- EXPECT_EQ(2, TestTiling(4, 6, 4, false).numTiles());
- EXPECT_EQ(2, TestTiling(4, 7, 4, false).numTiles());
- EXPECT_EQ(2, TestTiling(4, 8, 4, false).numTiles());
- EXPECT_EQ(3, TestTiling(4, 9, 4, false).numTiles());
- EXPECT_EQ(3, TestTiling(4, 10, 4, false).numTiles());
- EXPECT_EQ(3, TestTiling(4, 11, 4, false).numTiles());
-
- EXPECT_EQ(1, TestTiling(5, 1, 5, false).numTiles());
- EXPECT_EQ(1, TestTiling(5, 2, 5, false).numTiles());
- EXPECT_EQ(1, TestTiling(5, 3, 5, false).numTiles());
- EXPECT_EQ(1, TestTiling(5, 4, 5, false).numTiles());
- EXPECT_EQ(1, TestTiling(5, 5, 5, false).numTiles());
- EXPECT_EQ(2, TestTiling(5, 6, 5, false).numTiles());
- EXPECT_EQ(2, TestTiling(5, 7, 5, false).numTiles());
- EXPECT_EQ(2, TestTiling(5, 8, 5, false).numTiles());
- EXPECT_EQ(2, TestTiling(5, 9, 5, false).numTiles());
- EXPECT_EQ(2, TestTiling(5, 10, 5, false).numTiles());
- EXPECT_EQ(3, TestTiling(5, 11, 5, false).numTiles());
-
- EXPECT_EQ(1, TestTiling(16, 16, 16, false).numTiles());
- EXPECT_EQ(1, TestTiling(17, 16, 16, false).numTiles());
- EXPECT_EQ(4, TestTiling(15, 16, 16, false).numTiles());
- EXPECT_EQ(4, TestTiling(8, 16, 16, false).numTiles());
- EXPECT_EQ(6, TestTiling(8, 17, 16, false).numTiles());
+ EXPECT_EQ(0, TestTiling(IntSize(0, 0), IntSize(0, 0), false).numTiles());
+ EXPECT_EQ(0, TestTiling(IntSize(0, 0), IntSize(4, 0), false).numTiles());
+ EXPECT_EQ(0, TestTiling(IntSize(0, 0), IntSize(0, 4), false).numTiles());
+ EXPECT_EQ(0, TestTiling(IntSize(4, 4), IntSize(4, 0), false).numTiles());
+ EXPECT_EQ(0, TestTiling(IntSize(4, 4), IntSize(0, 4), false).numTiles());
+ EXPECT_EQ(0, TestTiling(IntSize(-8, -8), IntSize(1, 1), false).numTiles());
+ EXPECT_EQ(0, TestTiling(IntSize(-1, -1), IntSize(1, 1), false).numTiles());
+ EXPECT_EQ(0, TestTiling(IntSize(0, 0), IntSize(1, 1), false).numTiles());
+
+ EXPECT_EQ(1, TestTiling(IntSize(1, 1), IntSize(1, 1), false).numTiles());
+ EXPECT_EQ(2, TestTiling(IntSize(1, 1), IntSize(1, 2), false).numTiles());
+ EXPECT_EQ(2, TestTiling(IntSize(1, 1), IntSize(2, 1), false).numTiles());
+ EXPECT_EQ(1, TestTiling(IntSize(2, 2), IntSize(1, 1), false).numTiles());
+ EXPECT_EQ(1, TestTiling(IntSize(2, 2), IntSize(1, 2), false).numTiles());
+ EXPECT_EQ(1, TestTiling(IntSize(2, 2), IntSize(2, 1), false).numTiles());
+ EXPECT_EQ(1, TestTiling(IntSize(2, 2), IntSize(2, 2), false).numTiles());
+ EXPECT_EQ(1, TestTiling(IntSize(3, 3), IntSize(3, 3), false).numTiles());
+
+ EXPECT_EQ(1, TestTiling(IntSize(4, 4), IntSize(1, 4), false).numTiles());
+ EXPECT_EQ(1, TestTiling(IntSize(4, 4), IntSize(2, 4), false).numTiles());
+ EXPECT_EQ(1, TestTiling(IntSize(4, 4), IntSize(3, 4), false).numTiles());
+ EXPECT_EQ(1, TestTiling(IntSize(4, 4), IntSize(4, 4), false).numTiles());
+ EXPECT_EQ(2, TestTiling(IntSize(4, 4), IntSize(5, 4), false).numTiles());
+ EXPECT_EQ(2, TestTiling(IntSize(4, 4), IntSize(6, 4), false).numTiles());
+ EXPECT_EQ(2, TestTiling(IntSize(4, 4), IntSize(7, 4), false).numTiles());
+ EXPECT_EQ(2, TestTiling(IntSize(4, 4), IntSize(8, 4), false).numTiles());
+ EXPECT_EQ(3, TestTiling(IntSize(4, 4), IntSize(9, 4), false).numTiles());
+ EXPECT_EQ(3, TestTiling(IntSize(4, 4), IntSize(10, 4), false).numTiles());
+ EXPECT_EQ(3, TestTiling(IntSize(4, 4), IntSize(11, 4), false).numTiles());
+
+ EXPECT_EQ(1, TestTiling(IntSize(5, 5), IntSize(1, 5), false).numTiles());
+ EXPECT_EQ(1, TestTiling(IntSize(5, 5), IntSize(2, 5), false).numTiles());
+ EXPECT_EQ(1, TestTiling(IntSize(5, 5), IntSize(3, 5), false).numTiles());
+ EXPECT_EQ(1, TestTiling(IntSize(5, 5), IntSize(4, 5), false).numTiles());
+ EXPECT_EQ(1, TestTiling(IntSize(5, 5), IntSize(5, 5), false).numTiles());
+ EXPECT_EQ(2, TestTiling(IntSize(5, 5), IntSize(6, 5), false).numTiles());
+ EXPECT_EQ(2, TestTiling(IntSize(5, 5), IntSize(7, 5), false).numTiles());
+ EXPECT_EQ(2, TestTiling(IntSize(5, 5), IntSize(8, 5), false).numTiles());
+ EXPECT_EQ(2, TestTiling(IntSize(5, 5), IntSize(9, 5), false).numTiles());
+ EXPECT_EQ(2, TestTiling(IntSize(5, 5), IntSize(10, 5), false).numTiles());
+ EXPECT_EQ(3, TestTiling(IntSize(5, 5), IntSize(11, 5), false).numTiles());
+
+ EXPECT_EQ(1, TestTiling(IntSize(16, 16), IntSize(16, 16), false).numTiles());
+ EXPECT_EQ(1, TestTiling(IntSize(17, 17), IntSize(16, 16), false).numTiles());
+ EXPECT_EQ(4, TestTiling(IntSize(15, 15), IntSize(16, 16), false).numTiles());
+ EXPECT_EQ(4, TestTiling(IntSize(8, 8), IntSize(16, 16), false).numTiles());
+ EXPECT_EQ(6, TestTiling(IntSize(8, 8), IntSize(17, 16), false).numTiles());
+
+ EXPECT_EQ(8, TestTiling(IntSize(5, 8), IntSize(17, 16), false).numTiles());
}
TEST(TilingDataTest, numTiles_TilingWithBorders)
{
- EXPECT_EQ(0, TestTiling(0, 0, 0, true).numTiles());
- EXPECT_EQ(0, TestTiling(0, 4, 0, true).numTiles());
- EXPECT_EQ(0, TestTiling(0, 0, 4, true).numTiles());
- EXPECT_EQ(0, TestTiling(4, 4, 0, true).numTiles());
- EXPECT_EQ(0, TestTiling(4, 0, 4, true).numTiles());
- EXPECT_EQ(0, TestTiling(-8, 1, 1, true).numTiles());
- EXPECT_EQ(0, TestTiling(-1, 1, 1, true).numTiles());
- EXPECT_EQ(0, TestTiling(0, 1, 1, true).numTiles());
-
- EXPECT_EQ(1, TestTiling(1, 1, 1, true).numTiles());
- EXPECT_EQ(0, TestTiling(1, 1, 2, true).numTiles());
- EXPECT_EQ(0, TestTiling(1, 2, 1, true).numTiles());
- EXPECT_EQ(1, TestTiling(2, 1, 1, true).numTiles());
- EXPECT_EQ(1, TestTiling(2, 1, 2, true).numTiles());
- EXPECT_EQ(1, TestTiling(2, 2, 1, true).numTiles());
- EXPECT_EQ(1, TestTiling(2, 2, 2, true).numTiles());
-
- EXPECT_EQ(1, TestTiling(3, 1, 3, true).numTiles());
- EXPECT_EQ(1, TestTiling(3, 2, 3, true).numTiles());
- EXPECT_EQ(1, TestTiling(3, 3, 3, true).numTiles());
- EXPECT_EQ(2, TestTiling(3, 4, 3, true).numTiles());
- EXPECT_EQ(3, TestTiling(3, 5, 3, true).numTiles());
- EXPECT_EQ(4, TestTiling(3, 6, 3, true).numTiles());
- EXPECT_EQ(5, TestTiling(3, 7, 3, true).numTiles());
-
- EXPECT_EQ(1, TestTiling(4, 1, 4, true).numTiles());
- EXPECT_EQ(1, TestTiling(4, 2, 4, true).numTiles());
- EXPECT_EQ(1, TestTiling(4, 3, 4, true).numTiles());
- EXPECT_EQ(1, TestTiling(4, 4, 4, true).numTiles());
- EXPECT_EQ(2, TestTiling(4, 5, 4, true).numTiles());
- EXPECT_EQ(2, TestTiling(4, 6, 4, true).numTiles());
- EXPECT_EQ(3, TestTiling(4, 7, 4, true).numTiles());
- EXPECT_EQ(3, TestTiling(4, 8, 4, true).numTiles());
- EXPECT_EQ(4, TestTiling(4, 9, 4, true).numTiles());
- EXPECT_EQ(4, TestTiling(4, 10, 4, true).numTiles());
- EXPECT_EQ(5, TestTiling(4, 11, 4, true).numTiles());
-
- EXPECT_EQ(1, TestTiling(5, 1, 5, true).numTiles());
- EXPECT_EQ(1, TestTiling(5, 2, 5, true).numTiles());
- EXPECT_EQ(1, TestTiling(5, 3, 5, true).numTiles());
- EXPECT_EQ(1, TestTiling(5, 4, 5, true).numTiles());
- EXPECT_EQ(1, TestTiling(5, 5, 5, true).numTiles());
- EXPECT_EQ(2, TestTiling(5, 6, 5, true).numTiles());
- EXPECT_EQ(2, TestTiling(5, 7, 5, true).numTiles());
- EXPECT_EQ(2, TestTiling(5, 8, 5, true).numTiles());
- EXPECT_EQ(3, TestTiling(5, 9, 5, true).numTiles());
- EXPECT_EQ(3, TestTiling(5, 10, 5, true).numTiles());
- EXPECT_EQ(3, TestTiling(5, 11, 5, true).numTiles());
+ EXPECT_EQ(0, TestTiling(IntSize(0, 0), IntSize(0, 0), true).numTiles());
+ EXPECT_EQ(0, TestTiling(IntSize(0, 0), IntSize(4, 0), true).numTiles());
+ EXPECT_EQ(0, TestTiling(IntSize(0, 0), IntSize(0, 4), true).numTiles());
+ EXPECT_EQ(0, TestTiling(IntSize(4, 4), IntSize(4, 0), true).numTiles());
+ EXPECT_EQ(0, TestTiling(IntSize(4, 4), IntSize(0, 4), true).numTiles());
+ EXPECT_EQ(0, TestTiling(IntSize(-8, -8), IntSize(1, 1), true).numTiles());
+ EXPECT_EQ(0, TestTiling(IntSize(-1, -1), IntSize(1, 1), true).numTiles());
+ EXPECT_EQ(0, TestTiling(IntSize(0, 0), IntSize(1, 1), true).numTiles());
+
+ EXPECT_EQ(1, TestTiling(IntSize(1, 1), IntSize(1, 1), true).numTiles());
+ EXPECT_EQ(0, TestTiling(IntSize(1, 1), IntSize(1, 2), true).numTiles());
+ EXPECT_EQ(0, TestTiling(IntSize(1, 1), IntSize(2, 1), true).numTiles());
+ EXPECT_EQ(1, TestTiling(IntSize(2, 2), IntSize(1, 1), true).numTiles());
+ EXPECT_EQ(1, TestTiling(IntSize(2, 2), IntSize(1, 2), true).numTiles());
+ EXPECT_EQ(1, TestTiling(IntSize(2, 2), IntSize(2, 1), true).numTiles());
+ EXPECT_EQ(1, TestTiling(IntSize(2, 2), IntSize(2, 2), true).numTiles());
+
+ EXPECT_EQ(1, TestTiling(IntSize(3, 3), IntSize(1, 3), true).numTiles());
+ EXPECT_EQ(1, TestTiling(IntSize(3, 3), IntSize(2, 3), true).numTiles());
+ EXPECT_EQ(1, TestTiling(IntSize(3, 3), IntSize(3, 3), true).numTiles());
+ EXPECT_EQ(2, TestTiling(IntSize(3, 3), IntSize(4, 3), true).numTiles());
+ EXPECT_EQ(3, TestTiling(IntSize(3, 3), IntSize(5, 3), true).numTiles());
+ EXPECT_EQ(4, TestTiling(IntSize(3, 3), IntSize(6, 3), true).numTiles());
+ EXPECT_EQ(5, TestTiling(IntSize(3, 3), IntSize(7, 3), true).numTiles());
+
+ EXPECT_EQ(1, TestTiling(IntSize(4, 4), IntSize(1, 4), true).numTiles());
+ EXPECT_EQ(1, TestTiling(IntSize(4, 4), IntSize(2, 4), true).numTiles());
+ EXPECT_EQ(1, TestTiling(IntSize(4, 4), IntSize(3, 4), true).numTiles());
+ EXPECT_EQ(1, TestTiling(IntSize(4, 4), IntSize(4, 4), true).numTiles());
+ EXPECT_EQ(2, TestTiling(IntSize(4, 4), IntSize(5, 4), true).numTiles());
+ EXPECT_EQ(2, TestTiling(IntSize(4, 4), IntSize(6, 4), true).numTiles());
+ EXPECT_EQ(3, TestTiling(IntSize(4, 4), IntSize(7, 4), true).numTiles());
+ EXPECT_EQ(3, TestTiling(IntSize(4, 4), IntSize(8, 4), true).numTiles());
+ EXPECT_EQ(4, TestTiling(IntSize(4, 4), IntSize(9, 4), true).numTiles());
+ EXPECT_EQ(4, TestTiling(IntSize(4, 4), IntSize(10, 4), true).numTiles());
+ EXPECT_EQ(5, TestTiling(IntSize(4, 4), IntSize(11, 4), true).numTiles());
+
+ EXPECT_EQ(1, TestTiling(IntSize(5, 5), IntSize(1, 5), true).numTiles());
+ EXPECT_EQ(1, TestTiling(IntSize(5, 5), IntSize(2, 5), true).numTiles());
+ EXPECT_EQ(1, TestTiling(IntSize(5, 5), IntSize(3, 5), true).numTiles());
+ EXPECT_EQ(1, TestTiling(IntSize(5, 5), IntSize(4, 5), true).numTiles());
+ EXPECT_EQ(1, TestTiling(IntSize(5, 5), IntSize(5, 5), true).numTiles());
+ EXPECT_EQ(2, TestTiling(IntSize(5, 5), IntSize(6, 5), true).numTiles());
+ EXPECT_EQ(2, TestTiling(IntSize(5, 5), IntSize(7, 5), true).numTiles());
+ EXPECT_EQ(2, TestTiling(IntSize(5, 5), IntSize(8, 5), true).numTiles());
+ EXPECT_EQ(3, TestTiling(IntSize(5, 5), IntSize(9, 5), true).numTiles());
+ EXPECT_EQ(3, TestTiling(IntSize(5, 5), IntSize(10, 5), true).numTiles());
+ EXPECT_EQ(3, TestTiling(IntSize(5, 5), IntSize(11, 5), true).numTiles());
+
+ EXPECT_EQ(30, TestTiling(IntSize(8, 5), IntSize(16, 32), true).numTiles());
}
TEST(TilingDataTest, tileXIndexFromSrcCoord)
{
- EXPECT_EQ(0, TestTiling(3, 10, 10, false).tileXIndexFromSrcCoord(0));
- EXPECT_EQ(0, TestTiling(3, 10, 10, false).tileXIndexFromSrcCoord(1));
- EXPECT_EQ(0, TestTiling(3, 10, 10, false).tileXIndexFromSrcCoord(2));
- EXPECT_EQ(1, TestTiling(3, 10, 10, false).tileXIndexFromSrcCoord(3));
- EXPECT_EQ(1, TestTiling(3, 10, 10, false).tileXIndexFromSrcCoord(4));
- EXPECT_EQ(1, TestTiling(3, 10, 10, false).tileXIndexFromSrcCoord(5));
- EXPECT_EQ(2, TestTiling(3, 10, 10, false).tileXIndexFromSrcCoord(6));
- EXPECT_EQ(2, TestTiling(3, 10, 10, false).tileXIndexFromSrcCoord(7));
- EXPECT_EQ(2, TestTiling(3, 10, 10, false).tileXIndexFromSrcCoord(8));
- EXPECT_EQ(3, TestTiling(3, 10, 10, false).tileXIndexFromSrcCoord(9));
- EXPECT_EQ(3, TestTiling(3, 10, 10, false).tileXIndexFromSrcCoord(10));
- EXPECT_EQ(3, TestTiling(3, 10, 10, false).tileXIndexFromSrcCoord(11));
-
- EXPECT_EQ(0, TestTiling(3, 10, 10, true).tileXIndexFromSrcCoord(0));
- EXPECT_EQ(0, TestTiling(3, 10, 10, true).tileXIndexFromSrcCoord(1));
- EXPECT_EQ(1, TestTiling(3, 10, 10, true).tileXIndexFromSrcCoord(2));
- EXPECT_EQ(2, TestTiling(3, 10, 10, true).tileXIndexFromSrcCoord(3));
- EXPECT_EQ(3, TestTiling(3, 10, 10, true).tileXIndexFromSrcCoord(4));
- EXPECT_EQ(4, TestTiling(3, 10, 10, true).tileXIndexFromSrcCoord(5));
- EXPECT_EQ(5, TestTiling(3, 10, 10, true).tileXIndexFromSrcCoord(6));
- EXPECT_EQ(6, TestTiling(3, 10, 10, true).tileXIndexFromSrcCoord(7));
- EXPECT_EQ(7, TestTiling(3, 10, 10, true).tileXIndexFromSrcCoord(8));
- EXPECT_EQ(7, TestTiling(3, 10, 10, true).tileXIndexFromSrcCoord(9));
- EXPECT_EQ(7, TestTiling(3, 10, 10, true).tileXIndexFromSrcCoord(10));
- EXPECT_EQ(7, TestTiling(3, 10, 10, true).tileXIndexFromSrcCoord(11));
-
- EXPECT_EQ(0, TestTiling(1, 1, 1, false).tileXIndexFromSrcCoord(0));
- EXPECT_EQ(0, TestTiling(2, 2, 2, false).tileXIndexFromSrcCoord(0));
- EXPECT_EQ(0, TestTiling(2, 2, 2, false).tileXIndexFromSrcCoord(1));
- EXPECT_EQ(0, TestTiling(3, 3, 3, false).tileXIndexFromSrcCoord(0));
- EXPECT_EQ(0, TestTiling(3, 3, 3, false).tileXIndexFromSrcCoord(1));
- EXPECT_EQ(0, TestTiling(3, 3, 3, false).tileXIndexFromSrcCoord(2));
-
- EXPECT_EQ(0, TestTiling(3, 4, 3, false).tileXIndexFromSrcCoord(0));
- EXPECT_EQ(0, TestTiling(3, 4, 3, false).tileXIndexFromSrcCoord(1));
- EXPECT_EQ(0, TestTiling(3, 4, 3, false).tileXIndexFromSrcCoord(2));
- EXPECT_EQ(1, TestTiling(3, 4, 3, false).tileXIndexFromSrcCoord(3));
-
- EXPECT_EQ(0, TestTiling(1, 1, 1, true).tileXIndexFromSrcCoord(0));
- EXPECT_EQ(0, TestTiling(2, 2, 2, true).tileXIndexFromSrcCoord(0));
- EXPECT_EQ(0, TestTiling(2, 2, 2, true).tileXIndexFromSrcCoord(1));
- EXPECT_EQ(0, TestTiling(3, 3, 3, true).tileXIndexFromSrcCoord(0));
- EXPECT_EQ(0, TestTiling(3, 3, 3, true).tileXIndexFromSrcCoord(1));
- EXPECT_EQ(0, TestTiling(3, 3, 3, true).tileXIndexFromSrcCoord(2));
-
- EXPECT_EQ(0, TestTiling(3, 4, 3, true).tileXIndexFromSrcCoord(0));
- EXPECT_EQ(0, TestTiling(3, 4, 3, true).tileXIndexFromSrcCoord(1));
- EXPECT_EQ(1, TestTiling(3, 4, 3, true).tileXIndexFromSrcCoord(2));
- EXPECT_EQ(1, TestTiling(3, 4, 3, true).tileXIndexFromSrcCoord(3));
+ EXPECT_EQ(0, TestTiling(IntSize(3, 3), IntSize(10, 10), false).tileXIndexFromSrcCoord(0));
+ EXPECT_EQ(0, TestTiling(IntSize(3, 3), IntSize(10, 10), false).tileXIndexFromSrcCoord(1));
+ EXPECT_EQ(0, TestTiling(IntSize(3, 3), IntSize(10, 10), false).tileXIndexFromSrcCoord(2));
+ EXPECT_EQ(1, TestTiling(IntSize(3, 3), IntSize(10, 10), false).tileXIndexFromSrcCoord(3));
+ EXPECT_EQ(1, TestTiling(IntSize(3, 3), IntSize(10, 10), false).tileXIndexFromSrcCoord(4));
+ EXPECT_EQ(1, TestTiling(IntSize(3, 3), IntSize(10, 10), false).tileXIndexFromSrcCoord(5));
+ EXPECT_EQ(2, TestTiling(IntSize(3, 3), IntSize(10, 10), false).tileXIndexFromSrcCoord(6));
+ EXPECT_EQ(2, TestTiling(IntSize(3, 3), IntSize(10, 10), false).tileXIndexFromSrcCoord(7));
+ EXPECT_EQ(2, TestTiling(IntSize(3, 3), IntSize(10, 10), false).tileXIndexFromSrcCoord(8));
+ EXPECT_EQ(3, TestTiling(IntSize(3, 3), IntSize(10, 10), false).tileXIndexFromSrcCoord(9));
+ EXPECT_EQ(3, TestTiling(IntSize(3, 3), IntSize(10, 10), false).tileXIndexFromSrcCoord(10));
+ EXPECT_EQ(3, TestTiling(IntSize(3, 3), IntSize(10, 10), false).tileXIndexFromSrcCoord(11));
+
+ EXPECT_EQ(0, TestTiling(IntSize(3, 3), IntSize(10, 10), true).tileXIndexFromSrcCoord(0));
+ EXPECT_EQ(0, TestTiling(IntSize(3, 3), IntSize(10, 10), true).tileXIndexFromSrcCoord(1));
+ EXPECT_EQ(1, TestTiling(IntSize(3, 3), IntSize(10, 10), true).tileXIndexFromSrcCoord(2));
+ EXPECT_EQ(2, TestTiling(IntSize(3, 3), IntSize(10, 10), true).tileXIndexFromSrcCoord(3));
+ EXPECT_EQ(3, TestTiling(IntSize(3, 3), IntSize(10, 10), true).tileXIndexFromSrcCoord(4));
+ EXPECT_EQ(4, TestTiling(IntSize(3, 3), IntSize(10, 10), true).tileXIndexFromSrcCoord(5));
+ EXPECT_EQ(5, TestTiling(IntSize(3, 3), IntSize(10, 10), true).tileXIndexFromSrcCoord(6));
+ EXPECT_EQ(6, TestTiling(IntSize(3, 3), IntSize(10, 10), true).tileXIndexFromSrcCoord(7));
+ EXPECT_EQ(7, TestTiling(IntSize(3, 3), IntSize(10, 10), true).tileXIndexFromSrcCoord(8));
+ EXPECT_EQ(7, TestTiling(IntSize(3, 3), IntSize(10, 10), true).tileXIndexFromSrcCoord(9));
+ EXPECT_EQ(7, TestTiling(IntSize(3, 3), IntSize(10, 10), true).tileXIndexFromSrcCoord(10));
+ EXPECT_EQ(7, TestTiling(IntSize(3, 3), IntSize(10, 10), true).tileXIndexFromSrcCoord(11));
+
+ EXPECT_EQ(0, TestTiling(IntSize(1, 1), IntSize(1, 1), false).tileXIndexFromSrcCoord(0));
+ EXPECT_EQ(0, TestTiling(IntSize(2, 2), IntSize(2, 2), false).tileXIndexFromSrcCoord(0));
+ EXPECT_EQ(0, TestTiling(IntSize(2, 2), IntSize(2, 2), false).tileXIndexFromSrcCoord(1));
+ EXPECT_EQ(0, TestTiling(IntSize(3, 3), IntSize(3, 3), false).tileXIndexFromSrcCoord(0));
+ EXPECT_EQ(0, TestTiling(IntSize(3, 3), IntSize(3, 3), false).tileXIndexFromSrcCoord(1));
+ EXPECT_EQ(0, TestTiling(IntSize(3, 3), IntSize(3, 3), false).tileXIndexFromSrcCoord(2));
+
+ EXPECT_EQ(0, TestTiling(IntSize(3, 3), IntSize(4, 3), false).tileXIndexFromSrcCoord(0));
+ EXPECT_EQ(0, TestTiling(IntSize(3, 3), IntSize(4, 3), false).tileXIndexFromSrcCoord(1));
+ EXPECT_EQ(0, TestTiling(IntSize(3, 3), IntSize(4, 3), false).tileXIndexFromSrcCoord(2));
+ EXPECT_EQ(1, TestTiling(IntSize(3, 3), IntSize(4, 3), false).tileXIndexFromSrcCoord(3));
+
+ EXPECT_EQ(0, TestTiling(IntSize(1, 1), IntSize(1, 1), true).tileXIndexFromSrcCoord(0));
+ EXPECT_EQ(0, TestTiling(IntSize(2, 2), IntSize(2, 2), true).tileXIndexFromSrcCoord(0));
+ EXPECT_EQ(0, TestTiling(IntSize(2, 2), IntSize(2, 2), true).tileXIndexFromSrcCoord(1));
+ EXPECT_EQ(0, TestTiling(IntSize(3, 3), IntSize(3, 3), true).tileXIndexFromSrcCoord(0));
+ EXPECT_EQ(0, TestTiling(IntSize(3, 3), IntSize(3, 3), true).tileXIndexFromSrcCoord(1));
+ EXPECT_EQ(0, TestTiling(IntSize(3, 3), IntSize(3, 3), true).tileXIndexFromSrcCoord(2));
+
+ EXPECT_EQ(0, TestTiling(IntSize(3, 3), IntSize(4, 3), true).tileXIndexFromSrcCoord(0));
+ EXPECT_EQ(0, TestTiling(IntSize(3, 3), IntSize(4, 3), true).tileXIndexFromSrcCoord(1));
+ EXPECT_EQ(1, TestTiling(IntSize(3, 3), IntSize(4, 3), true).tileXIndexFromSrcCoord(2));
+ EXPECT_EQ(1, TestTiling(IntSize(3, 3), IntSize(4, 3), true).tileXIndexFromSrcCoord(3));
}
TEST(TilingDataTest, tileYIndexFromSrcCoord)
{
- EXPECT_EQ(0, TestTiling(3, 10, 10, false).tileYIndexFromSrcCoord(0));
- EXPECT_EQ(0, TestTiling(3, 10, 10, false).tileYIndexFromSrcCoord(1));
- EXPECT_EQ(0, TestTiling(3, 10, 10, false).tileYIndexFromSrcCoord(2));
- EXPECT_EQ(1, TestTiling(3, 10, 10, false).tileYIndexFromSrcCoord(3));
- EXPECT_EQ(1, TestTiling(3, 10, 10, false).tileYIndexFromSrcCoord(4));
- EXPECT_EQ(1, TestTiling(3, 10, 10, false).tileYIndexFromSrcCoord(5));
- EXPECT_EQ(2, TestTiling(3, 10, 10, false).tileYIndexFromSrcCoord(6));
- EXPECT_EQ(2, TestTiling(3, 10, 10, false).tileYIndexFromSrcCoord(7));
- EXPECT_EQ(2, TestTiling(3, 10, 10, false).tileYIndexFromSrcCoord(8));
- EXPECT_EQ(3, TestTiling(3, 10, 10, false).tileYIndexFromSrcCoord(9));
- EXPECT_EQ(3, TestTiling(3, 10, 10, false).tileYIndexFromSrcCoord(10));
- EXPECT_EQ(3, TestTiling(3, 10, 10, false).tileYIndexFromSrcCoord(11));
-
- EXPECT_EQ(0, TestTiling(3, 10, 10, true).tileYIndexFromSrcCoord(0));
- EXPECT_EQ(0, TestTiling(3, 10, 10, true).tileYIndexFromSrcCoord(1));
- EXPECT_EQ(1, TestTiling(3, 10, 10, true).tileYIndexFromSrcCoord(2));
- EXPECT_EQ(2, TestTiling(3, 10, 10, true).tileYIndexFromSrcCoord(3));
- EXPECT_EQ(3, TestTiling(3, 10, 10, true).tileYIndexFromSrcCoord(4));
- EXPECT_EQ(4, TestTiling(3, 10, 10, true).tileYIndexFromSrcCoord(5));
- EXPECT_EQ(5, TestTiling(3, 10, 10, true).tileYIndexFromSrcCoord(6));
- EXPECT_EQ(6, TestTiling(3, 10, 10, true).tileYIndexFromSrcCoord(7));
- EXPECT_EQ(7, TestTiling(3, 10, 10, true).tileYIndexFromSrcCoord(8));
- EXPECT_EQ(7, TestTiling(3, 10, 10, true).tileYIndexFromSrcCoord(9));
- EXPECT_EQ(7, TestTiling(3, 10, 10, true).tileYIndexFromSrcCoord(10));
- EXPECT_EQ(7, TestTiling(3, 10, 10, true).tileYIndexFromSrcCoord(11));
-
- EXPECT_EQ(0, TestTiling(1, 1, 1, false).tileYIndexFromSrcCoord(0));
- EXPECT_EQ(0, TestTiling(2, 2, 2, false).tileYIndexFromSrcCoord(0));
- EXPECT_EQ(0, TestTiling(2, 2, 2, false).tileYIndexFromSrcCoord(1));
- EXPECT_EQ(0, TestTiling(3, 3, 3, false).tileYIndexFromSrcCoord(0));
- EXPECT_EQ(0, TestTiling(3, 3, 3, false).tileYIndexFromSrcCoord(1));
- EXPECT_EQ(0, TestTiling(3, 3, 3, false).tileYIndexFromSrcCoord(2));
-
- EXPECT_EQ(0, TestTiling(3, 3, 4, false).tileYIndexFromSrcCoord(0));
- EXPECT_EQ(0, TestTiling(3, 3, 4, false).tileYIndexFromSrcCoord(1));
- EXPECT_EQ(0, TestTiling(3, 3, 4, false).tileYIndexFromSrcCoord(2));
- EXPECT_EQ(1, TestTiling(3, 3, 4, false).tileYIndexFromSrcCoord(3));
-
- EXPECT_EQ(0, TestTiling(1, 1, 1, true).tileYIndexFromSrcCoord(0));
- EXPECT_EQ(0, TestTiling(2, 2, 2, true).tileYIndexFromSrcCoord(0));
- EXPECT_EQ(0, TestTiling(2, 2, 2, true).tileYIndexFromSrcCoord(1));
- EXPECT_EQ(0, TestTiling(3, 3, 3, true).tileYIndexFromSrcCoord(0));
- EXPECT_EQ(0, TestTiling(3, 3, 3, true).tileYIndexFromSrcCoord(1));
- EXPECT_EQ(0, TestTiling(3, 3, 3, true).tileYIndexFromSrcCoord(2));
-
- EXPECT_EQ(0, TestTiling(3, 3, 4, true).tileYIndexFromSrcCoord(0));
- EXPECT_EQ(0, TestTiling(3, 3, 4, true).tileYIndexFromSrcCoord(1));
- EXPECT_EQ(1, TestTiling(3, 3, 4, true).tileYIndexFromSrcCoord(2));
- EXPECT_EQ(1, TestTiling(3, 3, 4, true).tileYIndexFromSrcCoord(3));
+ EXPECT_EQ(0, TestTiling(IntSize(3, 3), IntSize(10, 10), false).tileYIndexFromSrcCoord(0));
+ EXPECT_EQ(0, TestTiling(IntSize(3, 3), IntSize(10, 10), false).tileYIndexFromSrcCoord(1));
+ EXPECT_EQ(0, TestTiling(IntSize(3, 3), IntSize(10, 10), false).tileYIndexFromSrcCoord(2));
+ EXPECT_EQ(1, TestTiling(IntSize(3, 3), IntSize(10, 10), false).tileYIndexFromSrcCoord(3));
+ EXPECT_EQ(1, TestTiling(IntSize(3, 3), IntSize(10, 10), false).tileYIndexFromSrcCoord(4));
+ EXPECT_EQ(1, TestTiling(IntSize(3, 3), IntSize(10, 10), false).tileYIndexFromSrcCoord(5));
+ EXPECT_EQ(2, TestTiling(IntSize(3, 3), IntSize(10, 10), false).tileYIndexFromSrcCoord(6));
+ EXPECT_EQ(2, TestTiling(IntSize(3, 3), IntSize(10, 10), false).tileYIndexFromSrcCoord(7));
+ EXPECT_EQ(2, TestTiling(IntSize(3, 3), IntSize(10, 10), false).tileYIndexFromSrcCoord(8));
+ EXPECT_EQ(3, TestTiling(IntSize(3, 3), IntSize(10, 10), false).tileYIndexFromSrcCoord(9));
+ EXPECT_EQ(3, TestTiling(IntSize(3, 3), IntSize(10, 10), false).tileYIndexFromSrcCoord(10));
+ EXPECT_EQ(3, TestTiling(IntSize(3, 3), IntSize(10, 10), false).tileYIndexFromSrcCoord(11));
+
+ EXPECT_EQ(0, TestTiling(IntSize(3, 3), IntSize(10, 10), true).tileYIndexFromSrcCoord(0));
+ EXPECT_EQ(0, TestTiling(IntSize(3, 3), IntSize(10, 10), true).tileYIndexFromSrcCoord(1));
+ EXPECT_EQ(1, TestTiling(IntSize(3, 3), IntSize(10, 10), true).tileYIndexFromSrcCoord(2));
+ EXPECT_EQ(2, TestTiling(IntSize(3, 3), IntSize(10, 10), true).tileYIndexFromSrcCoord(3));
+ EXPECT_EQ(3, TestTiling(IntSize(3, 3), IntSize(10, 10), true).tileYIndexFromSrcCoord(4));
+ EXPECT_EQ(4, TestTiling(IntSize(3, 3), IntSize(10, 10), true).tileYIndexFromSrcCoord(5));
+ EXPECT_EQ(5, TestTiling(IntSize(3, 3), IntSize(10, 10), true).tileYIndexFromSrcCoord(6));
+ EXPECT_EQ(6, TestTiling(IntSize(3, 3), IntSize(10, 10), true).tileYIndexFromSrcCoord(7));
+ EXPECT_EQ(7, TestTiling(IntSize(3, 3), IntSize(10, 10), true).tileYIndexFromSrcCoord(8));
+ EXPECT_EQ(7, TestTiling(IntSize(3, 3), IntSize(10, 10), true).tileYIndexFromSrcCoord(9));
+ EXPECT_EQ(7, TestTiling(IntSize(3, 3), IntSize(10, 10), true).tileYIndexFromSrcCoord(10));
+ EXPECT_EQ(7, TestTiling(IntSize(3, 3), IntSize(10, 10), true).tileYIndexFromSrcCoord(11));
+
+ EXPECT_EQ(0, TestTiling(IntSize(1, 1), IntSize(1, 1), false).tileYIndexFromSrcCoord(0));
+ EXPECT_EQ(0, TestTiling(IntSize(2, 2), IntSize(2, 2), false).tileYIndexFromSrcCoord(0));
+ EXPECT_EQ(0, TestTiling(IntSize(2, 2), IntSize(2, 2), false).tileYIndexFromSrcCoord(1));
+ EXPECT_EQ(0, TestTiling(IntSize(3, 3), IntSize(3, 3), false).tileYIndexFromSrcCoord(0));
+ EXPECT_EQ(0, TestTiling(IntSize(3, 3), IntSize(3, 3), false).tileYIndexFromSrcCoord(1));
+ EXPECT_EQ(0, TestTiling(IntSize(3, 3), IntSize(3, 3), false).tileYIndexFromSrcCoord(2));
+
+ EXPECT_EQ(0, TestTiling(IntSize(3, 3), IntSize(3, 4), false).tileYIndexFromSrcCoord(0));
+ EXPECT_EQ(0, TestTiling(IntSize(3, 3), IntSize(3, 4), false).tileYIndexFromSrcCoord(1));
+ EXPECT_EQ(0, TestTiling(IntSize(3, 3), IntSize(3, 4), false).tileYIndexFromSrcCoord(2));
+ EXPECT_EQ(1, TestTiling(IntSize(3, 3), IntSize(3, 4), false).tileYIndexFromSrcCoord(3));
+
+ EXPECT_EQ(0, TestTiling(IntSize(1, 1), IntSize(1, 1), true).tileYIndexFromSrcCoord(0));
+ EXPECT_EQ(0, TestTiling(IntSize(2, 2), IntSize(2, 2), true).tileYIndexFromSrcCoord(0));
+ EXPECT_EQ(0, TestTiling(IntSize(2, 2), IntSize(2, 2), true).tileYIndexFromSrcCoord(1));
+ EXPECT_EQ(0, TestTiling(IntSize(3, 3), IntSize(3, 3), true).tileYIndexFromSrcCoord(0));
+ EXPECT_EQ(0, TestTiling(IntSize(3, 3), IntSize(3, 3), true).tileYIndexFromSrcCoord(1));
+ EXPECT_EQ(0, TestTiling(IntSize(3, 3), IntSize(3, 3), true).tileYIndexFromSrcCoord(2));
+
+ EXPECT_EQ(0, TestTiling(IntSize(3, 3), IntSize(3, 4), true).tileYIndexFromSrcCoord(0));
+ EXPECT_EQ(0, TestTiling(IntSize(3, 3), IntSize(3, 4), true).tileYIndexFromSrcCoord(1));
+ EXPECT_EQ(1, TestTiling(IntSize(3, 3), IntSize(3, 4), true).tileYIndexFromSrcCoord(2));
+ EXPECT_EQ(1, TestTiling(IntSize(3, 3), IntSize(3, 4), true).tileYIndexFromSrcCoord(3));
}
TEST(TilingDataTest, tileSizeX)
{
- EXPECT_EQ(5, TestTiling(5, 5, 5, false).tileSizeX(0));
- EXPECT_EQ(5, TestTiling(5, 5, 5, true).tileSizeX(0));
-
- EXPECT_EQ(5, TestTiling(5, 6, 6, false).tileSizeX(0));
- EXPECT_EQ(1, TestTiling(5, 6, 6, false).tileSizeX(1));
- EXPECT_EQ(4, TestTiling(5, 6, 6, true).tileSizeX(0));
- EXPECT_EQ(2, TestTiling(5, 6, 6, true).tileSizeX(1));
-
- EXPECT_EQ(5, TestTiling(5, 8, 8, false).tileSizeX(0));
- EXPECT_EQ(3, TestTiling(5, 8, 8, false).tileSizeX(1));
- EXPECT_EQ(4, TestTiling(5, 8, 8, true).tileSizeX(0));
- EXPECT_EQ(4, TestTiling(5, 8, 8, true).tileSizeX(1));
-
- EXPECT_EQ(5, TestTiling(5, 10, 10, false).tileSizeX(0));
- EXPECT_EQ(5, TestTiling(5, 10, 10, false).tileSizeX(1));
- EXPECT_EQ(4, TestTiling(5, 10, 10, true).tileSizeX(0));
- EXPECT_EQ(3, TestTiling(5, 10, 10, true).tileSizeX(1));
- EXPECT_EQ(3, TestTiling(5, 10, 10, true).tileSizeX(2));
-
- EXPECT_EQ(4, TestTiling(5, 11, 11, true).tileSizeX(2));
- EXPECT_EQ(3, TestTiling(5, 12, 12, true).tileSizeX(2));
+ EXPECT_EQ(5, TestTiling(IntSize(5, 5), IntSize(5, 5), false).tileSizeX(0));
+ EXPECT_EQ(5, TestTiling(IntSize(5, 5), IntSize(5, 5), true).tileSizeX(0));
+
+ EXPECT_EQ(5, TestTiling(IntSize(5, 5), IntSize(6, 6), false).tileSizeX(0));
+ EXPECT_EQ(1, TestTiling(IntSize(5, 5), IntSize(6, 6), false).tileSizeX(1));
+ EXPECT_EQ(4, TestTiling(IntSize(5, 5), IntSize(6, 6), true).tileSizeX(0));
+ EXPECT_EQ(2, TestTiling(IntSize(5, 5), IntSize(6, 6), true).tileSizeX(1));
+
+ EXPECT_EQ(5, TestTiling(IntSize(5, 5), IntSize(8, 8), false).tileSizeX(0));
+ EXPECT_EQ(3, TestTiling(IntSize(5, 5), IntSize(8, 8), false).tileSizeX(1));
+ EXPECT_EQ(4, TestTiling(IntSize(5, 5), IntSize(8, 8), true).tileSizeX(0));
+ EXPECT_EQ(4, TestTiling(IntSize(5, 5), IntSize(8, 8), true).tileSizeX(1));
+
+ EXPECT_EQ(5, TestTiling(IntSize(5, 5), IntSize(10, 10), false).tileSizeX(0));
+ EXPECT_EQ(5, TestTiling(IntSize(5, 5), IntSize(10, 10), false).tileSizeX(1));
+ EXPECT_EQ(4, TestTiling(IntSize(5, 5), IntSize(10, 10), true).tileSizeX(0));
+ EXPECT_EQ(3, TestTiling(IntSize(5, 5), IntSize(10, 10), true).tileSizeX(1));
+ EXPECT_EQ(3, TestTiling(IntSize(5, 5), IntSize(10, 10), true).tileSizeX(2));
+
+ EXPECT_EQ(4, TestTiling(IntSize(5, 5), IntSize(11, 11), true).tileSizeX(2));
+ EXPECT_EQ(3, TestTiling(IntSize(5, 5), IntSize(12, 12), true).tileSizeX(2));
+
+ EXPECT_EQ(3, TestTiling(IntSize(5, 9), IntSize(12, 17), true).tileSizeX(2));
}
+
TEST(TilingDataTest, tileSizeY)
{
- EXPECT_EQ(5, TestTiling(5, 5, 5, false).tileSizeY(0));
- EXPECT_EQ(5, TestTiling(5, 5, 5, true).tileSizeY(0));
-
- EXPECT_EQ(5, TestTiling(5, 6, 6, false).tileSizeY(0));
- EXPECT_EQ(1, TestTiling(5, 6, 6, false).tileSizeY(1));
- EXPECT_EQ(4, TestTiling(5, 6, 6, true).tileSizeY(0));
- EXPECT_EQ(2, TestTiling(5, 6, 6, true).tileSizeY(1));
-
- EXPECT_EQ(5, TestTiling(5, 8, 8, false).tileSizeY(0));
- EXPECT_EQ(3, TestTiling(5, 8, 8, false).tileSizeY(1));
- EXPECT_EQ(4, TestTiling(5, 8, 8, true).tileSizeY(0));
- EXPECT_EQ(4, TestTiling(5, 8, 8, true).tileSizeY(1));
-
- EXPECT_EQ(5, TestTiling(5, 10, 10, false).tileSizeY(0));
- EXPECT_EQ(5, TestTiling(5, 10, 10, false).tileSizeY(1));
- EXPECT_EQ(4, TestTiling(5, 10, 10, true).tileSizeY(0));
- EXPECT_EQ(3, TestTiling(5, 10, 10, true).tileSizeY(1));
- EXPECT_EQ(3, TestTiling(5, 10, 10, true).tileSizeY(2));
-
- EXPECT_EQ(4, TestTiling(5, 11, 11, true).tileSizeY(2));
- EXPECT_EQ(3, TestTiling(5, 12, 12, true).tileSizeY(2));
+ EXPECT_EQ(5, TestTiling(IntSize(5, 5), IntSize(5, 5), false).tileSizeY(0));
+ EXPECT_EQ(5, TestTiling(IntSize(5, 5), IntSize(5, 5), true).tileSizeY(0));
+
+ EXPECT_EQ(5, TestTiling(IntSize(5, 5), IntSize(6, 6), false).tileSizeY(0));
+ EXPECT_EQ(1, TestTiling(IntSize(5, 5), IntSize(6, 6), false).tileSizeY(1));
+ EXPECT_EQ(4, TestTiling(IntSize(5, 5), IntSize(6, 6), true).tileSizeY(0));
+ EXPECT_EQ(2, TestTiling(IntSize(5, 5), IntSize(6, 6), true).tileSizeY(1));
+
+ EXPECT_EQ(5, TestTiling(IntSize(5, 5), IntSize(8, 8), false).tileSizeY(0));
+ EXPECT_EQ(3, TestTiling(IntSize(5, 5), IntSize(8, 8), false).tileSizeY(1));
+ EXPECT_EQ(4, TestTiling(IntSize(5, 5), IntSize(8, 8), true).tileSizeY(0));
+ EXPECT_EQ(4, TestTiling(IntSize(5, 5), IntSize(8, 8), true).tileSizeY(1));
+
+ EXPECT_EQ(5, TestTiling(IntSize(5, 5), IntSize(10, 10), false).tileSizeY(0));
+ EXPECT_EQ(5, TestTiling(IntSize(5, 5), IntSize(10, 10), false).tileSizeY(1));
+ EXPECT_EQ(4, TestTiling(IntSize(5, 5), IntSize(10, 10), true).tileSizeY(0));
+ EXPECT_EQ(3, TestTiling(IntSize(5, 5), IntSize(10, 10), true).tileSizeY(1));
+ EXPECT_EQ(3, TestTiling(IntSize(5, 5), IntSize(10, 10), true).tileSizeY(2));
+
+ EXPECT_EQ(4, TestTiling(IntSize(5, 5), IntSize(11, 11), true).tileSizeY(2));
+ EXPECT_EQ(3, TestTiling(IntSize(5, 5), IntSize(12, 12), true).tileSizeY(2));
+
+ EXPECT_EQ(3, TestTiling(IntSize(9, 5), IntSize(17, 12), true).tileSizeY(2));
}
TEST(TilingDataTest, tileSizeX_and_tilePositionX)
{
// Single tile cases:
- EXPECT_EQ(1, TestTiling(3, 1, 1, false).tileSizeX(0));
- EXPECT_EQ(0, TestTiling(3, 1, 1, false).tilePositionX(0));
- EXPECT_EQ(1, TestTiling(3, 1, 100, false).tileSizeX(0));
- EXPECT_EQ(0, TestTiling(3, 1, 100, false).tilePositionX(0));
- EXPECT_EQ(3, TestTiling(3, 3, 1, false).tileSizeX(0));
- EXPECT_EQ(0, TestTiling(3, 3, 1, false).tilePositionX(0));
- EXPECT_EQ(3, TestTiling(3, 3, 100, false).tileSizeX(0));
- EXPECT_EQ(0, TestTiling(3, 3, 100, false).tilePositionX(0));
- EXPECT_EQ(1, TestTiling(3, 1, 1, true).tileSizeX(0));
- EXPECT_EQ(0, TestTiling(3, 1, 1, true).tilePositionX(0));
- EXPECT_EQ(1, TestTiling(3, 1, 100, true).tileSizeX(0));
- EXPECT_EQ(0, TestTiling(3, 1, 100, true).tilePositionX(0));
- EXPECT_EQ(3, TestTiling(3, 3, 1, true).tileSizeX(0));
- EXPECT_EQ(0, TestTiling(3, 3, 1, true).tilePositionX(0));
- EXPECT_EQ(3, TestTiling(3, 3, 100, true).tileSizeX(0));
- EXPECT_EQ(0, TestTiling(3, 3, 100, true).tilePositionX(0));
+ EXPECT_EQ(1, TestTiling(IntSize(3, 3), IntSize(1, 1), false).tileSizeX(0));
+ EXPECT_EQ(0, TestTiling(IntSize(3, 3), IntSize(1, 1), false).tilePositionX(0));
+ EXPECT_EQ(1, TestTiling(IntSize(3, 3), IntSize(1, 100), false).tileSizeX(0));
+ EXPECT_EQ(0, TestTiling(IntSize(3, 3), IntSize(1, 100), false).tilePositionX(0));
+ EXPECT_EQ(3, TestTiling(IntSize(3, 3), IntSize(3, 1), false).tileSizeX(0));
+ EXPECT_EQ(0, TestTiling(IntSize(3, 3), IntSize(3, 1), false).tilePositionX(0));
+ EXPECT_EQ(3, TestTiling(IntSize(3, 3), IntSize(3, 100), false).tileSizeX(0));
+ EXPECT_EQ(0, TestTiling(IntSize(3, 3), IntSize(3, 100), false).tilePositionX(0));
+ EXPECT_EQ(1, TestTiling(IntSize(3, 3), IntSize(1, 1), true).tileSizeX(0));
+ EXPECT_EQ(0, TestTiling(IntSize(3, 3), IntSize(1, 1), true).tilePositionX(0));
+ EXPECT_EQ(1, TestTiling(IntSize(3, 3), IntSize(1, 100), true).tileSizeX(0));
+ EXPECT_EQ(0, TestTiling(IntSize(3, 3), IntSize(1, 100), true).tilePositionX(0));
+ EXPECT_EQ(3, TestTiling(IntSize(3, 3), IntSize(3, 1), true).tileSizeX(0));
+ EXPECT_EQ(0, TestTiling(IntSize(3, 3), IntSize(3, 1), true).tilePositionX(0));
+ EXPECT_EQ(3, TestTiling(IntSize(3, 3), IntSize(3, 100), true).tileSizeX(0));
+ EXPECT_EQ(0, TestTiling(IntSize(3, 3), IntSize(3, 100), true).tilePositionX(0));
// Multiple tiles:
// no border
// positions 0, 3
- EXPECT_EQ(2, TestTiling(3, 6, 1, false).numTiles());
- EXPECT_EQ(3, TestTiling(3, 6, 1, false).tileSizeX(0));
- EXPECT_EQ(3, TestTiling(3, 6, 1, false).tileSizeX(1));
- EXPECT_EQ(0, TestTiling(3, 6, 1, false).tilePositionX(0));
- EXPECT_EQ(3, TestTiling(3, 6, 1, false).tilePositionX(1));
- EXPECT_EQ(3, TestTiling(3, 6, 100, false).tileSizeX(0));
- EXPECT_EQ(3, TestTiling(3, 6, 100, false).tileSizeX(1));
- EXPECT_EQ(0, TestTiling(3, 6, 100, false).tilePositionX(0));
- EXPECT_EQ(3, TestTiling(3, 6, 100, false).tilePositionX(1));
+ EXPECT_EQ(2, TestTiling(IntSize(3, 3), IntSize(6, 1), false).numTiles());
+ EXPECT_EQ(3, TestTiling(IntSize(3, 3), IntSize(6, 1), false).tileSizeX(0));
+ EXPECT_EQ(3, TestTiling(IntSize(3, 3), IntSize(6, 1), false).tileSizeX(1));
+ EXPECT_EQ(0, TestTiling(IntSize(3, 3), IntSize(6, 1), false).tilePositionX(0));
+ EXPECT_EQ(3, TestTiling(IntSize(3, 3), IntSize(6, 1), false).tilePositionX(1));
+ EXPECT_EQ(3, TestTiling(IntSize(3, 3), IntSize(6, 100), false).tileSizeX(0));
+ EXPECT_EQ(3, TestTiling(IntSize(3, 3), IntSize(6, 100), false).tileSizeX(1));
+ EXPECT_EQ(0, TestTiling(IntSize(3, 3), IntSize(6, 100), false).tilePositionX(0));
+ EXPECT_EQ(3, TestTiling(IntSize(3, 3), IntSize(6, 100), false).tilePositionX(1));
// Multiple tiles:
// with border
// positions 0, 2, 3, 4
- EXPECT_EQ(4, TestTiling(3, 6, 1, true).numTiles());
- EXPECT_EQ(2, TestTiling(3, 6, 1, true).tileSizeX(0));
- EXPECT_EQ(1, TestTiling(3, 6, 1, true).tileSizeX(1));
- EXPECT_EQ(1, TestTiling(3, 6, 1, true).tileSizeX(2));
- EXPECT_EQ(2, TestTiling(3, 6, 1, true).tileSizeX(3));
- EXPECT_EQ(0, TestTiling(3, 6, 1, true).tilePositionX(0));
- EXPECT_EQ(2, TestTiling(3, 6, 1, true).tilePositionX(1));
- EXPECT_EQ(3, TestTiling(3, 6, 1, true).tilePositionX(2));
- EXPECT_EQ(4, TestTiling(3, 6, 1, true).tilePositionX(3));
- EXPECT_EQ(2, TestTiling(3, 6, 100, true).tileSizeX(0));
- EXPECT_EQ(1, TestTiling(3, 6, 100, true).tileSizeX(1));
- EXPECT_EQ(1, TestTiling(3, 6, 100, true).tileSizeX(2));
- EXPECT_EQ(2, TestTiling(3, 6, 100, true).tileSizeX(3));
- EXPECT_EQ(0, TestTiling(3, 6, 100, true).tilePositionX(0));
- EXPECT_EQ(2, TestTiling(3, 6, 100, true).tilePositionX(1));
- EXPECT_EQ(3, TestTiling(3, 6, 100, true).tilePositionX(2));
- EXPECT_EQ(4, TestTiling(3, 6, 100, true).tilePositionX(3));
+ EXPECT_EQ(4, TestTiling(IntSize(3, 3), IntSize(6, 1), true).numTiles());
+ EXPECT_EQ(2, TestTiling(IntSize(3, 3), IntSize(6, 1), true).tileSizeX(0));
+ EXPECT_EQ(1, TestTiling(IntSize(3, 3), IntSize(6, 1), true).tileSizeX(1));
+ EXPECT_EQ(1, TestTiling(IntSize(3, 3), IntSize(6, 1), true).tileSizeX(2));
+ EXPECT_EQ(2, TestTiling(IntSize(3, 3), IntSize(6, 1), true).tileSizeX(3));
+ EXPECT_EQ(0, TestTiling(IntSize(3, 3), IntSize(6, 1), true).tilePositionX(0));
+ EXPECT_EQ(2, TestTiling(IntSize(3, 3), IntSize(6, 1), true).tilePositionX(1));
+ EXPECT_EQ(3, TestTiling(IntSize(3, 3), IntSize(6, 1), true).tilePositionX(2));
+ EXPECT_EQ(4, TestTiling(IntSize(3, 3), IntSize(6, 1), true).tilePositionX(3));
+ EXPECT_EQ(2, TestTiling(IntSize(3, 7), IntSize(6, 100), true).tileSizeX(0));
+ EXPECT_EQ(1, TestTiling(IntSize(3, 7), IntSize(6, 100), true).tileSizeX(1));
+ EXPECT_EQ(1, TestTiling(IntSize(3, 7), IntSize(6, 100), true).tileSizeX(2));
+ EXPECT_EQ(2, TestTiling(IntSize(3, 7), IntSize(6, 100), true).tileSizeX(3));
+ EXPECT_EQ(0, TestTiling(IntSize(3, 7), IntSize(6, 100), true).tilePositionX(0));
+ EXPECT_EQ(2, TestTiling(IntSize(3, 7), IntSize(6, 100), true).tilePositionX(1));
+ EXPECT_EQ(3, TestTiling(IntSize(3, 7), IntSize(6, 100), true).tilePositionX(2));
+ EXPECT_EQ(4, TestTiling(IntSize(3, 7), IntSize(6, 100), true).tilePositionX(3));
}
TEST(TilingDataTest, tileSizeY_and_tilePositionY)
{
// Single tile cases:
- EXPECT_EQ(1, TestTiling(3, 1, 1, false).tileSizeY(0));
- EXPECT_EQ(0, TestTiling(3, 1, 1, false).tilePositionY(0));
- EXPECT_EQ(1, TestTiling(3, 100, 1, false).tileSizeY(0));
- EXPECT_EQ(0, TestTiling(3, 100, 1, false).tilePositionY(0));
- EXPECT_EQ(3, TestTiling(3, 1, 3, false).tileSizeY(0));
- EXPECT_EQ(0, TestTiling(3, 1, 3, false).tilePositionY(0));
- EXPECT_EQ(3, TestTiling(3, 100, 3, false).tileSizeY(0));
- EXPECT_EQ(0, TestTiling(3, 100, 3, false).tilePositionY(0));
- EXPECT_EQ(1, TestTiling(3, 1, 1, true).tileSizeY(0));
- EXPECT_EQ(0, TestTiling(3, 1, 1, true).tilePositionY(0));
- EXPECT_EQ(1, TestTiling(3, 100, 1, true).tileSizeY(0));
- EXPECT_EQ(0, TestTiling(3, 100, 1, true).tilePositionY(0));
- EXPECT_EQ(3, TestTiling(3, 1, 3, true).tileSizeY(0));
- EXPECT_EQ(0, TestTiling(3, 1, 3, true).tilePositionY(0));
- EXPECT_EQ(3, TestTiling(3, 100, 3, true).tileSizeY(0));
- EXPECT_EQ(0, TestTiling(3, 100, 3, true).tilePositionY(0));
+ EXPECT_EQ(1, TestTiling(IntSize(3, 3), IntSize(1, 1), false).tileSizeY(0));
+ EXPECT_EQ(0, TestTiling(IntSize(3, 3), IntSize(1, 1), false).tilePositionY(0));
+ EXPECT_EQ(1, TestTiling(IntSize(3, 3), IntSize(100, 1), false).tileSizeY(0));
+ EXPECT_EQ(0, TestTiling(IntSize(3, 3), IntSize(100, 1), false).tilePositionY(0));
+ EXPECT_EQ(3, TestTiling(IntSize(3, 3), IntSize(1, 3), false).tileSizeY(0));
+ EXPECT_EQ(0, TestTiling(IntSize(3, 3), IntSize(1, 3), false).tilePositionY(0));
+ EXPECT_EQ(3, TestTiling(IntSize(3, 3), IntSize(100, 3), false).tileSizeY(0));
+ EXPECT_EQ(0, TestTiling(IntSize(3, 3), IntSize(100, 3), false).tilePositionY(0));
+ EXPECT_EQ(1, TestTiling(IntSize(3, 3), IntSize(1, 1), true).tileSizeY(0));
+ EXPECT_EQ(0, TestTiling(IntSize(3, 3), IntSize(1, 1), true).tilePositionY(0));
+ EXPECT_EQ(1, TestTiling(IntSize(3, 3), IntSize(100, 1), true).tileSizeY(0));
+ EXPECT_EQ(0, TestTiling(IntSize(3, 3), IntSize(100, 1), true).tilePositionY(0));
+ EXPECT_EQ(3, TestTiling(IntSize(3, 3), IntSize(1, 3), true).tileSizeY(0));
+ EXPECT_EQ(0, TestTiling(IntSize(3, 3), IntSize(1, 3), true).tilePositionY(0));
+ EXPECT_EQ(3, TestTiling(IntSize(3, 3), IntSize(100, 3), true).tileSizeY(0));
+ EXPECT_EQ(0, TestTiling(IntSize(3, 3), IntSize(100, 3), true).tilePositionY(0));
// Multiple tiles:
// no border
// positions 0, 3
- EXPECT_EQ(2, TestTiling(3, 1, 6, false).numTiles());
- EXPECT_EQ(3, TestTiling(3, 1, 6, false).tileSizeY(0));
- EXPECT_EQ(3, TestTiling(3, 1, 6, false).tileSizeY(1));
- EXPECT_EQ(0, TestTiling(3, 1, 6, false).tilePositionY(0));
- EXPECT_EQ(3, TestTiling(3, 1, 6, false).tilePositionY(1));
- EXPECT_EQ(3, TestTiling(3, 100, 6, false).tileSizeY(0));
- EXPECT_EQ(3, TestTiling(3, 100, 6, false).tileSizeY(1));
- EXPECT_EQ(0, TestTiling(3, 100, 6, false).tilePositionY(0));
- EXPECT_EQ(3, TestTiling(3, 100, 6, false).tilePositionY(1));
+ EXPECT_EQ(2, TestTiling(IntSize(3, 3), IntSize(1, 6), false).numTiles());
+ EXPECT_EQ(3, TestTiling(IntSize(3, 3), IntSize(1, 6), false).tileSizeY(0));
+ EXPECT_EQ(3, TestTiling(IntSize(3, 3), IntSize(1, 6), false).tileSizeY(1));
+ EXPECT_EQ(0, TestTiling(IntSize(3, 3), IntSize(1, 6), false).tilePositionY(0));
+ EXPECT_EQ(3, TestTiling(IntSize(3, 3), IntSize(1, 6), false).tilePositionY(1));
+ EXPECT_EQ(3, TestTiling(IntSize(3, 3), IntSize(100, 6), false).tileSizeY(0));
+ EXPECT_EQ(3, TestTiling(IntSize(3, 3), IntSize(100, 6), false).tileSizeY(1));
+ EXPECT_EQ(0, TestTiling(IntSize(3, 3), IntSize(100, 6), false).tilePositionY(0));
+ EXPECT_EQ(3, TestTiling(IntSize(3, 3), IntSize(100, 6), false).tilePositionY(1));
// Multiple tiles:
// with border
// positions 0, 2, 3, 4
- EXPECT_EQ(4, TestTiling(3, 1, 6, true).numTiles());
- EXPECT_EQ(2, TestTiling(3, 1, 6, true).tileSizeY(0));
- EXPECT_EQ(1, TestTiling(3, 1, 6, true).tileSizeY(1));
- EXPECT_EQ(1, TestTiling(3, 1, 6, true).tileSizeY(2));
- EXPECT_EQ(2, TestTiling(3, 1, 6, true).tileSizeY(3));
- EXPECT_EQ(0, TestTiling(3, 1, 6, true).tilePositionY(0));
- EXPECT_EQ(2, TestTiling(3, 1, 6, true).tilePositionY(1));
- EXPECT_EQ(3, TestTiling(3, 1, 6, true).tilePositionY(2));
- EXPECT_EQ(4, TestTiling(3, 1, 6, true).tilePositionY(3));
- EXPECT_EQ(2, TestTiling(3, 100, 6, true).tileSizeY(0));
- EXPECT_EQ(1, TestTiling(3, 100, 6, true).tileSizeY(1));
- EXPECT_EQ(1, TestTiling(3, 100, 6, true).tileSizeY(2));
- EXPECT_EQ(2, TestTiling(3, 100, 6, true).tileSizeY(3));
- EXPECT_EQ(0, TestTiling(3, 100, 6, true).tilePositionY(0));
- EXPECT_EQ(2, TestTiling(3, 100, 6, true).tilePositionY(1));
- EXPECT_EQ(3, TestTiling(3, 100, 6, true).tilePositionY(2));
- EXPECT_EQ(4, TestTiling(3, 100, 6, true).tilePositionY(3));
+ EXPECT_EQ(4, TestTiling(IntSize(3, 3), IntSize(1, 6), true).numTiles());
+ EXPECT_EQ(2, TestTiling(IntSize(3, 3), IntSize(1, 6), true).tileSizeY(0));
+ EXPECT_EQ(1, TestTiling(IntSize(3, 3), IntSize(1, 6), true).tileSizeY(1));
+ EXPECT_EQ(1, TestTiling(IntSize(3, 3), IntSize(1, 6), true).tileSizeY(2));
+ EXPECT_EQ(2, TestTiling(IntSize(3, 3), IntSize(1, 6), true).tileSizeY(3));
+ EXPECT_EQ(0, TestTiling(IntSize(3, 3), IntSize(1, 6), true).tilePositionY(0));
+ EXPECT_EQ(2, TestTiling(IntSize(3, 3), IntSize(1, 6), true).tilePositionY(1));
+ EXPECT_EQ(3, TestTiling(IntSize(3, 3), IntSize(1, 6), true).tilePositionY(2));
+ EXPECT_EQ(4, TestTiling(IntSize(3, 3), IntSize(1, 6), true).tilePositionY(3));
+ EXPECT_EQ(2, TestTiling(IntSize(7, 3), IntSize(100, 6), true).tileSizeY(0));
+ EXPECT_EQ(1, TestTiling(IntSize(7, 3), IntSize(100, 6), true).tileSizeY(1));
+ EXPECT_EQ(1, TestTiling(IntSize(7, 3), IntSize(100, 6), true).tileSizeY(2));
+ EXPECT_EQ(2, TestTiling(IntSize(7, 3), IntSize(100, 6), true).tileSizeY(3));
+ EXPECT_EQ(0, TestTiling(IntSize(7, 3), IntSize(100, 6), true).tilePositionY(0));
+ EXPECT_EQ(2, TestTiling(IntSize(7, 3), IntSize(100, 6), true).tilePositionY(1));
+ EXPECT_EQ(3, TestTiling(IntSize(7, 3), IntSize(100, 6), true).tilePositionY(2));
+ EXPECT_EQ(4, TestTiling(IntSize(7, 3), IntSize(100, 6), true).tilePositionY(3));
}
TEST(TilingDataTest, setTotalSize)
{
- TestTiling data(5, 5, 5, false);
- EXPECT_EQ(5, data.totalSizeX());
- EXPECT_EQ(5, data.totalSizeY());
+ TestTiling data(IntSize(5, 5), IntSize(5, 5), false);
+ EXPECT_EQ(5, data.totalSize().width());
+ EXPECT_EQ(5, data.totalSize().height());
EXPECT_EQ(1, data.numTilesX());
EXPECT_EQ(5, data.tileSizeX(0));
EXPECT_EQ(1, data.numTilesY());
EXPECT_EQ(5, data.tileSizeY(0));
- data.setTotalSize(6, 5);
- EXPECT_EQ(6, data.totalSizeX());
- EXPECT_EQ(5, data.totalSizeY());
+ data.setTotalSize(IntSize(6, 5));
+ EXPECT_EQ(6, data.totalSize().width());
+ EXPECT_EQ(5, data.totalSize().height());
EXPECT_EQ(2, data.numTilesX());
EXPECT_EQ(5, data.tileSizeX(0));
EXPECT_EQ(1, data.tileSizeX(1));
EXPECT_EQ(1, data.numTilesY());
EXPECT_EQ(5, data.tileSizeY(0));
- data.setTotalSize(5, 12);
- EXPECT_EQ(5, data.totalSizeX());
- EXPECT_EQ(12, data.totalSizeY());
+ data.setTotalSize(IntSize(5, 12));
+ EXPECT_EQ(5, data.totalSize().width());
+ EXPECT_EQ(12, data.totalSize().height());
EXPECT_EQ(1, data.numTilesX());
EXPECT_EQ(5, data.tileSizeX(0));
EXPECT_EQ(3, data.numTilesY());
@@ -468,75 +480,85 @@ TEST(TilingDataTest, setTotalSize)
TEST(TilingDataTest, setMaxTextureSizeNoBorders)
{
- TestTiling data(8, 16, 32, false);
+ TestTiling data(IntSize(8, 8), IntSize(16, 32), false);
EXPECT_EQ(2, data.numTilesX());
EXPECT_EQ(4, data.numTilesY());
- data.setMaxTextureSize(32);
- EXPECT_EQ(32, data.maxTextureSize());
+ data.setMaxTextureSize(IntSize(32, 32));
+ EXPECT_EQ(IntSize(32, 32), data.maxTextureSize());
EXPECT_EQ(1, data.numTilesX());
EXPECT_EQ(1, data.numTilesY());
- data.setMaxTextureSize(2);
- EXPECT_EQ(2, data.maxTextureSize());
+ data.setMaxTextureSize(IntSize(2, 2));
+ EXPECT_EQ(IntSize(2, 2), data.maxTextureSize());
EXPECT_EQ(8, data.numTilesX());
EXPECT_EQ(16, data.numTilesY());
- data.setMaxTextureSize(5);
- EXPECT_EQ(5, data.maxTextureSize());
+ data.setMaxTextureSize(IntSize(5, 5));
+ EXPECT_EQ(IntSize(5, 5), data.maxTextureSize());
EXPECT_EQ(4, data.numTilesX());
EXPECT_EQ(7, data.numTilesY());
+
+ data.setMaxTextureSize(IntSize(8, 5));
+ EXPECT_EQ(IntSize(8, 5), data.maxTextureSize());
+ EXPECT_EQ(2, data.numTilesX());
+ EXPECT_EQ(7, data.numTilesY());
}
TEST(TilingDataTest, setMaxTextureSizeBorders)
{
- TestTiling data(8, 16, 32, true);
+ TestTiling data(IntSize(8, 8), IntSize(16, 32), true);
EXPECT_EQ(3, data.numTilesX());
EXPECT_EQ(5, data.numTilesY());
- data.setMaxTextureSize(32);
- EXPECT_EQ(32, data.maxTextureSize());
+ data.setMaxTextureSize(IntSize(32, 32));
+ EXPECT_EQ(IntSize(32, 32), data.maxTextureSize());
EXPECT_EQ(1, data.numTilesX());
EXPECT_EQ(1, data.numTilesY());
- data.setMaxTextureSize(2);
- EXPECT_EQ(2, data.maxTextureSize());
+ data.setMaxTextureSize(IntSize(2, 2));
+ EXPECT_EQ(IntSize(2, 2), data.maxTextureSize());
EXPECT_EQ(0, data.numTilesX());
EXPECT_EQ(0, data.numTilesY());
- data.setMaxTextureSize(5);
- EXPECT_EQ(5, data.maxTextureSize());
+ data.setMaxTextureSize(IntSize(5, 5));
+ EXPECT_EQ(IntSize(5, 5), data.maxTextureSize());
EXPECT_EQ(5, data.numTilesX());
EXPECT_EQ(10, data.numTilesY());
+
+ data.setMaxTextureSize(IntSize(8, 5));
+ EXPECT_EQ(IntSize(8, 5), data.maxTextureSize());
+ EXPECT_EQ(3, data.numTilesX());
+ EXPECT_EQ(10, data.numTilesY());
}
TEST(TilingDataTest, assignment)
{
{
- TestTiling source(8, 16, 32, true);
+ TestTiling source(IntSize(8, 8), IntSize(16, 32), true);
TestTiling dest = source;
EXPECT_EQ(source.borderTexels(), dest.borderTexels());
EXPECT_EQ(source.maxTextureSize(), dest.maxTextureSize());
EXPECT_EQ(source.numTilesX(), dest.numTilesX());
EXPECT_EQ(source.numTilesY(), dest.numTilesY());
- EXPECT_EQ(source.totalSizeX(), dest.totalSizeX());
- EXPECT_EQ(source.totalSizeY(), dest.totalSizeY());
+ EXPECT_EQ(source.totalSize().width(), dest.totalSize().width());
+ EXPECT_EQ(source.totalSize().height(), dest.totalSize().height());
}
{
- TestTiling source(3, 6, 100, false);
+ TestTiling source(IntSize(7, 3), IntSize(6, 100), false);
TestTiling dest(source);
EXPECT_EQ(source.borderTexels(), dest.borderTexels());
EXPECT_EQ(source.maxTextureSize(), dest.maxTextureSize());
EXPECT_EQ(source.numTilesX(), dest.numTilesX());
EXPECT_EQ(source.numTilesY(), dest.numTilesY());
- EXPECT_EQ(source.totalSizeX(), dest.totalSizeX());
- EXPECT_EQ(source.totalSizeY(), dest.totalSizeY());
+ EXPECT_EQ(source.totalSize().width(), dest.totalSize().width());
+ EXPECT_EQ(source.totalSize().height(), dest.totalSize().height());
}
}
TEST(TilingDataTest, setBorderTexels)
{
- TestTiling data(8, 16, 32, false);
+ TestTiling data(IntSize(8, 8), IntSize(16, 32), false);
EXPECT_EQ(2, data.numTilesX());
EXPECT_EQ(4, data.numTilesY());
diff --git a/Source/WebKit/chromium/tests/WebFrameTest.cpp b/Source/WebKit/chromium/tests/WebFrameTest.cpp
index b8bc2e3c4..2fe01bf16 100644
--- a/Source/WebKit/chromium/tests/WebFrameTest.cpp
+++ b/Source/WebKit/chromium/tests/WebFrameTest.cpp
@@ -40,6 +40,7 @@
#include "WebRange.h"
#include "WebScriptSource.h"
#include "WebSearchableFormData.h"
+#include "WebSecurityOrigin.h"
#include "WebSecurityPolicy.h"
#include "WebSettings.h"
#include "WebViewClient.h"
@@ -136,22 +137,71 @@ TEST_F(WebFrameTest, FormWithNullFrame)
WebSearchableFormData searchableDataForm(forms[0]);
}
+TEST_F(WebFrameTest, ChromePageJavascript)
+{
+ registerMockedChromeURLLoad("history.html");
+
+ // Pass true to enable JavaScript.
+ WebView* webView = FrameTestHelpers::createWebViewAndLoad(m_chromeURL + "history.html", true);
+
+ // Try to run JS against the chrome-style URL.
+ FrameTestHelpers::loadFrame(webView->mainFrame(), "javascript:document.body.appendChild(document.createTextNode('Clobbered'))");
+
+ // Required to see any updates in contentAsText.
+ webView->layout();
+
+ // Now retrieve the frame's text and ensure it was modified by running javascript.
+ std::string content = webView->mainFrame()->contentAsText(1024).utf8();
+ EXPECT_NE(std::string::npos, content.find("Clobbered"));
+}
+
TEST_F(WebFrameTest, ChromePageNoJavascript)
{
registerMockedChromeURLLoad("history.html");
+ /// Pass true to enable JavaScript.
WebView* webView = FrameTestHelpers::createWebViewAndLoad(m_chromeURL + "history.html", true);
- // Try to run JS against the chrome-style URL.
+ // Try to run JS against the chrome-style URL after prohibiting it.
WebSecurityPolicy::registerURLSchemeAsNotAllowingJavascriptURLs("chrome");
FrameTestHelpers::loadFrame(webView->mainFrame(), "javascript:document.body.appendChild(document.createTextNode('Clobbered'))");
- // Now retrieve the frames text and see if it was clobbered.
+ // Required to see any updates in contentAsText.
+ webView->layout();
+
+ // Now retrieve the frame's text and ensure it wasn't modified by running javascript.
std::string content = webView->mainFrame()->contentAsText(1024).utf8();
- EXPECT_NE(std::string::npos, content.find("Simulated Chromium History Page"));
EXPECT_EQ(std::string::npos, content.find("Clobbered"));
}
+TEST_F(WebFrameTest, DispatchMessageEventWithOriginCheck)
+{
+ registerMockedHttpURLLoad("postmessage_test.html");
+
+ // Pass true to enable JavaScript.
+ WebView* webView = FrameTestHelpers::createWebViewAndLoad(m_baseURL + "postmessage_test.html", true);
+
+ // Send a message with the correct origin.
+ WebSecurityOrigin correctOrigin(WebSecurityOrigin::create(GURL(m_baseURL)));
+ WebDOMEvent event = webView->mainFrame()->document().createEvent("MessageEvent");
+ WebDOMMessageEvent message = event.to<WebDOMMessageEvent>();
+ WebSerializedScriptValue data(WebSerializedScriptValue::fromString("foo"));
+ message.initMessageEvent("message", false, false, data, "http://origin.com", 0, "");
+ webView->mainFrame()->dispatchMessageEventWithOriginCheck(correctOrigin, message);
+
+ // Send another message with incorrect origin.
+ WebSecurityOrigin incorrectOrigin(WebSecurityOrigin::create(GURL(m_chromeURL)));
+ webView->mainFrame()->dispatchMessageEventWithOriginCheck(incorrectOrigin, message);
+
+ // Required to see any updates in contentAsText.
+ webView->layout();
+
+ // Verify that only the first addition is in the body of the page.
+ std::string content = webView->mainFrame()->contentAsText(1024).utf8();
+ EXPECT_NE(std::string::npos, content.find("Message 1."));
+ EXPECT_EQ(std::string::npos, content.find("Message 2."));
+}
+
#if ENABLE(VIEWPORT)
class FixedLayoutTestWebViewClient : public WebViewClient {
diff --git a/Source/WebKit/chromium/tests/WebViewTest.cpp b/Source/WebKit/chromium/tests/WebViewTest.cpp
index 00d8a832d..460c62bd2 100644
--- a/Source/WebKit/chromium/tests/WebViewTest.cpp
+++ b/Source/WebKit/chromium/tests/WebViewTest.cpp
@@ -110,6 +110,8 @@ protected:
int expectedWidth, int expectedHeight,
HorizontalScrollbarState expectedHorizontalState, VerticalScrollbarState expectedVerticalState);
+ void testTextInputType(WebTextInputType expectedType, const std::string& htmlFile);
+
std::string m_baseURL;
};
@@ -245,4 +247,44 @@ TEST_F(WebViewTest, AutoResizeMaxSize)
expectedWidth, expectedHeight, NoHorizontalScrollbar, NoVerticalScrollbar);
}
+void WebViewTest::testTextInputType(WebTextInputType expectedType, const std::string& htmlFile)
+{
+ FrameTestHelpers::registerMockedURLLoad(m_baseURL, htmlFile);
+ WebView* webView = FrameTestHelpers::createWebViewAndLoad(m_baseURL + htmlFile);
+ webView->setInitialFocus(false);
+ EXPECT_EQ(expectedType, webView->textInputType());
+ webView->close();
+}
+
+// Disabled for https://bugs.webkit.org/show_bug.cgi?id=78746#c29
+TEST_F(WebViewTest, DISABLED_TextInputType)
+{
+ testTextInputType(WebTextInputTypeText, "input_field_default.html");
+ testTextInputType(WebTextInputTypePassword, "input_field_password.html");
+ testTextInputType(WebTextInputTypeEmail, "input_field_email.html");
+ testTextInputType(WebTextInputTypeSearch, "input_field_search.html");
+ testTextInputType(WebTextInputTypeNumber, "input_field_number.html");
+ testTextInputType(WebTextInputTypeTelephone, "input_field_tel.html");
+ testTextInputType(WebTextInputTypeURL, "input_field_url.html");
+#if ENABLE(INPUT_TYPE_DATE)
+ testTextInputType(WebTextInputTypeDate, "input_field_date.html");
+#endif
+#if ENABLE(INPUT_TYPE_DATETIME)
+ testTextInputType(WebTextInputTypeDateTime, "input_field_datetime.html");
+#endif
+#if ENABLE(INPUT_TYPE_DATETIMELOCAL)
+ testTextInputType(WebTextInputTypeDateTimeLocal, "input_field_datetimelocal.html");
+#endif
+#if ENABLE(INPUT_TYPE_MONTH)
+ testTextInputType(WebTextInputTypeMonth, "input_field_month.html");
+#endif
+#if ENABLE(INPUT_TYPE_TIME)
+ testTextInputType(WebTextInputTypeTime, "input_field_time.html");
+#endif
+#if ENABLE(INPUT_TYPE_WEEK)
+ testTextInputType(WebTextInputTypeWeek, "input_field_week.html");
+#endif
+
+}
+
}
diff --git a/Source/WebKit/chromium/tests/data/input_field_date.html b/Source/WebKit/chromium/tests/data/input_field_date.html
new file mode 100644
index 000000000..72aba6db6
--- /dev/null
+++ b/Source/WebKit/chromium/tests/data/input_field_date.html
@@ -0,0 +1 @@
+<input type="date" />
diff --git a/Source/WebKit/chromium/tests/data/input_field_datetime.html b/Source/WebKit/chromium/tests/data/input_field_datetime.html
new file mode 100644
index 000000000..fa9c5481b
--- /dev/null
+++ b/Source/WebKit/chromium/tests/data/input_field_datetime.html
@@ -0,0 +1 @@
+<input type="datetime" />
diff --git a/Source/WebKit/chromium/tests/data/input_field_datetimelocal.html b/Source/WebKit/chromium/tests/data/input_field_datetimelocal.html
new file mode 100644
index 000000000..42f8422bf
--- /dev/null
+++ b/Source/WebKit/chromium/tests/data/input_field_datetimelocal.html
@@ -0,0 +1 @@
+<input type="datetime-local" />
diff --git a/Source/WebKit/chromium/tests/data/input_field_default.html b/Source/WebKit/chromium/tests/data/input_field_default.html
new file mode 100644
index 000000000..4cf679efe
--- /dev/null
+++ b/Source/WebKit/chromium/tests/data/input_field_default.html
@@ -0,0 +1 @@
+<input />
diff --git a/Source/WebKit/chromium/tests/data/input_field_email.html b/Source/WebKit/chromium/tests/data/input_field_email.html
new file mode 100644
index 000000000..d12a5aab8
--- /dev/null
+++ b/Source/WebKit/chromium/tests/data/input_field_email.html
@@ -0,0 +1 @@
+<input type="email" />
diff --git a/Source/WebKit/chromium/tests/data/input_field_month.html b/Source/WebKit/chromium/tests/data/input_field_month.html
new file mode 100644
index 000000000..f787e4f64
--- /dev/null
+++ b/Source/WebKit/chromium/tests/data/input_field_month.html
@@ -0,0 +1 @@
+<input type="month" />
diff --git a/Source/WebKit/chromium/tests/data/input_field_number.html b/Source/WebKit/chromium/tests/data/input_field_number.html
new file mode 100644
index 000000000..2cfc5bdfa
--- /dev/null
+++ b/Source/WebKit/chromium/tests/data/input_field_number.html
@@ -0,0 +1 @@
+<input type="number" />
diff --git a/Source/WebKit/chromium/tests/data/input_field_password.html b/Source/WebKit/chromium/tests/data/input_field_password.html
new file mode 100644
index 000000000..98ed14c93
--- /dev/null
+++ b/Source/WebKit/chromium/tests/data/input_field_password.html
@@ -0,0 +1 @@
+<input type="password" />
diff --git a/Source/WebKit/chromium/tests/data/input_field_search.html b/Source/WebKit/chromium/tests/data/input_field_search.html
new file mode 100644
index 000000000..7f360e6bc
--- /dev/null
+++ b/Source/WebKit/chromium/tests/data/input_field_search.html
@@ -0,0 +1 @@
+<input type="search" />
diff --git a/Source/WebKit/chromium/tests/data/input_field_tel.html b/Source/WebKit/chromium/tests/data/input_field_tel.html
new file mode 100644
index 000000000..3dcaae033
--- /dev/null
+++ b/Source/WebKit/chromium/tests/data/input_field_tel.html
@@ -0,0 +1 @@
+<input type="tel" />
diff --git a/Source/WebKit/chromium/tests/data/input_field_time.html b/Source/WebKit/chromium/tests/data/input_field_time.html
new file mode 100644
index 000000000..b74734bd4
--- /dev/null
+++ b/Source/WebKit/chromium/tests/data/input_field_time.html
@@ -0,0 +1 @@
+<input type="time" />
diff --git a/Source/WebKit/chromium/tests/data/input_field_url.html b/Source/WebKit/chromium/tests/data/input_field_url.html
new file mode 100644
index 000000000..bf2716bc6
--- /dev/null
+++ b/Source/WebKit/chromium/tests/data/input_field_url.html
@@ -0,0 +1 @@
+<input type="url" />
diff --git a/Source/WebKit/chromium/tests/data/input_field_week.html b/Source/WebKit/chromium/tests/data/input_field_week.html
new file mode 100644
index 000000000..f4290cdb9
--- /dev/null
+++ b/Source/WebKit/chromium/tests/data/input_field_week.html
@@ -0,0 +1 @@
+<input type="week" />
diff --git a/Source/WebKit/chromium/tests/data/listener/listener_leak1.html b/Source/WebKit/chromium/tests/data/listener/listener_leak1.html
new file mode 100644
index 000000000..ef0e0ec6e
--- /dev/null
+++ b/Source/WebKit/chromium/tests/data/listener/listener_leak1.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<html>
+<head><title>Event Listener Leak Test 1</title></head>
+<body onload="leak()">
+<script>
+if (typeof(gc) == "undefined") gc = function() {};
+
+function EventListenerLeakTestObject1() {}
+
+function createListener(node) {
+ var foo = new EventListenerLeakTestObject1();
+ return function(evt) {
+ // This closure references |node| and an instance of leak object.
+ node.foo = foo;
+ };
+}
+
+function doLeak() {
+ for (var i = 0; i < 10000; i++) {
+ var node = document.createElement('span');
+ node.onclick = createListener(node);
+ }
+}
+
+function leak() {
+ doLeak();
+ gc();
+ gc();
+}
+</script>
+
+<p>This page leaks memory.</p>
+
+<!-- Allow leaking manually. -->
+<input type="button" value="Leak More" onclick="leak()">
+
+</body>
+</html>
diff --git a/Source/WebKit/chromium/tests/data/listener/listener_leak2.html b/Source/WebKit/chromium/tests/data/listener/listener_leak2.html
new file mode 100644
index 000000000..14df25a34
--- /dev/null
+++ b/Source/WebKit/chromium/tests/data/listener/listener_leak2.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<html>
+<head><title>Event Listener Leak Test 2</title></head>
+<body onload="leak()">
+<script>
+if (typeof(gc) == "undefined") gc = function() {};
+
+var node = null;
+
+function EventListenerLeakTestObject2() {}
+
+function createListener(node) {
+ var foo = new EventListenerLeakTestObject2();
+ return function(evt) {
+ // This closure references |node| and an instance of leak object.
+ node.foo = foo;
+ };
+}
+
+function doLeak() {
+ if (!node) node = document.createElement('span');
+ for (var i = 0; i < 10000; i++) {
+ node.onclick = createListener(node);
+ }
+}
+
+function leak() {
+ doLeak();
+ gc();
+ gc();
+}
+</script>
+
+<p>This page leaks memory.</p>
+
+<!-- Allow leaking manually. -->
+<input type="button" value="Leak More" onclick="leak()">
+
+</body>
+</html>
diff --git a/Source/WebKit/chromium/tests/data/listener/mutation_event_listener.html b/Source/WebKit/chromium/tests/data/listener/mutation_event_listener.html
new file mode 100644
index 000000000..231a4f1e8
--- /dev/null
+++ b/Source/WebKit/chromium/tests/data/listener/mutation_event_listener.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+function removeNode(id) {
+ var node = document.getElementById(id);
+ node.parentNode.removeChild(node);
+ }
+
+function addElement(id) {
+ var elem = document.createElement("div");
+ elem.setAttribute("id", id);
+ var text = document.createTextNode("Added node id=" + id);
+ elem.appendChild(text);
+ document.getElementById("topDiv").appendChild(elem);
+ }
+
+function changeText(id, newText) {
+ var node = document.getElementById(id);
+ node.childNodes[0].nodeValue = newText;
+}
+</script>
+</head>
+
+<body>
+
+<div id="topDiv">
+ <div id="div1">Div #1</div>
+ <div id="div2">Div #2</div>
+ <div id="div3">Div #3</div>
+</div>
+
+<button onclick="removeNode('div1')">Remove node</button><br>
+<button onclick="addElement('bidule')">Add node</button><br>
+<button onclick="changeText('div2', 'Bijour')">Change text</button><br>
+
+</body>
+</html>
diff --git a/Source/WebKit/chromium/tests/data/postmessage_test.html b/Source/WebKit/chromium/tests/data/postmessage_test.html
new file mode 100644
index 000000000..75cb8efec
--- /dev/null
+++ b/Source/WebKit/chromium/tests/data/postmessage_test.html
@@ -0,0 +1,16 @@
+<html>
+<head>
+<title>PostMessage Test</title>
+<script>
+var messagesReceived = 0;
+window.addEventListener("message", messageReceived, false);
+function messageReceived(event) {
+ messagesReceived++;
+ document.body.appendChild(document.createTextNode('Message ' + messagesReceived + '.'));
+}
+</script>
+</head>
+<body>
+Test page.
+</body>
+</html>
diff --git a/Source/WebKit/efl/ChangeLog b/Source/WebKit/efl/ChangeLog
index b251653b7..c7d6d8c42 100644
--- a/Source/WebKit/efl/ChangeLog
+++ b/Source/WebKit/efl/ChangeLog
@@ -1,3 +1,221 @@
+2012-05-10 Gyuyoung Kim <gyuyoung.kim@samsung.com>
+
+ Move resumeAnimations to use Internals interface
+ https://bugs.webkit.org/show_bug.cgi?id=86063
+
+ Reviewed by Alexey Proskuryakov.
+
+ Remove resumeAnimations functions, because it is able to work in the
+ cross-port way through the Internals interface.
+
+ * WebCoreSupport/DumpRenderTreeSupportEfl.cpp:
+ * WebCoreSupport/DumpRenderTreeSupportEfl.h:
+
+2012-05-10 Kangil Han <kangil.han@samsung.com>
+
+ [EFL][DRT] Editor doesn't cancel composition as change of value
+ https://bugs.webkit.org/show_bug.cgi?id=85122
+
+ Reviewed by Martin Robinson.
+
+ IME composition should be cancelled when the value of input element is changed programmatically.
+ However, EFL port doesn't cancel as change of value.
+ Therefore, this patch will fix the bug.
+
+ * WebCoreSupport/EditorClientEfl.cpp:
+ (WebCore::EditorClientEfl::respondToChangedSelection):
+
+2012-05-10 Dominik Röttsches <dominik.rottsches@intel.com>
+
+ [EFL][DRT] ewk_view_paint_contents may trigger assertion failure
+ https://bugs.webkit.org/show_bug.cgi?id=85058
+
+ Reviewed by Gustavo Noronha Silva.
+
+ Fixing assertion failure triggered in media/media-fragment cases.
+ The assertion is hit because of a race between scheduleRelayout() and
+ the EWK's idle tiling painting. This is exposed by test cases
+ that rapidly insert child nodes to the document which lead to
+ scheduleRelayout() calls. Using the general purpose defensive
+ layout function, not causing any extra relayout work if there's
+ nothing to be done, but still avoiding the assertion failure if
+ layout is needed.
+
+ * ewk/ewk_view.cpp:
+ (ewk_view_paint):
+ (ewk_view_paint_contents):
+
+2012-05-10 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r116633.
+ http://trac.webkit.org/changeset/116633
+ https://bugs.webkit.org/show_bug.cgi?id=86093
+
+ Breaks EFL tests (Requested by kov on #webkit).
+
+ * WebCoreSupport/DumpRenderTreeSupportEfl.cpp:
+ * WebCoreSupport/DumpRenderTreeSupportEfl.h:
+
+2012-05-10 Alexander Shalamov <alexander.shalamov@intel.com>
+
+ [EFL] LayoutTestController needs implementation of setTabKeyCyclesThroughElements
+ https://bugs.webkit.org/show_bug.cgi?id=82864
+
+ Reviewed by Gustavo Noronha Silva.
+
+ Add missing implementation for setTabKeyCyclesThroughElements to EFL's
+ DumpRenderTreeSupport.
+
+ * WebCoreSupport/DumpRenderTreeSupportEfl.cpp:
+ (DumpRenderTreeSupportEfl::setTabKeyCyclesThroughElements):
+ * WebCoreSupport/DumpRenderTreeSupportEfl.h:
+
+2012-05-10 Mikhail Pozdnyakov <mikhail.pozdnyakov@intel.com>
+
+ [EFL][DRT] Clear added user style sheets before a new testcase execution.
+ https://bugs.webkit.org/show_bug.cgi?id=84792
+
+ Reviewed by Gustavo Noronha Silva.
+
+ Add a helper function for clearing of the added user style sheets.
+
+ * WebCoreSupport/DumpRenderTreeSupportEfl.cpp:
+ (DumpRenderTreeSupportEfl::clearUserStyleSheets):
+ * WebCoreSupport/DumpRenderTreeSupportEfl.h:
+
+2012-05-09 Gyuyoung Kim <gyuyoung.kim@samsung.com>
+
+ Move suspendAnimations to use Internals interface.
+ https://bugs.webkit.org/show_bug.cgi?id=85986
+
+ Reviewed by Ryosuke Niwa.
+
+ Remove suspendAnimations functions, because it is able to work in the
+ cross-port way through the Internals interface.
+
+ * WebCoreSupport/DumpRenderTreeSupportEfl.cpp:
+ * WebCoreSupport/DumpRenderTreeSupportEfl.h:
+
+2012-05-09 Christophe Dumez <christophe.dumez@intel.com>
+
+ [EFL][DRT] EFL's DRT needs to support LayoutTestController.dumpIconChanges()
+ https://bugs.webkit.org/show_bug.cgi?id=84435
+
+ Reviewed by Antonio Gomes.
+
+ Emit a "icon,changed" signal on the frame when its favion changed.
+ Clarify that the "icon,loaded" signal is only emitted for the main
+ frame.
+
+ * WebCoreSupport/FrameLoaderClientEfl.cpp:
+ (WebCore::FrameLoaderClientEfl::dispatchDidReceiveIcon):
+ (WebCore::FrameLoaderClientEfl::dispatchDidChangeIcons):
+ * ewk/ewk_frame.cpp:
+ (ewk_frame_icon_changed):
+ * ewk/ewk_frame.h:
+ * ewk/ewk_private.h:
+
+2012-05-09 Mikhail Pozdnyakov <mikhail.pozdnyakov@intel.com>
+
+ [EFL][DRT] LayoutTestController addUserScript implementation
+ https://bugs.webkit.org/show_bug.cgi?id=84718
+
+ Reviewed by Antonio Gomes.
+
+ Added helper functions for adding/clearing of user scripts.
+
+ * WebCoreSupport/DumpRenderTreeSupportEfl.cpp:
+ (DumpRenderTreeSupportEfl::addUserScript):
+ (DumpRenderTreeSupportEfl::clearUserScripts):
+ * WebCoreSupport/DumpRenderTreeSupportEfl.h:
+
+2012-05-08 Kangil Han <kangil.han@samsung.com>
+
+ [EFL][DRT] Implement TextInputController.
+ https://bugs.webkit.org/show_bug.cgi?id=78559
+
+ Reviewed by Martin Robinson.
+
+ TextInputController has been created for an input emulation purpose in DRT.
+ However, not like other ports, EFL doesn't have it.
+ Therefore, this patch will enable EFL port to have an input emulation in DRT.
+
+ * WebCoreSupport/DumpRenderTreeSupportEfl.cpp:
+ (DumpRenderTreeSupportEfl::setComposition):
+ (DumpRenderTreeSupportEfl::hasComposition):
+ (DumpRenderTreeSupportEfl::compositionRange):
+ (DumpRenderTreeSupportEfl::confirmComposition):
+ (DumpRenderTreeSupportEfl::firstRectForCharacterRange):
+ (DumpRenderTreeSupportEfl::selectedRange):
+ * WebCoreSupport/DumpRenderTreeSupportEfl.h:
+
+2012-04-23 Raphael Kubo da Costa <rakuco@webkit.org>
+
+ [EFL] Pass a WTF::String directly from DRT to ewebkit when possible
+ https://bugs.webkit.org/show_bug.cgi?id=84634
+
+ Reviewed by Gustavo Noronha Silva.
+
+ Drop unnecessary const char* -> WTF::String conversions by
+ creating String objects directly in LayoutTestController out of
+ JSStringRef's and passing them to DumpRenderTreeSupportEfl.
+
+ * WebCoreSupport/DumpRenderTreeSupportEfl.cpp:
+ (DumpRenderTreeSupportEfl::setValueForUser):
+ (DumpRenderTreeSupportEfl::addUserStyleSheet):
+ (DumpRenderTreeSupportEfl::findString):
+ * WebCoreSupport/DumpRenderTreeSupportEfl.h:
+
+2012-05-08 Krzysztof Czech <k.czech@samsung.com>
+
+ [EFL] Update documentation of ewk_frame_contents_alternate_set and ewk_view_zoom_range_set.
+ https://bugs.webkit.org/show_bug.cgi?id=84588
+
+ Reviewed by Eric Seidel.
+
+ In ewk_frame_contents_alternate_set, param unreachableUri is required, must not be 0.
+ In ewk_view_zoom_range_set, function returns EINA_FALSE only on failure,
+ not when zoom range is changed.
+
+ * ewk/ewk_frame.h:
+ * ewk/ewk_view.h:
+
+2012-05-07 Mikhail Pozdnyakov <mikhail.pozdnyakov@intel.com>
+
+ [EFL] Page caching permission from EFL's FrameLoaderClient
+ https://bugs.webkit.org/show_bug.cgi?id=85620
+
+ Reviewed by Gustavo Noronha Silva.
+
+ FrameLoaderClientEfl::canCachePage() returns true.
+
+ * WebCoreSupport/FrameLoaderClientEfl.cpp:
+ (WebCore::FrameLoaderClientEfl::canCachePage):
+
+2012-05-07 Grzegorz Czajkowski <g.czajkowski@samsung.com>
+
+ [EFL] Icon database path may be NULL when a new path was set.
+ https://bugs.webkit.org/show_bug.cgi?id=82456
+
+ Reviewed by Andreas Kling.
+
+ ewk_settings_icon_database_path_set calls asynchronous method WebCore::iconDatabase().open().
+ There is no notification when the new path is set by WebCore.
+ Moreover ewk_settings_icon_database_path_set keeps the new path in a local variable.
+
+ To retrieve path to icon database ewk_settings_icon_database_path_get can be called.
+ It first checks flags whether icon databse is opened and enabled. There is possibility
+ that icon database has been set through API but it hasn't been opened by WebCore yet.
+ So as a result ewk_settings_icon_database_path_get returns NULL because WebCore hasn't
+ set an appropriate flag yet.
+
+ It may happen while icon database set/get sequences.
+ Information whether icon database is opened/enabled should be exposed by separate API.
+
+ * ewk/ewk_settings.cpp:
+ (ewk_settings_icon_database_path_get): Skip checking whether icon database is opened, enabled.
+ * ewk/ewk_settings.h:
+
2012-05-07 Sudarsana Nagineni <sudarsana.nagineni@linux.intel.com>
[EFL][DRT] Implement LayoutTestController::execCommand
diff --git a/Source/WebKit/efl/WebCoreSupport/DumpRenderTreeSupportEfl.cpp b/Source/WebKit/efl/WebCoreSupport/DumpRenderTreeSupportEfl.cpp
index 9b28046f8..1486cbc60 100644
--- a/Source/WebKit/efl/WebCoreSupport/DumpRenderTreeSupportEfl.cpp
+++ b/Source/WebKit/efl/WebCoreSupport/DumpRenderTreeSupportEfl.cpp
@@ -43,12 +43,11 @@
#include <PrintContext.h>
#include <RenderTreeAsText.h>
#include <Settings.h>
+#include <TextIterator.h>
#include <WebKitMutationObserver.h>
#include <bindings/js/GCController.h>
#include <history/HistoryItem.h>
#include <workers/WorkerThread.h>
-#include <wtf/OwnArrayPtr.h>
-#include <wtf/text/AtomicString.h>
unsigned DumpRenderTreeSupportEfl::activeAnimationsCount(const Evas_Object* ewkFrame)
{
@@ -279,18 +278,6 @@ String DumpRenderTreeSupportEfl::responseMimeType(const Evas_Object* ewkFrame)
return documentLoader->responseMIMEType();
}
-void DumpRenderTreeSupportEfl::resumeAnimations(Evas_Object* ewkFrame)
-{
- WebCore::Frame* frame = EWKPrivate::coreFrame(ewkFrame);
-
- if (!frame)
- return;
-
- WebCore::AnimationController *animationController = frame->animation();
- if (animationController)
- animationController->resumeAnimations();
-}
-
WebCore::IntRect DumpRenderTreeSupportEfl::selectionRectangle(const Evas_Object* ewkFrame)
{
WebCore::Frame* frame = EWKPrivate::coreFrame(ewkFrame);
@@ -324,19 +311,7 @@ String DumpRenderTreeSupportEfl::suitableDRTFrameName(const Evas_Object* ewkFram
return String("frame (anonymous)");
}
-void DumpRenderTreeSupportEfl::suspendAnimations(Evas_Object* ewkFrame)
-{
- WebCore::Frame* frame = EWKPrivate::coreFrame(ewkFrame);
-
- if (!frame)
- return;
-
- WebCore::AnimationController *animationController = frame->animation();
- if (animationController)
- animationController->suspendAnimations();
-}
-
-void DumpRenderTreeSupportEfl::setValueForUser(JSContextRef context, JSValueRef nodeObject, JSStringRef value)
+void DumpRenderTreeSupportEfl::setValueForUser(JSContextRef context, JSValueRef nodeObject, const String& value)
{
JSC::ExecState* exec = toJS(context);
WebCore::Element* element = WebCore::toElement(toJS(exec, nodeObject));
@@ -346,10 +321,7 @@ void DumpRenderTreeSupportEfl::setValueForUser(JSContextRef context, JSValueRef
if (!inputElement)
return;
- size_t bufferSize = JSStringGetMaximumUTF8CStringSize(value);
- OwnArrayPtr<char> valueBuffer = adoptArrayPtr(new char[bufferSize]);
- JSStringGetUTF8CString(value, valueBuffer.get(), bufferSize);
- inputElement->setValueForUser(String::fromUTF8(valueBuffer.get()));
+ inputElement->setValueForUser(value);
}
void DumpRenderTreeSupportEfl::setAutofilled(JSContextRef context, JSValueRef nodeObject, bool autofilled)
@@ -384,7 +356,27 @@ void DumpRenderTreeSupportEfl::setLoadsSiteIconsIgnoringImageLoadingSetting(Evas
page->settings()->setLoadsSiteIconsIgnoringImageLoadingSetting(loadsSiteIconsIgnoringImageLoadingPreferences);
}
-void DumpRenderTreeSupportEfl::addUserStyleSheet(const Evas_Object* ewkView, const char* sourceCode, bool allFrames)
+void DumpRenderTreeSupportEfl::addUserScript(const Evas_Object* ewkView, const String& sourceCode, bool runAtStart, bool allFrames)
+{
+ WebCore::Page* page = EWKPrivate::corePage(ewkView);
+ if (!page)
+ return;
+
+ page->group().addUserScriptToWorld(WebCore::mainThreadNormalWorld(), sourceCode, WebCore::KURL(),
+ nullptr, nullptr, runAtStart ? WebCore::InjectAtDocumentStart : WebCore::InjectAtDocumentEnd,
+ allFrames ? WebCore::InjectInAllFrames : WebCore::InjectInTopFrameOnly);
+}
+
+void DumpRenderTreeSupportEfl::clearUserScripts(const Evas_Object* ewkView)
+{
+ WebCore::Page* page = EWKPrivate::corePage(ewkView);
+ if (!page)
+ return;
+
+ page->group().removeUserScriptsFromWorld(WebCore::mainThreadNormalWorld());
+}
+
+void DumpRenderTreeSupportEfl::addUserStyleSheet(const Evas_Object* ewkView, const String& sourceCode, bool allFrames)
{
WebCore::Page* page = EWKPrivate::corePage(ewkView);
if (!page)
@@ -393,6 +385,15 @@ void DumpRenderTreeSupportEfl::addUserStyleSheet(const Evas_Object* ewkView, con
page->group().addUserStyleSheetToWorld(WebCore::mainThreadNormalWorld(), sourceCode, WebCore::KURL(), nullptr, nullptr, allFrames ? WebCore::InjectInAllFrames : WebCore::InjectInTopFrameOnly);
}
+void DumpRenderTreeSupportEfl::clearUserStyleSheets(const Evas_Object* ewkView)
+{
+ WebCore::Page* page = EWKPrivate::corePage(ewkView);
+ if (!page)
+ return;
+
+ page->group().removeUserStyleSheetsFromWorld(WebCore::mainThreadNormalWorld());
+}
+
void DumpRenderTreeSupportEfl::executeCoreCommandByName(const Evas_Object* ewkView, const char* name, const char* value)
{
WebCore::Page* page = EWKPrivate::corePage(ewkView);
@@ -402,14 +403,14 @@ void DumpRenderTreeSupportEfl::executeCoreCommandByName(const Evas_Object* ewkVi
page->focusController()->focusedOrMainFrame()->editor()->command(name).execute(value);
}
-bool DumpRenderTreeSupportEfl::findString(const Evas_Object* ewkView, const char* text, WebCore::FindOptions options)
+bool DumpRenderTreeSupportEfl::findString(const Evas_Object* ewkView, const String& text, WebCore::FindOptions options)
{
WebCore::Page* page = EWKPrivate::corePage(ewkView);
if (!page)
return false;
- return page->findString(String::fromUTF8(text), options);
+ return page->findString(text, options);
}
void DumpRenderTreeSupportEfl::setJavaScriptProfilingEnabled(const Evas_Object* ewkView, bool enabled)
@@ -620,3 +621,117 @@ void DumpRenderTreeSupportEfl::setAuthorAndUserStylesEnabled(Evas_Object* ewkVie
corePage->settings()->setAuthorAndUserStylesEnabled(enabled);
}
+
+void DumpRenderTreeSupportEfl::setComposition(Evas_Object* ewkView, const char* text, int start, int length)
+{
+ WebCore::Page* page = EWKPrivate::corePage(ewkView);
+ if (!page || !page->focusController() || !page->focusController()->focusedOrMainFrame())
+ return;
+
+ WebCore::Editor* editor = page->focusController()->focusedOrMainFrame()->editor();
+ if (!editor || (!editor->canEdit() && !editor->hasComposition()))
+ return;
+
+ const String compositionString = String::fromUTF8(text);
+ Vector<WebCore::CompositionUnderline> underlines;
+ underlines.append(WebCore::CompositionUnderline(0, compositionString.length(), WebCore::Color(0, 0, 0), false));
+ editor->setComposition(compositionString, underlines, start, start + length);
+}
+
+bool DumpRenderTreeSupportEfl::hasComposition(const Evas_Object* ewkView)
+{
+ const WebCore::Page* page = EWKPrivate::corePage(ewkView);
+ if (!page || !page->focusController() || !page->focusController()->focusedOrMainFrame())
+ return false;
+
+ const WebCore::Editor* editor = page->focusController()->focusedOrMainFrame()->editor();
+ if (!editor)
+ return false;
+
+ return editor->hasComposition();
+}
+
+bool DumpRenderTreeSupportEfl::compositionRange(Evas_Object* ewkView, int* start, int* length)
+{
+ *start = *length = 0;
+
+ WebCore::Page* page = EWKPrivate::corePage(ewkView);
+ if (!page || !page->focusController() || !page->focusController()->focusedOrMainFrame())
+ return false;
+
+ WebCore::Editor* editor = page->focusController()->focusedOrMainFrame()->editor();
+ if (!editor || !editor->hasComposition())
+ return false;
+
+ *start = editor->compositionStart();
+ *length = editor->compositionEnd() - *start;
+ return true;
+}
+
+void DumpRenderTreeSupportEfl::confirmComposition(Evas_Object* ewkView, const char* text)
+{
+ WebCore::Page* page = EWKPrivate::corePage(ewkView);
+ if (!page || !page->focusController() || !page->focusController()->focusedOrMainFrame())
+ return;
+
+ WebCore::Editor* editor = page->focusController()->focusedOrMainFrame()->editor();
+ if (!editor)
+ return;
+
+ if (!editor->hasComposition()) {
+ editor->insertText(String::fromUTF8(text), 0);
+ return;
+ }
+
+ if (text) {
+ editor->confirmComposition(String::fromUTF8(text));
+ return;
+ }
+ editor->confirmComposition();
+}
+
+WebCore::IntRect DumpRenderTreeSupportEfl::firstRectForCharacterRange(Evas_Object* ewkView, int location, int length)
+{
+ WebCore::Page* page = EWKPrivate::corePage(ewkView);
+ if (!page || !page->focusController() || !page->focusController()->focusedOrMainFrame() || !page->focusController()->focusedOrMainFrame()->editor())
+ return WebCore::IntRect();
+
+ if ((location + length < location) && (location + length))
+ length = 0;
+
+ WebCore::Frame* frame = page->focusController()->focusedOrMainFrame();
+ WebCore::Editor* editor = frame->editor();
+
+ RefPtr<WebCore::Range> range = WebCore::TextIterator::rangeFromLocationAndLength(frame->selection()->rootEditableElementOrDocumentElement(), location, length);
+ if (!range)
+ return WebCore::IntRect();
+
+ return editor->firstRectForRange(range.get());
+}
+
+bool DumpRenderTreeSupportEfl::selectedRange(Evas_Object* ewkView, int* start, int* length)
+{
+ if (!(start && length))
+ return false;
+
+ WebCore::Page* page = EWKPrivate::corePage(ewkView);
+ if (!page || !page->focusController() || !page->focusController()->focusedOrMainFrame())
+ return false;
+
+ WebCore::Frame* frame = page->focusController()->focusedOrMainFrame();
+ RefPtr<WebCore::Range> range = frame->selection()->toNormalizedRange().get();
+ if (!range)
+ return false;
+
+ WebCore::Element* selectionRoot = frame->selection()->rootEditableElement();
+ WebCore::Element* scope = selectionRoot ? selectionRoot : frame->document()->documentElement();
+
+ RefPtr<WebCore::Range> testRange = WebCore::Range::create(scope->document(), scope, 0, range->startContainer(), range->startOffset());
+ *start = WebCore::TextIterator::rangeLength(testRange.get());
+
+ WebCore::ExceptionCode ec;
+ testRange->setEnd(range->endContainer(), range->endOffset(), ec);
+ *length = WebCore::TextIterator::rangeLength(testRange.get());
+
+ return true;
+}
diff --git a/Source/WebKit/efl/WebCoreSupport/DumpRenderTreeSupportEfl.h b/Source/WebKit/efl/WebCoreSupport/DumpRenderTreeSupportEfl.h
index d65fa74c4..5328f6776 100644
--- a/Source/WebKit/efl/WebCoreSupport/DumpRenderTreeSupportEfl.h
+++ b/Source/WebKit/efl/WebCoreSupport/DumpRenderTreeSupportEfl.h
@@ -62,18 +62,19 @@ public:
static unsigned pendingUnloadEventCount(const Evas_Object* ewkFrame);
static String renderTreeDump(Evas_Object* ewkFrame);
static String responseMimeType(const Evas_Object* ewkFrame);
- static void resumeAnimations(Evas_Object* ewkFrame);
static WebCore::IntRect selectionRectangle(const Evas_Object* ewkFrame);
static String suitableDRTFrameName(const Evas_Object* ewkFrame);
- static void suspendAnimations(Evas_Object* ewkFrame);
- static void setValueForUser(JSContextRef, JSValueRef nodeObject, JSStringRef value);
+ static void setValueForUser(JSContextRef, JSValueRef nodeObject, const String& value);
static void setAutofilled(JSContextRef, JSValueRef nodeObject, bool autofilled);
static void setDefersLoading(Evas_Object* ewkView, bool defers);
static void setLoadsSiteIconsIgnoringImageLoadingSetting(Evas_Object* ewkView, bool loadsSiteIconsIgnoringImageLoadingPreferences);
- static void addUserStyleSheet(const Evas_Object* ewkView, const char* sourceCode, bool allFrames);
+ static void addUserScript(const Evas_Object* ewkView, const String& sourceCode, bool runAtStart, bool allFrames);
+ static void clearUserScripts(const Evas_Object* ewkView);
+ static void addUserStyleSheet(const Evas_Object* ewkView, const String& sourceCode, bool allFrames);
+ static void clearUserStyleSheets(const Evas_Object* ewkView);
static void executeCoreCommandByName(const Evas_Object* ewkView, const char* name, const char* value);
- static bool findString(const Evas_Object* ewkView, const char* text, WebCore::FindOptions);
+ static bool findString(const Evas_Object* ewkView, const String& text, WebCore::FindOptions);
static bool isCommandEnabled(const Evas_Object* ewkView, const char* name);
static void setJavaScriptProfilingEnabled(const Evas_Object* ewkView, bool enabled);
static void setSmartInsertDeleteEnabled(Evas_Object* ewkView, bool enabled);
@@ -98,6 +99,14 @@ public:
static void setInteractiveFormValidationEnabled(Evas_Object* ewkView, bool enabled);
static JSValueRef computedStyleIncludingVisitedInfo(JSContextRef, JSValueRef);
static void setAuthorAndUserStylesEnabled(Evas_Object* ewkView, bool);
+
+ // TextInputController
+ static void setComposition(Evas_Object*, const char*, int, int);
+ static bool hasComposition(const Evas_Object*);
+ static bool compositionRange(Evas_Object*, int*, int*);
+ static void confirmComposition(Evas_Object*, const char*);
+ static WebCore::IntRect firstRectForCharacterRange(Evas_Object*, int, int);
+ static bool selectedRange(Evas_Object*, int*, int*);
};
#endif // DumpRenderTreeSupportEfl_h
diff --git a/Source/WebKit/efl/WebCoreSupport/EditorClientEfl.cpp b/Source/WebKit/efl/WebCoreSupport/EditorClientEfl.cpp
index 8b9bc9fd4..9217cc1a5 100644
--- a/Source/WebKit/efl/WebCoreSupport/EditorClientEfl.cpp
+++ b/Source/WebKit/efl/WebCoreSupport/EditorClientEfl.cpp
@@ -144,6 +144,15 @@ void EditorClientEfl::respondToChangedSelection(Frame* coreFrame)
Evas_Object* webFrame = EWKPrivate::kitFrame(coreFrame);
ewk_frame_editor_client_selection_changed(webFrame);
+
+ if (!coreFrame->editor()->hasComposition() || coreFrame->editor()->ignoreCompositionSelectionChange())
+ return;
+
+ unsigned start;
+ unsigned end;
+
+ if (!coreFrame->editor()->getCompositionSelection(start, end))
+ coreFrame->editor()->cancelComposition();
}
void EditorClientEfl::didEndEditing()
diff --git a/Source/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp b/Source/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp
index ea930222d..5185d1eb0 100644
--- a/Source/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp
+++ b/Source/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp
@@ -596,9 +596,8 @@ void FrameLoaderClientEfl::dispatchWillClose()
void FrameLoaderClientEfl::dispatchDidReceiveIcon()
{
- /* report received favicon only for main frame. */
- if (ewk_view_frame_main_get(m_view) != m_frame)
- return;
+ // IconController loads icons only for the main frame.
+ ASSERT(ewk_view_frame_main_get(m_view) == m_frame);
ewk_view_frame_main_icon_received(m_view);
}
@@ -621,9 +620,11 @@ void FrameLoaderClientEfl::dispatchDidReceiveTitle(const StringWithDirection& ti
ewk_view_title_set(m_view, cs.data());
}
-void FrameLoaderClientEfl::dispatchDidChangeIcons(WebCore::IconType)
+void FrameLoaderClientEfl::dispatchDidChangeIcons(WebCore::IconType iconType)
{
- notImplemented();
+ // Other touch types are apple-specific
+ ASSERT(iconType == WebCore::Favicon);
+ ewk_frame_icon_changed(m_frame);
}
void FrameLoaderClientEfl::dispatchDidCommitLoad()
@@ -884,7 +885,7 @@ bool FrameLoaderClientEfl::shouldFallBack(const ResourceError& error)
bool FrameLoaderClientEfl::canCachePage() const
{
- return false;
+ return true;
}
Frame* FrameLoaderClientEfl::dispatchCreatePage(const NavigationAction&)
diff --git a/Source/WebKit/efl/ewk/ewk_frame.cpp b/Source/WebKit/efl/ewk/ewk_frame.cpp
index 24a12eac9..964b69288 100644
--- a/Source/WebKit/efl/ewk/ewk_frame.cpp
+++ b/Source/WebKit/efl/ewk/ewk_frame.cpp
@@ -1724,6 +1724,20 @@ Ewk_Certificate_Status ewk_frame_certificate_status_get(Evas_Object* ewkFrame)
/**
* @internal
+ * Reports frame favicon changed.
+ *
+ * @param ewkFrame Frame.
+ *
+ * Emits signal: "icon,changed" with no parameters.
+ */
+void ewk_frame_icon_changed(Evas_Object* ewkFrame)
+{
+ DBG("ewkFrame=%p", ewkFrame);
+ evas_object_smart_callback_call(ewkFrame, "icon,changed", 0);
+}
+
+/**
+ * @internal
* Reports uri changed and swap internal string reference.
*
* Emits signal: "uri,changed" with new uri as parameter.
diff --git a/Source/WebKit/efl/ewk/ewk_frame.h b/Source/WebKit/efl/ewk/ewk_frame.h
index 08b4bc067..f5bba1b9a 100644
--- a/Source/WebKit/efl/ewk/ewk_frame.h
+++ b/Source/WebKit/efl/ewk/ewk_frame.h
@@ -39,6 +39,7 @@
* were changed due new layout, script actions or any other events.
* - "editorclient,contents,changed", void: reports that editor client's
* contents were changed
+ * - "icon,changed", void: frame favicon changed.
* - "load,committed", void: reports load committed.
* - "load,document,finished", void: frame finished loading the document.
* - "load,error", const Ewk_Frame_Load_Error*: reports load failed
@@ -396,7 +397,7 @@ EAPI Eina_Bool ewk_frame_contents_set(Evas_Object *o, const char *contents, s
* @param base_uri base URI to use for relative resources, may be @c 0,
* if provided must be an absolute uri
* @param unreachable_uri the URI that failed to load and is getting the
- * alternative representation
+ * alternative representation, must @b not be @c 0
*
* @return @c EINA_TRUE on successful request, @c EINA_FALSE on errors
*/
diff --git a/Source/WebKit/efl/ewk/ewk_private.h b/Source/WebKit/efl/ewk/ewk_private.h
index 26d448d0e..fa284f3de 100644
--- a/Source/WebKit/efl/ewk/ewk_private.h
+++ b/Source/WebKit/efl/ewk/ewk_private.h
@@ -241,6 +241,7 @@ void ewk_frame_title_set(Evas_Object* ewkFrame, const char* title);
void ewk_frame_view_create_for_view(Evas_Object* ewkFrame, Evas_Object* view);
bool ewk_frame_uri_changed(Evas_Object* ewkFrame);
void ewk_frame_force_layout(Evas_Object* ewkFrame);
+void ewk_frame_icon_changed(Evas_Object* ewkFrame);
WTF::PassRefPtr<WebCore::Widget> ewk_frame_plugin_create(Evas_Object* ewkFrame, const WebCore::IntSize& pluginSize, WebCore::HTMLPlugInElement* element, const WebCore::KURL& url, const WTF::Vector<WTF::String>& paramNames, const WTF::Vector<WTF::String>& paramValues, const WTF::String& mimeType, bool loadManually);
diff --git a/Source/WebKit/efl/ewk/ewk_settings.cpp b/Source/WebKit/efl/ewk/ewk_settings.cpp
index 7866cde47..842930a7e 100644
--- a/Source/WebKit/efl/ewk/ewk_settings.cpp
+++ b/Source/WebKit/efl/ewk/ewk_settings.cpp
@@ -194,11 +194,6 @@ Eina_Bool ewk_settings_icon_database_path_set(const char* directory)
const char* ewk_settings_icon_database_path_get(void)
{
- if (!WebCore::iconDatabase().isEnabled())
- return 0;
- if (!WebCore::iconDatabase().isOpen())
- return 0;
-
return _ewk_icon_database_path;
}
diff --git a/Source/WebKit/efl/ewk/ewk_settings.h b/Source/WebKit/efl/ewk/ewk_settings.h
index 8c2200e07..8aa2c31d9 100644
--- a/Source/WebKit/efl/ewk/ewk_settings.h
+++ b/Source/WebKit/efl/ewk/ewk_settings.h
@@ -147,7 +147,7 @@ EAPI Eina_Bool ewk_settings_icon_database_path_set(const char *path);
* save yourself some cpu cycles and use eina_stringshare_ref()
* instead of eina_stringshare_add() or strdup().
*
- * @return database path or @c 0 if none is set or database is closed
+ * @return database path or @c 0 if none is set
*/
EAPI const char *ewk_settings_icon_database_path_get(void);
diff --git a/Source/WebKit/efl/ewk/ewk_view.cpp b/Source/WebKit/efl/ewk/ewk_view.cpp
index 7a0ee1ed6..8ec867d21 100644
--- a/Source/WebKit/efl/ewk/ewk_view.cpp
+++ b/Source/WebKit/efl/ewk/ewk_view.cpp
@@ -2778,8 +2778,7 @@ Eina_Bool ewk_view_paint(Ewk_View_Private_Data* priv, cairo_t* cr, const Eina_Re
WebCore::FrameView* view = priv->mainFrame->view();
EINA_SAFETY_ON_NULL_RETURN_VAL(view, false);
- if (view->needsLayout())
- view->forceLayout();
+ view->updateLayoutAndStyleIfNeededRecursive();
WebCore::GraphicsContext graphicsContext(cr);
WebCore::IntRect rect(*area);
@@ -2806,6 +2805,7 @@ Eina_Bool ewk_view_paint_contents(Ewk_View_Private_Data* priv, cairo_t* cr, cons
WebCore::GraphicsContext graphicsContext(cr);
WebCore::IntRect rect(*area);
+ view->updateLayoutAndStyleIfNeededRecursive();
cairo_save(cr);
graphicsContext.save();
graphicsContext.clip(rect);
diff --git a/Source/WebKit/efl/ewk/ewk_view.h b/Source/WebKit/efl/ewk/ewk_view.h
index 4d87724da..98210f828 100644
--- a/Source/WebKit/efl/ewk/ewk_view.h
+++ b/Source/WebKit/efl/ewk/ewk_view.h
@@ -2325,7 +2325,7 @@ EAPI void ewk_view_viewport_attributes_get(const Evas_Object *o, int *w, int *h,
* @param min_scale the minimum value of the zoom range
* @param max_scale the maximum value of the zoom range
*
- * @return @c EINA_TRUE if zoom range is changed, @c EINA_FALSE if not or on failure
+ * @return @c EINA_TRUE on success, @c EINA_FALSE on failure
*/
EAPI Eina_Bool ewk_view_zoom_range_set(Evas_Object *o, float min_scale, float max_scale);
diff --git a/Source/WebKit/gtk/ChangeLog b/Source/WebKit/gtk/ChangeLog
index 770526e53..d9d0eb5d4 100644
--- a/Source/WebKit/gtk/ChangeLog
+++ b/Source/WebKit/gtk/ChangeLog
@@ -1,3 +1,68 @@
+2012-05-10 Gyuyoung Kim <gyuyoung.kim@samsung.com>
+
+ Move resumeAnimations to use Internals interface
+ https://bugs.webkit.org/show_bug.cgi?id=86063
+
+ Reviewed by Alexey Proskuryakov.
+
+ Remove resumeAnimations functions, because it is able to work in the
+ cross-port way through the Internals interface.
+
+ * WebCoreSupport/DumpRenderTreeSupportGtk.cpp:
+ * WebCoreSupport/DumpRenderTreeSupportGtk.h:
+ (DumpRenderTreeSupportGtk):
+
+2012-05-09 Gyuyoung Kim <gyuyoung.kim@samsung.com>
+
+ Move suspendAnimations to use Internals interface.
+ https://bugs.webkit.org/show_bug.cgi?id=85986
+
+ Reviewed by Ryosuke Niwa.
+
+ Remove suspendAnimations functions, because it is able to work in the
+ cross-port way through the Internals interface.
+
+ * WebCoreSupport/DumpRenderTreeSupportGtk.cpp:
+ * WebCoreSupport/DumpRenderTreeSupportGtk.h:
+ (DumpRenderTreeSupportGtk):
+
+2012-05-09 Simon Pena <spena@igalia.com>
+
+ [GTK] Missing WebPreferences for media playback requiring user gestures and inline playback
+ https://bugs.webkit.org/show_bug.cgi?id=85194
+
+ Reviewed by Martin Robinson.
+
+ Expose WebPreferences for media playback requires user gesture and
+ media playback allows inline to GTK side.
+
+ This adds two properties (mediaPlaybackRequiresUserGesture and
+ mediaPlaybackAllowsInline) to GTK WebKit WebSettings, and connects
+ them to the WebKit WebView, so clients can programmatically modify
+ them.
+
+ * webkit/webkitwebsettings.cpp: install new properties and update
+ setter and getter
+ (webkit_web_settings_class_init):
+ (webkit_web_settings_set_property):
+ (webkit_web_settings_get_property):
+ * webkit/webkitwebsettingsprivate.h: add media playback related
+ properties
+ * webkit/webkitwebview.cpp: connect newly added properties
+ (webkit_web_view_update_settings):
+ (webkit_web_view_settings_notify):
+
+2012-05-09 Dan Winship <danw@gnome.org>
+
+ [GTK] don't use soup_session_pause_message in webkitdownload
+ https://bugs.webkit.org/show_bug.cgi?id=85931
+
+ Reviewed by Martin Robinson.
+
+ * webkit/webkitdownload.cpp:
+ (webkit_download_new_with_handle):
+ (webkit_download_start):
+
2012-05-06 Gyuyoung Kim <gyuyoung.kim@samsung.com>
Convert isPageBoxVisible to use Internals interface.
diff --git a/Source/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.cpp b/Source/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.cpp
index 1a0f32f2d..03827b4b7 100644
--- a/Source/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.cpp
+++ b/Source/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.cpp
@@ -363,24 +363,6 @@ unsigned int DumpRenderTreeSupportGtk::numberOfActiveAnimations(WebKitWebFrame*
return coreFrame->animation()->numberOfActiveAnimations(coreFrame->document());
}
-void DumpRenderTreeSupportGtk::suspendAnimations(WebKitWebFrame* frame)
-{
- Frame* coreFrame = core(frame);
- if (!coreFrame)
- return;
-
- return coreFrame->animation()->suspendAnimations();
-}
-
-void DumpRenderTreeSupportGtk::resumeAnimations(WebKitWebFrame* frame)
-{
- Frame* coreFrame = core(frame);
- if (!coreFrame)
- return;
-
- return coreFrame->animation()->resumeAnimations();
-}
-
void DumpRenderTreeSupportGtk::clearMainFrameName(WebKitWebFrame* frame)
{
g_return_if_fail(WEBKIT_IS_WEB_FRAME(frame));
diff --git a/Source/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.h b/Source/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.h
index 7db85cffe..a0fd1a567 100644
--- a/Source/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.h
+++ b/Source/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.h
@@ -72,8 +72,6 @@ public:
static bool pauseTransition(WebKitWebFrame*, const char* name, double time, const char* element);
static WTF::CString markerTextForListItem(WebKitWebFrame*, JSContextRef, JSValueRef nodeObject);
static unsigned int numberOfActiveAnimations(WebKitWebFrame*);
- static void suspendAnimations(WebKitWebFrame*);
- static void resumeAnimations(WebKitWebFrame*);
static void clearMainFrameName(WebKitWebFrame*);
static AtkObject* getFocusedAccessibleElement(WebKitWebFrame*);
static AtkObject* getRootAccessibleElement(WebKitWebFrame*);
diff --git a/Source/WebKit/gtk/webkit/webkitdownload.cpp b/Source/WebKit/gtk/webkit/webkitdownload.cpp
index 871db2c62..e698ed505 100644
--- a/Source/WebKit/gtk/webkit/webkitdownload.cpp
+++ b/Source/WebKit/gtk/webkit/webkitdownload.cpp
@@ -421,14 +421,11 @@ WebKitDownload* webkit_download_new_with_handle(WebKitNetworkRequest* request, W
{
g_return_val_if_fail(request, NULL);
- ResourceHandleInternal* d = handle->getInternal();
- if (d->m_soupMessage)
- soup_session_pause_message(webkit_get_default_session(), d->m_soupMessage.get());
-
WebKitDownload* download = WEBKIT_DOWNLOAD(g_object_new(WEBKIT_TYPE_DOWNLOAD, "network-request", request, NULL));
WebKitDownloadPrivate* priv = download->priv;
handle->ref();
+ handle->setDefersLoading(true);
priv->resourceHandle = handle;
webkit_download_set_response(download, response);
@@ -513,10 +510,7 @@ void webkit_download_start(WebKitDownload* download)
priv->resourceHandle = ResourceHandle::create(/* Null NetworkingContext */ NULL, core(priv->networkRequest), priv->downloadClient, false, false);
else {
priv->resourceHandle->setClient(priv->downloadClient);
-
- ResourceHandleInternal* d = priv->resourceHandle->getInternal();
- if (d->m_soupMessage)
- soup_session_unpause_message(webkit_get_default_session(), d->m_soupMessage.get());
+ priv->resourceHandle->setDefersLoading(false);
}
priv->timer = g_timer_new();
diff --git a/Source/WebKit/gtk/webkit/webkitwebsettings.cpp b/Source/WebKit/gtk/webkit/webkitwebsettings.cpp
index 1a3a27eb4..ce877e4f0 100644
--- a/Source/WebKit/gtk/webkit/webkitwebsettings.cpp
+++ b/Source/WebKit/gtk/webkit/webkitwebsettings.cpp
@@ -121,7 +121,9 @@ enum {
PROP_ENABLE_WEBGL,
PROP_ENABLE_WEB_AUDIO,
PROP_ENABLE_ACCELERATED_COMPOSITING,
- PROP_ENABLE_SMOOTH_SCROLLING
+ PROP_ENABLE_SMOOTH_SCROLLING,
+ PROP_MEDIA_PLAYBACK_REQUIRES_USER_GESTURE,
+ PROP_MEDIA_PLAYBACK_ALLOWS_INLINE
};
// Create a default user agent string
@@ -972,6 +974,43 @@ static void webkit_web_settings_class_init(WebKitWebSettingsClass* klass)
_("Whether to enable smooth scrolling"),
FALSE,
flags));
+
+ /**
+ * WebKitWebSettings:media-playback-requires-user-gesture
+ *
+ * Whether a user gesture (such as clicking the play button) would
+ * be required to start media playback or load media. This is off
+ * by default, so media playback could start automatically. Setting
+ * it on requires a gesture by the user to start playback, or to load
+ * the media.
+ *
+ * Since: 1.10.0
+ */
+ g_object_class_install_property(gobject_class,
+ PROP_MEDIA_PLAYBACK_REQUIRES_USER_GESTURE,
+ g_param_spec_boolean("media-playback-requires-user-gesture",
+ _("Media playback requires user gesture"),
+ _("Whether media playback requires user gesture"),
+ FALSE,
+ flags));
+
+ /**
+ * WebKitWebSettings:media-playback-allows-inline
+ *
+ * Whether media playback is full-screen only or inline playback is allowed.
+ * This is true by default, so media playback can be inline. Setting it to
+ * false allows specifying that media playback should be always fullscreen.
+ *
+ * Since: 1.10.0
+ */
+ g_object_class_install_property(gobject_class,
+ PROP_MEDIA_PLAYBACK_ALLOWS_INLINE,
+ g_param_spec_boolean("media-playback-allows-inline",
+ _("Media playback allows inline"),
+ _("Whether media playback allows inline"),
+ TRUE,
+ flags));
+
}
static void webkit_web_settings_init(WebKitWebSettings* web_settings)
@@ -1150,6 +1189,12 @@ static void webkit_web_settings_set_property(GObject* object, guint prop_id, con
case PROP_ENABLE_SMOOTH_SCROLLING:
priv->enableSmoothScrolling = g_value_get_boolean(value);
break;
+ case PROP_MEDIA_PLAYBACK_REQUIRES_USER_GESTURE:
+ priv->mediaPlaybackRequiresUserGesture = g_value_get_boolean(value);
+ break;
+ case PROP_MEDIA_PLAYBACK_ALLOWS_INLINE:
+ priv->mediaPlaybackAllowsInline = g_value_get_boolean(value);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
break;
@@ -1318,6 +1363,12 @@ static void webkit_web_settings_get_property(GObject* object, guint prop_id, GVa
case PROP_ENABLE_SMOOTH_SCROLLING:
g_value_set_boolean(value, priv->enableSmoothScrolling);
break;
+ case PROP_MEDIA_PLAYBACK_REQUIRES_USER_GESTURE:
+ g_value_set_boolean(value, priv->mediaPlaybackRequiresUserGesture);
+ break;
+ case PROP_MEDIA_PLAYBACK_ALLOWS_INLINE:
+ g_value_set_boolean(value, priv->mediaPlaybackAllowsInline);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
break;
diff --git a/Source/WebKit/gtk/webkit/webkitwebsettingsprivate.h b/Source/WebKit/gtk/webkit/webkitwebsettingsprivate.h
index 45f822371..5ed24a537 100644
--- a/Source/WebKit/gtk/webkit/webkitwebsettingsprivate.h
+++ b/Source/WebKit/gtk/webkit/webkitwebsettingsprivate.h
@@ -81,6 +81,8 @@ struct _WebKitWebSettingsPrivate {
gboolean enableWebAudio;
gboolean enableAcceleratedCompositing;
gboolean enableSmoothScrolling;
+ gboolean mediaPlaybackRequiresUserGesture;
+ gboolean mediaPlaybackAllowsInline;
};
WEBKIT_API void webkit_web_settings_add_extra_plugin_directory(WebKitWebView*, const gchar* directory);
diff --git a/Source/WebKit/gtk/webkit/webkitwebview.cpp b/Source/WebKit/gtk/webkit/webkitwebview.cpp
index 80e2fc3a3..300ea8c99 100644
--- a/Source/WebKit/gtk/webkit/webkitwebview.cpp
+++ b/Source/WebKit/gtk/webkit/webkitwebview.cpp
@@ -3334,6 +3334,8 @@ static void webkit_web_view_update_settings(WebKitWebView* webView)
coreSettings->setJavaEnabled(settingsPrivate->enableJavaApplet);
coreSettings->setHyperlinkAuditingEnabled(settingsPrivate->enableHyperlinkAuditing);
coreSettings->setDNSPrefetchingEnabled(settingsPrivate->enableDNSPrefetching);
+ coreSettings->setMediaPlaybackRequiresUserGesture(settingsPrivate->mediaPlaybackRequiresUserGesture);
+ coreSettings->setMediaPlaybackAllowsInline(settingsPrivate->mediaPlaybackAllowsInline);
#if ENABLE(SQL_DATABASE)
AbstractDatabase::setIsAvailable(settingsPrivate->enableHTML5Database);
@@ -3475,6 +3477,10 @@ static void webkit_web_view_settings_notify(WebKitWebSettings* webSettings, GPar
settings->setJavaEnabled(g_value_get_boolean(&value));
else if (name == g_intern_string("enable-hyperlink-auditing"))
settings->setHyperlinkAuditingEnabled(g_value_get_boolean(&value));
+ else if (name == g_intern_string("media-playback-requires-user-gesture"))
+ settings->setMediaPlaybackRequiresUserGesture(g_value_get_boolean(&value));
+ else if (name == g_intern_string("media-playback-allows-inline"))
+ settings->setMediaPlaybackAllowsInline(g_value_get_boolean(&value));
#if ENABLE(SPELLCHECK)
else if (name == g_intern_string("spell-checking-languages")) {
diff --git a/Source/WebKit/mac/ChangeLog b/Source/WebKit/mac/ChangeLog
index e103b9942..f35e19a6e 100644
--- a/Source/WebKit/mac/ChangeLog
+++ b/Source/WebKit/mac/ChangeLog
@@ -1,3 +1,109 @@
+2012-05-10 Gyuyoung Kim <gyuyoung.kim@samsung.com>
+
+ Move resumeAnimations to use Internals interface
+ https://bugs.webkit.org/show_bug.cgi?id=86063
+
+ Reviewed by Alexey Proskuryakov.
+
+ Remove resumeAnimations functions, because it is able to work in the
+ cross-port way through the Internals interface.
+
+ * WebKit.order:
+ * WebView/WebFrame.mm:
+ * WebView/WebFramePrivate.h:
+
+2012-05-10 Anders Carlsson <andersca@apple.com>
+
+ WebKit1: Add a way to blacklist specific plug-ins/plug-in versions
+ https://bugs.webkit.org/show_bug.cgi?id=86150
+ <rdar://problem/9551196>
+
+ Reviewed by Sam Weinig.
+
+ * Misc/WebKitErrors.h:
+ Add WebKitErrorInsecurePlugInVersion enum.
+
+ * Plugins/WebBasePluginPackage.h:
+ * Plugins/WebBasePluginPackage.mm:
+ (-[WebBasePluginPackage bundleIdentifier]):
+ (-[WebBasePluginPackage bundleVersion]):
+ Add bundleIdentifier and bundleVersion getters.
+
+ * WebCoreSupport/WebFrameLoaderClient.mm:
+ (WebFrameLoaderClient::createPlugin):
+ Check if the plug-in is blocked. If it is, set the unavailability reason and the error code.
+
+2012-05-10 Anders Carlsson <andersca@apple.com>
+
+ Rename the missing plug-in indicator to the unavailable plug-in indicator
+ https://bugs.webkit.org/show_bug.cgi?id=86136
+
+ Reviewed by Sam Weinig.
+
+ * Plugins/Hosted/WebHostedNetscapePluginView.mm:
+ (-[WebHostedNetscapePluginView pluginHostDied]):
+ * WebCoreSupport/WebChromeClient.h:
+ * WebCoreSupport/WebChromeClient.mm:
+ (WebChromeClient::shouldUnavailablePluginMessageBeButton):
+ (WebChromeClient::unavailablePluginButtonClicked):
+
+2012-05-09 Gyuyoung Kim <gyuyoung.kim@samsung.com>
+
+ Move suspendAnimations to use Internals interface.
+ https://bugs.webkit.org/show_bug.cgi?id=85986
+
+ Reviewed by Ryosuke Niwa.
+
+ Remove suspendAnimations functions, because it is able to work in the
+ cross-port way through the Internals interface.
+
+ * WebKit.order:
+ * WebView/WebFrame.mm:
+ * WebView/WebFramePrivate.h:
+
+2012-05-08 Kent Tamura <tkent@chromium.org>
+
+ Fixe Chromium build, and add a FIXME comment about a layering violation.
+
+ * WebCoreSupport/WebSystemInterface.mm:
+ (InitWebCoreSystemInterface):
+
+2012-05-08 Jon Lee <jonlee@apple.com>
+
+ Safari warns that it needs to resend the form in an iFrame when going back
+ https://bugs.webkit.org/show_bug.cgi?id=82658
+ <rdar://problem/11292558>
+
+ Reviewed by Darin Adler.
+
+ * WebCoreSupport/WebSystemInterface.mm:
+ (InitWebCoreSystemInterface): Add wkCFURLRequestAllowAllPostCaching.
+
+2012-05-08 Timothy Hatcher <timothy@apple.com>
+
+ Fix the SOFT_LINK_STAGED_FRAMEWORK_OPTIONAL macro so it passes the full path to dlopen.
+
+ <rdar://problem/11406517>
+
+ Reviewed by Mark Rowe.
+
+ * WebCoreSupport/WebInspectorClient.mm: Pass A to SOFT_LINK_STAGED_FRAMEWORK_OPTIONAL for the version.
+
+2012-05-07 Andy Estes <aestes@apple.com>
+
+ ENABLE_IFRAME_SEAMLESS should be part of FEATURE_DEFINES.
+
+ * Configurations/FeatureDefines.xcconfig:
+
+2012-05-07 Eric Seidel <eric@webkit.org>
+
+ Add ENABLE_IFRAME_SEAMLESS so Apple can turn off SEAMLESS if needed
+ https://bugs.webkit.org/show_bug.cgi?id=85822
+
+ Reviewed by Adam Barth.
+
+ * Configurations/FeatureDefines.xcconfig:
+
2012-05-05 Dean Jackson <dino@apple.com>
Add new Setting/Preference to disable requestAnimationFrame
diff --git a/Source/WebKit/mac/Configurations/FeatureDefines.xcconfig b/Source/WebKit/mac/Configurations/FeatureDefines.xcconfig
index 2dc145f36..91d688b53 100644
--- a/Source/WebKit/mac/Configurations/FeatureDefines.xcconfig
+++ b/Source/WebKit/mac/Configurations/FeatureDefines.xcconfig
@@ -54,6 +54,7 @@ ENABLE_GEOLOCATION = ENABLE_GEOLOCATION;
ENABLE_HIGH_DPI_CANVAS = ENABLE_HIGH_DPI_CANVAS;
ENABLE_ICONDATABASE = $(ENABLE_ICONDATABASE_$(REAL_PLATFORM_NAME));
ENABLE_ICONDATABASE_macosx = ENABLE_ICONDATABASE;
+ENABLE_IFRAME_SEAMLESS = ENABLE_IFRAME_SEAMLESS;
ENABLE_INDEXED_DATABASE = ;
ENABLE_INPUT_SPEECH = ;
ENABLE_INPUT_TYPE_COLOR = ;
@@ -121,4 +122,4 @@ ENABLE_WEB_TIMING = ;
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_CSS_FILTERS) $(ENABLE_CSS_GRID_LAYOUT) $(ENABLE_CSS_SHADERS) $(ENABLE_DASHBOARD_SUPPORT) $(ENABLE_DATALIST) $(ENABLE_DATA_TRANSFER_ITEMS) $(ENABLE_DETAILS) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DIRECTORY_UPLOAD) $(ENABLE_FILE_SYSTEM) $(ENABLE_FILTERS) $(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_NOTIFICATIONS) $(ENABLE_LINK_PREFETCH) $(ENABLE_LINK_PRERENDER) $(ENABLE_MATHML) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_METER_TAG) $(ENABLE_MICRODATA) $(ENABLE_MUTATION_OBSERVERS) $(ENABLE_NOTIFICATIONS) $(ENABLE_PAGE_VISIBILITY_API) $(ENABLE_PROGRESS_TAG) $(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_NOTIFICATIONS_ONLY) $(ENABLE_TOUCH_ICON_LOADING) $(ENABLE_VIDEO) $(ENABLE_VIDEO_TRACK) $(ENABLE_WEBGL) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WEB_TIMING) $(ENABLE_WORKERS) $(ENABLE_XSLT);
+FEATURE_DEFINES = $(ENABLE_3D_RENDERING) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ANIMATION_API) $(ENABLE_BLOB) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CSS_FILTERS) $(ENABLE_CSS_GRID_LAYOUT) $(ENABLE_CSS_SHADERS) $(ENABLE_DASHBOARD_SUPPORT) $(ENABLE_DATALIST) $(ENABLE_DATA_TRANSFER_ITEMS) $(ENABLE_DETAILS) $(ENABLE_DEVICE_ORIENTATION) $(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_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_NOTIFICATIONS) $(ENABLE_LINK_PREFETCH) $(ENABLE_LINK_PRERENDER) $(ENABLE_MATHML) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_METER_TAG) $(ENABLE_MICRODATA) $(ENABLE_MUTATION_OBSERVERS) $(ENABLE_NOTIFICATIONS) $(ENABLE_PAGE_VISIBILITY_API) $(ENABLE_PROGRESS_TAG) $(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_NOTIFICATIONS_ONLY) $(ENABLE_TOUCH_ICON_LOADING) $(ENABLE_VIDEO) $(ENABLE_VIDEO_TRACK) $(ENABLE_WEBGL) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WEB_TIMING) $(ENABLE_WORKERS) $(ENABLE_XSLT);
diff --git a/Source/WebKit/mac/Configurations/Version.xcconfig b/Source/WebKit/mac/Configurations/Version.xcconfig
index 011c8bc6a..4404b895a 100644
--- a/Source/WebKit/mac/Configurations/Version.xcconfig
+++ b/Source/WebKit/mac/Configurations/Version.xcconfig
@@ -21,8 +21,8 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-MAJOR_VERSION = 536;
-MINOR_VERSION = 11;
+MAJOR_VERSION = 537;
+MINOR_VERSION = 1;
TINY_VERSION = 0;
FULL_VERSION = $(MAJOR_VERSION).$(MINOR_VERSION);
diff --git a/Source/WebKit/mac/Misc/WebKitErrors.h b/Source/WebKit/mac/Misc/WebKitErrors.h
index e4cbdcc72..ec47fe6a2 100644
--- a/Source/WebKit/mac/Misc/WebKitErrors.h
+++ b/Source/WebKit/mac/Misc/WebKitErrors.h
@@ -56,4 +56,5 @@ enum {
WebKitErrorCannotFindPlugIn = 200,
WebKitErrorCannotLoadPlugIn = 201,
WebKitErrorJavaUnavailable = 202,
+ WebKitErrorInsecurePlugInVersion = 203,
};
diff --git a/Source/WebKit/mac/Plugins/Hosted/WebHostedNetscapePluginView.mm b/Source/WebKit/mac/Plugins/Hosted/WebHostedNetscapePluginView.mm
index 8ad8fe0cf..165a00662 100644
--- a/Source/WebKit/mac/Plugins/Hosted/WebHostedNetscapePluginView.mm
+++ b/Source/WebKit/mac/Plugins/Hosted/WebHostedNetscapePluginView.mm
@@ -392,7 +392,7 @@ extern "C" {
if (_element->renderer() && _element->renderer()->isEmbeddedObject()) {
// FIXME: The renderer could also be a RenderApplet, we should handle that.
RenderEmbeddedObject* renderer = toRenderEmbeddedObject(_element->renderer());
- renderer->setShowsCrashedPluginIndicator();
+ renderer->setPluginUnavailabilityReason(RenderEmbeddedObject::PluginCrashed);
}
_pluginLayer = nil;
diff --git a/Source/WebKit/mac/Plugins/WebBasePluginPackage.h b/Source/WebKit/mac/Plugins/WebBasePluginPackage.h
index a42a82ef3..cf8846410 100644
--- a/Source/WebKit/mac/Plugins/WebBasePluginPackage.h
+++ b/Source/WebKit/mac/Plugins/WebBasePluginPackage.h
@@ -77,7 +77,8 @@ typedef void (*BP_CreatePluginMIMETypesPreferencesFuncPtr)(void);
- (const WebCore::PluginInfo&)pluginInfo;
-- (WTF::String)bundleIdentifier;
+- (String)bundleIdentifier;
+- (String)bundleVersion;
- (BOOL)supportsExtension:(const WTF::String&)extension;
- (BOOL)supportsMIMEType:(const WTF::String&)MIMEType;
diff --git a/Source/WebKit/mac/Plugins/WebBasePluginPackage.mm b/Source/WebKit/mac/Plugins/WebBasePluginPackage.mm
index 1d1409ec8..e4cd8584d 100644
--- a/Source/WebKit/mac/Plugins/WebBasePluginPackage.mm
+++ b/Source/WebKit/mac/Plugins/WebBasePluginPackage.mm
@@ -463,11 +463,24 @@ static inline void swapIntsInHeader(uint32_t* rawData, size_t length)
[pluginDatabases removeObject:database];
}
-- (WTF::String)bundleIdentifier
+- (String)bundleIdentifier
{
return CFBundleGetIdentifier(cfBundle.get());
}
+- (String)bundleVersion
+{
+ CFDictionaryRef infoDictionary = CFBundleGetInfoDictionary(cfBundle.get());
+ if (!infoDictionary)
+ return String();
+
+ CFTypeRef bundleVersionString = CFDictionaryGetValue(infoDictionary, kCFBundleVersionKey);
+ if (!bundleVersionString || CFGetTypeID(bundleVersionString) != CFStringGetTypeID())
+ return String();
+
+ return reinterpret_cast<CFStringRef>(bundleVersionString);
+}
+
@end
@implementation NSArray (WebPluginExtensions)
diff --git a/Source/WebKit/mac/WebCoreSupport/WebChromeClient.h b/Source/WebKit/mac/WebCoreSupport/WebChromeClient.h
index 0576aff83..16041b0cc 100644
--- a/Source/WebKit/mac/WebCoreSupport/WebChromeClient.h
+++ b/Source/WebKit/mac/WebCoreSupport/WebChromeClient.h
@@ -102,8 +102,8 @@ public:
virtual void setStatusbarText(const WTF::String&) OVERRIDE;
virtual void scrollbarsModeDidChange() const OVERRIDE { }
- virtual bool shouldMissingPluginMessageBeButton() const OVERRIDE;
- virtual void missingPluginButtonClicked(WebCore::Element*) const OVERRIDE;
+ virtual bool shouldUnavailablePluginMessageBeButton(WebCore::RenderEmbeddedObject::PluginUnavailabilityReason) const OVERRIDE;
+ virtual void unavailablePluginButtonClicked(WebCore::Element*, WebCore::RenderEmbeddedObject::PluginUnavailabilityReason) const OVERRIDE;
virtual void mouseDidMoveOverElement(const WebCore::HitTestResult&, unsigned modifierFlags) OVERRIDE;
virtual void setToolTip(const WTF::String&, WebCore::TextDirection) OVERRIDE;
diff --git a/Source/WebKit/mac/WebCoreSupport/WebChromeClient.mm b/Source/WebKit/mac/WebCoreSupport/WebChromeClient.mm
index 98f5c5d1b..2ea0d6672 100644
--- a/Source/WebKit/mac/WebCoreSupport/WebChromeClient.mm
+++ b/Source/WebKit/mac/WebCoreSupport/WebChromeClient.mm
@@ -590,13 +590,17 @@ void WebChromeClient::scrollRectIntoView(const IntRect& r) const
// End host window methods.
-bool WebChromeClient::shouldMissingPluginMessageBeButton() const
+bool WebChromeClient::shouldUnavailablePluginMessageBeButton(RenderEmbeddedObject::PluginUnavailabilityReason pluginUnavailabilityReason) const
{
- return [[m_webView UIDelegate] respondsToSelector:@selector(webView:didPressMissingPluginButton:)];
+ if (pluginUnavailabilityReason == RenderEmbeddedObject::PluginMissing)
+ return [[m_webView UIDelegate] respondsToSelector:@selector(webView:didPressMissingPluginButton:)];
+
+ return false;
}
-void WebChromeClient::missingPluginButtonClicked(Element* element) const
+void WebChromeClient::unavailablePluginButtonClicked(Element* element, RenderEmbeddedObject::PluginUnavailabilityReason pluginUnavailabilityReason) const
{
+ ASSERT_UNUSED(pluginUnavailabilityReason, pluginUnavailabilityReason == RenderEmbeddedObject::PluginMissing);
CallUIDelegate(m_webView, @selector(webView:didPressMissingPluginButton:), kit(element));
}
diff --git a/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm b/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm
index b8ac274e9..f787bfb77 100644
--- a/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm
+++ b/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm
@@ -1665,25 +1665,31 @@ PassRefPtr<Widget> WebFrameLoaderClient::createPlugin(const IntSize& size, HTMLP
NSView *view = nil;
if (pluginPackage) {
- if ([pluginPackage isKindOfClass:[WebPluginPackage class]])
- view = pluginView(m_webFrame.get(), (WebPluginPackage *)pluginPackage, attributeKeys, kit(paramValues), baseURL, kit(element), loadManually);
-
+ if (!WKShouldBlockPlugin([pluginPackage bundleIdentifier], [pluginPackage bundleVersion])) {
+ if ([pluginPackage isKindOfClass:[WebPluginPackage class]])
+ view = pluginView(m_webFrame.get(), (WebPluginPackage *)pluginPackage, attributeKeys, kit(paramValues), baseURL, kit(element), loadManually);
+
#if ENABLE(NETSCAPE_PLUGIN_API)
- else if ([pluginPackage isKindOfClass:[WebNetscapePluginPackage class]]) {
- WebBaseNetscapePluginView *pluginView = [[[NETSCAPE_PLUGIN_VIEW alloc]
- initWithFrame:NSMakeRect(0, 0, size.width(), size.height())
- pluginPackage:(WebNetscapePluginPackage *)pluginPackage
- URL:pluginURL
- baseURL:baseURL
- MIMEType:MIMEType
- attributeKeys:attributeKeys
- attributeValues:kit(paramValues)
- loadManually:loadManually
- element:element] autorelease];
-
- return adoptRef(new NetscapePluginWidget(pluginView));
- }
+ else if ([pluginPackage isKindOfClass:[WebNetscapePluginPackage class]]) {
+ WebBaseNetscapePluginView *pluginView = [[[NETSCAPE_PLUGIN_VIEW alloc]
+ initWithFrame:NSMakeRect(0, 0, size.width(), size.height())
+ pluginPackage:(WebNetscapePluginPackage *)pluginPackage
+ URL:pluginURL
+ baseURL:baseURL
+ MIMEType:MIMEType
+ attributeKeys:attributeKeys
+ attributeValues:kit(paramValues)
+ loadManually:loadManually
+ element:element] autorelease];
+
+ return adoptRef(new NetscapePluginWidget(pluginView));
+ }
#endif
+ } else {
+ errorCode = WebKitErrorInsecurePlugInVersion;
+ if (element->renderer()->isEmbeddedObject())
+ toRenderEmbeddedObject(element->renderer())->setPluginUnavailabilityReason(RenderEmbeddedObject::InsecurePluginVersion);
+ }
} else
errorCode = WebKitErrorCannotFindPlugIn;
diff --git a/Source/WebKit/mac/WebCoreSupport/WebInspectorClient.mm b/Source/WebKit/mac/WebCoreSupport/WebInspectorClient.mm
index edee884c9..bd7b600a9 100644
--- a/Source/WebKit/mac/WebCoreSupport/WebInspectorClient.mm
+++ b/Source/WebKit/mac/WebCoreSupport/WebInspectorClient.mm
@@ -47,7 +47,7 @@
#import <WebKitSystemInterface.h>
#import <wtf/PassOwnPtr.h>
-SOFT_LINK_STAGED_FRAMEWORK_OPTIONAL(WebInspector, PrivateFrameworks)
+SOFT_LINK_STAGED_FRAMEWORK_OPTIONAL(WebInspector, PrivateFrameworks, A)
using namespace WebCore;
diff --git a/Source/WebKit/mac/WebCoreSupport/WebSystemInterface.mm b/Source/WebKit/mac/WebCoreSupport/WebSystemInterface.mm
index 06a3ea37c..00f79b546 100644
--- a/Source/WebKit/mac/WebCoreSupport/WebSystemInterface.mm
+++ b/Source/WebKit/mac/WebCoreSupport/WebSystemInterface.mm
@@ -170,21 +170,28 @@ void InitWebCoreSystemInterface(void)
INIT(SetCFURLResponseMIMEType);
INIT(SetMetadataURL);
-
+
+#if PLATFORM(MAC)
+ // FIXME: We should stop using this file in Chromium.
+
#if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
INIT(CreateVMPressureDispatchOnMainQueue);
#endif
-#if PLATFORM(MAC) && !defined(BUILDING_ON_SNOW_LEOPARD) && !defined(BUILDING_ON_LION)
+#if !defined(BUILDING_ON_SNOW_LEOPARD) && !defined(BUILDING_ON_LION)
INIT(GetMacOSXVersionString);
INIT(ExecutableWasLinkedOnOrBeforeLion);
#endif
-#if PLATFORM(MAC) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
+#if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
INIT(CGPathAddRoundedRect);
#endif
-#if PLATFORM(MAC) && !defined(BUILDING_ON_SNOW_LEOPARD) && !defined(BUILDING_ON_LION) && !PLATFORM(IOS)
+#if !defined(BUILDING_ON_SNOW_LEOPARD)
+ INIT(CFURLRequestAllowAllPostCaching);
+#endif
+
+#if !defined(BUILDING_ON_SNOW_LEOPARD) && !defined(BUILDING_ON_LION) && !PLATFORM(IOS)
INIT(FilterIsManagedSession);
INIT(FilterCreateInstance);
INIT(FilterRelease);
@@ -192,5 +199,6 @@ void InitWebCoreSystemInterface(void)
INIT(FilterAddData);
INIT(FilterDataComplete);
#endif
+#endif
didInit = true;
}
diff --git a/Source/WebKit/mac/WebKit.order b/Source/WebKit/mac/WebKit.order
index 514881484..1a1eb0c72 100644
--- a/Source/WebKit/mac/WebKit.order
+++ b/Source/WebKit/mac/WebKit.order
@@ -1221,8 +1221,6 @@ _WKExecutableWasLinkedOnOrBeforeSnowLeopard
__ZNK7WebCore12ChromeClient29dispatchViewportDataDidChangeERKNS_17ViewportArgumentsE
-[WebView(WebPrivate) setFrameSize:]
-[WebFrame(WebKitDebug) renderTreeAsExternalRepresentationForPrinting:]
--[WebFrame(WebPrivate) _suspendAnimations]
--[WebFrame(WebPrivate) _resumeAnimations]
+[WebView(WebPrivate) _pointingHandCursor]
_WKGetCFURLResponseURL
_WKGetCFURLResponseHTTPResponse
diff --git a/Source/WebKit/mac/WebView/WebFrame.mm b/Source/WebKit/mac/WebView/WebFrame.mm
index 02f4a3c68..416bd7dfe 100644
--- a/Source/WebKit/mac/WebView/WebFrame.mm
+++ b/Source/WebKit/mac/WebView/WebFrame.mm
@@ -998,24 +998,6 @@ static inline WebDataSource *dataSource(DocumentLoader* loader)
return controller->numberOfActiveAnimations(frame->document());
}
-- (void) _suspendAnimations
-{
- Frame* frame = core(self);
- if (!frame)
- return;
-
- frame->animation()->suspendAnimations();
-}
-
-- (void) _resumeAnimations
-{
- Frame* frame = core(self);
- if (!frame)
- return;
-
- frame->animation()->resumeAnimations();
-}
-
- (void)_replaceSelectionWithFragment:(DOMDocumentFragment *)fragment selectReplacement:(BOOL)selectReplacement smartReplace:(BOOL)smartReplace matchStyle:(BOOL)matchStyle
{
if (_private->coreFrame->selection()->isNone() || !fragment)
diff --git a/Source/WebKit/mac/WebView/WebFramePrivate.h b/Source/WebKit/mac/WebView/WebFramePrivate.h
index cb521c3ea..9dea7e1b4 100644
--- a/Source/WebKit/mac/WebView/WebFramePrivate.h
+++ b/Source/WebKit/mac/WebView/WebFramePrivate.h
@@ -107,10 +107,6 @@ typedef enum {
// Returns the total number of currently running animations (includes both CSS transitions and CSS animations).
- (unsigned)_numberOfActiveAnimations;
-// Suspend and resume animations (includes both CSS transitions and CSS animations).
-- (void)_suspendAnimations;
-- (void)_resumeAnimations;
-
- (void)_replaceSelectionWithFragment:(DOMDocumentFragment *)fragment selectReplacement:(BOOL)selectReplacement smartReplace:(BOOL)smartReplace matchStyle:(BOOL)matchStyle;
- (void)_replaceSelectionWithText:(NSString *)text selectReplacement:(BOOL)selectReplacement smartReplace:(BOOL)smartReplace;
- (void)_replaceSelectionWithMarkupString:(NSString *)markupString baseURLString:(NSString *)baseURLString selectReplacement:(BOOL)selectReplacement smartReplace:(BOOL)smartReplace;
diff --git a/Source/WebKit/qt/Api/qwebpage.cpp b/Source/WebKit/qt/Api/qwebpage.cpp
index e85dfd282..2e330acff 100644
--- a/Source/WebKit/qt/Api/qwebpage.cpp
+++ b/Source/WebKit/qt/Api/qwebpage.cpp
@@ -3407,7 +3407,7 @@ void QWebPage::updatePositionDependentActions(const QPoint &pos)
\inmodule QtWebKit
- \sa QWebPage::extension() QWebPage::ExtensionReturn
+ \sa QWebPage::extension(), QWebPage::ExtensionReturn
*/
@@ -3418,7 +3418,7 @@ void QWebPage::updatePositionDependentActions(const QPoint &pos)
\inmodule QtWebKit
- \sa QWebPage::extension() QWebPage::ExtensionOption
+ \sa QWebPage::extension(), QWebPage::ExtensionOption
*/
/*!
@@ -3434,7 +3434,7 @@ void QWebPage::updatePositionDependentActions(const QPoint &pos)
The error itself is reported by an error \a domain, the \a error code as well as \a errorString.
- \sa QWebPage::extension() QWebPage::ErrorPageExtensionReturn
+ \sa QWebPage::extension(), QWebPage::ErrorPageExtensionReturn
*/
/*!
@@ -3481,7 +3481,7 @@ void QWebPage::updatePositionDependentActions(const QPoint &pos)
External objects such as stylesheets or images referenced in the HTML are located relative to
\a baseUrl.
- \sa QWebPage::extension() QWebPage::ErrorPageExtensionOption, QString::toUtf8()
+ \sa QWebPage::extension(), QWebPage::ErrorPageExtensionOption, QString::toUtf8()
*/
/*!
@@ -3524,7 +3524,7 @@ void QWebPage::updatePositionDependentActions(const QPoint &pos)
The ChooseMultipleFilesExtensionOption class holds the frame originating the request
and the suggested filenames which might be provided.
- \sa QWebPage::extension() QWebPage::chooseFile(), QWebPage::ChooseMultipleFilesExtensionReturn
+ \sa QWebPage::extension(), QWebPage::chooseFile(), QWebPage::ChooseMultipleFilesExtensionReturn
*/
/*!
@@ -3553,7 +3553,7 @@ void QWebPage::updatePositionDependentActions(const QPoint &pos)
The ChooseMultipleFilesExtensionReturn class holds the filenames selected by the user
when the extension is invoked.
- \sa QWebPage::extension() QWebPage::ChooseMultipleFilesExtensionOption
+ \sa QWebPage::extension(), QWebPage::ChooseMultipleFilesExtensionOption
*/
/*!
diff --git a/Source/WebKit/qt/Api/qwebsettings.cpp b/Source/WebKit/qt/Api/qwebsettings.cpp
index ca264c8af..4e01836f7 100644
--- a/Source/WebKit/qt/Api/qwebsettings.cpp
+++ b/Source/WebKit/qt/Api/qwebsettings.cpp
@@ -1174,7 +1174,11 @@ void QWebSettings::enablePersistentStorage(const QString& path)
#if ENABLE(NETSCAPE_PLUGIN_METADATA_CACHE)
// All applications can share the common QtWebkit cache file(s).
// Path is not configurable and uses QDesktopServices::CacheLocation by default.
+#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
+ QString cachePath = QStandardPaths::writableLocation(QStandardPaths::CacheLocation);
+#else
QString cachePath = QDesktopServices::storageLocation(QDesktopServices::CacheLocation);
+#endif
WebCore::makeAllDirectories(cachePath);
QFileInfo info(cachePath);
diff --git a/Source/WebKit/qt/ChangeLog b/Source/WebKit/qt/ChangeLog
index 9bb4acc99..6881af4a1 100644
--- a/Source/WebKit/qt/ChangeLog
+++ b/Source/WebKit/qt/ChangeLog
@@ -1,3 +1,60 @@
+2012-05-10 Gyuyoung Kim <gyuyoung.kim@samsung.com>
+
+ Move resumeAnimations to use Internals interface
+ https://bugs.webkit.org/show_bug.cgi?id=86063
+
+ Reviewed by Alexey Proskuryakov.
+
+ Remove resumeAnimations functions, because it is able to work in the
+ cross-port way through the Internals interface.
+
+ * WebCoreSupport/DumpRenderTreeSupportQt.cpp:
+ * WebCoreSupport/DumpRenderTreeSupportQt.h:
+
+2012-05-10 Marius Storm-Olsen <marius.storm-olsen@nokia.com>
+
+ [Qt] Fix \sa usage in documentation
+
+ Ensure comma between elements (6 missing).
+
+ Reviewed by Tor Arne Vestbø.
+
+ * Api/qwebpage.cpp:
+
+2012-05-09 Gyuyoung Kim <gyuyoung.kim@samsung.com>
+
+ Move suspendAnimations to use Internals interface.
+ https://bugs.webkit.org/show_bug.cgi?id=85986
+
+ Reviewed by Ryosuke Niwa.
+
+ Remove suspendAnimations functions, because it is able to work in the
+ cross-port way through the Internals interface.
+
+ * WebCoreSupport/DumpRenderTreeSupportQt.cpp:
+ * WebCoreSupport/DumpRenderTreeSupportQt.h:
+
+2012-05-08 Balazs Kelemen <kbalazs@webkit.org>
+
+ [Qt] X11 plugins need to be reworked for Qt5+WK1
+ https://bugs.webkit.org/show_bug.cgi?id=80691
+
+ Reviewed by Simon Hausmann.
+
+ * Api/qwebsettings.cpp:
+ (QWebSettings::enablePersistentStorage):
+ Build fix for Qt5.
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::createPlugin):
+ Inject the wmode parameter for flash so it will
+ work in windowless, non-transparent mode which
+ is the only one we support currently.
+ * WebCoreSupport/PageClientQt.cpp:
+ (WebCore):
+ (WebCore::QWebPageClient::ownerWindow):
+ Added a getter for the top level window so the PluginView
+ can get it without calling into QtWidgets code.
+
2012-05-06 Gyuyoung Kim <gyuyoung.kim@samsung.com>
Convert isPageBoxVisible to use Internals interface.
diff --git a/Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp b/Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp
index f55e25667..2d4fb5057 100644
--- a/Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp
+++ b/Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp
@@ -384,32 +384,6 @@ int DumpRenderTreeSupportQt::numberOfActiveAnimations(QWebFrame *frame)
return controller->numberOfActiveAnimations(coreFrame->document());
}
-void DumpRenderTreeSupportQt::suspendAnimations(QWebFrame *frame)
-{
- Frame* coreFrame = QWebFramePrivate::core(frame);
- if (!coreFrame)
- return;
-
- AnimationController* controller = coreFrame->animation();
- if (!controller)
- return;
-
- controller->suspendAnimations();
-}
-
-void DumpRenderTreeSupportQt::resumeAnimations(QWebFrame *frame)
-{
- Frame* coreFrame = QWebFramePrivate::core(frame);
- if (!coreFrame)
- return;
-
- AnimationController* controller = coreFrame->animation();
- if (!controller)
- return;
-
- controller->resumeAnimations();
-}
-
void DumpRenderTreeSupportQt::clearFrameName(QWebFrame* frame)
{
Frame* coreFrame = QWebFramePrivate::core(frame);
diff --git a/Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h b/Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h
index eadc1af35..373f60e70 100644
--- a/Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h
+++ b/Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h
@@ -141,8 +141,6 @@ public:
static void clearFrameName(QWebFrame* frame);
static void overwritePluginDirectories();
static int numberOfActiveAnimations(QWebFrame*);
- static void suspendAnimations(QWebFrame*);
- static void resumeAnimations(QWebFrame*);
static int numberOfPages(QWebFrame* frame, float width, float height);
static int pageNumberForElementById(QWebFrame* frame, const QString& id, float width, float height);
static bool hasDocumentElement(QWebFrame* frame);
diff --git a/Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp b/Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
index 85b609185..c23311daa 100644
--- a/Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
+++ b/Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
@@ -1603,9 +1603,14 @@ PassRefPtr<Widget> FrameLoaderClientQt::createPlugin(const IntSize& pluginSize,
Vector<String> params = paramNames;
Vector<String> values = paramValues;
if (mimeType == "application/x-shockwave-flash") {
+#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
+ const bool shouldInjectWmode = true;
+#else
+ // Inject wmode=opaque when there is no client or the client is not a QWebView.
QWebPageClient* client = m_webFrame->page()->d->client.get();
- const bool isQWebView = client && qobject_cast<QWidget*>(client->pluginParent());
- if (!isQWebView) {
+ const bool shouldInjectWmode = !(client && qobject_cast<QWidget*>(client->pluginParent()));
+#endif
+ if (shouldInjectWmode) {
// Inject wmode=opaque when there is no client or the client is not a QWebView.
size_t wmodeIndex = params.find("wmode");
if (wmodeIndex == WTF::notFound) {
diff --git a/Source/WebKit/qt/WebCoreSupport/PageClientQt.cpp b/Source/WebKit/qt/WebCoreSupport/PageClientQt.cpp
index 6f96ce1ba..ed61d1f96 100644
--- a/Source/WebKit/qt/WebCoreSupport/PageClientQt.cpp
+++ b/Source/WebKit/qt/WebCoreSupport/PageClientQt.cpp
@@ -69,6 +69,20 @@ static void createPlatformGraphicsContext3DFromWidget(QWidget* widget, PlatformG
#include "texmap/TextureMapperLayer.h"
#endif
+#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
+QWindow* QWebPageClient::ownerWindow() const
+{
+ QWidget* widget = ownerWidget();
+ if (!widget)
+ return 0;
+ if (QWindow *window = widget->windowHandle())
+ return window;
+ if (const QWidget *nativeParent = widget->nativeParentWidget())
+ return nativeParent->windowHandle();
+ return 0;
+}
+#endif
+
namespace WebCore {
#if USE(ACCELERATED_COMPOSITING) && USE(TEXTURE_MAPPER)
diff --git a/Source/WebKit/win/ChangeLog b/Source/WebKit/win/ChangeLog
index 56dea8721..c2a96b080 100644
--- a/Source/WebKit/win/ChangeLog
+++ b/Source/WebKit/win/ChangeLog
@@ -1,3 +1,62 @@
+2012-05-10 Gyuyoung Kim <gyuyoung.kim@samsung.com>
+
+ Move resumeAnimations to use Internals interface
+ https://bugs.webkit.org/show_bug.cgi?id=86063
+
+ Reviewed by Alexey Proskuryakov.
+
+ Remove resumeAnimations functions, because it is able to work in the
+ cross-port way through the Internals interface.
+
+ * Interfaces/IWebFramePrivate.idl:
+ * WebFrame.cpp:
+ * WebFrame.h:
+
+2012-05-10 Anders Carlsson <andersca@apple.com>
+
+ Rename the missing plug-in indicator to the unavailable plug-in indicator
+ https://bugs.webkit.org/show_bug.cgi?id=86136
+
+ Reviewed by Sam Weinig.
+
+ * WebCoreSupport/WebChromeClient.cpp:
+ (WebChromeClient::shouldUnavailablePluginMessageBeButton):
+ (WebChromeClient::unavailablePluginButtonClicked):
+ * WebCoreSupport/WebChromeClient.h:
+ (WebChromeClient):
+
+2012-05-09 Gyuyoung Kim <gyuyoung.kim@samsung.com>
+
+ Move suspendAnimations to use Internals interface.
+ https://bugs.webkit.org/show_bug.cgi?id=85986
+
+ Reviewed by Ryosuke Niwa.
+
+ Remove suspendAnimations functions, because it is able to work in the
+ cross-port way through the Internals interface.
+
+ * Interfaces/IWebFramePrivate.idl:
+ * WebFrame.cpp:
+ * WebFrame.h:
+
+2012-05-07 Julien Chaffraix <jchaffraix@webkit.org>
+
+ Refactor windowClipRectForLayer to remove the explicit RenderLayer dependency
+ https://bugs.webkit.org/show_bug.cgi?id=84090
+
+ Reviewed by David Hyatt.
+
+ * WebCoreSupport/EmbeddedWidget.cpp:
+ (EmbeddedWidget::windowClipRect):
+ Updated after windowClipRectForLayer name and signature change.
+
+ * WebCoreSupport/EmbeddedWidget.h:
+ (EmbeddedWidget):
+ (EmbeddedWidget::EmbeddedWidget):
+ Updated the internal DOM pointer to be an HTMLPlugInElement
+ as it was what was passed in anyway. Also fixed some style
+ issues detected by our tools.
+
2012-05-05 Dean Jackson <dino@apple.com>
Add new Setting/Preference to disable requestAnimationFrame
diff --git a/Source/WebKit/win/Interfaces/IWebFramePrivate.idl b/Source/WebKit/win/Interfaces/IWebFramePrivate.idl
index cb7a46997..dea1123b0 100644
--- a/Source/WebKit/win/Interfaces/IWebFramePrivate.idl
+++ b/Source/WebKit/win/Interfaces/IWebFramePrivate.idl
@@ -110,9 +110,6 @@ interface IWebFramePrivate : IUnknown
HRESULT renderTreeAsExternalRepresentation([in] BOOL forPrinting, [out, retval] BSTR* result);
- HRESULT suspendAnimations();
- HRESULT resumeAnimations();
-
HRESULT loadPlainTextString([in] BSTR string, [in] BSTR url);
HRESULT clearOpener();
diff --git a/Source/WebKit/win/WebCoreSupport/EmbeddedWidget.cpp b/Source/WebKit/win/WebCoreSupport/EmbeddedWidget.cpp
index fb2b564fe..00442291c 100644
--- a/Source/WebKit/win/WebCoreSupport/EmbeddedWidget.cpp
+++ b/Source/WebKit/win/WebCoreSupport/EmbeddedWidget.cpp
@@ -27,8 +27,8 @@
#include "EmbeddedWidget.h"
#include <WebCore/Document.h>
-#include <WebCore/Element.h>
#include <WebCore/FrameView.h>
+#include <WebCore/HTMLPlugInElement.h>
#include <WebCore/RenderObject.h>
#include "MemoryStream.h"
@@ -37,7 +37,7 @@
using namespace WebCore;
-PassRefPtr<EmbeddedWidget> EmbeddedWidget::create(IWebEmbeddedView* view, Element* element, HWND parentWindow, const IntSize& size)
+PassRefPtr<EmbeddedWidget> EmbeddedWidget::create(IWebEmbeddedView* view, HTMLPlugInElement* element, HWND parentWindow, const IntSize& size)
{
RefPtr<EmbeddedWidget> widget = adoptRef(new EmbeddedWidget(view, element));
@@ -167,9 +167,8 @@ IntRect EmbeddedWidget::windowClipRect() const
IntRect clipRect(m_windowRect);
// Take our element and get the clip rect from the enclosing layer and frame view.
- RenderLayer* layer = m_element->renderer()->enclosingLayer();
FrameView* parentView = m_element->document()->view();
- clipRect.intersect(parentView->windowClipRectForLayer(layer, true));
+ clipRect.intersect(parentView->windowClipRectForFrameOwner(m_element, true));
return clipRect;
}
diff --git a/Source/WebKit/win/WebCoreSupport/EmbeddedWidget.h b/Source/WebKit/win/WebCoreSupport/EmbeddedWidget.h
index abfe76ed4..a5276bf57 100644
--- a/Source/WebKit/win/WebCoreSupport/EmbeddedWidget.h
+++ b/Source/WebKit/win/WebCoreSupport/EmbeddedWidget.h
@@ -32,19 +32,19 @@
#include <WebCore/PluginView.h>
namespace WebCore {
- class Element;
- class IntSize;
+class HTMLPlugInElement;
+class IntSize;
}
interface IWebEmbeddedView;
class EmbeddedWidget : public WebCore::Widget, public WebCore::PluginManualLoader {
public:
- static PassRefPtr<EmbeddedWidget> create(IWebEmbeddedView*, WebCore::Element* element, HWND parentWindow, const WebCore::IntSize&);
+ static PassRefPtr<EmbeddedWidget> create(IWebEmbeddedView*, WebCore::HTMLPlugInElement*, HWND parentWindow, const WebCore::IntSize&);
~EmbeddedWidget();
private:
- EmbeddedWidget(IWebEmbeddedView* view, WebCore::Element* element)
+ EmbeddedWidget(IWebEmbeddedView* view, WebCore::HTMLPlugInElement* element)
: m_view(view)
, m_element(element)
, m_window(0)
@@ -73,7 +73,7 @@ private:
virtual void detachFromWindow();
COMPtr<IWebEmbeddedView> m_view;
- WebCore::Element* m_element;
+ WebCore::HTMLPlugInElement* m_element;
HWND m_window;
bool m_isVisible;
diff --git a/Source/WebKit/win/WebCoreSupport/WebChromeClient.cpp b/Source/WebKit/win/WebCoreSupport/WebChromeClient.cpp
index 4435b48d6..381dbb021 100644
--- a/Source/WebKit/win/WebCoreSupport/WebChromeClient.cpp
+++ b/Source/WebKit/win/WebCoreSupport/WebChromeClient.cpp
@@ -539,8 +539,11 @@ void WebChromeClient::mouseDidMoveOverElement(const HitTestResult& result, unsig
uiDelegate->mouseDidMoveOverElement(m_webView, element.get(), modifierFlags);
}
-bool WebChromeClient::shouldMissingPluginMessageBeButton() const
+bool WebChromeClient::shouldUnavailablePluginMessageBeButton(RenderEmbeddedObject::PluginUnavailabilityReason pluginUnavailabilityReason) const
{
+ if (pluginUnavailabilityReason != RenderEmbeddedObject::PluginMissing)
+ return false;
+
COMPtr<IWebUIDelegate> uiDelegate;
if (FAILED(m_webView->uiDelegate(&uiDelegate)))
return false;
@@ -551,8 +554,10 @@ bool WebChromeClient::shouldMissingPluginMessageBeButton() const
return uiDelegatePrivate3;
}
-void WebChromeClient::missingPluginButtonClicked(Element* element) const
+void WebChromeClient::unavailablePluginButtonClicked(Element* element, RenderEmbeddedObject::PluginUnavailabilityReason pluginUnavailabilityReason) const
{
+ ASSERT_UNUSED(pluginUnavailabilityReason, pluginUnavailabilityReason == RenderEmbeddedObject::PluginMissing);
+
COMPtr<IWebUIDelegate> uiDelegate;
if (FAILED(m_webView->uiDelegate(&uiDelegate)))
return;
diff --git a/Source/WebKit/win/WebCoreSupport/WebChromeClient.h b/Source/WebKit/win/WebCoreSupport/WebChromeClient.h
index f22d6f3ab..9a5af3893 100644
--- a/Source/WebKit/win/WebCoreSupport/WebChromeClient.h
+++ b/Source/WebKit/win/WebCoreSupport/WebChromeClient.h
@@ -106,8 +106,8 @@ public:
virtual void scrollbarsModeDidChange() const { }
virtual void mouseDidMoveOverElement(const WebCore::HitTestResult&, unsigned modifierFlags);
- virtual bool shouldMissingPluginMessageBeButton() const;
- virtual void missingPluginButtonClicked(WebCore::Element*) const;
+ virtual bool shouldUnavailablePluginMessageBeButton(WebCore::RenderEmbeddedObject::PluginUnavailabilityReason) const;
+ virtual void unavailablePluginButtonClicked(WebCore::Element*, WebCore::RenderEmbeddedObject::PluginUnavailabilityReason) const;
virtual void setToolTip(const WTF::String&, WebCore::TextDirection);
diff --git a/Source/WebKit/win/WebFrame.cpp b/Source/WebKit/win/WebFrame.cpp
index 1a4b676a0..3a3715b3b 100644
--- a/Source/WebKit/win/WebFrame.cpp
+++ b/Source/WebKit/win/WebFrame.cpp
@@ -1311,26 +1311,6 @@ HRESULT WebFrame::numberOfActiveAnimations(UINT* number)
return S_OK;
}
-HRESULT WebFrame::suspendAnimations()
-{
- Frame* frame = core(this);
- if (!frame)
- return E_FAIL;
-
- frame->animation()->suspendAnimations();
- return S_OK;
-}
-
-HRESULT WebFrame::resumeAnimations()
-{
- Frame* frame = core(this);
- if (!frame)
- return E_FAIL;
-
- frame->animation()->resumeAnimations();
- return S_OK;
-}
-
HRESULT WebFrame::isDisplayingStandaloneImage(BOOL* result)
{
if (!result)
diff --git a/Source/WebKit/win/WebFrame.h b/Source/WebKit/win/WebFrame.h
index c7ddfe860..b63438b50 100644
--- a/Source/WebKit/win/WebFrame.h
+++ b/Source/WebKit/win/WebFrame.h
@@ -260,8 +260,6 @@ public:
virtual HRESULT STDMETHODCALLTYPE pauseAnimation(BSTR animationName, IDOMNode*, double secondsFromNow, BOOL* animationWasRunning);
virtual HRESULT STDMETHODCALLTYPE pauseTransition(BSTR propertyName, IDOMNode*, double secondsFromNow, BOOL* transitionWasRunning);
virtual HRESULT STDMETHODCALLTYPE numberOfActiveAnimations(UINT*);
- virtual HRESULT STDMETHODCALLTYPE suspendAnimations();
- virtual HRESULT STDMETHODCALLTYPE resumeAnimations();
virtual HRESULT STDMETHODCALLTYPE loadPlainTextString(BSTR string, BSTR url);
virtual HRESULT STDMETHODCALLTYPE isDisplayingStandaloneImage(BOOL*);
diff --git a/Source/WebKit2/ChangeLog b/Source/WebKit2/ChangeLog
index 03d10950c..3abd478aa 100644
--- a/Source/WebKit2/ChangeLog
+++ b/Source/WebKit2/ChangeLog
@@ -1,3 +1,701 @@
+2012-05-10 MORITA Hajime <morrita@google.com>
+
+ ElementShadow should minimize the usage of "ShadowRoot" name
+ https://bugs.webkit.org/show_bug.cgi?id=85970
+
+ Reviewed by Dimitri Glazkov.
+
+ Removed symbols which no longer exists
+
+ * win/WebKit2.def:
+ * win/WebKit2CFLite.def:
+
+2012-05-10 Gyuyoung Kim <gyuyoung.kim@samsung.com>
+
+ Move resumeAnimations to use Internals interface
+ https://bugs.webkit.org/show_bug.cgi?id=86063
+
+ Reviewed by Alexey Proskuryakov.
+
+ * win/WebKit2.def: Add a symbol filter for resumeAnimations.
+
+2012-05-10 Anders Carlsson <andersca@apple.com>
+
+ PDF files won't scroll in Safari when using Adobe plug-in
+ https://bugs.webkit.org/show_bug.cgi?id=86167
+ <rdar://problem/11389719>
+
+ Reviewed by Sam Weinig.
+
+ Add a way to whitelist plug-ins that we know will process wheel events correctly. Add the new
+ Adobe Reader plug-in to this whitelist. Only send wheel events to plug-ins that are in the whitelist.
+
+ * PluginProcess/PluginControllerProxy.cpp:
+ (WebKit::PluginControllerProxy::wantsWheelEvents):
+ (WebKit):
+ * PluginProcess/PluginControllerProxy.h:
+ (PluginControllerProxy):
+ * PluginProcess/WebProcessConnection.cpp:
+ (WebKit::WebProcessConnection::createPlugin):
+ * PluginProcess/WebProcessConnection.h:
+ (WebProcessConnection):
+ * PluginProcess/WebProcessConnection.messages.in:
+ * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
+ (WebKit::NetscapePluginModule::determineQuirks):
+ * Shared/Plugins/PluginQuirks.h:
+ * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
+ (WebKit::NetscapePlugin::wantsWheelEvents):
+ (WebKit):
+ * WebProcess/Plugins/Netscape/NetscapePlugin.h:
+ (NetscapePlugin):
+ * WebProcess/Plugins/PDF/BuiltInPDFView.h:
+ (BuiltInPDFView):
+ * WebProcess/Plugins/PDF/BuiltInPDFView.mm:
+ (WebKit::BuiltInPDFView::wantsWheelEvents):
+ (WebKit):
+ * WebProcess/Plugins/Plugin.h:
+ (Plugin):
+ * WebProcess/Plugins/PluginProxy.cpp:
+ (WebKit::PluginProxy::PluginProxy):
+ (WebKit::PluginProxy::initialize):
+ (WebKit::PluginProxy::wantsWheelEvents):
+ (WebKit):
+ * WebProcess/Plugins/PluginProxy.h:
+ (PluginProxy):
+ * WebProcess/Plugins/PluginView.cpp:
+ (WebKit::PluginView::initializePlugin):
+ (WebKit::PluginView::wantsWheelEvents):
+ (WebKit):
+ (WebKit::PluginView::handleEvent):
+ * WebProcess/Plugins/PluginView.h:
+ (PluginView):
+
+2012-05-10 Anders Carlsson <andersca@apple.com>
+
+ WebKit2: Add a way to blacklist specific plug-ins/plug-in versions
+ https://bugs.webkit.org/show_bug.cgi?id=86164
+ <rdar://problem/9551196>
+
+ Reviewed by Sam Weinig.
+
+ * Shared/API/c/WKError.h:
+ Add kWKErrorCodeInsecurePlugInVersion error code.
+
+ * Shared/APIClientTraits.cpp:
+ Update now that didFailToInitializePlugin is deprecated.
+
+ * UIProcess/API/C/WKPage.h:
+ Deprecate didFailToInitializePlugin and replace it with the more generic pluginDidFail.
+ Also, deprecate missingPluginButtonClicked and replace it with unavailablePluginButtonClicked.
+
+ * UIProcess/Plugins/PluginInfoStore.cpp:
+ (WebKit::PluginInfoStore::shouldBlockPlugin):
+ Non-Mac version, always return false.
+
+ * UIProcess/Plugins/mac/PluginInfoStoreMac.mm:
+ (WebKit::PluginInfoStore::shouldBlockPlugin):
+ Call WKShouldBlockPlugin.
+
+ * UIProcess/WebContext.cpp:
+ (WebKit::WebContext::getPluginPath):
+ Check if the plug-in should be blocked.
+
+ * UIProcess/WebContext.messages.in:
+ GetPluginPath now takes an additional out parameter, a boolean that determines whether the plug-in
+ should be blocked from loading or not.
+
+ * UIProcess/WebLoaderClient.cpp:
+ (WebKit::WebLoaderClient::didFailToInitializePlugin):
+ Call m_client.pluginDidFail.
+
+ (WebKit::WebLoaderClient::didBlockInsecurePluginVersion):
+ Ditto.
+
+ * UIProcess/WebPageProxy.cpp:
+ (WebKit::WebPageProxy::unavailablePluginButtonClicked):
+ Call the loader client.
+
+ (WebKit::WebPageProxy::didBlockInsecurePluginVersion):
+ Ditto.
+
+ * UIProcess/WebPageProxy.messages.in:
+ Rename MissingPluginButtonClicked to UnavailablePluginButtonClicked and add a new DidBlockInsecurePluginVersion message.
+
+ * UIProcess/WebUIClient.cpp:
+ (WebKit::WebUIClient::unavailablePluginButtonClicked):
+ Call missingPluginButtonClicked and unavailablePluginButtonClicked.
+
+ * WebProcess/WebCoreSupport/WebChromeClient.cpp:
+ (WebKit::WebChromeClient::shouldUnavailablePluginMessageBeButton):
+ (WebKit::WebChromeClient::unavailablePluginButtonClicked):
+ Handle RenderEmbeddedObject::InsecurePluginVersion.
+
+ * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
+ (WebKit::WebFrameLoaderClient::createPlugin):
+ WebPage::createPlugin now takes the plug-in element.
+
+ * WebProcess/WebPage/WebPage.cpp:
+ (WebKit::WebPage::createPlugin):
+ If the plug-in is blocked, set the appropriate unavailability reason.
+
+ * WebProcess/WebProcess.cpp:
+ (WebKit::canPluginHandleResponse):
+ Update now that GetPluginPath returns a blocked parameter as well.
+
+2012-05-10 Anders Carlsson <andersca@apple.com>
+
+ Rename the missing plug-in indicator to the unavailable plug-in indicator
+ https://bugs.webkit.org/show_bug.cgi?id=86136
+
+ Reviewed by Sam Weinig.
+
+ Update for WebCore changes.
+
+ * WebProcess/Plugins/PluginView.cpp:
+ (WebKit::PluginView::pluginProcessCrashed):
+ * WebProcess/WebCoreSupport/WebChromeClient.cpp:
+ (WebKit::WebChromeClient::shouldUnavailablePluginMessageBeButton):
+ (WebKit::WebChromeClient::unavailablePluginButtonClicked):
+ * WebProcess/WebCoreSupport/WebChromeClient.h:
+ (WebChromeClient):
+
+2012-05-10 Carlos Garcia Campos <cgarcia@igalia.com>
+
+ [GTK] Test /webkit2/WebKitWebView/resources times out
+ https://bugs.webkit.org/show_bug.cgi?id=86088
+
+ Reviewed by Martin Robinson.
+
+ * UIProcess/API/gtk/tests/TestResources.cpp:
+ (testWebViewResources): Use webkit_web_view_reload_bypass_cache()
+ instead of webkit_web_view_reload() to make sure resources are not
+ read from the cache.
+
+2012-05-10 Simon Pena <spena@igalia.com>
+
+ [GTK] WK2 misses WebKitSettings for media playback requiring user gestures and inline playback
+ https://bugs.webkit.org/show_bug.cgi?id=85999
+
+ Reviewed by Martin Robinson.
+
+ Expose WebKitSettings for media playback requiring user gesture and
+ media playback allows inline to GTK side.
+
+ This adds two properties (mediaPlaybackRequiresUserGesture and
+ mediaPlaybackAllowsInline), with their setters and getters, to
+ WebKitSettings. It also updates the WebKitSettings tests so these
+ two properties are checked, and includes the new methods in the
+ documentation.
+
+ * UIProcess/API/gtk/WebKitSettings.cpp: added the new properties and
+ their accessors
+ (webKitSettingsSetProperty):
+ (webKitSettingsGetProperty):
+ (webkit_settings_class_init):
+ (webkit_settings_set_media_playback_requires_user_gesture):
+ (webkit_settings_get_media_playback_requires_user_gesture):
+ (webkit_settings_set_media_playback_allows_inline):
+ (webkit_settings_get_media_playback_allows_inline):
+ * UIProcess/API/gtk/WebKitSettings.h:
+ * UIProcess/API/gtk/docs/webkit2gtk-sections.txt: included the new
+ methods in the documentation
+ * UIProcess/API/gtk/tests/TestWebKitSettings.cpp: tested the newly
+ added methods
+ (testWebKitSettings):
+
+2012-05-10 Simon Pena <spena@igalia.com>
+
+ [GTK] Missing field initializers for WKPageLoaderClient
+ https://bugs.webkit.org/show_bug.cgi?id=86005
+
+ Reviewed by Martin Robinson.
+
+ Initialize willGoToBackForwardListItem and
+ interactionOccurredWhileProcessUnresponsive fields of
+ WKPageLoaderClient.
+
+ * UIProcess/API/gtk/WebKitLoaderClient.cpp:
+ (attachLoaderClientToView):
+
+2012-05-10 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ [Qt] Double tap to zoom is considered a user interaction
+ https://bugs.webkit.org/show_bug.cgi?id=86094
+
+ Reviewed by Simon Hausmann.
+
+ This makes it so that the content size change doesn't change scale
+ after a double tap to zoom.
+
+ * UIProcess/qt/QtViewportInteractionEngine.cpp:
+ (WebKit::QtViewportInteractionEngine::zoomToAreaGestureEnded):
+
+2012-05-10 Kent Hansen <kent.hansen@nokia.com>
+
+ [Qt] Rename QDeclarative* to QQml*
+ https://bugs.webkit.org/show_bug.cgi?id=86089
+
+ Reviewed by Simon Hausmann.
+
+ The QtDeclarative module was deprecated in favor of QtQml.
+
+ * Target.pri:
+ * UIProcess/API/qt/qquickwebview.cpp:
+ (QQuickWebViewPrivate::_q_onReceivedResponseFromDownload):
+ (QQuickWebViewExperimental::alertDialog):
+ (QQuickWebViewExperimental::setAlertDialog):
+ (QQuickWebViewExperimental::confirmDialog):
+ (QQuickWebViewExperimental::setConfirmDialog):
+ (QQuickWebViewExperimental::promptDialog):
+ (QQuickWebViewExperimental::setPromptDialog):
+ (QQuickWebViewExperimental::authenticationDialog):
+ (QQuickWebViewExperimental::setAuthenticationDialog):
+ (QQuickWebViewExperimental::proxyAuthenticationDialog):
+ (QQuickWebViewExperimental::setProxyAuthenticationDialog):
+ (QQuickWebViewExperimental::certificateVerificationDialog):
+ (QQuickWebViewExperimental::setCertificateVerificationDialog):
+ (QQuickWebViewExperimental::itemSelector):
+ (QQuickWebViewExperimental::setItemSelector):
+ (QQuickWebViewExperimental::filePicker):
+ (QQuickWebViewExperimental::setFilePicker):
+ (QQuickWebViewExperimental::databaseQuotaDialog):
+ (QQuickWebViewExperimental::setDatabaseQuotaDialog):
+ (QQuickWebViewExperimental::schemeDelegates_At):
+ (QQuickWebViewExperimental::schemeDelegates_Append):
+ (QQuickWebViewExperimental::schemeDelegates_Count):
+ (QQuickWebViewExperimental::schemeDelegates_Clear):
+ (QQuickWebViewExperimental::schemeDelegates):
+ * UIProcess/API/qt/qquickwebview_p.h:
+ * UIProcess/API/qt/qquickwebview_p_p.h:
+ (QQuickWebViewPrivate):
+ * UIProcess/API/qt/qwebiconimageprovider.cpp:
+ (QWebIconImageProvider::QWebIconImageProvider):
+ * UIProcess/API/qt/qwebiconimageprovider_p.h:
+ * UIProcess/API/qt/qwebviewportinfo_p.h:
+ * UIProcess/API/qt/tests/tests.pri:
+ * UIProcess/qt/QtDialogRunner.h:
+ (QtDialogRunner):
+ * UIProcess/qt/WebPopupMenuProxyQt.h:
+ (WebPopupMenuProxyQt):
+
+2012-05-10 Jocelyn Turcotte <jocelyn.turcotte@nokia.com>
+
+ [Qt] Fix sites with a viewport meta tag when devicePixelRatio isn't explicitely set on the WebView
+ https://bugs.webkit.org/show_bug.cgi?id=86002
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ The preference was recently changed to a double ratio, but was still left under
+ FOR_EACH_WEBKIT_UINT32_PREFERENCE and was initialized to inf instead of 1.0.
+ This would cause the viewport constraints to apply a multi-millionaire device
+ pixel ratio and make the contents invisible.
+
+ This moves it with other double preferences under FOR_EACH_WEBKIT_DOUBLE_PREFERENCE.
+
+ * Shared/WebPreferencesStore.h:
+ (WebKit):
+
+2012-05-10 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ [Qt] Implement fit-to-width behaviour
+ https://bugs.webkit.org/show_bug.cgi?id=86085
+
+ Reviewed by Simon Hausmann.
+
+ We don't restrict the minimum scale to the layout viewport anymore,
+ but instead update the minimum scale when the content size changes.
+
+ * UIProcess/API/qt/qquickwebview.cpp:
+ (QQuickWebViewFlickablePrivate::didChangeViewportProperties):
+ (QQuickWebViewFlickablePrivate::didChangeContentsSize):
+ * UIProcess/API/qt/qwebviewportinfo.cpp:
+ (QWebViewportInfo::minimumScale):
+ (QWebViewportInfo::maximumScale):
+ * UIProcess/qt/QtViewportInteractionEngine.h:
+ (QtViewportInteractionEngine):
+
+2012-05-07 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
+
+ WebPageProxy::activeURL() should return the pending API request, even when there's no main frame
+ https://bugs.webkit.org/show_bug.cgi?id=85806
+
+ The m_pendingAPIRequestURL member is used (presumably) to mask over the async
+ nature of WebKit2, so that starting a load of a URL will reflect that URL
+ immedeatly from activeURL, even if the request has not been passed over to
+ the web process yet and reflected there.
+
+ This works well, except in the case of the initial request, where the main
+ frame creation happens on the web process side and is notified back to the
+ UI process. Until we've recived the notification we don't know about the main
+ frame, and this race condition will potentially give us an empty url instead
+ of the pending request.
+
+ To solve this we always return the pending API request if it's set, even
+ when there's no mainframe yet (that we known about).
+
+ Reviewed by Simon Hausmann.
+
+ * UIProcess/WebPageProxy.cpp:
+
+2012-05-09 Gyuyoung Kim <gyuyoung.kim@samsung.com>
+
+ Move suspendAnimations to use Internals interface.
+ https://bugs.webkit.org/show_bug.cgi?id=85986
+
+ Reviewed by Ryosuke Niwa.
+
+ * win/WebKit2.def: Add a symbol filter for suspendAnimations.
+
+2012-05-09 Carlos Garcia Campos <cgarcia@igalia.com>
+
+ [GTK] Split WebKit2 Makefile moving source code listings to GNUmakefile.list.am
+ https://bugs.webkit.org/show_bug.cgi?id=85985
+
+ Reviewed by Gustavo Noronha Silva.
+
+ * GNUmakefile.am:
+ * GNUmakefile.list.am: Copied from Source/WebKit2/GNUmakefile.am.
+
+2012-05-09 Carlos Garcia Campos <cgarcia@igalia.com>
+
+ [GTK] Use independent version numbers for public libraries
+ https://bugs.webkit.org/show_bug.cgi?id=85984
+
+ Reviewed by Gustavo Noronha Silva.
+
+ * GNUmakefile.am: Use LIBWEBKIT2GTK_VERSION for library version.
+
+2012-05-09 Allan Sandfeld Jensen <allan.jensen@nokia.com>
+
+ [Qt] Tap-to-zoom zooms to wrong area.
+ https://bugs.webkit.org/show_bug.cgi?id=85982
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Fix computation and take more care when to use CSS scale and when to use Item scale.
+
+ * UIProcess/qt/QtViewportInteractionEngine.cpp:
+ (WebKit::QtViewportInteractionEngine::zoomToAreaGestureEnded):
+
+2012-05-09 Zalan Bujtas <zbujtas@gmail.com>
+
+ [Qt][WK2] Define clear split between QtWebPageLoadClient and QQuickWebViewPrivate for loading tasks.
+ https://bugs.webkit.org/show_bug.cgi?id=84527#c3
+
+ Reviewed by Simon Hausmann.
+
+ Moving loading related code and signal emission from QtWebPageLoadClient to QQuickWebViewPrivate.
+ It puts the loading code that implements an API right where the API is defined, including
+ signal emission as well as translation of WebPageProxy internals to public Qt API with correct types.
+
+ * UIProcess/API/qt/qquickwebview.cpp:
+ (QQuickWebViewPrivate::QQuickWebViewPrivate):
+ (QQuickWebViewPrivate::provisionalLoadDidStart):
+ (QQuickWebViewPrivate::loadDidCommit):
+ (QQuickWebViewPrivate::didSameDocumentNavigation):
+ (QQuickWebViewPrivate::titleDidChange):
+ (QQuickWebViewPrivate::loadProgressDidChange):
+ (QQuickWebViewPrivate::backForwardListDidChange):
+ (QQuickWebViewPrivate::loadDidFail):
+ (QQuickWebViewPrivate::processDidCrash):
+ (QQuickWebView::loadProgress):
+ * UIProcess/API/qt/qquickwebview_p_p.h:
+ (WebKit):
+ (QQuickWebViewPrivate):
+ (QQuickWebViewPrivate::didChangeViewportProperties):
+ (QQuickWebViewPrivate::loadProgress):
+ (QQuickWebViewFlickablePrivate):
+ * UIProcess/qt/QtWebError.cpp:
+ (WebKit::QtWebError::isCancellation):
+ (WebKit):
+ * UIProcess/qt/QtWebError.h:
+ * UIProcess/qt/QtWebPageLoadClient.cpp:
+ (WebKit::QtWebPageLoadClient::QtWebPageLoadClient):
+ (WebKit):
+ (WebKit::QtWebPageLoadClient::didStartProvisionalLoad):
+ (WebKit::QtWebPageLoadClient::didCommitLoad):
+ (WebKit::QtWebPageLoadClient::didSameDocumentNavigation):
+ (WebKit::QtWebPageLoadClient::didReceiveTitle):
+ (WebKit::QtWebPageLoadClient::didChangeProgress):
+ (WebKit::QtWebPageLoadClient::didChangeBackForwardList):
+ (WebKit::QtWebPageLoadClient::dispatchLoadFailed):
+ (WebKit::QtWebPageLoadClient::didFailProvisionalLoadWithErrorForFrame):
+ (WebKit::QtWebPageLoadClient::didFailLoadWithErrorForFrame):
+ (WebKit::QtWebPageLoadClient::didStartProgress):
+ (WebKit::QtWebPageLoadClient::didFinishProgress):
+ * UIProcess/qt/QtWebPageLoadClient.h:
+ (WebKit):
+ (QtWebPageLoadClient):
+
+2012-05-09 Zalan Bujtas <zbujtas@gmail.com>
+
+ [Qt][WK2] Remove delayed loadDidSucceed() signaling and m_deferedUrlToLoad from QQuickWebViewPrivate
+ https://bugs.webkit.org/show_bug.cgi?id=85906
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Deferred loading activies were introduced to work around the delayed Flickable construction
+ at onComponentComplete(). QQuickWebView inherits from QQuickFlickable now,
+ so no need for the workaround anymore.
+
+ * UIProcess/API/qt/qquickwebview.cpp:
+ (QQuickWebViewFlickablePrivate::QQuickWebViewFlickablePrivate):
+ (QQuickWebViewFlickablePrivate::onComponentComplete):
+ (QQuickWebView::setUrl):
+ (QQuickWebView::componentComplete):
+ * UIProcess/API/qt/qquickwebview_p_p.h:
+ (QQuickWebViewPrivate::onComponentComplete):
+ (QQuickWebViewPrivate):
+ (QQuickWebViewFlickablePrivate):
+
+2012-05-08 Jon Lee <jonlee@apple.com>
+
+ Unreviewed build fix.
+
+ * WebProcess/WebPage/ca/win/LayerTreeHostCAWin.h:
+ (LayerTreeHostCAWin):
+
+2012-05-08 Anders Carlsson <andersca@apple.com>
+
+ DrawingAreaProxyImpl doesn't work with window server hosting
+ https://bugs.webkit.org/show_bug.cgi?id=85947
+ <rdar://problem/11213718>
+
+ Reviewed by Andreas Kling.
+
+ * UIProcess/DrawingAreaProxyImpl.cpp:
+ (WebKit::DrawingAreaProxyImpl::updateAcceleratedCompositingMode):
+ Update the layer tree context and call WebPage::updateAcceleratedCompositingMode.
+
+ * WebProcess/WebPage/DrawingAreaImpl.cpp:
+ (WebKit::DrawingAreaImpl::setLayerHostingMode):
+ If setting the layer hosting mode changed the layer tree context, send back an UpdateAcceleratedCompositingMode message
+ with the new context.
+
+ * WebProcess/WebPage/ca/LayerTreeHostCA.cpp:
+ (WebKit::LayerTreeHostCA::initialize):
+ platformInitialize no longer takes a context.
+
+ * WebProcess/WebPage/ca/LayerTreeHostCA.h:
+ (LayerTreeHostCA):
+ Make m_layerTreeContext protected instead.
+
+ * WebProcess/WebPage/ca/mac/LayerTreeHostCAMac.h:
+ * WebProcess/WebPage/ca/mac/LayerTreeHostCAMac.mm:
+ (WebKit::LayerTreeHostCAMac::platformInitialize):
+ Assign to m_layerTreeContext directly.
+
+ (WebKit::LayerTreeHostCAMac::setLayerHostingMode):
+ Set m_layerTreeContext.contextID.
+
+ * WebProcess/WebPage/ca/win/LayerTreeHostCAWin.cpp:
+ (WebKit::LayerTreeHostCAWin::platformInitialize):
+ Assign to m_layerTreeContext directly.
+
+2012-05-08 Jon Lee <jonlee@apple.com>
+
+ Safari warns that it needs to resend the form in an iFrame when going back
+ https://bugs.webkit.org/show_bug.cgi?id=82658
+ <rdar://problem/11292558>
+
+ Reviewed by Darin Adler.
+
+ * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
+ (InitWebCoreSystemInterface): Add wkCFURLRequestAllowAllPostCaching.
+
+2012-05-08 Anders Carlsson <andersca@apple.com>
+
+ Can't scroll PDF in subframe
+ https://bugs.webkit.org/show_bug.cgi?id=85932
+ <rdar://problem/11405527>
+
+ Reviewed by Sam Weinig.
+
+ * WebProcess/Plugins/PDF/BuiltInPDFView.h:
+ * WebProcess/Plugins/PDF/BuiltInPDFView.mm:
+ (WebKit::BuiltInPDFView::updateScrollbars):
+ Trigger a layout when scrollbars come and go so the non fast scrollable region gets recomputed.
+
+ (WebKit::BuiltInPDFView::scrollableAreaBoundingBox):
+ Implement this by calling out to the PluginView.
+
+2012-05-06 Jon Lee <jonlee@apple.com>
+
+ [WK2] Push wheel events if there are too many in queue
+ https://bugs.webkit.org/show_bug.cgi?id=85747
+ <rdar://problem/11390790>
+
+ Reviewed by Anders Carlsson.
+
+ It is possible that a whole bunch of messages added to the message queue, or a series
+ of long-running messages, cause unresponsiveness. The reason for this is that we have
+ a scroll event waiting for acknowledgment from the web process before it sends the next
+ event. And in the time between the user has scrolled, causing a large backlog of scroll
+ events to be held in the UI process.
+
+ We should push new scroll events if the queue accumulates too many of them.
+
+ * UIProcess/WebPageProxy.h: The vector m_currentlyProcessedWheelEvents used to hold the
+ series of wheel events that were coalesced and sent as a single wheel event to the web
+ process. When the web process acknowledges this with didReceiveEvent, the UI process
+ cleared that vector, then tried to coalesce the next wheel event to send. Now we might have
+ multiple sets of coalesced wheel events that we are sending to the web process. To keep
+ track of these sets, m_currentlyProcessedWheelEvents now is a queue of Vectors.
+ (WebPageProxy):
+ * UIProcess/WebPageProxy.cpp: Add new constant wheelEventQueueSizeThreshold representing
+ the threshold of scroll events to look for before we start pushing events.
+ (WebKit::canCoalesce): Move static function so that handleWheelEvent() has access. No changes.
+ (WebKit::coalesce): Move static function so that handleWheelEvent() has access. No changes.
+ (WebKit::coalescedWheelEvent): Move static function so that handleWheelEvent() has access. No changes.
+ (WebKit::WebPageProxy::handleWheelEvent): If we are currently waiting for acknowledgment
+ from the web process that a wheel event has been handled, we add it to the queue. We
+ check to see that the queue size is within our threshold before we return early. Otherwise
+ we will start pushing events in the queue. Refactor the rest of the function into
+ processNextQueuedWheelEvent() and sendWheelEvent(). If we are not currently waiting for
+ acknowledgment, nor have events in the queue, then we send the current wheel event.
+ (WebKit::WebPageProxy::processNextQueuedWheelEvent): Try to coalesce events based on the
+ wheel event at the head of the queue, and send that event to the web process.
+ (WebKit::WebPageProxy::sendWheelEvent): Refactored from handleWheelEvent().
+ (WebKit::WebPageProxy::didReceiveEvent): Instead of clearing m_currentlyProcessedWheelEvents,
+ which contained the set of one coalesced wheel event, we pull the head Vector, which
+ contains the same set of events. Refactor to use processNextQueuedWheelEvent().
+
+2012-05-08 Timothy Hatcher <timothy@apple.com>
+
+ Fix the SOFT_LINK_STAGED_FRAMEWORK_OPTIONAL macro so it passes the full path to dlopen.
+
+ <rdar://problem/11406517>
+
+ Reviewed by Mark Rowe.
+
+ * UIProcess/mac/WebInspectorProxyMac.mm: Pass A to SOFT_LINK_STAGED_FRAMEWORK_OPTIONAL for the version.
+ * WebProcess/WebPage/mac/WebInspectorMac.mm: Ditto.
+
+2012-05-08 Jesus Sanchez-Palencia <jesus.palencia@openbossa.org>
+
+ [WK2] Integrate Page Visibility state change and WK2 Suspend/Resume API
+ https://bugs.webkit.org/show_bug.cgi?id=85650
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ This patch uses state changes of the Page Visibility API to trigger the
+ automatic suspension/resume of animations on the WebPage and its main frame,
+ in the same fashion of what is used by the Suspend/Resume API of WebKit2.
+ By telling the WebPage it will move off/on the screen and the FrameView to
+ hide/show, this patch is suspending/resuming animations (animated painting)
+ but not timers and other active DOM objects.
+
+ * WebProcess/WebPage/WebPage.cpp:
+ (WebKit::WebPage::setVisibilityState):
+
+2012-05-08 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ [Qt] Add QML/WK2 evaluateJavaScript experimental API
+ https://bugs.webkit.org/show_bug.cgi?id=85496
+
+ Reviewed by Simon Hausmann.
+
+ This is an initial patch adding support for strings,
+ numbers and bools as return values.
+
+ Test: qmltests/WebView/tst_evaluateJavaScript.qml
+
+ * UIProcess/API/qt/qquickwebview.cpp:
+ (JSCallbackClosure):
+ (toQString):
+ (toQJSValue):
+ (buildQJSValue):
+ (javaScriptCallback):
+ (QQuickWebViewExperimental::evaluateJavaScript):
+ (QQuickWebView::runJavaScriptInMainFrame):
+ * UIProcess/API/qt/qquickwebview_p.h:
+ * UIProcess/API/qt/tests/qmltests/WebView/tst_evaluateJavaScript.qml: Added.
+
+2012-05-07 Alexis Menard <alexis.menard@openbossa.org>
+
+ [Qt] Unbreak debugging of WebKit2.
+ https://bugs.webkit.org/show_bug.cgi?id=85839
+
+ Reviewed by Simon Hausmann.
+
+ When you attach GDB to a running process, it stops it.
+ http://trac.webkit.org/changeset/115958 introduced a pause()
+ call to wait the debugger to be attached to then continue
+ the execution of the WebProcess. Unfortunately the pause()
+ function does not return unless a signal handler is called.
+ This patch introduce an event handler to exit from the paused
+ state when the debugger send the signal SIGCONT. The old code
+ works with older version of GDB (<7.0) but not with newer
+ versions where the behavior of pause() is correct.
+
+ * qt/MainQt.cpp:
+ (sigcontHandler):
+ (main):
+
+2012-05-07 Julien Chaffraix <jchaffraix@webkit.org>
+
+ Refactor windowClipRectForLayer to remove the explicit RenderLayer dependency
+ https://bugs.webkit.org/show_bug.cgi?id=84090
+
+ Reviewed by David Hyatt.
+
+ * WebProcess/Plugins/PluginView.cpp:
+ (WebKit::PluginView::clipRectInWindowCoordinates):
+ Updated after windowClipRectForLayer name and signature change.
+
+2012-05-07 Andy Estes <aestes@apple.com>
+
+ ENABLE_IFRAME_SEAMLESS should be part of FEATURE_DEFINES.
+
+ * Configurations/FeatureDefines.xcconfig:
+
+2012-05-07 Eric Seidel <eric@webkit.org>
+
+ Add ENABLE_IFRAME_SEAMLESS so Apple can turn off SEAMLESS if needed
+ https://bugs.webkit.org/show_bug.cgi?id=85822
+
+ Reviewed by Adam Barth.
+
+ * Configurations/FeatureDefines.xcconfig:
+
+2012-05-07 Alexis Menard <alexis.menard@openbossa.org>
+
+ Unreviewed Qt build fix in Debug.
+
+ We need some system includes here for getpid() to be recognized.
+
+ * qt/MainQt.cpp:
+
+2012-05-07 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r116299, r116301, and r116303.
+ http://trac.webkit.org/changeset/116299
+ http://trac.webkit.org/changeset/116301
+ http://trac.webkit.org/changeset/116303
+ https://bugs.webkit.org/show_bug.cgi?id=85795
+
+ Build is still broken (Requested by Ossy on #webkit).
+
+ * qt/MainQt.cpp:
+ (main):
+
+2012-05-07 Balazs Kelemen <kbalazs@webkit.org>
+
+ [Qt] Add test specific platform plugin to achieve unified layout test results
+ https://bugs.webkit.org/show_bug.cgi?id=80996
+
+ Reviewed by Simon Hausmann.
+
+ Initialize the test platform plugin before initializing
+ the web process if we are in a WTR run.
+ It is necessary to place this initialization here as we
+ cannot control wich platform plugin will be used after
+ the instantiation of the QApplication.
+
+ * qt/MainQt.cpp:
+ (initializeTestPlatformPluginForWTRIfRequired):
+ (main):
+
2012-05-06 MORITA Hajime <morrita@google.com>
https://bugs.webkit.org/show_bug.cgi?id=85265
diff --git a/Source/WebKit2/Configurations/FeatureDefines.xcconfig b/Source/WebKit2/Configurations/FeatureDefines.xcconfig
index 2dc145f36..91d688b53 100644
--- a/Source/WebKit2/Configurations/FeatureDefines.xcconfig
+++ b/Source/WebKit2/Configurations/FeatureDefines.xcconfig
@@ -54,6 +54,7 @@ ENABLE_GEOLOCATION = ENABLE_GEOLOCATION;
ENABLE_HIGH_DPI_CANVAS = ENABLE_HIGH_DPI_CANVAS;
ENABLE_ICONDATABASE = $(ENABLE_ICONDATABASE_$(REAL_PLATFORM_NAME));
ENABLE_ICONDATABASE_macosx = ENABLE_ICONDATABASE;
+ENABLE_IFRAME_SEAMLESS = ENABLE_IFRAME_SEAMLESS;
ENABLE_INDEXED_DATABASE = ;
ENABLE_INPUT_SPEECH = ;
ENABLE_INPUT_TYPE_COLOR = ;
@@ -121,4 +122,4 @@ ENABLE_WEB_TIMING = ;
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_CSS_FILTERS) $(ENABLE_CSS_GRID_LAYOUT) $(ENABLE_CSS_SHADERS) $(ENABLE_DASHBOARD_SUPPORT) $(ENABLE_DATALIST) $(ENABLE_DATA_TRANSFER_ITEMS) $(ENABLE_DETAILS) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DIRECTORY_UPLOAD) $(ENABLE_FILE_SYSTEM) $(ENABLE_FILTERS) $(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_NOTIFICATIONS) $(ENABLE_LINK_PREFETCH) $(ENABLE_LINK_PRERENDER) $(ENABLE_MATHML) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_METER_TAG) $(ENABLE_MICRODATA) $(ENABLE_MUTATION_OBSERVERS) $(ENABLE_NOTIFICATIONS) $(ENABLE_PAGE_VISIBILITY_API) $(ENABLE_PROGRESS_TAG) $(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_NOTIFICATIONS_ONLY) $(ENABLE_TOUCH_ICON_LOADING) $(ENABLE_VIDEO) $(ENABLE_VIDEO_TRACK) $(ENABLE_WEBGL) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WEB_TIMING) $(ENABLE_WORKERS) $(ENABLE_XSLT);
+FEATURE_DEFINES = $(ENABLE_3D_RENDERING) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ANIMATION_API) $(ENABLE_BLOB) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CSS_FILTERS) $(ENABLE_CSS_GRID_LAYOUT) $(ENABLE_CSS_SHADERS) $(ENABLE_DASHBOARD_SUPPORT) $(ENABLE_DATALIST) $(ENABLE_DATA_TRANSFER_ITEMS) $(ENABLE_DETAILS) $(ENABLE_DEVICE_ORIENTATION) $(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_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_NOTIFICATIONS) $(ENABLE_LINK_PREFETCH) $(ENABLE_LINK_PRERENDER) $(ENABLE_MATHML) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_METER_TAG) $(ENABLE_MICRODATA) $(ENABLE_MUTATION_OBSERVERS) $(ENABLE_NOTIFICATIONS) $(ENABLE_PAGE_VISIBILITY_API) $(ENABLE_PROGRESS_TAG) $(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_NOTIFICATIONS_ONLY) $(ENABLE_TOUCH_ICON_LOADING) $(ENABLE_VIDEO) $(ENABLE_VIDEO_TRACK) $(ENABLE_WEBGL) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WEB_TIMING) $(ENABLE_WORKERS) $(ENABLE_XSLT);
diff --git a/Source/WebKit2/Configurations/Version.xcconfig b/Source/WebKit2/Configurations/Version.xcconfig
index c024bad61..d0b2d142f 100644
--- a/Source/WebKit2/Configurations/Version.xcconfig
+++ b/Source/WebKit2/Configurations/Version.xcconfig
@@ -21,8 +21,8 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-MAJOR_VERSION = 536;
-MINOR_VERSION = 11;
+MAJOR_VERSION = 537;
+MINOR_VERSION = 1;
TINY_VERSION = 0;
FULL_VERSION = $(MAJOR_VERSION).$(MINOR_VERSION);
diff --git a/Source/WebKit2/GNUmakefile.am b/Source/WebKit2/GNUmakefile.am
index a6b42a6d6..f727cdfb2 100644
--- a/Source/WebKit2/GNUmakefile.am
+++ b/Source/WebKit2/GNUmakefile.am
@@ -1,1032 +1,18 @@
+include $(srcdir)/Source/WebKit2/GNUmakefile.list.am
+
libwebkit2gtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_HEADERS = \
- $(WebKit2)/Shared/API/c/gtk/WKBaseGtk.h \
- $(WebKit2)/Shared/API/c/gtk/WKGraphicsContextGtk.h \
- $(WebKit2)/Shared/API/c/soup/WKBaseSoup.h \
- $(WebKit2)/Shared/API/c/WKArray.h \
- $(WebKit2)/Shared/API/c/WKBase.h \
- $(WebKit2)/Shared/API/c/WKCertificateInfo.h \
- $(WebKit2)/Shared/API/c/WKConnectionRef.h \
- $(WebKit2)/Shared/API/c/WKContextMenuItem.h \
- $(WebKit2)/Shared/API/c/WKContextMenuItemTypes.h \
- $(WebKit2)/Shared/API/c/WKData.h \
- $(WebKit2)/Shared/API/c/WKDictionary.h \
- $(WebKit2)/Shared/API/c/WKError.h \
- $(WebKit2)/Shared/API/c/WKEvent.h \
- $(WebKit2)/Shared/API/c/WKFindOptions.h \
- $(WebKit2)/Shared/API/c/WKGeometry.h \
- $(WebKit2)/Shared/API/c/WKGraphicsContext.h \
- $(WebKit2)/Shared/API/c/WKImage.h \
- $(WebKit2)/Shared/API/c/WKMutableArray.h \
- $(WebKit2)/Shared/API/c/WKMutableDictionary.h \
- $(WebKit2)/Shared/API/c/WKNumber.h \
- $(WebKit2)/Shared/API/c/WKPageLoadTypes.h \
- $(WebKit2)/Shared/API/c/WKRenderLayer.h \
- $(WebKit2)/Shared/API/c/WKRenderObject.h \
- $(WebKit2)/Shared/API/c/WKSecurityOrigin.h \
- $(WebKit2)/Shared/API/c/WKSerializedScriptValue.h \
- $(WebKit2)/Shared/API/c/WKSerializedScriptValuePrivate.h \
- $(WebKit2)/Shared/API/c/WKSharedAPICast.h \
- $(WebKit2)/Shared/API/c/WKString.h \
- $(WebKit2)/Shared/API/c/WKStringPrivate.h \
- $(WebKit2)/Shared/API/c/WKType.h \
- $(WebKit2)/Shared/API/c/WKURL.h \
- $(WebKit2)/Shared/API/c/WKURLRequest.h \
- $(WebKit2)/Shared/API/c/WKURLResponse.h \
- $(WebKit2)/Shared/API/c/WKUserContentURLPattern.h \
- $(WebKit2)/UIProcess/API/C/gtk/WKAPICastGtk.h \
- $(WebKit2)/UIProcess/API/C/gtk/WKFullScreenClientGtk.h \
- $(WebKit2)/UIProcess/API/C/gtk/WKView.h \
- $(WebKit2)/UIProcess/API/C/soup/WKAPICastSoup.h \
- $(WebKit2)/UIProcess/API/C/soup/WKContextSoup.h \
- $(WebKit2)/UIProcess/API/C/soup/WKSoupRequestManager.h \
- $(WebKit2)/UIProcess/API/C/WebKit2.h \
- $(WebKit2)/UIProcess/API/C/WKAPICast.h \
- $(WebKit2)/UIProcess/API/C/WKApplicationCacheManager.h \
- $(WebKit2)/UIProcess/API/C/WKAuthenticationChallenge.h \
- $(WebKit2)/UIProcess/API/C/WKAuthenticationDecisionListener.h \
- $(WebKit2)/UIProcess/API/C/WKBackForwardList.h \
- $(WebKit2)/UIProcess/API/C/WKBackForwardListItem.h \
- $(WebKit2)/UIProcess/API/C/WKContext.h \
- $(WebKit2)/UIProcess/API/C/WKContextPrivate.h \
- $(WebKit2)/UIProcess/API/C/WKCookieManager.h \
- $(WebKit2)/UIProcess/API/C/WKCredential.h \
- $(WebKit2)/UIProcess/API/C/WKCredentialTypes.h \
- $(WebKit2)/UIProcess/API/C/WKDatabaseManager.h \
- $(WebKit2)/UIProcess/API/C/WKDownload.h \
- $(WebKit2)/UIProcess/API/C/WKFormSubmissionListener.h \
- $(WebKit2)/UIProcess/API/C/WKFrame.h \
- $(WebKit2)/UIProcess/API/C/WKFramePolicyListener.h \
- $(WebKit2)/UIProcess/API/C/WKGeolocationManager.h \
- $(WebKit2)/UIProcess/API/C/WKGeolocationPermissionRequest.h \
- $(WebKit2)/UIProcess/API/C/WKGeolocationPosition.h \
- $(WebKit2)/UIProcess/API/C/WKGrammarDetail.h \
- $(WebKit2)/UIProcess/API/C/WKHitTestResult.h \
- $(WebKit2)/UIProcess/API/C/WKInspector.h \
- $(WebKit2)/UIProcess/API/C/WKKeyValueStorageManager.h \
- $(WebKit2)/UIProcess/API/C/WKMediaCacheManager.h \
- $(WebKit2)/UIProcess/API/C/WKNativeEvent.h \
- $(WebKit2)/UIProcess/API/C/WKNavigationData.h \
- $(WebKit2)/UIProcess/API/C/WKNotification.h \
- $(WebKit2)/UIProcess/API/C/WKNotificationManager.h \
- $(WebKit2)/UIProcess/API/C/WKNotificationPermissionRequest.h \
- $(WebKit2)/UIProcess/API/C/WKNotificationProvider.h \
- $(WebKit2)/UIProcess/API/C/WKOpenPanelParameters.h \
- $(WebKit2)/UIProcess/API/C/WKOpenPanelResultListener.h \
- $(WebKit2)/UIProcess/API/C/WKPageGroup.h \
- $(WebKit2)/UIProcess/API/C/WKPage.h \
- $(WebKit2)/UIProcess/API/C/WKPagePrivate.h \
- $(WebKit2)/UIProcess/API/C/WKPluginSiteDataManager.h \
- $(WebKit2)/UIProcess/API/C/WKPreferences.h \
- $(WebKit2)/UIProcess/API/C/WKPreferencesPrivate.h \
- $(WebKit2)/UIProcess/API/C/WKProtectionSpace.h \
- $(WebKit2)/UIProcess/API/C/WKProtectionSpaceTypes.h \
- $(WebKit2)/UIProcess/API/C/WKResourceCacheManager.h \
- $(WebKit2)/UIProcess/API/C/WKTextChecker.h \
- $(WebKit2)/UIProcess/API/cpp/WKRetainPtr.h
+ $(webkit2_h_api)
libwebkit2gtkincludedir = $(libwebkitgtkincludedir)/webkit2
nodist_libwebkit2gtkinclude_HEADERS = \
DerivedSources/WebKit2/webkit2gtk/webkit2/WebKitEnumTypes.h
libwebkit2gtkinclude_HEADERS = \
- $(WebKit2)/UIProcess/API/gtk/WebKitBackForwardList.h \
- $(WebKit2)/UIProcess/API/gtk/WebKitBackForwardListItem.h \
- $(WebKit2)/UIProcess/API/gtk/WebKitCookieManager.h \
- $(WebKit2)/UIProcess/API/gtk/WebKitDefines.h \
- $(WebKit2)/UIProcess/API/gtk/WebKitDownload.h \
- $(WebKit2)/UIProcess/API/gtk/WebKitEditingCommands.h \
- $(WebKit2)/UIProcess/API/gtk/WebKitError.h \
- $(WebKit2)/UIProcess/API/gtk/WebKitFileChooserRequest.h \
- $(WebKit2)/UIProcess/API/gtk/WebKitFindController.h \
- $(WebKit2)/UIProcess/API/gtk/WebKitHitTestResult.h \
- $(WebKit2)/UIProcess/API/gtk/WebKitJavascriptResult.h \
- $(WebKit2)/UIProcess/API/gtk/WebKitNavigationPolicyDecision.h \
- $(WebKit2)/UIProcess/API/gtk/WebKitPolicyDecision.h \
- $(WebKit2)/UIProcess/API/gtk/WebKitPrintOperation.h \
- $(WebKit2)/UIProcess/API/gtk/WebKitResponsePolicyDecision.h \
- $(WebKit2)/UIProcess/API/gtk/WebKitScriptDialog.h \
- $(WebKit2)/UIProcess/API/gtk/WebKitSettings.h \
- $(WebKit2)/UIProcess/API/gtk/WebKitURIRequest.h \
- $(WebKit2)/UIProcess/API/gtk/WebKitURIResponse.h \
- $(WebKit2)/UIProcess/API/gtk/WebKitWebContext.h \
- $(WebKit2)/UIProcess/API/gtk/WebKitWebResource.h \
- $(WebKit2)/UIProcess/API/gtk/WebKitWebView.h \
- $(WebKit2)/UIProcess/API/gtk/WebKitWebViewBase.h \
- $(WebKit2)/UIProcess/API/gtk/WebKitWindowProperties.h \
- $(WebKit2)/UIProcess/API/gtk/webkit2.h
-
-webkit2_built_sources += \
- DerivedSources/WebKit2/AuthenticationManagerMessageReceiver.cpp \
- DerivedSources/WebKit2/AuthenticationManagerMessages.h \
- DerivedSources/WebKit2/DownloadProxyMessageReceiver.cpp \
- DerivedSources/WebKit2/DownloadProxyMessages.h \
- DerivedSources/WebKit2/DrawingAreaMessageReceiver.cpp \
- DerivedSources/WebKit2/DrawingAreaMessages.h \
- DerivedSources/WebKit2/DrawingAreaProxyMessageReceiver.cpp \
- DerivedSources/WebKit2/DrawingAreaProxyMessages.h \
- DerivedSources/WebKit2/EventDispatcherMessageReceiver.cpp \
- DerivedSources/WebKit2/EventDispatcherMessages.h \
- DerivedSources/WebKit2/LayerTreeHostProxyMessageReceiver.cpp \
- DerivedSources/WebKit2/LayerTreeHostProxyMessages.h \
- DerivedSources/WebKit2/NPObjectMessageReceiverMessageReceiver.cpp \
- DerivedSources/WebKit2/NPObjectMessageReceiverMessages.h \
- DerivedSources/WebKit2/PluginControllerProxyMessageReceiver.cpp \
- DerivedSources/WebKit2/PluginControllerProxyMessages.h \
- DerivedSources/WebKit2/PluginProcessConnectionMessageReceiver.cpp \
- DerivedSources/WebKit2/PluginProcessConnectionMessages.h \
- DerivedSources/WebKit2/PluginProcessMessageReceiver.cpp \
- DerivedSources/WebKit2/PluginProcessMessages.h \
- DerivedSources/WebKit2/PluginProcessProxyMessageReceiver.cpp \
- DerivedSources/WebKit2/PluginProcessProxyMessages.h \
- DerivedSources/WebKit2/PluginProxyMessageReceiver.cpp \
- DerivedSources/WebKit2/PluginProxyMessages.h \
- DerivedSources/WebKit2/WebApplicationCacheManagerMessageReceiver.cpp \
- DerivedSources/WebKit2/WebApplicationCacheManagerMessages.h \
- DerivedSources/WebKit2/WebApplicationCacheManagerProxyMessageReceiver.cpp \
- DerivedSources/WebKit2/WebApplicationCacheManagerProxyMessages.h \
- DerivedSources/WebKit2/WebContextMessageReceiver.cpp \
- DerivedSources/WebKit2/WebContextMessages.h \
- DerivedSources/WebKit2/WebCookieManagerMessageReceiver.cpp \
- DerivedSources/WebKit2/WebCookieManagerMessages.h \
- DerivedSources/WebKit2/WebCookieManagerProxyMessageReceiver.cpp \
- DerivedSources/WebKit2/WebCookieManagerProxyMessages.h \
- DerivedSources/WebKit2/WebDatabaseManagerMessageReceiver.cpp \
- DerivedSources/WebKit2/WebDatabaseManagerMessages.h \
- DerivedSources/WebKit2/WebDatabaseManagerProxyMessageReceiver.cpp \
- DerivedSources/WebKit2/WebDatabaseManagerProxyMessages.h \
- DerivedSources/WebKit2/WebFullScreenManagerMessageReceiver.cpp \
- DerivedSources/WebKit2/WebFullScreenManagerMessages.h \
- DerivedSources/WebKit2/WebFullScreenManagerProxyMessageReceiver.cpp \
- DerivedSources/WebKit2/WebFullScreenManagerProxyMessages.h \
- DerivedSources/WebKit2/WebGeolocationManagerMessageReceiver.cpp \
- DerivedSources/WebKit2/WebGeolocationManagerMessages.h \
- DerivedSources/WebKit2/WebGeolocationManagerProxyMessageReceiver.cpp \
- DerivedSources/WebKit2/WebGeolocationManagerProxyMessages.h \
- DerivedSources/WebKit2/WebIconDatabaseMessageReceiver.cpp \
- DerivedSources/WebKit2/WebIconDatabaseMessages.h \
- DerivedSources/WebKit2/WebIconDatabaseProxyMessageReceiver.cpp \
- DerivedSources/WebKit2/WebIconDatabaseProxyMessages.h \
- DerivedSources/WebKit2/WebInspectorMessageReceiver.cpp \
- DerivedSources/WebKit2/WebInspectorMessages.h \
- DerivedSources/WebKit2/WebInspectorProxyMessageReceiver.cpp \
- DerivedSources/WebKit2/WebInspectorProxyMessages.h \
- DerivedSources/WebKit2/WebKeyValueStorageManagerMessageReceiver.cpp \
- DerivedSources/WebKit2/WebKeyValueStorageManagerMessages.h \
- DerivedSources/WebKit2/WebKeyValueStorageManagerProxyMessageReceiver.cpp \
- DerivedSources/WebKit2/WebKeyValueStorageManagerProxyMessages.h \
- DerivedSources/WebKit2/WebMediaCacheManagerMessageReceiver.cpp \
- DerivedSources/WebKit2/WebMediaCacheManagerMessages.h \
- DerivedSources/WebKit2/WebMediaCacheManagerProxyMessageReceiver.cpp \
- DerivedSources/WebKit2/WebMediaCacheManagerProxyMessages.h \
- DerivedSources/WebKit2/WebNotificationManagerMessageReceiver.cpp \
- DerivedSources/WebKit2/WebNotificationManagerMessages.h \
- DerivedSources/WebKit2/WebNotificationManagerProxyMessageReceiver.cpp \
- DerivedSources/WebKit2/WebNotificationManagerProxyMessages.h \
- DerivedSources/WebKit2/WebPageProxyMessageReceiver.cpp \
- DerivedSources/WebKit2/WebPageProxyMessages.h \
- DerivedSources/WebKit2/WebPageMessageReceiver.cpp \
- DerivedSources/WebKit2/WebPageMessages.h \
- DerivedSources/WebKit2/WebResourceCacheManagerMessageReceiver.cpp \
- DerivedSources/WebKit2/WebResourceCacheManagerMessages.h \
- DerivedSources/WebKit2/WebResourceCacheManagerProxyMessageReceiver.cpp \
- DerivedSources/WebKit2/WebResourceCacheManagerProxyMessages.h \
- DerivedSources/WebKit2/WebProcessConnectionMessageReceiver.cpp \
- DerivedSources/WebKit2/WebProcessConnectionMessages.h \
- DerivedSources/WebKit2/WebProcessMessageReceiver.cpp \
- DerivedSources/WebKit2/WebProcessMessages.h \
- DerivedSources/WebKit2/WebProcessProxyMessageReceiver.cpp \
- DerivedSources/WebKit2/WebProcessProxyMessages.h \
- DerivedSources/WebKit2/WebSoupRequestManagerMessageReceiver.cpp \
- DerivedSources/WebKit2/WebSoupRequestManagerMessages.h \
- DerivedSources/WebKit2/WebSoupRequestManagerProxyMessageReceiver.cpp \
- DerivedSources/WebKit2/WebSoupRequestManagerProxyMessages.h
-
-webkit2_built_sources += \
- DerivedSources/WebKit2/webkit2gtk/webkit2/WebKitEnumTypes.cpp \
- DerivedSources/WebKit2/webkit2gtk/webkit2/WebKitEnumTypes.h \
- DerivedSources/WebKit2/webkit2gtk/webkit2/WebKitMarshal.cpp \
- DerivedSources/WebKit2/webkit2gtk/webkit2/WebKitMarshal.h
-
-BUILT_SOURCES += $(webkit2_built_sources)
+ $(webkit2gtk_h_api)
nodist_libwebkit2gtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_SOURCES = \
- $(webkit2_built_sources)
-
-webkit2_sources += \
- Source/WebKit2/config.h \
- Source/WebKit2/Platform/CoreIPC/ArgumentCoder.h \
- Source/WebKit2/Platform/CoreIPC/ArgumentCoders.cpp \
- Source/WebKit2/Platform/CoreIPC/ArgumentCoders.h \
- Source/WebKit2/Platform/CoreIPC/ArgumentDecoder.cpp \
- Source/WebKit2/Platform/CoreIPC/ArgumentDecoder.h \
- Source/WebKit2/Platform/CoreIPC/ArgumentEncoder.cpp \
- Source/WebKit2/Platform/CoreIPC/ArgumentEncoder.h \
- Source/WebKit2/Platform/CoreIPC/Arguments.h \
- Source/WebKit2/Platform/CoreIPC/Attachment.cpp \
- Source/WebKit2/Platform/CoreIPC/Attachment.h \
- Source/WebKit2/Platform/CoreIPC/BinarySemaphore.cpp \
- Source/WebKit2/Platform/CoreIPC/BinarySemaphore.h \
- Source/WebKit2/Platform/CoreIPC/Connection.cpp \
- Source/WebKit2/Platform/CoreIPC/Connection.h \
- Source/WebKit2/Platform/CoreIPC/CoreIPCMessageKinds.h \
- Source/WebKit2/Platform/CoreIPC/DataReference.cpp \
- Source/WebKit2/Platform/CoreIPC/DataReference.h \
- Source/WebKit2/Platform/CoreIPC/HandleMessage.h \
- Source/WebKit2/Platform/CoreIPC/MessageID.h \
- Source/WebKit2/Platform/CoreIPC/MessageSender.h \
- Source/WebKit2/Platform/CoreIPC/unix/AttachmentUnix.cpp \
- Source/WebKit2/Platform/CoreIPC/unix/ConnectionUnix.cpp \
- Source/WebKit2/Platform/gtk/LoggingGtk.cpp \
- Source/WebKit2/Platform/gtk/ModuleGtk.cpp \
- Source/WebKit2/Platform/gtk/WorkQueueGtk.cpp \
- Source/WebKit2/Platform/Logging.cpp \
- Source/WebKit2/Platform/Logging.h \
- Source/WebKit2/Platform/Module.cpp \
- Source/WebKit2/Platform/Module.h \
- Source/WebKit2/Platform/PlatformProcessIdentifier.h \
- Source/WebKit2/Platform/SharedMemory.h \
- Source/WebKit2/Platform/unix/SharedMemoryUnix.cpp \
- Source/WebKit2/Platform/WorkQueue.cpp \
- Source/WebKit2/Platform/WorkQueue.h \
- Source/WebKit2/PluginProcess/PluginControllerProxy.cpp \
- Source/WebKit2/PluginProcess/PluginControllerProxy.h \
- Source/WebKit2/PluginProcess/PluginCreationParameters.cpp \
- Source/WebKit2/PluginProcess/PluginCreationParameters.h \
- Source/WebKit2/PluginProcess/PluginProcess.cpp \
- Source/WebKit2/PluginProcess/PluginProcess.h \
- Source/WebKit2/PluginProcess/PluginProcessMain.h \
- Source/WebKit2/PluginProcess/WebProcessConnection.cpp \
- Source/WebKit2/PluginProcess/WebProcessConnection.h \
- Source/WebKit2/PluginProcess/gtk/PluginControllerProxyGtk.cpp \
- Source/WebKit2/PluginProcess/gtk/PluginProcessGtk.cpp \
- Source/WebKit2/Shared/DragControllerAction.h \
- Source/WebKit2/Shared/FontInfo.h \
- Source/WebKit2/Shared/HTTPCookieAcceptPolicy.h \
- Source/WebKit2/Shared/ResourceCachesToClear.h \
- Source/WebKit2/Shared/WebMemorySampler.h \
- Source/WebKit2/Shared/APIClient.h \
- Source/WebKit2/Shared/APIClientTraits.cpp \
- Source/WebKit2/Shared/APIClientTraits.h \
- Source/WebKit2/Shared/API/c/cairo/WKImageCairo.cpp \
- Source/WebKit2/Shared/API/c/cairo/WKImageCairo.h \
- Source/WebKit2/Shared/API/c/gtk/WKBaseGtk.h \
- Source/WebKit2/Shared/API/c/gtk/WKGraphicsContextGtk.h \
- Source/WebKit2/Shared/API/c/gtk/WKGraphicsContextGtk.cpp \
- Source/WebKit2/Shared/API/c/soup/WKBaseSoup.h \
- Source/WebKit2/Shared/API/c/WKArray.cpp \
- Source/WebKit2/Shared/API/c/WKArray.h \
- Source/WebKit2/Shared/API/c/WKBase.h \
- Source/WebKit2/Shared/API/c/WKCertificateInfo.cpp \
- Source/WebKit2/Shared/API/c/WKCertificateInfo.h \
- Source/WebKit2/Shared/API/c/WKConnectionRef.cpp \
- Source/WebKit2/Shared/API/c/WKConnectionRef.h \
- Source/WebKit2/Shared/API/c/WKContextMenuItem.cpp \
- Source/WebKit2/Shared/API/c/WKContextMenuItem.h \
- Source/WebKit2/Shared/API/c/WKContextMenuItemTypes.h \
- Source/WebKit2/Shared/API/c/WKData.cpp \
- Source/WebKit2/Shared/API/c/WKData.h \
- Source/WebKit2/Shared/API/c/WKDictionary.cpp \
- Source/WebKit2/Shared/API/c/WKDictionary.h \
- Source/WebKit2/Shared/API/c/WKError.cpp \
- Source/WebKit2/Shared/API/c/WKError.h \
- Source/WebKit2/Shared/API/c/WKEvent.h \
- Source/WebKit2/Shared/API/c/WKFindOptions.h \
- Source/WebKit2/Shared/API/c/WKGeometry.h \
- Source/WebKit2/Shared/API/c/WKGeometry.cpp \
- Source/WebKit2/Shared/API/c/WKGraphicsContext.cpp \
- Source/WebKit2/Shared/API/c/WKGraphicsContext.h \
- Source/WebKit2/Shared/API/c/WKImage.cpp \
- Source/WebKit2/Shared/API/c/WKImage.h \
- Source/WebKit2/Shared/API/c/WKMutableArray.cpp \
- Source/WebKit2/Shared/API/c/WKMutableArray.h \
- Source/WebKit2/Shared/API/c/WKMutableDictionary.cpp \
- Source/WebKit2/Shared/API/c/WKMutableDictionary.h \
- Source/WebKit2/Shared/API/c/WKNumber.cpp \
- Source/WebKit2/Shared/API/c/WKNumber.h \
- Source/WebKit2/Shared/API/c/WKPageLoadTypes.h \
- Source/WebKit2/Shared/API/c/WKRenderLayer.cpp \
- Source/WebKit2/Shared/API/c/WKRenderLayer.h \
- Source/WebKit2/Shared/API/c/WKRenderObject.cpp \
- Source/WebKit2/Shared/API/c/WKRenderObject.h \
- Source/WebKit2/Shared/API/c/WKSecurityOrigin.cpp \
- Source/WebKit2/Shared/API/c/WKSecurityOrigin.h \
- Source/WebKit2/Shared/API/c/WKSerializedScriptValue.cpp \
- Source/WebKit2/Shared/API/c/WKSerializedScriptValue.h \
- Source/WebKit2/Shared/API/c/WKSerializedScriptValuePrivate.h \
- Source/WebKit2/Shared/API/c/WKSharedAPICast.h \
- Source/WebKit2/Shared/API/c/WKString.cpp \
- Source/WebKit2/Shared/API/c/WKString.h \
- Source/WebKit2/Shared/API/c/WKStringPrivate.h \
- Source/WebKit2/Shared/API/c/WKType.cpp \
- Source/WebKit2/Shared/API/c/WKType.h \
- Source/WebKit2/Shared/API/c/WKURL.cpp \
- Source/WebKit2/Shared/API/c/WKURL.h \
- Source/WebKit2/Shared/API/c/WKURLRequest.cpp \
- Source/WebKit2/Shared/API/c/WKURLRequest.h \
- Source/WebKit2/Shared/API/c/WKURLResponse.cpp \
- Source/WebKit2/Shared/API/c/WKURLResponse.h \
- Source/WebKit2/Shared/API/c/WKUserContentURLPattern.cpp \
- Source/WebKit2/Shared/API/c/WKUserContentURLPattern.h \
- Source/WebKit2/Shared/APIObject.cpp \
- Source/WebKit2/Shared/APIObject.h \
- Source/WebKit2/Shared/ShareableBitmap.cpp \
- Source/WebKit2/Shared/ShareableBitmap.h \
- Source/WebKit2/Shared/CacheModel.h \
- Source/WebKit2/Shared/ChildProcess.cpp \
- Source/WebKit2/Shared/ChildProcess.h \
- Source/WebKit2/Shared/CommandLine.h \
- Source/WebKit2/Shared/CoreIPCSupport/InjectedBundleMessageKinds.h \
- Source/WebKit2/Shared/CoreIPCSupport/WebConnectionMessageKinds.h \
- Source/WebKit2/Shared/CoreIPCSupport/WebContextMessageKinds.h \
- Source/WebKit2/Shared/CoreIPCSupport/WebPageProxyMessageKinds.h \
- Source/WebKit2/Shared/DrawingAreaInfo.h \
- Source/WebKit2/Shared/EditorState.cpp \
- Source/WebKit2/Shared/EditorState.h \
- Source/WebKit2/Shared/FontSmoothingLevel.h \
- Source/WebKit2/Shared/ProcessExecutablePath.h \
- Source/WebKit2/Shared/cairo/LayerTreeContextCairo.cpp \
- Source/WebKit2/Shared/cairo/ShareableBitmapCairo.cpp \
- Source/WebKit2/Shared/gtk/ArgumentCodersGtk.h \
- Source/WebKit2/Shared/gtk/ArgumentCodersGtk.cpp \
- Source/WebKit2/Shared/gtk/NativeWebKeyboardEventGtk.cpp \
- Source/WebKit2/Shared/gtk/NativeWebMouseEventGtk.cpp \
- Source/WebKit2/Shared/gtk/NativeWebWheelEventGtk.cpp \
- Source/WebKit2/Shared/gtk/PlatformCertificateInfo.h \
- Source/WebKit2/Shared/gtk/PrintInfoGtk.cpp \
- Source/WebKit2/Shared/gtk/ProcessExecutablePathGtk.cpp \
- Source/WebKit2/Shared/gtk/WebCoreArgumentCodersGtk.cpp \
- Source/WebKit2/Shared/gtk/WebEventFactory.cpp \
- Source/WebKit2/Shared/gtk/WebEventFactory.h \
- Source/WebKit2/Shared/ImageOptions.h \
- Source/WebKit2/Shared/ImmutableArray.cpp \
- Source/WebKit2/Shared/ImmutableArray.h \
- Source/WebKit2/Shared/ImmutableDictionary.cpp \
- Source/WebKit2/Shared/ImmutableDictionary.h \
- Source/WebKit2/Shared/LayerTreeContext.h \
- Source/WebKit2/Shared/MutableArray.cpp \
- Source/WebKit2/Shared/MutableArray.h \
- Source/WebKit2/Shared/MutableDictionary.cpp \
- Source/WebKit2/Shared/MutableDictionary.h \
- Source/WebKit2/Shared/NativeWebKeyboardEvent.h \
- Source/WebKit2/Shared/NativeWebMouseEvent.h \
- Source/WebKit2/Shared/NativeWebWheelEvent.h \
- Source/WebKit2/Shared/OriginAndDatabases.cpp \
- Source/WebKit2/Shared/OriginAndDatabases.h \
- Source/WebKit2/Shared/PlatformPopupMenuData.cpp \
- Source/WebKit2/Shared/PlatformPopupMenuData.h \
- Source/WebKit2/Shared/PrintInfo.cpp \
- Source/WebKit2/Shared/PrintInfo.h \
- Source/WebKit2/Shared/Plugins/Netscape/NetscapePluginModule.cpp \
- Source/WebKit2/Shared/Plugins/Netscape/NetscapePluginModule.h \
- Source/WebKit2/Shared/Plugins/Netscape/NetscapePluginModuleNone.cpp \
- Source/WebKit2/Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp \
- Source/WebKit2/Shared/Plugins/NPIdentifierData.cpp \
- Source/WebKit2/Shared/Plugins/NPIdentifierData.h \
- Source/WebKit2/Shared/Plugins/NPObjectMessageReceiver.cpp \
- Source/WebKit2/Shared/Plugins/NPObjectMessageReceiver.h \
- Source/WebKit2/Shared/Plugins/NPObjectProxy.cpp \
- Source/WebKit2/Shared/Plugins/NPObjectProxy.h \
- Source/WebKit2/Shared/Plugins/NPRemoteObjectMap.cpp \
- Source/WebKit2/Shared/Plugins/NPRemoteObjectMap.h \
- Source/WebKit2/Shared/Plugins/NPVariantData.cpp \
- Source/WebKit2/Shared/Plugins/NPVariantData.h \
- Source/WebKit2/Shared/Plugins/PluginModuleInfo.cpp \
- Source/WebKit2/Shared/Plugins/PluginModuleInfo.h \
- Source/WebKit2/Shared/Plugins/PluginProcessCreationParameters.cpp \
- Source/WebKit2/Shared/Plugins/PluginProcessCreationParameters.h \
- Source/WebKit2/Shared/Plugins/PluginQuirks.h \
- Source/WebKit2/Shared/SameDocumentNavigationType.h \
- Source/WebKit2/Shared/SandboxExtension.h \
- Source/WebKit2/Shared/SecurityOriginData.h \
- Source/WebKit2/Shared/SecurityOriginData.cpp \
- Source/WebKit2/Shared/SessionState.cpp \
- Source/WebKit2/Shared/SessionState.h \
- Source/WebKit2/Shared/StatisticsData.cpp \
- Source/WebKit2/Shared/StatisticsData.h \
- Source/WebKit2/Shared/StringPairVector.h \
- Source/WebKit2/Shared/TextCheckerState.h \
- Source/WebKit2/Shared/UserMessageCoders.h \
- Source/WebKit2/Shared/UpdateInfo.cpp \
- Source/WebKit2/Shared/UpdateInfo.h \
- Source/WebKit2/Shared/VisitedLinkTable.cpp \
- Source/WebKit2/Shared/VisitedLinkTable.h \
- Source/WebKit2/Shared/WebBackForwardListItem.cpp \
- Source/WebKit2/Shared/WebBackForwardListItem.h \
- Source/WebKit2/Shared/WebCertificateInfo.h \
- Source/WebKit2/Shared/WebConnection.cpp \
- Source/WebKit2/Shared/WebConnection.h \
- Source/WebKit2/Shared/WebConnectionClient.cpp \
- Source/WebKit2/Shared/WebConnectionClient.h \
- Source/WebKit2/Shared/WebContextMenuItem.cpp \
- Source/WebKit2/Shared/WebContextMenuItemData.cpp \
- Source/WebKit2/Shared/WebContextMenuItemData.h \
- Source/WebKit2/Shared/WebContextMenuItem.h \
- Source/WebKit2/Shared/WebCoreArgumentCoders.cpp \
- Source/WebKit2/Shared/WebCoreArgumentCoders.h \
- Source/WebKit2/Shared/WebData.h \
- Source/WebKit2/Shared/WebError.cpp \
- Source/WebKit2/Shared/WebError.h \
- Source/WebKit2/Shared/WebEventConversion.cpp \
- Source/WebKit2/Shared/WebEventConversion.h \
- Source/WebKit2/Shared/WebEvent.cpp \
- Source/WebKit2/Shared/WebEvent.h \
- Source/WebKit2/Shared/WebFindOptions.h \
- Source/WebKit2/Shared/WebGeolocationPosition.cpp \
- Source/WebKit2/Shared/WebGeolocationPosition.h \
- Source/WebKit2/Shared/WebGeometry.h \
- Source/WebKit2/Shared/WebGraphicsContext.cpp \
- Source/WebKit2/Shared/WebGraphicsContext.h \
- Source/WebKit2/Shared/WebHitTestResult.cpp \
- Source/WebKit2/Shared/WebHitTestResult.h \
- Source/WebKit2/Shared/WebImage.cpp \
- Source/WebKit2/Shared/WebImage.h \
- Source/WebKit2/Shared/WebKeyboardEvent.cpp \
- Source/WebKit2/Shared/WebMouseEvent.cpp \
- Source/WebKit2/Shared/WebNavigationDataStore.h \
- Source/WebKit2/Shared/WebNumber.h \
- Source/WebKit2/Shared/WebOpenPanelParameters.cpp \
- Source/WebKit2/Shared/WebOpenPanelParameters.h \
- Source/WebKit2/Shared/WebPageCreationParameters.cpp \
- Source/WebKit2/Shared/WebPageCreationParameters.h \
- Source/WebKit2/Shared/WebPageGroupData.cpp \
- Source/WebKit2/Shared/WebPageGroupData.h \
- Source/WebKit2/Shared/WebPlatformTouchPoint.cpp \
- Source/WebKit2/Shared/WebPopupItem.cpp \
- Source/WebKit2/Shared/WebPopupItem.h \
- Source/WebKit2/Shared/WebPreferencesStore.cpp \
- Source/WebKit2/Shared/WebPreferencesStore.h \
- Source/WebKit2/Shared/WebProcessCreationParameters.cpp \
- Source/WebKit2/Shared/WebProcessCreationParameters.h \
- Source/WebKit2/Shared/WebRenderLayer.cpp \
- Source/WebKit2/Shared/WebRenderLayer.h \
- Source/WebKit2/Shared/WebRenderObject.cpp \
- Source/WebKit2/Shared/WebRenderObject.h \
- Source/WebKit2/Shared/WebSecurityOrigin.h \
- Source/WebKit2/Shared/WebSerializedScriptValue.h \
- Source/WebKit2/Shared/WebString.h \
- Source/WebKit2/Shared/WebTouchEvent.cpp \
- Source/WebKit2/Shared/WebURL.h \
- Source/WebKit2/Shared/WebURLRequest.cpp \
- Source/WebKit2/Shared/WebURLRequest.h \
- Source/WebKit2/Shared/WebURLResponse.cpp \
- Source/WebKit2/Shared/WebURLResponse.h \
- Source/WebKit2/Shared/WebUserContentURLPattern.h \
- Source/WebKit2/Shared/WebWheelEvent.cpp \
- Source/WebKit2/UIProcess/API/C/gtk/WKAPICastGtk.h \
- Source/WebKit2/UIProcess/API/C/gtk/WKFullScreenClientGtk.cpp \
- Source/WebKit2/UIProcess/API/C/gtk/WKFullScreenClientGtk.h \
- Source/WebKit2/UIProcess/API/C/gtk/WKView.cpp \
- Source/WebKit2/UIProcess/API/C/gtk/WKView.h \
- Source/WebKit2/UIProcess/API/C/soup/WKAPICastSoup.h \
- Source/WebKit2/UIProcess/API/C/soup/WKContextSoup.cpp \
- Source/WebKit2/UIProcess/API/C/soup/WKContextSoup.h \
- Source/WebKit2/UIProcess/API/C/soup/WKSoupRequestManager.cpp \
- Source/WebKit2/UIProcess/API/C/soup/WKSoupRequestManager.h \
- Source/WebKit2/UIProcess/API/C/WebKit2.h \
- Source/WebKit2/UIProcess/API/C/WKAPICast.h \
- Source/WebKit2/UIProcess/API/C/WKApplicationCacheManager.h \
- Source/WebKit2/UIProcess/API/C/WKApplicationCacheManager.cpp \
- Source/WebKit2/UIProcess/API/C/WKAuthenticationChallenge.cpp \
- Source/WebKit2/UIProcess/API/C/WKAuthenticationChallenge.h \
- Source/WebKit2/UIProcess/API/C/WKAuthenticationDecisionListener.cpp \
- Source/WebKit2/UIProcess/API/C/WKAuthenticationDecisionListener.h \
- Source/WebKit2/UIProcess/API/C/WKBackForwardList.cpp \
- Source/WebKit2/UIProcess/API/C/WKBackForwardList.h \
- Source/WebKit2/UIProcess/API/C/WKBackForwardListItem.cpp \
- Source/WebKit2/UIProcess/API/C/WKBackForwardListItem.h \
- Source/WebKit2/UIProcess/API/C/WKContext.cpp \
- Source/WebKit2/UIProcess/API/C/WKContext.h \
- Source/WebKit2/UIProcess/API/C/WKContextPrivate.h \
- Source/WebKit2/UIProcess/API/C/WKCookieManager.h \
- Source/WebKit2/UIProcess/API/C/WKCookieManager.cpp \
- Source/WebKit2/UIProcess/API/C/WKCredential.cpp \
- Source/WebKit2/UIProcess/API/C/WKCredential.h \
- Source/WebKit2/UIProcess/API/C/WKCredentialTypes.h \
- Source/WebKit2/UIProcess/API/C/WKDatabaseManager.cpp \
- Source/WebKit2/UIProcess/API/C/WKDatabaseManager.h \
- Source/WebKit2/UIProcess/API/C/WKDownload.cpp \
- Source/WebKit2/UIProcess/API/C/WKDownload.h \
- Source/WebKit2/UIProcess/API/C/WKFormSubmissionListener.cpp \
- Source/WebKit2/UIProcess/API/C/WKFormSubmissionListener.h \
- Source/WebKit2/UIProcess/API/C/WKFrame.cpp \
- Source/WebKit2/UIProcess/API/C/WKFrame.h \
- Source/WebKit2/UIProcess/API/C/WKFramePolicyListener.cpp \
- Source/WebKit2/UIProcess/API/C/WKFramePolicyListener.h \
- Source/WebKit2/UIProcess/API/C/WKGeolocationManager.h \
- Source/WebKit2/UIProcess/API/C/WKGeolocationPermissionRequest.h \
- Source/WebKit2/UIProcess/API/C/WKGeolocationPosition.h \
- Source/WebKit2/UIProcess/API/C/WKGrammarDetail.cpp \
- Source/WebKit2/UIProcess/API/C/WKGrammarDetail.h \
- Source/WebKit2/UIProcess/API/C/WKHitTestResult.cpp \
- Source/WebKit2/UIProcess/API/C/WKHitTestResult.h \
- Source/WebKit2/UIProcess/API/C/WKIconDatabase.cpp \
- Source/WebKit2/UIProcess/API/C/WKIconDatabase.h \
- Source/WebKit2/UIProcess/API/C/WKInspector.cpp \
- Source/WebKit2/UIProcess/API/C/WKInspector.h \
- Source/WebKit2/UIProcess/API/C/WKKeyValueStorageManager.cpp \
- Source/WebKit2/UIProcess/API/C/WKKeyValueStorageManager.h \
- Source/WebKit2/UIProcess/API/C/WKMediaCacheManager.cpp \
- Source/WebKit2/UIProcess/API/C/WKMediaCacheManager.h \
- Source/WebKit2/UIProcess/API/C/WKNativeEvent.h \
- Source/WebKit2/UIProcess/API/C/WKNavigationData.cpp \
- Source/WebKit2/UIProcess/API/C/WKNavigationData.h \
- Source/WebKit2/UIProcess/API/C/WKNotification.cpp \
- Source/WebKit2/UIProcess/API/C/WKNotification.h \
- Source/WebKit2/UIProcess/API/C/WKNotificationManager.cpp \
- Source/WebKit2/UIProcess/API/C/WKNotificationManager.h \
- Source/WebKit2/UIProcess/API/C/WKNotificationPermissionRequest.cpp \
- Source/WebKit2/UIProcess/API/C/WKNotificationPermissionRequest.h \
- Source/WebKit2/UIProcess/API/C/WKNotificationProvider.h \
- Source/WebKit2/UIProcess/API/C/WKOpenPanelParameters.cpp \
- Source/WebKit2/UIProcess/API/C/WKOpenPanelParameters.h \
- Source/WebKit2/UIProcess/API/C/WKOpenPanelResultListener.cpp \
- Source/WebKit2/UIProcess/API/C/WKOpenPanelResultListener.h \
- Source/WebKit2/UIProcess/API/C/WKPage.cpp \
- Source/WebKit2/UIProcess/API/C/WKPageGroup.cpp \
- Source/WebKit2/UIProcess/API/C/WKPageGroup.h \
- Source/WebKit2/UIProcess/API/C/WKPage.h \
- Source/WebKit2/UIProcess/API/C/WKPagePrivate.h \
- Source/WebKit2/UIProcess/API/C/WKPluginSiteDataManager.h \
- Source/WebKit2/UIProcess/API/C/WKPluginSiteDataManager.cpp \
- Source/WebKit2/UIProcess/API/C/WKPreferences.cpp \
- Source/WebKit2/UIProcess/API/C/WKPreferences.h \
- Source/WebKit2/UIProcess/API/C/WKPreferencesPrivate.h \
- Source/WebKit2/UIProcess/API/C/WKProtectionSpace.cpp \
- Source/WebKit2/UIProcess/API/C/WKProtectionSpace.h \
- Source/WebKit2/UIProcess/API/C/WKProtectionSpaceTypes.h \
- Source/WebKit2/UIProcess/API/C/WKResourceCacheManager.h \
- Source/WebKit2/UIProcess/API/C/WKResourceCacheManager.cpp \
- Source/WebKit2/UIProcess/API/C/WKTextChecker.h \
- Source/WebKit2/UIProcess/API/C/WKTextChecker.cpp \
- Source/WebKit2/UIProcess/API/cpp/WKRetainPtr.h \
- Source/WebKit2/UIProcess/API/gtk/PageClientImpl.h \
- Source/WebKit2/UIProcess/API/gtk/PageClientImpl.cpp \
- Source/WebKit2/UIProcess/API/gtk/WebKitBackForwardList.h \
- Source/WebKit2/UIProcess/API/gtk/WebKitBackForwardList.cpp \
- Source/WebKit2/UIProcess/API/gtk/WebKitBackForwardListItem.h \
- Source/WebKit2/UIProcess/API/gtk/WebKitBackForwardListItem.cpp \
- Source/WebKit2/UIProcess/API/gtk/WebKitBackForwardListPrivate.h \
- Source/WebKit2/UIProcess/API/gtk/WebKitCookieManager.h \
- Source/WebKit2/UIProcess/API/gtk/WebKitCookieManager.cpp \
- Source/WebKit2/UIProcess/API/gtk/WebKitCookieManagerPrivate.h \
- Source/WebKit2/UIProcess/API/gtk/WebKitDefines.h \
- Source/WebKit2/UIProcess/API/gtk/WebKitDownload.cpp \
- Source/WebKit2/UIProcess/API/gtk/WebKitDownload.h \
- Source/WebKit2/UIProcess/API/gtk/WebKitDownloadPrivate.h \
- Source/WebKit2/UIProcess/API/gtk/WebKitDownloadClient.cpp \
- Source/WebKit2/UIProcess/API/gtk/WebKitDownloadClient.h \
- Source/WebKit2/UIProcess/API/gtk/WebKitEditingCommands.h \
- Source/WebKit2/UIProcess/API/gtk/WebKitError.h \
- Source/WebKit2/UIProcess/API/gtk/WebKitError.cpp \
- Source/WebKit2/UIProcess/API/gtk/WebKitFileChooserRequest.cpp \
- Source/WebKit2/UIProcess/API/gtk/WebKitFileChooserRequest.h \
- Source/WebKit2/UIProcess/API/gtk/WebKitFileChooserRequestPrivate.h \
- Source/WebKit2/UIProcess/API/gtk/WebKitFullscreenClient.cpp \
- Source/WebKit2/UIProcess/API/gtk/WebKitFullscreenClient.h \
- Source/WebKit2/UIProcess/API/gtk/WebKitHitTestResult.cpp \
- Source/WebKit2/UIProcess/API/gtk/WebKitHitTestResult.h \
- Source/WebKit2/UIProcess/API/gtk/WebKitHitTestResultPrivate.h \
- Source/WebKit2/UIProcess/API/gtk/WebKitJavascriptResult.cpp \
- Source/WebKit2/UIProcess/API/gtk/WebKitJavascriptResult.h \
- Source/WebKit2/UIProcess/API/gtk/WebKitJavascriptResultPrivate.h \
- Source/WebKit2/UIProcess/API/gtk/WebKitLoaderClient.h \
- Source/WebKit2/UIProcess/API/gtk/WebKitLoaderClient.cpp \
- Source/WebKit2/UIProcess/API/gtk/WebKitFindController.h \
- Source/WebKit2/UIProcess/API/gtk/WebKitFindController.cpp \
- Source/WebKit2/UIProcess/API/gtk/WebKitNavigationPolicyDecision.cpp \
- Source/WebKit2/UIProcess/API/gtk/WebKitNavigationPolicyDecision.h \
- Source/WebKit2/UIProcess/API/gtk/WebKitNavigationPolicyDecisionPrivate.h \
- Source/WebKit2/UIProcess/API/gtk/WebKitPolicyDecision.cpp \
- Source/WebKit2/UIProcess/API/gtk/WebKitPolicyDecision.h \
- Source/WebKit2/UIProcess/API/gtk/WebKitPolicyDecisionPrivate.h \
- Source/WebKit2/UIProcess/API/gtk/WebKitPolicyClient.cpp \
- Source/WebKit2/UIProcess/API/gtk/WebKitPolicyClient.h \
- Source/WebKit2/UIProcess/API/gtk/WebKitPrintOperation.cpp \
- Source/WebKit2/UIProcess/API/gtk/WebKitPrintOperation.h \
- Source/WebKit2/UIProcess/API/gtk/WebKitPrintOperationPrivate.h \
- Source/WebKit2/UIProcess/API/gtk/WebKitPrivate.h \
- Source/WebKit2/UIProcess/API/gtk/WebKitPrivate.cpp \
- Source/WebKit2/UIProcess/API/gtk/WebKitResourceLoadClient.cpp \
- Source/WebKit2/UIProcess/API/gtk/WebKitResourceLoadClient.h \
- Source/WebKit2/UIProcess/API/gtk/WebKitResponsePolicyDecision.cpp \
- Source/WebKit2/UIProcess/API/gtk/WebKitResponsePolicyDecision.h \
- Source/WebKit2/UIProcess/API/gtk/WebKitResponsePolicyDecisionPrivate.h \
- Source/WebKit2/UIProcess/API/gtk/WebKitScriptDialog.cpp \
- Source/WebKit2/UIProcess/API/gtk/WebKitScriptDialog.h \
- Source/WebKit2/UIProcess/API/gtk/WebKitScriptDialogPrivate.h \
- Source/WebKit2/UIProcess/API/gtk/WebKitSettings.cpp \
- Source/WebKit2/UIProcess/API/gtk/WebKitSettings.h \
- Source/WebKit2/UIProcess/API/gtk/WebKitSettingsPrivate.h \
- Source/WebKit2/UIProcess/API/gtk/WebKitUIClient.cpp \
- Source/WebKit2/UIProcess/API/gtk/WebKitUIClient.h \
- Source/WebKit2/UIProcess/API/gtk/WebKitURIRequest.cpp \
- Source/WebKit2/UIProcess/API/gtk/WebKitURIRequest.h \
- Source/WebKit2/UIProcess/API/gtk/WebKitURIRequestPrivate.h \
- Source/WebKit2/UIProcess/API/gtk/WebKitURIResponse.cpp \
- Source/WebKit2/UIProcess/API/gtk/WebKitURIResponse.h \
- Source/WebKit2/UIProcess/API/gtk/WebKitURIResponsePrivate.h \
- Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.h \
- Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.cpp \
- Source/WebKit2/UIProcess/API/gtk/WebKitWebContextPrivate.h \
- Source/WebKit2/UIProcess/API/gtk/WebKitWebResource.cpp \
- Source/WebKit2/UIProcess/API/gtk/WebKitWebResource.h \
- Source/WebKit2/UIProcess/API/gtk/WebKitWebResourcePrivate.h \
- Source/WebKit2/UIProcess/API/gtk/WebKitWebView.h \
- Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp \
- Source/WebKit2/UIProcess/API/gtk/WebKitWebView.h \
- Source/WebKit2/UIProcess/API/gtk/WebKitWebViewPrivate.h \
- Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.h \
- Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp \
- Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBaseAccessible.h \
- Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBaseAccessible.cpp \
- Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBasePrivate.h \
- Source/WebKit2/UIProcess/API/gtk/WebKitWindowProperties.cpp \
- Source/WebKit2/UIProcess/API/gtk/WebKitWindowProperties.h \
- Source/WebKit2/UIProcess/API/gtk/WebKitWindowPropertiesPrivate.h \
- Source/WebKit2/UIProcess/API/gtk/webkit2.h \
- Source/WebKit2/UIProcess/Authentication/AuthenticationChallengeProxy.cpp \
- Source/WebKit2/UIProcess/Authentication/AuthenticationChallengeProxy.h \
- Source/WebKit2/UIProcess/Authentication/AuthenticationDecisionListener.cpp \
- Source/WebKit2/UIProcess/Authentication/AuthenticationDecisionListener.h \
- Source/WebKit2/UIProcess/Authentication/WebCredential.cpp \
- Source/WebKit2/UIProcess/Authentication/WebCredential.h \
- Source/WebKit2/UIProcess/Authentication/WebProtectionSpace.cpp \
- Source/WebKit2/UIProcess/Authentication/WebProtectionSpace.h \
- Source/WebKit2/UIProcess/BackingStore.cpp \
- Source/WebKit2/UIProcess/BackingStore.h \
- Source/WebKit2/UIProcess/Downloads/DownloadProxy.cpp \
- Source/WebKit2/UIProcess/Downloads/DownloadProxy.h \
- Source/WebKit2/UIProcess/DrawingAreaProxy.cpp \
- Source/WebKit2/UIProcess/DrawingAreaProxy.h \
- Source/WebKit2/UIProcess/DrawingAreaProxyImpl.cpp \
- Source/WebKit2/UIProcess/DrawingAreaProxyImpl.h \
- Source/WebKit2/UIProcess/FindIndicator.cpp \
- Source/WebKit2/UIProcess/FindIndicator.h \
- Source/WebKit2/UIProcess/GenericCallback.h \
- Source/WebKit2/UIProcess/GeolocationPermissionRequestManagerProxy.cpp \
- Source/WebKit2/UIProcess/GeolocationPermissionRequestManagerProxy.h \
- Source/WebKit2/UIProcess/GeolocationPermissionRequestProxy.cpp \
- Source/WebKit2/UIProcess/GeolocationPermissionRequestProxy.h \
- Source/WebKit2/UIProcess/cairo/BackingStoreCairo.cpp \
- Source/WebKit2/UIProcess/gtk/TextCheckerGtk.cpp \
- Source/WebKit2/UIProcess/gtk/WebContextGtk.cpp \
- Source/WebKit2/UIProcess/gtk/WebContextMenuProxyGtk.cpp \
- Source/WebKit2/UIProcess/gtk/WebContextMenuProxyGtk.h \
- Source/WebKit2/UIProcess/gtk/WebFullScreenClientGtk.cpp \
- Source/WebKit2/UIProcess/gtk/WebFullScreenClientGtk.h \
- Source/WebKit2/UIProcess/gtk/WebFullScreenManagerProxyGtk.cpp \
- Source/WebKit2/UIProcess/gtk/WebInspectorGtk.cpp \
- Source/WebKit2/UIProcess/gtk/WebPageProxyGtk.cpp \
- Source/WebKit2/UIProcess/gtk/WebPopupMenuProxyGtk.cpp \
- Source/WebKit2/UIProcess/gtk/WebPopupMenuProxyGtk.h \
- Source/WebKit2/UIProcess/gtk/WebPreferencesGtk.cpp \
- Source/WebKit2/UIProcess/Launcher/gtk/ProcessLauncherGtk.cpp \
- Source/WebKit2/UIProcess/Launcher/gtk/ThreadLauncherGtk.cpp \
- Source/WebKit2/UIProcess/Launcher/ProcessLauncher.cpp \
- Source/WebKit2/UIProcess/Launcher/ProcessLauncher.h \
- Source/WebKit2/UIProcess/Launcher/ThreadLauncher.cpp \
- Source/WebKit2/UIProcess/Launcher/ThreadLauncher.h \
- Source/WebKit2/UIProcess/Notifications/NotificationPermissionRequest.cpp \
- Source/WebKit2/UIProcess/Notifications/NotificationPermissionRequest.h \
- Source/WebKit2/UIProcess/Notifications/NotificationPermissionRequestManagerProxy.cpp \
- Source/WebKit2/UIProcess/Notifications/NotificationPermissionRequestManagerProxy.h \
- Source/WebKit2/UIProcess/Notifications/WebNotification.cpp \
- Source/WebKit2/UIProcess/Notifications/WebNotification.h \
- Source/WebKit2/UIProcess/Notifications/WebNotificationManagerProxy.cpp \
- Source/WebKit2/UIProcess/Notifications/WebNotificationManagerProxy.h \
- Source/WebKit2/UIProcess/Notifications/WebNotificationProvider.cpp \
- Source/WebKit2/UIProcess/Notifications/WebNotificationProvider.h \
- Source/WebKit2/UIProcess/PageClient.h \
- Source/WebKit2/UIProcess/Plugins/PluginInfoStore.cpp \
- Source/WebKit2/UIProcess/Plugins/PluginInfoStore.h \
- Source/WebKit2/UIProcess/Plugins/PluginProcessManager.cpp \
- Source/WebKit2/UIProcess/Plugins/PluginProcessManager.h \
- Source/WebKit2/UIProcess/Plugins/PluginProcessProxy.cpp \
- Source/WebKit2/UIProcess/Plugins/PluginProcessProxy.h \
- Source/WebKit2/UIProcess/Plugins/WebPluginSiteDataManager.h \
- Source/WebKit2/UIProcess/Plugins/WebPluginSiteDataManager.cpp \
- Source/WebKit2/UIProcess/Plugins/gtk/PluginProcessProxyGtk.cpp \
- Source/WebKit2/UIProcess/Plugins/unix/PluginInfoStoreUnix.cpp \
- Source/WebKit2/UIProcess/ProcessModel.h \
- Source/WebKit2/UIProcess/ResponsivenessTimer.cpp \
- Source/WebKit2/UIProcess/ResponsivenessTimer.h \
- Source/WebKit2/UIProcess/soup/WebSoupRequestManagerClient.cpp \
- Source/WebKit2/UIProcess/soup/WebSoupRequestManagerClient.h \
- Source/WebKit2/UIProcess/soup/WebSoupRequestManagerProxy.cpp \
- Source/WebKit2/UIProcess/soup/WebSoupRequestManagerProxy.h \
- Source/WebKit2/UIProcess/TextChecker.h \
- Source/WebKit2/UIProcess/VisitedLinkProvider.cpp \
- Source/WebKit2/UIProcess/VisitedLinkProvider.h \
- Source/WebKit2/UIProcess/WebApplicationCacheManagerProxy.h \
- Source/WebKit2/UIProcess/WebApplicationCacheManagerProxy.cpp \
- Source/WebKit2/UIProcess/WebBackForwardList.cpp \
- Source/WebKit2/UIProcess/WebBackForwardList.h \
- Source/WebKit2/UIProcess/WebConnectionToWebProcess.cpp \
- Source/WebKit2/UIProcess/WebConnectionToWebProcess.h \
- Source/WebKit2/UIProcess/WebContext.cpp \
- Source/WebKit2/UIProcess/WebContext.h \
- Source/WebKit2/UIProcess/WebContextConnectionClient.cpp \
- Source/WebKit2/UIProcess/WebContextConnectionClient.h \
- Source/WebKit2/UIProcess/WebContextInjectedBundleClient.cpp \
- Source/WebKit2/UIProcess/WebContextInjectedBundleClient.h \
- Source/WebKit2/UIProcess/WebContextMenuProxy.cpp \
- Source/WebKit2/UIProcess/WebContextMenuProxy.h \
- Source/WebKit2/UIProcess/WebContextUserMessageCoders.h \
- Source/WebKit2/UIProcess/WebCookieManagerProxy.h \
- Source/WebKit2/UIProcess/WebCookieManagerProxy.cpp \
- Source/WebKit2/UIProcess/WebCookieManagerProxyClient.cpp \
- Source/WebKit2/UIProcess/WebCookieManagerProxyClient.h \
- Source/WebKit2/UIProcess/WebDatabaseManagerProxyClient.cpp \
- Source/WebKit2/UIProcess/WebDatabaseManagerProxyClient.h \
- Source/WebKit2/UIProcess/WebDatabaseManagerProxy.cpp \
- Source/WebKit2/UIProcess/WebDatabaseManagerProxy.h \
- Source/WebKit2/UIProcess/WebDownloadClient.cpp \
- Source/WebKit2/UIProcess/WebDownloadClient.h \
- Source/WebKit2/UIProcess/WebEditCommandProxy.cpp \
- Source/WebKit2/UIProcess/WebEditCommandProxy.h \
- Source/WebKit2/UIProcess/WebFindClient.cpp \
- Source/WebKit2/UIProcess/WebFindClient.h \
- Source/WebKit2/UIProcess/WebFormClient.cpp \
- Source/WebKit2/UIProcess/WebFormClient.h \
- Source/WebKit2/UIProcess/WebFormSubmissionListenerProxy.cpp \
- Source/WebKit2/UIProcess/WebFormSubmissionListenerProxy.h \
- Source/WebKit2/UIProcess/WebFrameListenerProxy.cpp \
- Source/WebKit2/UIProcess/WebFrameListenerProxy.h \
- Source/WebKit2/UIProcess/WebFramePolicyListenerProxy.cpp \
- Source/WebKit2/UIProcess/WebFramePolicyListenerProxy.h \
- Source/WebKit2/UIProcess/WebFrameProxy.cpp \
- Source/WebKit2/UIProcess/WebFrameProxy.h \
- Source/WebKit2/UIProcess/WebFullScreenManagerProxy.cpp \
- Source/WebKit2/UIProcess/WebFullScreenManagerProxy.h \
- Source/WebKit2/UIProcess/WebGeolocationManagerProxy.cpp \
- Source/WebKit2/UIProcess/WebGeolocationManagerProxy.h \
- Source/WebKit2/UIProcess/WebGeolocationProvider.cpp \
- Source/WebKit2/UIProcess/WebGeolocationProvider.h \
- Source/WebKit2/UIProcess/WebGrammarDetail.cpp \
- Source/WebKit2/UIProcess/WebGrammarDetail.h \
- Source/WebKit2/UIProcess/WebHistoryClient.cpp \
- Source/WebKit2/UIProcess/WebHistoryClient.h \
- Source/WebKit2/UIProcess/WebIconDatabase.cpp \
- Source/WebKit2/UIProcess/WebIconDatabase.h \
- Source/WebKit2/UIProcess/WebIconDatabaseClient.cpp \
- Source/WebKit2/UIProcess/WebIconDatabaseClient.h \
- Source/WebKit2/UIProcess/WebInspectorProxy.cpp \
- Source/WebKit2/UIProcess/WebInspectorProxy.h \
- Source/WebKit2/UIProcess/WebKeyValueStorageManagerProxy.cpp \
- Source/WebKit2/UIProcess/WebKeyValueStorageManagerProxy.h \
- Source/WebKit2/UIProcess/WebMediaCacheManagerProxy.cpp \
- Source/WebKit2/UIProcess/WebMediaCacheManagerProxy.h \
- Source/WebKit2/UIProcess/WebLoaderClient.cpp \
- Source/WebKit2/UIProcess/WebLoaderClient.h \
- Source/WebKit2/UIProcess/WebNavigationData.cpp \
- Source/WebKit2/UIProcess/WebNavigationData.h \
- Source/WebKit2/UIProcess/WebOpenPanelResultListenerProxy.cpp \
- Source/WebKit2/UIProcess/WebOpenPanelResultListenerProxy.h \
- Source/WebKit2/UIProcess/WebPageContextMenuClient.cpp \
- Source/WebKit2/UIProcess/WebPageContextMenuClient.h \
- Source/WebKit2/UIProcess/WebPageGroup.cpp \
- Source/WebKit2/UIProcess/WebPageGroup.h \
- Source/WebKit2/UIProcess/WebPageProxy.cpp \
- Source/WebKit2/UIProcess/WebPageProxy.h \
- Source/WebKit2/UIProcess/WebPolicyClient.cpp \
- Source/WebKit2/UIProcess/WebPolicyClient.h \
- Source/WebKit2/UIProcess/WebPopupMenuProxy.h \
- Source/WebKit2/UIProcess/WebPreferences.cpp \
- Source/WebKit2/UIProcess/WebPreferences.h \
- Source/WebKit2/UIProcess/WebProcessProxy.cpp \
- Source/WebKit2/UIProcess/WebProcessProxy.h \
- Source/WebKit2/UIProcess/WebResourceCacheManagerProxy.h \
- Source/WebKit2/UIProcess/WebResourceCacheManagerProxy.cpp \
- Source/WebKit2/UIProcess/WebResourceLoadClient.cpp \
- Source/WebKit2/UIProcess/WebResourceLoadClient.h \
- Source/WebKit2/UIProcess/WebTextChecker.cpp \
- Source/WebKit2/UIProcess/WebTextChecker.h \
- Source/WebKit2/UIProcess/WebTextCheckerClient.cpp \
- Source/WebKit2/UIProcess/WebTextCheckerClient.h \
- Source/WebKit2/UIProcess/WebUIClient.cpp \
- Source/WebKit2/UIProcess/WebUIClient.h \
- Source/WebKit2/WebKit2Prefix.h \
- Source/WebKit2/WebProcess/ApplicationCache/WebApplicationCacheManager.h \
- Source/WebKit2/WebProcess/ApplicationCache/WebApplicationCacheManager.cpp \
- Source/WebKit2/WebProcess/Authentication/AuthenticationManager.cpp \
- Source/WebKit2/WebProcess/Authentication/AuthenticationManager.h \
- Source/WebKit2/WebProcess/Cookies/WebCookieManager.h \
- Source/WebKit2/WebProcess/Cookies/WebCookieManager.cpp \
- Source/WebKit2/WebProcess/Cookies/soup/WebCookieManagerSoup.cpp \
- Source/WebKit2/WebProcess/Downloads/Download.cpp \
- Source/WebKit2/WebProcess/Downloads/Download.h \
- Source/WebKit2/WebProcess/Downloads/DownloadAuthenticationClient.h \
- Source/WebKit2/WebProcess/Downloads/DownloadManager.cpp \
- Source/WebKit2/WebProcess/Downloads/DownloadManager.h \
- Source/WebKit2/WebProcess/Downloads/soup/DownloadSoup.cpp \
- Source/WebKit2/WebProcess/FullScreen/WebFullScreenManager.cpp \
- Source/WebKit2/WebProcess/FullScreen/WebFullScreenManager.h \
- Source/WebKit2/WebProcess/Geolocation/GeolocationPermissionRequestManager.cpp \
- Source/WebKit2/WebProcess/Geolocation/GeolocationPermissionRequestManager.h \
- Source/WebKit2/WebProcess/Geolocation/WebGeolocationManager.cpp \
- Source/WebKit2/WebProcess/Geolocation/WebGeolocationManager.h \
- Source/WebKit2/WebProcess/gtk/WebAuthDialog.cpp \
- Source/WebKit2/WebProcess/gtk/WebAuthDialog.h \
- Source/WebKit2/WebProcess/gtk/WebProcessGtk.cpp \
- Source/WebKit2/WebProcess/gtk/WebProcessMainGtk.cpp \
- Source/WebKit2/WebProcess/gtk/WebProcessMainGtk.h \
- Source/WebKit2/WebProcess/IconDatabase/WebIconDatabaseProxy.cpp \
- Source/WebKit2/WebProcess/IconDatabase/WebIconDatabaseProxy.h \
- Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleAPICast.h \
- Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleBackForwardList.cpp \
- Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleBackForwardList.h \
- Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleBackForwardListItem.cpp \
- Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleBackForwardListItem.h \
- Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundle.cpp \
- Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleDOMWindowExtension.cpp \
- Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleDOMWindowExtension.h \
- Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp \
- Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleFrame.h \
- Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleFramePrivate.h \
- Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundle.h \
- Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleHitTestResult.cpp \
- Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleHitTestResult.h \
- Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleNavigationAction.h \
- Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleNavigationAction.cpp \
- 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/WKBundleNodeHandle.cpp \
- Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.h \
- Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleNodeHandlePrivate.h \
- Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp \
- Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePageGroup.cpp \
- Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePageGroup.h \
- Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.h \
- Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp \
- Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.h \
- Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h \
- Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePrivate.h \
- Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleRangeHandle.cpp \
- Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleRangeHandle.h \
- Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleScriptWorld.cpp \
- Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleScriptWorld.h \
- Source/WebKit2/WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp \
- Source/WebKit2/WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h \
- Source/WebKit2/WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp \
- Source/WebKit2/WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.h \
- Source/WebKit2/WebProcess/InjectedBundle/gtk/InjectedBundleGtk.cpp \
- Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp \
- Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.h \
- Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleBackForwardList.cpp \
- Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleBackForwardList.h \
- Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleBackForwardListItem.cpp \
- Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleBackForwardListItem.h \
- Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleClient.cpp \
- Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleClient.h \
- Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleDOMWindowExtension.cpp \
- Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleDOMWindowExtension.h \
- Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleHitTestResult.cpp \
- Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleHitTestResult.h \
- Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleNavigationAction.cpp \
- Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleNavigationAction.h \
- Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageContextMenuClient.cpp \
- Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageContextMenuClient.h \
- Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageEditorClient.cpp \
- Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageEditorClient.h \
- Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageFormClient.cpp \
- Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageFormClient.h \
- Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageFullScreenClient.cpp \
- Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageFullScreenClient.h \
- Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp \
- Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h \
- Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePagePolicyClient.cpp \
- Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePagePolicyClient.h \
- Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageResourceLoadClient.cpp \
- Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageResourceLoadClient.h \
- Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp \
- Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageUIClient.h \
- Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleScriptWorld.cpp \
- Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleScriptWorld.h \
- Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleUserMessageCoders.h \
- Source/WebKit2/WebProcess/KeyValueStorage/WebKeyValueStorageManager.cpp \
- Source/WebKit2/WebProcess/KeyValueStorage/WebKeyValueStorageManager.h \
- Source/WebKit2/WebProcess/MediaCache/WebMediaCacheManager.cpp \
- Source/WebKit2/WebProcess/MediaCache/WebMediaCacheManager.h \
- Source/WebKit2/WebProcess/Notifications/NotificationPermissionRequestManager.cpp \
- Source/WebKit2/WebProcess/Notifications/NotificationPermissionRequestManager.h \
- Source/WebKit2/WebProcess/Notifications/WebNotificationManager.cpp \
- Source/WebKit2/WebProcess/Notifications/WebNotificationManager.h \
- Source/WebKit2/WebProcess/Plugins/Netscape/JSNPMethod.cpp \
- Source/WebKit2/WebProcess/Plugins/Netscape/JSNPMethod.h \
- Source/WebKit2/WebProcess/Plugins/Netscape/JSNPObject.cpp \
- Source/WebKit2/WebProcess/Plugins/Netscape/JSNPObject.h \
- Source/WebKit2/WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp \
- Source/WebKit2/WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.h \
- Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.cpp \
- Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.h \
- Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePluginNone.cpp \
- Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePluginStream.cpp \
- Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePluginStream.h \
- Source/WebKit2/WebProcess/Plugins/Netscape/NPJSObject.cpp \
- Source/WebKit2/WebProcess/Plugins/Netscape/NPJSObject.h \
- Source/WebKit2/WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp \
- Source/WebKit2/WebProcess/Plugins/Netscape/NPRuntimeObjectMap.h \
- Source/WebKit2/WebProcess/Plugins/Netscape/NPRuntimeUtilities.cpp \
- Source/WebKit2/WebProcess/Plugins/Netscape/NPRuntimeUtilities.h \
- Source/WebKit2/WebProcess/Plugins/Netscape/gtk/PluginProxyGtk.cpp \
- Source/WebKit2/WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp \
- Source/WebKit2/WebProcess/Plugins/PluginController.h \
- Source/WebKit2/WebProcess/Plugins/Plugin.cpp \
- Source/WebKit2/WebProcess/Plugins/Plugin.h \
- Source/WebKit2/WebProcess/Plugins/PluginProcessConnection.cpp \
- Source/WebKit2/WebProcess/Plugins/PluginProcessConnection.h \
- Source/WebKit2/WebProcess/Plugins/PluginProcessConnectionManager.cpp \
- Source/WebKit2/WebProcess/Plugins/PluginProcessConnectionManager.h \
- Source/WebKit2/WebProcess/Plugins/PluginProxy.cpp \
- Source/WebKit2/WebProcess/Plugins/PluginProxy.h \
- Source/WebKit2/WebProcess/Plugins/PluginView.cpp \
- Source/WebKit2/WebProcess/Plugins/PluginView.h \
- Source/WebKit2/WebProcess/ResourceCache/WebResourceCacheManager.h \
- Source/WebKit2/WebProcess/ResourceCache/WebResourceCacheManager.cpp \
- Source/WebKit2/WebProcess/soup/WebSoupRequestManager.cpp \
- Source/WebKit2/WebProcess/soup/WebSoupRequestManager.h \
- Source/WebKit2/WebProcess/soup/WebKitSoupRequestGeneric.cpp \
- Source/WebKit2/WebProcess/soup/WebKitSoupRequestGeneric.h \
- Source/WebKit2/WebProcess/WebCoreSupport/gtk/WebContextMenuClientGtk.cpp \
- Source/WebKit2/WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp \
- Source/WebKit2/WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp \
- Source/WebKit2/WebProcess/WebCoreSupport/gtk/WebErrorsGtk.cpp \
- Source/WebKit2/WebProcess/WebCoreSupport/gtk/WebPopupMenuGtk.cpp \
- Source/WebKit2/WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.cpp \
- Source/WebKit2/WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.h \
- Source/WebKit2/WebProcess/WebCoreSupport/WebAlternativeTextClient.h \
- Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp \
- Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h \
- Source/WebKit2/WebProcess/WebCoreSupport/WebContextMenuClient.cpp \
- Source/WebKit2/WebProcess/WebCoreSupport/WebContextMenuClient.h \
- Source/WebKit2/WebProcess/WebCoreSupport/WebDatabaseManager.cpp \
- Source/WebKit2/WebProcess/WebCoreSupport/WebDatabaseManager.h \
- Source/WebKit2/WebProcess/WebCoreSupport/WebDragClient.cpp \
- Source/WebKit2/WebProcess/WebCoreSupport/WebDragClient.h \
- Source/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.cpp \
- Source/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.h \
- Source/WebKit2/WebProcess/WebCoreSupport/WebErrors.h \
- Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp \
- Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.h \
- Source/WebKit2/WebProcess/WebCoreSupport/WebGeolocationClient.cpp \
- Source/WebKit2/WebProcess/WebCoreSupport/WebGeolocationClient.h \
- Source/WebKit2/WebProcess/WebCoreSupport/WebInspectorClient.cpp \
- Source/WebKit2/WebProcess/WebCoreSupport/WebInspectorClient.h \
- Source/WebKit2/WebProcess/WebCoreSupport/WebInspectorFrontendClient.cpp \
- Source/WebKit2/WebProcess/WebCoreSupport/WebInspectorFrontendClient.h \
- Source/WebKit2/WebProcess/WebCoreSupport/WebNotificationClient.cpp \
- Source/WebKit2/WebProcess/WebCoreSupport/WebNotificationClient.h \
- Source/WebKit2/WebProcess/WebCoreSupport/WebPlatformStrategies.cpp \
- Source/WebKit2/WebProcess/WebCoreSupport/WebPlatformStrategies.h \
- Source/WebKit2/WebProcess/WebCoreSupport/WebPopupMenu.cpp \
- Source/WebKit2/WebProcess/WebCoreSupport/WebPopupMenu.h \
- Source/WebKit2/WebProcess/WebCoreSupport/WebSearchPopupMenu.cpp \
- Source/WebKit2/WebProcess/WebCoreSupport/WebSearchPopupMenu.h \
- Source/WebKit2/WebProcess/WebPage/DecoderAdapter.cpp \
- Source/WebKit2/WebProcess/WebPage/DecoderAdapter.h \
- Source/WebKit2/WebProcess/WebPage/DrawingArea.cpp \
- Source/WebKit2/WebProcess/WebPage/DrawingArea.h \
- Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp \
- Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.h \
- Source/WebKit2/WebProcess/WebPage/EncoderAdapter.cpp \
- Source/WebKit2/WebProcess/WebPage/EncoderAdapter.h \
- Source/WebKit2/WebProcess/WebPage/EventDispatcher.cpp \
- Source/WebKit2/WebProcess/WebPage/EventDispatcher.h \
- Source/WebKit2/WebProcess/WebPage/FindController.cpp \
- Source/WebKit2/WebProcess/WebPage/FindController.h \
- Source/WebKit2/WebProcess/WebPage/TapHighlightController.cpp \
- Source/WebKit2/WebProcess/WebPage/TapHighlightController.h \
- Source/WebKit2/WebProcess/WebPage/gtk/WebInspectorGtk.cpp \
- Source/WebKit2/WebProcess/WebPage/gtk/WebPageAccessibilityObject.h \
- Source/WebKit2/WebProcess/WebPage/gtk/WebPageAccessibilityObject.cpp \
- Source/WebKit2/WebProcess/WebPage/gtk/WebPageGtk.cpp \
- Source/WebKit2/WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp \
- Source/WebKit2/WebProcess/WebPage/gtk/WebPrintOperationGtk.h \
- Source/WebKit2/WebProcess/WebPage/LayerTreeHost.cpp \
- Source/WebKit2/WebProcess/WebPage/LayerTreeHost.h \
- Source/WebKit2/WebProcess/WebPage/PageOverlay.cpp \
- Source/WebKit2/WebProcess/WebPage/PageOverlay.h \
- Source/WebKit2/WebProcess/WebPage/WebBackForwardListProxy.cpp \
- Source/WebKit2/WebProcess/WebPage/WebBackForwardListProxy.h \
- Source/WebKit2/WebProcess/WebPage/WebContextMenu.cpp \
- Source/WebKit2/WebProcess/WebPage/WebContextMenu.h \
- Source/WebKit2/WebProcess/WebPage/WebFrame.cpp \
- Source/WebKit2/WebProcess/WebPage/WebFrame.h \
- Source/WebKit2/WebProcess/WebPage/WebInspector.cpp \
- Source/WebKit2/WebProcess/WebPage/WebInspector.h \
- Source/WebKit2/WebProcess/WebPage/WebOpenPanelResultListener.cpp \
- Source/WebKit2/WebProcess/WebPage/WebOpenPanelResultListener.h \
- Source/WebKit2/WebProcess/WebPage/WebPage.cpp \
- Source/WebKit2/WebProcess/WebPage/WebPageGroupProxy.cpp \
- Source/WebKit2/WebProcess/WebPage/WebPageGroupProxy.h \
- Source/WebKit2/WebProcess/WebPage/WebPage.h \
- Source/WebKit2/WebProcess/WebPage/WebUndoStep.cpp \
- Source/WebKit2/WebProcess/WebPage/WebUndoStep.h \
- Source/WebKit2/WebProcess/WebConnectionToUIProcess.cpp \
- Source/WebKit2/WebProcess/WebConnectionToUIProcess.h \
- Source/WebKit2/WebProcess/WebProcess.cpp \
- Source/WebKit2/WebProcess/WebProcess.h
+ $(webkit2_built_sources) \
+ $(webkit2gtk_built_sources)
libwebkit2gtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_SOURCES = \
$(webkit2_sources)
@@ -1158,7 +144,7 @@ libwebkit2gtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_CPP
endif
libwebkit2gtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_LDFLAGS = \
- -version-info @LIBWEBKITGTK_VERSION@ \
+ -version-info @LIBWEBKIT2GTK_VERSION@ \
$(version_script) \
$(no_undefined)
@@ -1454,109 +440,8 @@ Programs_WebKitPluginProcess_CFLAGS = \
$(LIBSOUP_CFLAGS) \
$(UNICODE_CFLAGS)
-webkit2_plugin_process_built_sources += \
- DerivedSources/WebKit2/NPObjectMessageReceiverMessageReceiver.cpp \
- DerivedSources/WebKit2/NPObjectMessageReceiverMessages.h \
- DerivedSources/WebKit2/PluginControllerProxyMessageReceiver.cpp \
- DerivedSources/WebKit2/PluginControllerProxyMessages.h \
- DerivedSources/WebKit2/PluginProcessMessageReceiver.cpp \
- DerivedSources/WebKit2/PluginProcessMessages.h \
- DerivedSources/WebKit2/WebProcessConnectionMessageReceiver.cpp \
- DerivedSources/WebKit2/WebProcessConnectionMessages.h
-nodist_Programs_WebKitPluginProcess_SOURCES = $(webkit2_plugin_process_built_sources)
-BUILT_SOURCES += $(nodist_Programs_WebKitPluginProcess_SOURCES)
-
-webkit2_plugin_process_sources += \
- Source/WebKit2/Platform/CoreIPC/ArgumentCoder.h \
- Source/WebKit2/Platform/CoreIPC/ArgumentCoders.h \
- Source/WebKit2/Platform/CoreIPC/ArgumentCoders.cpp \
- Source/WebKit2/Platform/CoreIPC/ArgumentDecoder.cpp \
- Source/WebKit2/Platform/CoreIPC/ArgumentDecoder.h \
- Source/WebKit2/Platform/CoreIPC/ArgumentEncoder.cpp \
- Source/WebKit2/Platform/CoreIPC/ArgumentEncoder.h \
- Source/WebKit2/Platform/CoreIPC/Arguments.h \
- Source/WebKit2/Platform/CoreIPC/Attachment.cpp \
- Source/WebKit2/Platform/CoreIPC/Attachment.h \
- Source/WebKit2/Platform/CoreIPC/BinarySemaphore.cpp \
- Source/WebKit2/Platform/CoreIPC/BinarySemaphore.h \
- Source/WebKit2/Platform/CoreIPC/Connection.cpp \
- Source/WebKit2/Platform/CoreIPC/Connection.h \
- Source/WebKit2/Platform/CoreIPC/CoreIPCMessageKinds.h \
- Source/WebKit2/Platform/CoreIPC/DataReference.cpp \
- Source/WebKit2/Platform/CoreIPC/DataReference.h \
- Source/WebKit2/Platform/CoreIPC/HandleMessage.h \
- Source/WebKit2/Platform/CoreIPC/MessageID.h \
- Source/WebKit2/Platform/CoreIPC/MessageSender.h \
- Source/WebKit2/Platform/CoreIPC/unix/AttachmentUnix.cpp \
- Source/WebKit2/Platform/CoreIPC/unix/ConnectionUnix.cpp \
- Source/WebKit2/Platform/Module.cpp \
- Source/WebKit2/Platform/Module.h \
- Source/WebKit2/Platform/WorkQueue.cpp \
- Source/WebKit2/Platform/WorkQueue.h \
- Source/WebKit2/Platform/SharedMemory.h \
- Source/WebKit2/Platform/gtk/ModuleGtk.cpp \
- Source/WebKit2/Platform/gtk/WorkQueueGtk.cpp \
- Source/WebKit2/Platform/unix/SharedMemoryUnix.cpp \
- Source/WebKit2/PluginProcess/PluginControllerProxy.cpp \
- Source/WebKit2/PluginProcess/PluginControllerProxy.h \
- Source/WebKit2/PluginProcess/PluginCreationParameters.cpp \
- Source/WebKit2/PluginProcess/PluginCreationParameters.h \
- Source/WebKit2/PluginProcess/PluginProcess.cpp \
- Source/WebKit2/PluginProcess/PluginProcess.h \
- Source/WebKit2/PluginProcess/PluginProcessMain.h \
- Source/WebKit2/PluginProcess/WebProcessConnection.cpp \
- Source/WebKit2/PluginProcess/WebProcessConnection.h \
- Source/WebKit2/Shared/Plugins/PluginProcessCreationParameters.cpp \
- Source/WebKit2/Shared/Plugins/PluginProcessCreationParameters.h \
- Source/WebKit2/PluginProcess/gtk/PluginControllerProxyGtk.cpp \
- Source/WebKit2/PluginProcess/gtk/PluginProcessGtk.cpp \
- Source/WebKit2/PluginProcess/gtk/PluginProcessMainGtk.h \
- Source/WebKit2/PluginProcess/gtk/PluginProcessMainGtk.cpp \
- Source/WebKit2/Shared/ChildProcess.cpp \
- Source/WebKit2/Shared/ChildProcess.h \
- Source/WebKit2/Shared/ProcessExecutablePath.h \
- Source/WebKit2/Shared/Plugins/NPIdentifierData.cpp \
- Source/WebKit2/Shared/Plugins/NPIdentifierData.h \
- Source/WebKit2/Shared/Plugins/NPObjectMessageReceiver.cpp \
- Source/WebKit2/Shared/Plugins/NPObjectMessageReceiver.h \
- Source/WebKit2/Shared/Plugins/NPObjectProxy.cpp \
- Source/WebKit2/Shared/Plugins/NPObjectProxy.h \
- Source/WebKit2/Shared/Plugins/NPRemoteObjectMap.cpp \
- Source/WebKit2/Shared/Plugins/NPRemoteObjectMap.h \
- Source/WebKit2/Shared/Plugins/NPVariantData.cpp \
- Source/WebKit2/Shared/Plugins/NPVariantData.h \
- Source/WebKit2/Shared/Plugins/Netscape/NetscapePluginModule.cpp \
- Source/WebKit2/Shared/Plugins/Netscape/NetscapePluginModule.h \
- Source/WebKit2/Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp \
- Source/WebKit2/Shared/ShareableBitmap.cpp \
- Source/WebKit2/Shared/ShareableBitmap.h \
- Source/WebKit2/Shared/WebCoreArgumentCoders.cpp \
- Source/WebKit2/Shared/WebCoreArgumentCoders.h \
- Source/WebKit2/Shared/WebEvent.cpp \
- Source/WebKit2/Shared/WebEvent.h \
- Source/WebKit2/Shared/WebKeyboardEvent.cpp \
- Source/WebKit2/Shared/WebMouseEvent.cpp \
- Source/WebKit2/Shared/WebWheelEvent.cpp \
- Source/WebKit2/Shared/gtk/WebCoreArgumentCodersGtk.cpp \
- Source/WebKit2/Shared/gtk/NativeWebKeyboardEventGtk.cpp \
- Source/WebKit2/Shared/gtk/NativeWebWheelEventGtk.cpp \
- Source/WebKit2/Shared/gtk/NativeWebMouseEventGtk.cpp \
- Source/WebKit2/Shared/gtk/ProcessExecutablePathGtk.cpp \
- Source/WebKit2/Shared/gtk/WebEventFactory.cpp \
- Source/WebKit2/Shared/cairo/ShareableBitmapCairo.cpp \
- Source/WebKit2/UIProcess/Plugins/gtk/PluginProcessProxyGtk.cpp \
- Source/WebKit2/WebProcess/Plugins/Plugin.cpp \
- Source/WebKit2/WebProcess/Plugins/Plugin.h \
- Source/WebKit2/WebProcess/Plugins/Netscape/NPRuntimeUtilities.cpp \
- Source/WebKit2/WebProcess/Plugins/Netscape/NPRuntimeUtilities.h \
- Source/WebKit2/WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp \
- Source/WebKit2/WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.h \
- Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.cpp \
- Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.h \
- Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePluginStream.cpp \
- Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePluginStream.h \
- Source/WebKit2/WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp \
- Source/WebKit2/gtk/PluginMainGtk.cpp
+nodist_Programs_WebKitPluginProcess_SOURCES = \
+ $(webkit2_plugin_process_built_sources)
Programs_WebKitPluginProcess_SOURCES = \
$(webkit2_plugin_process_sources)
diff --git a/Source/WebKit2/GNUmakefile.list.am b/Source/WebKit2/GNUmakefile.list.am
new file mode 100644
index 000000000..d45783f22
--- /dev/null
+++ b/Source/WebKit2/GNUmakefile.list.am
@@ -0,0 +1,1126 @@
+webkit2_h_api += \
+ $(WebKit2)/Shared/API/c/gtk/WKBaseGtk.h \
+ $(WebKit2)/Shared/API/c/gtk/WKGraphicsContextGtk.h \
+ $(WebKit2)/Shared/API/c/soup/WKBaseSoup.h \
+ $(WebKit2)/Shared/API/c/WKArray.h \
+ $(WebKit2)/Shared/API/c/WKBase.h \
+ $(WebKit2)/Shared/API/c/WKCertificateInfo.h \
+ $(WebKit2)/Shared/API/c/WKConnectionRef.h \
+ $(WebKit2)/Shared/API/c/WKContextMenuItem.h \
+ $(WebKit2)/Shared/API/c/WKContextMenuItemTypes.h \
+ $(WebKit2)/Shared/API/c/WKData.h \
+ $(WebKit2)/Shared/API/c/WKDictionary.h \
+ $(WebKit2)/Shared/API/c/WKError.h \
+ $(WebKit2)/Shared/API/c/WKEvent.h \
+ $(WebKit2)/Shared/API/c/WKFindOptions.h \
+ $(WebKit2)/Shared/API/c/WKGeometry.h \
+ $(WebKit2)/Shared/API/c/WKGraphicsContext.h \
+ $(WebKit2)/Shared/API/c/WKImage.h \
+ $(WebKit2)/Shared/API/c/WKMutableArray.h \
+ $(WebKit2)/Shared/API/c/WKMutableDictionary.h \
+ $(WebKit2)/Shared/API/c/WKNumber.h \
+ $(WebKit2)/Shared/API/c/WKPageLoadTypes.h \
+ $(WebKit2)/Shared/API/c/WKRenderLayer.h \
+ $(WebKit2)/Shared/API/c/WKRenderObject.h \
+ $(WebKit2)/Shared/API/c/WKSecurityOrigin.h \
+ $(WebKit2)/Shared/API/c/WKSerializedScriptValue.h \
+ $(WebKit2)/Shared/API/c/WKSerializedScriptValuePrivate.h \
+ $(WebKit2)/Shared/API/c/WKSharedAPICast.h \
+ $(WebKit2)/Shared/API/c/WKString.h \
+ $(WebKit2)/Shared/API/c/WKStringPrivate.h \
+ $(WebKit2)/Shared/API/c/WKType.h \
+ $(WebKit2)/Shared/API/c/WKURL.h \
+ $(WebKit2)/Shared/API/c/WKURLRequest.h \
+ $(WebKit2)/Shared/API/c/WKURLResponse.h \
+ $(WebKit2)/Shared/API/c/WKUserContentURLPattern.h \
+ $(WebKit2)/UIProcess/API/C/gtk/WKAPICastGtk.h \
+ $(WebKit2)/UIProcess/API/C/gtk/WKFullScreenClientGtk.h \
+ $(WebKit2)/UIProcess/API/C/gtk/WKView.h \
+ $(WebKit2)/UIProcess/API/C/soup/WKAPICastSoup.h \
+ $(WebKit2)/UIProcess/API/C/soup/WKContextSoup.h \
+ $(WebKit2)/UIProcess/API/C/soup/WKSoupRequestManager.h \
+ $(WebKit2)/UIProcess/API/C/WebKit2.h \
+ $(WebKit2)/UIProcess/API/C/WKAPICast.h \
+ $(WebKit2)/UIProcess/API/C/WKApplicationCacheManager.h \
+ $(WebKit2)/UIProcess/API/C/WKAuthenticationChallenge.h \
+ $(WebKit2)/UIProcess/API/C/WKAuthenticationDecisionListener.h \
+ $(WebKit2)/UIProcess/API/C/WKBackForwardList.h \
+ $(WebKit2)/UIProcess/API/C/WKBackForwardListItem.h \
+ $(WebKit2)/UIProcess/API/C/WKContext.h \
+ $(WebKit2)/UIProcess/API/C/WKContextPrivate.h \
+ $(WebKit2)/UIProcess/API/C/WKCookieManager.h \
+ $(WebKit2)/UIProcess/API/C/WKCredential.h \
+ $(WebKit2)/UIProcess/API/C/WKCredentialTypes.h \
+ $(WebKit2)/UIProcess/API/C/WKDatabaseManager.h \
+ $(WebKit2)/UIProcess/API/C/WKDownload.h \
+ $(WebKit2)/UIProcess/API/C/WKFormSubmissionListener.h \
+ $(WebKit2)/UIProcess/API/C/WKFrame.h \
+ $(WebKit2)/UIProcess/API/C/WKFramePolicyListener.h \
+ $(WebKit2)/UIProcess/API/C/WKGeolocationManager.h \
+ $(WebKit2)/UIProcess/API/C/WKGeolocationPermissionRequest.h \
+ $(WebKit2)/UIProcess/API/C/WKGeolocationPosition.h \
+ $(WebKit2)/UIProcess/API/C/WKGrammarDetail.h \
+ $(WebKit2)/UIProcess/API/C/WKHitTestResult.h \
+ $(WebKit2)/UIProcess/API/C/WKInspector.h \
+ $(WebKit2)/UIProcess/API/C/WKKeyValueStorageManager.h \
+ $(WebKit2)/UIProcess/API/C/WKMediaCacheManager.h \
+ $(WebKit2)/UIProcess/API/C/WKNativeEvent.h \
+ $(WebKit2)/UIProcess/API/C/WKNavigationData.h \
+ $(WebKit2)/UIProcess/API/C/WKNotification.h \
+ $(WebKit2)/UIProcess/API/C/WKNotificationManager.h \
+ $(WebKit2)/UIProcess/API/C/WKNotificationPermissionRequest.h \
+ $(WebKit2)/UIProcess/API/C/WKNotificationProvider.h \
+ $(WebKit2)/UIProcess/API/C/WKOpenPanelParameters.h \
+ $(WebKit2)/UIProcess/API/C/WKOpenPanelResultListener.h \
+ $(WebKit2)/UIProcess/API/C/WKPageGroup.h \
+ $(WebKit2)/UIProcess/API/C/WKPage.h \
+ $(WebKit2)/UIProcess/API/C/WKPagePrivate.h \
+ $(WebKit2)/UIProcess/API/C/WKPluginSiteDataManager.h \
+ $(WebKit2)/UIProcess/API/C/WKPreferences.h \
+ $(WebKit2)/UIProcess/API/C/WKPreferencesPrivate.h \
+ $(WebKit2)/UIProcess/API/C/WKProtectionSpace.h \
+ $(WebKit2)/UIProcess/API/C/WKProtectionSpaceTypes.h \
+ $(WebKit2)/UIProcess/API/C/WKResourceCacheManager.h \
+ $(WebKit2)/UIProcess/API/C/WKTextChecker.h \
+ $(WebKit2)/UIProcess/API/cpp/WKRetainPtr.h
+
+webkit2gtk_h_api += \
+ $(WebKit2)/UIProcess/API/gtk/WebKitBackForwardList.h \
+ $(WebKit2)/UIProcess/API/gtk/WebKitBackForwardListItem.h \
+ $(WebKit2)/UIProcess/API/gtk/WebKitCookieManager.h \
+ $(WebKit2)/UIProcess/API/gtk/WebKitDefines.h \
+ $(WebKit2)/UIProcess/API/gtk/WebKitDownload.h \
+ $(WebKit2)/UIProcess/API/gtk/WebKitEditingCommands.h \
+ $(WebKit2)/UIProcess/API/gtk/WebKitError.h \
+ $(WebKit2)/UIProcess/API/gtk/WebKitFileChooserRequest.h \
+ $(WebKit2)/UIProcess/API/gtk/WebKitFindController.h \
+ $(WebKit2)/UIProcess/API/gtk/WebKitHitTestResult.h \
+ $(WebKit2)/UIProcess/API/gtk/WebKitJavascriptResult.h \
+ $(WebKit2)/UIProcess/API/gtk/WebKitNavigationPolicyDecision.h \
+ $(WebKit2)/UIProcess/API/gtk/WebKitPolicyDecision.h \
+ $(WebKit2)/UIProcess/API/gtk/WebKitPrintOperation.h \
+ $(WebKit2)/UIProcess/API/gtk/WebKitResponsePolicyDecision.h \
+ $(WebKit2)/UIProcess/API/gtk/WebKitScriptDialog.h \
+ $(WebKit2)/UIProcess/API/gtk/WebKitSettings.h \
+ $(WebKit2)/UIProcess/API/gtk/WebKitURIRequest.h \
+ $(WebKit2)/UIProcess/API/gtk/WebKitURIResponse.h \
+ $(WebKit2)/UIProcess/API/gtk/WebKitWebContext.h \
+ $(WebKit2)/UIProcess/API/gtk/WebKitWebResource.h \
+ $(WebKit2)/UIProcess/API/gtk/WebKitWebView.h \
+ $(WebKit2)/UIProcess/API/gtk/WebKitWebViewBase.h \
+ $(WebKit2)/UIProcess/API/gtk/WebKitWindowProperties.h \
+ $(WebKit2)/UIProcess/API/gtk/webkit2.h
+
+webkit2_built_sources += \
+ DerivedSources/WebKit2/AuthenticationManagerMessageReceiver.cpp \
+ DerivedSources/WebKit2/AuthenticationManagerMessages.h \
+ DerivedSources/WebKit2/DownloadProxyMessageReceiver.cpp \
+ DerivedSources/WebKit2/DownloadProxyMessages.h \
+ DerivedSources/WebKit2/DrawingAreaMessageReceiver.cpp \
+ DerivedSources/WebKit2/DrawingAreaMessages.h \
+ DerivedSources/WebKit2/DrawingAreaProxyMessageReceiver.cpp \
+ DerivedSources/WebKit2/DrawingAreaProxyMessages.h \
+ DerivedSources/WebKit2/EventDispatcherMessageReceiver.cpp \
+ DerivedSources/WebKit2/EventDispatcherMessages.h \
+ DerivedSources/WebKit2/LayerTreeHostProxyMessageReceiver.cpp \
+ DerivedSources/WebKit2/LayerTreeHostProxyMessages.h \
+ DerivedSources/WebKit2/NPObjectMessageReceiverMessageReceiver.cpp \
+ DerivedSources/WebKit2/NPObjectMessageReceiverMessages.h \
+ DerivedSources/WebKit2/PluginControllerProxyMessageReceiver.cpp \
+ DerivedSources/WebKit2/PluginControllerProxyMessages.h \
+ DerivedSources/WebKit2/PluginProcessConnectionMessageReceiver.cpp \
+ DerivedSources/WebKit2/PluginProcessConnectionMessages.h \
+ DerivedSources/WebKit2/PluginProcessMessageReceiver.cpp \
+ DerivedSources/WebKit2/PluginProcessMessages.h \
+ DerivedSources/WebKit2/PluginProcessProxyMessageReceiver.cpp \
+ DerivedSources/WebKit2/PluginProcessProxyMessages.h \
+ DerivedSources/WebKit2/PluginProxyMessageReceiver.cpp \
+ DerivedSources/WebKit2/PluginProxyMessages.h \
+ DerivedSources/WebKit2/WebApplicationCacheManagerMessageReceiver.cpp \
+ DerivedSources/WebKit2/WebApplicationCacheManagerMessages.h \
+ DerivedSources/WebKit2/WebApplicationCacheManagerProxyMessageReceiver.cpp \
+ DerivedSources/WebKit2/WebApplicationCacheManagerProxyMessages.h \
+ DerivedSources/WebKit2/WebContextMessageReceiver.cpp \
+ DerivedSources/WebKit2/WebContextMessages.h \
+ DerivedSources/WebKit2/WebCookieManagerMessageReceiver.cpp \
+ DerivedSources/WebKit2/WebCookieManagerMessages.h \
+ DerivedSources/WebKit2/WebCookieManagerProxyMessageReceiver.cpp \
+ DerivedSources/WebKit2/WebCookieManagerProxyMessages.h \
+ DerivedSources/WebKit2/WebDatabaseManagerMessageReceiver.cpp \
+ DerivedSources/WebKit2/WebDatabaseManagerMessages.h \
+ DerivedSources/WebKit2/WebDatabaseManagerProxyMessageReceiver.cpp \
+ DerivedSources/WebKit2/WebDatabaseManagerProxyMessages.h \
+ DerivedSources/WebKit2/WebFullScreenManagerMessageReceiver.cpp \
+ DerivedSources/WebKit2/WebFullScreenManagerMessages.h \
+ DerivedSources/WebKit2/WebFullScreenManagerProxyMessageReceiver.cpp \
+ DerivedSources/WebKit2/WebFullScreenManagerProxyMessages.h \
+ DerivedSources/WebKit2/WebGeolocationManagerMessageReceiver.cpp \
+ DerivedSources/WebKit2/WebGeolocationManagerMessages.h \
+ DerivedSources/WebKit2/WebGeolocationManagerProxyMessageReceiver.cpp \
+ DerivedSources/WebKit2/WebGeolocationManagerProxyMessages.h \
+ DerivedSources/WebKit2/WebIconDatabaseMessageReceiver.cpp \
+ DerivedSources/WebKit2/WebIconDatabaseMessages.h \
+ DerivedSources/WebKit2/WebIconDatabaseProxyMessageReceiver.cpp \
+ DerivedSources/WebKit2/WebIconDatabaseProxyMessages.h \
+ DerivedSources/WebKit2/WebInspectorMessageReceiver.cpp \
+ DerivedSources/WebKit2/WebInspectorMessages.h \
+ DerivedSources/WebKit2/WebInspectorProxyMessageReceiver.cpp \
+ DerivedSources/WebKit2/WebInspectorProxyMessages.h \
+ DerivedSources/WebKit2/WebKeyValueStorageManagerMessageReceiver.cpp \
+ DerivedSources/WebKit2/WebKeyValueStorageManagerMessages.h \
+ DerivedSources/WebKit2/WebKeyValueStorageManagerProxyMessageReceiver.cpp \
+ DerivedSources/WebKit2/WebKeyValueStorageManagerProxyMessages.h \
+ DerivedSources/WebKit2/WebMediaCacheManagerMessageReceiver.cpp \
+ DerivedSources/WebKit2/WebMediaCacheManagerMessages.h \
+ DerivedSources/WebKit2/WebMediaCacheManagerProxyMessageReceiver.cpp \
+ DerivedSources/WebKit2/WebMediaCacheManagerProxyMessages.h \
+ DerivedSources/WebKit2/WebNotificationManagerMessageReceiver.cpp \
+ DerivedSources/WebKit2/WebNotificationManagerMessages.h \
+ DerivedSources/WebKit2/WebNotificationManagerProxyMessageReceiver.cpp \
+ DerivedSources/WebKit2/WebNotificationManagerProxyMessages.h \
+ DerivedSources/WebKit2/WebPageProxyMessageReceiver.cpp \
+ DerivedSources/WebKit2/WebPageProxyMessages.h \
+ DerivedSources/WebKit2/WebPageMessageReceiver.cpp \
+ DerivedSources/WebKit2/WebPageMessages.h \
+ DerivedSources/WebKit2/WebResourceCacheManagerMessageReceiver.cpp \
+ DerivedSources/WebKit2/WebResourceCacheManagerMessages.h \
+ DerivedSources/WebKit2/WebResourceCacheManagerProxyMessageReceiver.cpp \
+ DerivedSources/WebKit2/WebResourceCacheManagerProxyMessages.h \
+ DerivedSources/WebKit2/WebProcessConnectionMessageReceiver.cpp \
+ DerivedSources/WebKit2/WebProcessConnectionMessages.h \
+ DerivedSources/WebKit2/WebProcessMessageReceiver.cpp \
+ DerivedSources/WebKit2/WebProcessMessages.h \
+ DerivedSources/WebKit2/WebProcessProxyMessageReceiver.cpp \
+ DerivedSources/WebKit2/WebProcessProxyMessages.h \
+ DerivedSources/WebKit2/WebSoupRequestManagerMessageReceiver.cpp \
+ DerivedSources/WebKit2/WebSoupRequestManagerMessages.h \
+ DerivedSources/WebKit2/WebSoupRequestManagerProxyMessageReceiver.cpp \
+ DerivedSources/WebKit2/WebSoupRequestManagerProxyMessages.h
+
+webkit2gtk_built_sources += \
+ DerivedSources/WebKit2/webkit2gtk/webkit2/WebKitEnumTypes.cpp \
+ DerivedSources/WebKit2/webkit2gtk/webkit2/WebKitEnumTypes.h \
+ DerivedSources/WebKit2/webkit2gtk/webkit2/WebKitMarshal.cpp \
+ DerivedSources/WebKit2/webkit2gtk/webkit2/WebKitMarshal.h
+
+webkit2_sources += \
+ Source/WebKit2/config.h \
+ Source/WebKit2/Platform/CoreIPC/ArgumentCoder.h \
+ Source/WebKit2/Platform/CoreIPC/ArgumentCoders.cpp \
+ Source/WebKit2/Platform/CoreIPC/ArgumentCoders.h \
+ Source/WebKit2/Platform/CoreIPC/ArgumentDecoder.cpp \
+ Source/WebKit2/Platform/CoreIPC/ArgumentDecoder.h \
+ Source/WebKit2/Platform/CoreIPC/ArgumentEncoder.cpp \
+ Source/WebKit2/Platform/CoreIPC/ArgumentEncoder.h \
+ Source/WebKit2/Platform/CoreIPC/Arguments.h \
+ Source/WebKit2/Platform/CoreIPC/Attachment.cpp \
+ Source/WebKit2/Platform/CoreIPC/Attachment.h \
+ Source/WebKit2/Platform/CoreIPC/BinarySemaphore.cpp \
+ Source/WebKit2/Platform/CoreIPC/BinarySemaphore.h \
+ Source/WebKit2/Platform/CoreIPC/Connection.cpp \
+ Source/WebKit2/Platform/CoreIPC/Connection.h \
+ Source/WebKit2/Platform/CoreIPC/CoreIPCMessageKinds.h \
+ Source/WebKit2/Platform/CoreIPC/DataReference.cpp \
+ Source/WebKit2/Platform/CoreIPC/DataReference.h \
+ Source/WebKit2/Platform/CoreIPC/HandleMessage.h \
+ Source/WebKit2/Platform/CoreIPC/MessageID.h \
+ Source/WebKit2/Platform/CoreIPC/MessageSender.h \
+ Source/WebKit2/Platform/CoreIPC/unix/AttachmentUnix.cpp \
+ Source/WebKit2/Platform/CoreIPC/unix/ConnectionUnix.cpp \
+ Source/WebKit2/Platform/gtk/LoggingGtk.cpp \
+ Source/WebKit2/Platform/gtk/ModuleGtk.cpp \
+ Source/WebKit2/Platform/gtk/WorkQueueGtk.cpp \
+ Source/WebKit2/Platform/Logging.cpp \
+ Source/WebKit2/Platform/Logging.h \
+ Source/WebKit2/Platform/Module.cpp \
+ Source/WebKit2/Platform/Module.h \
+ Source/WebKit2/Platform/PlatformProcessIdentifier.h \
+ Source/WebKit2/Platform/SharedMemory.h \
+ Source/WebKit2/Platform/unix/SharedMemoryUnix.cpp \
+ Source/WebKit2/Platform/WorkQueue.cpp \
+ Source/WebKit2/Platform/WorkQueue.h \
+ Source/WebKit2/PluginProcess/PluginControllerProxy.cpp \
+ Source/WebKit2/PluginProcess/PluginControllerProxy.h \
+ Source/WebKit2/PluginProcess/PluginCreationParameters.cpp \
+ Source/WebKit2/PluginProcess/PluginCreationParameters.h \
+ Source/WebKit2/PluginProcess/PluginProcess.cpp \
+ Source/WebKit2/PluginProcess/PluginProcess.h \
+ Source/WebKit2/PluginProcess/PluginProcessMain.h \
+ Source/WebKit2/PluginProcess/WebProcessConnection.cpp \
+ Source/WebKit2/PluginProcess/WebProcessConnection.h \
+ Source/WebKit2/PluginProcess/gtk/PluginControllerProxyGtk.cpp \
+ Source/WebKit2/PluginProcess/gtk/PluginProcessGtk.cpp \
+ Source/WebKit2/Shared/DragControllerAction.h \
+ Source/WebKit2/Shared/FontInfo.h \
+ Source/WebKit2/Shared/HTTPCookieAcceptPolicy.h \
+ Source/WebKit2/Shared/ResourceCachesToClear.h \
+ Source/WebKit2/Shared/WebMemorySampler.h \
+ Source/WebKit2/Shared/APIClient.h \
+ Source/WebKit2/Shared/APIClientTraits.cpp \
+ Source/WebKit2/Shared/APIClientTraits.h \
+ Source/WebKit2/Shared/API/c/cairo/WKImageCairo.cpp \
+ Source/WebKit2/Shared/API/c/cairo/WKImageCairo.h \
+ Source/WebKit2/Shared/API/c/gtk/WKBaseGtk.h \
+ Source/WebKit2/Shared/API/c/gtk/WKGraphicsContextGtk.h \
+ Source/WebKit2/Shared/API/c/gtk/WKGraphicsContextGtk.cpp \
+ Source/WebKit2/Shared/API/c/soup/WKBaseSoup.h \
+ Source/WebKit2/Shared/API/c/WKArray.cpp \
+ Source/WebKit2/Shared/API/c/WKArray.h \
+ Source/WebKit2/Shared/API/c/WKBase.h \
+ Source/WebKit2/Shared/API/c/WKCertificateInfo.cpp \
+ Source/WebKit2/Shared/API/c/WKCertificateInfo.h \
+ Source/WebKit2/Shared/API/c/WKConnectionRef.cpp \
+ Source/WebKit2/Shared/API/c/WKConnectionRef.h \
+ Source/WebKit2/Shared/API/c/WKContextMenuItem.cpp \
+ Source/WebKit2/Shared/API/c/WKContextMenuItem.h \
+ Source/WebKit2/Shared/API/c/WKContextMenuItemTypes.h \
+ Source/WebKit2/Shared/API/c/WKData.cpp \
+ Source/WebKit2/Shared/API/c/WKData.h \
+ Source/WebKit2/Shared/API/c/WKDictionary.cpp \
+ Source/WebKit2/Shared/API/c/WKDictionary.h \
+ Source/WebKit2/Shared/API/c/WKError.cpp \
+ Source/WebKit2/Shared/API/c/WKError.h \
+ Source/WebKit2/Shared/API/c/WKEvent.h \
+ Source/WebKit2/Shared/API/c/WKFindOptions.h \
+ Source/WebKit2/Shared/API/c/WKGeometry.h \
+ Source/WebKit2/Shared/API/c/WKGeometry.cpp \
+ Source/WebKit2/Shared/API/c/WKGraphicsContext.cpp \
+ Source/WebKit2/Shared/API/c/WKGraphicsContext.h \
+ Source/WebKit2/Shared/API/c/WKImage.cpp \
+ Source/WebKit2/Shared/API/c/WKImage.h \
+ Source/WebKit2/Shared/API/c/WKMutableArray.cpp \
+ Source/WebKit2/Shared/API/c/WKMutableArray.h \
+ Source/WebKit2/Shared/API/c/WKMutableDictionary.cpp \
+ Source/WebKit2/Shared/API/c/WKMutableDictionary.h \
+ Source/WebKit2/Shared/API/c/WKNumber.cpp \
+ Source/WebKit2/Shared/API/c/WKNumber.h \
+ Source/WebKit2/Shared/API/c/WKPageLoadTypes.h \
+ Source/WebKit2/Shared/API/c/WKRenderLayer.cpp \
+ Source/WebKit2/Shared/API/c/WKRenderLayer.h \
+ Source/WebKit2/Shared/API/c/WKRenderObject.cpp \
+ Source/WebKit2/Shared/API/c/WKRenderObject.h \
+ Source/WebKit2/Shared/API/c/WKSecurityOrigin.cpp \
+ Source/WebKit2/Shared/API/c/WKSecurityOrigin.h \
+ Source/WebKit2/Shared/API/c/WKSerializedScriptValue.cpp \
+ Source/WebKit2/Shared/API/c/WKSerializedScriptValue.h \
+ Source/WebKit2/Shared/API/c/WKSerializedScriptValuePrivate.h \
+ Source/WebKit2/Shared/API/c/WKSharedAPICast.h \
+ Source/WebKit2/Shared/API/c/WKString.cpp \
+ Source/WebKit2/Shared/API/c/WKString.h \
+ Source/WebKit2/Shared/API/c/WKStringPrivate.h \
+ Source/WebKit2/Shared/API/c/WKType.cpp \
+ Source/WebKit2/Shared/API/c/WKType.h \
+ Source/WebKit2/Shared/API/c/WKURL.cpp \
+ Source/WebKit2/Shared/API/c/WKURL.h \
+ Source/WebKit2/Shared/API/c/WKURLRequest.cpp \
+ Source/WebKit2/Shared/API/c/WKURLRequest.h \
+ Source/WebKit2/Shared/API/c/WKURLResponse.cpp \
+ Source/WebKit2/Shared/API/c/WKURLResponse.h \
+ Source/WebKit2/Shared/API/c/WKUserContentURLPattern.cpp \
+ Source/WebKit2/Shared/API/c/WKUserContentURLPattern.h \
+ Source/WebKit2/Shared/APIObject.cpp \
+ Source/WebKit2/Shared/APIObject.h \
+ Source/WebKit2/Shared/ShareableBitmap.cpp \
+ Source/WebKit2/Shared/ShareableBitmap.h \
+ Source/WebKit2/Shared/CacheModel.h \
+ Source/WebKit2/Shared/ChildProcess.cpp \
+ Source/WebKit2/Shared/ChildProcess.h \
+ Source/WebKit2/Shared/CommandLine.h \
+ Source/WebKit2/Shared/CoreIPCSupport/InjectedBundleMessageKinds.h \
+ Source/WebKit2/Shared/CoreIPCSupport/WebConnectionMessageKinds.h \
+ Source/WebKit2/Shared/CoreIPCSupport/WebContextMessageKinds.h \
+ Source/WebKit2/Shared/CoreIPCSupport/WebPageProxyMessageKinds.h \
+ Source/WebKit2/Shared/DrawingAreaInfo.h \
+ Source/WebKit2/Shared/EditorState.cpp \
+ Source/WebKit2/Shared/EditorState.h \
+ Source/WebKit2/Shared/FontSmoothingLevel.h \
+ Source/WebKit2/Shared/ProcessExecutablePath.h \
+ Source/WebKit2/Shared/cairo/LayerTreeContextCairo.cpp \
+ Source/WebKit2/Shared/cairo/ShareableBitmapCairo.cpp \
+ Source/WebKit2/Shared/gtk/ArgumentCodersGtk.h \
+ Source/WebKit2/Shared/gtk/ArgumentCodersGtk.cpp \
+ Source/WebKit2/Shared/gtk/NativeWebKeyboardEventGtk.cpp \
+ Source/WebKit2/Shared/gtk/NativeWebMouseEventGtk.cpp \
+ Source/WebKit2/Shared/gtk/NativeWebWheelEventGtk.cpp \
+ Source/WebKit2/Shared/gtk/PlatformCertificateInfo.h \
+ Source/WebKit2/Shared/gtk/PrintInfoGtk.cpp \
+ Source/WebKit2/Shared/gtk/ProcessExecutablePathGtk.cpp \
+ Source/WebKit2/Shared/gtk/WebCoreArgumentCodersGtk.cpp \
+ Source/WebKit2/Shared/gtk/WebEventFactory.cpp \
+ Source/WebKit2/Shared/gtk/WebEventFactory.h \
+ Source/WebKit2/Shared/ImageOptions.h \
+ Source/WebKit2/Shared/ImmutableArray.cpp \
+ Source/WebKit2/Shared/ImmutableArray.h \
+ Source/WebKit2/Shared/ImmutableDictionary.cpp \
+ Source/WebKit2/Shared/ImmutableDictionary.h \
+ Source/WebKit2/Shared/LayerTreeContext.h \
+ Source/WebKit2/Shared/MutableArray.cpp \
+ Source/WebKit2/Shared/MutableArray.h \
+ Source/WebKit2/Shared/MutableDictionary.cpp \
+ Source/WebKit2/Shared/MutableDictionary.h \
+ Source/WebKit2/Shared/NativeWebKeyboardEvent.h \
+ Source/WebKit2/Shared/NativeWebMouseEvent.h \
+ Source/WebKit2/Shared/NativeWebWheelEvent.h \
+ Source/WebKit2/Shared/OriginAndDatabases.cpp \
+ Source/WebKit2/Shared/OriginAndDatabases.h \
+ Source/WebKit2/Shared/PlatformPopupMenuData.cpp \
+ Source/WebKit2/Shared/PlatformPopupMenuData.h \
+ Source/WebKit2/Shared/PrintInfo.cpp \
+ Source/WebKit2/Shared/PrintInfo.h \
+ Source/WebKit2/Shared/Plugins/Netscape/NetscapePluginModule.cpp \
+ Source/WebKit2/Shared/Plugins/Netscape/NetscapePluginModule.h \
+ Source/WebKit2/Shared/Plugins/Netscape/NetscapePluginModuleNone.cpp \
+ Source/WebKit2/Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp \
+ Source/WebKit2/Shared/Plugins/NPIdentifierData.cpp \
+ Source/WebKit2/Shared/Plugins/NPIdentifierData.h \
+ Source/WebKit2/Shared/Plugins/NPObjectMessageReceiver.cpp \
+ Source/WebKit2/Shared/Plugins/NPObjectMessageReceiver.h \
+ Source/WebKit2/Shared/Plugins/NPObjectProxy.cpp \
+ Source/WebKit2/Shared/Plugins/NPObjectProxy.h \
+ Source/WebKit2/Shared/Plugins/NPRemoteObjectMap.cpp \
+ Source/WebKit2/Shared/Plugins/NPRemoteObjectMap.h \
+ Source/WebKit2/Shared/Plugins/NPVariantData.cpp \
+ Source/WebKit2/Shared/Plugins/NPVariantData.h \
+ Source/WebKit2/Shared/Plugins/PluginModuleInfo.cpp \
+ Source/WebKit2/Shared/Plugins/PluginModuleInfo.h \
+ Source/WebKit2/Shared/Plugins/PluginProcessCreationParameters.cpp \
+ Source/WebKit2/Shared/Plugins/PluginProcessCreationParameters.h \
+ Source/WebKit2/Shared/Plugins/PluginQuirks.h \
+ Source/WebKit2/Shared/SameDocumentNavigationType.h \
+ Source/WebKit2/Shared/SandboxExtension.h \
+ Source/WebKit2/Shared/SecurityOriginData.h \
+ Source/WebKit2/Shared/SecurityOriginData.cpp \
+ Source/WebKit2/Shared/SessionState.cpp \
+ Source/WebKit2/Shared/SessionState.h \
+ Source/WebKit2/Shared/StatisticsData.cpp \
+ Source/WebKit2/Shared/StatisticsData.h \
+ Source/WebKit2/Shared/StringPairVector.h \
+ Source/WebKit2/Shared/TextCheckerState.h \
+ Source/WebKit2/Shared/UserMessageCoders.h \
+ Source/WebKit2/Shared/UpdateInfo.cpp \
+ Source/WebKit2/Shared/UpdateInfo.h \
+ Source/WebKit2/Shared/VisitedLinkTable.cpp \
+ Source/WebKit2/Shared/VisitedLinkTable.h \
+ Source/WebKit2/Shared/WebBackForwardListItem.cpp \
+ Source/WebKit2/Shared/WebBackForwardListItem.h \
+ Source/WebKit2/Shared/WebCertificateInfo.h \
+ Source/WebKit2/Shared/WebConnection.cpp \
+ Source/WebKit2/Shared/WebConnection.h \
+ Source/WebKit2/Shared/WebConnectionClient.cpp \
+ Source/WebKit2/Shared/WebConnectionClient.h \
+ Source/WebKit2/Shared/WebContextMenuItem.cpp \
+ Source/WebKit2/Shared/WebContextMenuItemData.cpp \
+ Source/WebKit2/Shared/WebContextMenuItemData.h \
+ Source/WebKit2/Shared/WebContextMenuItem.h \
+ Source/WebKit2/Shared/WebCoreArgumentCoders.cpp \
+ Source/WebKit2/Shared/WebCoreArgumentCoders.h \
+ Source/WebKit2/Shared/WebData.h \
+ Source/WebKit2/Shared/WebError.cpp \
+ Source/WebKit2/Shared/WebError.h \
+ Source/WebKit2/Shared/WebEventConversion.cpp \
+ Source/WebKit2/Shared/WebEventConversion.h \
+ Source/WebKit2/Shared/WebEvent.cpp \
+ Source/WebKit2/Shared/WebEvent.h \
+ Source/WebKit2/Shared/WebFindOptions.h \
+ Source/WebKit2/Shared/WebGeolocationPosition.cpp \
+ Source/WebKit2/Shared/WebGeolocationPosition.h \
+ Source/WebKit2/Shared/WebGeometry.h \
+ Source/WebKit2/Shared/WebGraphicsContext.cpp \
+ Source/WebKit2/Shared/WebGraphicsContext.h \
+ Source/WebKit2/Shared/WebHitTestResult.cpp \
+ Source/WebKit2/Shared/WebHitTestResult.h \
+ Source/WebKit2/Shared/WebImage.cpp \
+ Source/WebKit2/Shared/WebImage.h \
+ Source/WebKit2/Shared/WebKeyboardEvent.cpp \
+ Source/WebKit2/Shared/WebMouseEvent.cpp \
+ Source/WebKit2/Shared/WebNavigationDataStore.h \
+ Source/WebKit2/Shared/WebNumber.h \
+ Source/WebKit2/Shared/WebOpenPanelParameters.cpp \
+ Source/WebKit2/Shared/WebOpenPanelParameters.h \
+ Source/WebKit2/Shared/WebPageCreationParameters.cpp \
+ Source/WebKit2/Shared/WebPageCreationParameters.h \
+ Source/WebKit2/Shared/WebPageGroupData.cpp \
+ Source/WebKit2/Shared/WebPageGroupData.h \
+ Source/WebKit2/Shared/WebPlatformTouchPoint.cpp \
+ Source/WebKit2/Shared/WebPopupItem.cpp \
+ Source/WebKit2/Shared/WebPopupItem.h \
+ Source/WebKit2/Shared/WebPreferencesStore.cpp \
+ Source/WebKit2/Shared/WebPreferencesStore.h \
+ Source/WebKit2/Shared/WebProcessCreationParameters.cpp \
+ Source/WebKit2/Shared/WebProcessCreationParameters.h \
+ Source/WebKit2/Shared/WebRenderLayer.cpp \
+ Source/WebKit2/Shared/WebRenderLayer.h \
+ Source/WebKit2/Shared/WebRenderObject.cpp \
+ Source/WebKit2/Shared/WebRenderObject.h \
+ Source/WebKit2/Shared/WebSecurityOrigin.h \
+ Source/WebKit2/Shared/WebSerializedScriptValue.h \
+ Source/WebKit2/Shared/WebString.h \
+ Source/WebKit2/Shared/WebTouchEvent.cpp \
+ Source/WebKit2/Shared/WebURL.h \
+ Source/WebKit2/Shared/WebURLRequest.cpp \
+ Source/WebKit2/Shared/WebURLRequest.h \
+ Source/WebKit2/Shared/WebURLResponse.cpp \
+ Source/WebKit2/Shared/WebURLResponse.h \
+ Source/WebKit2/Shared/WebUserContentURLPattern.h \
+ Source/WebKit2/Shared/WebWheelEvent.cpp \
+ Source/WebKit2/UIProcess/API/C/gtk/WKAPICastGtk.h \
+ Source/WebKit2/UIProcess/API/C/gtk/WKFullScreenClientGtk.cpp \
+ Source/WebKit2/UIProcess/API/C/gtk/WKFullScreenClientGtk.h \
+ Source/WebKit2/UIProcess/API/C/gtk/WKView.cpp \
+ Source/WebKit2/UIProcess/API/C/gtk/WKView.h \
+ Source/WebKit2/UIProcess/API/C/soup/WKAPICastSoup.h \
+ Source/WebKit2/UIProcess/API/C/soup/WKContextSoup.cpp \
+ Source/WebKit2/UIProcess/API/C/soup/WKContextSoup.h \
+ Source/WebKit2/UIProcess/API/C/soup/WKSoupRequestManager.cpp \
+ Source/WebKit2/UIProcess/API/C/soup/WKSoupRequestManager.h \
+ Source/WebKit2/UIProcess/API/C/WebKit2.h \
+ Source/WebKit2/UIProcess/API/C/WKAPICast.h \
+ Source/WebKit2/UIProcess/API/C/WKApplicationCacheManager.h \
+ Source/WebKit2/UIProcess/API/C/WKApplicationCacheManager.cpp \
+ Source/WebKit2/UIProcess/API/C/WKAuthenticationChallenge.cpp \
+ Source/WebKit2/UIProcess/API/C/WKAuthenticationChallenge.h \
+ Source/WebKit2/UIProcess/API/C/WKAuthenticationDecisionListener.cpp \
+ Source/WebKit2/UIProcess/API/C/WKAuthenticationDecisionListener.h \
+ Source/WebKit2/UIProcess/API/C/WKBackForwardList.cpp \
+ Source/WebKit2/UIProcess/API/C/WKBackForwardList.h \
+ Source/WebKit2/UIProcess/API/C/WKBackForwardListItem.cpp \
+ Source/WebKit2/UIProcess/API/C/WKBackForwardListItem.h \
+ Source/WebKit2/UIProcess/API/C/WKContext.cpp \
+ Source/WebKit2/UIProcess/API/C/WKContext.h \
+ Source/WebKit2/UIProcess/API/C/WKContextPrivate.h \
+ Source/WebKit2/UIProcess/API/C/WKCookieManager.h \
+ Source/WebKit2/UIProcess/API/C/WKCookieManager.cpp \
+ Source/WebKit2/UIProcess/API/C/WKCredential.cpp \
+ Source/WebKit2/UIProcess/API/C/WKCredential.h \
+ Source/WebKit2/UIProcess/API/C/WKCredentialTypes.h \
+ Source/WebKit2/UIProcess/API/C/WKDatabaseManager.cpp \
+ Source/WebKit2/UIProcess/API/C/WKDatabaseManager.h \
+ Source/WebKit2/UIProcess/API/C/WKDownload.cpp \
+ Source/WebKit2/UIProcess/API/C/WKDownload.h \
+ Source/WebKit2/UIProcess/API/C/WKFormSubmissionListener.cpp \
+ Source/WebKit2/UIProcess/API/C/WKFormSubmissionListener.h \
+ Source/WebKit2/UIProcess/API/C/WKFrame.cpp \
+ Source/WebKit2/UIProcess/API/C/WKFrame.h \
+ Source/WebKit2/UIProcess/API/C/WKFramePolicyListener.cpp \
+ Source/WebKit2/UIProcess/API/C/WKFramePolicyListener.h \
+ Source/WebKit2/UIProcess/API/C/WKGeolocationManager.h \
+ Source/WebKit2/UIProcess/API/C/WKGeolocationPermissionRequest.h \
+ Source/WebKit2/UIProcess/API/C/WKGeolocationPosition.h \
+ Source/WebKit2/UIProcess/API/C/WKGrammarDetail.cpp \
+ Source/WebKit2/UIProcess/API/C/WKGrammarDetail.h \
+ Source/WebKit2/UIProcess/API/C/WKHitTestResult.cpp \
+ Source/WebKit2/UIProcess/API/C/WKHitTestResult.h \
+ Source/WebKit2/UIProcess/API/C/WKIconDatabase.cpp \
+ Source/WebKit2/UIProcess/API/C/WKIconDatabase.h \
+ Source/WebKit2/UIProcess/API/C/WKInspector.cpp \
+ Source/WebKit2/UIProcess/API/C/WKInspector.h \
+ Source/WebKit2/UIProcess/API/C/WKKeyValueStorageManager.cpp \
+ Source/WebKit2/UIProcess/API/C/WKKeyValueStorageManager.h \
+ Source/WebKit2/UIProcess/API/C/WKMediaCacheManager.cpp \
+ Source/WebKit2/UIProcess/API/C/WKMediaCacheManager.h \
+ Source/WebKit2/UIProcess/API/C/WKNativeEvent.h \
+ Source/WebKit2/UIProcess/API/C/WKNavigationData.cpp \
+ Source/WebKit2/UIProcess/API/C/WKNavigationData.h \
+ Source/WebKit2/UIProcess/API/C/WKNotification.cpp \
+ Source/WebKit2/UIProcess/API/C/WKNotification.h \
+ Source/WebKit2/UIProcess/API/C/WKNotificationManager.cpp \
+ Source/WebKit2/UIProcess/API/C/WKNotificationManager.h \
+ Source/WebKit2/UIProcess/API/C/WKNotificationPermissionRequest.cpp \
+ Source/WebKit2/UIProcess/API/C/WKNotificationPermissionRequest.h \
+ Source/WebKit2/UIProcess/API/C/WKNotificationProvider.h \
+ Source/WebKit2/UIProcess/API/C/WKOpenPanelParameters.cpp \
+ Source/WebKit2/UIProcess/API/C/WKOpenPanelParameters.h \
+ Source/WebKit2/UIProcess/API/C/WKOpenPanelResultListener.cpp \
+ Source/WebKit2/UIProcess/API/C/WKOpenPanelResultListener.h \
+ Source/WebKit2/UIProcess/API/C/WKPage.cpp \
+ Source/WebKit2/UIProcess/API/C/WKPageGroup.cpp \
+ Source/WebKit2/UIProcess/API/C/WKPageGroup.h \
+ Source/WebKit2/UIProcess/API/C/WKPage.h \
+ Source/WebKit2/UIProcess/API/C/WKPagePrivate.h \
+ Source/WebKit2/UIProcess/API/C/WKPluginSiteDataManager.h \
+ Source/WebKit2/UIProcess/API/C/WKPluginSiteDataManager.cpp \
+ Source/WebKit2/UIProcess/API/C/WKPreferences.cpp \
+ Source/WebKit2/UIProcess/API/C/WKPreferences.h \
+ Source/WebKit2/UIProcess/API/C/WKPreferencesPrivate.h \
+ Source/WebKit2/UIProcess/API/C/WKProtectionSpace.cpp \
+ Source/WebKit2/UIProcess/API/C/WKProtectionSpace.h \
+ Source/WebKit2/UIProcess/API/C/WKProtectionSpaceTypes.h \
+ Source/WebKit2/UIProcess/API/C/WKResourceCacheManager.h \
+ Source/WebKit2/UIProcess/API/C/WKResourceCacheManager.cpp \
+ Source/WebKit2/UIProcess/API/C/WKTextChecker.h \
+ Source/WebKit2/UIProcess/API/C/WKTextChecker.cpp \
+ Source/WebKit2/UIProcess/API/cpp/WKRetainPtr.h \
+ Source/WebKit2/UIProcess/API/gtk/PageClientImpl.h \
+ Source/WebKit2/UIProcess/API/gtk/PageClientImpl.cpp \
+ Source/WebKit2/UIProcess/API/gtk/WebKitBackForwardList.h \
+ Source/WebKit2/UIProcess/API/gtk/WebKitBackForwardList.cpp \
+ Source/WebKit2/UIProcess/API/gtk/WebKitBackForwardListItem.h \
+ Source/WebKit2/UIProcess/API/gtk/WebKitBackForwardListItem.cpp \
+ Source/WebKit2/UIProcess/API/gtk/WebKitBackForwardListPrivate.h \
+ Source/WebKit2/UIProcess/API/gtk/WebKitCookieManager.h \
+ Source/WebKit2/UIProcess/API/gtk/WebKitCookieManager.cpp \
+ Source/WebKit2/UIProcess/API/gtk/WebKitCookieManagerPrivate.h \
+ Source/WebKit2/UIProcess/API/gtk/WebKitDefines.h \
+ Source/WebKit2/UIProcess/API/gtk/WebKitDownload.cpp \
+ Source/WebKit2/UIProcess/API/gtk/WebKitDownload.h \
+ Source/WebKit2/UIProcess/API/gtk/WebKitDownloadPrivate.h \
+ Source/WebKit2/UIProcess/API/gtk/WebKitDownloadClient.cpp \
+ Source/WebKit2/UIProcess/API/gtk/WebKitDownloadClient.h \
+ Source/WebKit2/UIProcess/API/gtk/WebKitEditingCommands.h \
+ Source/WebKit2/UIProcess/API/gtk/WebKitError.h \
+ Source/WebKit2/UIProcess/API/gtk/WebKitError.cpp \
+ Source/WebKit2/UIProcess/API/gtk/WebKitFileChooserRequest.cpp \
+ Source/WebKit2/UIProcess/API/gtk/WebKitFileChooserRequest.h \
+ Source/WebKit2/UIProcess/API/gtk/WebKitFileChooserRequestPrivate.h \
+ Source/WebKit2/UIProcess/API/gtk/WebKitFullscreenClient.cpp \
+ Source/WebKit2/UIProcess/API/gtk/WebKitFullscreenClient.h \
+ Source/WebKit2/UIProcess/API/gtk/WebKitHitTestResult.cpp \
+ Source/WebKit2/UIProcess/API/gtk/WebKitHitTestResult.h \
+ Source/WebKit2/UIProcess/API/gtk/WebKitHitTestResultPrivate.h \
+ Source/WebKit2/UIProcess/API/gtk/WebKitJavascriptResult.cpp \
+ Source/WebKit2/UIProcess/API/gtk/WebKitJavascriptResult.h \
+ Source/WebKit2/UIProcess/API/gtk/WebKitJavascriptResultPrivate.h \
+ Source/WebKit2/UIProcess/API/gtk/WebKitLoaderClient.h \
+ Source/WebKit2/UIProcess/API/gtk/WebKitLoaderClient.cpp \
+ Source/WebKit2/UIProcess/API/gtk/WebKitFindController.h \
+ Source/WebKit2/UIProcess/API/gtk/WebKitFindController.cpp \
+ Source/WebKit2/UIProcess/API/gtk/WebKitNavigationPolicyDecision.cpp \
+ Source/WebKit2/UIProcess/API/gtk/WebKitNavigationPolicyDecision.h \
+ Source/WebKit2/UIProcess/API/gtk/WebKitNavigationPolicyDecisionPrivate.h \
+ Source/WebKit2/UIProcess/API/gtk/WebKitPolicyDecision.cpp \
+ Source/WebKit2/UIProcess/API/gtk/WebKitPolicyDecision.h \
+ Source/WebKit2/UIProcess/API/gtk/WebKitPolicyDecisionPrivate.h \
+ Source/WebKit2/UIProcess/API/gtk/WebKitPolicyClient.cpp \
+ Source/WebKit2/UIProcess/API/gtk/WebKitPolicyClient.h \
+ Source/WebKit2/UIProcess/API/gtk/WebKitPrintOperation.cpp \
+ Source/WebKit2/UIProcess/API/gtk/WebKitPrintOperation.h \
+ Source/WebKit2/UIProcess/API/gtk/WebKitPrintOperationPrivate.h \
+ Source/WebKit2/UIProcess/API/gtk/WebKitPrivate.h \
+ Source/WebKit2/UIProcess/API/gtk/WebKitPrivate.cpp \
+ Source/WebKit2/UIProcess/API/gtk/WebKitResourceLoadClient.cpp \
+ Source/WebKit2/UIProcess/API/gtk/WebKitResourceLoadClient.h \
+ Source/WebKit2/UIProcess/API/gtk/WebKitResponsePolicyDecision.cpp \
+ Source/WebKit2/UIProcess/API/gtk/WebKitResponsePolicyDecision.h \
+ Source/WebKit2/UIProcess/API/gtk/WebKitResponsePolicyDecisionPrivate.h \
+ Source/WebKit2/UIProcess/API/gtk/WebKitScriptDialog.cpp \
+ Source/WebKit2/UIProcess/API/gtk/WebKitScriptDialog.h \
+ Source/WebKit2/UIProcess/API/gtk/WebKitScriptDialogPrivate.h \
+ Source/WebKit2/UIProcess/API/gtk/WebKitSettings.cpp \
+ Source/WebKit2/UIProcess/API/gtk/WebKitSettings.h \
+ Source/WebKit2/UIProcess/API/gtk/WebKitSettingsPrivate.h \
+ Source/WebKit2/UIProcess/API/gtk/WebKitUIClient.cpp \
+ Source/WebKit2/UIProcess/API/gtk/WebKitUIClient.h \
+ Source/WebKit2/UIProcess/API/gtk/WebKitURIRequest.cpp \
+ Source/WebKit2/UIProcess/API/gtk/WebKitURIRequest.h \
+ Source/WebKit2/UIProcess/API/gtk/WebKitURIRequestPrivate.h \
+ Source/WebKit2/UIProcess/API/gtk/WebKitURIResponse.cpp \
+ Source/WebKit2/UIProcess/API/gtk/WebKitURIResponse.h \
+ Source/WebKit2/UIProcess/API/gtk/WebKitURIResponsePrivate.h \
+ Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.h \
+ Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.cpp \
+ Source/WebKit2/UIProcess/API/gtk/WebKitWebContextPrivate.h \
+ Source/WebKit2/UIProcess/API/gtk/WebKitWebResource.cpp \
+ Source/WebKit2/UIProcess/API/gtk/WebKitWebResource.h \
+ Source/WebKit2/UIProcess/API/gtk/WebKitWebResourcePrivate.h \
+ Source/WebKit2/UIProcess/API/gtk/WebKitWebView.h \
+ Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp \
+ Source/WebKit2/UIProcess/API/gtk/WebKitWebView.h \
+ Source/WebKit2/UIProcess/API/gtk/WebKitWebViewPrivate.h \
+ Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.h \
+ Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp \
+ Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBaseAccessible.h \
+ Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBaseAccessible.cpp \
+ Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBasePrivate.h \
+ Source/WebKit2/UIProcess/API/gtk/WebKitWindowProperties.cpp \
+ Source/WebKit2/UIProcess/API/gtk/WebKitWindowProperties.h \
+ Source/WebKit2/UIProcess/API/gtk/WebKitWindowPropertiesPrivate.h \
+ Source/WebKit2/UIProcess/API/gtk/webkit2.h \
+ Source/WebKit2/UIProcess/Authentication/AuthenticationChallengeProxy.cpp \
+ Source/WebKit2/UIProcess/Authentication/AuthenticationChallengeProxy.h \
+ Source/WebKit2/UIProcess/Authentication/AuthenticationDecisionListener.cpp \
+ Source/WebKit2/UIProcess/Authentication/AuthenticationDecisionListener.h \
+ Source/WebKit2/UIProcess/Authentication/WebCredential.cpp \
+ Source/WebKit2/UIProcess/Authentication/WebCredential.h \
+ Source/WebKit2/UIProcess/Authentication/WebProtectionSpace.cpp \
+ Source/WebKit2/UIProcess/Authentication/WebProtectionSpace.h \
+ Source/WebKit2/UIProcess/BackingStore.cpp \
+ Source/WebKit2/UIProcess/BackingStore.h \
+ Source/WebKit2/UIProcess/Downloads/DownloadProxy.cpp \
+ Source/WebKit2/UIProcess/Downloads/DownloadProxy.h \
+ Source/WebKit2/UIProcess/DrawingAreaProxy.cpp \
+ Source/WebKit2/UIProcess/DrawingAreaProxy.h \
+ Source/WebKit2/UIProcess/DrawingAreaProxyImpl.cpp \
+ Source/WebKit2/UIProcess/DrawingAreaProxyImpl.h \
+ Source/WebKit2/UIProcess/FindIndicator.cpp \
+ Source/WebKit2/UIProcess/FindIndicator.h \
+ Source/WebKit2/UIProcess/GenericCallback.h \
+ Source/WebKit2/UIProcess/GeolocationPermissionRequestManagerProxy.cpp \
+ Source/WebKit2/UIProcess/GeolocationPermissionRequestManagerProxy.h \
+ Source/WebKit2/UIProcess/GeolocationPermissionRequestProxy.cpp \
+ Source/WebKit2/UIProcess/GeolocationPermissionRequestProxy.h \
+ Source/WebKit2/UIProcess/cairo/BackingStoreCairo.cpp \
+ Source/WebKit2/UIProcess/gtk/TextCheckerGtk.cpp \
+ Source/WebKit2/UIProcess/gtk/WebContextGtk.cpp \
+ Source/WebKit2/UIProcess/gtk/WebContextMenuProxyGtk.cpp \
+ Source/WebKit2/UIProcess/gtk/WebContextMenuProxyGtk.h \
+ Source/WebKit2/UIProcess/gtk/WebFullScreenClientGtk.cpp \
+ Source/WebKit2/UIProcess/gtk/WebFullScreenClientGtk.h \
+ Source/WebKit2/UIProcess/gtk/WebFullScreenManagerProxyGtk.cpp \
+ Source/WebKit2/UIProcess/gtk/WebInspectorGtk.cpp \
+ Source/WebKit2/UIProcess/gtk/WebPageProxyGtk.cpp \
+ Source/WebKit2/UIProcess/gtk/WebPopupMenuProxyGtk.cpp \
+ Source/WebKit2/UIProcess/gtk/WebPopupMenuProxyGtk.h \
+ Source/WebKit2/UIProcess/gtk/WebPreferencesGtk.cpp \
+ Source/WebKit2/UIProcess/Launcher/gtk/ProcessLauncherGtk.cpp \
+ Source/WebKit2/UIProcess/Launcher/gtk/ThreadLauncherGtk.cpp \
+ Source/WebKit2/UIProcess/Launcher/ProcessLauncher.cpp \
+ Source/WebKit2/UIProcess/Launcher/ProcessLauncher.h \
+ Source/WebKit2/UIProcess/Launcher/ThreadLauncher.cpp \
+ Source/WebKit2/UIProcess/Launcher/ThreadLauncher.h \
+ Source/WebKit2/UIProcess/Notifications/NotificationPermissionRequest.cpp \
+ Source/WebKit2/UIProcess/Notifications/NotificationPermissionRequest.h \
+ Source/WebKit2/UIProcess/Notifications/NotificationPermissionRequestManagerProxy.cpp \
+ Source/WebKit2/UIProcess/Notifications/NotificationPermissionRequestManagerProxy.h \
+ Source/WebKit2/UIProcess/Notifications/WebNotification.cpp \
+ Source/WebKit2/UIProcess/Notifications/WebNotification.h \
+ Source/WebKit2/UIProcess/Notifications/WebNotificationManagerProxy.cpp \
+ Source/WebKit2/UIProcess/Notifications/WebNotificationManagerProxy.h \
+ Source/WebKit2/UIProcess/Notifications/WebNotificationProvider.cpp \
+ Source/WebKit2/UIProcess/Notifications/WebNotificationProvider.h \
+ Source/WebKit2/UIProcess/PageClient.h \
+ Source/WebKit2/UIProcess/Plugins/PluginInfoStore.cpp \
+ Source/WebKit2/UIProcess/Plugins/PluginInfoStore.h \
+ Source/WebKit2/UIProcess/Plugins/PluginProcessManager.cpp \
+ Source/WebKit2/UIProcess/Plugins/PluginProcessManager.h \
+ Source/WebKit2/UIProcess/Plugins/PluginProcessProxy.cpp \
+ Source/WebKit2/UIProcess/Plugins/PluginProcessProxy.h \
+ Source/WebKit2/UIProcess/Plugins/WebPluginSiteDataManager.h \
+ Source/WebKit2/UIProcess/Plugins/WebPluginSiteDataManager.cpp \
+ Source/WebKit2/UIProcess/Plugins/gtk/PluginProcessProxyGtk.cpp \
+ Source/WebKit2/UIProcess/Plugins/unix/PluginInfoStoreUnix.cpp \
+ Source/WebKit2/UIProcess/ProcessModel.h \
+ Source/WebKit2/UIProcess/ResponsivenessTimer.cpp \
+ Source/WebKit2/UIProcess/ResponsivenessTimer.h \
+ Source/WebKit2/UIProcess/soup/WebSoupRequestManagerClient.cpp \
+ Source/WebKit2/UIProcess/soup/WebSoupRequestManagerClient.h \
+ Source/WebKit2/UIProcess/soup/WebSoupRequestManagerProxy.cpp \
+ Source/WebKit2/UIProcess/soup/WebSoupRequestManagerProxy.h \
+ Source/WebKit2/UIProcess/TextChecker.h \
+ Source/WebKit2/UIProcess/VisitedLinkProvider.cpp \
+ Source/WebKit2/UIProcess/VisitedLinkProvider.h \
+ Source/WebKit2/UIProcess/WebApplicationCacheManagerProxy.h \
+ Source/WebKit2/UIProcess/WebApplicationCacheManagerProxy.cpp \
+ Source/WebKit2/UIProcess/WebBackForwardList.cpp \
+ Source/WebKit2/UIProcess/WebBackForwardList.h \
+ Source/WebKit2/UIProcess/WebConnectionToWebProcess.cpp \
+ Source/WebKit2/UIProcess/WebConnectionToWebProcess.h \
+ Source/WebKit2/UIProcess/WebContext.cpp \
+ Source/WebKit2/UIProcess/WebContext.h \
+ Source/WebKit2/UIProcess/WebContextConnectionClient.cpp \
+ Source/WebKit2/UIProcess/WebContextConnectionClient.h \
+ Source/WebKit2/UIProcess/WebContextInjectedBundleClient.cpp \
+ Source/WebKit2/UIProcess/WebContextInjectedBundleClient.h \
+ Source/WebKit2/UIProcess/WebContextMenuProxy.cpp \
+ Source/WebKit2/UIProcess/WebContextMenuProxy.h \
+ Source/WebKit2/UIProcess/WebContextUserMessageCoders.h \
+ Source/WebKit2/UIProcess/WebCookieManagerProxy.h \
+ Source/WebKit2/UIProcess/WebCookieManagerProxy.cpp \
+ Source/WebKit2/UIProcess/WebCookieManagerProxyClient.cpp \
+ Source/WebKit2/UIProcess/WebCookieManagerProxyClient.h \
+ Source/WebKit2/UIProcess/WebDatabaseManagerProxyClient.cpp \
+ Source/WebKit2/UIProcess/WebDatabaseManagerProxyClient.h \
+ Source/WebKit2/UIProcess/WebDatabaseManagerProxy.cpp \
+ Source/WebKit2/UIProcess/WebDatabaseManagerProxy.h \
+ Source/WebKit2/UIProcess/WebDownloadClient.cpp \
+ Source/WebKit2/UIProcess/WebDownloadClient.h \
+ Source/WebKit2/UIProcess/WebEditCommandProxy.cpp \
+ Source/WebKit2/UIProcess/WebEditCommandProxy.h \
+ Source/WebKit2/UIProcess/WebFindClient.cpp \
+ Source/WebKit2/UIProcess/WebFindClient.h \
+ Source/WebKit2/UIProcess/WebFormClient.cpp \
+ Source/WebKit2/UIProcess/WebFormClient.h \
+ Source/WebKit2/UIProcess/WebFormSubmissionListenerProxy.cpp \
+ Source/WebKit2/UIProcess/WebFormSubmissionListenerProxy.h \
+ Source/WebKit2/UIProcess/WebFrameListenerProxy.cpp \
+ Source/WebKit2/UIProcess/WebFrameListenerProxy.h \
+ Source/WebKit2/UIProcess/WebFramePolicyListenerProxy.cpp \
+ Source/WebKit2/UIProcess/WebFramePolicyListenerProxy.h \
+ Source/WebKit2/UIProcess/WebFrameProxy.cpp \
+ Source/WebKit2/UIProcess/WebFrameProxy.h \
+ Source/WebKit2/UIProcess/WebFullScreenManagerProxy.cpp \
+ Source/WebKit2/UIProcess/WebFullScreenManagerProxy.h \
+ Source/WebKit2/UIProcess/WebGeolocationManagerProxy.cpp \
+ Source/WebKit2/UIProcess/WebGeolocationManagerProxy.h \
+ Source/WebKit2/UIProcess/WebGeolocationProvider.cpp \
+ Source/WebKit2/UIProcess/WebGeolocationProvider.h \
+ Source/WebKit2/UIProcess/WebGrammarDetail.cpp \
+ Source/WebKit2/UIProcess/WebGrammarDetail.h \
+ Source/WebKit2/UIProcess/WebHistoryClient.cpp \
+ Source/WebKit2/UIProcess/WebHistoryClient.h \
+ Source/WebKit2/UIProcess/WebIconDatabase.cpp \
+ Source/WebKit2/UIProcess/WebIconDatabase.h \
+ Source/WebKit2/UIProcess/WebIconDatabaseClient.cpp \
+ Source/WebKit2/UIProcess/WebIconDatabaseClient.h \
+ Source/WebKit2/UIProcess/WebInspectorProxy.cpp \
+ Source/WebKit2/UIProcess/WebInspectorProxy.h \
+ Source/WebKit2/UIProcess/WebKeyValueStorageManagerProxy.cpp \
+ Source/WebKit2/UIProcess/WebKeyValueStorageManagerProxy.h \
+ Source/WebKit2/UIProcess/WebMediaCacheManagerProxy.cpp \
+ Source/WebKit2/UIProcess/WebMediaCacheManagerProxy.h \
+ Source/WebKit2/UIProcess/WebLoaderClient.cpp \
+ Source/WebKit2/UIProcess/WebLoaderClient.h \
+ Source/WebKit2/UIProcess/WebNavigationData.cpp \
+ Source/WebKit2/UIProcess/WebNavigationData.h \
+ Source/WebKit2/UIProcess/WebOpenPanelResultListenerProxy.cpp \
+ Source/WebKit2/UIProcess/WebOpenPanelResultListenerProxy.h \
+ Source/WebKit2/UIProcess/WebPageContextMenuClient.cpp \
+ Source/WebKit2/UIProcess/WebPageContextMenuClient.h \
+ Source/WebKit2/UIProcess/WebPageGroup.cpp \
+ Source/WebKit2/UIProcess/WebPageGroup.h \
+ Source/WebKit2/UIProcess/WebPageProxy.cpp \
+ Source/WebKit2/UIProcess/WebPageProxy.h \
+ Source/WebKit2/UIProcess/WebPolicyClient.cpp \
+ Source/WebKit2/UIProcess/WebPolicyClient.h \
+ Source/WebKit2/UIProcess/WebPopupMenuProxy.h \
+ Source/WebKit2/UIProcess/WebPreferences.cpp \
+ Source/WebKit2/UIProcess/WebPreferences.h \
+ Source/WebKit2/UIProcess/WebProcessProxy.cpp \
+ Source/WebKit2/UIProcess/WebProcessProxy.h \
+ Source/WebKit2/UIProcess/WebResourceCacheManagerProxy.h \
+ Source/WebKit2/UIProcess/WebResourceCacheManagerProxy.cpp \
+ Source/WebKit2/UIProcess/WebResourceLoadClient.cpp \
+ Source/WebKit2/UIProcess/WebResourceLoadClient.h \
+ Source/WebKit2/UIProcess/WebTextChecker.cpp \
+ Source/WebKit2/UIProcess/WebTextChecker.h \
+ Source/WebKit2/UIProcess/WebTextCheckerClient.cpp \
+ Source/WebKit2/UIProcess/WebTextCheckerClient.h \
+ Source/WebKit2/UIProcess/WebUIClient.cpp \
+ Source/WebKit2/UIProcess/WebUIClient.h \
+ Source/WebKit2/WebKit2Prefix.h \
+ Source/WebKit2/WebProcess/ApplicationCache/WebApplicationCacheManager.h \
+ Source/WebKit2/WebProcess/ApplicationCache/WebApplicationCacheManager.cpp \
+ Source/WebKit2/WebProcess/Authentication/AuthenticationManager.cpp \
+ Source/WebKit2/WebProcess/Authentication/AuthenticationManager.h \
+ Source/WebKit2/WebProcess/Cookies/WebCookieManager.h \
+ Source/WebKit2/WebProcess/Cookies/WebCookieManager.cpp \
+ Source/WebKit2/WebProcess/Cookies/soup/WebCookieManagerSoup.cpp \
+ Source/WebKit2/WebProcess/Downloads/Download.cpp \
+ Source/WebKit2/WebProcess/Downloads/Download.h \
+ Source/WebKit2/WebProcess/Downloads/DownloadAuthenticationClient.h \
+ Source/WebKit2/WebProcess/Downloads/DownloadManager.cpp \
+ Source/WebKit2/WebProcess/Downloads/DownloadManager.h \
+ Source/WebKit2/WebProcess/Downloads/soup/DownloadSoup.cpp \
+ Source/WebKit2/WebProcess/FullScreen/WebFullScreenManager.cpp \
+ Source/WebKit2/WebProcess/FullScreen/WebFullScreenManager.h \
+ Source/WebKit2/WebProcess/Geolocation/GeolocationPermissionRequestManager.cpp \
+ Source/WebKit2/WebProcess/Geolocation/GeolocationPermissionRequestManager.h \
+ Source/WebKit2/WebProcess/Geolocation/WebGeolocationManager.cpp \
+ Source/WebKit2/WebProcess/Geolocation/WebGeolocationManager.h \
+ Source/WebKit2/WebProcess/gtk/WebAuthDialog.cpp \
+ Source/WebKit2/WebProcess/gtk/WebAuthDialog.h \
+ Source/WebKit2/WebProcess/gtk/WebProcessGtk.cpp \
+ Source/WebKit2/WebProcess/gtk/WebProcessMainGtk.cpp \
+ Source/WebKit2/WebProcess/gtk/WebProcessMainGtk.h \
+ Source/WebKit2/WebProcess/IconDatabase/WebIconDatabaseProxy.cpp \
+ Source/WebKit2/WebProcess/IconDatabase/WebIconDatabaseProxy.h \
+ Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleAPICast.h \
+ Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleBackForwardList.cpp \
+ Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleBackForwardList.h \
+ Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleBackForwardListItem.cpp \
+ Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleBackForwardListItem.h \
+ Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundle.cpp \
+ Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleDOMWindowExtension.cpp \
+ Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleDOMWindowExtension.h \
+ Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp \
+ Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleFrame.h \
+ Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleFramePrivate.h \
+ Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundle.h \
+ Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleHitTestResult.cpp \
+ Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleHitTestResult.h \
+ Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleNavigationAction.h \
+ Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleNavigationAction.cpp \
+ 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/WKBundleNodeHandle.cpp \
+ Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.h \
+ Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleNodeHandlePrivate.h \
+ Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp \
+ Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePageGroup.cpp \
+ Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePageGroup.h \
+ Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.h \
+ Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp \
+ Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.h \
+ Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h \
+ Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePrivate.h \
+ Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleRangeHandle.cpp \
+ Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleRangeHandle.h \
+ Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleScriptWorld.cpp \
+ Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleScriptWorld.h \
+ Source/WebKit2/WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp \
+ Source/WebKit2/WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h \
+ Source/WebKit2/WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp \
+ Source/WebKit2/WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.h \
+ Source/WebKit2/WebProcess/InjectedBundle/gtk/InjectedBundleGtk.cpp \
+ Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp \
+ Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.h \
+ Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleBackForwardList.cpp \
+ Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleBackForwardList.h \
+ Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleBackForwardListItem.cpp \
+ Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleBackForwardListItem.h \
+ Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleClient.cpp \
+ Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleClient.h \
+ Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleDOMWindowExtension.cpp \
+ Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleDOMWindowExtension.h \
+ Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleHitTestResult.cpp \
+ Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleHitTestResult.h \
+ Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleNavigationAction.cpp \
+ Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleNavigationAction.h \
+ Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageContextMenuClient.cpp \
+ Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageContextMenuClient.h \
+ Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageEditorClient.cpp \
+ Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageEditorClient.h \
+ Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageFormClient.cpp \
+ Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageFormClient.h \
+ Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageFullScreenClient.cpp \
+ Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageFullScreenClient.h \
+ Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp \
+ Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h \
+ Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePagePolicyClient.cpp \
+ Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePagePolicyClient.h \
+ Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageResourceLoadClient.cpp \
+ Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageResourceLoadClient.h \
+ Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp \
+ Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageUIClient.h \
+ Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleScriptWorld.cpp \
+ Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleScriptWorld.h \
+ Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleUserMessageCoders.h \
+ Source/WebKit2/WebProcess/KeyValueStorage/WebKeyValueStorageManager.cpp \
+ Source/WebKit2/WebProcess/KeyValueStorage/WebKeyValueStorageManager.h \
+ Source/WebKit2/WebProcess/MediaCache/WebMediaCacheManager.cpp \
+ Source/WebKit2/WebProcess/MediaCache/WebMediaCacheManager.h \
+ Source/WebKit2/WebProcess/Notifications/NotificationPermissionRequestManager.cpp \
+ Source/WebKit2/WebProcess/Notifications/NotificationPermissionRequestManager.h \
+ Source/WebKit2/WebProcess/Notifications/WebNotificationManager.cpp \
+ Source/WebKit2/WebProcess/Notifications/WebNotificationManager.h \
+ Source/WebKit2/WebProcess/Plugins/Netscape/JSNPMethod.cpp \
+ Source/WebKit2/WebProcess/Plugins/Netscape/JSNPMethod.h \
+ Source/WebKit2/WebProcess/Plugins/Netscape/JSNPObject.cpp \
+ Source/WebKit2/WebProcess/Plugins/Netscape/JSNPObject.h \
+ Source/WebKit2/WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp \
+ Source/WebKit2/WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.h \
+ Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.cpp \
+ Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.h \
+ Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePluginNone.cpp \
+ Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePluginStream.cpp \
+ Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePluginStream.h \
+ Source/WebKit2/WebProcess/Plugins/Netscape/NPJSObject.cpp \
+ Source/WebKit2/WebProcess/Plugins/Netscape/NPJSObject.h \
+ Source/WebKit2/WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp \
+ Source/WebKit2/WebProcess/Plugins/Netscape/NPRuntimeObjectMap.h \
+ Source/WebKit2/WebProcess/Plugins/Netscape/NPRuntimeUtilities.cpp \
+ Source/WebKit2/WebProcess/Plugins/Netscape/NPRuntimeUtilities.h \
+ Source/WebKit2/WebProcess/Plugins/Netscape/gtk/PluginProxyGtk.cpp \
+ Source/WebKit2/WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp \
+ Source/WebKit2/WebProcess/Plugins/PluginController.h \
+ Source/WebKit2/WebProcess/Plugins/Plugin.cpp \
+ Source/WebKit2/WebProcess/Plugins/Plugin.h \
+ Source/WebKit2/WebProcess/Plugins/PluginProcessConnection.cpp \
+ Source/WebKit2/WebProcess/Plugins/PluginProcessConnection.h \
+ Source/WebKit2/WebProcess/Plugins/PluginProcessConnectionManager.cpp \
+ Source/WebKit2/WebProcess/Plugins/PluginProcessConnectionManager.h \
+ Source/WebKit2/WebProcess/Plugins/PluginProxy.cpp \
+ Source/WebKit2/WebProcess/Plugins/PluginProxy.h \
+ Source/WebKit2/WebProcess/Plugins/PluginView.cpp \
+ Source/WebKit2/WebProcess/Plugins/PluginView.h \
+ Source/WebKit2/WebProcess/ResourceCache/WebResourceCacheManager.h \
+ Source/WebKit2/WebProcess/ResourceCache/WebResourceCacheManager.cpp \
+ Source/WebKit2/WebProcess/soup/WebSoupRequestManager.cpp \
+ Source/WebKit2/WebProcess/soup/WebSoupRequestManager.h \
+ Source/WebKit2/WebProcess/soup/WebKitSoupRequestGeneric.cpp \
+ Source/WebKit2/WebProcess/soup/WebKitSoupRequestGeneric.h \
+ Source/WebKit2/WebProcess/WebCoreSupport/gtk/WebContextMenuClientGtk.cpp \
+ Source/WebKit2/WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp \
+ Source/WebKit2/WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp \
+ Source/WebKit2/WebProcess/WebCoreSupport/gtk/WebErrorsGtk.cpp \
+ Source/WebKit2/WebProcess/WebCoreSupport/gtk/WebPopupMenuGtk.cpp \
+ Source/WebKit2/WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.cpp \
+ Source/WebKit2/WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.h \
+ Source/WebKit2/WebProcess/WebCoreSupport/WebAlternativeTextClient.h \
+ Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp \
+ Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h \
+ Source/WebKit2/WebProcess/WebCoreSupport/WebContextMenuClient.cpp \
+ Source/WebKit2/WebProcess/WebCoreSupport/WebContextMenuClient.h \
+ Source/WebKit2/WebProcess/WebCoreSupport/WebDatabaseManager.cpp \
+ Source/WebKit2/WebProcess/WebCoreSupport/WebDatabaseManager.h \
+ Source/WebKit2/WebProcess/WebCoreSupport/WebDragClient.cpp \
+ Source/WebKit2/WebProcess/WebCoreSupport/WebDragClient.h \
+ Source/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.cpp \
+ Source/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.h \
+ Source/WebKit2/WebProcess/WebCoreSupport/WebErrors.h \
+ Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp \
+ Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.h \
+ Source/WebKit2/WebProcess/WebCoreSupport/WebGeolocationClient.cpp \
+ Source/WebKit2/WebProcess/WebCoreSupport/WebGeolocationClient.h \
+ Source/WebKit2/WebProcess/WebCoreSupport/WebInspectorClient.cpp \
+ Source/WebKit2/WebProcess/WebCoreSupport/WebInspectorClient.h \
+ Source/WebKit2/WebProcess/WebCoreSupport/WebInspectorFrontendClient.cpp \
+ Source/WebKit2/WebProcess/WebCoreSupport/WebInspectorFrontendClient.h \
+ Source/WebKit2/WebProcess/WebCoreSupport/WebNotificationClient.cpp \
+ Source/WebKit2/WebProcess/WebCoreSupport/WebNotificationClient.h \
+ Source/WebKit2/WebProcess/WebCoreSupport/WebPlatformStrategies.cpp \
+ Source/WebKit2/WebProcess/WebCoreSupport/WebPlatformStrategies.h \
+ Source/WebKit2/WebProcess/WebCoreSupport/WebPopupMenu.cpp \
+ Source/WebKit2/WebProcess/WebCoreSupport/WebPopupMenu.h \
+ Source/WebKit2/WebProcess/WebCoreSupport/WebSearchPopupMenu.cpp \
+ Source/WebKit2/WebProcess/WebCoreSupport/WebSearchPopupMenu.h \
+ Source/WebKit2/WebProcess/WebPage/DecoderAdapter.cpp \
+ Source/WebKit2/WebProcess/WebPage/DecoderAdapter.h \
+ Source/WebKit2/WebProcess/WebPage/DrawingArea.cpp \
+ Source/WebKit2/WebProcess/WebPage/DrawingArea.h \
+ Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp \
+ Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.h \
+ Source/WebKit2/WebProcess/WebPage/EncoderAdapter.cpp \
+ Source/WebKit2/WebProcess/WebPage/EncoderAdapter.h \
+ Source/WebKit2/WebProcess/WebPage/EventDispatcher.cpp \
+ Source/WebKit2/WebProcess/WebPage/EventDispatcher.h \
+ Source/WebKit2/WebProcess/WebPage/FindController.cpp \
+ Source/WebKit2/WebProcess/WebPage/FindController.h \
+ Source/WebKit2/WebProcess/WebPage/TapHighlightController.cpp \
+ Source/WebKit2/WebProcess/WebPage/TapHighlightController.h \
+ Source/WebKit2/WebProcess/WebPage/gtk/WebInspectorGtk.cpp \
+ Source/WebKit2/WebProcess/WebPage/gtk/WebPageAccessibilityObject.h \
+ Source/WebKit2/WebProcess/WebPage/gtk/WebPageAccessibilityObject.cpp \
+ Source/WebKit2/WebProcess/WebPage/gtk/WebPageGtk.cpp \
+ Source/WebKit2/WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp \
+ Source/WebKit2/WebProcess/WebPage/gtk/WebPrintOperationGtk.h \
+ Source/WebKit2/WebProcess/WebPage/LayerTreeHost.cpp \
+ Source/WebKit2/WebProcess/WebPage/LayerTreeHost.h \
+ Source/WebKit2/WebProcess/WebPage/PageOverlay.cpp \
+ Source/WebKit2/WebProcess/WebPage/PageOverlay.h \
+ Source/WebKit2/WebProcess/WebPage/WebBackForwardListProxy.cpp \
+ Source/WebKit2/WebProcess/WebPage/WebBackForwardListProxy.h \
+ Source/WebKit2/WebProcess/WebPage/WebContextMenu.cpp \
+ Source/WebKit2/WebProcess/WebPage/WebContextMenu.h \
+ Source/WebKit2/WebProcess/WebPage/WebFrame.cpp \
+ Source/WebKit2/WebProcess/WebPage/WebFrame.h \
+ Source/WebKit2/WebProcess/WebPage/WebInspector.cpp \
+ Source/WebKit2/WebProcess/WebPage/WebInspector.h \
+ Source/WebKit2/WebProcess/WebPage/WebOpenPanelResultListener.cpp \
+ Source/WebKit2/WebProcess/WebPage/WebOpenPanelResultListener.h \
+ Source/WebKit2/WebProcess/WebPage/WebPage.cpp \
+ Source/WebKit2/WebProcess/WebPage/WebPageGroupProxy.cpp \
+ Source/WebKit2/WebProcess/WebPage/WebPageGroupProxy.h \
+ Source/WebKit2/WebProcess/WebPage/WebPage.h \
+ Source/WebKit2/WebProcess/WebPage/WebUndoStep.cpp \
+ Source/WebKit2/WebProcess/WebPage/WebUndoStep.h \
+ Source/WebKit2/WebProcess/WebConnectionToUIProcess.cpp \
+ Source/WebKit2/WebProcess/WebConnectionToUIProcess.h \
+ Source/WebKit2/WebProcess/WebProcess.cpp \
+ Source/WebKit2/WebProcess/WebProcess.h
+
+if ENABLE_PLUGIN_PROCESS
+
+webkit2_plugin_process_built_sources += \
+ DerivedSources/WebKit2/NPObjectMessageReceiverMessageReceiver.cpp \
+ DerivedSources/WebKit2/NPObjectMessageReceiverMessages.h \
+ DerivedSources/WebKit2/PluginControllerProxyMessageReceiver.cpp \
+ DerivedSources/WebKit2/PluginControllerProxyMessages.h \
+ DerivedSources/WebKit2/PluginProcessMessageReceiver.cpp \
+ DerivedSources/WebKit2/PluginProcessMessages.h \
+ DerivedSources/WebKit2/WebProcessConnectionMessageReceiver.cpp \
+ DerivedSources/WebKit2/WebProcessConnectionMessages.h
+
+webkit2_plugin_process_sources += \
+ Source/WebKit2/Platform/CoreIPC/ArgumentCoder.h \
+ Source/WebKit2/Platform/CoreIPC/ArgumentCoders.h \
+ Source/WebKit2/Platform/CoreIPC/ArgumentCoders.cpp \
+ Source/WebKit2/Platform/CoreIPC/ArgumentDecoder.cpp \
+ Source/WebKit2/Platform/CoreIPC/ArgumentDecoder.h \
+ Source/WebKit2/Platform/CoreIPC/ArgumentEncoder.cpp \
+ Source/WebKit2/Platform/CoreIPC/ArgumentEncoder.h \
+ Source/WebKit2/Platform/CoreIPC/Arguments.h \
+ Source/WebKit2/Platform/CoreIPC/Attachment.cpp \
+ Source/WebKit2/Platform/CoreIPC/Attachment.h \
+ Source/WebKit2/Platform/CoreIPC/BinarySemaphore.cpp \
+ Source/WebKit2/Platform/CoreIPC/BinarySemaphore.h \
+ Source/WebKit2/Platform/CoreIPC/Connection.cpp \
+ Source/WebKit2/Platform/CoreIPC/Connection.h \
+ Source/WebKit2/Platform/CoreIPC/CoreIPCMessageKinds.h \
+ Source/WebKit2/Platform/CoreIPC/DataReference.cpp \
+ Source/WebKit2/Platform/CoreIPC/DataReference.h \
+ Source/WebKit2/Platform/CoreIPC/HandleMessage.h \
+ Source/WebKit2/Platform/CoreIPC/MessageID.h \
+ Source/WebKit2/Platform/CoreIPC/MessageSender.h \
+ Source/WebKit2/Platform/CoreIPC/unix/AttachmentUnix.cpp \
+ Source/WebKit2/Platform/CoreIPC/unix/ConnectionUnix.cpp \
+ Source/WebKit2/Platform/Module.cpp \
+ Source/WebKit2/Platform/Module.h \
+ Source/WebKit2/Platform/WorkQueue.cpp \
+ Source/WebKit2/Platform/WorkQueue.h \
+ Source/WebKit2/Platform/SharedMemory.h \
+ Source/WebKit2/Platform/gtk/ModuleGtk.cpp \
+ Source/WebKit2/Platform/gtk/WorkQueueGtk.cpp \
+ Source/WebKit2/Platform/unix/SharedMemoryUnix.cpp \
+ Source/WebKit2/PluginProcess/PluginControllerProxy.cpp \
+ Source/WebKit2/PluginProcess/PluginControllerProxy.h \
+ Source/WebKit2/PluginProcess/PluginCreationParameters.cpp \
+ Source/WebKit2/PluginProcess/PluginCreationParameters.h \
+ Source/WebKit2/PluginProcess/PluginProcess.cpp \
+ Source/WebKit2/PluginProcess/PluginProcess.h \
+ Source/WebKit2/PluginProcess/PluginProcessMain.h \
+ Source/WebKit2/PluginProcess/WebProcessConnection.cpp \
+ Source/WebKit2/PluginProcess/WebProcessConnection.h \
+ Source/WebKit2/Shared/Plugins/PluginProcessCreationParameters.cpp \
+ Source/WebKit2/Shared/Plugins/PluginProcessCreationParameters.h \
+ Source/WebKit2/PluginProcess/gtk/PluginControllerProxyGtk.cpp \
+ Source/WebKit2/PluginProcess/gtk/PluginProcessGtk.cpp \
+ Source/WebKit2/PluginProcess/gtk/PluginProcessMainGtk.h \
+ Source/WebKit2/PluginProcess/gtk/PluginProcessMainGtk.cpp \
+ Source/WebKit2/Shared/ChildProcess.cpp \
+ Source/WebKit2/Shared/ChildProcess.h \
+ Source/WebKit2/Shared/ProcessExecutablePath.h \
+ Source/WebKit2/Shared/Plugins/NPIdentifierData.cpp \
+ Source/WebKit2/Shared/Plugins/NPIdentifierData.h \
+ Source/WebKit2/Shared/Plugins/NPObjectMessageReceiver.cpp \
+ Source/WebKit2/Shared/Plugins/NPObjectMessageReceiver.h \
+ Source/WebKit2/Shared/Plugins/NPObjectProxy.cpp \
+ Source/WebKit2/Shared/Plugins/NPObjectProxy.h \
+ Source/WebKit2/Shared/Plugins/NPRemoteObjectMap.cpp \
+ Source/WebKit2/Shared/Plugins/NPRemoteObjectMap.h \
+ Source/WebKit2/Shared/Plugins/NPVariantData.cpp \
+ Source/WebKit2/Shared/Plugins/NPVariantData.h \
+ Source/WebKit2/Shared/Plugins/Netscape/NetscapePluginModule.cpp \
+ Source/WebKit2/Shared/Plugins/Netscape/NetscapePluginModule.h \
+ Source/WebKit2/Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp \
+ Source/WebKit2/Shared/ShareableBitmap.cpp \
+ Source/WebKit2/Shared/ShareableBitmap.h \
+ Source/WebKit2/Shared/WebCoreArgumentCoders.cpp \
+ Source/WebKit2/Shared/WebCoreArgumentCoders.h \
+ Source/WebKit2/Shared/WebEvent.cpp \
+ Source/WebKit2/Shared/WebEvent.h \
+ Source/WebKit2/Shared/WebKeyboardEvent.cpp \
+ Source/WebKit2/Shared/WebMouseEvent.cpp \
+ Source/WebKit2/Shared/WebWheelEvent.cpp \
+ Source/WebKit2/Shared/gtk/WebCoreArgumentCodersGtk.cpp \
+ Source/WebKit2/Shared/gtk/NativeWebKeyboardEventGtk.cpp \
+ Source/WebKit2/Shared/gtk/NativeWebWheelEventGtk.cpp \
+ Source/WebKit2/Shared/gtk/NativeWebMouseEventGtk.cpp \
+ Source/WebKit2/Shared/gtk/ProcessExecutablePathGtk.cpp \
+ Source/WebKit2/Shared/gtk/WebEventFactory.cpp \
+ Source/WebKit2/Shared/cairo/ShareableBitmapCairo.cpp \
+ Source/WebKit2/UIProcess/Plugins/gtk/PluginProcessProxyGtk.cpp \
+ Source/WebKit2/WebProcess/Plugins/Plugin.cpp \
+ Source/WebKit2/WebProcess/Plugins/Plugin.h \
+ Source/WebKit2/WebProcess/Plugins/Netscape/NPRuntimeUtilities.cpp \
+ Source/WebKit2/WebProcess/Plugins/Netscape/NPRuntimeUtilities.h \
+ Source/WebKit2/WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp \
+ Source/WebKit2/WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.h \
+ Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.cpp \
+ Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.h \
+ Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePluginStream.cpp \
+ Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePluginStream.h \
+ Source/WebKit2/WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp \
+ Source/WebKit2/gtk/PluginMainGtk.cpp
+
+endif # ENABLE_PLUGIN_PROCESS
diff --git a/Source/WebKit2/PluginProcess/PluginControllerProxy.cpp b/Source/WebKit2/PluginProcess/PluginControllerProxy.cpp
index 81b290a1f..d9bbfeeb4 100644
--- a/Source/WebKit2/PluginProcess/PluginControllerProxy.cpp
+++ b/Source/WebKit2/PluginProcess/PluginControllerProxy.cpp
@@ -148,6 +148,11 @@ void PluginControllerProxy::destroy()
m_connection->removePluginControllerProxy(this, plugin);
}
+bool PluginControllerProxy::wantsWheelEvents() const
+{
+ return m_plugin->wantsWheelEvents();
+}
+
void PluginControllerProxy::paint()
{
ASSERT(!m_dirtyRect.isEmpty());
diff --git a/Source/WebKit2/PluginProcess/PluginControllerProxy.h b/Source/WebKit2/PluginProcess/PluginControllerProxy.h
index 7022fd0c9..a4af54356 100644
--- a/Source/WebKit2/PluginProcess/PluginControllerProxy.h
+++ b/Source/WebKit2/PluginProcess/PluginControllerProxy.h
@@ -62,6 +62,8 @@ public:
void didReceivePluginControllerProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
void didReceiveSyncPluginControllerProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, OwnPtr<CoreIPC::ArgumentEncoder>&);
+ bool wantsWheelEvents() const;
+
#if PLATFORM(MAC)
uint32_t remoteLayerClientID() const;
#endif
diff --git a/Source/WebKit2/PluginProcess/WebProcessConnection.cpp b/Source/WebKit2/PluginProcess/WebProcessConnection.cpp
index a27d11390..5ae80b9dc 100644
--- a/Source/WebKit2/PluginProcess/WebProcessConnection.cpp
+++ b/Source/WebKit2/PluginProcess/WebProcessConnection.cpp
@@ -225,7 +225,7 @@ void WebProcessConnection::syncMessageSendTimedOut(CoreIPC::Connection*)
{
}
-void WebProcessConnection::createPlugin(const PluginCreationParameters& creationParameters, bool& result, uint32_t& remoteLayerClientID)
+void WebProcessConnection::createPlugin(const PluginCreationParameters& creationParameters, bool& result, bool& wantsWheelEvents, uint32_t& remoteLayerClientID)
{
OwnPtr<PluginControllerProxy> pluginControllerProxy = PluginControllerProxy::create(this, creationParameters);
@@ -241,6 +241,7 @@ void WebProcessConnection::createPlugin(const PluginCreationParameters& creation
if (!result)
return;
+ wantsWheelEvents = pluginControllerProxyPtr->wantsWheelEvents();
#if PLATFORM(MAC)
remoteLayerClientID = pluginControllerProxyPtr->remoteLayerClientID();
#endif
diff --git a/Source/WebKit2/PluginProcess/WebProcessConnection.h b/Source/WebKit2/PluginProcess/WebProcessConnection.h
index 4e2ea65df..f384671d3 100644
--- a/Source/WebKit2/PluginProcess/WebProcessConnection.h
+++ b/Source/WebKit2/PluginProcess/WebProcessConnection.h
@@ -68,7 +68,7 @@ private:
// Message handlers.
void didReceiveSyncWebProcessConnectionMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, OwnPtr<CoreIPC::ArgumentEncoder>&);
- void createPlugin(const PluginCreationParameters&, bool& result, uint32_t& remoteLayerClientID);
+ void createPlugin(const PluginCreationParameters&, bool& result, bool& wantsWheelEvents, uint32_t& remoteLayerClientID);
void destroyPlugin(uint64_t pluginInstanceID);
RefPtr<CoreIPC::Connection> m_connection;
diff --git a/Source/WebKit2/PluginProcess/WebProcessConnection.messages.in b/Source/WebKit2/PluginProcess/WebProcessConnection.messages.in
index 1b11458da..07c3c27fa 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, uint32_t remoteLayerClientID)
+ CreatePlugin(WebKit::PluginCreationParameters pluginCreationParameters) -> (bool result, bool wantsWheelEvents, uint32_t remoteLayerClientID)
# Destroys the plug-in instance with the given instance ID.
DestroyPlugin(uint64_t pluginInstanceID) -> ()
diff --git a/Source/WebKit2/Shared/API/c/WKError.h b/Source/WebKit2/Shared/API/c/WKError.h
index 6f1f4f36c..e8117f5aa 100644
--- a/Source/WebKit2/Shared/API/c/WKError.h
+++ b/Source/WebKit2/Shared/API/c/WKError.h
@@ -42,6 +42,7 @@ enum {
kWKErrorCodeJavaUnavailable = 202,
kWKErrorCodePlugInCancelledConnection = 203,
kWKErrorCodePlugInWillHandleLoad = 204,
+ kWKErrorCodeInsecurePlugInVersion = 205,
};
typedef uint32_t WKErrorCode;
diff --git a/Source/WebKit2/Shared/APIClientTraits.cpp b/Source/WebKit2/Shared/APIClientTraits.cpp
index f18d26358..f1f688c0e 100644
--- a/Source/WebKit2/Shared/APIClientTraits.cpp
+++ b/Source/WebKit2/Shared/APIClientTraits.cpp
@@ -52,7 +52,7 @@ const size_t APIClientTraits<WKPageContextMenuClient>::interfaceSizesByVersion[]
};
const size_t APIClientTraits<WKPageLoaderClient>::interfaceSizesByVersion[] = {
- offsetof(WKPageLoaderClient, didFailToInitializePlugin),
+ offsetof(WKPageLoaderClient, didFailToInitializePlugin_deprecatedForUseWithV0),
sizeof(WKPageLoaderClient)
};
diff --git a/Source/WebKit2/Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm b/Source/WebKit2/Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm
index 41d938979..ae247a139 100644
--- a/Source/WebKit2/Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm
+++ b/Source/WebKit2/Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm
@@ -518,6 +518,11 @@ void NetscapePluginModule::determineQuirks()
m_pluginQuirks.add(PluginQuirks::AllowHalfBakedQuickDrawSupport);
}
#endif
+
+ if (plugin.bundleIdentifier == "com.adobe.acrobat.pdfviewerNPAPI") {
+ // The Adobe Reader plug-in wants wheel events.
+ m_pluginQuirks.add(PluginQuirks::WantsWheelEvents);
+ }
}
} // namespace WebKit
diff --git a/Source/WebKit2/Shared/Plugins/PluginQuirks.h b/Source/WebKit2/Shared/Plugins/PluginQuirks.h
index 1d11e489b..c0a67d354 100644
--- a/Source/WebKit2/Shared/Plugins/PluginQuirks.h
+++ b/Source/WebKit2/Shared/Plugins/PluginQuirks.h
@@ -93,6 +93,10 @@ public:
WantsMozillaUserAgent,
#endif
+ // This isn't really a quirk as much as the opposite of a quirk. By default, we don't send wheel events
+ // to plug-ins unless we know that they handle them correctly. Adobe Reader on Mac handles wheel events correctly.
+ WantsWheelEvents,
+
NumPluginQuirks
};
diff --git a/Source/WebKit2/Shared/WebPreferencesStore.h b/Source/WebKit2/Shared/WebPreferencesStore.h
index ebb80f066..f7124077f 100644
--- a/Source/WebKit2/Shared/WebPreferencesStore.h
+++ b/Source/WebKit2/Shared/WebPreferencesStore.h
@@ -115,6 +115,7 @@ namespace WebKit {
\
#define FOR_EACH_WEBKIT_DOUBLE_PREFERENCE(macro) \
+ macro(DevicePixelRatio, devicePixelRatio, Double, double, 1.0) \
macro(PDFScaleFactor, pdfScaleFactor, Double, double, 0) \
\
@@ -131,7 +132,6 @@ namespace WebKit {
macro(DefaultFontSize, defaultFontSize, UInt32, uint32_t, 16) \
macro(DefaultFixedFontSize, defaultFixedFontSize, UInt32, uint32_t, 13) \
macro(LayoutFallbackWidth, layoutFallbackWidth, UInt32, uint32_t, 980) \
- macro(DevicePixelRatio, devicePixelRatio, Double, double, 1.0) \
macro(DeviceWidth, deviceWidth, UInt32, uint32_t, 480) \
macro(DeviceHeight, deviceHeight, UInt32, uint32_t, 854) \
macro(PDFDisplayMode, pdfDisplayMode, UInt32, uint32_t, 1) \
diff --git a/Source/WebKit2/Target.pri b/Source/WebKit2/Target.pri
index eb4efa5fe..1c75d671e 100644
--- a/Source/WebKit2/Target.pri
+++ b/Source/WebKit2/Target.pri
@@ -12,7 +12,7 @@ load(features)
include(WebKit2.pri)
WEBKIT += wtf javascriptcore webcore
-QT += declarative quick quick-private
+QT += qml quick quick-private
CONFIG += staticlib
diff --git a/Source/WebKit2/UIProcess/API/C/WKPage.h b/Source/WebKit2/UIProcess/API/C/WKPage.h
index a6d8a661a..aeefee796 100644
--- a/Source/WebKit2/UIProcess/API/C/WKPage.h
+++ b/Source/WebKit2/UIProcess/API/C/WKPage.h
@@ -27,6 +27,7 @@
#define WKPage_h
#include <WebKit2/WKBase.h>
+#include <WebKit2/WKError.h>
#include <WebKit2/WKEvent.h>
#include <WebKit2/WKFindOptions.h>
#include <WebKit2/WKGeometry.h>
@@ -69,9 +70,12 @@ typedef bool (*WKPageCanAuthenticateAgainstProtectionSpaceInFrameCallback)(WKPag
typedef void (*WKPageDidReceiveAuthenticationChallengeInFrameCallback)(WKPageRef page, WKFrameRef frame, WKAuthenticationChallengeRef authenticationChallenge, const void *clientInfo);
typedef void (*WKPageDidChangeBackForwardListCallback)(WKPageRef page, WKBackForwardListItemRef addedItem, WKArrayRef removedItems, const void *clientInfo);
typedef bool (*WKPageShouldGoToBackForwardListItemCallback)(WKPageRef page, WKBackForwardListItemRef item, const void *clientInfo);
-typedef void (*WKPageDidFailToInitializePluginCallback)(WKPageRef page, WKStringRef mimeType, const void* clientInfo);
typedef void (*WKPageDidNewFirstVisuallyNonEmptyLayoutCallback)(WKPageRef page, WKTypeRef userData, const void *clientInfo);
typedef void (*WKPageWillGoToBackForwardListItemCallback)(WKPageRef page, WKBackForwardListItemRef item, WKTypeRef userData, const void *clientInfo);
+typedef void (*WKPagePluginDidFailCallback)(WKPageRef page, WKErrorCode errorCode, WKStringRef mimeType, const void* clientInfo);
+
+// Deprecated
+typedef void (*WKPageDidFailToInitializePluginCallback_deprecatedForUseWithV0)(WKPageRef page, WKStringRef mimeType, const void* clientInfo);
struct WKPageLoaderClient {
int version;
@@ -104,7 +108,7 @@ struct WKPageLoaderClient {
WKPageCallback processDidCrash;
WKPageDidChangeBackForwardListCallback didChangeBackForwardList;
WKPageShouldGoToBackForwardListItemCallback shouldGoToBackForwardListItem;
- WKPageDidFailToInitializePluginCallback didFailToInitializePlugin;
+ WKPageDidFailToInitializePluginCallback_deprecatedForUseWithV0 didFailToInitializePlugin_deprecatedForUseWithV0;
// Version 1
WKPageDidDetectXSSForFrameCallback didDetectXSSForFrame;
@@ -115,6 +119,7 @@ struct WKPageLoaderClient {
WKPageWillGoToBackForwardListItemCallback willGoToBackForwardListItem;
WKPageCallback interactionOccurredWhileProcessUnresponsive;
+ WKPagePluginDidFailCallback pluginDidFail;
};
typedef struct WKPageLoaderClient WKPageLoaderClient;
@@ -172,6 +177,13 @@ typedef struct WKPageResourceLoadClient WKPageResourceLoadClient;
enum { kWKPageResourceLoadClientCurrentVersion = 0 };
+enum {
+ kWKPluginUnavailabilityReasonPluginMissing,
+ kWKPluginUnavailabilityReasonPluginCrashed,
+ kWKPluginUnavailabilityReasonInsecurePluginVersion
+};
+typedef uint32_t WKPluginUnavailabilityReason;
+
// UI Client
typedef WKPageRef (*WKPageCreateNewPageCallback)(WKPageRef page, WKURLRequestRef urlRequest, WKDictionaryRef features, WKEventModifiers modifiers, WKEventMouseButton mouseButton, const void *clientInfo);
typedef void (*WKPageRunJavaScriptAlertCallback)(WKPageRef page, WKStringRef alertText, WKFrameRef frame, const void *clientInfo);
@@ -182,7 +194,6 @@ typedef void (*WKPageFocusCallback)(WKPageRef page, const void *clientInfo);
typedef void (*WKPageUnfocusCallback)(WKPageRef page, const void *clientInfo);
typedef void (*WKPageSetStatusTextCallback)(WKPageRef page, WKStringRef text, const void *clientInfo);
typedef void (*WKPageMouseDidMoveOverElementCallback)(WKPageRef page, WKHitTestResultRef hitTestResult, WKEventModifiers modifiers, WKTypeRef userData, const void *clientInfo);
-typedef void (*WKPageMissingPluginButtonClickedCallback)(WKPageRef page, WKStringRef mimeType, WKStringRef url, WKStringRef pluginsPageURL, const void* clientInfo);
typedef void (*WKPageDidNotHandleKeyEventCallback)(WKPageRef page, WKNativeEventPtr event, const void *clientInfo);
typedef void (*WKPageDidNotHandleWheelEventCallback)(WKPageRef page, WKNativeEventPtr event, const void *clientInfo);
typedef bool (*WKPageGetToolbarsAreVisibleCallback)(WKPageRef page, const void *clientInfo);
@@ -207,10 +218,12 @@ typedef void (*WKPagePrintFrameCallback)(WKPageRef page, WKFrameRef frame, const
typedef void (*WKPageSaveDataToFileInDownloadsFolderCallback)(WKPageRef page, WKStringRef suggestedFilename, WKStringRef mimeType, WKURLRef originatingURL, WKDataRef data, const void* clientInfo);
typedef bool (*WKPageShouldInterruptJavaScriptCallback)(WKPageRef page, const void *clientInfo);
typedef void (*WKPageDecidePolicyForNotificationPermissionRequestCallback)(WKPageRef page, WKSecurityOriginRef origin, WKNotificationPermissionRequestRef permissionRequest, const void *clientInfo);
+typedef void (*WKPageUnavailablePluginButtonClickedCallback)(WKPageRef page, WKPluginUnavailabilityReason pluginUnavailabilityReason, WKStringRef mimeType, WKStringRef url, WKStringRef pluginsPageURL, const void* clientInfo);
// Deprecated
typedef WKPageRef (*WKPageCreateNewPageCallback_deprecatedForUseWithV0)(WKPageRef page, WKDictionaryRef features, WKEventModifiers modifiers, WKEventMouseButton mouseButton, const void *clientInfo);
typedef void (*WKPageMouseDidMoveOverElementCallback_deprecatedForUseWithV0)(WKPageRef page, WKEventModifiers modifiers, WKTypeRef userData, const void *clientInfo);
+typedef void (*WKPageMissingPluginButtonClickedCallback_deprecatedForUseWithV0)(WKPageRef page, WKStringRef mimeType, WKStringRef url, WKStringRef pluginsPageURL, const void* clientInfo);
struct WKPageUIClient {
int version;
@@ -228,7 +241,7 @@ struct WKPageUIClient {
WKPageRunJavaScriptPromptCallback runJavaScriptPrompt;
WKPageSetStatusTextCallback setStatusText;
WKPageMouseDidMoveOverElementCallback_deprecatedForUseWithV0 mouseDidMoveOverElement_deprecatedForUseWithV0;
- WKPageMissingPluginButtonClickedCallback missingPluginButtonClicked;
+ WKPageMissingPluginButtonClickedCallback_deprecatedForUseWithV0 missingPluginButtonClicked_deprecatedForUseWithV0;
WKPageDidNotHandleKeyEventCallback didNotHandleKeyEvent;
WKPageDidNotHandleWheelEventCallback didNotHandleWheelEvent;
WKPageGetToolbarsAreVisibleCallback toolbarsAreVisible;
@@ -261,6 +274,7 @@ struct WKPageUIClient {
WKPageCreateNewPageCallback createNewPage;
WKPageMouseDidMoveOverElementCallback mouseDidMoveOverElement;
WKPageDecidePolicyForNotificationPermissionRequestCallback decidePolicyForNotificationPermissionRequest;
+ WKPageUnavailablePluginButtonClickedCallback unavailablePluginButtonClicked;
};
typedef struct WKPageUIClient WKPageUIClient;
diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitLoaderClient.cpp b/Source/WebKit2/UIProcess/API/gtk/WebKitLoaderClient.cpp
index c26d8ebe9..9476255c8 100644
--- a/Source/WebKit2/UIProcess/API/gtk/WebKitLoaderClient.cpp
+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitLoaderClient.cpp
@@ -145,7 +145,9 @@ void attachLoaderClientToView(WebKitWebView* webView)
0, // shouldGoToBackForwardListItem
0, // didFailToInitializePlugin
0, // didDetectXSSForFrame
- 0 // didFirstVisuallyNonEmptyLayoutForFrame
+ 0, // didFirstVisuallyNonEmptyLayoutForFrame
+ 0, // willGoToBackForwardListItem
+ 0 // interactionOccurredWhileProcessUnresponsive
};
WKPageRef wkPage = toAPI(webkitWebViewBaseGetPage(WEBKIT_WEB_VIEW_BASE(webView)));
WKPageSetPageLoaderClient(wkPage, &wkLoaderClient);
diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitSettings.cpp b/Source/WebKit2/UIProcess/API/gtk/WebKitSettings.cpp
index 8bec722b3..5c027044b 100644
--- a/Source/WebKit2/UIProcess/API/gtk/WebKitSettings.cpp
+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitSettings.cpp
@@ -106,7 +106,9 @@ enum {
PROP_ENABLE_WEBAUDIO,
PROP_ENABLE_WEBGL,
PROP_ZOOM_TEXT_ONLY,
- PROP_JAVASCRIPT_CAN_ACCESS_CLIPBOARD
+ PROP_JAVASCRIPT_CAN_ACCESS_CLIPBOARD,
+ PROP_MEDIA_PLAYBACK_REQUIRES_USER_GESTURE,
+ PROP_MEDIA_PLAYBACK_ALLOWS_INLINE
};
static void webKitSettingsSetProperty(GObject* object, guint propId, const GValue* value, GParamSpec* paramSpec)
@@ -219,6 +221,12 @@ static void webKitSettingsSetProperty(GObject* object, guint propId, const GValu
case PROP_JAVASCRIPT_CAN_ACCESS_CLIPBOARD:
webkit_settings_set_javascript_can_access_clipboard(settings, g_value_get_boolean(value));
break;
+ case PROP_MEDIA_PLAYBACK_REQUIRES_USER_GESTURE:
+ webkit_settings_set_media_playback_requires_user_gesture(settings, g_value_get_boolean(value));
+ break;
+ case PROP_MEDIA_PLAYBACK_ALLOWS_INLINE:
+ webkit_settings_set_media_playback_allows_inline(settings, g_value_get_boolean(value));
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, propId, paramSpec);
break;
@@ -335,6 +343,12 @@ static void webKitSettingsGetProperty(GObject* object, guint propId, GValue* val
case PROP_JAVASCRIPT_CAN_ACCESS_CLIPBOARD:
g_value_set_boolean(value, webkit_settings_get_javascript_can_access_clipboard(settings));
break;
+ case PROP_MEDIA_PLAYBACK_REQUIRES_USER_GESTURE:
+ g_value_set_boolean(value, webkit_settings_get_media_playback_requires_user_gesture(settings));
+ break;
+ case PROP_MEDIA_PLAYBACK_ALLOWS_INLINE:
+ g_value_set_boolean(value, webkit_settings_get_media_playback_allows_inline(settings));
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, propId, paramSpec);
break;
@@ -862,6 +876,38 @@ static void webkit_settings_class_init(WebKitSettingsClass* klass)
FALSE,
readWriteConstructParamFlags));
+ /**
+ * WebKitSettings:media-playback-requires-user-gesture:
+ *
+ * Whether a user gesture (such as clicking the play button)
+ * would be required to start media playback or load media. This is off
+ * by default, so media playback could start automatically.
+ * Setting it on requires a gesture by the user to start playback, or to
+ * load the media.
+ */
+ g_object_class_install_property(gObjectClass,
+ PROP_MEDIA_PLAYBACK_REQUIRES_USER_GESTURE,
+ g_param_spec_boolean("media-playback-requires-user-gesture",
+ _("Media playback requires user gesture"),
+ _("Whether media playback requires user gesture"),
+ FALSE,
+ readWriteConstructParamFlags));
+
+ /**
+ * WebKitSettings:media-playback-allows-inline
+ *
+ * Whether media playback is full-screen only or inline playback is allowed.
+ * This is %TRUE by default, so media playback can be inline. Setting it to
+ * %FALSE allows specifying that media playback should be always fullscreen.
+ */
+ g_object_class_install_property(gObjectClass,
+ PROP_MEDIA_PLAYBACK_ALLOWS_INLINE,
+ g_param_spec_boolean("media-playback-allows-inline",
+ _("Media playback allows inline"),
+ _("Whether media playback allows inline"),
+ TRUE,
+ readWriteConstructParamFlags));
+
g_type_class_add_private(klass, sizeof(WebKitSettingsPrivate));
}
@@ -2193,3 +2239,77 @@ void webkit_settings_set_javascript_can_access_clipboard(WebKitSettings* setting
g_object_notify(G_OBJECT(settings), "javascript-can-access-clipboard");
}
+
+/**
+ * webkit_settings_set_media_playback_requires_user_gesture:
+ * @settings: a #WebKitSettings
+ * @enabled: Value to be set
+ *
+ * Set the #WebKitSettings:media-playback-requires-user-gesture property.
+ */
+void webkit_settings_set_media_playback_requires_user_gesture(WebKitSettings* settings, gboolean enabled)
+{
+ g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
+
+ WebKitSettingsPrivate* priv = settings->priv;
+ bool currentValue = WKPreferencesGetMediaPlaybackRequiresUserGesture(priv->preferences.get());
+ if (currentValue == enabled)
+ return;
+
+ WKPreferencesSetMediaPlaybackRequiresUserGesture(priv->preferences.get(), enabled);
+
+ g_object_notify(G_OBJECT(settings), "media-playback-requires-user-gesture");
+}
+
+/**
+ * webkit_settings_get_media_playback_requires_user_gesture:
+ * @settings: a #WebKitSettings
+ *
+ * Get the #WebKitSettings:media-playback-requires-user-gesture property.
+ *
+ * Returns: %TRUE If an user gesture is needed to play or load media
+ * or %FALSE if no user gesture is needed.
+ */
+gboolean webkit_settings_get_media_playback_requires_user_gesture(WebKitSettings* settings)
+{
+ g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
+
+ return WKPreferencesGetMediaPlaybackRequiresUserGesture(settings->priv->preferences.get());
+}
+
+/**
+ * webkit_settings_set_media_playback_allows_inline:
+ * @settings: a #WebKitSettings
+ * @enabled: Value to be set
+ *
+ * Set the #WebKitSettings:media-playback-allows-inline property.
+ */
+void webkit_settings_set_media_playback_allows_inline(WebKitSettings* settings, gboolean enabled)
+{
+ g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
+
+ WebKitSettingsPrivate* priv = settings->priv;
+ bool currentValue = WKPreferencesGetMediaPlaybackAllowsInline(priv->preferences.get());
+ if (currentValue == enabled)
+ return;
+
+ WKPreferencesSetMediaPlaybackAllowsInline(priv->preferences.get(), enabled);
+
+ g_object_notify(G_OBJECT(settings), "media-playback-allows-inline");
+}
+
+/**
+ * webkit_settings_get_media_playback_allows_inline:
+ * @settings: a #WebKitSettings
+ *
+ * Get the #WebKitSettings:media-playback-allows-inline property.
+ *
+ * Returns: %TRUE If inline playback is allowed for media
+ * or %FALSE if only fullscreen playback is allowed.
+ */
+gboolean webkit_settings_get_media_playback_allows_inline(WebKitSettings* settings)
+{
+ g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), TRUE);
+
+ return WKPreferencesGetMediaPlaybackAllowsInline(settings->priv->preferences.get());
+}
diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitSettings.h b/Source/WebKit2/UIProcess/API/gtk/WebKitSettings.h
index 57bf3f17d..fda7089d0 100644
--- a/Source/WebKit2/UIProcess/API/gtk/WebKitSettings.h
+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitSettings.h
@@ -321,6 +321,19 @@ WEBKIT_API void
webkit_settings_set_javascript_can_access_clipboard (WebKitSettings *settings,
gboolean enabled);
+WEBKIT_API gboolean
+webkit_settings_get_media_playback_requires_user_gesture (WebKitSettings *settings);
+
+WEBKIT_API void
+webkit_settings_set_media_playback_requires_user_gesture (WebKitSettings *settings,
+ gboolean enabled);
+
+WEBKIT_API gboolean
+webkit_settings_get_media_playback_allows_inline (WebKitSettings *settings);
+
+WEBKIT_API void
+webkit_settings_set_media_playback_allows_inline (WebKitSettings *settings,
+ gboolean enabled);
G_END_DECLS
#endif /* WebKitSettings_h */
diff --git a/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-sections.txt b/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-sections.txt
index dc5e65ac6..f5e15d9b2 100644
--- a/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-sections.txt
+++ b/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-sections.txt
@@ -251,6 +251,10 @@ webkit_settings_get_zoom_text_only
webkit_settings_set_zoom_text_only
webkit_settings_get_javascript_can_access_clipboard
webkit_settings_set_javascript_can_access_clipboard
+webkit_settings_get_media_playback_requires_user_gesture
+webkit_settings_set_media_playback_requires_user_gesture
+webkit_settings_get_media_playback_allows_inline
+webkit_settings_set_media_playback_allows_inline
<SUBSECTION Standard>
WebKitSettingsClass
diff --git a/Source/WebKit2/UIProcess/API/gtk/tests/TestResources.cpp b/Source/WebKit2/UIProcess/API/gtk/tests/TestResources.cpp
index cc272c9e8..e08cfb9c9 100644
--- a/Source/WebKit2/UIProcess/API/gtk/tests/TestResources.cpp
+++ b/Source/WebKit2/UIProcess/API/gtk/tests/TestResources.cpp
@@ -207,7 +207,7 @@ static void testWebViewResources(ResourcesTest* test, gconstpointer)
#endif
// Reload.
- webkit_web_view_reload(test->m_webView);
+ webkit_web_view_reload_bypass_cache(test->m_webView);
test->waitUntilResourcesLoaded(4);
}
diff --git a/Source/WebKit2/UIProcess/API/gtk/tests/TestWebKitSettings.cpp b/Source/WebKit2/UIProcess/API/gtk/tests/TestWebKitSettings.cpp
index 19491c201..ad03444ae 100644
--- a/Source/WebKit2/UIProcess/API/gtk/tests/TestWebKitSettings.cpp
+++ b/Source/WebKit2/UIProcess/API/gtk/tests/TestWebKitSettings.cpp
@@ -209,6 +209,16 @@ static void testWebKitSettings(Test*, gconstpointer)
webkit_settings_set_javascript_can_access_clipboard(settings, TRUE);
g_assert(webkit_settings_get_javascript_can_access_clipboard(settings));
+ // By default, media playback doesn't require user gestures.
+ g_assert(!webkit_settings_get_media_playback_requires_user_gesture(settings));
+ webkit_settings_set_media_playback_requires_user_gesture(settings, TRUE);
+ g_assert(webkit_settings_get_media_playback_requires_user_gesture(settings));
+
+ // By default, inline media playback is allowed
+ g_assert(webkit_settings_get_media_playback_allows_inline(settings));
+ webkit_settings_set_media_playback_allows_inline(settings, FALSE);
+ g_assert(!webkit_settings_get_media_playback_allows_inline(settings));
+
g_object_unref(G_OBJECT(settings));
}
diff --git a/Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp b/Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp
index b1b465526..167c50f6a 100644
--- a/Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp
+++ b/Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp
@@ -27,6 +27,7 @@
#include "QtDownloadManager.h"
#include "QtViewportInteractionEngine.h"
#include "QtWebContext.h"
+#include "QtWebError.h"
#include "QtWebIconDatabaseClient.h"
#include "QtWebPageEventHandler.h"
#include "QtWebPageLoadClient.h"
@@ -52,10 +53,14 @@
#include "qwebviewportinfo_p.h"
#include <JavaScriptCore/InitializeThreading.h>
+#include <JavaScriptCore/JSBase.h>
+#include <JavaScriptCore/JSRetainPtr.h>
#include <QDateTime>
+#include <QtQml/QJSValue>
+#include <WKOpenPanelResultListener.h>
+#include <WKSerializedScriptValue.h>
#include <WebCore/IntPoint.h>
#include <WebCore/IntRect.h>
-#include <WKOpenPanelResultListener.h>
#include <wtf/Assertions.h>
#include <wtf/MainThread.h>
#include <wtf/text/WTFString.h>
@@ -68,6 +73,105 @@ static const int kAxisLockSampleCount = 5;
static const qreal kAxisLockVelocityThreshold = 300;
static const qreal kAxisLockVelocityDirectionThreshold = 50;
+struct JSCallbackClosure {
+ QPointer<QObject> receiver;
+ QByteArray method;
+ QJSValue value;
+};
+
+static inline QString toQString(JSStringRef string)
+{
+ return QString(reinterpret_cast<const QChar*>(JSStringGetCharactersPtr(string)), JSStringGetLength(string));
+}
+
+static inline QJSValue toQJSValue(JSStringRef string)
+{
+ return QJSValue(toQString(string));
+}
+
+static QJSValue buildQJSValue(QJSEngine* engine, JSGlobalContextRef context, JSValueRef value, int depth)
+{
+ QJSValue var;
+ JSValueRef exception = 0;
+
+ if (depth > 10)
+ return var;
+
+ switch (JSValueGetType(context, value)) {
+ case kJSTypeBoolean:
+ var = QJSValue(JSValueToBoolean(context, value));
+ break;
+ case kJSTypeNumber:
+ {
+ double number = JSValueToNumber(context, value, &exception);
+ if (!exception)
+ var = QJSValue(number);
+ }
+ break;
+ case kJSTypeString:
+ {
+ JSRetainPtr<JSStringRef> string = JSValueToStringCopy(context, value, &exception);
+ if (!exception)
+ var = toQJSValue(string.get());
+ }
+ break;
+ case kJSTypeObject:
+ {
+ JSObjectRef obj = JSValueToObject(context, value, &exception);
+
+ JSPropertyNameArrayRef names = JSObjectCopyPropertyNames(context, obj);
+ size_t length = JSPropertyNameArrayGetCount(names);
+
+ var = engine->newObject();
+
+ for (size_t i = 0; i < length; ++i) {
+ JSRetainPtr<JSStringRef> name = JSPropertyNameArrayGetNameAtIndex(names, i);
+ JSValueRef property = JSObjectGetProperty(context, obj, name.get(), &exception);
+
+ if (!exception) {
+ QJSValue value = buildQJSValue(engine, context, property, depth + 1);
+ var.setProperty(toQString(name.get()), value);
+ }
+ }
+ }
+ break;
+ }
+ return var;
+}
+
+static void javaScriptCallback(WKSerializedScriptValueRef valueRef, WKErrorRef, void* data)
+{
+ JSCallbackClosure* closure = reinterpret_cast<JSCallbackClosure*>(data);
+
+ if (closure->method.size())
+ QMetaObject::invokeMethod(closure->receiver, closure->method);
+ else {
+ QJSValue function = closure->value;
+
+ // If a callable function is supplied, we build a JavaScript value accessible
+ // in the QML engine, and calls the function with that.
+ if (function.isCallable()) {
+ QJSValue var;
+ if (valueRef) {
+ // FIXME: Slow but OK for now.
+ JSGlobalContextRef context = JSGlobalContextCreate(0);
+
+ JSValueRef exception = 0;
+ JSValueRef value = WKSerializedScriptValueDeserialize(valueRef, context, &exception);
+ var = buildQJSValue(function.engine(), context, value, /* depth */ 0);
+
+ JSGlobalContextRelease(context);
+ }
+
+ QList<QJSValue> args;
+ args.append(var);
+ function.call(args);
+ }
+ }
+
+ delete closure;
+}
+
static QQuickWebViewPrivate* createPrivateObject(QQuickWebView* publicObject)
{
if (s_flickableViewportEnabled)
@@ -162,6 +266,7 @@ QQuickWebViewPrivate::QQuickWebViewPrivate(QQuickWebView* viewport)
, m_navigatorQtObjectEnabled(false)
, m_renderToOffscreenBuffer(false)
, m_dialogActive(false)
+ , m_loadProgress(0)
{
viewport->setClip(true);
viewport->setPixelAligned(true);
@@ -230,20 +335,72 @@ QPointF QQuickWebViewPrivate::pageItemPos()
\qmlsignal WebView::loadingChanged(WebLoadRequest request)
*/
+void QQuickWebViewPrivate::provisionalLoadDidStart(const QUrl& url)
+{
+ Q_Q(QQuickWebView);
+
+ QWebLoadRequest loadRequest(url, QQuickWebView::LoadStartedStatus);
+ emit q->loadingChanged(&loadRequest);
+}
+
+void QQuickWebViewPrivate::loadDidCommit()
+{
+ Q_Q(QQuickWebView);
+ ASSERT(q->loading());
+
+ emit q->navigationHistoryChanged();
+ emit q->urlChanged();
+ emit q->titleChanged();
+}
+
+void QQuickWebViewPrivate::didSameDocumentNavigation()
+{
+ Q_Q(QQuickWebView);
+
+ emit q->navigationHistoryChanged();
+ emit q->urlChanged();
+}
+
+void QQuickWebViewPrivate::titleDidChange()
+{
+ Q_Q(QQuickWebView);
+
+ emit q->titleChanged();
+}
+
+void QQuickWebViewPrivate::loadProgressDidChange(int loadProgress)
+{
+ Q_Q(QQuickWebView);
+
+ if (!loadProgress)
+ setIcon(QUrl());
+
+ m_loadProgress = loadProgress;
+
+ emit q->loadProgressChanged();
+}
+
+void QQuickWebViewPrivate::backForwardListDidChange()
+{
+ navigationHistory->d->reset();
+}
+
void QQuickWebViewPrivate::loadDidSucceed()
{
Q_Q(QQuickWebView);
ASSERT(!q->loading());
+
QWebLoadRequest loadRequest(q->url(), QQuickWebView::LoadSucceededStatus);
emit q->loadingChanged(&loadRequest);
}
-void QQuickWebViewPrivate::onComponentComplete()
+void QQuickWebViewPrivate::loadDidFail(const QtWebError& error)
{
- if (m_deferedUrlToLoad.isEmpty())
- return;
+ Q_Q(QQuickWebView);
+ ASSERT(!q->loading());
- q_ptr->setUrl(m_deferedUrlToLoad);
+ QWebLoadRequest loadRequest(error.url(), QQuickWebView::LoadFailedStatus, error.description(), static_cast<QQuickWebView::ErrorDomain>(error.type()), error.errorCode());
+ emit q->loadingChanged(&loadRequest);
}
void QQuickWebViewPrivate::setNeedsDisplay()
@@ -269,18 +426,22 @@ void QQuickWebViewPrivate::_q_onIconChangedForPageURL(const QUrl& pageURL, const
setIcon(iconURL);
}
-void QQuickWebViewPrivate::didChangeBackForwardList()
-{
- navigationHistory->d->reset();
-}
-
void QQuickWebViewPrivate::processDidCrash()
{
- pageView->eventHandler()->resetGestureRecognizers();
- pageLoadClient->completeLoadWhenProcessDidCrashIfNeeded();
+ Q_Q(QQuickWebView);
QUrl url(KURL(WebCore::ParsedURLString, webPageProxy->urlAtProcessExit()));
qWarning("WARNING: The web process experienced a crash on '%s'.", qPrintable(url.toString(QUrl::RemoveUserInfo)));
+
+ pageView->eventHandler()->resetGestureRecognizers();
+
+ // Check if loading was ongoing, when process crashed.
+ if (m_loadProgress > 0 && m_loadProgress < 100) {
+ QWebLoadRequest loadRequest(url, QQuickWebView::LoadFailedStatus, QLatin1String("The web process crashed."), QQuickWebView::InternalErrorDomain, 0);
+
+ loadProgressDidChange(100);
+ emit q->loadingChanged(&loadRequest);
+ }
}
void QQuickWebViewPrivate::didRelaunchProcess()
@@ -328,7 +489,7 @@ void QQuickWebViewPrivate::_q_onReceivedResponseFromDownload(QWebDownloadItem* d
return;
Q_Q(QQuickWebView);
- QDeclarativeEngine::setObjectOwnership(downloadItem, QDeclarativeEngine::JavaScriptOwnership);
+ QQmlEngine::setObjectOwnership(downloadItem, QQmlEngine::JavaScriptOwnership);
emit q->experimental()->downloadRequested(downloadItem);
}
@@ -626,7 +787,6 @@ void QQuickWebViewLegacyPrivate::setZoomFactor(qreal factor)
QQuickWebViewFlickablePrivate::QQuickWebViewFlickablePrivate(QQuickWebView* viewport)
: QQuickWebViewPrivate(viewport)
, pageIsSuspended(true)
- , loadSuccessDispatchIsPending(false)
{
// Disable mouse events on the flickable web view so we do not
// select text during pan gestures on platforms which send both
@@ -689,44 +849,16 @@ void QQuickWebViewFlickablePrivate::onComponentComplete()
_q_resume();
- if (loadSuccessDispatchIsPending) {
- QQuickWebViewPrivate::loadDidSucceed();
- loadSuccessDispatchIsPending = false;
- }
-
// Trigger setting of correct visibility flags after everything was allocated and initialized.
_q_onVisibleChanged();
-
- QQuickWebViewPrivate::onComponentComplete();
-}
-
-void QQuickWebViewFlickablePrivate::loadDidSucceed()
-{
- if (interactionEngine)
- QQuickWebViewPrivate::loadDidSucceed();
- else
- loadSuccessDispatchIsPending = true;
-}
-
-void QQuickWebViewFlickablePrivate::loadDidCommit()
-{
- // Due to entering provisional load before committing, we
- // might actually be suspended here.
-}
-
-void QQuickWebViewFlickablePrivate::didFinishFirstNonEmptyLayout()
-{
}
void QQuickWebViewFlickablePrivate::didChangeViewportProperties(const WebCore::ViewportAttributes& newAttributes)
{
Q_Q(QQuickWebView);
- QSize viewportSize = q->boundingRect().size().toSize();
-
// FIXME: Revise these when implementing fit-to-width.
WebCore::ViewportAttributes attr = newAttributes;
- WebCore::restrictMinimumScaleFactorToViewportSize(attr, viewportSize);
WebCore::restrictScaleFactorToInitialScaleIfNotUserScalable(attr);
// FIXME: Resetting here can reset more than needed. For instance it will end deferrers.
@@ -814,8 +946,20 @@ void QQuickWebViewFlickablePrivate::pageDidRequestScroll(const QPoint& pos)
void QQuickWebViewFlickablePrivate::didChangeContentsSize(const QSize& newSize)
{
Q_Q(QQuickWebView);
+ QSize viewportSize = q->boundingRect().size().toSize();
+
pageView->setContentsSize(newSize);
q->experimental()->viewportInfo()->didUpdateContentsSize();
+
+ float minimumScale = WebCore::computeMinimumScaleFactorForContentContained(attributes, viewportSize, newSize);
+
+ if (!qFuzzyCompare(minimumScale, attributes.minimumScale)) {
+ interactionEngine->setCSSScaleBounds(minimumScale, attributes.maximumScale);
+ q->experimental()->viewportInfo()->didUpdateViewportConstraints();
+
+ if (!interactionEngine->hadUserInteraction() && !pageIsSuspended)
+ interactionEngine->setCSSScale(minimumScale);
+ }
}
/*!
@@ -955,13 +1099,13 @@ void QQuickWebViewExperimental::postMessage(const QString& message)
d->context->postMessageToNavigatorQtObject(d->webPageProxy.get(), message);
}
-QDeclarativeComponent* QQuickWebViewExperimental::alertDialog() const
+QQmlComponent* QQuickWebViewExperimental::alertDialog() const
{
Q_D(const QQuickWebView);
return d->alertDialog;
}
-void QQuickWebViewExperimental::setAlertDialog(QDeclarativeComponent* alertDialog)
+void QQuickWebViewExperimental::setAlertDialog(QQmlComponent* alertDialog)
{
Q_D(QQuickWebView);
if (d->alertDialog == alertDialog)
@@ -970,13 +1114,13 @@ void QQuickWebViewExperimental::setAlertDialog(QDeclarativeComponent* alertDialo
emit alertDialogChanged();
}
-QDeclarativeComponent* QQuickWebViewExperimental::confirmDialog() const
+QQmlComponent* QQuickWebViewExperimental::confirmDialog() const
{
Q_D(const QQuickWebView);
return d->confirmDialog;
}
-void QQuickWebViewExperimental::setConfirmDialog(QDeclarativeComponent* confirmDialog)
+void QQuickWebViewExperimental::setConfirmDialog(QQmlComponent* confirmDialog)
{
Q_D(QQuickWebView);
if (d->confirmDialog == confirmDialog)
@@ -990,7 +1134,7 @@ QWebNavigationHistory* QQuickWebViewExperimental::navigationHistory() const
return d_ptr->navigationHistory.get();
}
-QDeclarativeComponent* QQuickWebViewExperimental::promptDialog() const
+QQmlComponent* QQuickWebViewExperimental::promptDialog() const
{
Q_D(const QQuickWebView);
return d->promptDialog;
@@ -1004,7 +1148,7 @@ QWebPreferences* QQuickWebViewExperimental::preferences() const
return d->preferences.get();
}
-void QQuickWebViewExperimental::setPromptDialog(QDeclarativeComponent* promptDialog)
+void QQuickWebViewExperimental::setPromptDialog(QQmlComponent* promptDialog)
{
Q_D(QQuickWebView);
if (d->promptDialog == promptDialog)
@@ -1013,13 +1157,13 @@ void QQuickWebViewExperimental::setPromptDialog(QDeclarativeComponent* promptDia
emit promptDialogChanged();
}
-QDeclarativeComponent* QQuickWebViewExperimental::authenticationDialog() const
+QQmlComponent* QQuickWebViewExperimental::authenticationDialog() const
{
Q_D(const QQuickWebView);
return d->authenticationDialog;
}
-void QQuickWebViewExperimental::setAuthenticationDialog(QDeclarativeComponent* authenticationDialog)
+void QQuickWebViewExperimental::setAuthenticationDialog(QQmlComponent* authenticationDialog)
{
Q_D(QQuickWebView);
if (d->authenticationDialog == authenticationDialog)
@@ -1028,13 +1172,13 @@ void QQuickWebViewExperimental::setAuthenticationDialog(QDeclarativeComponent* a
emit authenticationDialogChanged();
}
-QDeclarativeComponent* QQuickWebViewExperimental::proxyAuthenticationDialog() const
+QQmlComponent* QQuickWebViewExperimental::proxyAuthenticationDialog() const
{
Q_D(const QQuickWebView);
return d->proxyAuthenticationDialog;
}
-void QQuickWebViewExperimental::setProxyAuthenticationDialog(QDeclarativeComponent* proxyAuthenticationDialog)
+void QQuickWebViewExperimental::setProxyAuthenticationDialog(QQmlComponent* proxyAuthenticationDialog)
{
Q_D(QQuickWebView);
if (d->proxyAuthenticationDialog == proxyAuthenticationDialog)
@@ -1042,13 +1186,13 @@ void QQuickWebViewExperimental::setProxyAuthenticationDialog(QDeclarativeCompone
d->proxyAuthenticationDialog = proxyAuthenticationDialog;
emit proxyAuthenticationDialogChanged();
}
-QDeclarativeComponent* QQuickWebViewExperimental::certificateVerificationDialog() const
+QQmlComponent* QQuickWebViewExperimental::certificateVerificationDialog() const
{
Q_D(const QQuickWebView);
return d->certificateVerificationDialog;
}
-void QQuickWebViewExperimental::setCertificateVerificationDialog(QDeclarativeComponent* certificateVerificationDialog)
+void QQuickWebViewExperimental::setCertificateVerificationDialog(QQmlComponent* certificateVerificationDialog)
{
Q_D(QQuickWebView);
if (d->certificateVerificationDialog == certificateVerificationDialog)
@@ -1057,13 +1201,13 @@ void QQuickWebViewExperimental::setCertificateVerificationDialog(QDeclarativeCom
emit certificateVerificationDialogChanged();
}
-QDeclarativeComponent* QQuickWebViewExperimental::itemSelector() const
+QQmlComponent* QQuickWebViewExperimental::itemSelector() const
{
Q_D(const QQuickWebView);
return d->itemSelector;
}
-void QQuickWebViewExperimental::setItemSelector(QDeclarativeComponent* itemSelector)
+void QQuickWebViewExperimental::setItemSelector(QQmlComponent* itemSelector)
{
Q_D(QQuickWebView);
if (d->itemSelector == itemSelector)
@@ -1072,13 +1216,13 @@ void QQuickWebViewExperimental::setItemSelector(QDeclarativeComponent* itemSelec
emit itemSelectorChanged();
}
-QDeclarativeComponent* QQuickWebViewExperimental::filePicker() const
+QQmlComponent* QQuickWebViewExperimental::filePicker() const
{
Q_D(const QQuickWebView);
return d->filePicker;
}
-void QQuickWebViewExperimental::setFilePicker(QDeclarativeComponent* filePicker)
+void QQuickWebViewExperimental::setFilePicker(QQmlComponent* filePicker)
{
Q_D(QQuickWebView);
if (d->filePicker == filePicker)
@@ -1087,13 +1231,13 @@ void QQuickWebViewExperimental::setFilePicker(QDeclarativeComponent* filePicker)
emit filePickerChanged();
}
-QDeclarativeComponent* QQuickWebViewExperimental::databaseQuotaDialog() const
+QQmlComponent* QQuickWebViewExperimental::databaseQuotaDialog() const
{
Q_D(const QQuickWebView);
return d->databaseQuotaDialog;
}
-void QQuickWebViewExperimental::setDatabaseQuotaDialog(QDeclarativeComponent* databaseQuotaDialog)
+void QQuickWebViewExperimental::setDatabaseQuotaDialog(QQmlComponent* databaseQuotaDialog)
{
Q_D(QQuickWebView);
if (d->databaseQuotaDialog == databaseQuotaDialog)
@@ -1171,7 +1315,25 @@ void QQuickWebViewExperimental::setDevicePixelRatio(double devicePixelRatio)
emit devicePixelRatioChanged();
}
-QQuickUrlSchemeDelegate* QQuickWebViewExperimental::schemeDelegates_At(QDeclarativeListProperty<QQuickUrlSchemeDelegate>* property, int index)
+/*!
+ \internal
+
+ \qmlmethod void WebViewExperimental::evaluateJavaScript(string script [, function(result)])
+
+ \brief Evaluates the specified JavaScript and, if supplied, calls a function with the result.
+*/
+
+void QQuickWebViewExperimental::evaluateJavaScript(const QString& script, const QJSValue& value)
+{
+ JSCallbackClosure* closure = new JSCallbackClosure;
+
+ closure->receiver = this;
+ closure->value = value;
+
+ d_ptr->webPageProxy.get()->runJavaScriptInMainFrame(script, ScriptValueCallback::create(closure, javaScriptCallback));
+}
+
+QQuickUrlSchemeDelegate* QQuickWebViewExperimental::schemeDelegates_At(QQmlListProperty<QQuickUrlSchemeDelegate>* property, int index)
{
const QObjectList children = property->object->children();
if (index < children.count())
@@ -1179,7 +1341,7 @@ QQuickUrlSchemeDelegate* QQuickWebViewExperimental::schemeDelegates_At(QDeclarat
return 0;
}
-void QQuickWebViewExperimental::schemeDelegates_Append(QDeclarativeListProperty<QQuickUrlSchemeDelegate>* property, QQuickUrlSchemeDelegate *scheme)
+void QQuickWebViewExperimental::schemeDelegates_Append(QQmlListProperty<QQuickUrlSchemeDelegate>* property, QQuickUrlSchemeDelegate *scheme)
{
QObject* schemeParent = property->object;
scheme->setParent(schemeParent);
@@ -1191,12 +1353,12 @@ void QQuickWebViewExperimental::schemeDelegates_Append(QDeclarativeListProperty<
d->webPageProxy->registerApplicationScheme(scheme->scheme());
}
-int QQuickWebViewExperimental::schemeDelegates_Count(QDeclarativeListProperty<QQuickUrlSchemeDelegate>* property)
+int QQuickWebViewExperimental::schemeDelegates_Count(QQmlListProperty<QQuickUrlSchemeDelegate>* property)
{
return property->object->children().count();
}
-void QQuickWebViewExperimental::schemeDelegates_Clear(QDeclarativeListProperty<QQuickUrlSchemeDelegate>* property)
+void QQuickWebViewExperimental::schemeDelegates_Clear(QQmlListProperty<QQuickUrlSchemeDelegate>* property)
{
const QObjectList children = property->object->children();
for (int index = 0; index < children.count(); index++) {
@@ -1206,9 +1368,9 @@ void QQuickWebViewExperimental::schemeDelegates_Clear(QDeclarativeListProperty<Q
}
}
-QDeclarativeListProperty<QQuickUrlSchemeDelegate> QQuickWebViewExperimental::schemeDelegates()
+QQmlListProperty<QQuickUrlSchemeDelegate> QQuickWebViewExperimental::schemeDelegates()
{
- return QDeclarativeListProperty<QQuickUrlSchemeDelegate>(schemeParent, 0,
+ return QQmlListProperty<QQuickUrlSchemeDelegate>(schemeParent, 0,
QQuickWebViewExperimental::schemeDelegates_Append,
QQuickWebViewExperimental::schemeDelegates_Count,
QQuickWebViewExperimental::schemeDelegates_At,
@@ -1336,11 +1498,6 @@ void QQuickWebView::setUrl(const QUrl& url)
if (url.isEmpty())
return;
- if (!isComponentComplete()) {
- d->m_deferedUrlToLoad = url;
- return;
- }
-
d->webPageProxy->loadURL(url.toString());
}
@@ -1360,7 +1517,7 @@ QUrl QQuickWebView::icon() const
int QQuickWebView::loadProgress() const
{
Q_D(const QQuickWebView);
- return d->pageLoadClient->loadProgress();
+ return d->loadProgress();
}
bool QQuickWebView::canGoBack() const
@@ -1725,24 +1882,14 @@ void QQuickWebView::setZoomFactor(qreal factor)
d->setZoomFactor(factor);
}
-struct JSCallbackClosure {
- QPointer<QObject> receiver;
- QByteArray method;
-};
-
-static void javaScriptCallback(WKSerializedScriptValueRef, WKErrorRef, void* context)
-{
- JSCallbackClosure* closure = reinterpret_cast<JSCallbackClosure*>(context);
- QMetaObject::invokeMethod(closure->receiver, closure->method);
- delete closure;
-}
-
void QQuickWebView::runJavaScriptInMainFrame(const QString &script, QObject *receiver, const char *method)
{
Q_D(QQuickWebView);
+
JSCallbackClosure* closure = new JSCallbackClosure;
closure->receiver = receiver;
closure->method = method;
+
d->webPageProxy.get()->runJavaScriptInMainFrame(script, ScriptValueCallback::create(closure, javaScriptCallback));
}
diff --git a/Source/WebKit2/UIProcess/API/qt/qquickwebview_p.h b/Source/WebKit2/UIProcess/API/qt/qquickwebview_p.h
index 916f2282d..4bdd0fbbd 100644
--- a/Source/WebKit2/UIProcess/API/qt/qquickwebview_p.h
+++ b/Source/WebKit2/UIProcess/API/qt/qquickwebview_p.h
@@ -28,7 +28,7 @@
#include <private/qquickflickable_p.h>
class QWebNavigationRequest;
-class QDeclarativeComponent;
+class QQmlComponent;
class QQuickWebPage;
class QQuickWebViewAttached;
class QWebLoadRequest;
@@ -65,11 +65,12 @@ QT_BEGIN_NAMESPACE
class QPainter;
class QUrl;
class QQuickFlickable;
+class QJSValue;
QT_END_NAMESPACE
// Instantiating the WebView in C++ is only possible by creating
-// a QDeclarativeComponent as the initialization depends on the
+// a QQmlComponent as the initialization depends on the
// componentComplete method being called.
class QWEBKIT_EXPORT QQuickWebView : public QQuickFlickable {
Q_OBJECT
@@ -252,18 +253,18 @@ class QWEBKIT_EXPORT QQuickWebViewExperimental : public QObject {
Q_PROPERTY(int preferredMinimumContentsWidth WRITE setPreferredMinimumContentsWidth READ preferredMinimumContentsWidth)
Q_PROPERTY(QWebNavigationHistory* navigationHistory READ navigationHistory CONSTANT FINAL)
- Q_PROPERTY(QDeclarativeComponent* alertDialog READ alertDialog WRITE setAlertDialog NOTIFY alertDialogChanged)
- Q_PROPERTY(QDeclarativeComponent* confirmDialog READ confirmDialog WRITE setConfirmDialog NOTIFY confirmDialogChanged)
- Q_PROPERTY(QDeclarativeComponent* promptDialog READ promptDialog WRITE setPromptDialog NOTIFY promptDialogChanged)
- Q_PROPERTY(QDeclarativeComponent* authenticationDialog READ authenticationDialog WRITE setAuthenticationDialog NOTIFY authenticationDialogChanged)
- Q_PROPERTY(QDeclarativeComponent* proxyAuthenticationDialog READ proxyAuthenticationDialog WRITE setProxyAuthenticationDialog NOTIFY proxyAuthenticationDialogChanged)
- Q_PROPERTY(QDeclarativeComponent* certificateVerificationDialog READ certificateVerificationDialog WRITE setCertificateVerificationDialog NOTIFY certificateVerificationDialogChanged)
- Q_PROPERTY(QDeclarativeComponent* itemSelector READ itemSelector WRITE setItemSelector NOTIFY itemSelectorChanged)
- Q_PROPERTY(QDeclarativeComponent* filePicker READ filePicker WRITE setFilePicker NOTIFY filePickerChanged)
- Q_PROPERTY(QDeclarativeComponent* databaseQuotaDialog READ databaseQuotaDialog WRITE setDatabaseQuotaDialog NOTIFY databaseQuotaDialogChanged)
+ Q_PROPERTY(QQmlComponent* alertDialog READ alertDialog WRITE setAlertDialog NOTIFY alertDialogChanged)
+ Q_PROPERTY(QQmlComponent* confirmDialog READ confirmDialog WRITE setConfirmDialog NOTIFY confirmDialogChanged)
+ Q_PROPERTY(QQmlComponent* promptDialog READ promptDialog WRITE setPromptDialog NOTIFY promptDialogChanged)
+ Q_PROPERTY(QQmlComponent* authenticationDialog READ authenticationDialog WRITE setAuthenticationDialog NOTIFY authenticationDialogChanged)
+ Q_PROPERTY(QQmlComponent* proxyAuthenticationDialog READ proxyAuthenticationDialog WRITE setProxyAuthenticationDialog NOTIFY proxyAuthenticationDialogChanged)
+ Q_PROPERTY(QQmlComponent* certificateVerificationDialog READ certificateVerificationDialog WRITE setCertificateVerificationDialog NOTIFY certificateVerificationDialogChanged)
+ Q_PROPERTY(QQmlComponent* itemSelector READ itemSelector WRITE setItemSelector NOTIFY itemSelectorChanged)
+ Q_PROPERTY(QQmlComponent* filePicker READ filePicker WRITE setFilePicker NOTIFY filePickerChanged)
+ Q_PROPERTY(QQmlComponent* databaseQuotaDialog READ databaseQuotaDialog WRITE setDatabaseQuotaDialog NOTIFY databaseQuotaDialogChanged)
Q_PROPERTY(QWebPreferences* preferences READ preferences CONSTANT FINAL)
Q_PROPERTY(QWebViewportInfo* viewportInfo READ viewportInfo CONSTANT FINAL)
- Q_PROPERTY(QDeclarativeListProperty<QQuickUrlSchemeDelegate> urlSchemeDelegates READ schemeDelegates)
+ Q_PROPERTY(QQmlListProperty<QQuickUrlSchemeDelegate> urlSchemeDelegates READ schemeDelegates)
Q_PROPERTY(QString userAgent READ userAgent WRITE setUserAgent NOTIFY userAgentChanged)
Q_PROPERTY(double devicePixelRatio READ devicePixelRatio WRITE setDevicePixelRatio NOTIFY devicePixelRatioChanged)
Q_ENUMS(NavigationRequestActionExperimental)
@@ -276,24 +277,24 @@ public:
QQuickWebViewExperimental(QQuickWebView* webView);
virtual ~QQuickWebViewExperimental();
- QDeclarativeComponent* alertDialog() const;
- void setAlertDialog(QDeclarativeComponent*);
- QDeclarativeComponent* confirmDialog() const;
- void setConfirmDialog(QDeclarativeComponent*);
- QDeclarativeComponent* promptDialog() const;
- void setPromptDialog(QDeclarativeComponent*);
- QDeclarativeComponent* authenticationDialog() const;
- void setAuthenticationDialog(QDeclarativeComponent*);
- QDeclarativeComponent* certificateVerificationDialog() const;
- void setCertificateVerificationDialog(QDeclarativeComponent*);
- QDeclarativeComponent* itemSelector() const;
- void setItemSelector(QDeclarativeComponent*);
- QDeclarativeComponent* proxyAuthenticationDialog() const;
- void setProxyAuthenticationDialog(QDeclarativeComponent*);
- QDeclarativeComponent* filePicker() const;
- void setFilePicker(QDeclarativeComponent*);
- QDeclarativeComponent* databaseQuotaDialog() const;
- void setDatabaseQuotaDialog(QDeclarativeComponent*);
+ QQmlComponent* alertDialog() const;
+ void setAlertDialog(QQmlComponent*);
+ QQmlComponent* confirmDialog() const;
+ void setConfirmDialog(QQmlComponent*);
+ QQmlComponent* promptDialog() const;
+ void setPromptDialog(QQmlComponent*);
+ QQmlComponent* authenticationDialog() const;
+ void setAuthenticationDialog(QQmlComponent*);
+ QQmlComponent* certificateVerificationDialog() const;
+ void setCertificateVerificationDialog(QQmlComponent*);
+ QQmlComponent* itemSelector() const;
+ void setItemSelector(QQmlComponent*);
+ QQmlComponent* proxyAuthenticationDialog() const;
+ void setProxyAuthenticationDialog(QQmlComponent*);
+ QQmlComponent* filePicker() const;
+ void setFilePicker(QQmlComponent*);
+ QQmlComponent* databaseQuotaDialog() const;
+ void setDatabaseQuotaDialog(QQmlComponent*);
QString userAgent() const;
void setUserAgent(const QString& userAgent);
double devicePixelRatio() const;
@@ -305,11 +306,11 @@ public:
QWebNavigationHistory* navigationHistory() const;
QQuickWebPage* page();
- static QQuickUrlSchemeDelegate* schemeDelegates_At(QDeclarativeListProperty<QQuickUrlSchemeDelegate>*, int index);
- static void schemeDelegates_Append(QDeclarativeListProperty<QQuickUrlSchemeDelegate>*, QQuickUrlSchemeDelegate*);
- static int schemeDelegates_Count(QDeclarativeListProperty<QQuickUrlSchemeDelegate>*);
- static void schemeDelegates_Clear(QDeclarativeListProperty<QQuickUrlSchemeDelegate>*);
- QDeclarativeListProperty<QQuickUrlSchemeDelegate> schemeDelegates();
+ static QQuickUrlSchemeDelegate* schemeDelegates_At(QQmlListProperty<QQuickUrlSchemeDelegate>*, int index);
+ static void schemeDelegates_Append(QQmlListProperty<QQuickUrlSchemeDelegate>*, QQuickUrlSchemeDelegate*);
+ static int schemeDelegates_Count(QQmlListProperty<QQuickUrlSchemeDelegate>*);
+ static void schemeDelegates_Clear(QQmlListProperty<QQuickUrlSchemeDelegate>*);
+ QQmlListProperty<QQuickUrlSchemeDelegate> schemeDelegates();
void invokeApplicationSchemeHandler(WTF::PassRefPtr<WebKit::QtRefCountedNetworkRequestData>);
void sendApplicationSchemeReply(QQuickNetworkReply*);
@@ -332,6 +333,7 @@ public Q_SLOTS:
void goBackTo(int index);
void goForwardTo(int index);
void postMessage(const QString&);
+ void evaluateJavaScript(const QString& script, const QJSValue& value = QJSValue());
Q_SIGNALS:
void alertDialogChanged();
diff --git a/Source/WebKit2/UIProcess/API/qt/qquickwebview_p_p.h b/Source/WebKit2/UIProcess/API/qt/qquickwebview_p_p.h
index 417618d0a..de62d39bb 100644
--- a/Source/WebKit2/UIProcess/API/qt/qquickwebview_p_p.h
+++ b/Source/WebKit2/UIProcess/API/qt/qquickwebview_p_p.h
@@ -41,6 +41,7 @@ class DrawingAreaProxy;
class QtDialogRunner;
class QtViewportInteractionEngine;
class QtWebContext;
+class QtWebError;
class QtWebPageLoadClient;
class QtWebPagePolicyClient;
class WebPageProxy;
@@ -50,7 +51,7 @@ class QWebNavigationHistory;
class QWebViewportInfo;
QT_BEGIN_NAMESPACE
-class QDeclarativeComponent;
+class QQmlComponent;
QT_END_NAMESPACE
class QQuickWebViewPrivate {
@@ -67,19 +68,26 @@ public:
virtual void initialize(WKContextRef contextRef = 0, WKPageGroupRef pageGroupRef = 0);
+ virtual void onComponentComplete() { }
+
virtual void enableMouseEvents() { }
virtual void disableMouseEvents() { }
virtual QPointF pageItemPos();
virtual void updateContentsSize(const QSizeF&) { }
+ virtual void provisionalLoadDidStart(const QUrl& url);
+ virtual void loadDidCommit();
+ virtual void didSameDocumentNavigation();
+ virtual void titleDidChange();
+ virtual void loadProgressDidChange(int loadProgress);
+ virtual void backForwardListDidChange();
virtual void loadDidSucceed();
- virtual void onComponentComplete();
- virtual void loadDidCommit() { }
- virtual void didFinishFirstNonEmptyLayout() { }
+ virtual void loadDidFail(const WebKit::QtWebError& error);
+
virtual void didChangeViewportProperties(const WebCore::ViewportAttributes& attr) { }
- void didChangeBackForwardList();
+ int loadProgress() const { return m_loadProgress; }
void setNeedsDisplay();
virtual WebKit::QtViewportInteractionEngine* viewportInteractionEngine() { return 0; }
@@ -175,15 +183,15 @@ protected:
FlickableAxisLocker axisLocker;
- QDeclarativeComponent* alertDialog;
- QDeclarativeComponent* confirmDialog;
- QDeclarativeComponent* promptDialog;
- QDeclarativeComponent* authenticationDialog;
- QDeclarativeComponent* certificateVerificationDialog;
- QDeclarativeComponent* itemSelector;
- QDeclarativeComponent* proxyAuthenticationDialog;
- QDeclarativeComponent* filePicker;
- QDeclarativeComponent* databaseQuotaDialog;
+ QQmlComponent* alertDialog;
+ QQmlComponent* confirmDialog;
+ QQmlComponent* promptDialog;
+ QQmlComponent* authenticationDialog;
+ QQmlComponent* certificateVerificationDialog;
+ QQmlComponent* itemSelector;
+ QQmlComponent* proxyAuthenticationDialog;
+ QQmlComponent* filePicker;
+ QQmlComponent* databaseQuotaDialog;
WebCore::ViewportAttributes attributes;
@@ -192,7 +200,7 @@ protected:
bool m_renderToOffscreenBuffer;
bool m_dialogActive;
QUrl m_iconURL;
- QUrl m_deferedUrlToLoad;
+ int m_loadProgress;
};
class QQuickWebViewLegacyPrivate : public QQuickWebViewPrivate {
@@ -216,13 +224,11 @@ public:
virtual ~QQuickWebViewFlickablePrivate();
virtual void initialize(WKContextRef contextRef = 0, WKPageGroupRef pageGroupRef = 0);
+ virtual void onComponentComplete();
+
virtual QPointF pageItemPos();
virtual void updateContentsSize(const QSizeF&);
- virtual void loadDidSucceed();
- virtual void onComponentComplete();
- virtual void loadDidCommit();
- virtual void didFinishFirstNonEmptyLayout();
virtual void didChangeViewportProperties(const WebCore::ViewportAttributes&);
virtual WebKit::QtViewportInteractionEngine* viewportInteractionEngine() { return interactionEngine.data(); }
virtual void updateViewportSize();
@@ -237,7 +243,6 @@ public:
private:
QScopedPointer<WebKit::QtViewportInteractionEngine> interactionEngine;
bool pageIsSuspended;
- bool loadSuccessDispatchIsPending;
};
#endif // qquickwebview_p_p_h
diff --git a/Source/WebKit2/UIProcess/API/qt/qwebiconimageprovider.cpp b/Source/WebKit2/UIProcess/API/qt/qwebiconimageprovider.cpp
index dce6ee9df..71342a1e3 100644
--- a/Source/WebKit2/UIProcess/API/qt/qwebiconimageprovider.cpp
+++ b/Source/WebKit2/UIProcess/API/qt/qwebiconimageprovider.cpp
@@ -29,7 +29,7 @@
using namespace WebKit;
QWebIconImageProvider::QWebIconImageProvider()
- : QDeclarativeImageProvider(QDeclarativeImageProvider::Image)
+ : QQuickImageProvider(QQuickImageProvider::Image)
{
}
diff --git a/Source/WebKit2/UIProcess/API/qt/qwebiconimageprovider_p.h b/Source/WebKit2/UIProcess/API/qt/qwebiconimageprovider_p.h
index 74f55995f..a54008a2c 100644
--- a/Source/WebKit2/UIProcess/API/qt/qwebiconimageprovider_p.h
+++ b/Source/WebKit2/UIProcess/API/qt/qwebiconimageprovider_p.h
@@ -23,7 +23,7 @@
#include "qwebkitglobal.h"
#include <QtQuick/QQuickImageProvider>
-class QWEBKIT_EXPORT QWebIconImageProvider : public QDeclarativeImageProvider {
+class QWEBKIT_EXPORT QWebIconImageProvider : public QQuickImageProvider {
public:
QWebIconImageProvider();
~QWebIconImageProvider();
diff --git a/Source/WebKit2/UIProcess/API/qt/qwebviewportinfo.cpp b/Source/WebKit2/UIProcess/API/qt/qwebviewportinfo.cpp
index 170604d1d..ea16732f5 100644
--- a/Source/WebKit2/UIProcess/API/qt/qwebviewportinfo.cpp
+++ b/Source/WebKit2/UIProcess/API/qt/qwebviewportinfo.cpp
@@ -62,11 +62,17 @@ QVariant QWebViewportInfo::initialScale() const
QVariant QWebViewportInfo::minimumScale() const
{
+ if (QtViewportInteractionEngine* interactionEngine = m_webViewPrivate->viewportInteractionEngine())
+ return interactionEngine->m_minimumScale;
+
return m_webViewPrivate->attributes.minimumScale;
}
QVariant QWebViewportInfo::maximumScale() const
{
+ if (QtViewportInteractionEngine* interactionEngine = m_webViewPrivate->viewportInteractionEngine())
+ return interactionEngine->m_maximumScale;
+
return m_webViewPrivate->attributes.maximumScale;
}
diff --git a/Source/WebKit2/UIProcess/API/qt/qwebviewportinfo_p.h b/Source/WebKit2/UIProcess/API/qt/qwebviewportinfo_p.h
index ab422e4e7..d3060bbe6 100644
--- a/Source/WebKit2/UIProcess/API/qt/qwebviewportinfo_p.h
+++ b/Source/WebKit2/UIProcess/API/qt/qwebviewportinfo_p.h
@@ -27,7 +27,7 @@
#include <QtCore/QPointer>
#include <QtCore/QSize>
#include <QtCore/QVariant>
-#include <QtDeclarative/QtDeclarative>
+#include <QtQml/QtQml>
class QQuickWebViewPrivate;
diff --git a/Source/WebKit2/UIProcess/API/qt/tests/qmltests/WebView/tst_evaluateJavaScript.qml b/Source/WebKit2/UIProcess/API/qt/tests/qmltests/WebView/tst_evaluateJavaScript.qml
new file mode 100644
index 000000000..a3083144d
--- /dev/null
+++ b/Source/WebKit2/UIProcess/API/qt/tests/qmltests/WebView/tst_evaluateJavaScript.qml
@@ -0,0 +1,87 @@
+import QtQuick 2.0
+import QtTest 1.0
+import QtWebKit 3.0
+import QtWebKit.experimental 1.0
+import "../common"
+
+Item {
+ TestWebView {
+ id: webView
+ property variant lastMessage
+ property variant lastResult
+
+ signal resultReceived
+
+ experimental.preferences.navigatorQtObjectEnabled: true
+ experimental.onMessageReceived: {
+ lastMessage = message
+ }
+ }
+
+ SignalSpy {
+ id: messageSpy
+ target: webView.experimental
+ signalName: "messageReceived"
+ }
+
+ SignalSpy {
+ id: resultSpy
+ target: webView
+ signalName: "resultReceived"
+ }
+
+ TestCase {
+ name: "JavaScriptEvaluation"
+
+ function init() {
+ messageSpy.clear()
+ webView.lastMessage = null
+
+ resultSpy.clear()
+ webView.lastResult = null
+ }
+
+ function test_basic() {
+ messageSpy.clear()
+ webView.url = "about:blank"
+ verify(webView.waitForLoadSucceeded())
+
+ webView.experimental.evaluateJavaScript(
+ "navigator.qt.onmessage = function(message) {" +
+ " var result = message.data.split('');" +
+ " result = result.reverse().join('');" +
+ " navigator.qt.postMessage(result);" +
+ "}");
+
+ webView.experimental.postMessage("DLROW OLLEH");
+ messageSpy.wait()
+ compare(webView.lastMessage.data, "HELLO WORLD")
+ }
+
+ function test_propertyObjectWithChild() {
+ messageSpy.clear()
+ webView.url = "about:blank"
+ verify(webView.waitForLoadSucceeded())
+
+ webView.experimental.evaluateJavaScript(
+ "(function() {" +
+ " var parent = new Object;" +
+ " var child = new Object;" +
+ " parent['level'] = '1';" +
+ " child['level'] = 2;" +
+ " parent['child'] = child;" +
+ " return parent;" +
+ "})()",
+
+ function(result) {
+ webView.lastResult = result
+ webView.resultReceived()
+ });
+
+ resultSpy.wait()
+
+ compare(JSON.stringify(webView.lastResult),
+ '{"child":{"level":2},"level":"1"}')
+ }
+ }
+}
diff --git a/Source/WebKit2/UIProcess/API/qt/tests/tests.pri b/Source/WebKit2/UIProcess/API/qt/tests/tests.pri
index ded493f88..358a2328c 100644
--- a/Source/WebKit2/UIProcess/API/qt/tests/tests.pri
+++ b/Source/WebKit2/UIProcess/API/qt/tests/tests.pri
@@ -10,7 +10,7 @@ SOURCES += ../util.cpp \
../bytearraytestdata.cpp
INCLUDEPATH += $$PWD
-QT += testlib declarative quick quick-private webkit
+QT += testlib qml quick quick-private webkit
DEFINES += TESTS_SOURCE_DIR=\\\"$$PWD\\\" \
QWP_PATH=\\\"$${ROOT_BUILD_DIR}/bin\\\"
diff --git a/Source/WebKit2/UIProcess/DrawingAreaProxyImpl.cpp b/Source/WebKit2/UIProcess/DrawingAreaProxyImpl.cpp
index 6519441b0..0fd295dcc 100644
--- a/Source/WebKit2/UIProcess/DrawingAreaProxyImpl.cpp
+++ b/Source/WebKit2/UIProcess/DrawingAreaProxyImpl.cpp
@@ -245,6 +245,17 @@ void DrawingAreaProxyImpl::exitAcceleratedCompositingMode(uint64_t backingStoreS
incorporateUpdate(updateInfo);
}
+void DrawingAreaProxyImpl::updateAcceleratedCompositingMode(uint64_t backingStoreStateID, const LayerTreeContext& layerTreeContext)
+{
+ ASSERT_ARG(backingStoreStateID, backingStoreStateID <= m_currentBackingStoreStateID);
+ if (backingStoreStateID < m_currentBackingStoreStateID)
+ return;
+
+#if USE(ACCELERATED_COMPOSITING)
+ updateAcceleratedCompositingMode(layerTreeContext);
+#endif
+}
+
void DrawingAreaProxyImpl::incorporateUpdate(const UpdateInfo& updateInfo)
{
ASSERT(!isInAcceleratedCompositingMode());
@@ -368,6 +379,14 @@ void DrawingAreaProxyImpl::exitAcceleratedCompositingMode()
m_layerTreeContext = LayerTreeContext();
m_webPageProxy->exitAcceleratedCompositingMode();
}
+
+void DrawingAreaProxyImpl::updateAcceleratedCompositingMode(const LayerTreeContext& layerTreeContext)
+{
+ ASSERT(isInAcceleratedCompositingMode());
+
+ m_layerTreeContext = layerTreeContext;
+ m_webPageProxy->updateAcceleratedCompositingMode(layerTreeContext);
+}
#endif
void DrawingAreaProxyImpl::pageCustomRepresentationChanged()
diff --git a/Source/WebKit2/UIProcess/DrawingAreaProxyImpl.h b/Source/WebKit2/UIProcess/DrawingAreaProxyImpl.h
index c67cd93da..346f3546d 100644
--- a/Source/WebKit2/UIProcess/DrawingAreaProxyImpl.h
+++ b/Source/WebKit2/UIProcess/DrawingAreaProxyImpl.h
@@ -65,6 +65,7 @@ private:
virtual void didUpdateBackingStoreState(uint64_t backingStoreStateID, const UpdateInfo&, const LayerTreeContext&);
virtual void enterAcceleratedCompositingMode(uint64_t backingStoreStateID, const LayerTreeContext&);
virtual void exitAcceleratedCompositingMode(uint64_t backingStoreStateID, const UpdateInfo&);
+ virtual void updateAcceleratedCompositingMode(uint64_t backingStoreStateID, const LayerTreeContext&);
void incorporateUpdate(const UpdateInfo&);
@@ -76,6 +77,7 @@ private:
#if USE(ACCELERATED_COMPOSITING)
void enterAcceleratedCompositingMode(const LayerTreeContext&);
void exitAcceleratedCompositingMode();
+ void updateAcceleratedCompositingMode(const LayerTreeContext&);
bool isInAcceleratedCompositingMode() const { return !m_layerTreeContext.isEmpty(); }
diff --git a/Source/WebKit2/UIProcess/Plugins/PluginInfoStore.cpp b/Source/WebKit2/UIProcess/Plugins/PluginInfoStore.cpp
index cef14dcf0..97775c626 100644
--- a/Source/WebKit2/UIProcess/Plugins/PluginInfoStore.cpp
+++ b/Source/WebKit2/UIProcess/Plugins/PluginInfoStore.cpp
@@ -174,6 +174,11 @@ static inline String pathExtension(const KURL& url)
}
#if !PLATFORM(MAC)
+bool PluginInfoStore::shouldBlockPlugin(const PluginModuleInfo&) const
+{
+ return false;
+}
+
String PluginInfoStore::getMIMETypeForExtension(const String& extension)
{
return MIMETypeRegistry::getMIMETypeForExtension(extension);
diff --git a/Source/WebKit2/UIProcess/Plugins/PluginInfoStore.h b/Source/WebKit2/UIProcess/Plugins/PluginInfoStore.h
index 4bfecb424..f30303c83 100644
--- a/Source/WebKit2/UIProcess/Plugins/PluginInfoStore.h
+++ b/Source/WebKit2/UIProcess/Plugins/PluginInfoStore.h
@@ -53,8 +53,11 @@ public:
// Returns the info for the plug-in with the given path.
PluginModuleInfo infoForPluginWithPath(const String& pluginPath) const;
-private:
+ // Return whether this plug-in should be blocked from being instantiated.
+ // Note that the plug-in will still be seen by e.g. navigator.plugins
+ bool shouldBlockPlugin(const PluginModuleInfo&) const;
+private:
PluginModuleInfo findPluginForMIMEType(const String& mimeType) const;
PluginModuleInfo findPluginForExtension(const String& extension, String& mimeType) const;
diff --git a/Source/WebKit2/UIProcess/Plugins/mac/PluginInfoStoreMac.mm b/Source/WebKit2/UIProcess/Plugins/mac/PluginInfoStoreMac.mm
index 6c6040781..7a04b5355 100644
--- a/Source/WebKit2/UIProcess/Plugins/mac/PluginInfoStoreMac.mm
+++ b/Source/WebKit2/UIProcess/Plugins/mac/PluginInfoStoreMac.mm
@@ -89,6 +89,11 @@ bool PluginInfoStore::shouldUsePlugin(Vector<PluginModuleInfo>& alreadyLoadedPlu
return true;
}
+bool PluginInfoStore::shouldBlockPlugin(const PluginModuleInfo& plugin) const
+{
+ return WKShouldBlockPlugin(plugin.bundleIdentifier, plugin.versionString);
+}
+
String PluginInfoStore::getMIMETypeForExtension(const String& extension)
{
// FIXME: This should just call MIMETypeRegistry::getMIMETypeForExtension and be
diff --git a/Source/WebKit2/UIProcess/WebContext.cpp b/Source/WebKit2/UIProcess/WebContext.cpp
index f1a0f0fb7..b6258ece1 100644
--- a/Source/WebKit2/UIProcess/WebContext.cpp
+++ b/Source/WebKit2/UIProcess/WebContext.cpp
@@ -620,7 +620,7 @@ void WebContext::getPlugins(bool refresh, Vector<PluginInfo>& pluginInfos)
#endif
}
-void WebContext::getPluginPath(const String& mimeType, const String& urlString, String& pluginPath)
+void WebContext::getPluginPath(const String& mimeType, const String& urlString, String& pluginPath, bool& blocked)
{
MESSAGE_CHECK_URL(urlString);
@@ -630,6 +630,12 @@ void WebContext::getPluginPath(const String& mimeType, const String& urlString,
if (!plugin.path)
return;
+ blocked = false;
+ if (pluginInfoStore().shouldBlockPlugin(plugin)) {
+ blocked = true;
+ return;
+ }
+
pluginPath = plugin.path;
}
diff --git a/Source/WebKit2/UIProcess/WebContext.h b/Source/WebKit2/UIProcess/WebContext.h
index ddf3d7932..f94dc4a28 100644
--- a/Source/WebKit2/UIProcess/WebContext.h
+++ b/Source/WebKit2/UIProcess/WebContext.h
@@ -217,7 +217,7 @@ private:
// Plugins
void getPlugins(bool refresh, Vector<WebCore::PluginInfo>&);
- void getPluginPath(const String& mimeType, const String& urlString, String& pluginPath);
+ 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);
diff --git a/Source/WebKit2/UIProcess/WebContext.messages.in b/Source/WebKit2/UIProcess/WebContext.messages.in
index 85ea7a2b7..a1397f055 100644
--- a/Source/WebKit2/UIProcess/WebContext.messages.in
+++ b/Source/WebKit2/UIProcess/WebContext.messages.in
@@ -33,7 +33,7 @@ messages -> WebContext {
# Plugin messages.
GetPlugins(bool refresh) -> (Vector<WebCore::PluginInfo> plugins)
- GetPluginPath(WTF::String mimeType, WTF::String urlString) -> (WTF::String pluginPath)
+ 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)
diff --git a/Source/WebKit2/UIProcess/WebLoaderClient.cpp b/Source/WebKit2/UIProcess/WebLoaderClient.cpp
index ca9d7f6f1..5a7f71766 100644
--- a/Source/WebKit2/UIProcess/WebLoaderClient.cpp
+++ b/Source/WebKit2/UIProcess/WebLoaderClient.cpp
@@ -266,10 +266,21 @@ void WebLoaderClient::willGoToBackForwardListItem(WebPageProxy* page, WebBackFor
void WebLoaderClient::didFailToInitializePlugin(WebPageProxy* page, const String& mimeType)
{
- if (!m_client.didFailToInitializePlugin)
+ if (m_client.didFailToInitializePlugin_deprecatedForUseWithV0)
+ m_client.didFailToInitializePlugin_deprecatedForUseWithV0(toAPI(page), toAPI(mimeType.impl()), m_client.clientInfo);
+
+ if (!m_client.pluginDidFail)
+ return;
+
+ m_client.pluginDidFail(toAPI(page), kWKErrorCodeCannotLoadPlugIn, toAPI(mimeType.impl()), m_client.clientInfo);
+}
+
+void WebLoaderClient::didBlockInsecurePluginVersion(WebPageProxy* page, const String& mimeType)
+{
+ if (!m_client.pluginDidFail)
return;
- m_client.didFailToInitializePlugin(toAPI(page), toAPI(mimeType.impl()), m_client.clientInfo);
+ m_client.pluginDidFail(toAPI(page), kWKErrorCodeInsecurePlugInVersion, toAPI(mimeType.impl()), m_client.clientInfo);
}
} // namespace WebKit
diff --git a/Source/WebKit2/UIProcess/WebLoaderClient.h b/Source/WebKit2/UIProcess/WebLoaderClient.h
index 3981e2f0d..a78788d76 100644
--- a/Source/WebKit2/UIProcess/WebLoaderClient.h
+++ b/Source/WebKit2/UIProcess/WebLoaderClient.h
@@ -87,6 +87,7 @@ public:
void willGoToBackForwardListItem(WebPageProxy*, WebBackForwardListItem*, APIObject*);
void didFailToInitializePlugin(WebPageProxy*, const String& mimeType);
+ void didBlockInsecurePluginVersion(WebPageProxy*, const String& mimeType);
};
} // namespace WebKit
diff --git a/Source/WebKit2/UIProcess/WebPageProxy.cpp b/Source/WebKit2/UIProcess/WebPageProxy.cpp
index 043cdb690..ca11b64ca 100644
--- a/Source/WebKit2/UIProcess/WebPageProxy.cpp
+++ b/Source/WebKit2/UIProcess/WebPageProxy.cpp
@@ -109,6 +109,9 @@
using namespace WebCore;
+// Represents the number of wheel events we can hold in the queue before we start pushing them preemptively.
+static const unsigned wheelEventQueueSizeThreshold = 10;
+
namespace WebKit {
WKPageDebugPaintFlags WebPageProxy::s_debugPaintFlags = 0;
@@ -657,13 +660,15 @@ void WebPageProxy::willGoToBackForwardListItem(uint64_t itemID, CoreIPC::Argumen
String WebPageProxy::activeURL() const
{
- if (!m_mainFrame)
- return String();
-
- // If there is a currently pending url, it is the active URL.
+ // If there is a currently pending url, it is the active URL,
+ // even when there's no main frame yet, as it might be the
+ // first API request.
if (!m_pendingAPIRequestURL.isNull())
return m_pendingAPIRequestURL;
+ if (!m_mainFrame)
+ return String();
+
if (!m_mainFrame->unreachableURL().isEmpty())
return m_mainFrame->unreachableURL();
@@ -985,6 +990,68 @@ void WebPageProxy::handleMouseEvent(const NativeWebMouseEvent& event)
process()->send(Messages::WebPage::MouseEvent(event), m_pageID);
}
+#if MERGE_WHEEL_EVENTS
+static bool canCoalesce(const WebWheelEvent& a, const WebWheelEvent& b)
+{
+ if (a.position() != b.position())
+ return false;
+ if (a.globalPosition() != b.globalPosition())
+ return false;
+ if (a.modifiers() != b.modifiers())
+ return false;
+ if (a.granularity() != b.granularity())
+ return false;
+#if PLATFORM(MAC)
+ if (a.phase() != b.phase())
+ return false;
+ if (a.momentumPhase() != b.momentumPhase())
+ return false;
+ if (a.hasPreciseScrollingDeltas() != b.hasPreciseScrollingDeltas())
+ return false;
+#endif
+
+ return true;
+}
+
+static WebWheelEvent coalesce(const WebWheelEvent& a, const WebWheelEvent& b)
+{
+ ASSERT(canCoalesce(a, b));
+
+ FloatSize mergedDelta = a.delta() + b.delta();
+ FloatSize mergedWheelTicks = a.wheelTicks() + b.wheelTicks();
+
+#if PLATFORM(MAC)
+ return WebWheelEvent(WebEvent::Wheel, b.position(), b.globalPosition(), mergedDelta, mergedWheelTicks, b.granularity(), b.phase(), b.momentumPhase(), b.hasPreciseScrollingDeltas(), b.modifiers(), b.timestamp(), b.directionInvertedFromDevice());
+#else
+ return WebWheelEvent(WebEvent::Wheel, b.position(), b.globalPosition(), mergedDelta, mergedWheelTicks, b.granularity(), b.modifiers(), b.timestamp());
+#endif
+}
+#endif // MERGE_WHEEL_EVENTS
+
+static WebWheelEvent coalescedWheelEvent(Deque<NativeWebWheelEvent>& queue, Vector<NativeWebWheelEvent>& coalescedEvents)
+{
+ ASSERT(!queue.isEmpty());
+ ASSERT(coalescedEvents.isEmpty());
+
+#if MERGE_WHEEL_EVENTS
+ NativeWebWheelEvent firstEvent = queue.takeFirst();
+ coalescedEvents.append(firstEvent);
+
+ WebWheelEvent event = firstEvent;
+ while (!queue.isEmpty() && canCoalesce(event, queue.first())) {
+ NativeWebWheelEvent firstEvent = queue.takeFirst();
+ coalescedEvents.append(firstEvent);
+ event = coalesce(event, firstEvent);
+ }
+
+ return event;
+#else
+ while (!queue.isEmpty())
+ coalescedEvents.append(queue.takeFirst());
+ return coalescedEvents.last();
+#endif
+}
+
void WebPageProxy::handleWheelEvent(const NativeWebWheelEvent& event)
{
if (!isValid())
@@ -992,19 +1059,42 @@ void WebPageProxy::handleWheelEvent(const NativeWebWheelEvent& event)
if (!m_currentlyProcessedWheelEvents.isEmpty()) {
m_wheelEventQueue.append(event);
+ if (m_wheelEventQueue.size() < wheelEventQueueSizeThreshold)
+ return;
+ // The queue has too many wheel events, so push a new event.
+ }
+
+ if (!m_wheelEventQueue.isEmpty()) {
+ processNextQueuedWheelEvent();
return;
}
- m_currentlyProcessedWheelEvents.append(event);
+ OwnPtr<Vector<NativeWebWheelEvent> > coalescedWheelEvent = adoptPtr(new Vector<NativeWebWheelEvent>);
+ coalescedWheelEvent->append(event);
+ m_currentlyProcessedWheelEvents.append(coalescedWheelEvent.release());
+ sendWheelEvent(event);
+}
+
+void WebPageProxy::processNextQueuedWheelEvent()
+{
+ OwnPtr<Vector<NativeWebWheelEvent> > nextCoalescedEvent = adoptPtr(new Vector<NativeWebWheelEvent>);
+ WebWheelEvent nextWheelEvent = coalescedWheelEvent(m_wheelEventQueue, *nextCoalescedEvent.get());
+ m_currentlyProcessedWheelEvents.append(nextCoalescedEvent.release());
+ sendWheelEvent(nextWheelEvent);
+}
+void WebPageProxy::sendWheelEvent(const WebWheelEvent& event)
+{
process()->responsivenessTimer()->start();
if (m_shouldSendEventsSynchronously) {
bool handled = false;
process()->sendSync(Messages::WebPage::WheelEventSyncForTesting(event), Messages::WebPage::WheelEventSyncForTesting::Reply(handled), m_pageID);
didReceiveEvent(event.type(), handled);
- } else
- process()->send(Messages::EventDispatcher::WheelEvent(m_pageID, event, canGoBack(), canGoForward()), 0);
+ return;
+ }
+
+ process()->send(Messages::EventDispatcher::WheelEvent(m_pageID, event, canGoBack(), canGoForward()), 0);
}
void WebPageProxy::handleKeyboardEvent(const NativeWebKeyboardEvent& event)
@@ -2309,12 +2399,13 @@ void WebPageProxy::mouseDidMoveOverElement(const WebHitTestResult::Data& hitTest
m_uiClient.mouseDidMoveOverElement(this, hitTestResultData, modifiers, userData.get());
}
-void WebPageProxy::missingPluginButtonClicked(const String& mimeType, const String& url, const String& pluginsPageURL)
+void WebPageProxy::unavailablePluginButtonClicked(uint32_t opaquePluginUnavailabilityReason, const String& mimeType, const String& url, const String& pluginsPageURL)
{
MESSAGE_CHECK_URL(url);
MESSAGE_CHECK_URL(pluginsPageURL);
- m_uiClient.missingPluginButtonClicked(this, mimeType, url, pluginsPageURL);
+ WKPluginUnavailabilityReason pluginUnavailabilityReason = static_cast<WKPluginUnavailabilityReason>(opaquePluginUnavailabilityReason);
+ m_uiClient.unavailablePluginButtonClicked(this, pluginUnavailabilityReason, mimeType, url, pluginsPageURL);
}
void WebPageProxy::setToolbarsAreVisible(bool toolbarsAreVisible)
@@ -2967,68 +3058,6 @@ void WebPageProxy::setCursorHiddenUntilMouseMoves(bool hiddenUntilMouseMoves)
m_pageClient->setCursorHiddenUntilMouseMoves(hiddenUntilMouseMoves);
}
-#if MERGE_WHEEL_EVENTS
-static bool canCoalesce(const WebWheelEvent& a, const WebWheelEvent& b)
-{
- if (a.position() != b.position())
- return false;
- if (a.globalPosition() != b.globalPosition())
- return false;
- if (a.modifiers() != b.modifiers())
- return false;
- if (a.granularity() != b.granularity())
- return false;
-#if PLATFORM(MAC)
- if (a.phase() != b.phase())
- return false;
- if (a.momentumPhase() != b.momentumPhase())
- return false;
- if (a.hasPreciseScrollingDeltas() != b.hasPreciseScrollingDeltas())
- return false;
-#endif
-
- return true;
-}
-
-static WebWheelEvent coalesce(const WebWheelEvent& a, const WebWheelEvent& b)
-{
- ASSERT(canCoalesce(a, b));
-
- FloatSize mergedDelta = a.delta() + b.delta();
- FloatSize mergedWheelTicks = a.wheelTicks() + b.wheelTicks();
-
-#if PLATFORM(MAC)
- return WebWheelEvent(WebEvent::Wheel, b.position(), b.globalPosition(), mergedDelta, mergedWheelTicks, b.granularity(), b.phase(), b.momentumPhase(), b.hasPreciseScrollingDeltas(), b.modifiers(), b.timestamp(), b.directionInvertedFromDevice());
-#else
- return WebWheelEvent(WebEvent::Wheel, b.position(), b.globalPosition(), mergedDelta, mergedWheelTicks, b.granularity(), b.modifiers(), b.timestamp());
-#endif
-}
-#endif
-
-static WebWheelEvent coalescedWheelEvent(Deque<NativeWebWheelEvent>& queue, Vector<NativeWebWheelEvent>& coalescedEvents)
-{
- ASSERT(!queue.isEmpty());
- ASSERT(coalescedEvents.isEmpty());
-
-#if MERGE_WHEEL_EVENTS
- NativeWebWheelEvent firstEvent = queue.takeFirst();
- coalescedEvents.append(firstEvent);
-
- WebWheelEvent event = firstEvent;
- while (!queue.isEmpty() && canCoalesce(event, queue.first())) {
- NativeWebWheelEvent firstEvent = queue.takeFirst();
- coalescedEvents.append(firstEvent);
- event = coalesce(event, firstEvent);
- }
-
- return event;
-#else
- while (!queue.isEmpty())
- coalescedEvents.append(queue.takeFirst());
- return coalescedEvents.last();
-#endif
-}
-
void WebPageProxy::didReceiveEvent(uint32_t opaqueType, bool handled)
{
WebEvent::Type type = static_cast<WebEvent::Type>(opaqueType);
@@ -3091,19 +3120,14 @@ void WebPageProxy::didReceiveEvent(uint32_t opaqueType, bool handled)
case WebEvent::Wheel: {
ASSERT(!m_currentlyProcessedWheelEvents.isEmpty());
+ OwnPtr<Vector<NativeWebWheelEvent> > oldestCoalescedEvent = m_currentlyProcessedWheelEvents.takeFirst();
+
// FIXME: Dispatch additional events to the didNotHandleWheelEvent client function.
if (!handled && m_uiClient.implementsDidNotHandleWheelEvent())
- m_uiClient.didNotHandleWheelEvent(this, m_currentlyProcessedWheelEvents.last());
-
- m_currentlyProcessedWheelEvents.clear();
-
- if (!m_wheelEventQueue.isEmpty()) {
- WebWheelEvent newWheelEvent = coalescedWheelEvent(m_wheelEventQueue, m_currentlyProcessedWheelEvents);
-
- process()->responsivenessTimer()->start();
- process()->send(Messages::EventDispatcher::WheelEvent(m_pageID, newWheelEvent, canGoBack(), canGoForward()), 0);
- }
+ m_uiClient.didNotHandleWheelEvent(this, oldestCoalescedEvent->last());
+ if (!m_wheelEventQueue.isEmpty())
+ processNextQueuedWheelEvent();
break;
}
@@ -3597,6 +3621,11 @@ void WebPageProxy::didFailToInitializePlugin(const String& mimeType)
m_loaderClient.didFailToInitializePlugin(this, mimeType);
}
+void WebPageProxy::didBlockInsecurePluginVersion(const String& mimeType)
+{
+ m_loaderClient.didBlockInsecurePluginVersion(this, mimeType);
+}
+
bool WebPageProxy::willHandleHorizontalScrollEvents() const
{
return !m_canShortCircuitHorizontalWheelEvents;
diff --git a/Source/WebKit2/UIProcess/WebPageProxy.h b/Source/WebKit2/UIProcess/WebPageProxy.h
index a3e9bb8f7..ef331fc7d 100644
--- a/Source/WebKit2/UIProcess/WebPageProxy.h
+++ b/Source/WebKit2/UIProcess/WebPageProxy.h
@@ -718,7 +718,7 @@ private:
void shouldInterruptJavaScript(bool& result);
void setStatusText(const String&);
void mouseDidMoveOverElement(const WebHitTestResult::Data& hitTestResultData, uint32_t modifiers, CoreIPC::ArgumentDecoder*);
- void missingPluginButtonClicked(const String& mimeType, const String& url, const String& pluginsPageURL);
+ void unavailablePluginButtonClicked(uint32_t opaquePluginUnavailabilityReason, const String& mimeType, const String& url, const String& pluginsPageURL);
void setToolbarsAreVisible(bool toolbarsAreVisible);
void getToolbarsAreVisible(bool& toolbarsAreVisible);
void setMenuBarIsVisible(bool menuBarIsVisible);
@@ -745,6 +745,7 @@ private:
void didChangeScrollOffsetPinningForMainFrame(bool pinnedToLeftSide, bool pinnedToRightSide);
void didChangePageCount(unsigned);
void didFailToInitializePlugin(const String& mimeType);
+ void didBlockInsecurePluginVersion(const String& mimeType);
void setCanShortCircuitHorizontalWheelEvents(bool canShortCircuitHorizontalWheelEvents) { m_canShortCircuitHorizontalWheelEvents = canShortCircuitHorizontalWheelEvents; }
void reattachToWebProcess();
@@ -903,6 +904,9 @@ private:
void windowedPluginGeometryDidChange(const WebCore::IntRect& frameRect, const WebCore::IntRect& clipRect, uint64_t windowID);
#endif
+ void processNextQueuedWheelEvent();
+ void sendWheelEvent(const WebWheelEvent&);
+
PageClient* m_pageClient;
WebLoaderClient m_loaderClient;
WebPolicyClient m_policyClient;
@@ -1024,7 +1028,7 @@ private:
#endif
Deque<NativeWebKeyboardEvent> m_keyEventQueue;
Deque<NativeWebWheelEvent> m_wheelEventQueue;
- Vector<NativeWebWheelEvent> m_currentlyProcessedWheelEvents;
+ Deque<OwnPtr<Vector<NativeWebWheelEvent> > > m_currentlyProcessedWheelEvents;
bool m_processingMouseMoveEvent;
OwnPtr<NativeWebMouseEvent> m_nextMouseMoveEvent;
diff --git a/Source/WebKit2/UIProcess/WebPageProxy.messages.in b/Source/WebKit2/UIProcess/WebPageProxy.messages.in
index 400aced5d..4c48a3cd8 100644
--- a/Source/WebKit2/UIProcess/WebPageProxy.messages.in
+++ b/Source/WebKit2/UIProcess/WebPageProxy.messages.in
@@ -30,7 +30,7 @@ messages -> WebPageProxy {
RunJavaScriptPrompt(uint64_t frameID, WTF::String message, WTF::String defaultValue) -> (WTF::String result)
ShouldInterruptJavaScript() -> (bool shouldInterupt)
MouseDidMoveOverElement(WebKit::WebHitTestResult::Data hitTestResultData, uint32_t modifiers, WebKit::InjectedBundleUserMessageEncoder userData);
- MissingPluginButtonClicked(WTF::String mimeType, WTF::String url, WTF::String pluginsPageURL)
+ UnavailablePluginButtonClicked(uint32_t pluginUnavailabilityReason, WTF::String mimeType, WTF::String url, WTF::String pluginsPageURL)
DidChangeViewportProperties(WebCore::ViewportAttributes attributes)
DidReceiveEvent(uint32_t type, bool handled)
StopResponsivenessTimer()
@@ -66,6 +66,7 @@ messages -> WebPageProxy {
DidChangeScrollOffsetPinningForMainFrame(bool hasHorizontalScrollbar, bool hasVerticalScrollbar)
DidChangePageCount(unsigned pageCount);
DidFailToInitializePlugin(WTF::String mimeType)
+ DidBlockInsecurePluginVersion(WTF::String mimeType)
SetCanShortCircuitHorizontalWheelEvents(bool canShortCircuitHorizontalWheelEvents)
#if USE(TILED_BACKING_STORE)
diff --git a/Source/WebKit2/UIProcess/WebUIClient.cpp b/Source/WebKit2/UIProcess/WebUIClient.cpp
index d01312208..ed1fb930b 100644
--- a/Source/WebKit2/UIProcess/WebUIClient.cpp
+++ b/Source/WebKit2/UIProcess/WebUIClient.cpp
@@ -174,12 +174,18 @@ void WebUIClient::mouseDidMoveOverElement(WebPageProxy* page, const WebHitTestRe
m_client.mouseDidMoveOverElement(toAPI(page), toAPI(webHitTestResult.get()), toAPI(modifiers), toAPI(userData), m_client.clientInfo);
}
-void WebUIClient::missingPluginButtonClicked(WebPageProxy* page, const String& mimeType, const String& url, const String& pluginsPageURL)
+void WebUIClient::unavailablePluginButtonClicked(WebPageProxy* page, WKPluginUnavailabilityReason pluginUnavailabilityReason, const String& mimeType, const String& url, const String& pluginsPageURL)
{
- if (!m_client.missingPluginButtonClicked)
+ if (pluginUnavailabilityReason == kWKPluginUnavailabilityReasonPluginMissing) {
+ if (m_client.missingPluginButtonClicked_deprecatedForUseWithV0)
+ m_client.missingPluginButtonClicked_deprecatedForUseWithV0(toAPI(page), toAPI(mimeType.impl()), toAPI(url.impl()), toAPI(pluginsPageURL.impl()), m_client.clientInfo);
+ }
+
+ if (!m_client.unavailablePluginButtonClicked)
return;
- m_client.missingPluginButtonClicked(toAPI(page), toAPI(mimeType.impl()), toAPI(url.impl()), toAPI(pluginsPageURL.impl()), m_client.clientInfo);
+ m_client.unavailablePluginButtonClicked(toAPI(page), pluginUnavailabilityReason, toAPI(mimeType.impl()), toAPI(url.impl()), toAPI(pluginsPageURL.impl()), m_client.clientInfo);
+
}
bool WebUIClient::implementsDidNotHandleKeyEvent() const
diff --git a/Source/WebKit2/UIProcess/WebUIClient.h b/Source/WebKit2/UIProcess/WebUIClient.h
index 835e6ceb7..28cfb686a 100644
--- a/Source/WebKit2/UIProcess/WebUIClient.h
+++ b/Source/WebKit2/UIProcess/WebUIClient.h
@@ -70,7 +70,7 @@ public:
void setStatusText(WebPageProxy*, const String&);
void mouseDidMoveOverElement(WebPageProxy*, const WebHitTestResult::Data&, WebEvent::Modifiers, APIObject*);
- void missingPluginButtonClicked(WebPageProxy*, const String& mimeType, const String& url, const String& pluginsPageURL);
+ void unavailablePluginButtonClicked(WebPageProxy*, WKPluginUnavailabilityReason, const String& mimeType, const String& url, const String& pluginsPageURL);
bool implementsDidNotHandleKeyEvent() const;
void didNotHandleKeyEvent(WebPageProxy*, const NativeWebKeyboardEvent&);
diff --git a/Source/WebKit2/UIProcess/mac/WebInspectorProxyMac.mm b/Source/WebKit2/UIProcess/mac/WebInspectorProxyMac.mm
index cfb756cdb..bcdfbc272 100644
--- a/Source/WebKit2/UIProcess/mac/WebInspectorProxyMac.mm
+++ b/Source/WebKit2/UIProcess/mac/WebInspectorProxyMac.mm
@@ -42,7 +42,7 @@
#import <WebCore/SoftLinking.h>
#import <wtf/text/WTFString.h>
-SOFT_LINK_STAGED_FRAMEWORK_OPTIONAL(WebInspector, PrivateFrameworks)
+SOFT_LINK_STAGED_FRAMEWORK_OPTIONAL(WebInspector, PrivateFrameworks, A)
using namespace WebCore;
using namespace WebKit;
diff --git a/Source/WebKit2/UIProcess/qt/QtDialogRunner.h b/Source/WebKit2/UIProcess/qt/QtDialogRunner.h
index f53fc92f4..eb229ec84 100644
--- a/Source/WebKit2/UIProcess/qt/QtDialogRunner.h
+++ b/Source/WebKit2/UIProcess/qt/QtDialogRunner.h
@@ -27,8 +27,8 @@
#include <wtf/OwnPtr.h>
QT_BEGIN_NAMESPACE
-class QDeclarativeComponent;
-class QDeclarativeContext;
+class QQmlComponent;
+class QQmlContext;
class QQuickItem;
QT_END_NAMESPACE
@@ -41,14 +41,14 @@ public:
QtDialogRunner();
virtual ~QtDialogRunner();
- bool initForAlert(QDeclarativeComponent*, QQuickItem* dialogParent, const QString& message);
- bool initForConfirm(QDeclarativeComponent*, QQuickItem* dialogParent, const QString& message);
- bool initForPrompt(QDeclarativeComponent*, QQuickItem* dialogParent, const QString& message, const QString& defaultValue);
- bool initForAuthentication(QDeclarativeComponent*, QQuickItem* dialogParent, const QString& hostname, const QString& realm, const QString& prefilledUsername);
- bool initForCertificateVerification(QDeclarativeComponent*, QQuickItem*, const QString& hostname);
- bool initForProxyAuthentication(QDeclarativeComponent*, QQuickItem*, const QString& hostname, uint16_t port, const QString& prefilledUsername);
- bool initForFilePicker(QDeclarativeComponent*, QQuickItem*, const QStringList& selectedFiles, bool allowMultiple);
- bool initForDatabaseQuotaDialog(QDeclarativeComponent*, QQuickItem*, const QString& databaseName, const QString& displayName, WKSecurityOriginRef, quint64 currentQuota, quint64 currentOriginUsage, quint64 currentDatabaseUsage, quint64 expectedUsage);
+ bool initForAlert(QQmlComponent*, QQuickItem* dialogParent, const QString& message);
+ bool initForConfirm(QQmlComponent*, QQuickItem* dialogParent, const QString& message);
+ bool initForPrompt(QQmlComponent*, QQuickItem* dialogParent, const QString& message, const QString& defaultValue);
+ bool initForAuthentication(QQmlComponent*, QQuickItem* dialogParent, const QString& hostname, const QString& realm, const QString& prefilledUsername);
+ bool initForCertificateVerification(QQmlComponent*, QQuickItem*, const QString& hostname);
+ bool initForProxyAuthentication(QQmlComponent*, QQuickItem*, const QString& hostname, uint16_t port, const QString& prefilledUsername);
+ bool initForFilePicker(QQmlComponent*, QQuickItem*, const QStringList& selectedFiles, bool allowMultiple);
+ bool initForDatabaseQuotaDialog(QQmlComponent*, QQuickItem*, const QString& databaseName, const QString& displayName, WKSecurityOriginRef, quint64 currentQuota, quint64 currentOriginUsage, quint64 currentDatabaseUsage, quint64 expectedUsage);
QQuickItem* dialog() const { return m_dialog.get(); }
@@ -88,9 +88,9 @@ public slots:
}
private:
- bool createDialog(QDeclarativeComponent*, QQuickItem* dialogParent, QObject* contextObject);
+ bool createDialog(QQmlComponent*, QQuickItem* dialogParent, QObject* contextObject);
- OwnPtr<QDeclarativeContext> m_dialogContext;
+ OwnPtr<QQmlContext> m_dialogContext;
OwnPtr<QQuickItem> m_dialog;
QString m_result;
bool m_wasAccepted;
diff --git a/Source/WebKit2/UIProcess/qt/QtViewportInteractionEngine.cpp b/Source/WebKit2/UIProcess/qt/QtViewportInteractionEngine.cpp
index 09f632456..949a5918c 100644
--- a/Source/WebKit2/UIProcess/qt/QtViewportInteractionEngine.cpp
+++ b/Source/WebKit2/UIProcess/qt/QtViewportInteractionEngine.cpp
@@ -365,22 +365,25 @@ void QtViewportInteractionEngine::zoomToAreaGestureEnded(const QPointF& touchPoi
if (scrollAnimationActive() || scaleAnimationActive())
return;
+ m_hadUserInteraction = true;
+
const int margin = 10; // We want at least a little bit of margin.
QRectF endArea = itemRectFromCSS(targetArea.adjusted(-margin, -margin, margin, margin));
const QRectF viewportRect = m_viewport->boundingRect();
- qreal targetCSSScale = cssScaleFromItem(viewportRect.size().width() / endArea.size().width());
- qreal endItemScale = itemScaleFromCSS(innerBoundedCSSScale(qMin(targetCSSScale, qreal(2.5))));
+ qreal targetCSSScale = viewportRect.size().width() / endArea.size().width();
+ qreal endCSSScale = innerBoundedCSSScale(qMin(targetCSSScale, qreal(2.5)));
+ qreal endItemScale = itemScaleFromCSS(endCSSScale);
qreal currentScale = m_content->contentsScale();
// We want to end up with the target area filling the whole width of the viewport (if possible),
// and centralized vertically where the user requested zoom. Thus our hotspot is the center of
// the targetArea x-wise and the requested zoom position, y-wise.
- const QPointF hotspot = QPointF(endArea.center().x(), touchPoint.y() * m_devicePixelRatio);
+ const QPointF hotspot = QPointF(endArea.center().x(), itemCoordFromCSS(touchPoint.y()));
const QPointF viewportHotspot = viewportRect.center();
- QPointF endPosition = hotspot * endItemScale - viewportHotspot;
+ QPointF endPosition = hotspot * endCSSScale - viewportHotspot;
QRectF endPosRange = computePosRangeForItemAtScale(endItemScale);
endPosition = boundPosition(endPosRange.topLeft(), endPosition, endPosRange.bottomRight());
@@ -415,8 +418,9 @@ void QtViewportInteractionEngine::zoomToAreaGestureEnded(const QPointF& touchPoi
case ZoomBack: {
ScaleStackItem lastScale = m_scaleStack.takeLast();
endItemScale = lastScale.scale;
+ endCSSScale = cssScaleFromItem(lastScale.scale);
// Recalculate endPosition and bound it according to new scale.
- endPosition.setY(hotspot.y() * endItemScale - viewportHotspot.y());
+ endPosition.setY(hotspot.y() * endCSSScale - viewportHotspot.y());
endPosition.setX(lastScale.xPosition);
endPosRange = computePosRangeForItemAtScale(endItemScale);
endPosition = boundPosition(endPosRange.topLeft(), endPosition, endPosRange.bottomRight());
diff --git a/Source/WebKit2/UIProcess/qt/QtViewportInteractionEngine.h b/Source/WebKit2/UIProcess/qt/QtViewportInteractionEngine.h
index 486d8417c..8a720f34b 100644
--- a/Source/WebKit2/UIProcess/qt/QtViewportInteractionEngine.h
+++ b/Source/WebKit2/UIProcess/qt/QtViewportInteractionEngine.h
@@ -35,6 +35,8 @@ class QQuickWebView;
class QWheelEvent;
QT_END_NAMESPACE
+class QWebViewportInfo;
+
namespace WebKit {
class ViewportUpdateDeferrer;
@@ -114,7 +116,7 @@ private Q_SLOTS:
private:
friend class ViewportUpdateDeferrer;
- friend class QWebViewportInfo;
+ friend class ::QWebViewportInfo;
QQuickWebView* const m_viewport;
QQuickWebPage* const m_content;
diff --git a/Source/WebKit2/UIProcess/qt/QtWebError.cpp b/Source/WebKit2/UIProcess/qt/QtWebError.cpp
index 87ac17edf..9ea2925a9 100644
--- a/Source/WebKit2/UIProcess/qt/QtWebError.cpp
+++ b/Source/WebKit2/UIProcess/qt/QtWebError.cpp
@@ -66,4 +66,9 @@ QString QtWebError::description() const
return WKStringCopyQString(WKErrorCopyLocalizedDescription(error.get()));
}
+bool QtWebError::isCancellation() const
+{
+ return toImpl(error.get())->platformError().isCancellation();
+}
+
} // namespace WebKit
diff --git a/Source/WebKit2/UIProcess/qt/QtWebError.h b/Source/WebKit2/UIProcess/qt/QtWebError.h
index 3c36f701d..8f954054e 100644
--- a/Source/WebKit2/UIProcess/qt/QtWebError.h
+++ b/Source/WebKit2/UIProcess/qt/QtWebError.h
@@ -46,6 +46,7 @@ public:
QUrl url() const;
int errorCode() const;
QString description() const;
+ bool isCancellation() const;
int errorCodeAsHttpStatusCode() const { return errorCode(); }
QNetworkReply::NetworkError errorCodeAsNetworkError() const { return static_cast<QNetworkReply::NetworkError>(errorCode()); }
diff --git a/Source/WebKit2/UIProcess/qt/QtWebPageLoadClient.cpp b/Source/WebKit2/UIProcess/qt/QtWebPageLoadClient.cpp
index f510016de..c7a69cd28 100644
--- a/Source/WebKit2/UIProcess/qt/QtWebPageLoadClient.cpp
+++ b/Source/WebKit2/UIProcess/qt/QtWebPageLoadClient.cpp
@@ -22,13 +22,7 @@
#include "QtWebPageLoadClient.h"
#include "QtWebError.h"
-#include "WKStringQt.h"
-#include "qquickwebview_p.h"
#include "qquickwebview_p_p.h"
-#include "qwebloadrequest_p.h"
-#include <KURL.h>
-#include <WKFrame.h>
-#include <WebPageProxy.h>
using namespace WebCore;
@@ -36,8 +30,6 @@ namespace WebKit {
QtWebPageLoadClient::QtWebPageLoadClient(WKPageRef pageRef, QQuickWebView* webView)
: m_webView(webView)
- , m_webPageProxy(toImpl(pageRef))
- , m_loadProgress(0)
{
WKPageLoaderClient loadClient;
memset(&loadClient, 0, sizeof(WKPageLoaderClient));
@@ -53,57 +45,38 @@ QtWebPageLoadClient::QtWebPageLoadClient(WKPageRef pageRef, QQuickWebView* webVi
loadClient.didStartProgress = didStartProgress;
loadClient.didChangeProgress = didChangeProgress;
loadClient.didFinishProgress = didFinishProgress;
- loadClient.didFirstVisuallyNonEmptyLayoutForFrame = didFirstVisuallyNonEmptyLayoutForFrame;
loadClient.didChangeBackForwardList = didChangeBackForwardList;
WKPageSetPageLoaderClient(pageRef, &loadClient);
}
-void QtWebPageLoadClient::completeLoadWhenProcessDidCrashIfNeeded()
-{
- // Check if loading was ongoing, when process crashed.
- if (!m_loadProgress || m_loadProgress == 100)
- return;
-
- QUrl url(KURL(WebCore::ParsedURLString, m_webPageProxy->urlAtProcessExit()));
- QWebLoadRequest loadRequest(url, QQuickWebView::LoadFailedStatus, QLatin1String("The web process crashed."), QQuickWebView::InternalErrorDomain, 0);
-
- emit m_webView->loadingChanged(&loadRequest);
- setLoadProgress(100);
-}
-
void QtWebPageLoadClient::didStartProvisionalLoad(const QUrl& url)
{
- QWebLoadRequest loadRequest(url, QQuickWebView::LoadStartedStatus);
- emit m_webView->loadingChanged(&loadRequest);
+ m_webView->d_func()->provisionalLoadDidStart(url);
}
void QtWebPageLoadClient::didCommitLoad()
{
- emit m_webView->navigationHistoryChanged();
- emit m_webView->urlChanged();
- emit m_webView->titleChanged();
m_webView->d_func()->loadDidCommit();
}
void QtWebPageLoadClient::didSameDocumentNavigation()
{
- emit m_webView->navigationHistoryChanged();
- emit m_webView->urlChanged();
+ m_webView->d_func()->didSameDocumentNavigation();
}
void QtWebPageLoadClient::didReceiveTitle()
{
- emit m_webView->titleChanged();
+ m_webView->d_func()->titleDidChange();
}
-void QtWebPageLoadClient::didFirstVisuallyNonEmptyLayout()
+void QtWebPageLoadClient::didChangeProgress(int loadProgress)
{
- m_webView->d_func()->didFinishFirstNonEmptyLayout();
+ m_webView->d_func()->loadProgressDidChange(loadProgress);
}
void QtWebPageLoadClient::didChangeBackForwardList()
{
- m_webView->d_func()->didChangeBackForwardList();
+ m_webView->d_func()->backForwardListDidChange();
}
void QtWebPageLoadClient::dispatchLoadSucceeded()
@@ -111,24 +84,17 @@ void QtWebPageLoadClient::dispatchLoadSucceeded()
m_webView->d_func()->loadDidSucceed();
}
-void QtWebPageLoadClient::dispatchLoadFailed(WKErrorRef error)
+void QtWebPageLoadClient::dispatchLoadFailed(const QtWebError& error)
{
- int errorCode = WKErrorGetErrorCode(error);
- if (toImpl(error)->platformError().isCancellation() || errorCode == kWKErrorCodeFrameLoadInterruptedByPolicyChange || errorCode == kWKErrorCodePlugInWillHandleLoad) {
+ int errorCode = error.errorCode();
+
+ if (error.isCancellation() || errorCode == kWKErrorCodeFrameLoadInterruptedByPolicyChange || errorCode == kWKErrorCodePlugInWillHandleLoad) {
// Make sure that LoadStartedStatus has a counterpart when e.g. requesting a download.
dispatchLoadSucceeded();
return;
}
- QtWebError qtError(error);
- QWebLoadRequest loadRequest(qtError.url(), QQuickWebView::LoadFailedStatus, qtError.description(), static_cast<QQuickWebView::ErrorDomain>(qtError.type()), qtError.errorCode());
- emit m_webView->loadingChanged(&loadRequest);
-}
-
-void QtWebPageLoadClient::setLoadProgress(int loadProgress)
-{
- m_loadProgress = loadProgress;
- emit m_webView->loadProgressChanged();
+ m_webView->d_func()->loadDidFail(error);
}
static QtWebPageLoadClient* toQtWebPageLoadClient(const void* clientInfo)
@@ -141,8 +107,7 @@ void QtWebPageLoadClient::didStartProvisionalLoadForFrame(WKPageRef, WKFrameRef
{
if (!WKFrameIsMainFrame(frame))
return;
- WebFrameProxy* wkframe = toImpl(frame);
- QString urlStr(wkframe->provisionalURL());
+ QString urlStr(toImpl(frame)->provisionalURL());
QUrl qUrl = urlStr;
toQtWebPageLoadClient(clientInfo)->didStartProvisionalLoad(qUrl);
}
@@ -191,26 +156,17 @@ void QtWebPageLoadClient::didReceiveTitleForFrame(WKPageRef, WKStringRef title,
void QtWebPageLoadClient::didStartProgress(WKPageRef, const void* clientInfo)
{
- QtWebPageLoadClient* client = toQtWebPageLoadClient(clientInfo);
- client->setLoadProgress(0);
- client->m_webView->d_func()->setIcon(QUrl());
+ toQtWebPageLoadClient(clientInfo)->didChangeProgress(0);
}
void QtWebPageLoadClient::didChangeProgress(WKPageRef page, const void* clientInfo)
{
- toQtWebPageLoadClient(clientInfo)->setLoadProgress(WKPageGetEstimatedProgress(page) * 100);
+ toQtWebPageLoadClient(clientInfo)->didChangeProgress(WKPageGetEstimatedProgress(page) * 100);
}
void QtWebPageLoadClient::didFinishProgress(WKPageRef, const void* clientInfo)
{
- toQtWebPageLoadClient(clientInfo)->setLoadProgress(100);
-}
-
-void QtWebPageLoadClient::didFirstVisuallyNonEmptyLayoutForFrame(WKPageRef, WKFrameRef frame, WKTypeRef, const void *clientInfo)
-{
- if (!WKFrameIsMainFrame(frame))
- return;
- toQtWebPageLoadClient(clientInfo)->didFirstVisuallyNonEmptyLayout();
+ toQtWebPageLoadClient(clientInfo)->didChangeProgress(100);
}
void QtWebPageLoadClient::didChangeBackForwardList(WKPageRef, WKBackForwardListItemRef, WKArrayRef, const void *clientInfo)
diff --git a/Source/WebKit2/UIProcess/qt/QtWebPageLoadClient.h b/Source/WebKit2/UIProcess/qt/QtWebPageLoadClient.h
index a4afd25f8..179eb8ed2 100644
--- a/Source/WebKit2/UIProcess/qt/QtWebPageLoadClient.h
+++ b/Source/WebKit2/UIProcess/qt/QtWebPageLoadClient.h
@@ -32,27 +32,23 @@ class QQuickWebView;
namespace WebKit {
-class WebPageProxy;
+class QtWebError;
class QtWebPageLoadClient {
public:
QtWebPageLoadClient(WKPageRef, QQuickWebView*);
- int loadProgress() const { return m_loadProgress; }
- void completeLoadWhenProcessDidCrashIfNeeded();
-
private:
void didStartProvisionalLoad(const QUrl&);
void didCommitLoad();
void didSameDocumentNavigation();
void didReceiveTitle();
- void didFirstVisuallyNonEmptyLayout();
+ void didChangeProgress(int);
void didChangeBackForwardList();
void dispatchLoadSucceeded();
- void dispatchLoadFailed(WKErrorRef);
+ void dispatchLoadFailed(const QtWebError&);
- void setLoadProgress(int);
// WKPageLoadClient callbacks.
static void didStartProvisionalLoadForFrame(WKPageRef, WKFrameRef, WKTypeRef userData, const void* clientInfo);
@@ -65,12 +61,9 @@ private:
static void didStartProgress(WKPageRef, const void* clientInfo);
static void didChangeProgress(WKPageRef, const void* clientInfo);
static void didFinishProgress(WKPageRef, const void* clientInfo);
- static void didFirstVisuallyNonEmptyLayoutForFrame(WKPageRef, WKFrameRef, WKTypeRef userData, const void* clientInfo);
static void didChangeBackForwardList(WKPageRef, WKBackForwardListItemRef, WKArrayRef, const void *clientInfo);
QQuickWebView* m_webView;
- WebPageProxy* m_webPageProxy;
- int m_loadProgress;
};
} // namespace Webkit
diff --git a/Source/WebKit2/UIProcess/qt/WebPopupMenuProxyQt.h b/Source/WebKit2/UIProcess/qt/WebPopupMenuProxyQt.h
index d23134078..21eec5d1d 100644
--- a/Source/WebKit2/UIProcess/qt/WebPopupMenuProxyQt.h
+++ b/Source/WebKit2/UIProcess/qt/WebPopupMenuProxyQt.h
@@ -31,8 +31,8 @@
#include <QtCore/QObject>
#include <wtf/OwnPtr.h>
-class QDeclarativeComponent;
-class QDeclarativeContext;
+class QQmlComponent;
+class QQmlContext;
class QQuickWebView;
class QQuickItem;
@@ -59,11 +59,11 @@ private Q_SLOTS:
private:
WebPopupMenuProxyQt(WebPopupMenuProxy::Client*, QQuickWebView*);
void createItem(QObject*);
- void createContext(QDeclarativeComponent*, QObject*);
+ void createContext(QQmlComponent*, QObject*);
void notifyValueChanged();
- OwnPtr<QDeclarativeContext> m_context;
+ OwnPtr<QQmlContext> m_context;
OwnPtr<QQuickItem> m_itemSelector;
QQuickWebView* m_webView;
diff --git a/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.cpp b/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.cpp
index b63c73a4e..adc632dd8 100644
--- a/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.cpp
+++ b/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.cpp
@@ -676,6 +676,11 @@ bool NetscapePlugin::isTransparent()
return m_isTransparent;
}
+bool NetscapePlugin::wantsWheelEvents()
+{
+ return m_pluginModule->pluginQuirks().contains(PluginQuirks::WantsWheelEvents);
+}
+
void NetscapePlugin::geometryDidChange(const IntSize& pluginSize, const IntRect& clipRect, const AffineTransform& pluginToRootViewTransform)
{
ASSERT(m_isStarted);
diff --git a/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.h b/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.h
index 660b68540..7bba977b4 100644
--- a/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.h
+++ b/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.h
@@ -173,6 +173,7 @@ private:
virtual PlatformLayer* pluginLayer();
#endif
virtual bool isTransparent();
+ virtual bool wantsWheelEvents() OVERRIDE;
virtual void geometryDidChange(const WebCore::IntSize& pluginSize, const WebCore::IntRect& clipRect, const WebCore::AffineTransform& pluginToRootViewTransform);
virtual void visibilityDidChange();
virtual void frameDidFinishLoading(uint64_t requestID);
diff --git a/Source/WebKit2/WebProcess/Plugins/PDF/BuiltInPDFView.h b/Source/WebKit2/WebProcess/Plugins/PDF/BuiltInPDFView.h
index c4d178c6e..6d11c8552 100644
--- a/Source/WebKit2/WebProcess/Plugins/PDF/BuiltInPDFView.h
+++ b/Source/WebKit2/WebProcess/Plugins/PDF/BuiltInPDFView.h
@@ -77,6 +77,7 @@ private:
virtual PlatformLayer* pluginLayer();
#endif
virtual bool isTransparent();
+ virtual bool wantsWheelEvents() OVERRIDE;
virtual void geometryDidChange(const WebCore::IntSize& pluginSize, const WebCore::IntRect& clipRect, const WebCore::AffineTransform& pluginToRootViewTransform);
virtual void visibilityDidChange();
virtual void frameDidFinishLoading(uint64_t requestID);
@@ -119,6 +120,7 @@ private:
// ScrollableArea methods.
virtual WebCore::IntRect scrollCornerRect() const;
virtual WebCore::ScrollableArea* enclosingScrollableArea() const;
+ virtual WebCore::IntRect scrollableAreaBoundingBox() const OVERRIDE;
virtual void setScrollOffset(const WebCore::IntPoint&);
virtual int scrollSize(WebCore::ScrollbarOrientation) const;
virtual bool isActive() const;
diff --git a/Source/WebKit2/WebProcess/Plugins/PDF/BuiltInPDFView.mm b/Source/WebKit2/WebProcess/Plugins/PDF/BuiltInPDFView.mm
index 7dc0b0e64..c4ee69330 100644
--- a/Source/WebKit2/WebProcess/Plugins/PDF/BuiltInPDFView.mm
+++ b/Source/WebKit2/WebProcess/Plugins/PDF/BuiltInPDFView.mm
@@ -196,6 +196,8 @@ const PluginView* BuiltInPDFView::pluginView() const
void BuiltInPDFView::updateScrollbars()
{
+ bool hadScrollbars = m_horizontalScrollbar || m_verticalScrollbar;
+
if (m_horizontalScrollbar) {
if (m_pluginSize.width() >= m_pdfDocumentSize.width())
destroyScrollbar(HorizontalScrollbar);
@@ -234,10 +236,15 @@ void BuiltInPDFView::updateScrollbars()
if (!frameView)
return;
- if (m_verticalScrollbar || m_horizontalScrollbar)
- frameView->addScrollableArea(this);
- else
- frameView->removeScrollableArea(this);
+ bool hasScrollbars = m_horizontalScrollbar || m_verticalScrollbar;
+ if (hadScrollbars != hasScrollbars) {
+ if (hasScrollbars)
+ frameView->addScrollableArea(this);
+ else
+ frameView->removeScrollableArea(this);
+
+ frameView->setNeedsLayout();
+ }
}
PassRefPtr<Scrollbar> BuiltInPDFView::createScrollbar(ScrollbarOrientation orientation)
@@ -464,6 +471,12 @@ bool BuiltInPDFView::isTransparent()
return false;
}
+bool BuiltInPDFView::wantsWheelEvents()
+{
+ // We return false here even though we do want wheel events, because we add ourselves to the scrollable area set in updateScrollbars().
+ return false;
+}
+
void BuiltInPDFView::geometryDidChange(const IntSize& pluginSize, const IntRect& clipRect, const AffineTransform& pluginToRootViewTransform)
{
if (m_pluginSize == pluginSize) {
@@ -688,6 +701,11 @@ ScrollableArea* BuiltInPDFView::enclosingScrollableArea() const
return 0;
}
+IntRect BuiltInPDFView::scrollableAreaBoundingBox() const
+{
+ return pluginView()->frameRect();
+}
+
void BuiltInPDFView::setScrollOffset(const IntPoint& offset)
{
m_scrollOffset = IntSize(offset.x(), offset.y());
diff --git a/Source/WebKit2/WebProcess/Plugins/Plugin.h b/Source/WebKit2/WebProcess/Plugins/Plugin.h
index 4f10da9bc..5be84f476 100644
--- a/Source/WebKit2/WebProcess/Plugins/Plugin.h
+++ b/Source/WebKit2/WebProcess/Plugins/Plugin.h
@@ -121,6 +121,9 @@ public:
// Returns whether the plug-in is transparent or not.
virtual bool isTransparent() = 0;
+ // Returns whether we should send wheel events to this plug-in.
+ virtual bool wantsWheelEvents() = 0;
+
// Tells the plug-in that its geometry has changed. The clip rect is in plug-in coordinates, and the affine transform can be used
// to convert from root view coordinates to plug-in coordinates.
virtual void geometryDidChange(const WebCore::IntSize& pluginSize, const WebCore::IntRect& clipRect, const WebCore::AffineTransform& pluginToRootViewTransform) = 0;
diff --git a/Source/WebKit2/WebProcess/Plugins/PluginProxy.cpp b/Source/WebKit2/WebProcess/Plugins/PluginProxy.cpp
index 0771bc3d5..d4a3549f4 100644
--- a/Source/WebKit2/WebProcess/Plugins/PluginProxy.cpp
+++ b/Source/WebKit2/WebProcess/Plugins/PluginProxy.cpp
@@ -66,6 +66,7 @@ PluginProxy::PluginProxy(const String& pluginPath)
, m_pluginBackingStoreContainsValidData(false)
, m_isStarted(false)
, m_waitingForPaintInResponseToUpdate(false)
+ , m_wantsWheelEvents(false)
, m_remoteLayerClientID(0)
{
}
@@ -104,13 +105,15 @@ bool PluginProxy::initialize(const Parameters& parameters)
#endif
bool result = false;
+ bool wantsWheelEvents = false;
uint32_t remoteLayerClientID = 0;
- if (!m_connection->connection()->sendSync(Messages::WebProcessConnection::CreatePlugin(creationParameters), Messages::WebProcessConnection::CreatePlugin::Reply(result, remoteLayerClientID), 0) || !result) {
+ if (!m_connection->connection()->sendSync(Messages::WebProcessConnection::CreatePlugin(creationParameters), Messages::WebProcessConnection::CreatePlugin::Reply(result, wantsWheelEvents, remoteLayerClientID), 0) || !result) {
m_connection->removePluginProxy(this);
return false;
}
+ m_wantsWheelEvents = wantsWheelEvents;
m_remoteLayerClientID = remoteLayerClientID;
m_isStarted = true;
@@ -171,6 +174,11 @@ bool PluginProxy::isTransparent()
return false;
}
+bool PluginProxy::wantsWheelEvents()
+{
+ return m_wantsWheelEvents;
+}
+
void PluginProxy::geometryDidChange()
{
ASSERT(m_isStarted);
diff --git a/Source/WebKit2/WebProcess/Plugins/PluginProxy.h b/Source/WebKit2/WebProcess/Plugins/PluginProxy.h
index e4b428669..be07caa85 100644
--- a/Source/WebKit2/WebProcess/Plugins/PluginProxy.h
+++ b/Source/WebKit2/WebProcess/Plugins/PluginProxy.h
@@ -72,6 +72,7 @@ private:
virtual PlatformLayer* pluginLayer();
#endif
virtual bool isTransparent();
+ virtual bool wantsWheelEvents() OVERRIDE;
virtual void geometryDidChange(const WebCore::IntSize& pluginSize, const WebCore::IntRect& clipRect, const WebCore::AffineTransform& pluginToRootViewTransform);
virtual void visibilityDidChange();
virtual void frameDidFinishLoading(uint64_t requestID);
@@ -168,6 +169,9 @@ private:
// Whether we're called invalidate in response to an update call, and are now waiting for a paint call.
bool m_waitingForPaintInResponseToUpdate;
+ // Whether we should send wheel events to this plug-in or not.
+ bool m_wantsWheelEvents;
+
// The client ID for the CA layer in the plug-in process. Will be 0 if the plug-in is not a CA plug-in.
uint32_t m_remoteLayerClientID;
diff --git a/Source/WebKit2/WebProcess/Plugins/PluginView.cpp b/Source/WebKit2/WebProcess/Plugins/PluginView.cpp
index 6799f11b3..03dd60f59 100644
--- a/Source/WebKit2/WebProcess/Plugins/PluginView.cpp
+++ b/Source/WebKit2/WebProcess/Plugins/PluginView.cpp
@@ -54,7 +54,6 @@
#include <WebCore/ProtectionSpace.h>
#include <WebCore/ProxyServer.h>
#include <WebCore/RenderEmbeddedObject.h>
-#include <WebCore/RenderLayer.h>
#include <WebCore/ResourceLoadScheduler.h>
#include <WebCore/ScriptValue.h>
#include <WebCore/ScrollView.h>
@@ -504,6 +503,13 @@ void PluginView::initializePlugin()
setWindowIsVisible(m_webPage->windowIsVisible());
setWindowIsFocused(m_webPage->windowIsFocused());
#endif
+
+ if (wantsWheelEvents()) {
+ if (Frame* frame = m_pluginElement->document()->frame()) {
+ if (FrameView* frameView = frame->view())
+ frameView->setNeedsLayout();
+ }
+ }
}
#if PLATFORM(MAC)
@@ -578,6 +584,15 @@ Scrollbar* PluginView::verticalScrollbar()
return m_plugin->verticalScrollbar();
}
+bool PluginView::wantsWheelEvents()
+{
+ // The plug-in can be null here if it failed to initialize.
+ if (!m_isInitialized || !m_plugin)
+ return 0;
+
+ return m_plugin->wantsWheelEvents();
+}
+
void PluginView::setFrameRect(const WebCore::IntRect& rect)
{
Widget::setFrameRect(rect);
@@ -652,7 +667,7 @@ void PluginView::handleEvent(Event* event)
frame()->eventHandler()->setCapturingMouseEventsNode(0);
didHandleEvent = m_plugin->handleMouseEvent(static_cast<const WebMouseEvent&>(*currentEvent));
- } else if (event->type() == eventNames().mousewheelEvent && currentEvent->type() == WebEvent::Wheel) {
+ } else if (event->type() == eventNames().mousewheelEvent && currentEvent->type() == WebEvent::Wheel && m_plugin->wantsWheelEvents()) {
// We have a wheel event.
didHandleEvent = m_plugin->handleWheelEvent(static_cast<const WebWheelEvent&>(*currentEvent));
} else if (event->type() == eventNames().mouseoverEvent && currentEvent->type() == WebEvent::MouseMove) {
@@ -752,9 +767,8 @@ IntRect PluginView::clipRectInWindowCoordinates() const
Frame* frame = this->frame();
- // Get the window clip rect for the enclosing layer (in window coordinates).
- RenderLayer* layer = m_pluginElement->renderer()->enclosingLayer();
- IntRect windowClipRect = frame->view()->windowClipRectForLayer(layer, true);
+ // Get the window clip rect for the plugin element (in window coordinates).
+ IntRect windowClipRect = frame->view()->windowClipRectForFrameOwner(m_pluginElement.get(), true);
// Intersect the two rects to get the view clip rect in window coordinates.
frameRectInWindowCoordinates.intersect(windowClipRect);
@@ -1111,7 +1125,7 @@ void PluginView::pluginProcessCrashed()
return;
RenderEmbeddedObject* renderer = toRenderEmbeddedObject(m_pluginElement->renderer());
- renderer->setShowsCrashedPluginIndicator();
+ renderer->setPluginUnavailabilityReason(RenderEmbeddedObject::PluginCrashed);
Widget::invalidate();
}
diff --git a/Source/WebKit2/WebProcess/Plugins/PluginView.h b/Source/WebKit2/WebProcess/Plugins/PluginView.h
index 1bf76ae71..d5cb2574c 100644
--- a/Source/WebKit2/WebProcess/Plugins/PluginView.h
+++ b/Source/WebKit2/WebProcess/Plugins/PluginView.h
@@ -111,6 +111,7 @@ private:
virtual bool scroll(WebCore::ScrollDirection, WebCore::ScrollGranularity);
virtual WebCore::Scrollbar* horizontalScrollbar();
virtual WebCore::Scrollbar* verticalScrollbar();
+ virtual bool wantsWheelEvents();
// WebCore::Widget
virtual void setFrameRect(const WebCore::IntRect&);
diff --git a/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp b/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp
index 5d3afe68a..4b78c5a29 100644
--- a/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp
+++ b/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp
@@ -468,20 +468,25 @@ void WebChromeClient::scrollRectIntoView(const IntRect&) const
notImplemented();
}
-bool WebChromeClient::shouldMissingPluginMessageBeButton() const
+bool WebChromeClient::shouldUnavailablePluginMessageBeButton(RenderEmbeddedObject::PluginUnavailabilityReason pluginUnavailabilityReason) const
{
- // FIXME: <rdar://problem/8794397> We should only return true when there is a
- // missingPluginButtonClicked callback defined on the Page UI client.
- return true;
+ if (pluginUnavailabilityReason == RenderEmbeddedObject::PluginMissing || pluginUnavailabilityReason == RenderEmbeddedObject::InsecurePluginVersion) {
+ // FIXME: <rdar://problem/8794397> We should only return true when there is a
+ // missingPluginButtonClicked callback defined on the Page UI client.
+ return true;
+ }
+
+ return false;
}
-void WebChromeClient::missingPluginButtonClicked(Element* element) const
+void WebChromeClient::unavailablePluginButtonClicked(Element* element, RenderEmbeddedObject::PluginUnavailabilityReason pluginUnavailabilityReason) const
{
ASSERT(element->hasTagName(objectTag) || element->hasTagName(embedTag));
+ ASSERT(pluginUnavailabilityReason == RenderEmbeddedObject::PluginMissing || pluginUnavailabilityReason == RenderEmbeddedObject::InsecurePluginVersion);
HTMLPlugInImageElement* pluginElement = static_cast<HTMLPlugInImageElement*>(element);
- m_page->send(Messages::WebPageProxy::MissingPluginButtonClicked(pluginElement->serviceType(), pluginElement->url(), pluginElement->getAttribute(pluginspageAttr)));
+ m_page->send(Messages::WebPageProxy::UnavailablePluginButtonClicked(pluginUnavailabilityReason, pluginElement->serviceType(), pluginElement->url(), pluginElement->getAttribute(pluginspageAttr)));
}
void WebChromeClient::scrollbarsModeDidChange() const
diff --git a/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h b/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h
index 969049fac..59e7688cc 100644
--- a/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h
+++ b/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h
@@ -121,8 +121,8 @@ private:
virtual void contentsSizeChanged(WebCore::Frame*, const WebCore::IntSize&) const OVERRIDE;
virtual void scrollRectIntoView(const WebCore::IntRect&) const OVERRIDE; // Currently only Mac has a non empty implementation.
- virtual bool shouldMissingPluginMessageBeButton() const OVERRIDE;
- virtual void missingPluginButtonClicked(WebCore::Element*) const OVERRIDE;
+ virtual bool shouldUnavailablePluginMessageBeButton(WebCore::RenderEmbeddedObject::PluginUnavailabilityReason) const OVERRIDE;
+ virtual void unavailablePluginButtonClicked(WebCore::Element*, WebCore::RenderEmbeddedObject::PluginUnavailabilityReason) const OVERRIDE;
virtual void scrollbarsModeDidChange() const OVERRIDE;
virtual void mouseDidMoveOverElement(const WebCore::HitTestResult&, unsigned modifierFlags) OVERRIDE;
diff --git a/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp b/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
index 5366cc9f4..36378d4db 100644
--- a/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
+++ b/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
@@ -1317,7 +1317,7 @@ PassRefPtr<Widget> WebFrameLoaderClient::createPlugin(const IntSize&, HTMLPlugIn
}
#endif
- RefPtr<Plugin> plugin = webPage->createPlugin(m_frame, parameters);
+ RefPtr<Plugin> plugin = webPage->createPlugin(m_frame, pluginElement, parameters);
if (!plugin)
return 0;
diff --git a/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebSystemInterface.mm b/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebSystemInterface.mm
index 37a684143..acf19c4bf 100644
--- a/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebSystemInterface.mm
+++ b/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebSystemInterface.mm
@@ -171,6 +171,9 @@ void InitWebCoreSystemInterface(void)
INIT(CGPathAddRoundedRect);
#endif
+#if !defined(BUILDING_ON_SNOW_LEOPARD)
+ INIT(CFURLRequestAllowAllPostCaching);
+#endif
#if PLATFORM(MAC) && !defined(BUILDING_ON_SNOW_LEOPARD) && !defined(BUILDING_ON_LION) && !PLATFORM(IOS)
INIT(FilterIsManagedSession);
INIT(FilterCreateInstance);
diff --git a/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp b/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp
index d710e99ec..ddadcb15f 100644
--- a/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp
+++ b/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp
@@ -705,7 +705,11 @@ void DrawingAreaImpl::setLayerHostingMode(uint32_t opaqueLayerHostingMode)
if (!m_layerTreeHost)
return;
+ LayerTreeContext oldLayerTreeContext = m_layerTreeHost->layerTreeContext();
m_layerTreeHost->setLayerHostingMode(layerHostingMode);
+
+ if (m_layerTreeHost->layerTreeContext() != oldLayerTreeContext)
+ m_webPage->send(Messages::DrawingAreaProxy::UpdateAcceleratedCompositingMode(m_backingStoreStateID, m_layerTreeHost->layerTreeContext()));
}
#endif
diff --git a/Source/WebKit2/WebProcess/WebPage/WebPage.cpp b/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
index 717f67371..413d0d7ab 100644
--- a/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
+++ b/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
@@ -91,6 +91,7 @@
#include <WebCore/FrameView.h>
#include <WebCore/HTMLFormElement.h>
#include <WebCore/HTMLInputElement.h>
+#include <WebCore/HTMLPlugInElement.h>
#include <WebCore/HistoryItem.h>
#include <WebCore/KeyboardEvent.h>
#include <WebCore/MouseEvent.h>
@@ -224,6 +225,9 @@ WebPage::WebPage(uint64_t pageID, const WebPageCreationParameters& parameters)
#if PLATFORM(WIN)
, m_gestureReachedScrollingLimit(false)
#endif
+#if ENABLE(PAGE_VISIBILITY_API)
+ , m_visibilityState(WebCore::PageVisibilityStateVisible)
+#endif
{
ASSERT(m_pageID);
// FIXME: This is a non-ideal location for this Setting and
@@ -382,13 +386,22 @@ void WebPage::initializeInjectedBundleFullScreenClient(WKBundlePageFullScreenCli
}
#endif
-PassRefPtr<Plugin> WebPage::createPlugin(WebFrame* frame, const Plugin::Parameters& parameters)
+PassRefPtr<Plugin> WebPage::createPlugin(WebFrame* frame, HTMLPlugInElement* pluginElement, const Plugin::Parameters& parameters)
{
String pluginPath;
+ bool blocked;
if (!WebProcess::shared().connection()->sendSync(
Messages::WebContext::GetPluginPath(parameters.mimeType, parameters.url.string()),
- Messages::WebContext::GetPluginPath::Reply(pluginPath), 0)) {
+ Messages::WebContext::GetPluginPath::Reply(pluginPath, blocked), 0)) {
+ return 0;
+ }
+
+ if (blocked) {
+ if (pluginElement->renderer()->isEmbeddedObject())
+ toRenderEmbeddedObject(pluginElement->renderer())->setPluginUnavailabilityReason(RenderEmbeddedObject::InsecurePluginVersion);
+
+ send(Messages::WebPageProxy::DidBlockInsecurePluginVersion(parameters.mimeType));
return 0;
}
@@ -3157,7 +3170,28 @@ void WebPage::setVisibilityState(int visibilityState, bool isInitialState)
{
if (!m_page)
return;
- m_page->setVisibilityState(static_cast<WebCore::PageVisibilityState>(visibilityState), isInitialState);
+
+ WebCore::PageVisibilityState state = static_cast<WebCore::PageVisibilityState>(visibilityState);
+
+ if (m_visibilityState == state)
+ return;
+
+ FrameView* view = m_page->mainFrame() ? m_page->mainFrame()->view() : 0;
+
+ if (state == WebCore::PageVisibilityStateVisible) {
+ m_page->didMoveOnscreen();
+ if (view)
+ view->show();
+ }
+
+ m_page->setVisibilityState(state, isInitialState);
+ m_visibilityState = state;
+
+ if (state == WebCore::PageVisibilityStateHidden) {
+ m_page->willMoveOffscreen();
+ if (view)
+ view->hide();
+ }
}
#endif
diff --git a/Source/WebKit2/WebProcess/WebPage/WebPage.h b/Source/WebKit2/WebProcess/WebPage/WebPage.h
index d9d2df72c..d18c401bf 100644
--- a/Source/WebKit2/WebProcess/WebPage/WebPage.h
+++ b/Source/WebKit2/WebProcess/WebPage/WebPage.h
@@ -52,6 +52,9 @@
#include <WebCore/Editor.h>
#include <WebCore/FrameLoaderTypes.h>
#include <WebCore/IntRect.h>
+#if ENABLE(PAGE_VISIBILITY_API)
+#include <WebCore/PageVisibilityState.h>
+#endif
#include <WebCore/PlatformScreen.h>
#include <WebCore/ScrollTypes.h>
#include <WebCore/WebCoreKeyboardUIMode.h>
@@ -100,6 +103,7 @@ namespace WebCore {
class GraphicsContext;
class Frame;
class FrameView;
+ class HTMLPlugInElement;
class KeyboardEvent;
class Page;
class PrintContext;
@@ -253,7 +257,7 @@ public:
WebCore::Frame* mainFrame() const; // May return 0.
WebCore::FrameView* mainFrameView() const; // May return 0.
- PassRefPtr<Plugin> createPlugin(WebFrame*, const Plugin::Parameters&);
+ PassRefPtr<Plugin> createPlugin(WebFrame*, WebCore::HTMLPlugInElement*, const Plugin::Parameters&);
EditorState editorState() const;
@@ -828,6 +832,9 @@ private:
#if PLATFORM(QT)
HashMap<String, QtNetworkReply*> m_applicationSchemeReplies;
#endif
+#if ENABLE(PAGE_VISIBILITY_API)
+ WebCore::PageVisibilityState m_visibilityState;
+#endif
};
} // namespace WebKit
diff --git a/Source/WebKit2/WebProcess/WebPage/ca/LayerTreeHostCA.cpp b/Source/WebKit2/WebProcess/WebPage/ca/LayerTreeHostCA.cpp
index 87e9cedbe..de3a2e38e 100644
--- a/Source/WebKit2/WebProcess/WebPage/ca/LayerTreeHostCA.cpp
+++ b/Source/WebKit2/WebProcess/WebPage/ca/LayerTreeHostCA.cpp
@@ -75,7 +75,7 @@ void LayerTreeHostCA::initialize()
if (m_webPage->hasPageOverlay())
createPageOverlayLayer();
- platformInitialize(m_layerTreeContext);
+ platformInitialize();
setLayerFlushSchedulingEnabled(!m_webPage->drawingArea() || !m_webPage->drawingArea()->layerTreeStateIsFrozen());
scheduleLayerFlush();
diff --git a/Source/WebKit2/WebProcess/WebPage/ca/LayerTreeHostCA.h b/Source/WebKit2/WebProcess/WebPage/ca/LayerTreeHostCA.h
index 64233347d..92ae72674 100644
--- a/Source/WebKit2/WebProcess/WebPage/ca/LayerTreeHostCA.h
+++ b/Source/WebKit2/WebProcess/WebPage/ca/LayerTreeHostCA.h
@@ -58,6 +58,8 @@ protected:
bool m_layerFlushSchedulingEnabled;
+ LayerTreeContext m_layerTreeContext;
+
private:
// LayerTreeHost.
virtual const LayerTreeContext& layerTreeContext();
@@ -80,14 +82,11 @@ private:
virtual void didCommitChangesForLayer(const WebCore::GraphicsLayer*) const { }
// LayerTreeHostCA
- virtual void platformInitialize(LayerTreeContext&) = 0;
+ virtual void platformInitialize() = 0;
void createPageOverlayLayer();
void destroyPageOverlayLayer();
- // The context for this layer tree.
- LayerTreeContext m_layerTreeContext;
-
// Whether the layer tree host is valid or not.
bool m_isValid;
diff --git a/Source/WebKit2/WebProcess/WebPage/ca/mac/LayerTreeHostCAMac.h b/Source/WebKit2/WebProcess/WebPage/ca/mac/LayerTreeHostCAMac.h
index 375f8c6d6..6f6a37965 100644
--- a/Source/WebKit2/WebProcess/WebPage/ca/mac/LayerTreeHostCAMac.h
+++ b/Source/WebKit2/WebProcess/WebPage/ca/mac/LayerTreeHostCAMac.h
@@ -54,7 +54,7 @@ private:
virtual void setLayerHostingMode(LayerHostingMode) OVERRIDE;
// LayerTreeHostCA
- virtual void platformInitialize(LayerTreeContext&);
+ virtual void platformInitialize();
virtual void didPerformScheduledLayerFlush();
virtual bool flushPendingLayerChanges();
diff --git a/Source/WebKit2/WebProcess/WebPage/ca/mac/LayerTreeHostCAMac.mm b/Source/WebKit2/WebProcess/WebPage/ca/mac/LayerTreeHostCAMac.mm
index aeca22445..17ddbbe85 100644
--- a/Source/WebKit2/WebProcess/WebPage/ca/mac/LayerTreeHostCAMac.mm
+++ b/Source/WebKit2/WebProcess/WebPage/ca/mac/LayerTreeHostCAMac.mm
@@ -58,7 +58,7 @@ LayerTreeHostCAMac::~LayerTreeHostCAMac()
ASSERT(!m_layerHostingContext);
}
-void LayerTreeHostCAMac::platformInitialize(LayerTreeContext& layerTreeContext)
+void LayerTreeHostCAMac::platformInitialize()
{
switch (m_webPage->layerHostingMode()) {
case LayerHostingModeDefault:
@@ -70,9 +70,9 @@ void LayerTreeHostCAMac::platformInitialize(LayerTreeContext& layerTreeContext)
break;
#endif
}
- m_layerHostingContext->setRootLayer(rootLayer()->platformLayer());
- layerTreeContext.contextID = m_layerHostingContext->contextID();
+ m_layerHostingContext->setRootLayer(rootLayer()->platformLayer());
+ m_layerTreeContext.contextID = m_layerHostingContext->contextID();
}
void LayerTreeHostCAMac::scheduleLayerFlush()
@@ -169,6 +169,7 @@ void LayerTreeHostCAMac::setLayerHostingMode(LayerHostingMode layerHostingMode)
}
m_layerHostingContext->setRootLayer(rootLayer()->platformLayer());
+ m_layerTreeContext.contextID = m_layerHostingContext->contextID();
scheduleLayerFlush();
}
diff --git a/Source/WebKit2/WebProcess/WebPage/ca/win/LayerTreeHostCAWin.cpp b/Source/WebKit2/WebProcess/WebPage/ca/win/LayerTreeHostCAWin.cpp
index ef3c16a11..b086aa5ae 100644
--- a/Source/WebKit2/WebProcess/WebPage/ca/win/LayerTreeHostCAWin.cpp
+++ b/Source/WebKit2/WebProcess/WebPage/ca/win/LayerTreeHostCAWin.cpp
@@ -89,7 +89,7 @@ LayerTreeHostCAWin::~LayerTreeHostCAWin()
{
}
-void LayerTreeHostCAWin::platformInitialize(LayerTreeContext& context)
+void LayerTreeHostCAWin::platformInitialize()
{
m_view.adoptCF(WKCACFViewCreate(kWKCACFViewDrawingDestinationWindow));
WKCACFViewSetContextUserData(m_view.get(), static_cast<AbstractCACFLayerTreeHost*>(this));
@@ -106,7 +106,7 @@ void LayerTreeHostCAWin::platformInitialize(LayerTreeContext& context)
CGRect bounds = m_webPage->bounds();
WKCACFViewUpdate(m_view.get(), m_window->window(), &bounds);
- context.window = m_window->window();
+ m_layerTreeContext.window = m_window->window();
}
void LayerTreeHostCAWin::invalidate()
diff --git a/Source/WebKit2/WebProcess/WebPage/ca/win/LayerTreeHostCAWin.h b/Source/WebKit2/WebProcess/WebPage/ca/win/LayerTreeHostCAWin.h
index d9d59678a..3d8d88513 100644
--- a/Source/WebKit2/WebProcess/WebPage/ca/win/LayerTreeHostCAWin.h
+++ b/Source/WebKit2/WebProcess/WebPage/ca/win/LayerTreeHostCAWin.h
@@ -64,7 +64,7 @@ private:
virtual void scheduleChildWindowGeometryUpdate(const WindowGeometry&);
// LayerTreeHostCA
- virtual void platformInitialize(LayerTreeContext&);
+ virtual void platformInitialize();
virtual void setRootCompositingLayer(WebCore::GraphicsLayer*);
// AbstractCACFLayerTreeHost
diff --git a/Source/WebKit2/WebProcess/WebPage/mac/WebInspectorMac.mm b/Source/WebKit2/WebProcess/WebPage/mac/WebInspectorMac.mm
index 1fa87957b..48ac886d0 100644
--- a/Source/WebKit2/WebProcess/WebPage/mac/WebInspectorMac.mm
+++ b/Source/WebKit2/WebProcess/WebPage/mac/WebInspectorMac.mm
@@ -28,7 +28,7 @@
#import <WebCore/SoftLinking.h>
-SOFT_LINK_STAGED_FRAMEWORK_OPTIONAL(WebInspector, PrivateFrameworks)
+SOFT_LINK_STAGED_FRAMEWORK_OPTIONAL(WebInspector, PrivateFrameworks, A)
namespace WebKit {
diff --git a/Source/WebKit2/WebProcess/WebProcess.cpp b/Source/WebKit2/WebProcess/WebProcess.cpp
index c435221a7..20d9260b7 100644
--- a/Source/WebKit2/WebProcess/WebProcess.cpp
+++ b/Source/WebKit2/WebProcess/WebProcess.cpp
@@ -764,11 +764,12 @@ WebPageGroupProxy* WebProcess::webPageGroup(const WebPageGroupData& pageGroupDat
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), 0))
+ if (!WebProcess::shared().connection()->sendSync(Messages::WebContext::GetPluginPath(response.mimeType(), response.url().string()), Messages::WebContext::GetPluginPath::Reply(pluginPath, blocked), 0))
return false;
- return !pluginPath.isEmpty();
+ return !blocked && !pluginPath.isEmpty();
}
bool WebProcess::shouldUseCustomRepresentationForResponse(const ResourceResponse& response) const
diff --git a/Source/WebKit2/qt/MainQt.cpp b/Source/WebKit2/qt/MainQt.cpp
index def1b3f2a..97879c928 100644
--- a/Source/WebKit2/qt/MainQt.cpp
+++ b/Source/WebKit2/qt/MainQt.cpp
@@ -27,12 +27,22 @@
#include <QApplication>
#include <stdio.h>
+#if !defined(NDEBUG) && defined(Q_OS_UNIX)
+#include <signal.h>
+#include <unistd.h>
+#endif
namespace WebKit {
Q_DECL_IMPORT int WebProcessMainQt(QGuiApplication*);
Q_DECL_IMPORT void initializeWebKit2Theme();
}
+#if !defined(NDEBUG) && defined(Q_OS_UNIX)
+static void sigcontHandler(int)
+{
+}
+#endif
+
static void messageHandler(QtMsgType type, const char* message)
{
if (type == QtCriticalMsg) {
@@ -50,8 +60,14 @@ int main(int argc, char** argv)
{
#if !defined(NDEBUG) && defined(Q_OS_UNIX)
if (qgetenv("QT_WEBKIT_PAUSE_WEB_PROCESS") == "1" || qgetenv("QT_WEBKIT2_DEBUG") == "1") {
- fprintf(stderr, "Pausing web process, please attach to PID %d and continue... ", getpid());
+ struct sigaction newAction, oldAction;
+ newAction.sa_handler = sigcontHandler;
+ sigemptyset(&newAction.sa_mask);
+ newAction.sa_flags = 0;
+ sigaction(SIGCONT, &newAction, &oldAction);
+ fprintf(stderr, "Pausing UI process, please attach to PID %d and send signal SIGCONT... ", getpid());
pause();
+ sigaction(SIGCONT, &oldAction, 0);
fprintf(stderr, " OK\n");
}
#endif
diff --git a/Source/WebKit2/win/WebKit2.def b/Source/WebKit2/win/WebKit2.def
index 0342c1f45..31848ffd0 100644
--- a/Source/WebKit2/win/WebKit2.def
+++ b/Source/WebKit2/win/WebKit2.def
@@ -178,7 +178,6 @@ 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
- ?hasShadowRoot@Element@WebCore@@QBE_NXZ
?inputTag@HTMLNames@WebCore@@3VQualifiedName@2@B
?instrumentingAgentsForPage@InspectorInstrumentation@WebCore@@CAPAVInstrumentingAgents@2@PAVPage@2@@Z
?isCSSExclusionsEnabled@RuntimeEnabledFeatures@WebCore@@0_NA
@@ -201,7 +200,6 @@ EXPORTS
?paintControlTints@FrameView@WebCore@@AAEXXZ
?placeholderShouldBeVisible@HTMLTextFormControlElement@WebCore@@QBE_NXZ
?rangeFromLocationAndLength@TextIterator@WebCore@@SA?AV?$PassRefPtr@VRange@WebCore@@@WTF@@PAVElement@2@HH_N@Z
- ?removeAllShadowRoots@ElementShadow@WebCore@@QAEXXZ
?remove@String@WTF@@QAEXIH@Z
?reverseFind@StringImpl@WTF@@QAEI_WI@Z
?s_frontendCounter@InspectorInstrumentation@WebCore@@0HA
@@ -255,3 +253,5 @@ EXPORTS
?webkitWillExitFullScreenForElement@Document@WebCore@@QAEXPAVElement@2@@Z
?webkitDidExitFullScreenForElement@Document@WebCore@@QAEXPAVElement@2@@Z
?isPageBoxVisible@Document@WebCore@@QAE_NH@Z
+ ?suspendAnimations@AnimationController@WebCore@@QAEXXZ
+ ?resumeAnimations@AnimationController@WebCore@@QAEXXZ
diff --git a/Source/WebKit2/win/WebKit2CFLite.def b/Source/WebKit2/win/WebKit2CFLite.def
index b6e0f36d4..ac552ae21 100644
--- a/Source/WebKit2/win/WebKit2CFLite.def
+++ b/Source/WebKit2/win/WebKit2CFLite.def
@@ -171,7 +171,6 @@ 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
- ?hasShadowRoot@Element@WebCore@@QBE_NXZ
?inputTag@HTMLNames@WebCore@@3VQualifiedName@2@B
?instrumentingAgentsForPage@InspectorInstrumentation@WebCore@@CAPAVInstrumentingAgents@2@PAVPage@2@@Z
?isCSSExclusionsEnabled@RuntimeEnabledFeatures@WebCore@@0_NA
@@ -194,7 +193,6 @@ EXPORTS
?paintControlTints@FrameView@WebCore@@AAEXXZ
?placeholderShouldBeVisible@HTMLTextFormControlElement@WebCore@@QBE_NXZ
?rangeFromLocationAndLength@TextIterator@WebCore@@SA?AV?$PassRefPtr@VRange@WebCore@@@WTF@@PAVElement@2@HH_N@Z
- ?removeAllShadowRoots@ElementShadow@WebCore@@QAEXXZ
?remove@String@WTF@@QAEXIH@Z
?reverseFind@StringImpl@WTF@@QAEI_WI@Z
?s_frontendCounter@InspectorInstrumentation@WebCore@@0HA
diff --git a/Source/autotools/symbols.filter b/Source/autotools/symbols.filter
index c03385374..d3044ea5e 100644
--- a/Source/autotools/symbols.filter
+++ b/Source/autotools/symbols.filter
@@ -43,7 +43,6 @@ _ZN7WebCore10toDocumentEN3JSC7JSValueE;
_ZN7WebCore10ClientRectC1Ev;
_ZN7WebCore10ClientRectC1ERKNS_7IntRectE;
_ZN7WebCore10ShadowRoot6createEPNS_7ElementERi;
-_ZN7WebCore13ElementShadow20removeAllShadowRootsEv;
_ZN7WebCore11EventTarget17toGeneratedStreamEv;
_ZN7WebCore11EventTarget8toStreamEv;
_ZN7WebCore12TextIterator26rangeFromLocationAndLengthEPNS_7ElementEiib;
@@ -99,7 +98,6 @@ _ZNK7WebCore26HTMLTextFormControlElement26placeholderShouldBeVisibleEv;
_ZNK7WebCore5Frame8settingsEv;
_ZNK7WebCore6JSNode21pushEventHandlerScopeEPN3JSC9ExecStateEPNS1_14ScopeChainNodeE;
_ZNK7WebCore7Element6shadowEv;
-_ZNK7WebCore7Element13hasShadowRootEv;
_ZNK7WebCore8Document4pageEv;
_ZNK7WebCore8Document8settingsEv;
_ZNK7WebCore8Document4viewEv;
@@ -107,6 +105,8 @@ _ZNK7WebCore5Range4textEv;
_ZNK7WebCore9TreeScope14getElementByIdERKN3WTF12AtomicStringE;
_ZNK7WebCore14DocumentMarker11descriptionEv;
_ZN7WebCore8Document16isPageBoxVisibleEi;
+_ZN7WebCore19AnimationController17suspendAnimationsEv;
+_ZN7WebCore19AnimationController16resumeAnimationsEv;
_ZNK7WebCore19InspectorController12getHighlightEPNS_9HighlightE;
_ZN7WebCore24InspectorInstrumentation26instrumentingAgentsForPageEPNS_4PageE;
_ZN7WebCore24InspectorInstrumentation17s_frontendCounterE;
diff --git a/Source/cmake/FindGStreamer-App.cmake b/Source/cmake/FindGStreamer-App.cmake
deleted file mode 100644
index f865f443a..000000000
--- a/Source/cmake/FindGStreamer-App.cmake
+++ /dev/null
@@ -1,34 +0,0 @@
-# - Try to find GStreamer-App
-# Once done, this will define
-#
-# GStreamer-App_FOUND - system has GStreamer
-# GStreamer-App_INCLUDE_DIRS - the GStreamer include directories
-# GStreamer-App_LIBRARIES - link these to use GStreamer
-
-include(LibFindMacros)
-
-# Dependencies
-libfind_package(GStreamer-App GStreamer)
-libfind_package(GStreamer-App GStreamer-Base)
-
-# Use pkg-config to get hints about paths
-libfind_pkg_check_modules(GStreamer-App_PKGCONF gstreamer-app-0.10>=0.10.30)
-
-# Include dir
-find_path(GStreamer-App_INCLUDE_DIR
- NAMES gst/app/gstappsink.h
- PATHS ${GStreamer-App_PKGCONF_INCLUDE_DIRS}
- PATH_SUFFIXES gstreamer-0.10
-)
-
-# Finally the library itself
-find_library(GStreamer-App_LIBRARY
- NAMES gstapp-0.10
- PATHS ${GStreamer-App_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(GStreamer-App_PROCESS_INCLUDES GStreamer-App_INCLUDE_DIR GStreamer_INCLUDE_DIR GStreamer-Base_INCLUDE_DIR)
-set(GStreamer-App_PROCESS_LIBS GStreamer-App_LIBRARY GStreamer_LIBRARIES GStreamer-Base_LIBRARIES)
-libfind_process(GStreamer-App)
diff --git a/Source/cmake/FindGStreamer-Audio.cmake b/Source/cmake/FindGStreamer-Audio.cmake
deleted file mode 100644
index deab926e1..000000000
--- a/Source/cmake/FindGStreamer-Audio.cmake
+++ /dev/null
@@ -1,35 +0,0 @@
-# - Try to find GStreamer-Audio
-# Once done, this will define
-#
-# GStreamer-Audio_FOUND - system has GStreamer-Audio
-# GStreamer-Audio_INCLUDE_DIRS - the GStreamer-Audio include directories
-# GStreamer-Audio_LIBRARIES - link these to use GStreamer-Audio
-
-include(LibFindMacros)
-
-# Dependencies
-libfind_package(GStreamer-Audio GStreamer)
-libfind_package(GStreamer-Audio GStreamer-Base)
-
-# Use pkg-config to get hints about paths
-libfind_pkg_check_modules(GStreamer-Audio_PKGCONF gstreamer-audio-0.10>=0.10.30)
-
-# Include dir
-find_path(GStreamer-Audio_INCLUDE_DIR
- NAMES gst/audio/audio.h
- PATHS ${GStreamer-Audio_PKGCONF_INCLUDE_DIRS}
- PATH_SUFFIXES gstreamer-0.10
-)
-
-# Finally the library itself
-find_library(GStreamer-Audio_LIBRARY
- NAMES gstaudio-0.10
- PATHS ${GStreamer-Audio_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(GStreamer-Audio_PROCESS_INCLUDES GStreamer-Audio_INCLUDE_DIR
-GStreamer_INCLUDE_DIR GStreamer-Base_INCLUDE_DIR)
-set(GStreamer-Audio_PROCESS_LIBS GStreamer-Audio_LIBRARY GStreamer_LIBRARIES GStreamer-Base_LIBRARIES)
-libfind_process(GStreamer-Audio)
diff --git a/Source/cmake/FindGStreamer-Base.cmake b/Source/cmake/FindGStreamer-Base.cmake
deleted file mode 100644
index 4e04b0cae..000000000
--- a/Source/cmake/FindGStreamer-Base.cmake
+++ /dev/null
@@ -1,33 +0,0 @@
-# - Try to find GStreamer-Base
-# Once done, this will define
-#
-# GStreamer-Base_FOUND - system has GStreamer-Base
-# GStreamer-Base_INCLUDE_DIRS - the GStreamer-Base include directories
-# GStreamer-Base_LIBRARIES - link these to use GStreamer-Base
-
-include(LibFindMacros)
-
-# Dependencies
-libfind_package(GStreamer-Base GStreamer)
-
-# Use pkg-config to get hints about paths
-libfind_pkg_check_modules(GStreamer-Base_PKGCONF gstreamer-base-0.10>=0.10.30)
-
-# Include dir
-find_path(GStreamer-Base_INCLUDE_DIR
- NAMES gst/base/gstbasesrc.h
- PATHS ${GStreamer-Base_PKGCONF_INCLUDE_DIRS}
- PATH_SUFFIXES gstreamer-0.10
-)
-
-# Finally the library itself
-find_library(GStreamer-Base_LIBRARY
- NAMES gstbase-0.10
- PATHS ${GStreamer-Base_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(GStreamer-Base_PROCESS_INCLUDES GStreamer-Base_INCLUDE_DIR GStreamer_INCLUDE_DIR)
-set(GStreamer-Base_PROCESS_LIBS GStreamer-Base_LIBRARY GStreamer_LIBRARIES)
-libfind_process(GStreamer-Base)
diff --git a/Source/cmake/FindGStreamer-FFT.cmake b/Source/cmake/FindGStreamer-FFT.cmake
deleted file mode 100644
index 22ce45059..000000000
--- a/Source/cmake/FindGStreamer-FFT.cmake
+++ /dev/null
@@ -1,34 +0,0 @@
-# - Try to find GStreamer-FFT
-# Once done, this will define
-#
-# GStreamer-FFT_FOUND - system has GStreamer-FFT
-# GStreamer-FFT_INCLUDE_DIRS - the GStreamer-FFT include directories
-# GStreamer-FFT_LIBRARIES - link these to use GStreamer-FFT
-
-include(LibFindMacros)
-
-# Dependencies
-libfind_package(GStreamer-FFT GStreamer)
-libfind_package(GStreamer-FFT GStreamer-Base)
-
-# Use pkg-config to get hints about paths
-libfind_pkg_check_modules(GStreamer-FFT_PKGCONF gstreamer-base-0.10>=0.10.30)
-
-# Include dir
-find_path(GStreamer-FFT_INCLUDE_DIR
- NAMES gst/fft/gstfftf32.h
- PATHS ${GStreamer-FFT_PKGCONF_INCLUDE_DIRS}
- PATH_SUFFIXES gstreamer-0.10
-)
-
-# Finally the library itself
-find_library(GStreamer-FFT_LIBRARY
- NAMES gstfft-0.10
- PATHS ${GStreamer-FFT_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(GStreamer-FFT_PROCESS_INCLUDES GStreamer-FFT_INCLUDE_DIR GStreamer_INCLUDE_DIR)
-set(GStreamer-FFT_PROCESS_LIBS GStreamer-FFT_LIBRARY GStreamer_LIBRARIES)
-libfind_process(GStreamer-FFT)
diff --git a/Source/cmake/FindGStreamer-Interfaces.cmake b/Source/cmake/FindGStreamer-Interfaces.cmake
deleted file mode 100644
index 7959c6678..000000000
--- a/Source/cmake/FindGStreamer-Interfaces.cmake
+++ /dev/null
@@ -1,33 +0,0 @@
-# - Try to find GStreamer-Interfaces
-# Once done, this will define
-#
-# GStreamer-Interfaces_FOUND - system has GStreamer-Interfaces
-# GStreamer-Interfaces_INCLUDE_DIRS - the GStreamer-Interfaces include directories
-# GStreamer-Interfaces_LIBRARIES - link these to use GStreamer-Interfaces
-
-include(LibFindMacros)
-
-# Dependencies
-libfind_package(GStreamer-Interfaces GStreamer)
-
-# Use pkg-config to get hints about paths
-libfind_pkg_check_modules(GStreamer-Interfaces_PKGCONF gstreamer-interfaces-0.10>=0.10.30)
-
-# Include dir
-find_path(GStreamer-Interfaces_INCLUDE_DIR
- NAMES gst/interfaces/mixer.h
- PATHS ${GStreamer-Interfaces_PKGCONF_INCLUDE_DIRS}
- PATH_SUFFIXES gstreamer-0.10
-)
-
-# Finally the library itself
-find_library(GStreamer-Interfaces_LIBRARY
- NAMES gstinterfaces-0.10
- PATHS ${GStreamer-Interfaces_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(GStreamer-Interfaces_PROCESS_INCLUDES GStreamer-Interfaces_INCLUDE_DIR GStreamer_INCLUDE_DIR)
-set(GStreamer-Interfaces_PROCESS_LIBS GStreamer-Interfaces_LIBRARY GStreamer_LIBRARIES)
-libfind_process(GStreamer-Interfaces)
diff --git a/Source/cmake/FindGStreamer-Pbutils.cmake b/Source/cmake/FindGStreamer-Pbutils.cmake
deleted file mode 100644
index a1246c8d3..000000000
--- a/Source/cmake/FindGStreamer-Pbutils.cmake
+++ /dev/null
@@ -1,33 +0,0 @@
-# - Try to find GStreamer-Pbutils
-# Once done, this will define
-#
-# GStreamer-Pbutils_FOUND - system has GStreamer-Pbutils
-# GStreamer-Pbutils_INCLUDE_DIRS - the GStreamer-Pbutils include directories
-# GStreamer-Pbutils_LIBRARIES - link these to use GStreamer-Pbutils
-
-include(LibFindMacros)
-
-# Dependencies
-libfind_package(GStreamer-Pbutils GStreamer)
-
-# Use pkg-config to get hints about paths
-libfind_pkg_check_modules(GStreamer-Pbutils_PKGCONF gstreamer-pbutils-0.10>=0.10.30)
-
-# Include dir
-find_path(GStreamer-Pbutils_INCLUDE_DIR
- NAMES gst/pbutils/pbutils.h
- PATHS ${GStreamer-Pbutils_PKGCONF_INCLUDE_DIRS}
- PATH_SUFFIXES gstreamer-0.10
-)
-
-# Finally the library itself
-find_library(GStreamer-Pbutils_LIBRARY
- NAMES gstpbutils-0.10
- PATHS ${GStreamer-Pbutils_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(GStreamer-Pbutils_PROCESS_INCLUDES GStreamer-Pbutils_INCLUDE_DIR GStreamer_INCLUDE_DIR)
-set(GStreamer-Pbutils_PROCESS_LIBS GStreamer-Pbutils_LIBRARY GStreamer_LIBRARY)
-libfind_process(GStreamer-Pbutils)
diff --git a/Source/cmake/FindGStreamer-Plugins-Base.cmake b/Source/cmake/FindGStreamer-Plugins-Base.cmake
deleted file mode 100644
index ee41bb935..000000000
--- a/Source/cmake/FindGStreamer-Plugins-Base.cmake
+++ /dev/null
@@ -1,33 +0,0 @@
-# - Try to find GStreamer-Plugins-Base
-# Once done, this will define
-#
-# GStreamer-Plugins-Base_FOUND - system has GStreamer-Plugins-Base
-# GStreamer-Plugins-Base_INCLUDE_DIRS - the GStreamer-Plugins-Base include directories
-# GStreamer-Plugins-Base_LIBRARIES - link these to use GStreamer-Plugins-Base
-
-include(LibFindMacros)
-
-# Dependencies
-libfind_package(GStreamer-Plugins-Base GStreamer)
-
-# Use pkg-config to get hints about paths
-libfind_pkg_check_modules(GStreamer-Plugins-Base_PKGCONF gstreamer-plugins-base-0.10>=0.10.30)
-
-# Include dir
-find_path(GStreamer-Plugins-Base_INCLUDE_DIR
- NAMES gst/audio/audio.h
- PATHS ${GStreamer-Plugins-Base_PKGCONF_INCLUDE_DIRS}
- PATH_SUFFIXES gstreamer-0.10
-)
-
-# Finally the library itself
-find_library(GStreamer-Plugins-Base_LIBRARY
- NAMES gstreamer-0.10
- PATHS ${GStreamer-Plugins-Base_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(GStreamer-Plugins-Base_PROCESS_INCLUDES GStreamer-Plugins-Base_INCLUDE_DIR GStreamer_INCLUDE_DIR)
-set(GStreamer-Plugins-Base_PROCESS_LIBS GStreamer-Plugins-Base_LIBRARY GStreamer_LIBRARIES)
-libfind_process(GStreamer-Plugins-Base)
diff --git a/Source/cmake/FindGStreamer-Video.cmake b/Source/cmake/FindGStreamer-Video.cmake
deleted file mode 100644
index 64748d26e..000000000
--- a/Source/cmake/FindGStreamer-Video.cmake
+++ /dev/null
@@ -1,34 +0,0 @@
-# - Try to find GStreamer-Video
-# Once done, this will define
-#
-# GStreamer-Video_FOUND - system has GStreamer-Video
-# GStreamer-Video_INCLUDE_DIRS - the GStreamer-Video include directories
-# GStreamer-Video_LIBRARIES - link these to use GStreamer-Video
-
-include(LibFindMacros)
-
-# Dependencies
-libfind_package(GStreamer-Video GStreamer)
-libfind_package(GStreamer-Video GStreamer-Base)
-
-# Use pkg-config to get hints about paths
-libfind_pkg_check_modules(GStreamer-Video_PKGCONF gstreamer-video-0.10>=0.10.30)
-
-# Include dir
-find_path(GStreamer-Video_INCLUDE_DIR
- NAMES gst/video/video.h
- PATHS ${GStreamer-Video_PKGCONF_INCLUDE_DIRS}
- PATH_SUFFIXES gstreamer-0.10
-)
-
-# Finally the library itself
-find_library(GStreamer-Video_LIBRARY
- NAMES gstvideo-0.10
- PATHS ${GStreamer-Video_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(GStreamer-Video_PROCESS_INCLUDES GStreamer-Video_INCLUDE_DIR GStreamer_INCLUDE_DIR GStreamer-Base_INCLUDE_DIR)
-set(GStreamer-Video_PROCESS_LIBS GStreamer-Video_LIBRARY GStreamer_LIBRARIES GStreamer-Base_LIBRARIES)
-libfind_process(GStreamer-Video)
diff --git a/Source/cmake/FindGStreamer.cmake b/Source/cmake/FindGStreamer.cmake
index dbfe45b27..542ebacb1 100644
--- a/Source/cmake/FindGStreamer.cmake
+++ b/Source/cmake/FindGStreamer.cmake
@@ -1,31 +1,132 @@
-# - Try to find GStreamer
+# - Try to find GStreamer and its plugins
# Once done, this will define
#
-# GStreamer_FOUND - system has GStreamer
-# GStreamer_INCLUDE_DIRS - the GStreamer include directories
-# GStreamer_LIBRARIES - link these to use GStreamer
+# GSTREAMER_FOUND - system has GStreamer
+# GSTREAMER_INCLUDE_DIRS - the GStreamer include directories
+# GSTREAMER_LIBRARIES - link these to use GStreamer
+#
+# Additionally, gstreamer-base is always looked for and required, and
+# the following related variables are defined:
+#
+# GSTREAMER_BASE_INCLUDE_DIRS - gstreamer-base's include directory
+# GSTREAMER_BASE_LIBRARIES - link to these to use gstreamer-base
+#
+# Optionally, the COMPONENTS keyword can be passed to FIND_PACKAGE()
+# and GStreamer plugins can be looked for. Currently, the following
+# plugins can be searched, and they define the following variables if
+# found:
+#
+# gstreamer-app: GSTREAMER_APP_INCLUDE_DIRS and GSTREAMER_APP_LIBRARIES
+# gstreamer-audio: GSTREAMER_AUDIO_INCLUDE_DIRS and GSTREAMER_AUDIO_LIBRARIES
+# gstreamer-fft: GSTREAMER_FFT_INCLUDE_DIRS and GSTREAMER_FFT_LIBRARIES
+# gstreamer-interfaces: GSTREAMER_INTERFACES_INCLUDE_DIRS and GSTREAMER_INTERFACES_LIBRARIES
+# gstreamer-pbutils: GSTREAMER_PBUTILS_INCLUDE_DIRS and GSTREAMER_PBUTILS_LIBRARIES
+# gstreamer-video: GSTREAMER_VIDEO_INCLUDE_DIRS and GSTREAMER_VIDEO_LIBRARIES
+#
+# 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)
+
+# The minimum GStreamer version we support.
+SET(GSTREAMER_MINIMUM_VERSION 0.10.30)
+
+# Helper macro to find a GStreamer plugin (or GStreamer itself)
+# _component_prefix is prepended to the _INCLUDE_DIRS and _LIBRARIES variables (eg. "GSTREAMER_AUDIO")
+# _pkgconfig_name is the component's pkg-config name (eg. "gstreamer-0.10", or "gstreamer-video-0.10").
+# _header is the component's header, relative to the gstreamer-0.10 directory (eg. "gst/gst.h").
+# _library is the component's library name (eg. "gstreamer-0.10" or "gstvideo-0.10")
+MACRO(FIND_GSTREAMER_COMPONENT _component_prefix _pkgconfig_name _header _library)
+ # FIXME: The QUIET keyword can be used once we require CMake 2.8.2.
+ PKG_CHECK_MODULES(PC_${_component_prefix} ${_pkgconfig_name})
+
+ FIND_PATH(${_component_prefix}_INCLUDE_DIRS
+ NAMES ${_header}
+ HINTS ${PC_${_component_prefix}_INCLUDE_DIRS} ${PC_${_component_prefix}_INCLUDEDIR}
+ PATH_SUFFIXES gstreamer-0.10
+ )
+
+ FIND_LIBRARY(${_component_prefix}_LIBRARIES
+ NAMES ${_library}
+ HINTS ${PC_${_component_prefix}_LIBRARY_DIRS} ${PC_${_component_prefix}_LIBDIR}
+ )
+ENDMACRO()
+
+# ------------------------
+# 1. Find GStreamer itself
+# ------------------------
+
+# 1.1. Find headers and libraries
+FIND_GSTREAMER_COMPONENT(GSTREAMER gstreamer-0.10 gst/gst.h gstreamer-0.10)
+FIND_GSTREAMER_COMPONENT(GSTREAMER_BASE gstreamer-base-0.10 gst/gst.h gstbase-0.10)
+
+# 1.2. Check GStreamer version
+IF (GSTREAMER_INCLUDE_DIRS)
+ IF (EXISTS "${GSTREAMER_INCLUDE_DIRS}/gst/gstversion.h")
+ FILE (READ "${GSTREAMER_INCLUDE_DIRS}/gst/gstversion.h" GSTREAMER_VERSION_CONTENTS)
+
+ STRING(REGEX MATCH "#define +GST_VERSION_MAJOR +\\(([0-9]+)\\)" _dummy "${GSTREAMER_VERSION_CONTENTS}")
+ SET(GSTREAMER_VERSION_MAJOR "${CMAKE_MATCH_1}")
+
+ STRING(REGEX MATCH "#define +GST_VERSION_MINOR +\\(([0-9]+)\\)" _dummy "${GSTREAMER_VERSION_CONTENTS}")
+ SET(GSTREAMER_VERSION_MINOR "${CMAKE_MATCH_1}")
+
+ STRING(REGEX MATCH "#define +GST_VERSION_MICRO +\\(([0-9]+)\\)" _dummy "${GSTREAMER_VERSION_CONTENTS}")
+ SET(GSTREAMER_VERSION_MICRO "${CMAKE_MATCH_1}")
+
+ SET(GSTREAMER_VERSION "${GSTREAMER_VERSION_MAJOR}.${GSTREAMER_VERSION_MINOR}.${GSTREAMER_VERSION_MICRO}")
+ ENDIF ()
+ENDIF ()
+
+# FIXME: With CMake 2.8.3 we can just pass GSTREAMER_VERSION to FIND_PACKAGE_HANDLE_STARNDARD_ARGS as VERSION_VAR
+# and remove the version check here (GSTREAMER_MINIMUM_VERSION would be passed to FIND_PACKAGE).
+SET(VERSION_OK TRUE)
+IF ("${GSTREAMER_VERSION}" VERSION_LESS "${GSTREAMER_MINIMUM_VERSION}")
+ SET(VERSION_OK FALSE)
+ENDIF ()
-include(LibFindMacros)
+# -------------------------
+# 2. Find GStreamer plugins
+# -------------------------
-# Use pkg-config to get hints about paths
-libfind_pkg_check_modules(GStreamer_PKGCONF gstreamer-0.10>=0.10.30)
+FIND_GSTREAMER_COMPONENT(GSTREAMER_APP gstreamer-app-0.10 gst/app/gstappsink.h gstapp-0.10)
+FIND_GSTREAMER_COMPONENT(GSTREAMER_AUDIO gstreamer-audio-0.10 gst/audio/audio.h gstaudio-0.10)
+FIND_GSTREAMER_COMPONENT(GSTREAMER_FFT gstreamer-fft-0.10 gst/fft/gstfft.h gstfft-0.10)
+FIND_GSTREAMER_COMPONENT(GSTREAMER_INTERFACES gstreamer-interfaces-0.10 gst/interfaces/mixer.h gstinterfaces-0.10)
+FIND_GSTREAMER_COMPONENT(GSTREAMER_PBUTILS gstreamer-pbutils-0.10 gst/pbutils/pbutils.h gstpbutils-0.10)
+FIND_GSTREAMER_COMPONENT(GSTREAMER_VIDEO gstreamer-video-0.10 gst/video/video.h gstvideo-0.10)
-# Include dir
-find_path(GStreamer_INCLUDE_DIR
- NAMES gst/gst.h
- PATHS ${GStreamer_PKGCONF_INCLUDE_DIRS}
- PATH_SUFFIXES gstreamer-0.10
-)
+# ------------------------------------------------
+# 3. Process the COMPONENTS passed to FIND_PACKAGE
+# ------------------------------------------------
+SET(_GSTREAMER_REQUIRED_VARS GSTREAMER_INCLUDE_DIRS GSTREAMER_LIBRARIES VERSION_OK GSTREAMER_BASE_INCLUDE_DIRS GSTREAMER_BASE_LIBRARIES)
-# Finally the library itself
-find_library(GStreamer_LIBRARY
- NAMES gstreamer-0.10
- PATHS ${GStreamer_PKGCONF_LIBRARY_DIRS}
-)
+FOREACH(_component ${GStreamer_FIND_COMPONENTS})
+ SET(_gst_component "GSTREAMER_${_component}")
+ STRING(TOUPPER ${_gst_component} _UPPER_NAME)
-# 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(GStreamer_PROCESS_INCLUDES GStreamer_INCLUDE_DIR)
-set(GStreamer_PROCESS_LIBS GStreamer_LIBRARY)
-libfind_process(GStreamer)
+ LIST(APPEND _GSTREAMER_REQUIRED_VARS ${_UPPER_NAME}_INCLUDE_DIRS ${_UPPER_NAME}_LIBRARIES)
+ENDFOREACH()
+INCLUDE(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(GStreamer DEFAULT_MSG ${_GSTREAMER_REQUIRED_VARS})
diff --git a/Source/cmake/OptionsBlackBerry.cmake b/Source/cmake/OptionsBlackBerry.cmake
index d7cf949ce..a2d83feb5 100644
--- a/Source/cmake/OptionsBlackBerry.cmake
+++ b/Source/cmake/OptionsBlackBerry.cmake
@@ -146,6 +146,7 @@ WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_LEGACY_NOTIFICATIONS ON)
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_LEGACY_WEBKIT_BLOB_BUILDER ON)
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_NOTIFICATIONS ON)
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_ORIENTATION_EVENTS ON)
+WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_PAGE_POPUP ON)
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_PAGE_VISIBILITY_API ON)
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_REPAINT_THROTTLING ON)
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_REQUEST_ANIMATION_FRAME ON)
diff --git a/Source/cmake/OptionsEfl.cmake b/Source/cmake/OptionsEfl.cmake
index 1e35eebb5..983ff65bb 100644
--- a/Source/cmake/OptionsEfl.cmake
+++ b/Source/cmake/OptionsEfl.cmake
@@ -109,24 +109,20 @@ IF (NOT ENABLE_SVG)
ENDIF ()
IF (ENABLE_VIDEO OR ENABLE_WEB_AUDIO)
- FIND_PACKAGE(GStreamer REQUIRED)
- FIND_PACKAGE(GStreamer-App REQUIRED)
- FIND_PACKAGE(GStreamer-Base REQUIRED)
- FIND_PACKAGE(GStreamer-Interfaces REQUIRED)
- FIND_PACKAGE(GStreamer-Pbutils REQUIRED)
- FIND_PACKAGE(GStreamer-Plugins-Base REQUIRED)
- SET(WTF_USE_GSTREAMER 1)
- ADD_DEFINITIONS(-DWTF_USE_GSTREAMER=1)
-ENDIF ()
+ SET(GSTREAMER_COMPONENTS app interfaces pbutils)
+ SET(WTF_USE_GSTREAMER 1)
+ ADD_DEFINITIONS(-DWTF_USE_GSTREAMER=1)
+
+ IF (ENABLE_VIDEO)
+ LIST(APPEND GSTREAMER_COMPONENTS video)
+ ENDIF()
-IF (ENABLE_VIDEO)
- FIND_PACKAGE(GStreamer-Video REQUIRED)
-ENDIF()
+ IF (ENABLE_WEB_AUDIO)
+ LIST(APPEND GSTREAMER_COMPONENTS audio fft)
+ ADD_DEFINITIONS(-DWTF_USE_WEBAUDIO_GSTREAMER=1)
+ ENDIF ()
-IF (ENABLE_WEB_AUDIO)
- FIND_PACKAGE(GStreamer-Audio REQUIRED)
- FIND_PACKAGE(GStreamer-FFT REQUIRED)
- ADD_DEFINITIONS(-DWTF_USE_WEBAUDIO_GSTREAMER=1)
+ FIND_PACKAGE(GStreamer REQUIRED COMPONENTS ${GSTREAMER_COMPONENTS})
ENDIF ()
IF (ENABLE_WEBGL)
diff --git a/Source/cmake/WebKitFeatures.cmake b/Source/cmake/WebKitFeatures.cmake
index 24a15fe7e..41a473db7 100644
--- a/Source/cmake/WebKitFeatures.cmake
+++ b/Source/cmake/WebKitFeatures.cmake
@@ -38,6 +38,7 @@ MACRO (WEBKIT_OPTION_BEGIN)
WEBKIT_OPTION_DEFINE(ENABLE_GLIB_SUPPORT "Toggle Glib support" OFF)
WEBKIT_OPTION_DEFINE(ENABLE_HIGH_DPI_CANVAS "Toggle high-DPI canvas backing store support" OFF)
WEBKIT_OPTION_DEFINE(ENABLE_ICONDATABASE "Toggle Icon database support" ON)
+ WEBKIT_OPTION_DEFINE(ENABLE_IFRAME_SEAMLESS "Toggle iframe seamless attribute support" ON)
WEBKIT_OPTION_DEFINE(ENABLE_IMAGE_DECODER_DOWN_SAMPLING "Toggle image decoder down sampling support" OFF)
WEBKIT_OPTION_DEFINE(ENABLE_INDEXED_DATABASE "Toggle Indexed Database API support" OFF)
WEBKIT_OPTION_DEFINE(ENABLE_INPUT_SPEECH "Toggle Speech Input API support" OFF)
@@ -94,6 +95,7 @@ MACRO (WEBKIT_OPTION_BEGIN)
WEBKIT_OPTION_DEFINE(ENABLE_XSLT "Toggle XSLT support" ON)
WEBKIT_OPTION_DEFINE(USE_SYSTEM_MALLOC "Toggle system allocator instead of TCmalloc" OFF)
WEBKIT_OPTION_DEFINE(USE_TILED_BACKING_STORE "Toggle Tiled Backing Store support" OFF)
+ WEBKIT_OPTION_DEFINE(USE_LEGACY_VIEWPORT_ADAPTION "Toogle legacy viewport adaption" OFF)
WEBKIT_OPTION_DEFINE(USE_WTFURL "Toogle the use of WTFURL for URL parsing" OFF)
ENDMACRO ()
diff --git a/Source/cmakeconfig.h.cmake b/Source/cmakeconfig.h.cmake
index ab5c86d92..a06857dea 100644
--- a/Source/cmakeconfig.h.cmake
+++ b/Source/cmakeconfig.h.cmake
@@ -30,6 +30,7 @@
#cmakedefine01 ENABLE_GEOLOCATION
#cmakedefine01 ENABLE_GLIB_SUPPORT
#cmakedefine01 ENABLE_ICONDATABASE
+#cmakedefine01 ENABLE_IFRAME_SEAMLESS
#cmakedefine01 ENABLE_IMAGE_DECODER_DOWN_SAMPLING
#cmakedefine01 ENABLE_INDEXED_DATABASE
#cmakedefine01 ENABLE_INPUT_TYPE_COLOR
@@ -52,6 +53,7 @@
#cmakedefine01 ENABLE_NOTIFICATIONS
#cmakedefine01 ENABLE_ORIENTATION_EVENTS
#cmakedefine01 ENABLE_OVERFLOW_SCROLLING
+#cmakedefine01 ENABLE_PAGE_POPUP
#cmakedefine01 ENABLE_PAGE_VISIBILITY_API
#cmakedefine01 ENABLE_PROGRESS_TAG
#cmakedefine01 ENABLE_REQUEST_ANIMATION_FRAME
diff --git a/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/garden-o-matic.html b/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/garden-o-matic.html
index 209068a83..83b6bb51d 100644
--- a/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/garden-o-matic.html
+++ b/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/garden-o-matic.html
@@ -44,6 +44,7 @@ James, a web developer from Birmingham, UK.
<link rel="stylesheet" href="styles/failures.css">
<link rel="stylesheet" href="styles/results.css">
<link rel="stylesheet" href="styles/notifications.css">
+<link rel="stylesheet" href="styles/perf.css">
<link rel="stylesheet" href="styles/pixelzoomer.css">
</head>
<body>
@@ -62,6 +63,7 @@ James, a web developer from Birmingham, UK.
<script src="scripts/ui/actions.js"></script>
<script src="scripts/ui/failures.js"></script>
<script src="scripts/ui/notifications.js"></script>
+<script src="scripts/ui/perf.js"></script>
<script src="scripts/ui/results.js"></script>
<script src="scripts/controllers.js"></script>
<script src="scripts/pixelzoomer.js"></script>
diff --git a/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/run-unittests.html b/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/run-unittests.html
index 7bae78f71..ce2e6cd9d 100644
--- a/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/run-unittests.html
+++ b/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/run-unittests.html
@@ -67,6 +67,8 @@ THE POSSIBILITY OF SUCH DAMAGE.
<script src="scripts/model_unittests.js"></script>
<script src="scripts/ui/notifications.js"></script>
<script src="scripts/ui/notifications_unittests.js"></script>
+<script src="scripts/ui/perf.js"></script>
+<script src="scripts/ui/perf_unittests.js"></script>
<script src="scripts/controllers_unittests.js"></script>
<!-- FIXME: We should have tests for these files! -->
diff --git a/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/builders.js b/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/builders.js
index 9d4eff42f..72b8de32c 100644
--- a/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/builders.js
+++ b/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/builders.js
@@ -41,32 +41,18 @@ function urlForBuildInfo(builderName, buildNumber)
return kChromiumBuildBotURL + '/json/builders/' + encodeURIComponent(builderName) + '/builds/' + encodeURIComponent(buildNumber);
}
-function isStepRequredForTestCoverage(step)
-{
- switch(step.name) {
- case kUpdateStepName:
- case kUpdateScriptsStepName:
- case kCompileStepName:
- case kWebKitTestsStepName:
- return true;
- default:
- return false;
- }
-}
-
function didFail(step)
{
if (step.name == kWebKitTestsStepName) {
// run-webkit-tests fails to generate test coverage when it crashes or hangs.
return step.text.indexOf(kCrashedOrHungOutputMarker) != -1;
}
- // FIXME: Is this the correct way to test for failure?
return step.results[0] > 0;
}
-function didFailStepRequredForTestCoverage(buildInfo)
+function failingSteps(buildInfo)
{
- return buildInfo.steps.filter(isStepRequredForTestCoverage).filter(didFail).length > 0;
+ return buildInfo.steps.filter(didFail);
}
function mostRecentCompletedBuildNumber(individualBuilderStatus)
@@ -90,11 +76,19 @@ var g_buildInfoCache = new base.AsynchronousCache(function(key, callback) {
function fetchMostRecentBuildInfoByBuilder(callback)
{
- var buildInfoByBuilder = {};
- var builderNames = Object.keys(config.kBuilders);
- var requestTracker = new base.RequestTracker(builderNames.length, callback, [buildInfoByBuilder]);
net.get(kChromiumBuildBotURL + '/json/builders', function(builderStatus) {
- $.each(builderNames, function(index, builderName) {
+ var buildInfoByBuilder = {};
+ var builderNames = Object.keys(builderStatus);
+ var requestTracker = new base.RequestTracker(builderNames.length, callback, [buildInfoByBuilder]);
+ builderNames.forEach(function(builderName) {
+ // FIXME: Should garden-o-matic show these? I can imagine showing the deps bots being useful at least so
+ // that the gardener only need to look at garden-o-matic and never at the waterfall. Not really sure who
+ // watches the GPU bots.
+ if (builderName.indexOf('GPU') != -1 || builderName.indexOf('deps') != -1) {
+ requestTracker.requestComplete();
+ return;
+ }
+
var buildNumber = mostRecentCompletedBuildNumber(builderStatus[builderName]);
if (!buildNumber) {
buildInfoByBuilder[builderName] = null;
@@ -110,18 +104,40 @@ function fetchMostRecentBuildInfoByBuilder(callback)
});
}
-builders.buildersFailingStepRequredForTestCoverage = function(callback)
+builders.buildersFailingNonLayoutTests = function(callback)
{
fetchMostRecentBuildInfoByBuilder(function(buildInfoByBuilder) {
- var builderNameList = [];
+ var failureList = {};
$.each(buildInfoByBuilder, function(builderName, buildInfo) {
if (!buildInfo)
return;
- if (didFailStepRequredForTestCoverage(buildInfo))
- builderNameList.push(builderName);
+ var failures = failingSteps(buildInfo);
+ if (failures.length)
+ failureList[builderName] = failures.map(function(failure) { return failure.name; });
});
- callback(builderNameList);
+ callback(failureList);
});
};
+builders.perfBuilders = function(callback)
+{
+ fetchMostRecentBuildInfoByBuilder(function(buildInfoByBuilder) {
+ var perfTestMap = {};
+ $.each(buildInfoByBuilder, function(builderName, buildInfo) {
+ if (!buildInfo || builderName.indexOf('Perf') == -1)
+ return;
+ buildInfo.steps.forEach(function(step) {
+ // FIXME: If the compile is broken, grab an older build.
+ // If the compile/update is broken, no steps will have a results url.
+ if (!step.urls.results)
+ return;
+ if (!perfTestMap[step.name])
+ perfTestMap[step.name] = [];
+ perfTestMap[step.name].push({ builder: builderName, url: step.urls.results });
+ });
+ });
+ callback(perfTestMap);
+ });
+}
+
})();
diff --git a/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/builders_unittests.js b/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/builders_unittests.js
index c3c15c940..7259e2819 100644
--- a/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/builders_unittests.js
+++ b/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/builders_unittests.js
@@ -582,7 +582,289 @@ var kExampleBuildInfoWithWebKitTestCrashJSON = {
"times": [1318364210.066524, 1318366408.0732119]
};
-test("buildersFailingStepRequredForTestCoverage", 3, function() {
+var kExamplePerfBuilderStatusJSON = {
+ "Webkit Linux": {
+ "basedir": "Webkit_Linux",
+ "cachedBuilds": [11459, 11460, 11461, 11462],
+ "category": "6webkit linux latest",
+ "currentBuilds": [11462],
+ "pendingBuilds": 0,
+ "slaves": ["vm124-m1"],
+ "state": "building"
+ },
+ "Mac10.6 Perf": {
+ "basedir": "Mac10_6_Perf",
+ "cachedBuilds": [11459, 11460, 11461, 11462],
+ "category": "6webkit linux latest",
+ "currentBuilds": [11461, 11462],
+ "pendingBuilds": 0,
+ "slaves": ["vm124-m1"],
+ "state": "building"
+ },
+};
+
+var kExamplePerfBuildInfoJSON = {
+ "blame": ["abarth@webkit.org"],
+ "builderName": "Mac10.6 Perf",
+ "changes": ["Files:\n Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/main.js\n Tools/ChangeLog\nAt: Thu 04 Aug 2011 00:50:38\nChanged By: abarth@webkit.org\nComments: Fix types. Sadly, main.js has no test coverage. (I need to think\nabout how to test this part of the code.)\n\n* BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/main.js:Properties: \n\n\n", "Files:\n LayoutTests/ChangeLog\n LayoutTests/platform/chromium-mac/fast/box-shadow/inset-box-shadows-expected.png\n LayoutTests/platform/chromium-mac/fast/repaint/shadow-multiple-horizontal-expected.png\n LayoutTests/platform/chromium-mac/fast/repaint/shadow-multiple-strict-horizontal-expected.png\n LayoutTests/platform/chromium-mac/fast/repaint/shadow-multiple-strict-vertical-expected.png\n LayoutTests/platform/chromium-mac/fast/repaint/shadow-multiple-vertical-expected.png\nAt: Thu 04 Aug 2011 00:50:38\nChanged By: abarth@webkit.org\nComments: Update baselines after <http://trac.webkit.org/changeset/92340>.\n\n* platform/chromium-mac/fast/box-shadow/inset-box-shadows-expected.png:\n* platform/chromium-mac/fast/repaint/shadow-multiple-horizontal-expected.png:\n* platform/chromium-mac/fast/repaint/shadow-multiple-strict-horizontal-expected.png:\n* platform/chromium-mac/fast/repaint/shadow-multiple-strict-vertical-expected.png:\n* platform/chromium-mac/fast/repaint/shadow-multiple-vertical-expected.png:Properties: \n\n\n"],
+ "currentStep": null,
+ "eta": null,
+ "logs": [
+ ["stdio", "http://build.chromium.org/p/chromium.webkitbuilders/Webkit%20Linux/builds/11461/steps/update_scripts/logs/stdio"],
+ ["stdio", "http://build.chromium.org/p/chromium.webkitbuilders/Webkit%20Linux/builds/11461/steps/update/logs/stdio"],
+ ["stdio", "http://build.chromium.org/p/chromium.webkitbuilders/Webkit%20Linux/builds/11461/steps/compile/logs/stdio"],
+ ["stdio", "http://build.chromium.org/p/chromium.webkitbuilders/Webkit%20Linux/builds/11461/steps/test_shell_tests/logs/stdio"],
+ ["stdio", "http://build.chromium.org/p/chromium.webkitbuilders/Webkit%20Linux/builds/11461/steps/webkit_unit_tests/logs/stdio"],
+ ["stdio", "http://build.chromium.org/p/chromium.webkitbuilders/Webkit%20Linux/builds/11461/steps/webkit_tests/logs/stdio"],
+ ["stdio", "http://build.chromium.org/p/chromium.webkitbuilders/Webkit%20Linux/builds/11461/steps/archive_webkit_tests_results/logs/stdio"],
+ ["stdio", "http://build.chromium.org/p/chromium.webkitbuilders/Webkit%20Linux/builds/11461/steps/webkit_gpu_tests/logs/stdio"],
+ ["stdio", "http://build.chromium.org/p/chromium.webkitbuilders/Webkit%20Linux/builds/11461/steps/archive_webkit_tests_gpu_results/logs/stdio"]
+ ],
+ "number": 11461,
+ "properties": [
+ ["blamelist", ["abarth@webkit.org"], "Build"],
+ ["branch", "trunk", "Build"],
+ ["buildername", "Webkit Linux", "Build"],
+ ["buildnumber", 11461, "Build"],
+ ["got_revision", "95395", "Source"],
+ ["got_webkit_revision", "92358", "Source"],
+ ["gtest_filter", null, "Factory"],
+ ["mastername", "chromium.webkit", "master.cfg"],
+ ["revision", "92358", "Build"],
+ ["scheduler", "s6_webkit_rel", "Scheduler"],
+ ["slavename", "vm124-m1", "BuildSlave"]
+ ],
+ "reason": "",
+ "requests": [{
+ "builderName": "Webkit Linux",
+ "builds": [11461],
+ "source": {
+ "branch": "trunk",
+ "changes": [{
+ "branch": "trunk",
+ "category": null,
+ "comments": "Fix types. Sadly, main.js has no test coverage. (I need to think\nabout how to test this part of the code.)\n\n* BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/main.js:",
+ "files": ["Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/main.js", "Tools/ChangeLog"],
+ "number": 43707,
+ "properties": [],
+ "repository": "",
+ "revision": "92357",
+ "revlink": "http://trac.webkit.org/changeset/92357",
+ "when": 1312444238.855081,
+ "who": "abarth@webkit.org"
+ }, {
+ "branch": "trunk",
+ "category": null,
+ "comments": "Update baselines after <http://trac.webkit.org/changeset/92340>.\n\n* platform/chromium-mac/fast/box-shadow/inset-box-shadows-expected.png:\n* platform/chromium-mac/fast/repaint/shadow-multiple-horizontal-expected.png:\n* platform/chromium-mac/fast/repaint/shadow-multiple-strict-horizontal-expected.png:\n* platform/chromium-mac/fast/repaint/shadow-multiple-strict-vertical-expected.png:\n* platform/chromium-mac/fast/repaint/shadow-multiple-vertical-expected.png:",
+ "files": ["LayoutTests/ChangeLog", "LayoutTests/platform/chromium-mac/fast/box-shadow/inset-box-shadows-expected.png", "LayoutTests/platform/chromium-mac/fast/repaint/shadow-multiple-horizontal-expected.png", "LayoutTests/platform/chromium-mac/fast/repaint/shadow-multiple-strict-horizontal-expected.png", "LayoutTests/platform/chromium-mac/fast/repaint/shadow-multiple-strict-vertical-expected.png", "LayoutTests/platform/chromium-mac/fast/repaint/shadow-multiple-vertical-expected.png"],
+ "number": 43708,
+ "properties": [],
+ "repository": "",
+ "revision": "92358",
+ "revlink": "http://trac.webkit.org/changeset/92358",
+ "when": 1312444238.855538,
+ "who": "abarth@webkit.org"
+ }],
+ "hasPatch": false,
+ "revision": "92358"
+ },
+ "submittedAt": 1312444298.989818
+ }],
+ "results": 2,
+ "slave": "vm124-m1",
+ "sourceStamp": {
+ "branch": "trunk",
+ "changes": [{
+ "branch": "trunk",
+ "category": null,
+ "comments": "Fix types. Sadly, main.js has no test coverage. (I need to think\nabout how to test this part of the code.)\n\n* BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/main.js:",
+ "files": ["Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/main.js", "Tools/ChangeLog"],
+ "number": 43707,
+ "properties": [],
+ "repository": "",
+ "revision": "92357",
+ "revlink": "http://trac.webkit.org/changeset/92357",
+ "when": 1312444238.855081,
+ "who": "abarth@webkit.org"
+ }, {
+ "branch": "trunk",
+ "category": null,
+ "comments": "Update baselines after <http://trac.webkit.org/changeset/92340>.\n\n* platform/chromium-mac/fast/box-shadow/inset-box-shadows-expected.png:\n* platform/chromium-mac/fast/repaint/shadow-multiple-horizontal-expected.png:\n* platform/chromium-mac/fast/repaint/shadow-multiple-strict-horizontal-expected.png:\n* platform/chromium-mac/fast/repaint/shadow-multiple-strict-vertical-expected.png:\n* platform/chromium-mac/fast/repaint/shadow-multiple-vertical-expected.png:",
+ "files": ["LayoutTests/ChangeLog", "LayoutTests/platform/chromium-mac/fast/box-shadow/inset-box-shadows-expected.png", "LayoutTests/platform/chromium-mac/fast/repaint/shadow-multiple-horizontal-expected.png", "LayoutTests/platform/chromium-mac/fast/repaint/shadow-multiple-strict-horizontal-expected.png", "LayoutTests/platform/chromium-mac/fast/repaint/shadow-multiple-strict-vertical-expected.png", "LayoutTests/platform/chromium-mac/fast/repaint/shadow-multiple-vertical-expected.png"],
+ "number": 43708,
+ "properties": [],
+ "repository": "",
+ "revision": "92358",
+ "revlink": "http://trac.webkit.org/changeset/92358",
+ "when": 1312444238.855538,
+ "who": "abarth@webkit.org"
+ }],
+ "hasPatch": false,
+ "revision": "92358"
+ },
+ "steps": [{
+ "eta": null,
+ "expectations": [
+ ["output", 2297, 2300.6571014083784]
+ ],
+ "isFinished": true,
+ "isStarted": true,
+ "logs": [
+ ["stdio", "http://build.chromium.org/p/chromium.webkitbuilders/Webkit%20Linux/builds/11461/steps/update_scripts/logs/stdio"]
+ ],
+ "name": "update_scripts",
+ "results": [0, []],
+ "statistics": {},
+ "step_number": 0,
+ "text": ["update_scripts"],
+ "times": [1312444299.102834, 1312444309.270324],
+ "urls": {}
+ }, {
+ "eta": null,
+ "expectations": [
+ ["output", 20453, 17580.5002389645]
+ ],
+ "isFinished": true,
+ "isStarted": true,
+ "logs": [
+ ["stdio", "http://build.chromium.org/p/chromium.webkitbuilders/Webkit%20Linux/builds/11461/steps/update/logs/stdio"]
+ ],
+ "name": "update",
+ "results": [0, []],
+ "statistics": {},
+ "step_number": 1,
+ "text": ["update", "r95395", "webkit r92358"],
+ "times": [1312444309.270763, 1312444398.468139],
+ "urls": {}
+ }, {
+ "eta": null,
+ "expectations": [
+ ["output", 17316, 2652.4850499589456]
+ ],
+ "isFinished": true,
+ "isStarted": true,
+ "logs": [
+ ["stdio", "http://build.chromium.org/p/chromium.webkitbuilders/Webkit%20Linux/builds/11461/steps/compile/logs/stdio"]
+ ],
+ "name": "compile",
+ "results": [0, []],
+ "statistics": {},
+ "step_number": 2,
+ "text": ["compile"],
+ "times": [1312444398.46855, 1312444441.68838],
+ "urls": {}
+ }, {
+ "eta": null,
+ "expectations": [
+ ["output", 91980, 92002.12628325251]
+ ],
+ "isFinished": true,
+ "isStarted": true,
+ "logs": [
+ ["stdio", "http://build.chromium.org/p/chromium.webkitbuilders/Webkit%20Linux/builds/11461/steps/test_shell_tests/logs/stdio"]
+ ],
+ "name": "test_shell_tests",
+ "results": [0, []],
+ "statistics": {},
+ "step_number": 3,
+ "text": ["test_shell_tests", "1 disabled", "2 flaky"],
+ "times": [1312444441.688756, 1312444451.74908],
+ "urls": {}
+ }, {
+ "eta": null,
+ "expectations": [
+ ["output", 20772, 20772.638503443086]
+ ],
+ "isFinished": true,
+ "isStarted": true,
+ "logs": [
+ ["stdio", "http://build.chromium.org/p/chromium.webkitbuilders/Webkit%20Linux/builds/11461/steps/webkit_unit_tests/logs/stdio"]
+ ],
+ "name": "webkit_unit_tests",
+ "results": [0, []],
+ "statistics": {},
+ "step_number": 4,
+ "text": ["webkit_unit_tests", "1 disabled"],
+ "times": [1312444451.749574, 1312444452.306143],
+ "urls": {}
+ }, {
+ "eta": null,
+ "expectations": [
+ ["output", 2477406, 2498915.6146275494]
+ ],
+ "isFinished": true,
+ "isStarted": true,
+ "logs": [
+ ["stdio", "http://build.chromium.org/p/chromium.webkitbuilders/Webkit%20Linux/builds/11461/steps/webkit_tests/logs/stdio"]
+ ],
+ "name": "webkit_tests",
+ "results": [2, ["webkit_tests"]],
+ "statistics": {},
+ "step_number": 5,
+ "text": ["webkit_tests", "2014 fixable", "(370 skipped)", "failed 1", "<div class=\"BuildResultInfo\">", "<a href=\"http://test-results.appspot.com/dashboards/flakiness_dashboard.html#master=ChromiumWebkit&tests=fast/box-shadow/box-shadow-clipped-slices.html\">", "<abbr title=\"fast/box-shadow/box-shadow-clipped-slices.html\">box-shadow-clipped-slices.html</abbr>", "</a>", "</div>"],
+ "times": [1312444452.306695, 1312444768.888266],
+ "urls": {}
+ }, {
+ "eta": null,
+ "expectations": [
+ ["output", 2668845, 2672746.372363254]
+ ],
+ "isFinished": true,
+ "isStarted": true,
+ "logs": [
+ ["stdio", "http://build.chromium.org/p/chromium.webkitbuilders/Webkit%20Linux/builds/11461/steps/archive_webkit_tests_results/logs/stdio"]
+ ],
+ "name": "dummy_perf_test_1",
+ "results": [0, []],
+ "statistics": {},
+ "step_number": 6,
+ "text": ["archived webkit_tests results"],
+ "times": [1312444768.888746, 1312444781.444399],
+ "urls": {
+ "results": "http://dummyurl1"
+ }
+ }, {
+ "eta": null,
+ "expectations": [
+ ["output", 210958, 208138.4965182993]
+ ],
+ "isFinished": true,
+ "isStarted": true,
+ "logs": [
+ ["stdio", "http://build.chromium.org/p/chromium.webkitbuilders/Webkit%20Linux/builds/11461/steps/webkit_gpu_tests/logs/stdio"]
+ ],
+ "name": "webkit_gpu_tests",
+ "results": [2, ["webkit_gpu_tests"]],
+ "statistics": {},
+ "step_number": 7,
+ "text": ["webkit_gpu_tests", "148 fixable", "(24 skipped)", "failed 1", "<div class=\"BuildResultInfo\">", "<a href=\"http://test-results.appspot.com/dashboards/flakiness_dashboard.html#master=ChromiumWebkit&tests=compositing/scaling/tiled-layer-recursion.html\">", "<abbr title=\"compositing/scaling/tiled-layer-recursion.html\">tiled-layer-recursion.html</abbr>", "</a>", "</div>"],
+ "times": [1312444781.444903, 1312444966.856074],
+ "urls": {}
+ }, {
+ "eta": null,
+ "expectations": [
+ ["output", 148825, 147822.1074277072]
+ ],
+ "isFinished": true,
+ "isStarted": true,
+ "logs": [
+ ["stdio", "http://build.chromium.org/p/chromium.webkitbuilders/Webkit%20Linux/builds/11461/steps/archive_webkit_tests_gpu_results/logs/stdio"]
+ ],
+ "name": "dummy_perf_test_2",
+ "results": [0, []],
+ "statistics": {},
+ "step_number": 8,
+ "text": ["archived webkit_tests gpu results"],
+ "times": [1312444966.856575, 1312444970.458655],
+ "urls": {
+ "results": "http://dummyurl2"
+ }
+ }],
+ "text": ["failed", "webkit_tests", "webkit_gpu_tests"],
+ "times": [1312444299.10216, 1312444970.459138]
+};
+
+test("buildersFailing", 3, function() {
var simulator = new NetworkSimulator();
var failingBuildInfoJSON = JSON.parse(JSON.stringify(kExampleBuildInfoJSON));
@@ -608,8 +890,16 @@ test("buildersFailingStepRequredForTestCoverage", 3, function() {
};
simulator.runTest(function() {
- builders.buildersFailingStepRequredForTestCoverage(function(builderNameList) {
- deepEqual(builderNameList, ["Webkit Mac10.6"]);
+ builders.buildersFailingNonLayoutTests(function(builderNameList) {
+ deepEqual(builderNameList, {
+ "Webkit Linux": [
+ "webkit_gpu_tests"
+ ],
+ "Webkit Mac10.6": [
+ "compile",
+ "webkit_gpu_tests"
+ ]
+ });
});
});
@@ -620,7 +910,7 @@ test("buildersFailingStepRequredForTestCoverage", 3, function() {
]);
});
-test("buildersFailingStepRequredForTestCoverage (run-webkit-tests crash)", 3, function() {
+test("buildersFailing (run-webkit-tests crash)", 3, function() {
var simulator = new NetworkSimulator();
var builderStatusJSON = JSON.parse(JSON.stringify(kExampleBuilderStatusJSON));
@@ -648,8 +938,16 @@ test("buildersFailingStepRequredForTestCoverage (run-webkit-tests crash)", 3, fu
};
simulator.runTest(function() {
- builders.buildersFailingStepRequredForTestCoverage(function(builderNameList) {
- deepEqual(builderNameList, ["Webkit Linux"]);
+ builders.buildersFailingNonLayoutTests(function(builderNameList) {
+ deepEqual(builderNameList, {
+ "Webkit Linux": [
+ "extract_build",
+ "webkit_tests",
+ "archive_webkit_tests_results",
+ "webkit_gpu_tests",
+ "archive_webkit_tests_gpu_results"
+ ]
+ });
});
});
@@ -659,4 +957,43 @@ test("buildersFailingStepRequredForTestCoverage (run-webkit-tests crash)", 3, fu
]);
});
+test("builders.perfBuilders", 2, function() {
+ var simulator = new NetworkSimulator();
+ var builderStatusJSON = JSON.parse(JSON.stringify(kExamplePerfBuilderStatusJSON));
+ var failingBuildInfoJSON = JSON.parse(JSON.stringify(kExamplePerfBuildInfoJSON));
+
+ var requestedURLs = [];
+ simulator.get = function(url, callback)
+ {
+ requestedURLs.push(url);
+ simulator.scheduleCallback(function() {
+ if (/\/json\/builders$/.exec(url))
+ callback(builderStatusJSON);
+ else if (/Mac10.6%20Perf/.exec(url))
+ callback(failingBuildInfoJSON);
+ else
+ callback();
+ });
+ };
+
+ simulator.runTest(function() {
+ builders.perfBuilders(function(builderNameList) {
+ deepEqual(builderNameList, {
+ "dummy_perf_test_1": [
+ {
+ "builder": "Mac10.6 Perf",
+ "url": "http://dummyurl1"
+ }
+ ],
+ "dummy_perf_test_2": [
+ {
+ "builder": "Mac10.6 Perf",
+ "url": "http://dummyurl2"
+ }
+ ]
+ });
+ });
+ });
+});
+
})();
diff --git a/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/config.js b/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/config.js
index 8f5059cbc..39ae71372 100644
--- a/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/config.js
+++ b/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/config.js
@@ -44,15 +44,6 @@ config.kBuilders = {
'Webkit Mac10.7': {version: 'lion'},
};
-config.kBuildersThatOnlyCompile = [
- 'Webkit Win Builder',
- 'Webkit Win Builder (dbg)',
- // FIXME: Where is the Linux Builder?
- 'Webkit Mac Builder',
- 'Webkit Mac Builder (dbg)',
- 'Win Builder',
-];
-
config.kTracURL = 'http://trac.webkit.org';
config.kBugzillaURL = 'https://bugs.webkit.org';
config.kLocalServerURL = 'http://127.0.0.1:8127';
diff --git a/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/controllers.js b/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/controllers.js
index 4f95f57a8..3dacd28e8 100644
--- a/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/controllers.js
+++ b/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/controllers.js
@@ -287,9 +287,13 @@ controllers.FailingBuilders = base.extends(Object, {
this._message = message;
this._notification = null;
},
- update: function(builderNameList)
+ hasFailures: function()
{
- if (builderNameList.length == 0) {
+ return !!this._notification;
+ },
+ update: function(failuresList)
+ {
+ if (Object.keys(failuresList).length == 0) {
if (this._notification) {
this._notification.dismiss();
this._notification = null;
@@ -302,7 +306,7 @@ controllers.FailingBuilders = base.extends(Object, {
}
// FIXME: We should provide regression ranges for the failing builders.
// This doesn't seem to happen often enough to worry too much about that, however.
- this._notification.setFailingBuilders(builderNameList);
+ this._notification.setFailingBuilders(failuresList);
}
});
diff --git a/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/controllers_unittests.js b/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/controllers_unittests.js
index 55b8d4a11..89f4c939f 100644
--- a/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/controllers_unittests.js
+++ b/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/controllers_unittests.js
@@ -73,4 +73,34 @@ test("UnexpectedFailures", 3, function() {
});
});
+test("controllers.FailingBuilders", 3, function() {
+ var MockView = base.extends('div', {
+ add: function(node) {
+ this.appendChild(node);
+ }
+ })
+ var view = new MockView();
+ var failingBuilders = new controllers.FailingBuilders(view, 'dummy message');
+ ok(!failingBuilders.hasFailures());
+
+ failingBuilders.update({'DummyBuilder': ['webkit_tests']});
+ ok(failingBuilders.hasFailures());
+
+ equal(view.outerHTML, '<div>' +
+ '<li style="opacity: 0; ">' +
+ '<div class="how"><time class="relative"></time></div>' +
+ '<div class="what">' +
+ '<div class="problem">dummy message:' +
+ '<ul class="effects">' +
+ '<li class="builder"><a class="failing-builder" target="_blank" href="http://build.chromium.org/p/chromium.webkit/waterfall?builder=DummyBuilder">' +
+ '<span class="version">DummyBuilder</span><span class="failures"> webkit_tests</span></a>' +
+ '</li>' +
+ '</ul>' +
+ '</div>' +
+ '<ul class="causes"></ul>' +
+ '</div>' +
+ '</li>' +
+ '</div>')
+});
+
})();
diff --git a/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/garden-o-matic.js b/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/garden-o-matic.js
index d0609f5c0..7772826cc 100644
--- a/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/garden-o-matic.js
+++ b/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/garden-o-matic.js
@@ -34,20 +34,35 @@ var g_buildersFailing = null;
var g_unexpectedFailuresController = null;
var g_failuresController = null;
-var g_losingTestCoverageBuilders = null;
+var g_nonLayoutTestFailureBuilders = null;
+
+function updatePartyTime()
+{
+ if (!g_unexpectedFailuresController.length() && !g_nonLayoutTestFailureBuilders.hasFailures())
+ $('#onebar').addClass('partytime');
+ else
+ $('#onebar').removeClass('partytime');
+}
function update()
{
if (g_revisionHint)
g_revisionHint.dismiss();
+ var gtestIframe = document.querySelector('#chromium-gtests iframe');
+ if (gtestIframe)
+ gtestIframe.src = gtestIframe.src;
+
// FIXME: This should be a button with a progress element.
var numberOfTestsAnalyzed = 0;
var updating = new ui.notifications.Info('Loading commit data ...');
g_info.add(updating);
- builders.buildersFailingStepRequredForTestCoverage(g_losingTestCoverageBuilders.update.bind(g_losingTestCoverageBuilders));
+ builders.buildersFailingNonLayoutTests(function(failuresList) {
+ g_nonLayoutTestFailureBuilders.update(failuresList);
+ updatePartyTime();
+ });
base.callInParallel([model.updateRecentCommits, model.updateResultsByBuilder], function() {
if (g_failuresController)
@@ -59,10 +74,7 @@ function update()
updating.update('Analyzing test failures ... ' + ++numberOfTestsAnalyzed + ' tests analyzed.');
g_unexpectedFailuresController.update(failureAnalysis);
}, function() {
- if (!g_unexpectedFailuresController.length())
- $('#onebar').addClass('partytime');
- else
- $('#onebar').removeClass('partytime');
+ updatePartyTime();
g_unexpectedFailuresController.purge();
updating.dismiss();
@@ -86,7 +98,6 @@ $(document).ready(function() {
showResults: function(resultsView)
{
var resultsContainer = onebar.results();
- console.log(resultsContainer);
$(resultsContainer).empty().append(resultsView);
onebar.select('results');
}
@@ -96,7 +107,7 @@ $(document).ready(function() {
g_unexpectedFailuresController = new controllers.UnexpectedFailures(model.state, unexpectedFailuresView, onebarController);
g_info = new ui.notifications.Stream();
- g_losingTestCoverageBuilders = new controllers.FailingBuilders(g_info, 'Losing test coverage');
+ g_nonLayoutTestFailureBuilders = new controllers.FailingBuilders(g_info, 'Non-layout test failures');
// FIXME: This should be an Action object.
var updateButton = document.body.insertBefore(document.createElement('button'), document.body.firstChild);
@@ -115,6 +126,8 @@ $(document).ready(function() {
expected.appendChild(failuresView);
}
+ onebar.perf().appendChild(new ui.perf.View());
+
update();
});
diff --git a/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui.js b/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui.js
index 42a64b56e..b2930ff81 100644
--- a/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui.js
+++ b/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui.js
@@ -71,15 +71,19 @@ ui.onebar = base.extends('div', {
'<li><a href="#unexpected">Unexpected Failures</a></li>' +
'<li><a href="#expected">Expected Failures</a></li>' +
'<li><a href="#results">Results</a></li>' +
+ '<li><a href="#perf">perf</a></li>' +
'</ul>' +
'<div id="unexpected"></div>' +
'<div id="expected"></div>' +
- '<div id="results"></div>';
+ '<div id="results"></div>' +
+ '<div id="perf"></div>';
this._tabNames = [
'unexpected',
'expected',
'results',
+ 'perf',
]
+
this._tabIndexToSavedScrollOffset = {};
this._tabs = $(this).tabs({
disabled: [2],
@@ -153,6 +157,10 @@ ui.onebar = base.extends('div', {
{
return this.tabNamed('results');
},
+ perf: function()
+ {
+ return this.tabNamed('perf');
+ },
_selectInternal: function(tabName) {
var tabIndex = this._tabNames.indexOf(tabName);
this._tabs.tabs('enable', tabIndex);
diff --git a/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui/failures.js b/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui/failures.js
index d3d631a66..2c53bfc1b 100644
--- a/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui/failures.js
+++ b/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui/failures.js
@@ -31,17 +31,23 @@ ui.failures = ui.failures || {};
var kBuildingResult = 'BUILDING';
ui.failures.Builder = base.extends('a', {
- init: function(builderName)
+ init: function(builderName, failures)
{
var configuration = config.kBuilders[builderName];
- if (configuration.version)
- this._addSpan('version', configuration.version);
- if (configuration.is64bit)
- this._addSpan('architecture', '64-bit');
- this._configuration = configuration;
+ if (configuration) {
+ if (configuration.version)
+ this._addSpan('version', configuration.version);
+ if (configuration.is64bit)
+ this._addSpan('architecture', '64-bit');
+ this._configuration = configuration;
+ } else
+ this._addSpan('version', builderName);
+
this.className = 'failing-builder';
this.target = '_blank';
this.href = ui.displayURLForBuilder(builderName);
+ if (failures)
+ this._addSpan('failures', ' ' + failures.join(', '));
},
_addSpan: function(className, text)
{
@@ -51,7 +57,7 @@ ui.failures.Builder = base.extends('a', {
},
equals: function(configuration)
{
- return this._configuration.is64bit == configuration.is64bit && this._configuration.version == configuration.version;
+ return this._configuration && this._configuration.is64bit == configuration.is64bit && this._configuration.version == configuration.version;
}
});
diff --git a/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui/failures_unittests.js b/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui/failures_unittests.js
index 4a9661394..7e5197e63 100644
--- a/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui/failures_unittests.js
+++ b/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui/failures_unittests.js
@@ -27,19 +27,15 @@
module('ui.failures');
-test('Builder', 7, function() {
- raises(function() {
- new ui.failures.Builder();
- });
-
+test('Builder', 6, function() {
var configuration;
- configuration = new ui.failures.Builder("Webkit Linux");
+ configuration = new ui.failures.Builder("Webkit Linux", ["update", "webkit_tests"]);
deepEqual(Object.getOwnPropertyNames(configuration.__proto__).sort(), [
'_addSpan',
'equals',
'init',
]);
- equal(configuration.outerHTML, '<a class="failing-builder" target="_blank" href="http://build.chromium.org/p/chromium.webkit/waterfall?builder=Webkit+Linux"><span class="version">lucid</span><span class="architecture">64-bit</span></a>');
+ equal(configuration.outerHTML, '<a class="failing-builder" target="_blank" href="http://build.chromium.org/p/chromium.webkit/waterfall?builder=Webkit+Linux"><span class="version">lucid</span><span class="architecture">64-bit</span><span class="failures"> update, webkit_tests</span></a>');
configuration = new ui.failures.Builder("Webkit Win");
equal(configuration.outerHTML, '<a class="failing-builder" target="_blank" href="http://build.chromium.org/p/chromium.webkit/waterfall?builder=Webkit+Win"><span class="version">xp</span></a>');
configuration._addSpan('foo', 'bar');
diff --git a/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui/notifications.js b/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui/notifications.js
index ef713c264..572082e4d 100644
--- a/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui/notifications.js
+++ b/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui/notifications.js
@@ -243,12 +243,12 @@ ui.notifications.BuildersFailing = base.extends(ui.notifications.Failure, {
{
this._problem.insertBefore(document.createTextNode(message + ':'), this._problem.firstChild);
},
- setFailingBuilders: function(builderNameList)
+ setFailingBuilders: function(failuresList)
{
- $(this._effects).empty().append(builderNameList.map(function(builderName) {
+ $(this._effects).empty().append(Object.keys(failuresList).map(function(builderName) {
var effect = document.createElement('li');
effect.className = 'builder';
- effect.appendChild(new ui.failures.Builder(builderName));
+ effect.appendChild(new ui.failures.Builder(builderName, failuresList[builderName]));
return effect;
}));
}
diff --git a/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui/notifications_unittests.js b/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui/notifications_unittests.js
index 241085f6e..6c6a18c05 100644
--- a/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui/notifications_unittests.js
+++ b/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui/notifications_unittests.js
@@ -318,7 +318,7 @@ test('FailingTestsSummary (grouping)', 1, function() {
test('BuildersFailing', 1, function() {
var builderFailing = new ui.notifications.BuildersFailing('Disasterifying');
- builderFailing.setFailingBuilders(['Webkit Linux', 'Webkit Vista']);
+ builderFailing.setFailingBuilders({'Webkit Linux': ['compile'], 'Webkit Vista': ['webkit_tests', 'update']);
equal(builderFailing.innerHTML,
'<div class="how">' +
'<time class="relative"></time>' +
diff --git a/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui/perf.js b/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui/perf.js
new file mode 100644
index 000000000..ec6e7e570
--- /dev/null
+++ b/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui/perf.js
@@ -0,0 +1,118 @@
+/*
+ * 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.
+ */
+
+var ui = ui || {};
+ui.perf = ui.perf || {};
+
+(function(){
+
+ui.perf.Picker = base.extends('select', {
+ init: function(items, onChange, opt_values)
+ {
+ this.onchange = onChange;
+ this._values = opt_values;
+ items.forEach(this._appendItem.bind(this));
+ },
+ _appendItem: function(item, index)
+ {
+ var option = document.createElement('option');
+ option.innerHTML = item;
+ if (this._values)
+ option.value = this._values[index];
+ this.appendChild(option);
+ }
+});
+
+ui.perf.View = base.extends('div', {
+ init: function()
+ {
+ this.id = 'perf-view';
+ builders.perfBuilders(this.loadGraphs.bind(this));
+
+ var stream = new ui.notifications.Stream();
+ var notifications = document.createElement()
+ this._notification = ui.notifications.Info("Loading list of perf dashboards...");
+ stream.appendChild(this._notification);
+ this.appendChild(stream);
+ },
+ loadGraphs: function(graphData)
+ {
+ this._notification.dismiss();
+
+ // FIXME: Add next/previous buttons for easy navigation through all the graphs.
+ // FIXME: Also, show the list of failing perf builders along with which steps are failing.
+ this._data = graphData;
+
+ this._titleBar = document.createElement('div');
+ this._titleBar.className = 'title-bar';
+ this.appendChild(this._titleBar);
+
+ var testSuites = Object.keys(graphData);
+ var suitePicker = new ui.perf.Picker(testSuites, this._updateBuilderPicker.bind(this));
+ this._titleBar.appendChild(suitePicker);
+
+ this._suitePicker = suitePicker;
+ this._updateBuilderPicker();
+ },
+ _updateBuilderPicker: function()
+ {
+ if (this._builderPicker)
+ this._titleBar.removeChild(this._builderPicker);
+
+ var selectedSuite = this._suitePicker[this._suitePicker.selectedIndex].text;
+ var builders = [];
+ var urls = [];
+ this._data[selectedSuite].forEach(function(config) {
+ builders.push(config.builder);
+ urls.push(config.url);
+ });
+ this._builderPicker = new ui.perf.Picker(builders, this._displayGraph.bind(this), urls);
+ this._titleBar.appendChild(this._builderPicker);
+
+ this._displayGraph();
+ },
+ _displayGraph: function() {
+ var popOutLink = this.querySelector('.pop-out');
+ if (!popOutLink) {
+ popOutLink = document.createElement('a');
+ popOutLink.className = 'pop-out';
+ popOutLink.textContent = 'Pop out';
+ popOutLink.target = '_blank';
+ this._titleBar.appendChild(popOutLink);
+ }
+
+ var graph = this.querySelector('iframe');
+ if (!graph) {
+ graph = document.createElement('iframe');
+ this.appendChild(graph);
+ }
+
+ var url = this._builderPicker[this._builderPicker.selectedIndex].value;
+ popOutLink.href = url;
+ graph.src = url;
+ }
+});
+
+})();
diff --git a/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui/perf_unittests.js b/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui/perf_unittests.js
new file mode 100644
index 000000000..302ae4443
--- /dev/null
+++ b/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui/perf_unittests.js
@@ -0,0 +1,131 @@
+/*
+ * 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.
+ */
+
+(function () {
+
+module('ui.perf');
+
+var kDummyPerfGraphData = {
+ "dummy_perf_test_1": [
+ {
+ "builder": "Mac10.6 Perf",
+ "url": "http://dummyurl1"
+ }
+ ],
+ "dummy_perf_test_2": [
+ {
+ "builder": "Mac10.6 Perf",
+ "url": "http://dummyurl2"
+ },
+ {
+ "builder": "Linux Perf",
+ "url": "http://dummyurl3"
+ }
+ ]
+};
+
+asyncTest("builders.perfBuilders", 4, function() {
+ var oldPerfBuilders = builders.perfBuilders;
+ builders.perfBuilders = function(callback) {
+ setTimeout(function() { callback(kDummyPerfGraphData) }, 0);
+ }
+
+ var view = new ui.perf.View();
+
+ setTimeout(function() {
+ equal(view.outerHTML, '<div id="perf-view">' +
+ '<ol class="notifications">' +
+ '<li style="opacity: 0; ">' +
+ '<div class="how"></div><div class="what">Loading list of perf dashboards...</div>' +
+ '</li>' +
+ '</ol>' +
+ '<div class="title-bar">' +
+ '<select><option>dummy_perf_test_1</option><option>dummy_perf_test_2</option></select>' +
+ '<select><option value="http://dummyurl1">Mac10.6 Perf</option></select>' +
+ '<a class="pop-out" target="_blank" href="http://dummyurl1">Pop out</a>' +
+ '</div>' +
+ '<iframe src="http://dummyurl1"></iframe>' +
+ '</div>');
+
+ var suiteSelector = view.querySelectorAll('select')[0];
+ suiteSelector.selectedIndex = 1;
+ view._updateBuilderPicker();
+
+ equal(view.outerHTML, '<div id="perf-view">' +
+ '<ol class="notifications">' +
+ '<li style="opacity: 0; ">' +
+ '<div class="how"></div><div class="what">Loading list of perf dashboards...</div>' +
+ '</li>' +
+ '</ol>' +
+ '<div class="title-bar">' +
+ '<select><option>dummy_perf_test_1</option><option>dummy_perf_test_2</option></select>' +
+ '<a class="pop-out" target="_blank" href="http://dummyurl2">Pop out</a>' +
+ '<select><option value="http://dummyurl2">Mac10.6 Perf</option><option value="http://dummyurl3">Linux Perf</option></select>' +
+ '</div>' +
+ '<iframe src="http://dummyurl2"></iframe>' +
+ '</div>');
+
+ var builderSelector = view.querySelectorAll('select')[1];
+ builderSelector.selectedIndex = 1;
+ view._displayGraph();
+
+ equal(view.outerHTML, '<div id="perf-view">' +
+ '<ol class="notifications">' +
+ '<li style="opacity: 0; ">' +
+ '<div class="how"></div><div class="what">Loading list of perf dashboards...</div>' +
+ '</li>' +
+ '</ol>' +
+ '<div class="title-bar">' +
+ '<select><option>dummy_perf_test_1</option><option>dummy_perf_test_2</option></select>' +
+ '<a class="pop-out" target="_blank" href="http://dummyurl3">Pop out</a>' +
+ '<select><option value="http://dummyurl2">Mac10.6 Perf</option><option value="http://dummyurl3">Linux Perf</option></select>' +
+ '</div>' +
+ '<iframe src="http://dummyurl3"></iframe>' +
+ '</div>');
+
+ var suiteSelector = view.querySelectorAll('select')[0];
+ suiteSelector.selectedIndex = 0;
+ view._updateBuilderPicker();
+
+ equal(view.outerHTML, '<div id="perf-view">' +
+ '<ol class="notifications">' +
+ '<li style="opacity: 0; ">' +
+ '<div class="how"></div><div class="what">Loading list of perf dashboards...</div>' +
+ '</li>' +
+ '</ol>' +
+ '<div class="title-bar">' +
+ '<select><option>dummy_perf_test_1</option><option>dummy_perf_test_2</option></select>' +
+ '<a class="pop-out" target="_blank" href="http://dummyurl1">Pop out</a>' +
+ '<select><option value="http://dummyurl1">Mac10.6 Perf</option></select>' +
+ '</div>' +
+ '<iframe src="http://dummyurl1"></iframe>' +
+ '</div>');
+
+ builders.perfBuilders = oldPerfBuilders;
+ start();
+ }, 0);
+});
+
+})();
diff --git a/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui_unittests.js b/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui_unittests.js
index 1b815b8e5..cd18e8888 100644
--- a/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui_unittests.js
+++ b/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui_unittests.js
@@ -58,10 +58,12 @@ test("ui.onebar", 3, function() {
'<li class="ui-state-default ui-corner-top ui-tabs-selected ui-state-active"><a href="#unexpected">Unexpected Failures</a></li>' +
'<li class="ui-state-default ui-corner-top"><a href="#expected">Expected Failures</a></li>' +
'<li class="ui-state-default ui-corner-top ui-state-disabled"><a href="#results">Results</a></li>' +
+ '<li class="ui-state-default ui-corner-top"><a href="#perf">perf</a></li>' +
'</ul>' +
'<div id="unexpected" class="ui-tabs-panel ui-widget-content ui-corner-bottom"></div>' +
'<div id="expected" class="ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide"></div>' +
- '<div id="results" class="ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide"></div>');
+ '<div id="results" class="ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide"></div>' +
+ '<div id="perf" class="ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide"></div>');
onebar.select('expected');
equal(window.location.hash, '#expected');
diff --git a/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/styles/onebar.css b/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/styles/onebar.css
index 2b606eed1..e0ddce226 100644
--- a/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/styles/onebar.css
+++ b/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/styles/onebar.css
@@ -48,3 +48,18 @@
#onebar.partytime #unexpected {
background: url(../images/partytime.gif) center center no-repeat;
}
+
+#chromium-gtests iframe {
+ border: 0;
+ height: 20px;
+}
+
+#chromium-gtests {
+ position: absolute;
+ top: 10px;
+ right: 5px;
+}
+
+#gtest-label {
+ vertical-align: top;
+}
diff --git a/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/styles/perf.css b/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/styles/perf.css
new file mode 100644
index 000000000..936358c40
--- /dev/null
+++ b/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/styles/perf.css
@@ -0,0 +1,47 @@
+/*
+ * 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.
+ */
+
+#perf-view {
+ height: 100%;
+}
+
+#perf-view > .title-bar {
+ height: 2em;
+}
+
+#perf-view > .notifications {
+ margin: 0;
+}
+
+#perf-view .pop-out {
+ float: right;
+}
+
+#perf-view > iframe {
+ width: 100%;
+ border: 0;
+ /* FIXME: Add perf-dashboard-side postMessage calls so the iframe can size to it's contents. */
+ height: -webkit-calc(100% - 2em);
+} \ No newline at end of file
diff --git a/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/styles/results.css b/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/styles/results.css
index 869ca64a7..ae6d18d1c 100644
--- a/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/styles/results.css
+++ b/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/styles/results.css
@@ -143,10 +143,12 @@ html, body, #onebar, .results-view, .test-selector {
height: 100%;
}
-#results {
+#results, #perf {
/* FIXME: We really should use flexbox so we don't have to do this. But that requires restructuring the DOM a bit. */;
height: -webkit-calc(100% - 39px);
box-sizing: border-box;
+ /* Position relative so that nested percentages size to this element. */
+ position: relative;
}
/*** status console ***/
diff --git a/Tools/ChangeLog b/Tools/ChangeLog
index 129d161d0..126ebe7b7 100644
--- a/Tools/ChangeLog
+++ b/Tools/ChangeLog
@@ -1,3 +1,1646 @@
+2012-05-10 Ojan Vafai <ojan@chromium.org>
+
+ Add a perf tab to garden-o-matic
+ https://bugs.webkit.org/show_bug.cgi?id=86169
+
+ Reviewed by Dimitri Glazkov.
+
+ This is a first stab at making it easier to view the Chromium WebKit canary
+ perf graphs. For now, it's just a couple select elements and an iframe.
+
+ * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/garden-o-matic.html:
+ * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/run-unittests.html:
+ * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/builders.js:
+ * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/builders_unittests.js:
+ * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/garden-o-matic.js:
+ * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui.js:
+ * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui/perf.js: Added.
+ * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui/perf_unittests.js: Added.
+ * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui_unittests.js:
+ * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/styles/perf.css: Added.
+ * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/styles/results.css:
+
+2012-05-10 Gyuyoung Kim <gyuyoung.kim@samsung.com>
+
+ Move resumeAnimations to use Internals interface
+ https://bugs.webkit.org/show_bug.cgi?id=86063
+
+ Reviewed by Alexey Proskuryakov.
+
+ Remove resumeAnimations functions, because it is able to work in the
+ cross-port way through the Internals interface.
+
+ * DumpRenderTree/LayoutTestController.cpp:
+ (LayoutTestController::staticFunctions):
+ * DumpRenderTree/LayoutTestController.h:
+ (LayoutTestController):
+ * DumpRenderTree/blackberry/LayoutTestControllerBlackBerry.cpp:
+ * DumpRenderTree/chromium/LayoutTestController.cpp:
+ (LayoutTestController::LayoutTestController):
+ * DumpRenderTree/chromium/LayoutTestController.h:
+ (LayoutTestController):
+ * DumpRenderTree/efl/LayoutTestControllerEfl.cpp:
+ * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+ * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ * DumpRenderTree/qt/LayoutTestControllerQt.h:
+ (LayoutTestController):
+ * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+ * DumpRenderTree/wx/LayoutTestControllerWx.cpp:
+ * WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl:
+ * WebKitTestRunner/InjectedBundle/LayoutTestController.cpp:
+ * WebKitTestRunner/InjectedBundle/LayoutTestController.h:
+ (LayoutTestController):
+
+2012-05-10 Alexey Proskuryakov <ap@apple.com>
+
+ Crash in 3rd party WebKit apps that disable cache at a wrong time
+ https://bugs.webkit.org/show_bug.cgi?id=86027
+ <rdar://problem/10615880>
+
+ Reviewed by Antti Koivisto.
+
+ Added a test that's very similar to MemoryCachePruneWithinResourceLoadDelegate,
+ but for disabling the cache instead of triggering a prune.
+
+ * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
+ * TestWebKitAPI/Tests/mac/MemoryCacheDisableWithinResourceLoadDelegate.html: Added.
+ * TestWebKitAPI/Tests/mac/MemoryCacheDisableWithinResourceLoadDelegate.mm: Added.
+ (-[MemoryCacheDisableTestResourceLoadDelegate webView:identifierForInitialRequest:fromDataSource:]):
+ (-[MemoryCacheDisableTestResourceLoadDelegate webView:resource:willSendRequest:redirectResponse:fromDataSource:]):
+ (-[MemoryCacheDisableTestResourceLoadDelegate webView:resource:didFinishLoadingFromDataSource:]):
+ (-[MemoryCacheDisableTestResourceLoadDelegate webView:resource:didFailLoadingWithError:fromDataSource:]):
+ (TestWebKitAPI::TEST):
+
+2012-05-10 Anders Carlsson <andersca@apple.com>
+
+ WebKit2: Add a way to blacklist specific plug-ins/plug-in versions
+ https://bugs.webkit.org/show_bug.cgi?id=86164
+ <rdar://problem/9551196>
+
+ Reviewed by Sam Weinig.
+
+ Update for WK2 API changes.
+
+ * MiniBrowser/mac/BrowserWindowController.m:
+ (-[BrowserWindowController awakeFromNib]):
+ * WebKitTestRunner/TestController.cpp:
+ (WTR::TestController::createOtherPage):
+ (WTR::TestController::initialize):
+
+2012-05-10 Dirk Pranke <dpranke@chromium.org>
+
+ nrwt: [chromium] fix path to asan symbolize script
+ https://bugs.webkit.org/show_bug.cgi?id=86161
+
+ Reviewed by Abhishek Arya.
+
+ * Scripts/webkitpy/layout_tests/port/chromium.py:
+ (ChromiumPort._get_crash_log):
+
+2012-05-10 Lei Zhang <thestig@chromium.org>
+
+ [chromium] Set Valgrind environment variables for layout tests.
+ https://bugs.webkit.org/show_bug.cgi?id=86156
+
+ Reviewed by Dirk Pranke.
+
+ * Scripts/webkitpy/layout_tests/port/chromium.py:
+ (ChromiumPort.setup_environ_for_server):
+
+2012-05-10 Raphael Kubo da Costa <rakuco@webkit.org>
+
+ [webkitpy][EFL] It should be possible to use a wrapper command for ImageDiff.
+ https://bugs.webkit.org/show_bug.cgi?id=86145
+
+ Reviewed by Dirk Pranke.
+
+ The GTK+ and EFL ports use jhbuild to build a few base libraries
+ which are then used when building the port itself. Programs such
+ as DRT and ImageDiff are then supposed to be run with the
+ `run-with-jhbuild' wrapper so that the libraries are properly
+ found and loaded.
+
+ This was already the case for DumpRenderTree (EflPort defines the
+ 'wrapper' option for that), but it was not possible to do the same
+ with ImageDiff so far.
+
+ The code which created the ImageDiff command-line call has been
+ moved to a separate method, _image_diff_command, which is then
+ overridden by EflPort to add the jhbuild wrapper.
+
+ * Scripts/webkitpy/layout_tests/port/efl.py:
+ (EflPort.__init__):
+ (EflPort._image_diff_command):
+ * Scripts/webkitpy/layout_tests/port/webkit.py:
+ (WebKitPort):
+ (WebKitPort._image_diff_command):
+ (WebKitPort._start_image_diff_process):
+
+2012-05-10 Zan Dobersek <zandobersek@gmail.com>
+
+ [GTK] ENABLE_IFRAME_SEAMLESS support
+ https://bugs.webkit.org/show_bug.cgi?id=85843
+
+ Reviewed by Eric Seidel.
+
+ Add the iframe-seamless option to the options list. This makes it
+ possible to enable the iframe seamless support through build-webkit
+ script. Enabled by default for all the ports.
+
+ * Scripts/webkitperl/FeatureList.pm:
+
+2012-05-10 Raphael Kubo da Costa <rakuco@webkit.org>
+
+ [EFL][webkitpy] Do not redefine check_build() in EflPort.
+ https://bugs.webkit.org/show_bug.cgi?id=86124
+
+ Reviewed by Dirk Pranke.
+
+ Remove an old FIXME and do not redefine check_build in EflPort;
+ once build-dumprendertree recognizes --efl, we can use the
+ check_build implementation in WebKitPort.
+
+ * Scripts/build-dumprendertree:
+ * Scripts/webkitpy/layout_tests/port/efl.py:
+ (EflPort.check_build):
+
+2012-05-10 Tommy Widenflycht <tommyw@google.com>
+
+ [chromium] MediaStream API: Fix the ExtraData functionality in WebMediaStreamDescriptor
+ https://bugs.webkit.org/show_bug.cgi?id=86087
+
+ Reviewed by Adam Barth.
+
+ * DumpRenderTree/chromium/WebUserMediaClientMock.cpp:
+ (MockExtraData):
+ (WebKit):
+ (WebKit::WebUserMediaClientMock::requestUserMedia):
+
+2012-05-10 Varun Jain <varunjain@google.com>
+
+ [chromium] Trigger context menu for long press gesture
+ https://bugs.webkit.org/show_bug.cgi?id=85919
+
+ Reviewed by Adam Barth.
+
+ * DumpRenderTree/chromium/EventSender.cpp:
+ (EventSender::EventSender):
+ (EventSender::gestureLongPress):
+ (EventSender::gestureEvent):
+ * DumpRenderTree/chromium/EventSender.h:
+ (EventSender):
+
+2012-05-10 Takashi Toyoshima <toyoshim@chromium.org>
+
+ don't use autoinstall to import pywebsocket but check it in WebKit directly.
+ https://bugs.webkit.org/show_bug.cgi?id=86107
+
+ Reviewed by Adam Barth.
+
+ This change removes pywebsocket from webkitpy's autoinstall list and
+ imports pywebsocket 0.7.4 directly into webkitpy/thirparty.
+
+ * Scripts/webkitpy/layout_tests/servers/websocket_server.py:
+ (PyWebSocket._prepare_config):
+ * Scripts/webkitpy/thirdparty/__init__.py:
+ (AutoinstallImportHook.find_module):
+ (AutoinstallImportHook._install_irc):
+ * Scripts/webkitpy/thirdparty/__init___unittest.py:
+ (ThirdpartyTest.test_import_hook.MockImportHook.__init__):
+ (ThirdpartyTest.test_import_hook.MockImportHook._install_eliza):
+ (ThirdpartyTest):
+ (ThirdpartyTest.test_import_hook):
+ * Scripts/webkitpy/thirdparty/mod_pywebsocket/COPYING: Added.
+ * Scripts/webkitpy/thirdparty/mod_pywebsocket/__init__.py: Added.
+ * Scripts/webkitpy/thirdparty/mod_pywebsocket/_stream_base.py: Added.
+ (ConnectionTerminatedException):
+ (InvalidFrameException):
+ (BadOperationException):
+ (UnsupportedFrameException):
+ (InvalidUTF8Exception):
+ (StreamBase):
+ (StreamBase.__init__):
+ (StreamBase._read):
+ (StreamBase._write):
+ (StreamBase.receive_bytes):
+ (StreamBase._read_until):
+ * Scripts/webkitpy/thirdparty/mod_pywebsocket/_stream_hixie75.py: Added.
+ (for):
+ (StreamHixie75):
+ (StreamHixie75.for):
+ (StreamHixie75.__init__):
+ (StreamHixie75.send_message):
+ (StreamHixie75._read_payload_length_hixie75):
+ (StreamHixie75.receive_message):
+ (StreamHixie75._send_closing_handshake):
+ (StreamHixie75.close_connection):
+ (StreamHixie75.send_ping):
+ * Scripts/webkitpy/thirdparty/mod_pywebsocket/_stream_hybi.py: Added.
+ (Frame):
+ (Frame.__init__):
+ (create_length_header):
+ (create_header):
+ (_build_frame):
+ (_filter_and_format_frame_object):
+ (create_binary_frame):
+ (create_text_frame):
+ (FragmentedFrameBuilder):
+ (FragmentedFrameBuilder.to):
+ (FragmentedFrameBuilder.__init__):
+ (FragmentedFrameBuilder.build):
+ (_create_control_frame):
+ (create_ping_frame):
+ (create_pong_frame):
+ (create_close_frame):
+ (StreamOptions):
+ (StreamOptions.__init__):
+ (Stream):
+ (Stream.for):
+ (Stream.__init__):
+ (Stream._receive_frame):
+ (Stream._receive_frame_as_frame_object):
+ (Stream.send_message):
+ (Stream.receive_message):
+ (Stream._send_closing_handshake):
+ (Stream.close_connection):
+ (Stream.send_ping):
+ (Stream._send_pong):
+ (Stream._drain_received_data):
+ * Scripts/webkitpy/thirdparty/mod_pywebsocket/common.py: Added.
+ (is_control_opcode):
+ (ExtensionParameter):
+ (ExtensionParameter.__init__):
+ (ExtensionParameter.name):
+ (ExtensionParameter.add_parameter):
+ (ExtensionParameter.get_parameters):
+ (ExtensionParameter.get_parameter_names):
+ (ExtensionParameter.has_parameter):
+ (ExtensionParameter.get_parameter_value):
+ * Scripts/webkitpy/thirdparty/mod_pywebsocket/dispatch.py: Added.
+ (DispatchException):
+ (DispatchException.__init__):
+ (_default_passive_closing_handshake_handler):
+ (_normalize_path):
+ (_create_path_to_resource_converter):
+ (_create_path_to_resource_converter.converter):
+ (_enumerate_handler_file_paths):
+ (_HandlerSuite):
+ (_HandlerSuite.__init__):
+ (_source_handler_file):
+ (_extract_handler):
+ (Dispatcher):
+ (Dispatcher.maintains):
+ (Dispatcher.__init__):
+ (Dispatcher.add_resource_path_alias):
+ (Dispatcher.source_warnings):
+ (Dispatcher.do_extra_handshake):
+ (Dispatcher.transfer_data):
+ (Dispatcher.passive_closing_handshake):
+ (Dispatcher.get_handler_suite):
+ (Dispatcher._source_handler_files_in_dir):
+ * Scripts/webkitpy/thirdparty/mod_pywebsocket/extensions.py: Added.
+ (ExtensionProcessorInterface):
+ (ExtensionProcessorInterface.get_extension_response):
+ (ExtensionProcessorInterface.setup_stream_options):
+ (DeflateStreamExtensionProcessor):
+ (DeflateStreamExtensionProcessor.__init__):
+ (DeflateStreamExtensionProcessor.get_extension_response):
+ (DeflateStreamExtensionProcessor.setup_stream_options):
+ (DeflateFrameExtensionProcessor):
+ (DeflateFrameExtensionProcessor.__init__):
+ (DeflateFrameExtensionProcessor.get_extension_response):
+ (DeflateFrameExtensionProcessor.setup_stream_options):
+ (DeflateFrameExtensionProcessor.setup_stream_options._OutgoingFilter):
+ (DeflateFrameExtensionProcessor.setup_stream_options._OutgoingFilter.__init__):
+ (DeflateFrameExtensionProcessor.setup_stream_options._OutgoingFilter.filter):
+ (DeflateFrameExtensionProcessor.setup_stream_options._IncomingFilter):
+ (DeflateFrameExtensionProcessor.setup_stream_options._IncomingFilter.__init__):
+ (DeflateFrameExtensionProcessor.setup_stream_options._IncomingFilter.filter):
+ (DeflateFrameExtensionProcessor.set_response_window_bits):
+ (DeflateFrameExtensionProcessor.set_response_no_context_takeover):
+ (DeflateFrameExtensionProcessor.enable_outgoing_compression):
+ (DeflateFrameExtensionProcessor.disable_outgoing_compression):
+ (DeflateFrameExtensionProcessor._outgoing_filter):
+ (DeflateFrameExtensionProcessor._incoming_filter):
+ (get_extension_processor):
+ (get_extension_processor.is):
+ * Scripts/webkitpy/thirdparty/mod_pywebsocket/handshake/__init__.py: Added.
+ (try):
+ (do_handshake):
+ * Scripts/webkitpy/thirdparty/mod_pywebsocket/handshake/_base.py: Added.
+ (AbortedByUserException):
+ (HandshakeException):
+ (HandshakeException.__init__):
+ (VersionException):
+ (VersionException.__init__):
+ (get_default_port):
+ (validate_subprotocol):
+ (parse_host_header):
+ (format_header):
+ (build_location):
+ (get_mandatory_header):
+ (validate_mandatory_header):
+ (check_request_line):
+ (check_header_lines):
+ (parse_token_list):
+ (_parse_extension_param):
+ (_parse_extension):
+ (parse_extensions):
+ (format_extensions):
+ * Scripts/webkitpy/thirdparty/mod_pywebsocket/handshake/draft75.py: Added.
+ (Handshaker):
+ (Handshaker.performs):
+ (Handshaker.__init__):
+ (Handshaker.do_handshake):
+ (Handshaker._set_resource):
+ (Handshaker._set_origin):
+ (Handshaker._set_location):
+ (Handshaker._set_subprotocol):
+ (Handshaker._set_protocol_version):
+ (Handshaker._sendall):
+ (Handshaker._send_handshake):
+ (Handshaker._check_header_lines):
+ (Handshaker._check_first_lines):
+ * Scripts/webkitpy/thirdparty/mod_pywebsocket/handshake/hybi.py: Added.
+ (compute_accept):
+ (Handshaker):
+ (Handshaker.__init__):
+ (Handshaker._validate_connection_header):
+ (Handshaker.do_handshake):
+ (Handshaker._get_origin):
+ (Handshaker._check_version):
+ (Handshaker._set_protocol):
+ (Handshaker._parse_extensions):
+ (Handshaker._validate_key):
+ (Handshaker._get_key):
+ (Handshaker._send_handshake):
+ * Scripts/webkitpy/thirdparty/mod_pywebsocket/handshake/hybi00.py: Added.
+ (Handshaker):
+ (Handshaker.__init__):
+ (Handshaker.do_handshake):
+ (Handshaker._set_resource):
+ (Handshaker._set_subprotocol):
+ (Handshaker._set_location):
+ (Handshaker._set_origin):
+ (Handshaker._set_protocol_version):
+ (Handshaker._set_challenge_response):
+ (Handshaker._get_key_value):
+ (Handshaker._get_challenge):
+ (Handshaker._send_handshake):
+ * Scripts/webkitpy/thirdparty/mod_pywebsocket/headerparserhandler.py: Added.
+ (ApacheLogHandler):
+ (ApacheLogHandler.__init__):
+ (ApacheLogHandler.emit):
+ (_configure_logging):
+ (_parse_option):
+ (_create_dispatcher):
+ (headerparserhandler):
+ * Scripts/webkitpy/thirdparty/mod_pywebsocket/http_header_util.py: Added.
+ (_is_char):
+ (_is_ctl):
+ (ParsingState):
+ (ParsingState.__init__):
+ (peek):
+ (consume):
+ (consume_string):
+ (consume_lws):
+ (consume_lwses):
+ (consume_token):
+ (consume_token_or_quoted_string):
+ (quote_if_necessary):
+ (parse_uri):
+ * Scripts/webkitpy/thirdparty/mod_pywebsocket/memorizingfile.py: Added.
+ (MemorizingFile):
+ (MemorizingFile.__init__):
+ (MemorizingFile.__getattribute__):
+ (MemorizingFile.readline):
+ (MemorizingFile.get_memorized_lines):
+ * Scripts/webkitpy/thirdparty/mod_pywebsocket/msgutil.py: Added.
+ (close_connection):
+ (send_message):
+ (receive_message):
+ (send_ping):
+ (MessageReceiver):
+ (MessageReceiver.receives):
+ (MessageReceiver.provides):
+ (MessageReceiver.should):
+ (MessageReceiver.__init__):
+ (MessageReceiver.run):
+ (MessageReceiver.receive):
+ (MessageReceiver.receive_nowait):
+ (MessageReceiver.stop):
+ (MessageSender):
+ (MessageSender.sends):
+ (MessageSender.provides):
+ (MessageSender.should):
+ (MessageSender.__init__):
+ (MessageSender.run):
+ (MessageSender.send):
+ (MessageSender.send_nowait):
+ * Scripts/webkitpy/thirdparty/mod_pywebsocket/standalone.py: Added.
+ (_StandaloneConnection):
+ (_StandaloneConnection.__init__):
+ (_StandaloneConnection.get_local_addr):
+ (_StandaloneConnection.get_remote_addr):
+ (_StandaloneConnection.write):
+ (_StandaloneConnection.read):
+ (_StandaloneConnection.get_memorized_lines):
+ (_StandaloneRequest):
+ (_StandaloneRequest.__init__):
+ (_StandaloneRequest.get_uri):
+ (_StandaloneRequest.get_method):
+ (_StandaloneRequest.is_https):
+ (_StandaloneRequest._drain_received_data):
+ (_StandaloneSSLConnection):
+ (_StandaloneSSLConnection.for):
+ (_StandaloneSSLConnection.__init__):
+ (_StandaloneSSLConnection.__getattribute__):
+ (_StandaloneSSLConnection.__setattr__):
+ (_StandaloneSSLConnection.makefile):
+ (WebSocketServer):
+ (WebSocketServer.__init__):
+ (WebSocketServer._create_sockets):
+ (WebSocketServer.server_bind):
+ (WebSocketServer.server_activate):
+ (WebSocketServer.server_close):
+ (WebSocketServer.fileno):
+ (WebSocketServer.handle_error):
+ (WebSocketServer.get_request):
+ (WebSocketServer.serve_forever):
+ (WebSocketServer.shutdown):
+ (WebSocketRequestHandler):
+ (WebSocketRequestHandler.setup):
+ (WebSocketRequestHandler.setup.SocketServer):
+ (WebSocketRequestHandler.__init__):
+ (WebSocketRequestHandler.parse_request):
+ (WebSocketRequestHandler.log_request):
+ (WebSocketRequestHandler.log_error):
+ (WebSocketRequestHandler.is_cgi):
+ (_configure_logging):
+ (_alias_handlers):
+ (_build_option_parser):
+ (ThreadMonitor):
+ (ThreadMonitor.__init__):
+ (ThreadMonitor.run):
+ (_parse_args_and_config):
+ (_main):
+ (_main.if):
+ (_main.if.__check_script):
+ * Scripts/webkitpy/thirdparty/mod_pywebsocket/stream.py: Copied from Tools/Scripts/webkitpy/thirdparty/__init___unittest.py.
+ * Scripts/webkitpy/thirdparty/mod_pywebsocket/util.py: Added.
+ (get_stack_trace):
+ (prepend_message_to_exception):
+ (__translate_interp):
+ (get_script_interp):
+ (wrap_popen3_for_win):
+ (wrap_popen3_for_win.__wrap_popen3):
+ (hexify):
+ (get_class_logger):
+ (NoopMasker):
+ (NoopMasker.__init__):
+ (NoopMasker.mask):
+ (RepeatedXorMasker):
+ (RepeatedXorMasker.__init__):
+ (RepeatedXorMasker.mask):
+ (DeflateRequest):
+ (DeflateRequest.for):
+ (DeflateRequest.__init__):
+ (DeflateRequest.__getattribute__):
+ (DeflateRequest.__setattr__):
+ (_Deflater):
+ (_Deflater.__init__):
+ (_Deflater.compress_and_flush):
+ (_Inflater):
+ (_Inflater.__init__):
+ (_Inflater.decompress):
+ (_Inflater.append):
+ (_Inflater.reset):
+ (_RFC1979Deflater):
+ (_RFC1979Deflater.that):
+ (_RFC1979Deflater.__init__):
+ (_RFC1979Deflater.filter):
+ (_RFC1979Inflater):
+ (_RFC1979Inflater.for):
+ (_RFC1979Inflater.__init__):
+ (_RFC1979Inflater.filter):
+ (DeflateSocket):
+ (DeflateSocket.for):
+ (DeflateSocket.__init__):
+ (DeflateSocket.recv):
+ (DeflateSocket.sendall):
+ (DeflateSocket.send):
+ (DeflateConnection):
+ (DeflateConnection.for):
+ (DeflateConnection.__init__):
+ (DeflateConnection.get_remote_addr):
+ (DeflateConnection.put_bytes):
+ (DeflateConnection.read):
+ (DeflateConnection.write):
+ (_is_ewouldblock_errno):
+ (drain_received_data):
+
+2012-05-10 Raphael Kubo da Costa <rakuco@webkit.org>
+
+ [EFL][webkitpy] Define the 'wrapper' option in EflPort instead of creating a EflDriver.
+ https://bugs.webkit.org/show_bug.cgi?id=86117
+
+ Reviewed by Adam Barth.
+
+ Simplify the code used to wrap driver calls with jhbuild: we can
+ just define the 'wrapper' option instead of having to create a
+ Driver class just for that.
+
+ * Scripts/webkitpy/layout_tests/port/efl.py:
+ (EflPort.__init__):
+ (EflPort._port_flag_for_scripts):
+
+2012-05-10 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r116633.
+ http://trac.webkit.org/changeset/116633
+ https://bugs.webkit.org/show_bug.cgi?id=86093
+
+ Breaks EFL tests (Requested by kov on #webkit).
+
+ * DumpRenderTree/efl/DumpRenderTreeChrome.cpp:
+ (DumpRenderTreeChrome::resetDefaultsToConsistentValues):
+ * DumpRenderTree/efl/EventSender.cpp:
+ (keyDownCallback):
+ * DumpRenderTree/efl/LayoutTestControllerEfl.cpp:
+ (LayoutTestController::setTabKeyCyclesThroughElements):
+
+2012-05-10 Sudarsana Nagineni <sudarsana.nagineni@linux.intel.com>
+
+ [EFL] Memory leaks found in EFL DRT
+ https://bugs.webkit.org/show_bug.cgi?id=85889
+
+ Reviewed by Gustavo Noronha Silva.
+
+ Fix two memory leaks in EFL's DRT by using JSRetainPtr for JSString
+ created with JSStringCreateWithUTF8CString.
+
+ * DumpRenderTree/efl/DumpRenderTreeChrome.cpp:
+ (DumpRenderTreeChrome::onWindowObjectCleared):
+ * DumpRenderTree/efl/EventSender.cpp:
+ (modifiersFromJSValue):
+
+2012-05-10 Alexander Shalamov <alexander.shalamov@intel.com>
+
+ [EFL] LayoutTestController needs implementation of setTabKeyCyclesThroughElements
+ https://bugs.webkit.org/show_bug.cgi?id=82864
+
+ Reviewed by Gustavo Noronha Silva.
+
+ Add missing implementation for setTabKeyCyclesThroughElements to EFL's LayoutTestController
+ in order to unskip fast/events/keypress-insert-tab.html
+
+ * DumpRenderTree/efl/EventSender.cpp:
+ (keyDownCallback):
+ * DumpRenderTree/efl/LayoutTestControllerEfl.cpp:
+ (LayoutTestController::setTabKeyCyclesThroughElements):
+
+2012-05-10 Alexander Shalamov <alexander.shalamov@intel.com>
+
+ [EFL][DRT] EventSender - set delayed event information if it was not set before
+ https://bugs.webkit.org/show_bug.cgi?id=85972
+
+ Reviewed by Gustavo Noronha Silva.
+
+ Reset delayed event information if it is missing.
+
+ * DumpRenderTree/efl/EventSender.cpp:
+ (feedOrQueueMouseEvent):
+
+2012-05-07 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
+
+ WebPageProxy::activeURL() should return the pending API request, even when there's no main frame
+ https://bugs.webkit.org/show_bug.cgi?id=85806
+
+ The m_pendingAPIRequestURL member is used (presumably) to mask over the async
+ nature of WebKit2, so that starting a load of a URL will reflect that URL
+ immedeatly from activeURL, even if the request has not been passed over to
+ the web process yet and reflected there.
+
+ This works well, except in the case of the initial request, where the main
+ frame creation happens on the web process side and is notified back to the
+ UI process. Until we've recived the notification we don't know about the main
+ frame, and this race condition will potentially give us an empty url instead
+ of the pending request.
+
+ To solve this we always return the pending API request if it's set, even
+ when there's no mainframe yet (that we known about).
+
+ Reviewed by Simon Hausmann.
+
+ * TestWebKitAPI/Tests/WebKit2/PageLoadBasic.cpp:
+
+2012-05-10 Mikhail Pozdnyakov <mikhail.pozdnyakov@intel.com>
+
+ [EFL][DRT] Clear added user style sheets before a new testcase execution.
+ https://bugs.webkit.org/show_bug.cgi?id=84792
+
+ Reviewed Gustavo Noronha Silva.
+
+ The added user style sheets from the previous testcases are cleared in order to avoid
+ flaky results.
+
+ * DumpRenderTree/efl/DumpRenderTreeChrome.cpp:
+ (DumpRenderTreeChrome::resetDefaultsToConsistentValues):
+
+2012-05-09 Gyuyoung Kim <gyuyoung.kim@samsung.com>
+
+ Move suspendAnimations to use Internals interface.
+ https://bugs.webkit.org/show_bug.cgi?id=85986
+
+ Reviewed by Ryosuke Niwa.
+
+ Remove suspendAnimations functions, because it is able to work in the
+ cross-port way through the Internals interface
+
+ * DumpRenderTree/LayoutTestController.cpp:
+ (LayoutTestController::staticFunctions):
+ * DumpRenderTree/LayoutTestController.h:
+ (LayoutTestController):
+ * DumpRenderTree/blackberry/LayoutTestControllerBlackBerry.cpp:
+ * DumpRenderTree/chromium/LayoutTestController.cpp:
+ (LayoutTestController::LayoutTestController):
+ * DumpRenderTree/chromium/LayoutTestController.h:
+ (LayoutTestController):
+ * DumpRenderTree/efl/LayoutTestControllerEfl.cpp:
+ * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+ * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ * DumpRenderTree/qt/LayoutTestControllerQt.h:
+ (LayoutTestController):
+ * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+ * DumpRenderTree/wx/LayoutTestControllerWx.cpp:
+
+2012-05-09 Kent Tamura <tkent@chromium.org>
+
+ [Chromium] Attempt to fix an Android build error.
+ https://bugs.webkit.org/show_bug.cgi?id=86045
+
+ * DumpRenderTree/DumpRenderTree.gypi:
+
+2012-05-09 Ojan Vafai <ojan@chromium.org>
+
+ Don't show partytime if there are non-layout test failures.
+ https://bugs.webkit.org/show_bug.cgi?id=86056
+
+ Reviewed by Dimitri Glazkov.
+
+ * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/controllers.js:
+ * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/controllers_unittests.js:
+ * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/garden-o-matic.js:
+
+2012-05-09 Hayato Ito <hayato@chromium.org>
+
+ Improve a warning message for a reftest having an unused expectation file.
+ https://bugs.webkit.org/show_bug.cgi?id=85975
+
+ Reviewed by Adam Barth.
+
+ The current warning message is not intuitive. It might be better to update the message
+ so that it encourage users to remove unused expectation files.
+
+ * Scripts/webkitpy/layout_tests/controllers/single_test_runner.py:
+ (SingleTestRunner.__init__):
+
+2012-05-09 Ojan Vafai <ojan@chromium.org>
+
+ Change "losing test coverage" to cover all non-layout test problems in garden-o-matic
+ https://bugs.webkit.org/show_bug.cgi?id=86043
+
+ Reviewed by Adam Barth.
+
+ -Get rid of the gtest iframe.
+ -Cover all non-layout test problems. Before we wouldn't catch compile failures
+ or gtest failures since they were not on the webkit testing bots.
+ -Include the list of failing steps next to the builder name. This is a lot less
+ cluttered than you'd expect and already helped me find a compile failure early.
+
+ * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/builders.js:
+ * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/builders_unittests.js:
+ * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/config.js:
+ Delete unused map.
+ * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/controllers.js:
+ * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/garden-o-matic.js:
+ * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui.js:
+ * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui/failures.js:
+ * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui/failures_unittests.js:
+ * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui/notifications.js:
+ * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui/notifications_unittests.js:
+ * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui_unittests.js:
+
+2012-05-09 Jessie Berlin <jberlin@apple.com>
+
+ Crash using the new WKBundleDOMWindowExtensions APIs.
+ https://bugs.webkit.org/show_bug.cgi?id=85888
+
+ Reviewed by Brady Eidson.
+
+ Cached frames can live slightly longer than the page, but most clients unregister themselves
+ and do other cleanup in the willDestroyPage callback, making them miss the
+ willDestroyGlobalObjectForDOMWindowExtension callbacks.
+
+ The calls to willDestroyGlobalObjectForDOMWindowExtension in the DOMWindowExtensionBasic
+ test were all being invoked underneath WebPage::close. This is unrealistic. Update that test
+ to destroy the BundleDOMWindowExtensions in response to the willDestroyPage callback.
+
+ Add a test to verify that willDestroyGlobalObjectForDOMWindowExtension is being called for
+ pages that don't go into the page cache.
+
+ * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
+ Add DOMWindowExtensionNoCache.cpp, DOMWindowExtensionNoCache_Bundle.cpp, simple-unload.html
+ and simple-iframe-unload.html
+
+ * TestWebKitAPI/Tests/WebKit2/DOMWindowExtensionBasic.cpp:
+ (TestWebKitAPI):
+ Remove the expected messages for willDestroyGlobalObjectForDOMWindowExtension.
+ (TestWebKitAPI::didReceiveMessageFromInjectedBundle):
+ Do not bother to keep track of the live extension count - all of them are expected to be
+ live until the test completes.
+ (TestWebKitAPI::TEST):
+ Fix the calls to EXPECT to pass the expected value first, and use EXPECT_WK_STREQ so that
+ message failures will be clearer.
+ * TestWebKitAPI/Tests/WebKit2/DOMWindowExtensionBasic_Bundle.cpp:
+ (TestWebKitAPI::DOMWindowExtensionBasic::willDestroyPage):
+ Clean up the BundleDOMWindowExtensions.
+ (TestWebKitAPI::DOMWindowExtensionBasic::willDestroyGlobalObjectForDOMWindowExtension):
+ Add an ASSERT_NOT_REACHED.
+
+ * TestWebKitAPI/Tests/WebKit2/DOMWindowExtensionNoCache.cpp: Added.
+ (TestWebKitAPI::didReceiveMessageFromInjectedBundle):
+ Keep track of the messages received so they can be checked at the end of the test.
+ (TestWebKitAPI::TEST):
+ Navigate to uncacheable pages and back.
+ * TestWebKitAPI/Tests/WebKit2/DOMWindowExtensionNoCache_Bundle.cpp: Copied from Tools/TestWebKitAPI/Tests/WebKit2/DOMWindowExtensionBasic_Bundle.cpp.
+ (DOMWindowExtensionNoCache):
+ (TestWebKitAPI::DOMWindowExtensionNoCache::DOMWindowExtensionNoCache):
+ Set up all the states for each BundleDOMWindowExtension.
+ (TestWebKitAPI::DOMWindowExtensionNoCache::frameLoadFinished):
+ Tell the UI Process about the states of the BundleDOMWindowExtensions.
+ (TestWebKitAPI::DOMWindowExtensionNoCache::sendExtensionStateMessage):
+ (TestWebKitAPI::DOMWindowExtensionNoCache::initialize):
+ (TestWebKitAPI::DOMWindowExtensionNoCache::didCreatePage):
+ (TestWebKitAPI::DOMWindowExtensionNoCache::willDestroyPage):
+ Remvoe the remaining BundleDOMWindowExtensions, send the updated state, and finish the test.
+ (TestWebKitAPI::DOMWindowExtensionNoCache::updateExtensionStateRecord):
+ (TestWebKitAPI::DOMWindowExtensionNoCache::sendBundleMessage):
+ (TestWebKitAPI::DOMWindowExtensionNoCache::globalObjectIsAvailableForFrame):
+ (TestWebKitAPI::DOMWindowExtensionNoCache::willDisconnectDOMWindowExtensionFromGlobalObject):
+ ASSERT that these pages not going into the page cache are not getting disconnected to go into
+ the page cache.
+ (TestWebKitAPI::DOMWindowExtensionNoCache::didReconnectDOMWindowExtensionToGlobalObject):
+ Ditto about getting reconnected when coming out of the page cache.
+ (TestWebKitAPI::DOMWindowExtensionNoCache::willDestroyGlobalObjectForDOMWindowExtension):
+ Tell the UI Process, update the state, and get rid of the BundleDOMWindowExtension.
+ (TestWebKitAPI::didFinishLoadForFrameCallback):
+ (TestWebKitAPI::globalObjectIsAvailableForFrameCallback):
+ (TestWebKitAPI::willDisconnectDOMWindowExtensionFromGlobalObjectCallback):
+ (TestWebKitAPI::didReconnectDOMWindowExtensionToGlobalObjectCallback):
+ (TestWebKitAPI::willDestroyGlobalObjectForDOMWindowExtensionCallback):
+
+ * TestWebKitAPI/Tests/WebKit2/simple-iframe-unload.html: Added.
+ * TestWebKitAPI/Tests/WebKit2/simple-unload.html: Added.
+
+2012-05-09 Adam Barth <abarth@webkit.org>
+
+ [Chromium] Android's DRT doesn't want to build WebUserMediaClientMock
+ https://bugs.webkit.org/show_bug.cgi?id=86045
+
+ Reviewed by Eric Seidel.
+
+ * DumpRenderTree/DumpRenderTree.gypi:
+
+2012-05-09 Adam Barth <abarth@webkit.org>
+
+ [Chromium] MockWebSpeechInputController.cpp should be guarded by ENABLE(INPUT_SPEECH)
+ https://bugs.webkit.org/show_bug.cgi?id=86041
+
+ Reviewed by Eric Seidel.
+
+ * DumpRenderTree/chromium/MockWebSpeechInputController.cpp:
+
+2012-05-09 Adam Barth <abarth@webkit.org>
+
+ [Chromium] Android needs to swizzle pixel dumps in order to get the same hash as other platforms
+ https://bugs.webkit.org/show_bug.cgi?id=86040
+
+ Reviewed by Kent Tamura.
+
+ * DumpRenderTree/chromium/TestShell.cpp:
+ (TestShell::dumpImage):
+
+2012-05-09 Raphael Kubo da Costa <rakuco@webkit.org>
+
+ [EFL] Build fix after r116464.
+
+ `ulong' is a type defined by glibc, so it is not very
+ portable. Use `unsigned long' instead.
+
+ * DumpRenderTree/efl/EventSender.cpp:
+ (DelayedEvent::DelayedEvent):
+ (DelayedEvent):
+ (leapForwardCallback):
+
+2012-05-09 Adam Barth <abarth@webkit.org>
+
+ [Chromium] LayoutTestController should use ENABLE guards for some features
+ https://bugs.webkit.org/show_bug.cgi?id=86030
+
+ Reviewed by Eric Seidel.
+
+ These features are disabled on OS(ANDROID) and so shouldn't be compiled
+ when the feature is off.
+
+ * DumpRenderTree/chromium/LayoutTestController.cpp:
+ (LayoutTestController::LayoutTestController):
+ * DumpRenderTree/chromium/LayoutTestController.h:
+ (LayoutTestController):
+ * DumpRenderTree/chromium/TestShell.h:
+ (TestShell):
+
+2012-05-09 Tom Zakrajsek <tomz@codeaurora.org>
+
+ Fix overzealous re-opened since blocked by... message
+ https://bugs.webkit.org/show_bug.cgi?id=86020
+
+ Reviewed by Adam Barth.
+
+ Changed CreateBug behavior to only re-open a blocked bug if it
+ was RESOLVED. Also had to update the test infrastructure slightly
+ to allow for distinct mock commit revisions, so one could point
+ to a RESOLVED bug for testing while another pointed to an OPEN bug.
+
+ Also moved default created mock bug to be 60001 instead of 50004
+ which already exists as a reference mock bug.
+
+ * Scripts/webkitpy/common/checkout/checkout_mock.py:
+ (MockCheckout.__init__):
+ (MockCheckout.commit_info_for_revision):
+ * Scripts/webkitpy/common/net/bugzilla/bugzilla_mock.py:
+ (MockBugzilla.create_bug):
+ * Scripts/webkitpy/tool/bot/flakytestreporter_unittest.py:
+ * Scripts/webkitpy/tool/commands/download_unittest.py:
+ (test_create_rollout_resolved):
+ * Scripts/webkitpy/tool/commands/queries_unittest.py:
+ (FailureReasonTest.test_blame_line_for_revision):
+ * Scripts/webkitpy/tool/steps/createbug.py:
+ (CreateBug.run):
+
+2012-05-09 Hugo Parente Lima <hugo.lima@openbossa.org>
+
+ Use suitable viewport values on XHTML-MP pages.
+ https://bugs.webkit.org/show_bug.cgi?id=85425
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Enable LEGACY_VIEWPORT_ADAPTION on Qt port.
+
+ * qmake/mkspecs/features/features.prf:
+
+2012-05-09 Jochen Eisinger <jochen@chromium.org>
+
+ When creating a new page during a navigation, prime the initial document with the correct referrer policy
+ https://bugs.webkit.org/show_bug.cgi?id=86001
+
+ Reviewed by Adam Barth.
+
+ Store the referrer policy in the request, so the network stack can comply with it.
+
+ * DumpRenderTree/chromium/WebViewHost.cpp:
+ (WebViewHost::willSendRequest):
+
+2012-05-09 Vivek Galatage <vivekgalatage@gmail.com>
+
+ Remove CYGWIN=tty from environment variable as its no longer supported
+ https://bugs.webkit.org/show_bug.cgi?id=85791
+
+ The CYGWIN=tty environment variable is no longer supported from Cygwin
+ version 1.7.10. This fix avoids addition of this environment variable
+ for Cygwin versions greater than 1.7.9. For supporting older versions
+ i.e. 1.7.9 or older, the script takes care of retaining the environment
+ variable.
+
+ Reviewed by Adam Roben.
+
+ * Scripts/webkitdirs.pm:
+ (setupAppleWinEnv):
+
+2012-05-09 Dirk Pranke <dpranke@chromium.org>
+
+ nrwt: --skip-failing-tests should also skip flaky tests
+ https://bugs.webkit.org/show_bug.cgi?id=85941
+
+ Reviewed by Ojan Vafai.
+
+ This changes --skip-failing-tests so that we skip tests that
+ are believed to pass sometimes as well as tests that are
+ believed to always fail.
+
+ In addition, in testing this I discovered that we had lousy
+ test coverage of the details of retrying test failures and
+ --clobber-old-results, so I wrote some more tests.
+
+ * Scripts/webkitpy/layout_tests/controllers/manager.py:
+ (Manager.prepare_lists_and_print_output):
+ * Scripts/webkitpy/layout_tests/port/test.py:
+ (unit_test_list):
+ (TestPort.__init__):
+ (TestDriver.run_test):
+ * Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py:
+ (MainTest.test_skip_failing_tests):
+ (MainTest.test_retrying_and_flaky_tests):
+
+2012-05-09 Christophe Dumez <christophe.dumez@intel.com>
+
+ [EFL][DRT] EFL's DRT needs to support LayoutTestController.dumpIconChanges()
+ https://bugs.webkit.org/show_bug.cgi?id=84435
+
+ Reviewed by Antonio Gomes.
+
+ Catch the "icon,changed" signal on the frames in EFL's DumpRenderTree
+ to support LayoutTestController's dumpIconChanges().
+
+ * DumpRenderTree/efl/DumpRenderTreeChrome.cpp:
+ (DumpRenderTreeChrome::createView):
+ (DumpRenderTreeChrome::onFrameIconChanged):
+ (DumpRenderTreeChrome::onFrameCreated):
+ * DumpRenderTree/efl/DumpRenderTreeChrome.h:
+ (DumpRenderTreeChrome):
+
+2012-05-09 Dominik Röttsches <dominik.rottsches@intel.com>
+
+ webkit-patch upload Fails Behind Load-balancing Proxies
+ https://bugs.webkit.org/show_bug.cgi?id=85980
+
+ Reviewed by Adam Barth.
+
+ Unchecking the login restriction to IP to allow the tool
+ to function behind load-balancing proxies that use multiple
+ outgoing IPs.
+
+ * Scripts/webkitpy/common/net/bugzilla/bugzilla.py:
+ (Bugzilla.authenticate):
+
+2012-05-09 Hao Zheng <zhenghao@chromium.org>
+
+ [Chromium-android] Add unit test for Android layout test script (chromium_android.py)
+ https://bugs.webkit.org/show_bug.cgi?id=80852
+
+ Reviewed by Adam Barth.
+
+ Add some tests to ensure that chromium android port works to some
+ extent. Some methods is hard to test, as they rely on the actual
+ behavior on device, e.g. pushing files to device.
+
+ * Scripts/webkitpy/layout_tests/port/chromium_android.py:
+ (ChromiumAndroidPort.get_last_stacktrace): Check if dir exists.
+ * Scripts/webkitpy/layout_tests/port/chromium_android_unittest.py:
+ (ChromiumAndroidPortTest):
+ (ChromiumAndroidPortTest.test_attributes):
+ (ChromiumAndroidPortTest.test_get_last_stacktrace):
+ (ChromiumAndroidPortTest.test_get_last_stacktrace.mock_run_command_no_dir):
+ (ChromiumAndroidPortTest.test_get_last_stacktrace.mock_run_command_no_file):
+ (ChromiumAndroidPortTest.test_get_last_stacktrace.mock_run_command_non_empty):
+ (ChromiumAndroidDriverTest):
+ (ChromiumAndroidDriverTest.setUp):
+ (ChromiumAndroidDriverTest.test_get_drt_return_value):
+ (ChromiumAndroidDriverTest.test_has_crash_hint):
+ (ChromiumAndroidDriverTest.test_read_prompt):
+ (ChromiumAndroidDriverTest.test_test_shell_command):
+ (ChromiumAndroidDriverTest.test_write_command_and_read_line):
+
+2012-05-09 Allan Sandfeld Jensen <allan.jensen@nokia.com>
+
+ [Qt] ORWT fails with Qt 5 and WK2.
+ https://bugs.webkit.org/show_bug.cgi?id=85968
+
+ Reviewed by Csaba Osztrogonác.
+
+ The Qt5 binary does not have a -style argument, so avoid using it.
+
+ * Scripts/old-run-webkit-tests:
+
+2012-05-09 Mikhail Pozdnyakov <mikhail.pozdnyakov@intel.com>
+
+ [EFL][DRT] LayoutTestController addUserScript implementation
+ https://bugs.webkit.org/show_bug.cgi?id=84718
+
+ Reviewed by Antonio Gomes.
+
+ Added implementation of addUserScript() to LayoutTestController.
+
+ * DumpRenderTree/efl/DumpRenderTreeChrome.cpp:
+ (DumpRenderTreeChrome::resetDefaultsToConsistentValues): clear added user scripts
+ * DumpRenderTree/efl/LayoutTestControllerEfl.cpp:
+ (LayoutTestController::addUserScript): added implementation
+
+2012-05-09 Dan Bernstein <mitz@apple.com>
+
+ Made build-webkit copy WebKitLibraries to the right location again after r116257
+
+ Reviewed by Mark Rowe.
+
+ * Scripts/build-webkit: Pass the built product directory to copy-webkitlibraries-to-product-directory.
+ * Scripts/copy-webkitlibraries-to-product-directory: Use the first argument, if present, as the
+ product directory.
+
+2012-05-08 Ojan Vafai <ojan@chromium.org>
+
+ Show the chromium non-layout test bots in garden-o-matic
+ https://bugs.webkit.org/show_bug.cgi?id=85903
+
+ Reviewed by Eric Seidel.
+
+ This is just a single-line high-level overview of the chromium non-layout test bots.
+ This means that Chromium WebKit gardeners only need to keep garden-o-matic open in
+ order to do their job.
+
+ * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/garden-o-matic.js:
+ * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui.js:
+ * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui_unittests.js:
+ * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/styles/onebar.css:
+ (#chromium-gtests iframe):
+ (#chromium-gtests):
+ (#gtest-label):
+
+2012-05-08 Kangil Han <kangil.han@samsung.com>
+
+ [EFL][DRT] Implement TextInputController.
+ https://bugs.webkit.org/show_bug.cgi?id=78559
+
+ Reviewed by Martin Robinson.
+
+ TextInputController has been created for an input emulation purpose in DRT.
+ However, not like other ports, EFL doesn't have it.
+ Therefore, this patch will enable EFL port to have an input emulation in DRT.
+
+ * DumpRenderTree/efl/CMakeLists.txt:
+ * DumpRenderTree/efl/DumpRenderTreeChrome.cpp:
+ (DumpRenderTreeChrome::onWindowObjectCleared):
+ * DumpRenderTree/efl/TextInputController.cpp: Added.
+ (setMarkedTextCallback):
+ (hasMarkedTextCallback):
+ (markedRangeCallback):
+ (insertTextCallback):
+ (unmarkTextCallback):
+ (firstRectForCharacterRangeCallback):
+ (selectedRangeCallback):
+ (makeTextInputController):
+ * DumpRenderTree/efl/TextInputController.h: Added.
+
+2012-04-23 Raphael Kubo da Costa <rakuco@webkit.org>
+
+ [EFL] Pass a WTF::String directly from DRT to ewebkit when possible
+ https://bugs.webkit.org/show_bug.cgi?id=84634
+
+ Reviewed by Gustavo Noronha Silva.
+
+ Drop unnecessary const char* -> WTF::String conversions by
+ creating String objects directly in LayoutTestController out of
+ JSStringRef's and passing them to DumpRenderTreeSupportEfl.
+
+ * DumpRenderTree/efl/LayoutTestControllerEfl.cpp:
+ (LayoutTestController::queueLoad):
+ (LayoutTestController::setValueForUser):
+ (LayoutTestController::findString):
+ (LayoutTestController::addUserStyleSheet):
+
+2012-05-08 Alexander Shalamov <alexander.shalamov@intel.com>
+
+ [EFL][DRT] EventSender needs implementation of leapForward function
+ https://bugs.webkit.org/show_bug.cgi?id=83486
+
+ Reviewed by Eric Seidel.
+
+ Implemented leapForward function in Efl's DRT. This function is required
+ to delay and queue event execution and simulate real user behavior.
+
+ * DumpRenderTree/efl/EventSender.cpp:
+ (DelayedEvent):
+ (MouseEventInfo::MouseEventInfo):
+ (MouseEventInfo):
+ (sendClick):
+ (mouseDownCallback):
+ (mouseUpCallback):
+ (mouseMoveToCallback):
+ (leapForwardCallback):
+ (mouseScrollByCallback):
+ (feedOrQueueMouseEvent):
+ (feedMouseEvent):
+ (feedQueuedMouseEvents):
+
+2012-05-08 Ryuan Choi <ryuan.choi@samsung.com>
+
+ [EFL][DRT] WebKit/DRT should not paint webview for the pixel tests.
+ https://bugs.webkit.org/show_bug.cgi?id=79853
+
+ Reviewed by Eric Seidel.
+
+ Screen buffer can be different from rendered results.
+ For example, WebKit/Efl just moves tiles for ewk_view_tiled when scrolling
+ contents.
+ It means that pixel tests can't check regression of ewk_view_tiled.
+
+ This patch changes a way to provide bitmap from painting webview to capturing
+ evas.
+
+ * DumpRenderTree/efl/PixelDumpSupportEfl.cpp:
+ (createBitmapContextFromWebView):
+
+2012-05-08 Sudarsana Nagineni <sudarsana.nagineni@linux.intel.com>
+
+ [GTK] Memory leak in DRT EventSender.cpp
+ https://bugs.webkit.org/show_bug.cgi?id=85886
+
+ Reviewed by Martin Robinson.
+
+ Fix a memory leak in gdkModifersFromJSValue() by using JSRetainPtr for
+ JSString created with JSStringCreateWithUTF8CString.
+
+ * DumpRenderTree/gtk/EventSender.cpp:
+ (gdkModifersFromJSValue):
+
+2012-05-08 Christophe Dumez <christophe.dumez@intel.com>
+
+ [EFL] glib dependency needs to be updated in jhbuild
+ https://bugs.webkit.org/show_bug.cgi?id=85878
+
+ Reviewed by Martin Robinson.
+
+ Bump glib version from 2.31.8 to 2.32.2 in jhbuild.modules. This
+ addresses flakiness in media tests due to possible deadlock with the
+ following output on stderr:
+ GStreamer-WARNING **: wrong STREAM_LOCK count 0
+
+ The bug was fixed upstream by:
+ http://git.gnome.org/browse/glib/commit/?id=265f265c677bc5399dbb1cfa449cb4b915a6459f
+
+ * efl/jhbuild.modules:
+
+2012-05-07 Alexis Menard <alexis.menard@openbossa.org>
+
+ [Qt] Unbreak debugging of WebKit2.
+ https://bugs.webkit.org/show_bug.cgi?id=85839
+
+ Reviewed by Simon Hausmann.
+
+ When you attach GDB to a running process, it stops it.
+ http://trac.webkit.org/changeset/115958 introduced a pause()
+ call to wait the debugger to be attached to then continue
+ the execution of the WebProcess. Unfortunately the pause()
+ function does not return unless a signal handler is called.
+ This patch introduce an event handler to exit from the paused
+ state when the debugger send the signal SIGCONT. The old code
+ works with older version of GDB (<7.0) but not with newer
+ versions where the behavior of pause() is correct.
+
+ * WebKitTestRunner/qt/main.cpp:
+ (sigcontHandler):
+ (main):
+
+2012-05-08 Christophe Dumez <christophe.dumez@intel.com>
+
+ [EFL][DRT] EFL's DRT does not fully support page visibility
+ https://bugs.webkit.org/show_bug.cgi?id=85032
+
+ Reviewed by Antonio Gomes.
+
+ * DumpRenderTree/LayoutTestController.cpp:
+ (resetPageVisibilityCallback): Fix incorrect argumentCount check.
+ * DumpRenderTree/efl/DumpRenderTreeChrome.cpp:
+ (DumpRenderTreeChrome::resetDefaultsToConsistentValues): Properly
+ reset page visibility setting between tests.
+ * DumpRenderTree/efl/LayoutTestControllerEfl.cpp:
+ (LayoutTestController::setPageVisibility): Add support for "preview"
+ visibility state.
+
+2012-05-08 Gavin Peters <gavinp@chromium.org>
+
+ [webkit-patch] Return meaningful results from single-result queries.
+ https://bugs.webkit.org/show_bug.cgi?id=85367
+
+ Reviewed by Dirk Pranke.
+
+ Sometimes a quicksearch returns a single result by just redirecting to the page for that single
+ bug. This patch hacks around that by noticing the redirect target is a single page, and constructing
+ a result list consisting of that one bug.
+
+ * Scripts/webkitpy/common/net/bugzilla/bugzilla.py:
+ (BugzillaQueries._fetch_bugs_from_advanced_query):
+
+2012-05-08 Gavin Peters <gavinp@chromium.org>
+
+ [webkit-patch] Add new chrome-channels command to track down current chrome release channels for a committed bug.
+ https://bugs.webkit.org/show_bug.cgi?id=85368
+
+ Reviewed by Eric Seidel.
+
+ * Scripts/webkitpy/common/config/urls.py:
+ * Scripts/webkitpy/common/net/bugzilla/bugzilla_mock.py:
+ (MockBugzillaQueries.fetch_bugs_matching_quicksearch):
+ * Scripts/webkitpy/common/net/omahaproxy.py: Added.
+ (OmahaProxy):
+ (OmahaProxy.__init__):
+ (OmahaProxy.set_url):
+ (OmahaProxy._json_url):
+ (OmahaProxy._get_json):
+ (OmahaProxy.get_revisions):
+ * Scripts/webkitpy/common/net/omahaproxy_unittest.py: Added.
+ (MockOmahaProxy):
+ (MockOmahaProxy.__init__):
+ (OmahaProxyTest):
+ (OmahaProxyTest.test_get_revisions):
+ * Scripts/webkitpy/tool/commands/__init__.py:
+ * Scripts/webkitpy/tool/commands/bugsearch.py:
+ (BugSearch):
+ * Scripts/webkitpy/tool/commands/chromechannels.py: Added.
+ (ChromeChannels):
+ (__init__):
+ (execute):
+ * Scripts/webkitpy/tool/commands/chromechannels_unittest.py: Added.
+ (MockOmahaProxy):
+ (MockOmahaProxy.get_revisions):
+ (TestableChromeChannels):
+ (TestableChromeChannels.__init__):
+ (ChromeChannelsTest):
+ (ChromeChannelsTest.test_single_bug):
+ (ChromeChannelsTest.test_with_query):
+
+2012-05-08 Carlos Garcia Campos <cgarcia@igalia.com>
+
+ Unreviewed. Fix GTK+ unit tests.
+
+ * gtk/common.py:
+ (pkg_config_file_variable):
+
+2012-05-08 Carlos Garcia Campos <cgarcia@igalia.com>
+
+ [GTK] Google tests that time out are leaked
+ https://bugs.webkit.org/show_bug.cgi?id=84973
+
+ Reviewed by Philippe Normand.
+
+ Move Tools/Scripts/run-gtk-tests to Tools/gtk/run-api-tests
+ leaving run-gtk-tests as simple wrapper that runs run-api-tests in
+ a jhbuild environment when jhbuild is available.
+
+ * Scripts/run-gtk-tests: Run Tools/gtk/run-api-tests directly or
+ with jhbuild if present.
+ * gtk/common.py:
+ (pkg_config_file_variable): Generic function to get a variable
+ from a pkg-config file.
+ (prefix_of_pkg_config_file): Use pkg_config_file_variable with 'prefix'.
+ * gtk/run-api-tests: Copied from Tools/Scripts/run-gtk-tests.
+ (TestRunner.__init__): Use common.build_path() to get the programs path.
+ (TestRunner._lookup_atspi2_binary): Use
+ common.pkg_config_file_variable() to get the 'exec_prefix'.
+ (TestRunner._start_accessibility_daemons): Use subprocess.Popen()
+ directly instead of helper _create_process that has been removed.
+ (TestRunner._setup_testing_environment): Use subprocess.Popen()
+ directly instead of helper _create_process that has been
+ removed. Use common.top_level_path() and common.build_path()
+ instead of custom methods that have been removed too.
+ (TestRunner._run_test_command): Use subprocess.Popen() directly
+ instead of helper _create_process that has been removed.
+
+2012-05-08 Thiago Marcos P. Santos <thiago.santos@intel.com>
+
+ [EFL] [DRT] Clear extra views before setting a blank page
+ https://bugs.webkit.org/show_bug.cgi?id=85608
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ We need to clear the extra views before setting a blank page,
+ otherwise it will cause more events interactions and sometimes
+ trigger a unload(). This was causing frame-crash-with-page-cache.html
+ to leak events to the next test causing any subsequent test to
+ fail.
+
+ * DumpRenderTree/efl/DumpRenderTree.cpp:
+ (runTest):
+ * DumpRenderTree/efl/DumpRenderTreeChrome.cpp:
+ (DumpRenderTreeChrome::clearExtraViews):
+ (DumpRenderTreeChrome::resetDefaultsToConsistentValues):
+ * DumpRenderTree/efl/DumpRenderTreeChrome.h:
+ (DumpRenderTreeChrome):
+
+2012-05-08 Balazs Kelemen <kbalazs@webkit.org>
+
+ [Qt] X11 plugins need to be reworked for Qt5+WK1
+ https://bugs.webkit.org/show_bug.cgi?id=80691
+
+ Reviewed by Simon Hausmann.
+
+ Implement basic windowless plugin support with Qt5.
+
+ * qmake/mkspecs/features/features.prf:
+ Enable NPAPI plugins if X11 libraries are available.
+ * qmake/mkspecs/features/functions.prf:
+ Added a convenience function to determine availability
+ of X11 libraries.
+
+2012-05-07 Raphael Kubo da Costa <rakuco@webkit.org>
+
+ [webkitpy] Remove Python 2.5-specific workaround from http_server_base.py.
+ https://bugs.webkit.org/show_bug.cgi?id=85852
+
+ Reviewed by Dirk Pranke.
+
+ * Scripts/webkitpy/layout_tests/servers/http_server_base.py:
+ (HttpServerBase._is_server_running_on_all_ports): Revert the part
+ of r89412 which was a workaround for an issue with Python 2.5 on
+ Mac 10.5.
+
+2012-05-07 Raphael Kubo da Costa <rakuco@FreeBSD.org>
+
+ webkitdirs.pm: Make determineNumberOfCPUs work on FreeBSD.
+ https://bugs.webkit.org/show_bug.cgi?id=81481
+
+ Reviewed by Dirk Pranke.
+
+ FreeBSD has the same sysctl interface present in Darwin to query
+ the number of CPUs available, so use that too.
+
+ * Scripts/webkitdirs.pm:
+ (determineNumberOfCPUs): Share the sysctl call with Darwin.
+ (isFreeBSD): Added.
+
+2012-05-07 Alexis Menard <alexis.menard@openbossa.org>
+
+ Unreviewed Qt build fix in Debug.
+
+ We need some system includes here for getpid() to be recognized.
+
+ * WebKitTestRunner/qt/main.cpp:
+
+2012-05-07 Ojan Vafai <ojan@chromium.org>
+
+ When embedding the flakiness dashboard, hide popups when the frame is blurred.
+ https://bugs.webkit.org/show_bug.cgi?id=85684
+
+ Reviewed by Dirk Pranke.
+
+ If you show a popup, then click elsewhere in garden-o-matic, it will now
+ properly hide it.
+
+ * TestResultServer/static-dashboards/dashboard_base.js:
+ (showPopup):
+ * TestResultServer/static-dashboards/flakiness_dashboard.js:
+ (showPopupForBuild):
+ (generatePageForIndividualTests.if):
+ (generatePageForIndividualTests):
+ * TestResultServer/static-dashboards/flakiness_dashboard_embedded_unittests.js: Added.
+ * TestResultServer/static-dashboards/flakiness_dashboard_unittests.js:
+ * TestResultServer/static-dashboards/run-embedded-unittests.html: Added.
+
+2012-05-07 Ian Vollick <vollick@chromium.org>
+
+ [chromium] WebViewHost should setCompositorSurfaceReady
+ https://bugs.webkit.org/show_bug.cgi?id=85418
+
+ Reviewed by James Robinson.
+
+ * DumpRenderTree/chromium/WebViewHost.cpp:
+ (WebViewHost::setWebWidget):
+
+2012-05-07 Jon Lee <jonlee@apple.com>
+
+ WebKitTestRunner needs layoutTestController.dumpFrameLoadCallbacks
+ https://bugs.webkit.org/show_bug.cgi?id=42331
+ <rdar://problem/8193641>
+
+ Reviewed by Darin Adler.
+
+ This patch sets up the framework for supporting dumpFrameLoadCallbacks, as well as
+ outputting some of the required strings. As tests become unskipped the other callbacks
+ can be supported.
+
+ * WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl: Add dumpFrameLoadCallbacks()
+ * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
+ (WTR::InjectedBundle::didReceiveMessage): pass in the dictionary containing keys needed to initialize
+ dump callbacks for the layoutTestController.
+ (WTR::InjectedBundle::booleanForKey): Helper function to extract boolean value from key in WKDictionaryRef.
+ Output some warning if we are trying to extract a value that is not a boolean.
+ (WTR::InjectedBundle::beginTesting): Update to take in the dictionary passed in by the TestController.
+ We cannot set the bits on the layoutTestController until it has been created in beginTesting().
+ * WebKitTestRunner/InjectedBundle/InjectedBundle.h:
+ * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
+ (WTR::InjectedBundle::didReceiveMessage):
+ (WTR):
+ (WTR::InjectedBundle::beginTesting):
+ * WebKitTestRunner/InjectedBundle/InjectedBundle.h:
+ (InjectedBundle):
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
+ (WTR):
+ (WTR::dumpFrameDescriptionSuitableForTestResult): Static function similar to
+ -[WebFrame _drt_descriptionSuitableForTestResult] in DumpRenderTree.
+ (WTR::InjectedBundlePage::didStartProvisionalLoadForFrame): Output string.
+ (WTR::InjectedBundlePage::didCommitLoadForFrame): Output string.
+ (WTR::InjectedBundlePage::didFinishLoadForFrame): Output string.
+ (WTR::InjectedBundlePage::didReceiveTitleForFrame): Output string.
+ (WTR::InjectedBundlePage::didCancelClientRedirectForFrame): Output string.
+ (WTR::InjectedBundlePage::willPerformClientRedirectForFrame): Output string. In WK1 it's
+ "willPerformClientRedirectToURL" so we will have to use that value here.
+ (WTR::InjectedBundlePage::didFinishDocumentLoadForFrame): Output string.
+ (WTR::InjectedBundlePage::didHandleOnloadEventsForFrame): Output string.
+ * WebKitTestRunner/InjectedBundle/LayoutTestController.cpp:
+ (WTR::LayoutTestController::LayoutTestController): Initialize to not dump frame load callbacks.
+ * WebKitTestRunner/InjectedBundle/LayoutTestController.h:
+ (WTR::LayoutTestController::dumpFrameLoadCallbacks): Change to use setShouldDumpFrameLoadCallbacks.
+ (WTR::LayoutTestController::setShouldDumpFrameLoadCallbacks): Set bit.
+ (WTR::LayoutTestController::shouldDumpFrameLoadCallbacks): Return bit.
+ (LayoutTestController): Added m_dumpFrameLoadCallbacks to track whether to dump the output.
+ * WebKitTestRunner/TestInvocation.cpp:
+ (WTR::shouldLogFrameLoadDelegates): Similar to DRT.
+ (WTR::TestInvocation::invoke): Based on the URL loaded, set the bit in the dictionary that gets passed
+ to the injected bundle.
+
+2012-05-07 Tommy Widenflycht <tommyw@google.com>
+
+ [chromium] MediaStream API: Enhance WebUserMediaClientMock and add a test for it
+ https://bugs.webkit.org/show_bug.cgi?id=85618
+
+ Reviewed by Adam Barth.
+
+ Adding the capability to control which MediaStreamTracks actually get created,
+ and adding a test that exercises the JS api using that capability.
+
+ * DumpRenderTree/chromium/WebUserMediaClientMock.cpp:
+ (WebKit::WebUserMediaClientMock::requestUserMedia):
+ * DumpRenderTree/chromium/WebUserMediaClientMock.h:
+ * DumpRenderTree/chromium/WebViewHost.cpp:
+ (WebViewHost::testMediaStreamClient):
+ * DumpRenderTree/chromium/WebViewHost.h:
+ (WebViewHost):
+
+2012-05-07 Zan Dobersek <zandobersek@gmail.com>
+
+ [Gtk] WebGL feature is not built anymore through build-webkit after r116251
+ https://bugs.webkit.org/show_bug.cgi?id=85788
+
+ Reviewed by Martin Robinson.
+
+ Enable WebGL by default for the Gtk port. The feature is already enabled by
+ default in configure.ac, so there's no reason it shouldn't be enabled when
+ building through build-webkit.
+
+ * Scripts/webkitperl/FeatureList.pm:
+
+2012-05-07 Csaba Osztrogonác <ossy@webkit.org>
+
+ Unittest fix after r116288, because now there are more than 5 hit for the 'Eric' word.
+ We have only 2 'Gavin', so it is a better choice than 'Eric' for unit testing.
+
+ Reviewed by Tor Arne Vestbø.
+
+ * Scripts/webkitpy/tool/bot/irc_command_unittest.py:
+ (IRCCommandTest.test_whois):
+
+2012-05-07 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r116299, r116301, and r116303.
+ http://trac.webkit.org/changeset/116299
+ http://trac.webkit.org/changeset/116301
+ http://trac.webkit.org/changeset/116303
+ https://bugs.webkit.org/show_bug.cgi?id=85795
+
+ Build is still broken (Requested by Ossy on #webkit).
+
+ * DumpRenderTree/qt/DumpRenderTree.pro:
+ * DumpRenderTree/qt/main.cpp:
+ (main):
+ * QtTestPlatformPlugin/QtTestPlatformPlugin.pro: Removed.
+ * QtTestPlatformPlugin/TestIntegration.cpp: Removed.
+ * QtTestPlatformPlugin/TestIntegration.h: Removed.
+ * QtTestPlatformPlugin/mac/TestFontDatabase.h: Removed.
+ * QtTestPlatformPlugin/mac/TestFontDatabase.mm: Removed.
+ * QtTestPlatformPlugin/mac/TestIntegrationMac.mm: Removed.
+ * QtTestPlatformPlugin/main.cpp: Removed.
+ * QtTestPlatformPlugin/testplatform.json: Removed.
+ * Tools.pro:
+ * WebKitTestRunner/Target.pri:
+ * WebKitTestRunner/qt/main.cpp:
+ (main):
+
+2012-05-07 Balazs Kelemen <kbalazs@webkit.org>
+
+ Unreviewed Qt build fix.
+
+ One more try to learn how to use
+ const with a pointer array.
+
+ * DumpRenderTree/qt/main.cpp:
+ (initializeTestPlatformPlugin):
+
+2012-05-07 Balazs Kelemen <kbalazs@webkit.org>
+
+ Unreviewed build fix after r116299.
+
+ * DumpRenderTree/qt/main.cpp:
+ (initializeTestPlatformPlugin):
+
+2012-05-07 Balazs Kelemen <kbalazs@webkit.org>
+
+ [Qt] Add test specific platform plugin to achieve unified layout test results
+ https://bugs.webkit.org/show_bug.cgi?id=80996
+
+ Reviewed by Simon Hausmann.
+
+ Added QtTestPlatformPlugin as a new project under Tools.
+ This is a Qt5-ish platform plugin that can be used to tweak the
+ platform support interfaces in order to unify layout test results.
+ For now it only overrides the font database on Mac and redirects
+ everything else to the real platform plugin. The font database it
+ provides mimics the way how we set up test fonts with fontconfig on Linux.
+ Make DumpRenderTree and WebKitTestRunner use this platform plugin.
+
+ * DumpRenderTree/qt/DumpRenderTree.pro:
+ * DumpRenderTree/qt/main.cpp:
+ (initializeTestPlatformPlugin):
+ (main):
+ * QtTestPlatformPlugin/QtTestPlatformPlugin.pro: Added.
+ * QtTestPlatformPlugin/TestIntegration.cpp: Added.
+ (TestIntegration::TestIntegration):
+ (TestIntegration::fontDatabase):
+ * QtTestPlatformPlugin/TestIntegration.h: Added.
+ (TestIntegration):
+ (TestIntegration::hasCapability):
+ (TestIntegration::createPlatformPixmap):
+ (TestIntegration::createPlatformWindow):
+ (TestIntegration::createPlatformBackingStore):
+ (TestIntegration::createPlatformOpenGLContext):
+ (TestIntegration::createPlatformSharedGraphicsCache):
+ (TestIntegration::guiThreadEventDispatcher):
+ (TestIntegration::clipboard):
+ (TestIntegration::drag):
+ (TestIntegration::inputContext):
+ (TestIntegration::accessibility):
+ (TestIntegration::nativeInterface):
+ (TestIntegration::services):
+ (TestIntegration::styleHint):
+ (TestIntegration::platformTheme):
+ * QtTestPlatformPlugin/mac/TestFontDatabase.h: Added.
+ (TestFontDatabase):
+ * QtTestPlatformPlugin/mac/TestFontDatabase.mm: Added.
+ (TestFontDatabase::populateFontDatabase):
+ * QtTestPlatformPlugin/mac/TestIntegrationMac.mm: Added.
+ (TestIntegration::fontDatabase):
+ * QtTestPlatformPlugin/main.cpp: Added.
+ (TestIntegrationPlugin::keys):
+ (TestIntegrationPlugin::create):
+ (TestIntegrationPlugin::initialize):
+ * QtTestPlatformPlugin/testplatform.json: Added.
+ * Tools.pro:
+ * WebKitTestRunner/Target.pri:
+ * WebKitTestRunner/qt/main.cpp:
+ (main):
+
+2012-05-07 Christophe Dumez <christophe.dumez@intel.com>
+
+ [EFL] media/video-poster-blocked-by-willsendrequest.html is flaky
+ https://bugs.webkit.org/show_bug.cgi?id=85609
+
+ Reviewed by Simon Hausmann.
+
+ Flakiness was caused by the fact that
+ media/crash-closing-page-with-media-as-plugin-fallback.html and
+ media/video-poster-blocked-by-willsendrequest.html use the same PNG
+ file as poster attribute in the video tag. The PNG file gets cached
+ when the first test is executed and this somehow causes the second
+ test to fail.
+
+ The flakiness was addressed by clearing the memory and page caches
+ between tests.
+
+ * DumpRenderTree/efl/DumpRenderTreeChrome.cpp:
+ (DumpRenderTreeChrome::resetDefaultsToConsistentValues):
+
+2012-05-07 Eric Seidel <eric@webkit.org>
+
+ Add values for all features to Qt's features.pri
+ https://bugs.webkit.org/show_bug.cgi?id=85746
+
+ Reviewed by Tor Arne Vestbø.
+
+ When generate-feature-files generates features.pri it provides a value
+ for every possible ENABLE_. In prepration for landing generate-feature-files
+ it seems appropriate to add a value for all possible ENABLEs to the existing
+ features.pri. This lets me make sure that I'm getting them all right!
+
+ * qmake/mkspecs/features/features.pri:
+
+2012-05-07 Adam Bergkvist <adam.bergkvist@ericsson.com>
+
+ Added myself as a committer.
+
+ Not reviewed.
+
+ * Scripts/webkitpy/common/config/committers.py:
+
2012-05-07 Sudarsana Nagineni <sudarsana.nagineni@linux.intel.com>
[EFL][DRT] Implement LayoutTestController::execCommand
diff --git a/Tools/DumpRenderTree/DumpRenderTree.gypi b/Tools/DumpRenderTree/DumpRenderTree.gypi
index b49a084b7..f80935f9b 100644
--- a/Tools/DumpRenderTree/DumpRenderTree.gypi
+++ b/Tools/DumpRenderTree/DumpRenderTree.gypi
@@ -93,7 +93,7 @@
'chromium/WebThemeEngineDRTMac.mm',
'chromium/WebThemeEngineDRTMac.h',
],
- }],
+ }],
],
}
}
diff --git a/Tools/DumpRenderTree/LayoutTestController.cpp b/Tools/DumpRenderTree/LayoutTestController.cpp
index c7e7971a2..836ddeff8 100644
--- a/Tools/DumpRenderTree/LayoutTestController.cpp
+++ b/Tools/DumpRenderTree/LayoutTestController.cpp
@@ -1717,10 +1717,6 @@ static JSValueRef setPageVisibilityCallback(JSContextRef context, JSObjectRef fu
static JSValueRef resetPageVisibilityCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
- // Has mac & windows implementation
- if (argumentCount < 1)
- return JSValueMakeUndefined(context);
-
LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
controller->resetPageVisibility();
return JSValueMakeUndefined(context);
@@ -1865,20 +1861,6 @@ static JSValueRef numberOfActiveAnimationsCallback(JSContextRef context, JSObjec
return JSValueMakeNumber(context, controller->numberOfActiveAnimations());
}
-static JSValueRef suspendAnimationsCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
-{
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
- controller->suspendAnimations();
- return JSValueMakeUndefined(context);
-}
-
-static JSValueRef resumeAnimationsCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
-{
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
- controller->resumeAnimations();
- return JSValueMakeUndefined(context);
-}
-
static JSValueRef waitForPolicyDelegateCallback(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t, const JSValueRef[], JSValueRef*)
{
LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
@@ -2354,8 +2336,6 @@ JSStaticFunction* LayoutTestController::staticFunctions()
{ "markerTextForListItem", markerTextForListItemCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "notifyDone", notifyDoneCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "numberOfActiveAnimations", numberOfActiveAnimationsCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
- { "suspendAnimations", suspendAnimationsCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
- { "resumeAnimations", resumeAnimationsCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "overridePreference", overridePreferenceCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "pageNumberForElementById", pageNumberForElementByIdCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "pageSizeAndMarginsInPixels", pageSizeAndMarginsInPixelsCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
diff --git a/Tools/DumpRenderTree/LayoutTestController.h b/Tools/DumpRenderTree/LayoutTestController.h
index a3e3e9b95..e3d3182dd 100644
--- a/Tools/DumpRenderTree/LayoutTestController.h
+++ b/Tools/DumpRenderTree/LayoutTestController.h
@@ -290,8 +290,6 @@ public:
bool pauseAnimationAtTimeOnElementWithId(JSStringRef animationName, double time, JSStringRef elementId);
bool pauseTransitionAtTimeOnElementWithId(JSStringRef propertyName, double time, JSStringRef elementId);
unsigned numberOfActiveAnimations() const;
- void suspendAnimations() const;
- void resumeAnimations() const;
void addOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef destinationProtocol, JSStringRef destinationHost, bool allowDestinationSubdomains);
void removeOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef destinationProtocol, JSStringRef destinationHost, bool allowDestinationSubdomains);
diff --git a/Tools/DumpRenderTree/blackberry/LayoutTestControllerBlackBerry.cpp b/Tools/DumpRenderTree/blackberry/LayoutTestControllerBlackBerry.cpp
index bd1a5bd66..a799b0414 100644
--- a/Tools/DumpRenderTree/blackberry/LayoutTestControllerBlackBerry.cpp
+++ b/Tools/DumpRenderTree/blackberry/LayoutTestControllerBlackBerry.cpp
@@ -705,18 +705,6 @@ void LayoutTestController::setViewModeMediaFeature(const JSStringRef mode)
notImplemented();
}
-void LayoutTestController::suspendAnimations() const
-{
- if (mainFrame && mainFrame->animation())
- mainFrame->animation()->suspendAnimations();
-}
-
-void LayoutTestController::resumeAnimations() const
-{
- if (mainFrame && mainFrame->animation())
- mainFrame->animation()->resumeAnimations();
-}
-
void LayoutTestController::setSerializeHTTPLoads(bool)
{
// FIXME: Implement if needed for https://bugs.webkit.org/show_bug.cgi?id=50758.
diff --git a/Tools/DumpRenderTree/chromium/EventSender.cpp b/Tools/DumpRenderTree/chromium/EventSender.cpp
index a15c72c3e..7ddaafbe6 100644
--- a/Tools/DumpRenderTree/chromium/EventSender.cpp
+++ b/Tools/DumpRenderTree/chromium/EventSender.cpp
@@ -286,6 +286,7 @@ EventSender::EventSender(TestShell* shell)
bindMethod("gestureScrollFirstPoint", &EventSender::gestureScrollFirstPoint);
bindMethod("gestureScrollUpdate", &EventSender::gestureScrollUpdate);
bindMethod("gestureTap", &EventSender::gestureTap);
+ bindMethod("gestureLongPress", &EventSender::gestureLongPress);
bindMethod("zoomPageIn", &EventSender::zoomPageIn);
bindMethod("zoomPageOut", &EventSender::zoomPageOut);
bindMethod("scalePageBy", &EventSender::scalePageBy);
@@ -1092,6 +1093,12 @@ void EventSender::gestureTap(const CppArgumentList& arguments, CppVariant* resul
gestureEvent(WebInputEvent::GestureTap, arguments);
}
+void EventSender::gestureLongPress(const CppArgumentList& arguments, CppVariant* result)
+{
+ result->setNull();
+ gestureEvent(WebInputEvent::GestureLongPress, arguments);
+}
+
void EventSender::gestureScrollFirstPoint(const CppArgumentList& arguments, CppVariant* result)
{
result->setNull();
@@ -1141,6 +1148,10 @@ void EventSender::gestureEvent(WebInputEvent::Type type, const CppArgumentList&
event.x = point.x;
event.y = point.y;
break;
+ case WebInputEvent::GestureLongPress:
+ event.x = point.x;
+ event.y = point.y;
+ break;
default:
ASSERT_NOT_REACHED();
}
diff --git a/Tools/DumpRenderTree/chromium/EventSender.h b/Tools/DumpRenderTree/chromium/EventSender.h
index 5d82d7898..bc8a6baa0 100644
--- a/Tools/DumpRenderTree/chromium/EventSender.h
+++ b/Tools/DumpRenderTree/chromium/EventSender.h
@@ -104,6 +104,7 @@ public:
void gestureScrollFirstPoint(const CppArgumentList&, CppVariant*);
void gestureScrollUpdate(const CppArgumentList&, CppVariant*);
void gestureTap(const CppArgumentList&, CppVariant*);
+ void gestureLongPress(const CppArgumentList&, CppVariant*);
void gestureEvent(WebKit::WebInputEvent::Type, const CppArgumentList&);
// Unimplemented stubs
diff --git a/Tools/DumpRenderTree/chromium/LayoutTestController.cpp b/Tools/DumpRenderTree/chromium/LayoutTestController.cpp
index 8bb531911..a56f4c35b 100644
--- a/Tools/DumpRenderTree/chromium/LayoutTestController.cpp
+++ b/Tools/DumpRenderTree/chromium/LayoutTestController.cpp
@@ -93,8 +93,10 @@ LayoutTestController::LayoutTestController(TestShell* shell)
// names to their methods will be done by calling bindToJavaScript() (defined
// by CppBoundClass, the parent to LayoutTestController).
bindMethod("addFileToPasteboardOnDrag", &LayoutTestController::addFileToPasteboardOnDrag);
+#if ENABLE(INPUT_SPEECH)
bindMethod("addMockSpeechInputResult", &LayoutTestController::addMockSpeechInputResult);
bindMethod("setMockSpeechInputDumpRect", &LayoutTestController::setMockSpeechInputDumpRect);
+#endif
bindMethod("addOriginAccessWhitelistEntry", &LayoutTestController::addOriginAccessWhitelistEntry);
bindMethod("addUserScript", &LayoutTestController::addUserScript);
bindMethod("addUserStyleSheet", &LayoutTestController::addUserStyleSheet);
@@ -132,7 +134,9 @@ LayoutTestController::LayoutTestController(TestShell* shell)
bindMethod("setIsolatedWorldSecurityOrigin", &LayoutTestController::setIsolatedWorldSecurityOrigin);
bindMethod("execCommand", &LayoutTestController::execCommand);
bindMethod("forceRedSelectionColors", &LayoutTestController::forceRedSelectionColors);
+#if ENABLE(NOTIFICATIONS)
bindMethod("grantDesktopNotificationPermission", &LayoutTestController::grantDesktopNotificationPermission);
+#endif
bindMethod("findString", &LayoutTestController::findString);
bindMethod("isCommandEnabled", &LayoutTestController::isCommandEnabled);
bindMethod("hasCustomPageSizeStyle", &LayoutTestController::hasCustomPageSizeStyle);
@@ -161,7 +165,6 @@ LayoutTestController::LayoutTestController(TestShell* shell)
bindMethod("removeOriginAccessWhitelistEntry", &LayoutTestController::removeOriginAccessWhitelistEntry);
bindMethod("repaintSweepHorizontally", &LayoutTestController::repaintSweepHorizontally);
bindMethod("resetPageVisibility", &LayoutTestController::resetPageVisibility);
- bindMethod("resumeAnimations", &LayoutTestController::resumeAnimations);
bindMethod("setAcceptsEditing", &LayoutTestController::setAcceptsEditing);
bindMethod("setAllowDisplayOfInsecureContent", &LayoutTestController::setAllowDisplayOfInsecureContent);
bindMethod("setAllowFileAccessFromFileURLs", &LayoutTestController::setAllowFileAccessFromFileURLs);
@@ -210,9 +213,10 @@ LayoutTestController::LayoutTestController(TestShell* shell)
bindMethod("setXSSAuditorEnabled", &LayoutTestController::setXSSAuditorEnabled);
bindMethod("setAsynchronousSpellCheckingEnabled", &LayoutTestController::setAsynchronousSpellCheckingEnabled);
bindMethod("showWebInspector", &LayoutTestController::showWebInspector);
+#if ENABLE(NOTIFICATIONS)
bindMethod("simulateDesktopNotificationClick", &LayoutTestController::simulateDesktopNotificationClick);
+#endif
bindMethod("startSpeechInput", &LayoutTestController::startSpeechInput);
- bindMethod("suspendAnimations", &LayoutTestController::suspendAnimations);
bindMethod("testRepaint", &LayoutTestController::testRepaint);
bindMethod("waitForPolicyDelegate", &LayoutTestController::waitForPolicyDelegate);
bindMethod("waitUntilDone", &LayoutTestController::waitUntilDone);
@@ -1059,32 +1063,6 @@ int LayoutTestController::numberOfActiveAnimations()
return controller->numberOfActiveAnimations();
}
-void LayoutTestController::suspendAnimations()
-{
- WebFrame* webFrame = m_shell->webView()->mainFrame();
- if (!webFrame)
- return;
-
- WebAnimationController* controller = webFrame->animationController();
- if (!controller)
- return;
-
- controller->suspendAnimations();
-}
-
-void LayoutTestController::resumeAnimations()
-{
- WebFrame* webFrame = m_shell->webView()->mainFrame();
- if (!webFrame)
- return;
-
- WebAnimationController* controller = webFrame->animationController();
- if (!controller)
- return;
-
- controller->resumeAnimations();
-}
-
void LayoutTestController::pauseAnimationAtTimeOnElementWithId(const CppArgumentList& arguments, CppVariant* result)
{
result->set(false);
@@ -1156,18 +1134,6 @@ void LayoutTestController::numberOfActiveAnimations(const CppArgumentList&, CppV
result->set(numberOfActiveAnimations());
}
-void LayoutTestController::suspendAnimations(const CppArgumentList&, CppVariant* result)
-{
- suspendAnimations();
- result->setNull();
-}
-
-void LayoutTestController::resumeAnimations(const CppArgumentList&, CppVariant* result)
-{
- resumeAnimations();
- result->setNull();
-}
-
void LayoutTestController::disableImageLoading(const CppArgumentList&, CppVariant* result)
{
m_shell->preferences()->loadsImagesAutomatically = false;
@@ -1186,6 +1152,7 @@ void LayoutTestController::callShouldCloseOnWebView(const CppArgumentList&, CppV
result->set(m_shell->webView()->dispatchBeforeUnloadEvent());
}
+#if ENABLE(NOTIFICATIONS)
void LayoutTestController::grantDesktopNotificationPermission(const CppArgumentList& arguments, CppVariant* result)
{
if (arguments.size() != 1 || !arguments[0].isString()) {
@@ -1211,6 +1178,7 @@ void LayoutTestController::simulateDesktopNotificationClick(const CppArgumentLis
#endif
result->set(false);
}
+#endif
void LayoutTestController::setDomainRelaxationForbiddenForURLScheme(const CppArgumentList& arguments, CppVariant* result)
{
@@ -1960,6 +1928,7 @@ void LayoutTestController::abortModal(const CppArgumentList& arguments, CppVaria
result->setNull();
}
+#if ENABLE(INPUT_SPEECH)
void LayoutTestController::addMockSpeechInputResult(const CppArgumentList& arguments, CppVariant* result)
{
result->setNull();
@@ -1979,6 +1948,7 @@ void LayoutTestController::setMockSpeechInputDumpRect(const CppArgumentList& arg
if (MockWebSpeechInputController* controller = m_shell->webViewHost()->speechInputControllerMock())
controller->setDumpRect(arguments[0].value.boolValue);
}
+#endif
void LayoutTestController::startSpeechInput(const CppArgumentList& arguments, CppVariant* result)
{
diff --git a/Tools/DumpRenderTree/chromium/LayoutTestController.h b/Tools/DumpRenderTree/chromium/LayoutTestController.h
index 7383ecfb5..7bdb4e143 100644
--- a/Tools/DumpRenderTree/chromium/LayoutTestController.h
+++ b/Tools/DumpRenderTree/chromium/LayoutTestController.h
@@ -243,16 +243,16 @@ public:
void enableAutoResizeMode(const CppArgumentList&, CppVariant*);
void disableAutoResizeMode(const CppArgumentList&, CppVariant*);
void numberOfActiveAnimations(const CppArgumentList&, CppVariant*);
- void suspendAnimations(const CppArgumentList&, CppVariant*);
- void resumeAnimations(const CppArgumentList&, CppVariant*);
void disableImageLoading(const CppArgumentList&, CppVariant*);
void setIconDatabaseEnabled(const CppArgumentList&, CppVariant*);
void dumpSelectionRect(const CppArgumentList&, CppVariant*);
+#if ENABLE(NOTIFICATIONS)
// Grants permission for desktop notifications to an origin
void grantDesktopNotificationPermission(const CppArgumentList&, CppVariant*);
// Simulates a click on a desktop notification.
void simulateDesktopNotificationClick(const CppArgumentList&, CppVariant*);
+#endif
void setDomainRelaxationForbiddenForURLScheme(const CppArgumentList&, CppVariant*);
void setDeferMainResourceDataLoad(const CppArgumentList&, CppVariant*);
@@ -374,8 +374,10 @@ public:
void abortModal(const CppArgumentList&, CppVariant*);
// Speech input related functions.
+#if ENABLE(INPUT_SPEECH)
void addMockSpeechInputResult(const CppArgumentList&, CppVariant*);
void setMockSpeechInputDumpRect(const CppArgumentList&, CppVariant*);
+#endif
void startSpeechInput(const CppArgumentList&, CppVariant*);
void layerTreeAsText(const CppArgumentList& args, CppVariant* result);
@@ -570,8 +572,6 @@ private:
bool pauseTransitionAtTimeOnElementWithId(const WebKit::WebString& propertyName, double time, const WebKit::WebString& elementId);
bool elementDoesAutoCompleteForElementWithId(const WebKit::WebString&);
int numberOfActiveAnimations();
- void suspendAnimations();
- void resumeAnimations();
// Used for test timeouts.
TaskList m_taskList;
diff --git a/Tools/DumpRenderTree/chromium/MockWebSpeechInputController.cpp b/Tools/DumpRenderTree/chromium/MockWebSpeechInputController.cpp
index a5fe3eda6..716222f9a 100644
--- a/Tools/DumpRenderTree/chromium/MockWebSpeechInputController.cpp
+++ b/Tools/DumpRenderTree/chromium/MockWebSpeechInputController.cpp
@@ -32,6 +32,8 @@
#include <wtf/text/CString.h>
#include <wtf/text/StringBuilder.h>
+#if ENABLE(INPUT_SPEECH)
+
using namespace WebKit;
PassOwnPtr<MockWebSpeechInputController> MockWebSpeechInputController::create(WebSpeechInputListener* listener)
@@ -196,3 +198,5 @@ void MockWebSpeechInputController::SpeechTask::runIfValid()
m_object->m_speechTask = 0;
m_object->speechTaskFired();
}
+
+#endif
diff --git a/Tools/DumpRenderTree/chromium/TestShell.cpp b/Tools/DumpRenderTree/chromium/TestShell.cpp
index 2e036f1a9..07a72e3f4 100644
--- a/Tools/DumpRenderTree/chromium/TestShell.cpp
+++ b/Tools/DumpRenderTree/chromium/TestShell.cpp
@@ -64,6 +64,7 @@
#include <cctype>
#include <vector>
#include <wtf/MD5.h>
+#include <wtf/OwnArrayPtr.h>
using namespace WebKit;
using namespace std;
@@ -666,7 +667,26 @@ void TestShell::dumpImage(SkCanvas* canvas) const
// Compute MD5 sum.
MD5 digester;
Vector<uint8_t, 16> digestValue;
+#if OS(ANDROID)
+ // On Android, pixel layout is RGBA (see third_party/skia/include/core/SkColorPriv.h);
+ // however, other Chrome platforms use BGRA (see skia/config/SkUserConfig.h).
+ // To match the checksum of other Chrome platforms, we need to reorder the layout of pixels.
+ // NOTE: The following code assumes we use SkBitmap::kARGB_8888_Config,
+ // which has been checked in device.makeOpaque() (see above).
+ const uint8_t* rawPixels = reinterpret_cast<const uint8_t*>(sourceBitmap.getPixels());
+ size_t bitmapSize = sourceBitmap.getSize();
+ OwnArrayPtr<uint8_t> reorderedPixels = adoptArrayPtr(new uint8_t[bitmapSize]);
+ for (size_t i = 0; i < bitmapSize; i += 4) {
+ reorderedPixels[i] = rawPixels[i + 2]; // R
+ reorderedPixels[i + 1] = rawPixels[i + 1]; // G
+ reorderedPixels[i + 2] = rawPixels[i]; // B
+ reorderedPixels[i + 3] = rawPixels[i + 3]; // A
+ }
+ digester.addBytes(reorderedPixels.get(), bitmapSize);
+ reorderedPixels.clear();
+#else
digester.addBytes(reinterpret_cast<const uint8_t*>(sourceBitmap.getPixels()), sourceBitmap.getSize());
+#endif
digester.checksum(digestValue);
string md5hash;
md5hash.reserve(16 * 2);
@@ -681,8 +701,13 @@ void TestShell::dumpImage(SkCanvas* canvas) const
// image is really expensive.
if (md5hash.compare(m_params.pixelHash)) {
std::vector<unsigned char> png;
+#if OS(ANDROID)
+ webkit_support::EncodeRGBAPNGWithChecksum(reinterpret_cast<const unsigned char*>(sourceBitmap.getPixels()), sourceBitmap.width(),
+ sourceBitmap.height(), static_cast<int>(sourceBitmap.rowBytes()), discardTransparency, md5hash, &png);
+#else
webkit_support::EncodeBGRAPNGWithChecksum(reinterpret_cast<const unsigned char*>(sourceBitmap.getPixels()), sourceBitmap.width(),
sourceBitmap.height(), static_cast<int>(sourceBitmap.rowBytes()), discardTransparency, md5hash, &png);
+#endif
m_printer->handleImage(md5hash.c_str(), m_params.pixelHash.c_str(), &png[0], png.size(), m_params.pixelFileName.c_str());
} else
diff --git a/Tools/DumpRenderTree/chromium/TestShell.h b/Tools/DumpRenderTree/chromium/TestShell.h
index c661c57a3..fc340248d 100644
--- a/Tools/DumpRenderTree/chromium/TestShell.h
+++ b/Tools/DumpRenderTree/chromium/TestShell.h
@@ -95,7 +95,9 @@ public:
EventSender* eventSender() const { return m_eventSender.get(); }
AccessibilityController* accessibilityController() const { return m_accessibilityController.get(); }
GamepadController* gamepadController() const { return m_gamepadController.get(); }
+#if ENABLE(NOTIFICATIONS)
NotificationPresenter* notificationPresenter() const { return m_notificationPresenter.get(); }
+#endif
TestEventPrinter* printer() const { return m_printer.get(); }
WebPreferences* preferences() { return &m_prefs; }
@@ -217,7 +219,9 @@ private:
OwnPtr<EventSender> m_eventSender;
OwnPtr<LayoutTestController> m_layoutTestController;
OwnPtr<TextInputController> m_textInputController;
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
OwnPtr<NotificationPresenter> m_notificationPresenter;
+#endif
OwnPtr<WebViewHost> m_webViewHost;
OwnPtr<WebKit::WebThread> m_webCompositorThread;
diff --git a/Tools/DumpRenderTree/chromium/WebUserMediaClientMock.cpp b/Tools/DumpRenderTree/chromium/WebUserMediaClientMock.cpp
index 722192376..4efeb82d3 100644
--- a/Tools/DumpRenderTree/chromium/WebUserMediaClientMock.cpp
+++ b/Tools/DumpRenderTree/chromium/WebUserMediaClientMock.cpp
@@ -42,43 +42,38 @@
namespace WebKit {
+class MockExtraData : public WebMediaStreamDescriptor::ExtraData {
+public:
+ int foo;
+};
+
PassOwnPtr<WebUserMediaClientMock> WebUserMediaClientMock::create()
{
return adoptPtr(new WebUserMediaClientMock());
}
-bool WebUserMediaClientMock::IsMockStream(const WebURL& url)
-{
- WebMediaStreamDescriptor descriptor(WebMediaStreamRegistry::lookupMediaStreamDescriptor(url));
- if (descriptor.isNull())
- return false;
-
- WebVector<WebMediaStreamSource> sourceVector;
- descriptor.sources(sourceVector);
- WebString trackId;
- for (size_t i = 0; i < sourceVector.size(); ++i) {
- if (sourceVector[i].type() == WebMediaStreamSource::TypeVideo) {
- trackId = sourceVector[i].id();
- break;
- }
- }
- return trackId.equals("mediastreamtest");
-}
-
void WebUserMediaClientMock::requestUserMedia(const WebUserMediaRequest& streamRequest, const WebVector<WebMediaStreamSource>& audioSourcesVector, const WebVector<WebMediaStreamSource>& videoSourcesVector)
{
ASSERT(!streamRequest.isNull());
-
WebUserMediaRequest request = streamRequest;
- const size_t size = 1;
- WebVector<WebMediaStreamSource> audioSources(size);
- WebVector<WebMediaStreamSource> videoSources(size);
- WebString trackId("mediastreamtest");
- WebString audioTrackName("AudioRecord");
- WebString videoTrackName("VideoCapture");
- audioSources[0].initialize(trackId, WebMediaStreamSource::TypeAudio, audioTrackName);
- videoSources[0].initialize(trackId, WebMediaStreamSource::TypeVideo, videoTrackName);
- request.requestSucceeded(audioSources, videoSources);
+
+ const size_t zero = 0;
+ const size_t one = 1;
+ WebVector<WebMediaStreamSource> audioSources(request.audio() ? one : zero);
+ WebVector<WebMediaStreamSource> videoSources(request.video() ? one : zero);
+
+ if (request.audio())
+ audioSources[0].initialize("MockAudioDevice#1", WebMediaStreamSource::TypeAudio, "Mock audio device");
+
+ if (request.video())
+ videoSources[0].initialize("MockVideoDevice#1", WebMediaStreamSource::TypeVideo, "Mock video device");
+
+ WebKit::WebMediaStreamDescriptor descriptor;
+ descriptor.initialize("foobar", audioSources, videoSources);
+
+ descriptor.setExtraData(new MockExtraData());
+
+ request.requestSucceeded(descriptor);
}
void WebUserMediaClientMock::cancelUserMediaRequest(const WebUserMediaRequest&)
diff --git a/Tools/DumpRenderTree/chromium/WebUserMediaClientMock.h b/Tools/DumpRenderTree/chromium/WebUserMediaClientMock.h
index 9c4970b8c..e2415985c 100644
--- a/Tools/DumpRenderTree/chromium/WebUserMediaClientMock.h
+++ b/Tools/DumpRenderTree/chromium/WebUserMediaClientMock.h
@@ -42,14 +42,11 @@
namespace WebKit {
-class WebUserMediaClientMock : public WebUserMediaClient,
- public webkit_support::MediaStreamUtil {
+class WebUserMediaClientMock : public WebUserMediaClient {
public:
static PassOwnPtr<WebUserMediaClientMock> create();
~WebUserMediaClientMock() { }
- bool IsMockStream(const WebURL&);
-
virtual void requestUserMedia(const WebUserMediaRequest&, const WebVector<WebMediaStreamSource>&, const WebVector<WebMediaStreamSource>&) OVERRIDE;
virtual void cancelUserMediaRequest(const WebUserMediaRequest&);
diff --git a/Tools/DumpRenderTree/chromium/WebViewHost.cpp b/Tools/DumpRenderTree/chromium/WebViewHost.cpp
index d845b7ec0..732bc7a9b 100644
--- a/Tools/DumpRenderTree/chromium/WebViewHost.cpp
+++ b/Tools/DumpRenderTree/chromium/WebViewHost.cpp
@@ -42,12 +42,14 @@
#include "WebDOMMessageEvent.h"
#include "WebDataSource.h"
#include "WebDeviceOrientationClientMock.h"
+#include "WebDocument.h"
#include "platform/WebDragData.h"
#include "WebElement.h"
#include "WebFrame.h"
#include "WebGeolocationClientMock.h"
#include "WebHistoryItem.h"
#include "WebIntent.h"
+#include "WebIntentServiceInfo.h"
#include "WebKit.h"
#include "WebNode.h"
#include "WebPluginParams.h"
@@ -1198,7 +1200,7 @@ void WebViewHost::removeIdentifierForRequest(unsigned identifier)
m_resourceIdentifierMap.remove(identifier);
}
-void WebViewHost::willSendRequest(WebFrame*, unsigned identifier, WebURLRequest& request, const WebURLResponse& redirectResponse)
+void WebViewHost::willSendRequest(WebFrame* frame, unsigned identifier, WebURLRequest& request, const WebURLResponse& redirectResponse)
{
// Need to use GURL for host() and SchemeIs()
GURL url = request.url();
@@ -1216,6 +1218,8 @@ void WebViewHost::willSendRequest(WebFrame*, unsigned identifier, WebURLRequest&
fputs("\n", stdout);
}
+ request.setExtraData(webkit_support::CreateWebURLRequestExtraData(frame->document().referrerPolicy()));
+
if (!redirectResponse.isNull() && m_blocksRedirects) {
fputs("Returning null for this redirect\n", stdout);
// To block the request, we set its URL to an empty one.
@@ -1322,6 +1326,12 @@ bool WebViewHost::willCheckAndDispatchMessageEvent(WebFrame* source, WebSecurity
return false;
}
+void WebViewHost::registerIntentService(WebKit::WebFrame*, const WebKit::WebIntentServiceInfo& service)
+{
+ printf("Registered Web Intent Service: action=%s type=%s title=%s url=%s disposition=%s\n",
+ service.action().utf8().data(), service.type().utf8().data(), service.title().utf8().data(), service.url().spec().data(), service.disposition().utf8().data());
+}
+
void WebViewHost::dispatchIntent(WebFrame* source, const WebIntentRequest& request)
{
printf("Received Web Intent: action=%s type=%s\n",
@@ -1377,6 +1387,7 @@ void WebViewHost::setWebWidget(WebKit::WebWidget* widget)
{
m_webWidget = widget;
webView()->setSpellCheckClient(this);
+ webView()->setCompositorSurfaceReady();
}
WebView* WebViewHost::webView() const
@@ -1693,15 +1704,10 @@ void WebViewHost::exitFullScreenNow()
}
#if ENABLE(MEDIA_STREAM)
-webkit_support::MediaStreamUtil* WebViewHost::mediaStreamUtil()
-{
- return userMediaClientMock();
-}
-
webkit_support::TestMediaStreamClient* WebViewHost::testMediaStreamClient()
{
if (!m_testMediaStreamClient.get())
- m_testMediaStreamClient = adoptPtr(new webkit_support::TestMediaStreamClient(mediaStreamUtil()));
+ m_testMediaStreamClient = adoptPtr(new webkit_support::TestMediaStreamClient());
return m_testMediaStreamClient.get();
}
#endif
diff --git a/Tools/DumpRenderTree/chromium/WebViewHost.h b/Tools/DumpRenderTree/chromium/WebViewHost.h
index 706035d33..62bd04cf7 100644
--- a/Tools/DumpRenderTree/chromium/WebViewHost.h
+++ b/Tools/DumpRenderTree/chromium/WebViewHost.h
@@ -57,6 +57,7 @@ class WebDeviceOrientationClientMock;
class WebGeolocationClient;
class WebGeolocationClientMock;
class WebGeolocationServiceMock;
+class WebIntentServiceInfo;
class WebSharedWorkerClient;
class WebSpeechInputController;
class WebSpeechInputListener;
@@ -239,7 +240,8 @@ class WebViewHost : public WebKit::WebSpellCheckClient, public WebKit::WebViewCl
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 bool willCheckAndDispatchMessageEvent(WebKit::WebFrame* source, WebKit::WebSecurityOrigin target, WebKit::WebDOMMessageEvent);
- virtual void dispatchIntent(WebKit::WebFrame* source, const WebKit::WebIntentRequest&);
+ virtual void registerIntentService(WebKit::WebFrame*, const WebKit::WebIntentServiceInfo&);
+ virtual void dispatchIntent(WebKit::WebFrame*, const WebKit::WebIntentRequest&);
WebKit::WebDeviceOrientationClientMock* deviceOrientationClientMock();
@@ -315,7 +317,6 @@ private:
#if ENABLE(MEDIA_STREAM)
WebKit::WebUserMediaClientMock* userMediaClientMock();
- webkit_support::MediaStreamUtil* mediaStreamUtil();
webkit_support::TestMediaStreamClient* testMediaStreamClient();
#endif
diff --git a/Tools/DumpRenderTree/efl/CMakeLists.txt b/Tools/DumpRenderTree/efl/CMakeLists.txt
index ad0ae2dcb..0416e0121 100644
--- a/Tools/DumpRenderTree/efl/CMakeLists.txt
+++ b/Tools/DumpRenderTree/efl/CMakeLists.txt
@@ -15,6 +15,7 @@ SET(DumpRenderTree_SOURCES
${TOOLS_DIR}/DumpRenderTree/efl/JSStringUtils.cpp
${TOOLS_DIR}/DumpRenderTree/efl/LayoutTestControllerEfl.cpp
${TOOLS_DIR}/DumpRenderTree/efl/PixelDumpSupportEfl.cpp
+ ${TOOLS_DIR}/DumpRenderTree/efl/TextInputController.cpp
${TOOLS_DIR}/DumpRenderTree/efl/WorkQueueItemEfl.cpp
)
diff --git a/Tools/DumpRenderTree/efl/DumpRenderTree.cpp b/Tools/DumpRenderTree/efl/DumpRenderTree.cpp
index b716c5337..d8931f052 100644
--- a/Tools/DumpRenderTree/efl/DumpRenderTree.cpp
+++ b/Tools/DumpRenderTree/efl/DumpRenderTree.cpp
@@ -250,6 +250,8 @@ static void runTest(const char* cTestPathOrURL)
gLayoutTestController->closeWebInspector();
gLayoutTestController->setDeveloperExtrasEnabled(false);
+ browser->clearExtraViews();
+
ewk_view_uri_set(browser->mainView(), "about:blank");
gLayoutTestController.clear();
diff --git a/Tools/DumpRenderTree/efl/DumpRenderTreeChrome.cpp b/Tools/DumpRenderTree/efl/DumpRenderTreeChrome.cpp
index 7fe1c19c2..9f74416ab 100644
--- a/Tools/DumpRenderTree/efl/DumpRenderTreeChrome.cpp
+++ b/Tools/DumpRenderTree/efl/DumpRenderTreeChrome.cpp
@@ -33,6 +33,7 @@
#include "GCController.h"
#include "LayoutTestController.h"
#include "NotImplemented.h"
+#include "TextInputController.h"
#include "WebCoreSupport/DumpRenderTreeSupportEfl.h"
#include "WebCoreTestSupport.h"
#include "WorkQueue.h"
@@ -107,6 +108,7 @@ Evas_Object* DumpRenderTreeChrome::createView() const
evas_object_smart_callback_add(view, "frame,created", onFrameCreated, 0);
Evas_Object* mainFrame = ewk_view_frame_main_get(view);
+ evas_object_smart_callback_add(mainFrame, "icon,changed", onFrameIconChanged, 0);
evas_object_smart_callback_add(mainFrame, "load,provisional", onFrameProvisionalLoad, 0);
evas_object_smart_callback_add(mainFrame, "load,committed", onFrameLoadCommitted, 0);
evas_object_smart_callback_add(mainFrame, "load,finished", onFrameLoadFinished, 0);
@@ -166,6 +168,14 @@ Vector<Evas_Object*> DumpRenderTreeChrome::extraViews() const
return m_extraViews;
}
+void DumpRenderTreeChrome::clearExtraViews()
+{
+ Vector<Evas_Object*>::iterator it = m_extraViews.begin();
+ for (; it != m_extraViews.end(); ++it)
+ evas_object_del(*it);
+ m_extraViews.clear();
+}
+
Evas_Object* DumpRenderTreeChrome::mainFrame() const
{
return m_mainFrame;
@@ -193,17 +203,14 @@ static inline const char* defaultEditingBehavior()
void DumpRenderTreeChrome::resetDefaultsToConsistentValues()
{
- Vector<Evas_Object*>::iterator it = m_extraViews.begin();
- for (; it != m_extraViews.end(); ++it)
- evas_object_del(*it);
- m_extraViews.clear();
-
ewk_settings_icon_database_clear();
ewk_settings_icon_database_path_set(0);
ewk_settings_web_database_clear();
ewk_settings_web_database_default_quota_set(5 * 1024 * 1024);
+ ewk_settings_memory_cache_clear();
+
ewk_view_setting_private_browsing_set(mainView(), EINA_FALSE);
ewk_view_setting_spatial_navigation_set(mainView(), EINA_FALSE);
ewk_view_setting_enable_frame_flattening_set(mainView(), EINA_FALSE);
@@ -236,6 +243,7 @@ void DumpRenderTreeChrome::resetDefaultsToConsistentValues()
ewk_view_zoom_set(mainView(), 1.0, 0, 0);
ewk_view_scale_set(mainView(), 1.0, 0, 0);
ewk_view_text_zoom_set(mainView(), 1.0);
+ ewk_view_visibility_state_set(mainView(), EWK_PAGE_VISIBILITY_STATE_VISIBLE, true);
ewk_history_clear(ewk_view_history_get(mainView()));
@@ -246,6 +254,8 @@ void DumpRenderTreeChrome::resetDefaultsToConsistentValues()
DumpRenderTreeSupportEfl::clearFrameName(mainFrame());
DumpRenderTreeSupportEfl::clearOpener(mainFrame());
+ DumpRenderTreeSupportEfl::clearUserScripts(mainView());
+ DumpRenderTreeSupportEfl::clearUserStyleSheets(mainView());
DumpRenderTreeSupportEfl::setInteractiveFormValidationEnabled(mainView(), true);
DumpRenderTreeSupportEfl::setAuthorAndUserStylesEnabled(mainView(), true);
DumpRenderTreeSupportEfl::setSmartInsertDeleteEnabled(mainView(), false);
@@ -356,12 +366,18 @@ void DumpRenderTreeChrome::onWindowObjectCleared(void* userData, Evas_Object*, v
gcController->makeWindowObject(objectClearedInfo->context, objectClearedInfo->windowObject, &exception);
ASSERT(!exception);
- JSRetainPtr<JSStringRef> controllerName(JSStringCreateWithUTF8CString("eventSender"));
+ JSRetainPtr<JSStringRef> controllerName(Adopt, JSStringCreateWithUTF8CString("eventSender"));
JSObjectSetProperty(objectClearedInfo->context, objectClearedInfo->windowObject,
controllerName.get(),
makeEventSender(objectClearedInfo->context, !DumpRenderTreeSupportEfl::frameParent(objectClearedInfo->frame)),
kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete, 0);
+ JSRetainPtr<JSStringRef> textInputControllerName(JSStringCreateWithUTF8CString("textInputController"));
+ JSObjectSetProperty(objectClearedInfo->context, objectClearedInfo->windowObject,
+ textInputControllerName.get(),
+ makeTextInputController(objectClearedInfo->context),
+ kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete, 0);
+
WebCoreTestSupport::injectInternalsObject(objectClearedInfo->context);
}
@@ -406,6 +422,14 @@ void DumpRenderTreeChrome::onStatusbarTextSet(void*, Evas_Object*, void* eventIn
printf("UI DELEGATE STATUS CALLBACK: setStatusText:%s\n", statusbarText);
}
+void DumpRenderTreeChrome::onFrameIconChanged(void*, Evas_Object* frame, void*)
+{
+ if (!done && gLayoutTestController->dumpIconChanges()) {
+ const String frameName(DumpRenderTreeSupportEfl::suitableDRTFrameName(frame));
+ printf("%s - didChangeIcons\n", frameName.utf8().data());
+ }
+}
+
void DumpRenderTreeChrome::onTitleChanged(void*, Evas_Object*, void* eventInfo)
{
if (!gLayoutTestController->dumpTitleChanges())
@@ -494,6 +518,7 @@ void DumpRenderTreeChrome::onFrameCreated(void*, Evas_Object*, void* eventInfo)
{
Evas_Object* frame = static_cast<Evas_Object*>(eventInfo);
+ evas_object_smart_callback_add(frame, "icon,changed", onFrameIconChanged, 0);
evas_object_smart_callback_add(frame, "load,provisional", onFrameProvisionalLoad, 0);
evas_object_smart_callback_add(frame, "load,committed", onFrameLoadCommitted, 0);
evas_object_smart_callback_add(frame, "load,finished", onFrameLoadFinished, 0);
diff --git a/Tools/DumpRenderTree/efl/DumpRenderTreeChrome.h b/Tools/DumpRenderTree/efl/DumpRenderTreeChrome.h
index cba3dbdcf..7d63a19bb 100644
--- a/Tools/DumpRenderTree/efl/DumpRenderTreeChrome.h
+++ b/Tools/DumpRenderTree/efl/DumpRenderTreeChrome.h
@@ -47,6 +47,8 @@ public:
void removeWindow(Evas_Object*);
Vector<Evas_Object*> extraViews() const;
+ void clearExtraViews();
+
Evas_Object* mainFrame() const;
Evas_Object* mainView() const;
@@ -89,6 +91,8 @@ private:
static void onFrameCreated(void*, Evas_Object*, void*);
+ static void onFrameIconChanged(void*, Evas_Object*, void*);
+
static void onFrameProvisionalLoad(void*, Evas_Object*, void*);
static void onFrameLoadCommitted(void*, Evas_Object*, void*);
diff --git a/Tools/DumpRenderTree/efl/EventSender.cpp b/Tools/DumpRenderTree/efl/EventSender.cpp
index 2bed5c900..ed606ff75 100644
--- a/Tools/DumpRenderTree/efl/EventSender.cpp
+++ b/Tools/DumpRenderTree/efl/EventSender.cpp
@@ -103,6 +103,11 @@ enum ZoomEvent {
ZoomOut
};
+enum EventQueueStrategy {
+ FeedQueuedEvents,
+ DoNotFeedQueuedEvents
+};
+
struct KeyEventInfo {
KeyEventInfo(const CString& keyName, EvasKeyModifier modifiers)
: keyName(keyName)
@@ -114,6 +119,45 @@ struct KeyEventInfo {
EvasKeyModifier modifiers;
};
+struct MouseEventInfo {
+ MouseEventInfo(EvasMouseEvent event, EvasKeyModifier modifiers = EvasKeyModifierNone, EvasMouseButton button = EvasMouseButtonNone, int horizontalDelta = 0, int verticalDelta = 0)
+ : event(event)
+ , modifiers(modifiers)
+ , button(button)
+ , horizontalDelta(horizontalDelta)
+ , verticalDelta(verticalDelta)
+ {
+ }
+
+ EvasMouseEvent event;
+ EvasKeyModifier modifiers;
+ EvasMouseButton button;
+ int horizontalDelta;
+ int verticalDelta;
+};
+
+struct DelayedEvent {
+ DelayedEvent(MouseEventInfo* eventInfo, unsigned long delay = 0)
+ : eventInfo(eventInfo)
+ , delay(delay)
+ {
+ }
+
+ MouseEventInfo* eventInfo;
+ unsigned long delay;
+};
+
+WTF::Vector<DelayedEvent>& delayedEventQueue()
+{
+ DEFINE_STATIC_LOCAL(WTF::Vector<DelayedEvent>, staticDelayedEventQueue, ());
+ return staticDelayedEventQueue;
+}
+
+
+static void feedOrQueueMouseEvent(MouseEventInfo*, EventQueueStrategy);
+static void feedMouseEvent(MouseEventInfo*);
+static void feedQueuedMouseEvents();
+
static void setEvasModifiers(Evas* evas, EvasKeyModifier modifiers)
{
static const char* modifierNames[] = { "Control", "Shift", "Alt", "Super" };
@@ -141,43 +185,10 @@ static EvasMouseButton translateMouseButtonNumber(int eventSenderButtonNumber)
return EvasMouseButtonLeft;
}
-static void sendMouseEvent(Evas* evas, EvasMouseEvent event, int buttonNumber, EvasKeyModifier modifiers)
-{
- unsigned timeStamp = 0;
-
- DumpRenderTreeSupportEfl::layoutFrame(browser->mainFrame());
-
- setEvasModifiers(evas, modifiers);
- if (event & EvasMouseEventMove)
- evas_event_feed_mouse_move(evas, gLastMousePositionX, gLastMousePositionY, timeStamp++, 0);
- if (event & EvasMouseEventDown) {
- unsigned flags = 0;
- if (gClickCount == 2)
- flags |= EVAS_BUTTON_DOUBLE_CLICK;
- else if (gClickCount == 3)
- flags |= EVAS_BUTTON_TRIPLE_CLICK;
-
- evas_event_feed_mouse_down(evas, buttonNumber, static_cast<Evas_Button_Flags>(flags), timeStamp++, 0);
- }
- if (event & EvasMouseEventUp)
- evas_event_feed_mouse_up(evas, buttonNumber, EVAS_BUTTON_NONE, timeStamp++, 0);
-
- const bool horizontal = !!(event & EvasMouseEventScrollLeft | event & EvasMouseEventScrollRight);
- const bool vertical = !!(event & EvasMouseEventScrollUp | event & EvasMouseEventScrollDown);
- if (vertical && horizontal) {
- evas_event_feed_mouse_wheel(evas, 0, (event & EvasMouseEventScrollUp) ? 10 : -10, timeStamp, 0);
- evas_event_feed_mouse_wheel(evas, 1, (event & EvasMouseEventScrollLeft) ? 10 : -10, timeStamp, 0);
- } else if (vertical)
- evas_event_feed_mouse_wheel(evas, 0, (event & EvasMouseEventScrollUp) ? 10 : -10, timeStamp, 0);
- else if (horizontal)
- evas_event_feed_mouse_wheel(evas, 1, (event & EvasMouseEventScrollLeft) ? 10 : -10, timeStamp, 0);
-
- setEvasModifiers(evas, EvasKeyModifierNone);
-}
-
static Eina_Bool sendClick(void*)
{
- sendMouseEvent(evas_object_evas_get(browser->mainFrame()), EvasMouseEventClick, EvasMouseButtonLeft, EvasKeyModifierNone);
+ MouseEventInfo* eventInfo = new MouseEventInfo(EvasMouseEventClick, EvasKeyModifierNone, EvasMouseButtonLeft);
+ feedOrQueueMouseEvent(eventInfo, FeedQueuedEvents);
return ECORE_CALLBACK_CANCEL;
}
@@ -225,7 +236,8 @@ static EvasKeyModifier modifiersFromJSValue(JSContextRef context, const JSValueR
return EvasKeyModifierNone;
unsigned modifier = 0;
- int modifiersCount = JSValueToNumber(context, JSObjectGetProperty(context, modifiersArray, JSStringCreateWithUTF8CString("length"), 0), 0);
+ JSRetainPtr<JSStringRef> lengthProperty(Adopt, JSStringCreateWithUTF8CString("length"));
+ int modifiersCount = JSValueToNumber(context, JSObjectGetProperty(context, modifiersArray, lengthProperty.get(), 0), 0);
for (int i = 0; i < modifiersCount; ++i)
modifier |= static_cast<unsigned>(modifierFromJSValue(context, JSObjectGetPropertyAtIndex(context, modifiersArray, i, 0)));
return static_cast<EvasKeyModifier>(modifier);
@@ -249,8 +261,8 @@ static JSValueRef mouseDownCallback(JSContextRef context, JSObjectRef function,
updateClickCount(button);
EvasKeyModifier modifiers = argumentCount >= 2 ? modifiersFromJSValue(context, arguments[1]) : EvasKeyModifierNone;
- sendMouseEvent(evas_object_evas_get(browser->mainFrame()), EvasMouseEventDown, button, modifiers);
-
+ MouseEventInfo* eventInfo = new MouseEventInfo(EvasMouseEventDown, modifiers, static_cast<EvasMouseButton>(button));
+ feedOrQueueMouseEvent(eventInfo, FeedQueuedEvents);
gButtonCurrentlyDown = button;
return JSValueMakeUndefined(context);
}
@@ -271,7 +283,8 @@ static JSValueRef mouseUpCallback(JSContextRef context, JSObjectRef function, JS
gButtonCurrentlyDown = 0;
EvasKeyModifier modifiers = argumentCount >= 2 ? modifiersFromJSValue(context, arguments[1]) : EvasKeyModifierNone;
- sendMouseEvent(evas_object_evas_get(browser->mainFrame()), EvasMouseEventUp, translateMouseButtonNumber(button), modifiers);
+ MouseEventInfo* eventInfo = new MouseEventInfo(EvasMouseEventUp, modifiers, translateMouseButtonNumber(button));
+ feedOrQueueMouseEvent(eventInfo, FeedQueuedEvents);
return JSValueMakeUndefined(context);
}
@@ -287,7 +300,22 @@ static JSValueRef mouseMoveToCallback(JSContextRef context, JSObjectRef function
if (exception && *exception)
return JSValueMakeUndefined(context);
- sendMouseEvent(evas_object_evas_get(browser->mainFrame()), EvasMouseEventMove, EvasMouseButtonNone, EvasKeyModifierNone);
+ MouseEventInfo* eventInfo = new MouseEventInfo(EvasMouseEventMove);
+ feedOrQueueMouseEvent(eventInfo, DoNotFeedQueuedEvents);
+ return JSValueMakeUndefined(context);
+}
+
+static JSValueRef leapForwardCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+ if (argumentCount > 0) {
+ const unsigned long leapForwardDelay = JSValueToNumber(context, arguments[0], exception);
+ if (delayedEventQueue().isEmpty())
+ delayedEventQueue().append(DelayedEvent(0, leapForwardDelay));
+ else
+ delayedEventQueue().last().delay = leapForwardDelay;
+ gTimeOffset += leapForwardDelay;
+ }
+
return JSValueMakeUndefined(context);
}
@@ -313,14 +341,17 @@ static JSValueRef mouseScrollByCallback(JSContextRef context, JSObjectRef functi
if (argumentCount < 2)
return JSValueMakeUndefined(context);
- const int horizontal = static_cast<int>(JSValueToNumber(context, arguments[0], exception));
+ // We need to invert scrolling values since in EFL negative z value means that
+ // canvas is scrolling down
+ const int horizontal = -(static_cast<int>(JSValueToNumber(context, arguments[0], exception)));
if (exception && *exception)
return JSValueMakeUndefined(context);
- const int vertical = static_cast<int>(JSValueToNumber(context, arguments[1], exception));
+ const int vertical = -(static_cast<int>(JSValueToNumber(context, arguments[1], exception)));
if (exception && *exception)
return JSValueMakeUndefined(context);
- sendMouseEvent(evas_object_evas_get(browser->mainFrame()), evasMouseEventFromHorizontalAndVerticalOffsets(horizontal, vertical), EvasMouseButtonNone, EvasKeyModifierNone);
+ MouseEventInfo* eventInfo = new MouseEventInfo(evasMouseEventFromHorizontalAndVerticalOffsets(horizontal, vertical), EvasKeyModifierNone, EvasMouseButtonNone, horizontal, vertical);
+ feedOrQueueMouseEvent(eventInfo, FeedQueuedEvents);
return JSValueMakeUndefined(context);
}
@@ -562,6 +593,7 @@ static JSStaticFunction staticFunctions[] = {
{ "mouseDown", mouseDownCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "mouseUp", mouseUpCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "mouseMoveTo", mouseMoveToCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+ { "leapForward", leapForwardCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "keyDown", keyDownCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "scheduleAsynchronousClick", scheduleAsynchronousClickCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "scheduleAsynchronousKeyDown", scheduleAsynchronousKeyDownCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
@@ -615,3 +647,68 @@ JSObjectRef makeEventSender(JSContextRef context, bool isTopFrame)
return JSObjectMake(context, getClass(context), 0);
}
+
+static void feedOrQueueMouseEvent(MouseEventInfo* eventInfo, EventQueueStrategy strategy)
+{
+ if (!delayedEventQueue().isEmpty()) {
+ if (delayedEventQueue().last().eventInfo)
+ delayedEventQueue().append(DelayedEvent(eventInfo));
+ else
+ delayedEventQueue().last().eventInfo = eventInfo;
+
+ if (strategy == FeedQueuedEvents)
+ feedQueuedMouseEvents();
+ } else
+ feedMouseEvent(eventInfo);
+}
+
+static void feedMouseEvent(MouseEventInfo* eventInfo)
+{
+ if (!eventInfo)
+ return;
+
+ unsigned timeStamp = 0;
+ Evas_Object* mainFrame = browser->mainFrame();
+ Evas* evas = evas_object_evas_get(mainFrame);
+ DumpRenderTreeSupportEfl::layoutFrame(mainFrame);
+ EvasMouseEvent event = eventInfo->event;
+
+ setEvasModifiers(evas, eventInfo->modifiers);
+
+ Evas_Button_Flags flags = EVAS_BUTTON_NONE;
+
+ // FIXME: We need to pass additional information with our events, so that
+ // we could construct correct PlatformWheelEvent. At the moment, max number
+ // of clicks is 3
+ if (gClickCount == 3)
+ flags = EVAS_BUTTON_TRIPLE_CLICK;
+ else if (gClickCount == 2)
+ flags = EVAS_BUTTON_DOUBLE_CLICK;
+
+ if (event & EvasMouseEventMove)
+ evas_event_feed_mouse_move(evas, gLastMousePositionX, gLastMousePositionY, timeStamp++, 0);
+ if (event & EvasMouseEventDown)
+ evas_event_feed_mouse_down(evas, eventInfo->button, flags, timeStamp++, 0);
+ if (event & EvasMouseEventUp)
+ evas_event_feed_mouse_up(evas, eventInfo->button, flags, timeStamp++, 0);
+ if (event & EvasMouseEventScrollLeft | event & EvasMouseEventScrollRight)
+ evas_event_feed_mouse_wheel(evas, 1, eventInfo->horizontalDelta, timeStamp, 0);
+ if (event & EvasMouseEventScrollUp | event & EvasMouseEventScrollDown)
+ evas_event_feed_mouse_wheel(evas, 0, eventInfo->verticalDelta, timeStamp, 0);
+
+ setEvasModifiers(evas, EvasKeyModifierNone);
+
+ delete eventInfo;
+}
+
+static void feedQueuedMouseEvents()
+{
+ WTF::Vector<DelayedEvent>::const_iterator it = delayedEventQueue().begin();
+ for (; it != delayedEventQueue().end(); it++) {
+ DelayedEvent delayedEvent = *it;
+ if (delayedEvent.delay)
+ usleep(delayedEvent.delay * 1000);
+ feedMouseEvent(delayedEvent.eventInfo);
+ }
+ delayedEventQueue().clear();
+}
diff --git a/Tools/DumpRenderTree/efl/LayoutTestControllerEfl.cpp b/Tools/DumpRenderTree/efl/LayoutTestControllerEfl.cpp
index bb7a50b66..29838bf45 100644
--- a/Tools/DumpRenderTree/efl/LayoutTestControllerEfl.cpp
+++ b/Tools/DumpRenderTree/efl/LayoutTestControllerEfl.cpp
@@ -184,7 +184,7 @@ JSStringRef LayoutTestController::pathToLocalResource(JSContextRef context, JSSt
void LayoutTestController::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->characters(), url->length()));
+ WebCore::KURL absoluteURL(baseURL, WTF::String(url->ustring().impl()));
JSRetainPtr<JSStringRef> jsAbsoluteURL(
Adopt, JSStringCreateWithUTF8CString(absoluteURL.string().utf8().data()));
@@ -270,7 +270,7 @@ void LayoutTestController::setUserStyleSheetLocation(JSStringRef path)
void LayoutTestController::setValueForUser(JSContextRef context, JSValueRef nodeObject, JSStringRef value)
{
- DumpRenderTreeSupportEfl::setValueForUser(context, nodeObject, value);
+ DumpRenderTreeSupportEfl::setValueForUser(context, nodeObject, WTF::String(value->ustring().impl()));
}
void LayoutTestController::setViewModeMediaFeature(JSStringRef mode)
@@ -515,7 +515,7 @@ bool LayoutTestController::findString(JSContextRef context, JSStringRef target,
options |= WebCore::StartInSelection;
}
- return DumpRenderTreeSupportEfl::findString(browser->mainView(), target->ustring().utf8().data(), options);
+ return DumpRenderTreeSupportEfl::findString(browser->mainView(), WTF::String(target->ustring().impl()), options);
}
bool LayoutTestController::isCommandEnabled(JSStringRef name)
@@ -648,16 +648,6 @@ unsigned LayoutTestController::numberOfActiveAnimations() const
return DumpRenderTreeSupportEfl::activeAnimationsCount(browser->mainFrame());
}
-void LayoutTestController::suspendAnimations() const
-{
- DumpRenderTreeSupportEfl::suspendAnimations(browser->mainFrame());
-}
-
-void LayoutTestController::resumeAnimations() const
-{
- DumpRenderTreeSupportEfl::resumeAnimations(browser->mainFrame());
-}
-
static inline bool toBool(JSStringRef value)
{
return equals(value, "true") || equals(value, "1");
@@ -694,14 +684,14 @@ void LayoutTestController::overridePreference(JSStringRef key, JSStringRef value
fprintf(stderr, "LayoutTestController::overridePreference tried to override unknown preference '%s'.\n", value->ustring().utf8().data());
}
-void LayoutTestController::addUserScript(JSStringRef, bool, bool)
+void LayoutTestController::addUserScript(JSStringRef source, bool runAtStart, bool allFrames)
{
- notImplemented();
+ DumpRenderTreeSupportEfl::addUserScript(browser->mainView(), String(source->ustring().impl()), runAtStart, allFrames);
}
void LayoutTestController::addUserStyleSheet(JSStringRef source, bool allFrames)
{
- DumpRenderTreeSupportEfl::addUserStyleSheet(browser->mainView(), source->ustring().utf8().data(), allFrames);
+ DumpRenderTreeSupportEfl::addUserStyleSheet(browser->mainView(), WTF::String(source->ustring().impl()), allFrames);
}
void LayoutTestController::setDeveloperExtrasEnabled(bool enabled)
@@ -856,4 +846,6 @@ void LayoutTestController::setPageVisibility(const char* visibility)
ewk_view_visibility_state_set(browser->mainView(), EWK_PAGE_VISIBILITY_STATE_HIDDEN, false);
else if (newVisibility == "prerender")
ewk_view_visibility_state_set(browser->mainView(), EWK_PAGE_VISIBILITY_STATE_PRERENDER, false);
+ else if (newVisibility == "preview")
+ ewk_view_visibility_state_set(browser->mainView(), EWK_PAGE_VISIBILITY_STATE_PREVIEW, false);
}
diff --git a/Tools/DumpRenderTree/efl/PixelDumpSupportEfl.cpp b/Tools/DumpRenderTree/efl/PixelDumpSupportEfl.cpp
index 109374ec9..b164b80c3 100644
--- a/Tools/DumpRenderTree/efl/PixelDumpSupportEfl.cpp
+++ b/Tools/DumpRenderTree/efl/PixelDumpSupportEfl.cpp
@@ -37,26 +37,29 @@
#include "PixelDumpSupportCairo.h"
#include "RefPtrCairo.h"
#include "WebCoreSupport/DumpRenderTreeSupportEfl.h"
-#include "ewk_private.h"
+#include <Ecore_Evas.h>
+#include <Evas.h>
PassRefPtr<BitmapContext> createBitmapContextFromWebView(bool, bool, bool, bool drawSelectionRect)
{
- Ewk_View_Smart_Data* smartData = static_cast<Ewk_View_Smart_Data*>(evas_object_smart_data_get(browser->mainView()));
- Ewk_View_Private_Data* privateData = static_cast<Ewk_View_Private_Data*>(smartData->_priv);
- const Evas_Object* mainFrame = browser->mainFrame();
+ const Evas_Object* mainView = browser->mainView();
+ Evas* evas = evas_object_evas_get(mainView);
+ Ecore_Evas* ecoreEvas = ecore_evas_ecore_evas_get(evas);
- int x, y, width, height;
- if (!ewk_frame_visible_content_geometry_get(mainFrame, EINA_TRUE, &x, &y, &width, &height))
- return 0;
+ int width, height;
+ evas_object_geometry_get(mainView, 0, 0, &width, &height);
- RefPtr<cairo_surface_t> surface = adoptRef(cairo_image_surface_create(CAIRO_FORMAT_ARGB32, width, height));
- RefPtr<cairo_t> context = adoptRef(cairo_create(surface.get()));
+ const void* pixels = ecore_evas_buffer_pixels_get(ecoreEvas);
+ RefPtr<cairo_surface_t> viewSurface = adoptRef(cairo_image_surface_create_for_data(static_cast<unsigned char*>(const_cast<void*>(pixels)), CAIRO_FORMAT_ARGB32, width, height, width * 4));
- const Eina_Rectangle rect = { x, y, width, height };
- if (!ewk_view_paint(privateData, context.get(), &rect))
- return 0;
+ RefPtr<cairo_surface_t> imageSurface = adoptRef(cairo_image_surface_create(CAIRO_FORMAT_ARGB32, width, height));
+ RefPtr<cairo_t> context = adoptRef(cairo_create(imageSurface.get()));
+
+ cairo_set_source_surface(context.get(), viewSurface.get(), 0, 0);
+ cairo_paint(context.get());
if (drawSelectionRect) {
+ const Evas_Object* mainFrame = browser->mainFrame();
const WebCore::IntRect selectionRect = DumpRenderTreeSupportEfl::selectionRectangle(mainFrame);
if (!selectionRect.isEmpty()) {
diff --git a/Tools/DumpRenderTree/efl/TextInputController.cpp b/Tools/DumpRenderTree/efl/TextInputController.cpp
new file mode 100644
index 000000000..62b6d6be8
--- /dev/null
+++ b/Tools/DumpRenderTree/efl/TextInputController.cpp
@@ -0,0 +1,178 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ * Copyright (C) 2011 Igalia S.L.
+ * Copyright (C) 2012 Samsung Electronics
+ *
+ * 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 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 "TextInputController.h"
+
+#include "DumpRenderTree.h"
+#include "DumpRenderTreeChrome.h"
+#include "WebCoreSupport/DumpRenderTreeSupportEfl.h"
+#include <JavaScriptCore/JSObjectRef.h>
+#include <JavaScriptCore/JSRetainPtr.h>
+#include <JavaScriptCore/JSStringRef.h>
+#include <JavaScriptCore/OpaqueJSString.h>
+
+static JSValueRef setMarkedTextCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+ if (!browser->mainView() || argumentCount < 3)
+ return JSValueMakeUndefined(context);
+
+ JSStringRef string = JSValueToStringCopy(context, arguments[0], exception);
+
+ size_t bufferSize = JSStringGetMaximumUTF8CStringSize(string);
+ char* text = new char[bufferSize];
+ JSStringGetUTF8CString(string, text, bufferSize);
+ JSStringRelease(string);
+
+ int start = static_cast<int>(JSValueToNumber(context, arguments[1], exception));
+ int length = static_cast<int>(JSValueToNumber(context, arguments[2], exception));
+
+ DumpRenderTreeSupportEfl::setComposition(browser->mainView(), text, start, length);
+
+ delete[] text;
+ return JSValueMakeUndefined(context);
+}
+
+static JSValueRef hasMarkedTextCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+ if (!browser->mainView())
+ return JSValueMakeUndefined(context);
+
+ return JSValueMakeBoolean(context, DumpRenderTreeSupportEfl::hasComposition(browser->mainView()));
+}
+
+static JSValueRef markedRangeCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+ if (!browser->mainView())
+ return JSValueMakeUndefined(context);
+
+ int start, length;
+ if (!DumpRenderTreeSupportEfl::compositionRange(browser->mainView(), &start, &length))
+ return JSValueMakeUndefined(context);
+
+ JSValueRef arrayValues[2];
+ arrayValues[0] = JSValueMakeNumber(context, start);
+ arrayValues[1] = JSValueMakeNumber(context, length);
+ JSObjectRef arrayObject = JSObjectMakeArray(context, 2, arrayValues, exception);
+ return arrayObject;
+}
+
+static JSValueRef insertTextCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+ if (!browser->mainView() || argumentCount < 1)
+ return JSValueMakeUndefined(context);
+
+ JSStringRef string = JSValueToStringCopy(context, arguments[0], exception);
+
+ size_t bufferSize = JSStringGetMaximumUTF8CStringSize(string);
+ char* text = new char[bufferSize];
+ JSStringGetUTF8CString(string, text, bufferSize);
+ JSStringRelease(string);
+
+ DumpRenderTreeSupportEfl::confirmComposition(browser->mainView(), text);
+
+ delete[] text;
+ return JSValueMakeUndefined(context);
+}
+
+static JSValueRef unmarkTextCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+ if (!browser->mainView())
+ return JSValueMakeUndefined(context);
+
+ DumpRenderTreeSupportEfl::confirmComposition(browser->mainView(), 0);
+ return JSValueMakeUndefined(context);
+}
+
+static JSValueRef firstRectForCharacterRangeCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+ if (!browser->mainView() || argumentCount < 2)
+ return JSValueMakeUndefined(context);
+
+ int location = static_cast<int>(JSValueToNumber(context, arguments[0], exception));
+ int length = static_cast<int>(JSValueToNumber(context, arguments[1], exception));
+
+ WebCore::IntRect rect = DumpRenderTreeSupportEfl::firstRectForCharacterRange(browser->mainView(), location, length);
+
+ JSValueRef arrayValues[4];
+ arrayValues[0] = JSValueMakeNumber(context, rect.x());
+ arrayValues[1] = JSValueMakeNumber(context, rect.y());
+ arrayValues[2] = JSValueMakeNumber(context, rect.width());
+ arrayValues[3] = JSValueMakeNumber(context, rect.height());
+ JSObjectRef arrayObject = JSObjectMakeArray(context, 4, arrayValues, exception);
+ return arrayObject;
+}
+
+static JSValueRef selectedRangeCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+ if (!browser->mainView())
+ return JSValueMakeUndefined(context);
+
+ int start, length;
+ if (!DumpRenderTreeSupportEfl::selectedRange(browser->mainView(), &start, &length))
+ return JSValueMakeUndefined(context);
+
+ JSValueRef arrayValues[2];
+ arrayValues[0] = JSValueMakeNumber(context, start);
+ arrayValues[1] = JSValueMakeNumber(context, length);
+ JSObjectRef arrayObject = JSObjectMakeArray(context, 2, arrayValues, exception);
+ return arrayObject;
+}
+
+static JSStaticFunction staticFunctions[] = {
+ { "setMarkedText", setMarkedTextCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+ { "hasMarkedText", hasMarkedTextCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+ { "markedRange", markedRangeCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+ { "insertText", insertTextCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+ { "unmarkText", unmarkTextCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+ { "firstRectForCharacterRange", firstRectForCharacterRangeCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+ { "selectedRange", selectedRangeCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+ { 0, 0, 0 }
+};
+
+static JSClassRef getClass(JSContextRef context)
+{
+ static JSClassRef textInputControllerClass = 0;
+
+ if (!textInputControllerClass) {
+ JSClassDefinition classDefinition = {
+ 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
+ classDefinition.staticFunctions = staticFunctions;
+
+ textInputControllerClass = JSClassCreate(&classDefinition);
+ }
+
+ return textInputControllerClass;
+}
+
+JSObjectRef makeTextInputController(JSContextRef context)
+{
+ return JSObjectMake(context, getClass(context), 0);
+}
+
diff --git a/Tools/DumpRenderTree/efl/TextInputController.h b/Tools/DumpRenderTree/efl/TextInputController.h
new file mode 100644
index 000000000..5ee271983
--- /dev/null
+++ b/Tools/DumpRenderTree/efl/TextInputController.h
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ * Copyright (C) 2011 Igalia S.L.
+ * Copyright (C) 2012 Samsung Electronics
+ *
+ * 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 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 TextInputController_h
+#define TextInputController_h
+
+typedef const struct OpaqueJSContext* JSContextRef;
+typedef struct OpaqueJSValue* JSObjectRef;
+
+JSObjectRef makeTextInputController(JSContextRef);
+
+#endif
diff --git a/Tools/DumpRenderTree/gtk/EventSender.cpp b/Tools/DumpRenderTree/gtk/EventSender.cpp
index d396c52a3..92acbe733 100644
--- a/Tools/DumpRenderTree/gtk/EventSender.cpp
+++ b/Tools/DumpRenderTree/gtk/EventSender.cpp
@@ -298,7 +298,8 @@ static guint gdkModifersFromJSValue(JSContextRef context, const JSValueRef modif
return 0;
guint gdkModifiers = 0;
- int modifiersCount = JSValueToNumber(context, JSObjectGetProperty(context, modifiersArray, JSStringCreateWithUTF8CString("length"), 0), 0);
+ JSRetainPtr<JSStringRef> lengthProperty(Adopt, JSStringCreateWithUTF8CString("length"));
+ int modifiersCount = JSValueToNumber(context, JSObjectGetProperty(context, modifiersArray, lengthProperty.get(), 0), 0);
for (int i = 0; i < modifiersCount; ++i)
gdkModifiers |= gdkModifierFromJSValue(context, JSObjectGetPropertyAtIndex(context, modifiersArray, i, 0));
return gdkModifiers;
diff --git a/Tools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp b/Tools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp
index de80c750b..5eb7fbed4 100644
--- a/Tools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp
+++ b/Tools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp
@@ -787,16 +787,6 @@ unsigned LayoutTestController::numberOfActiveAnimations() const
return DumpRenderTreeSupportGtk::numberOfActiveAnimations(mainFrame);
}
-void LayoutTestController::suspendAnimations() const
-{
- DumpRenderTreeSupportGtk::suspendAnimations(mainFrame);
-}
-
-void LayoutTestController::resumeAnimations() const
-{
- DumpRenderTreeSupportGtk::resumeAnimations(mainFrame);
-}
-
static gboolean booleanFromValue(gchar* value)
{
return !g_ascii_strcasecmp(value, "true") || !g_ascii_strcasecmp(value, "1");
diff --git a/Tools/DumpRenderTree/mac/LayoutTestControllerMac.mm b/Tools/DumpRenderTree/mac/LayoutTestControllerMac.mm
index 79c363cf7..b8356c935 100644
--- a/Tools/DumpRenderTree/mac/LayoutTestControllerMac.mm
+++ b/Tools/DumpRenderTree/mac/LayoutTestControllerMac.mm
@@ -844,16 +844,6 @@ unsigned LayoutTestController::numberOfActiveAnimations() const
return [mainFrame _numberOfActiveAnimations];
}
-void LayoutTestController::suspendAnimations() const
-{
- return [mainFrame _suspendAnimations];
-}
-
-void LayoutTestController::resumeAnimations() const
-{
- return [mainFrame _resumeAnimations];
-}
-
void LayoutTestController::waitForPolicyDelegate()
{
setWaitToDump(true);
diff --git a/Tools/DumpRenderTree/qt/LayoutTestControllerQt.cpp b/Tools/DumpRenderTree/qt/LayoutTestControllerQt.cpp
index 464ac5382..3e875d1c5 100644
--- a/Tools/DumpRenderTree/qt/LayoutTestControllerQt.cpp
+++ b/Tools/DumpRenderTree/qt/LayoutTestControllerQt.cpp
@@ -569,20 +569,6 @@ unsigned LayoutTestController::numberOfActiveAnimations() const
return DumpRenderTreeSupportQt::numberOfActiveAnimations(frame);
}
-void LayoutTestController::suspendAnimations() const
-{
- QWebFrame* frame = m_drt->webPage()->mainFrame();
- Q_ASSERT(frame);
- DumpRenderTreeSupportQt::suspendAnimations(frame);
-}
-
-void LayoutTestController::resumeAnimations() const
-{
- QWebFrame* frame = m_drt->webPage()->mainFrame();
- Q_ASSERT(frame);
- DumpRenderTreeSupportQt::resumeAnimations(frame);
-}
-
void LayoutTestController::disableImageLoading()
{
m_drt->webPage()->settings()->setAttribute(QWebSettings::AutoLoadImages, false);
diff --git a/Tools/DumpRenderTree/qt/LayoutTestControllerQt.h b/Tools/DumpRenderTree/qt/LayoutTestControllerQt.h
index 9caa3a9f9..24ab097d1 100644
--- a/Tools/DumpRenderTree/qt/LayoutTestControllerQt.h
+++ b/Tools/DumpRenderTree/qt/LayoutTestControllerQt.h
@@ -187,8 +187,6 @@ public slots:
bool elementDoesAutoCompleteForElementWithId(const QString& elementId);
unsigned numberOfActiveAnimations() const;
- void suspendAnimations() const;
- void resumeAnimations() const;
void addOriginAccessWhitelistEntry(const QString& sourceOrigin, const QString& destinationProtocol, const QString& destinationHost, bool allowDestinationSubdomains);
void removeOriginAccessWhitelistEntry(const QString& sourceOrigin, const QString& destinationProtocol, const QString& destinationHost, bool allowDestinationSubdomains);
diff --git a/Tools/DumpRenderTree/win/LayoutTestControllerWin.cpp b/Tools/DumpRenderTree/win/LayoutTestControllerWin.cpp
index 8d60dfca5..fb237b115 100644
--- a/Tools/DumpRenderTree/win/LayoutTestControllerWin.cpp
+++ b/Tools/DumpRenderTree/win/LayoutTestControllerWin.cpp
@@ -1122,24 +1122,6 @@ unsigned LayoutTestController::numberOfActiveAnimations() const
return number;
}
-void LayoutTestController::suspendAnimations() const
-{
- COMPtr<IWebFramePrivate> framePrivate(Query, frame);
- if (!framePrivate)
- return;
-
- framePrivate->suspendAnimations();
-}
-
-void LayoutTestController::resumeAnimations() const
-{
- COMPtr<IWebFramePrivate> framePrivate(Query, frame);
- if (!framePrivate)
- return;
-
- framePrivate->resumeAnimations();
-}
-
static _bstr_t bstrT(JSStringRef jsString)
{
// The false parameter tells the _bstr_t constructor to adopt the BSTR we pass it.
diff --git a/Tools/DumpRenderTree/wx/LayoutTestControllerWx.cpp b/Tools/DumpRenderTree/wx/LayoutTestControllerWx.cpp
index c3a43d232..2139e7c01 100644
--- a/Tools/DumpRenderTree/wx/LayoutTestControllerWx.cpp
+++ b/Tools/DumpRenderTree/wx/LayoutTestControllerWx.cpp
@@ -313,16 +313,6 @@ unsigned LayoutTestController::numberOfActiveAnimations() const
return 0;
}
-void LayoutTestController::suspendAnimations() const
-{
- // FIXME: implement
-}
-
-void LayoutTestController::resumeAnimations() const
-{
- // FIXME: implement
-}
-
unsigned LayoutTestController::workerThreadCount() const
{
// FIXME: implement
diff --git a/Tools/MiniBrowser/mac/BrowserWindowController.m b/Tools/MiniBrowser/mac/BrowserWindowController.m
index 5144f5393..131bfa4dd 100644
--- a/Tools/MiniBrowser/mac/BrowserWindowController.m
+++ b/Tools/MiniBrowser/mac/BrowserWindowController.m
@@ -611,6 +611,7 @@ static void runOpenPanel(WKPageRef page, WKFrameRef frame, WKOpenPanelParameters
0, // didNewFirstVisuallyNonEmptyLayout
0, // willGoToBackForwardListItem
0, // interactionOccurredWhileProcessUnresponsive
+ 0, // pluginDidFail
};
WKPageSetPageLoaderClient(_webView.pageRef, &loadClient);
@@ -669,6 +670,7 @@ static void runOpenPanel(WKPageRef page, WKFrameRef frame, WKOpenPanelParameters
createNewPage,
mouseDidMoveOverElement,
0, // decidePolicyForNotificationPermissionRequest
+ 0, // unavailablePluginButtonClicked
};
WKPageSetPageUIClient(_webView.pageRef, &uiClient);
}
diff --git a/Tools/Scripts/build-dumprendertree b/Tools/Scripts/build-dumprendertree
index 717f934a1..4e206f4bc 100755
--- a/Tools/Scripts/build-dumprendertree
+++ b/Tools/Scripts/build-dumprendertree
@@ -46,6 +46,7 @@ Usage: $programName [options] [options to pass to build system]
--qt Build the Qt port
--wx Build the wxWindows port
--chromium Build the Chromium port
+ --efl Build the EFL port
EOF
GetOptions(
@@ -70,8 +71,8 @@ if (isAppleMacWebKit()) {
$result = buildXCodeProject("DumpRenderTree", $clean, XcodeOptions(), @ARGV);
} elsif (isAppleWinWebKit()) {
$result = buildVisualStudioProject("DumpRenderTree.sln", $clean);
-} elsif (isQt() || isGtk() || isWx() || isChromium()) {
- # Qt, Gtk wxWindows, and Chromium build everything in one shot. No need to build anything here.
+} elsif (isQt() || isGtk() || isWx() || isChromium() || isEfl()) {
+ # Qt, Gtk wxWindows, Chromium and EFL build everything in one shot. No need to build anything here.
$result = 0;
} else {
die "Building not defined for this platform!\n";
diff --git a/Tools/Scripts/build-webkit b/Tools/Scripts/build-webkit
index cba264b83..20595244b 100755
--- a/Tools/Scripts/build-webkit
+++ b/Tools/Scripts/build-webkit
@@ -245,7 +245,7 @@ if (isGtk()) {
push @projects, ("Source/WebKit2", "Tools/MiniBrowser") if osXVersion()->{"minor"} >= 6 and !$noWebKit2;
# Copy library and header from WebKitLibraries to a findable place in the product directory.
- (system("perl Tools/Scripts/copy-webkitlibraries-to-product-directory") == 0) or die;
+ (system("perl", "Tools/Scripts/copy-webkitlibraries-to-product-directory", $productDir) == 0) or die;
} elsif (isWinCairo()) {
(system("perl Tools/Scripts/update-webkit-wincairo-libs") == 0) or die;
} elsif (isAppleWinWebKit()) {
diff --git a/Tools/Scripts/copy-webkitlibraries-to-product-directory b/Tools/Scripts/copy-webkitlibraries-to-product-directory
index e81a0c413..2a128c5af 100755
--- a/Tools/Scripts/copy-webkitlibraries-to-product-directory
+++ b/Tools/Scripts/copy-webkitlibraries-to-product-directory
@@ -28,8 +28,8 @@ use FindBin;
use lib $FindBin::Bin;
use webkitdirs;
-my $productDir = $ENV{BUILT_PRODUCTS_DIR};
-$productDir = productDir() if !$productDir;
+my $productDir = shift @ARGV;
+$productDir = $ENV{BUILT_PRODUCTS_DIR} if !productDir;
chdirWebKit();
diff --git a/Tools/Scripts/old-run-webkit-tests b/Tools/Scripts/old-run-webkit-tests
index fdaee927c..a7908298b 100755
--- a/Tools/Scripts/old-run-webkit-tests
+++ b/Tools/Scripts/old-run-webkit-tests
@@ -1200,8 +1200,8 @@ if (isGtk()) {
push(@configurationArgs, '-2') if $useWebKitTestRunner;
system "Tools/Scripts/run-launcher", @configurationArgs, "file://".$testResults if $launchSafari;
} elsif (isQt()) {
- unshift @configurationArgs, qw(-style windows);
if (getQtVersion() lt "5.0") {
+ unshift @configurationArgs, qw(-style windows);
unshift @configurationArgs, qw(-graphicssystem raster);
}
if (isCygwin()) {
diff --git a/Tools/Scripts/run-gtk-tests b/Tools/Scripts/run-gtk-tests
index 3f9067108..3a07e9e6c 100755
--- a/Tools/Scripts/run-gtk-tests
+++ b/Tools/Scripts/run-gtk-tests
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Copyright (C) 2011 Igalia S.L.
+# Copyright (C) 2012 Igalia S.L.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
@@ -20,377 +20,18 @@
import subprocess
import os
import sys
-import optparse
-import re
-from signal import alarm, signal, SIGALRM, SIGKILL
-from gi.repository import Gio, GLib
-class SkippedTest:
- def __init__(self, test, reason, bug=None, test_cases=[]):
- self.test = test
- self.reason = reason
- self.bug = bug
- self.test_cases = test_cases
+api_tests_command = []
- def __str__(self):
- skipped_test_str = "%s" % self.test
- if self.test_cases:
- skipped_test_str += " [%s]" % ", ".join(self.test_cases)
- skipped_test_str += ": %s " % self.reason
- if self.bug is not None:
- skipped_test_str += "(https://bugs.webkit.org/show_bug.cgi?id=%d)" % self.bug
- return skipped_test_str
+top_level_directory = os.path.normpath(os.path.join(os.path.dirname(__file__), "..", ".."))
+run_api_tests_path = os.path.join(top_level_directory, 'Tools', 'gtk', 'run-api-tests')
-class TestTimeout(Exception):
- pass
+if os.path.exists(os.path.join(top_level_directory, 'WebKitBuild', 'Dependencies')):
+ jhbuild_wrapper_path = os.path.join(top_level_directory, 'Tools', 'jhbuild', 'jhbuild-wrapper')
+ api_tests_command = [jhbuild_wrapper_path, '--gtk', 'run', run_api_tests_path]
+else:
+ api_tests_command = [run_api_tests_path]
-class TestRunner:
+api_tests_command.extend(sys.argv[1:])
+sys.exit(subprocess.Popen(api_tests_command).wait())
- TEST_DIRS = [ "unittests", "WebKit2APITests", "TestWebKitAPI/WTF", "TestWebKitAPI/WebKit2" ]
-
- SKIPPED = [
- SkippedTest("unittests/testdownload",
- "Test fails in GTK Linux 64-bit Release bot",
- 82329,
- ["/webkit/download/not-found"]),
- SkippedTest("unittests/testwebview",
- "Test times out in GTK Linux 64-bit Release bot",
- 82328,
- ["/webkit/webview/icon-uri"]),
- SkippedTest("unittests/testwebresource",
- "Test fails in GTK Linux 64-bit Release bot",
- 82330,
- ["/webkit/webresource/sub_resource_loading"]),
- SkippedTest("unittests/testwebinspector",
- "Test is flaky in GTK Linux 32-bit Release bot",
- 82869,
- ["/webkit/webinspector/close-and-inspect"]),
- SkippedTest("WebKit2APITests/TestWebKitWebView",
- "Test is flaky in GTK Linux 32-bit Release bot",
- 82866,
- ["/webkit2/WebKitWebView/mouse-target"]),
- SkippedTest("WebKit2APITests/TestResources",
- "Test is flaky in GTK Linux 32-bit Release bot",
- 82868,
- ["/webkit2/WebKitWebView/resources"]),
- SkippedTest("TestWebKitAPI/WebKit2/TestWKConnection",
- "Test times out",
- 84959),
- SkippedTest("TestWebKitAPI/WebKit2/TestRestoreSessionStateContainingFormData",
- "Session State is not implemented in GTK+ port",
- 84960),
- SkippedTest("TestWebKitAPI/WebKit2/TestSpacebarScrolling",
- "Test fails",
- 84961),
- SkippedTest("TestWebKitAPI/WebKit2/TestNewFirstVisuallyNonEmptyLayoutFrames",
- "Test fails",
- 85037),
- SkippedTest("TestWebKitAPI/WebKit2/TestMouseMoveAfterCrash",
- "Test is flaky",
- 85066)
- ]
-
- def __init__(self, options, tests=[]):
-
- # FIXME: webkit-build-directory --configuration always returns
- # Release because we never call set-webkit-configuration.
- #build_directory_script = os.path.join(os.path.dirname(__file__), "webkit-build-directory")
- #build_directory = self._executive.run_command([build_directory_script, "--configuration"]).rstrip()
-
- self._options = options
- self._gtk_tools_directory = os.path.join(self._get_top_level_directory(), "Tools", "gtk")
- self._programs_path = os.path.join(self._get_build_directory(), "Programs")
- self._tests = self._get_tests(tests)
- self._skipped_tests = TestRunner.SKIPPED
-
- # These SPI daemons need to be active for the accessibility tests to work.
- self._spi_registryd = None
- self._spi_bus_launcher = None
-
- # run-gtk-tests may be run during make distcheck, which doesn't include jhbuild.
- self._jhbuild_path = os.path.join(self._gtk_tools_directory, "run-with-jhbuild")
- if not os.path.exists(self._jhbuild_path):
- self._jhbuild_path = None
-
- def _get_top_level_directory(self):
- return os.path.normpath(os.path.join(os.path.dirname(__file__), "..", ".."))
-
- def _get_build_directory(self):
- top_level = self._get_top_level_directory()
- if self._options.release:
- return os.path.join(top_level, 'WebKitBuild', 'Release')
- if self._options.debug:
- return os.path.join(top_level, 'WebKitBuild', 'Debug')
-
- build_directory = os.path.join(top_level, 'WebKitBuild', 'Release')
- if os.path.exists(os.path.join(build_directory, '.libs')):
- return build_directory
- build_directory = os.path.join(top_level, 'WebKitBuild', 'Debug')
- if os.path.exists(os.path.join(build_directory, '.libs')):
- return build_directory
- build_directory = os.path.join(top_level, '_build')
- if os.path.exists(os.path.join(build_directory, '.libs')):
- return build_directory
-
- return os.path.join(top_level, 'WebKitBuild')
-
- def _get_tests(self, tests):
- if tests:
- return tests
-
- tests = []
- for test_dir in self.TEST_DIRS:
- absolute_test_dir = os.path.join(self._programs_path, test_dir)
- if not os.path.isdir(absolute_test_dir):
- continue
- for test_file in os.listdir(absolute_test_dir):
- if not test_file.lower().startswith("test"):
- continue
- test_path = os.path.join(self._programs_path, test_dir, test_file)
- if os.path.isfile(test_path) and os.access(test_path, os.X_OK):
- tests.append(test_path)
- return tests
-
- def _create_process(self, command, stdout=None, stderr=None, env=os.environ):
- if self._jhbuild_path:
- command.insert(0, self._jhbuild_path)
- return subprocess.Popen(command, stdout=stdout, stderr=stderr, env=env)
-
- def _lookup_atspi2_binary(self, filename):
- process = self._create_process(['pkg-config', '--variable=exec_prefix', 'atspi-2'], stdout=subprocess.PIPE)
- stdout = process.communicate()[0]
- exec_prefix = stdout.rstrip('\r\n')
- for path in [ 'libexec', 'lib/at-spi2-core', 'lib32/at-spi2-core', 'lib64/at-spi2-core' ]:
- filepath = os.path.join(exec_prefix, path, filename)
- if os.path.isfile(filepath):
- return filepath
-
- return None
-
- def _start_accessibility_daemons(self):
- if not self._jhbuild_path:
- return False
-
- spi_bus_launcher_path = self._lookup_atspi2_binary('at-spi-bus-launcher')
- spi_registryd_path = self._lookup_atspi2_binary('at-spi2-registryd')
- if not spi_bus_launcher_path or not spi_registryd_path:
- return False
-
- try:
- self._ally_bus_launcher = self._create_process([spi_bus_launcher_path], env=self._test_env)
- except:
- sys.stderr.write("Failed to launch the accessibility bus\n")
- sys.stderr.flush()
- return False
-
- # We need to wait until the SPI bus is launched before trying to start the SPI
- # registry, so we spin a main loop until the bus name appears on DBus.
- loop = GLib.MainLoop()
- Gio.bus_watch_name(Gio.BusType.SESSION, 'org.a11y.Bus', Gio.BusNameWatcherFlags.NONE,
- lambda *args: loop.quit(), None)
- loop.run()
-
- try:
- self._spi_registryd = self._create_process([spi_registryd_path], env=self._test_env)
- except:
- sys.stderr.write("Failed to launch the accessibility registry\n")
- sys.stderr.flush()
- return False
-
- return True
-
- def _setup_testing_environment(self):
- self._test_env = os.environ
- self._test_env["DISPLAY"] = self._options.display
- self._test_env["WEBKIT_INSPECTOR_PATH"] = os.path.abspath(os.path.join(self._programs_path, 'resources', 'inspector'))
- self._test_env['GSETTINGS_BACKEND'] = 'memory'
- self._test_env["TEST_WEBKIT_API_WEBKIT2_RESOURCES_PATH"] = os.path.join(self._get_top_level_directory(), "Tools", "TestWebKitAPI", "Tests", "WebKit2")
- self._test_env["TEST_WEBKIT_API_WEBKIT2_INJECTED_BUNDLE_PATH"] = os.path.abspath(os.path.join(self._get_build_directory(), "Libraries"))
- self._test_env["WEBKIT_EXEC_PATH"] = self._programs_path
-
- try:
- self._xvfb = self._create_process(["Xvfb", self._options.display, "-screen", "0", "800x600x24", "-nolisten", "tcp"],
- stdout=subprocess.PIPE, stderr=subprocess.PIPE)
- except Exception as e:
- sys.stderr.write("Failed to run Xvfb: %s\n", e)
- sys.stderr.flush()
- return False
-
- # If we cannot start the accessibility daemons, we can just skip the accessibility tests.
- if not self._start_accessibility_daemons():
- print "Could not start accessibility bus, so skipping TestWebKitAccessibility"
- self._skipped_tests.append(SkippedTest("WebKit2APITests/TestWebKitAccessibility",
- "Could not start accessibility bus"))
- return True
-
- def _tear_down_testing_environment(self):
- if self._spi_registryd:
- self._spi_registryd.terminate()
- if self._spi_bus_launcher:
- self._spi_bus_launcher.terminate()
- self._xvfb.kill();
-
- def _find_skipped_test(self, test):
- for skipped in self._skipped_tests:
- if test.endswith(skipped.test):
- return skipped
- return None
-
- def _test_cases_to_skip(self, test):
- if self._options.skipped_action != 'skip':
- return []
-
- skipped = self._find_skipped_test(test)
- if skipped is not None:
- return skipped.test_cases
- return []
-
- def _should_run_test(self, test):
- # Skipped test are ignored, run all tests.
- if self._options.skipped_action == 'ignore':
- return True
-
- skipped = self._find_skipped_test(test)
- # By default skipped test are skipped, run them only when there are specific test cases failing.
- if self._options.skipped_action == 'skip':
- return skipped is None or skipped.test_cases
-
- # Run only skipped tests.
- return skipped is not None
-
- def _get_child_pid_from_test_output(self, output):
- if not output:
- return -1
- match = re.search(r'\(pid=(?P<child_pid>[0-9]+)\)', output)
- if not match:
- return -1
- return int(match.group('child_pid'))
-
- def _kill_process(self, pid):
- try:
- os.kill(pid, SIGKILL)
- except OSError:
- # Process already died.
- pass
-
- def _run_test_command(self, command, timeout=-1):
- def alarm_handler(signum, frame):
- raise TestTimeout
-
- p = self._create_process(command, stdout=subprocess.PIPE, env=self._test_env)
- if timeout > 0:
- signal(SIGALRM, alarm_handler)
- alarm(timeout)
-
- stdout = ""
- try:
- stdout = p.communicate()[0]
- if timeout > 0:
- alarm(0)
- sys.stdout.write(stdout)
- sys.stdout.flush()
- except TestTimeout:
- self._kill_process(p.pid)
- child_pid = self._get_child_pid_from_test_output(stdout)
- if child_pid > 0:
- self._kill_process(child_pid)
- raise
-
- return not p.returncode
-
- def _run_test_glib(self, test):
- tester_command = ['gtester']
- if self._options.verbose:
- tester_command.append('--verbose')
- for test_case in self._test_cases_to_skip(test):
- tester_command.extend(['-s', test_case])
- tester_command.append(test)
-
- return self._run_test_command(tester_command, self._options.timeout)
-
- def _run_test_google(self, test):
- tester_command = [test, "--gtest_throw_on_failure"]
- skipped_tests_cases = self._test_cases_to_skip(test)
- if skipped_tests_cases:
- tester_command.append("--gtest_filter=-%s" % ":".join(skipped_tests_cases))
-
- return self._run_test_command(tester_command, self._options.timeout)
-
- def _run_test(self, test):
- if "unittests" in test or "WebKit2APITests" in test:
- return self._run_test_glib(test)
-
- if "TestWebKitAPI" in test:
- return self._run_test_google(test)
-
- return False
-
- def run_tests(self):
- if not self._tests:
- sys.stderr.write("ERROR: tests not found in %s.\n" % (self._programs_path))
- sys.stderr.flush()
- return 1
-
- if not self._setup_testing_environment():
- return 1
-
- # Remove skipped tests now instead of when we find them, because
- # some tests might be skipped while setting up the test environment.
- self._tests = [test for test in self._tests if self._should_run_test(test)]
-
- failed_tests = []
- timed_out_tests = []
- try:
- for test in self._tests:
- success = True
- try:
- success = self._run_test(test)
- except TestTimeout:
- sys.stdout.write("TEST: %s: TIMEOUT\n" % test)
- sys.stdout.flush()
- timed_out_tests.append(test)
-
- if not success:
- failed_tests.append(test)
- finally:
- self._tear_down_testing_environment()
-
- if failed_tests:
- names = [test.replace(self._programs_path, '', 1) for test in failed_tests]
- sys.stdout.write("Tests failed: %s\n" % ", ".join(names))
- sys.stdout.flush()
-
- if timed_out_tests:
- names = [test.replace(self._programs_path, '', 1) for test in timed_out_tests]
- sys.stdout.write("Tests that timed out: %s\n" % ", ".join(names))
- sys.stdout.flush()
-
- if self._skipped_tests and self._options.skipped_action == 'skip':
- sys.stdout.write("Tests skipped:\n%s\n" % "\n".join([str(skipped) for skipped in self._skipped_tests]))
- sys.stdout.flush()
-
- return len(failed_tests)
-
-if __name__ == "__main__":
- option_parser = optparse.OptionParser(usage='usage: %prog [options] [test...]')
- option_parser.add_option('-r', '--release',
- action='store_true', dest='release',
- help='Run in Release')
- option_parser.add_option('-d', '--debug',
- action='store_true', dest='debug',
- help='Run in Debug')
- option_parser.add_option('-v', '--verbose',
- action='store_true', dest='verbose',
- help='Run gtester in verbose mode')
- option_parser.add_option('--display', action='store', dest='display', default=':55',
- help='Display to run Xvfb')
- option_parser.add_option('--skipped', action='store', dest='skipped_action',
- choices=['skip', 'ignore', 'only'], default='skip',
- metavar='skip|ignore|only',
- help='Specifies how to treat the skipped tests')
- option_parser.add_option('-t', '--timeout',
- action='store', type='int', dest='timeout', default=10,
- help='Time in seconds until a test times out')
- options, args = option_parser.parse_args()
-
- sys.exit(TestRunner(options, args).run_tests())
diff --git a/Tools/Scripts/webkitdirs.pm b/Tools/Scripts/webkitdirs.pm
index c471a9470..203853b94 100755
--- a/Tools/Scripts/webkitdirs.pm
+++ b/Tools/Scripts/webkitdirs.pm
@@ -29,6 +29,7 @@
# Module to share code to get to WebKit directories.
use strict;
+use version;
use warnings;
use Config;
use Digest::MD5 qw(md5_hex);
@@ -336,7 +337,7 @@ sub determineNumberOfCPUs
} elsif (isWindows() || isCygwin()) {
# Assumes cygwin
$numberOfCPUs = `ls /proc/registry/HKEY_LOCAL_MACHINE/HARDWARE/DESCRIPTION/System/CentralProcessor | wc -w`;
- } elsif (isDarwin()) {
+ } elsif (isDarwin() || isFreeBSD()) {
chomp($numberOfCPUs = `sysctl -n hw.ncpu`);
}
}
@@ -1257,6 +1258,11 @@ sub isLinux()
return ($^O eq "linux") || 0;
}
+sub isFreeBSD()
+{
+ return ($^O eq "freebsd") || 0;
+}
+
sub isARM()
{
return $Config{archname} =~ /^arm-/;
@@ -1482,9 +1488,15 @@ sub setupAppleWinEnv()
my $restartNeeded = 0;
my %variablesToSet = ();
- # Setting the environment variable 'CYGWIN' to 'tty' makes cygwin enable extra support (i.e., termios)
- # for UNIX-like ttys in the Windows console
- $variablesToSet{CYGWIN} = "tty" unless $ENV{CYGWIN};
+ # FIXME: We should remove this explicit version check for cygwin once we stop supporting Cygwin 1.7.9 or older versions.
+ # https://bugs.webkit.org/show_bug.cgi?id=85791
+ my $currentCygwinVersion = version->parse(`uname -r`);
+ my $firstCygwinVersionWithoutTTYSupport = version->parse("1.7.10");
+ if ($currentCygwinVersion < $firstCygwinVersionWithoutTTYSupport) {
+ # Setting the environment variable 'CYGWIN' to 'tty' makes cygwin enable extra support (i.e., termios)
+ # for UNIX-like ttys in the Windows console
+ $variablesToSet{CYGWIN} = "tty" unless $ENV{CYGWIN};
+ }
# Those environment variables must be set to be able to build inside Visual Studio.
$variablesToSet{WEBKITLIBRARIESDIR} = windowsLibrariesDir() unless $ENV{WEBKITLIBRARIESDIR};
diff --git a/Tools/Scripts/webkitperl/FeatureList.pm b/Tools/Scripts/webkitperl/FeatureList.pm
index 9a286807a..a4fb53504 100644
--- a/Tools/Scripts/webkitperl/FeatureList.pm
+++ b/Tools/Scripts/webkitperl/FeatureList.pm
@@ -65,6 +65,7 @@ my (
$geolocationSupport,
$highDPICanvasSupport,
$icondatabaseSupport,
+ $iframeSeamlessSupport,
$imageResizerSupport,
$indexedDatabaseSupport,
$inputSpeechSupport,
@@ -191,6 +192,9 @@ my @features = (
{ option => "icon-database", desc => "Toggle Icondatabase support",
define => "ENABLE_ICONDATABASE", default => 1, value => \$icondatabaseSupport },
+ { option => "iframe-seamless", desc => "Toggle iframe seamless attribute support",
+ define => "ENABLE_IFRAME_SEAMLESS", default => 1, value => \$iframeSeamlessSupport },
+
{ option => "indexed-database", desc => "Toggle Indexed Database support",
define => "ENABLE_INDEXED_DATABASE", default => 0, value => \$indexedDatabaseSupport },
@@ -333,7 +337,7 @@ my @features = (
define => "ENABLE_VIDEO_TRACK", default => (isAppleWebKit() || isGtk() || isEfl()), value => \$videoTrackSupport },
{ option => "webgl", desc => "Toggle WebGL support",
- define => "ENABLE_WEBGL", default => isAppleMacWebKit(), value => \$webglSupport },
+ define => "ENABLE_WEBGL", default => (isAppleMacWebKit() || isGtk()), value => \$webglSupport },
{ option => "web-audio", desc => "Toggle Web Audio support",
define => "ENABLE_WEB_AUDIO", default => 0, value => \$webAudioSupport },
diff --git a/Tools/Scripts/webkitpy/common/checkout/checkout_mock.py b/Tools/Scripts/webkitpy/common/checkout/checkout_mock.py
index 696f1427e..3c050aeb9 100644
--- a/Tools/Scripts/webkitpy/common/checkout/checkout_mock.py
+++ b/Tools/Scripts/webkitpy/common/checkout/checkout_mock.py
@@ -40,31 +40,51 @@ class MockCommitMessage(object):
return "This is a fake commit message that is at least 50 characters."
+committer_list = CommitterList()
+
+mock_revisions = {
+ 1: CommitInfo(852, "eric@webkit.org", {
+ "bug_id": 50000,
+ "author_name": "Adam Barth",
+ "author_email": "abarth@webkit.org",
+ "author": committer_list.contributor_by_email("abarth@webkit.org"),
+ "reviewer_text": "Darin Adler",
+ "reviewer": committer_list.committer_by_name("Darin Adler"),
+ "changed_files": [
+ "path/to/file",
+ "another/file",
+ ],
+ }),
+ 3001: CommitInfo(3001, "tomz@codeaurora.org", {
+ "bug_id": 50004,
+ "author_name": "Tom Zakrajsek",
+ "author_email": "tomz@codeaurora.org",
+ "author": committer_list.contributor_by_email("tomz@codeaurora.org"),
+ "reviewer_text": "Darin Adler",
+ "reviewer": committer_list.committer_by_name("Darin Adler"),
+ "changed_files": [
+ "path/to/file",
+ "another/file",
+ ],
+ })
+}
+
class MockCheckout(object):
def __init__(self):
# FIXME: It's unclear if a MockCheckout is very useful. A normal Checkout
# with a MockSCM/MockFileSystem/MockExecutive is probably better.
self._filesystem = MockFileSystem()
- # FIXME: This should move onto the Host object, and we should use a MockCommitterList for tests.
- _committer_list = CommitterList()
-
def commit_info_for_revision(self, svn_revision):
- # The real Checkout would probably throw an exception, but this is the only way tests have to get None back at the moment.
- if not svn_revision:
- return None
- return CommitInfo(svn_revision, "eric@webkit.org", {
- "bug_id": 50000,
- "author_name": "Adam Barth",
- "author_email": "abarth@webkit.org",
- "author": self._committer_list.contributor_by_email("abarth@webkit.org"),
- "reviewer_text": "Darin Adler",
- "reviewer": self._committer_list.committer_by_name("Darin Adler"),
- "changed_files": [
- "path/to/file",
- "another/file",
- ],
- })
+ # There are legacy tests that all expected these revision numbers to map
+ # to the same commit description (now mock_revisions[1])
+ if svn_revision in [32, 123, 852, 853, 854, 1234, 21654, 21655, 21656]:
+ return mock_revisions[1]
+
+ if svn_revision in mock_revisions:
+ return mock_revisions[svn_revision]
+
+ # any "unrecognized" svn_revision will return None.
def is_path_to_changelog(self, path):
return self._filesystem.basename(path) == "ChangeLog"
diff --git a/Tools/Scripts/webkitpy/common/config/committers.py b/Tools/Scripts/webkitpy/common/config/committers.py
index be0e61974..68e2f0d4e 100644
--- a/Tools/Scripts/webkitpy/common/config/committers.py
+++ b/Tools/Scripts/webkitpy/common/config/committers.py
@@ -172,6 +172,7 @@ contributors_who_are_not_committers = [
committers_unable_to_review = [
Committer("Aaron Boodman", "aa@chromium.org", "aboodman"),
+ Committer("Adam Bergkvist", "adam.bergkvist@ericsson.com", "adambe"),
Committer("Adam Klein", "adamk@chromium.org", "aklein"),
Committer("Adam Langley", "agl@chromium.org", "agl"),
Committer("Ademar de Souza Reis Jr", ["ademar.reis@gmail.com", "ademar@webkit.org"], "ademar"),
@@ -209,6 +210,7 @@ committers_unable_to_review = [
Committer("Carlos Garcia Campos", ["cgarcia@igalia.com", "carlosgc@gnome.org", "carlosgc@webkit.org"], "KaL"),
Committer("Carol Szabo", ["carol@webkit.org", "carol.szabo@nokia.com"], "cszabo1"),
Committer("Cary Clark", ["caryclark@google.com", "caryclark@chromium.org"], "caryclark"),
+ Committer("Charles Reis", "creis@chromium.org", "creis"),
Committer("Charles Wei", ["charles.wei@torchmobile.com.cn"], "cswei"),
Committer("Chris Evans", ["cevans@google.com", "cevans@chromium.org"]),
Committer("Chris Guillory", ["ctguil@chromium.org", "chris.guillory@google.com"], "ctguil"),
diff --git a/Tools/Scripts/webkitpy/common/config/urls.py b/Tools/Scripts/webkitpy/common/config/urls.py
index b547045f4..48830c564 100644
--- a/Tools/Scripts/webkitpy/common/config/urls.py
+++ b/Tools/Scripts/webkitpy/common/config/urls.py
@@ -56,6 +56,7 @@ direct_attachment_url = r"https?://bug-(?P<bug_id>\d+)-attachments.%s/attachment
buildbot_url = "http://build.webkit.org"
chromium_buildbot_url = "http://build.chromium.org/p/chromium.webkit"
+omahaproxy_url = "http://omahaproxy.appspot.com/"
def parse_bug_id(string):
if not string:
diff --git a/Tools/Scripts/webkitpy/common/net/bugzilla/bugzilla.py b/Tools/Scripts/webkitpy/common/net/bugzilla/bugzilla.py
index 3d2a96922..6186a9559 100644
--- a/Tools/Scripts/webkitpy/common/net/bugzilla/bugzilla.py
+++ b/Tools/Scripts/webkitpy/common/net/bugzilla/bugzilla.py
@@ -152,6 +152,11 @@ class BugzillaQueries(object):
def _fetch_bugs_from_advanced_query(self, query):
results_page = self._load_query(query)
+ # Some simple searches can return a single result.
+ results_url = results_page.geturl()
+ if results_url.find("/show_bug.cgi?id=") != -1:
+ bug_id = int(results_url.split("=")[-1])
+ return [self._fetch_bug(bug_id)]
if not self._parse_result_count(results_page):
return []
# Bugzilla results pages have an "XML" submit button at the bottom
@@ -493,6 +498,7 @@ class Bugzilla(object):
self.browser.select_form(name="login")
self.browser['Bugzilla_login'] = username
self.browser['Bugzilla_password'] = password
+ self.browser.find_control("Bugzilla_restrictlogin").items[0].selected = False
response = self.browser.submit()
match = re.search("<title>(.+?)</title>", response.read())
diff --git a/Tools/Scripts/webkitpy/common/net/bugzilla/bugzilla_mock.py b/Tools/Scripts/webkitpy/common/net/bugzilla/bugzilla_mock.py
index 47f867e03..36b465920 100644
--- a/Tools/Scripts/webkitpy/common/net/bugzilla/bugzilla_mock.py
+++ b/Tools/Scripts/webkitpy/common/net/bugzilla/bugzilla_mock.py
@@ -169,9 +169,9 @@ _bug2 = {
"bug_status": "ASSIGNED",
"comments": [{"comment_date": datetime.datetime(2011, 6, 11, 9, 4, 3),
"comment_email": "bar@foo.com",
- "text": "Message1.",
- },
- ],
+ "text": "Message1.\nCommitted r35: <http://trac.webkit.org/changeset/35>",
+ },
+ ],
}
@@ -183,7 +183,15 @@ _bug3 = {
"cc_emails": [],
"attachments": [_patch7],
"bug_status": "NEW",
- "comments": [],
+ "comments": [{"comment_date": datetime.datetime(2011, 6, 11, 9, 4, 3),
+ "comment_email": "bar@foo.com",
+ "text": "Committed r30: <http://trac.webkit.org/changeset/30>",
+ },
+ {"comment_date": datetime.datetime(2011, 6, 11, 9, 4, 3),
+ "comment_email": "bar@foo.com",
+ "text": "Committed r31: <http://trac.webkit.org/changeset/31>",
+ },
+ ],
}
@@ -195,7 +203,15 @@ _bug4 = {
"cc_emails": [],
"attachments": [_patch4, _patch5, _patch6],
"bug_status": "REOPENED",
- "comments": [],
+ "comments": [{"comment_date": datetime.datetime(2011, 6, 11, 9, 4, 3),
+ "comment_email": "bar@foo.com",
+ "text": "Committed r25: <http://trac.webkit.org/changeset/30>",
+ },
+ {"comment_date": datetime.datetime(2011, 6, 11, 9, 4, 3),
+ "comment_email": "bar@foo.com",
+ "text": "Rolled out in <http://trac.webkit.org/changeset/26",
+ },
+ ],
}
@@ -208,7 +224,12 @@ _bug5 = {
"attachments": [],
"bug_status": "RESOLVED",
"dup_id": 50002,
- "comments": [],
+ "comments": [{"comment_date": datetime.datetime(2011, 6, 11, 9, 4, 3),
+ "comment_email": "bar@foo.com",
+ "text": "Committed r15: <http://trac.webkit.org/changeset/15>",
+ },
+ ],
+
}
@@ -251,6 +272,10 @@ class MockBugzillaQueries(object):
def fetch_bugs_matching_search(self, search_string, author_email=None):
return [self._bugzilla.fetch_bug(50004), self._bugzilla.fetch_bug(50003)]
+ def fetch_bugs_matching_quicksearch(self, search_string):
+ return [self._bugzilla.fetch_bug(50001), self._bugzilla.fetch_bug(50002),
+ self._bugzilla.fetch_bug(50003), self._bugzilla.fetch_bug(50004)]
+
_mock_reviewers = [Reviewer("Foo Bar", "foo@bar.com"),
Reviewer("Reviewer2", "reviewer2@webkit.org")]
@@ -298,7 +323,7 @@ class MockBugzilla(object):
log("cc: %s" % cc)
if blocked:
log("blocked: %s" % blocked)
- return 50004
+ return 60001
def quips(self):
return ["Good artists copy. Great artists steal. - Pablo Picasso"]
diff --git a/Tools/Scripts/webkitpy/common/net/omahaproxy.py b/Tools/Scripts/webkitpy/common/net/omahaproxy.py
new file mode 100644
index 000000000..796923a6a
--- /dev/null
+++ b/Tools/Scripts/webkitpy/common/net/omahaproxy.py
@@ -0,0 +1,80 @@
+# 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.
+#
+# This is the client to query http://omahaproxy.appspot.com/ to retrieve
+# chrome versions associated with WebKit commits.
+
+from webkitpy.common.net.networktransaction import NetworkTransaction
+from webkitpy.common.config import urls
+
+import json
+import urllib2
+
+
+class OmahaProxy(object):
+ default_url = urls.omahaproxy_url
+
+ chrome_platforms = {"linux": "Linux",
+ "win": "Windows",
+ "mac": "Mac",
+ "cros": "Chrome OS",
+ "cf": "Chrome Frame"}
+ chrome_channels = ["canary", "dev", "beta", "stable"]
+
+ def __init__(self, url=default_url, browser=None):
+ self._chrome_channels = set(self.chrome_channels)
+ self.set_url(url)
+ from webkitpy.thirdparty.autoinstalled.mechanize import Browser
+ self._browser = browser or Browser()
+
+ def set_url(self, url):
+ self.url = url
+
+ def _json_url(self):
+ return "%s/all.json" % self.url
+
+ def _get_json(self):
+ return NetworkTransaction().run(lambda: urllib2.urlopen(self._json_url()).read())
+
+ def get_revisions(self):
+ revisions_json = json.loads(self._get_json())
+ revisions = []
+ for platform in revisions_json:
+ for version in platform["versions"]:
+ try:
+ row = {
+ "commit": int(version["base_webkit_revision"]),
+ "channel": version["channel"],
+ "platform": self.chrome_platforms[platform["os"]],
+ "date": version["date"],
+ }
+ assert(version["channel"] in self._chrome_channels)
+ revisions.append(row)
+ except ValueError:
+ next
+ return revisions
diff --git a/Tools/Scripts/webkitpy/common/net/omahaproxy_unittest.py b/Tools/Scripts/webkitpy/common/net/omahaproxy_unittest.py
new file mode 100644
index 000000000..42735c1ab
--- /dev/null
+++ b/Tools/Scripts/webkitpy/common/net/omahaproxy_unittest.py
@@ -0,0 +1,125 @@
+# 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.
+#
+
+# Unit test for omahaproxy.py
+
+import unittest
+
+from webkitpy.common.net.omahaproxy import OmahaProxy
+
+
+class MockOmahaProxy(OmahaProxy):
+ def __init__(self, json):
+ self._get_json = lambda: json
+ OmahaProxy.__init__(self)
+
+
+class OmahaProxyTest(unittest.TestCase):
+ example_omahaproxy_json = """[
+ {"os": "win",
+ "versions": [
+ {"base_webkit_revision": "116185",
+ "v8_ver": "3.10.8.1",
+ "wk_ver": "536.11",
+ "base_trunk_revision": 135598,
+ "prev_version": "20.0.1128.0",
+ "version": "20.0.1129.0",
+ "date": "05\/07\/12",
+ "prev_date": "05\/06\/12",
+ "true_branch": "trunk",
+ "channel": "canary",
+ "branch_revision": "NA"},
+ {"base_webkit_revision": "115687",
+ "v8_ver": "3.10.6.0",
+ "wk_ver": "536.10",
+ "base_trunk_revision": 134666,
+ "prev_version": "20.0.1123.1",
+ "version": "20.0.1123.4",
+ "date": "05\/04\/12",
+ "prev_date": "05\/02\/12",
+ "true_branch": "1123",
+ "channel": "dev",
+ "branch_revision": 135092}]},
+ {"os": "linux",
+ "versions": [
+ {"base_webkit_revision": "115688",
+ "v8_ver": "3.10.6.0",
+ "wk_ver": "536.10",
+ "base_trunk_revision": 134666,
+ "prev_version": "20.0.1123.2",
+ "version": "20.0.1123.4",
+ "date": "05\/04\/12",
+ "prev_date": "05\/02\/12",
+ "true_branch": "1123",
+ "channel": "dev",
+ "branch_revision": 135092},
+ {"base_webkit_revision": "112327",
+ "v8_ver": "3.9.24.17",
+ "wk_ver": "536.5",
+ "base_trunk_revision": 129376,
+ "prev_version": "19.0.1084.36",
+ "version": "19.0.1084.41",
+ "date": "05\/03\/12",
+ "prev_date": "04\/25\/12",
+ "true_branch": "1084",
+ "channel": "beta",
+ "branch_revision": 134854},
+ {"base_webkit_revision": "*",
+ "v8_ver": "3.9.24.17",
+ "wk_ver": "536.5",
+ "base_trunk_revision": 129376,
+ "prev_version": "19.0.1084.36",
+ "version": "19.0.1084.41",
+ "date": "05\/03\/12",
+ "prev_date": "04\/25\/12",
+ "true_branch": "1084",
+ "channel": "release",
+ "branch_revision": 134854}]}]"""
+
+ expected_revisions = [
+ {"commit": 116185, "channel": "canary", "platform": "Windows", "date": "05/07/12"},
+ {"commit": 115687, "channel": "dev", "platform": "Windows", "date": "05/04/12"},
+ {"commit": 115688, "channel": "dev", "platform": "Linux", "date": "05/04/12"},
+ {"commit": 112327, "channel": "beta", "platform": "Linux", "date": "05/03/12"},
+ ]
+
+ def test_get_revisions(self):
+ omahaproxy = MockOmahaProxy(self.example_omahaproxy_json)
+ revisions = omahaproxy.get_revisions()
+ self.assertEqual(len(revisions), 4)
+ for revision in revisions:
+ self.assertTrue("commit" in revision)
+ self.assertTrue("channel" in revision)
+ self.assertTrue("platform" in revision)
+ self.assertTrue("date" in revision)
+ self.assertEqual(len(revision.keys()), 4)
+ self.assertEqual(revisions, self.expected_revisions)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py b/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py
index cd6c55a4d..a225ce856 100644
--- a/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py
+++ b/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py
@@ -478,10 +478,10 @@ class Manager(object):
skipped = skipped.union(self._http_tests())
if num_all_test_files > 1 and not self._options.force:
- skipped = skipped.union(self._expectations.get_tests_with_result_type(test_expectations.SKIP))
+ skipped.update(self._expectations.get_tests_with_result_type(test_expectations.SKIP))
if self._options.skip_failing_tests:
- failing = self._expectations.get_tests_with_result_type(test_expectations.FAIL)
- self._test_files -= failing
+ skipped.update(self._expectations.get_tests_with_result_type(test_expectations.FAIL))
+ skipped.update(self._expectations.get_tests_with_result_type(test_expectations.FLAKY))
self._test_files -= skipped
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 3f51410cf..529aea222 100644
--- a/Tools/Scripts/webkitpy/layout_tests/controllers/single_test_runner.py
+++ b/Tools/Scripts/webkitpy/layout_tests/controllers/single_test_runner.py
@@ -67,7 +67,7 @@ class SingleTestRunner:
for suffix in ('.txt', '.png', '.wav'):
expected_filename = self._port.expected_filename(self._test_name, suffix)
if self._filesystem.exists(expected_filename):
- _log.error('%s is both a reftest and has an expected output file %s.',
+ _log.error('%s is a reftest, but has an unused expectation file. Please remove %s.',
self._test_name, expected_filename)
def _expected_driver_output(self):
diff --git a/Tools/Scripts/webkitpy/layout_tests/port/chromium.py b/Tools/Scripts/webkitpy/layout_tests/port/chromium.py
index 7b3cb71f9..c912a0ef2 100755
--- a/Tools/Scripts/webkitpy/layout_tests/port/chromium.py
+++ b/Tools/Scripts/webkitpy/layout_tests/port/chromium.py
@@ -235,6 +235,13 @@ class ChromiumPort(Port):
def path_to_test_expectations_file(self):
return self.path_from_webkit_base('LayoutTests', 'platform', 'chromium', 'test_expectations.txt')
+ def setup_environ_for_server(self, server_name=None):
+ clean_env = super(ChromiumPort, self).setup_environ_for_server(server_name)
+ # Webkit Linux (valgrind layout) bot needs these envvars.
+ self._copy_value_from_environ_if_set(clean_env, 'VALGRIND_LIB')
+ self._copy_value_from_environ_if_set(clean_env, 'VALGRIND_LIB_INNER')
+ return clean_env
+
def default_results_directory(self):
try:
return self.path_from_chromium_base('webkit', self.get_option('configuration'), 'layout-test-results')
@@ -337,7 +344,7 @@ class ChromiumPort(Port):
def _get_crash_log(self, name, pid, stdout, stderr, newer_than):
new_stderr = stderr
if stderr and 'AddressSanitizer' in stderr:
- asan_filter_path = self.path_from_chromium_base('third_party', 'asan', 'scripts', 'asan_symbolize.py')
+ asan_filter_path = self.path_from_chromium_base('tools', 'valgrind', 'asan', 'asan_symbolize.py')
if self._filesystem.exists(asan_filter_path):
output = self._executive.run_command([asan_filter_path], input=stderr)
new_stderr = self._executive.run_command(['c++filt'], input=output)
diff --git a/Tools/Scripts/webkitpy/layout_tests/port/chromium_android.py b/Tools/Scripts/webkitpy/layout_tests/port/chromium_android.py
index 566afba23..b9683a81f 100644
--- a/Tools/Scripts/webkitpy/layout_tests/port/chromium_android.py
+++ b/Tools/Scripts/webkitpy/layout_tests/port/chromium_android.py
@@ -357,7 +357,7 @@ class ChromiumAndroidPort(chromium.ChromiumPort):
def get_last_stacktrace(self):
tombstones = self._run_adb_command(['shell', 'ls', '-n', '/data/tombstones'])
- if not tombstones:
+ if not tombstones or tombstones.startswith('/data/tombstones: No such file or directory'):
_log.error('DRT crashed, but no tombstone found!')
return ''
tombstones = tombstones.rstrip().split('\n')
diff --git a/Tools/Scripts/webkitpy/layout_tests/port/chromium_android_unittest.py b/Tools/Scripts/webkitpy/layout_tests/port/chromium_android_unittest.py
index 05598a322..3ed3e2b20 100644
--- a/Tools/Scripts/webkitpy/layout_tests/port/chromium_android_unittest.py
+++ b/Tools/Scripts/webkitpy/layout_tests/port/chromium_android_unittest.py
@@ -26,15 +26,96 @@
# (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 StringIO
import unittest
from webkitpy.common.system import executive_mock
+from webkitpy.common.system.executive_mock import MockExecutive2
from webkitpy.common.system.systemhost_mock import MockSystemHost
+from webkitpy.thirdparty.mock import Mock
from webkitpy.layout_tests.port import chromium_android
from webkitpy.layout_tests.port import port_testcase
+from webkitpy.layout_tests.port import Port
class ChromiumAndroidPortTest(port_testcase.PortTestCase):
port_name = 'chromium-android'
port_maker = chromium_android.ChromiumAndroidPort
+
+ def test_attributes(self):
+ port = self.make_port()
+ self.assertTrue(port.get_option('enable_hardware_gpu'))
+ self.assertEquals(port.baseline_path(), port._webkit_baseline_path('chromium-android'))
+
+ def test_get_last_stacktrace(self):
+ port = self.make_port()
+
+ def mock_run_command_no_dir(args):
+ return '/data/tombstones: No such file or directory'
+ port._executive = MockExecutive2(run_command_fn=mock_run_command_no_dir)
+ self.assertEquals(port.get_last_stacktrace(), '')
+
+ def mock_run_command_no_file(args):
+ return ''
+ port._executive = MockExecutive2(run_command_fn=mock_run_command_no_file)
+ self.assertEquals(port.get_last_stacktrace(), '')
+
+ def mock_run_command_non_empty(args):
+ if args[2] == 'ls':
+ # For 'adb shell ls -n /data/tombstones'
+ return '''-rw------- 1000 1000 218643 2012-04-26 18:15 tombstone_00
+-rw------- 1000 1000 241695 2012-04-26 18:15 tombstone_01
+-rw------- 1000 1000 219472 2012-04-26 18:16 tombstone_02
+-rw------- 1000 1000 45316 2012-04-27 16:33 tombstone_03
+-rw------- 1000 1000 82022 2012-04-23 16:57 tombstone_04
+-rw------- 1000 1000 82015 2012-04-23 16:57 tombstone_05
+-rw------- 1000 1000 81974 2012-04-23 16:58 tombstone_06
+-rw------- 1000 1000 237409 2012-04-26 17:41 tombstone_07
+-rw------- 1000 1000 276089 2012-04-26 18:15 tombstone_08
+-rw------- 1000 1000 219618 2012-04-26 18:15 tombstone_09
+'''
+ else:
+ # For 'adb shell cat {tombstone}'
+ return args[3]
+ port._executive = MockExecutive2(run_command_fn=mock_run_command_non_empty)
+ self.assertEquals(port.get_last_stacktrace(), '/data/tombstones/tombstone_03')
+
+
+class ChromiumAndroidDriverTest(unittest.TestCase):
+ def setUp(self):
+ mock_port = Port(MockSystemHost())
+ self.driver = chromium_android.ChromiumAndroidDriver(mock_port, worker_number=0, pixel_tests=True)
+
+ def test_get_drt_return_value(self):
+ self.assertEquals(self.driver._get_drt_return_value('#DRT_RETURN 0'), 0)
+ self.assertEquals(self.driver._get_drt_return_value(''), None)
+
+ def test_has_crash_hint(self):
+ self.assertTrue(self.driver._has_crash_hint('[1] + Stopped (signal)'))
+ self.assertFalse(self.driver._has_crash_hint(''))
+
+ def test_read_prompt(self):
+ self.driver._proc = Mock() # FIXME: This should use a tighter mock.
+ self.driver._proc.stdout = StringIO.StringIO("root@android:/ # ")
+ self.assertEquals(self.driver._read_prompt(), None)
+ self.driver._proc.stdout = StringIO.StringIO("$ ")
+ self.assertRaises(AssertionError, self.driver._read_prompt)
+
+ def test_test_shell_command(self):
+ uri = 'file://%s/test.html' % self.driver._port.layout_tests_dir()
+ self.assertEquals(uri, 'file:///mock-checkout/LayoutTests/test.html')
+ expected_command = 'file:///data/local/tmp/third_party/WebKit/LayoutTests/test.html 2 checksum\n'
+ self.assertEquals(self.driver._test_shell_command(uri, 2, 'checksum'), expected_command)
+ self.assertEquals(self.driver._test_shell_command('http://test.html', 2, 'checksum'), 'http://test.html 2 checksum\n')
+
+ def test_write_command_and_read_line(self):
+ self.driver._proc = Mock() # FIXME: This should use a tighter mock.
+ self.driver._proc.stdout = StringIO.StringIO("#URL:file:///data/local/tmp/third_party/WebKit/LayoutTests/test.html\noutput\n[1] + Stopped (signal)\n")
+ self.assertEquals(self.driver._write_command_and_read_line(), ('#URL:file:///mock-checkout/LayoutTests/test.html\n', False))
+ self.assertEquals(self.driver._write_command_and_read_line(), ('output\n', False))
+ self.assertEquals(self.driver._write_command_and_read_line(), ('[1] + Stopped (signal)\n', True))
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/Tools/Scripts/webkitpy/layout_tests/port/efl.py b/Tools/Scripts/webkitpy/layout_tests/port/efl.py
index db7be8057..10184b446 100644
--- a/Tools/Scripts/webkitpy/layout_tests/port/efl.py
+++ b/Tools/Scripts/webkitpy/layout_tests/port/efl.py
@@ -32,25 +32,23 @@ import signal
import subprocess
from webkitpy.layout_tests.models.test_configuration import TestConfiguration
-from webkitpy.layout_tests.port.webkit import WebKitDriver, WebKitPort
+from webkitpy.layout_tests.port.webkit import WebKitPort
from webkitpy.layout_tests.port.pulseaudio_sanitizer import PulseAudioSanitizer
-class EflDriver(WebKitDriver):
- def cmd_line(self, pixel_tests, per_test_args):
- wrapper_path = self._port.path_from_webkit_base("Tools", "efl", "run-with-jhbuild")
- return [wrapper_path] + WebKitDriver.cmd_line(self, pixel_tests, per_test_args)
-
-
class EflPort(WebKitPort, PulseAudioSanitizer):
port_name = 'efl'
+ def __init__(self, *args, **kwargs):
+ WebKitPort.__init__(self, *args, **kwargs)
+
+ self._jhbuild_wrapper_path = self.path_from_webkit_base('Tools', 'efl', 'run-with-jhbuild')
+
+ self.set_option_default('wrapper', self._jhbuild_wrapper_path)
+
def _port_flag_for_scripts(self):
return "--efl"
- def _driver_class(self):
- return EflDriver
-
def setup_test_run(self):
self._unload_pulseaudio_module()
@@ -66,9 +64,8 @@ class EflPort(WebKitPort, PulseAudioSanitizer):
def _path_to_image_diff(self):
return self._build_path('bin', 'ImageDiff')
- # FIXME: I doubt EFL wants to override this method.
- def check_build(self, needs_http):
- return self._check_driver()
+ def _image_diff_command(self, *args, **kwargs):
+ return [self._jhbuild_wrapper_path] + super(EflPort, self)._image_diff_command(*args, **kwargs)
def _path_to_webcore_library(self):
static_path = self._build_path('WebCore', 'libwebcore_efl.a')
diff --git a/Tools/Scripts/webkitpy/layout_tests/port/test.py b/Tools/Scripts/webkitpy/layout_tests/port/test.py
index b6b2229e7..d2e64b6db 100644
--- a/Tools/Scripts/webkitpy/layout_tests/port/test.py
+++ b/Tools/Scripts/webkitpy/layout_tests/port/test.py
@@ -136,6 +136,7 @@ def unit_test_list():
expected_text="foo\r\r\r\n", actual_text="foo\n")
tests.add('failures/expected/text.html', actual_text='text_fail-png')
tests.add('failures/expected/skip_text.html', actual_text='text diff')
+ tests.add('failures/flaky/text.html')
tests.add('failures/unexpected/missing_text.html', expected_text=None)
tests.add('failures/unexpected/missing_image.html', expected_image=None)
tests.add('failures/unexpected/missing_render_tree_dump.html', actual_text="""layer at (0,0) size 800x600
@@ -334,6 +335,7 @@ class TestPort(Port):
port_name = port_name or 'test-mac-leopard'
Port.__init__(self, host, port_name, **kwargs)
self._tests = unit_test_list()
+ self._flakes = set()
self._expectations_path = LAYOUT_TEST_DIR + '/platform/test/test_expectations.txt'
self._results_directory = None
@@ -513,6 +515,11 @@ class TestDriver(Driver):
audio = None
actual_text = test.actual_text
+
+ if 'flaky' in test_name and not test_name in self._port._flakes:
+ self._port._flakes.add(test_name)
+ actual_text = 'flaky text failure'
+
if actual_text and test_args and test_name == 'passes/args.html':
actual_text = actual_text + ' ' + ' '.join(test_args)
diff --git a/Tools/Scripts/webkitpy/layout_tests/port/webkit.py b/Tools/Scripts/webkitpy/layout_tests/port/webkit.py
index a41d62e32..ade7d038e 100644
--- a/Tools/Scripts/webkitpy/layout_tests/port/webkit.py
+++ b/Tools/Scripts/webkitpy/layout_tests/port/webkit.py
@@ -170,7 +170,7 @@ class WebKitPort(Port):
process = self._start_image_diff_process(expected_contents, actual_contents, tolerance=tolerance)
return self._read_image_diff(process)
- def _start_image_diff_process(self, expected_contents, actual_contents, tolerance=None):
+ def _image_diff_command(self, tolerance=None):
# FIXME: There needs to be a more sane way of handling default
# values for options so that you can distinguish between a default
# value of None and a default value that wasn't set.
@@ -179,7 +179,12 @@ class WebKitPort(Port):
tolerance = self.get_option('tolerance')
else:
tolerance = 0.1
+
command = [self._path_to_image_diff(), '--tolerance', str(tolerance)]
+ return command
+
+ def _start_image_diff_process(self, expected_contents, actual_contents, tolerance=None):
+ command = self._image_diff_command(tolerance)
environment = self.setup_environ_for_server('ImageDiff')
process = server_process.ServerProcess(self, 'ImageDiff', command, environment)
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 ee35697d6..66e7d8f0b 100755
--- a/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py
+++ b/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py
@@ -460,10 +460,16 @@ class MainTest(unittest.TestCase, StreamTestingMixin):
self.assertEquals(len(batch), 1, '%s had too many tests' % ', '.join(batch))
def test_skip_failing_tests(self):
- batches = get_tests_run(['--skip-failing-tests'])
+ # This tests that we skip both known failing and known flaky tests. Because there are
+ # no known flaky tests in the default test_expectations, we add additional expectations.
+ host = MockHost()
+ host.filesystem.write_text_file('/tmp/overrides.txt', 'BUGX : passes/image.html = IMAGE PASS\n')
+
+ batches = get_tests_run(['--skip-failing-tests', '--additional-expectations', '/tmp/overrides.txt'], host=host)
has_passes_text = False
for batch in batches:
self.assertFalse('failures/expected/text.html' in batch)
+ self.assertFalse('passes/image.html' in batch)
has_passes_text = has_passes_text or ('passes/text.html' in batch)
self.assertTrue(has_passes_text)
@@ -718,10 +724,27 @@ class MainTest(unittest.TestCase, StreamTestingMixin):
tests_included=True, host=host)
self.assertEqual(user.opened_urls, [path.abspath_to_uri('/tmp/cwd/foo/results.html')])
- def test_retries_directory(self):
+ def test_retrying_and_flaky_tests(self):
host = MockHost()
- res, out, err, user = logging_run(tests_included=True, host=host)
+ res, out, err, _ = logging_run(['failures/flaky'], tests_included=True, host=host)
+ self.assertEquals(res, 0)
+ self.assertTrue('Retrying' in err.getvalue())
+ self.assertTrue('Unexpected flakiness' in out.getvalue())
+ self.assertTrue(host.filesystem.exists('/tmp/layout-test-results/failures/flaky/text-actual.txt'))
self.assertTrue(host.filesystem.exists('/tmp/layout-test-results/retries/tests_run0.txt'))
+ self.assertFalse(host.filesystem.exists('/tmp/layout-test-results/retries/failures/flaky/text-actual.txt'))
+
+ # Now we test that --clobber-old-results does remove the old entries and the old retries,
+ # and that we don't retry again.
+ res, out, err, _ = logging_run(['--no-retry-failures', '--clobber-old-results', 'failures/flaky'], tests_included=True, host=host)
+ self.assertEquals(res, 1)
+ self.assertTrue('Clobbering old results' in err.getvalue())
+ self.assertTrue('flaky/text.html' in err.getvalue())
+ self.assertTrue('Unexpected text diff' in out.getvalue())
+ self.assertFalse('Unexpected flakiness' in out.getvalue())
+ self.assertTrue(host.filesystem.exists('/tmp/layout-test-results/failures/flaky/text-actual.txt'))
+ self.assertFalse(host.filesystem.exists('retries'))
+
# These next tests test that we run the tests in ascending alphabetical
# order per directory. HTTP tests are sharded separately from other tests,
diff --git a/Tools/Scripts/webkitpy/layout_tests/servers/http_server_base.py b/Tools/Scripts/webkitpy/layout_tests/servers/http_server_base.py
index 33131d247..47836fcec 100755
--- a/Tools/Scripts/webkitpy/layout_tests/servers/http_server_base.py
+++ b/Tools/Scripts/webkitpy/layout_tests/servers/http_server_base.py
@@ -174,12 +174,6 @@ class HttpServerBase(object):
try:
s.connect(('localhost', port))
_log.debug("Server running on %d" % port)
- except socket.error, e:
- # this branch is needed on Mac 10.5 / python 2.5
- if e.args[0] not in (errno.ECONNREFUSED, errno.ECONNRESET):
- raise
- _log.debug("Server NOT running on %d: %s" % (port, e))
- return False
except IOError, e:
if e.errno not in (errno.ECONNREFUSED, errno.ECONNRESET):
raise
diff --git a/Tools/Scripts/webkitpy/layout_tests/servers/websocket_server.py b/Tools/Scripts/webkitpy/layout_tests/servers/websocket_server.py
index 7671f6006..296ab9882 100644
--- a/Tools/Scripts/webkitpy/layout_tests/servers/websocket_server.py
+++ b/Tools/Scripts/webkitpy/layout_tests/servers/websocket_server.py
@@ -109,11 +109,11 @@ class PyWebSocket(http_server.Lighttpd):
output_log = self._filesystem.join(self._output_dir, log_file_name + "-out.txt")
self._wsout = self._filesystem.open_text_file_for_writing(output_log)
- from webkitpy.thirdparty.autoinstalled.pywebsocket import mod_pywebsocket
+ from webkitpy.thirdparty import mod_pywebsocket
python_interp = sys.executable
# FIXME: Use self._filesystem.path_to_module(self.__module__) instead of __file__
# I think this is trying to get the chrome directory? Doesn't the port object know that?
- pywebsocket_base = self._filesystem.join(self._filesystem.dirname(self._filesystem.dirname(self._filesystem.dirname(self._filesystem.abspath(__file__)))), 'thirdparty', 'autoinstalled', 'pywebsocket')
+ pywebsocket_base = self._filesystem.join(self._filesystem.dirname(self._filesystem.dirname(self._filesystem.dirname(self._filesystem.abspath(__file__)))), 'thirdparty')
pywebsocket_script = self._filesystem.join(pywebsocket_base, 'mod_pywebsocket', 'standalone.py')
start_cmd = [
python_interp, '-u', pywebsocket_script,
diff --git a/Tools/Scripts/webkitpy/thirdparty/__init__.py b/Tools/Scripts/webkitpy/thirdparty/__init__.py
index a0cf0f4d4..0df0cf7b6 100644
--- a/Tools/Scripts/webkitpy/thirdparty/__init__.py
+++ b/Tools/Scripts/webkitpy/thirdparty/__init__.py
@@ -80,8 +80,6 @@ class AutoinstallImportHook(object):
self._install_eliza()
elif '.irc' in fullname:
self._install_irc()
- elif '.pywebsocket' in fullname:
- self._install_pywebsocket()
elif '.buildbot' in fullname:
self._install_buildbot()
@@ -128,12 +126,6 @@ class AutoinstallImportHook(object):
installer.install(url="http://downloads.sourceforge.net/project/python-irclib/python-irclib/0.4.8/python-irclib-0.4.8.zip",
url_subpath="ircbot.py")
- def _install_pywebsocket(self):
- pywebsocket_dir = self._fs.join(_AUTOINSTALLED_DIR, "pywebsocket")
- installer = AutoInstaller(target_dir=pywebsocket_dir)
- installer.install(url="http://pywebsocket.googlecode.com/files/mod_pywebsocket-0.7.4.tar.gz",
- url_subpath="pywebsocket-0.7.4/src/mod_pywebsocket")
-
def _install(self, url, url_subpath):
installer = AutoInstaller(target_dir=_AUTOINSTALLED_DIR)
installer.install(url=url, url_subpath=url_subpath)
diff --git a/Tools/Scripts/webkitpy/thirdparty/__init___unittest.py b/Tools/Scripts/webkitpy/thirdparty/__init___unittest.py
index b1964e9bc..3583ab432 100644
--- a/Tools/Scripts/webkitpy/thirdparty/__init___unittest.py
+++ b/Tools/Scripts/webkitpy/thirdparty/__init___unittest.py
@@ -39,14 +39,10 @@ class ThirdpartyTest(unittest.TestCase):
def __init__(self):
AutoinstallImportHook.__init__(self)
self._eliza_installed = False
- self._pywebsocket_installed = False
def _install_eliza(self):
self.eliza_installed = True
- def _install_pywebsocket(self):
- self.pywebsocket_installed = True
-
mock_import_hook = MockImportHook()
try:
# The actual AutoinstallImportHook should be installed before us,
@@ -55,8 +51,6 @@ class ThirdpartyTest(unittest.TestCase):
from webkitpy.thirdparty.autoinstalled import eliza
self.assertTrue(mock_import_hook.eliza_installed)
- from webkitpy.thirdparty.autoinstalled.pywebsocket import mod_pywebsocket
- self.assertTrue(mock_import_hook.pywebsocket_installed)
finally:
sys.meta_path.remove(mock_import_hook)
diff --git a/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/COPYING b/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/COPYING
new file mode 100644
index 000000000..ab9d52ddf
--- /dev/null
+++ b/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/COPYING
@@ -0,0 +1,28 @@
+Copyright 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.
diff --git a/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/__init__.py b/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/__init__.py
new file mode 100644
index 000000000..c154da4a1
--- /dev/null
+++ b/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/__init__.py
@@ -0,0 +1,184 @@
+# Copyright 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:
+#
+# * 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.
+
+
+"""WebSocket extension for Apache HTTP Server.
+
+mod_pywebsocket is a WebSocket extension for Apache HTTP Server
+intended for testing or experimental purposes. mod_python is required.
+
+
+Installation:
+
+0. Prepare an Apache HTTP Server for which mod_python is enabled.
+
+1. Specify the following Apache HTTP Server directives to suit your
+ configuration.
+
+ If mod_pywebsocket is not in the Python path, specify the following.
+ <websock_lib> is the directory where mod_pywebsocket is installed.
+
+ PythonPath "sys.path+['<websock_lib>']"
+
+ Always specify the following. <websock_handlers> is the directory where
+ user-written WebSocket handlers are placed.
+
+ PythonOption mod_pywebsocket.handler_root <websock_handlers>
+ PythonHeaderParserHandler mod_pywebsocket.headerparserhandler
+
+ To limit the search for WebSocket handlers to a directory <scan_dir>
+ under <websock_handlers>, configure as follows:
+
+ PythonOption mod_pywebsocket.handler_scan <scan_dir>
+
+ <scan_dir> is useful in saving scan time when <websock_handlers>
+ contains many non-WebSocket handler files.
+
+ If you want to support old handshake based on
+ draft-hixie-thewebsocketprotocol-75:
+
+ PythonOption mod_pywebsocket.allow_draft75 On
+
+ If you want to allow handlers whose canonical path is not under the root
+ directory (i.e. symbolic link is in root directory but its target is not),
+ configure as follows:
+
+ PythonOption mod_pywebsocket.allow_handlers_outside_root_dir On
+
+ Example snippet of httpd.conf:
+ (mod_pywebsocket is in /websock_lib, WebSocket handlers are in
+ /websock_handlers, port is 80 for ws, 443 for wss.)
+
+ <IfModule python_module>
+ PythonPath "sys.path+['/websock_lib']"
+ PythonOption mod_pywebsocket.handler_root /websock_handlers
+ PythonHeaderParserHandler mod_pywebsocket.headerparserhandler
+ </IfModule>
+
+2. Tune Apache parameters for serving WebSocket. We'd like to note that at
+ least TimeOut directive from core features and RequestReadTimeout
+ directive from mod_reqtimeout should be modified not to kill connections
+ in only a few seconds of idle time.
+
+3. Verify installation. You can use example/console.html to poke the server.
+
+
+Writing WebSocket handlers:
+
+When a WebSocket request comes in, the resource name
+specified in the handshake is considered as if it is a file path under
+<websock_handlers> and the handler defined in
+<websock_handlers>/<resource_name>_wsh.py is invoked.
+
+For example, if the resource name is /example/chat, the handler defined in
+<websock_handlers>/example/chat_wsh.py is invoked.
+
+A WebSocket handler is composed of the following three functions:
+
+ web_socket_do_extra_handshake(request)
+ web_socket_transfer_data(request)
+ web_socket_passive_closing_handshake(request)
+
+where:
+ request: mod_python request.
+
+web_socket_do_extra_handshake is called during the handshake after the
+headers are successfully parsed and WebSocket properties (ws_location,
+ws_origin, and ws_resource) are added to request. A handler
+can reject the request by raising an exception.
+
+A request object has the following properties that you can use during the
+extra handshake (web_socket_do_extra_handshake):
+- ws_resource
+- ws_origin
+- ws_version
+- ws_location (Hixie 75 and HyBi 00 only)
+- ws_extensions (Hybi 06 and later)
+- ws_deflate (HyBi 06 and later)
+- ws_protocol
+- ws_requested_protocols (HyBi 06 and later)
+
+The last two are a bit tricky.
+
+For HyBi 06 and later, ws_protocol is always set to None when
+web_socket_do_extra_handshake is called. If ws_requested_protocols is not
+None, you must choose one subprotocol from this list and set it to
+ws_protocol.
+
+For Hixie 75 and HyBi 00, when web_socket_do_extra_handshake is called,
+ws_protocol is set to the value given by the client in
+Sec-WebSocket-Protocol (WebSocket-Protocol for Hixie 75) header or None if
+such header was not found in the opening handshake request. Finish extra
+handshake with ws_protocol untouched to accept the request subprotocol.
+Then, Sec-WebSocket-Protocol (or WebSocket-Protocol) header will be sent to
+the client in response with the same value as requested. Raise an exception
+in web_socket_do_extra_handshake to reject the requested subprotocol.
+
+web_socket_transfer_data is called after the handshake completed
+successfully. A handler can receive/send messages from/to the client
+using request. mod_pywebsocket.msgutil module provides utilities
+for data transfer.
+
+You can receive a message by the following statement.
+
+ message = request.ws_stream.receive_message()
+
+This call blocks until any complete text frame arrives, and the payload data
+of the incoming frame will be stored into message. When you're using IETF
+HyBi 00 or later protocol, receive_message() will return None on receiving
+client-initiated closing handshake. When any error occurs, receive_message()
+will raise some exception.
+
+You can send a message by the following statement.
+
+ request.ws_stream.send_message(message)
+
+Executing the following statement or just return-ing from
+web_socket_transfer_data cause connection close.
+
+ request.ws_stream.close_connection()
+
+When you're using IETF HyBi 00 or later protocol, close_connection will wait
+for closing handshake acknowledgement coming from the client. When it
+couldn't receive a valid acknowledgement, raises an exception.
+
+web_socket_passive_closing_handshake is called after the server receives
+incoming closing frame from the client peer immediately. You can specify
+code and reason by return values. They are sent as a outgoing closing frame
+from the server. A request object has the following properties that you can
+use in web_socket_passive_closing_handshake.
+- ws_close_code
+- ws_close_reason
+
+A WebSocket handler must be thread-safe if the server (Apache or
+standalone.py) is configured to use threads.
+"""
+
+
+# vi:sts=4 sw=4 et tw=72
diff --git a/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/_stream_base.py b/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/_stream_base.py
new file mode 100644
index 000000000..60fb33d2c
--- /dev/null
+++ b/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/_stream_base.py
@@ -0,0 +1,165 @@
+# Copyright 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:
+#
+# * 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.
+
+
+"""Base stream class.
+"""
+
+
+# Note: request.connection.write/read are used in this module, even though
+# mod_python document says that they should be used only in connection
+# handlers. Unfortunately, we have no other options. For example,
+# request.write/read are not suitable because they don't allow direct raw bytes
+# writing/reading.
+
+
+from mod_pywebsocket import util
+
+
+# Exceptions
+
+
+class ConnectionTerminatedException(Exception):
+ """This exception will be raised when a connection is terminated
+ unexpectedly.
+ """
+
+ pass
+
+
+class InvalidFrameException(ConnectionTerminatedException):
+ """This exception will be raised when we received an invalid frame we
+ cannot parse.
+ """
+
+ pass
+
+
+class BadOperationException(Exception):
+ """This exception will be raised when send_message() is called on
+ server-terminated connection or receive_message() is called on
+ client-terminated connection.
+ """
+
+ pass
+
+
+class UnsupportedFrameException(Exception):
+ """This exception will be raised when we receive a frame with flag, opcode
+ we cannot handle. Handlers can just catch and ignore this exception and
+ call receive_message() again to continue processing the next frame.
+ """
+
+ pass
+
+
+class InvalidUTF8Exception(Exception):
+ """This exception will be raised when we receive a text frame which
+ contains invalid UTF-8 strings.
+ """
+
+ pass
+
+
+class StreamBase(object):
+ """Base stream class."""
+
+ def __init__(self, request):
+ """Construct an instance.
+
+ Args:
+ request: mod_python request.
+ """
+
+ self._logger = util.get_class_logger(self)
+
+ self._request = request
+
+ def _read(self, length):
+ """Reads length bytes from connection. In case we catch any exception,
+ prepends remote address to the exception message and raise again.
+
+ Raises:
+ ConnectionTerminatedException: when read returns empty string.
+ """
+
+ bytes = self._request.connection.read(length)
+ if not bytes:
+ raise ConnectionTerminatedException(
+ 'Receiving %d byte failed. Peer (%r) closed connection' %
+ (length, (self._request.connection.remote_addr,)))
+ return bytes
+
+ def _write(self, bytes):
+ """Writes given bytes to connection. In case we catch any exception,
+ prepends remote address to the exception message and raise again.
+ """
+
+ try:
+ self._request.connection.write(bytes)
+ except Exception, e:
+ util.prepend_message_to_exception(
+ 'Failed to send message to %r: ' %
+ (self._request.connection.remote_addr,),
+ e)
+ raise
+
+ def receive_bytes(self, length):
+ """Receives multiple bytes. Retries read when we couldn't receive the
+ specified amount.
+
+ Raises:
+ ConnectionTerminatedException: when read returns empty string.
+ """
+
+ bytes = []
+ while length > 0:
+ new_bytes = self._read(length)
+ bytes.append(new_bytes)
+ length -= len(new_bytes)
+ return ''.join(bytes)
+
+ def _read_until(self, delim_char):
+ """Reads bytes until we encounter delim_char. The result will not
+ contain delim_char.
+
+ Raises:
+ ConnectionTerminatedException: when read returns empty string.
+ """
+
+ bytes = []
+ while True:
+ ch = self._read(1)
+ if ch == delim_char:
+ break
+ bytes.append(ch)
+ return ''.join(bytes)
+
+
+# vi:sts=4 sw=4 et
diff --git a/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/_stream_hixie75.py b/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/_stream_hixie75.py
new file mode 100644
index 000000000..c84ca6e07
--- /dev/null
+++ b/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/_stream_hixie75.py
@@ -0,0 +1,228 @@
+# Copyright 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:
+#
+# * 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.
+
+
+"""This file provides a class for parsing/building frames of the WebSocket
+protocol version HyBi 00 and Hixie 75.
+
+Specification:
+http://tools.ietf.org/html/draft-ietf-hybi-thewebsocketprotocol-00
+"""
+
+
+from mod_pywebsocket import common
+from mod_pywebsocket._stream_base import BadOperationException
+from mod_pywebsocket._stream_base import ConnectionTerminatedException
+from mod_pywebsocket._stream_base import InvalidFrameException
+from mod_pywebsocket._stream_base import StreamBase
+from mod_pywebsocket._stream_base import UnsupportedFrameException
+from mod_pywebsocket import util
+
+
+class StreamHixie75(StreamBase):
+ """A class for parsing/building frames of the WebSocket protocol version
+ HyBi 00 and Hixie 75.
+ """
+
+ def __init__(self, request, enable_closing_handshake=False):
+ """Construct an instance.
+
+ Args:
+ request: mod_python request.
+ enable_closing_handshake: to let StreamHixie75 perform closing
+ handshake as specified in HyBi 00, set
+ this option to True.
+ """
+
+ StreamBase.__init__(self, request)
+
+ self._logger = util.get_class_logger(self)
+
+ self._enable_closing_handshake = enable_closing_handshake
+
+ self._request.client_terminated = False
+ self._request.server_terminated = False
+
+ def send_message(self, message, end=True, binary=False):
+ """Send message.
+
+ Args:
+ message: unicode string to send.
+ binary: not used in hixie75.
+
+ Raises:
+ BadOperationException: when called on a server-terminated
+ connection.
+ """
+
+ if not end:
+ raise BadOperationException(
+ 'StreamHixie75 doesn\'t support send_message with end=False')
+
+ if binary:
+ raise BadOperationException(
+ 'StreamHixie75 doesn\'t support send_message with binary=True')
+
+ if self._request.server_terminated:
+ raise BadOperationException(
+ 'Requested send_message after sending out a closing handshake')
+
+ self._write(''.join(['\x00', message.encode('utf-8'), '\xff']))
+
+ def _read_payload_length_hixie75(self):
+ """Reads a length header in a Hixie75 version frame with length.
+
+ Raises:
+ ConnectionTerminatedException: when read returns empty string.
+ """
+
+ length = 0
+ while True:
+ b_str = self._read(1)
+ b = ord(b_str)
+ length = length * 128 + (b & 0x7f)
+ if (b & 0x80) == 0:
+ break
+ return length
+
+ def receive_message(self):
+ """Receive a WebSocket frame and return its payload an unicode string.
+
+ Returns:
+ payload unicode string in a WebSocket frame.
+
+ Raises:
+ ConnectionTerminatedException: when read returns empty
+ string.
+ BadOperationException: when called on a client-terminated
+ connection.
+ """
+
+ if self._request.client_terminated:
+ raise BadOperationException(
+ 'Requested receive_message after receiving a closing '
+ 'handshake')
+
+ while True:
+ # Read 1 byte.
+ # mp_conn.read will block if no bytes are available.
+ # Timeout is controlled by TimeOut directive of Apache.
+ frame_type_str = self.receive_bytes(1)
+ frame_type = ord(frame_type_str)
+ if (frame_type & 0x80) == 0x80:
+ # The payload length is specified in the frame.
+ # Read and discard.
+ length = self._read_payload_length_hixie75()
+ if length > 0:
+ _ = self.receive_bytes(length)
+ # 5.3 3. 12. if /type/ is 0xFF and /length/ is 0, then set the
+ # /client terminated/ flag and abort these steps.
+ if not self._enable_closing_handshake:
+ continue
+
+ if frame_type == 0xFF and length == 0:
+ self._request.client_terminated = True
+
+ if self._request.server_terminated:
+ self._logger.debug(
+ 'Received ack for server-initiated closing '
+ 'handshake')
+ return None
+
+ self._logger.debug(
+ 'Received client-initiated closing handshake')
+
+ self._send_closing_handshake()
+ self._logger.debug(
+ 'Sent ack for client-initiated closing handshake')
+ return None
+ else:
+ # The payload is delimited with \xff.
+ bytes = self._read_until('\xff')
+ # The WebSocket protocol section 4.4 specifies that invalid
+ # characters must be replaced with U+fffd REPLACEMENT
+ # CHARACTER.
+ message = bytes.decode('utf-8', 'replace')
+ if frame_type == 0x00:
+ return message
+ # Discard data of other types.
+
+ def _send_closing_handshake(self):
+ if not self._enable_closing_handshake:
+ raise BadOperationException(
+ 'Closing handshake is not supported in Hixie 75 protocol')
+
+ self._request.server_terminated = True
+
+ # 5.3 the server may decide to terminate the WebSocket connection by
+ # running through the following steps:
+ # 1. send a 0xFF byte and a 0x00 byte to the client to indicate the
+ # start of the closing handshake.
+ self._write('\xff\x00')
+
+ def close_connection(self, unused_code='', unused_reason=''):
+ """Closes a WebSocket connection.
+
+ Raises:
+ ConnectionTerminatedException: when closing handshake was
+ not successfull.
+ """
+
+ if self._request.server_terminated:
+ self._logger.debug(
+ 'Requested close_connection but server is already terminated')
+ return
+
+ if not self._enable_closing_handshake:
+ self._request.server_terminated = True
+ self._logger.debug('Connection closed')
+ return
+
+ self._send_closing_handshake()
+ self._logger.debug('Sent server-initiated closing handshake')
+
+ # TODO(ukai): 2. wait until the /client terminated/ flag has been set,
+ # or until a server-defined timeout expires.
+ #
+ # For now, we expect receiving closing handshake right after sending
+ # out closing handshake, and if we couldn't receive non-handshake
+ # frame, we take it as ConnectionTerminatedException.
+ message = self.receive_message()
+ if message is not None:
+ raise ConnectionTerminatedException(
+ 'Didn\'t receive valid ack for closing handshake')
+ # TODO: 3. close the WebSocket connection.
+ # note: mod_python Connection (mp_conn) doesn't have close method.
+
+ def send_ping(self, body):
+ raise BadOperationException(
+ 'StreamHixie75 doesn\'t support send_ping')
+
+
+# vi:sts=4 sw=4 et
diff --git a/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/_stream_hybi.py b/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/_stream_hybi.py
new file mode 100644
index 000000000..c00f5692b
--- /dev/null
+++ b/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/_stream_hybi.py
@@ -0,0 +1,668 @@
+# Copyright 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.
+
+
+"""This file provides classes and helper functions for parsing/building frames
+of the WebSocket protocol (RFC 6455).
+
+Specification:
+http://tools.ietf.org/html/rfc6455
+"""
+
+
+from collections import deque
+import os
+import struct
+
+from mod_pywebsocket import common
+from mod_pywebsocket import util
+from mod_pywebsocket._stream_base import BadOperationException
+from mod_pywebsocket._stream_base import ConnectionTerminatedException
+from mod_pywebsocket._stream_base import InvalidFrameException
+from mod_pywebsocket._stream_base import InvalidUTF8Exception
+from mod_pywebsocket._stream_base import StreamBase
+from mod_pywebsocket._stream_base import UnsupportedFrameException
+
+
+_NOOP_MASKER = util.NoopMasker()
+
+
+class Frame(object):
+
+ def __init__(self, fin=1, rsv1=0, rsv2=0, rsv3=0,
+ opcode=None, payload=''):
+ self.fin = fin
+ self.rsv1 = rsv1
+ self.rsv2 = rsv2
+ self.rsv3 = rsv3
+ self.opcode = opcode
+ self.payload = payload
+
+
+# Helper functions made public to be used for writing unittests for WebSocket
+# clients.
+
+
+def create_length_header(length, mask):
+ """Creates a length header.
+
+ Args:
+ length: Frame length. Must be less than 2^63.
+ mask: Mask bit. Must be boolean.
+
+ Raises:
+ ValueError: when bad data is given.
+ """
+
+ if mask:
+ mask_bit = 1 << 7
+ else:
+ mask_bit = 0
+
+ if length < 0:
+ raise ValueError('length must be non negative integer')
+ elif length <= 125:
+ return chr(mask_bit | length)
+ elif length < (1 << 16):
+ return chr(mask_bit | 126) + struct.pack('!H', length)
+ elif length < (1 << 63):
+ return chr(mask_bit | 127) + struct.pack('!Q', length)
+ else:
+ raise ValueError('Payload is too big for one frame')
+
+
+def create_header(opcode, payload_length, fin, rsv1, rsv2, rsv3, mask):
+ """Creates a frame header.
+
+ Raises:
+ Exception: when bad data is given.
+ """
+
+ if opcode < 0 or 0xf < opcode:
+ raise ValueError('Opcode out of range')
+
+ if payload_length < 0 or (1 << 63) <= payload_length:
+ raise ValueError('payload_length out of range')
+
+ if (fin | rsv1 | rsv2 | rsv3) & ~1:
+ raise ValueError('FIN bit and Reserved bit parameter must be 0 or 1')
+
+ header = ''
+
+ first_byte = ((fin << 7)
+ | (rsv1 << 6) | (rsv2 << 5) | (rsv3 << 4)
+ | opcode)
+ header += chr(first_byte)
+ header += create_length_header(payload_length, mask)
+
+ return header
+
+
+def _build_frame(header, body, mask):
+ if not mask:
+ return header + body
+
+ masking_nonce = os.urandom(4)
+ masker = util.RepeatedXorMasker(masking_nonce)
+
+ return header + masking_nonce + masker.mask(body)
+
+
+def _filter_and_format_frame_object(frame, mask, frame_filters):
+ for frame_filter in frame_filters:
+ frame_filter.filter(frame)
+
+ header = create_header(
+ frame.opcode, len(frame.payload), frame.fin,
+ frame.rsv1, frame.rsv2, frame.rsv3, mask)
+ return _build_frame(header, frame.payload, mask)
+
+
+def create_binary_frame(
+ message, opcode=common.OPCODE_BINARY, fin=1, mask=False, frame_filters=[]):
+ """Creates a simple binary frame with no extension, reserved bit."""
+
+ frame = Frame(fin=fin, opcode=opcode, payload=message)
+ return _filter_and_format_frame_object(frame, mask, frame_filters)
+
+
+def create_text_frame(
+ message, opcode=common.OPCODE_TEXT, fin=1, mask=False, frame_filters=[]):
+ """Creates a simple text frame with no extension, reserved bit."""
+
+ encoded_message = message.encode('utf-8')
+ return create_binary_frame(encoded_message, opcode, fin, mask,
+ frame_filters)
+
+
+class FragmentedFrameBuilder(object):
+ """A stateful class to send a message as fragments."""
+
+ def __init__(self, mask, frame_filters=[]):
+ """Constructs an instance."""
+
+ self._mask = mask
+ self._frame_filters = frame_filters
+
+ self._started = False
+
+ # Hold opcode of the first frame in messages to verify types of other
+ # frames in the message are all the same.
+ self._opcode = common.OPCODE_TEXT
+
+ def build(self, message, end, binary):
+ if binary:
+ frame_type = common.OPCODE_BINARY
+ else:
+ frame_type = common.OPCODE_TEXT
+ if self._started:
+ if self._opcode != frame_type:
+ raise ValueError('Message types are different in frames for '
+ 'the same message')
+ opcode = common.OPCODE_CONTINUATION
+ else:
+ opcode = frame_type
+ self._opcode = frame_type
+
+ if end:
+ self._started = False
+ fin = 1
+ else:
+ self._started = True
+ fin = 0
+
+ if binary:
+ return create_binary_frame(
+ message, opcode, fin, self._mask, self._frame_filters)
+ else:
+ return create_text_frame(
+ message, opcode, fin, self._mask, self._frame_filters)
+
+
+def _create_control_frame(opcode, body, mask, frame_filters):
+ frame = Frame(opcode=opcode, payload=body)
+
+ return _filter_and_format_frame_object(frame, mask, frame_filters)
+
+
+def create_ping_frame(body, mask=False, frame_filters=[]):
+ return _create_control_frame(common.OPCODE_PING, body, mask, frame_filters)
+
+
+def create_pong_frame(body, mask=False, frame_filters=[]):
+ return _create_control_frame(common.OPCODE_PONG, body, mask, frame_filters)
+
+
+def create_close_frame(body, mask=False, frame_filters=[]):
+ return _create_control_frame(
+ common.OPCODE_CLOSE, body, mask, frame_filters)
+
+
+class StreamOptions(object):
+ """Holds option values to configure Stream objects."""
+
+ def __init__(self):
+ """Constructs StreamOptions."""
+
+ # Enables deflate-stream extension.
+ self.deflate_stream = False
+
+ # Filters applied to frames.
+ self.outgoing_frame_filters = []
+ self.incoming_frame_filters = []
+
+ self.mask_send = False
+ self.unmask_receive = True
+
+
+class Stream(StreamBase):
+ """A class for parsing/building frames of the WebSocket protocol
+ (RFC 6455).
+ """
+
+ def __init__(self, request, options):
+ """Constructs an instance.
+
+ Args:
+ request: mod_python request.
+ """
+
+ StreamBase.__init__(self, request)
+
+ self._logger = util.get_class_logger(self)
+
+ self._options = options
+
+ if self._options.deflate_stream:
+ self._logger.debug('Setup filter for deflate-stream')
+ self._request = util.DeflateRequest(self._request)
+
+ self._request.client_terminated = False
+ self._request.server_terminated = False
+
+ # Holds body of received fragments.
+ self._received_fragments = []
+ # Holds the opcode of the first fragment.
+ self._original_opcode = None
+
+ self._writer = FragmentedFrameBuilder(
+ self._options.mask_send, self._options.outgoing_frame_filters)
+
+ self._ping_queue = deque()
+
+ def _receive_frame(self):
+ """Receives a frame and return data in the frame as a tuple containing
+ each header field and payload separately.
+
+ Raises:
+ ConnectionTerminatedException: when read returns empty
+ string.
+ InvalidFrameException: when the frame contains invalid data.
+ """
+
+ received = self.receive_bytes(2)
+
+ first_byte = ord(received[0])
+ fin = (first_byte >> 7) & 1
+ rsv1 = (first_byte >> 6) & 1
+ rsv2 = (first_byte >> 5) & 1
+ rsv3 = (first_byte >> 4) & 1
+ opcode = first_byte & 0xf
+
+ second_byte = ord(received[1])
+ mask = (second_byte >> 7) & 1
+ payload_length = second_byte & 0x7f
+
+ if (mask == 1) != self._options.unmask_receive:
+ raise InvalidFrameException(
+ 'Mask bit on the received frame did\'nt match masking '
+ 'configuration for received frames')
+
+ # The Hybi-13 and later specs disallow putting a value in 0x0-0xFFFF
+ # into the 8-octet extended payload length field (or 0x0-0xFD in
+ # 2-octet field).
+ valid_length_encoding = True
+ length_encoding_bytes = 1
+ if payload_length == 127:
+ extended_payload_length = self.receive_bytes(8)
+ payload_length = struct.unpack(
+ '!Q', extended_payload_length)[0]
+ if payload_length > 0x7FFFFFFFFFFFFFFF:
+ raise InvalidFrameException(
+ 'Extended payload length >= 2^63')
+ if self._request.ws_version >= 13 and payload_length < 0x10000:
+ valid_length_encoding = False
+ length_encoding_bytes = 8
+ elif payload_length == 126:
+ extended_payload_length = self.receive_bytes(2)
+ payload_length = struct.unpack(
+ '!H', extended_payload_length)[0]
+ if self._request.ws_version >= 13 and payload_length < 126:
+ valid_length_encoding = False
+ length_encoding_bytes = 2
+
+ if not valid_length_encoding:
+ self._logger.warning(
+ 'Payload length is not encoded using the minimal number of '
+ 'bytes (%d is encoded using %d bytes)',
+ payload_length,
+ length_encoding_bytes)
+
+ if mask == 1:
+ masking_nonce = self.receive_bytes(4)
+ masker = util.RepeatedXorMasker(masking_nonce)
+ else:
+ masker = _NOOP_MASKER
+
+ bytes = masker.mask(self.receive_bytes(payload_length))
+
+ return opcode, bytes, fin, rsv1, rsv2, rsv3
+
+ def _receive_frame_as_frame_object(self):
+ opcode, bytes, fin, rsv1, rsv2, rsv3 = self._receive_frame()
+
+ return Frame(fin=fin, rsv1=rsv1, rsv2=rsv2, rsv3=rsv3,
+ opcode=opcode, payload=bytes)
+
+ def send_message(self, message, end=True, binary=False):
+ """Send message.
+
+ Args:
+ message: text in unicode or binary in str to send.
+ binary: send message as binary frame.
+
+ Raises:
+ BadOperationException: when called on a server-terminated
+ connection or called with inconsistent message type or binary
+ parameter.
+ """
+
+ if self._request.server_terminated:
+ raise BadOperationException(
+ 'Requested send_message after sending out a closing handshake')
+
+ if binary and isinstance(message, unicode):
+ raise BadOperationException(
+ 'Message for binary frame must be instance of str')
+
+ try:
+ self._write(self._writer.build(message, end, binary))
+ except ValueError, e:
+ raise BadOperationException(e)
+
+ def receive_message(self):
+ """Receive a WebSocket frame and return its payload as a text in
+ unicode or a binary in str.
+
+ Returns:
+ payload data of the frame
+ - as unicode instance if received text frame
+ - as str instance if received binary frame
+ or None iff received closing handshake.
+ Raises:
+ BadOperationException: when called on a client-terminated
+ connection.
+ ConnectionTerminatedException: when read returns empty
+ string.
+ InvalidFrameException: when the frame contains invalid
+ data.
+ UnsupportedFrameException: when the received frame has
+ flags, opcode we cannot handle. You can ignore this
+ exception and continue receiving the next frame.
+ """
+
+ if self._request.client_terminated:
+ raise BadOperationException(
+ 'Requested receive_message after receiving a closing '
+ 'handshake')
+
+ while True:
+ # mp_conn.read will block if no bytes are available.
+ # Timeout is controlled by TimeOut directive of Apache.
+
+ frame = self._receive_frame_as_frame_object()
+
+ for frame_filter in self._options.incoming_frame_filters:
+ frame_filter.filter(frame)
+
+ if frame.rsv1 or frame.rsv2 or frame.rsv3:
+ raise UnsupportedFrameException(
+ 'Unsupported flag is set (rsv = %d%d%d)' %
+ (frame.rsv1, frame.rsv2, frame.rsv3))
+
+ if frame.opcode == common.OPCODE_CONTINUATION:
+ if not self._received_fragments:
+ if frame.fin:
+ raise InvalidFrameException(
+ 'Received a termination frame but fragmentation '
+ 'not started')
+ else:
+ raise InvalidFrameException(
+ 'Received an intermediate frame but '
+ 'fragmentation not started')
+
+ if frame.fin:
+ # End of fragmentation frame
+ self._received_fragments.append(frame.payload)
+ message = ''.join(self._received_fragments)
+ self._received_fragments = []
+ else:
+ # Intermediate frame
+ self._received_fragments.append(frame.payload)
+ continue
+ else:
+ if self._received_fragments:
+ if frame.fin:
+ raise InvalidFrameException(
+ 'Received an unfragmented frame without '
+ 'terminating existing fragmentation')
+ else:
+ raise InvalidFrameException(
+ 'New fragmentation started without terminating '
+ 'existing fragmentation')
+
+ if frame.fin:
+ # Unfragmented frame
+
+ if (common.is_control_opcode(frame.opcode) and
+ len(frame.payload) > 125):
+ raise InvalidFrameException(
+ 'Application data size of control frames must be '
+ '125 bytes or less')
+
+ self._original_opcode = frame.opcode
+ message = frame.payload
+ else:
+ # Start of fragmentation frame
+
+ if common.is_control_opcode(frame.opcode):
+ raise InvalidFrameException(
+ 'Control frames must not be fragmented')
+
+ self._original_opcode = frame.opcode
+ self._received_fragments.append(frame.payload)
+ continue
+
+ if self._original_opcode == common.OPCODE_TEXT:
+ # The WebSocket protocol section 4.4 specifies that invalid
+ # characters must be replaced with U+fffd REPLACEMENT
+ # CHARACTER.
+ try:
+ return message.decode('utf-8')
+ except UnicodeDecodeError, e:
+ raise InvalidUTF8Exception(e)
+ elif self._original_opcode == common.OPCODE_BINARY:
+ return message
+ elif self._original_opcode == common.OPCODE_CLOSE:
+ self._request.client_terminated = True
+
+ # Status code is optional. We can have status reason only if we
+ # have status code. Status reason can be empty string. So,
+ # allowed cases are
+ # - no application data: no code no reason
+ # - 2 octet of application data: has code but no reason
+ # - 3 or more octet of application data: both code and reason
+ if len(message) == 1:
+ raise InvalidFrameException(
+ 'If a close frame has status code, the length of '
+ 'status code must be 2 octet')
+ elif len(message) >= 2:
+ self._request.ws_close_code = struct.unpack(
+ '!H', message[0:2])[0]
+ self._request.ws_close_reason = message[2:].decode(
+ 'utf-8', 'replace')
+ self._logger.debug(
+ 'Received close frame (code=%d, reason=%r)',
+ self._request.ws_close_code,
+ self._request.ws_close_reason)
+
+ # Drain junk data after the close frame if necessary.
+ self._drain_received_data()
+
+ if self._request.server_terminated:
+ self._logger.debug(
+ 'Received ack for server-initiated closing '
+ 'handshake')
+ return None
+
+ self._logger.debug(
+ 'Received client-initiated closing handshake')
+
+ code = common.STATUS_NORMAL_CLOSURE
+ reason = ''
+ if hasattr(self._request, '_dispatcher'):
+ dispatcher = self._request._dispatcher
+ code, reason = dispatcher.passive_closing_handshake(
+ self._request)
+ self._send_closing_handshake(code, reason)
+ self._logger.debug(
+ 'Sent ack for client-initiated closing handshake')
+ return None
+ elif self._original_opcode == common.OPCODE_PING:
+ try:
+ handler = self._request.on_ping_handler
+ if handler:
+ handler(self._request, message)
+ continue
+ except AttributeError, e:
+ pass
+ self._send_pong(message)
+ elif self._original_opcode == common.OPCODE_PONG:
+ # TODO(tyoshino): Add ping timeout handling.
+
+ inflight_pings = deque()
+
+ while True:
+ try:
+ expected_body = self._ping_queue.popleft()
+ if expected_body == message:
+ # inflight_pings contains pings ignored by the
+ # other peer. Just forget them.
+ self._logger.debug(
+ 'Ping %r is acked (%d pings were ignored)',
+ expected_body, len(inflight_pings))
+ break
+ else:
+ inflight_pings.append(expected_body)
+ except IndexError, e:
+ # The received pong was unsolicited pong. Keep the
+ # ping queue as is.
+ self._ping_queue = inflight_pings
+ self._logger.debug('Received a unsolicited pong')
+ break
+
+ try:
+ handler = self._request.on_pong_handler
+ if handler:
+ handler(self._request, message)
+ continue
+ except AttributeError, e:
+ pass
+
+ continue
+ else:
+ raise UnsupportedFrameException(
+ 'Opcode %d is not supported' % self._original_opcode)
+
+ def _send_closing_handshake(self, code, reason):
+ if code >= (1 << 16) or code < 0:
+ raise BadOperationException('Status code is out of range')
+
+ encoded_reason = reason.encode('utf-8')
+ if len(encoded_reason) + 2 > 125:
+ raise BadOperationException(
+ 'Application data size of close frames must be 125 bytes or '
+ 'less')
+
+ frame = create_close_frame(
+ struct.pack('!H', code) + encoded_reason,
+ self._options.mask_send,
+ self._options.outgoing_frame_filters)
+
+ self._request.server_terminated = True
+
+ self._write(frame)
+
+ def close_connection(self, code=common.STATUS_NORMAL_CLOSURE, reason=''):
+ """Closes a WebSocket connection."""
+
+ if self._request.server_terminated:
+ self._logger.debug(
+ 'Requested close_connection but server is already terminated')
+ return
+
+ self._send_closing_handshake(code, reason)
+ self._logger.debug('Sent server-initiated closing handshake')
+
+ if (code == common.STATUS_GOING_AWAY or
+ code == common.STATUS_PROTOCOL_ERROR):
+ # It doesn't make sense to wait for a close frame if the reason is
+ # protocol error or that the server is going away. For some of
+ # other reasons, it might not make sense to wait for a close frame,
+ # but it's not clear, yet.
+ return
+
+ # TODO(ukai): 2. wait until the /client terminated/ flag has been set,
+ # or until a server-defined timeout expires.
+ #
+ # For now, we expect receiving closing handshake right after sending
+ # out closing handshake.
+ message = self.receive_message()
+ if message is not None:
+ raise ConnectionTerminatedException(
+ 'Didn\'t receive valid ack for closing handshake')
+ # TODO: 3. close the WebSocket connection.
+ # note: mod_python Connection (mp_conn) doesn't have close method.
+
+ def send_ping(self, body=''):
+ if len(body) > 125:
+ raise ValueError(
+ 'Application data size of control frames must be 125 bytes or '
+ 'less')
+ frame = create_ping_frame(
+ body,
+ self._options.mask_send,
+ self._options.outgoing_frame_filters)
+ self._write(frame)
+
+ self._ping_queue.append(body)
+
+ def _send_pong(self, body):
+ if len(body) > 125:
+ raise ValueError(
+ 'Application data size of control frames must be 125 bytes or '
+ 'less')
+ frame = create_pong_frame(
+ body,
+ self._options.mask_send,
+ self._options.outgoing_frame_filters)
+ self._write(frame)
+
+ def _drain_received_data(self):
+ """Drains unread data in the receive buffer to avoid sending out TCP
+ RST packet. This is because when deflate-stream is enabled, some
+ DEFLATE block for flushing data may follow a close frame. If any data
+ remains in the receive buffer of a socket when the socket is closed,
+ it sends out TCP RST packet to the other peer.
+
+ Since mod_python's mp_conn object doesn't support non-blocking read,
+ we perform this only when pywebsocket is running in standalone mode.
+ """
+
+ # If self._options.deflate_stream is true, self._request is
+ # DeflateRequest, so we can get wrapped request object by
+ # self._request._request.
+ #
+ # Only _StandaloneRequest has _drain_received_data method.
+ if (self._options.deflate_stream and
+ ('_drain_received_data' in dir(self._request._request))):
+ self._request._request._drain_received_data()
+
+
+# vi:sts=4 sw=4 et
diff --git a/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/common.py b/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/common.py
new file mode 100644
index 000000000..ba670bb42
--- /dev/null
+++ b/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/common.py
@@ -0,0 +1,179 @@
+# Copyright 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.
+
+
+# Constants indicating WebSocket protocol version.
+VERSION_HIXIE75 = -1
+VERSION_HYBI00 = 0
+VERSION_HYBI01 = 1
+VERSION_HYBI02 = 2
+VERSION_HYBI03 = 2
+VERSION_HYBI04 = 4
+VERSION_HYBI05 = 5
+VERSION_HYBI06 = 6
+VERSION_HYBI07 = 7
+VERSION_HYBI08 = 8
+VERSION_HYBI09 = 8
+VERSION_HYBI10 = 8
+VERSION_HYBI11 = 8
+VERSION_HYBI12 = 8
+VERSION_HYBI13 = 13
+VERSION_HYBI14 = 13
+VERSION_HYBI15 = 13
+VERSION_HYBI16 = 13
+VERSION_HYBI17 = 13
+
+# Constants indicating WebSocket protocol latest version.
+VERSION_HYBI_LATEST = VERSION_HYBI13
+
+# Port numbers
+DEFAULT_WEB_SOCKET_PORT = 80
+DEFAULT_WEB_SOCKET_SECURE_PORT = 443
+
+# Schemes
+WEB_SOCKET_SCHEME = 'ws'
+WEB_SOCKET_SECURE_SCHEME = 'wss'
+
+# Frame opcodes defined in the spec.
+OPCODE_CONTINUATION = 0x0
+OPCODE_TEXT = 0x1
+OPCODE_BINARY = 0x2
+OPCODE_CLOSE = 0x8
+OPCODE_PING = 0x9
+OPCODE_PONG = 0xa
+
+# UUIDs used by HyBi 04 and later opening handshake and frame masking.
+WEBSOCKET_ACCEPT_UUID = '258EAFA5-E914-47DA-95CA-C5AB0DC85B11'
+
+# Opening handshake header names and expected values.
+UPGRADE_HEADER = 'Upgrade'
+WEBSOCKET_UPGRADE_TYPE = 'websocket'
+WEBSOCKET_UPGRADE_TYPE_HIXIE75 = 'WebSocket'
+CONNECTION_HEADER = 'Connection'
+UPGRADE_CONNECTION_TYPE = 'Upgrade'
+HOST_HEADER = 'Host'
+ORIGIN_HEADER = 'Origin'
+SEC_WEBSOCKET_ORIGIN_HEADER = 'Sec-WebSocket-Origin'
+SEC_WEBSOCKET_KEY_HEADER = 'Sec-WebSocket-Key'
+SEC_WEBSOCKET_ACCEPT_HEADER = 'Sec-WebSocket-Accept'
+SEC_WEBSOCKET_VERSION_HEADER = 'Sec-WebSocket-Version'
+SEC_WEBSOCKET_PROTOCOL_HEADER = 'Sec-WebSocket-Protocol'
+SEC_WEBSOCKET_EXTENSIONS_HEADER = 'Sec-WebSocket-Extensions'
+SEC_WEBSOCKET_DRAFT_HEADER = 'Sec-WebSocket-Draft'
+SEC_WEBSOCKET_KEY1_HEADER = 'Sec-WebSocket-Key1'
+SEC_WEBSOCKET_KEY2_HEADER = 'Sec-WebSocket-Key2'
+SEC_WEBSOCKET_LOCATION_HEADER = 'Sec-WebSocket-Location'
+
+# Extensions
+DEFLATE_STREAM_EXTENSION = 'deflate-stream'
+DEFLATE_FRAME_EXTENSION = 'deflate-frame'
+X_WEBKIT_DEFLATE_FRAME_EXTENSION = 'x-webkit-deflate-frame'
+
+# Status codes
+# Code STATUS_NO_STATUS_RECEIVED, STATUS_ABNORMAL_CLOSURE, and
+# STATUS_TLS_HANDSHAKE are pseudo codes to indicate specific error cases.
+# Could not be used for codes in actual closing frames.
+# Application level errors must use codes in the range
+# STATUS_USER_REGISTERED_BASE to STATUS_USER_PRIVATE_MAX. The codes in the
+# range STATUS_USER_REGISTERED_BASE to STATUS_USER_REGISTERED_MAX are managed
+# by IANA. Usually application must define user protocol level errors in the
+# range STATUS_USER_PRIVATE_BASE to STATUS_USER_PRIVATE_MAX.
+STATUS_NORMAL_CLOSURE = 1000
+STATUS_GOING_AWAY = 1001
+STATUS_PROTOCOL_ERROR = 1002
+STATUS_UNSUPPORTED_DATA = 1003
+STATUS_NO_STATUS_RECEIVED = 1005
+STATUS_ABNORMAL_CLOSURE = 1006
+STATUS_INVALID_FRAME_PAYLOAD_DATA = 1007
+STATUS_POLICY_VIOLATION = 1008
+STATUS_MESSAGE_TOO_BIG = 1009
+STATUS_MANDATORY_EXTENSION = 1010
+STATUS_INTERNAL_SERVER_ERROR = 1011
+STATUS_TLS_HANDSHAKE = 1015
+STATUS_USER_REGISTERED_BASE = 3000
+STATUS_USER_REGISTERED_MAX = 3999
+STATUS_USER_PRIVATE_BASE = 4000
+STATUS_USER_PRIVATE_MAX = 4999
+# Following definitions are aliases to keep compatibility. Applications must
+# not use these obsoleted definitions anymore.
+STATUS_NORMAL = STATUS_NORMAL_CLOSURE
+STATUS_UNSUPPORTED = STATUS_UNSUPPORTED_DATA
+STATUS_CODE_NOT_AVAILABLE = STATUS_NO_STATUS_RECEIVED
+STATUS_ABNORMAL_CLOSE = STATUS_ABNORMAL_CLOSURE
+STATUS_INVALID_FRAME_PAYLOAD = STATUS_INVALID_FRAME_PAYLOAD_DATA
+STATUS_MANDATORY_EXT = STATUS_MANDATORY_EXTENSION
+
+# HTTP status codes
+HTTP_STATUS_BAD_REQUEST = 400
+HTTP_STATUS_FORBIDDEN = 403
+HTTP_STATUS_NOT_FOUND = 404
+
+
+def is_control_opcode(opcode):
+ return (opcode >> 3) == 1
+
+
+class ExtensionParameter(object):
+ """Holds information about an extension which is exchanged on extension
+ negotiation in opening handshake.
+ """
+
+ def __init__(self, name):
+ self._name = name
+ # TODO(tyoshino): Change the data structure to more efficient one such
+ # as dict when the spec changes to say like
+ # - Parameter names must be unique
+ # - The order of parameters is not significant
+ self._parameters = []
+
+ def name(self):
+ return self._name
+
+ def add_parameter(self, name, value):
+ self._parameters.append((name, value))
+
+ def get_parameters(self):
+ return self._parameters
+
+ def get_parameter_names(self):
+ return [name for name, unused_value in self._parameters]
+
+ def has_parameter(self, name):
+ for param_name, param_value in self._parameters:
+ if param_name == name:
+ return True
+ return False
+
+ def get_parameter_value(self, name):
+ for param_name, param_value in self._parameters:
+ if param_name == name:
+ return param_value
+
+
+# vi:sts=4 sw=4 et
diff --git a/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/dispatch.py b/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/dispatch.py
new file mode 100644
index 000000000..ab1eb4fb3
--- /dev/null
+++ b/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/dispatch.py
@@ -0,0 +1,381 @@
+# Copyright 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.
+
+
+"""Dispatch WebSocket request.
+"""
+
+
+import logging
+import os
+import re
+
+from mod_pywebsocket import common
+from mod_pywebsocket import handshake
+from mod_pywebsocket import msgutil
+from mod_pywebsocket import stream
+from mod_pywebsocket import util
+
+
+_SOURCE_PATH_PATTERN = re.compile(r'(?i)_wsh\.py$')
+_SOURCE_SUFFIX = '_wsh.py'
+_DO_EXTRA_HANDSHAKE_HANDLER_NAME = 'web_socket_do_extra_handshake'
+_TRANSFER_DATA_HANDLER_NAME = 'web_socket_transfer_data'
+_PASSIVE_CLOSING_HANDSHAKE_HANDLER_NAME = (
+ 'web_socket_passive_closing_handshake')
+
+
+class DispatchException(Exception):
+ """Exception in dispatching WebSocket request."""
+
+ def __init__(self, name, status=common.HTTP_STATUS_NOT_FOUND):
+ super(DispatchException, self).__init__(name)
+ self.status = status
+
+
+def _default_passive_closing_handshake_handler(request):
+ """Default web_socket_passive_closing_handshake handler."""
+
+ return common.STATUS_NORMAL_CLOSURE, ''
+
+
+def _normalize_path(path):
+ """Normalize path.
+
+ Args:
+ path: the path to normalize.
+
+ Path is converted to the absolute path.
+ The input path can use either '\\' or '/' as the separator.
+ The normalized path always uses '/' regardless of the platform.
+ """
+
+ path = path.replace('\\', os.path.sep)
+ path = os.path.realpath(path)
+ path = path.replace('\\', '/')
+ return path
+
+
+def _create_path_to_resource_converter(base_dir):
+ """Returns a function that converts the path of a WebSocket handler source
+ file to a resource string by removing the path to the base directory from
+ its head, removing _SOURCE_SUFFIX from its tail, and replacing path
+ separators in it with '/'.
+
+ Args:
+ base_dir: the path to the base directory.
+ """
+
+ base_dir = _normalize_path(base_dir)
+
+ base_len = len(base_dir)
+ suffix_len = len(_SOURCE_SUFFIX)
+
+ def converter(path):
+ if not path.endswith(_SOURCE_SUFFIX):
+ return None
+ # _normalize_path must not be used because resolving symlink breaks
+ # following path check.
+ path = path.replace('\\', '/')
+ if not path.startswith(base_dir):
+ return None
+ return path[base_len:-suffix_len]
+
+ return converter
+
+
+def _enumerate_handler_file_paths(directory):
+ """Returns a generator that enumerates WebSocket Handler source file names
+ in the given directory.
+ """
+
+ for root, unused_dirs, files in os.walk(directory):
+ for base in files:
+ path = os.path.join(root, base)
+ if _SOURCE_PATH_PATTERN.search(path):
+ yield path
+
+
+class _HandlerSuite(object):
+ """A handler suite holder class."""
+
+ def __init__(self, do_extra_handshake, transfer_data,
+ passive_closing_handshake):
+ self.do_extra_handshake = do_extra_handshake
+ self.transfer_data = transfer_data
+ self.passive_closing_handshake = passive_closing_handshake
+
+
+def _source_handler_file(handler_definition):
+ """Source a handler definition string.
+
+ Args:
+ handler_definition: a string containing Python statements that define
+ handler functions.
+ """
+
+ global_dic = {}
+ try:
+ exec handler_definition in global_dic
+ except Exception:
+ raise DispatchException('Error in sourcing handler:' +
+ util.get_stack_trace())
+ passive_closing_handshake_handler = None
+ try:
+ passive_closing_handshake_handler = _extract_handler(
+ global_dic, _PASSIVE_CLOSING_HANDSHAKE_HANDLER_NAME)
+ except Exception:
+ passive_closing_handshake_handler = (
+ _default_passive_closing_handshake_handler)
+ return _HandlerSuite(
+ _extract_handler(global_dic, _DO_EXTRA_HANDSHAKE_HANDLER_NAME),
+ _extract_handler(global_dic, _TRANSFER_DATA_HANDLER_NAME),
+ passive_closing_handshake_handler)
+
+
+def _extract_handler(dic, name):
+ """Extracts a callable with the specified name from the given dictionary
+ dic.
+ """
+
+ if name not in dic:
+ raise DispatchException('%s is not defined.' % name)
+ handler = dic[name]
+ if not callable(handler):
+ raise DispatchException('%s is not callable.' % name)
+ return handler
+
+
+class Dispatcher(object):
+ """Dispatches WebSocket requests.
+
+ This class maintains a map from resource name to handlers.
+ """
+
+ def __init__(
+ self, root_dir, scan_dir=None,
+ allow_handlers_outside_root_dir=True):
+ """Construct an instance.
+
+ Args:
+ root_dir: The directory where handler definition files are
+ placed.
+ scan_dir: The directory where handler definition files are
+ searched. scan_dir must be a directory under root_dir,
+ including root_dir itself. If scan_dir is None,
+ root_dir is used as scan_dir. scan_dir can be useful
+ in saving scan time when root_dir contains many
+ subdirectories.
+ allow_handlers_outside_root_dir: Scans handler files even if their
+ canonical path is not under root_dir.
+ """
+
+ self._logger = util.get_class_logger(self)
+
+ self._handler_suite_map = {}
+ self._source_warnings = []
+ if scan_dir is None:
+ scan_dir = root_dir
+ if not os.path.realpath(scan_dir).startswith(
+ os.path.realpath(root_dir)):
+ raise DispatchException('scan_dir:%s must be a directory under '
+ 'root_dir:%s.' % (scan_dir, root_dir))
+ self._source_handler_files_in_dir(
+ root_dir, scan_dir, allow_handlers_outside_root_dir)
+
+ def add_resource_path_alias(self,
+ alias_resource_path, existing_resource_path):
+ """Add resource path alias.
+
+ Once added, request to alias_resource_path would be handled by
+ handler registered for existing_resource_path.
+
+ Args:
+ alias_resource_path: alias resource path
+ existing_resource_path: existing resource path
+ """
+ try:
+ handler_suite = self._handler_suite_map[existing_resource_path]
+ self._handler_suite_map[alias_resource_path] = handler_suite
+ except KeyError:
+ raise DispatchException('No handler for: %r' %
+ existing_resource_path)
+
+ def source_warnings(self):
+ """Return warnings in sourcing handlers."""
+
+ return self._source_warnings
+
+ def do_extra_handshake(self, request):
+ """Do extra checking in WebSocket handshake.
+
+ Select a handler based on request.uri and call its
+ web_socket_do_extra_handshake function.
+
+ Args:
+ request: mod_python request.
+
+ Raises:
+ DispatchException: when handler was not found
+ AbortedByUserException: when user handler abort connection
+ HandshakeException: when opening handshake failed
+ """
+
+ handler_suite = self.get_handler_suite(request.ws_resource)
+ if handler_suite is None:
+ raise DispatchException('No handler for: %r' % request.ws_resource)
+ do_extra_handshake_ = handler_suite.do_extra_handshake
+ try:
+ do_extra_handshake_(request)
+ except handshake.AbortedByUserException, e:
+ raise
+ except Exception, e:
+ util.prepend_message_to_exception(
+ '%s raised exception for %s: ' % (
+ _DO_EXTRA_HANDSHAKE_HANDLER_NAME,
+ request.ws_resource),
+ e)
+ raise handshake.HandshakeException(e, common.HTTP_STATUS_FORBIDDEN)
+
+ def transfer_data(self, request):
+ """Let a handler transfer_data with a WebSocket client.
+
+ Select a handler based on request.ws_resource and call its
+ web_socket_transfer_data function.
+
+ Args:
+ request: mod_python request.
+
+ Raises:
+ DispatchException: when handler was not found
+ AbortedByUserException: when user handler abort connection
+ """
+
+ handler_suite = self.get_handler_suite(request.ws_resource)
+ if handler_suite is None:
+ raise DispatchException('No handler for: %r' % request.ws_resource)
+ transfer_data_ = handler_suite.transfer_data
+ # TODO(tyoshino): Terminate underlying TCP connection if possible.
+ try:
+ transfer_data_(request)
+ if not request.server_terminated:
+ request.ws_stream.close_connection()
+ # Catch non-critical exceptions the handler didn't handle.
+ except handshake.AbortedByUserException, e:
+ self._logger.debug('%s', e)
+ raise
+ except msgutil.BadOperationException, e:
+ self._logger.debug('%s', e)
+ request.ws_stream.close_connection(common.STATUS_ABNORMAL_CLOSURE)
+ except msgutil.InvalidFrameException, e:
+ # InvalidFrameException must be caught before
+ # ConnectionTerminatedException that catches InvalidFrameException.
+ self._logger.debug('%s', e)
+ request.ws_stream.close_connection(common.STATUS_PROTOCOL_ERROR)
+ except msgutil.UnsupportedFrameException, e:
+ self._logger.debug('%s', e)
+ request.ws_stream.close_connection(common.STATUS_UNSUPPORTED_DATA)
+ except stream.InvalidUTF8Exception, e:
+ self._logger.debug('%s', e)
+ request.ws_stream.close_connection(
+ common.STATUS_INVALID_FRAME_PAYLOAD_DATA)
+ except msgutil.ConnectionTerminatedException, e:
+ self._logger.debug('%s', e)
+ except Exception, e:
+ util.prepend_message_to_exception(
+ '%s raised exception for %s: ' % (
+ _TRANSFER_DATA_HANDLER_NAME, request.ws_resource),
+ e)
+ raise
+
+ def passive_closing_handshake(self, request):
+ """Prepare code and reason for responding client initiated closing
+ handshake.
+ """
+
+ handler_suite = self.get_handler_suite(request.ws_resource)
+ if handler_suite is None:
+ return _default_passive_closing_handshake_handler(request)
+ return handler_suite.passive_closing_handshake(request)
+
+ def get_handler_suite(self, resource):
+ """Retrieves two handlers (one for extra handshake processing, and one
+ for data transfer) for the given request as a HandlerSuite object.
+ """
+
+ fragment = None
+ if '#' in resource:
+ resource, fragment = resource.split('#', 1)
+ if '?' in resource:
+ resource = resource.split('?', 1)[0]
+ handler_suite = self._handler_suite_map.get(resource)
+ if handler_suite and fragment:
+ raise DispatchException('Fragment identifiers MUST NOT be used on '
+ 'WebSocket URIs',
+ common.HTTP_STATUS_BAD_REQUEST)
+ return handler_suite
+
+ def _source_handler_files_in_dir(
+ self, root_dir, scan_dir, allow_handlers_outside_root_dir):
+ """Source all the handler source files in the scan_dir directory.
+
+ The resource path is determined relative to root_dir.
+ """
+
+ # We build a map from resource to handler code assuming that there's
+ # only one path from root_dir to scan_dir and it can be obtained by
+ # comparing realpath of them.
+
+ # Here we cannot use abspath. See
+ # https://bugs.webkit.org/show_bug.cgi?id=31603
+
+ convert = _create_path_to_resource_converter(root_dir)
+ scan_realpath = os.path.realpath(scan_dir)
+ root_realpath = os.path.realpath(root_dir)
+ for path in _enumerate_handler_file_paths(scan_realpath):
+ if (not allow_handlers_outside_root_dir and
+ (not os.path.realpath(path).startswith(root_realpath))):
+ self._logger.debug(
+ 'Canonical path of %s is not under root directory' %
+ path)
+ continue
+ try:
+ handler_suite = _source_handler_file(open(path).read())
+ except DispatchException, e:
+ self._source_warnings.append('%s: %s' % (path, e))
+ continue
+ resource = convert(path)
+ if resource is None:
+ self._logger.debug(
+ 'Path to resource conversion on %s failed' % path)
+ else:
+ self._handler_suite_map[convert(path)] = handler_suite
+
+
+# vi:sts=4 sw=4 et
diff --git a/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/extensions.py b/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/extensions.py
new file mode 100644
index 000000000..ce3784658
--- /dev/null
+++ b/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/extensions.py
@@ -0,0 +1,265 @@
+# Copyright 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:
+#
+# * 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.
+
+
+from mod_pywebsocket import common
+from mod_pywebsocket import util
+
+
+_available_processors = {}
+
+
+class ExtensionProcessorInterface(object):
+
+ def get_extension_response(self):
+ return None
+
+ def setup_stream_options(self, stream_options):
+ pass
+
+
+class DeflateStreamExtensionProcessor(ExtensionProcessorInterface):
+ """WebSocket DEFLATE stream extension processor."""
+
+ def __init__(self, request):
+ self._logger = util.get_class_logger(self)
+
+ self._request = request
+
+ def get_extension_response(self):
+ if len(self._request.get_parameter_names()) != 0:
+ return None
+
+ self._logger.debug(
+ 'Enable %s extension', common.DEFLATE_STREAM_EXTENSION)
+
+ return common.ExtensionParameter(common.DEFLATE_STREAM_EXTENSION)
+
+ def setup_stream_options(self, stream_options):
+ stream_options.deflate_stream = True
+
+
+_available_processors[common.DEFLATE_STREAM_EXTENSION] = (
+ DeflateStreamExtensionProcessor)
+
+
+class DeflateFrameExtensionProcessor(ExtensionProcessorInterface):
+ """WebSocket Per-frame DEFLATE extension processor."""
+
+ _WINDOW_BITS_PARAM = 'max_window_bits'
+ _NO_CONTEXT_TAKEOVER_PARAM = 'no_context_takeover'
+
+ def __init__(self, request):
+ self._logger = util.get_class_logger(self)
+
+ self._request = request
+
+ self._response_window_bits = None
+ self._response_no_context_takeover = False
+
+ # Counters for statistics.
+
+ # Total number of outgoing bytes supplied to this filter.
+ self._total_outgoing_payload_bytes = 0
+ # Total number of bytes sent to the network after applying this filter.
+ self._total_filtered_outgoing_payload_bytes = 0
+
+ # Total number of bytes received from the network.
+ self._total_incoming_payload_bytes = 0
+ # Total number of incoming bytes obtained after applying this filter.
+ self._total_filtered_incoming_payload_bytes = 0
+
+ def get_extension_response(self):
+ # Any unknown parameter will be just ignored.
+
+ window_bits = self._request.get_parameter_value(
+ self._WINDOW_BITS_PARAM)
+ no_context_takeover = self._request.has_parameter(
+ self._NO_CONTEXT_TAKEOVER_PARAM)
+ if (no_context_takeover and
+ self._request.get_parameter_value(
+ self._NO_CONTEXT_TAKEOVER_PARAM) is not None):
+ return None
+
+ if window_bits is not None:
+ try:
+ window_bits = int(window_bits)
+ except ValueError, e:
+ return None
+ if window_bits < 8 or window_bits > 15:
+ return None
+
+ self._deflater = util._RFC1979Deflater(
+ window_bits, no_context_takeover)
+
+ self._inflater = util._RFC1979Inflater()
+
+ self._compress_outgoing = True
+
+ response = common.ExtensionParameter(self._request.name())
+
+ if self._response_window_bits is not None:
+ response.add_parameter(
+ self._WINDOW_BITS_PARAM, str(self._response_window_bits))
+ if self._response_no_context_takeover:
+ response.add_parameter(
+ self._NO_CONTEXT_TAKEOVER_PARAM, None)
+
+ self._logger.debug(
+ 'Enable %s extension ('
+ 'request: window_bits=%s; no_context_takeover=%r, '
+ 'response: window_wbits=%s; no_context_takeover=%r)' %
+ (self._request.name(),
+ window_bits,
+ no_context_takeover,
+ self._response_window_bits,
+ self._response_no_context_takeover))
+
+ return response
+
+ def setup_stream_options(self, stream_options):
+
+ class _OutgoingFilter(object):
+
+ def __init__(self, parent):
+ self._parent = parent
+
+ def filter(self, frame):
+ self._parent._outgoing_filter(frame)
+
+ class _IncomingFilter(object):
+
+ def __init__(self, parent):
+ self._parent = parent
+
+ def filter(self, frame):
+ self._parent._incoming_filter(frame)
+
+ stream_options.outgoing_frame_filters.append(
+ _OutgoingFilter(self))
+ stream_options.incoming_frame_filters.insert(
+ 0, _IncomingFilter(self))
+
+ def set_response_window_bits(self, value):
+ self._response_window_bits = value
+
+ def set_response_no_context_takeover(self, value):
+ self._response_no_context_takeover = value
+
+ def enable_outgoing_compression(self):
+ self._compress_outgoing = True
+
+ def disable_outgoing_compression(self):
+ self._compress_outgoing = False
+
+ def _outgoing_filter(self, frame):
+ """Transform outgoing frames. This method is called only by
+ an _OutgoingFilter instance.
+ """
+
+ original_payload_size = len(frame.payload)
+ self._total_outgoing_payload_bytes += original_payload_size
+
+ if (not self._compress_outgoing or
+ common.is_control_opcode(frame.opcode)):
+ self._total_filtered_outgoing_payload_bytes += (
+ original_payload_size)
+ return
+
+ frame.payload = self._deflater.filter(frame.payload)
+ frame.rsv1 = 1
+
+ filtered_payload_size = len(frame.payload)
+ self._total_filtered_outgoing_payload_bytes += filtered_payload_size
+
+ # Print inf when ratio is not available.
+ ratio = float('inf')
+ average_ratio = float('inf')
+ if original_payload_size != 0:
+ ratio = float(filtered_payload_size) / original_payload_size
+ if self._total_outgoing_payload_bytes != 0:
+ average_ratio = (
+ float(self._total_filtered_outgoing_payload_bytes) /
+ self._total_outgoing_payload_bytes)
+ self._logger.debug(
+ 'Outgoing compress ratio: %f (average: %f)' %
+ (ratio, average_ratio))
+
+ def _incoming_filter(self, frame):
+ """Transform incoming frames. This method is called only by
+ an _IncomingFilter instance.
+ """
+
+ received_payload_size = len(frame.payload)
+ self._total_incoming_payload_bytes += received_payload_size
+
+ if frame.rsv1 != 1 or common.is_control_opcode(frame.opcode):
+ self._total_filtered_incoming_payload_bytes += (
+ received_payload_size)
+ return
+
+ frame.payload = self._inflater.filter(frame.payload)
+ frame.rsv1 = 0
+
+ filtered_payload_size = len(frame.payload)
+ self._total_filtered_incoming_payload_bytes += filtered_payload_size
+
+ # Print inf when ratio is not available.
+ ratio = float('inf')
+ average_ratio = float('inf')
+ if received_payload_size != 0:
+ ratio = float(received_payload_size) / filtered_payload_size
+ if self._total_filtered_incoming_payload_bytes != 0:
+ average_ratio = (
+ float(self._total_incoming_payload_bytes) /
+ self._total_filtered_incoming_payload_bytes)
+ self._logger.debug(
+ 'Incoming compress ratio: %f (average: %f)' %
+ (ratio, average_ratio))
+
+
+_available_processors[common.DEFLATE_FRAME_EXTENSION] = (
+ DeflateFrameExtensionProcessor)
+
+
+# Adding vendor-prefixed deflate-frame extension.
+# TODO(bashi): Remove this after WebKit stops using vender prefix.
+_available_processors[common.X_WEBKIT_DEFLATE_FRAME_EXTENSION] = (
+ DeflateFrameExtensionProcessor)
+
+
+def get_extension_processor(extension_request):
+ global _available_processors
+ processor_class = _available_processors.get(extension_request.name())
+ if processor_class is None:
+ return None
+ return processor_class(extension_request)
+
+
+# vi:sts=4 sw=4 et
diff --git a/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/handshake/__init__.py b/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/handshake/__init__.py
new file mode 100644
index 000000000..10a178314
--- /dev/null
+++ b/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/handshake/__init__.py
@@ -0,0 +1,116 @@
+# Copyright 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:
+#
+# * 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.
+
+
+"""WebSocket opening handshake processor. This class try to apply available
+opening handshake processors for each protocol version until a connection is
+successfully established.
+"""
+
+
+import logging
+
+from mod_pywebsocket import common
+from mod_pywebsocket.handshake import draft75
+from mod_pywebsocket.handshake import hybi00
+from mod_pywebsocket.handshake import hybi
+# Export AbortedByUserException, HandshakeException, and VersionException
+# symbol from this module.
+from mod_pywebsocket.handshake._base import AbortedByUserException
+from mod_pywebsocket.handshake._base import HandshakeException
+from mod_pywebsocket.handshake._base import VersionException
+
+
+_LOGGER = logging.getLogger(__name__)
+
+
+def do_handshake(request, dispatcher, allowDraft75=False, strict=False):
+ """Performs WebSocket handshake.
+
+ Args:
+ request: mod_python request.
+ dispatcher: Dispatcher (dispatch.Dispatcher).
+ allowDraft75: allow draft 75 handshake protocol.
+ strict: Strictly check handshake request in draft 75.
+ Default: False. If True, request.connection must provide
+ get_memorized_lines method.
+
+ Handshaker will add attributes such as ws_resource in performing
+ handshake.
+ """
+
+ _LOGGER.debug('Client\'s opening handshake resource: %r', request.uri)
+ # To print mimetools.Message as escaped one-line string, we converts
+ # headers_in to dict object. Without conversion, if we use %r, it just
+ # prints the type and address, and if we use %s, it prints the original
+ # header string as multiple lines.
+ #
+ # Both mimetools.Message and MpTable_Type of mod_python can be
+ # converted to dict.
+ #
+ # mimetools.Message.__str__ returns the original header string.
+ # dict(mimetools.Message object) returns the map from header names to
+ # header values. While MpTable_Type doesn't have such __str__ but just
+ # __repr__ which formats itself as well as dictionary object.
+ _LOGGER.debug(
+ 'Client\'s opening handshake headers: %r', dict(request.headers_in))
+
+ handshakers = []
+ handshakers.append(
+ ('RFC 6455', hybi.Handshaker(request, dispatcher)))
+ handshakers.append(
+ ('HyBi 00', hybi00.Handshaker(request, dispatcher)))
+ if allowDraft75:
+ handshakers.append(
+ ('Hixie 75', draft75.Handshaker(request, dispatcher, strict)))
+
+ for name, handshaker in handshakers:
+ _LOGGER.debug('Trying protocol version %s', name)
+ try:
+ handshaker.do_handshake()
+ _LOGGER.info('Established (%s protocol)', name)
+ return
+ except HandshakeException, e:
+ _LOGGER.debug(
+ 'Failed to complete opening handshake as %s protocol: %r',
+ name, e)
+ if e.status:
+ raise e
+ except AbortedByUserException, e:
+ raise
+ except VersionException, e:
+ raise
+
+ # TODO(toyoshim): Add a test to cover the case all handshakers fail.
+ raise HandshakeException(
+ 'Failed to complete opening handshake for all available protocols',
+ status=common.HTTP_STATUS_BAD_REQUEST)
+
+
+# vi:sts=4 sw=4 et
diff --git a/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/handshake/_base.py b/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/handshake/_base.py
new file mode 100644
index 000000000..4d7c32e35
--- /dev/null
+++ b/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/handshake/_base.py
@@ -0,0 +1,323 @@
+# Copyright 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:
+#
+# * 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.
+
+
+"""Common functions and exceptions used by WebSocket opening handshake
+processors.
+"""
+
+
+from mod_pywebsocket import common
+from mod_pywebsocket import http_header_util
+
+
+class AbortedByUserException(Exception):
+ """Exception for aborting a connection intentionally.
+
+ If this exception is raised in do_extra_handshake handler, the connection
+ will be abandoned. No other WebSocket or HTTP(S) handler will be invoked.
+
+ If this exception is raised in transfer_data_handler, the connection will
+ be closed without closing handshake. No other WebSocket or HTTP(S) handler
+ will be invoked.
+ """
+
+ pass
+
+
+class HandshakeException(Exception):
+ """This exception will be raised when an error occurred while processing
+ WebSocket initial handshake.
+ """
+
+ def __init__(self, name, status=None):
+ super(HandshakeException, self).__init__(name)
+ self.status = status
+
+
+class VersionException(Exception):
+ """This exception will be raised when a version of client request does not
+ match with version the server supports.
+ """
+
+ def __init__(self, name, supported_versions=''):
+ """Construct an instance.
+
+ Args:
+ supported_version: a str object to show supported hybi versions.
+ (e.g. '8, 13')
+ """
+ super(VersionException, self).__init__(name)
+ self.supported_versions = supported_versions
+
+
+def get_default_port(is_secure):
+ if is_secure:
+ return common.DEFAULT_WEB_SOCKET_SECURE_PORT
+ else:
+ return common.DEFAULT_WEB_SOCKET_PORT
+
+
+def validate_subprotocol(subprotocol, hixie):
+ """Validate a value in subprotocol fields such as WebSocket-Protocol,
+ Sec-WebSocket-Protocol.
+
+ See
+ - RFC 6455: Section 4.1., 4.2.2., and 4.3.
+ - HyBi 00: Section 4.1. Opening handshake
+ - Hixie 75: Section 4.1. Handshake
+ """
+
+ if not subprotocol:
+ raise HandshakeException('Invalid subprotocol name: empty')
+ if hixie:
+ # Parameter should be in the range U+0020 to U+007E.
+ for c in subprotocol:
+ if not 0x20 <= ord(c) <= 0x7e:
+ raise HandshakeException(
+ 'Illegal character in subprotocol name: %r' % c)
+ else:
+ # Parameter should be encoded HTTP token.
+ state = http_header_util.ParsingState(subprotocol)
+ token = http_header_util.consume_token(state)
+ rest = http_header_util.peek(state)
+ # If |rest| is not None, |subprotocol| is not one token or invalid. If
+ # |rest| is None, |token| must not be None because |subprotocol| is
+ # concatenation of |token| and |rest| and is not None.
+ if rest is not None:
+ raise HandshakeException('Invalid non-token string in subprotocol '
+ 'name: %r' % rest)
+
+
+def parse_host_header(request):
+ fields = request.headers_in['Host'].split(':', 1)
+ if len(fields) == 1:
+ return fields[0], get_default_port(request.is_https())
+ try:
+ return fields[0], int(fields[1])
+ except ValueError, e:
+ raise HandshakeException('Invalid port number format: %r' % e)
+
+
+def format_header(name, value):
+ return '%s: %s\r\n' % (name, value)
+
+
+def build_location(request):
+ """Build WebSocket location for request."""
+ location_parts = []
+ if request.is_https():
+ location_parts.append(common.WEB_SOCKET_SECURE_SCHEME)
+ else:
+ location_parts.append(common.WEB_SOCKET_SCHEME)
+ location_parts.append('://')
+ host, port = parse_host_header(request)
+ connection_port = request.connection.local_addr[1]
+ if port != connection_port:
+ raise HandshakeException('Header/connection port mismatch: %d/%d' %
+ (port, connection_port))
+ location_parts.append(host)
+ if (port != get_default_port(request.is_https())):
+ location_parts.append(':')
+ location_parts.append(str(port))
+ location_parts.append(request.uri)
+ return ''.join(location_parts)
+
+
+def get_mandatory_header(request, key):
+ value = request.headers_in.get(key)
+ if value is None:
+ raise HandshakeException('Header %s is not defined' % key)
+ return value
+
+
+def validate_mandatory_header(request, key, expected_value, fail_status=None):
+ value = get_mandatory_header(request, key)
+
+ if value.lower() != expected_value.lower():
+ raise HandshakeException(
+ 'Expected %r for header %s but found %r (case-insensitive)' %
+ (expected_value, key, value), status=fail_status)
+
+
+def check_request_line(request):
+ # 5.1 1. The three character UTF-8 string "GET".
+ # 5.1 2. A UTF-8-encoded U+0020 SPACE character (0x20 byte).
+ if request.method != 'GET':
+ raise HandshakeException('Method is not GET')
+
+
+def check_header_lines(request, mandatory_headers):
+ check_request_line(request)
+
+ # The expected field names, and the meaning of their corresponding
+ # values, are as follows.
+ # |Upgrade| and |Connection|
+ for key, expected_value in mandatory_headers:
+ validate_mandatory_header(request, key, expected_value)
+
+
+def parse_token_list(data):
+ """Parses a header value which follows 1#token and returns parsed elements
+ as a list of strings.
+
+ Leading LWSes must be trimmed.
+ """
+
+ state = http_header_util.ParsingState(data)
+
+ token_list = []
+
+ while True:
+ token = http_header_util.consume_token(state)
+ if token is not None:
+ token_list.append(token)
+
+ http_header_util.consume_lwses(state)
+
+ if http_header_util.peek(state) is None:
+ break
+
+ if not http_header_util.consume_string(state, ','):
+ raise HandshakeException(
+ 'Expected a comma but found %r' % http_header_util.peek(state))
+
+ http_header_util.consume_lwses(state)
+
+ if len(token_list) == 0:
+ raise HandshakeException('No valid token found')
+
+ return token_list
+
+
+def _parse_extension_param(state, definition, allow_quoted_string):
+ param_name = http_header_util.consume_token(state)
+
+ if param_name is None:
+ raise HandshakeException('No valid parameter name found')
+
+ http_header_util.consume_lwses(state)
+
+ if not http_header_util.consume_string(state, '='):
+ definition.add_parameter(param_name, None)
+ return
+
+ http_header_util.consume_lwses(state)
+
+ if allow_quoted_string:
+ # TODO(toyoshim): Add code to validate that parsed param_value is token
+ param_value = http_header_util.consume_token_or_quoted_string(state)
+ else:
+ param_value = http_header_util.consume_token(state)
+ if param_value is None:
+ raise HandshakeException(
+ 'No valid parameter value found on the right-hand side of '
+ 'parameter %r' % param_name)
+
+ definition.add_parameter(param_name, param_value)
+
+
+def _parse_extension(state, allow_quoted_string):
+ extension_token = http_header_util.consume_token(state)
+ if extension_token is None:
+ return None
+
+ extension = common.ExtensionParameter(extension_token)
+
+ while True:
+ http_header_util.consume_lwses(state)
+
+ if not http_header_util.consume_string(state, ';'):
+ break
+
+ http_header_util.consume_lwses(state)
+
+ try:
+ _parse_extension_param(state, extension, allow_quoted_string)
+ except HandshakeException, e:
+ raise HandshakeException(
+ 'Failed to parse Sec-WebSocket-Extensions header: '
+ 'Failed to parse parameter for %r (%r)' %
+ (extension_token, e))
+
+ return extension
+
+
+def parse_extensions(data, allow_quoted_string=False):
+ """Parses Sec-WebSocket-Extensions header value returns a list of
+ common.ExtensionParameter objects.
+
+ Leading LWSes must be trimmed.
+ """
+
+ state = http_header_util.ParsingState(data)
+
+ extension_list = []
+ while True:
+ extension = _parse_extension(state, allow_quoted_string)
+ if extension is not None:
+ extension_list.append(extension)
+
+ http_header_util.consume_lwses(state)
+
+ if http_header_util.peek(state) is None:
+ break
+
+ if not http_header_util.consume_string(state, ','):
+ raise HandshakeException(
+ 'Failed to parse Sec-WebSocket-Extensions header: '
+ 'Expected a comma but found %r' %
+ http_header_util.peek(state))
+
+ http_header_util.consume_lwses(state)
+
+ if len(extension_list) == 0:
+ raise HandshakeException(
+ 'Sec-WebSocket-Extensions header contains no valid extension')
+
+ return extension_list
+
+
+def format_extensions(extension_list):
+ formatted_extension_list = []
+ for extension in extension_list:
+ formatted_params = [extension.name()]
+ for param_name, param_value in extension.get_parameters():
+ if param_value is None:
+ formatted_params.append(param_name)
+ else:
+ quoted_value = http_header_util.quote_if_necessary(param_value)
+ formatted_params.append('%s=%s' % (param_name, quoted_value))
+
+ formatted_extension_list.append('; '.join(formatted_params))
+
+ return ', '.join(formatted_extension_list)
+
+
+# vi:sts=4 sw=4 et
diff --git a/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/handshake/draft75.py b/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/handshake/draft75.py
new file mode 100644
index 000000000..802a31c9a
--- /dev/null
+++ b/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/handshake/draft75.py
@@ -0,0 +1,190 @@
+# Copyright 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:
+#
+# * 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.
+
+
+"""WebSocket handshaking defined in draft-hixie-thewebsocketprotocol-75."""
+
+
+# Note: request.connection.write is used in this module, even though mod_python
+# document says that it should be used only in connection handlers.
+# Unfortunately, we have no other options. For example, request.write is not
+# suitable because it doesn't allow direct raw bytes writing.
+
+
+import logging
+import re
+
+from mod_pywebsocket import common
+from mod_pywebsocket.stream import StreamHixie75
+from mod_pywebsocket import util
+from mod_pywebsocket.handshake._base import HandshakeException
+from mod_pywebsocket.handshake._base import build_location
+from mod_pywebsocket.handshake._base import validate_subprotocol
+
+
+_MANDATORY_HEADERS = [
+ # key, expected value or None
+ ['Upgrade', 'WebSocket'],
+ ['Connection', 'Upgrade'],
+ ['Host', None],
+ ['Origin', None],
+]
+
+_FIRST_FIVE_LINES = map(re.compile, [
+ r'^GET /[\S]* HTTP/1.1\r\n$',
+ r'^Upgrade: WebSocket\r\n$',
+ r'^Connection: Upgrade\r\n$',
+ r'^Host: [\S]+\r\n$',
+ r'^Origin: [\S]+\r\n$',
+])
+
+_SIXTH_AND_LATER = re.compile(
+ r'^'
+ r'(WebSocket-Protocol: [\x20-\x7e]+\r\n)?'
+ r'(Cookie: [^\r]*\r\n)*'
+ r'(Cookie2: [^\r]*\r\n)?'
+ r'(Cookie: [^\r]*\r\n)*'
+ r'\r\n')
+
+
+class Handshaker(object):
+ """This class performs WebSocket handshake."""
+
+ def __init__(self, request, dispatcher, strict=False):
+ """Construct an instance.
+
+ Args:
+ request: mod_python request.
+ dispatcher: Dispatcher (dispatch.Dispatcher).
+ strict: Strictly check handshake request. Default: False.
+ If True, request.connection must provide get_memorized_lines
+ method.
+
+ Handshaker will add attributes such as ws_resource in performing
+ handshake.
+ """
+
+ self._logger = util.get_class_logger(self)
+
+ self._request = request
+ self._dispatcher = dispatcher
+ self._strict = strict
+
+ def do_handshake(self):
+ """Perform WebSocket Handshake.
+
+ On _request, we set
+ ws_resource, ws_origin, ws_location, ws_protocol
+ ws_challenge_md5: WebSocket handshake information.
+ ws_stream: Frame generation/parsing class.
+ ws_version: Protocol version.
+ """
+
+ self._check_header_lines()
+ self._set_resource()
+ self._set_origin()
+ self._set_location()
+ self._set_subprotocol()
+ self._set_protocol_version()
+
+ self._dispatcher.do_extra_handshake(self._request)
+
+ self._send_handshake()
+
+ self._logger.debug('Sent opening handshake response')
+
+ def _set_resource(self):
+ self._request.ws_resource = self._request.uri
+
+ def _set_origin(self):
+ self._request.ws_origin = self._request.headers_in['Origin']
+
+ def _set_location(self):
+ self._request.ws_location = build_location(self._request)
+
+ def _set_subprotocol(self):
+ subprotocol = self._request.headers_in.get('WebSocket-Protocol')
+ if subprotocol is not None:
+ validate_subprotocol(subprotocol, hixie=True)
+ self._request.ws_protocol = subprotocol
+
+ def _set_protocol_version(self):
+ self._logger.debug('IETF Hixie 75 protocol')
+ self._request.ws_version = common.VERSION_HIXIE75
+ self._request.ws_stream = StreamHixie75(self._request)
+
+ def _sendall(self, data):
+ self._request.connection.write(data)
+
+ def _send_handshake(self):
+ self._sendall('HTTP/1.1 101 Web Socket Protocol Handshake\r\n')
+ self._sendall('Upgrade: WebSocket\r\n')
+ self._sendall('Connection: Upgrade\r\n')
+ self._sendall('WebSocket-Origin: %s\r\n' % self._request.ws_origin)
+ self._sendall('WebSocket-Location: %s\r\n' % self._request.ws_location)
+ if self._request.ws_protocol:
+ self._sendall(
+ 'WebSocket-Protocol: %s\r\n' % self._request.ws_protocol)
+ self._sendall('\r\n')
+
+ def _check_header_lines(self):
+ for key, expected_value in _MANDATORY_HEADERS:
+ actual_value = self._request.headers_in.get(key)
+ if not actual_value:
+ raise HandshakeException('Header %s is not defined' % key)
+ if expected_value:
+ if actual_value != expected_value:
+ raise HandshakeException(
+ 'Expected %r for header %s but found %r' %
+ (expected_value, key, actual_value))
+ if self._strict:
+ try:
+ lines = self._request.connection.get_memorized_lines()
+ except AttributeError, e:
+ raise AttributeError(
+ 'Strict handshake is specified but the connection '
+ 'doesn\'t provide get_memorized_lines()')
+ self._check_first_lines(lines)
+
+ def _check_first_lines(self, lines):
+ if len(lines) < len(_FIRST_FIVE_LINES):
+ raise HandshakeException('Too few header lines: %d' % len(lines))
+ for line, regexp in zip(lines, _FIRST_FIVE_LINES):
+ if not regexp.search(line):
+ raise HandshakeException(
+ 'Unexpected header: %r doesn\'t match %r'
+ % (line, regexp.pattern))
+ sixth_and_later = ''.join(lines[5:])
+ if not _SIXTH_AND_LATER.search(sixth_and_later):
+ raise HandshakeException(
+ 'Unexpected header: %r doesn\'t match %r'
+ % (sixth_and_later, _SIXTH_AND_LATER.pattern))
+
+
+# vi:sts=4 sw=4 et
diff --git a/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/handshake/hybi.py b/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/handshake/hybi.py
new file mode 100644
index 000000000..3bc84bd26
--- /dev/null
+++ b/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/handshake/hybi.py
@@ -0,0 +1,370 @@
+# Copyright 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:
+#
+# * 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.
+
+
+"""This file provides the opening handshake processor for the WebSocket
+protocol (RFC 6455).
+
+Specification:
+http://tools.ietf.org/html/rfc6455
+"""
+
+
+# Note: request.connection.write is used in this module, even though mod_python
+# document says that it should be used only in connection handlers.
+# Unfortunately, we have no other options. For example, request.write is not
+# suitable because it doesn't allow direct raw bytes writing.
+
+
+import base64
+import logging
+import os
+import re
+
+from mod_pywebsocket import common
+from mod_pywebsocket.extensions import get_extension_processor
+from mod_pywebsocket.handshake._base import check_request_line
+from mod_pywebsocket.handshake._base import format_extensions
+from mod_pywebsocket.handshake._base import format_header
+from mod_pywebsocket.handshake._base import get_mandatory_header
+from mod_pywebsocket.handshake._base import HandshakeException
+from mod_pywebsocket.handshake._base import parse_extensions
+from mod_pywebsocket.handshake._base import parse_token_list
+from mod_pywebsocket.handshake._base import validate_mandatory_header
+from mod_pywebsocket.handshake._base import validate_subprotocol
+from mod_pywebsocket.handshake._base import VersionException
+from mod_pywebsocket.stream import Stream
+from mod_pywebsocket.stream import StreamOptions
+from mod_pywebsocket import util
+
+
+# Used to validate the value in the Sec-WebSocket-Key header strictly. RFC 4648
+# disallows non-zero padding, so the character right before == must be any of
+# A, Q, g and w.
+_SEC_WEBSOCKET_KEY_REGEX = re.compile('^[+/0-9A-Za-z]{21}[AQgw]==$')
+
+# Defining aliases for values used frequently.
+_VERSION_HYBI08 = common.VERSION_HYBI08
+_VERSION_HYBI08_STRING = str(_VERSION_HYBI08)
+_VERSION_LATEST = common.VERSION_HYBI_LATEST
+_VERSION_LATEST_STRING = str(_VERSION_LATEST)
+_SUPPORTED_VERSIONS = [
+ _VERSION_LATEST,
+ _VERSION_HYBI08,
+]
+
+
+def compute_accept(key):
+ """Computes value for the Sec-WebSocket-Accept header from value of the
+ Sec-WebSocket-Key header.
+ """
+
+ accept_binary = util.sha1_hash(
+ key + common.WEBSOCKET_ACCEPT_UUID).digest()
+ accept = base64.b64encode(accept_binary)
+
+ return (accept, accept_binary)
+
+
+class Handshaker(object):
+ """Opening handshake processor for the WebSocket protocol (RFC 6455)."""
+
+ def __init__(self, request, dispatcher):
+ """Construct an instance.
+
+ Args:
+ request: mod_python request.
+ dispatcher: Dispatcher (dispatch.Dispatcher).
+
+ Handshaker will add attributes such as ws_resource during handshake.
+ """
+
+ self._logger = util.get_class_logger(self)
+
+ self._request = request
+ self._dispatcher = dispatcher
+
+ def _validate_connection_header(self):
+ connection = get_mandatory_header(
+ self._request, common.CONNECTION_HEADER)
+
+ try:
+ connection_tokens = parse_token_list(connection)
+ except HandshakeException, e:
+ raise HandshakeException(
+ 'Failed to parse %s: %s' % (common.CONNECTION_HEADER, e))
+
+ connection_is_valid = False
+ for token in connection_tokens:
+ if token.lower() == common.UPGRADE_CONNECTION_TYPE.lower():
+ connection_is_valid = True
+ break
+ if not connection_is_valid:
+ raise HandshakeException(
+ '%s header doesn\'t contain "%s"' %
+ (common.CONNECTION_HEADER, common.UPGRADE_CONNECTION_TYPE))
+
+ def do_handshake(self):
+ self._request.ws_close_code = None
+ self._request.ws_close_reason = None
+
+ # Parsing.
+
+ check_request_line(self._request)
+
+ validate_mandatory_header(
+ self._request,
+ common.UPGRADE_HEADER,
+ common.WEBSOCKET_UPGRADE_TYPE)
+
+ self._validate_connection_header()
+
+ self._request.ws_resource = self._request.uri
+
+ unused_host = get_mandatory_header(self._request, common.HOST_HEADER)
+
+ self._request.ws_version = self._check_version()
+
+ # This handshake must be based on latest hybi. We are responsible to
+ # fallback to HTTP on handshake failure as latest hybi handshake
+ # specifies.
+ try:
+ self._get_origin()
+ self._set_protocol()
+ self._parse_extensions()
+
+ # Key validation, response generation.
+
+ key = self._get_key()
+ (accept, accept_binary) = compute_accept(key)
+ self._logger.debug(
+ '%s: %r (%s)',
+ common.SEC_WEBSOCKET_ACCEPT_HEADER,
+ accept,
+ util.hexify(accept_binary))
+
+ self._logger.debug('Protocol version is RFC 6455')
+
+ # Setup extension processors.
+
+ processors = []
+ if self._request.ws_requested_extensions is not None:
+ for extension_request in self._request.ws_requested_extensions:
+ processor = get_extension_processor(extension_request)
+ # Unknown extension requests are just ignored.
+ if processor is not None:
+ processors.append(processor)
+ self._request.ws_extension_processors = processors
+
+ # Extra handshake handler may modify/remove processors.
+ self._dispatcher.do_extra_handshake(self._request)
+
+ stream_options = StreamOptions()
+
+ self._request.ws_extensions = None
+ for processor in self._request.ws_extension_processors:
+ if processor is None:
+ # Some processors may be removed by extra handshake
+ # handler.
+ continue
+
+ extension_response = processor.get_extension_response()
+ if extension_response is None:
+ # Rejected.
+ continue
+
+ if self._request.ws_extensions is None:
+ self._request.ws_extensions = []
+ self._request.ws_extensions.append(extension_response)
+
+ processor.setup_stream_options(stream_options)
+
+ if self._request.ws_extensions is not None:
+ self._logger.debug(
+ 'Extensions accepted: %r',
+ map(common.ExtensionParameter.name,
+ self._request.ws_extensions))
+
+ self._request.ws_stream = Stream(self._request, stream_options)
+
+ if self._request.ws_requested_protocols is not None:
+ if self._request.ws_protocol is None:
+ raise HandshakeException(
+ 'do_extra_handshake must choose one subprotocol from '
+ 'ws_requested_protocols and set it to ws_protocol')
+ validate_subprotocol(self._request.ws_protocol, hixie=False)
+
+ self._logger.debug(
+ 'Subprotocol accepted: %r',
+ self._request.ws_protocol)
+ else:
+ if self._request.ws_protocol is not None:
+ raise HandshakeException(
+ 'ws_protocol must be None when the client didn\'t '
+ 'request any subprotocol')
+
+ self._send_handshake(accept)
+ except HandshakeException, e:
+ if not e.status:
+ # Fallback to 400 bad request by default.
+ e.status = common.HTTP_STATUS_BAD_REQUEST
+ raise e
+
+ def _get_origin(self):
+ if self._request.ws_version is _VERSION_HYBI08:
+ origin_header = common.SEC_WEBSOCKET_ORIGIN_HEADER
+ else:
+ origin_header = common.ORIGIN_HEADER
+ origin = self._request.headers_in.get(origin_header)
+ if origin is None:
+ self._logger.debug('Client request does not have origin header')
+ self._request.ws_origin = origin
+
+ def _check_version(self):
+ version = get_mandatory_header(self._request,
+ common.SEC_WEBSOCKET_VERSION_HEADER)
+ if version == _VERSION_HYBI08_STRING:
+ return _VERSION_HYBI08
+ if version == _VERSION_LATEST_STRING:
+ return _VERSION_LATEST
+
+ if version.find(',') >= 0:
+ raise HandshakeException(
+ 'Multiple versions (%r) are not allowed for header %s' %
+ (version, common.SEC_WEBSOCKET_VERSION_HEADER),
+ status=common.HTTP_STATUS_BAD_REQUEST)
+ raise VersionException(
+ 'Unsupported version %r for header %s' %
+ (version, common.SEC_WEBSOCKET_VERSION_HEADER),
+ supported_versions=', '.join(map(str, _SUPPORTED_VERSIONS)))
+
+ def _set_protocol(self):
+ self._request.ws_protocol = None
+
+ protocol_header = self._request.headers_in.get(
+ common.SEC_WEBSOCKET_PROTOCOL_HEADER)
+
+ if not protocol_header:
+ self._request.ws_requested_protocols = None
+ return
+
+ self._request.ws_requested_protocols = parse_token_list(
+ protocol_header)
+ self._logger.debug('Subprotocols requested: %r',
+ self._request.ws_requested_protocols)
+
+ def _parse_extensions(self):
+ extensions_header = self._request.headers_in.get(
+ common.SEC_WEBSOCKET_EXTENSIONS_HEADER)
+ if not extensions_header:
+ self._request.ws_requested_extensions = None
+ return
+
+ if self._request.ws_version is common.VERSION_HYBI08:
+ allow_quoted_string=False
+ else:
+ allow_quoted_string=True
+ self._request.ws_requested_extensions = parse_extensions(
+ extensions_header, allow_quoted_string=allow_quoted_string)
+
+ self._logger.debug(
+ 'Extensions requested: %r',
+ map(common.ExtensionParameter.name,
+ self._request.ws_requested_extensions))
+
+ def _validate_key(self, key):
+ if key.find(',') >= 0:
+ raise HandshakeException('Request has multiple %s header lines or '
+ 'contains illegal character \',\': %r' %
+ (common.SEC_WEBSOCKET_KEY_HEADER, key))
+
+ # Validate
+ key_is_valid = False
+ try:
+ # Validate key by quick regex match before parsing by base64
+ # module. Because base64 module skips invalid characters, we have
+ # to do this in advance to make this server strictly reject illegal
+ # keys.
+ if _SEC_WEBSOCKET_KEY_REGEX.match(key):
+ decoded_key = base64.b64decode(key)
+ if len(decoded_key) == 16:
+ key_is_valid = True
+ except TypeError, e:
+ pass
+
+ if not key_is_valid:
+ raise HandshakeException(
+ 'Illegal value for header %s: %r' %
+ (common.SEC_WEBSOCKET_KEY_HEADER, key))
+
+ return decoded_key
+
+ def _get_key(self):
+ key = get_mandatory_header(
+ self._request, common.SEC_WEBSOCKET_KEY_HEADER)
+
+ decoded_key = self._validate_key(key)
+
+ self._logger.debug(
+ '%s: %r (%s)',
+ common.SEC_WEBSOCKET_KEY_HEADER,
+ key,
+ util.hexify(decoded_key))
+
+ return key
+
+ def _send_handshake(self, accept):
+ response = []
+
+ response.append('HTTP/1.1 101 Switching Protocols\r\n')
+
+ response.append(format_header(
+ common.UPGRADE_HEADER, common.WEBSOCKET_UPGRADE_TYPE))
+ response.append(format_header(
+ common.CONNECTION_HEADER, common.UPGRADE_CONNECTION_TYPE))
+ response.append(format_header(
+ common.SEC_WEBSOCKET_ACCEPT_HEADER, accept))
+ if self._request.ws_protocol is not None:
+ response.append(format_header(
+ common.SEC_WEBSOCKET_PROTOCOL_HEADER,
+ self._request.ws_protocol))
+ if (self._request.ws_extensions is not None and
+ len(self._request.ws_extensions) != 0):
+ response.append(format_header(
+ common.SEC_WEBSOCKET_EXTENSIONS_HEADER,
+ format_extensions(self._request.ws_extensions)))
+ response.append('\r\n')
+
+ raw_response = ''.join(response)
+ self._request.connection.write(raw_response)
+ self._logger.debug('Sent server\'s opening handshake: %r',
+ raw_response)
+
+
+# vi:sts=4 sw=4 et
diff --git a/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/handshake/hybi00.py b/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/handshake/hybi00.py
new file mode 100644
index 000000000..cc6f8dc43
--- /dev/null
+++ b/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/handshake/hybi00.py
@@ -0,0 +1,242 @@
+# Copyright 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:
+#
+# * 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.
+
+
+"""This file provides the opening handshake processor for the WebSocket
+protocol version HyBi 00.
+
+Specification:
+http://tools.ietf.org/html/draft-ietf-hybi-thewebsocketprotocol-00
+"""
+
+
+# Note: request.connection.write/read are used in this module, even though
+# mod_python document says that they should be used only in connection
+# handlers. Unfortunately, we have no other options. For example,
+# request.write/read are not suitable because they don't allow direct raw bytes
+# writing/reading.
+
+
+import logging
+import re
+import struct
+
+from mod_pywebsocket import common
+from mod_pywebsocket.stream import StreamHixie75
+from mod_pywebsocket import util
+from mod_pywebsocket.handshake._base import HandshakeException
+from mod_pywebsocket.handshake._base import build_location
+from mod_pywebsocket.handshake._base import check_header_lines
+from mod_pywebsocket.handshake._base import format_header
+from mod_pywebsocket.handshake._base import get_mandatory_header
+from mod_pywebsocket.handshake._base import validate_subprotocol
+
+
+_MANDATORY_HEADERS = [
+ # key, expected value or None
+ [common.UPGRADE_HEADER, common.WEBSOCKET_UPGRADE_TYPE_HIXIE75],
+ [common.CONNECTION_HEADER, common.UPGRADE_CONNECTION_TYPE],
+]
+
+
+class Handshaker(object):
+ """Opening handshake processor for the WebSocket protocol version HyBi 00.
+ """
+
+ def __init__(self, request, dispatcher):
+ """Construct an instance.
+
+ Args:
+ request: mod_python request.
+ dispatcher: Dispatcher (dispatch.Dispatcher).
+
+ Handshaker will add attributes such as ws_resource in performing
+ handshake.
+ """
+
+ self._logger = util.get_class_logger(self)
+
+ self._request = request
+ self._dispatcher = dispatcher
+
+ def do_handshake(self):
+ """Perform WebSocket Handshake.
+
+ On _request, we set
+ ws_resource, ws_protocol, ws_location, ws_origin, ws_challenge,
+ ws_challenge_md5: WebSocket handshake information.
+ ws_stream: Frame generation/parsing class.
+ ws_version: Protocol version.
+
+ Raises:
+ HandshakeException: when any error happened in parsing the opening
+ handshake request.
+ """
+
+ # 5.1 Reading the client's opening handshake.
+ # dispatcher sets it in self._request.
+ check_header_lines(self._request, _MANDATORY_HEADERS)
+ self._set_resource()
+ self._set_subprotocol()
+ self._set_location()
+ self._set_origin()
+ self._set_challenge_response()
+ self._set_protocol_version()
+
+ self._dispatcher.do_extra_handshake(self._request)
+
+ self._send_handshake()
+
+ def _set_resource(self):
+ self._request.ws_resource = self._request.uri
+
+ def _set_subprotocol(self):
+ # |Sec-WebSocket-Protocol|
+ subprotocol = self._request.headers_in.get(
+ common.SEC_WEBSOCKET_PROTOCOL_HEADER)
+ if subprotocol is not None:
+ validate_subprotocol(subprotocol, hixie=True)
+ self._request.ws_protocol = subprotocol
+
+ def _set_location(self):
+ # |Host|
+ host = self._request.headers_in.get(common.HOST_HEADER)
+ if host is not None:
+ self._request.ws_location = build_location(self._request)
+ # TODO(ukai): check host is this host.
+
+ def _set_origin(self):
+ # |Origin|
+ origin = self._request.headers_in.get(common.ORIGIN_HEADER)
+ if origin is not None:
+ self._request.ws_origin = origin
+
+ def _set_protocol_version(self):
+ # |Sec-WebSocket-Draft|
+ draft = self._request.headers_in.get(common.SEC_WEBSOCKET_DRAFT_HEADER)
+ if draft is not None and draft != '0':
+ raise HandshakeException('Illegal value for %s: %s' %
+ (common.SEC_WEBSOCKET_DRAFT_HEADER,
+ draft))
+
+ self._logger.debug('Protocol version is HyBi 00')
+ self._request.ws_version = common.VERSION_HYBI00
+ self._request.ws_stream = StreamHixie75(self._request, True)
+
+ def _set_challenge_response(self):
+ # 5.2 4-8.
+ self._request.ws_challenge = self._get_challenge()
+ # 5.2 9. let /response/ be the MD5 finterprint of /challenge/
+ self._request.ws_challenge_md5 = util.md5_hash(
+ self._request.ws_challenge).digest()
+ self._logger.debug(
+ 'Challenge: %r (%s)',
+ self._request.ws_challenge,
+ util.hexify(self._request.ws_challenge))
+ self._logger.debug(
+ 'Challenge response: %r (%s)',
+ self._request.ws_challenge_md5,
+ util.hexify(self._request.ws_challenge_md5))
+
+ def _get_key_value(self, key_field):
+ key_value = get_mandatory_header(self._request, key_field)
+
+ self._logger.debug('%s: %r', key_field, key_value)
+
+ # 5.2 4. let /key-number_n/ be the digits (characters in the range
+ # U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9)) in /key_n/,
+ # interpreted as a base ten integer, ignoring all other characters
+ # in /key_n/.
+ try:
+ key_number = int(re.sub("\\D", "", key_value))
+ except:
+ raise HandshakeException('%s field contains no digit' % key_field)
+ # 5.2 5. let /spaces_n/ be the number of U+0020 SPACE characters
+ # in /key_n/.
+ spaces = re.subn(" ", "", key_value)[1]
+ if spaces == 0:
+ raise HandshakeException('%s field contains no space' % key_field)
+
+ self._logger.debug(
+ '%s: Key-number is %d and number of spaces is %d',
+ key_field, key_number, spaces)
+
+ # 5.2 6. if /key-number_n/ is not an integral multiple of /spaces_n/
+ # then abort the WebSocket connection.
+ if key_number % spaces != 0:
+ raise HandshakeException(
+ '%s: Key-number (%d) is not an integral multiple of spaces '
+ '(%d)' % (key_field, key_number, spaces))
+ # 5.2 7. let /part_n/ be /key-number_n/ divided by /spaces_n/.
+ part = key_number / spaces
+ self._logger.debug('%s: Part is %d', key_field, part)
+ return part
+
+ def _get_challenge(self):
+ # 5.2 4-7.
+ key1 = self._get_key_value(common.SEC_WEBSOCKET_KEY1_HEADER)
+ key2 = self._get_key_value(common.SEC_WEBSOCKET_KEY2_HEADER)
+ # 5.2 8. let /challenge/ be the concatenation of /part_1/,
+ challenge = ''
+ challenge += struct.pack('!I', key1) # network byteorder int
+ challenge += struct.pack('!I', key2) # network byteorder int
+ challenge += self._request.connection.read(8)
+ return challenge
+
+ def _send_handshake(self):
+ response = []
+
+ # 5.2 10. send the following line.
+ response.append('HTTP/1.1 101 WebSocket Protocol Handshake\r\n')
+
+ # 5.2 11. send the following fields to the client.
+ response.append(format_header(
+ common.UPGRADE_HEADER, common.WEBSOCKET_UPGRADE_TYPE_HIXIE75))
+ response.append(format_header(
+ common.CONNECTION_HEADER, common.UPGRADE_CONNECTION_TYPE))
+ response.append(format_header(
+ common.SEC_WEBSOCKET_LOCATION_HEADER, self._request.ws_location))
+ response.append(format_header(
+ common.SEC_WEBSOCKET_ORIGIN_HEADER, self._request.ws_origin))
+ if self._request.ws_protocol:
+ response.append(format_header(
+ common.SEC_WEBSOCKET_PROTOCOL_HEADER,
+ self._request.ws_protocol))
+ # 5.2 12. send two bytes 0x0D 0x0A.
+ response.append('\r\n')
+ # 5.2 13. send /response/
+ response.append(self._request.ws_challenge_md5)
+
+ raw_response = ''.join(response)
+ self._request.connection.write(raw_response)
+ self._logger.debug('Sent server\'s opening handshake: %r',
+ raw_response)
+
+
+# vi:sts=4 sw=4 et
diff --git a/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/headerparserhandler.py b/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/headerparserhandler.py
new file mode 100644
index 000000000..b68c240e1
--- /dev/null
+++ b/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/headerparserhandler.py
@@ -0,0 +1,243 @@
+# Copyright 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:
+#
+# * 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.
+
+
+"""PythonHeaderParserHandler for mod_pywebsocket.
+
+Apache HTTP Server and mod_python must be configured such that this
+function is called to handle WebSocket request.
+"""
+
+
+import logging
+
+from mod_python import apache
+
+from mod_pywebsocket import common
+from mod_pywebsocket import dispatch
+from mod_pywebsocket import handshake
+from mod_pywebsocket import util
+
+
+# PythonOption to specify the handler root directory.
+_PYOPT_HANDLER_ROOT = 'mod_pywebsocket.handler_root'
+
+# PythonOption to specify the handler scan directory.
+# This must be a directory under the root directory.
+# The default is the root directory.
+_PYOPT_HANDLER_SCAN = 'mod_pywebsocket.handler_scan'
+
+# PythonOption to allow handlers whose canonical path is
+# not under the root directory. It's disallowed by default.
+# Set this option with value of 'yes' to allow.
+_PYOPT_ALLOW_HANDLERS_OUTSIDE_ROOT = (
+ 'mod_pywebsocket.allow_handlers_outside_root_dir')
+# Map from values to their meanings. 'Yes' and 'No' are allowed just for
+# compatibility.
+_PYOPT_ALLOW_HANDLERS_OUTSIDE_ROOT_DEFINITION = {
+ 'off': False, 'no': False, 'on': True, 'yes': True}
+
+# PythonOption to specify to allow draft75 handshake.
+# The default is None (Off)
+_PYOPT_ALLOW_DRAFT75 = 'mod_pywebsocket.allow_draft75'
+# Map from values to their meanings.
+_PYOPT_ALLOW_DRAFT75_DEFINITION = {'off': False, 'on': True}
+
+
+class ApacheLogHandler(logging.Handler):
+ """Wrapper logging.Handler to emit log message to apache's error.log."""
+
+ _LEVELS = {
+ logging.DEBUG: apache.APLOG_DEBUG,
+ logging.INFO: apache.APLOG_INFO,
+ logging.WARNING: apache.APLOG_WARNING,
+ logging.ERROR: apache.APLOG_ERR,
+ logging.CRITICAL: apache.APLOG_CRIT,
+ }
+
+ def __init__(self, request=None):
+ logging.Handler.__init__(self)
+ self._log_error = apache.log_error
+ if request is not None:
+ self._log_error = request.log_error
+
+ # Time and level will be printed by Apache.
+ self._formatter = logging.Formatter('%(name)s: %(message)s')
+
+ def emit(self, record):
+ apache_level = apache.APLOG_DEBUG
+ if record.levelno in ApacheLogHandler._LEVELS:
+ apache_level = ApacheLogHandler._LEVELS[record.levelno]
+
+ msg = self._formatter.format(record)
+
+ # "server" parameter must be passed to have "level" parameter work.
+ # If only "level" parameter is passed, nothing shows up on Apache's
+ # log. However, at this point, we cannot get the server object of the
+ # virtual host which will process WebSocket requests. The only server
+ # object we can get here is apache.main_server. But Wherever (server
+ # configuration context or virtual host context) we put
+ # PythonHeaderParserHandler directive, apache.main_server just points
+ # the main server instance (not any of virtual server instance). Then,
+ # Apache follows LogLevel directive in the server configuration context
+ # to filter logs. So, we need to specify LogLevel in the server
+ # configuration context. Even if we specify "LogLevel debug" in the
+ # virtual host context which actually handles WebSocket connections,
+ # DEBUG level logs never show up unless "LogLevel debug" is specified
+ # in the server configuration context.
+ #
+ # TODO(tyoshino): Provide logging methods on request object. When
+ # request is mp_request object (when used together with Apache), the
+ # methods call request.log_error indirectly. When request is
+ # _StandaloneRequest, the methods call Python's logging facility which
+ # we create in standalone.py.
+ self._log_error(msg, apache_level, apache.main_server)
+
+
+def _configure_logging():
+ logger = logging.getLogger()
+ # Logs are filtered by Apache based on LogLevel directive in Apache
+ # configuration file. We must just pass logs for all levels to
+ # ApacheLogHandler.
+ logger.setLevel(logging.DEBUG)
+ logger.addHandler(ApacheLogHandler())
+
+
+_configure_logging()
+
+_LOGGER = logging.getLogger(__name__)
+
+
+def _parse_option(name, value, definition):
+ if value is None:
+ return False
+
+ meaning = definition.get(value.lower())
+ if meaning is None:
+ raise Exception('Invalid value for PythonOption %s: %r' %
+ (name, value))
+ return meaning
+
+
+def _create_dispatcher():
+ _LOGGER.info('Initializing Dispatcher')
+
+ options = apache.main_server.get_options()
+
+ handler_root = options.get(_PYOPT_HANDLER_ROOT, None)
+ if not handler_root:
+ raise Exception('PythonOption %s is not defined' % _PYOPT_HANDLER_ROOT,
+ apache.APLOG_ERR)
+
+ handler_scan = options.get(_PYOPT_HANDLER_SCAN, handler_root)
+
+ allow_handlers_outside_root = _parse_option(
+ _PYOPT_ALLOW_HANDLERS_OUTSIDE_ROOT,
+ options.get(_PYOPT_ALLOW_HANDLERS_OUTSIDE_ROOT),
+ _PYOPT_ALLOW_HANDLERS_OUTSIDE_ROOT_DEFINITION)
+
+ dispatcher = dispatch.Dispatcher(
+ handler_root, handler_scan, allow_handlers_outside_root)
+
+ for warning in dispatcher.source_warnings():
+ apache.log_error('mod_pywebsocket: %s' % warning, apache.APLOG_WARNING)
+
+ return dispatcher
+
+
+# Initialize
+_dispatcher = _create_dispatcher()
+
+
+def headerparserhandler(request):
+ """Handle request.
+
+ Args:
+ request: mod_python request.
+
+ This function is named headerparserhandler because it is the default
+ name for a PythonHeaderParserHandler.
+ """
+
+ handshake_is_done = False
+ try:
+ # Fallback to default http handler for request paths for which
+ # we don't have request handlers.
+ if not _dispatcher.get_handler_suite(request.uri):
+ request.log_error('No handler for resource: %r' % request.uri,
+ apache.APLOG_INFO)
+ request.log_error('Fallback to Apache', apache.APLOG_INFO)
+ return apache.DECLINED
+ except dispatch.DispatchException, e:
+ request.log_error('mod_pywebsocket: %s' % e, apache.APLOG_INFO)
+ if not handshake_is_done:
+ return e.status
+
+ try:
+ allow_draft75 = _parse_option(
+ _PYOPT_ALLOW_DRAFT75,
+ apache.main_server.get_options().get(_PYOPT_ALLOW_DRAFT75),
+ _PYOPT_ALLOW_DRAFT75_DEFINITION)
+
+ try:
+ handshake.do_handshake(
+ request, _dispatcher, allowDraft75=allow_draft75)
+ except handshake.VersionException, e:
+ request.log_error('mod_pywebsocket: %s' % e, apache.APLOG_INFO)
+ request.err_headers_out.add(common.SEC_WEBSOCKET_VERSION_HEADER,
+ e.supported_versions)
+ return apache.HTTP_BAD_REQUEST
+ except handshake.HandshakeException, e:
+ # Handshake for ws/wss failed.
+ # Send http response with error status.
+ request.log_error('mod_pywebsocket: %s' % e, apache.APLOG_INFO)
+ return e.status
+
+ handshake_is_done = True
+ request._dispatcher = _dispatcher
+ _dispatcher.transfer_data(request)
+ except handshake.AbortedByUserException, e:
+ request.log_error('mod_pywebsocket: %s' % e, apache.APLOG_INFO)
+ except Exception, e:
+ # DispatchException can also be thrown if something is wrong in
+ # pywebsocket code. It's caught here, then.
+
+ request.log_error('mod_pywebsocket: %s\n%s' %
+ (e, util.get_stack_trace()),
+ apache.APLOG_ERR)
+ # Unknown exceptions before handshake mean Apache must handle its
+ # request with another handler.
+ if not handshake_is_done:
+ return apache.DECLINED
+ # Set assbackwards to suppress response header generation by Apache.
+ request.assbackwards = 1
+ return apache.DONE # Return DONE such that no other handlers are invoked.
+
+
+# vi:sts=4 sw=4 et
diff --git a/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/http_header_util.py b/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/http_header_util.py
new file mode 100644
index 000000000..b77465393
--- /dev/null
+++ b/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/http_header_util.py
@@ -0,0 +1,263 @@
+# Copyright 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:
+#
+# * 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.
+
+
+"""Utilities for parsing and formatting headers that follow the grammar defined
+in HTTP RFC http://www.ietf.org/rfc/rfc2616.txt.
+"""
+
+
+import urlparse
+
+
+_SEPARATORS = '()<>@,;:\\"/[]?={} \t'
+
+
+def _is_char(c):
+ """Returns true iff c is in CHAR as specified in HTTP RFC."""
+
+ return ord(c) <= 127
+
+
+def _is_ctl(c):
+ """Returns true iff c is in CTL as specified in HTTP RFC."""
+
+ return ord(c) <= 31 or ord(c) == 127
+
+
+class ParsingState(object):
+
+ def __init__(self, data):
+ self.data = data
+ self.head = 0
+
+
+def peek(state, pos=0):
+ """Peeks the character at pos from the head of data."""
+
+ if state.head + pos >= len(state.data):
+ return None
+
+ return state.data[state.head + pos]
+
+
+def consume(state, amount=1):
+ """Consumes specified amount of bytes from the head and returns the
+ consumed bytes. If there's not enough bytes to consume, returns None.
+ """
+
+ if state.head + amount > len(state.data):
+ return None
+
+ result = state.data[state.head:state.head + amount]
+ state.head = state.head + amount
+ return result
+
+
+def consume_string(state, expected):
+ """Given a parsing state and a expected string, consumes the string from
+ the head. Returns True if consumed successfully. Otherwise, returns
+ False.
+ """
+
+ pos = 0
+
+ for c in expected:
+ if c != peek(state, pos):
+ return False
+ pos += 1
+
+ consume(state, pos)
+ return True
+
+
+def consume_lws(state):
+ """Consumes a LWS from the head. Returns True if any LWS is consumed.
+ Otherwise, returns False.
+
+ LWS = [CRLF] 1*( SP | HT )
+ """
+
+ original_head = state.head
+
+ consume_string(state, '\r\n')
+
+ pos = 0
+
+ while True:
+ c = peek(state, pos)
+ if c == ' ' or c == '\t':
+ pos += 1
+ else:
+ if pos == 0:
+ state.head = original_head
+ return False
+ else:
+ consume(state, pos)
+ return True
+
+
+def consume_lwses(state):
+ """Consumes *LWS from the head."""
+
+ while consume_lws(state):
+ pass
+
+
+def consume_token(state):
+ """Consumes a token from the head. Returns the token or None if no token
+ was found.
+ """
+
+ pos = 0
+
+ while True:
+ c = peek(state, pos)
+ if c is None or c in _SEPARATORS or _is_ctl(c) or not _is_char(c):
+ if pos == 0:
+ return None
+
+ return consume(state, pos)
+ else:
+ pos += 1
+
+
+def consume_token_or_quoted_string(state):
+ """Consumes a token or a quoted-string, and returns the token or unquoted
+ string. If no token or quoted-string was found, returns None.
+ """
+
+ original_head = state.head
+
+ if not consume_string(state, '"'):
+ return consume_token(state)
+
+ result = []
+
+ expect_quoted_pair = False
+
+ while True:
+ if not expect_quoted_pair and consume_lws(state):
+ result.append(' ')
+ continue
+
+ c = consume(state)
+ if c is None:
+ # quoted-string is not enclosed with double quotation
+ state.head = original_head
+ return None
+ elif expect_quoted_pair:
+ expect_quoted_pair = False
+ if _is_char(c):
+ result.append(c)
+ else:
+ # Non CHAR character found in quoted-pair
+ state.head = original_head
+ return None
+ elif c == '\\':
+ expect_quoted_pair = True
+ elif c == '"':
+ return ''.join(result)
+ elif _is_ctl(c):
+ # Invalid character %r found in qdtext
+ state.head = original_head
+ return None
+ else:
+ result.append(c)
+
+
+def quote_if_necessary(s):
+ """Quotes arbitrary string into quoted-string."""
+
+ quote = False
+ if s == '':
+ return '""'
+
+ result = []
+ for c in s:
+ if c == '"' or c in _SEPARATORS or _is_ctl(c) or not _is_char(c):
+ quote = True
+
+ if c == '"' or _is_ctl(c):
+ result.append('\\' + c)
+ else:
+ result.append(c)
+
+ if quote:
+ return '"' + ''.join(result) + '"'
+ else:
+ return ''.join(result)
+
+
+def parse_uri(uri):
+ """Parse absolute URI then return host, port and resource."""
+
+ parsed = urlparse.urlsplit(uri)
+ if parsed.scheme != 'wss' and parsed.scheme != 'ws':
+ # |uri| must be a relative URI.
+ # TODO(toyoshim): Should validate |uri|.
+ return None, None, uri
+
+ if parsed.hostname is None:
+ return None, None, None
+
+ port = None
+ try:
+ port = parsed.port
+ except ValueError, e:
+ # port property cause ValueError on invalid null port description like
+ # 'ws://host:/path'.
+ return None, None, None
+
+ if port is None:
+ if parsed.scheme == 'ws':
+ port = 80
+ else:
+ port = 443
+
+ path = parsed.path
+ if not path:
+ path += '/'
+ if parsed.query:
+ path += '?' + parsed.query
+ if parsed.fragment:
+ path += '#' + parsed.fragment
+
+ return parsed.hostname, port, path
+
+
+try:
+ urlparse.uses_netloc.index('ws')
+except ValueError, e:
+ # urlparse in Python2.5.1 doesn't have 'ws' and 'wss' entries.
+ urlparse.uses_netloc.append('ws')
+ urlparse.uses_netloc.append('wss')
+
+
+# vi:sts=4 sw=4 et
diff --git a/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/memorizingfile.py b/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/memorizingfile.py
new file mode 100644
index 000000000..4d4cd9585
--- /dev/null
+++ b/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/memorizingfile.py
@@ -0,0 +1,99 @@
+#!/usr/bin/env python
+#
+# Copyright 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:
+#
+# * 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.
+
+
+"""Memorizing file.
+
+A memorizing file wraps a file and memorizes lines read by readline.
+"""
+
+
+import sys
+
+
+class MemorizingFile(object):
+ """MemorizingFile wraps a file and memorizes lines read by readline.
+
+ Note that data read by other methods are not memorized. This behavior
+ is good enough for memorizing lines SimpleHTTPServer reads before
+ the control reaches WebSocketRequestHandler.
+ """
+
+ def __init__(self, file_, max_memorized_lines=sys.maxint):
+ """Construct an instance.
+
+ Args:
+ file_: the file object to wrap.
+ max_memorized_lines: the maximum number of lines to memorize.
+ Only the first max_memorized_lines are memorized.
+ Default: sys.maxint.
+ """
+
+ self._file = file_
+ self._memorized_lines = []
+ self._max_memorized_lines = max_memorized_lines
+ self._buffered = False
+ self._buffered_line = None
+
+ def __getattribute__(self, name):
+ if name in ('_file', '_memorized_lines', '_max_memorized_lines',
+ '_buffered', '_buffered_line', 'readline',
+ 'get_memorized_lines'):
+ return object.__getattribute__(self, name)
+ return self._file.__getattribute__(name)
+
+ def readline(self, size=-1):
+ """Override file.readline and memorize the line read.
+
+ Note that even if size is specified and smaller than actual size,
+ the whole line will be read out from underlying file object by
+ subsequent readline calls.
+ """
+
+ if self._buffered:
+ line = self._buffered_line
+ self._buffered = False
+ else:
+ line = self._file.readline()
+ if line and len(self._memorized_lines) < self._max_memorized_lines:
+ self._memorized_lines.append(line)
+ if size >= 0 and size < len(line):
+ self._buffered = True
+ self._buffered_line = line[size:]
+ return line[:size]
+ return line
+
+ def get_memorized_lines(self):
+ """Get lines memorized so far."""
+ return self._memorized_lines
+
+
+# vi:sts=4 sw=4 et
diff --git a/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/msgutil.py b/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/msgutil.py
new file mode 100644
index 000000000..21ffdacf6
--- /dev/null
+++ b/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/msgutil.py
@@ -0,0 +1,219 @@
+# Copyright 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:
+#
+# * 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.
+
+
+"""Message related utilities.
+
+Note: request.connection.write/read are used in this module, even though
+mod_python document says that they should be used only in connection
+handlers. Unfortunately, we have no other options. For example,
+request.write/read are not suitable because they don't allow direct raw
+bytes writing/reading.
+"""
+
+
+import Queue
+import threading
+
+
+# Export Exception symbols from msgutil for backward compatibility
+from mod_pywebsocket._stream_base import ConnectionTerminatedException
+from mod_pywebsocket._stream_base import InvalidFrameException
+from mod_pywebsocket._stream_base import BadOperationException
+from mod_pywebsocket._stream_base import UnsupportedFrameException
+
+
+# An API for handler to send/receive WebSocket messages.
+def close_connection(request):
+ """Close connection.
+
+ Args:
+ request: mod_python request.
+ """
+ request.ws_stream.close_connection()
+
+
+def send_message(request, message, end=True, binary=False):
+ """Send message.
+
+ Args:
+ request: mod_python request.
+ message: unicode text or str binary to send.
+ end: False to send message as a fragment. All messages until the
+ first call with end=True (inclusive) will be delivered to the
+ client in separate frames but as one WebSocket message.
+ binary: send message as binary frame.
+ Raises:
+ BadOperationException: when server already terminated.
+ """
+ request.ws_stream.send_message(message, end, binary)
+
+
+def receive_message(request):
+ """Receive a WebSocket frame and return its payload as a text in
+ unicode or a binary in str.
+
+ Args:
+ request: mod_python request.
+ Raises:
+ InvalidFrameException: when client send invalid frame.
+ UnsupportedFrameException: when client send unsupported frame e.g. some
+ of reserved bit is set but no extension can
+ recognize it.
+ InvalidUTF8Exception: when client send a text frame containing any
+ invalid UTF-8 string.
+ ConnectionTerminatedException: when the connection is closed
+ unexpectedly.
+ BadOperationException: when client already terminated.
+ """
+ return request.ws_stream.receive_message()
+
+
+def send_ping(request, body=''):
+ request.ws_stream.send_ping(body)
+
+
+class MessageReceiver(threading.Thread):
+ """This class receives messages from the client.
+
+ This class provides three ways to receive messages: blocking,
+ non-blocking, and via callback. Callback has the highest precedence.
+
+ Note: This class should not be used with the standalone server for wss
+ because pyOpenSSL used by the server raises a fatal error if the socket
+ is accessed from multiple threads.
+ """
+
+ def __init__(self, request, onmessage=None):
+ """Construct an instance.
+
+ Args:
+ request: mod_python request.
+ onmessage: a function to be called when a message is received.
+ May be None. If not None, the function is called on
+ another thread. In that case, MessageReceiver.receive
+ and MessageReceiver.receive_nowait are useless
+ because they will never return any messages.
+ """
+
+ threading.Thread.__init__(self)
+ self._request = request
+ self._queue = Queue.Queue()
+ self._onmessage = onmessage
+ self._stop_requested = False
+ self.setDaemon(True)
+ self.start()
+
+ def run(self):
+ try:
+ while not self._stop_requested:
+ message = receive_message(self._request)
+ if self._onmessage:
+ self._onmessage(message)
+ else:
+ self._queue.put(message)
+ finally:
+ close_connection(self._request)
+
+ def receive(self):
+ """ Receive a message from the channel, blocking.
+
+ Returns:
+ message as a unicode string.
+ """
+ return self._queue.get()
+
+ def receive_nowait(self):
+ """ Receive a message from the channel, non-blocking.
+
+ Returns:
+ message as a unicode string if available. None otherwise.
+ """
+ try:
+ message = self._queue.get_nowait()
+ except Queue.Empty:
+ message = None
+ return message
+
+ def stop(self):
+ """Request to stop this instance.
+
+ The instance will be stopped after receiving the next message.
+ This method may not be very useful, but there is no clean way
+ in Python to forcefully stop a running thread.
+ """
+ self._stop_requested = True
+
+
+class MessageSender(threading.Thread):
+ """This class sends messages to the client.
+
+ This class provides both synchronous and asynchronous ways to send
+ messages.
+
+ Note: This class should not be used with the standalone server for wss
+ because pyOpenSSL used by the server raises a fatal error if the socket
+ is accessed from multiple threads.
+ """
+
+ def __init__(self, request):
+ """Construct an instance.
+
+ Args:
+ request: mod_python request.
+ """
+ threading.Thread.__init__(self)
+ self._request = request
+ self._queue = Queue.Queue()
+ self.setDaemon(True)
+ self.start()
+
+ def run(self):
+ while True:
+ message, condition = self._queue.get()
+ condition.acquire()
+ send_message(self._request, message)
+ condition.notify()
+ condition.release()
+
+ def send(self, message):
+ """Send a message, blocking."""
+
+ condition = threading.Condition()
+ condition.acquire()
+ self._queue.put((message, condition))
+ condition.wait()
+
+ def send_nowait(self, message):
+ """Send a message, non-blocking."""
+
+ self._queue.put((message, threading.Condition()))
+
+
+# vi:sts=4 sw=4 et
diff --git a/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/standalone.py b/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/standalone.py
new file mode 100755
index 000000000..dc143ea00
--- /dev/null
+++ b/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/standalone.py
@@ -0,0 +1,870 @@
+#!/usr/bin/env python
+#
+# Copyright 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:
+#
+# * 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.
+
+
+"""Standalone WebSocket server.
+
+BASIC USAGE
+
+Use this server to run mod_pywebsocket without Apache HTTP Server.
+
+Usage:
+ python standalone.py [-p <ws_port>] [-w <websock_handlers>]
+ [-s <scan_dir>]
+ [-d <document_root>]
+ [-m <websock_handlers_map_file>]
+ ... for other options, see _main below ...
+
+<ws_port> is the port number to use for ws:// connection.
+
+<document_root> is the path to the root directory of HTML files.
+
+<websock_handlers> is the path to the root directory of WebSocket handlers.
+See __init__.py for details of <websock_handlers> and how to write WebSocket
+handlers. If this path is relative, <document_root> is used as the base.
+
+<scan_dir> is a path under the root directory. If specified, only the
+handlers under scan_dir are scanned. This is useful in saving scan time.
+
+
+CONFIGURATION FILE
+
+You can also write a configuration file and use it by specifying the path to
+the configuration file by --config option. Please write a configuration file
+following the documentation of the Python ConfigParser library. Name of each
+entry must be the long version argument name. E.g. to set log level to debug,
+add the following line:
+
+log_level=debug
+
+For options which doesn't take value, please add some fake value. E.g. for
+--tls option, add the following line:
+
+tls=True
+
+Note that tls will be enabled even if you write tls=False as the value part is
+fake.
+
+When both a command line argument and a configuration file entry are set for
+the same configuration item, the command line value will override one in the
+configuration file.
+
+
+THREADING
+
+This server is derived from SocketServer.ThreadingMixIn. Hence a thread is
+used for each request.
+
+
+SECURITY WARNING
+
+This uses CGIHTTPServer and CGIHTTPServer is not secure.
+It may execute arbitrary Python code or external programs. It should not be
+used outside a firewall.
+"""
+
+import BaseHTTPServer
+import CGIHTTPServer
+import SimpleHTTPServer
+import SocketServer
+import ConfigParser
+import httplib
+import logging
+import logging.handlers
+import optparse
+import os
+import re
+import select
+import socket
+import sys
+import threading
+import time
+
+_HAS_SSL = False
+_HAS_OPEN_SSL = False
+try:
+ import ssl
+ _HAS_SSL = True
+except ImportError:
+ try:
+ import OpenSSL.SSL
+ _HAS_OPEN_SSL = True
+ except ImportError:
+ pass
+
+from mod_pywebsocket import common
+from mod_pywebsocket import dispatch
+from mod_pywebsocket import handshake
+from mod_pywebsocket import http_header_util
+from mod_pywebsocket import memorizingfile
+from mod_pywebsocket import util
+
+
+_DEFAULT_LOG_MAX_BYTES = 1024 * 256
+_DEFAULT_LOG_BACKUP_COUNT = 5
+
+_DEFAULT_REQUEST_QUEUE_SIZE = 128
+
+# 1024 is practically large enough to contain WebSocket handshake lines.
+_MAX_MEMORIZED_LINES = 1024
+
+
+class _StandaloneConnection(object):
+ """Mimic mod_python mp_conn."""
+
+ def __init__(self, request_handler):
+ """Construct an instance.
+
+ Args:
+ request_handler: A WebSocketRequestHandler instance.
+ """
+
+ self._request_handler = request_handler
+
+ def get_local_addr(self):
+ """Getter to mimic mp_conn.local_addr."""
+
+ return (self._request_handler.server.server_name,
+ self._request_handler.server.server_port)
+ local_addr = property(get_local_addr)
+
+ def get_remote_addr(self):
+ """Getter to mimic mp_conn.remote_addr.
+
+ Setting the property in __init__ won't work because the request
+ handler is not initialized yet there."""
+
+ return self._request_handler.client_address
+ remote_addr = property(get_remote_addr)
+
+ def write(self, data):
+ """Mimic mp_conn.write()."""
+
+ return self._request_handler.wfile.write(data)
+
+ def read(self, length):
+ """Mimic mp_conn.read()."""
+
+ return self._request_handler.rfile.read(length)
+
+ def get_memorized_lines(self):
+ """Get memorized lines."""
+
+ return self._request_handler.rfile.get_memorized_lines()
+
+
+class _StandaloneRequest(object):
+ """Mimic mod_python request."""
+
+ def __init__(self, request_handler, use_tls):
+ """Construct an instance.
+
+ Args:
+ request_handler: A WebSocketRequestHandler instance.
+ """
+
+ self._logger = util.get_class_logger(self)
+
+ self._request_handler = request_handler
+ self.connection = _StandaloneConnection(request_handler)
+ self._use_tls = use_tls
+ self.headers_in = request_handler.headers
+
+ def get_uri(self):
+ """Getter to mimic request.uri."""
+
+ return self._request_handler.path
+ uri = property(get_uri)
+
+ def get_method(self):
+ """Getter to mimic request.method."""
+
+ return self._request_handler.command
+ method = property(get_method)
+
+ def is_https(self):
+ """Mimic request.is_https()."""
+
+ return self._use_tls
+
+ def _drain_received_data(self):
+ """Don't use this method from WebSocket handler. Drains unread data
+ in the receive buffer.
+ """
+
+ raw_socket = self._request_handler.connection
+ drained_data = util.drain_received_data(raw_socket)
+
+ if drained_data:
+ self._logger.debug(
+ 'Drained data following close frame: %r', drained_data)
+
+
+class _StandaloneSSLConnection(object):
+ """A wrapper class for OpenSSL.SSL.Connection to provide makefile method
+ which is not supported by the class.
+ """
+
+ def __init__(self, connection):
+ self._connection = connection
+
+ def __getattribute__(self, name):
+ if name in ('_connection', 'makefile'):
+ return object.__getattribute__(self, name)
+ return self._connection.__getattribute__(name)
+
+ def __setattr__(self, name, value):
+ if name in ('_connection', 'makefile'):
+ return object.__setattr__(self, name, value)
+ return self._connection.__setattr__(name, value)
+
+ def makefile(self, mode='r', bufsize=-1):
+ return socket._fileobject(self._connection, mode, bufsize)
+
+
+class WebSocketServer(SocketServer.ThreadingMixIn, BaseHTTPServer.HTTPServer):
+ """HTTPServer specialized for WebSocket."""
+
+ # Overrides SocketServer.ThreadingMixIn.daemon_threads
+ daemon_threads = True
+ # Overrides BaseHTTPServer.HTTPServer.allow_reuse_address
+ allow_reuse_address = True
+
+ def __init__(self, options):
+ """Override SocketServer.TCPServer.__init__ to set SSL enabled
+ socket object to self.socket before server_bind and server_activate,
+ if necessary.
+ """
+
+ self._logger = util.get_class_logger(self)
+
+ self.request_queue_size = options.request_queue_size
+ self.__ws_is_shut_down = threading.Event()
+ self.__ws_serving = False
+
+ SocketServer.BaseServer.__init__(
+ self, (options.server_host, options.port), WebSocketRequestHandler)
+
+ # Expose the options object to allow handler objects access it. We name
+ # it with websocket_ prefix to avoid conflict.
+ self.websocket_server_options = options
+
+ self._create_sockets()
+ self.server_bind()
+ self.server_activate()
+
+ def _create_sockets(self):
+ self.server_name, self.server_port = self.server_address
+ self._sockets = []
+ if not self.server_name:
+ # On platforms that doesn't support IPv6, the first bind fails.
+ # On platforms that supports IPv6
+ # - If it binds both IPv4 and IPv6 on call with AF_INET6, the
+ # first bind succeeds and the second fails (we'll see 'Address
+ # already in use' error).
+ # - If it binds only IPv6 on call with AF_INET6, both call are
+ # expected to succeed to listen both protocol.
+ addrinfo_array = [
+ (socket.AF_INET6, socket.SOCK_STREAM, '', '', ''),
+ (socket.AF_INET, socket.SOCK_STREAM, '', '', '')]
+ else:
+ addrinfo_array = socket.getaddrinfo(self.server_name,
+ self.server_port,
+ socket.AF_UNSPEC,
+ socket.SOCK_STREAM,
+ socket.IPPROTO_TCP)
+ for addrinfo in addrinfo_array:
+ self._logger.info('Create socket on: %r', addrinfo)
+ family, socktype, proto, canonname, sockaddr = addrinfo
+ try:
+ socket_ = socket.socket(family, socktype)
+ except Exception, e:
+ self._logger.info('Skip by failure: %r', e)
+ continue
+ if self.websocket_server_options.use_tls:
+ if _HAS_SSL:
+ socket_ = ssl.wrap_socket(socket_,
+ keyfile=self.websocket_server_options.private_key,
+ certfile=self.websocket_server_options.certificate,
+ ssl_version=ssl.PROTOCOL_SSLv23)
+ if _HAS_OPEN_SSL:
+ ctx = OpenSSL.SSL.Context(OpenSSL.SSL.SSLv23_METHOD)
+ ctx.use_privatekey_file(
+ self.websocket_server_options.private_key)
+ ctx.use_certificate_file(
+ self.websocket_server_options.certificate)
+ socket_ = OpenSSL.SSL.Connection(ctx, socket_)
+ self._sockets.append((socket_, addrinfo))
+
+ def server_bind(self):
+ """Override SocketServer.TCPServer.server_bind to enable multiple
+ sockets bind.
+ """
+
+ failed_sockets = []
+
+ for socketinfo in self._sockets:
+ socket_, addrinfo = socketinfo
+ self._logger.info('Bind on: %r', addrinfo)
+ if self.allow_reuse_address:
+ socket_.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
+ try:
+ socket_.bind(self.server_address)
+ except Exception, e:
+ self._logger.info('Skip by failure: %r', e)
+ socket_.close()
+ failed_sockets.append(socketinfo)
+
+ for socketinfo in failed_sockets:
+ self._sockets.remove(socketinfo)
+
+ def server_activate(self):
+ """Override SocketServer.TCPServer.server_activate to enable multiple
+ sockets listen.
+ """
+
+ failed_sockets = []
+
+ for socketinfo in self._sockets:
+ socket_, addrinfo = socketinfo
+ self._logger.info('Listen on: %r', addrinfo)
+ try:
+ socket_.listen(self.request_queue_size)
+ except Exception, e:
+ self._logger.info('Skip by failure: %r', e)
+ socket_.close()
+ failed_sockets.append(socketinfo)
+
+ for socketinfo in failed_sockets:
+ self._sockets.remove(socketinfo)
+
+ def server_close(self):
+ """Override SocketServer.TCPServer.server_close to enable multiple
+ sockets close.
+ """
+
+ for socketinfo in self._sockets:
+ socket_, addrinfo = socketinfo
+ self._logger.info('Close on: %r', addrinfo)
+ socket_.close()
+
+ def fileno(self):
+ """Override SocketServer.TCPServer.fileno."""
+
+ self._logger.critical('Not supported: fileno')
+ return self._sockets[0][0].fileno()
+
+ def handle_error(self, rquest, client_address):
+ """Override SocketServer.handle_error."""
+
+ self._logger.error(
+ 'Exception in processing request from: %r\n%s',
+ client_address,
+ util.get_stack_trace())
+ # Note: client_address is a tuple.
+
+ def get_request(self):
+ """Override TCPServer.get_request to wrap OpenSSL.SSL.Connection
+ object with _StandaloneSSLConnection to provide makefile method. We
+ cannot substitute OpenSSL.SSL.Connection.makefile since it's readonly
+ attribute.
+ """
+
+ accepted_socket, client_address = self.socket.accept()
+ if self.websocket_server_options.use_tls and _HAS_OPEN_SSL:
+ accepted_socket = _StandaloneSSLConnection(accepted_socket)
+ return accepted_socket, client_address
+
+ def serve_forever(self, poll_interval=0.5):
+ """Override SocketServer.BaseServer.serve_forever."""
+
+ self.__ws_serving = True
+ self.__ws_is_shut_down.clear()
+ handle_request = self.handle_request
+ if hasattr(self, '_handle_request_noblock'):
+ handle_request = self._handle_request_noblock
+ else:
+ self._logger.warning('Fallback to blocking request handler')
+ try:
+ while self.__ws_serving:
+ r, w, e = select.select(
+ [socket_[0] for socket_ in self._sockets],
+ [], [], poll_interval)
+ for socket_ in r:
+ self.socket = socket_
+ handle_request()
+ self.socket = None
+ finally:
+ self.__ws_is_shut_down.set()
+
+ def shutdown(self):
+ """Override SocketServer.BaseServer.shutdown."""
+
+ self.__ws_serving = False
+ self.__ws_is_shut_down.wait()
+
+
+class WebSocketRequestHandler(CGIHTTPServer.CGIHTTPRequestHandler):
+ """CGIHTTPRequestHandler specialized for WebSocket."""
+
+ # Use httplib.HTTPMessage instead of mimetools.Message.
+ MessageClass = httplib.HTTPMessage
+
+ def setup(self):
+ """Override SocketServer.StreamRequestHandler.setup to wrap rfile
+ with MemorizingFile.
+
+ This method will be called by BaseRequestHandler's constructor
+ before calling BaseHTTPRequestHandler.handle.
+ BaseHTTPRequestHandler.handle will call
+ BaseHTTPRequestHandler.handle_one_request and it will call
+ WebSocketRequestHandler.parse_request.
+ """
+
+ # Call superclass's setup to prepare rfile, wfile, etc. See setup
+ # definition on the root class SocketServer.StreamRequestHandler to
+ # understand what this does.
+ CGIHTTPServer.CGIHTTPRequestHandler.setup(self)
+
+ self.rfile = memorizingfile.MemorizingFile(
+ self.rfile,
+ max_memorized_lines=_MAX_MEMORIZED_LINES)
+
+ def __init__(self, request, client_address, server):
+ self._logger = util.get_class_logger(self)
+
+ self._options = server.websocket_server_options
+
+ # Overrides CGIHTTPServerRequestHandler.cgi_directories.
+ self.cgi_directories = self._options.cgi_directories
+ # Replace CGIHTTPRequestHandler.is_executable method.
+ if self._options.is_executable_method is not None:
+ self.is_executable = self._options.is_executable_method
+
+ # This actually calls BaseRequestHandler.__init__.
+ CGIHTTPServer.CGIHTTPRequestHandler.__init__(
+ self, request, client_address, server)
+
+ def parse_request(self):
+ """Override BaseHTTPServer.BaseHTTPRequestHandler.parse_request.
+
+ Return True to continue processing for HTTP(S), False otherwise.
+
+ See BaseHTTPRequestHandler.handle_one_request method which calls
+ this method to understand how the return value will be handled.
+ """
+
+ # We hook parse_request method, but also call the original
+ # CGIHTTPRequestHandler.parse_request since when we return False,
+ # CGIHTTPRequestHandler.handle_one_request continues processing and
+ # it needs variables set by CGIHTTPRequestHandler.parse_request.
+ #
+ # Variables set by this method will be also used by WebSocket request
+ # handling (self.path, self.command, self.requestline, etc. See also
+ # how _StandaloneRequest's members are implemented using these
+ # attributes).
+ if not CGIHTTPServer.CGIHTTPRequestHandler.parse_request(self):
+ return False
+ host, port, resource = http_header_util.parse_uri(self.path)
+ if resource is None:
+ self._logger.info('Invalid URI: %r', self.path)
+ self._logger.info('Fallback to CGIHTTPRequestHandler')
+ return True
+ server_options = self.server.websocket_server_options
+ if host is not None:
+ validation_host = server_options.validation_host
+ if validation_host is not None and host != validation_host:
+ self._logger.info('Invalid host: %r (expected: %r)',
+ host,
+ validation_host)
+ self._logger.info('Fallback to CGIHTTPRequestHandler')
+ return True
+ if port is not None:
+ validation_port = server_options.validation_port
+ if validation_port is not None and port != validation_port:
+ self._logger.info('Invalid port: %r (expected: %r)',
+ port,
+ validation_port)
+ self._logger.info('Fallback to CGIHTTPRequestHandler')
+ return True
+ self.path = resource
+
+ request = _StandaloneRequest(self, self._options.use_tls)
+
+ try:
+ # Fallback to default http handler for request paths for which
+ # we don't have request handlers.
+ if not self._options.dispatcher.get_handler_suite(self.path):
+ self._logger.info('No handler for resource: %r',
+ self.path)
+ self._logger.info('Fallback to CGIHTTPRequestHandler')
+ return True
+ except dispatch.DispatchException, e:
+ self._logger.info('%s', e)
+ self.send_error(e.status)
+ return False
+
+ # If any Exceptions without except clause setup (including
+ # DispatchException) is raised below this point, it will be caught
+ # and logged by WebSocketServer.
+
+ try:
+ try:
+ handshake.do_handshake(
+ request,
+ self._options.dispatcher,
+ allowDraft75=self._options.allow_draft75,
+ strict=self._options.strict)
+ except handshake.VersionException, e:
+ self._logger.info('%s', e)
+ self.send_response(common.HTTP_STATUS_BAD_REQUEST)
+ self.send_header(common.SEC_WEBSOCKET_VERSION_HEADER,
+ e.supported_versions)
+ self.end_headers()
+ return False
+ except handshake.HandshakeException, e:
+ # Handshake for ws(s) failed.
+ self._logger.info('%s', e)
+ self.send_error(e.status)
+ return False
+
+ request._dispatcher = self._options.dispatcher
+ self._options.dispatcher.transfer_data(request)
+ except handshake.AbortedByUserException, e:
+ self._logger.info('%s', e)
+ return False
+
+ def log_request(self, code='-', size='-'):
+ """Override BaseHTTPServer.log_request."""
+
+ self._logger.info('"%s" %s %s',
+ self.requestline, str(code), str(size))
+
+ def log_error(self, *args):
+ """Override BaseHTTPServer.log_error."""
+
+ # Despite the name, this method is for warnings than for errors.
+ # For example, HTTP status code is logged by this method.
+ self._logger.warning('%s - %s',
+ self.address_string(),
+ args[0] % args[1:])
+
+ def is_cgi(self):
+ """Test whether self.path corresponds to a CGI script.
+
+ Add extra check that self.path doesn't contains ..
+ Also check if the file is a executable file or not.
+ If the file is not executable, it is handled as static file or dir
+ rather than a CGI script.
+ """
+
+ if CGIHTTPServer.CGIHTTPRequestHandler.is_cgi(self):
+ if '..' in self.path:
+ return False
+ # strip query parameter from request path
+ resource_name = self.path.split('?', 2)[0]
+ # convert resource_name into real path name in filesystem.
+ scriptfile = self.translate_path(resource_name)
+ if not os.path.isfile(scriptfile):
+ return False
+ if not self.is_executable(scriptfile):
+ return False
+ return True
+ return False
+
+
+def _configure_logging(options):
+ logger = logging.getLogger()
+ logger.setLevel(logging.getLevelName(options.log_level.upper()))
+ if options.log_file:
+ handler = logging.handlers.RotatingFileHandler(
+ options.log_file, 'a', options.log_max, options.log_count)
+ else:
+ handler = logging.StreamHandler()
+ formatter = logging.Formatter(
+ '[%(asctime)s] [%(levelname)s] %(name)s: %(message)s')
+ handler.setFormatter(formatter)
+ logger.addHandler(handler)
+
+
+def _alias_handlers(dispatcher, websock_handlers_map_file):
+ """Set aliases specified in websock_handler_map_file in dispatcher.
+
+ Args:
+ dispatcher: dispatch.Dispatcher instance
+ websock_handler_map_file: alias map file
+ """
+
+ fp = open(websock_handlers_map_file)
+ try:
+ for line in fp:
+ if line[0] == '#' or line.isspace():
+ continue
+ m = re.match('(\S+)\s+(\S+)', line)
+ if not m:
+ logging.warning('Wrong format in map file:' + line)
+ continue
+ try:
+ dispatcher.add_resource_path_alias(
+ m.group(1), m.group(2))
+ except dispatch.DispatchException, e:
+ logging.error(str(e))
+ finally:
+ fp.close()
+
+
+def _build_option_parser():
+ parser = optparse.OptionParser()
+
+ parser.add_option('--config', dest='config_file', type='string',
+ default=None,
+ help=('Path to configuration file. See the file comment '
+ 'at the top of this file for the configuration '
+ 'file format'))
+ parser.add_option('-H', '--server-host', '--server_host',
+ dest='server_host',
+ default='',
+ help='server hostname to listen to')
+ parser.add_option('-V', '--validation-host', '--validation_host',
+ dest='validation_host',
+ default=None,
+ help='server hostname to validate in absolute path.')
+ parser.add_option('-p', '--port', dest='port', type='int',
+ default=common.DEFAULT_WEB_SOCKET_PORT,
+ help='port to listen to')
+ parser.add_option('-P', '--validation-port', '--validation_port',
+ dest='validation_port', type='int',
+ default=None,
+ help='server port to validate in absolute path.')
+ parser.add_option('-w', '--websock-handlers', '--websock_handlers',
+ dest='websock_handlers',
+ default='.',
+ help='WebSocket handlers root directory.')
+ parser.add_option('-m', '--websock-handlers-map-file',
+ '--websock_handlers_map_file',
+ dest='websock_handlers_map_file',
+ default=None,
+ help=('WebSocket handlers map file. '
+ 'Each line consists of alias_resource_path and '
+ 'existing_resource_path, separated by spaces.'))
+ parser.add_option('-s', '--scan-dir', '--scan_dir', dest='scan_dir',
+ default=None,
+ help=('WebSocket handlers scan directory. '
+ 'Must be a directory under websock_handlers.'))
+ parser.add_option('--allow-handlers-outside-root-dir',
+ '--allow_handlers_outside_root_dir',
+ dest='allow_handlers_outside_root_dir',
+ action='store_true',
+ default=False,
+ help=('Scans WebSocket handlers even if their canonical '
+ 'path is not under websock_handlers.'))
+ parser.add_option('-d', '--document-root', '--document_root',
+ dest='document_root', default='.',
+ help='Document root directory.')
+ parser.add_option('-x', '--cgi-paths', '--cgi_paths', dest='cgi_paths',
+ default=None,
+ help=('CGI paths relative to document_root.'
+ 'Comma-separated. (e.g -x /cgi,/htbin) '
+ 'Files under document_root/cgi_path are handled '
+ 'as CGI programs. Must be executable.'))
+ parser.add_option('-t', '--tls', dest='use_tls', action='store_true',
+ default=False, help='use TLS (wss://)')
+ parser.add_option('-k', '--private-key', '--private_key',
+ dest='private_key',
+ default='', help='TLS private key file.')
+ parser.add_option('-c', '--certificate', dest='certificate',
+ default='', help='TLS certificate file.')
+ parser.add_option('-l', '--log-file', '--log_file', dest='log_file',
+ default='', help='Log file.')
+ parser.add_option('--log-level', '--log_level', type='choice',
+ dest='log_level', default='warn',
+ choices=['debug', 'info', 'warning', 'warn', 'error',
+ 'critical'],
+ help='Log level.')
+ parser.add_option('--thread-monitor-interval-in-sec',
+ '--thread_monitor_interval_in_sec',
+ dest='thread_monitor_interval_in_sec',
+ type='int', default=-1,
+ help=('If positive integer is specified, run a thread '
+ 'monitor to show the status of server threads '
+ 'periodically in the specified inteval in '
+ 'second. If non-positive integer is specified, '
+ 'disable the thread monitor.'))
+ parser.add_option('--log-max', '--log_max', dest='log_max', type='int',
+ default=_DEFAULT_LOG_MAX_BYTES,
+ help='Log maximum bytes')
+ parser.add_option('--log-count', '--log_count', dest='log_count',
+ type='int', default=_DEFAULT_LOG_BACKUP_COUNT,
+ help='Log backup count')
+ parser.add_option('--allow-draft75', dest='allow_draft75',
+ action='store_true', default=False,
+ help='Allow draft 75 handshake')
+ parser.add_option('--strict', dest='strict', action='store_true',
+ default=False, help='Strictly check handshake request')
+ parser.add_option('-q', '--queue', dest='request_queue_size', type='int',
+ default=_DEFAULT_REQUEST_QUEUE_SIZE,
+ help='request queue size')
+
+ return parser
+
+
+class ThreadMonitor(threading.Thread):
+ daemon = True
+
+ def __init__(self, interval_in_sec):
+ threading.Thread.__init__(self, name='ThreadMonitor')
+
+ self._logger = util.get_class_logger(self)
+
+ self._interval_in_sec = interval_in_sec
+
+ def run(self):
+ while True:
+ thread_name_list = []
+ for thread in threading.enumerate():
+ thread_name_list.append(thread.name)
+ self._logger.info(
+ "%d active threads: %s",
+ threading.active_count(),
+ ', '.join(thread_name_list))
+ time.sleep(self._interval_in_sec)
+
+
+def _parse_args_and_config(args):
+ parser = _build_option_parser()
+
+ # First, parse options without configuration file.
+ temporary_options, temporary_args = parser.parse_args(args=args)
+ if temporary_args:
+ logging.critical(
+ 'Unrecognized positional arguments: %r', temporary_args)
+ sys.exit(1)
+
+ if temporary_options.config_file:
+ try:
+ config_fp = open(temporary_options.config_file, 'r')
+ except IOError, e:
+ logging.critical(
+ 'Failed to open configuration file %r: %r',
+ temporary_options.config_file,
+ e)
+ sys.exit(1)
+
+ config_parser = ConfigParser.SafeConfigParser()
+ config_parser.readfp(config_fp)
+ config_fp.close()
+
+ args_from_config = []
+ for name, value in config_parser.items('pywebsocket'):
+ args_from_config.append('--' + name)
+ args_from_config.append(value)
+ if args is None:
+ args = args_from_config
+ else:
+ args = args_from_config + args
+ return parser.parse_args(args=args)
+ else:
+ return temporary_options, temporary_args
+
+
+def _main(args=None):
+ options, args = _parse_args_and_config(args=args)
+
+ os.chdir(options.document_root)
+
+ _configure_logging(options)
+
+ # TODO(tyoshino): Clean up initialization of CGI related values. Move some
+ # of code here to WebSocketRequestHandler class if it's better.
+ options.cgi_directories = []
+ options.is_executable_method = None
+ if options.cgi_paths:
+ options.cgi_directories = options.cgi_paths.split(',')
+ if sys.platform in ('cygwin', 'win32'):
+ cygwin_path = None
+ # For Win32 Python, it is expected that CYGWIN_PATH
+ # is set to a directory of cygwin binaries.
+ # For example, websocket_server.py in Chromium sets CYGWIN_PATH to
+ # full path of third_party/cygwin/bin.
+ if 'CYGWIN_PATH' in os.environ:
+ cygwin_path = os.environ['CYGWIN_PATH']
+ util.wrap_popen3_for_win(cygwin_path)
+
+ def __check_script(scriptpath):
+ return util.get_script_interp(scriptpath, cygwin_path)
+
+ options.is_executable_method = __check_script
+
+ if options.use_tls:
+ if not (_HAS_SSL or _HAS_OPEN_SSL):
+ logging.critical('TLS support requires ssl or pyOpenSSL.')
+ sys.exit(1)
+ if not options.private_key or not options.certificate:
+ logging.critical(
+ 'To use TLS, specify private_key and certificate.')
+ sys.exit(1)
+
+ if not options.scan_dir:
+ options.scan_dir = options.websock_handlers
+
+ try:
+ if options.thread_monitor_interval_in_sec > 0:
+ # Run a thread monitor to show the status of server threads for
+ # debugging.
+ ThreadMonitor(options.thread_monitor_interval_in_sec).start()
+
+ # Share a Dispatcher among request handlers to save time for
+ # instantiation. Dispatcher can be shared because it is thread-safe.
+ options.dispatcher = dispatch.Dispatcher(
+ options.websock_handlers,
+ options.scan_dir,
+ options.allow_handlers_outside_root_dir)
+ if options.websock_handlers_map_file:
+ _alias_handlers(options.dispatcher,
+ options.websock_handlers_map_file)
+ warnings = options.dispatcher.source_warnings()
+ if warnings:
+ for warning in warnings:
+ logging.warning('mod_pywebsocket: %s' % warning)
+
+ server = WebSocketServer(options)
+ server.serve_forever()
+ except Exception, e:
+ logging.critical('mod_pywebsocket: %s' % e)
+ logging.critical('mod_pywebsocket: %s' % util.get_stack_trace())
+ sys.exit(1)
+
+
+if __name__ == '__main__':
+ _main(sys.argv[1:])
+
+
+# vi:sts=4 sw=4 et
diff --git a/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/stream.py b/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/stream.py
new file mode 100644
index 000000000..d051eee20
--- /dev/null
+++ b/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/stream.py
@@ -0,0 +1,56 @@
+# Copyright 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:
+#
+# * 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.
+
+
+"""This file exports public symbols.
+"""
+
+
+from mod_pywebsocket._stream_base import BadOperationException
+from mod_pywebsocket._stream_base import ConnectionTerminatedException
+from mod_pywebsocket._stream_base import InvalidFrameException
+from mod_pywebsocket._stream_base import InvalidUTF8Exception
+from mod_pywebsocket._stream_base import UnsupportedFrameException
+from mod_pywebsocket._stream_hixie75 import StreamHixie75
+from mod_pywebsocket._stream_hybi import Frame
+from mod_pywebsocket._stream_hybi import Stream
+from mod_pywebsocket._stream_hybi import StreamOptions
+
+# These methods are intended to be used by WebSocket client developers to have
+# their implementations receive broken data in tests.
+from mod_pywebsocket._stream_hybi import create_close_frame
+from mod_pywebsocket._stream_hybi import create_header
+from mod_pywebsocket._stream_hybi import create_length_header
+from mod_pywebsocket._stream_hybi import create_ping_frame
+from mod_pywebsocket._stream_hybi import create_pong_frame
+from mod_pywebsocket._stream_hybi import create_binary_frame
+from mod_pywebsocket._stream_hybi import create_text_frame
+
+
+# vi:sts=4 sw=4 et
diff --git a/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/util.py b/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/util.py
new file mode 100644
index 000000000..9a0ab5de6
--- /dev/null
+++ b/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/util.py
@@ -0,0 +1,489 @@
+# Copyright 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:
+#
+# * 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.
+
+
+"""WebSocket utilities.
+"""
+
+
+import array
+import errno
+
+# Import hash classes from a module available and recommended for each Python
+# version and re-export those symbol. Use sha and md5 module in Python 2.4, and
+# hashlib module in Python 2.6.
+try:
+ import hashlib
+ md5_hash = hashlib.md5
+ sha1_hash = hashlib.sha1
+except ImportError:
+ import md5
+ import sha
+ md5_hash = md5.md5
+ sha1_hash = sha.sha
+
+import StringIO
+import logging
+import os
+import re
+import socket
+import traceback
+import zlib
+
+
+def get_stack_trace():
+ """Get the current stack trace as string.
+
+ This is needed to support Python 2.3.
+ TODO: Remove this when we only support Python 2.4 and above.
+ Use traceback.format_exc instead.
+ """
+
+ out = StringIO.StringIO()
+ traceback.print_exc(file=out)
+ return out.getvalue()
+
+
+def prepend_message_to_exception(message, exc):
+ """Prepend message to the exception."""
+
+ exc.args = (message + str(exc),)
+ return
+
+
+def __translate_interp(interp, cygwin_path):
+ """Translate interp program path for Win32 python to run cygwin program
+ (e.g. perl). Note that it doesn't support path that contains space,
+ which is typically true for Unix, where #!-script is written.
+ For Win32 python, cygwin_path is a directory of cygwin binaries.
+
+ Args:
+ interp: interp command line
+ cygwin_path: directory name of cygwin binary, or None
+ Returns:
+ translated interp command line.
+ """
+ if not cygwin_path:
+ return interp
+ m = re.match('^[^ ]*/([^ ]+)( .*)?', interp)
+ if m:
+ cmd = os.path.join(cygwin_path, m.group(1))
+ return cmd + m.group(2)
+ return interp
+
+
+def get_script_interp(script_path, cygwin_path=None):
+ """Gets #!-interpreter command line from the script.
+
+ It also fixes command path. When Cygwin Python is used, e.g. in WebKit,
+ it could run "/usr/bin/perl -wT hello.pl".
+ When Win32 Python is used, e.g. in Chromium, it couldn't. So, fix
+ "/usr/bin/perl" to "<cygwin_path>\perl.exe".
+
+ Args:
+ script_path: pathname of the script
+ cygwin_path: directory name of cygwin binary, or None
+ Returns:
+ #!-interpreter command line, or None if it is not #!-script.
+ """
+ fp = open(script_path)
+ line = fp.readline()
+ fp.close()
+ m = re.match('^#!(.*)', line)
+ if m:
+ return __translate_interp(m.group(1), cygwin_path)
+ return None
+
+
+def wrap_popen3_for_win(cygwin_path):
+ """Wrap popen3 to support #!-script on Windows.
+
+ Args:
+ cygwin_path: path for cygwin binary if command path is needed to be
+ translated. None if no translation required.
+ """
+
+ __orig_popen3 = os.popen3
+
+ def __wrap_popen3(cmd, mode='t', bufsize=-1):
+ cmdline = cmd.split(' ')
+ interp = get_script_interp(cmdline[0], cygwin_path)
+ if interp:
+ cmd = interp + ' ' + cmd
+ return __orig_popen3(cmd, mode, bufsize)
+
+ os.popen3 = __wrap_popen3
+
+
+def hexify(s):
+ return ' '.join(map(lambda x: '%02x' % ord(x), s))
+
+
+def get_class_logger(o):
+ return logging.getLogger(
+ '%s.%s' % (o.__class__.__module__, o.__class__.__name__))
+
+
+class NoopMasker(object):
+ """A masking object that has the same interface as RepeatedXorMasker but
+ just returns the string passed in without making any change.
+ """
+
+ def __init__(self):
+ pass
+
+ def mask(self, s):
+ return s
+
+
+class RepeatedXorMasker(object):
+ """A masking object that applies XOR on the string given to mask method
+ with the masking bytes given to the constructor repeatedly. This object
+ remembers the position in the masking bytes the last mask method call
+ ended and resumes from that point on the next mask method call.
+ """
+
+ def __init__(self, mask):
+ self._mask = map(ord, mask)
+ self._mask_size = len(self._mask)
+ self._count = 0
+
+ def mask(self, s):
+ result = array.array('B')
+ result.fromstring(s)
+ for i in xrange(len(result)):
+ result[i] ^= self._mask[self._count]
+ self._count = (self._count + 1) % self._mask_size
+ return result.tostring()
+
+
+class DeflateRequest(object):
+ """A wrapper class for request object to intercept send and recv to perform
+ deflate compression and decompression transparently.
+ """
+
+ def __init__(self, request):
+ self._request = request
+ self.connection = DeflateConnection(request.connection)
+
+ def __getattribute__(self, name):
+ if name in ('_request', 'connection'):
+ return object.__getattribute__(self, name)
+ return self._request.__getattribute__(name)
+
+ def __setattr__(self, name, value):
+ if name in ('_request', 'connection'):
+ return object.__setattr__(self, name, value)
+ return self._request.__setattr__(name, value)
+
+
+# By making wbits option negative, we can suppress CMF/FLG (2 octet) and
+# ADLER32 (4 octet) fields of zlib so that we can use zlib module just as
+# deflate library. DICTID won't be added as far as we don't set dictionary.
+# LZ77 window of 32K will be used for both compression and decompression.
+# For decompression, we can just use 32K to cover any windows size. For
+# compression, we use 32K so receivers must use 32K.
+#
+# Compression level is Z_DEFAULT_COMPRESSION. We don't have to match level
+# to decode.
+#
+# See zconf.h, deflate.cc, inflate.cc of zlib library, and zlibmodule.c of
+# Python. See also RFC1950 (ZLIB 3.3).
+
+
+class _Deflater(object):
+
+ def __init__(self, window_bits):
+ self._logger = get_class_logger(self)
+
+ self._compress = zlib.compressobj(
+ zlib.Z_DEFAULT_COMPRESSION, zlib.DEFLATED, -window_bits)
+
+ def compress_and_flush(self, bytes):
+ compressed_bytes = self._compress.compress(bytes)
+ compressed_bytes += self._compress.flush(zlib.Z_SYNC_FLUSH)
+ self._logger.debug('Compress input %r', bytes)
+ self._logger.debug('Compress result %r', compressed_bytes)
+ return compressed_bytes
+
+
+class _Inflater(object):
+
+ def __init__(self):
+ self._logger = get_class_logger(self)
+
+ self._unconsumed = ''
+
+ self.reset()
+
+ def decompress(self, size):
+ if not (size == -1 or size > 0):
+ raise Exception('size must be -1 or positive')
+
+ data = ''
+
+ while True:
+ if size == -1:
+ data += self._decompress.decompress(self._unconsumed)
+ # See Python bug http://bugs.python.org/issue12050 to
+ # understand why the same code cannot be used for updating
+ # self._unconsumed for here and else block.
+ self._unconsumed = ''
+ else:
+ data += self._decompress.decompress(
+ self._unconsumed, size - len(data))
+ self._unconsumed = self._decompress.unconsumed_tail
+ if self._decompress.unused_data:
+ # Encountered a last block (i.e. a block with BFINAL = 1) and
+ # found a new stream (unused_data). We cannot use the same
+ # zlib.Decompress object for the new stream. Create a new
+ # Decompress object to decompress the new one.
+ #
+ # It's fine to ignore unconsumed_tail if unused_data is not
+ # empty.
+ self._unconsumed = self._decompress.unused_data
+ self.reset()
+ if size >= 0 and len(data) == size:
+ # data is filled. Don't call decompress again.
+ break
+ else:
+ # Re-invoke Decompress.decompress to try to decompress all
+ # available bytes before invoking read which blocks until
+ # any new byte is available.
+ continue
+ else:
+ # Here, since unused_data is empty, even if unconsumed_tail is
+ # not empty, bytes of requested length are already in data. We
+ # don't have to "continue" here.
+ break
+
+ if data:
+ self._logger.debug('Decompressed %r', data)
+ return data
+
+ def append(self, data):
+ self._logger.debug('Appended %r', data)
+ self._unconsumed += data
+
+ def reset(self):
+ self._logger.debug('Reset')
+ self._decompress = zlib.decompressobj(-zlib.MAX_WBITS)
+
+
+# Compresses/decompresses given octets using the method introduced in RFC1979.
+
+
+class _RFC1979Deflater(object):
+ """A compressor class that applies DEFLATE to given byte sequence and
+ flushes using the algorithm described in the RFC1979 section 2.1.
+ """
+
+ def __init__(self, window_bits, no_context_takeover):
+ self._deflater = None
+ if window_bits is None:
+ window_bits = zlib.MAX_WBITS
+ self._window_bits = window_bits
+ self._no_context_takeover = no_context_takeover
+
+ def filter(self, bytes):
+ if self._deflater is None or self._no_context_takeover:
+ self._deflater = _Deflater(self._window_bits)
+
+ # Strip last 4 octets which is LEN and NLEN field of a non-compressed
+ # block added for Z_SYNC_FLUSH.
+ return self._deflater.compress_and_flush(bytes)[:-4]
+
+
+class _RFC1979Inflater(object):
+ """A decompressor class for byte sequence compressed and flushed following
+ the algorithm described in the RFC1979 section 2.1.
+ """
+
+ def __init__(self):
+ self._inflater = _Inflater()
+
+ def filter(self, bytes):
+ # Restore stripped LEN and NLEN field of a non-compressed block added
+ # for Z_SYNC_FLUSH.
+ self._inflater.append(bytes + '\x00\x00\xff\xff')
+ return self._inflater.decompress(-1)
+
+
+class DeflateSocket(object):
+ """A wrapper class for socket object to intercept send and recv to perform
+ deflate compression and decompression transparently.
+ """
+
+ # Size of the buffer passed to recv to receive compressed data.
+ _RECV_SIZE = 4096
+
+ def __init__(self, socket):
+ self._socket = socket
+
+ self._logger = get_class_logger(self)
+
+ self._deflater = _Deflater(zlib.MAX_WBITS)
+ self._inflater = _Inflater()
+
+ def recv(self, size):
+ """Receives data from the socket specified on the construction up
+ to the specified size. Once any data is available, returns it even
+ if it's smaller than the specified size.
+ """
+
+ # TODO(tyoshino): Allow call with size=0. It should block until any
+ # decompressed data is available.
+ if size <= 0:
+ raise Exception('Non-positive size passed')
+ while True:
+ data = self._inflater.decompress(size)
+ if len(data) != 0:
+ return data
+
+ read_data = self._socket.recv(DeflateSocket._RECV_SIZE)
+ if not read_data:
+ return ''
+ self._inflater.append(read_data)
+
+ def sendall(self, bytes):
+ self.send(bytes)
+
+ def send(self, bytes):
+ self._socket.sendall(self._deflater.compress_and_flush(bytes))
+ return len(bytes)
+
+
+class DeflateConnection(object):
+ """A wrapper class for request object to intercept write and read to
+ perform deflate compression and decompression transparently.
+ """
+
+ def __init__(self, connection):
+ self._connection = connection
+
+ self._logger = get_class_logger(self)
+
+ self._deflater = _Deflater(zlib.MAX_WBITS)
+ self._inflater = _Inflater()
+
+ def get_remote_addr(self):
+ return self._connection.remote_addr
+ remote_addr = property(get_remote_addr)
+
+ def put_bytes(self, bytes):
+ self.write(bytes)
+
+ def read(self, size=-1):
+ """Reads at most size bytes. Blocks until there's at least one byte
+ available.
+ """
+
+ # TODO(tyoshino): Allow call with size=0.
+ if not (size == -1 or size > 0):
+ raise Exception('size must be -1 or positive')
+
+ data = ''
+ while True:
+ if size == -1:
+ data += self._inflater.decompress(-1)
+ else:
+ data += self._inflater.decompress(size - len(data))
+
+ if size >= 0 and len(data) != 0:
+ break
+
+ # TODO(tyoshino): Make this read efficient by some workaround.
+ #
+ # In 3.0.3 and prior of mod_python, read blocks until length bytes
+ # was read. We don't know the exact size to read while using
+ # deflate, so read byte-by-byte.
+ #
+ # _StandaloneRequest.read that ultimately performs
+ # socket._fileobject.read also blocks until length bytes was read
+ read_data = self._connection.read(1)
+ if not read_data:
+ break
+ self._inflater.append(read_data)
+ return data
+
+ def write(self, bytes):
+ self._connection.write(self._deflater.compress_and_flush(bytes))
+
+
+def _is_ewouldblock_errno(error_number):
+ """Returns True iff error_number indicates that receive operation would
+ block. To make this portable, we check availability of errno and then
+ compare them.
+ """
+
+ for error_name in ['WSAEWOULDBLOCK', 'EWOULDBLOCK', 'EAGAIN']:
+ if (error_name in dir(errno) and
+ error_number == getattr(errno, error_name)):
+ return True
+ return False
+
+
+def drain_received_data(raw_socket):
+ # Set the socket non-blocking.
+ original_timeout = raw_socket.gettimeout()
+ raw_socket.settimeout(0.0)
+
+ drained_data = []
+
+ # Drain until the socket is closed or no data is immediately
+ # available for read.
+ while True:
+ try:
+ data = raw_socket.recv(1)
+ if not data:
+ break
+ drained_data.append(data)
+ except socket.error, e:
+ # e can be either a pair (errno, string) or just a string (or
+ # something else) telling what went wrong. We suppress only
+ # the errors that indicates that the socket blocks. Those
+ # exceptions can be parsed as a pair (errno, string).
+ try:
+ error_number, message = e
+ except:
+ # Failed to parse socket.error.
+ raise e
+
+ if _is_ewouldblock_errno(error_number):
+ break
+ else:
+ raise e
+
+ # Rollback timeout value.
+ raw_socket.settimeout(original_timeout)
+
+ return ''.join(drained_data)
+
+
+# vi:sts=4 sw=4 et
diff --git a/Tools/Scripts/webkitpy/tool/bot/flakytestreporter_unittest.py b/Tools/Scripts/webkitpy/tool/bot/flakytestreporter_unittest.py
index 961b83dfe..1150d1dd4 100644
--- a/Tools/Scripts/webkitpy/tool/bot/flakytestreporter_unittest.py
+++ b/Tools/Scripts/webkitpy/tool/bot/flakytestreporter_unittest.py
@@ -125,12 +125,12 @@ If you would like to track this test fix with another bug, please close this bug
component: Tools / Tests
cc: abarth@webkit.org
blocked: 50856
-MOCK add_attachment_to_bug: bug_id=50004, description=Failure diff from mock-bot-id filename=failure.diff
+MOCK add_attachment_to_bug: bug_id=60001, description=Failure diff from mock-bot-id filename=failure.diff
MOCK bug comment: bug_id=50000, cc=None
--- Begin comment ---
The dummy-queue encountered the following flaky tests while processing attachment 10000:
-foo/bar.html bug 50004 (author: abarth@webkit.org)
+foo/bar.html bug 60001 (author: abarth@webkit.org)
The dummy-queue is continuing to process your patch.
--- End comment ---
diff --git a/Tools/Scripts/webkitpy/tool/bot/irc_command_unittest.py b/Tools/Scripts/webkitpy/tool/bot/irc_command_unittest.py
index 096d16408..371e308ec 100644
--- a/Tools/Scripts/webkitpy/tool/bot/irc_command_unittest.py
+++ b/Tools/Scripts/webkitpy/tool/bot/irc_command_unittest.py
@@ -58,8 +58,8 @@ class IRCCommandTest(unittest.TestCase):
whois.execute("tom", ["lopez"], None, None))
self.assertEquals('tom: "Vicki Murley" <vicki@apple.com> hasn\'t told me their nick. Boo hoo :-(',
whois.execute("tom", ["vicki@apple.com"], None, None))
- self.assertEquals('tom: I\'m not sure who you mean? epenner, eroman, ericu, eric_carlson, or eseidel could be \'Eric\'.',
- whois.execute("tom", ["Eric"], None, None))
+ self.assertEquals('tom: I\'m not sure who you mean? gavinp or gbarra could be \'Gavin\'.',
+ whois.execute("tom", ["Gavin"], None, None))
self.assertEquals('tom: More than 5 contributors match \'david\', could you be more specific?',
whois.execute("tom", ["david"], None, None))
diff --git a/Tools/Scripts/webkitpy/tool/commands/__init__.py b/Tools/Scripts/webkitpy/tool/commands/__init__.py
index ef05b5ac4..e0d885f71 100644
--- a/Tools/Scripts/webkitpy/tool/commands/__init__.py
+++ b/Tools/Scripts/webkitpy/tool/commands/__init__.py
@@ -5,6 +5,7 @@ from webkitpy.tool.commands.analyzechangelog import AnalyzeChangeLog
from webkitpy.tool.commands.applywatchlistlocal import ApplyWatchListLocal
from webkitpy.tool.commands.bugfortest import BugForTest
from webkitpy.tool.commands.bugsearch import BugSearch
+from webkitpy.tool.commands.chromechannels import ChromeChannels
from webkitpy.tool.commands.download import *
from webkitpy.tool.commands.earlywarningsystem import *
from webkitpy.tool.commands.expectations import OptimizeExpectations
diff --git a/Tools/Scripts/webkitpy/tool/commands/bugsearch.py b/Tools/Scripts/webkitpy/tool/commands/bugsearch.py
index 5cbc1a044..a1d74c548 100644
--- a/Tools/Scripts/webkitpy/tool/commands/bugsearch.py
+++ b/Tools/Scripts/webkitpy/tool/commands/bugsearch.py
@@ -32,6 +32,13 @@ from webkitpy.tool.multicommandtool import AbstractDeclarativeCommand
class BugSearch(AbstractDeclarativeCommand):
name = "bug-search"
help_text = "List bugs matching a query"
+ argument_names = "QUERY"
+ long_help = \
+"""Runs the bugzilla quicksearch QUERY on bugs.webkit.org, and lists all bugs
+returned. QUERY can be as simple as a bug number or a comma delimited list of
+bug numbers.
+See https://bugzilla.mozilla.org/page.cgi?id=quicksearch.html for full
+documentation on the query format."""
def execute(self, options, args, tool):
search_string = args[0]
diff --git a/Tools/Scripts/webkitpy/tool/commands/chromechannels.py b/Tools/Scripts/webkitpy/tool/commands/chromechannels.py
new file mode 100644
index 000000000..da093b48c
--- /dev/null
+++ b/Tools/Scripts/webkitpy/tool/commands/chromechannels.py
@@ -0,0 +1,104 @@
+# 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.
+
+from optparse import make_option
+
+from webkitpy.common.net.omahaproxy import OmahaProxy
+from webkitpy.tool.multicommandtool import AbstractDeclarativeCommand
+
+import re
+
+
+class ChromeChannels(AbstractDeclarativeCommand):
+ name = "chrome-channels"
+ help_text = "List which chrome channels include the patches in bugs returned by QUERY."
+ argument_names = "QUERY"
+ long_help = """Retrieves the current list of Chrome releases from omahaproxy.appspot.com,
+and then runs the bugzilla quicksearch QUERY on bugs.bugzilla.org. For each bug
+returned by query, a single svn commit is deduced, and a short summary is
+printed of each bug listing which Chrome channels contain each bugs associated
+commit.
+
+The QUERY can be as simple as a bug number, or a comma delimited list of bug
+numbers. See https://bugzilla.mozilla.org/page.cgi?id=quicksearch.html for full
+documentation on the query format."""
+
+ chrome_channels = OmahaProxy.chrome_channels
+ commited_pattern = "Committed r([0-9]+): <http://trac.webkit.org/changeset/\\1>"
+ rollout_pattern = "Rolled out in http://trac.webkit.org/changeset/[0-9]+"
+
+ def __init__(self):
+ AbstractDeclarativeCommand.__init__(self)
+ self._re_committed = re.compile(self.commited_pattern)
+ self._re_rollout = re.compile(self.rollout_pattern)
+ self._omahaproxy = OmahaProxy()
+
+ def _channels_for_bug(self, revisions, bug):
+ comments = bug.comments()
+ commit = None
+
+ # Scan the comments, looking for a sane list of commits and rollbacks.
+ for comment in comments:
+ commit_match = self._re_committed.search(comment['text'])
+ if commit_match:
+ if commit:
+ return "%5s %s\n... has too confusing a commit history to parse, skipping\n" % (bug.id(), bug.title())
+ commit = int(commit_match.group(1))
+ if self._re_rollout.search(comment['text']):
+ commit = None
+ if not commit:
+ return "%5s %s\n... does not appear to have an associated commit.\n" % (bug.id(), bug.title())
+
+ # We now know that we have a commit, so gather up the list of platforms
+ # by channel, then print.
+ by_channel = {}
+ for revision in revisions:
+ channel = revision['channel']
+ if revision['commit'] < commit:
+ continue
+ if not channel in by_channel:
+ by_channel[revision['channel']] = " %6s:" % channel
+ by_channel[channel] += " %s," % revision['platform']
+ if not by_channel:
+ return "%5s %s (r%d)\n... not yet released in any Chrome channels.\n" % (bug.id(), bug.title(), commit)
+ retval = "%5s %s (r%d)\n" % (bug.id(), bug.title(), commit)
+ for channel in self.chrome_channels:
+ if channel in by_channel:
+ retval += by_channel[channel][:-1]
+ retval += "\n"
+ return retval
+
+ def execute(self, options, args, tool):
+ search_string = args[0]
+ revisions = self._omahaproxy.get_revisions()
+ bugs = tool.bugs.queries.fetch_bugs_matching_quicksearch(search_string)
+ if not bugs:
+ print "No bugs found matching '%s'" % search_string
+ return
+ for bug in bugs:
+ print self._channels_for_bug(revisions, bug),
diff --git a/Tools/Scripts/webkitpy/tool/commands/chromechannels_unittest.py b/Tools/Scripts/webkitpy/tool/commands/chromechannels_unittest.py
new file mode 100644
index 000000000..037aebbfe
--- /dev/null
+++ b/Tools/Scripts/webkitpy/tool/commands/chromechannels_unittest.py
@@ -0,0 +1,99 @@
+# 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.
+
+from webkitpy.tool.commands.chromechannels import ChromeChannels
+from webkitpy.tool.commands.commandtest import CommandsTest
+from webkitpy.tool.mocktool import MockTool
+from webkitpy.common.net.omahaproxy import OmahaProxy
+
+
+class MockOmahaProxy(OmahaProxy):
+ revisions = [{"commit": 20, "channel": "canary", "platform": "Mac", "date": "07/04/76"},
+ {"commit": 20, "channel": "canary", "platform": "Windows", "date": "07/04/76"},
+ {"commit": 25, "channel": "dev", "platform": "Mac", "date": "07/01/76"},
+ {"commit": 30, "channel": "dev", "platform": "Windows", "date": "03/29/82"},
+ {"commit": 30, "channel": "dev", "platform": "Linux", "date": "03/29/82"},
+ {"commit": 15, "channel": "beta", "platform": "Windows", "date": "07/04/67"},
+ {"commit": 15, "channel": "beta", "platform": "Linux", "date": "07/04/67"},
+ {"commit": 10, "channel": "stable", "platform": "Windows", "date": "07/01/67"},
+ {"commit": 20, "channel": "stable", "platform": "Linux", "date": "09/16/10"},
+ ]
+
+ def get_revisions(self):
+ return self.revisions
+
+
+class TestableChromeChannels(ChromeChannels):
+ def __init__(self):
+ ChromeChannels.__init__(self)
+ self._omahaproxy = MockOmahaProxy()
+
+
+class ChromeChannelsTest(CommandsTest):
+
+ single_bug_expectations = {
+ 50001: """50001 Bug with a patch needing review. (r35)
+... not yet released in any Chrome channels.
+""",
+ 50002: """50002 The third bug
+... has too confusing a commit history to parse, skipping
+""",
+ 50003: """50003 The fourth bug
+... does not appear to have an associated commit.
+""",
+ 50004: """50004 The fifth bug (r15)
+ canary: Mac, Windows
+ dev: Mac, Windows, Linux
+ beta: Windows, Linux
+ stable: Linux
+"""}
+
+ def test_single_bug(self):
+ testable_chrome_channels = TestableChromeChannels()
+ tool = MockTool()
+ testable_chrome_channels.bind_to_tool(tool)
+ revisions = testable_chrome_channels._omahaproxy.get_revisions()
+ for bug_id, expectation in self.single_bug_expectations.items():
+ self.assertEqual(testable_chrome_channels._channels_for_bug(revisions, testable_chrome_channels._tool.bugs.fetch_bug(bug_id)),
+ expectation)
+
+ def test_with_query(self):
+ expected_stdout = \
+"""50001 Bug with a patch needing review. (r35)
+... not yet released in any Chrome channels.
+50002 The third bug
+... has too confusing a commit history to parse, skipping
+50003 The fourth bug
+... does not appear to have an associated commit.
+50004 The fifth bug (r15)
+ canary: Mac, Windows
+ dev: Mac, Windows, Linux
+ beta: Windows, Linux
+ stable: Linux
+"""
+ self.assert_execute_outputs(TestableChromeChannels(), ["foo"], expected_stdout=expected_stdout)
diff --git a/Tools/Scripts/webkitpy/tool/commands/download_unittest.py b/Tools/Scripts/webkitpy/tool/commands/download_unittest.py
index f936a9673..7f19fbd7a 100644
--- a/Tools/Scripts/webkitpy/tool/commands/download_unittest.py
+++ b/Tools/Scripts/webkitpy/tool/commands/download_unittest.py
@@ -261,8 +261,7 @@ Reason
component: MOCK component
cc: MOCK cc
blocked: 50000
-MOCK reopen_bug 50000 with comment 'Re-opened since this is blocked by 50004'
-MOCK add_patch_to_bug: bug_id=50004, description=ROLLOUT of r852, mark_for_review=False, mark_for_commit_queue=True, mark_for_landing=False
+MOCK add_patch_to_bug: bug_id=60001, description=ROLLOUT of r852, mark_for_review=False, mark_for_commit_queue=True, mark_for_landing=False
-- Begin comment --
Any committer can land this patch automatically by marking it commit-queue+. The commit-queue will build and test the patch before landing to ensure that the rollout will be successful. This process takes approximately 15 minutes.
@@ -276,6 +275,30 @@ where ATTACHMENT_ID is the ID of this attachment.
self.assert_execute_outputs(CreateRollout(), [852, "Reason"], options=self._default_options(), expected_stderr=expected_stderr)
self.assert_execute_outputs(CreateRollout(), ["855 852 854", "Reason"], options=self._default_options(), expected_stderr=expected_stderr)
+ def test_create_rollout_resolved(self):
+ expected_stderr = """Preparing rollout for bug 50004.
+Updating working directory
+MOCK create_bug
+bug_title: REGRESSION(r3001): Reason
+bug_description: http://trac.webkit.org/changeset/3001 broke the build:
+Reason
+component: MOCK component
+cc: MOCK cc
+blocked: 50004
+MOCK reopen_bug 50004 with comment 'Re-opened since this is blocked by 60001'
+MOCK add_patch_to_bug: bug_id=60001, description=ROLLOUT of r3001, mark_for_review=False, mark_for_commit_queue=True, mark_for_landing=False
+-- Begin comment --
+Any committer can land this patch automatically by marking it commit-queue+. The commit-queue will build and test the patch before landing to ensure that the rollout will be successful. This process takes approximately 15 minutes.
+
+If you would like to land the rollout faster, you can use the following command:
+
+ webkit-patch land-attachment ATTACHMENT_ID
+
+where ATTACHMENT_ID is the ID of this attachment.
+-- End comment --
+"""
+ self.assert_execute_outputs(CreateRollout(), [3001, "Reason"], options=self._default_options(), expected_stderr=expected_stderr)
+
def test_rollout(self):
expected_stderr = """Preparing rollout for bug 50000.
Updating working directory
diff --git a/Tools/Scripts/webkitpy/tool/commands/queries_unittest.py b/Tools/Scripts/webkitpy/tool/commands/queries_unittest.py
index 0fb59a853..877d8c40a 100644
--- a/Tools/Scripts/webkitpy/tool/commands/queries_unittest.py
+++ b/Tools/Scripts/webkitpy/tool/commands/queries_unittest.py
@@ -98,12 +98,12 @@ class FailureReasonTest(unittest.TestCase):
command = FailureReason()
command.bind_to_tool(tool)
# This is an artificial example, mostly to test the CommitInfo lookup failure case.
- self.assertEquals(command._blame_line_for_revision(None), "FAILED to fetch CommitInfo for rNone, likely missing ChangeLog")
+ self.assertEquals(command._blame_line_for_revision(0), "FAILED to fetch CommitInfo for r0, likely missing ChangeLog")
def raising_mock(self):
raise Exception("MESSAGE")
tool.checkout().commit_info_for_revision = raising_mock
- self.assertEquals(command._blame_line_for_revision(None), "FAILED to fetch CommitInfo for rNone, exception: MESSAGE")
+ self.assertEquals(command._blame_line_for_revision(0), "FAILED to fetch CommitInfo for r0, exception: MESSAGE")
class PrintExpectationsTest(unittest.TestCase):
diff --git a/Tools/Scripts/webkitpy/tool/steps/createbug.py b/Tools/Scripts/webkitpy/tool/steps/createbug.py
index 2638d1973..4605892e7 100644
--- a/Tools/Scripts/webkitpy/tool/steps/createbug.py
+++ b/Tools/Scripts/webkitpy/tool/steps/createbug.py
@@ -1,9 +1,9 @@
# 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
@@ -13,7 +13,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
@@ -51,4 +51,6 @@ class CreateBug(AbstractStep):
blocks = state.get("bug_blocked")
state["bug_id"] = self._tool.bugs.create_bug(state["bug_title"], state["bug_description"], blocked=blocks, component=self._options.component, cc=cc)
if blocks:
- self._tool.bugs.reopen_bug(blocks, "Re-opened since this is blocked by %s" % state["bug_id"])
+ status = self._tool.bugs.fetch_bug(blocks).status()
+ if status == 'RESOLVED':
+ self._tool.bugs.reopen_bug(blocks, "Re-opened since this is blocked by %s" % state["bug_id"])
diff --git a/Tools/TestResultServer/static-dashboards/dashboard_base.js b/Tools/TestResultServer/static-dashboards/dashboard_base.js
index fa6c9a3af..34e546e4d 100644
--- a/Tools/TestResultServer/static-dashboards/dashboard_base.js
+++ b/Tools/TestResultServer/static-dashboards/dashboard_base.js
@@ -805,7 +805,7 @@ function hidePopup()
popup.parentNode.removeChild(popup);
}
-function showPopup(e, html)
+function showPopup(target, html)
{
var popup = $('popup');
if (!popup) {
@@ -817,7 +817,7 @@ function showPopup(e, html)
// Set html first so that we can get accurate size metrics on the popup.
popup.innerHTML = html;
- var targetRect = e.target.getBoundingClientRect();
+ var targetRect = target.getBoundingClientRect();
var x = Math.min(targetRect.left - 10, document.documentElement.clientWidth - popup.offsetWidth);
x = Math.max(0, x);
diff --git a/Tools/TestResultServer/static-dashboards/flakiness_dashboard.js b/Tools/TestResultServer/static-dashboards/flakiness_dashboard.js
index a72cce9b5..0e6311a07 100644
--- a/Tools/TestResultServer/static-dashboards/flakiness_dashboard.js
+++ b/Tools/TestResultServer/static-dashboards/flakiness_dashboard.js
@@ -36,6 +36,7 @@ var GTEST_MODIFIERS = ['FLAKY', 'FAILS', 'MAYBE', 'DISABLED'];
var TEST_URL_BASE_PATH_TRAC = 'http://trac.webkit.org/browser/trunk/LayoutTests/';
var TEST_URL_BASE_PATH = "http://svn.webkit.org/repository/webkit/trunk/LayoutTests/";
var TEST_RESULTS_BASE_PATH = 'http://build.chromium.org/f/chromium/layout_test_results/';
+var GPU_RESULTS_BASE_PATH = 'http://chromium-browser-gpu-tests.commondatastorage.googleapis.com/runs/'
// FIXME: These platform names should probably be changed to match the directories in LayoutTests/platform
// instead of matching the values we use in the test_expectations.txt file.
@@ -1015,7 +1016,7 @@ function showPopupForBuild(e, builder, index, opt_testName)
html += '<li>' + linkHTMLToOpenWindow(buildBasePath + pathToFailureLog(opt_testName), 'Failure log') + '</li>';
html += '</ul>';
- showPopup(e, html);
+ showPopup(e.target, html);
}
function htmlForTestResults(test)
@@ -1863,6 +1864,11 @@ function loadExpectations(expectationsContainer)
}
}
+function gpuResultsPath(chromeRevision, builder)
+{
+ return chromeRevision + '_' + builder.replace(/[^A-Za-z0-9]+/g, '_');
+}
+
function loadGPUResultsForBuilder(builder, test, expectationsContainer)
{
var container = document.createElement('div');
@@ -1870,21 +1876,19 @@ function loadGPUResultsForBuilder(builder, test, expectationsContainer)
container.innerHTML = '<div><b>' + builder + '</b></div>';
expectationsContainer.appendChild(container);
- var baseUrl = 'http://chromium-browser-gpu-tests.commondatastorage.googleapis.com/runs/'
var failureIndex = indexesForFailures(builder, test)[0];
var buildNumber = g_resultsByBuilder[builder].buildNumbers[failureIndex];
var pathToLog = builderMaster(builder).logPath(builder, buildNumber) + pathToFailureLog(test);
var chromeRevision = g_resultsByBuilder[builder].chromeRevision[failureIndex];
- var builderName = builder.replace(/[^A-Za-z0-9 ]/g, '').replace(/ /g, '_');
- var resultsUrl = baseUrl + chromeRevision + '_' + builderName + '_/';
+ var resultsUrl = GPU_RESULTS_BASE_PATH + gpuResultsPath(chromeRevision, builder);
var filename = test.split(/\./)[1] + '.png';
appendNonWebKitResults(container, pathToLog, 'non-webkit-results');
- appendNonWebKitResults(container, resultsUrl + 'gen/' + filename, 'gpu-test-results', 'Generated');
- appendNonWebKitResults(container, resultsUrl + 'ref/' + filename, 'gpu-test-results', 'Reference');
- appendNonWebKitResults(container, resultsUrl + 'diff/' + filename, 'gpu-test-results', 'Diff');
+ appendNonWebKitResults(container, resultsUrl + '/gen/' + filename, 'gpu-test-results', 'Generated');
+ appendNonWebKitResults(container, resultsUrl + '/ref/' + filename, 'gpu-test-results', 'Reference');
+ appendNonWebKitResults(container, resultsUrl + '/diff/' + filename, 'gpu-test-results', 'Diff');
}
function loadNonWebKitResultsForBuilder(builder, test, expectationsContainer)
@@ -2338,6 +2342,9 @@ function postHeightChangedMessage()
parent.postMessage({command: 'heightChanged', height: height}, '*')
}
+if (window != parent)
+ window.addEventListener('blur', hidePopup);
+
document.addEventListener('keydown', function(e) {
if (e.keyIdentifier == 'U+003F' || e.keyIdentifier == 'U+00BF') {
// WebKit MAC retursn 3F. WebKit WIN returns BF. This is a bug!
diff --git a/Tools/TestResultServer/static-dashboards/flakiness_dashboard_embedded_unittests.js b/Tools/TestResultServer/static-dashboards/flakiness_dashboard_embedded_unittests.js
new file mode 100644
index 000000000..5599b3e65
--- /dev/null
+++ b/Tools/TestResultServer/static-dashboards/flakiness_dashboard_embedded_unittests.js
@@ -0,0 +1,40 @@
+// 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:
+//
+// * 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.
+
+test('hidePopupOnBlur', 2, function() {
+ showPopup(document.body, 'dummy content');
+ ok(document.querySelector('#popup'));
+
+ // Cause the window to be blurred.
+ var frame = document.createElement('iframe');
+ document.body.appendChild(frame);
+ frame.focus();
+ document.body.removeChild(frame);
+
+ ok(!document.querySelector('#popup'));
+}); \ No newline at end of file
diff --git a/Tools/TestResultServer/static-dashboards/flakiness_dashboard_unittests.js b/Tools/TestResultServer/static-dashboards/flakiness_dashboard_unittests.js
index b58da4b6c..0da199725 100644
--- a/Tools/TestResultServer/static-dashboards/flakiness_dashboard_unittests.js
+++ b/Tools/TestResultServer/static-dashboards/flakiness_dashboard_unittests.js
@@ -666,3 +666,16 @@ test('sortTests', 4, function() {
sortTests(tests, 'bugs', BACKWARD);
deepEqual(tests, [test3, test1, test2]);
});
+
+test('popup', 2, function() {
+ showPopup(document.body, 'dummy content');
+ ok(document.querySelector('#popup'));
+ hidePopup();
+ ok(!document.querySelector('#popup'));
+});
+
+test('gpuResultsPath', 3, function() {
+ equal(gpuResultsPath('777777', 'Win7 Release (ATI)'), '777777_Win7_Release_ATI_');
+ equal(gpuResultsPath('123', 'GPU Linux (dbg)(NVIDIA)'), '123_GPU_Linux_dbg_NVIDIA_');
+ equal(gpuResultsPath('12345', 'GPU Mac'), '12345_GPU_Mac');
+});
diff --git a/Tools/TestResultServer/static-dashboards/run-embedded-unittests.html b/Tools/TestResultServer/static-dashboards/run-embedded-unittests.html
new file mode 100644
index 000000000..dc633ca79
--- /dev/null
+++ b/Tools/TestResultServer/static-dashboards/run-embedded-unittests.html
@@ -0,0 +1,67 @@
+<!DOCTYPE html>
+<!--
+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.
+-->
+<html>
+<head>
+<link rel="stylesheet" href="../../../Source/ThirdParty/qunit/qunit/qunit.css">
+<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
+<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.15/jquery-ui.min.js"></script>
+<script src="../../../Source/ThirdParty/qunit/qunit/qunit.js"></script>
+</head>
+<body>
+<h1 id="qunit-header">Test Results Server JavaScript Unit Tests</h1>
+<h2 id="qunit-banner"></h2>
+<div id="qunit-testrunner-toolbar"></div>
+<h2 id="qunit-userAgent"></h2>
+<ol id="qunit-tests"></ol>
+
+<link rel="stylesheet" href="flakiness_dashboard.css"></link>
+<link rel="stylesheet" href="flakiness_dashboard_tests.css"></link>
+<script src="builders.js"></script>
+
+<script>
+// Don't request the actual builders off the bots when running unittests.
+function loadBuildersList() {};
+function g_handleBuildersListLoaded() {};
+
+// Mimic being embedded. All our embedded checks compare window and parent.
+window.parent = null;
+</script>
+
+<script src="dashboard_base.js"></script>
+<script src="flakiness_dashboard.js"></script>
+
+<script>
+window.location.href = '#useTestData=true';
+var builderGroup = '@ToT - chromium.org';
+var builders = {'Webkit Linux': '', 'Webkit Linux (dbg)': '', 'Webkit Mac10.5': '', 'Webkit Win': ''};
+onBuilderListLoad(LAYOUT_TESTS_BUILDER_GROUPS, isChromiumWebkitTipOfTreeTestRunner, CHROMIUM_WEBKIT_BUILDER_MASTER, builderGroup, BuilderGroup.TOT_WEBKIT, builders);
+initBuilders();
+</script>
+
+<!-- FIXME: Split this up into multiple unittest.js, e.g. one for builders.js and one for dashboard_base.js. -->
+<script src="flakiness_dashboard_embedded_unittests.js"></script>
+</body>
+</html>
diff --git a/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj b/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
index 85c365cc3..6225f04dd 100644
--- a/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
+++ b/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
@@ -141,9 +141,15 @@
C507E8A714C6545B005D6B3B /* InspectorBar.mm in Sources */ = {isa = PBXBuildFile; fileRef = C507E8A614C6545B005D6B3B /* InspectorBar.mm */; };
C540F776152E4DA000A40C8C /* SimplifyMarkup.mm in Sources */ = {isa = PBXBuildFile; fileRef = C540F775152E4DA000A40C8C /* SimplifyMarkup.mm */; };
C540F784152E5A9A00A40C8C /* verboseMarkup.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = C540F783152E5A7800A40C8C /* verboseMarkup.html */; };
+ E1220DA0155B25480013E2FC /* MemoryCacheDisableWithinResourceLoadDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = E1220D9F155B25480013E2FC /* MemoryCacheDisableWithinResourceLoadDelegate.mm */; };
+ E1220DCA155B28AA0013E2FC /* MemoryCacheDisableWithinResourceLoadDelegate.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = E1220DC9155B287D0013E2FC /* MemoryCacheDisableWithinResourceLoadDelegate.html */; };
E490296814E2E3A4002BEDD1 /* TypingStyleCrash.mm in Sources */ = {isa = PBXBuildFile; fileRef = E490296714E2E3A4002BEDD1 /* TypingStyleCrash.mm */; };
F3FC3EE313678B7300126A65 /* libgtest.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F3FC3EE213678B7300126A65 /* libgtest.a */; };
+ F6A6BFBB1558AC4800926107 /* simple-unload.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = F6A6BFB91558ABF800926107 /* simple-unload.html */; };
+ F6A6BFBC1558AC4B00926107 /* simple-iframe-unload.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = F6A6BFB81558ABF800926107 /* simple-iframe-unload.html */; };
F6F3F29113342FEB00A6BF19 /* CookieManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F6F3F29013342FEB00A6BF19 /* CookieManager.cpp */; };
+ F6F49C6915545C8E0007F39D /* DOMWindowExtensionNoCache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F6F49C6715545C8D0007F39D /* DOMWindowExtensionNoCache.cpp */; };
+ F6F49C6B15545CA70007F39D /* DOMWindowExtensionNoCache_Bundle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F6F49C6615545C8D0007F39D /* DOMWindowExtensionNoCache_Bundle.cpp */; };
F6FDDDD314241AD4004F1729 /* PrivateBrowsingPushStateNoHistoryCallback.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F6FDDDD214241AD4004F1729 /* PrivateBrowsingPushStateNoHistoryCallback.cpp */; };
F6FDDDD614241C6F004F1729 /* push-state.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = F6FDDDD514241C48004F1729 /* push-state.html */; };
/* End PBXBuildFile section */
@@ -178,6 +184,7 @@
B55F11B71517D03300915916 /* attributedStringCustomFont.html in Copy Resources */,
76E182DF154767E600F1FADD /* auto-submitting-form.html in Copy Resources */,
5142B2731517C8C800C32B19 /* ContextMenuCanCopyURL.html in Copy Resources */,
+ E1220DCA155B28AA0013E2FC /* MemoryCacheDisableWithinResourceLoadDelegate.html in Copy Resources */,
517E7E04151119C100D0B008 /* MemoryCachePruneWithinResourceLoadDelegate.html in Copy Resources */,
379028B914FAC24C007E6B43 /* acceptsFirstMouse.html in Copy Resources */,
33DC8912141955FE00747EF7 /* simple-iframe.html in Copy Resources */,
@@ -190,7 +197,9 @@
F6FDDDD614241C6F004F1729 /* push-state.html in Copy Resources */,
BCBD3737125ABBEB00D2C29F /* icon.png in Copy Resources */,
1A02C870125D4CFD00E3F4BD /* find.html in Copy Resources */,
+ F6A6BFBC1558AC4B00926107 /* simple-iframe-unload.html in Copy Resources */,
BC909784125571CF00083756 /* simple.html in Copy Resources */,
+ F6A6BFBB1558AC4800926107 /* simple-unload.html in Copy Resources */,
C0ADBE9612FCA79B00D2C129 /* simple-form.html in Copy Resources */,
BCAA485614A0444C0088FAC4 /* simple-tall.html in Copy Resources */,
C01A23F21266156700C9ED55 /* spacebar-scrolling.html in Copy Resources */,
@@ -354,9 +363,15 @@
C507E8A614C6545B005D6B3B /* InspectorBar.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = InspectorBar.mm; sourceTree = "<group>"; };
C540F775152E4DA000A40C8C /* SimplifyMarkup.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = SimplifyMarkup.mm; sourceTree = "<group>"; };
C540F783152E5A7800A40C8C /* verboseMarkup.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = verboseMarkup.html; sourceTree = "<group>"; };
+ E1220D9F155B25480013E2FC /* MemoryCacheDisableWithinResourceLoadDelegate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MemoryCacheDisableWithinResourceLoadDelegate.mm; sourceTree = "<group>"; };
+ E1220DC9155B287D0013E2FC /* MemoryCacheDisableWithinResourceLoadDelegate.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = MemoryCacheDisableWithinResourceLoadDelegate.html; sourceTree = "<group>"; };
E490296714E2E3A4002BEDD1 /* TypingStyleCrash.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = TypingStyleCrash.mm; sourceTree = "<group>"; };
F3FC3EE213678B7300126A65 /* libgtest.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libgtest.a; sourceTree = BUILT_PRODUCTS_DIR; };
+ F6A6BFB81558ABF800926107 /* simple-iframe-unload.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "simple-iframe-unload.html"; sourceTree = "<group>"; };
+ F6A6BFB91558ABF800926107 /* simple-unload.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "simple-unload.html"; sourceTree = "<group>"; };
F6F3F29013342FEB00A6BF19 /* CookieManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CookieManager.cpp; sourceTree = "<group>"; };
+ F6F49C6615545C8D0007F39D /* DOMWindowExtensionNoCache_Bundle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DOMWindowExtensionNoCache_Bundle.cpp; sourceTree = "<group>"; };
+ F6F49C6715545C8D0007F39D /* DOMWindowExtensionNoCache.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DOMWindowExtensionNoCache.cpp; sourceTree = "<group>"; };
F6FDDDD214241AD4004F1729 /* PrivateBrowsingPushStateNoHistoryCallback.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PrivateBrowsingPushStateNoHistoryCallback.cpp; sourceTree = "<group>"; };
F6FDDDD514241C48004F1729 /* push-state.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "push-state.html"; sourceTree = "<group>"; };
/* End PBXFileReference section */
@@ -501,6 +516,8 @@
F6F3F29013342FEB00A6BF19 /* CookieManager.cpp */,
51393E1E1523944A005F39C5 /* DOMWindowExtensionBasic.cpp */,
51393E1D1523944A005F39C5 /* DOMWindowExtensionBasic_Bundle.cpp */,
+ F6F49C6715545C8D0007F39D /* DOMWindowExtensionNoCache.cpp */,
+ F6F49C6615545C8D0007F39D /* DOMWindowExtensionNoCache_Bundle.cpp */,
BCB6803F126FBFE100642A61 /* DocumentStartUserScriptAlertCrash.cpp */,
BCB68041126FBFF100642A61 /* DocumentStartUserScriptAlertCrash_Bundle.cpp */,
C045F9441385C2E900C0F3CD /* DownloadDecideDestinationCrash.cpp */,
@@ -589,7 +606,9 @@
1ADBEFBC130C6A0100D61D19 /* simple-accelerated-compositing.html */,
C0ADBE8412FCA6B600D2C129 /* simple-form.html */,
33DC890E1419539300747EF7 /* simple-iframe.html */,
+ F6A6BFB81558ABF800926107 /* simple-iframe-unload.html */,
BCAA485514A021640088FAC4 /* simple-tall.html */,
+ F6A6BFB91558ABF800926107 /* simple-unload.html */,
BC909778125571AB00083756 /* simple.html */,
C02B7882126615410026BF0F /* spacebar-scrolling.html */,
76E182DE15475A8300F1FADD /* auto-submitting-form.html */,
@@ -640,6 +659,7 @@
3776BC62150946BC0043A66D /* DeviceScaleFactorInDashboardRegions.mm */,
939BA91614103412001A01BD /* DeviceScaleFactorOnBack.mm */,
C507E8A614C6545B005D6B3B /* InspectorBar.mm */,
+ E1220D9F155B25480013E2FC /* MemoryCacheDisableWithinResourceLoadDelegate.mm */,
517E7DFB15110EA600D0B008 /* MemoryCachePruneWithinResourceLoadDelegate.mm */,
3722C8681461E03E00C45D00 /* RenderedImageFromDOMRange.mm */,
C540F775152E4DA000A40C8C /* SimplifyMarkup.mm */,
@@ -659,8 +679,9 @@
379028B814FABE49007E6B43 /* acceptsFirstMouse.html */,
5142B2721517C89100C32B19 /* ContextMenuCanCopyURL.html */,
37DC678F140D7D3A00ABCCDB /* DOMRangeOfString.html */,
- C07E6CB113FD738A0038B22B /* devicePixelRatio.html */,
+ E1220DC9155B287D0013E2FC /* MemoryCacheDisableWithinResourceLoadDelegate.html */,
517E7E031511187500D0B008 /* MemoryCachePruneWithinResourceLoadDelegate.html */,
+ C07E6CB113FD738A0038B22B /* devicePixelRatio.html */,
C540F783152E5A7800A40C8C /* verboseMarkup.html */,
);
name = Resources;
@@ -864,6 +885,8 @@
51FCF79A1534AC6D00104491 /* ShouldGoToBackForwardListItem.cpp in Sources */,
51393E201523944A005F39C5 /* DOMWindowExtensionBasic.cpp in Sources */,
76E182DA1547550100F1FADD /* WillSendSubmitEvent.cpp in Sources */,
+ E1220DA0155B25480013E2FC /* MemoryCacheDisableWithinResourceLoadDelegate.mm in Sources */,
+ F6F49C6915545C8E0007F39D /* DOMWindowExtensionNoCache.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -895,6 +918,7 @@
51FCF7A11534B2A000104491 /* ShouldGoToBackForwardListItem_Bundle.cpp in Sources */,
51393E221523952D005F39C5 /* DOMWindowExtensionBasic_Bundle.cpp in Sources */,
76E182DD1547569100F1FADD /* WillSendSubmitEvent_Bundle.cpp in Sources */,
+ F6F49C6B15545CA70007F39D /* DOMWindowExtensionNoCache_Bundle.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
diff --git a/Tools/TestWebKitAPI/Tests/WebKit2/DOMWindowExtensionBasic.cpp b/Tools/TestWebKitAPI/Tests/WebKit2/DOMWindowExtensionBasic.cpp
index b78ee91af..8be4440c2 100644
--- a/Tools/TestWebKitAPI/Tests/WebKit2/DOMWindowExtensionBasic.cpp
+++ b/Tools/TestWebKitAPI/Tests/WebKit2/DOMWindowExtensionBasic.cpp
@@ -33,7 +33,6 @@
namespace TestWebKitAPI {
static bool finished;
-static int liveDOMExtensionCount;
static const char* expectedMessages[] = {
"GlobalObjectIsAvailableForFrame called",
@@ -60,13 +59,7 @@ static const char* expectedMessages[] = {
"DidReconnectDOMWindowExtensionToGlobalObject called",
"Main frame finished loading",
"Extension states:\nFirst page, main frame, standard world - Connected\nFirst page, main frame, non-standard world - Connected\nFirst page, subframe, standard world - Connected\nFirst page, subframe, non-standard world - Connected\nSecond page, main frame, standard world - Disconnected\nSecond page, main frame, non-standard world - Disconnected",
-"WillDestroyGlobalObjectForDOMWindowExtension called",
-"WillDestroyGlobalObjectForDOMWindowExtension called",
-"WillDestroyGlobalObjectForDOMWindowExtension called",
-"WillDestroyGlobalObjectForDOMWindowExtension called",
-"WillDestroyGlobalObjectForDOMWindowExtension called",
-"WillDestroyGlobalObjectForDOMWindowExtension called",
-"Extension states:\nFirst page, main frame, standard world - Destroyed\nFirst page, main frame, non-standard world - Destroyed\nFirst page, subframe, standard world - Destroyed\nFirst page, subframe, non-standard world - Destroyed\nSecond page, main frame, standard world - Destroyed\nSecond page, main frame, non-standard world - Destroyed",
+"Extension states:\nFirst page, main frame, standard world - Removed\nFirst page, main frame, non-standard world - Removed\nFirst page, subframe, standard world - Removed\nFirst page, subframe, non-standard world - Removed\nSecond page, main frame, standard world - Removed\nSecond page, main frame, non-standard world - Removed",
"TestComplete"
};
@@ -80,15 +73,8 @@ static void didReceiveMessageFromInjectedBundle(WKContextRef, WKStringRef messag
WKStringRef bodyString = (WKStringRef)messageBody;
messages.append(bodyString);
- if (WKStringIsEqualToUTF8CString(messageName, "GlobalObjectIsAvailableForFrame"))
- liveDOMExtensionCount++;
- else if (WKStringIsEqualToUTF8CString(messageName, "WillDestroyGlobalObjectForDOMWindowExtension")) {
- liveDOMExtensionCount--;
- if (!liveDOMExtensionCount)
- finished = true;
- } else if (WKStringIsEqualToUTF8CString(messageName, "DidFinishLoadForMainFrame") || WKStringIsEqualToUTF8CString(messageName, "TestComplete"))
+ if (WKStringIsEqualToUTF8CString(messageName, "DidFinishLoadForMainFrame") || WKStringIsEqualToUTF8CString(messageName, "TestComplete"))
finished = true;
-
}
TEST(WebKit2, DOMWindowExtensionBasic)
@@ -129,20 +115,20 @@ TEST(WebKit2, DOMWindowExtensionBasic)
Util::run(&finished);
finished = false;
-
- // Make sure the 2 disconnected extensions in the page cache and the 4 active extensions are all destroyed.
+
+ // Make sure the 2 disconnected extensions in the page cache and the 4 active extensions are all removed.
WKPageClose(webView.page());
Util::run(&finished);
const size_t expectedSize = sizeof(expectedMessages) / sizeof(const char*);
- EXPECT_EQ(messages.size(), expectedSize);
+ EXPECT_EQ(expectedSize, messages.size());
if (messages.size() != expectedSize)
return;
for (size_t i = 0; i < messages.size(); ++i)
- EXPECT_EQ(WKStringIsEqualToUTF8CString(messages[i].get(), expectedMessages[i]), true);
+ EXPECT_WK_STREQ(expectedMessages[i], messages[i].get());
}
} // namespace TestWebKitAPI
diff --git a/Tools/TestWebKitAPI/Tests/WebKit2/DOMWindowExtensionBasic_Bundle.cpp b/Tools/TestWebKitAPI/Tests/WebKit2/DOMWindowExtensionBasic_Bundle.cpp
index 61ac1bdeb..bb5b1eb68 100644
--- a/Tools/TestWebKitAPI/Tests/WebKit2/DOMWindowExtensionBasic_Bundle.cpp
+++ b/Tools/TestWebKitAPI/Tests/WebKit2/DOMWindowExtensionBasic_Bundle.cpp
@@ -33,7 +33,6 @@
#include <WebKit2/WKBundleScriptWorld.h>
#include <WebKit2/WKRetainPtr.h>
#include <wtf/HashMap.h>
-#include <wtf/Vector.h>
#include <assert.h>
namespace TestWebKitAPI {
@@ -46,14 +45,15 @@ static void willDestroyGlobalObjectForDOMWindowExtensionCallback(WKBundlePageRef
enum ExtensionState {
- Uncreated = 0, Connected, Disconnected, Destroyed
+ Uncreated = 0, Connected, Disconnected, Destroyed, Removed
};
-const char* stateNames[4] = {
+const char* stateNames[5] = {
"Uncreated",
"Connected",
"Disconnected",
- "Destroyed"
+ "Destroyed",
+ "Removed"
};
typedef struct {
@@ -67,6 +67,7 @@ public:
virtual void initialize(WKBundleRef, WKTypeRef userData);
virtual void didCreatePage(WKBundleRef, WKBundlePageRef);
+ virtual void willDestroyPage(WKBundleRef, WKBundlePageRef);
void globalObjectIsAvailableForFrame(WKBundleFrameRef, WKBundleScriptWorldRef);
void willDisconnectDOMWindowExtensionFromGlobalObject(WKBundleDOMWindowExtensionRef);
@@ -85,7 +86,6 @@ private:
ExtensionRecord m_extensionRecords[6];
HashMap<WKBundleDOMWindowExtensionRef, int> m_extensionToRecordMap;
bool m_finishedOneMainFrameLoad;
- int m_numberOfDestroyedExtensions;
};
static InjectedBundleTest::Register<DOMWindowExtensionBasic> registrar("DOMWindowExtensionBasic");
@@ -93,7 +93,6 @@ static InjectedBundleTest::Register<DOMWindowExtensionBasic> registrar("DOMWindo
DOMWindowExtensionBasic::DOMWindowExtensionBasic(const std::string& identifier)
: InjectedBundleTest(identifier)
, m_finishedOneMainFrameLoad(false)
- , m_numberOfDestroyedExtensions(0)
{
m_extensionRecords[0].name = "First page, main frame, standard world";
m_extensionRecords[1].name = "First page, main frame, non-standard world";
@@ -167,6 +166,21 @@ void DOMWindowExtensionBasic::didCreatePage(WKBundleRef bundle, WKBundlePageRef
WKBundlePageSetPageLoaderClient(page, &pageLoaderClient);
}
+
+void DOMWindowExtensionBasic::willDestroyPage(WKBundleRef, WKBundlePageRef)
+{
+ HashMap<WKBundleDOMWindowExtensionRef, int>::iterator it = m_extensionToRecordMap.begin();
+ HashMap<WKBundleDOMWindowExtensionRef, int>::iterator end = m_extensionToRecordMap.end();
+ for (; it != end; ++it) {
+ updateExtensionStateRecord(it->first, Removed);
+ WKRelease(it->first);
+ }
+
+ m_extensionToRecordMap.clear();
+
+ sendExtensionStateMessage();
+ sendBundleMessage("TestComplete");
+}
void DOMWindowExtensionBasic::updateExtensionStateRecord(WKBundleDOMWindowExtensionRef extension, ExtensionState state)
{
@@ -211,19 +225,11 @@ void DOMWindowExtensionBasic::didReconnectDOMWindowExtensionToGlobalObject(WKBun
sendBundleMessage("DidReconnectDOMWindowExtensionToGlobalObject called");
}
-void DOMWindowExtensionBasic::willDestroyGlobalObjectForDOMWindowExtension(WKBundleDOMWindowExtensionRef extension)
+void DOMWindowExtensionBasic::willDestroyGlobalObjectForDOMWindowExtension(WKBundleDOMWindowExtensionRef)
{
- m_numberOfDestroyedExtensions++;
-
- updateExtensionStateRecord(extension, Destroyed);
- sendBundleMessage("WillDestroyGlobalObjectForDOMWindowExtension called");
-
- if (m_numberOfDestroyedExtensions == 6) {
- sendExtensionStateMessage();
- sendBundleMessage("TestComplete");
- }
-
- WKRelease(extension);
+ // All of the items are candidates for the page cache and should not be evicted from the page
+ // cache before the test completes.
+ ASSERT_NOT_REACHED();
}
static void didFinishLoadForFrameCallback(WKBundlePageRef, WKBundleFrameRef frame, WKTypeRef*, const void *clientInfo)
diff --git a/Tools/TestWebKitAPI/Tests/WebKit2/DOMWindowExtensionNoCache.cpp b/Tools/TestWebKitAPI/Tests/WebKit2/DOMWindowExtensionNoCache.cpp
new file mode 100644
index 000000000..d59d0d1bb
--- /dev/null
+++ b/Tools/TestWebKitAPI/Tests/WebKit2/DOMWindowExtensionNoCache.cpp
@@ -0,0 +1,133 @@
+/*
+* 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 "config.h"
+#include "PlatformUtilities.h"
+#include "PlatformWebView.h"
+#include "Test.h"
+#include <wtf/Vector.h>
+
+namespace TestWebKitAPI {
+
+static bool finished;
+
+static const char* expectedMessages[] = {
+"GlobalObjectIsAvailableForFrame called",
+"GlobalObjectIsAvailableForFrame called",
+"GlobalObjectIsAvailableForFrame called",
+"GlobalObjectIsAvailableForFrame called",
+"Subframe finished loading",
+"Extension states:\nFirst page, main frame, standard world - Connected\nFirst page, main frame, non-standard world - Connected\nFirst page, subframe, standard world - Connected\nFirst page, subframe, non-standard world - Connected\nSecond page, main frame, standard world - Uncreated\nSecond page, main frame, non-standard world - Uncreated\nFirst page, main frame, standard world - Uncreated\nFirst page, main frame, non-standard world - Uncreated\nFirst page, subframe, standard world - Uncreated\nFirst page, subframe, non-standard world - Uncreated",
+"Main frame finished loading",
+"Extension states:\nFirst page, main frame, standard world - Connected\nFirst page, main frame, non-standard world - Connected\nFirst page, subframe, standard world - Connected\nFirst page, subframe, non-standard world - Connected\nSecond page, main frame, standard world - Uncreated\nSecond page, main frame, non-standard world - Uncreated\nFirst page, main frame, standard world - Uncreated\nFirst page, main frame, non-standard world - Uncreated\nFirst page, subframe, standard world - Uncreated\nFirst page, subframe, non-standard world - Uncreated",
+"WillDestroyDOMWindowExtensionToGlobalObject called",
+"WillDestroyDOMWindowExtensionToGlobalObject called",
+"WillDestroyDOMWindowExtensionToGlobalObject called",
+"WillDestroyDOMWindowExtensionToGlobalObject called",
+"GlobalObjectIsAvailableForFrame called",
+"GlobalObjectIsAvailableForFrame called",
+"Main frame finished loading",
+"Extension states:\nFirst page, main frame, standard world - Destroyed\nFirst page, main frame, non-standard world - Destroyed\nFirst page, subframe, standard world - Destroyed\nFirst page, subframe, non-standard world - Destroyed\nSecond page, main frame, standard world - Connected\nSecond page, main frame, non-standard world - Connected\nFirst page, main frame, standard world - Uncreated\nFirst page, main frame, non-standard world - Uncreated\nFirst page, subframe, standard world - Uncreated\nFirst page, subframe, non-standard world - Uncreated",
+"WillDestroyDOMWindowExtensionToGlobalObject called",
+"WillDestroyDOMWindowExtensionToGlobalObject called",
+"GlobalObjectIsAvailableForFrame called",
+"GlobalObjectIsAvailableForFrame called",
+"GlobalObjectIsAvailableForFrame called",
+"GlobalObjectIsAvailableForFrame called",
+"Subframe finished loading",
+"Extension states:\nFirst page, main frame, standard world - Destroyed\nFirst page, main frame, non-standard world - Destroyed\nFirst page, subframe, standard world - Destroyed\nFirst page, subframe, non-standard world - Destroyed\nSecond page, main frame, standard world - Destroyed\nSecond page, main frame, non-standard world - Destroyed\nFirst page, main frame, standard world - Connected\nFirst page, main frame, non-standard world - Connected\nFirst page, subframe, standard world - Connected\nFirst page, subframe, non-standard world - Connected",
+"Main frame finished loading",
+"Extension states:\nFirst page, main frame, standard world - Destroyed\nFirst page, main frame, non-standard world - Destroyed\nFirst page, subframe, standard world - Destroyed\nFirst page, subframe, non-standard world - Destroyed\nSecond page, main frame, standard world - Destroyed\nSecond page, main frame, non-standard world - Destroyed\nFirst page, main frame, standard world - Connected\nFirst page, main frame, non-standard world - Connected\nFirst page, subframe, standard world - Connected\nFirst page, subframe, non-standard world - Connected",
+"Extension states:\nFirst page, main frame, standard world - Destroyed\nFirst page, main frame, non-standard world - Destroyed\nFirst page, subframe, standard world - Destroyed\nFirst page, subframe, non-standard world - Destroyed\nSecond page, main frame, standard world - Destroyed\nSecond page, main frame, non-standard world - Destroyed\nFirst page, main frame, standard world - Removed\nFirst page, main frame, non-standard world - Removed\nFirst page, subframe, standard world - Removed\nFirst page, subframe, non-standard world - Removed",
+"TestComplete"
+};
+
+static Vector<WKRetainPtr<WKStringRef> > messages;
+
+static void didReceiveMessageFromInjectedBundle(WKContextRef, WKStringRef messageName, WKTypeRef messageBody, const void*)
+{
+ ASSERT_NOT_NULL(messageBody);
+ EXPECT_EQ(WKStringGetTypeID(), WKGetTypeID(messageBody));
+
+ WKStringRef bodyString = (WKStringRef)messageBody;
+ messages.append(bodyString);
+
+ if (WKStringIsEqualToUTF8CString(messageName, "DidFinishLoadForMainFrame") || WKStringIsEqualToUTF8CString(messageName, "TestComplete"))
+ finished = true;
+}
+
+TEST(WebKit2, DOMWindowExtensionNoCache)
+{
+ WKRetainPtr<WKPageGroupRef> pageGroup(AdoptWK, WKPageGroupCreateWithIdentifier(WKStringCreateWithUTF8CString("DOMWindowExtensionNoCachePageGroup")));
+
+ WKRetainPtr<WKContextRef> context(AdoptWK, Util::createContextForInjectedBundleTest("DOMWindowExtensionNoCache", pageGroup.get()));
+
+ WKContextInjectedBundleClient injectedBundleClient;
+ memset(&injectedBundleClient, 0, sizeof(injectedBundleClient));
+ injectedBundleClient.version = kWKContextInjectedBundleClientCurrentVersion;
+ injectedBundleClient.clientInfo = 0;
+ injectedBundleClient.didReceiveMessageFromInjectedBundle = didReceiveMessageFromInjectedBundle;
+ WKContextSetInjectedBundleClient(context.get(), &injectedBundleClient);
+
+ // FIXME 85891: Instead of using unload handlers to prevent use of the page cache, set the
+ // cache model to kWKCacheModelDocumentView, which sets page cache capacity to 0.
+
+ PlatformWebView webView(context.get(), pageGroup.get());
+
+ // Make sure the extensions for each frame are installed in each world.
+ WKRetainPtr<WKURLRef> url1(AdoptWK, Util::createURLForResource("simple-iframe-unload", "html"));
+ WKPageLoadURL(webView.page(), url1.get());
+
+ Util::run(&finished);
+ finished = false;
+
+ // Make sure those first 4 extensions are destroyed, and 2 new ones are installed.
+ WKRetainPtr<WKURLRef> url2(AdoptWK, Util::createURLForResource("simple-unload", "html"));
+ WKPageLoadURL(webView.page(), url2.get());
+
+ Util::run(&finished);
+ finished = false;
+
+ // Make sure those 2 are destroyed, and the first 4 are recreated.
+ WKPageGoBack(webView.page());
+
+ Util::run(&finished);
+ finished = false;
+
+ WKPageClose(webView.page());
+
+ Util::run(&finished);
+
+ const size_t expectedSize = sizeof(expectedMessages) / sizeof(const char*);
+ EXPECT_EQ(expectedSize, messages.size());
+
+ if (messages.size() != expectedSize)
+ return;
+
+ for (size_t i = 0; i < messages.size(); ++i)
+ EXPECT_WK_STREQ(expectedMessages[i], messages[i].get());
+}
+
+} // namespace TestWebKitAPI
diff --git a/Tools/TestWebKitAPI/Tests/WebKit2/DOMWindowExtensionNoCache_Bundle.cpp b/Tools/TestWebKitAPI/Tests/WebKit2/DOMWindowExtensionNoCache_Bundle.cpp
new file mode 100644
index 000000000..fcc0c72f6
--- /dev/null
+++ b/Tools/TestWebKitAPI/Tests/WebKit2/DOMWindowExtensionNoCache_Bundle.cpp
@@ -0,0 +1,279 @@
+/*
+ * 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 "config.h"
+#include "InjectedBundleTest.h"
+#include <WebKit2/WKBundleDOMWindowExtension.h>
+#include <WebKit2/WKBundleFrame.h>
+#include <WebKit2/WKBundlePage.h>
+#include <WebKit2/WKBundlePageGroup.h>
+#include <WebKit2/WKBundlePrivate.h>
+#include <WebKit2/WKBundleScriptWorld.h>
+#include <WebKit2/WKRetainPtr.h>
+#include <wtf/HashMap.h>
+#include <assert.h>
+
+namespace TestWebKitAPI {
+
+static void didFinishLoadForFrameCallback(WKBundlePageRef, WKBundleFrameRef, WKTypeRef*, const void* clientInfo);
+static void globalObjectIsAvailableForFrameCallback(WKBundlePageRef, WKBundleFrameRef, WKBundleScriptWorldRef, const void* clientInfo);
+static void willDisconnectDOMWindowExtensionFromGlobalObjectCallback(WKBundlePageRef, WKBundleDOMWindowExtensionRef, const void* clientInfo);
+static void didReconnectDOMWindowExtensionToGlobalObjectCallback(WKBundlePageRef, WKBundleDOMWindowExtensionRef, const void* clientInfo);
+static void willDestroyGlobalObjectForDOMWindowExtensionCallback(WKBundlePageRef, WKBundleDOMWindowExtensionRef, const void* clientInfo);
+
+enum ExtensionState {
+ Uncreated = 0, Connected, Disconnected, Destroyed, Removed
+};
+
+const char* states[5] = {
+ "Uncreated",
+ "Connected",
+ "Disconnected",
+ "Destroyed",
+ "Removed"
+};
+
+typedef struct {
+ const char* name;
+ ExtensionState state;
+} ExtensionRecord;
+
+class DOMWindowExtensionNoCache : public InjectedBundleTest {
+public:
+ DOMWindowExtensionNoCache(const std::string& identifier);
+
+ virtual void initialize(WKBundleRef, WKTypeRef userData);
+ virtual void didCreatePage(WKBundleRef, WKBundlePageRef);
+ virtual void willDestroyPage(WKBundleRef, WKBundlePageRef);
+
+ void globalObjectIsAvailableForFrame(WKBundleFrameRef, WKBundleScriptWorldRef);
+ void willDisconnectDOMWindowExtensionFromGlobalObject(WKBundleDOMWindowExtensionRef);
+ void didReconnectDOMWindowExtensionToGlobalObject(WKBundleDOMWindowExtensionRef);
+ void willDestroyGlobalObjectForDOMWindowExtension(WKBundleDOMWindowExtensionRef);
+
+ void frameLoadFinished(WKBundleFrameRef);
+
+private:
+ void updateExtensionStateRecord(WKBundleDOMWindowExtensionRef, ExtensionState);
+ void sendExtensionStateMessage();
+ void sendBundleMessage(const char*);
+
+ WKBundlePageGroupRef m_pageGroup;
+ WKBundleRef m_bundle;
+ ExtensionRecord m_extensionRecords[10];
+ HashMap<WKBundleDOMWindowExtensionRef, int> m_extensionToRecordMap;
+ int m_numberMainFrameLoads;
+};
+
+static InjectedBundleTest::Register<DOMWindowExtensionNoCache> registrar("DOMWindowExtensionNoCache");
+
+DOMWindowExtensionNoCache::DOMWindowExtensionNoCache(const std::string& identifier)
+ : InjectedBundleTest(identifier)
+ , m_numberMainFrameLoads(0)
+{
+ m_extensionRecords[0].name = "First page, main frame, standard world";
+ m_extensionRecords[1].name = "First page, main frame, non-standard world";
+ m_extensionRecords[2].name = "First page, subframe, standard world";
+ m_extensionRecords[3].name = "First page, subframe, non-standard world";
+ m_extensionRecords[4].name = "Second page, main frame, standard world";
+ m_extensionRecords[5].name = "Second page, main frame, non-standard world";
+ m_extensionRecords[6].name = "First page, main frame, standard world";
+ m_extensionRecords[7].name = "First page, main frame, non-standard world";
+ m_extensionRecords[8].name = "First page, subframe, standard world";
+ m_extensionRecords[9].name = "First page, subframe, non-standard world";
+
+ for (size_t i = 0; i < 10; ++i)
+ m_extensionRecords[i].state = Uncreated;
+}
+
+void DOMWindowExtensionNoCache::frameLoadFinished(WKBundleFrameRef frame)
+{
+ bool mainFrame = !WKBundleFrameGetParentFrame(frame);
+ if (mainFrame)
+ m_numberMainFrameLoads++;
+
+ char body[16384];
+ sprintf(body, "%s finished loading", mainFrame ? "Main frame" : "Subframe");
+
+ // Only consider load finished for the main frame
+ const char* name = mainFrame ? "DidFinishLoadForMainFrame" : "DidFinishLoadForFrame";
+
+ WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString(name));
+ WKRetainPtr<WKStringRef> messageBody = adoptWK(WKStringCreateWithUTF8CString(body));
+ WKBundlePostMessage(m_bundle, messageName.get(), messageBody.get());
+
+ sendExtensionStateMessage();
+}
+
+void DOMWindowExtensionNoCache::sendExtensionStateMessage()
+{
+ char body[16384];
+ sprintf(body, "Extension states:\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s",
+ m_extensionRecords[0].name, states[m_extensionRecords[0].state],
+ m_extensionRecords[1].name, states[m_extensionRecords[1].state],
+ m_extensionRecords[2].name, states[m_extensionRecords[2].state],
+ m_extensionRecords[3].name, states[m_extensionRecords[3].state],
+ m_extensionRecords[4].name, states[m_extensionRecords[4].state],
+ m_extensionRecords[5].name, states[m_extensionRecords[5].state],
+ m_extensionRecords[6].name, states[m_extensionRecords[6].state],
+ m_extensionRecords[7].name, states[m_extensionRecords[7].state],
+ m_extensionRecords[8].name, states[m_extensionRecords[8].state],
+ m_extensionRecords[9].name, states[m_extensionRecords[9].state]);
+
+ WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("ExtensionStates"));
+ WKRetainPtr<WKStringRef> messageBody = adoptWK(WKStringCreateWithUTF8CString(body));
+ WKBundlePostMessage(m_bundle, messageName.get(), messageBody.get());
+}
+
+void DOMWindowExtensionNoCache::initialize(WKBundleRef bundle, WKTypeRef userData)
+{
+ assert(WKGetTypeID(userData) == WKBundlePageGroupGetTypeID());
+ WKBundlePageGroupRef pageGroup = static_cast<WKBundlePageGroupRef>(userData);
+
+ WKRetainPtr<WKStringRef> source(AdoptWK, WKStringCreateWithUTF8CString("alert('Unimportant alert');"));
+ WKBundleAddUserScript(bundle, pageGroup, WKBundleScriptWorldCreateWorld(), source.get(), 0, 0, 0, kWKInjectAtDocumentStart, kWKInjectInAllFrames);
+}
+
+void DOMWindowExtensionNoCache::didCreatePage(WKBundleRef bundle, WKBundlePageRef page)
+{
+ m_bundle = bundle;
+
+ WKBundlePageLoaderClient pageLoaderClient;
+ memset(&pageLoaderClient, 0, sizeof(pageLoaderClient));
+
+ pageLoaderClient.version = kWKBundlePageLoaderClientCurrentVersion;
+ pageLoaderClient.clientInfo = this;
+ pageLoaderClient.didFinishLoadForFrame = didFinishLoadForFrameCallback;
+ pageLoaderClient.globalObjectIsAvailableForFrame = globalObjectIsAvailableForFrameCallback;
+ pageLoaderClient.willDisconnectDOMWindowExtensionFromGlobalObject = willDisconnectDOMWindowExtensionFromGlobalObjectCallback;
+ pageLoaderClient.didReconnectDOMWindowExtensionToGlobalObject = didReconnectDOMWindowExtensionToGlobalObjectCallback;
+ pageLoaderClient.willDestroyGlobalObjectForDOMWindowExtension = willDestroyGlobalObjectForDOMWindowExtensionCallback;
+
+ WKBundlePageSetPageLoaderClient(page, &pageLoaderClient);
+}
+
+void DOMWindowExtensionNoCache::willDestroyPage(WKBundleRef, WKBundlePageRef)
+{
+ HashMap<WKBundleDOMWindowExtensionRef, int>::iterator it = m_extensionToRecordMap.begin();
+ HashMap<WKBundleDOMWindowExtensionRef, int>::iterator end = m_extensionToRecordMap.end();
+ for (; it != end; ++it) {
+ updateExtensionStateRecord(it->first, Removed);
+ WKRelease(it->first);
+ }
+
+ m_extensionToRecordMap.clear();
+
+ sendExtensionStateMessage();
+ sendBundleMessage("TestComplete");
+}
+
+void DOMWindowExtensionNoCache::updateExtensionStateRecord(WKBundleDOMWindowExtensionRef extension, ExtensionState state)
+{
+ int index = m_extensionToRecordMap.get(extension);
+ m_extensionRecords[index].state = state;
+}
+
+void DOMWindowExtensionNoCache::sendBundleMessage(const char* message)
+{
+ WKRetainPtr<WKStringRef> wkMessage = adoptWK(WKStringCreateWithUTF8CString(message));
+ WKBundlePostMessage(m_bundle, wkMessage.get(), wkMessage.get());
+}
+
+void DOMWindowExtensionNoCache::globalObjectIsAvailableForFrame(WKBundleFrameRef frame, WKBundleScriptWorldRef world)
+{
+ WKBundleDOMWindowExtensionRef extension = WKBundleDOMWindowExtensionCreate(frame, world);
+
+ int index;
+ bool standard;
+ standard = world == WKBundleScriptWorldNormalWorld();
+
+ bool mainFrame = !WKBundleFrameGetParentFrame(frame);
+ switch (m_numberMainFrameLoads) {
+ case 0:
+ index = mainFrame ? (standard ? 0 : 1) : (standard ? 2 : 3);
+ break;
+ case 1:
+ index = standard ? 4 : 5;
+ break;
+ case 2:
+ index = mainFrame ? (standard ? 6 : 7) : (standard ? 8 : 9);
+ break;
+ default:
+ ASSERT_NOT_REACHED();
+ break;
+ }
+
+ m_extensionToRecordMap.set(extension, index);
+
+ updateExtensionStateRecord(extension, Connected);
+ sendBundleMessage("GlobalObjectIsAvailableForFrame called");
+}
+
+void DOMWindowExtensionNoCache::willDisconnectDOMWindowExtensionFromGlobalObject(WKBundleDOMWindowExtensionRef extension)
+{
+ // No items should be going into a 0-capacity page cache.
+ ASSERT_NOT_REACHED();
+}
+
+void DOMWindowExtensionNoCache::didReconnectDOMWindowExtensionToGlobalObject(WKBundleDOMWindowExtensionRef)
+{
+ // No items should be coming out of a 0-capacity page cache.
+ ASSERT_NOT_REACHED();
+}
+
+void DOMWindowExtensionNoCache::willDestroyGlobalObjectForDOMWindowExtension(WKBundleDOMWindowExtensionRef extension)
+{
+ sendBundleMessage("WillDestroyDOMWindowExtensionToGlobalObject called");
+ updateExtensionStateRecord(extension, Destroyed);
+ m_extensionToRecordMap.remove(extension);
+ WKRelease(extension);
+}
+
+static void didFinishLoadForFrameCallback(WKBundlePageRef, WKBundleFrameRef frame, WKTypeRef*, const void *clientInfo)
+{
+ ((DOMWindowExtensionNoCache*)clientInfo)->frameLoadFinished(frame);
+}
+
+static void globalObjectIsAvailableForFrameCallback(WKBundlePageRef, WKBundleFrameRef frame, WKBundleScriptWorldRef world, const void* clientInfo)
+{
+ ((DOMWindowExtensionNoCache*)clientInfo)->globalObjectIsAvailableForFrame(frame, world);
+}
+
+static void willDisconnectDOMWindowExtensionFromGlobalObjectCallback(WKBundlePageRef, WKBundleDOMWindowExtensionRef extension, const void* clientInfo)
+{
+ ((DOMWindowExtensionNoCache*)clientInfo)->willDisconnectDOMWindowExtensionFromGlobalObject(extension);
+}
+
+static void didReconnectDOMWindowExtensionToGlobalObjectCallback(WKBundlePageRef, WKBundleDOMWindowExtensionRef extension, const void* clientInfo)
+{
+ ((DOMWindowExtensionNoCache*)clientInfo)->didReconnectDOMWindowExtensionToGlobalObject(extension);
+}
+
+static void willDestroyGlobalObjectForDOMWindowExtensionCallback(WKBundlePageRef, WKBundleDOMWindowExtensionRef extension , const void* clientInfo)
+{
+ ((DOMWindowExtensionNoCache*)clientInfo)->willDestroyGlobalObjectForDOMWindowExtension(extension);
+}
+
+} // namespace TestWebKitAPI
diff --git a/Tools/TestWebKitAPI/Tests/WebKit2/PageLoadBasic.cpp b/Tools/TestWebKitAPI/Tests/WebKit2/PageLoadBasic.cpp
index 9f69bca82..5f2f6e283 100644
--- a/Tools/TestWebKitAPI/Tests/WebKit2/PageLoadBasic.cpp
+++ b/Tools/TestWebKitAPI/Tests/WebKit2/PageLoadBasic.cpp
@@ -135,9 +135,17 @@ TEST(WebKit2, PageLoadBasic)
policyClient.decidePolicyForResponse = decidePolicyForResponse;
WKPageSetPagePolicyClient(webView.page(), &policyClient);
+ // Before loading anything, the active url should be null
+ EXPECT_NULL(WKPageCopyActiveURL(webView.page()));
+
WKRetainPtr<WKURLRef> url(AdoptWK, Util::createURLForResource("simple", "html"));
WKPageLoadURL(webView.page(), url.get());
+ // But immediately after starting a load, the active url should reflect the request
+ WKRetainPtr<WKURLRef> activeUrl = adoptWK(WKPageCopyActiveURL(webView.page()));
+ ASSERT_NOT_NULL(activeUrl.get());
+ EXPECT_TRUE(WKURLIsEqual(activeUrl.get(), url.get()));
+
Util::run(&test1Done);
}
diff --git a/Tools/TestWebKitAPI/Tests/WebKit2/simple-iframe-unload.html b/Tools/TestWebKitAPI/Tests/WebKit2/simple-iframe-unload.html
new file mode 100644
index 000000000..bb8860c74
--- /dev/null
+++ b/Tools/TestWebKitAPI/Tests/WebKit2/simple-iframe-unload.html
@@ -0,0 +1,6 @@
+<html>
+<body onunload="/* disable page cache */">
+ Simple HTML file with an unload handler.
+ <iframe src="simple-unload.html"></iframe>
+</body>
+</html>
diff --git a/Tools/TestWebKitAPI/Tests/WebKit2/simple-unload.html b/Tools/TestWebKitAPI/Tests/WebKit2/simple-unload.html
new file mode 100644
index 000000000..be38e24cb
--- /dev/null
+++ b/Tools/TestWebKitAPI/Tests/WebKit2/simple-unload.html
@@ -0,0 +1,5 @@
+<html>
+<body onunload="/* disable page cache */">
+ Simple HTML file with an unload handler.
+</body>
+</html>
diff --git a/Tools/TestWebKitAPI/Tests/mac/MemoryCacheDisableWithinResourceLoadDelegate.html b/Tools/TestWebKitAPI/Tests/mac/MemoryCacheDisableWithinResourceLoadDelegate.html
new file mode 100644
index 000000000..033c79130
--- /dev/null
+++ b/Tools/TestWebKitAPI/Tests/mac/MemoryCacheDisableWithinResourceLoadDelegate.html
@@ -0,0 +1,14 @@
+<script>
+
+function loaded()
+{
+ var request = new XMLHttpRequest();
+ request.open('GET', 'http://www.iana.org/domains/example/', true);
+ request.send(null);
+}
+
+</script>
+
+<body onload="loaded();">
+We will do some XHR'ing now!
+</body>
diff --git a/Tools/TestWebKitAPI/Tests/mac/MemoryCacheDisableWithinResourceLoadDelegate.mm b/Tools/TestWebKitAPI/Tests/mac/MemoryCacheDisableWithinResourceLoadDelegate.mm
new file mode 100644
index 000000000..aeb955508
--- /dev/null
+++ b/Tools/TestWebKitAPI/Tests/mac/MemoryCacheDisableWithinResourceLoadDelegate.mm
@@ -0,0 +1,90 @@
+/*
+ * 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.
+ */
+
+#import "config.h"
+#import "PlatformUtilities.h"
+#import <WebKit/WebCache.h>
+#import <wtf/RetainPtr.h>
+
+@interface MemoryCacheDisableTestResourceLoadDelegate : NSObject {
+}
+@end
+
+static bool didFinishLoad;
+
+@implementation MemoryCacheDisableTestResourceLoadDelegate
+
+- (id)webView:(WebView *)sender identifierForInitialRequest:(NSURLRequest *)request fromDataSource:(WebDataSource *)dataSource
+{
+ [WebCache setDisabled:YES];
+ [WebCache setDisabled:NO];
+
+ return self;
+}
+
+- (NSURLRequest *)webView:(WebView *)sender resource:(id)identifier willSendRequest:(NSURLRequest *)request redirectResponse:(NSURLResponse *)redirectResponse fromDataSource:(WebDataSource *)dataSource
+{
+ [WebCache setDisabled:YES];
+ [WebCache setDisabled:NO];
+
+ return request;
+}
+
+- (void)webView:(WebView *)sender resource:(id)identifier didFinishLoadingFromDataSource:(WebDataSource *)dataSource
+{
+ [WebCache setDisabled:YES];
+ [WebCache setDisabled:NO];
+
+ didFinishLoad = YES;
+}
+
+- (void)webView:(WebView *)sender resource:(id)identifier didFailLoadingWithError:(NSError *)error fromDataSource:(WebDataSource *)dataSource
+{
+ [WebCache setDisabled:YES];
+ [WebCache setDisabled:NO];
+}
+
+@end
+
+namespace TestWebKitAPI {
+
+TEST(WebKit1, MemoryCacheDisableWithinResourceLoadDelegate)
+{
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+
+ RetainPtr<WebView> webView(AdoptNS, [[WebView alloc] initWithFrame:NSMakeRect(0, 0, 120, 200) frameName:nil groupName:nil]);
+
+ RetainPtr<MemoryCacheDisableTestResourceLoadDelegate> resourceLoadDelegate(AdoptNS, [[MemoryCacheDisableTestResourceLoadDelegate alloc] init]);
+ webView.get().resourceLoadDelegate = resourceLoadDelegate.get();
+
+ [[webView.get() mainFrame] loadRequest:[NSURLRequest requestWithURL:[[NSBundle mainBundle] URLForResource:@"MemoryCacheDisableWithinResourceLoadDelegate" withExtension:@"html" subdirectory:@"TestWebKitAPI.resources"]]];
+
+ Util::run(&didFinishLoad);
+
+ [pool drain];
+ // If we finished without crashing, the test passed.
+}
+
+} // namespace TestWebKitAPI
diff --git a/Tools/WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl b/Tools/WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl
index d8def4dee..c7ac269a7 100644
--- a/Tools/WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl
+++ b/Tools/WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2010 Apple Inc. All rights reserved.
+ * Copyright (C) 2010, 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
@@ -41,6 +41,7 @@ module WTR {
void dumpStatusCallbacks();
void dumpTitleChanges();
void dumpFullScreenCallbacks();
+ void dumpFrameLoadCallbacks();
void dumpConfigurationForViewport(in int deviceDPI, in int deviceWidth, in int deviceHeight, in int availableWidth, in int availableHeight);
// Special options.
@@ -90,7 +91,6 @@ module WTR {
boolean pauseAnimationAtTimeOnElementWithId(in DOMString animationName, in double time, in DOMString elementId);
boolean pauseTransitionAtTimeOnElementWithId(in DOMString propertyName, in double time, in DOMString elementId);
void suspendAnimations();
- void resumeAnimations();
// UserContent testing.
void addUserScript(in DOMString source, in boolean runAtStart, in boolean allFrames);
diff --git a/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp b/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp
index 5564b32df..05d4ea687 100644
--- a/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp
+++ b/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2010 Apple Inc. All rights reserved.
+ * Copyright (C) 2010, 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
@@ -148,7 +148,7 @@ void InjectedBundle::didReceiveMessage(WKStringRef messageName, WKTypeRef messag
WKRetainPtr<WKStringRef> ackMessageBody(AdoptWK, WKStringCreateWithUTF8CString("BeginTest"));
WKBundlePostMessage(m_bundle, ackMessageName.get(), ackMessageBody.get());
- beginTesting();
+ beginTesting(messageBodyDictionary);
return;
} else if (WKStringIsEqualToUTF8CString(messageName, "Reset")) {
ASSERT(messageBody);
@@ -190,7 +190,20 @@ void InjectedBundle::didReceiveMessage(WKStringRef messageName, WKTypeRef messag
WKBundlePostMessage(m_bundle, errorMessageName.get(), errorMessageBody.get());
}
-void InjectedBundle::beginTesting()
+bool InjectedBundle::booleanForKey(WKDictionaryRef dictionary, const char* key)
+{
+ WKRetainPtr<WKStringRef> wkKey(AdoptWK, WKStringCreateWithUTF8CString(key));
+ WKTypeRef value = WKDictionaryGetItemForKey(dictionary, wkKey.get());
+ if (WKGetTypeID(value) != WKBooleanGetTypeID()) {
+ stringBuilder()->append("Boolean value for key \"");
+ stringBuilder()->append(key);
+ stringBuilder()->append("\" not found in dictionary\n");
+ return false;
+ }
+ return WKBooleanGetValue(static_cast<WKBooleanRef>(value));
+}
+
+void InjectedBundle::beginTesting(WKDictionaryRef settings)
{
m_state = Testing;
@@ -215,6 +228,8 @@ void InjectedBundle::beginTesting()
WKBundleRemoveAllUserContent(m_bundle, m_pageGroup);
+ m_layoutTestController->setShouldDumpFrameLoadCallbacks(booleanForKey(settings, "DumpFrameLoadDelegates"));
+
page()->reset();
WKBundleClearAllDatabases(m_bundle);
diff --git a/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.h b/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.h
index cb67dadbe..26bedc45d 100644
--- a/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.h
+++ b/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2010 Apple Inc. All rights reserved.
+ * Copyright (C) 2010, 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
@@ -106,7 +106,9 @@ private:
void platformInitialize(WKTypeRef initializationUserData);
void resetLocalSettings();
- void beginTesting();
+ void beginTesting(WKDictionaryRef initialSettings);
+
+ bool booleanForKey(WKDictionaryRef, const char* key);
WKBundleRef m_bundle;
WKBundlePageGroupRef m_pageGroup;
diff --git a/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp b/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp
index 527ec3799..0605a8537 100644
--- a/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp
+++ b/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2010 Apple Inc. All rights reserved.
+ * Copyright (C) 2010, 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
@@ -347,6 +347,32 @@ void InjectedBundlePage::reset()
// Loader Client Callbacks
+// String output must be identical to -[WebFrame _drt_descriptionSuitableForTestResult].
+static void dumpFrameDescriptionSuitableForTestResult(WKBundleFrameRef frame)
+{
+ WKRetainPtr<WKStringRef> name(AdoptWK, WKBundleFrameCopyName(frame));
+ if (WKBundleFrameIsMainFrame(frame)) {
+ if (WKStringIsEmpty(name.get())) {
+ InjectedBundle::shared().stringBuilder()->append("main frame");
+ return;
+ }
+
+ InjectedBundle::shared().stringBuilder()->append("main frame \"");
+ InjectedBundle::shared().stringBuilder()->append(toWTFString(name));
+ InjectedBundle::shared().stringBuilder()->append("\"");
+ return;
+ }
+
+ if (WKStringIsEmpty(name.get())) {
+ InjectedBundle::shared().stringBuilder()->append("frame (anonymous)");
+ return;
+ }
+
+ InjectedBundle::shared().stringBuilder()->append("frame \"");
+ InjectedBundle::shared().stringBuilder()->append(toWTFString(name));
+ InjectedBundle::shared().stringBuilder()->append("\"");
+}
+
void InjectedBundlePage::didStartProvisionalLoadForFrame(WKBundlePageRef page, WKBundleFrameRef frame, WKTypeRef*, const void *clientInfo)
{
static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->didStartProvisionalLoadForFrame(frame);
@@ -462,6 +488,11 @@ void InjectedBundlePage::didStartProvisionalLoadForFrame(WKBundleFrameRef frame)
if (!InjectedBundle::shared().isTestRunning())
return;
+ if (InjectedBundle::shared().layoutTestController()->shouldDumpFrameLoadCallbacks()) {
+ dumpFrameDescriptionSuitableForTestResult(frame);
+ InjectedBundle::shared().stringBuilder()->append(" - didStartProvisionalLoadForFrame\n");
+ }
+
if (InjectedBundle::shared().topLoadingFrame())
return;
InjectedBundle::shared().setTopLoadingFrame(frame);
@@ -488,6 +519,14 @@ void InjectedBundlePage::didFailProvisionalLoadWithErrorForFrame(WKBundleFrameRe
void InjectedBundlePage::didCommitLoadForFrame(WKBundleFrameRef frame)
{
+ if (!InjectedBundle::shared().isTestRunning())
+ return;
+
+ if (!InjectedBundle::shared().layoutTestController()->shouldDumpFrameLoadCallbacks())
+ return;
+
+ dumpFrameDescriptionSuitableForTestResult(frame);
+ InjectedBundle::shared().stringBuilder()->append(" - didCommitLoadForFrame\n");
}
enum FrameNamePolicy { ShouldNotIncludeFrameName, ShouldIncludeFrameName };
@@ -639,6 +678,11 @@ void InjectedBundlePage::didFinishLoadForFrame(WKBundleFrameRef frame)
if (!InjectedBundle::shared().isTestRunning())
return;
+ if (InjectedBundle::shared().layoutTestController()->shouldDumpFrameLoadCallbacks()) {
+ dumpFrameDescriptionSuitableForTestResult(frame);
+ InjectedBundle::shared().stringBuilder()->append(" - didFinishLoadForFrame\n");
+ }
+
if (frame != InjectedBundle::shared().topLoadingFrame())
return;
InjectedBundle::shared().setTopLoadingFrame(0);
@@ -669,6 +713,13 @@ void InjectedBundlePage::didReceiveTitleForFrame(WKStringRef title, WKBundleFram
if (!InjectedBundle::shared().isTestRunning())
return;
+ if (InjectedBundle::shared().layoutTestController()->shouldDumpFrameLoadCallbacks()) {
+ dumpFrameDescriptionSuitableForTestResult(frame);
+ InjectedBundle::shared().stringBuilder()->append(" - didReceiveTitle: ");
+ InjectedBundle::shared().stringBuilder()->append(toWTFString(title));
+ InjectedBundle::shared().stringBuilder()->append("\n");
+ }
+
if (!InjectedBundle::shared().layoutTestController()->shouldDumpTitleChanges())
return;
@@ -706,10 +757,28 @@ void InjectedBundlePage::didClearWindowForFrame(WKBundleFrameRef frame, WKBundle
void InjectedBundlePage::didCancelClientRedirectForFrame(WKBundleFrameRef frame)
{
+ if (!InjectedBundle::shared().isTestRunning())
+ return;
+
+ if (!InjectedBundle::shared().layoutTestController()->shouldDumpFrameLoadCallbacks())
+ return;
+
+ dumpFrameDescriptionSuitableForTestResult(frame);
+ InjectedBundle::shared().stringBuilder()->append(" - didCancelClientRedirectForFrame\n");
}
void InjectedBundlePage::willPerformClientRedirectForFrame(WKBundleFrameRef frame, WKURLRef url, double delay, double date)
{
+ if (!InjectedBundle::shared().isTestRunning())
+ return;
+
+ if (!InjectedBundle::shared().layoutTestController()->shouldDumpFrameLoadCallbacks())
+ return;
+
+ dumpFrameDescriptionSuitableForTestResult(frame);
+ InjectedBundle::shared().stringBuilder()->append(" - willPerformClientRedirectToURL: ");
+ InjectedBundle::shared().stringBuilder()->append(toWTFString(adoptWK(WKURLCopyString(url))));
+ InjectedBundle::shared().stringBuilder()->append(" \n");
}
void InjectedBundlePage::didSameDocumentNavigationForFrame(WKBundleFrameRef frame, WKSameDocumentNavigationType type)
@@ -721,6 +790,11 @@ void InjectedBundlePage::didFinishDocumentLoadForFrame(WKBundleFrameRef frame)
if (!InjectedBundle::shared().isTestRunning())
return;
+ if (InjectedBundle::shared().layoutTestController()->shouldDumpFrameLoadCallbacks()) {
+ dumpFrameDescriptionSuitableForTestResult(frame);
+ InjectedBundle::shared().stringBuilder()->append(" - didFinishDocumentLoadForFrame\n");
+ }
+
unsigned pendingFrameUnloadEvents = WKBundleFrameGetPendingUnloadCount(frame);
if (pendingFrameUnloadEvents) {
InjectedBundle::shared().stringBuilder()->append(frameToStr(frame));
@@ -732,6 +806,13 @@ void InjectedBundlePage::didFinishDocumentLoadForFrame(WKBundleFrameRef frame)
void InjectedBundlePage::didHandleOnloadEventsForFrame(WKBundleFrameRef frame)
{
+ if (!InjectedBundle::shared().isTestRunning())
+ return;
+
+ if (InjectedBundle::shared().layoutTestController()->shouldDumpFrameLoadCallbacks()) {
+ dumpFrameDescriptionSuitableForTestResult(frame);
+ InjectedBundle::shared().stringBuilder()->append(" - didHandleOnloadEventsForFrame\n");
+ }
}
void InjectedBundlePage::didDisplayInsecureContentForFrame(WKBundleFrameRef frame)
diff --git a/Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp b/Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp
index 55bf9dd08..6b265f375 100644
--- a/Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp
+++ b/Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2010 Apple Inc. All rights reserved.
+ * Copyright (C) 2010, 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
@@ -102,6 +102,7 @@ LayoutTestController::LayoutTestController()
, m_dumpTitleChanges(false)
, m_dumpPixels(true)
, m_dumpFullScreenCallbacks(false)
+ , m_dumpFrameLoadCallbacks(false)
, m_waitToDump(false)
, m_testRepaint(false)
, m_testRepaintSweepHorizontally(false)
@@ -208,12 +209,6 @@ void LayoutTestController::suspendAnimations()
WKBundleFrameSuspendAnimations(mainFrame);
}
-void LayoutTestController::resumeAnimations()
-{
- WKBundleFrameRef mainFrame = WKBundlePageGetMainFrame(InjectedBundle::shared().page()->page());
- WKBundleFrameResumeAnimations(mainFrame);
-}
-
JSRetainPtr<JSStringRef> LayoutTestController::layerTreeAsText() const
{
WKBundleFrameRef mainFrame = WKBundlePageGetMainFrame(InjectedBundle::shared().page()->page());
diff --git a/Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.h b/Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.h
index b46da215c..e581cfac4 100644
--- a/Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.h
+++ b/Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2010 Apple Inc. All rights reserved.
+ * Copyright (C) 2010, 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
@@ -72,8 +72,11 @@ public:
void dumpStatusCallbacks() { m_dumpStatusCallbacks = true; }
void dumpTitleChanges() { m_dumpTitleChanges = true; }
void dumpFullScreenCallbacks() { m_dumpFullScreenCallbacks = true; }
+ void dumpFrameLoadCallbacks() { setShouldDumpFrameLoadCallbacks(true); }
void dumpConfigurationForViewport(int deviceDPI, int deviceWidth, int deviceHeight, int availableWidth, int availableHeight);
+ void setShouldDumpFrameLoadCallbacks(bool value) { m_dumpFrameLoadCallbacks = value; }
+
// Special options.
void keepWebHistory();
void setAcceptsEditing(bool value) { m_shouldAllowEditing = value; }
@@ -111,7 +114,6 @@ public:
bool pauseAnimationAtTimeOnElementWithId(JSStringRef animationName, double time, JSStringRef elementId);
bool pauseTransitionAtTimeOnElementWithId(JSStringRef propertyName, double time, JSStringRef elementId);
void suspendAnimations();
- void resumeAnimations();
// Compositing testing.
JSRetainPtr<JSStringRef> layerTreeAsText() const;
@@ -151,6 +153,7 @@ public:
bool shouldDumpTitleChanges() const { return m_dumpTitleChanges; }
bool shouldDumpPixels() const { return m_dumpPixels; }
bool shouldDumpFullScreenCallbacks() const { return m_dumpFullScreenCallbacks; }
+ bool shouldDumpFrameLoadCallbacks() const { return m_dumpFrameLoadCallbacks; }
bool isPolicyDelegateEnabled() const { return m_policyDelegateEnabled; }
bool isPolicyDelegatePermissive() const { return m_policyDelegatePermissive; }
@@ -225,6 +228,7 @@ private:
bool m_dumpTitleChanges;
bool m_dumpPixels;
bool m_dumpFullScreenCallbacks;
+ bool m_dumpFrameLoadCallbacks;
bool m_waitToDump; // True if waitUntilDone() has been called, but notifyDone() has not yet been called.
bool m_testRepaint;
bool m_testRepaintSweepHorizontally;
diff --git a/Tools/WebKitTestRunner/TestController.cpp b/Tools/WebKitTestRunner/TestController.cpp
index b3b9396f8..219e74973 100644
--- a/Tools/WebKitTestRunner/TestController.cpp
+++ b/Tools/WebKitTestRunner/TestController.cpp
@@ -212,6 +212,7 @@ WKPageRef TestController::createOtherPage(WKPageRef oldPage, WKURLRequestRef, WK
createOtherPage,
0, // mouseDidMoveOverElement
0, // decidePolicyForNotificationPermissionRequest
+ 0, // unavailablePluginButtonClicked
};
WKPageSetPageUIClient(newPage, &otherPageUIClient);
@@ -371,6 +372,7 @@ void TestController::initialize(int argc, const char* argv[])
createOtherPage,
0, // mouseDidMoveOverElement
0, // decidePolicyForNotificationPermissionRequest
+ 0, // unavailablePluginButtonClicked
};
WKPageSetPageUIClient(m_mainWebView->page(), &pageUIClient);
@@ -406,6 +408,7 @@ void TestController::initialize(int argc, const char* argv[])
0, // didNewFirstVisuallyNonEmptyLayout
0, // willGoToBackForwardListItem
0, // interactionOccurredWhileProcessUnresponsive
+ 0, // pluginDidFail
};
WKPageSetPageLoaderClient(m_mainWebView->page(), &pageLoaderClient);
}
diff --git a/Tools/WebKitTestRunner/TestInvocation.cpp b/Tools/WebKitTestRunner/TestInvocation.cpp
index e5ad9b6d1..6106f62f2 100644
--- a/Tools/WebKitTestRunner/TestInvocation.cpp
+++ b/Tools/WebKitTestRunner/TestInvocation.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2010 Apple Inc. All rights reserved.
+ * Copyright (C) 2010, 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
@@ -127,6 +127,10 @@ static void sizeWebViewForCurrentTest(const char* pathOrURL)
else
TestController::shared().mainWebView()->resizeTo(normalWidth, normalHeight);
}
+static bool shouldLogFrameLoadDelegates(const char* pathOrURL)
+{
+ return strstr(pathOrURL, "loading/");
+}
static bool shouldOpenWebInspector(const char* pathOrURL)
{
@@ -140,6 +144,10 @@ void TestInvocation::invoke()
WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("BeginTest"));
WKRetainPtr<WKMutableDictionaryRef> beginTestMessageBody = adoptWK(WKMutableDictionaryCreate());
+ WKRetainPtr<WKStringRef> dumpFrameLoadDelegatesKey = adoptWK(WKStringCreateWithUTF8CString("DumpFrameLoadDelegates"));
+ WKRetainPtr<WKBooleanRef> dumpFrameLoadDelegatesValue = adoptWK(WKBooleanCreate(shouldLogFrameLoadDelegates(m_pathOrURL.c_str())));
+ WKDictionaryAddItem(beginTestMessageBody.get(), dumpFrameLoadDelegatesKey.get(), dumpFrameLoadDelegatesValue.get());
+
WKRetainPtr<WKStringRef> dumpPixelsKey = adoptWK(WKStringCreateWithUTF8CString("DumpPixels"));
WKRetainPtr<WKBooleanRef> dumpPixelsValue = adoptWK(WKBooleanCreate(m_dumpPixels));
WKDictionaryAddItem(beginTestMessageBody.get(), dumpPixelsKey.get(), dumpPixelsValue.get());
diff --git a/Tools/WebKitTestRunner/qt/main.cpp b/Tools/WebKitTestRunner/qt/main.cpp
index 3eb287310..d6d228091 100644
--- a/Tools/WebKitTestRunner/qt/main.cpp
+++ b/Tools/WebKitTestRunner/qt/main.cpp
@@ -30,6 +30,10 @@
#include "qquickwebview_p.h"
#include <stdio.h>
+#if !defined(NDEBUG) && defined(Q_OS_UNIX)
+#include <signal.h>
+#include <unistd.h>
+#endif
#include <QApplication>
#include <QObject>
@@ -63,6 +67,12 @@ private:
char** m_argv;
};
+#if !defined(NDEBUG) && defined(Q_OS_UNIX)
+static void sigcontHandler(int)
+{
+}
+#endif
+
void messageHandler(QtMsgType type, const char* message)
{
if (type == QtCriticalMsg) {
@@ -77,8 +87,14 @@ int main(int argc, char** argv)
{
#if !defined(NDEBUG) && defined(Q_OS_UNIX)
if (qgetenv("QT_WEBKIT_PAUSE_UI_PROCESS") == "1") {
- fprintf(stderr, "Pausing UI process, please attach to PID %d and continue... ", getpid());
+ struct sigaction newAction, oldAction;
+ newAction.sa_handler = sigcontHandler;
+ sigemptyset(&newAction.sa_mask);
+ newAction.sa_flags = 0;
+ sigaction(SIGCONT, &newAction, &oldAction);
+ fprintf(stderr, "Pausing UI process, please attach to PID %d and send signal SIGCONT... ", getpid());
pause();
+ sigaction(SIGCONT, &oldAction, 0);
fprintf(stderr, " OK\n");
}
#endif
diff --git a/Tools/efl/jhbuild.modules b/Tools/efl/jhbuild.modules
index 33bf8697f..886d84755 100644
--- a/Tools/efl/jhbuild.modules
+++ b/Tools/efl/jhbuild.modules
@@ -109,10 +109,10 @@
<dependencies>
<dep package="libffi"/>
</dependencies>
- <branch module="/pub/GNOME/sources/glib/2.31/glib-2.31.8.tar.xz" version="2.31.8"
+ <branch module="/pub/GNOME/sources/glib/2.32/glib-2.32.2.tar.xz" version="2.32.2"
repo="ftp.gnome.org"
- hash="sha256:1ce3d275189000e1c50e92efcdb6447bc260b1e5c41699b7a1959e3e1928fbaa"
- md5sum="6909664f29fae2f00cc3181c8c6a6aa7"/>
+ hash="sha256:b1764abf00bac96e0e93e29fb9715ce75f3583579acac40648e18771d43d6136"
+ md5sum="5bfdb6197afb90e4dbc7b1bb98f0eae0"/>
</autotools>
<autotools id="glib-networking">
diff --git a/Tools/gtk/common.py b/Tools/gtk/common.py
index 622f70882..220a8cf62 100644
--- a/Tools/gtk/common.py
+++ b/Tools/gtk/common.py
@@ -80,15 +80,19 @@ def build_path(*args):
return os.path.join(*(get_build_path(),) + args)
-def prefix_of_pkg_config_file(package):
- process = subprocess.Popen(['pkg-config', '--variable=prefix', package],
- stdout=subprocess.PIPE)
+def pkg_config_file_variable(package, variable):
+ process = subprocess.Popen(['pkg-config', '--variable=%s' % variable, package],
+ stdout=subprocess.PIPE)
stdout = process.communicate()[0]
- if process.returncode != 0:
+ if process.returncode:
return None
return stdout.strip()
+def prefix_of_pkg_config_file(package):
+ return pkg_config_file_variable(package, 'prefix')
+
+
def gtk_version_of_pkg_config_file(pkg_config_path):
process = subprocess.Popen(['pkg-config', pkg_config_path, '--print-requires'],
stdout=subprocess.PIPE)
diff --git a/Tools/gtk/run-api-tests b/Tools/gtk/run-api-tests
new file mode 100755
index 000000000..d9a6b4f5e
--- /dev/null
+++ b/Tools/gtk/run-api-tests
@@ -0,0 +1,353 @@
+#!/usr/bin/env python
+#
+# Copyright (C) 2011 Igalia S.L.
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library General Public
+# License as published by the Free Software Foundation; either
+# version 2 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public License
+# along with this library; see the file COPYING.LIB. If not, write to
+# the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+# Boston, MA 02110-1301, USA.
+
+import common
+import subprocess
+import os
+import sys
+import optparse
+import re
+from signal import alarm, signal, SIGALRM, SIGKILL
+from gi.repository import Gio, GLib
+
+class SkippedTest:
+ def __init__(self, test, reason, bug=None, test_cases=[]):
+ self.test = test
+ self.reason = reason
+ self.bug = bug
+ self.test_cases = test_cases
+
+ def __str__(self):
+ skipped_test_str = "%s" % self.test
+ if self.test_cases:
+ skipped_test_str += " [%s]" % ", ".join(self.test_cases)
+ skipped_test_str += ": %s " % self.reason
+ if self.bug is not None:
+ skipped_test_str += "(https://bugs.webkit.org/show_bug.cgi?id=%d)" % self.bug
+ return skipped_test_str
+
+class TestTimeout(Exception):
+ pass
+
+class TestRunner:
+
+ TEST_DIRS = [ "unittests", "WebKit2APITests", "TestWebKitAPI/WTF", "TestWebKitAPI/WebKit2" ]
+
+ SKIPPED = [
+ SkippedTest("unittests/testdownload",
+ "Test fails in GTK Linux 64-bit Release bot",
+ 82329,
+ ["/webkit/download/not-found"]),
+ SkippedTest("unittests/testwebview",
+ "Test times out in GTK Linux 64-bit Release bot",
+ 82328,
+ ["/webkit/webview/icon-uri"]),
+ SkippedTest("unittests/testwebresource",
+ "Test fails in GTK Linux 64-bit Release bot",
+ 82330,
+ ["/webkit/webresource/sub_resource_loading"]),
+ SkippedTest("unittests/testwebinspector",
+ "Test is flaky in GTK Linux 32-bit Release bot",
+ 82869,
+ ["/webkit/webinspector/close-and-inspect"]),
+ SkippedTest("WebKit2APITests/TestWebKitWebView",
+ "Test is flaky in GTK Linux 32-bit Release bot",
+ 82866,
+ ["/webkit2/WebKitWebView/mouse-target"]),
+ SkippedTest("WebKit2APITests/TestResources",
+ "Test is flaky in GTK Linux 32-bit Release bot",
+ 82868,
+ ["/webkit2/WebKitWebView/resources"]),
+ SkippedTest("TestWebKitAPI/WebKit2/TestWKConnection",
+ "Test times out",
+ 84959),
+ SkippedTest("TestWebKitAPI/WebKit2/TestRestoreSessionStateContainingFormData",
+ "Session State is not implemented in GTK+ port",
+ 84960),
+ SkippedTest("TestWebKitAPI/WebKit2/TestSpacebarScrolling",
+ "Test fails",
+ 84961),
+ SkippedTest("TestWebKitAPI/WebKit2/TestNewFirstVisuallyNonEmptyLayoutFrames",
+ "Test fails",
+ 85037),
+ SkippedTest("TestWebKitAPI/WebKit2/TestMouseMoveAfterCrash",
+ "Test is flaky",
+ 85066)
+ ]
+
+ def __init__(self, options, tests=[]):
+ self._options = options
+ self._programs_path = common.build_path("Programs")
+ self._tests = self._get_tests(tests)
+ self._skipped_tests = TestRunner.SKIPPED
+
+ # These SPI daemons need to be active for the accessibility tests to work.
+ self._spi_registryd = None
+ self._spi_bus_launcher = None
+
+ def _get_tests(self, tests):
+ if tests:
+ return tests
+
+ tests = []
+ for test_dir in self.TEST_DIRS:
+ absolute_test_dir = os.path.join(self._programs_path, test_dir)
+ if not os.path.isdir(absolute_test_dir):
+ continue
+ for test_file in os.listdir(absolute_test_dir):
+ if not test_file.lower().startswith("test"):
+ continue
+ test_path = os.path.join(self._programs_path, test_dir, test_file)
+ if os.path.isfile(test_path) and os.access(test_path, os.X_OK):
+ tests.append(test_path)
+ return tests
+
+ def _lookup_atspi2_binary(self, filename):
+ exec_prefix = common.pkg_config_file_variable('atspi-2', 'exec_prefix')
+ for path in ['libexec', 'lib/at-spi2-core', 'lib32/at-spi2-core', 'lib64/at-spi2-core']:
+ filepath = os.path.join(exec_prefix, path, filename)
+ if os.path.isfile(filepath):
+ return filepath
+
+ return None
+
+ def _start_accessibility_daemons(self):
+ spi_bus_launcher_path = self._lookup_atspi2_binary('at-spi-bus-launcher')
+ spi_registryd_path = self._lookup_atspi2_binary('at-spi2-registryd')
+ if not spi_bus_launcher_path or not spi_registryd_path:
+ return False
+
+ try:
+ self._ally_bus_launcher = subprocess.Popen([spi_bus_launcher_path], env=self._test_env)
+ except:
+ sys.stderr.write("Failed to launch the accessibility bus\n")
+ sys.stderr.flush()
+ return False
+
+ # We need to wait until the SPI bus is launched before trying to start the SPI
+ # registry, so we spin a main loop until the bus name appears on DBus.
+ loop = GLib.MainLoop()
+ Gio.bus_watch_name(Gio.BusType.SESSION, 'org.a11y.Bus', Gio.BusNameWatcherFlags.NONE,
+ lambda *args: loop.quit(), None)
+ loop.run()
+
+ try:
+ self._spi_registryd = subprocess.Popen([spi_registryd_path], env=self._test_env)
+ except:
+ sys.stderr.write("Failed to launch the accessibility registry\n")
+ sys.stderr.flush()
+ return False
+
+ return True
+
+ def _setup_testing_environment(self):
+ self._test_env = os.environ
+ self._test_env["DISPLAY"] = self._options.display
+ self._test_env["WEBKIT_INSPECTOR_PATH"] = os.path.abspath(os.path.join(self._programs_path, 'resources', 'inspector'))
+ self._test_env['GSETTINGS_BACKEND'] = 'memory'
+ self._test_env["TEST_WEBKIT_API_WEBKIT2_RESOURCES_PATH"] = common.top_level_path("Tools", "TestWebKitAPI", "Tests", "WebKit2")
+ self._test_env["TEST_WEBKIT_API_WEBKIT2_INJECTED_BUNDLE_PATH"] = common.build_path("Libraries")
+ self._test_env["WEBKIT_EXEC_PATH"] = self._programs_path
+
+ try:
+ self._xvfb = subprocess.Popen(["Xvfb", self._options.display, "-screen", "0", "800x600x24", "-nolisten", "tcp"],
+ stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+ except Exception as e:
+ sys.stderr.write("Failed to run Xvfb: %s\n", e)
+ sys.stderr.flush()
+ return False
+
+ # If we cannot start the accessibility daemons, we can just skip the accessibility tests.
+ if not self._start_accessibility_daemons():
+ print "Could not start accessibility bus, so skipping TestWebKitAccessibility"
+ self._skipped_tests.append(SkippedTest("WebKit2APITests/TestWebKitAccessibility",
+ "Could not start accessibility bus"))
+ return True
+
+ def _tear_down_testing_environment(self):
+ if self._spi_registryd:
+ self._spi_registryd.terminate()
+ if self._spi_bus_launcher:
+ self._spi_bus_launcher.terminate()
+ self._xvfb.terminate()
+
+ def _find_skipped_test(self, test):
+ for skipped in self._skipped_tests:
+ if test.endswith(skipped.test):
+ return skipped
+ return None
+
+ def _test_cases_to_skip(self, test):
+ if self._options.skipped_action != 'skip':
+ return []
+
+ skipped = self._find_skipped_test(test)
+ if skipped is not None:
+ return skipped.test_cases
+ return []
+
+ def _should_run_test(self, test):
+ # Skipped test are ignored, run all tests.
+ if self._options.skipped_action == 'ignore':
+ return True
+
+ skipped = self._find_skipped_test(test)
+ # By default skipped test are skipped, run them only when there are specific test cases failing.
+ if self._options.skipped_action == 'skip':
+ return skipped is None or skipped.test_cases
+
+ # Run only skipped tests.
+ return skipped is not None
+
+ def _get_child_pid_from_test_output(self, output):
+ if not output:
+ return -1
+ match = re.search(r'\(pid=(?P<child_pid>[0-9]+)\)', output)
+ if not match:
+ return -1
+ return int(match.group('child_pid'))
+
+ def _kill_process(self, pid):
+ try:
+ os.kill(pid, SIGKILL)
+ except OSError:
+ # Process already died.
+ pass
+
+ def _run_test_command(self, command, timeout=-1):
+ def alarm_handler(signum, frame):
+ raise TestTimeout
+
+ p = subprocess.Popen(command, stdout=subprocess.PIPE, env=self._test_env)
+ if timeout > 0:
+ signal(SIGALRM, alarm_handler)
+ alarm(timeout)
+
+ stdout = ""
+ try:
+ stdout = p.communicate()[0]
+ if timeout > 0:
+ alarm(0)
+ sys.stdout.write(stdout)
+ sys.stdout.flush()
+ except TestTimeout:
+ self._kill_process(p.pid)
+ child_pid = self._get_child_pid_from_test_output(stdout)
+ if child_pid > 0:
+ self._kill_process(child_pid)
+ raise
+
+ return not p.returncode
+
+ def _run_test_glib(self, test):
+ tester_command = ['gtester']
+ if self._options.verbose:
+ tester_command.append('--verbose')
+ for test_case in self._test_cases_to_skip(test):
+ tester_command.extend(['-s', test_case])
+ tester_command.append(test)
+
+ return self._run_test_command(tester_command, self._options.timeout)
+
+ def _run_test_google(self, test):
+ tester_command = [test, "--gtest_throw_on_failure"]
+ skipped_tests_cases = self._test_cases_to_skip(test)
+ if skipped_tests_cases:
+ tester_command.append("--gtest_filter=-%s" % ":".join(skipped_tests_cases))
+
+ return self._run_test_command(tester_command, self._options.timeout)
+
+ def _run_test(self, test):
+ if "unittests" in test or "WebKit2APITests" in test:
+ return self._run_test_glib(test)
+
+ if "TestWebKitAPI" in test:
+ return self._run_test_google(test)
+
+ return False
+
+ def run_tests(self):
+ if not self._tests:
+ sys.stderr.write("ERROR: tests not found in %s.\n" % (self._programs_path))
+ sys.stderr.flush()
+ return 1
+
+ if not self._setup_testing_environment():
+ return 1
+
+ # Remove skipped tests now instead of when we find them, because
+ # some tests might be skipped while setting up the test environment.
+ self._tests = [test for test in self._tests if self._should_run_test(test)]
+
+ failed_tests = []
+ timed_out_tests = []
+ try:
+ for test in self._tests:
+ success = True
+ try:
+ success = self._run_test(test)
+ except TestTimeout:
+ sys.stdout.write("TEST: %s: TIMEOUT\n" % test)
+ sys.stdout.flush()
+ timed_out_tests.append(test)
+
+ if not success:
+ failed_tests.append(test)
+ finally:
+ self._tear_down_testing_environment()
+
+ if failed_tests:
+ names = [test.replace(self._programs_path, '', 1) for test in failed_tests]
+ sys.stdout.write("Tests failed: %s\n" % ", ".join(names))
+ sys.stdout.flush()
+
+ if timed_out_tests:
+ names = [test.replace(self._programs_path, '', 1) for test in timed_out_tests]
+ sys.stdout.write("Tests that timed out: %s\n" % ", ".join(names))
+ sys.stdout.flush()
+
+ if self._skipped_tests and self._options.skipped_action == 'skip':
+ sys.stdout.write("Tests skipped:\n%s\n" % "\n".join([str(skipped) for skipped in self._skipped_tests]))
+ sys.stdout.flush()
+
+ return len(failed_tests)
+
+if __name__ == "__main__":
+ option_parser = optparse.OptionParser(usage='usage: %prog [options] [test...]')
+ option_parser.add_option('-r', '--release',
+ action='store_true', dest='release',
+ help='Run in Release')
+ option_parser.add_option('-d', '--debug',
+ action='store_true', dest='debug',
+ help='Run in Debug')
+ option_parser.add_option('-v', '--verbose',
+ action='store_true', dest='verbose',
+ help='Run gtester in verbose mode')
+ option_parser.add_option('--display', action='store', dest='display', default=':55',
+ help='Display to run Xvfb')
+ option_parser.add_option('--skipped', action='store', dest='skipped_action',
+ choices=['skip', 'ignore', 'only'], default='skip',
+ metavar='skip|ignore|only',
+ help='Specifies how to treat the skipped tests')
+ option_parser.add_option('-t', '--timeout',
+ action='store', type='int', dest='timeout', default=10,
+ help='Time in seconds until a test times out')
+ options, args = option_parser.parse_args()
+
+ sys.exit(TestRunner(options, args).run_tests())
diff --git a/Tools/qmake/mkspecs/features/features.prf b/Tools/qmake/mkspecs/features/features.prf
index f978b31d6..31180e0b3 100644
--- a/Tools/qmake/mkspecs/features/features.prf
+++ b/Tools/qmake/mkspecs/features/features.prf
@@ -78,9 +78,15 @@ haveQt(5) {
# Tiled Backing Store support
!contains(DEFINES, WTF_USE_TILED_BACKING_STORE=.): DEFINES += WTF_USE_TILED_BACKING_STORE=1
+# Turn on legacy viewport adaption
+!contains(DEFINES, WTF_USE_LEGACY_VIEWPORT_ADAPTION=.): DEFINES += WTF_USE_LEGACY_VIEWPORT_ADAPTION=1
+
# Nescape plugins support (NPAPI)
!contains(DEFINES, ENABLE_NETSCAPE_PLUGIN_API=.) {
- unix:haveQt(4)|win32-*:!embedded:!wince*: {
+ haveQt(5):xlibAvailable() {
+ DEFINES += ENABLE_NETSCAPE_PLUGIN_API=1
+ CONFIG += plugin_backend_xlib
+ } else: unix|win32-*:!embedded:!wince* {
DEFINES += ENABLE_NETSCAPE_PLUGIN_API=1
}
}
diff --git a/Tools/qmake/mkspecs/features/features.pri b/Tools/qmake/mkspecs/features/features.pri
index 00ad82930..becc38f82 100644
--- a/Tools/qmake/mkspecs/features/features.pri
+++ b/Tools/qmake/mkspecs/features/features.pri
@@ -14,14 +14,24 @@
FEATURE_DEFAULTS = \
ENABLE_3D_RENDERING=1 \
+ ENABLE_ACCELERATED_2D_CANVAS=0 \
ENABLE_ANIMATION_API=0 \
+ ENABLE_BATTERY_STATUS=0 \
ENABLE_BLOB=1 \
ENABLE_CHANNEL_MESSAGING=1 \
+ ENABLE_CSS_EXCLUSIONS=0 \
ENABLE_CSS_FILTERS=1 \
+ ENABLE_CSS_GRID_LAYOUT=0 \
+ ENABLE_CSS_REGIONS=0 \
+ ENABLE_CSS_SHADERS=0 \
ENABLE_DASHBOARD_SUPPORT=0 \
+ ENABLE_DATAGRID=0 \
ENABLE_DATALIST=1 \
+ ENABLE_DATA_TRANSFER_ITEMS=0 \
ENABLE_DETAILS=1 \
+ ENABLE_DEVICE_ORIENTATION=0 \
ENABLE_DIRECTORY_UPLOAD=0 \
+ ENABLE_DOWNLOAD_ATTRIBUTE=0 \
ENABLE_FAST_MOBILE_SCROLLING=1 \
ENABLE_FILE_SYSTEM=0 \
ENABLE_FILTERS=1 \
@@ -30,34 +40,55 @@ FEATURE_DEFAULTS = \
ENABLE_GAMEPAD=0 \
ENABLE_GEOLOCATION=0 \
ENABLE_GESTURE_EVENTS=1 \
+ ENABLE_HIGH_DPI_CANVAS=0 \
ENABLE_ICONDATABASE=1 \
+ ENABLE_IFRAME_SEAMLESS=1 \
+ ENABLE_INDEXED_DATABASE=0 \
ENABLE_INPUT_SPEECH=0 \
ENABLE_INPUT_TYPE_COLOR=0 \
+ ENABLE_INPUT_TYPE_DATE=0 \
+ ENABLE_INPUT_TYPE_DATETIME=0 \
+ ENABLE_INPUT_TYPE_DATETIMELOCAL=0 \
+ ENABLE_INPUT_TYPE_MONTH=0 \
+ ENABLE_INPUT_TYPE_TIME=0 \
+ ENABLE_INPUT_TYPE_WEEK=0 \
ENABLE_INSPECTOR=1 \
ENABLE_JAVASCRIPT_DEBUGGER=1 \
+ ENABLE_LEGACY_CSS_VENDOR_PREFIXES=0 \
ENABLE_LEGACY_NOTIFICATIONS=1 \
ENABLE_LEGACY_WEBKIT_BLOB_BUILDER=1 \
+ ENABLE_LINK_PREFETCH=0 \
+ ENABLE_LINK_PRERENDER=0 \
+ ENABLE_MATHML=0 \
ENABLE_MEDIA_SOURCE=0 \
ENABLE_MEDIA_STATISTICS=0 \
ENABLE_MEDIA_STREAM=0 \
ENABLE_METER_TAG=1 \
ENABLE_MHTML=0 \
ENABLE_MICRODATA=0 \
+ ENABLE_MUTATION_OBSERVERS=0 \
ENABLE_NETSCAPE_PLUGIN_API=0 \
+ ENABLE_NETWORK_INFO=0 \
ENABLE_NOTIFICATIONS=1 \
+ ENABLE_ORIENTATION_EVENTS=0 \
ENABLE_PAGE_VISIBILITY_API=1 \
ENABLE_PROGRESS_TAG=1 \
ENABLE_QUOTA=0 \
+ ENABLE_REGISTER_PROTOCOL_HANDLER=0 \
ENABLE_REQUEST_ANIMATION_FRAME=1 \
ENABLE_SCRIPTED_SPEECH=0 \
ENABLE_SHADOW_DOM=0 \
ENABLE_SHARED_WORKERS=1 \
ENABLE_SQL_DATABASE=1 \
+ ENABLE_STYLE_SCOPED=0 \
ENABLE_SVG=1 \
+ ENABLE_SVG_DOM_OBJC_BINDINGS=0 \
ENABLE_SVG_FONTS=0 \
+ ENABLE_TEXT_NOTIFICATIONS_ONLY=0 \
ENABLE_TOUCH_ADJUSTMENT=1 \
ENABLE_TOUCH_EVENTS=1 \
ENABLE_TOUCH_ICON_LOADING=0 \
+ ENABLE_VIBRATION=0 \
ENABLE_VIDEO=0 \
ENABLE_VIDEO_TRACK=0 \
ENABLE_WEBGL=0 \
@@ -65,4 +96,4 @@ FEATURE_DEFAULTS = \
ENABLE_WEB_SOCKETS=1 \
ENABLE_WEB_TIMING=1 \
ENABLE_WORKERS=1 \
- ENABLE_XSLT=0
+ ENABLE_XSLT=0 \
diff --git a/Tools/qmake/mkspecs/features/functions.prf b/Tools/qmake/mkspecs/features/functions.prf
index a0a13c27d..527e0d8fe 100644
--- a/Tools/qmake/mkspecs/features/functions.prf
+++ b/Tools/qmake/mkspecs/features/functions.prf
@@ -323,3 +323,19 @@ defineTest(runSyncQt) {
return(true)
}
+
+defineTest(xlibAvailable) {
+ haveQt(5) {
+ contains(QT_CONFIG, xcb-xlib) {
+ return(true)
+ } else {
+ return(false)
+ }
+ } else {
+ unix:!mac:!embedded {
+ return(true)
+ } else {
+ return(false)
+ }
+ }
+}
diff --git a/WebKitLibraries/ChangeLog b/WebKitLibraries/ChangeLog
index ed0fadb17..e8f058440 100644
--- a/WebKitLibraries/ChangeLog
+++ b/WebKitLibraries/ChangeLog
@@ -1,3 +1,39 @@
+2012-05-10 Anders Carlsson <andersca@apple.com>
+
+ WebKit1: Add a way to blacklist specific plug-ins/plug-in versions
+ https://bugs.webkit.org/show_bug.cgi?id=86150
+ <rdar://problem/9551196>
+
+ Reviewed by Sam Weinig.
+
+ Add WKShouldBlockPlugin.
+
+ * WebKitSystemInterface.h:
+ * libWebKitSystemInterfaceLion.a:
+ * libWebKitSystemInterfaceSnowLeopard.a:
+
+2012-05-08 Jon Lee <jonlee@apple.com>
+
+ Safari warns that it needs to resend the form in an iFrame when going back
+ https://bugs.webkit.org/show_bug.cgi?id=82658
+ <rdar://problem/11292558>
+
+ Reviewed by Darin Adler.
+
+ * WebKitSystemInterface.h:
+ * libWebKitSystemInterfaceLeopard.a:
+ * libWebKitSystemInterfaceLion.a:
+ * libWebKitSystemInterfaceSnowLeopard.a:
+
+2012-05-07 Eric Seidel <eric@webkit.org>
+
+ Add ENABLE_IFRAME_SEAMLESS so Apple can turn off SEAMLESS if needed
+ https://bugs.webkit.org/show_bug.cgi?id=85822
+
+ Reviewed by Adam Barth.
+
+ * win/tools/vsprops/FeatureDefines.vsprops:
+
2012-05-06 Eric Seidel <eric@webkit.org>
Remove 3D_CANVAS define from vsprops files (it was renamed WEBGL many months ago)
diff --git a/WebKitLibraries/WebKitSystemInterface.h b/WebKitLibraries/WebKitSystemInterface.h
index a67c8749f..0351a8e0b 100644
--- a/WebKitLibraries/WebKitSystemInterface.h
+++ b/WebKitLibraries/WebKitSystemInterface.h
@@ -92,6 +92,7 @@ void WKAccessibilityHandleFocusChanged(void);
AXUIElementRef WKCreateAXUIElementRef(id element);
void WKUnregisterUniqueIdForElement(id element);
+BOOL WKShouldBlockPlugin(NSString *bundleIdentifier, NSString *bundleVersionString);
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
// Remote Accessibility API.
@@ -488,6 +489,21 @@ bool WKExecutableWasLinkedOnOrBeforeLion(void);
void WKCGPathAddRoundedRect(CGMutablePathRef path, const CGAffineTransform* matrix, CGRect rect, CGFloat cornerWidth, CGFloat cornerHeight);
#endif
+#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
+void WKCFURLRequestAllowAllPostCaching(CFURLRequestRef);
+#endif
+
+#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
+@class WebFilterEvaluator;
+
+BOOL WKFilterIsManagedSession(void);
+WebFilterEvaluator *WKFilterCreateInstance(NSURLResponse *);
+void WKFilterRelease(WebFilterEvaluator *);
+BOOL WKFilterWasBlocked(WebFilterEvaluator *);
+const char* WKFilterAddData(WebFilterEvaluator *, const char* data, int* length);
+const char* WKFilterDataComplete(WebFilterEvaluator *, int* length);
+#endif
+
#ifdef __cplusplus
}
#endif
diff --git a/WebKitLibraries/libWebKitSystemInterfaceLeopard.a b/WebKitLibraries/libWebKitSystemInterfaceLeopard.a
index 868149cfd..33116d844 100644
--- a/WebKitLibraries/libWebKitSystemInterfaceLeopard.a
+++ b/WebKitLibraries/libWebKitSystemInterfaceLeopard.a
Binary files differ
diff --git a/WebKitLibraries/libWebKitSystemInterfaceLion.a b/WebKitLibraries/libWebKitSystemInterfaceLion.a
index add5b2fc7..0252234a9 100644
--- a/WebKitLibraries/libWebKitSystemInterfaceLion.a
+++ b/WebKitLibraries/libWebKitSystemInterfaceLion.a
Binary files differ
diff --git a/WebKitLibraries/libWebKitSystemInterfaceSnowLeopard.a b/WebKitLibraries/libWebKitSystemInterfaceSnowLeopard.a
index bf3fae34b..c59fc9889 100644
--- a/WebKitLibraries/libWebKitSystemInterfaceSnowLeopard.a
+++ b/WebKitLibraries/libWebKitSystemInterfaceSnowLeopard.a
Binary files differ
diff --git a/WebKitLibraries/win/tools/vsprops/FeatureDefines.vsprops b/WebKitLibraries/win/tools/vsprops/FeatureDefines.vsprops
index 342adff1e..5b3ac61eb 100644
--- a/WebKitLibraries/win/tools/vsprops/FeatureDefines.vsprops
+++ b/WebKitLibraries/win/tools/vsprops/FeatureDefines.vsprops
@@ -122,6 +122,11 @@
PerformEnvironmentSet="true"
/>
<UserMacro
+ Name="ENABLE_IFRAME_SEAMLESS"
+ Value="ENABLE_IFRAME_SEAMLESS"
+ PerformEnvironmentSet="true"
+ />
+ <UserMacro
Name="ENABLE_INDEXED_DATABASE"
Value=""
PerformEnvironmentSet="true"
diff --git a/configure.ac b/configure.ac
index 75332818e..32024bd64 100644
--- a/configure.ac
+++ b/configure.ac
@@ -38,6 +38,12 @@ dnl # see http://www.gnu.org/software/libtool/manual/html_node/Libtool-versionin
LIBWEBKITGTK_VERSION=13:1:13
AC_SUBST([LIBWEBKITGTK_VERSION])
+LIBJAVASCRIPTCOREGTK_VERSION=13:1:13
+AC_SUBST([LIBJAVASCRIPTCOREGTK_VERSION])
+
+LIBWEBKIT2GTK_VERSION=13:1:13
+AC_SUBST([LIBWEBKIT2GTK_VERSION])
+
AM_INIT_AUTOMAKE([foreign subdir-objects dist-xz no-dist-gzip tar-ustar])
# Use AM_SILENT_RULES if present
@@ -728,6 +734,14 @@ AC_ARG_ENABLE(sandbox,
[],[enable_sandbox="yes"])
AC_MSG_RESULT([$enable_sandbox])
+# check whether to enable HTML5 iframe seamless attribute support
+AC_MSG_CHECKING([whether to enable HTML5 iframe seamless attribute support])
+AC_ARG_ENABLE(iframe-seamless,
+ AC_HELP_STRING([--enable-iframe-seamless],
+ [enable HTML5 iframe seamless attribute support [default=yes]]),
+ [],[enable_iframe_seamless="yes"])
+AC_MSG_RESULT([$enable_sandbox])
+
# check whether to enable HTML5 audio/video support
AC_MSG_CHECKING([whether to enable HTML5 video support])
AC_ARG_ENABLE(video,
@@ -1390,6 +1404,7 @@ AM_CONDITIONAL([ENABLE_TOUCH_ICON_LOADING],[test "$enable_touch_icon_loading" =
AM_CONDITIONAL([ENABLE_REGISTER_PROTOCOL_HANDLER],[test "$enable_register_protocol_handler" = "yes"])
AM_CONDITIONAL([ENABLE_DEVICE_ORIENTATION],[test "$enable_device_orientation" = "yes"])
AM_CONDITIONAL([ENABLE_MUTATION_OBSERVERS],[test "$enable_mutation_observers" = "yes"])
+AM_CONDITIONAL([ENABLE_IFRAME_SEAMLESS],[test "$enable_iframe_seamless" = "yes"])
# Gtk conditionals
AM_CONDITIONAL([ENABLE_INTROSPECTION],[test "$enable_introspection" = "yes"])
@@ -1465,6 +1480,7 @@ Features:
HTML5 FileSystem API support : $enable_file_system
Quota API support : $enable_quota
HTML5 sandboxed iframe support : $enable_sandbox
+ HTML5 iframe seamless attribute support : $enable_iframe_seamless
HTML5 video element support : $enable_video
HTML5 track element support : $enable_video_track
Fullscreen API support : $enable_fullscreen_api