summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKristian Monsen <kristianm@google.com>2010-09-30 15:42:16 +0100
committerSteve Block <steveblock@google.com>2010-10-07 10:59:29 +0100
commitbec39347bb3bb5bf1187ccaf471d26247f28b585 (patch)
tree56bdc4c2978fbfd3d79d0d36d5d6c640ecc09cc8
parent90b7966e7815b262cd19ac25f03aaad9b21fdc06 (diff)
downloadexternal_webkit-bec39347bb3bb5bf1187ccaf471d26247f28b585.zip
external_webkit-bec39347bb3bb5bf1187ccaf471d26247f28b585.tar.gz
external_webkit-bec39347bb3bb5bf1187ccaf471d26247f28b585.tar.bz2
Merge WebKit at r68651 : Initial merge by git.
Change-Id: I3d6bff59f17eedd6722723354f386fec9be8ad12
-rw-r--r--JavaScriptCore/API/JSStringRef.h2
-rw-r--r--JavaScriptCore/ChangeLog800
-rw-r--r--JavaScriptCore/Configurations/Version.xcconfig2
-rw-r--r--JavaScriptCore/GNUmakefile.am15
-rw-r--r--JavaScriptCore/JavaScriptCore.exp2
-rw-r--r--JavaScriptCore/JavaScriptCore.pri3
-rw-r--r--JavaScriptCore/JavaScriptCore.vcproj/jsc/jscCommon.vsprops2
-rw-r--r--JavaScriptCore/bytecode/CodeBlock.cpp31
-rw-r--r--JavaScriptCore/bytecode/CodeBlock.h1
-rw-r--r--JavaScriptCore/bytecode/Opcode.cpp7
-rw-r--r--JavaScriptCore/bytecode/Opcode.h6
-rw-r--r--JavaScriptCore/bytecompiler/BytecodeGenerator.cpp116
-rw-r--r--JavaScriptCore/bytecompiler/BytecodeGenerator.h15
-rw-r--r--JavaScriptCore/bytecompiler/NodesCodegen.cpp17
-rwxr-xr-xJavaScriptCore/docs/make-bytecode-docs.pl1
-rw-r--r--JavaScriptCore/interpreter/Interpreter.cpp100
-rw-r--r--JavaScriptCore/jit/JIT.cpp7
-rw-r--r--JavaScriptCore/jit/JIT.h7
-rw-r--r--JavaScriptCore/jit/JITCall32_64.cpp12
-rw-r--r--JavaScriptCore/jit/JITOpcodes.cpp192
-rw-r--r--JavaScriptCore/jit/JITOpcodes32_64.cpp100
-rw-r--r--JavaScriptCore/jit/JITStubs.cpp35
-rw-r--r--JavaScriptCore/jit/JITStubs.h7
-rw-r--r--JavaScriptCore/jsc.pro4
-rw-r--r--JavaScriptCore/os-win32/inttypes.h261
-rw-r--r--JavaScriptCore/parser/JSParser.cpp27
-rw-r--r--JavaScriptCore/parser/Nodes.h3
-rw-r--r--JavaScriptCore/qt/ChangeLog36
-rw-r--r--JavaScriptCore/qt/api/qscriptengine.cpp23
-rw-r--r--JavaScriptCore/qt/api/qscriptengine.h5
-rw-r--r--JavaScriptCore/qt/api/qscriptengine_p.cpp14
-rw-r--r--JavaScriptCore/qt/api/qscriptengine_p.h8
-rw-r--r--JavaScriptCore/qt/api/qscriptoriginalglobalobject_p.h11
-rw-r--r--JavaScriptCore/qt/api/qscriptvalue.cpp23
-rw-r--r--JavaScriptCore/qt/api/qscriptvalue.h3
-rw-r--r--JavaScriptCore/qt/api/qscriptvalue_p.h35
-rw-r--r--JavaScriptCore/qt/tests/qscriptengine/tst_qscriptengine.cpp49
-rw-r--r--JavaScriptCore/runtime/Arguments.h2
-rw-r--r--JavaScriptCore/runtime/DateConstructor.cpp74
-rw-r--r--JavaScriptCore/runtime/Executable.cpp8
-rw-r--r--JavaScriptCore/runtime/Executable.h6
-rw-r--r--JavaScriptCore/runtime/JSActivation.cpp55
-rw-r--r--JavaScriptCore/runtime/JSActivation.h9
-rw-r--r--JavaScriptCore/runtime/JSArray.cpp18
-rw-r--r--JavaScriptCore/runtime/JSCell.h19
-rw-r--r--JavaScriptCore/runtime/MathObject.cpp4
-rw-r--r--JavaScriptCore/runtime/RegExp.cpp11
-rw-r--r--JavaScriptCore/wtf/Assertions.cpp7
-rw-r--r--JavaScriptCore/wtf/Noncopyable.h29
-rw-r--r--JavaScriptCore/wtf/PassRefPtr.h4
-rw-r--r--JavaScriptCore/wtf/Platform.h6
-rw-r--r--JavaScriptCore/wtf/RefCounted.h4
-rw-r--r--JavaScriptCore/wtf/StringHashFunctions.h227
-rw-r--r--JavaScriptCore/wtf/ThreadingPthreads.cpp8
-rw-r--r--JavaScriptCore/wtf/gobject/GOwnPtr.cpp4
-rw-r--r--JavaScriptCore/wtf/gobject/GOwnPtr.h5
-rw-r--r--JavaScriptCore/wtf/gobject/GRefPtr.cpp4
-rw-r--r--JavaScriptCore/wtf/gobject/GRefPtr.h4
-rw-r--r--JavaScriptCore/wtf/text/AtomicString.cpp5
-rw-r--r--JavaScriptCore/wtf/text/AtomicString.h4
-rw-r--r--JavaScriptCore/wtf/text/StringImpl.h6
-rw-r--r--JavaScriptCore/wtf/unicode/UTF8.cpp2
-rw-r--r--JavaScriptCore/wtf/unicode/qt4/UnicodeQt4.h2
-rw-r--r--JavaScriptCore/yarr/RegexInterpreter.cpp19
-rw-r--r--JavaScriptCore/yarr/RegexInterpreter.h11
-rw-r--r--JavaScriptCore/yarr/RegexJIT.cpp111
-rw-r--r--JavaScriptGlue/Configurations/Version.xcconfig2
-rw-r--r--LayoutTests/fast/dom/Attr/change-id-via-attr-node-value-expected.txt170
-rw-r--r--LayoutTests/fast/dom/Attr/change-id-via-attr-node-value.html223
-rw-r--r--LayoutTests/fast/dom/DeviceMotion/create-event-expected.txt18
-rw-r--r--LayoutTests/fast/dom/DeviceMotion/optional-event-properties-expected.txt130
-rw-r--r--LayoutTests/fast/dom/DeviceMotion/script-tests/create-event.js18
-rw-r--r--LayoutTests/fast/dom/DeviceMotion/script-tests/optional-event-properties.js148
-rw-r--r--LayoutTests/fast/encoding/charset-xuser-defined-expected.txt4
-rw-r--r--LayoutTests/fast/events/touch/basic-multi-touch-events-limited-expected.txt97
-rw-r--r--LayoutTests/fast/events/touch/basic-multi-touch-events-limited.html19
-rw-r--r--LayoutTests/fast/events/touch/script-tests/basic-multi-touch-events-limited.js108
-rw-r--r--LayoutTests/fast/events/touch/script-tests/touch-target-limited.js103
-rw-r--r--LayoutTests/fast/events/touch/touch-target-limited-expected.txt25
-rw-r--r--LayoutTests/fast/events/touch/touch-target-limited.html19
-rw-r--r--LayoutTests/storage/indexeddb/basics-expected.txt2
-rw-r--r--LayoutTests/storage/indexeddb/database-basics-expected.txt9
-rw-r--r--LayoutTests/storage/indexeddb/index-basics-expected.txt30
-rw-r--r--LayoutTests/storage/indexeddb/index-cursor-expected.txt22
-rw-r--r--LayoutTests/storage/indexeddb/objectstore-basics-expected.txt28
-rw-r--r--LayoutTests/storage/indexeddb/objectstore-basics.html28
-rw-r--r--LayoutTests/storage/indexeddb/objectstore-cursor-expected.txt18
-rw-r--r--LayoutTests/storage/indexeddb/objectstore-removeobjectstore-expected.txt24
-rw-r--r--LayoutTests/storage/indexeddb/objectstore-removeobjectstore.html22
-rw-r--r--LayoutTests/storage/indexeddb/open-cursor-expected.txt10
-rw-r--r--LayoutTests/storage/indexeddb/resources/shared.js2
-rw-r--r--LayoutTests/storage/indexeddb/transaction-basics-expected.txt5
-rw-r--r--WebCore/Android.derived.jscbindings.mk1
-rw-r--r--WebCore/Android.derived.v8bindings.mk6
-rw-r--r--WebCore/Android.jscbindings.mk4
-rw-r--r--WebCore/Android.mk61
-rw-r--r--WebCore/CMakeLists.txt70
-rw-r--r--WebCore/CMakeListsEfl.txt1
-rw-r--r--WebCore/ChangeLog6935
-rw-r--r--WebCore/Configurations/Version.xcconfig2
-rw-r--r--WebCore/DerivedSources.cpp1
-rw-r--r--WebCore/DerivedSources.make1
-rw-r--r--WebCore/English.lproj/localizedStrings.jsbin47620 -> 48630 bytes
-rw-r--r--WebCore/GNUmakefile.am150
-rw-r--r--WebCore/WebCore.exp.in18
-rw-r--r--WebCore/WebCore.gyp/WebCore.gyp33
-rw-r--r--WebCore/WebCore.gypi125
-rw-r--r--WebCore/WebCore.pri7
-rw-r--r--WebCore/WebCore.pro96
-rw-r--r--WebCore/WebCore.vcproj/WebCore.vcproj658
-rw-r--r--WebCore/WebCore.xcodeproj/project.pbxproj482
-rw-r--r--WebCore/accessibility/AXObjectCache.cpp19
-rw-r--r--WebCore/accessibility/AXObjectCache.h22
-rw-r--r--WebCore/accessibility/AccessibilityRenderObject.h17
-rw-r--r--WebCore/accessibility/chromium/AXObjectCacheChromium.cpp52
-rw-r--r--WebCore/accessibility/gtk/AXObjectCacheAtk.cpp37
-rw-r--r--WebCore/accessibility/gtk/AccessibilityObjectAtk.cpp6
-rw-r--r--WebCore/accessibility/gtk/AccessibilityObjectWrapperAtk.cpp75
-rw-r--r--WebCore/accessibility/mac/AXObjectCacheMac.mm8
-rw-r--r--WebCore/accessibility/mac/AccessibilityObjectWrapper.mm259
-rw-r--r--WebCore/accessibility/win/AXObjectCacheWin.cpp4
-rw-r--r--WebCore/bindings/generic/RuntimeEnabledFeatures.cpp9
-rw-r--r--WebCore/bindings/generic/RuntimeEnabledFeatures.h4
-rw-r--r--WebCore/bindings/gobject/GNUmakefile.am3
-rw-r--r--WebCore/bindings/js/JSClipboardCustom.cpp2
-rw-r--r--WebCore/bindings/js/JSDeviceMotionEventCustom.cpp159
-rw-r--r--WebCore/bindings/js/JSDirectoryEntryCustom.cpp4
-rw-r--r--WebCore/bindings/js/JSElementCustom.cpp1
-rw-r--r--WebCore/bindings/js/JSInspectorFrontendHostCustom.cpp2
-rw-r--r--WebCore/bindings/js/ScriptFunctionCall.cpp72
-rw-r--r--WebCore/bindings/js/ScriptFunctionCall.h35
-rw-r--r--WebCore/bindings/objc/ObjCEventListener.h19
-rw-r--r--WebCore/bindings/objc/ObjCEventListener.mm16
-rw-r--r--WebCore/bindings/scripts/CodeGeneratorJS.pm2
-rw-r--r--WebCore/bindings/scripts/CodeGeneratorV8.pm1
-rw-r--r--WebCore/bindings/v8/NPV8Object.cpp10
-rw-r--r--WebCore/bindings/v8/ScriptController.cpp4
-rw-r--r--WebCore/bindings/v8/ScriptController.h4
-rw-r--r--WebCore/bindings/v8/ScriptFunctionCall.cpp72
-rw-r--r--WebCore/bindings/v8/ScriptFunctionCall.h27
-rw-r--r--WebCore/bindings/v8/V8DOMWindowShell.cpp17
-rw-r--r--WebCore/bindings/v8/V8Proxy.cpp17
-rw-r--r--WebCore/bindings/v8/V8Proxy.h6
-rw-r--r--WebCore/bindings/v8/custom/V8ClipboardCustom.cpp2
-rw-r--r--WebCore/bindings/v8/custom/V8CustomVoidCallback.cpp10
-rw-r--r--WebCore/bindings/v8/custom/V8DOMStringMapCustom.cpp8
-rw-r--r--WebCore/bindings/v8/custom/V8DOMTokenListCustom.cpp56
-rw-r--r--WebCore/bindings/v8/custom/V8DeviceMotionEventCustom.cpp146
-rw-r--r--WebCore/bindings/v8/custom/V8DeviceOrientationEventCustom.cpp6
-rw-r--r--WebCore/bindings/v8/custom/V8DirectoryEntryCustom.cpp4
-rw-r--r--WebCore/bindings/v8/custom/V8InspectorFrontendHostCustom.cpp2
-rw-r--r--WebCore/bindings/v8/custom/V8XMLHttpRequestCustom.cpp3
-rw-r--r--WebCore/bridge/npapi.h8
-rw-r--r--WebCore/bridge/objc/objc_instance.mm12
-rw-r--r--WebCore/css/CSSComputedStyleDeclaration.cpp12
-rw-r--r--WebCore/css/CSSPageRule.idl3
-rw-r--r--WebCore/css/CSSParser.cpp10
-rw-r--r--WebCore/css/CSSPrimitiveValueMappings.h2
-rw-r--r--WebCore/css/CSSPropertyLonghand.cpp2
-rw-r--r--WebCore/css/CSSPropertyNames.in4
-rw-r--r--WebCore/css/CSSStyleRule.cpp33
-rw-r--r--WebCore/css/CSSStyleRule.h2
-rw-r--r--WebCore/css/CSSStyleRule.idl3
-rw-r--r--WebCore/css/CSSStyleSelector.cpp39
-rw-r--r--WebCore/css/CSSStyleSelector.h2
-rw-r--r--WebCore/css/CSSValueKeywords.in2
-rw-r--r--WebCore/css/SVGCSSStyleSelector.cpp34
-rw-r--r--WebCore/css/html.css7
-rw-r--r--WebCore/css/makeprop.pl48
-rw-r--r--WebCore/css/makevalues.pl50
-rw-r--r--WebCore/css/themeQtMobile.css (renamed from WebCore/css/themeQtMaemo5.css)33
-rw-r--r--WebCore/dom/Attr.cpp15
-rw-r--r--WebCore/dom/Attr.h1
-rw-r--r--WebCore/dom/CharacterData.cpp4
-rw-r--r--WebCore/dom/Clipboard.cpp8
-rw-r--r--WebCore/dom/Clipboard.h13
-rw-r--r--WebCore/dom/ContainerNode.cpp14
-rw-r--r--WebCore/dom/DeviceMotionClient.h1
-rw-r--r--WebCore/dom/DeviceMotionController.cpp5
-rw-r--r--WebCore/dom/DeviceMotionController.h1
-rw-r--r--WebCore/dom/DeviceMotionData.cpp84
-rw-r--r--WebCore/dom/DeviceMotionData.h103
-rw-r--r--WebCore/dom/DeviceMotionEvent.idl11
-rw-r--r--WebCore/dom/DeviceOrientationClient.h1
-rw-r--r--WebCore/dom/DeviceOrientationController.cpp5
-rw-r--r--WebCore/dom/DeviceOrientationController.h1
-rw-r--r--WebCore/dom/Document.cpp89
-rw-r--r--WebCore/dom/Document.h13
-rw-r--r--WebCore/dom/Document.idl5
-rw-r--r--WebCore/dom/DocumentMarker.h1
-rw-r--r--WebCore/dom/Element.cpp28
-rw-r--r--WebCore/dom/Element.h4
-rw-r--r--WebCore/dom/ElementRareData.h2
-rw-r--r--WebCore/dom/Node.cpp7
-rw-r--r--WebCore/dom/NodeIterator.cpp12
-rw-r--r--WebCore/dom/QualifiedName.h42
-rw-r--r--WebCore/dom/Range.h3
-rw-r--r--WebCore/dom/SelectElement.cpp2
-rw-r--r--WebCore/dom/SpaceSplitString.h1
-rw-r--r--WebCore/dom/StyledElement.cpp11
-rw-r--r--WebCore/dom/StyledElement.h1
-rw-r--r--WebCore/editing/AppendNodeCommand.cpp19
-rw-r--r--WebCore/editing/ApplyStyleCommand.cpp150
-rw-r--r--WebCore/editing/ApplyStyleCommand.h12
-rw-r--r--WebCore/editing/DeleteFromTextNodeCommand.cpp8
-rw-r--r--WebCore/editing/DeleteSelectionCommand.cpp13
-rw-r--r--WebCore/editing/EditingBehavior.h4
-rw-r--r--WebCore/editing/Editor.cpp106
-rw-r--r--WebCore/editing/Editor.h3
-rw-r--r--WebCore/editing/EditorCommand.cpp77
-rw-r--r--WebCore/editing/FormatBlockCommand.cpp60
-rw-r--r--WebCore/editing/FormatBlockCommand.h2
-rw-r--r--WebCore/editing/InsertIntoTextNodeCommand.cpp8
-rw-r--r--WebCore/editing/InsertNodeBeforeCommand.cpp8
-rw-r--r--WebCore/editing/SelectionController.cpp17
-rw-r--r--WebCore/editing/SelectionController.h4
-rw-r--r--WebCore/editing/TextIterator.cpp25
-rw-r--r--WebCore/editing/TypingCommand.cpp12
-rw-r--r--WebCore/editing/TypingCommand.h4
-rw-r--r--WebCore/editing/android/EditorAndroid.cpp2
-rw-r--r--WebCore/editing/brew/EditorBrew.cpp2
-rw-r--r--WebCore/editing/chromium/EditorChromium.cpp2
-rw-r--r--WebCore/editing/chromium/SelectionControllerChromium.cpp48
-rw-r--r--WebCore/editing/haiku/EditorHaiku.cpp2
-rw-r--r--WebCore/editing/mac/EditorMac.mm2
-rw-r--r--WebCore/editing/markup.cpp5
-rw-r--r--WebCore/editing/visible_units.cpp13
-rw-r--r--WebCore/editing/wx/EditorWx.cpp2
-rw-r--r--WebCore/features.pri14
-rw-r--r--WebCore/fileapi/AsyncFileWriter.h3
-rw-r--r--WebCore/fileapi/AsyncFileWriterClient.h (renamed from WebCore/fileapi/FileWriterClient.h)12
-rw-r--r--WebCore/fileapi/DOMFileSystem.cpp31
-rw-r--r--WebCore/fileapi/DOMFileSystem.h3
-rw-r--r--WebCore/fileapi/DOMFileSystem.idl3
-rw-r--r--WebCore/fileapi/DirectoryEntry.idl3
-rw-r--r--WebCore/fileapi/DirectoryReader.idl3
-rw-r--r--WebCore/fileapi/Entry.idl3
-rw-r--r--WebCore/fileapi/EntryArray.idl1
-rw-r--r--WebCore/fileapi/FileEntry.idl3
-rw-r--r--WebCore/fileapi/FileSystemCallbacks.cpp56
-rw-r--r--WebCore/fileapi/FileSystemCallbacks.h32
-rw-r--r--WebCore/fileapi/FileWriter.cpp36
-rw-r--r--WebCore/fileapi/FileWriter.h9
-rw-r--r--WebCore/fileapi/Flags.idl3
-rw-r--r--WebCore/fileapi/LocalFileSystem.cpp36
-rw-r--r--WebCore/fileapi/LocalFileSystem.h36
-rw-r--r--WebCore/fileapi/Metadata.idl3
-rw-r--r--WebCore/html/BaseTextInputType.cpp52
-rw-r--r--WebCore/html/BaseTextInputType.h49
-rw-r--r--WebCore/html/ButtonInputType.cpp (renamed from WebKit/chromium/src/GLES2ContextInternal.h)31
-rw-r--r--WebCore/html/ButtonInputType.h49
-rw-r--r--WebCore/html/CheckboxInputType.cpp48
-rw-r--r--WebCore/html/CheckboxInputType.h49
-rw-r--r--WebCore/html/ColorInputType.cpp48
-rw-r--r--WebCore/html/ColorInputType.h49
-rw-r--r--WebCore/html/DOMTokenList.cpp206
-rw-r--r--WebCore/html/DOMTokenList.h74
-rw-r--r--WebCore/html/DOMTokenList.idl43
-rw-r--r--WebCore/html/DateInputType.cpp (renamed from WebKit/chromium/src/GLES2ContextInternal.cpp)16
-rw-r--r--WebCore/html/DateInputType.h49
-rw-r--r--WebCore/html/DateTimeInputType.cpp48
-rw-r--r--WebCore/html/DateTimeInputType.h49
-rw-r--r--WebCore/html/DateTimeLocalInputType.cpp48
-rw-r--r--WebCore/html/DateTimeLocalInputType.h49
-rw-r--r--WebCore/html/DocTypeStrings.gperf19
-rw-r--r--WebCore/html/EmailInputType.cpp48
-rw-r--r--WebCore/html/EmailInputType.h49
-rw-r--r--WebCore/html/FileInputType.cpp48
-rw-r--r--WebCore/html/FileInputType.h49
-rw-r--r--WebCore/html/HTMLAnchorElement.cpp18
-rw-r--r--WebCore/html/HTMLAnchorElement.h4
-rw-r--r--WebCore/html/HTMLAnchorElement.idl2
-rw-r--r--WebCore/html/HTMLAttributeNames.in3
-rw-r--r--WebCore/html/HTMLCanvasElement.cpp2
-rw-r--r--WebCore/html/HTMLCanvasElement.h8
-rw-r--r--WebCore/html/HTMLDocument.cpp3
-rw-r--r--WebCore/html/HTMLElement.idl1
-rw-r--r--WebCore/html/HTMLImageElement.cpp2
-rw-r--r--WebCore/html/HTMLInputElement.cpp162
-rw-r--r--WebCore/html/HTMLInputElement.h5
-rw-r--r--WebCore/html/HTMLInputElement.idl2
-rw-r--r--WebCore/html/HTMLMediaElement.cpp60
-rw-r--r--WebCore/html/HTMLTextAreaElement.cpp12
-rw-r--r--WebCore/html/HTMLTextAreaElement.h1
-rw-r--r--WebCore/html/HiddenInputType.cpp47
-rw-r--r--WebCore/html/HiddenInputType.h49
-rw-r--r--WebCore/html/ImageInputType.cpp48
-rw-r--r--WebCore/html/ImageInputType.h49
-rw-r--r--WebCore/html/InputType.cpp277
-rw-r--r--WebCore/html/InputType.h (renamed from WebCore/platform/chromium/GLES2Context.h)69
-rw-r--r--WebCore/html/IsIndexInputType.cpp48
-rw-r--r--WebCore/html/IsIndexInputType.h50
-rw-r--r--WebCore/html/MonthInputType.cpp48
-rw-r--r--WebCore/html/MonthInputType.h49
-rw-r--r--WebCore/html/NumberInputType.cpp48
-rw-r--r--WebCore/html/NumberInputType.h49
-rw-r--r--WebCore/html/PasswordInputType.cpp48
-rw-r--r--WebCore/html/PasswordInputType.h49
-rw-r--r--WebCore/html/RadioInputType.cpp48
-rw-r--r--WebCore/html/RadioInputType.h49
-rw-r--r--WebCore/html/RangeInputType.cpp48
-rw-r--r--WebCore/html/RangeInputType.h49
-rw-r--r--WebCore/html/ResetInputType.cpp48
-rw-r--r--WebCore/html/ResetInputType.h49
-rw-r--r--WebCore/html/SearchInputType.cpp48
-rw-r--r--WebCore/html/SearchInputType.h49
-rw-r--r--WebCore/html/SubmitInputType.cpp48
-rw-r--r--WebCore/html/SubmitInputType.h49
-rw-r--r--WebCore/html/TelephoneInputType.cpp48
-rw-r--r--WebCore/html/TelephoneInputType.h49
-rw-r--r--WebCore/html/TextFieldInputType.cpp (renamed from WebKit/chromium/public/gtk/WebScreenInfoFactory.h)26
-rw-r--r--WebCore/html/TextFieldInputType.h48
-rw-r--r--WebCore/html/TextInputType.cpp48
-rw-r--r--WebCore/html/TextInputType.h49
-rw-r--r--WebCore/html/TimeInputType.cpp48
-rw-r--r--WebCore/html/TimeInputType.h49
-rw-r--r--WebCore/html/URLInputType.cpp48
-rw-r--r--WebCore/html/URLInputType.h49
-rw-r--r--WebCore/html/WeekInputType.cpp48
-rw-r--r--WebCore/html/WeekInputType.h49
-rw-r--r--WebCore/html/canvas/CanvasRenderingContext.cpp51
-rw-r--r--WebCore/html/canvas/CanvasRenderingContext.h60
-rw-r--r--WebCore/html/canvas/CanvasRenderingContext2D.cpp70
-rw-r--r--WebCore/html/canvas/CanvasRenderingContext2D.h7
-rw-r--r--WebCore/html/canvas/WebGLBuffer.cpp3
-rw-r--r--WebCore/html/canvas/WebGLFramebuffer.cpp52
-rw-r--r--WebCore/html/canvas/WebGLFramebuffer.h12
-rw-r--r--WebCore/html/canvas/WebGLObject.cpp6
-rw-r--r--WebCore/html/canvas/WebGLObject.h12
-rw-r--r--WebCore/html/canvas/WebGLProgram.cpp13
-rw-r--r--WebCore/html/canvas/WebGLRenderbuffer.cpp3
-rw-r--r--WebCore/html/canvas/WebGLRenderingContext.cpp85
-rw-r--r--WebCore/html/canvas/WebGLRenderingContext.h3
-rw-r--r--WebCore/html/canvas/WebGLRenderingContext.idl3
-rw-r--r--WebCore/html/canvas/WebGLShader.cpp3
-rw-r--r--WebCore/html/canvas/WebGLTexture.cpp4
-rw-r--r--WebCore/html/parser/HTMLDocumentParser.cpp4
-rw-r--r--WebCore/html/parser/HTMLTreeBuilder.cpp15
-rw-r--r--WebCore/html/parser/HTMLTreeBuilder.h14
-rw-r--r--WebCore/inspector/Inspector.idl13
-rw-r--r--WebCore/inspector/InspectorController.cpp108
-rw-r--r--WebCore/inspector/InspectorController.h71
-rw-r--r--WebCore/inspector/InspectorDOMAgent.cpp9
-rw-r--r--WebCore/inspector/InspectorDOMAgent.h2
-rw-r--r--WebCore/inspector/InspectorDebuggerAgent.cpp29
-rw-r--r--WebCore/inspector/InspectorDebuggerAgent.h13
-rw-r--r--WebCore/inspector/front-end/AbstractTimelinePanel.js527
-rw-r--r--WebCore/inspector/front-end/AuditLauncherView.js3
-rw-r--r--WebCore/inspector/front-end/BreakpointManager.js106
-rw-r--r--WebCore/inspector/front-end/BreakpointsSidebarPane.js73
-rw-r--r--WebCore/inspector/front-end/CallStackSidebarPane.js60
-rw-r--r--WebCore/inspector/front-end/DOMAgent.js29
-rw-r--r--WebCore/inspector/front-end/DataGrid.js50
-rw-r--r--WebCore/inspector/front-end/ElementsPanel.js49
-rw-r--r--WebCore/inspector/front-end/ElementsTreeOutline.js11
-rw-r--r--WebCore/inspector/front-end/GoToLineDialog.js127
-rw-r--r--WebCore/inspector/front-end/Images/networkIcon.pngbin0 -> 6431 bytes
-rw-r--r--WebCore/inspector/front-end/Images/paneAddButtons.pngbin0 -> 929 bytes
-rw-r--r--WebCore/inspector/front-end/NetworkPanel.js1414
-rw-r--r--WebCore/inspector/front-end/ResourceCategory.js11
-rw-r--r--WebCore/inspector/front-end/ResourcesPanel.js455
-rw-r--r--WebCore/inspector/front-end/ScriptsPanel.js30
-rw-r--r--WebCore/inspector/front-end/Settings.js6
-rw-r--r--WebCore/inspector/front-end/SourceFrame.js3
-rw-r--r--WebCore/inspector/front-end/WebKit.qrc7
-rw-r--r--WebCore/inspector/front-end/goToLineDialog.css39
-rw-r--r--WebCore/inspector/front-end/inspector.css37
-rw-r--r--WebCore/inspector/front-end/inspector.html5
-rw-r--r--WebCore/inspector/front-end/inspector.js65
-rw-r--r--WebCore/inspector/front-end/networkPanel.css383
-rw-r--r--WebCore/inspector/front-end/treeoutline.js8
-rw-r--r--WebCore/loader/Cache.cpp40
-rw-r--r--WebCore/loader/Cache.h28
-rw-r--r--WebCore/loader/CachedCSSStyleSheet.cpp3
-rw-r--r--WebCore/loader/CachedFont.cpp2
-rw-r--r--WebCore/loader/CachedImage.cpp3
-rw-r--r--WebCore/loader/CachedScript.cpp3
-rw-r--r--WebCore/loader/EmptyClients.h5
-rw-r--r--WebCore/loader/FrameLoaderClient.h4
-rw-r--r--WebCore/loader/PingLoader.cpp32
-rw-r--r--WebCore/loader/PingLoader.h4
-rw-r--r--WebCore/loader/RedirectScheduler.cpp2
-rw-r--r--WebCore/make-hash-tools.pl105
-rw-r--r--WebCore/manual-tests/large-size-image-crash.html6
-rw-r--r--WebCore/manual-tests/resources/large-size-image-crash.gifbin0 -> 16204 bytes
-rw-r--r--WebCore/page/ChromeClient.h6
-rw-r--r--WebCore/page/ContextMenuController.cpp22
-rw-r--r--WebCore/page/DOMWindow.cpp29
-rw-r--r--WebCore/page/DOMWindow.h4
-rw-r--r--WebCore/page/DOMWindow.idl1
-rw-r--r--WebCore/page/EventHandler.cpp6
-rwxr-xr-xWebCore/page/Frame.cpp6
-rw-r--r--WebCore/page/FrameView.cpp2
-rw-r--r--WebCore/page/Location.cpp9
-rw-r--r--WebCore/page/Location.h1
-rw-r--r--WebCore/page/Location.idl2
-rw-r--r--WebCore/page/PageGroup.cpp8
-rw-r--r--WebCore/page/PageGroup.h4
-rw-r--r--WebCore/page/SecurityOrigin.h1
-rw-r--r--WebCore/page/Settings.cpp9
-rw-r--r--WebCore/page/Settings.h15
-rw-r--r--WebCore/page/UserStyleSheet.h11
-rw-r--r--WebCore/page/UserStyleSheetTypes.h3
-rw-r--r--WebCore/page/animation/ImplicitAnimation.cpp19
-rw-r--r--WebCore/page/animation/ImplicitAnimation.h2
-rw-r--r--WebCore/page/chromium/ChromeClientChromium.h11
-rw-r--r--WebCore/page/chromium/EventHandlerChromium.cpp4
-rw-r--r--WebCore/page/efl/EventHandlerEfl.cpp2
-rw-r--r--WebCore/page/gtk/EventHandlerGtk.cpp2
-rw-r--r--WebCore/page/haiku/EventHandlerHaiku.cpp2
-rw-r--r--WebCore/page/mac/EventHandlerMac.mm2
-rw-r--r--WebCore/page/qt/EventHandlerQt.cpp2
-rw-r--r--WebCore/page/win/EventHandlerWin.cpp2
-rw-r--r--WebCore/page/wince/FrameWinCE.cpp4
-rw-r--r--WebCore/page/wx/EventHandlerWx.cpp2
-rw-r--r--WebCore/platform/AsyncFileSystem.cpp11
-rw-r--r--WebCore/platform/AsyncFileSystem.h8
-rw-r--r--WebCore/platform/AsyncFileSystemCallbacks.h4
-rw-r--r--WebCore/platform/ColorData.gperf12
-rw-r--r--WebCore/platform/ContextMenu.cpp71
-rw-r--r--WebCore/platform/ContextMenuItem.h8
-rw-r--r--WebCore/platform/Cursor.cpp4
-rw-r--r--WebCore/platform/Cursor.h8
-rw-r--r--WebCore/platform/LocalizationStrategy.h11
-rw-r--r--WebCore/platform/LocalizedStrings.cpp51
-rw-r--r--WebCore/platform/LocalizedStrings.h11
-rw-r--r--WebCore/platform/PlatformTouchEvent.h11
-rw-r--r--WebCore/platform/PlatformTouchPoint.h5
-rw-r--r--WebCore/platform/ScrollView.cpp8
-rw-r--r--WebCore/platform/ScrollView.h2
-rw-r--r--WebCore/platform/Scrollbar.cpp2
-rw-r--r--WebCore/platform/Widget.cpp5
-rw-r--r--WebCore/platform/Widget.h76
-rw-r--r--WebCore/platform/android/ClipboardAndroid.cpp10
-rw-r--r--WebCore/platform/android/ClipboardAndroid.h2
-rw-r--r--WebCore/platform/android/LocalizedStringsAndroid.cpp60
-rw-r--r--WebCore/platform/android/PlatformTouchEventAndroid.cpp4
-rw-r--r--WebCore/platform/audio/AudioDestination.h59
-rw-r--r--WebCore/platform/audio/HRTFDatabase.cpp124
-rw-r--r--WebCore/platform/audio/HRTFDatabase.h87
-rw-r--r--WebCore/platform/audio/HRTFDatabaseLoader.cpp133
-rw-r--r--WebCore/platform/audio/HRTFDatabaseLoader.h85
-rw-r--r--WebCore/platform/audio/HRTFElevation.cpp266
-rw-r--r--WebCore/platform/audio/HRTFElevation.h110
-rw-r--r--WebCore/platform/audio/HRTFKernel.cpp140
-rw-r--r--WebCore/platform/audio/HRTFKernel.h98
-rw-r--r--WebCore/platform/audio/mac/AudioDestinationMac.cpp171
-rw-r--r--WebCore/platform/audio/mac/AudioDestinationMac.h69
-rw-r--r--WebCore/platform/brew/ClipboardBrew.cpp10
-rw-r--r--WebCore/platform/brew/ClipboardBrew.h2
-rw-r--r--WebCore/platform/brew/FileSystemBrew.cpp13
-rw-r--r--WebCore/platform/brew/LocalizedStringsBrew.cpp50
-rw-r--r--WebCore/platform/brew/PasteboardBrew.cpp93
-rw-r--r--WebCore/platform/brew/PlatformKeyboardEventBrew.cpp4
-rw-r--r--WebCore/platform/brew/PlatformTouchEventBrew.cpp76
-rw-r--r--WebCore/platform/brew/PlatformTouchPointBrew.cpp41
-rw-r--r--WebCore/platform/chromium/ChromiumBridge.h2
-rw-r--r--WebCore/platform/chromium/ClipboardChromium.cpp18
-rw-r--r--WebCore/platform/chromium/ClipboardChromium.h4
-rw-r--r--WebCore/platform/chromium/ScrollbarThemeChromiumLinux.cpp2
-rw-r--r--WebCore/platform/efl/ClipboardEfl.cpp6
-rw-r--r--WebCore/platform/efl/ClipboardEfl.h6
-rw-r--r--WebCore/platform/efl/LocalizedStringsEfl.cpp50
-rw-r--r--WebCore/platform/efl/RenderThemeEfl.cpp6
-rw-r--r--WebCore/platform/efl/ScrollbarEfl.cpp2
-rw-r--r--WebCore/platform/graphics/Color.cpp3
-rw-r--r--WebCore/platform/graphics/ContextShadow.cpp (renamed from WebCore/platform/graphics/qt/ContextShadow.cpp)208
-rw-r--r--WebCore/platform/graphics/ContextShadow.h (renamed from WebCore/platform/graphics/qt/ContextShadow.h)82
-rw-r--r--WebCore/platform/graphics/Font.h4
-rw-r--r--WebCore/platform/graphics/GlyphPageTreeNode.cpp1
-rw-r--r--WebCore/platform/graphics/GraphicsContext.h6
-rw-r--r--WebCore/platform/graphics/GraphicsContext3D.cpp28
-rw-r--r--WebCore/platform/graphics/GraphicsContext3D.h10
-rw-r--r--WebCore/platform/graphics/GraphicsLayer.cpp6
-rw-r--r--WebCore/platform/graphics/GraphicsLayer.h13
-rw-r--r--WebCore/platform/graphics/MediaPlayer.cpp6
-rw-r--r--WebCore/platform/graphics/WidthIterator.cpp33
-rw-r--r--WebCore/platform/graphics/brew/ImageBrew.cpp56
-rw-r--r--WebCore/platform/graphics/cairo/CairoUtilities.cpp59
-rw-r--r--WebCore/platform/graphics/cairo/CairoUtilities.h (renamed from WebCore/platform/network/win/ResourceHandleWin.h)27
-rw-r--r--WebCore/platform/graphics/cairo/ContextShadowCairo.cpp122
-rw-r--r--WebCore/platform/graphics/cairo/FontCacheFreeType.cpp133
-rw-r--r--WebCore/platform/graphics/cairo/FontCustomPlatformData.cpp57
-rw-r--r--WebCore/platform/graphics/cairo/FontCustomPlatformData.h12
-rw-r--r--WebCore/platform/graphics/cairo/FontPlatformDataFreeType.cpp157
-rw-r--r--WebCore/platform/graphics/cairo/FontPlatformDataFreeType.h9
-rw-r--r--WebCore/platform/graphics/cairo/GlyphPageTreeNodeCairo.cpp3
-rw-r--r--WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp33
-rw-r--r--WebCore/platform/graphics/cairo/PathCairo.cpp18
-rw-r--r--WebCore/platform/graphics/cairo/PlatformRefPtrCairo.cpp13
-rw-r--r--WebCore/platform/graphics/cairo/PlatformRefPtrCairo.h4
-rw-r--r--WebCore/platform/graphics/cairo/SimpleFontDataCairo.cpp14
-rw-r--r--WebCore/platform/graphics/cg/GraphicsContext3DCG.cpp47
-rw-r--r--WebCore/platform/graphics/chromium/ContentLayerChromium.cpp22
-rw-r--r--WebCore/platform/graphics/chromium/ContentLayerChromium.h3
-rw-r--r--WebCore/platform/graphics/chromium/FontLinux.cpp18
-rw-r--r--WebCore/platform/graphics/chromium/FontPlatformData.h2
-rw-r--r--WebCore/platform/graphics/chromium/FontPlatformDataLinux.cpp8
-rw-r--r--WebCore/platform/graphics/chromium/HarfbuzzSkia.cpp2
-rw-r--r--WebCore/platform/graphics/chromium/LayerChromium.cpp11
-rw-r--r--WebCore/platform/graphics/chromium/LayerChromium.h8
-rw-r--r--WebCore/platform/graphics/chromium/LayerRendererChromium.cpp71
-rw-r--r--WebCore/platform/graphics/chromium/LayerRendererChromium.h13
-rw-r--r--WebCore/platform/graphics/chromium/VDMXParser.cpp1
-rw-r--r--WebCore/platform/graphics/chromium/VideoFrameChromium.cpp47
-rw-r--r--WebCore/platform/graphics/chromium/VideoFrameChromium.h17
-rw-r--r--WebCore/platform/graphics/chromium/VideoLayerChromium.cpp399
-rw-r--r--WebCore/platform/graphics/chromium/VideoLayerChromium.h67
-rw-r--r--WebCore/platform/graphics/filters/DistantLightSource.h (renamed from WebCore/svg/graphics/filters/SVGDistantLightSource.h)12
-rw-r--r--WebCore/platform/graphics/filters/FEBlend.cpp46
-rw-r--r--WebCore/platform/graphics/filters/FEBlend.h79
-rw-r--r--WebCore/platform/graphics/filters/FEColorMatrix.cpp44
-rw-r--r--WebCore/platform/graphics/filters/FEColorMatrix.h83
-rw-r--r--WebCore/platform/graphics/filters/FEComponentTransfer.cpp50
-rw-r--r--WebCore/platform/graphics/filters/FEComponentTransfer.h161
-rw-r--r--WebCore/platform/graphics/filters/FEComposite.cpp68
-rw-r--r--WebCore/platform/graphics/filters/FEComposite.h45
-rw-r--r--WebCore/platform/graphics/filters/FEConvolveMatrix.cpp (renamed from WebCore/svg/graphics/filters/SVGFEConvolveMatrix.cpp)11
-rw-r--r--WebCore/platform/graphics/filters/FEConvolveMatrix.h (renamed from WebCore/svg/graphics/filters/SVGFEConvolveMatrix.h)17
-rw-r--r--WebCore/platform/graphics/filters/FEDiffuseLighting.cpp (renamed from WebCore/svg/graphics/filters/SVGFEDiffuseLighting.cpp)9
-rw-r--r--WebCore/platform/graphics/filters/FEDiffuseLighting.h (renamed from WebCore/svg/graphics/filters/SVGFEDiffuseLighting.h)20
-rw-r--r--WebCore/platform/graphics/filters/FEDisplacementMap.cpp (renamed from WebCore/svg/graphics/filters/SVGFEDisplacementMap.cpp)13
-rw-r--r--WebCore/platform/graphics/filters/FEDisplacementMap.h70
-rw-r--r--WebCore/platform/graphics/filters/FEFlood.cpp (renamed from WebCore/svg/graphics/filters/SVGFEFlood.cpp)15
-rw-r--r--WebCore/platform/graphics/filters/FEFlood.h (renamed from WebCore/svg/graphics/filters/SVGFEFlood.h)41
-rw-r--r--WebCore/platform/graphics/filters/FEGaussianBlur.cpp46
-rw-r--r--WebCore/platform/graphics/filters/FEGaussianBlur.h47
-rw-r--r--WebCore/platform/graphics/filters/FELighting.cpp (renamed from WebCore/svg/graphics/filters/SVGFELighting.cpp)12
-rw-r--r--WebCore/platform/graphics/filters/FELighting.h (renamed from WebCore/svg/graphics/filters/SVGFELighting.h)14
-rw-r--r--WebCore/platform/graphics/filters/FEMerge.cpp (renamed from WebCore/svg/graphics/filters/SVGFEMerge.cpp)11
-rw-r--r--WebCore/platform/graphics/filters/FEMerge.h (renamed from WebCore/svg/graphics/filters/SVGFEMerge.h)29
-rw-r--r--WebCore/platform/graphics/filters/FEMorphology.cpp (renamed from WebCore/svg/graphics/filters/SVGFEMorphology.cpp)11
-rw-r--r--WebCore/platform/graphics/filters/FEMorphology.h66
-rw-r--r--WebCore/platform/graphics/filters/FEOffset.cpp (renamed from WebCore/svg/graphics/filters/SVGFEOffset.cpp)9
-rw-r--r--WebCore/platform/graphics/filters/FEOffset.h (renamed from WebCore/svg/graphics/filters/SVGFEOffset.h)41
-rw-r--r--WebCore/platform/graphics/filters/FESpecularLighting.cpp (renamed from WebCore/svg/graphics/filters/SVGFESpecularLighting.cpp)9
-rw-r--r--WebCore/platform/graphics/filters/FESpecularLighting.h (renamed from WebCore/svg/graphics/filters/SVGFESpecularLighting.h)17
-rw-r--r--WebCore/platform/graphics/filters/FETile.cpp (renamed from WebCore/svg/graphics/filters/SVGFETile.cpp)9
-rw-r--r--WebCore/platform/graphics/filters/FETile.h (renamed from WebCore/svg/graphics/filters/SVGFETile.h)33
-rw-r--r--WebCore/platform/graphics/filters/FETurbulence.cpp (renamed from WebCore/svg/graphics/filters/SVGFETurbulence.cpp)9
-rw-r--r--WebCore/platform/graphics/filters/FETurbulence.h (renamed from WebCore/svg/graphics/filters/SVGFETurbulence.h)17
-rw-r--r--WebCore/platform/graphics/filters/Filter.h26
-rw-r--r--WebCore/platform/graphics/filters/FilterEffect.cpp6
-rw-r--r--WebCore/platform/graphics/filters/FilterEffect.h6
-rw-r--r--WebCore/platform/graphics/filters/ImageBufferFilter.cpp28
-rw-r--r--WebCore/platform/graphics/filters/ImageBufferFilter.h28
-rw-r--r--WebCore/platform/graphics/filters/LightSource.cpp (renamed from WebCore/svg/graphics/filters/SVGLightSource.cpp)14
-rw-r--r--WebCore/platform/graphics/filters/LightSource.h (renamed from WebCore/svg/graphics/filters/SVGLightSource.h)10
-rw-r--r--WebCore/platform/graphics/filters/PointLightSource.h (renamed from WebCore/svg/graphics/filters/SVGPointLightSource.h)12
-rw-r--r--WebCore/platform/graphics/filters/SourceAlpha.cpp28
-rw-r--r--WebCore/platform/graphics/filters/SourceAlpha.h63
-rw-r--r--WebCore/platform/graphics/filters/SourceGraphic.cpp28
-rw-r--r--WebCore/platform/graphics/filters/SourceGraphic.h63
-rw-r--r--WebCore/platform/graphics/filters/SpotLightSource.h (renamed from WebCore/svg/graphics/filters/SVGSpotLightSource.h)12
-rw-r--r--WebCore/platform/graphics/gpu/LoopBlinnLocalTriangulator.cpp275
-rw-r--r--WebCore/platform/graphics/gpu/LoopBlinnLocalTriangulator.h268
-rw-r--r--WebCore/platform/graphics/gpu/Texture.cpp2
-rw-r--r--WebCore/platform/graphics/gstreamer/DataSourceGStreamer.cpp4
-rw-r--r--WebCore/platform/graphics/gstreamer/DataSourceGStreamer.h4
-rw-r--r--WebCore/platform/graphics/gstreamer/GOwnPtrGStreamer.cpp4
-rw-r--r--WebCore/platform/graphics/gstreamer/GOwnPtrGStreamer.h4
-rw-r--r--WebCore/platform/graphics/gstreamer/GStreamerGWorld.cpp4
-rw-r--r--WebCore/platform/graphics/gstreamer/GStreamerGWorld.h4
-rw-r--r--WebCore/platform/graphics/gstreamer/ImageGStreamer.h4
-rw-r--r--WebCore/platform/graphics/gstreamer/ImageGStreamerCG.mm4
-rw-r--r--WebCore/platform/graphics/gstreamer/ImageGStreamerCairo.cpp4
-rw-r--r--WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp4
-rw-r--r--WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h4
-rw-r--r--WebCore/platform/graphics/gstreamer/PlatformVideoWindow.h4
-rw-r--r--WebCore/platform/graphics/gstreamer/PlatformVideoWindowEfl.cpp4
-rw-r--r--WebCore/platform/graphics/gstreamer/PlatformVideoWindowGtk.cpp4
-rw-r--r--WebCore/platform/graphics/gstreamer/VideoSinkGStreamer.cpp4
-rw-r--r--WebCore/platform/graphics/gstreamer/VideoSinkGStreamer.h4
-rw-r--r--WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp4
-rw-r--r--WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.h4
-rw-r--r--WebCore/platform/graphics/gtk/GdkCairoUtilities.cpp (renamed from WebCore/platform/graphics/gtk/CairoUtilities.cpp)2
-rw-r--r--WebCore/platform/graphics/gtk/GdkCairoUtilities.h (renamed from WebCore/platform/graphics/gtk/CairoUtilities.h)6
-rw-r--r--WebCore/platform/graphics/gtk/ImageBufferGtk.cpp2
-rw-r--r--WebCore/platform/graphics/gtk/ImageGtk.cpp2
-rw-r--r--WebCore/platform/graphics/mac/ComplexTextController.cpp22
-rw-r--r--WebCore/platform/graphics/mac/GraphicsLayerCA.h67
-rw-r--r--WebCore/platform/graphics/mac/GraphicsLayerCA.mm243
-rw-r--r--WebCore/platform/graphics/mac/ImageMac.mm1
-rw-r--r--WebCore/platform/graphics/qt/ContextShadowQt.cpp159
-rw-r--r--WebCore/platform/graphics/qt/FontQt.cpp42
-rw-r--r--WebCore/platform/graphics/qt/GraphicsContextQt.cpp52
-rw-r--r--WebCore/platform/graphics/qt/MediaPlayerPrivatePhonon.cpp88
-rw-r--r--WebCore/platform/graphics/qt/MediaPlayerPrivatePhonon.h6
-rw-r--r--WebCore/platform/graphics/qt/MediaPlayerPrivateQt.cpp135
-rw-r--r--WebCore/platform/graphics/qt/MediaPlayerPrivateQt.h8
-rw-r--r--WebCore/platform/graphics/skia/FontCustomPlatformData.cpp12
-rw-r--r--WebCore/platform/graphics/skia/FontCustomPlatformData.h6
-rw-r--r--WebCore/platform/graphics/skia/GradientSkia.cpp2
-rw-r--r--WebCore/platform/graphics/skia/GraphicsContextSkia.cpp6
-rw-r--r--WebCore/platform/graphics/skia/ImageSkia.cpp18
-rw-r--r--WebCore/platform/graphics/skia/PatternSkia.cpp2
-rw-r--r--WebCore/platform/graphics/skia/PlatformContextSkia.cpp39
-rw-r--r--WebCore/platform/graphics/skia/PlatformContextSkia.h1
-rw-r--r--WebCore/platform/graphics/skia/SkiaFontWin.cpp2
-rw-r--r--WebCore/platform/graphics/wince/PlatformPathWinCE.cpp1
-rw-r--r--WebCore/platform/gtk/ClipboardGtk.cpp68
-rw-r--r--WebCore/platform/gtk/ClipboardGtk.h8
-rw-r--r--WebCore/platform/gtk/ContextMenuItemGtk.cpp13
-rw-r--r--WebCore/platform/gtk/GtkVersioning.c33
-rw-r--r--WebCore/platform/gtk/GtkVersioning.h12
-rw-r--r--WebCore/platform/gtk/LocalizedStringsGtk.cpp51
-rw-r--r--WebCore/platform/haiku/ClipboardHaiku.cpp6
-rw-r--r--WebCore/platform/haiku/ClipboardHaiku.h6
-rw-r--r--WebCore/platform/haiku/LocalizedStringsHaiku.cpp50
-rw-r--r--WebCore/platform/image-decoders/ImageDecoder.cpp5
-rw-r--r--WebCore/platform/image-decoders/ImageDecoder.h4
-rw-r--r--WebCore/platform/image-decoders/gif/GIFImageDecoder.cpp8
-rw-r--r--WebCore/platform/image-decoders/gif/GIFImageDecoder.h2
-rw-r--r--WebCore/platform/image-decoders/qt/RGBA32BufferQt.cpp5
-rw-r--r--WebCore/platform/image-decoders/skia/ImageDecoderSkia.cpp6
-rw-r--r--WebCore/platform/mac/ClipboardMac.h6
-rw-r--r--WebCore/platform/mac/ClipboardMac.mm40
-rw-r--r--WebCore/platform/mac/CursorMac.mm93
-rw-r--r--WebCore/platform/mac/FoundationExtras.h47
-rw-r--r--WebCore/platform/mac/RuntimeApplicationChecks.h2
-rw-r--r--WebCore/platform/mac/RuntimeApplicationChecks.mm12
-rw-r--r--WebCore/platform/mac/ThemeMac.mm52
-rw-r--r--WebCore/platform/mac/WidgetMac.mm18
-rw-r--r--WebCore/platform/mock/DeviceOrientationClientMock.h1
-rw-r--r--WebCore/platform/network/ResourceHandle.h16
-rw-r--r--WebCore/platform/network/ResourceHandleInternal.h31
-rw-r--r--WebCore/platform/network/mac/WebCoreURLResponse.mm19
-rw-r--r--WebCore/platform/network/qt/QNetworkReplyHandler.cpp7
-rw-r--r--WebCore/platform/network/qt/ResourceRequestQt.cpp2
-rw-r--r--WebCore/platform/network/qt/SocketStreamHandleQt.cpp7
-rw-r--r--WebCore/platform/network/soup/ResourceHandleSoup.cpp5
-rw-r--r--WebCore/platform/network/win/ResourceHandleWin.cpp507
-rw-r--r--WebCore/platform/qt/ClipboardQt.cpp26
-rw-r--r--WebCore/platform/qt/ClipboardQt.h6
-rw-r--r--WebCore/platform/qt/QWebPageClient.h2
-rw-r--r--WebCore/platform/qt/RenderThemeQt.cpp2
-rw-r--r--WebCore/platform/qt/TemporaryLinkStubsQt.cpp13
-rw-r--r--WebCore/platform/sql/SQLiteFileSystem.cpp6
-rw-r--r--WebCore/platform/sql/chromium/SQLiteFileSystemChromiumPosix.cpp1081
-rw-r--r--WebCore/platform/text/cf/HyphenationCF.cpp17
-rw-r--r--WebCore/platform/text/qt/TextCodecQt.cpp34
-rw-r--r--WebCore/platform/win/ClipboardWin.cpp18
-rw-r--r--WebCore/platform/win/ClipboardWin.h12
-rw-r--r--WebCore/platform/win/EditorWin.cpp2
-rw-r--r--WebCore/platform/wx/ClipboardWx.cpp4
-rw-r--r--WebCore/platform/wx/ClipboardWx.h6
-rw-r--r--WebCore/platform/wx/LocalizedStringsWx.cpp50
-rw-r--r--WebCore/platform/wx/PopupMenuWx.cpp38
-rw-r--r--WebCore/platform/wx/PopupMenuWx.h4
-rw-r--r--WebCore/plugins/PluginData.cpp2
-rw-r--r--WebCore/plugins/PluginPackage.cpp9
-rw-r--r--WebCore/plugins/PluginStrategy.h4
-rw-r--r--WebCore/plugins/PluginView.cpp4
-rw-r--r--WebCore/plugins/PluginView.h4
-rw-r--r--WebCore/plugins/qt/PluginViewQt.cpp10
-rw-r--r--WebCore/rendering/AutoTableLayout.cpp20
-rw-r--r--WebCore/rendering/AutoTableLayout.h2
-rw-r--r--WebCore/rendering/EllipsisBox.cpp8
-rw-r--r--WebCore/rendering/EllipsisBox.h4
-rw-r--r--WebCore/rendering/FixedTableLayout.cpp8
-rw-r--r--WebCore/rendering/FixedTableLayout.h2
-rw-r--r--WebCore/rendering/HitTestResult.cpp183
-rw-r--r--WebCore/rendering/HitTestResult.h60
-rw-r--r--WebCore/rendering/InlineBox.cpp8
-rw-r--r--WebCore/rendering/InlineBox.h68
-rw-r--r--WebCore/rendering/InlineFlowBox.cpp99
-rw-r--r--WebCore/rendering/InlineFlowBox.h105
-rw-r--r--WebCore/rendering/InlineTextBox.cpp58
-rw-r--r--WebCore/rendering/InlineTextBox.h4
-rw-r--r--WebCore/rendering/MediaControlElements.cpp58
-rw-r--r--WebCore/rendering/MediaControlElements.h2
-rw-r--r--WebCore/rendering/RenderApplet.cpp4
-rw-r--r--WebCore/rendering/RenderBlock.cpp477
-rw-r--r--WebCore/rendering/RenderBlock.h139
-rw-r--r--WebCore/rendering/RenderBlockLineLayout.cpp203
-rw-r--r--WebCore/rendering/RenderBox.cpp726
-rw-r--r--WebCore/rendering/RenderBox.h191
-rw-r--r--WebCore/rendering/RenderBoxModelObject.cpp71
-rw-r--r--WebCore/rendering/RenderBoxModelObject.h12
-rw-r--r--WebCore/rendering/RenderCounter.cpp4
-rw-r--r--WebCore/rendering/RenderCounter.h2
-rw-r--r--WebCore/rendering/RenderDataGrid.cpp28
-rw-r--r--WebCore/rendering/RenderDataGrid.h2
-rw-r--r--WebCore/rendering/RenderEmbeddedObject.cpp4
-rw-r--r--WebCore/rendering/RenderFieldset.cpp8
-rw-r--r--WebCore/rendering/RenderFieldset.h4
-rw-r--r--WebCore/rendering/RenderFileUploadControl.cpp30
-rw-r--r--WebCore/rendering/RenderFileUploadControl.h2
-rw-r--r--WebCore/rendering/RenderFlexibleBox.cpp90
-rw-r--r--WebCore/rendering/RenderFlexibleBox.h2
-rw-r--r--WebCore/rendering/RenderForeignObject.cpp6
-rw-r--r--WebCore/rendering/RenderForeignObject.h4
-rw-r--r--WebCore/rendering/RenderFrameBase.cpp6
-rw-r--r--WebCore/rendering/RenderHTMLCanvas.cpp8
-rw-r--r--WebCore/rendering/RenderIFrame.cpp16
-rw-r--r--WebCore/rendering/RenderIFrame.h4
-rw-r--r--WebCore/rendering/RenderImage.cpp30
-rw-r--r--WebCore/rendering/RenderImage.h10
-rw-r--r--WebCore/rendering/RenderIndicator.cpp4
-rw-r--r--WebCore/rendering/RenderInline.cpp63
-rw-r--r--WebCore/rendering/RenderInline.h11
-rw-r--r--WebCore/rendering/RenderLayer.cpp32
-rw-r--r--WebCore/rendering/RenderLayerBacking.cpp44
-rw-r--r--WebCore/rendering/RenderLayerBacking.h8
-rw-r--r--WebCore/rendering/RenderLineBoxList.cpp8
-rw-r--r--WebCore/rendering/RenderListBox.cpp34
-rw-r--r--WebCore/rendering/RenderListBox.h4
-rw-r--r--WebCore/rendering/RenderListItem.cpp45
-rw-r--r--WebCore/rendering/RenderListItem.h3
-rw-r--r--WebCore/rendering/RenderListMarker.cpp50
-rw-r--r--WebCore/rendering/RenderListMarker.h3
-rw-r--r--WebCore/rendering/RenderMenuList.cpp28
-rw-r--r--WebCore/rendering/RenderMenuList.h2
-rw-r--r--WebCore/rendering/RenderMeter.cpp8
-rw-r--r--WebCore/rendering/RenderMeter.h4
-rw-r--r--WebCore/rendering/RenderObject.cpp28
-rw-r--r--WebCore/rendering/RenderObject.h27
-rw-r--r--WebCore/rendering/RenderPath.cpp2
-rw-r--r--WebCore/rendering/RenderReplaced.cpp45
-rw-r--r--WebCore/rendering/RenderReplaced.h8
-rw-r--r--WebCore/rendering/RenderReplica.cpp8
-rw-r--r--WebCore/rendering/RenderReplica.h2
-rw-r--r--WebCore/rendering/RenderSVGContainer.cpp2
-rw-r--r--WebCore/rendering/RenderSVGImage.cpp2
-rw-r--r--WebCore/rendering/RenderSVGInline.cpp4
-rw-r--r--WebCore/rendering/RenderSVGInlineText.cpp2
-rw-r--r--WebCore/rendering/RenderSVGResourceFilter.cpp2
-rw-r--r--WebCore/rendering/RenderSVGResourceFilterPrimitive.h5
-rw-r--r--WebCore/rendering/RenderSVGRoot.cpp28
-rw-r--r--WebCore/rendering/RenderSVGRoot.h6
-rw-r--r--WebCore/rendering/RenderSVGText.cpp4
-rw-r--r--WebCore/rendering/RenderScrollbarPart.cpp8
-rw-r--r--WebCore/rendering/RenderScrollbarPart.h2
-rw-r--r--WebCore/rendering/RenderSlider.cpp32
-rw-r--r--WebCore/rendering/RenderSlider.h2
-rw-r--r--WebCore/rendering/RenderTable.cpp36
-rw-r--r--WebCore/rendering/RenderTable.h4
-rw-r--r--WebCore/rendering/RenderTableCell.cpp79
-rw-r--r--WebCore/rendering/RenderTableCell.h38
-rw-r--r--WebCore/rendering/RenderTableCol.cpp6
-rw-r--r--WebCore/rendering/RenderTableCol.h2
-rw-r--r--WebCore/rendering/RenderTableRow.cpp2
-rw-r--r--WebCore/rendering/RenderTableSection.cpp18
-rw-r--r--WebCore/rendering/RenderText.cpp54
-rw-r--r--WebCore/rendering/RenderText.h8
-rw-r--r--WebCore/rendering/RenderTextControl.cpp34
-rw-r--r--WebCore/rendering/RenderTextControl.h4
-rw-r--r--WebCore/rendering/RenderTextControlSingleLine.cpp24
-rw-r--r--WebCore/rendering/RenderTreeAsText.cpp56
-rw-r--r--WebCore/rendering/RenderTreeAsText.h29
-rw-r--r--WebCore/rendering/RenderVideo.cpp10
-rw-r--r--WebCore/rendering/RenderVideo.h4
-rw-r--r--WebCore/rendering/RenderView.cpp28
-rw-r--r--WebCore/rendering/RenderView.h8
-rw-r--r--WebCore/rendering/RootInlineBox.cpp55
-rw-r--r--WebCore/rendering/RootInlineBox.h12
-rw-r--r--WebCore/rendering/SVGInlineFlowBox.h8
-rw-r--r--WebCore/rendering/SVGInlineTextBox.cpp2
-rw-r--r--WebCore/rendering/SVGInlineTextBox.h8
-rw-r--r--WebCore/rendering/SVGRenderTreeAsText.cpp50
-rw-r--r--WebCore/rendering/SVGRenderTreeAsText.h22
-rw-r--r--WebCore/rendering/SVGRootInlineBox.cpp12
-rw-r--r--WebCore/rendering/SVGRootInlineBox.h12
-rw-r--r--WebCore/rendering/TableLayout.h2
-rw-r--r--WebCore/rendering/TrailingFloatsRootInlineBox.h9
-rw-r--r--WebCore/rendering/style/RenderStyle.cpp52
-rw-r--r--WebCore/rendering/style/RenderStyle.h16
-rw-r--r--WebCore/rendering/style/StyleRareNonInheritedData.cpp12
-rw-r--r--WebCore/rendering/style/StyleRareNonInheritedData.h4
-rw-r--r--WebCore/storage/IDBCursorBackendImpl.cpp1
-rw-r--r--WebCore/storage/IDBDatabase.cpp3
-rw-r--r--WebCore/storage/IDBDatabaseBackendImpl.cpp7
-rw-r--r--WebCore/storage/IDBDatabaseBackendImpl.h2
-rw-r--r--WebCore/storage/IDBFactoryBackendImpl.cpp11
-rw-r--r--WebCore/storage/IDBFactoryBackendImpl.h3
-rw-r--r--WebCore/storage/IDBFactoryBackendInterface.h1
-rw-r--r--WebCore/storage/IDBObjectStore.cpp14
-rw-r--r--WebCore/storage/IDBObjectStore.h9
-rw-r--r--WebCore/storage/IDBObjectStoreBackendImpl.cpp37
-rw-r--r--WebCore/storage/IDBObjectStoreBackendImpl.h5
-rw-r--r--WebCore/storage/IDBObjectStoreBackendInterface.h3
-rw-r--r--WebCore/storage/IDBPendingTransactionMonitor.cpp47
-rw-r--r--WebCore/storage/IDBPendingTransactionMonitor.h14
-rw-r--r--WebCore/storage/IDBRequest.cpp43
-rw-r--r--WebCore/storage/IDBRequest.h9
-rw-r--r--WebCore/storage/IDBRequest.idl1
-rw-r--r--WebCore/storage/IDBTransaction.cpp9
-rw-r--r--WebCore/storage/IDBTransactionBackendImpl.cpp91
-rw-r--r--WebCore/storage/IDBTransactionBackendImpl.h36
-rw-r--r--WebCore/storage/IDBTransactionBackendInterface.h3
-rw-r--r--WebCore/storage/IDBTransactionCoordinator.cpp46
-rw-r--r--WebCore/storage/IDBTransactionCoordinator.h16
-rw-r--r--WebCore/svg/SVGFEBlendElement.cpp10
-rw-r--r--WebCore/svg/SVGFEBlendElement.h1
-rw-r--r--WebCore/svg/SVGFEConvolveMatrixElement.h2
-rw-r--r--WebCore/svg/SVGFEDiffuseLightingElement.cpp2
-rw-r--r--WebCore/svg/SVGFEDisplacementMapElement.h2
-rw-r--r--WebCore/svg/SVGFEDistantLightElement.cpp3
-rw-r--r--WebCore/svg/SVGFEFloodElement.h2
-rw-r--r--WebCore/svg/SVGFELightElement.h2
-rw-r--r--WebCore/svg/SVGFEMergeElement.h2
-rw-r--r--WebCore/svg/SVGFEMorphologyElement.cpp16
-rw-r--r--WebCore/svg/SVGFEMorphologyElement.h3
-rw-r--r--WebCore/svg/SVGFEOffsetElement.h2
-rw-r--r--WebCore/svg/SVGFEPointLightElement.cpp3
-rw-r--r--WebCore/svg/SVGFESpecularLightingElement.h2
-rw-r--r--WebCore/svg/SVGFESpotLightElement.cpp3
-rw-r--r--WebCore/svg/SVGFETileElement.h2
-rw-r--r--WebCore/svg/SVGFETurbulenceElement.h2
-rw-r--r--WebCore/svg/SVGLength.cpp43
-rw-r--r--WebCore/svg/SVGParserUtilities.cpp5
-rw-r--r--WebCore/svg/SVGSVGElement.cpp2
-rw-r--r--WebCore/svg/graphics/filters/SVGFEDisplacementMap.h69
-rw-r--r--WebCore/svg/graphics/filters/SVGFEImage.cpp7
-rw-r--r--WebCore/svg/graphics/filters/SVGFEImage.h29
-rw-r--r--WebCore/svg/graphics/filters/SVGFEMorphology.h65
-rw-r--r--WebCore/svg/graphics/filters/SVGFilterBuilder.cpp19
-rw-r--r--WebCore/svg/graphics/filters/SVGFilterBuilder.h22
-rw-r--r--WebCore/webaudio/AudioContext.cpp467
-rw-r--r--WebCore/webaudio/AudioContext.h248
-rw-r--r--WebCore/webaudio/AudioContext.idl70
-rw-r--r--WebCore/webaudio/AudioDestinationNode.cpp115
-rw-r--r--WebCore/webaudio/AudioDestinationNode.h76
-rw-r--r--WebCore/webaudio/AudioDestinationNode.idl36
-rw-r--r--WebCore/webaudio/AudioGain.h53
-rw-r--r--WebCore/webaudio/AudioGain.idl35
-rw-r--r--WebCore/webaudio/AudioNode.cpp311
-rw-r--r--WebCore/webaudio/AudioNode.h174
-rw-r--r--WebCore/webaudio/AudioNode.idl40
-rw-r--r--WebCore/webaudio/AudioParam.h9
-rw-r--r--WebCore/wml/WMLElement.cpp3
-rw-r--r--WebCore/workers/WorkerContext.cpp82
-rw-r--r--WebCore/workers/WorkerContext.h28
-rw-r--r--WebCore/workers/WorkerContext.idl8
-rw-r--r--WebCore/workers/WorkerThread.cpp2
-rw-r--r--WebCore/xml/XMLHttpRequest.cpp2
-rw-r--r--WebCore/xml/XMLHttpRequest.h1
-rw-r--r--WebKit/CMakeLists.txt1
-rw-r--r--WebKit/ChangeLog17
-rw-r--r--WebKit/English.lproj/Localizable.stringsbin52026 -> 53406 bytes
-rw-r--r--WebKit/chromium/ChangeLog817
-rw-r--r--WebKit/chromium/DEPS2
-rw-r--r--WebKit/chromium/WebKit.gyp19
-rw-r--r--WebKit/chromium/features.gypi12
-rw-r--r--WebKit/chromium/public/WebAccessibilityCache.h1
-rw-r--r--WebKit/chromium/public/WebBindings.h3
-rw-r--r--WebKit/chromium/public/WebCommonWorkerClient.h9
-rw-r--r--WebKit/chromium/public/WebFileInfo.h14
-rw-r--r--WebKit/chromium/public/WebFileWriterClient.h2
-rw-r--r--WebKit/chromium/public/WebFrame.h11
-rw-r--r--WebKit/chromium/public/WebFrameClient.h7
-rw-r--r--WebKit/chromium/public/WebGLES2Context.h71
-rw-r--r--WebKit/chromium/public/WebGraphicsContext3D.h5
-rw-r--r--WebKit/chromium/public/WebIDBCursor.h15
-rwxr-xr-xWebKit/chromium/public/WebIDBFactory.h13
-rw-r--r--WebKit/chromium/public/WebIDBIndex.h42
-rwxr-xr-xWebKit/chromium/public/WebIDBObjectStore.h42
-rw-r--r--WebKit/chromium/public/WebIDBTransaction.h14
-rw-r--r--WebKit/chromium/public/WebInputElement.h29
-rw-r--r--WebKit/chromium/public/WebInputEvent.h6
-rw-r--r--WebKit/chromium/public/WebKitClient.h7
-rw-r--r--WebKit/chromium/public/WebPerformance.h92
-rw-r--r--WebKit/chromium/public/WebScriptController.h2
-rw-r--r--WebKit/chromium/public/WebSettings.h2
-rw-r--r--WebKit/chromium/public/WebView.h29
-rw-r--r--WebKit/chromium/public/WebViewClient.h6
-rw-r--r--WebKit/chromium/src/AssertMatchingEnums.cpp28
-rw-r--r--WebKit/chromium/src/AsyncFileSystemChromium.cpp68
-rw-r--r--WebKit/chromium/src/AsyncFileSystemChromium.h1
-rw-r--r--WebKit/chromium/src/AsyncFileWriterChromium.cpp23
-rw-r--r--WebKit/chromium/src/AsyncFileWriterChromium.h30
-rw-r--r--WebKit/chromium/src/ChromeClientImpl.cpp19
-rw-r--r--WebKit/chromium/src/ChromeClientImpl.h2
-rw-r--r--WebKit/chromium/src/ChromiumBridge.cpp4
-rw-r--r--WebKit/chromium/src/DeviceOrientationClientProxy.cpp5
-rw-r--r--WebKit/chromium/src/DeviceOrientationClientProxy.h1
-rw-r--r--WebKit/chromium/src/FrameLoaderClientImpl.cpp10
-rw-r--r--WebKit/chromium/src/FrameLoaderClientImpl.h6
-rw-r--r--WebKit/chromium/src/GLES2Context.cpp115
-rw-r--r--WebKit/chromium/src/IDBDatabaseProxy.h2
-rwxr-xr-xWebKit/chromium/src/IDBFactoryBackendProxy.cpp8
-rwxr-xr-xWebKit/chromium/src/IDBFactoryBackendProxy.h1
-rwxr-xr-xWebKit/chromium/src/IDBObjectStoreProxy.cpp9
-rwxr-xr-xWebKit/chromium/src/IDBObjectStoreProxy.h2
-rw-r--r--WebKit/chromium/src/IDBTransactionBackendProxy.cpp8
-rw-r--r--WebKit/chromium/src/IDBTransactionBackendProxy.h5
-rw-r--r--WebKit/chromium/src/LocalFileSystemChromium.cpp18
-rw-r--r--WebKit/chromium/src/LocalizedStrings.cpp10
-rw-r--r--WebKit/chromium/src/VideoFrameChromiumImpl.cpp26
-rw-r--r--WebKit/chromium/src/VideoFrameChromiumImpl.h1
-rw-r--r--WebKit/chromium/src/WebAccessibilityCache.cpp5
-rw-r--r--WebKit/chromium/src/WebBindings.cpp21
-rw-r--r--WebKit/chromium/src/WebFileSystemCallbacksImpl.h2
-rw-r--r--WebKit/chromium/src/WebFrameImpl.cpp53
-rw-r--r--WebKit/chromium/src/WebFrameImpl.h6
-rw-r--r--WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.cpp240
-rw-r--r--WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.h45
-rwxr-xr-xWebKit/chromium/src/WebIDBFactory.cpp52
-rwxr-xr-xWebKit/chromium/src/WebIDBFactoryImpl.cpp9
-rwxr-xr-xWebKit/chromium/src/WebIDBFactoryImpl.h1
-rwxr-xr-xWebKit/chromium/src/WebIDBObjectStoreImpl.cpp5
-rwxr-xr-xWebKit/chromium/src/WebIDBObjectStoreImpl.h2
-rw-r--r--WebKit/chromium/src/WebIDBTransactionImpl.cpp10
-rw-r--r--WebKit/chromium/src/WebIDBTransactionImpl.h5
-rw-r--r--WebKit/chromium/src/WebInputElement.cpp5
-rw-r--r--WebKit/chromium/src/WebPerformance.cpp160
-rw-r--r--WebKit/chromium/src/WebScriptController.cpp2
-rw-r--r--WebKit/chromium/src/WebSettingsImpl.cpp10
-rw-r--r--WebKit/chromium/src/WebSettingsImpl.h2
-rw-r--r--WebKit/chromium/src/WebViewImpl.cpp137
-rw-r--r--WebKit/chromium/src/WebViewImpl.h13
-rw-r--r--WebKit/chromium/src/WebWorkerBase.cpp16
-rw-r--r--WebKit/chromium/src/WebWorkerBase.h5
-rw-r--r--WebKit/chromium/src/WebWorkerClientImpl.h6
-rw-r--r--WebKit/chromium/src/WorkerFileSystemCallbacksBridge.cpp190
-rw-r--r--WebKit/chromium/src/WorkerFileSystemCallbacksBridge.h122
-rw-r--r--WebKit/chromium/src/gtk/WebInputEventFactory.cpp4
-rw-r--r--WebKit/chromium/src/gtk/WebScreenInfoFactory.cpp62
-rw-r--r--WebKit/chromium/src/js/DevTools.js2
-rw-r--r--WebKit/chromium/src/win/WebInputEventFactory.cpp14
-rw-r--r--WebKit/efl/CMakeListsEfl.txt7
-rw-r--r--WebKit/efl/ChangeLog63
-rw-r--r--WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp3
-rw-r--r--WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.h2
-rw-r--r--WebKit/efl/ewk/ewk_frame.cpp2
-rw-r--r--WebKit/efl/ewk/ewk_frame.h2
-rw-r--r--WebKit/efl/ewk/ewk_view.cpp37
-rw-r--r--WebKit/efl/ewk/ewk_view.h4
-rw-r--r--WebKit/gtk/ChangeLog189
-rw-r--r--WebKit/gtk/NEWS20
-rw-r--r--WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp15
-rw-r--r--WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.h2
-rw-r--r--WebKit/gtk/WebCoreSupport/FullscreenVideoController.cpp7
-rw-r--r--WebKit/gtk/WebCoreSupport/FullscreenVideoController.h1
-rw-r--r--WebKit/gtk/po/ChangeLog9
-rw-r--r--WebKit/gtk/po/nl.po859
-rw-r--r--WebKit/gtk/tests/testatk.c112
-rw-r--r--WebKit/gtk/tests/testmimehandling.c50
-rw-r--r--WebKit/gtk/webkit/webkitdownload.cpp4
-rw-r--r--WebKit/gtk/webkit/webkitnetworkrequest.cpp4
-rw-r--r--WebKit/gtk/webkit/webkitnetworkresponse.cpp4
-rw-r--r--WebKit/gtk/webkit/webkitsecurityorigin.cpp3
-rw-r--r--WebKit/gtk/webkit/webkitwebdatabase.cpp2
-rw-r--r--WebKit/gtk/webkit/webkitwebdatasource.cpp33
-rw-r--r--WebKit/gtk/webkit/webkitwebframe.cpp16
-rw-r--r--WebKit/gtk/webkit/webkitwebhistoryitem.cpp4
-rw-r--r--WebKit/gtk/webkit/webkitwebinspector.cpp4
-rw-r--r--WebKit/gtk/webkit/webkitwebresource.cpp5
-rw-r--r--WebKit/gtk/webkit/webkitwebsettings.cpp28
-rw-r--r--WebKit/gtk/webkit/webkitwebview.cpp29
-rw-r--r--WebKit/haiku/ChangeLog11
-rw-r--r--WebKit/haiku/WebCoreSupport/FrameLoaderClientHaiku.cpp3
-rw-r--r--WebKit/haiku/WebCoreSupport/FrameLoaderClientHaiku.h3
-rw-r--r--WebKit/mac/ChangeLog258
-rw-r--r--WebKit/mac/Configurations/Version.xcconfig2
-rw-r--r--WebKit/mac/Misc/WebKitVersionChecks.h1
-rw-r--r--WebKit/mac/Misc/WebNSFileManagerExtras.m26
-rw-r--r--WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm1
-rw-r--r--WebKit/mac/Plugins/WebNetscapePluginView.mm8
-rw-r--r--WebKit/mac/WebCoreSupport/WebDeviceOrientationClient.h1
-rw-r--r--WebKit/mac/WebCoreSupport/WebDeviceOrientationClient.mm5
-rw-r--r--WebKit/mac/WebCoreSupport/WebFrameLoaderClient.h2
-rw-r--r--WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm7
-rw-r--r--WebKit/mac/WebCoreSupport/WebPlatformStrategies.h12
-rw-r--r--WebKit/mac/WebCoreSupport/WebPlatformStrategies.mm52
-rw-r--r--WebKit/mac/WebInspector/WebNodeHighlightView.mm13
-rw-r--r--WebKit/mac/WebView/WebPreferenceKeysPrivate.h1
-rw-r--r--WebKit/mac/WebView/WebPreferences.mm11
-rw-r--r--WebKit/mac/WebView/WebPreferencesPrivate.h3
-rw-r--r--WebKit/mac/WebView/WebView.mm62
-rw-r--r--WebKit/mac/WebView/WebViewPrivate.h4
-rw-r--r--WebKit/qt/Api/DerivedSources.pro2
-rw-r--r--WebKit/qt/Api/qgraphicswebview.cpp34
-rw-r--r--WebKit/qt/Api/qgraphicswebview.h4
-rw-r--r--WebKit/qt/Api/qwebframe.cpp10
-rw-r--r--WebKit/qt/Api/qwebframe_p.h3
-rw-r--r--WebKit/qt/Api/qwebinspector.cpp25
-rw-r--r--WebKit/qt/Api/qwebinspector_p.h4
-rw-r--r--WebKit/qt/Api/qwebkitplatformplugin.h13
-rw-r--r--WebKit/qt/Api/qwebpage.cpp144
-rw-r--r--WebKit/qt/Api/qwebpage.h18
-rw-r--r--WebKit/qt/Api/qwebpage_p.h15
-rw-r--r--WebKit/qt/Api/qwebsettings.cpp6
-rw-r--r--WebKit/qt/Api/qwebsettings.h3
-rw-r--r--WebKit/qt/Api/qwebview.cpp12
-rw-r--r--WebKit/qt/ChangeLog351
-rw-r--r--WebKit/qt/WebCoreSupport/ChromeClientQt.cpp2
-rw-r--r--WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp2
-rw-r--r--WebKit/qt/WebCoreSupport/EditorClientQt.cpp4
-rw-r--r--WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp15
-rw-r--r--WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h2
-rw-r--r--WebKit/qt/WebCoreSupport/InspectorClientQt.cpp43
-rw-r--r--WebKit/qt/WebCoreSupport/InspectorClientQt.h8
-rw-r--r--WebKit/qt/WebCoreSupport/InspectorServerQt.cpp386
-rw-r--r--WebKit/qt/WebCoreSupport/InspectorServerQt.h110
-rw-r--r--WebKit/qt/WebCoreSupport/PageClientQt.cpp13
-rw-r--r--WebKit/qt/WebCoreSupport/PageClientQt.h6
-rw-r--r--WebKit/qt/WebCoreSupport/QtPlatformPlugin.cpp12
-rw-r--r--WebKit/qt/WebCoreSupport/QtPlatformPlugin.h2
-rw-r--r--WebKit/qt/WebCoreSupport/WebPlatformStrategies.cpp68
-rw-r--r--WebKit/qt/WebCoreSupport/WebPlatformStrategies.h22
-rw-r--r--WebKit/qt/examples/examples.pro2
-rw-r--r--WebKit/qt/examples/platformplugin/README3
-rw-r--r--WebKit/qt/examples/platformplugin/WebPlugin.cpp23
-rw-r--r--WebKit/qt/examples/platformplugin/WebPlugin.h8
-rw-r--r--WebKit/qt/examples/platformplugin/qwebkitplatformplugin.h7
-rw-r--r--WebKit/qt/symbian/eabi/QtWebKitu.def2
-rw-r--r--WebKit/qt/tests/qwebframe/tst_qwebframe.cpp6
-rw-r--r--WebKit/qt/tests/qwebpage/tst_qwebpage.cpp39
-rw-r--r--WebKit/qt/tests/qwebview/tst_qwebview.cpp8
-rw-r--r--WebKit/win/ChangeLog134
-rw-r--r--WebKit/win/Interfaces/IWebPreferencesPrivate.idl3
-rw-r--r--WebKit/win/Interfaces/WebKit.idl2
-rw-r--r--WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp2
-rw-r--r--WebKit/win/WebCoreSupport/WebFrameLoaderClient.h2
-rw-r--r--WebKit/win/WebCoreSupport/WebPlatformStrategies.cpp52
-rw-r--r--WebKit/win/WebCoreSupport/WebPlatformStrategies.h12
-rw-r--r--WebKit/win/WebFrame.cpp1
-rw-r--r--WebKit/win/WebKit.vcproj/WebKit.sln24
-rw-r--r--WebKit/win/WebPreferenceKeysPrivate.h1
-rw-r--r--WebKit/win/WebPreferences.cpp14
-rw-r--r--WebKit/win/WebPreferences.h3
-rwxr-xr-xWebKit/win/WebView.cpp20
-rw-r--r--WebKit/wince/ChangeLog57
-rw-r--r--WebKit/wince/WebCoreSupport/ChromeClientWinCE.cpp393
-rw-r--r--WebKit/wince/WebCoreSupport/ChromeClientWinCE.h174
-rw-r--r--WebKit/wince/WebCoreSupport/ContextMenuClientWinCE.cpp22
-rw-r--r--WebKit/wince/WebCoreSupport/ContextMenuClientWinCE.h4
-rw-r--r--WebKit/wince/WebCoreSupport/DragClientWinCE.cpp14
-rw-r--r--WebKit/wince/WebCoreSupport/DragClientWinCE.h2
-rw-r--r--WebKit/wince/WebCoreSupport/EditorClientWinCE.cpp106
-rw-r--r--WebKit/wince/WebCoreSupport/EditorClientWinCE.h6
-rw-r--r--WebKit/wince/WebCoreSupport/FrameLoaderClientWinCE.cpp9
-rw-r--r--WebKit/wince/WebCoreSupport/FrameLoaderClientWinCE.h3
-rw-r--r--WebKit/wince/WebCoreSupport/InspectorClientWinCE.cpp20
-rw-r--r--WebKit/wince/WebCoreSupport/InspectorClientWinCE.h6
-rw-r--r--WebKit/wince/WebCoreSupport/PlatformStrategiesWinCE.cpp663
-rw-r--r--WebKit/wince/WebCoreSupport/PlatformStrategiesWinCE.h148
-rw-r--r--WebKit/wx/ChangeLog24
-rw-r--r--WebKit/wx/WebKitSupport/ChromeClientWx.cpp2
-rw-r--r--WebKit/wx/WebKitSupport/FrameLoaderClientWx.cpp2
-rw-r--r--WebKit/wx/WebKitSupport/FrameLoaderClientWx.h2
-rw-r--r--WebKitTools/BuildSlaveSupport/build.webkit.org-config/config.json3
-rw-r--r--WebKitTools/BuildSlaveSupport/build.webkit.org-config/master.cfg10
-rw-r--r--WebKitTools/CMakeListsEfl.txt5
-rw-r--r--WebKitTools/CSSTestSuiteHarness/harness/harness.css220
-rw-r--r--WebKitTools/CSSTestSuiteHarness/harness/harness.html206
-rw-r--r--WebKitTools/CSSTestSuiteHarness/harness/harness.js1314
-rw-r--r--WebKitTools/ChangeLog1497
-rw-r--r--WebKitTools/DumpRenderTree/LayoutTestController.cpp19
-rw-r--r--WebKitTools/DumpRenderTree/LayoutTestController.h1
-rw-r--r--WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginObject.cpp11
-rw-r--r--WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginObject.h2
-rw-r--r--WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginTest.cpp5
-rw-r--r--WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginTest.h1
-rw-r--r--WebKitTools/DumpRenderTree/TestNetscapePlugIn/Tests/win/WindowGeometryInitializedBeforeSetWindow.cpp83
-rw-r--r--WebKitTools/DumpRenderTree/TestNetscapePlugIn/main.cpp24
-rw-r--r--WebKitTools/DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.vcproj48
-rw-r--r--WebKitTools/DumpRenderTree/chromium/DumpRenderTree.cpp5
-rw-r--r--WebKitTools/DumpRenderTree/chromium/LayoutTestController.cpp23
-rw-r--r--WebKitTools/DumpRenderTree/chromium/LayoutTestController.h1
-rw-r--r--WebKitTools/DumpRenderTree/chromium/TestEventPrinter.cpp3
-rw-r--r--WebKitTools/DumpRenderTree/chromium/TestShell.cpp2
-rw-r--r--WebKitTools/DumpRenderTree/chromium/TestShell.h3
-rw-r--r--WebKitTools/DumpRenderTree/chromium/TestShellGtk.cpp17
-rw-r--r--WebKitTools/DumpRenderTree/chromium/TextInputController.cpp22
-rw-r--r--WebKitTools/DumpRenderTree/chromium/WebPreferences.cpp7
-rw-r--r--WebKitTools/DumpRenderTree/chromium/WebPreferences.h3
-rw-r--r--WebKitTools/DumpRenderTree/gtk/DumpRenderTree.cpp90
-rw-r--r--WebKitTools/DumpRenderTree/gtk/EventSender.cpp60
-rw-r--r--WebKitTools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp103
-rw-r--r--WebKitTools/DumpRenderTree/gtk/fonts.conf258
-rw-r--r--WebKitTools/DumpRenderTree/gtk/fonts/AHEM____.TTFbin0 -> 12480 bytes
-rw-r--r--WebKitTools/DumpRenderTree/gtk/fonts/fonts.conf282
-rw-r--r--WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm5
-rw-r--r--WebKitTools/DumpRenderTree/qt/DumpRenderTree.pro5
-rw-r--r--WebKitTools/DumpRenderTree/qt/DumpRenderTreeQt.cpp3
-rw-r--r--WebKitTools/DumpRenderTree/qt/EventSenderQt.cpp18
-rw-r--r--WebKitTools/DumpRenderTree/qt/EventSenderQt.h6
-rw-r--r--WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp2
-rw-r--r--WebKitTools/DumpRenderTree/qt/TextInputControllerQt.cpp2
-rw-r--r--WebKitTools/DumpRenderTree/win/DumpRenderTree.vcproj46
-rw-r--r--WebKitTools/DumpRenderTree/win/LayoutTestControllerWin.cpp6
-rw-r--r--WebKitTools/DumpRenderTree/wx/LayoutTestControllerWx.cpp6
-rwxr-xr-xWebKitTools/EWSTools/start-commit-queue.sh3
-rw-r--r--WebKitTools/EWebLauncher/main.c53
-rw-r--r--WebKitTools/GNUmakefile.am8
-rw-r--r--WebKitTools/MiniBrowser/Configurations/MiniBrowserCFLite.vsprops15
-rw-r--r--WebKitTools/MiniBrowser/Configurations/MiniBrowserCommon.vsprops8
-rw-r--r--WebKitTools/MiniBrowser/Configurations/MiniBrowserCoreFoundation.vsprops15
-rw-r--r--WebKitTools/MiniBrowser/MiniBrowser.vcproj153
-rw-r--r--WebKitTools/MiniBrowser/mac/BrowserWindowController.m15
-rw-r--r--WebKitTools/MiniBrowser/mac/MiniBrowser_Prefix.pch2
-rw-r--r--WebKitTools/MiniBrowser/win/BrowserView.cpp8
-rw-r--r--WebKitTools/QtTestBrowser/launcherwindow.cpp17
-rw-r--r--WebKitTools/QtTestBrowser/launcherwindow.h5
-rw-r--r--WebKitTools/QtTestBrowser/main.cpp35
-rw-r--r--WebKitTools/QtTestBrowser/urlloader.cpp21
-rw-r--r--WebKitTools/QtTestBrowser/urlloader.h7
-rw-r--r--WebKitTools/QtTestBrowser/utils.cpp4
-rw-r--r--WebKitTools/QtTestBrowser/webview.cpp4
-rw-r--r--WebKitTools/QtTestBrowser/webview.h2
-rw-r--r--WebKitTools/QueueStatusServer/handlers/queuestatus.py13
-rw-r--r--WebKitTools/QueueStatusServer/handlers/updatestatus.py17
-rw-r--r--WebKitTools/QueueStatusServer/model/activeworkitems.py42
-rw-r--r--WebKitTools/QueueStatusServer/templates/queuestatus.html7
-rwxr-xr-xWebKitTools/Scripts/build-webkit21
-rwxr-xr-xWebKitTools/Scripts/old-run-webkit-tests3
-rwxr-xr-xWebKitTools/Scripts/prepare-ChangeLog2
-rwxr-xr-xWebKitTools/Scripts/run-chromium-webkit-unit-tests51
-rwxr-xr-xWebKitTools/Scripts/test-webkitpy19
-rw-r--r--WebKitTools/Scripts/webkitdirs.pm79
-rw-r--r--WebKitTools/Scripts/webkitpy/common/config/committers.py3
-rw-r--r--WebKitTools/Scripts/webkitpy/common/net/buildbot.py64
-rw-r--r--WebKitTools/Scripts/webkitpy/common/net/buildbot_unittest.py73
-rw-r--r--WebKitTools/Scripts/webkitpy/common/net/credentials.py20
-rw-r--r--WebKitTools/Scripts/webkitpy/common/net/credentials_unittest.py23
-rw-r--r--WebKitTools/Scripts/webkitpy/common/net/failuremap.py48
-rw-r--r--WebKitTools/Scripts/webkitpy/common/net/regressionwindow.py48
-rw-r--r--WebKitTools/Scripts/webkitpy/common/system/user.py35
-rw-r--r--WebKitTools/Scripts/webkitpy/common/system/user_unittest.py47
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/checksum-expected.checksum1
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/checksum-expected.png1
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/checksum-expected.txt1
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/checksum.html1
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/crash.html1
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/exception.html1
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/hang.html1
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/image-expected.checksum1
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/image-expected.png1
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/image-expected.txt1
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/image.html1
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/image_checksum-expected.checksum1
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/image_checksum-expected.png1
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/image_checksum-expected.txt1
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/image_checksum.html1
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/keyboard.html1
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/missing_check-expected.png1
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/missing_check-expected.txt1
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/missing_check.html1
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/missing_image.html1
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/missing_text.html1
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/text-expected.txt1
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/text.html1
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/timeout.html1
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/data/failures/unexpected/text-image-checksum-expected.checksum1
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/data/failures/unexpected/text-image-checksum-expected.png1
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/data/failures/unexpected/text-image-checksum-expected.txt1
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/data/failures/unexpected/text-image-checksum.html1
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/data/http/tests/passes/text-expected.txt1
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/data/http/tests/passes/text.html1
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/data/http/tests/ssl/text-expected.txt1
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/data/http/tests/ssl/text.html1
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/data/passes/error-expected.txt1
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/data/passes/error.html1
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/data/passes/image-expected.checksum1
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/data/passes/image-expected.png1
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/data/passes/image-expected.txt1
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/data/passes/image.html1
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/data/passes/platform_image-expected.checksum1
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/data/passes/platform_image-expected.png1
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/data/passes/platform_image-expected.txt1
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/data/passes/platform_image.html1
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/data/passes/text-expected.txt1
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/data/passes/text.html1
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/data/platform/test/passes/platform_image-expected.checksum1
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/data/platform/test/passes/platform_image-expected.png1
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/data/platform/test/passes/platform_image-expected.txt1
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/data/platform/test/test_expectations.txt13
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/data/resources/README.txt2
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/data/websocket/tests/passes/text-expected.txt1
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/data/websocket/tests/passes/text.html1
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/layout_package/printing.py17
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/layout_package/printing_unittest.py12
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_expectations.py39
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_expectations_unittest.py7
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/port/base.py115
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/port/base_unittest.py16
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/port/chromium.py48
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_gpu.py137
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_gpu_unittest.py58
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_linux.py9
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_mac.py9
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_unittest.py53
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_win.py9
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/port/dryrun.py95
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/port/factory.py43
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/port/factory_unittest.py10
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/port/google_chrome.py12
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/port/google_chrome_unittest.py3
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/port/gtk.py7
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/port/mac.py7
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/port/port_testcase.py12
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/port/qt.py7
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/port/server_process.py2
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/port/test.py262
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/port/test_files.py (renamed from WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_files.py)14
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/port/test_files_unittest.py68
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/port/webkit.py59
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/port/webkit_unittest.py2
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/port/win.py7
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests.py39
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests_unittest.py17
-rwxr-xr-xWebKitTools/Scripts/webkitpy/layout_tests/run_webkit_tests.py46
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py66
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/test_types/image_diff.py31
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/test_types/test_type_base.py10
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/test_types/text_diff.py21
-rw-r--r--WebKitTools/Scripts/webkitpy/style/checkers/test_expectations.py3
-rw-r--r--WebKitTools/Scripts/webkitpy/test/main.py12
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/bot/commitqueuetask.py158
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/bot/commitqueuetask_unittest.py194
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/bot/feeders.py73
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/bot/feeders_unittest.py70
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/bot/queueengine.py2
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/commands/download.py2
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/commands/openbugs.py4
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/commands/queries.py47
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/commands/queues.py253
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/commands/queues_unittest.py160
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/commands/queuestest.py5
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/commands/rebaseline.py9
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/commands/sheriffbot.py14
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/commands/upload.py8
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/mocktool.py20
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/multicommandtool.py14
-rw-r--r--WebKitTools/WebKitTestRunner/Configurations/InjectedBundleCFLite.vsprops12
-rw-r--r--WebKitTools/WebKitTestRunner/Configurations/InjectedBundleCommon.vsprops5
-rw-r--r--WebKitTools/WebKitTestRunner/Configurations/InjectedBundleCoreFoundation.vsprops12
-rw-r--r--WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundle.h1
-rw-r--r--WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp4
-rw-r--r--WebKitTools/WebKitTestRunner/TestController.cpp5
-rw-r--r--WebKitTools/WebKitTestRunner/win/InjectedBundle.vcproj135
-rw-r--r--WebKitTools/WebKitTestRunner/win/WebKitTestRunner.vcproj147
-rw-r--r--WebKitTools/wx/packaging/build-mac-installer.py7
-rw-r--r--WebKitTools/wx/packaging/build-win-installer.py5
1236 files changed, 45519 insertions, 10543 deletions
diff --git a/JavaScriptCore/API/JSStringRef.h b/JavaScriptCore/API/JSStringRef.h
index 51871b1..c5c1544 100644
--- a/JavaScriptCore/API/JSStringRef.h
+++ b/JavaScriptCore/API/JSStringRef.h
@@ -38,7 +38,7 @@ extern "C" {
#endif
#if !defined(WIN32) && !defined(_WIN32) && !defined(__WINSCW__) \
- && !((defined(__CC_ARM) || defined(__ARMCC__)) && defined(__SYMBIAN32__)) /* RVCT */
+ && !((defined(__CC_ARM) || defined(__ARMCC__)) && !defined(__linux__)) /* RVCT */
/*!
@typedef JSChar
@abstract A Unicode character.
diff --git a/JavaScriptCore/ChangeLog b/JavaScriptCore/ChangeLog
index 045347a..bbdf703 100644
--- a/JavaScriptCore/ChangeLog
+++ b/JavaScriptCore/ChangeLog
@@ -1,3 +1,803 @@
+2010-09-29 Patrick Gansterer <paroga@webkit.org>
+
+ Unreviewed.
+
+ Next try to fix cygwin build.
+
+ * wtf/Assertions.cpp:
+
+2010-09-29 Patrick Gansterer <paroga@webkit.org>
+
+ Unreviewed.
+
+ Build fix for cygwin #2. It's OS(WINDOWS), not OS(WIN).
+
+ * wtf/Assertions.cpp:
+
+2010-09-29 Patrick Gansterer <paroga@webkit.org>
+
+ Unreviewed.
+
+ Build fix for cygwin.
+
+ * wtf/Assertions.cpp:
+
+2010-09-29 Patrick Gansterer <paroga@webkit.org>
+
+ Reviewed by Andreas Kling.
+
+ [WINCE] Buildfix for Assertions.cpp after r68511.
+ https://bugs.webkit.org/show_bug.cgi?id=46807
+
+ Some, but not all WinCE environments have support for IsDebuggerPresent().
+ Add HAVE(ISDEBUGGERPRESENT) to make this a build option.
+ HAVE(ISDEBUGGERPRESENT) will be 1 for all OS(WIN) by default.
+
+ * wtf/Assertions.cpp:
+ * wtf/Platform.h:
+
+2010-09-29 Peter Varga <pvarga@inf.u-szeged.hu>
+
+ Reviewed by Csaba Osztrogonác.
+
+ JSC compile fails on 32bit platform when Regexp Tracing is enabled
+ https://bugs.webkit.org/show_bug.cgi?id=46713
+
+ Fix the cast of pointer in regexp tracing to avoid the warning.
+
+ * runtime/RegExp.cpp:
+ (JSC::RegExp::match):
+
+2010-09-28 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Begin hooking up painting in the plug-in process
+ https://bugs.webkit.org/show_bug.cgi?id=46766
+
+ * JavaScriptCore.exp:
+ Add tryFastRealloc, used by WebKit2.
+
+2010-09-28 Philippe Normand <pnormand@igalia.com>
+
+ Reviewed by Martin Robinson.
+
+ Guard GRefPtr/GOwnPtr files with ENABLE(GLIB_SUPPORT)
+ https://bugs.webkit.org/show_bug.cgi?id=46721
+
+ Enable GOwnPtr/GRefPtr build only if glib support has been
+ explicitly enabled using the WTF_ENABLE_GLIB_SUPPORT macro.
+
+ * wtf/gobject/GOwnPtr.cpp:
+ * wtf/gobject/GOwnPtr.h:
+ * wtf/gobject/GRefPtr.cpp:
+ * wtf/gobject/GRefPtr.h:
+
+2010-09-28 İsmail Dönmez <ismail@namtrac.org>
+
+ Reviewed by Andreas Kling.
+
+ Test for WINCE instead of WINCEBASIC, compiler always defines WINCE.
+ Remove reference to unexisting path JavaScriptCore/os-wince.
+
+ * JavaScriptCore.pri:
+ * wtf/Assertions.cpp:
+
+2010-09-27 Michael Saboff <msaboff@apple.com>
+
+ Reviewed by Geoffrey Garen.
+
+ Changed the initialization of JSArray objects to have space for
+ 3 elements for the constructor that takes a ArgList argument.
+ This improves v8-deltablue performance by about 2.8% by reducing
+ the number of realloc() calls.
+ https://bugs.webkit.org/show_bug.cgi?id=46664
+
+ * runtime/JSArray.cpp:
+ (JSC::JSArray::JSArray):
+
+2010-09-27 Gavin Barraclough <barraclough@apple.com>
+
+ Reviewed by Darin Adler.
+
+ Bug 46680 - Inlining string concatenation can regress interpreter performance
+ <rdar://problem/8362752> REGRESSION: ~6.4% sunspider regression in interpreter
+ Do not inline calls to string concatenation in the interpret loop.
+
+ * interpreter/Interpreter.cpp:
+ (JSC::concatenateStrings):
+ (JSC::Interpreter::privateExecute):
+
+2010-09-27 Anders Carlsson <andersca@apple.com>
+
+ Fix thinko.
+
+ * runtime/JSCell.h:
+
+2010-09-27 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Adam Roben.
+
+ Try to fix Windows build.
+
+ * runtime/JSCell.h:
+ (JSC::MSVCBugWorkaround::MSVCBugWorkaround):
+ (JSC::MSVCBugWorkaround::~MSVCBugWorkaround):
+
+2010-09-27 Erik Arvidsson <arv@chromium.org>
+
+ Reviewed by Darin Adler.
+
+ Add operator == for AtomicString and Vector<Uchar>
+ https://bugs.webkit.org/show_bug.cgi?id=46509
+
+ * JavaScriptCore.exp:
+ * wtf/text/AtomicString.cpp:
+ (WTF::operator==):
+ * wtf/text/AtomicString.h:
+ (WTF::operator==):
+ (WTF::operator!=):
+
+2010-09-27 Anders Carlsson <andersca@apple.com>
+
+ Try to fix the Windows build.
+
+ * wtf/Noncopyable.h:
+
+2010-09-26 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Alexey Proskuryakov and Adam Barth.
+
+ Add WTF_MAKE_NONCOPYABLE macro
+ https://bugs.webkit.org/show_bug.cgi?id=46589
+
+ Going forward, we'd like to get rid of the Noncopyable and FastAllocBase classes. The
+ reason for this is that the Itanium C++ ABI states that no empty classes of the same type
+ can be laid out at the same offset in the class. This can result in objects getting larger
+ which leads to memory regressions. (One example of this is the String class which grew by
+ sizeof(void*) when both its base class and its first member variable inherited indirectly
+ from FastAllocBase).
+
+ * wtf/Noncopyable.h:
+ Add a WTF_MAKE_NONCOPYABLE macro and get rid of NoncopyableCustomAllocated.
+
+ * runtime/JSCell.h:
+ * wtf/RefCounted.h:
+ Don't inherit from NoncopyableCustomAllocated. Instead, use WTF_MAKE_NONCOPYABLE.
+
+2010-09-27 Philippe Normand <pnormand@igalia.com>
+
+ Reviewed by Martin Robinson.
+
+ [GTK] use ENABLE(GLIB_SUPPORT)
+ https://bugs.webkit.org/show_bug.cgi?id=46630
+
+ * wtf/Platform.h: Include GTypedefs.h only if glib support
+ is explicitly enabled.
+
+2010-09-25 Holger Hans Peter Freyther <holger@moiji-mobile.com>
+
+ Reviewed by Adam Barth.
+
+ jsc: Document the strcat opcode.
+ https://bugs.webkit.org/show_bug.cgi?id=46571
+
+ * interpreter/Interpreter.cpp:
+ (JSC::Interpreter::privateExecute):
+
+2010-09-21 Holger Hans Peter Freyther <holger@moiji-mobile.com>
+
+ Reviewed by Adam Barth.
+
+ make-bytecode-docs.pl: Add a comment to the generated HTML
+ https://bugs.webkit.org/show_bug.cgi?id=46570
+
+ Generate an HTML Comment that this file was generated from
+ Interpreter.cpp with the make-bytecode-docs.pl script.
+
+ * docs/make-bytecode-docs.pl:
+
+2010-09-27 Patrick Gansterer <paroga@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Remove WTF::stringHash functions
+ https://bugs.webkit.org/show_bug.cgi?id=46520
+
+ Since r68289 the stringHash functions are only wrappers around StringHasher::createHash.
+ So use StringHasher::createHash directly and remove stringHash.
+
+ * wtf/StringHashFunctions.h:
+ * wtf/text/StringImpl.h:
+ (WTF::StringImpl::computeHash): Use WTF::StringHasher::createHash directly.
+
+2010-09-26 Patrick Gansterer <paroga@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Add WTF::StringHasher::createBlobHash
+ https://bugs.webkit.org/show_bug.cgi?id=46514
+
+ Add this function for hashing FormElementKey and QualifiedNameComponents.
+
+ * wtf/StringHashFunctions.h:
+ (WTF::StringHasher::createBlobHash):
+
+2010-09-26 Patrick Gansterer <paroga@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ REGRESSION (r68289): Assertion failure in StringHasher::addCharacter() (ch != invalidCharacterValue)
+ running websocket/tests/bad-sub-protocol-non-ascii.html
+ https://bugs.webkit.org/show_bug.cgi?id=46553
+
+ Because we use StringHasher for binary data too, so the check for invalid unicode input is wrong.
+ Add an additional member variable to indicate if we have an pending character
+ instead of only using an invalid character for this purpose.
+
+ * wtf/StringHashFunctions.h:
+ (WTF::StringHasher::StringHasher):
+ (WTF::StringHasher::addCharacters):
+ (WTF::StringHasher::addCharacter):
+ (WTF::StringHasher::hash):
+
+2010-09-26 Mark Hahnenberg <mhahnenb@gmail.com>
+
+ Reviewed by Oliver Hunt.
+
+ valueOf called in wrong order in atan2 and date constructors.
+ https://bugs.webkit.org/show_bug.cgi?id=26978
+
+ Fixed the bug where the arguments to atan2 were being evaluated
+ out of order.
+
+ * runtime/MathObject.cpp:
+ (JSC::mathProtoFuncATan2):
+
+2010-09-26 Mark Hahnenberg <mhahnenb@gmail.com>
+
+ Reviewed by Oliver Hunt.
+
+ valueOf called in wrong order in atan2 and date constructors.
+ https://bugs.webkit.org/show_bug.cgi?id=26978
+
+ Fixed the issue where the parameters to the Date constructor
+ were being evaluated to numbers more than once.
+
+ * runtime/DateConstructor.cpp:
+ (JSC::constructDate):
+ (JSC::dateUTC):
+
+2010-09-25 Oliver Hunt <oliver@apple.com>
+
+ Fix various builds
+
+ Relearning the lesson that last minute changes are bad.
+
+ * bytecode/CodeBlock.cpp:
+ (JSC::CodeBlock::dump):
+ * bytecompiler/BytecodeGenerator.cpp:
+ (JSC::BytecodeGenerator::emitGetArgumentsLength):
+ * jit/JITOpcodes.cpp:
+ (JSC::JIT::emitSlow_op_get_argument_by_val):
+
+2010-09-25 Oliver Hunt <oliver@apple.com>
+
+ Reviewed by Cameron Zwarich.
+
+ Avoid constructing arguments object when accessing length and index properties
+ https://bugs.webkit.org/show_bug.cgi?id=46572
+
+ Add opcodes to read argument length and properties, and then implement them.
+ Much like other lazy opcodes these opcodes take a fast path when the arguments
+ object has not been instantiated, and fall back on generic access mechanisms
+ if they are acting on an instantiated object.
+
+ 3% win on v8-earleyboyer, no change elsewhere.
+
+ * bytecode/CodeBlock.cpp:
+ (JSC::CodeBlock::dump):
+ * bytecode/Opcode.h:
+ * bytecompiler/BytecodeGenerator.cpp:
+ (JSC::BytecodeGenerator::emitGetArgumentsLength):
+ (JSC::BytecodeGenerator::emitGetArgumentByVal):
+ * bytecompiler/BytecodeGenerator.h:
+ * bytecompiler/NodesCodegen.cpp:
+ (JSC::BracketAccessorNode::emitBytecode):
+ (JSC::DotAccessorNode::emitBytecode):
+ * interpreter/Interpreter.cpp:
+ (JSC::Interpreter::privateExecute):
+ * jit/JIT.cpp:
+ (JSC::JIT::privateCompileMainPass):
+ (JSC::JIT::privateCompileSlowCases):
+ * jit/JIT.h:
+ * jit/JITOpcodes.cpp:
+ (JSC::JIT::emit_op_get_arguments_length):
+ (JSC::JIT::emitSlow_op_get_arguments_length):
+ (JSC::JIT::emit_op_get_argument_by_val):
+ (JSC::JIT::emitSlow_op_get_argument_by_val):
+ * jit/JITOpcodes32_64.cpp:
+ (JSC::JIT::emit_op_get_arguments_length):
+ (JSC::JIT::emitSlow_op_get_arguments_length):
+ (JSC::JIT::emit_op_get_argument_by_val):
+ (JSC::JIT::emitSlow_op_get_argument_by_val):
+
+2010-09-25 Patrick Gansterer <paroga@webkit.org>
+
+ Unreviewed.
+
+ Fix typo in StringHasher class
+ https://bugs.webkit.org/show_bug.cgi?id=45970
+
+ * wtf/StringHashFunctions.h:
+ (WTF::StringHasher::createHash):
+
+2010-09-24 Patrick Gansterer <paroga@paroga.com>
+
+ Reviewed by Gavin Barraclough.
+
+ Add WTF::StringHasher
+ https://bugs.webkit.org/show_bug.cgi?id=45970
+
+ StringHasher is a class for calculation stringHash out of character string.
+ This class will unify the different usages of the same algorithm.
+
+ * wtf/StringHashFunctions.h:
+ (WTF::StringHasher::StringHasher):
+ (WTF::StringHasher::addCharacters):
+ (WTF::StringHasher::addCharacter):
+ (WTF::StringHasher::hash):
+ (WTF::StringHasher::createHash):
+ (WTF::StringHasher::defaultCoverter):
+ (WTF::StringHasher::addCharactersToHash):
+ (WTF::stringHash):
+
+2010-09-24 Oliver Hunt <oliver@apple.com>
+
+ Reviewed by Geoffrey Garen.
+
+ Variable declarations inside a catch scope don't get propogated to the parent scope
+ https://bugs.webkit.org/show_bug.cgi?id=46501
+
+ Add logic to make variable declaration look for a scope for the
+ new variable. This allows us to create a scope (eg. for catch)
+ and then seal it, so that additional variable declarations
+ contained are propogated to the correct target. Strangely this
+ comes out as a performance win, but I think it's mostly cache
+ effects.
+
+ * parser/JSParser.cpp:
+ (JSC::JSParser::Scope::Scope):
+ (JSC::JSParser::Scope::preventNewDecls):
+ (JSC::JSParser::Scope::allowsNewDecls):
+ (JSC::JSParser::declareVariable):
+ (JSC::JSParser::parseVarDeclarationList):
+ (JSC::JSParser::parseConstDeclarationList):
+ (JSC::JSParser::parseTryStatement):
+ (JSC::JSParser::parseFormalParameters):
+ (JSC::JSParser::parseFunctionDeclaration):
+
+2010-09-24 İsmail Dönmez <ismail@namtrac.org>
+
+ Reviewed by Csaba Osztrogonác.
+
+ Add a Windows compatible inttypes.h header to fix WinCE build.
+ https://bugs.webkit.org/show_bug.cgi?id=46463
+
+ * os-win32/inttypes.h: Added.
+
+2010-09-24 Oliver Hunt <oliver@apple.com>
+
+ Reviewed by Gavin Barraclough.
+
+ REGRESSION(r68223): It broke 2-3 tests on bots (Requested by Ossy on #webkit).
+ https://bugs.webkit.org/show_bug.cgi?id=46448
+
+ Roll this back in, with additional logic to prevent us from delaying construction
+ of functions named "arguments"
+
+ * bytecode/CodeBlock.cpp:
+ (JSC::CodeBlock::dump):
+ * bytecode/Opcode.h:
+ * bytecompiler/BytecodeGenerator.cpp:
+ (JSC::BytecodeGenerator::BytecodeGenerator):
+ (JSC::BytecodeGenerator::emitInitLazyRegister):
+ (JSC::BytecodeGenerator::registerFor):
+ (JSC::BytecodeGenerator::createLazyRegisterIfNecessary):
+ (JSC::BytecodeGenerator::constRegisterFor):
+ (JSC::BytecodeGenerator::emitNewFunction):
+ (JSC::BytecodeGenerator::emitLazyNewFunction):
+ (JSC::BytecodeGenerator::emitNewFunctionInternal):
+ * bytecompiler/BytecodeGenerator.h:
+ * interpreter/Interpreter.cpp:
+ (JSC::Interpreter::privateExecute):
+ * jit/JIT.cpp:
+ (JSC::JIT::privateCompileMainPass):
+ * jit/JIT.h:
+ * jit/JITOpcodes.cpp:
+ (JSC::JIT::emit_op_init_lazy_reg):
+ (JSC::JIT::emit_op_new_func):
+ * jit/JITOpcodes32_64.cpp:
+ (JSC::JIT::emit_op_init_lazy_reg):
+ * parser/Nodes.h:
+ (JSC::ScopeNode::needsActivationForMoreThanVariables):
+
+2010-09-23 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r68223.
+ http://trac.webkit.org/changeset/68223
+ https://bugs.webkit.org/show_bug.cgi?id=46448
+
+ It broke 2-3 tests on bots (Requested by Ossy on #webkit).
+
+ * bytecode/CodeBlock.cpp:
+ (JSC::CodeBlock::dump):
+ * bytecode/Opcode.h:
+ * bytecompiler/BytecodeGenerator.cpp:
+ (JSC::BytecodeGenerator::BytecodeGenerator):
+ (JSC::BytecodeGenerator::registerFor):
+ (JSC::BytecodeGenerator::constRegisterFor):
+ (JSC::BytecodeGenerator::emitNewFunction):
+ * bytecompiler/BytecodeGenerator.h:
+ * interpreter/Interpreter.cpp:
+ (JSC::Interpreter::privateExecute):
+ * jit/JIT.cpp:
+ (JSC::JIT::privateCompileMainPass):
+ * jit/JIT.h:
+ * jit/JITOpcodes.cpp:
+ (JSC::JIT::emit_op_new_func):
+ (JSC::JIT::emit_op_init_arguments):
+ * jit/JITOpcodes32_64.cpp:
+ (JSC::JIT::emit_op_new_func):
+ (JSC::JIT::emit_op_init_arguments):
+ * parser/Nodes.h:
+
+2010-09-23 Oliver Hunt <oliver@apple.com>
+
+ Reviewed by Geoffrey Garen.
+
+ Delay construction of functions that aren't captured
+ https://bugs.webkit.org/show_bug.cgi?id=46433
+
+ If a function isn't captured by an activation there's no
+ way it can be accessed indirectly, so we can delay the
+ construction until it's used (similar to what we do with
+ arguments). We rename the existing op_init_arguments to
+ op_init_lazy_reg and removed its implicit handling of
+ the anonymous argument register, and make op_new_function
+ take a parameter to indicate whether it should null check
+ the target slot before creating the function object.
+
+ * bytecode/CodeBlock.cpp:
+ (JSC::CodeBlock::dump):
+ * bytecode/Opcode.h:
+ * bytecompiler/BytecodeGenerator.cpp:
+ (JSC::BytecodeGenerator::BytecodeGenerator):
+ (JSC::BytecodeGenerator::emitInitLazyRegister):
+ (JSC::BytecodeGenerator::registerFor):
+ (JSC::BytecodeGenerator::createLazyRegisterIfNecessary):
+ (JSC::BytecodeGenerator::constRegisterFor):
+ (JSC::BytecodeGenerator::emitNewFunction):
+ (JSC::BytecodeGenerator::emitLazyNewFunction):
+ (JSC::BytecodeGenerator::emitNewFunctionInternal):
+ * bytecompiler/BytecodeGenerator.h:
+ * interpreter/Interpreter.cpp:
+ (JSC::Interpreter::privateExecute):
+ * jit/JIT.cpp:
+ (JSC::JIT::privateCompileMainPass):
+ * jit/JIT.h:
+ * jit/JITOpcodes.cpp:
+ (JSC::JIT::emit_op_init_lazy_reg):
+ (JSC::JIT::emit_op_new_func):
+ * jit/JITOpcodes32_64.cpp:
+ (JSC::JIT::emit_op_init_lazy_reg):
+ * parser/Nodes.h:
+ (JSC::ScopeNode::needsActivationForMoreThanVariables):
+
+2010-09-23 David Kilzer <ddkilzer@apple.com>
+
+ <rdar://problem/8460731> ~9.9% speedup when compiling interpreter with llvm-gcc-4.2
+ https://bugs.webkit.org/show_bug.cgi?id=46423
+
+ Reviewed by Oliver Hunt.
+
+ * interpreter/Interpreter.cpp:
+ (JSC::Interpreter::privateExecute): Disable the gcc computed
+ goto hacks added in r55564 when compiling with llvm-gcc-4.2.
+
+2010-09-23 Lucas De Marchi <lucas.demarchi@profusion.mobi>
+
+ Reviewed by Darin Adler.
+
+ Fix usage of enum as if it was a define
+ https://bugs.webkit.org/show_bug.cgi?id=46355
+
+ pthread.h defines PTHREAD_MUTEX_DEFAULT and PTHREAD_MUTEX_NORMAL as an
+ enum. Hence, it cannot be used by the preprocessor which always
+ evaluates that condition as true. This was giving a warning when
+ compiling with gcc and "-Wundef" flag.
+
+ The second path, when PTHREAD_MUTEX_DEFAULT is not the same of
+ PTHREAD_MUTEX_NORMAL, is not slow. So, let's eliminate the first path
+ and get rid of that #if.
+
+ * wtf/ThreadingPthreads.cpp: Always call pthread_mutexattr_init() to
+ set mutex type to PTHREAD_MUTEX_NORMAL.
+ (WTF::Mutex::Mutex):
+
+2010-09-23 Michael Saboff <msaboff@apple.com>
+
+ Reviewed by Geoffrey Garen.
+
+ Removed extraneous truncation of ovector on entry and error exit.
+ Changed the initialization to -1 of vector to only initialize
+ the start indecies, which is sufficient for the pattern/subpatterns.
+ Changed the JIT code to not clear the end index for subpatterns
+ as it isn't needed. These changes are worth ~2.7% on v8-regexp.
+ https://bugs.webkit.org/show_bug.cgi?id=46404
+
+ * runtime/RegExp.cpp:
+ (JSC::RegExp::match):
+ * yarr/RegexJIT.cpp:
+ (JSC::Yarr::RegexGenerator::generateParenthesesSingle):
+
+2010-09-22 Oliver Hunt <oliver@apple.com>
+
+ Reviewed by Geoff Garen.
+
+ Only copy captured variables into activation
+ https://bugs.webkit.org/show_bug.cgi?id=46330
+
+ We now track free variable information which means that
+ we no longer need to copy every variable defined in a
+ function. With this patch activations only retain those
+ variables needed for correctness. In order to interact
+ safely with the inspector this means that JSActivation
+ now provides its own lookup functions so it can avoid
+ trying to read or write to variables that have been
+ optimised out.
+
+ * bytecode/CodeBlock.h:
+ * bytecompiler/BytecodeGenerator.cpp:
+ (JSC::BytecodeGenerator::BytecodeGenerator):
+ * parser/Nodes.h:
+ (JSC::ScopeNode::capturedVariableCount):
+ (JSC::ScopeNode::captures):
+ * runtime/Arguments.h:
+ (JSC::JSActivation::copyRegisters):
+ * runtime/Executable.cpp:
+ (JSC::FunctionExecutable::FunctionExecutable):
+ (JSC::FunctionExecutable::compileForCallInternal):
+ (JSC::FunctionExecutable::compileForConstructInternal):
+ * runtime/Executable.h:
+ (JSC::FunctionExecutable::capturedVariableCount):
+ * runtime/JSActivation.cpp:
+ (JSC::JSActivation::markChildren):
+ (JSC::JSActivation::symbolTableGet):
+ (JSC::JSActivation::symbolTablePut):
+ (JSC::JSActivation::getOwnPropertyNames):
+ (JSC::JSActivation::symbolTablePutWithAttributes):
+ * runtime/JSActivation.h:
+
+2010-09-23 Ismail Donmez <ismail@namtrac.org>
+
+ Reviewed by Andreas Kling.
+
+ Fix jsc.exe build for Windows CE
+
+ * jsc.pro: Add mmtimer.lib for Windows CE.
+
+2010-09-23 Ismail Donmez <ismail@namtrac.org>
+
+ Unreviewed.
+
+ JIT should be disabled on Windows CE. Broken in r64176.
+
+ * wtf/Platform.h:
+
+2010-09-23 Peter Varga <pvarga@inf.u-szeged.hu>
+
+ Reviewed by Gavin Barraclough.
+
+ Reduce the number of BOL checks in YARR Interpreter
+ https://bugs.webkit.org/show_bug.cgi?id=46260
+
+ Extend the YARR Interpreter with an optimization which reduces the number of
+ BOL assertion checks. If a "TypeBodyAlternative" byteTerm is followed by a
+ "TypeAssertionBOL" byteTerm it will be checked just one time.
+
+ * yarr/RegexInterpreter.cpp:
+ (JSC::Yarr::Interpreter::matchDisjunction):
+ (JSC::Yarr::ByteCompiler::compile):
+ (JSC::Yarr::ByteCompiler::regexBegin):
+ (JSC::Yarr::ByteCompiler::alternativeBodyDisjunction):
+ (JSC::Yarr::ByteCompiler::emitDisjunction):
+ * yarr/RegexInterpreter.h:
+ (JSC::Yarr::ByteTerm::BodyAlternativeBegin):
+ (JSC::Yarr::ByteTerm::BodyAlternativeDisjunction):
+ (JSC::Yarr::ByteTerm::BodyAlternativeEnd):
+ (JSC::Yarr::ByteTerm::AlternativeBegin):
+ (JSC::Yarr::ByteTerm::AlternativeDisjunction):
+ (JSC::Yarr::ByteTerm::AlternativeEnd):
+
+2010-09-22 Michael Saboff <msaboff@apple.com>
+
+ Reviewed by Gavin Barraclough.
+
+ Fixed the cross over from alternatives executed once and
+ those that loop. This fixed the problem where the index
+ was getting messed up for looping alternatives causing an
+ infinite loop.
+ https://bugs.webkit.org/show_bug.cgi?id=46189
+
+ * yarr/RegexJIT.cpp:
+ (JSC::Yarr::RegexGenerator::generateDisjunction):
+
+2010-09-22 Steve Falkenburg <sfalken@apple.com>
+
+ Rubber stamped by Jon Honeycutt.
+
+ Allow jsc.exe to be run against unversioned ICU.
+
+ * JavaScriptCore.vcproj/jsc/jscCommon.vsprops:
+
+2010-09-22 Kwang Yul Seo <skyul@company100.net>
+
+ Reviewed by Laszlo Gombos.
+
+ Use "typedef wchar_t JSChar" when compiled with RVCT
+ https://bugs.webkit.org/show_bug.cgi?id=40651
+
+ Use wchar_t for JSChar and UChar when compiled with RVCT.
+ Linux is the exception for this rule.
+
+ * API/JSStringRef.h:
+ * wtf/unicode/qt4/UnicodeQt4.h:
+
+2010-09-22 Oliver Hunt <oliver@apple.com>
+
+ Reviewed by Gavin Barraclough.
+
+ [INTERPRETER] Two tests fail with SputnikError: #1.1: if argArray is neither an array nor an arguments object (see 10.1.8), a TypeError exception is thrown
+ https://bugs.webkit.org/show_bug.cgi?id=44245
+
+ Remove incorrect code from op_load_varargs in the interpreter.
+
+ * interpreter/Interpreter.cpp:
+ (JSC::Interpreter::privateExecute):
+
+2010-09-22 Oliver Hunt <oliver@apple.com>
+
+ Reviewed by Gavin Barraclough.
+
+ [JIT] fast/js/sputnik/Conformance/15_Native_Objects/15.3_Function/15.3.5/S15.3.5.3_A2_T6.html fails
+ https://bugs.webkit.org/show_bug.cgi?id=44246
+
+ JIT code generated for instanceof was not checking to ensure that the prototype property was
+ an object, this patch ensures that it does.
+
+ * jit/JITOpcodes.cpp:
+ (JSC::JIT::emit_op_instanceof):
+ (JSC::JIT::emitSlow_op_instanceof):
+ * jit/JITOpcodes32_64.cpp:
+ (JSC::JIT::emit_op_instanceof):
+ (JSC::JIT::emitSlow_op_instanceof):
+
+2010-09-22 Patrick Gansterer <paroga@webkit.org>
+
+ Reviewed by Darin Adler.
+
+ Inline UTF8SequenceLength
+ https://bugs.webkit.org/show_bug.cgi?id=45589
+
+ * wtf/unicode/UTF8.cpp:
+ (WTF::Unicode::convertUTF8ToUTF16): Use inline version of UTF8SequenceLength to improve performance.
+
+2010-09-21 Oliver Hunt <oliver@apple.com>
+
+ RS=Gavin Barraclough.
+
+ Fix codeblock dumping
+
+ * bytecode/CodeBlock.cpp:
+ (JSC::CodeBlock::dump):
+ * runtime/Executable.h:
+ (JSC::ScriptExecutable::ScriptExecutable):
+
+2010-09-21 Oliver Hunt <oliver@apple.com>
+
+ Reviewed by Geoffrey Garen.
+
+ Speed up function.apply(..., arguments)
+ https://bugs.webkit.org/show_bug.cgi?id=46207
+
+ Add code to do argument copying inline in the case
+ where we're using Function.apply to forward our arguments
+ directly.
+
+ * jit/JIT.cpp:
+ (JSC::JIT::privateCompileSlowCases):
+ Splitted op_load_varargs into fast and slow paths, so add the call
+ to the slow path generator.
+ * jit/JIT.h:
+ * jit/JITCall32_64.cpp:
+ Remove 32bit specific emit_op_load_varargs as the logic is the
+ same for all value representations
+ * jit/JITOpcodes.cpp:
+ (JSC::JIT::emit_op_load_varargs):
+ Copy arguments inline
+ (JSC::JIT::emitSlow_op_load_varargs):
+
+2010-09-21 Geoffrey Garen <ggaren@apple.com>
+
+ Reviewed by Oliver Hunt.
+
+ <rdar://problem/8363003> REGRESSION: ~1.4% sunspider regression in
+ interpreter due to 54724 and 54596
+
+ Fixed a typo (using "UNLIKELY" instead of "LIKELY").
+
+ * wtf/PassRefPtr.h:
+ (WTF::refIfNotNull):
+ (WTF::derefIfNotNull): It is likely that m_ptr != 0 because most RefPtrs
+ hold real data. Also, in cases where they do not hold real data, the
+ compiler usually sees a call to release() right before the call to the
+ destructor, so it can probably optimize out the test completely.
+
+2010-09-21 Fridrich Strba <fridrich.strba@bluewin.ch>
+
+ Reviewed by Martin Robinson.
+
+ Build issues with Windows versions of the GTK+ port
+ https://bugs.webkit.org/show_bug.cgi?id=45844
+
+ Link with winmm.dll when necessary and specify the executable extension
+ explicitely so that the Programs/jsc-@WEBKITGTK_API_MAJOR_VERSION@
+ rule actually works.
+
+ Don't try to build the ThreadSpecificWin.cpp since GTK+ port uses
+ a section in ThreadSpecific.cpp
+
+ * GNUmakefile.am:
+
+2010-09-21 Martin Robinson <mrobinson@igalia.com>
+
+ Reviewed by Xan Lopez.
+
+ [GTK] 'make dist' should be fixed in preparation for the next release
+ https://bugs.webkit.org/show_bug.cgi?id=46129
+
+ * GNUmakefile.am: Update the sources list to include missing headers.
+
+2010-09-21 Dave Tapuska <dtapuska@rim.com>
+
+ Reviewed by Csaba Osztrogonác.
+
+ https://bugs.webkit.org/show_bug.cgi?id=45673
+
+ r65596 caused ENABLE_PROFILER_REFERENCE_OFFSET to not be
+ 8 byte aligned. A non 8 byte divisible value for this will
+ cause the sp to become non 8 byte aligned.
+
+ Verify and correct offset values that r65596 effected that
+ weren't updated.
+
+ * jit/JITStubs.cpp:
+ * jit/JITStubs.h:
+
+2010-09-21 Xan Lopez <xlopez@igalia.com>
+
+ Reviewed by Martin Robinson.
+
+ Fix Opcode stats compilation
+ https://bugs.webkit.org/show_bug.cgi?id=46079
+
+ The FixedArray API had changed, and <stdio.h> was not included for
+ printf.
+
+ * bytecode/Opcode.cpp:
+ (JSC::OpcodeStats::~OpcodeStats):
+
2010-09-20 Michael Saboff <msaboff@apple.com>
Reviewed by Gavin Barraclough.
diff --git a/JavaScriptCore/Configurations/Version.xcconfig b/JavaScriptCore/Configurations/Version.xcconfig
index e82e464..f688ea8 100644
--- a/JavaScriptCore/Configurations/Version.xcconfig
+++ b/JavaScriptCore/Configurations/Version.xcconfig
@@ -22,7 +22,7 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
MAJOR_VERSION = 534;
-MINOR_VERSION = 9;
+MINOR_VERSION = 10;
TINY_VERSION = 0;
FULL_VERSION = $(MAJOR_VERSION).$(MINOR_VERSION);
diff --git a/JavaScriptCore/GNUmakefile.am b/JavaScriptCore/GNUmakefile.am
index dd2ba21..88d1761 100644
--- a/JavaScriptCore/GNUmakefile.am
+++ b/JavaScriptCore/GNUmakefile.am
@@ -546,7 +546,6 @@ javascriptcore_sources += \
if TARGET_WIN32
javascriptcore_sources += \
- JavaScriptCore/wtf/ThreadSpecificWin.cpp \
JavaScriptCore/runtime/MarkStackWin.cpp
else
javascriptcore_sources += \
@@ -568,9 +567,9 @@ endif # USE_ICU_UNICODE
# ----
if USE_GLIB_UNICODE
javascriptcore_sources += \
+ JavaScriptCore/wtf/unicode/UnicodeMacrosFromICU.h \
JavaScriptCore/wtf/unicode/glib/UnicodeGLib.h \
- JavaScriptCore/wtf/unicode/glib/UnicodeGLib.cpp \
- JavaScriptCore/wtf/unicode/glib/UnicodeMacrosFromICU.h
+ JavaScriptCore/wtf/unicode/glib/UnicodeGLib.cpp
endif
JavaScriptCore/Lexer.lut.h: $(srcdir)/JavaScriptCore/create_hash_table $(srcdir)/JavaScriptCore/parser/Keywords.table
@@ -586,7 +585,7 @@ JavaScriptCore/pcre/chartables.c: $(srcdir)/JavaScriptCore/pcre/dftables
$(AM_V_GEN)$(PERL) $^ $@
bin_PROGRAMS += \
- Programs/jsc-@WEBKITGTK_API_MAJOR_VERSION@
+ Programs/jsc-@WEBKITGTK_API_MAJOR_VERSION@$(EXEEXT)
noinst_PROGRAMS += \
Programs/jsc \
@@ -616,6 +615,7 @@ Programs_minidom_CFLAGS = \
Programs_minidom_LDADD = \
libJavaScriptCore.la \
+ $(WINMM_LIBS) \
-lm \
-lstdc++
@@ -624,8 +624,8 @@ Programs_minidom_LDFLAGS = \
-no-fast-install
# jsc
-Programs/jsc-@WEBKITGTK_API_MAJOR_VERSION@: Programs/jsc
- $(AM_V_GEN)cp -f Programs/jsc Programs/jsc-@WEBKITGTK_API_MAJOR_VERSION@
+Programs/jsc-@WEBKITGTK_API_MAJOR_VERSION@$(EXEEXT): Programs/jsc$(EXEEXT)
+ $(AM_V_GEN)cp -f Programs/jsc$(EXEEXT) Programs/jsc-@WEBKITGTK_API_MAJOR_VERSION@$(EXEEXT)
Programs_jsc_@WEBKITGTK_API_MAJOR_VERSION@_LDADD =
Programs_jsc_@WEBKITGTK_API_MAJOR_VERSION@_SOURCES =
@@ -644,7 +644,8 @@ Programs_jsc_CXXFLAGS = \
$(UNICODE_CFLAGS)
Programs_jsc_LDADD = \
- libJavaScriptCore.la
+ libJavaScriptCore.la \
+ $(WINMM_LIBS)
EXTRA_DIST += \
JavaScriptCore/AUTHORS \
diff --git a/JavaScriptCore/JavaScriptCore.exp b/JavaScriptCore/JavaScriptCore.exp
index 13b9676..ff3d9b3 100644
--- a/JavaScriptCore/JavaScriptCore.exp
+++ b/JavaScriptCore/JavaScriptCore.exp
@@ -380,6 +380,7 @@ __ZN3WTF13tryFastCallocEmm
__ZN3WTF13tryFastMallocEm
__ZN3WTF14fastMallocSizeEPKv
__ZN3WTF14numberToStringEdPt
+__ZN3WTF14tryFastReallocEPvm
__ZN3WTF15ThreadCondition4waitERNS_5MutexE
__ZN3WTF15ThreadCondition6signalEv
__ZN3WTF15ThreadCondition9broadcastEv
@@ -474,6 +475,7 @@ __ZN3WTF9dayInYearEdi
__ZN3WTF9emptyAtomE
__ZN3WTF9xmlnsAtomE
__ZN3WTFeqERKNS_12AtomicStringEPKc
+__ZN3WTFeqERKNS_12AtomicStringERKNS_6VectorItLm0EEE
__ZN3WTFeqERKNS_7CStringES2_
__ZN3WTFplEPKcRKNS_6StringE
__ZN3WTFplERKNS_6StringEPKc
diff --git a/JavaScriptCore/JavaScriptCore.pri b/JavaScriptCore/JavaScriptCore.pri
index 8ef9b30..57b1ce8 100644
--- a/JavaScriptCore/JavaScriptCore.pri
+++ b/JavaScriptCore/JavaScriptCore.pri
@@ -56,9 +56,6 @@ DEFINES += BUILDING_QT__ BUILDING_JavaScriptCore BUILDING_WTF
wince* {
INCLUDEPATH += $$QT_SOURCE_TREE/src/3rdparty/ce-compat
- DEFINES += WINCEBASIC
-
- INCLUDEPATH += $$PWD/../JavaScriptCore/os-wince
INCLUDEPATH += $$PWD/../JavaScriptCore/os-win32
}
diff --git a/JavaScriptCore/JavaScriptCore.vcproj/jsc/jscCommon.vsprops b/JavaScriptCore/JavaScriptCore.vcproj/jsc/jscCommon.vsprops
index e5cc866..b63729c 100644
--- a/JavaScriptCore/JavaScriptCore.vcproj/jsc/jscCommon.vsprops
+++ b/JavaScriptCore/JavaScriptCore.vcproj/jsc/jscCommon.vsprops
@@ -19,7 +19,7 @@
/>
<Tool
Name="VCPostBuildEventTool"
- CommandLine="if exist &quot;$(WebKitOutputDir)\buildfailed&quot; del &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icudt40.dll&quot; xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icudt40.dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icudt40$(LibraryConfigSuffix).dll&quot; xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icudt40$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).dll&quot; xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).dll&quot; xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icudt42.dll&quot; xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icudt42.dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icudt42$(LibraryConfigSuffix).dll&quot; xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icudt42$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuin42$(LibraryConfigSuffix).dll&quot; xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuin42$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuuc42$(LibraryConfigSuffix).dll&quot; xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuuc42$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).dll&quot; xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\CoreFoundation.resources&quot; xcopy /y /d /e /i &quot;$(WebKitLibrariesDir)\bin\CoreFoundation.resources&quot; &quot;$(WebKitOutputDir)\bin\CoreFoundation.resources&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\pthreadVC2$(LibraryConfigSuffix).dll&quot; xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\pthreadVC2$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\objc$(LibraryConfigSuffix).dll&quot; xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\objc$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\ASL$(LibraryConfigSuffix).dll&quot; xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\ASL$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\libdispatch$(LibraryConfigSuffix).dll&quot; xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\libdispatch$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;&#x0D;&#x0A;cmd /c&#x0D;&#x0A;"
+ CommandLine="if exist &quot;$(WebKitOutputDir)\buildfailed&quot; del &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icudt44.dll&quot; xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icudt44.dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icudt44$(LibraryConfigSuffix).dll&quot; xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icudt44$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\libicuin$(LibraryConfigSuffix).dll&quot; xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\libicuin$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\libicuuc$(LibraryConfigSuffix).dll&quot; xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\libicuuc$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icudt40.dll&quot; xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icudt40.dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icudt40$(LibraryConfigSuffix).dll&quot; xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icudt40$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).dll&quot; xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).dll&quot; xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icudt42.dll&quot; xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icudt42.dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icudt42$(LibraryConfigSuffix).dll&quot; xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icudt42$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuin42$(LibraryConfigSuffix).dll&quot; xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuin42$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuuc42$(LibraryConfigSuffix).dll&quot; xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuuc42$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).dll&quot; xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\CoreFoundation.resources&quot; xcopy /y /d /e /i &quot;$(WebKitLibrariesDir)\bin\CoreFoundation.resources&quot; &quot;$(WebKitOutputDir)\bin\CoreFoundation.resources&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\pthreadVC2$(LibraryConfigSuffix).dll&quot; xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\pthreadVC2$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\objc$(LibraryConfigSuffix).dll&quot; xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\objc$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\ASL$(LibraryConfigSuffix).dll&quot; xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\ASL$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\libdispatch$(LibraryConfigSuffix).dll&quot; xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\libdispatch$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;&#x0D;&#x0A;cmd /c&#x0D;&#x0A;"
/>
<Tool
Name="VCPreBuildEventTool"
diff --git a/JavaScriptCore/bytecode/CodeBlock.cpp b/JavaScriptCore/bytecode/CodeBlock.cpp
index 0749cf6..6c0696e 100644
--- a/JavaScriptCore/bytecode/CodeBlock.cpp
+++ b/JavaScriptCore/bytecode/CodeBlock.cpp
@@ -495,9 +495,9 @@ void CodeBlock::dump(ExecState* exec, const Vector<Instruction>::const_iterator&
printf("[%4d] create_arguments\t %s\n", location, registerName(exec, r0).data());
break;
}
- case op_init_arguments: {
+ case op_init_lazy_reg: {
int r0 = (++it)->u.operand;
- printf("[%4d] init_arguments\t %s\n", location, registerName(exec, r0).data());
+ printf("[%4d] init_lazy_reg\t %s\n", location, registerName(exec, r0).data());
break;
}
case op_get_callee: {
@@ -712,16 +712,16 @@ void CodeBlock::dump(ExecState* exec, const Vector<Instruction>::const_iterator&
}
case op_resolve_global: {
int r0 = (++it)->u.operand;
- JSValue scope = JSValue((++it)->u.jsCell);
int id0 = (++it)->u.operand;
- printf("[%4d] resolve_global\t %s, %s, %s\n", location, registerName(exec, r0).data(), valueToSourceString(exec, scope).utf8().data(), idName(id0, m_identifiers[id0]).data());
+ printf("[%4d] resolve_global\t %s, %s\n", location, registerName(exec, r0).data(), idName(id0, m_identifiers[id0]).data());
it += 2;
break;
}
case op_resolve_global_dynamic: {
int r0 = (++it)->u.operand;
- JSValue scope = JSValue((++it)->u.jsCell);
int id0 = (++it)->u.operand;
+ JSValue scope = JSValue((++it)->u.jsCell);
+ ++it;
int depth = it[2].u.operand;
printf("[%4d] resolve_global_dynamic\t %s, %s, %s, %d\n", location, registerName(exec, r0).data(), valueToSourceString(exec, scope).utf8().data(), idName(id0, m_identifiers[id0]).data(), depth);
it += 3;
@@ -743,16 +743,14 @@ void CodeBlock::dump(ExecState* exec, const Vector<Instruction>::const_iterator&
}
case op_get_global_var: {
int r0 = (++it)->u.operand;
- JSValue scope = JSValue((++it)->u.jsCell);
int index = (++it)->u.operand;
- printf("[%4d] get_global_var\t %s, %s, %d\n", location, registerName(exec, r0).data(), valueToSourceString(exec, scope).utf8().data(), index);
+ printf("[%4d] get_global_var\t %s, %d\n", location, registerName(exec, r0).data(), index);
break;
}
case op_put_global_var: {
- JSValue scope = JSValue((++it)->u.jsCell);
int index = (++it)->u.operand;
int r0 = (++it)->u.operand;
- printf("[%4d] put_global_var\t %s, %d, %s\n", location, valueToSourceString(exec, scope).utf8().data(), index, registerName(exec, r0).data());
+ printf("[%4d] put_global_var\t %d, %s\n", location, index, registerName(exec, r0).data());
break;
}
case op_resolve_base: {
@@ -844,6 +842,11 @@ void CodeBlock::dump(ExecState* exec, const Vector<Instruction>::const_iterator&
printGetByIdOp(exec, location, it, "get_string_length");
break;
}
+ case op_get_arguments_length: {
+ printUnaryOp(exec, location, it, "get_arguments_length");
+ it++;
+ break;
+ }
case op_put_by_id: {
printPutByIdOp(exec, location, it, "put_by_id");
break;
@@ -892,6 +895,13 @@ void CodeBlock::dump(ExecState* exec, const Vector<Instruction>::const_iterator&
printf("[%4d] get_by_val\t %s, %s, %s\n", location, registerName(exec, r0).data(), registerName(exec, r1).data(), registerName(exec, r2).data());
break;
}
+ case op_get_argument_by_val: {
+ int r0 = (++it)->u.operand;
+ int r1 = (++it)->u.operand;
+ int r2 = (++it)->u.operand;
+ printf("[%4d] get_argument_by_val\t %s, %s, %s\n", location, registerName(exec, r0).data(), registerName(exec, r1).data(), registerName(exec, r2).data());
+ break;
+ }
case op_get_by_pname: {
int r0 = (++it)->u.operand;
int r1 = (++it)->u.operand;
@@ -1030,7 +1040,8 @@ void CodeBlock::dump(ExecState* exec, const Vector<Instruction>::const_iterator&
case op_new_func: {
int r0 = (++it)->u.operand;
int f0 = (++it)->u.operand;
- printf("[%4d] new_func\t\t %s, f%d\n", location, registerName(exec, r0).data(), f0);
+ int shouldCheck = (++it)->u.operand;
+ printf("[%4d] new_func\t\t %s, f%d, %s\n", location, registerName(exec, r0).data(), f0, shouldCheck ? "<Checked>" : "<Unchecked>");
break;
}
case op_new_func_exp: {
diff --git a/JavaScriptCore/bytecode/CodeBlock.h b/JavaScriptCore/bytecode/CodeBlock.h
index 766ad2a..cda4530 100644
--- a/JavaScriptCore/bytecode/CodeBlock.h
+++ b/JavaScriptCore/bytecode/CodeBlock.h
@@ -514,6 +514,7 @@ namespace JSC {
int m_numCalleeRegisters;
int m_numVars;
+ int m_numCapturedVars;
int m_numParameters;
bool m_isConstructor;
diff --git a/JavaScriptCore/bytecode/Opcode.cpp b/JavaScriptCore/bytecode/Opcode.cpp
index 8f7f01f..0bb714b 100644
--- a/JavaScriptCore/bytecode/Opcode.cpp
+++ b/JavaScriptCore/bytecode/Opcode.cpp
@@ -30,6 +30,11 @@
#include "config.h"
#include "Opcode.h"
+#if ENABLE(OPCODE_STATS)
+#include <stdio.h>
+#include <wtf/FixedArray.h>
+#endif
+
using namespace std;
namespace JSC {
@@ -104,7 +109,7 @@ OpcodeStats::~OpcodeStats()
FixedArray<int, numOpcodeIDs> sortedIndices;
for (int i = 0; i < numOpcodeIDs; ++i)
sortedIndices[i] = i;
- qsort(sortedIndices, numOpcodeIDs, sizeof(int), compareOpcodeIndices);
+ qsort(sortedIndices.data(), numOpcodeIDs, sizeof(int), compareOpcodeIndices);
pair<int, int> sortedPairIndices[numOpcodeIDs * numOpcodeIDs];
pair<int, int>* currentPairIndex = sortedPairIndices;
diff --git a/JavaScriptCore/bytecode/Opcode.h b/JavaScriptCore/bytecode/Opcode.h
index 4563ebe..03f6573 100644
--- a/JavaScriptCore/bytecode/Opcode.h
+++ b/JavaScriptCore/bytecode/Opcode.h
@@ -40,7 +40,7 @@ namespace JSC {
#define FOR_EACH_OPCODE_ID(macro) \
macro(op_enter, 1) \
macro(op_enter_with_activation, 2) \
- macro(op_init_arguments, 2) \
+ macro(op_init_lazy_reg, 2) \
macro(op_create_arguments, 2) \
macro(op_create_this, 3) \
macro(op_get_callee, 2) \
@@ -120,12 +120,14 @@ namespace JSC {
macro(op_get_by_id_generic, 8) \
macro(op_get_array_length, 8) \
macro(op_get_string_length, 8) \
+ macro(op_get_arguments_length, 4) \
macro(op_put_by_id, 9) \
macro(op_put_by_id_transition, 9) \
macro(op_put_by_id_replace, 9) \
macro(op_put_by_id_generic, 9) \
macro(op_del_by_id, 4) \
macro(op_get_by_val, 4) \
+ macro(op_get_argument_by_val, 4) \
macro(op_get_by_pname, 7) \
macro(op_put_by_val, 4) \
macro(op_del_by_val, 4) \
@@ -153,7 +155,7 @@ namespace JSC {
macro(op_switch_char, 4) \
macro(op_switch_string, 4) \
\
- macro(op_new_func, 3) \
+ macro(op_new_func, 4) \
macro(op_new_func_exp, 3) \
macro(op_call, 4) \
macro(op_call_eval, 4) \
diff --git a/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp b/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp
index ab259a6..986709b 100644
--- a/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp
+++ b/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp
@@ -214,6 +214,8 @@ BytecodeGenerator::BytecodeGenerator(ProgramNode* programNode, const Debugger* d
, m_nextGlobalIndex(-1)
, m_nextConstantOffset(0)
, m_globalConstantIndex(0)
+ , m_firstLazyFunction(0)
+ , m_lastLazyFunction(0)
, m_globalData(&scopeChain.globalObject()->globalExec()->globalData())
, m_lastOpcodeID(op_end)
#ifndef NDEBUG
@@ -287,6 +289,7 @@ BytecodeGenerator::BytecodeGenerator(ProgramNode* programNode, const Debugger* d
preserveLastVar();
}
+ codeBlock->m_numCapturedVars = codeBlock->m_numVars;
}
BytecodeGenerator::BytecodeGenerator(FunctionBodyNode* functionBody, const Debugger* debugger, const ScopeChain& scopeChain, SymbolTable* symbolTable, CodeBlock* codeBlock)
@@ -303,6 +306,8 @@ BytecodeGenerator::BytecodeGenerator(FunctionBodyNode* functionBody, const Debug
, m_codeType(FunctionCode)
, m_nextConstantOffset(0)
, m_globalConstantIndex(0)
+ , m_firstLazyFunction(0)
+ , m_lastLazyFunction(0)
, m_globalData(&scopeChain.globalObject()->globalExec()->globalData())
, m_lastOpcodeID(op_end)
, m_emitNodeDepth(0)
@@ -334,8 +339,8 @@ BytecodeGenerator::BytecodeGenerator(FunctionBodyNode* functionBody, const Debug
codeBlock->setArgumentsRegister(argumentsRegister->index());
ASSERT_UNUSED(unmodifiedArgumentsRegister, unmodifiedArgumentsRegister->index() == JSC::unmodifiedArgumentsRegister(codeBlock->argumentsRegister()));
- emitOpcode(op_init_arguments);
- instructions().append(argumentsRegister->index());
+ emitInitLazyRegister(argumentsRegister);
+ emitInitLazyRegister(unmodifiedArgumentsRegister);
// The debugger currently retrieves the arguments object from an activation rather than pulling
// it from a call frame. In the long-term it should stop doing that (<rdar://problem/6911886>),
@@ -347,16 +352,54 @@ BytecodeGenerator::BytecodeGenerator(FunctionBodyNode* functionBody, const Debug
}
const DeclarationStacks::FunctionStack& functionStack = functionBody->functionStack();
+ const DeclarationStacks::VarStack& varStack = functionBody->varStack();
+
+ // Captured variables and functions go first so that activations don't have
+ // to step over the non-captured locals to mark them.
+ if (functionBody->hasCapturedVariables()) {
+ for (size_t i = 0; i < functionStack.size(); ++i) {
+ FunctionBodyNode* function = functionStack[i];
+ const Identifier& ident = function->ident();
+ if (functionBody->captures(ident)) {
+ m_functions.add(ident.impl());
+ emitNewFunction(addVar(ident, false), function);
+ }
+ }
+ for (size_t i = 0; i < varStack.size(); ++i) {
+ const Identifier& ident = *varStack[i].first;
+ if (functionBody->captures(ident))
+ addVar(ident, varStack[i].second & DeclarationStacks::IsConstant);
+ }
+ }
+ bool canLazilyCreateFunctions = !functionBody->needsActivationForMoreThanVariables();
+ codeBlock->m_numCapturedVars = codeBlock->m_numVars;
+ m_firstLazyFunction = codeBlock->m_numVars;
for (size_t i = 0; i < functionStack.size(); ++i) {
FunctionBodyNode* function = functionStack[i];
const Identifier& ident = function->ident();
- m_functions.add(ident.impl());
- emitNewFunction(addVar(ident, false), function);
+ if (!functionBody->captures(ident)) {
+ m_functions.add(ident.impl());
+ RefPtr<RegisterID> reg = addVar(ident, false);
+ // Don't lazily create functions that override the name 'arguments'
+ // as this would complicate lazy instantiation of actual arguments.
+ if (!canLazilyCreateFunctions || ident == propertyNames().arguments)
+ emitNewFunction(reg.get(), function);
+ else {
+ emitInitLazyRegister(reg.get());
+ m_lazyFunctions.set(reg->index(), function);
+ }
+ }
}
-
- const DeclarationStacks::VarStack& varStack = functionBody->varStack();
- for (size_t i = 0; i < varStack.size(); ++i)
- addVar(*varStack[i].first, varStack[i].second & DeclarationStacks::IsConstant);
+ m_lastLazyFunction = canLazilyCreateFunctions ? codeBlock->m_numVars : m_firstLazyFunction;
+ for (size_t i = 0; i < varStack.size(); ++i) {
+ const Identifier& ident = *varStack[i].first;
+ if (!functionBody->captures(ident))
+ addVar(ident, varStack[i].second & DeclarationStacks::IsConstant);
+ }
+
+ if (debugger)
+ codeBlock->m_numCapturedVars = codeBlock->m_numVars;
+
FunctionParameters& parameters = *functionBody->parameters();
size_t parameterCount = parameters.size();
@@ -405,6 +448,8 @@ BytecodeGenerator::BytecodeGenerator(EvalNode* evalNode, const Debugger* debugge
, m_codeType(EvalCode)
, m_nextConstantOffset(0)
, m_globalConstantIndex(0)
+ , m_firstLazyFunction(0)
+ , m_lastLazyFunction(0)
, m_globalData(&scopeChain.globalObject()->globalExec()->globalData())
, m_lastOpcodeID(op_end)
, m_emitNodeDepth(0)
@@ -430,10 +475,17 @@ BytecodeGenerator::BytecodeGenerator(EvalNode* evalNode, const Debugger* debugge
for (size_t i = 0; i < numVariables; ++i)
variables.append(*varStack[i].first);
codeBlock->adoptVariables(variables);
-
+ codeBlock->m_numCapturedVars = codeBlock->m_numVars;
preserveLastVar();
}
+RegisterID* BytecodeGenerator::emitInitLazyRegister(RegisterID* reg)
+{
+ emitOpcode(op_init_lazy_reg);
+ instructions().append(reg->index());
+ return reg;
+}
+
void BytecodeGenerator::addParameter(const Identifier& ident, int parameterIndex)
{
// Parameters overwrite var declarations, but not function declarations.
@@ -464,7 +516,7 @@ RegisterID* BytecodeGenerator::registerFor(const Identifier& ident)
if (ident == propertyNames().arguments)
createArgumentsIfNecessary();
- return &registerFor(entry.getIndex());
+ return createLazyRegisterIfNecessary(&registerFor(entry.getIndex()));
}
bool BytecodeGenerator::willResolveToArguments(const Identifier& ident)
@@ -494,6 +546,14 @@ RegisterID* BytecodeGenerator::uncheckedRegisterForArguments()
return &registerFor(entry.getIndex());
}
+RegisterID* BytecodeGenerator::createLazyRegisterIfNecessary(RegisterID* reg)
+{
+ if (m_lastLazyFunction <= reg->index() || reg->index() < m_firstLazyFunction)
+ return reg;
+ emitLazyNewFunction(reg, m_lazyFunctions.get(reg->index()));
+ return reg;
+}
+
RegisterID* BytecodeGenerator::constRegisterFor(const Identifier& ident)
{
if (m_codeType == EvalCode)
@@ -503,7 +563,7 @@ RegisterID* BytecodeGenerator::constRegisterFor(const Identifier& ident)
if (entry.isNull())
return 0;
- return &registerFor(entry.getIndex());
+ return createLazyRegisterIfNecessary(&registerFor(entry.getIndex()));
}
bool BytecodeGenerator::isLocal(const Identifier& ident)
@@ -1268,6 +1328,16 @@ RegisterID* BytecodeGenerator::emitGetById(RegisterID* dst, RegisterID* base, co
return dst;
}
+RegisterID* BytecodeGenerator::emitGetArgumentsLength(RegisterID* dst, RegisterID* base)
+{
+ emitOpcode(op_get_arguments_length);
+ instructions().append(dst->index());
+ ASSERT(base->index() == m_codeBlock->argumentsRegister());
+ instructions().append(base->index());
+ instructions().append(addConstant(propertyNames().length));
+ return dst;
+}
+
RegisterID* BytecodeGenerator::emitPutById(RegisterID* base, const Identifier& property, RegisterID* value)
{
#if ENABLE(JIT)
@@ -1335,6 +1405,16 @@ RegisterID* BytecodeGenerator::emitDeleteById(RegisterID* dst, RegisterID* base,
return dst;
}
+RegisterID* BytecodeGenerator::emitGetArgumentByVal(RegisterID* dst, RegisterID* base, RegisterID* property)
+{
+ emitOpcode(op_get_argument_by_val);
+ instructions().append(dst->index());
+ ASSERT(base->index() == m_codeBlock->argumentsRegister());
+ instructions().append(base->index());
+ instructions().append(property->index());
+ return dst;
+}
+
RegisterID* BytecodeGenerator::emitGetByVal(RegisterID* dst, RegisterID* base, RegisterID* property)
{
for (size_t i = m_forInContextStack.size(); i > 0; i--) {
@@ -1411,11 +1491,23 @@ RegisterID* BytecodeGenerator::emitNewArray(RegisterID* dst, ElementNode* elemen
RegisterID* BytecodeGenerator::emitNewFunction(RegisterID* dst, FunctionBodyNode* function)
{
- unsigned index = m_codeBlock->addFunctionDecl(makeFunction(m_globalData, function));
+ return emitNewFunctionInternal(dst, m_codeBlock->addFunctionDecl(makeFunction(m_globalData, function)), false);
+}
+RegisterID* BytecodeGenerator::emitLazyNewFunction(RegisterID* dst, FunctionBodyNode* function)
+{
+ std::pair<FunctionOffsetMap::iterator, bool> ptr = m_functionOffsets.add(function, 0);
+ if (ptr.second)
+ ptr.first->second = m_codeBlock->addFunctionDecl(makeFunction(m_globalData, function));
+ return emitNewFunctionInternal(dst, ptr.first->second, true);
+}
+
+RegisterID* BytecodeGenerator::emitNewFunctionInternal(RegisterID* dst, unsigned index, bool doNullCheck)
+{
emitOpcode(op_new_func);
instructions().append(dst->index());
instructions().append(index);
+ instructions().append(doNullCheck);
return dst;
}
diff --git a/JavaScriptCore/bytecompiler/BytecodeGenerator.h b/JavaScriptCore/bytecompiler/BytecodeGenerator.h
index f7bd0bf..2afa0c4 100644
--- a/JavaScriptCore/bytecompiler/BytecodeGenerator.h
+++ b/JavaScriptCore/bytecompiler/BytecodeGenerator.h
@@ -307,6 +307,8 @@ namespace JSC {
RegisterID* emitNewArray(RegisterID* dst, ElementNode*); // stops at first elision
RegisterID* emitNewFunction(RegisterID* dst, FunctionBodyNode* body);
+ RegisterID* emitLazyNewFunction(RegisterID* dst, FunctionBodyNode* body);
+ RegisterID* emitNewFunctionInternal(RegisterID* dst, unsigned index, bool shouldNullCheck);
RegisterID* emitNewFunctionExpression(RegisterID* dst, FuncExprNode* func);
RegisterID* emitNewRegExp(RegisterID* dst, RegExp* regExp);
@@ -332,10 +334,12 @@ namespace JSC {
void emitMethodCheck();
RegisterID* emitGetById(RegisterID* dst, RegisterID* base, const Identifier& property);
+ RegisterID* emitGetArgumentsLength(RegisterID* dst, RegisterID* base);
RegisterID* emitPutById(RegisterID* base, const Identifier& property, RegisterID* value);
RegisterID* emitDirectPutById(RegisterID* base, const Identifier& property, RegisterID* value);
RegisterID* emitDeleteById(RegisterID* dst, RegisterID* base, const Identifier&);
RegisterID* emitGetByVal(RegisterID* dst, RegisterID* base, RegisterID* property);
+ RegisterID* emitGetArgumentByVal(RegisterID* dst, RegisterID* base, RegisterID* property);
RegisterID* emitPutByVal(RegisterID* base, RegisterID* property, RegisterID* value);
RegisterID* emitDeleteByVal(RegisterID* dst, RegisterID* base, RegisterID* property);
RegisterID* emitPutByIndex(RegisterID* base, unsigned index, RegisterID* value);
@@ -441,7 +445,7 @@ namespace JSC {
typedef HashMap<StringImpl*, JSString*, IdentifierRepHash> IdentifierStringMap;
RegisterID* emitCall(OpcodeID, RegisterID* dst, RegisterID* func, CallArguments&, unsigned divot, unsigned startOffset, unsigned endOffset);
-
+
RegisterID* newRegister();
// Adds a var slot and maps it to the name ident in symbolTable().
@@ -503,6 +507,8 @@ namespace JSC {
return FunctionExecutable::create(globalData, body->ident(), body->source(), body->usesArguments(), body->parameters(), body->lineNo(), body->lastLine());
}
+ RegisterID* emitInitLazyRegister(RegisterID*);
+
Vector<Instruction>& instructions() { return m_codeBlock->instructions(); }
SymbolTable& symbolTable() { return *m_symbolTable; }
@@ -512,6 +518,7 @@ namespace JSC {
RegisterID* emitThrowExpressionTooDeepException();
void createArgumentsIfNecessary();
+ RegisterID* createLazyRegisterIfNecessary(RegisterID*);
bool m_shouldEmitDebugHooks;
bool m_shouldEmitProfileHooks;
@@ -551,6 +558,12 @@ namespace JSC {
int m_globalVarStorageOffset;
+ int m_firstLazyFunction;
+ int m_lastLazyFunction;
+ HashMap<unsigned int, FunctionBodyNode*, WTF::IntHash<unsigned int>, WTF::UnsignedWithZeroKeyHashTraits<unsigned int> > m_lazyFunctions;
+ typedef HashMap<FunctionBodyNode*, unsigned> FunctionOffsetMap;
+ FunctionOffsetMap m_functionOffsets;
+
// Constant pool
IdentifierMap m_identifierMap;
JSValueMap m_jsValueMap;
diff --git a/JavaScriptCore/bytecompiler/NodesCodegen.cpp b/JavaScriptCore/bytecompiler/NodesCodegen.cpp
index f098ba6..2cc1a3f 100644
--- a/JavaScriptCore/bytecompiler/NodesCodegen.cpp
+++ b/JavaScriptCore/bytecompiler/NodesCodegen.cpp
@@ -290,6 +290,12 @@ RegisterID* PropertyListNode::emitBytecode(BytecodeGenerator& generator, Registe
RegisterID* BracketAccessorNode::emitBytecode(BytecodeGenerator& generator, RegisterID* dst)
{
+ if (m_base->isResolveNode() && generator.willResolveToArguments(static_cast<ResolveNode*>(m_base)->identifier())) {
+ RegisterID* property = generator.emitNode(m_subscript);
+ generator.emitExpressionInfo(divot(), startOffset(), endOffset());
+ return generator.emitGetArgumentByVal(generator.finalDestination(dst), generator.uncheckedRegisterForArguments(), property);
+ }
+
RefPtr<RegisterID> base = generator.emitNodeForLeftHandSide(m_base, m_subscriptHasAssignments, m_subscript->isPure(generator));
RegisterID* property = generator.emitNode(m_subscript);
generator.emitExpressionInfo(divot(), startOffset(), endOffset());
@@ -300,6 +306,17 @@ RegisterID* BracketAccessorNode::emitBytecode(BytecodeGenerator& generator, Regi
RegisterID* DotAccessorNode::emitBytecode(BytecodeGenerator& generator, RegisterID* dst)
{
+ if (m_ident == generator.propertyNames().length) {
+ if (!m_base->isResolveNode())
+ goto nonArgumentsPath;
+ ResolveNode* resolveNode = static_cast<ResolveNode*>(m_base);
+ if (!generator.willResolveToArguments(resolveNode->identifier()))
+ goto nonArgumentsPath;
+ generator.emitExpressionInfo(divot(), startOffset(), endOffset());
+ return generator.emitGetArgumentsLength(generator.finalDestination(dst), generator.uncheckedRegisterForArguments());
+ }
+
+nonArgumentsPath:
RegisterID* base = generator.emitNode(m_base);
generator.emitExpressionInfo(divot(), startOffset(), endOffset());
return generator.emitGetById(generator.finalDestination(dst), base, m_ident);
diff --git a/JavaScriptCore/docs/make-bytecode-docs.pl b/JavaScriptCore/docs/make-bytecode-docs.pl
index 9494d1b..5a95195 100755
--- a/JavaScriptCore/docs/make-bytecode-docs.pl
+++ b/JavaScriptCore/docs/make-bytecode-docs.pl
@@ -7,6 +7,7 @@ open OUTPUT, ">" . $ARGV[1];
my @undocumented = ();
+print OUTPUT "<!-- Generated from Interpreter.cpp by make-bytecode-docs.pl. -->\n";
print OUTPUT "<style>p code \{ font-size: 14px; \}</style>\n";
while (<MACHINE>) {
diff --git a/JavaScriptCore/interpreter/Interpreter.cpp b/JavaScriptCore/interpreter/Interpreter.cpp
index d43eb57..5943ece 100644
--- a/JavaScriptCore/interpreter/Interpreter.cpp
+++ b/JavaScriptCore/interpreter/Interpreter.cpp
@@ -67,6 +67,8 @@
#include "JIT.h"
#endif
+#define WTF_USE_GCC_COMPUTED_GOTO_WORKAROUND (ENABLE(COMPUTED_GOTO_INTERPRETER) && !defined(__llvm__))
+
using namespace std;
namespace JSC {
@@ -80,6 +82,11 @@ static int depth(CodeBlock* codeBlock, ScopeChain& sc)
}
#if ENABLE(INTERPRETER)
+static NEVER_INLINE JSValue concatenateStrings(ExecState* exec, Register* strings, unsigned count)
+{
+ return jsString(exec, strings, count);
+}
+
NEVER_INLINE bool Interpreter::resolve(CallFrame* callFrame, Instruction* vPC, JSValue& exceptionValue)
{
int dst = vPC[1].u.operand;
@@ -2473,7 +2480,7 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi
uncacheGetByID(codeBlock, vPC);
NEXT_INSTRUCTION();
}
-#if ENABLE(COMPUTED_GOTO_INTERPRETER)
+#if USE(GCC_COMPUTED_GOTO_WORKAROUND)
goto *(&&skip_id_getter_proto);
#endif
DEFINE_OPCODE(op_get_by_id_getter_proto) {
@@ -2515,10 +2522,10 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi
uncacheGetByID(codeBlock, vPC);
NEXT_INSTRUCTION();
}
-#if ENABLE(COMPUTED_GOTO_INTERPRETER)
+#if USE(GCC_COMPUTED_GOTO_WORKAROUND)
skip_id_getter_proto:
#endif
-#if ENABLE(COMPUTED_GOTO_INTERPRETER)
+#if USE(GCC_COMPUTED_GOTO_WORKAROUND)
goto *(&&skip_id_custom_proto);
#endif
DEFINE_OPCODE(op_get_by_id_custom_proto) {
@@ -2557,7 +2564,7 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi
uncacheGetByID(codeBlock, vPC);
NEXT_INSTRUCTION();
}
-#if ENABLE(COMPUTED_GOTO_INTERPRETER)
+#if USE(GCC_COMPUTED_GOTO_WORKAROUND)
skip_id_custom_proto:
#endif
DEFINE_OPCODE(op_get_by_id_self_list) {
@@ -2648,7 +2655,7 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi
uncacheGetByID(codeBlock, vPC);
NEXT_INSTRUCTION();
}
-#if ENABLE(COMPUTED_GOTO_INTERPRETER)
+#if USE(GCC_COMPUTED_GOTO_WORKAROUND)
goto *(&&skip_id_getter_self);
#endif
DEFINE_OPCODE(op_get_by_id_getter_self) {
@@ -2688,10 +2695,10 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi
uncacheGetByID(codeBlock, vPC);
NEXT_INSTRUCTION();
}
-#if ENABLE(COMPUTED_GOTO_INTERPRETER)
+#if USE(GCC_COMPUTED_GOTO_WORKAROUND)
skip_id_getter_self:
#endif
-#if ENABLE(COMPUTED_GOTO_INTERPRETER)
+#if USE(GCC_COMPUTED_GOTO_WORKAROUND)
goto *(&&skip_id_custom_self);
#endif
DEFINE_OPCODE(op_get_by_id_custom_self) {
@@ -2725,7 +2732,7 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi
uncacheGetByID(codeBlock, vPC);
NEXT_INSTRUCTION();
}
-#if ENABLE(COMPUTED_GOTO_INTERPRETER)
+#if USE(GCC_COMPUTED_GOTO_WORKAROUND)
skip_id_custom_self:
#endif
DEFINE_OPCODE(op_get_by_id_generic) {
@@ -2748,7 +2755,7 @@ skip_id_custom_self:
vPC += OPCODE_LENGTH(op_get_by_id_generic);
NEXT_INSTRUCTION();
}
-#if ENABLE(COMPUTED_GOTO_INTERPRETER)
+#if USE(GCC_COMPUTED_GOTO_WORKAROUND)
goto *(&&skip_id_getter_chain);
#endif
DEFINE_OPCODE(op_get_by_id_getter_chain) {
@@ -2800,10 +2807,10 @@ skip_id_custom_self:
uncacheGetByID(codeBlock, vPC);
NEXT_INSTRUCTION();
}
-#if ENABLE(COMPUTED_GOTO_INTERPRETER)
+#if USE(GCC_COMPUTED_GOTO_WORKAROUND)
skip_id_getter_chain:
#endif
-#if ENABLE(COMPUTED_GOTO_INTERPRETER)
+#if USE(GCC_COMPUTED_GOTO_WORKAROUND)
goto *(&&skip_id_custom_chain);
#endif
DEFINE_OPCODE(op_get_by_id_custom_chain) {
@@ -2852,7 +2859,7 @@ skip_id_custom_self:
uncacheGetByID(codeBlock, vPC);
NEXT_INSTRUCTION();
}
-#if ENABLE(COMPUTED_GOTO_INTERPRETER)
+#if USE(GCC_COMPUTED_GOTO_WORKAROUND)
skip_id_custom_chain:
#endif
DEFINE_OPCODE(op_get_array_length) {
@@ -3089,6 +3096,46 @@ skip_id_custom_self:
vPC += OPCODE_LENGTH(op_get_by_pname);
NEXT_INSTRUCTION();
}
+ DEFINE_OPCODE(op_get_arguments_length) {
+ int dst = vPC[1].u.operand;
+ int argumentsRegister = vPC[2].u.operand;
+ int property = vPC[3].u.operand;
+ JSValue arguments = callFrame->r(argumentsRegister).jsValue();
+ if (arguments) {
+ Identifier& ident = codeBlock->identifier(property);
+ PropertySlot slot(arguments);
+ JSValue result = arguments.get(callFrame, ident, slot);
+ CHECK_FOR_EXCEPTION();
+ callFrame->r(dst) = result;
+ } else
+ callFrame->r(dst) = jsNumber(callFrame, callFrame->argumentCount());
+
+ vPC += OPCODE_LENGTH(op_get_arguments_length);
+ NEXT_INSTRUCTION();
+ }
+ DEFINE_OPCODE(op_get_argument_by_val) {
+ int dst = vPC[1].u.operand;
+ int argumentsRegister = vPC[2].u.operand;
+ int property = vPC[3].u.operand;
+ JSValue arguments = callFrame->r(argumentsRegister).jsValue();
+ JSValue subscript = callFrame->r(property).jsValue();
+ if (!arguments && subscript.isUInt32() && subscript.asUInt32() < callFrame->argumentCount()) {
+ unsigned arg = subscript.asUInt32() + 1;
+ unsigned numParameters = callFrame->codeBlock()->m_numParameters;
+ if (arg < numParameters)
+ callFrame->r(dst) = callFrame->r(arg - RegisterFile::CallFrameHeaderSize - numParameters);
+ else
+ callFrame->r(dst) = callFrame->r(arg - RegisterFile::CallFrameHeaderSize - numParameters - callFrame->argumentCount() - 1);
+ vPC += OPCODE_LENGTH(op_get_argument_by_val);
+ NEXT_INSTRUCTION();
+ }
+ if (!arguments) {
+ Arguments* arguments = new (globalData) Arguments(callFrame);
+ callFrame->r(dst) = JSValue(arguments);
+ callFrame->r(unmodifiedArgumentsRegister(dst)) = JSValue(arguments);
+ }
+ // fallthrough
+ }
DEFINE_OPCODE(op_get_by_val) {
/* get_by_val dst(r) base(r) property(r)
@@ -3610,8 +3657,10 @@ skip_id_custom_self:
*/
int dst = vPC[1].u.operand;
int func = vPC[2].u.operand;
+ int shouldCheck = vPC[3].u.operand;
- callFrame->r(dst) = JSValue(codeBlock->functionDecl(func)->make(callFrame, callFrame->scopeChain()));
+ if (!shouldCheck || !callFrame->r(dst).jsValue())
+ callFrame->r(dst) = JSValue(codeBlock->functionDecl(func)->make(callFrame, callFrame->scopeChain()));
vPC += OPCODE_LENGTH(op_new_func);
NEXT_INSTRUCTION();
@@ -3832,10 +3881,8 @@ skip_id_custom_self:
CHECK_FOR_EXCEPTION();
}
} else {
- if (!arguments.isObject()) {
- exceptionValue = createInvalidParamError(callFrame, "Function.prototype.apply", arguments, vPC - codeBlock->instructions().begin(), codeBlock);
- goto vm_throw;
- }
+ exceptionValue = createInvalidParamError(callFrame, "Function.prototype.apply", arguments, vPC - codeBlock->instructions().begin(), codeBlock);
+ goto vm_throw;
}
}
CHECK_FOR_EXCEPTION();
@@ -4137,18 +4184,17 @@ skip_id_custom_self:
vPC += OPCODE_LENGTH(op_convert_this);
NEXT_INSTRUCTION();
}
- DEFINE_OPCODE(op_init_arguments) {
- /* create_arguments dst(r)
+ DEFINE_OPCODE(op_init_lazy_reg) {
+ /* init_lazy_reg dst(r)
- Initialises 'arguments' to JSValue().
+ Initialises dst(r) to JSValue().
This opcode appears only at the beginning of a code block.
*/
int dst = vPC[1].u.operand;
callFrame->r(dst) = JSValue();
- callFrame->r(unmodifiedArgumentsRegister(dst)) = JSValue();
- vPC += OPCODE_LENGTH(op_init_arguments);
+ vPC += OPCODE_LENGTH(op_init_lazy_reg);
NEXT_INSTRUCTION();
}
DEFINE_OPCODE(op_create_arguments) {
@@ -4248,11 +4294,19 @@ skip_id_custom_self:
goto vm_throw;
}
DEFINE_OPCODE(op_strcat) {
+ /* strcat dst(r) src(r) count(n)
+
+ Construct a new String instance using the original
+ constructor, and puts the result in register dst.
+ The string will be the result of concatenating count
+ strings with values taken from registers starting at
+ register src.
+ */
int dst = vPC[1].u.operand;
int src = vPC[2].u.operand;
int count = vPC[3].u.operand;
- callFrame->r(dst) = jsString(callFrame, &callFrame->registers()[src], count);
+ callFrame->r(dst) = concatenateStrings(callFrame, &callFrame->registers()[src], count);
CHECK_FOR_EXCEPTION();
vPC += OPCODE_LENGTH(op_strcat);
diff --git a/JavaScriptCore/jit/JIT.cpp b/JavaScriptCore/jit/JIT.cpp
index 4466fbd..a508d0c 100644
--- a/JavaScriptCore/jit/JIT.cpp
+++ b/JavaScriptCore/jit/JIT.cpp
@@ -225,7 +225,7 @@ void JIT::privateCompileMainPass()
DEFINE_OP(op_get_callee)
DEFINE_OP(op_create_this)
DEFINE_OP(op_convert_this)
- DEFINE_OP(op_init_arguments)
+ DEFINE_OP(op_init_lazy_reg)
DEFINE_OP(op_create_arguments)
DEFINE_OP(op_debug)
DEFINE_OP(op_del_by_id)
@@ -238,7 +238,9 @@ void JIT::privateCompileMainPass()
DEFINE_OP(op_eq)
DEFINE_OP(op_eq_null)
DEFINE_OP(op_get_by_id)
+ DEFINE_OP(op_get_arguments_length)
DEFINE_OP(op_get_by_val)
+ DEFINE_OP(op_get_argument_by_val)
DEFINE_OP(op_get_by_pname)
DEFINE_OP(op_get_global_var)
DEFINE_OP(op_get_pnames)
@@ -399,7 +401,9 @@ void JIT::privateCompileSlowCases()
#endif
DEFINE_SLOWCASE_OP(op_eq)
DEFINE_SLOWCASE_OP(op_get_by_id)
+ DEFINE_SLOWCASE_OP(op_get_arguments_length)
DEFINE_SLOWCASE_OP(op_get_by_val)
+ DEFINE_SLOWCASE_OP(op_get_argument_by_val)
DEFINE_SLOWCASE_OP(op_get_by_pname)
DEFINE_SLOWCASE_OP(op_instanceof)
DEFINE_SLOWCASE_OP(op_jfalse)
@@ -408,6 +412,7 @@ void JIT::privateCompileSlowCases()
DEFINE_SLOWCASE_OP(op_jlesseq)
DEFINE_SLOWCASE_OP(op_jnlesseq)
DEFINE_SLOWCASE_OP(op_jtrue)
+ DEFINE_SLOWCASE_OP(op_load_varargs)
DEFINE_SLOWCASE_OP(op_loop_if_less)
DEFINE_SLOWCASE_OP(op_loop_if_lesseq)
DEFINE_SLOWCASE_OP(op_loop_if_true)
diff --git a/JavaScriptCore/jit/JIT.h b/JavaScriptCore/jit/JIT.h
index 6f1168b..6b2e70e 100644
--- a/JavaScriptCore/jit/JIT.h
+++ b/JavaScriptCore/jit/JIT.h
@@ -748,11 +748,13 @@ namespace JSC {
void emit_op_eq(Instruction*);
void emit_op_eq_null(Instruction*);
void emit_op_get_by_id(Instruction*);
+ void emit_op_get_arguments_length(Instruction*);
void emit_op_get_by_val(Instruction*);
+ void emit_op_get_argument_by_val(Instruction*);
void emit_op_get_by_pname(Instruction*);
void emit_op_get_global_var(Instruction*);
void emit_op_get_scoped_var(Instruction*);
- void emit_op_init_arguments(Instruction*);
+ void emit_op_init_lazy_reg(Instruction*);
void emit_op_instanceof(Instruction*);
void emit_op_jeq_null(Instruction*);
void emit_op_jfalse(Instruction*);
@@ -846,7 +848,9 @@ namespace JSC {
void emitSlow_op_div(Instruction*, Vector<SlowCaseEntry>::iterator&);
void emitSlow_op_eq(Instruction*, Vector<SlowCaseEntry>::iterator&);
void emitSlow_op_get_by_id(Instruction*, Vector<SlowCaseEntry>::iterator&);
+ void emitSlow_op_get_arguments_length(Instruction*, Vector<SlowCaseEntry>::iterator&);
void emitSlow_op_get_by_val(Instruction*, Vector<SlowCaseEntry>::iterator&);
+ void emitSlow_op_get_argument_by_val(Instruction*, Vector<SlowCaseEntry>::iterator&);
void emitSlow_op_get_by_pname(Instruction*, Vector<SlowCaseEntry>::iterator&);
void emitSlow_op_instanceof(Instruction*, Vector<SlowCaseEntry>::iterator&);
void emitSlow_op_jfalse(Instruction*, Vector<SlowCaseEntry>::iterator&);
@@ -855,6 +859,7 @@ namespace JSC {
void emitSlow_op_jlesseq(Instruction*, Vector<SlowCaseEntry>::iterator&, bool invert = false);
void emitSlow_op_jnlesseq(Instruction*, Vector<SlowCaseEntry>::iterator&);
void emitSlow_op_jtrue(Instruction*, Vector<SlowCaseEntry>::iterator&);
+ void emitSlow_op_load_varargs(Instruction*, Vector<SlowCaseEntry>::iterator&);
void emitSlow_op_loop_if_less(Instruction*, Vector<SlowCaseEntry>::iterator&);
void emitSlow_op_loop_if_lesseq(Instruction*, Vector<SlowCaseEntry>::iterator&);
void emitSlow_op_loop_if_true(Instruction*, Vector<SlowCaseEntry>::iterator&);
diff --git a/JavaScriptCore/jit/JITCall32_64.cpp b/JavaScriptCore/jit/JITCall32_64.cpp
index aa8e987..e4005ae 100644
--- a/JavaScriptCore/jit/JITCall32_64.cpp
+++ b/JavaScriptCore/jit/JITCall32_64.cpp
@@ -180,18 +180,6 @@ void JIT::emit_op_call_eval(Instruction* currentInstruction)
compileOpCall(op_call_eval, currentInstruction, m_callLinkInfoIndex++);
}
-void JIT::emit_op_load_varargs(Instruction* currentInstruction)
-{
- int argCountDst = currentInstruction[1].u.operand;
- int argsOffset = currentInstruction[2].u.operand;
-
- JITStubCall stubCall(this, cti_op_load_varargs);
- stubCall.addArgument(Imm32(argsOffset));
- stubCall.call();
- // Stores a naked int32 in the register file.
- store32(returnValueRegister, Address(callFrameRegister, argCountDst * sizeof(Register)));
-}
-
void JIT::emit_op_call_varargs(Instruction* currentInstruction)
{
compileOpCallVarargs(currentInstruction);
diff --git a/JavaScriptCore/jit/JITOpcodes.cpp b/JavaScriptCore/jit/JITOpcodes.cpp
index 2bfba83..c81932a 100644
--- a/JavaScriptCore/jit/JITOpcodes.cpp
+++ b/JavaScriptCore/jit/JITOpcodes.cpp
@@ -28,6 +28,7 @@
#if ENABLE(JIT)
#include "JIT.h"
+#include "Arguments.h"
#include "JITInlineMethods.h"
#include "JITStubCall.h"
#include "JSArray.h"
@@ -396,6 +397,10 @@ void JIT::emit_op_instanceof(Instruction* currentInstruction)
emitJumpSlowCaseIfNotJSCell(regT0, baseVal);
emitJumpSlowCaseIfNotJSCell(regT1, proto);
+ // Check that prototype is an object
+ loadPtr(Address(regT1, OBJECT_OFFSETOF(JSCell, m_structure)), regT3);
+ addSlowCase(branch8(NotEqual, Address(regT3, OBJECT_OFFSETOF(Structure, m_typeInfo.m_type)), Imm32(ObjectType)));
+
// Check that baseVal 'ImplementsDefaultHasInstance'.
loadPtr(Address(regT0, OBJECT_OFFSETOF(JSCell, m_structure)), regT0);
addSlowCase(branchTest8(Zero, Address(regT0, OBJECT_OFFSETOF(Structure, m_typeInfo.m_flags)), Imm32(ImplementsDefaultHasInstance)));
@@ -421,13 +426,6 @@ void JIT::emit_op_instanceof(Instruction* currentInstruction)
emitPutVirtualRegister(dst);
}
-void JIT::emit_op_new_func(Instruction* currentInstruction)
-{
- JITStubCall stubCall(this, cti_op_new_func);
- stubCall.addArgument(ImmPtr(m_codeBlock->functionDecl(currentInstruction[2].u.operand)));
- stubCall.call(currentInstruction[1].u.operand);
-}
-
void JIT::emit_op_call(Instruction* currentInstruction)
{
compileOpCall(op_call, currentInstruction, m_callLinkInfoIndex++);
@@ -438,18 +436,6 @@ void JIT::emit_op_call_eval(Instruction* currentInstruction)
compileOpCall(op_call_eval, currentInstruction, m_callLinkInfoIndex++);
}
-void JIT::emit_op_load_varargs(Instruction* currentInstruction)
-{
- int argCountDst = currentInstruction[1].u.operand;
- int argsOffset = currentInstruction[2].u.operand;
-
- JITStubCall stubCall(this, cti_op_load_varargs);
- stubCall.addArgument(Imm32(argsOffset));
- stubCall.call();
- // Stores a naked int32 in the register file.
- store32(returnValueRegister, Address(callFrameRegister, argCountDst * sizeof(Register)));
-}
-
void JIT::emit_op_call_varargs(Instruction* currentInstruction)
{
compileOpCallVarargs(currentInstruction);
@@ -1225,12 +1211,11 @@ void JIT::emit_op_create_arguments(Instruction* currentInstruction)
argsCreated.link(this);
}
-void JIT::emit_op_init_arguments(Instruction* currentInstruction)
+void JIT::emit_op_init_lazy_reg(Instruction* currentInstruction)
{
unsigned dst = currentInstruction[1].u.operand;
storePtr(ImmPtr(0), Address(callFrameRegister, sizeof(Register) * dst));
- storePtr(ImmPtr(0), Address(callFrameRegister, sizeof(Register) * (unmodifiedArgumentsRegister(dst))));
}
void JIT::emit_op_convert_this(Instruction* currentInstruction)
@@ -1447,6 +1432,7 @@ void JIT::emitSlow_op_instanceof(Instruction* currentInstruction, Vector<SlowCas
linkSlowCaseIfNotJSCell(iter, baseVal);
linkSlowCaseIfNotJSCell(iter, proto);
linkSlowCase(iter);
+ linkSlowCase(iter);
JITStubCall stubCall(this, cti_op_instanceof);
stubCall.addArgument(value, regT2);
stubCall.addArgument(baseVal, regT2);
@@ -1484,6 +1470,88 @@ void JIT::emitSlow_op_to_jsnumber(Instruction* currentInstruction, Vector<SlowCa
stubCall.call(currentInstruction[1].u.operand);
}
+void JIT::emit_op_get_arguments_length(Instruction* currentInstruction)
+{
+ int dst = currentInstruction[1].u.operand;
+ int argumentsRegister = currentInstruction[2].u.operand;
+ addSlowCase(branchTestPtr(NonZero, addressFor(argumentsRegister)));
+ emitGetFromCallFrameHeader32(RegisterFile::ArgumentCount, regT0);
+ sub32(Imm32(1), regT0);
+ emitFastArithReTagImmediate(regT0, regT0);
+ emitPutVirtualRegister(dst, regT0);
+}
+
+void JIT::emitSlow_op_get_arguments_length(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
+{
+ linkSlowCase(iter);
+ unsigned dst = currentInstruction[1].u.operand;
+ unsigned base = currentInstruction[2].u.operand;
+ Identifier* ident = &(m_codeBlock->identifier(currentInstruction[3].u.operand));
+
+ emitGetVirtualRegister(base, regT0);
+ JITStubCall stubCall(this, cti_op_get_by_id_generic);
+ stubCall.addArgument(regT0);
+ stubCall.addArgument(ImmPtr(ident));
+ stubCall.call(dst);
+}
+
+void JIT::emit_op_get_argument_by_val(Instruction* currentInstruction)
+{
+ int dst = currentInstruction[1].u.operand;
+ int argumentsRegister = currentInstruction[2].u.operand;
+ int property = currentInstruction[3].u.operand;
+ addSlowCase(branchTestPtr(NonZero, addressFor(argumentsRegister)));
+ emitGetVirtualRegister(property, regT1);
+ addSlowCase(emitJumpIfNotImmediateInteger(regT1));
+ add32(Imm32(1), regT1);
+ // regT1 now contains the integer index of the argument we want, including this
+ emitGetFromCallFrameHeader32(RegisterFile::ArgumentCount, regT2);
+ addSlowCase(branch32(AboveOrEqual, regT1, regT2));
+
+ Jump skipOutofLineParams;
+ int numArgs = m_codeBlock->m_numParameters;
+ if (numArgs) {
+ Jump notInInPlaceArgs = branch32(AboveOrEqual, regT1, Imm32(numArgs));
+ addPtr(Imm32(static_cast<unsigned>(-(RegisterFile::CallFrameHeaderSize + numArgs) * sizeof(Register))), callFrameRegister, regT0);
+ loadPtr(BaseIndex(regT0, regT1, TimesEight, 0), regT0);
+ skipOutofLineParams = jump();
+ notInInPlaceArgs.link(this);
+ }
+
+ addPtr(Imm32(static_cast<unsigned>(-(RegisterFile::CallFrameHeaderSize + numArgs) * sizeof(Register))), callFrameRegister, regT0);
+ mul32(Imm32(sizeof(Register)), regT2, regT2);
+ subPtr(regT2, regT0);
+ loadPtr(BaseIndex(regT0, regT1, TimesEight, 0), regT0);
+ if (numArgs)
+ skipOutofLineParams.link(this);
+ emitPutVirtualRegister(dst, regT0);
+}
+
+void JIT::emitSlow_op_get_argument_by_val(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
+{
+ unsigned dst = currentInstruction[1].u.operand;
+ unsigned arguments = currentInstruction[2].u.operand;
+ unsigned property = currentInstruction[3].u.operand;
+
+ linkSlowCase(iter);
+ Jump skipArgumentsCreation = jump();
+
+ linkSlowCase(iter);
+ linkSlowCase(iter);
+ if (m_codeBlock->m_numParameters == 1)
+ JITStubCall(this, cti_op_create_arguments_no_params).call();
+ else
+ JITStubCall(this, cti_op_create_arguments).call();
+ emitPutVirtualRegister(arguments);
+ emitPutVirtualRegister(unmodifiedArgumentsRegister(arguments));
+
+ skipArgumentsCreation.link(this);
+ JITStubCall stubCall(this, cti_op_get_by_val);
+ stubCall.addArgument(arguments, regT2);
+ stubCall.addArgument(property, regT2);
+ stubCall.call(dst);
+}
+
#endif // !USE(JSVALUE32_64)
void JIT::emit_op_resolve_global_dynamic(Instruction* currentInstruction)
@@ -1528,6 +1596,88 @@ void JIT::emit_op_new_regexp(Instruction* currentInstruction)
stubCall.call(currentInstruction[1].u.operand);
}
+void JIT::emit_op_load_varargs(Instruction* currentInstruction)
+{
+ int argCountDst = currentInstruction[1].u.operand;
+ int argsOffset = currentInstruction[2].u.operand;
+ int expectedParams = m_codeBlock->m_numParameters - 1;
+ // Don't do inline copying if we aren't guaranteed to have a single stream
+ // of arguments
+ if (expectedParams) {
+ JITStubCall stubCall(this, cti_op_load_varargs);
+ stubCall.addArgument(Imm32(argsOffset));
+ stubCall.call();
+ // Stores a naked int32 in the register file.
+ store32(returnValueRegister, Address(callFrameRegister, argCountDst * sizeof(Register)));
+ return;
+ }
+
+#if USE(JSVALUE32_64)
+ addSlowCase(branch32(NotEqual, tagFor(argsOffset), Imm32(JSValue::EmptyValueTag)));
+#else
+ addSlowCase(branchTestPtr(NonZero, addressFor(argsOffset)));
+#endif
+ // Load arg count into regT0
+ emitGetFromCallFrameHeader32(RegisterFile::ArgumentCount, regT0);
+ storePtr(regT0, addressFor(argCountDst));
+ Jump endBranch = branch32(Equal, regT0, Imm32(1));
+
+ mul32(Imm32(sizeof(Register)), regT0, regT3);
+ addPtr(Imm32(static_cast<unsigned>(sizeof(Register) - RegisterFile::CallFrameHeaderSize * sizeof(Register))), callFrameRegister, regT1);
+ subPtr(regT3, regT1); // regT1 is now the start of the out of line arguments
+ addPtr(Imm32(argsOffset * sizeof(Register)), callFrameRegister, regT2); // regT2 is the target buffer
+
+ // Bounds check the registerfile
+ addPtr(regT2, regT3);
+ addSlowCase(branchPtr(Below, AbsoluteAddress(&m_globalData->interpreter->registerFile().m_end), regT3));
+
+ sub32(Imm32(1), regT0);
+ Label loopStart = label();
+ loadPtr(BaseIndex(regT1, regT0, TimesEight, static_cast<unsigned>(0 - 2 * sizeof(Register))), regT3);
+ storePtr(regT3, BaseIndex(regT2, regT0, TimesEight, static_cast<unsigned>(0 - sizeof(Register))));
+#if USE(JSVALUE32_64)
+ loadPtr(BaseIndex(regT1, regT0, TimesEight, static_cast<unsigned>(sizeof(void*) - 2 * sizeof(Register))), regT3);
+ storePtr(regT3, BaseIndex(regT2, regT0, TimesEight, static_cast<unsigned>(sizeof(void*) - sizeof(Register))));
+#endif
+ branchSubPtr(NonZero, Imm32(1), regT0).linkTo(loopStart, this);
+ endBranch.link(this);
+}
+
+void JIT::emitSlow_op_load_varargs(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
+{
+ int argCountDst = currentInstruction[1].u.operand;
+ int argsOffset = currentInstruction[2].u.operand;
+ int expectedParams = m_codeBlock->m_numParameters - 1;
+ if (expectedParams)
+ return;
+
+ linkSlowCase(iter);
+ linkSlowCase(iter);
+ JITStubCall stubCall(this, cti_op_load_varargs);
+ stubCall.addArgument(Imm32(argsOffset));
+ stubCall.call();
+ // Stores a naked int32 in the register file.
+ store32(returnValueRegister, Address(callFrameRegister, argCountDst * sizeof(Register)));
+}
+
+void JIT::emit_op_new_func(Instruction* currentInstruction)
+{
+ Jump lazyJump;
+ int dst = currentInstruction[1].u.operand;
+ if (currentInstruction[3].u.operand) {
+#if USE(JSVALUE32_64)
+ lazyJump = branch32(NotEqual, tagFor(dst), Imm32(JSValue::EmptyValueTag));
+#else
+ lazyJump = branchTestPtr(NonZero, addressFor(dst));
+#endif
+ }
+ JITStubCall stubCall(this, cti_op_new_func);
+ stubCall.addArgument(ImmPtr(m_codeBlock->functionDecl(currentInstruction[2].u.operand)));
+ stubCall.call(currentInstruction[1].u.operand);
+ if (currentInstruction[3].u.operand)
+ lazyJump.link(this);
+}
+
// For both JSValue32_64 and JSValue32
#if ENABLE(JIT_USE_SOFT_MODULO)
#if CPU(ARM_TRADITIONAL)
diff --git a/JavaScriptCore/jit/JITOpcodes32_64.cpp b/JavaScriptCore/jit/JITOpcodes32_64.cpp
index 1ad19b7..ad3b558 100644
--- a/JavaScriptCore/jit/JITOpcodes32_64.cpp
+++ b/JavaScriptCore/jit/JITOpcodes32_64.cpp
@@ -525,7 +525,11 @@ void JIT::emit_op_instanceof(Instruction* currentInstruction)
emitJumpSlowCaseIfNotJSCell(value);
emitJumpSlowCaseIfNotJSCell(baseVal);
emitJumpSlowCaseIfNotJSCell(proto);
-
+
+ // Check that prototype is an object
+ loadPtr(Address(regT1, OBJECT_OFFSETOF(JSCell, m_structure)), regT3);
+ addSlowCase(branch8(NotEqual, Address(regT3, OBJECT_OFFSETOF(Structure, m_typeInfo.m_type)), Imm32(ObjectType)));
+
// Check that baseVal 'ImplementsDefaultHasInstance'.
loadPtr(Address(regT0, OBJECT_OFFSETOF(JSCell, m_structure)), regT0);
addSlowCase(branchTest8(Zero, Address(regT0, OBJECT_OFFSETOF(Structure, m_typeInfo.m_flags)), Imm32(ImplementsDefaultHasInstance)));
@@ -562,6 +566,7 @@ void JIT::emitSlow_op_instanceof(Instruction* currentInstruction, Vector<SlowCas
linkSlowCaseIfNotJSCell(iter, baseVal);
linkSlowCaseIfNotJSCell(iter, proto);
linkSlowCase(iter);
+ linkSlowCase(iter);
JITStubCall stubCall(this, cti_op_instanceof);
stubCall.addArgument(value);
@@ -570,13 +575,6 @@ void JIT::emitSlow_op_instanceof(Instruction* currentInstruction, Vector<SlowCas
stubCall.call(dst);
}
-void JIT::emit_op_new_func(Instruction* currentInstruction)
-{
- JITStubCall stubCall(this, cti_op_new_func);
- stubCall.addArgument(ImmPtr(m_codeBlock->functionDecl(currentInstruction[2].u.operand)));
- stubCall.call(currentInstruction[1].u.operand);
-}
-
void JIT::emit_op_get_global_var(Instruction* currentInstruction)
{
int dst = currentInstruction[1].u.operand;
@@ -1493,12 +1491,11 @@ void JIT::emit_op_create_arguments(Instruction* currentInstruction)
argsCreated.link(this);
}
-void JIT::emit_op_init_arguments(Instruction* currentInstruction)
+void JIT::emit_op_init_lazy_reg(Instruction* currentInstruction)
{
unsigned dst = currentInstruction[1].u.operand;
emitStore(dst, JSValue());
- emitStore(unmodifiedArgumentsRegister(dst), JSValue());
}
void JIT::emit_op_get_callee(Instruction* currentInstruction)
@@ -1565,6 +1562,89 @@ void JIT::emit_op_profile_did_call(Instruction* currentInstruction)
noProfiler.link(this);
}
+void JIT::emit_op_get_arguments_length(Instruction* currentInstruction)
+{
+ int dst = currentInstruction[1].u.operand;
+ int argumentsRegister = currentInstruction[2].u.operand;
+ addSlowCase(branch32(NotEqual, tagFor(argumentsRegister), Imm32(JSValue::EmptyValueTag)));
+ emitGetFromCallFrameHeader32(RegisterFile::ArgumentCount, regT0);
+ sub32(Imm32(1), regT0);
+ emitStoreInt32(dst, regT0);
+}
+
+void JIT::emitSlow_op_get_arguments_length(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
+{
+ linkSlowCase(iter);
+ int dst = currentInstruction[1].u.operand;
+ int base = currentInstruction[2].u.operand;
+ int ident = currentInstruction[3].u.operand;
+
+ JITStubCall stubCall(this, cti_op_get_by_id_generic);
+ stubCall.addArgument(base);
+ stubCall.addArgument(ImmPtr(&(m_codeBlock->identifier(ident))));
+ stubCall.call(dst);
+}
+
+void JIT::emit_op_get_argument_by_val(Instruction* currentInstruction)
+{
+ int dst = currentInstruction[1].u.operand;
+ int argumentsRegister = currentInstruction[2].u.operand;
+ int property = currentInstruction[3].u.operand;
+ addSlowCase(branch32(NotEqual, tagFor(argumentsRegister), Imm32(JSValue::EmptyValueTag)));
+ emitLoad(property, regT1, regT2);
+ addSlowCase(branch32(NotEqual, regT1, Imm32(JSValue::Int32Tag)));
+ add32(Imm32(1), regT2);
+ // regT2 now contains the integer index of the argument we want, including this
+ emitGetFromCallFrameHeader32(RegisterFile::ArgumentCount, regT3);
+ addSlowCase(branch32(AboveOrEqual, regT2, regT3));
+
+ Jump skipOutofLineParams;
+ int numArgs = m_codeBlock->m_numParameters;
+ if (numArgs) {
+ Jump notInInPlaceArgs = branch32(AboveOrEqual, regT2, Imm32(numArgs));
+ addPtr(Imm32(static_cast<unsigned>(-(RegisterFile::CallFrameHeaderSize + numArgs) * sizeof(Register))), callFrameRegister, regT1);
+ loadPtr(BaseIndex(regT1, regT2, TimesEight, OBJECT_OFFSETOF(JSValue, u.asBits.payload)), regT0);
+ loadPtr(BaseIndex(regT1, regT2, TimesEight, OBJECT_OFFSETOF(JSValue, u.asBits.tag)), regT1);
+ skipOutofLineParams = jump();
+ notInInPlaceArgs.link(this);
+ }
+
+ addPtr(Imm32(static_cast<unsigned>(-(RegisterFile::CallFrameHeaderSize + numArgs) * sizeof(Register))), callFrameRegister, regT1);
+ mul32(Imm32(sizeof(Register)), regT3, regT3);
+ subPtr(regT3, regT1);
+ loadPtr(BaseIndex(regT1, regT2, TimesEight, OBJECT_OFFSETOF(JSValue, u.asBits.payload)), regT0);
+ loadPtr(BaseIndex(regT1, regT2, TimesEight, OBJECT_OFFSETOF(JSValue, u.asBits.tag)), regT1);
+ if (numArgs)
+ skipOutofLineParams.link(this);
+ emitStore(dst, regT1, regT0);
+}
+
+void JIT::emitSlow_op_get_argument_by_val(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
+{
+ unsigned dst = currentInstruction[1].u.operand;
+ unsigned arguments = currentInstruction[2].u.operand;
+ unsigned property = currentInstruction[3].u.operand;
+
+ linkSlowCase(iter);
+ Jump skipArgumentsCreation = jump();
+
+ linkSlowCase(iter);
+ linkSlowCase(iter);
+ if (m_codeBlock->m_numParameters == 1)
+ JITStubCall(this, cti_op_create_arguments_no_params).call();
+ else
+ JITStubCall(this, cti_op_create_arguments).call();
+
+ emitStore(arguments, regT1, regT0);
+ emitStore(unmodifiedArgumentsRegister(arguments), regT1, regT0);
+
+ skipArgumentsCreation.link(this);
+ JITStubCall stubCall(this, cti_op_get_by_val);
+ stubCall.addArgument(arguments);
+ stubCall.addArgument(property);
+ stubCall.call(dst);
+}
+
} // namespace JSC
#endif // USE(JSVALUE32_64)
diff --git a/JavaScriptCore/jit/JITStubs.cpp b/JavaScriptCore/jit/JITStubs.cpp
index d5e55b4..f1ec079 100644
--- a/JavaScriptCore/jit/JITStubs.cpp
+++ b/JavaScriptCore/jit/JITStubs.cpp
@@ -1,6 +1,7 @@
/*
* Copyright (C) 2008, 2009 Apple Inc. All rights reserved.
* Copyright (C) 2008 Cameron Zwarich <cwzwarich@uwaterloo.ca>
+ * Copyright (C) Research In Motion Limited 2010. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -234,15 +235,15 @@ SYMBOL_STRING(ctiOpThrowNotCaught) ":" "\n"
#elif COMPILER(GCC) && CPU(ARM_THUMB2)
-#define THUNK_RETURN_ADDRESS_OFFSET 0x40
-#define PRESERVED_RETURN_ADDRESS_OFFSET 0x44
-#define PRESERVED_R4_OFFSET 0x48
-#define PRESERVED_R5_OFFSET 0x4C
-#define PRESERVED_R6_OFFSET 0x50
-#define REGISTER_FILE_OFFSET 0x54
-#define CALLFRAME_OFFSET 0x58
-#define EXCEPTION_OFFSET 0x5C
-#define ENABLE_PROFILER_REFERENCE_OFFSET 0x64
+#define THUNK_RETURN_ADDRESS_OFFSET 0x38
+#define PRESERVED_RETURN_ADDRESS_OFFSET 0x3C
+#define PRESERVED_R4_OFFSET 0x40
+#define PRESERVED_R5_OFFSET 0x44
+#define PRESERVED_R6_OFFSET 0x48
+#define REGISTER_FILE_OFFSET 0x4C
+#define CALLFRAME_OFFSET 0x50
+#define EXCEPTION_OFFSET 0x54
+#define ENABLE_PROFILER_REFERENCE_OFFSET 0x58
#elif (COMPILER(GCC) || COMPILER(RVCT)) && CPU(ARM_TRADITIONAL)
@@ -467,14 +468,14 @@ SYMBOL_STRING(ctiOpThrowNotCaught) ":" "\n"
#elif COMPILER(GCC) && CPU(ARM_THUMB2)
-#define THUNK_RETURN_ADDRESS_OFFSET 0x1C
-#define PRESERVED_RETURN_ADDRESS_OFFSET 0x20
-#define PRESERVED_R4_OFFSET 0x24
-#define PRESERVED_R5_OFFSET 0x28
-#define PRESERVED_R6_OFFSET 0x2C
-#define REGISTER_FILE_OFFSET 0x30
-#define CALLFRAME_OFFSET 0x34
-#define EXCEPTION_OFFSET 0x38
+#define THUNK_RETURN_ADDRESS_OFFSET 0x20
+#define PRESERVED_RETURN_ADDRESS_OFFSET 0x24
+#define PRESERVED_R4_OFFSET 0x28
+#define PRESERVED_R5_OFFSET 0x2C
+#define PRESERVED_R6_OFFSET 0x30
+#define REGISTER_FILE_OFFSET 0x34
+#define CALLFRAME_OFFSET 0x38
+#define EXCEPTION_OFFSET 0x3C
#define ENABLE_PROFILER_REFERENCE_OFFSET 0x40
#elif (COMPILER(GCC) || COMPILER(RVCT)) && CPU(ARM_TRADITIONAL)
diff --git a/JavaScriptCore/jit/JITStubs.h b/JavaScriptCore/jit/JITStubs.h
index d3d7c53..2b22e6d 100644
--- a/JavaScriptCore/jit/JITStubs.h
+++ b/JavaScriptCore/jit/JITStubs.h
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2008 Apple Inc. All rights reserved.
+ * Copyright (C) Research In Motion Limited 2010. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -146,8 +147,8 @@ namespace JSC {
struct JITStackFrame {
JITStubArg reserved; // Unused
JITStubArg args[6];
-#if USE(JSVALUE32_64)
- void* padding[2]; // Maintain 16-byte stack alignment.
+#if !USE(JSVALUE32_64)
+ void* padding; // Maintain 16-byte stack alignment.
#endif
ReturnAddressPtr thunkReturnAddress;
@@ -162,8 +163,6 @@ namespace JSC {
CallFrame* callFrame;
JSValue* exception;
- void* padding2;
-
// These arguments passed on the stack.
Profiler** enabledProfilerReference;
JSGlobalData* globalData;
diff --git a/JavaScriptCore/jsc.pro b/JavaScriptCore/jsc.pro
index 6f3831e..670ca61 100644
--- a/JavaScriptCore/jsc.pro
+++ b/JavaScriptCore/jsc.pro
@@ -32,6 +32,10 @@ mac {
LIBS_PRIVATE += -framework AppKit
}
+wince* {
+ LIBS += mmtimer.lib
+}
+
# Prevent warnings about difference in visibility on Mac OS X
contains(QT_CONFIG, reduce_exports):CONFIG += hide_symbols
unix:contains(QT_CONFIG, reduce_relocations):CONFIG += bsymbolic_functions
diff --git a/JavaScriptCore/os-win32/inttypes.h b/JavaScriptCore/os-win32/inttypes.h
new file mode 100644
index 0000000..0ed6718
--- /dev/null
+++ b/JavaScriptCore/os-win32/inttypes.h
@@ -0,0 +1,261 @@
+// ISO C9x compliant inttypes.h for Microsoft Visual Studio
+// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124
+//
+// Copyright (c) 2006 Alexander Chemeris
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice,
+// this list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+// 3. The name of the author may be used to endorse or promote products
+// derived from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
+// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+// EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+///////////////////////////////////////////////////////////////////////////////
+
+#ifndef INTTYPES_WIN32_H
+#define INTTYPES_WIN32_H
+
+#include <wtf/Platform.h>
+
+#if !COMPILER(MSVC)
+#error "This inttypes.h file should only be compiled with MSVC"
+#endif
+
+#if _MSC_VER > 1000
+#pragma once
+#endif
+
+#include "stdint.h"
+
+// 7.8.1 Macros for format specifiers
+
+#if !defined(__cplusplus) || defined(__STDC_FORMAT_MACROS)
+
+// The fprintf macros for signed integers are:
+#define PRId8 "d"
+#define PRIi8 "i"
+#define PRIdLEAST8 "d"
+#define PRIiLEAST8 "i"
+#define PRIdFAST8 "d"
+#define PRIiFAST8 "i"
+
+#define PRId16 "hd"
+#define PRIi16 "hi"
+#define PRIdLEAST16 "hd"
+#define PRIiLEAST16 "hi"
+#define PRIdFAST16 "hd"
+#define PRIiFAST16 "hi"
+
+#define PRId32 "I32d"
+#define PRIi32 "I32i"
+#define PRIdLEAST32 "I32d"
+#define PRIiLEAST32 "I32i"
+#define PRIdFAST32 "I32d"
+#define PRIiFAST32 "I32i"
+
+#define PRId64 "I64d"
+#define PRIi64 "I64i"
+#define PRIdLEAST64 "I64d"
+#define PRIiLEAST64 "I64i"
+#define PRIdFAST64 "I64d"
+#define PRIiFAST64 "I64i"
+
+#define PRIdMAX "I64d"
+#define PRIiMAX "I64i"
+
+#define PRIdPTR "Id"
+#define PRIiPTR "Ii"
+
+// The fprintf macros for unsigned integers are:
+#define PRIo8 "o"
+#define PRIu8 "u"
+#define PRIx8 "x"
+#define PRIX8 "X"
+#define PRIoLEAST8 "o"
+#define PRIuLEAST8 "u"
+#define PRIxLEAST8 "x"
+#define PRIXLEAST8 "X"
+#define PRIoFAST8 "o"
+#define PRIuFAST8 "u"
+#define PRIxFAST8 "x"
+#define PRIXFAST8 "X"
+
+#define PRIo16 "ho"
+#define PRIu16 "hu"
+#define PRIx16 "hx"
+#define PRIX16 "hX"
+#define PRIoLEAST16 "ho"
+#define PRIuLEAST16 "hu"
+#define PRIxLEAST16 "hx"
+#define PRIXLEAST16 "hX"
+#define PRIoFAST16 "ho"
+#define PRIuFAST16 "hu"
+#define PRIxFAST16 "hx"
+#define PRIXFAST16 "hX"
+
+#define PRIo32 "I32o"
+#define PRIu32 "I32u"
+#define PRIx32 "I32x"
+#define PRIX32 "I32X"
+#define PRIoLEAST32 "I32o"
+#define PRIuLEAST32 "I32u"
+#define PRIxLEAST32 "I32x"
+#define PRIXLEAST32 "I32X"
+#define PRIoFAST32 "I32o"
+#define PRIuFAST32 "I32u"
+#define PRIxFAST32 "I32x"
+#define PRIXFAST32 "I32X"
+
+#define PRIo64 "I64o"
+#define PRIu64 "I64u"
+#define PRIx64 "I64x"
+#define PRIX64 "I64X"
+#define PRIoLEAST64 "I64o"
+#define PRIuLEAST64 "I64u"
+#define PRIxLEAST64 "I64x"
+#define PRIXLEAST64 "I64X"
+#define PRIoFAST64 "I64o"
+#define PRIuFAST64 "I64u"
+#define PRIxFAST64 "I64x"
+#define PRIXFAST64 "I64X"
+
+#define PRIoMAX "I64o"
+#define PRIuMAX "I64u"
+#define PRIxMAX "I64x"
+#define PRIXMAX "I64X"
+
+#define PRIoPTR "Io"
+#define PRIuPTR "Iu"
+#define PRIxPTR "Ix"
+#define PRIXPTR "IX"
+
+// The fscanf macros for signed integers are:
+#define SCNd8 "d"
+#define SCNi8 "i"
+#define SCNdLEAST8 "d"
+#define SCNiLEAST8 "i"
+#define SCNdFAST8 "d"
+#define SCNiFAST8 "i"
+
+#define SCNd16 "hd"
+#define SCNi16 "hi"
+#define SCNdLEAST16 "hd"
+#define SCNiLEAST16 "hi"
+#define SCNdFAST16 "hd"
+#define SCNiFAST16 "hi"
+
+#define SCNd32 "ld"
+#define SCNi32 "li"
+#define SCNdLEAST32 "ld"
+#define SCNiLEAST32 "li"
+#define SCNdFAST32 "ld"
+#define SCNiFAST32 "li"
+
+#define SCNd64 "I64d"
+#define SCNi64 "I64i"
+#define SCNdLEAST64 "I64d"
+#define SCNiLEAST64 "I64i"
+#define SCNdFAST64 "I64d"
+#define SCNiFAST64 "I64i"
+
+#define SCNdMAX "I64d"
+#define SCNiMAX "I64i"
+
+#ifdef _WIN64
+# define SCNdPTR "I64d"
+# define SCNiPTR "I64i"
+#else
+# define SCNdPTR "ld"
+# define SCNiPTR "li"
+#endif
+
+// The fscanf macros for unsigned integers are:
+#define SCNo8 "o"
+#define SCNu8 "u"
+#define SCNx8 "x"
+#define SCNX8 "X"
+#define SCNoLEAST8 "o"
+#define SCNuLEAST8 "u"
+#define SCNxLEAST8 "x"
+#define SCNXLEAST8 "X"
+#define SCNoFAST8 "o"
+#define SCNuFAST8 "u"
+#define SCNxFAST8 "x"
+#define SCNXFAST8 "X"
+
+#define SCNo16 "ho"
+#define SCNu16 "hu"
+#define SCNx16 "hx"
+#define SCNX16 "hX"
+#define SCNoLEAST16 "ho"
+#define SCNuLEAST16 "hu"
+#define SCNxLEAST16 "hx"
+#define SCNXLEAST16 "hX"
+#define SCNoFAST16 "ho"
+#define SCNuFAST16 "hu"
+#define SCNxFAST16 "hx"
+#define SCNXFAST16 "hX"
+
+#define SCNo32 "lo"
+#define SCNu32 "lu"
+#define SCNx32 "lx"
+#define SCNX32 "lX"
+#define SCNoLEAST32 "lo"
+#define SCNuLEAST32 "lu"
+#define SCNxLEAST32 "lx"
+#define SCNXLEAST32 "lX"
+#define SCNoFAST32 "lo"
+#define SCNuFAST32 "lu"
+#define SCNxFAST32 "lx"
+#define SCNXFAST32 "lX"
+
+#define SCNo64 "I64o"
+#define SCNu64 "I64u"
+#define SCNx64 "I64x"
+#define SCNX64 "I64X"
+#define SCNoLEAST64 "I64o"
+#define SCNuLEAST64 "I64u"
+#define SCNxLEAST64 "I64x"
+#define SCNXLEAST64 "I64X"
+#define SCNoFAST64 "I64o"
+#define SCNuFAST64 "I64u"
+#define SCNxFAST64 "I64x"
+#define SCNXFAST64 "I64X"
+
+#define SCNoMAX "I64o"
+#define SCNuMAX "I64u"
+#define SCNxMAX "I64x"
+#define SCNXMAX "I64X"
+
+#ifdef _WIN64
+# define SCNoPTR "I64o"
+# define SCNuPTR "I64u"
+# define SCNxPTR "I64x"
+# define SCNXPTR "I64X"
+#else
+# define SCNoPTR "lo"
+# define SCNuPTR "lu"
+# define SCNxPTR "lx"
+# define SCNXPTR "lX"
+#endif
+
+#endif
+
+#endif
diff --git a/JavaScriptCore/parser/JSParser.cpp b/JavaScriptCore/parser/JSParser.cpp
index 540dc3b..0e526ac 100644
--- a/JavaScriptCore/parser/JSParser.cpp
+++ b/JavaScriptCore/parser/JSParser.cpp
@@ -204,6 +204,7 @@ private:
Scope()
: m_usesEval(false)
, m_needsFullActivation(false)
+ , m_allowsNewDecls(true)
{
}
@@ -212,6 +213,9 @@ private:
m_declaredVariables.add(ident->ustring().impl());
}
+ void preventNewDecls() { m_allowsNewDecls = false; }
+ bool allowsNewDecls() const { return m_allowsNewDecls; }
+
void useVariable(const Identifier* ident, bool isEval)
{
m_usesEval |= isEval;
@@ -249,6 +253,7 @@ private:
private:
bool m_usesEval;
bool m_needsFullActivation;
+ bool m_allowsNewDecls;
IdentifierSet m_declaredVariables;
IdentifierSet m_usedVariables;
IdentifierSet m_closedVariables;
@@ -287,6 +292,17 @@ private:
m_scopeStack[m_scopeStack.size() - 2].collectFreeVariables(&m_scopeStack.last(), shouldTrackClosedVariables);
m_scopeStack.removeLast();
}
+
+ void declareVariable(const Identifier* ident)
+ {
+ unsigned i = m_scopeStack.size() - 1;
+ ASSERT(i < m_scopeStack.size());
+ while (!m_scopeStack[i].allowsNewDecls()) {
+ i--;
+ ASSERT(i < m_scopeStack.size());
+ }
+ m_scopeStack[i].declareVariable(ident);
+ }
ScopeStack m_scopeStack;
};
@@ -425,7 +441,7 @@ template <class TreeBuilder> TreeExpression JSParser::parseVarDeclarationList(Tr
lastIdent = name;
next();
bool hasInitializer = match(EQUAL);
- currentScope()->declareVariable(name);
+ declareVariable(name);
context.addVar(name, (hasInitializer || (!m_allowsIn && match(INTOKEN))) ? DeclarationStacks::HasInitializer : 0);
if (hasInitializer) {
int varDivot = tokenStart() + 1;
@@ -457,7 +473,7 @@ template <class TreeBuilder> TreeConstDeclList JSParser::parseConstDeclarationLi
const Identifier* name = m_token.m_data.ident;
next();
bool hasInitializer = match(EQUAL);
- currentScope()->declareVariable(name);
+ declareVariable(name);
context.addVar(name, DeclarationStacks::IsConstant | (hasInitializer ? DeclarationStacks::HasInitializer : 0));
TreeExpression initializer = 0;
if (hasInitializer) {
@@ -759,6 +775,7 @@ template <class TreeBuilder> TreeStatement JSParser::parseTryStatement(TreeBuild
next();
ScopeRef catchScope = pushScope();
catchScope->declareVariable(ident);
+ catchScope->preventNewDecls();
consumeOrFail(CLOSEPAREN);
matchOrFail(OPENBRACE);
int initialEvalCount = context.evalCount();
@@ -862,7 +879,7 @@ template <class TreeBuilder> TreeFormalParameterList JSParser::parseFormalParame
{
matchOrFail(IDENT);
usesArguments = m_globalData->propertyNames->arguments == *m_token.m_data.ident;
- currentScope()->declareVariable(m_token.m_data.ident);
+ declareVariable(m_token.m_data.ident);
TreeFormalParameterList list = context.createFormalParameterList(*m_token.m_data.ident);
TreeFormalParameterList tail = list;
next();
@@ -870,7 +887,7 @@ template <class TreeBuilder> TreeFormalParameterList JSParser::parseFormalParame
next();
matchOrFail(IDENT);
const Identifier* ident = m_token.m_data.ident;
- currentScope()->declareVariable(ident);
+ declareVariable(ident);
next();
usesArguments = usesArguments || m_globalData->propertyNames->arguments == *ident;
tail = context.createFormalParameterList(tail, *ident);
@@ -933,7 +950,7 @@ template <class TreeBuilder> TreeStatement JSParser::parseFunctionDeclaration(Tr
int bodyStartLine = 0;
failIfFalse((parseFunctionInfo<FunctionNeedsName, true>(context, name, parameters, body, openBracePos, closeBracePos, bodyStartLine)));
failIfFalse(name);
- currentScope()->declareVariable(name);
+ declareVariable(name);
return context.createFuncDeclStatement(name, body, parameters, openBracePos, closeBracePos, bodyStartLine, m_lastLine);
}
diff --git a/JavaScriptCore/parser/Nodes.h b/JavaScriptCore/parser/Nodes.h
index 2d8448c..fa61cdc 100644
--- a/JavaScriptCore/parser/Nodes.h
+++ b/JavaScriptCore/parser/Nodes.h
@@ -1412,8 +1412,11 @@ namespace JSC {
bool usesArguments() const { return m_features & ArgumentsFeature; }
void setUsesArguments() { m_features |= ArgumentsFeature; }
bool usesThis() const { return m_features & ThisFeature; }
+ bool needsActivationForMoreThanVariables() const { ASSERT(m_data); return m_features & (EvalFeature | WithFeature | CatchFeature); }
bool needsActivation() const { ASSERT(m_data); return (hasCapturedVariables()) || (m_features & (EvalFeature | WithFeature | CatchFeature)); }
bool hasCapturedVariables() const { return !!m_data->m_capturedVariables.size(); }
+ size_t capturedVariableCount() const { return m_data->m_capturedVariables.size(); }
+ bool captures(const Identifier& ident) { return m_data->m_capturedVariables.contains(ident.impl()); }
VarStack& varStack() { ASSERT(m_data); return m_data->m_varStack; }
FunctionStack& functionStack() { ASSERT(m_data); return m_data->m_functionStack; }
diff --git a/JavaScriptCore/qt/ChangeLog b/JavaScriptCore/qt/ChangeLog
index e80493b..11018b4 100644
--- a/JavaScriptCore/qt/ChangeLog
+++ b/JavaScriptCore/qt/ChangeLog
@@ -1,3 +1,39 @@
+2010-09-29 Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org>
+
+ Reviewed by Andreas Kling.
+
+ [Qt] QScriptEngine should have an API for creating Date objects
+ https://bugs.webkit.org/show_bug.cgi?id=41667
+
+ Implement newDate(), isDate() and toDateTime() functions. Use the
+ QDateTime::{to,set}MSecsSinceEpoch() functions to do the
+ calculations.
+
+ * api/qscriptengine.cpp:
+ (QScriptEngine::newDate):
+ * api/qscriptengine.h:
+ * api/qscriptengine_p.cpp:
+ (QScriptEnginePrivate::newDate):
+ * api/qscriptengine_p.h:
+ (QScriptEnginePrivate::isDate):
+
+ * api/qscriptoriginalglobalobject_p.h:
+ (QScriptOriginalGlobalObject::QScriptOriginalGlobalObject): need
+ to keep track of Date Constructor and Prototype.
+ (QScriptOriginalGlobalObject::~QScriptOriginalGlobalObject): ditto.
+ (QScriptOriginalGlobalObject::isDate): use the Date Constructor
+ and Prototype to identify Date values.
+
+ * api/qscriptvalue.cpp:
+ (QScriptValue::isDate):
+ (QScriptValue::toDateTime):
+ * api/qscriptvalue.h:
+ * api/qscriptvalue_p.h:
+ (QScriptValuePrivate::isDate):
+ (QScriptValuePrivate::toDateTime):
+ * tests/qscriptengine/tst_qscriptengine.cpp:
+ (tst_QScriptEngine::newDate):
+
2010-07-27 Jedrzej Nowacki <jedrzej.nowacki@nokia.com>
Reviewed by Kenneth Rohde Christiansen.
diff --git a/JavaScriptCore/qt/api/qscriptengine.cpp b/JavaScriptCore/qt/api/qscriptengine.cpp
index 7ef7c8e..607b0b9 100644
--- a/JavaScriptCore/qt/api/qscriptengine.cpp
+++ b/JavaScriptCore/qt/api/qscriptengine.cpp
@@ -25,6 +25,8 @@
#include "qscriptprogram_p.h"
#include "qscriptsyntaxcheckresult_p.h"
#include "qscriptvalue_p.h"
+#include <QtCore/qdatetime.h>
+#include <QtCore/qnumeric.h>
/*!
Constructs a QScriptEngine object.
@@ -368,6 +370,27 @@ QScriptValue QScriptEngine::newArray(uint length)
}
/*!
+ Creates a QtScript object of class Date with the given \a value
+ (the number of milliseconds since 01 January 1970, UTC).
+*/
+QScriptValue QScriptEngine::newDate(qsreal value)
+{
+ return QScriptValuePrivate::get(d_ptr->newDate(value));
+}
+
+/*!
+ Creates a QtScript object of class Date from the given \a value.
+
+ \sa QScriptValue::toDateTime()
+*/
+QScriptValue QScriptEngine::newDate(const QDateTime& value)
+{
+ if (value.isValid())
+ return QScriptValuePrivate::get(d_ptr->newDate(qsreal(value.toMSecsSinceEpoch())));
+ return QScriptValuePrivate::get(d_ptr->newDate(qSNaN()));
+}
+
+/*!
Returns this engine's Global Object.
By default, the Global Object contains the built-in objects that are
diff --git a/JavaScriptCore/qt/api/qscriptengine.h b/JavaScriptCore/qt/api/qscriptengine.h
index b85dc52..281707f 100644
--- a/JavaScriptCore/qt/api/qscriptengine.h
+++ b/JavaScriptCore/qt/api/qscriptengine.h
@@ -23,11 +23,12 @@
#include "qscriptprogram.h"
#include "qscriptstring.h"
#include "qscriptsyntaxcheckresult.h"
+#include "qscriptvalue.h"
#include <QtCore/qobject.h>
#include <QtCore/qshareddata.h>
#include <QtCore/qstring.h>
-class QScriptValue;
+class QDateTime;
class QScriptEnginePrivate;
// FIXME: Remove this once QScriptContext is properly defined.
@@ -69,6 +70,8 @@ public:
QScriptValue newObject();
QScriptValue newArray(uint length = 0);
+ QScriptValue newDate(qsreal value);
+ QScriptValue newDate(const QDateTime& value);
QScriptValue globalObject() const;
private:
friend class QScriptEnginePrivate;
diff --git a/JavaScriptCore/qt/api/qscriptengine_p.cpp b/JavaScriptCore/qt/api/qscriptengine_p.cpp
index a708a34..89054c0 100644
--- a/JavaScriptCore/qt/api/qscriptengine_p.cpp
+++ b/JavaScriptCore/qt/api/qscriptengine_p.cpp
@@ -146,6 +146,20 @@ QScriptValuePrivate* QScriptEnginePrivate::newArray(uint length)
return new QScriptValuePrivate(this, array);
}
+QScriptValuePrivate* QScriptEnginePrivate::newDate(qsreal value)
+{
+ JSValueRef exception = 0;
+ JSValueRef argument = JSValueMakeNumber(m_context, value);
+ JSObjectRef result = JSObjectMakeDate(m_context, /* argumentCount */ 1, &argument, &exception);
+
+ if (exception) {
+ setException(exception, NotNullException);
+ return new QScriptValuePrivate();
+ }
+
+ return new QScriptValuePrivate(this, result);
+}
+
QScriptValuePrivate* QScriptEnginePrivate::globalObject() const
{
JSObjectRef globalObject = JSContextGetGlobalObject(m_context);
diff --git a/JavaScriptCore/qt/api/qscriptengine_p.h b/JavaScriptCore/qt/api/qscriptengine_p.h
index eec1929..4603b91 100644
--- a/JavaScriptCore/qt/api/qscriptengine_p.h
+++ b/JavaScriptCore/qt/api/qscriptengine_p.h
@@ -77,16 +77,19 @@ public:
QScriptValuePrivate* newObject() const;
QScriptValuePrivate* newArray(uint length);
+ QScriptValuePrivate* newDate(qsreal value);
QScriptValuePrivate* globalObject() const;
inline QScriptStringPrivate* toStringHandle(const QString& str) const;
inline operator JSGlobalContextRef() const;
+ inline bool isDate(JSValueRef value) const;
inline bool isArray(JSValueRef value) const;
inline bool isError(JSValueRef value) const;
inline bool objectHasOwnProperty(JSObjectRef object, JSStringRef property) const;
inline QVector<JSStringRef> objectGetOwnPropertyNames(JSObjectRef object) const;
+
private:
QScriptEngine* q_ptr;
JSGlobalContextRef m_context;
@@ -226,6 +229,11 @@ QScriptEnginePrivate::operator JSGlobalContextRef() const
return m_context;
}
+bool QScriptEnginePrivate::isDate(JSValueRef value) const
+{
+ return m_originalGlobalObject.isDate(value);
+}
+
bool QScriptEnginePrivate::isArray(JSValueRef value) const
{
return m_originalGlobalObject.isArray(value);
diff --git a/JavaScriptCore/qt/api/qscriptoriginalglobalobject_p.h b/JavaScriptCore/qt/api/qscriptoriginalglobalobject_p.h
index 31e94f7..2bd945f 100644
--- a/JavaScriptCore/qt/api/qscriptoriginalglobalobject_p.h
+++ b/JavaScriptCore/qt/api/qscriptoriginalglobalobject_p.h
@@ -43,6 +43,7 @@ public:
inline bool objectHasOwnProperty(JSObjectRef object, JSStringRef property) const;
inline QVector<JSStringRef> objectGetOwnPropertyNames(JSObjectRef object) const;
+ inline bool isDate(JSValueRef value) const;
inline bool isArray(JSValueRef value) const;
inline bool isError(JSValueRef value) const;
@@ -61,6 +62,8 @@ private:
JSValueRef m_errorPrototype;
JSObjectRef m_functionConstructor;
JSValueRef m_functionPrototype;
+ JSObjectRef m_dateConstructor;
+ JSValueRef m_datePrototype;
// Reference to standard JS functions that are not exposed by JSC C API.
JSObjectRef m_hasOwnPropertyFunction;
@@ -78,6 +81,7 @@ QScriptOriginalGlobalObject::QScriptOriginalGlobalObject(JSGlobalContextRef cont
initializeMember(globalObject, propertyName.get(), "Array", m_arrayConstructor, m_arrayPrototype);
initializeMember(globalObject, propertyName.get(), "Error", m_errorConstructor, m_errorPrototype);
initializeMember(globalObject, propertyName.get(), "Function", m_functionConstructor, m_functionPrototype);
+ initializeMember(globalObject, propertyName.get(), "Date", m_dateConstructor, m_datePrototype);
propertyName.adopt(JSStringCreateWithUTF8CString("hasOwnProperty"));
m_hasOwnPropertyFunction = const_cast<JSObjectRef>(JSObjectGetProperty(m_context, globalObject, propertyName.get(), &exception));
@@ -126,6 +130,8 @@ QScriptOriginalGlobalObject::~QScriptOriginalGlobalObject()
JSValueUnprotect(m_context, m_errorPrototype);
JSValueUnprotect(m_context, m_functionConstructor);
JSValueUnprotect(m_context, m_functionPrototype);
+ JSValueUnprotect(m_context, m_dateConstructor);
+ JSValueUnprotect(m_context, m_datePrototype);
JSValueUnprotect(m_context, m_hasOwnPropertyFunction);
JSValueUnprotect(m_context, m_getOwnPropertyNamesFunction);
JSGlobalContextRelease(m_context);
@@ -170,6 +176,11 @@ inline QVector<JSStringRef> QScriptOriginalGlobalObject::objectGetOwnPropertyNam
return names;
}
+inline bool QScriptOriginalGlobalObject::isDate(JSValueRef value) const
+{
+ return isType(value, m_dateConstructor, m_datePrototype);
+}
+
inline bool QScriptOriginalGlobalObject::isArray(JSValueRef value) const
{
return isType(value, m_arrayConstructor, m_arrayPrototype);
diff --git a/JavaScriptCore/qt/api/qscriptvalue.cpp b/JavaScriptCore/qt/api/qscriptvalue.cpp
index a7d0b7b..8a7a6c4 100644
--- a/JavaScriptCore/qt/api/qscriptvalue.cpp
+++ b/JavaScriptCore/qt/api/qscriptvalue.cpp
@@ -324,6 +324,17 @@ bool QScriptValue::isArray() const
}
/*!
+ Returns true if this QScriptValue is an object of the Date class;
+ otherwise returns false.
+
+ \sa QScriptEngine::newDate()
+*/
+bool QScriptValue::isDate() const
+{
+ return d_ptr->isDate();
+}
+
+/*!
Returns true if this QScriptValue is of the Object type; otherwise
returns false.
@@ -488,6 +499,18 @@ QScriptValue QScriptValue::toObject() const
}
/*!
+ Returns a QDateTime representation of this value, in local time.
+ If this QScriptValue is not a date, or the value of the date is
+ NaN (Not-a-Number), an invalid QDateTime is returned.
+
+ \sa isDate()
+*/
+QDateTime QScriptValue::toDateTime() const
+{
+ return d_ptr->toDateTime();
+}
+
+/*!
Calls this QScriptValue as a function, using \a thisObject as
the `this' object in the function call, and passing \a args
as arguments to the function. Returns the value returned from
diff --git a/JavaScriptCore/qt/api/qscriptvalue.h b/JavaScriptCore/qt/api/qscriptvalue.h
index 991a6a0..bd33849 100644
--- a/JavaScriptCore/qt/api/qscriptvalue.h
+++ b/JavaScriptCore/qt/api/qscriptvalue.h
@@ -26,6 +26,7 @@
class QScriptEngine;
class QScriptValuePrivate;
+class QDateTime;
class QScriptValue;
typedef QList<QScriptValue> QScriptValueList;
@@ -112,6 +113,7 @@ public:
bool isObject() const;
bool isError() const;
bool isArray() const;
+ bool isDate() const;
QString toString() const;
qsreal toNumber() const;
@@ -122,6 +124,7 @@ public:
quint32 toUInt32() const;
quint16 toUInt16() const;
QScriptValue toObject() const;
+ QDateTime toDateTime() const;
QScriptValue call(const QScriptValue& thisObject = QScriptValue(),
const QScriptValueList& args = QScriptValueList());
diff --git a/JavaScriptCore/qt/api/qscriptvalue_p.h b/JavaScriptCore/qt/api/qscriptvalue_p.h
index 6fbf98b..f98a06a 100644
--- a/JavaScriptCore/qt/api/qscriptvalue_p.h
+++ b/JavaScriptCore/qt/api/qscriptvalue_p.h
@@ -26,6 +26,7 @@
#include <JavaScriptCore/JavaScript.h>
#include <JavaScriptCore/JSRetainPtr.h>
#include <JSObjectRefPrivate.h>
+#include <QtCore/qdatetime.h>
#include <QtCore/qmath.h>
#include <QtCore/qnumeric.h>
#include <QtCore/qshareddata.h>
@@ -102,6 +103,7 @@ public:
inline bool isObject();
inline bool isFunction();
inline bool isArray();
+ inline bool isDate();
inline QString toString() const;
inline qsreal toNumber() const;
@@ -113,6 +115,7 @@ public:
inline QScriptValuePrivate* toObject(QScriptEnginePrivate* engine);
inline QScriptValuePrivate* toObject();
+ inline QDateTime toDateTime();
inline QScriptValuePrivate* prototype();
inline void setPrototype(QScriptValuePrivate* prototype);
@@ -462,6 +465,20 @@ bool QScriptValuePrivate::isArray()
}
}
+bool QScriptValuePrivate::isDate()
+{
+ switch (m_state) {
+ case JSValue:
+ if (refinedJSValue() != JSObject)
+ return false;
+ // Fall-through.
+ case JSObject:
+ return m_engine->isDate(*this);
+ default:
+ return false;
+ }
+}
+
QString QScriptValuePrivate::toString() const
{
switch (m_state) {
@@ -662,6 +679,24 @@ QScriptValuePrivate* QScriptValuePrivate::toObject()
return new QScriptValuePrivate;
}
+QDateTime QScriptValuePrivate::toDateTime()
+{
+ if (!isDate())
+ return QDateTime();
+
+ JSValueRef exception = 0;
+ qsreal t = JSValueToNumber(*m_engine, *this, &exception);
+
+ if (exception) {
+ m_engine->setException(exception, QScriptEnginePrivate::NotNullException);
+ return QDateTime();
+ }
+
+ QDateTime result;
+ result.setMSecsSinceEpoch(qint64(t));
+ return result;
+}
+
inline QScriptValuePrivate* QScriptValuePrivate::prototype()
{
if (isObject()) {
diff --git a/JavaScriptCore/qt/tests/qscriptengine/tst_qscriptengine.cpp b/JavaScriptCore/qt/tests/qscriptengine/tst_qscriptengine.cpp
index 58a1587..dabcfb2 100644
--- a/JavaScriptCore/qt/tests/qscriptengine/tst_qscriptengine.cpp
+++ b/JavaScriptCore/qt/tests/qscriptengine/tst_qscriptengine.cpp
@@ -21,6 +21,7 @@
#include "qscriptprogram.h"
#include "qscriptsyntaxcheckresult.h"
#include "qscriptvalue.h"
+#include <QtCore/qnumeric.h>
#include <QtTest/qtest.h>
class tst_QScriptEngine : public QObject {
@@ -50,6 +51,7 @@ private slots:
void toObjectTwoEngines();
void newArray();
void uncaughtException();
+ void newDate();
};
/* Evaluating a script that throw an unhandled exception should return an invalid value. */
@@ -681,5 +683,52 @@ void tst_QScriptEngine::uncaughtException()
}
}
+void tst_QScriptEngine::newDate()
+{
+ QScriptEngine eng;
+ {
+ QScriptValue date = eng.newDate(0);
+ QCOMPARE(date.isValid(), true);
+ QCOMPARE(date.isDate(), true);
+ QCOMPARE(date.isObject(), true);
+ QVERIFY(!date.isFunction());
+ // prototype should be Date.prototype
+ QCOMPARE(date.prototype().isValid(), true);
+ QCOMPARE(date.prototype().isDate(), true);
+ QCOMPARE(date.prototype().strictlyEquals(eng.evaluate("Date.prototype")), true);
+ }
+ {
+ QDateTime dt = QDateTime(QDate(1, 2, 3), QTime(4, 5, 6, 7), Qt::LocalTime);
+ QScriptValue date = eng.newDate(dt);
+ QCOMPARE(date.isValid(), true);
+ QCOMPARE(date.isDate(), true);
+ QCOMPARE(date.isObject(), true);
+ // prototype should be Date.prototype
+ QCOMPARE(date.prototype().isValid(), true);
+ QCOMPARE(date.prototype().isDate(), true);
+ QCOMPARE(date.prototype().strictlyEquals(eng.evaluate("Date.prototype")), true);
+
+ QCOMPARE(date.toDateTime(), dt);
+ }
+ {
+ QDateTime dt = QDateTime(QDate(1, 2, 3), QTime(4, 5, 6, 7), Qt::UTC);
+ QScriptValue date = eng.newDate(dt);
+ // toDateTime() result should be in local time
+ QCOMPARE(date.toDateTime(), dt.toLocalTime());
+ }
+ // Date.parse() should return NaN when it fails
+ {
+ QScriptValue ret = eng.evaluate("Date.parse()");
+ QVERIFY(ret.isNumber());
+ QVERIFY(qIsNaN(ret.toNumber()));
+ }
+ // Date.parse() should be able to parse the output of Date().toString()
+ {
+ QScriptValue ret = eng.evaluate("var x = new Date(); var s = x.toString(); s == new Date(Date.parse(s)).toString()");
+ QVERIFY(ret.isBoolean());
+ QCOMPARE(ret.toBoolean(), true);
+ }
+}
+
QTEST_MAIN(tst_QScriptEngine)
#include "tst_qscriptengine.moc"
diff --git a/JavaScriptCore/runtime/Arguments.h b/JavaScriptCore/runtime/Arguments.h
index d892de0..49c8b3b 100644
--- a/JavaScriptCore/runtime/Arguments.h
+++ b/JavaScriptCore/runtime/Arguments.h
@@ -225,7 +225,7 @@ namespace JSC {
ASSERT(!d()->registerArray);
size_t numParametersMinusThis = d()->functionExecutable->parameterCount();
- size_t numVars = d()->functionExecutable->variableCount();
+ size_t numVars = d()->functionExecutable->capturedVariableCount();
size_t numLocals = numVars + numParametersMinusThis;
if (!numLocals)
diff --git a/JavaScriptCore/runtime/DateConstructor.cpp b/JavaScriptCore/runtime/DateConstructor.cpp
index 5b2f916..49e0405 100644
--- a/JavaScriptCore/runtime/DateConstructor.cpp
+++ b/JavaScriptCore/runtime/DateConstructor.cpp
@@ -90,25 +90,34 @@ JSObject* constructDate(ExecState* exec, const ArgList& args)
value = primitive.toNumber(exec);
}
} else {
- if (isnan(args.at(0).toNumber(exec))
- || isnan(args.at(1).toNumber(exec))
- || (numArgs >= 3 && isnan(args.at(2).toNumber(exec)))
- || (numArgs >= 4 && isnan(args.at(3).toNumber(exec)))
- || (numArgs >= 5 && isnan(args.at(4).toNumber(exec)))
- || (numArgs >= 6 && isnan(args.at(5).toNumber(exec)))
- || (numArgs >= 7 && isnan(args.at(6).toNumber(exec))))
+ double doubleArguments[7] = {
+ args.at(0).toNumber(exec),
+ args.at(1).toNumber(exec),
+ args.at(2).toNumber(exec),
+ args.at(3).toNumber(exec),
+ args.at(4).toNumber(exec),
+ args.at(5).toNumber(exec),
+ args.at(6).toNumber(exec)
+ };
+ if (isnan(doubleArguments[0])
+ || isnan(doubleArguments[1])
+ || (numArgs >= 3 && isnan(doubleArguments[2]))
+ || (numArgs >= 4 && isnan(doubleArguments[3]))
+ || (numArgs >= 5 && isnan(doubleArguments[4]))
+ || (numArgs >= 6 && isnan(doubleArguments[5]))
+ || (numArgs >= 7 && isnan(doubleArguments[6])))
value = NaN;
else {
GregorianDateTime t;
- int year = args.at(0).toInt32(exec);
+ int year = JSC::toInt32(doubleArguments[0]);
t.year = (year >= 0 && year <= 99) ? year : year - 1900;
- t.month = args.at(1).toInt32(exec);
- t.monthDay = (numArgs >= 3) ? args.at(2).toInt32(exec) : 1;
- t.hour = args.at(3).toInt32(exec);
- t.minute = args.at(4).toInt32(exec);
- t.second = args.at(5).toInt32(exec);
+ t.month = JSC::toInt32(doubleArguments[1]);
+ t.monthDay = (numArgs >= 3) ? JSC::toInt32(doubleArguments[2]) : 1;
+ t.hour = JSC::toInt32(doubleArguments[3]);
+ t.minute = JSC::toInt32(doubleArguments[4]);
+ t.second = JSC::toInt32(doubleArguments[5]);
t.isDST = -1;
- double ms = (numArgs >= 7) ? args.at(6).toNumber(exec) : 0;
+ double ms = (numArgs >= 7) ? doubleArguments[6] : 0;
value = gregorianDateTimeToMS(exec, t, ms, false);
}
}
@@ -160,25 +169,34 @@ static EncodedJSValue JSC_HOST_CALL dateNow(ExecState* exec)
static EncodedJSValue JSC_HOST_CALL dateUTC(ExecState* exec)
{
+ double doubleArguments[7] = {
+ exec->argument(0).toNumber(exec),
+ exec->argument(1).toNumber(exec),
+ exec->argument(2).toNumber(exec),
+ exec->argument(3).toNumber(exec),
+ exec->argument(4).toNumber(exec),
+ exec->argument(5).toNumber(exec),
+ exec->argument(6).toNumber(exec)
+ };
int n = exec->argumentCount();
- if (isnan(exec->argument(0).toNumber(exec))
- || isnan(exec->argument(1).toNumber(exec))
- || (n >= 3 && isnan(exec->argument(2).toNumber(exec)))
- || (n >= 4 && isnan(exec->argument(3).toNumber(exec)))
- || (n >= 5 && isnan(exec->argument(4).toNumber(exec)))
- || (n >= 6 && isnan(exec->argument(5).toNumber(exec)))
- || (n >= 7 && isnan(exec->argument(6).toNumber(exec))))
+ if (isnan(doubleArguments[0])
+ || isnan(doubleArguments[1])
+ || (n >= 3 && isnan(doubleArguments[2]))
+ || (n >= 4 && isnan(doubleArguments[3]))
+ || (n >= 5 && isnan(doubleArguments[4]))
+ || (n >= 6 && isnan(doubleArguments[5]))
+ || (n >= 7 && isnan(doubleArguments[6])))
return JSValue::encode(jsNaN(exec));
GregorianDateTime t;
- int year = exec->argument(0).toInt32(exec);
+ int year = JSC::toInt32(doubleArguments[0]);
t.year = (year >= 0 && year <= 99) ? year : year - 1900;
- t.month = exec->argument(1).toInt32(exec);
- t.monthDay = (n >= 3) ? exec->argument(2).toInt32(exec) : 1;
- t.hour = exec->argument(3).toInt32(exec);
- t.minute = exec->argument(4).toInt32(exec);
- t.second = exec->argument(5).toInt32(exec);
- double ms = (n >= 7) ? exec->argument(6).toNumber(exec) : 0;
+ t.month = JSC::toInt32(doubleArguments[1]);
+ t.monthDay = (n >= 3) ? JSC::toInt32(doubleArguments[2]) : 1;
+ t.hour = JSC::toInt32(doubleArguments[3]);
+ t.minute = JSC::toInt32(doubleArguments[4]);
+ t.second = JSC::toInt32(doubleArguments[5]);
+ double ms = (n >= 7) ? doubleArguments[6] : 0;
return JSValue::encode(jsNumber(exec, timeClip(gregorianDateTimeToMS(exec, t, ms, true))));
}
diff --git a/JavaScriptCore/runtime/Executable.cpp b/JavaScriptCore/runtime/Executable.cpp
index e14955c..871f3e2 100644
--- a/JavaScriptCore/runtime/Executable.cpp
+++ b/JavaScriptCore/runtime/Executable.cpp
@@ -65,7 +65,7 @@ ProgramExecutable::~ProgramExecutable()
FunctionExecutable::FunctionExecutable(JSGlobalData* globalData, const Identifier& name, const SourceCode& source, bool forceUsesArguments, FunctionParameters* parameters, int firstLine, int lastLine)
: ScriptExecutable(globalData, source)
- , m_numVariables(0)
+ , m_numCapturedVariables(0)
, m_forceUsesArguments(forceUsesArguments)
, m_parameters(parameters)
, m_name(name)
@@ -77,7 +77,7 @@ FunctionExecutable::FunctionExecutable(JSGlobalData* globalData, const Identifie
FunctionExecutable::FunctionExecutable(ExecState* exec, const Identifier& name, const SourceCode& source, bool forceUsesArguments, FunctionParameters* parameters, int firstLine, int lastLine)
: ScriptExecutable(exec, source)
- , m_numVariables(0)
+ , m_numCapturedVariables(0)
, m_forceUsesArguments(forceUsesArguments)
, m_parameters(parameters)
, m_name(name)
@@ -197,7 +197,7 @@ JSObject* FunctionExecutable::compileForCallInternal(ExecState* exec, ScopeChain
generator->generate();
m_numParametersForCall = m_codeBlockForCall->m_numParameters;
ASSERT(m_numParametersForCall);
- m_numVariables = m_codeBlockForCall->m_numVars;
+ m_numCapturedVariables = m_codeBlockForCall->m_numCapturedVars;
m_symbolTable = m_codeBlockForCall->sharedSymbolTable();
body->destroyData();
@@ -238,7 +238,7 @@ JSObject* FunctionExecutable::compileForConstructInternal(ExecState* exec, Scope
generator->generate();
m_numParametersForConstruct = m_codeBlockForConstruct->m_numParameters;
ASSERT(m_numParametersForConstruct);
- m_numVariables = m_codeBlockForConstruct->m_numVars;
+ m_numCapturedVariables = m_codeBlockForConstruct->m_numCapturedVars;
m_symbolTable = m_codeBlockForConstruct->sharedSymbolTable();
body->destroyData();
diff --git a/JavaScriptCore/runtime/Executable.h b/JavaScriptCore/runtime/Executable.h
index c168ac8..feab7ef 100644
--- a/JavaScriptCore/runtime/Executable.h
+++ b/JavaScriptCore/runtime/Executable.h
@@ -144,6 +144,7 @@ namespace JSC {
, m_features(0)
{
#if ENABLE(CODEBLOCK_SAMPLING)
+ relaxAdoptionRequirement();
if (SamplingTool* sampler = globalData->interpreter->sampler())
sampler->notifyOfScope(this);
#else
@@ -157,6 +158,7 @@ namespace JSC {
, m_features(0)
{
#if ENABLE(CODEBLOCK_SAMPLING)
+ relaxAdoptionRequirement();
if (SamplingTool* sampler = exec->globalData().interpreter->sampler())
sampler->notifyOfScope(this);
#else
@@ -347,7 +349,7 @@ namespace JSC {
const Identifier& name() { return m_name; }
size_t parameterCount() const { return m_parameters->size(); }
- unsigned variableCount() const { return m_numVariables; }
+ unsigned capturedVariableCount() const { return m_numCapturedVariables; }
UString paramString() const;
SharedSymbolTable* symbolTable() const { return m_symbolTable; }
@@ -364,7 +366,7 @@ namespace JSC {
virtual PassOwnPtr<ExceptionInfo> reparseExceptionInfo(JSGlobalData*, ScopeChainNode*, CodeBlock*);
- unsigned m_numVariables : 31;
+ unsigned m_numCapturedVariables : 31;
bool m_forceUsesArguments : 1;
RefPtr<FunctionParameters> m_parameters;
diff --git a/JavaScriptCore/runtime/JSActivation.cpp b/JavaScriptCore/runtime/JSActivation.cpp
index 8cf71d0..d121518 100644
--- a/JavaScriptCore/runtime/JSActivation.cpp
+++ b/JavaScriptCore/runtime/JSActivation.cpp
@@ -62,12 +62,65 @@ void JSActivation::markChildren(MarkStack& markStack)
size_t count = numParametersMinusThis;
markStack.appendValues(registerArray, count);
- size_t numVars = d()->functionExecutable->variableCount();
+ size_t numVars = d()->functionExecutable->capturedVariableCount();
// Skip the call frame, which sits between the parameters and vars.
markStack.appendValues(registerArray + count + RegisterFile::CallFrameHeaderSize, numVars, MayContainNullValues);
}
+inline bool JSActivation::symbolTableGet(const Identifier& propertyName, PropertySlot& slot)
+{
+ SymbolTableEntry entry = symbolTable().inlineGet(propertyName.impl());
+ if (!entry.isNull()) {
+ ASSERT(entry.getIndex() < static_cast<int>(d()->functionExecutable->capturedVariableCount()));
+ slot.setRegisterSlot(&registerAt(entry.getIndex()));
+ return true;
+ }
+ return false;
+}
+
+inline bool JSActivation::symbolTablePut(const Identifier& propertyName, JSValue value)
+{
+ ASSERT(!Heap::heap(value) || Heap::heap(value) == Heap::heap(this));
+
+ SymbolTableEntry entry = symbolTable().inlineGet(propertyName.impl());
+ if (entry.isNull())
+ return false;
+ if (entry.isReadOnly())
+ return true;
+ ASSERT(entry.getIndex() < static_cast<int>(d()->functionExecutable->capturedVariableCount()));
+ registerAt(entry.getIndex()) = value;
+ return true;
+}
+
+void JSActivation::getOwnPropertyNames(ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode)
+{
+ SymbolTable::const_iterator end = symbolTable().end();
+ for (SymbolTable::const_iterator it = symbolTable().begin(); it != end; ++it) {
+ ASSERT(it->second.getIndex() < static_cast<int>(d()->functionExecutable->capturedVariableCount()));
+ if (!(it->second.getAttributes() & DontEnum) || (mode == IncludeDontEnumProperties))
+ propertyNames.add(Identifier(exec, it->first.get()));
+ }
+ // Skip the JSVariableObject implementation of getOwnPropertyNames
+ JSObject::getOwnPropertyNames(exec, propertyNames, mode);
+}
+
+inline bool JSActivation::symbolTablePutWithAttributes(const Identifier& propertyName, JSValue value, unsigned attributes)
+{
+ ASSERT(!Heap::heap(value) || Heap::heap(value) == Heap::heap(this));
+
+ SymbolTable::iterator iter = symbolTable().find(propertyName.impl());
+ if (iter == symbolTable().end())
+ return false;
+ SymbolTableEntry& entry = iter->second;
+ ASSERT(!entry.isNull());
+ if (entry.getIndex() >= static_cast<int>(d()->functionExecutable->capturedVariableCount()))
+ return false;
+ entry.setAttributes(attributes);
+ registerAt(entry.getIndex()) = value;
+ return true;
+}
+
bool JSActivation::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
{
if (propertyName == exec->propertyNames().arguments) {
diff --git a/JavaScriptCore/runtime/JSActivation.h b/JavaScriptCore/runtime/JSActivation.h
index d5e7991..9ff9168 100644
--- a/JavaScriptCore/runtime/JSActivation.h
+++ b/JavaScriptCore/runtime/JSActivation.h
@@ -52,6 +52,7 @@ namespace JSC {
virtual bool isActivationObject() const { return true; }
virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
+ virtual void getOwnPropertyNames(ExecState*, PropertyNameArray&, EnumerationMode);
virtual void put(ExecState*, const Identifier&, JSValue, PutPropertySlot&);
@@ -87,7 +88,13 @@ namespace JSC {
RefPtr<FunctionExecutable> functionExecutable;
};
-
+
+ bool symbolTableGet(const Identifier&, PropertySlot&);
+ bool symbolTableGet(const Identifier&, PropertyDescriptor&);
+ bool symbolTableGet(const Identifier&, PropertySlot&, bool& slotIsWriteable);
+ bool symbolTablePut(const Identifier&, JSValue);
+ bool symbolTablePutWithAttributes(const Identifier&, JSValue, unsigned attributes);
+
static JSValue argumentsGetter(ExecState*, JSValue, const Identifier&);
NEVER_INLINE PropertySlot::GetValueFunc getArgumentsGetter();
diff --git a/JavaScriptCore/runtime/JSArray.cpp b/JavaScriptCore/runtime/JSArray.cpp
index 340cb75..dae807f 100644
--- a/JavaScriptCore/runtime/JSArray.cpp
+++ b/JavaScriptCore/runtime/JSArray.cpp
@@ -202,12 +202,20 @@ JSArray::JSArray(NonNullPassRefPtr<Structure> structure, const ArgList& list)
: JSObject(structure)
{
unsigned initialCapacity = list.size();
-
- m_storage = static_cast<ArrayStorage*>(fastMalloc(storageSize(initialCapacity)));
+ unsigned initialStorage;
+
+ // If the ArgList is empty, allocate space for 3 entries. This value empirically
+ // works well for benchmarks.
+ if (!initialCapacity)
+ initialStorage = 3;
+ else
+ initialStorage = initialCapacity;
+
+ m_storage = static_cast<ArrayStorage*>(fastMalloc(storageSize(initialStorage)));
m_storage->m_allocBase = m_storage;
m_indexBias = 0;
m_storage->m_length = initialCapacity;
- m_vectorLength = initialCapacity;
+ m_vectorLength = initialStorage;
m_storage->m_numValuesInVector = initialCapacity;
m_storage->m_sparseValueMap = 0;
m_storage->subclassData = 0;
@@ -221,10 +229,12 @@ JSArray::JSArray(NonNullPassRefPtr<Structure> structure, const ArgList& list)
ArgList::const_iterator end = list.end();
for (ArgList::const_iterator it = list.begin(); it != end; ++it, ++i)
vector[i] = *it;
+ for (; i < initialStorage; i++)
+ vector[i] = JSValue();
checkConsistency();
- Heap::heap(this)->reportExtraMemoryCost(storageSize(initialCapacity));
+ Heap::heap(this)->reportExtraMemoryCost(storageSize(initialStorage));
}
JSArray::~JSArray()
diff --git a/JavaScriptCore/runtime/JSCell.h b/JavaScriptCore/runtime/JSCell.h
index 2ffce8d..cfa1454 100644
--- a/JavaScriptCore/runtime/JSCell.h
+++ b/JavaScriptCore/runtime/JSCell.h
@@ -34,7 +34,24 @@
namespace JSC {
- class JSCell : public NoncopyableCustomAllocated {
+#if COMPILER(MSVC)
+ // If WTF_MAKE_NONCOPYABLE is applied to JSCell we end up with a bunch of
+ // undefined references to the JSCell copy constructor and assignment operator
+ // when linking JavaScriptCore.
+ class MSVCBugWorkaround {
+ WTF_MAKE_NONCOPYABLE(MSVCBugWorkaround);
+
+ protected:
+ MSVCBugWorkaround() { }
+ ~MSVCBugWorkaround() { }
+ };
+
+ class JSCell : MSVCBugWorkaround {
+#else
+ class JSCell {
+ WTF_MAKE_NONCOPYABLE(JSCell);
+#endif
+
friend class GetterSetter;
friend class Heap;
friend class JIT;
diff --git a/JavaScriptCore/runtime/MathObject.cpp b/JavaScriptCore/runtime/MathObject.cpp
index 5648264..8d2ae2d 100644
--- a/JavaScriptCore/runtime/MathObject.cpp
+++ b/JavaScriptCore/runtime/MathObject.cpp
@@ -135,7 +135,9 @@ EncodedJSValue JSC_HOST_CALL mathProtoFuncATan(ExecState* exec)
EncodedJSValue JSC_HOST_CALL mathProtoFuncATan2(ExecState* exec)
{
- return JSValue::encode(jsDoubleNumber(exec, atan2(exec->argument(0).toNumber(exec), exec->argument(1).toNumber(exec))));
+ double arg0 = exec->argument(0).toNumber(exec);
+ double arg1 = exec->argument(1).toNumber(exec);
+ return JSValue::encode(jsDoubleNumber(exec, atan2(arg0, arg1)));
}
EncodedJSValue JSC_HOST_CALL mathProtoFuncCeil(ExecState* exec)
diff --git a/JavaScriptCore/runtime/RegExp.cpp b/JavaScriptCore/runtime/RegExp.cpp
index d4545cb..3ebfe0f 100644
--- a/JavaScriptCore/runtime/RegExp.cpp
+++ b/JavaScriptCore/runtime/RegExp.cpp
@@ -115,8 +115,6 @@ int RegExp::match(const UString& s, int startOffset, Vector<int, 32>* ovector)
{
if (startOffset < 0)
startOffset = 0;
- if (ovector)
- ovector->resize(0);
#if ENABLE(REGEXP_TRACING)
m_rtMatchCallCount++;
@@ -142,7 +140,10 @@ int RegExp::match(const UString& s, int startOffset, Vector<int, 32>* ovector)
}
ASSERT(offsetVector);
- for (int j = 0; j < offsetVectorSize; ++j)
+ // Initialize offsetVector with the return value (index 0) and the
+ // first subpattern start indicies (even index values) set to -1.
+ // No need to init the subpattern end indicies.
+ for (unsigned j = 0, i = 0; i < m_numSubpatterns + 1; j += 2, i++)
offsetVector[j] = -1;
#if ENABLE(YARR_JIT)
@@ -157,8 +158,6 @@ int RegExp::match(const UString& s, int startOffset, Vector<int, 32>* ovector)
if (result != -1)
fprintf(stderr, "jsRegExpExecute failed with result %d\n", result);
#endif
- if (ovector)
- ovector->clear();
}
#if ENABLE(REGEXP_TRACING)
@@ -255,7 +254,7 @@ int RegExp::match(const UString& s, int startOffset, Vector<int, 32>* ovector)
if (codeBlock.getFallback())
sprintf(jitAddr, "fallback");
else
- sprintf(jitAddr, "0x%014lx", (uintptr_t)codeBlock.getAddr());
+ sprintf(jitAddr, "0x%014lx", reinterpret_cast<unsigned long int>(codeBlock.getAddr()));
#else
const char* jitAddr = "JIT Off";
#endif
diff --git a/JavaScriptCore/wtf/Assertions.cpp b/JavaScriptCore/wtf/Assertions.cpp
index 273e0e0..9222c1d 100644
--- a/JavaScriptCore/wtf/Assertions.cpp
+++ b/JavaScriptCore/wtf/Assertions.cpp
@@ -42,12 +42,11 @@
#ifndef _WIN32_WINNT
#define _WIN32_WINNT 0x0500
#endif
-#include <windows.h>
#include <crtdbg.h>
#endif
-#if OS(WINCE)
-#include <winbase.h>
+#if OS(WINDOWS)
+#include <windows.h>
#endif
#if PLATFORM(BREWMP)
@@ -113,7 +112,7 @@ static void vprintf_stderr_common(const char* format, va_list args)
printLog(buffer);
}
-#elif COMPILER(MSVC) && !defined(WINCEBASIC)
+#elif HAVE(ISDEBUGGERPRESENT)
if (IsDebuggerPresent()) {
size_t size = 1024;
diff --git a/JavaScriptCore/wtf/Noncopyable.h b/JavaScriptCore/wtf/Noncopyable.h
index 60a46e2..898c1ba 100644
--- a/JavaScriptCore/wtf/Noncopyable.h
+++ b/JavaScriptCore/wtf/Noncopyable.h
@@ -21,6 +21,26 @@
#ifndef WTF_Noncopyable_h
#define WTF_Noncopyable_h
+#ifndef __has_feature
+ #define __has_feature(x) 0
+#endif
+
+#if __has_feature(cxx_deleted_functions)
+ #define WTF_MAKE_NONCOPYABLE(ClassName) \
+ _Pragma("clang diagnostic push") \
+ _Pragma("clang diagnostic ignored \"-Wunknown-pragmas\"") \
+ _Pragma("clang diagnostic ignored \"-Wc++0x-extensions\"") \
+ private: \
+ ClassName(const ClassName&) = delete; \
+ ClassName& operator=(const ClassName&) = delete; \
+ _Pragma("clang diagnostic pop")
+#else
+ #define WTF_MAKE_NONCOPYABLE(ClassName) \
+ private: \
+ ClassName(const ClassName&); \
+ ClassName& operator=(const ClassName&)
+#endif
+
// We don't want argument-dependent lookup to pull in everything from the WTF
// namespace when you use Noncopyable, so put it in its own namespace.
@@ -36,17 +56,8 @@ namespace WTFNoncopyable {
~Noncopyable() { }
};
- class NoncopyableCustomAllocated {
- NoncopyableCustomAllocated(const NoncopyableCustomAllocated&);
- NoncopyableCustomAllocated& operator=(const NoncopyableCustomAllocated&);
- protected:
- NoncopyableCustomAllocated() { }
- ~NoncopyableCustomAllocated() { }
- };
-
} // namespace WTFNoncopyable
using WTFNoncopyable::Noncopyable;
-using WTFNoncopyable::NoncopyableCustomAllocated;
#endif // WTF_Noncopyable_h
diff --git a/JavaScriptCore/wtf/PassRefPtr.h b/JavaScriptCore/wtf/PassRefPtr.h
index b43c5ba..052d6e2 100644
--- a/JavaScriptCore/wtf/PassRefPtr.h
+++ b/JavaScriptCore/wtf/PassRefPtr.h
@@ -48,13 +48,13 @@ namespace WTF {
template<typename T> REF_DEREF_INLINE void refIfNotNull(T* ptr)
{
- if (UNLIKELY(ptr != 0))
+ if (LIKELY(ptr != 0))
ptr->ref();
}
template<typename T> REF_DEREF_INLINE void derefIfNotNull(T* ptr)
{
- if (UNLIKELY(ptr != 0))
+ if (LIKELY(ptr != 0))
ptr->deref();
}
diff --git a/JavaScriptCore/wtf/Platform.h b/JavaScriptCore/wtf/Platform.h
index 30bc795..1843bea 100644
--- a/JavaScriptCore/wtf/Platform.h
+++ b/JavaScriptCore/wtf/Platform.h
@@ -746,6 +746,7 @@
#else
#define HAVE_SYS_TIMEB_H 1
#define HAVE_ALIGNED_MALLOC 1
+#define HAVE_ISDEBUGGERPRESENT 1
#endif
#define HAVE_VIRTUALALLOC 1
@@ -964,7 +965,8 @@
/* The JIT is enabled by default on all x86, x64-64, ARM & MIPS platforms. */
#if !defined(ENABLE_JIT) \
&& (CPU(X86) || CPU(X86_64) || CPU(ARM) || CPU(MIPS)) \
- && (OS(DARWIN) || !COMPILER(GCC) || GCC_VERSION_AT_LEAST(4,1,0))
+ && (OS(DARWIN) || !COMPILER(GCC) || GCC_VERSION_AT_LEAST(4,1,0)) \
+ && !OS(WINCE)
#define ENABLE_JIT 1
#endif
@@ -1142,7 +1144,7 @@
#define ENABLE_BRANCH_COMPACTION 1
#endif
-#if PLATFORM(GTK) || (PLATFORM(EFL) && ENABLE(GLIB_SUPPORT))
+#if ENABLE(GLIB_SUPPORT)
#include "GTypedefs.h"
#endif
diff --git a/JavaScriptCore/wtf/RefCounted.h b/JavaScriptCore/wtf/RefCounted.h
index d85c47e..8d8b302 100644
--- a/JavaScriptCore/wtf/RefCounted.h
+++ b/JavaScriptCore/wtf/RefCounted.h
@@ -145,7 +145,9 @@ protected:
}
};
-template<typename T> class RefCountedCustomAllocated : public RefCountedBase, public NoncopyableCustomAllocated {
+template<typename T> class RefCountedCustomAllocated : public RefCountedBase {
+ WTF_MAKE_NONCOPYABLE(RefCountedCustomAllocated);
+
public:
void deref()
{
diff --git a/JavaScriptCore/wtf/StringHashFunctions.h b/JavaScriptCore/wtf/StringHashFunctions.h
index 07f117f..3ad7701 100644
--- a/JavaScriptCore/wtf/StringHashFunctions.h
+++ b/JavaScriptCore/wtf/StringHashFunctions.h
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2005, 2006, 2008, 2010 Apple Inc. All rights reserved.
+ * Copyright (C) 2010 Patrick Gansterer <paroga@paroga.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -27,130 +28,142 @@ namespace WTF {
// Golden ratio - arbitrary start value to avoid mapping all 0's to all 0's
static const unsigned stringHashingStartValue = 0x9e3779b9U;
-// stringHash methods based on Paul Hsieh's SuperFastHash.
+// Paul Hsieh's SuperFastHash
// http://www.azillionmonkeys.com/qed/hash.html
// char* data is interpreted as latin-encoded (zero extended to 16 bits).
+class StringHasher {
+public:
+ inline StringHasher()
+ : m_hash(stringHashingStartValue)
+ , m_hasPendingCharacter(false)
+ , m_pendingCharacter(0)
+ {
+ }
-inline unsigned stringHash(const UChar* data, unsigned length)
-{
- unsigned hash = WTF::stringHashingStartValue;
- unsigned rem = length & 1;
- length >>= 1;
-
- // Main loop
- for (; length > 0; length--) {
- hash += data[0];
- unsigned tmp = (data[1] << 11) ^ hash;
- hash = (hash << 16) ^ tmp;
- data += 2;
- hash += hash >> 11;
+ inline void addCharacters(UChar a, UChar b)
+ {
+ ASSERT(!m_hasPendingCharacter);
+ addCharactersToHash(a, b);
}
- // Handle end case
- if (rem) {
- hash += data[0];
- hash ^= hash << 11;
- hash += hash >> 17;
+ inline void addCharacter(UChar ch)
+ {
+ if (m_hasPendingCharacter) {
+ addCharactersToHash(m_pendingCharacter, ch);
+ m_hasPendingCharacter = false;
+ return;
+ }
+
+ m_pendingCharacter = ch;
+ m_hasPendingCharacter = true;
}
- // Force "avalanching" of final 127 bits
- hash ^= hash << 3;
- hash += hash >> 5;
- hash ^= hash << 2;
- hash += hash >> 15;
- hash ^= hash << 10;
-
- hash &= 0x7fffffff;
-
- // this avoids ever returning a hash code of 0, since that is used to
- // signal "hash not computed yet", using a value that is likely to be
- // effectively the same as 0 when the low bits are masked
- if (hash == 0)
- hash = 0x40000000;
-
- return hash;
-}
-
-inline unsigned stringHash(const char* data, unsigned length)
-{
- unsigned hash = WTF::stringHashingStartValue;
- unsigned rem = length & 1;
- length >>= 1;
-
- // Main loop
- for (; length > 0; length--) {
- hash += static_cast<unsigned char>(data[0]);
- unsigned tmp = (static_cast<unsigned char>(data[1]) << 11) ^ hash;
- hash = (hash << 16) ^ tmp;
- data += 2;
- hash += hash >> 11;
+ inline unsigned hash() const
+ {
+ unsigned result = m_hash;
+
+ // Handle end case.
+ if (m_hasPendingCharacter) {
+ result += m_pendingCharacter;
+ result ^= result << 11;
+ result += result >> 17;
+ }
+
+ // Force "avalanching" of final 31 bits.
+ result ^= result << 3;
+ result += result >> 5;
+ result ^= result << 2;
+ result += result >> 15;
+ result ^= result << 10;
+
+ // First bit is used in UStringImpl for m_isIdentifier.
+ result &= 0x7fffffff;
+
+ // This avoids ever returning a hash code of 0, since that is used to
+ // signal "hash not computed yet", using a value that is likely to be
+ // effectively the same as 0 when the low bits are masked.
+ if (!result)
+ return 0x40000000;
+
+ return result;
}
- // Handle end case
- if (rem) {
- hash += static_cast<unsigned char>(data[0]);
- hash ^= hash << 11;
- hash += hash >> 17;
+ template<typename T, UChar Converter(T)> static inline unsigned createHash(const T* data, unsigned length)
+ {
+ StringHasher hasher;
+ bool rem = length & 1;
+ length >>= 1;
+
+ while (length--) {
+ hasher.addCharacters(Converter(data[0]), Converter(data[1]));
+ data += 2;
+ }
+
+ if (rem)
+ hasher.addCharacter(Converter(*data));
+
+ return hasher.hash();
}
- // Force "avalanching" of final 127 bits
- hash ^= hash << 3;
- hash += hash >> 5;
- hash ^= hash << 2;
- hash += hash >> 15;
- hash ^= hash << 10;
-
- hash &= 0x7fffffff;
-
- // this avoids ever returning a hash code of 0, since that is used to
- // signal "hash not computed yet", using a value that is likely to be
- // effectively the same as 0 when the low bits are masked
- if (hash == 0)
- hash = 0x40000000;
-
- return hash;
-}
-
-inline unsigned stringHash(const char* data)
-{
- unsigned hash = WTF::stringHashingStartValue;
-
- // Main loop
- for (;;) {
- unsigned char b0 = data[0];
- if (!b0)
- break;
- unsigned char b1 = data[1];
- if (!b1) {
- hash += b0;
- hash ^= hash << 11;
- hash += hash >> 17;
- break;
+ template<typename T, UChar Converter(T)> static inline unsigned createHash(const T* data)
+ {
+ StringHasher hasher;
+
+ while (true) {
+ UChar b0 = Converter(*data++);
+ if (!b0)
+ break;
+ UChar b1 = Converter(*data++);
+ if (!b1) {
+ hasher.addCharacter(b0);
+ break;
+ }
+
+ hasher.addCharacters(b0, b1);
}
- hash += b0;
- unsigned tmp = (b1 << 11) ^ hash;
- hash = (hash << 16) ^ tmp;
- data += 2;
- hash += hash >> 11;
+
+ return hasher.hash();
+ }
+
+ template<typename T> static inline unsigned createHash(const T* data, unsigned length)
+ {
+ return createHash<T, defaultCoverter>(data, length);
}
- // Force "avalanching" of final 127 bits.
- hash ^= hash << 3;
- hash += hash >> 5;
- hash ^= hash << 2;
- hash += hash >> 15;
- hash ^= hash << 10;
+ template<typename T> static inline unsigned createHash(const T* data)
+ {
+ return createHash<T, defaultCoverter>(data);
+ }
- hash &= 0x7fffffff;
+ template<size_t length> static inline unsigned createBlobHash(const void* data)
+ {
+ COMPILE_ASSERT(!(length % 4), length_must_be_a_multible_of_four);
+ return createHash<UChar>(static_cast<const UChar*>(data), length / sizeof(UChar));
+ }
- // This avoids ever returning a hash code of 0, since that is used to
- // signal "hash not computed yet", using a value that is likely to be
- // effectively the same as 0 when the low bits are masked.
- if (hash == 0)
- hash = 0x40000000;
+private:
+ static inline UChar defaultCoverter(UChar ch)
+ {
+ return ch;
+ }
+
+ static inline UChar defaultCoverter(char ch)
+ {
+ return static_cast<unsigned char>(ch);
+ }
+
+ inline void addCharactersToHash(UChar a, UChar b)
+ {
+ m_hash += a;
+ unsigned tmp = (b << 11) ^ m_hash;
+ m_hash = (m_hash << 16) ^ tmp;
+ m_hash += m_hash >> 11;
+ }
- return hash;
-}
+ unsigned m_hash;
+ bool m_hasPendingCharacter;
+ UChar m_pendingCharacter;
+};
} // namespace WTF
diff --git a/JavaScriptCore/wtf/ThreadingPthreads.cpp b/JavaScriptCore/wtf/ThreadingPthreads.cpp
index 98286d3..0017a6f 100644
--- a/JavaScriptCore/wtf/ThreadingPthreads.cpp
+++ b/JavaScriptCore/wtf/ThreadingPthreads.cpp
@@ -241,12 +241,6 @@ ThreadIdentifier currentThread()
Mutex::Mutex()
{
-#if PTHREAD_MUTEX_NORMAL == PTHREAD_MUTEX_DEFAULT
-
- pthread_mutex_init(&m_mutex, 0);
-
-#else
-
pthread_mutexattr_t attr;
pthread_mutexattr_init(&attr);
pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_NORMAL);
@@ -254,8 +248,6 @@ Mutex::Mutex()
pthread_mutex_init(&m_mutex, &attr);
pthread_mutexattr_destroy(&attr);
-
-#endif
}
Mutex::~Mutex()
diff --git a/JavaScriptCore/wtf/gobject/GOwnPtr.cpp b/JavaScriptCore/wtf/gobject/GOwnPtr.cpp
index da0d839..8dcfb9e 100644
--- a/JavaScriptCore/wtf/gobject/GOwnPtr.cpp
+++ b/JavaScriptCore/wtf/gobject/GOwnPtr.cpp
@@ -19,6 +19,8 @@
#include "config.h"
#include "GOwnPtr.h"
+#if ENABLE(GLIB_SUPPORT)
+
#include <gio/gio.h>
#include <glib.h>
@@ -65,3 +67,5 @@ template <> void freeOwnedGPtr<GFile>(GFile* ptr)
g_object_unref(ptr);
}
} // namespace WTF
+
+#endif // ENABLE(GLIB_SUPPORT)
diff --git a/JavaScriptCore/wtf/gobject/GOwnPtr.h b/JavaScriptCore/wtf/gobject/GOwnPtr.h
index e04ee9d..cec3e43 100644
--- a/JavaScriptCore/wtf/gobject/GOwnPtr.h
+++ b/JavaScriptCore/wtf/gobject/GOwnPtr.h
@@ -22,6 +22,8 @@
#ifndef GOwnPtr_h
#define GOwnPtr_h
+#if ENABLE(GLIB_SUPPORT)
+
#include <algorithm>
#include <wtf/Assertions.h>
#include <wtf/Noncopyable.h>
@@ -135,4 +137,7 @@ template <typename T> inline void freeOwnedGPtr(T* ptr)
using WTF::GOwnPtr;
+#endif // ENABLE(GLIB_SUPPORT)
+
#endif // GOwnPtr_h
+
diff --git a/JavaScriptCore/wtf/gobject/GRefPtr.cpp b/JavaScriptCore/wtf/gobject/GRefPtr.cpp
index 14f7cf4..085684e 100644
--- a/JavaScriptCore/wtf/gobject/GRefPtr.cpp
+++ b/JavaScriptCore/wtf/gobject/GRefPtr.cpp
@@ -19,6 +19,8 @@
#include "config.h"
#include "GRefPtr.h"
+#if ENABLE(GLIB_SUPPORT)
+
#include <glib.h>
namespace WTF {
@@ -80,3 +82,5 @@ template <> void derefPlatformPtr(GSource* ptr)
}
} // namespace WTF
+
+#endif // ENABLE(GLIB_SUPPORT)
diff --git a/JavaScriptCore/wtf/gobject/GRefPtr.h b/JavaScriptCore/wtf/gobject/GRefPtr.h
index ede0a7a..4efd9be 100644
--- a/JavaScriptCore/wtf/gobject/GRefPtr.h
+++ b/JavaScriptCore/wtf/gobject/GRefPtr.h
@@ -23,6 +23,8 @@
#ifndef WTF_GRefPtr_h
#define WTF_GRefPtr_h
+#if ENABLE(GLIB_SUPPORT)
+
#include "AlwaysInline.h"
#include "PlatformRefPtr.h"
#include <algorithm>
@@ -54,4 +56,6 @@ template <typename T> inline void derefPlatformPtr(T* ptr)
} // namespace WTF
+#endif // ENABLE(GLIB_SUPPORT)
+
#endif // WTF_GRefPtr_h
diff --git a/JavaScriptCore/wtf/text/AtomicString.cpp b/JavaScriptCore/wtf/text/AtomicString.cpp
index 1981170..c8140d6 100644
--- a/JavaScriptCore/wtf/text/AtomicString.cpp
+++ b/JavaScriptCore/wtf/text/AtomicString.cpp
@@ -156,6 +156,11 @@ static inline bool equal(StringImpl* string, const UChar* characters, unsigned l
#endif
}
+bool operator==(const AtomicString& string, const Vector<UChar>& vector)
+{
+ return string.impl() && equal(string.impl(), vector.data(), vector.size());
+}
+
struct UCharBufferTranslator {
static unsigned hash(const UCharBuffer& buf)
{
diff --git a/JavaScriptCore/wtf/text/AtomicString.h b/JavaScriptCore/wtf/text/AtomicString.h
index cfabde7..06e63f4 100644
--- a/JavaScriptCore/wtf/text/AtomicString.h
+++ b/JavaScriptCore/wtf/text/AtomicString.h
@@ -126,15 +126,19 @@ private:
inline bool operator==(const AtomicString& a, const AtomicString& b) { return a.impl() == b.impl(); }
bool operator==(const AtomicString& a, const char* b);
+bool operator==(const AtomicString& a, const Vector<UChar>& b);
inline bool operator==(const AtomicString& a, const String& b) { return equal(a.impl(), b.impl()); }
inline bool operator==(const char* a, const AtomicString& b) { return b == a; }
inline bool operator==(const String& a, const AtomicString& b) { return equal(a.impl(), b.impl()); }
+inline bool operator==(const Vector<UChar>& a, const AtomicString& b) { return b == a; }
inline bool operator!=(const AtomicString& a, const AtomicString& b) { return a.impl() != b.impl(); }
inline bool operator!=(const AtomicString& a, const char *b) { return !(a == b); }
inline bool operator!=(const AtomicString& a, const String& b) { return !equal(a.impl(), b.impl()); }
+inline bool operator!=(const AtomicString& a, const Vector<UChar>& b) { return !(a == b); }
inline bool operator!=(const char* a, const AtomicString& b) { return !(b == a); }
inline bool operator!=(const String& a, const AtomicString& b) { return !equal(a.impl(), b.impl()); }
+inline bool operator!=(const Vector<UChar>& a, const AtomicString& b) { return !(a == b); }
inline bool equalIgnoringCase(const AtomicString& a, const AtomicString& b) { return equalIgnoringCase(a.impl(), b.impl()); }
inline bool equalIgnoringCase(const AtomicString& a, const char* b) { return equalIgnoringCase(a.impl(), b); }
diff --git a/JavaScriptCore/wtf/text/StringImpl.h b/JavaScriptCore/wtf/text/StringImpl.h
index cec0b80..7025d9f 100644
--- a/JavaScriptCore/wtf/text/StringImpl.h
+++ b/JavaScriptCore/wtf/text/StringImpl.h
@@ -233,9 +233,9 @@ public:
unsigned hash() const { if (!m_hash) m_hash = computeHash(m_data, m_length); return m_hash; }
unsigned existingHash() const { ASSERT(m_hash); return m_hash; }
- static unsigned computeHash(const UChar* data, unsigned length) { return WTF::stringHash(data, length); }
- static unsigned computeHash(const char* data, unsigned length) { return WTF::stringHash(data, length); }
- static unsigned computeHash(const char* data) { return WTF::stringHash(data); }
+ static unsigned computeHash(const UChar* data, unsigned length) { return WTF::StringHasher::createHash<UChar>(data, length); }
+ static unsigned computeHash(const char* data, unsigned length) { return WTF::StringHasher::createHash<char>(data, length); }
+ static unsigned computeHash(const char* data) { return WTF::StringHasher::createHash<char>(data); }
ALWAYS_INLINE void deref() { m_refCountAndFlags -= s_refCountIncrement; if (!(m_refCountAndFlags & (s_refCountMask | s_refCountFlagStatic))) delete this; }
ALWAYS_INLINE bool hasOneRef() const { return (m_refCountAndFlags & (s_refCountMask | s_refCountFlagStatic)) == s_refCountIncrement; }
diff --git a/JavaScriptCore/wtf/unicode/UTF8.cpp b/JavaScriptCore/wtf/unicode/UTF8.cpp
index 21d5856..40c5609 100644
--- a/JavaScriptCore/wtf/unicode/UTF8.cpp
+++ b/JavaScriptCore/wtf/unicode/UTF8.cpp
@@ -240,7 +240,7 @@ ConversionResult convertUTF8ToUTF16(
UChar* target = *targetStart;
while (source < sourceEnd) {
UChar32 ch = 0;
- int extraBytesToRead = UTF8SequenceLength(*source) - 1;
+ int extraBytesToRead = inlineUTF8SequenceLength(*source) - 1;
if (source + extraBytesToRead >= sourceEnd) {
result = sourceExhausted;
break;
diff --git a/JavaScriptCore/wtf/unicode/qt4/UnicodeQt4.h b/JavaScriptCore/wtf/unicode/qt4/UnicodeQt4.h
index c9e2e1c..547ed32 100644
--- a/JavaScriptCore/wtf/unicode/qt4/UnicodeQt4.h
+++ b/JavaScriptCore/wtf/unicode/qt4/UnicodeQt4.h
@@ -58,7 +58,7 @@ namespace QUnicodeTables {
QT_END_NAMESPACE
// ugly hack to make UChar compatible with JSChar in API/JSStringRef.h
-#if defined(Q_OS_WIN) || COMPILER(WINSCW) || (COMPILER(RVCT) && OS(SYMBIAN))
+#if defined(Q_OS_WIN) || COMPILER(WINSCW) || (COMPILER(RVCT) && !OS(LINUX))
typedef wchar_t UChar;
#else
typedef uint16_t UChar;
diff --git a/JavaScriptCore/yarr/RegexInterpreter.cpp b/JavaScriptCore/yarr/RegexInterpreter.cpp
index d50c6c8..17ffd8f 100644
--- a/JavaScriptCore/yarr/RegexInterpreter.cpp
+++ b/JavaScriptCore/yarr/RegexInterpreter.cpp
@@ -1106,6 +1106,10 @@ public:
input.next();
context->matchBegin = input.getPos();
+
+ if (currentTerm().alternative.onceThrough)
+ context->term += currentTerm().alternative.next;
+
MATCH_NEXT();
}
case ByteTerm::TypeBodyAlternativeEnd:
@@ -1257,7 +1261,7 @@ public:
PassOwnPtr<BytecodePattern> compile(BumpPointerAllocator* allocator)
{
- regexBegin(m_pattern.m_numSubpatterns, m_pattern.m_body->m_callFrameSize);
+ regexBegin(m_pattern.m_numSubpatterns, m_pattern.m_body->m_callFrameSize, m_pattern.m_body->m_alternatives[0]->onceThrough());
emitDisjunction(m_pattern.m_body);
regexEnd();
@@ -1462,10 +1466,10 @@ public:
}
}
- void regexBegin(unsigned numSubpatterns, unsigned callFrameSize)
+ void regexBegin(unsigned numSubpatterns, unsigned callFrameSize, bool onceThrough)
{
m_bodyDisjunction = adoptPtr(new ByteDisjunction(numSubpatterns, callFrameSize));
- m_bodyDisjunction->terms.append(ByteTerm::BodyAlternativeBegin());
+ m_bodyDisjunction->terms.append(ByteTerm::BodyAlternativeBegin(onceThrough));
m_bodyDisjunction->terms[0].frameLocation = 0;
m_currentAlternativeIndex = 0;
}
@@ -1475,11 +1479,11 @@ public:
closeBodyAlternative();
}
- void alternativeBodyDisjunction()
+ void alternativeBodyDisjunction(bool onceThrough)
{
int newAlternativeIndex = m_bodyDisjunction->terms.size();
m_bodyDisjunction->terms[m_currentAlternativeIndex].alternative.next = newAlternativeIndex - m_currentAlternativeIndex;
- m_bodyDisjunction->terms.append(ByteTerm::BodyAlternativeDisjunction());
+ m_bodyDisjunction->terms.append(ByteTerm::BodyAlternativeDisjunction(onceThrough));
m_currentAlternativeIndex = newAlternativeIndex;
}
@@ -1498,14 +1502,15 @@ public:
for (unsigned alt = 0; alt < disjunction->m_alternatives.size(); ++alt) {
unsigned currentCountAlreadyChecked = inputCountAlreadyChecked;
+ PatternAlternative* alternative = disjunction->m_alternatives[alt];
+
if (alt) {
if (disjunction == m_pattern.m_body)
- alternativeBodyDisjunction();
+ alternativeBodyDisjunction(alternative->onceThrough());
else
alternativeDisjunction();
}
- PatternAlternative* alternative = disjunction->m_alternatives[alt];
unsigned minimumSize = alternative->m_minimumSize;
ASSERT(minimumSize >= parenthesesInputCountAlreadyChecked);
diff --git a/JavaScriptCore/yarr/RegexInterpreter.h b/JavaScriptCore/yarr/RegexInterpreter.h
index 4da9cc5..37f17fe 100644
--- a/JavaScriptCore/yarr/RegexInterpreter.h
+++ b/JavaScriptCore/yarr/RegexInterpreter.h
@@ -94,6 +94,7 @@ struct ByteTerm {
struct {
int next;
int end;
+ bool onceThrough;
} alternative;
unsigned checkInputCount;
};
@@ -215,19 +216,21 @@ struct ByteTerm {
return ByteTerm(TypeBackReference, subpatternId, false, inputPos);
}
- static ByteTerm BodyAlternativeBegin()
+ static ByteTerm BodyAlternativeBegin(bool onceThrough)
{
ByteTerm term(TypeBodyAlternativeBegin);
term.alternative.next = 0;
term.alternative.end = 0;
+ term.alternative.onceThrough = onceThrough;
return term;
}
- static ByteTerm BodyAlternativeDisjunction()
+ static ByteTerm BodyAlternativeDisjunction(bool onceThrough)
{
ByteTerm term(TypeBodyAlternativeDisjunction);
term.alternative.next = 0;
term.alternative.end = 0;
+ term.alternative.onceThrough = onceThrough;
return term;
}
@@ -236,6 +239,7 @@ struct ByteTerm {
ByteTerm term(TypeBodyAlternativeEnd);
term.alternative.next = 0;
term.alternative.end = 0;
+ term.alternative.onceThrough = false;
return term;
}
@@ -244,6 +248,7 @@ struct ByteTerm {
ByteTerm term(TypeAlternativeBegin);
term.alternative.next = 0;
term.alternative.end = 0;
+ term.alternative.onceThrough = false;
return term;
}
@@ -252,6 +257,7 @@ struct ByteTerm {
ByteTerm term(TypeAlternativeDisjunction);
term.alternative.next = 0;
term.alternative.end = 0;
+ term.alternative.onceThrough = false;
return term;
}
@@ -260,6 +266,7 @@ struct ByteTerm {
ByteTerm term(TypeAlternativeEnd);
term.alternative.next = 0;
term.alternative.end = 0;
+ term.alternative.onceThrough = false;
return term;
}
diff --git a/JavaScriptCore/yarr/RegexJIT.cpp b/JavaScriptCore/yarr/RegexJIT.cpp
index 8740130..1b80464 100644
--- a/JavaScriptCore/yarr/RegexJIT.cpp
+++ b/JavaScriptCore/yarr/RegexJIT.cpp
@@ -986,10 +986,8 @@ class RegexGenerator : private MacroAssembler {
parenthesesState.plantJumpToBacktrackIfExists(this);
// A failure WITHIN the parens jumps here
parenthesesState.linkAlternativeBacktracks(this);
- if (term.invertOrCapture) {
+ if (term.invertOrCapture)
store32(Imm32(-1), Address(output, (term.parentheses.subpatternId << 1) * sizeof(int)));
- store32(Imm32(-1), Address(output, ((term.parentheses.subpatternId << 1) + 1) * sizeof(int)));
- }
if (term.quantityType == QuantifierGreedy)
storeToFrame(Imm32(0), parenthesesFrameLocation);
@@ -1271,64 +1269,75 @@ class RegexGenerator : private MacroAssembler {
// if there are any more alternatives, plant the check for input before looping.
if (state.alternativeValid()) {
PatternAlternative* nextAlternative = state.alternative();
- bool setAlternativeLoopLabel = false;
if (!setRepeatAlternativeLabels && !nextAlternative->onceThrough()) {
// We have handled non-repeating alternatives, jump to next iteration
// and loop over repeating alternatives.
state.jumpToBacktrack(jump(), this);
-
- firstAlternative = Label(this);
- setRepeatAlternativeLabels = true;
- setAlternativeLoopLabel = true;
- }
-
- int countToCheckForNextAlternative = nextAlternative->m_minimumSize;
-
- if (countCheckedForCurrentAlternative > countToCheckForNextAlternative) { // CASE 1: current alternative was longer than the next one.
- // If we get here, there the last input checked failed.
- notEnoughInputForPreviousAlternative.link(this);
-
- // Check if sufficent input available to run the next alternative
- notEnoughInputForPreviousAlternative.append(jumpIfNoAvailableInput(countToCheckForNextAlternative - countCheckedForCurrentAlternative));
- // We are now in the correct state to enter the next alternative; this add is only required
- // to mirror and revert operation of the sub32, just below.
- add32(Imm32(countCheckedForCurrentAlternative - countToCheckForNextAlternative), index);
-
- // If we get here, there the last input checked passed.
- state.linkAlternativeBacktracks(this);
- // No need to check if we can run the next alternative, since it is shorter -
- // just update index.
- sub32(Imm32(countCheckedForCurrentAlternative - countToCheckForNextAlternative), index);
- } else if (countCheckedForCurrentAlternative < countToCheckForNextAlternative) { // CASE 2: next alternative is longer than the current one.
+
+ countToCheckForFirstAlternative = nextAlternative->m_minimumSize;
+
// If we get here, there the last input checked failed.
- // If there is insufficient input to run the current alternative, and the next alternative is longer,
- // then there is definitely not enough input to run it - don't even check. Just adjust index, as if
- // we had checked.
notEnoughInputForPreviousAlternative.link(this);
- add32(Imm32(countToCheckForNextAlternative - countCheckedForCurrentAlternative), index);
- notEnoughInputForPreviousAlternative.append(jump());
-
- // The next alternative is longer than the current one; check the difference.
- state.linkAlternativeBacktracks(this);
- notEnoughInputForPreviousAlternative.append(jumpIfNoAvailableInput(countToCheckForNextAlternative - countCheckedForCurrentAlternative));
- } else { // CASE 3: Both alternatives are the same length.
- ASSERT(countCheckedForCurrentAlternative == countToCheckForNextAlternative);
-
- // If the next alterative is the same length as this one, then no need to check the input -
- // if there was sufficent input to run the current alternative then there is sufficient
- // input to run the next one; if not, there isn't.
+
state.linkAlternativeBacktracks(this);
- }
- if (setAlternativeLoopLabel) {
+ // Back up to start the looping alternatives.
+ if (countCheckedForCurrentAlternative)
+ sub32(Imm32(countCheckedForCurrentAlternative), index);
+
+ firstAlternative = Label(this);
+
+ state.checkedTotal = countToCheckForFirstAlternative;
+ if (countToCheckForFirstAlternative)
+ notEnoughInputForPreviousAlternative.append(jumpIfNoAvailableInput(countToCheckForFirstAlternative));
+
+ countCheckedForCurrentAlternative = countToCheckForFirstAlternative;
+
firstAlternativeInputChecked = Label(this);
- countToCheckForFirstAlternative = countToCheckForNextAlternative;
- setAlternativeLoopLabel = true;
+
+ setRepeatAlternativeLabels = true;
+ } else {
+ int countToCheckForNextAlternative = nextAlternative->m_minimumSize;
+
+ if (countCheckedForCurrentAlternative > countToCheckForNextAlternative) { // CASE 1: current alternative was longer than the next one.
+ // If we get here, then the last input checked failed.
+ notEnoughInputForPreviousAlternative.link(this);
+
+ // Check if sufficent input available to run the next alternative
+ notEnoughInputForPreviousAlternative.append(jumpIfNoAvailableInput(countToCheckForNextAlternative - countCheckedForCurrentAlternative));
+ // We are now in the correct state to enter the next alternative; this add is only required
+ // to mirror and revert operation of the sub32, just below.
+ add32(Imm32(countCheckedForCurrentAlternative - countToCheckForNextAlternative), index);
+
+ // If we get here, then the last input checked passed.
+ state.linkAlternativeBacktracks(this);
+ // No need to check if we can run the next alternative, since it is shorter -
+ // just update index.
+ sub32(Imm32(countCheckedForCurrentAlternative - countToCheckForNextAlternative), index);
+ } else if (countCheckedForCurrentAlternative < countToCheckForNextAlternative) { // CASE 2: next alternative is longer than the current one.
+ // If we get here, then the last input checked failed.
+ // If there is insufficient input to run the current alternative, and the next alternative is longer,
+ // then there is definitely not enough input to run it - don't even check. Just adjust index, as if
+ // we had checked.
+ notEnoughInputForPreviousAlternative.link(this);
+ add32(Imm32(countToCheckForNextAlternative - countCheckedForCurrentAlternative), index);
+ notEnoughInputForPreviousAlternative.append(jump());
+
+ // The next alternative is longer than the current one; check the difference.
+ state.linkAlternativeBacktracks(this);
+ notEnoughInputForPreviousAlternative.append(jumpIfNoAvailableInput(countToCheckForNextAlternative - countCheckedForCurrentAlternative));
+ } else { // CASE 3: Both alternatives are the same length.
+ ASSERT(countCheckedForCurrentAlternative == countToCheckForNextAlternative);
+
+ // If the next alterative is the same length as this one, then no need to check the input -
+ // if there was sufficent input to run the current alternative then there is sufficient
+ // input to run the next one; if not, there isn't.
+ state.linkAlternativeBacktracks(this);
+ }
+ state.checkedTotal -= countCheckedForCurrentAlternative;
+ countCheckedForCurrentAlternative = countToCheckForNextAlternative;
+ state.checkedTotal += countCheckedForCurrentAlternative;
}
-
- state.checkedTotal -= countCheckedForCurrentAlternative;
- countCheckedForCurrentAlternative = countToCheckForNextAlternative;
- state.checkedTotal += countCheckedForCurrentAlternative;
}
}
diff --git a/JavaScriptGlue/Configurations/Version.xcconfig b/JavaScriptGlue/Configurations/Version.xcconfig
index e82e464..f688ea8 100644
--- a/JavaScriptGlue/Configurations/Version.xcconfig
+++ b/JavaScriptGlue/Configurations/Version.xcconfig
@@ -22,7 +22,7 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
MAJOR_VERSION = 534;
-MINOR_VERSION = 9;
+MINOR_VERSION = 10;
TINY_VERSION = 0;
FULL_VERSION = $(MAJOR_VERSION).$(MINOR_VERSION);
diff --git a/LayoutTests/fast/dom/Attr/change-id-via-attr-node-value-expected.txt b/LayoutTests/fast/dom/Attr/change-id-via-attr-node-value-expected.txt
new file mode 100644
index 0000000..62fb9a8
--- /dev/null
+++ b/LayoutTests/fast/dom/Attr/change-id-via-attr-node-value-expected.txt
@@ -0,0 +1,170 @@
+Test that different ways of changing an element's id all work properly.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+
+1. Check id after parsing.
+PASS document.getElementById("a") is document.body
+PASS document.body.id is "a"
+PASS document.body.getAttributeNode("id").isId is true
+PASS document.body.getAttributeNode("id").textContent is "a"
+
+2. Change Attr.value.
+PASS document.getElementById("a") is null
+PASS document.getElementById("b") is document.body
+PASS document.body.getAttributeNode("id").textContent is "b"
+
+3. Change HTMLElement.id.
+PASS document.getElementById("b") is null
+PASS document.getElementById("c") is document.body
+PASS document.body.getAttributeNode("id").textContent is "c"
+
+4. Change id attribute via setAttribute().
+PASS document.getElementById("c") is null
+PASS document.getElementById("d") is document.body
+PASS document.body.getAttributeNode("id").textContent is "d"
+
+5. Change id attribute via setAttributeNS().
+PASS document.getElementById("d") is null
+PASS document.getElementById("e") is document.body
+PASS document.body.getAttributeNode("id").textContent is "e"
+
+6. Change Attr.nodeValue.
+PASS document.getElementById("e") is null
+PASS document.getElementById("f") is document.body
+PASS document.body.id is "f"
+PASS document.body.getAttribute("id") is "f"
+PASS attrNode.textContent is "f"
+PASS attrNode.childNodes.length is 1
+
+7. Attr.replaceChild().
+PASS document.getElementById("f") is null
+PASS document.getElementById("g") is document.body
+PASS document.body.id is "g"
+PASS document.body.getAttribute("id") is "g"
+PASS attrNode.textContent is "g"
+PASS attrNode.childNodes.length is 1
+
+8. Attr.insertBefore().
+PASS document.getElementById("g") is null
+PASS document.getElementById("0g") is document.body
+PASS document.body.id is "0g"
+PASS document.body.getAttribute("id") is "0g"
+PASS attrNode.textContent is "0g"
+PASS attrNode.childNodes.length is 2
+
+9. attr.appendChild().
+PASS document.getElementById("0g") is null
+PASS document.getElementById("0g2") is document.body
+PASS document.body.id is "0g2"
+PASS document.body.getAttribute("id") is "0g2"
+PASS attrNode.textContent is "0g2"
+PASS attrNode.childNodes.length is 3
+
+10. Attr.removeChild()
+PASS document.body.getAttributeNode("id").childNodes.length is 0
+PASS document.getElementById("h") is null
+PASS document.getElementById("") is null
+PASS document.body.id is ""
+PASS document.body.getAttribute("id") is ""
+PASS document.body.getAttributeNode("id").textContent is ""
+
+11. Changing Text.nodeValue.
+PASS attrNode.firstChild.nodeValue is "i"
+PASS document.getElementById("i") is document.body
+PASS document.body.id is "i"
+PASS document.body.getAttribute("id") is "i"
+PASS attrNode.textContent is "i"
+PASS attrNode.childNodes.length is 1
+
+12. Chnaging Attr.textContent.
+PASS document.getElementById("i") is null
+PASS document.getElementById("hi") is document.body
+PASS document.body.id is "hi"
+PASS document.body.getAttribute("id") is "hi"
+PASS attrNode.textContent is "hi"
+PASS attrNode.childNodes.length is 1
+
+13. Text.splitText().
+PASS document.getElementById("hi") is document.body
+PASS document.body.id is "hi"
+PASS document.body.getAttribute("id") is "hi"
+PASS document.body.getAttributeNode("id").textContent is "hi"
+PASS document.body.getAttributeNode("id").childNodes.length is 2
+
+14. Node.normalize(), joining text nodes.
+PASS document.getElementById("hi") is document.body
+PASS document.body.id is "hi"
+PASS document.body.getAttribute("id") is "hi"
+PASS document.body.getAttributeNode("id").textContent is "hi"
+PASS document.body.getAttributeNode("id").childNodes.length is 1
+
+15. Changing Attr.nodeValue.
+PASS document.getElementById("hi") is null
+PASS document.getElementById("j") is document.body
+PASS document.body.id is "j"
+PASS document.body.getAttribute("id") is "j"
+PASS attrNode.textContent is "j"
+PASS attrNode.childNodes.length is 1
+
+16. Changing Text.data.
+PASS document.getElementById("j") is null
+PASS document.getElementById("k") is document.body
+PASS document.body.id is "k"
+PASS document.body.getAttribute("id") is "k"
+PASS attrNode.textContent is "k"
+PASS attrNode.childNodes.length is 1
+
+17. Changing text child with appendData().
+PASS document.getElementById("k") is null
+PASS document.getElementById("kl") is document.body
+PASS document.body.id is "kl"
+PASS document.body.getAttribute("id") is "kl"
+PASS attrNode.textContent is "kl"
+PASS attrNode.childNodes.length is 1
+
+18. Changing text child with insertData().
+PASS document.getElementById("kl") is null
+PASS document.getElementById("k1l") is document.body
+PASS document.body.id is "k1l"
+PASS document.body.getAttribute("id") is "k1l"
+PASS attrNode.textContent is "k1l"
+PASS attrNode.childNodes.length is 1
+
+19. Changing text child with deleteData().
+PASS document.getElementById("k1l") is null
+PASS document.getElementById("l") is document.body
+PASS document.body.id is "l"
+PASS document.body.getAttribute("id") is "l"
+PASS attrNode.textContent is "l"
+PASS attrNode.childNodes.length is 1
+
+20. Changing text child with replaceData().
+PASS document.getElementById("l") is null
+PASS document.getElementById("mn") is document.body
+PASS document.body.id is "mn"
+PASS document.body.getAttribute("id") is "mn"
+PASS attrNode.textContent is "mn"
+PASS attrNode.childNodes.length is 1
+
+21. Remove an Attr node.
+PASS document.body.id is ""
+PASS document.getElementById("mn") is null
+PASS document.body.getAttribute("id") is null
+PASS document.body.getAttributeNode("id") is null
+
+22. Add an Attr node.
+PASS document.getElementById("o") is document.body
+PASS document.body.id is "o"
+PASS document.body.getAttribute("id") is "o"
+
+23. Add an Attr node over an existing one.
+PASS document.getElementById("o") is null
+PASS document.getElementById("p") is document.body
+PASS document.body.id is "p"
+PASS document.body.getAttribute("id") is "p"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/dom/Attr/change-id-via-attr-node-value.html b/LayoutTests/fast/dom/Attr/change-id-via-attr-node-value.html
new file mode 100644
index 0000000..c4e97bd
--- /dev/null
+++ b/LayoutTests/fast/dom/Attr/change-id-via-attr-node-value.html
@@ -0,0 +1,223 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<link rel="stylesheet" href="../../js/resources/js-test-style.css">
+<script src="../../js/resources/js-test-pre.js"></script>
+</head>
+<body id="a">
+<p id="description"></p>
+<div id="console"></div>
+<script>
+
+description("Test that different ways of changing an element's id all work properly.");
+
+debug("\n1. Check id after parsing.");
+shouldBe('document.getElementById("a")', 'document.body');
+shouldBe('document.body.id', '"a"');
+shouldBe('document.body.getAttributeNode("id").isId', 'true');
+shouldBe('document.body.getAttributeNode("id").textContent', '"a"');
+
+debug("\n2. Change Attr.value.");
+document.body.getAttributeNode("id").value = "b";
+shouldBe('document.getElementById("a")', 'null');
+shouldBe('document.getElementById("b")', 'document.body');
+shouldBe('document.body.getAttributeNode("id").textContent', '"b"');
+
+debug("\n3. Change HTMLElement.id.");
+document.body.id = "c";
+shouldBe('document.getElementById("b")', 'null');
+shouldBe('document.getElementById("c")', 'document.body');
+shouldBe('document.body.getAttributeNode("id").textContent', '"c"');
+
+debug("\n4. Change id attribute via setAttribute().");
+document.body.setAttribute("id", "d");
+shouldBe('document.getElementById("c")', 'null');
+shouldBe('document.getElementById("d")', 'document.body');
+shouldBe('document.body.getAttributeNode("id").textContent', '"d"');
+
+debug("\n5. Change id attribute via setAttributeNS().");
+document.body.setAttributeNS(null, "id", "e");
+shouldBe('document.getElementById("d")', 'null');
+shouldBe('document.getElementById("e")', 'document.body');
+shouldBe('document.body.getAttributeNode("id").textContent', '"e"');
+
+var attrNode = document.body.getAttributeNode("id");
+
+debug("\n6. Change Attr.nodeValue.");
+document.body.getAttributeNode("id").nodeValue = "f";
+shouldBe('document.getElementById("e")', 'null');
+shouldBe('document.getElementById("f")', 'document.body');
+shouldBe('document.body.id', '"f"');
+shouldBe('document.body.getAttribute("id")', '"f"');
+shouldBe('attrNode.textContent', '"f"');
+shouldBe('attrNode.childNodes.length', '1');
+
+// Firefox doesn't support these for Attr nodes.
+debug("\n7. Attr.replaceChild().");
+try {
+ attrNode.replaceChild(document.createTextNode("g"), attrNode.firstChild);
+ shouldBe('document.getElementById("f")', 'null');
+ shouldBe('document.getElementById("g")', 'document.body');
+ shouldBe('document.body.id', '"g"');
+ shouldBe('document.body.getAttribute("id")', '"g"');
+ shouldBe('attrNode.textContent', '"g"');
+ shouldBe('attrNode.childNodes.length', '1');
+} catch (ex) {
+ debug(ex);
+}
+
+debug("\n8. Attr.insertBefore().");
+try {
+ attrNode.insertBefore(document.createTextNode("0"), attrNode.firstChild);
+ shouldBe('document.getElementById("g")', 'null');
+ shouldBe('document.getElementById("0g")', 'document.body');
+ shouldBe('document.body.id', '"0g"');
+ shouldBe('document.body.getAttribute("id")', '"0g"');
+ shouldBe('attrNode.textContent', '"0g"');
+ shouldBe('attrNode.childNodes.length', '2');
+} catch (ex) {
+ debug(ex);
+}
+
+debug("\n9. attr.appendChild().");
+try {
+ attrNode.appendChild(document.createTextNode("2"));
+ shouldBe('document.getElementById("0g")', 'null');
+ shouldBe('document.getElementById("0g2")', 'document.body');
+ shouldBe('document.body.id', '"0g2"');
+ shouldBe('document.body.getAttribute("id")', '"0g2"');
+ shouldBe('attrNode.textContent', '"0g2"');
+ shouldBe('attrNode.childNodes.length', '3');
+} catch (ex) {
+ debug(ex);
+}
+
+debug("\n10. Attr.removeChild()");
+attrNode.nodeValue = "h";
+attrNode.removeChild(attrNode.firstChild);
+shouldBe('document.body.getAttributeNode("id").childNodes.length', '0');
+shouldBe('document.getElementById("h")', 'null');
+shouldBe('document.getElementById("")', 'null');
+shouldBe('document.body.id', '""');
+shouldBe('document.body.getAttribute("id")', '""');
+shouldBe('document.body.getAttributeNode("id").textContent', '""');
+
+debug("\n11. Changing Text.nodeValue.");
+attrNode.nodeValue = "h";
+attrNode.firstChild.nodeValue = "i";
+shouldBe('attrNode.firstChild.nodeValue', '"i"');
+shouldBe('document.getElementById("i")', 'document.body');
+shouldBe('document.body.id', '"i"');
+shouldBe('document.body.getAttribute("id")', '"i"');
+shouldBe('attrNode.textContent', '"i"');
+shouldBe('attrNode.childNodes.length', '1');
+
+debug("\n12. Chnaging Attr.textContent.");
+attrNode.textContent = "hi";
+shouldBe('document.getElementById("i")', 'null');
+shouldBe('document.getElementById("hi")', 'document.body');
+shouldBe('document.body.id', '"hi"');
+shouldBe('document.body.getAttribute("id")', '"hi"');
+shouldBe('attrNode.textContent', '"hi"');
+shouldBe('attrNode.childNodes.length', '1');
+
+debug("\n13. Text.splitText().");
+attrNode.firstChild.splitText(1);
+shouldBe('document.getElementById("hi")', 'document.body');
+shouldBe('document.body.id', '"hi"');
+shouldBe('document.body.getAttribute("id")', '"hi"');
+shouldBe('document.body.getAttributeNode("id").textContent', '"hi"');
+shouldBe('document.body.getAttributeNode("id").childNodes.length', '2');
+
+debug("\n14. Node.normalize(), joining text nodes.");
+attrNode.normalize();
+shouldBe('document.getElementById("hi")', 'document.body');
+shouldBe('document.body.id', '"hi"');
+shouldBe('document.body.getAttribute("id")', '"hi"');
+shouldBe('document.body.getAttributeNode("id").textContent', '"hi"');
+shouldBe('document.body.getAttributeNode("id").childNodes.length', '1');
+
+debug("\n15. Changing Attr.nodeValue.");
+attrNode.nodeValue = "foo";
+attrNode.firstChild.replaceWholeText("j");
+shouldBe('document.getElementById("hi")', 'null');
+shouldBe('document.getElementById("j")', 'document.body');
+shouldBe('document.body.id', '"j"');
+shouldBe('document.body.getAttribute("id")', '"j"');
+shouldBe('attrNode.textContent', '"j"');
+shouldBe('attrNode.childNodes.length', '1');
+
+debug("\n16. Changing Text.data.");
+attrNode.firstChild.data = "k";
+shouldBe('document.getElementById("j")', 'null');
+shouldBe('document.getElementById("k")', 'document.body');
+shouldBe('document.body.id', '"k"');
+shouldBe('document.body.getAttribute("id")', '"k"');
+shouldBe('attrNode.textContent', '"k"');
+shouldBe('attrNode.childNodes.length', '1');
+
+debug("\n17. Changing text child with appendData().");
+attrNode.firstChild.appendData("l");
+shouldBe('document.getElementById("k")', 'null');
+shouldBe('document.getElementById("kl")', 'document.body');
+shouldBe('document.body.id', '"kl"');
+shouldBe('document.body.getAttribute("id")', '"kl"');
+shouldBe('attrNode.textContent', '"kl"');
+shouldBe('attrNode.childNodes.length', '1');
+
+debug("\n18. Changing text child with insertData().");
+attrNode.firstChild.insertData(1, "1");
+shouldBe('document.getElementById("kl")', 'null');
+shouldBe('document.getElementById("k1l")', 'document.body');
+shouldBe('document.body.id', '"k1l"');
+shouldBe('document.body.getAttribute("id")', '"k1l"');
+shouldBe('attrNode.textContent', '"k1l"');
+shouldBe('attrNode.childNodes.length', '1');
+
+debug("\n19. Changing text child with deleteData().");
+attrNode.firstChild.deleteData(0, 2);
+shouldBe('document.getElementById("k1l")', 'null');
+shouldBe('document.getElementById("l")', 'document.body');
+shouldBe('document.body.id', '"l"');
+shouldBe('document.body.getAttribute("id")', '"l"');
+shouldBe('attrNode.textContent', '"l"');
+shouldBe('attrNode.childNodes.length', '1');
+
+debug("\n20. Changing text child with replaceData().");
+attrNode.firstChild.replaceData(0, 1, "mn");
+shouldBe('document.getElementById("l")', 'null');
+shouldBe('document.getElementById("mn")', 'document.body');
+shouldBe('document.body.id', '"mn"');
+shouldBe('document.body.getAttribute("id")', '"mn"');
+shouldBe('attrNode.textContent', '"mn"');
+shouldBe('attrNode.childNodes.length', '1');
+
+debug("\n21. Remove an Attr node.");
+document.body.removeAttributeNode(attrNode);
+shouldBe('document.body.id', '""');
+shouldBe('document.getElementById("mn")', 'null');
+shouldBe('document.body.getAttribute("id")', 'null');
+shouldBe('document.body.getAttributeNode("id")', 'null');
+
+debug("\n22. Add an Attr node.");
+var attrNode = document.createAttribute("id");
+attrNode.value = "o";
+document.body.setAttributeNode(attrNode);
+shouldBe('document.getElementById("o")', 'document.body');
+shouldBe('document.body.id', '"o"');
+shouldBe('document.body.getAttribute("id")', '"o"');
+
+debug("\n23. Add an Attr node over an existing one.");
+var attrNode = document.createAttribute("id");
+attrNode.value = "p";
+document.body.setAttributeNode(attrNode);
+shouldBe('document.getElementById("o")', 'null');
+shouldBe('document.getElementById("p")', 'document.body');
+shouldBe('document.body.id', '"p"');
+shouldBe('document.body.getAttribute("id")', '"p"');
+
+var successfullyParsed = true;
+</script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/DeviceMotion/create-event-expected.txt b/LayoutTests/fast/dom/DeviceMotion/create-event-expected.txt
index fdc40c4..f890861 100644
--- a/LayoutTests/fast/dom/DeviceMotion/create-event-expected.txt
+++ b/LayoutTests/fast/dom/DeviceMotion/create-event-expected.txt
@@ -7,22 +7,16 @@ PASS typeof event == 'object' is true
PASS 'type' in event is true
PASS 'bubbles' in event is true
PASS 'cancelable' in event is true
-PASS 'xAcceleration' in event is true
-PASS 'yAcceleration' in event is true
-PASS 'zAcceleration' in event is true
-PASS 'xRotationRate' in event is true
-PASS 'yRotationRate' in event is true
-PASS 'zRotationRate' in event is true
+PASS 'acceleration' in event is true
+PASS 'accelerationIncludingGravity' in event is true
+PASS 'rotationRate' in event is true
PASS 'interval' in event is true
PASS typeof event.type == 'string' is true
PASS typeof event.bubbles == 'boolean' is true
PASS typeof event.cancelable == 'boolean' is true
-PASS typeof event.xAcceleration == 'object' is true
-PASS typeof event.yAcceleration == 'object' is true
-PASS typeof event.zAcceleration == 'object' is true
-PASS typeof event.xRotationRate == 'object' is true
-PASS typeof event.yRotationRate == 'object' is true
-PASS typeof event.zRotationRate == 'object' is true
+PASS typeof event.acceleration == 'object' is true
+PASS typeof event.accelerationIncludingGravity == 'object' is true
+PASS typeof event.rotationRate == 'object' is true
PASS typeof event.interval == 'object' is true
PASS successfullyParsed is true
diff --git a/LayoutTests/fast/dom/DeviceMotion/optional-event-properties-expected.txt b/LayoutTests/fast/dom/DeviceMotion/optional-event-properties-expected.txt
index 0eabe35..c2230b2 100644
--- a/LayoutTests/fast/dom/DeviceMotion/optional-event-properties-expected.txt
+++ b/LayoutTests/fast/dom/DeviceMotion/optional-event-properties-expected.txt
@@ -4,60 +4,94 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
event = document.createEvent('DeviceMotionEvent')
-PASS event.xAcceleration == null is true
-PASS event.yAcceleration == null is true
-PASS event.zAcceleration == null is true
-PASS event.xRotationRate == null is true
-PASS event.yRotationRate == null is true
-PASS event.zRotationRate == null is true
+PASS event.acceleration == null is true
+PASS event.accelerationIncludingGravity == null is true
+PASS event.rotationRate == null is true
PASS event.interval == null is true
-event.initDeviceMotionEvent('', false, false, 0, 1, 2, 3, 4, 5, 6)
-PASS event.xAcceleration == 0 is true
-PASS event.yAcceleration == 1 is true
-PASS event.zAcceleration == 2 is true
-PASS event.xRotationRate == 3 is true
-PASS event.yRotationRate == 4 is true
-PASS event.zRotationRate == 5 is true
-PASS event.interval == 6 is true
+event.initDeviceMotionEvent('', false, false, {x: 0, y: 1, z: 2}, {x: 3, y: 4, z: 5}, {alpha: 6, beta: 7, gamma: 8}, 9)
+PASS event.acceleration.x == 0 is true
+PASS event.acceleration.y == 1 is true
+PASS event.acceleration.z == 2 is true
+PASS event.accelerationIncludingGravity.x == 3 is true
+PASS event.accelerationIncludingGravity.y == 4 is true
+PASS event.accelerationIncludingGravity.z == 5 is true
+PASS event.rotationRate.alpha == 6 is true
+PASS event.rotationRate.beta == 7 is true
+PASS event.rotationRate.gamma == 8 is true
+PASS event.interval == 9 is true
+PASS event.initDeviceMotionEvent('', false, false, objectThrowingException, {x: 3, z: 5}, {gamma: 8, beta: 7}, 9) threw exception Error: x getter exception.
+PASS event.initDeviceMotionEvent('', false, false, {x: 0, y: 1, z: 2}, objectThrowingException, {gamma: 8, beta: 7}, 9) threw exception Error: x getter exception.
+PASS event.initDeviceMotionEvent('', false, false, {x: 0, y: 1, z: 2}, {x: 3, z: 5}, objectThrowingException, 9) threw exception Error: alpha getter exception.
+PASS event.initDeviceMotionEvent('', false, false, {x: objectThrowingException, y: 1, z: 2}, {x: 3, y: 4, z: 5}, {alpha: 6, beta: 7, gamma: 8}, 9) threw exception Error: valueOf threw exception.
+PASS event.initDeviceMotionEvent('', false, false, {x: 0, y: 1, z: 2}, {x: 3, y: objectThrowingException, z: 5}, {alpha: 6, beta: 7, gamma: 8}, 9) threw exception Error: valueOf threw exception.
+PASS event.initDeviceMotionEvent('', false, false, {x: 0, y: 1, z: 2}, {x: 3, y: 4, z: 5}, {alpha: 6, beta: 7, gamma: objectThrowingException}, 9) threw exception Error: valueOf threw exception.
+event.initDeviceMotionEvent('', false, false, {y: 1, x: 0}, {x: 3, z: 5}, {gamma: 8, beta: 7}, 9)
+PASS event.acceleration.x == 0 is true
+PASS event.acceleration.y == 1 is true
+PASS event.acceleration.z == null is true
+PASS event.accelerationIncludingGravity.x == 3 is true
+PASS event.accelerationIncludingGravity.y == null is true
+PASS event.accelerationIncludingGravity.z == 5 is true
+PASS event.rotationRate.alpha == null is true
+PASS event.rotationRate.beta == 7 is true
+PASS event.rotationRate.gamma == 8 is true
+PASS event.interval == 9 is true
event.initDeviceMotionEvent()
-PASS event.xAcceleration == null is true
-PASS event.yAcceleration == null is true
-PASS event.zAcceleration == null is true
-PASS event.xRotationRate == null is true
-PASS event.yRotationRate == null is true
-PASS event.zRotationRate == null is true
+PASS event.acceleration == null is true
+PASS event.accelerationIncludingGravity == null is true
+PASS event.rotationRate == null is true
PASS event.interval == null is true
-event.initDeviceMotionEvent('', false, false, [], [], [], [], [], [], [])
-PASS event.xAcceleration == 0 is true
-PASS event.yAcceleration == 0 is true
-PASS event.zAcceleration == 0 is true
-PASS event.xRotationRate == 0 is true
-PASS event.yRotationRate == 0 is true
-PASS event.zRotationRate == 0 is true
+event.initDeviceMotionEvent('', false, false, [], [], [], [])
+PASS event.acceleration == null is true
+PASS event.accelerationIncludingGravity == null is true
+PASS event.rotationRate == null is true
PASS event.interval == 0 is true
-event.initDeviceMotionEvent('', false, false, undefined, undefined, undefined, undefined, undefined, undefined, undefined)
-PASS event.xAcceleration == null is true
-PASS event.yAcceleration == null is true
-PASS event.zAcceleration == null is true
-PASS event.xRotationRate == null is true
-PASS event.yRotationRate == null is true
-PASS event.zRotationRate == null is true
+event.initDeviceMotionEvent('', false, false, undefined, undefined, undefined, undefined)
+PASS event.acceleration == null is true
+PASS event.accelerationIncludingGravity == null is true
+PASS event.rotationRate == null is true
PASS event.interval == null is true
-event.initDeviceMotionEvent('', false, false, '', '', '', '', '', '', '')
-PASS event.xAcceleration == 0 is true
-PASS event.yAcceleration == 0 is true
-PASS event.zAcceleration == 0 is true
-PASS event.xRotationRate == 0 is true
-PASS event.yRotationRate == 0 is true
-PASS event.zRotationRate == 0 is true
+event.initDeviceMotionEvent('', false, false, '', '', '', '')
+PASS event.acceleration == null is true
+PASS event.accelerationIncludingGravity == null is true
+PASS event.rotationRate == null is true
PASS event.interval == 0 is true
-event.initDeviceMotionEvent('', false, false, null, null, null, null, null, null, null)
-PASS event.xAcceleration == null is true
-PASS event.yAcceleration == null is true
-PASS event.zAcceleration == null is true
-PASS event.xRotationRate == null is true
-PASS event.yRotationRate == null is true
-PASS event.zRotationRate == null is true
+event.initDeviceMotionEvent('', false, false, null, null, null, null)
+PASS event.acceleration == null is true
+PASS event.accelerationIncludingGravity == null is true
+PASS event.rotationRate == null is true
+PASS event.interval == null is true
+event.initDeviceMotionEvent('', false, false, {x: null, y: null, z: null}, {x: null, y: null, z: null}, {alpha: null, beta: null, gamma: null}, null)
+PASS event.acceleration == null is true
+PASS event.accelerationIncludingGravity == null is true
+PASS event.rotationRate == null is true
+PASS event.interval == null is true
+event.initDeviceMotionEvent('', false, false, {x: null, y: null, z: 1}, {x: null, y: null, z: 2}, {alpha: null, beta: null, gamma: 3}, null)
+PASS event.acceleration.x == null is true
+PASS event.acceleration.y == null is true
+PASS event.acceleration.z == 1 is true
+PASS event.accelerationIncludingGravity.x == null is true
+PASS event.accelerationIncludingGravity.y == null is true
+PASS event.accelerationIncludingGravity.z == 2 is true
+PASS event.rotationRate.alpha == null is true
+PASS event.rotationRate.beta == null is true
+PASS event.rotationRate.gamma == 3 is true
+PASS event.interval == null is true
+event.initDeviceMotionEvent('', false, false, {x: undefined, y: undefined, z: undefined}, {x: undefined, y: undefined, z: undefined}, {alpha: undefined, beta: undefined, gamma: undefined}, undefined)
+PASS event.acceleration == null is true
+PASS event.accelerationIncludingGravity == null is true
+PASS event.rotationRate == null is true
+PASS event.interval == null is true
+event.initDeviceMotionEvent('', false, false, {x: undefined, y: undefined, z: 1}, {x: undefined, y: undefined, z: 2}, {alpha: undefined, beta: undefined, gamma: 3}, undefined)
+PASS event.acceleration.x == null is true
+PASS event.acceleration.y == null is true
+PASS event.acceleration.z == 1 is true
+PASS event.accelerationIncludingGravity.x == null is true
+PASS event.accelerationIncludingGravity.y == null is true
+PASS event.accelerationIncludingGravity.z == 2 is true
+PASS event.rotationRate.alpha == null is true
+PASS event.rotationRate.beta == null is true
+PASS event.rotationRate.gamma == 3 is true
PASS event.interval == null is true
PASS successfullyParsed is true
diff --git a/LayoutTests/fast/dom/DeviceMotion/script-tests/create-event.js b/LayoutTests/fast/dom/DeviceMotion/script-tests/create-event.js
index 167329d..8b5aec8 100644
--- a/LayoutTests/fast/dom/DeviceMotion/script-tests/create-event.js
+++ b/LayoutTests/fast/dom/DeviceMotion/script-tests/create-event.js
@@ -7,23 +7,17 @@ shouldBeTrue("typeof event == 'object'");
shouldBeTrue("'type' in event");
shouldBeTrue("'bubbles' in event");
shouldBeTrue("'cancelable' in event");
-shouldBeTrue("'xAcceleration' in event");
-shouldBeTrue("'yAcceleration' in event");
-shouldBeTrue("'zAcceleration' in event");
-shouldBeTrue("'xRotationRate' in event");
-shouldBeTrue("'yRotationRate' in event");
-shouldBeTrue("'zRotationRate' in event");
+shouldBeTrue("'acceleration' in event");
+shouldBeTrue("'accelerationIncludingGravity' in event");
+shouldBeTrue("'rotationRate' in event");
shouldBeTrue("'interval' in event");
shouldBeTrue("typeof event.type == 'string'");
shouldBeTrue("typeof event.bubbles == 'boolean'");
shouldBeTrue("typeof event.cancelable == 'boolean'");
-shouldBeTrue("typeof event.xAcceleration == 'object'");
-shouldBeTrue("typeof event.yAcceleration == 'object'");
-shouldBeTrue("typeof event.zAcceleration == 'object'");
-shouldBeTrue("typeof event.xRotationRate == 'object'");
-shouldBeTrue("typeof event.yRotationRate == 'object'");
-shouldBeTrue("typeof event.zRotationRate == 'object'");
+shouldBeTrue("typeof event.acceleration == 'object'");
+shouldBeTrue("typeof event.accelerationIncludingGravity == 'object'");
+shouldBeTrue("typeof event.rotationRate == 'object'");
shouldBeTrue("typeof event.interval == 'object'");
window.successfullyParsed = true;
diff --git a/LayoutTests/fast/dom/DeviceMotion/script-tests/optional-event-properties.js b/LayoutTests/fast/dom/DeviceMotion/script-tests/optional-event-properties.js
index ab9b53b..5f5c88a 100644
--- a/LayoutTests/fast/dom/DeviceMotion/script-tests/optional-event-properties.js
+++ b/LayoutTests/fast/dom/DeviceMotion/script-tests/optional-event-properties.js
@@ -1,68 +1,120 @@
description("Tests the optional properties of DeviceMotionEvent. Each property should be null if not set, or set to null or undefined.");
+function ObjectThrowingException() {};
+ObjectThrowingException.prototype.valueOf = function() { throw new Error('valueOf threw exception'); }
+ObjectThrowingException.prototype.__defineGetter__("x", function() { throw new Error('x getter exception'); });
+ObjectThrowingException.prototype.__defineGetter__("alpha", function() { throw new Error('alpha getter exception'); });
+var objectThrowingException = new ObjectThrowingException();
+
+function testException(expression, expectedException)
+{
+ shouldThrow(expression, '(function() { return "' + expectedException + '"; })();');
+}
+
var event;
evalAndLog("event = document.createEvent('DeviceMotionEvent')");
-shouldBeTrue("event.xAcceleration == null");
-shouldBeTrue("event.yAcceleration == null");
-shouldBeTrue("event.zAcceleration == null");
-shouldBeTrue("event.xRotationRate == null");
-shouldBeTrue("event.yRotationRate == null");
-shouldBeTrue("event.zRotationRate == null");
+shouldBeTrue("event.acceleration == null");
+shouldBeTrue("event.accelerationIncludingGravity == null");
+shouldBeTrue("event.rotationRate == null");
shouldBeTrue("event.interval == null");
-evalAndLog("event.initDeviceMotionEvent('', false, false, 0, 1, 2, 3, 4, 5, 6)");
-shouldBeTrue("event.xAcceleration == 0");
-shouldBeTrue("event.yAcceleration == 1");
-shouldBeTrue("event.zAcceleration == 2");
-shouldBeTrue("event.xRotationRate == 3");
-shouldBeTrue("event.yRotationRate == 4");
-shouldBeTrue("event.zRotationRate == 5");
-shouldBeTrue("event.interval == 6");
+evalAndLog("event.initDeviceMotionEvent('', false, false, {x: 0, y: 1, z: 2}, {x: 3, y: 4, z: 5}, {alpha: 6, beta: 7, gamma: 8}, 9)");
+shouldBeTrue("event.acceleration.x == 0");
+shouldBeTrue("event.acceleration.y == 1");
+shouldBeTrue("event.acceleration.z == 2");
+shouldBeTrue("event.accelerationIncludingGravity.x == 3");
+shouldBeTrue("event.accelerationIncludingGravity.y == 4");
+shouldBeTrue("event.accelerationIncludingGravity.z == 5");
+shouldBeTrue("event.rotationRate.alpha == 6");
+shouldBeTrue("event.rotationRate.beta == 7");
+shouldBeTrue("event.rotationRate.gamma == 8");
+shouldBeTrue("event.interval == 9");
+
+testException("event.initDeviceMotionEvent('', false, false, objectThrowingException, {x: 3, z: 5}, {gamma: 8, beta: 7}, 9)", "Error: x getter exception");
+testException("event.initDeviceMotionEvent('', false, false, {x: 0, y: 1, z: 2}, objectThrowingException, {gamma: 8, beta: 7}, 9)", "Error: x getter exception");
+testException("event.initDeviceMotionEvent('', false, false, {x: 0, y: 1, z: 2}, {x: 3, z: 5}, objectThrowingException, 9)", "Error: alpha getter exception");
+
+testException("event.initDeviceMotionEvent('', false, false, {x: objectThrowingException, y: 1, z: 2}, {x: 3, y: 4, z: 5}, {alpha: 6, beta: 7, gamma: 8}, 9)", "Error: valueOf threw exception");
+testException("event.initDeviceMotionEvent('', false, false, {x: 0, y: 1, z: 2}, {x: 3, y: objectThrowingException, z: 5}, {alpha: 6, beta: 7, gamma: 8}, 9)", "Error: valueOf threw exception");
+testException("event.initDeviceMotionEvent('', false, false, {x: 0, y: 1, z: 2}, {x: 3, y: 4, z: 5}, {alpha: 6, beta: 7, gamma: objectThrowingException}, 9)", "Error: valueOf threw exception");
+
+evalAndLog("event.initDeviceMotionEvent('', false, false, {y: 1, x: 0}, {x: 3, z: 5}, {gamma: 8, beta: 7}, 9)");
+shouldBeTrue("event.acceleration.x == 0");
+shouldBeTrue("event.acceleration.y == 1");
+shouldBeTrue("event.acceleration.z == null");
+shouldBeTrue("event.accelerationIncludingGravity.x == 3");
+shouldBeTrue("event.accelerationIncludingGravity.y == null");
+shouldBeTrue("event.accelerationIncludingGravity.z == 5");
+shouldBeTrue("event.rotationRate.alpha == null");
+shouldBeTrue("event.rotationRate.beta == 7");
+shouldBeTrue("event.rotationRate.gamma == 8");
+shouldBeTrue("event.interval == 9");
evalAndLog("event.initDeviceMotionEvent()");
-shouldBeTrue("event.xAcceleration == null");
-shouldBeTrue("event.yAcceleration == null");
-shouldBeTrue("event.zAcceleration == null");
-shouldBeTrue("event.xRotationRate == null");
-shouldBeTrue("event.yRotationRate == null");
-shouldBeTrue("event.zRotationRate == null");
+shouldBeTrue("event.acceleration == null");
+shouldBeTrue("event.accelerationIncludingGravity == null");
+shouldBeTrue("event.rotationRate == null");
shouldBeTrue("event.interval == null");
-evalAndLog("event.initDeviceMotionEvent('', false, false, [], [], [], [], [], [], [])");
-shouldBeTrue("event.xAcceleration == 0");
-shouldBeTrue("event.yAcceleration == 0");
-shouldBeTrue("event.zAcceleration == 0");
-shouldBeTrue("event.xRotationRate == 0");
-shouldBeTrue("event.yRotationRate == 0");
-shouldBeTrue("event.zRotationRate == 0");
+evalAndLog("event.initDeviceMotionEvent('', false, false, [], [], [], [])");
+shouldBeTrue("event.acceleration == null");
+shouldBeTrue("event.accelerationIncludingGravity == null");
+shouldBeTrue("event.rotationRate == null");
shouldBeTrue("event.interval == 0");
-evalAndLog("event.initDeviceMotionEvent('', false, false, undefined, undefined, undefined, undefined, undefined, undefined, undefined)");
-shouldBeTrue("event.xAcceleration == null");
-shouldBeTrue("event.yAcceleration == null");
-shouldBeTrue("event.zAcceleration == null");
-shouldBeTrue("event.xRotationRate == null");
-shouldBeTrue("event.yRotationRate == null");
-shouldBeTrue("event.zRotationRate == null");
+evalAndLog("event.initDeviceMotionEvent('', false, false, undefined, undefined, undefined, undefined)");
+shouldBeTrue("event.acceleration == null");
+shouldBeTrue("event.accelerationIncludingGravity == null");
+shouldBeTrue("event.rotationRate == null");
shouldBeTrue("event.interval == null");
-evalAndLog("event.initDeviceMotionEvent('', false, false, '', '', '', '', '', '', '')");
-shouldBeTrue("event.xAcceleration == 0");
-shouldBeTrue("event.yAcceleration == 0");
-shouldBeTrue("event.zAcceleration == 0");
-shouldBeTrue("event.xRotationRate == 0");
-shouldBeTrue("event.yRotationRate == 0");
-shouldBeTrue("event.zRotationRate == 0");
+evalAndLog("event.initDeviceMotionEvent('', false, false, '', '', '', '')");
+shouldBeTrue("event.acceleration == null");
+shouldBeTrue("event.accelerationIncludingGravity == null");
+shouldBeTrue("event.rotationRate == null");
shouldBeTrue("event.interval == 0");
-evalAndLog("event.initDeviceMotionEvent('', false, false, null, null, null, null, null, null, null)");
-shouldBeTrue("event.xAcceleration == null");
-shouldBeTrue("event.yAcceleration == null");
-shouldBeTrue("event.zAcceleration == null");
-shouldBeTrue("event.xRotationRate == null");
-shouldBeTrue("event.yRotationRate == null");
-shouldBeTrue("event.zRotationRate == null");
+evalAndLog("event.initDeviceMotionEvent('', false, false, null, null, null, null)");
+shouldBeTrue("event.acceleration == null");
+shouldBeTrue("event.accelerationIncludingGravity == null");
+shouldBeTrue("event.rotationRate == null");
+shouldBeTrue("event.interval == null");
+
+evalAndLog("event.initDeviceMotionEvent('', false, false, {x: null, y: null, z: null}, {x: null, y: null, z: null}, {alpha: null, beta: null, gamma: null}, null)");
+shouldBeTrue("event.acceleration == null");
+shouldBeTrue("event.accelerationIncludingGravity == null");
+shouldBeTrue("event.rotationRate == null");
+shouldBeTrue("event.interval == null");
+
+evalAndLog("event.initDeviceMotionEvent('', false, false, {x: null, y: null, z: 1}, {x: null, y: null, z: 2}, {alpha: null, beta: null, gamma: 3}, null)");
+shouldBeTrue("event.acceleration.x == null");
+shouldBeTrue("event.acceleration.y == null");
+shouldBeTrue("event.acceleration.z == 1");
+shouldBeTrue("event.accelerationIncludingGravity.x == null");
+shouldBeTrue("event.accelerationIncludingGravity.y == null");
+shouldBeTrue("event.accelerationIncludingGravity.z == 2");
+shouldBeTrue("event.rotationRate.alpha == null");
+shouldBeTrue("event.rotationRate.beta == null");
+shouldBeTrue("event.rotationRate.gamma == 3");
+shouldBeTrue("event.interval == null");
+
+evalAndLog("event.initDeviceMotionEvent('', false, false, {x: undefined, y: undefined, z: undefined}, {x: undefined, y: undefined, z: undefined}, {alpha: undefined, beta: undefined, gamma: undefined}, undefined)");
+shouldBeTrue("event.acceleration == null");
+shouldBeTrue("event.accelerationIncludingGravity == null");
+shouldBeTrue("event.rotationRate == null");
+shouldBeTrue("event.interval == null");
+
+evalAndLog("event.initDeviceMotionEvent('', false, false, {x: undefined, y: undefined, z: 1}, {x: undefined, y: undefined, z: 2}, {alpha: undefined, beta: undefined, gamma: 3}, undefined)");
+shouldBeTrue("event.acceleration.x == null");
+shouldBeTrue("event.acceleration.y == null");
+shouldBeTrue("event.acceleration.z == 1");
+shouldBeTrue("event.accelerationIncludingGravity.x == null");
+shouldBeTrue("event.accelerationIncludingGravity.y == null");
+shouldBeTrue("event.accelerationIncludingGravity.z == 2");
+shouldBeTrue("event.rotationRate.alpha == null");
+shouldBeTrue("event.rotationRate.beta == null");
+shouldBeTrue("event.rotationRate.gamma == 3");
shouldBeTrue("event.interval == null");
window.successfullyParsed = true;
diff --git a/LayoutTests/fast/encoding/charset-xuser-defined-expected.txt b/LayoutTests/fast/encoding/charset-xuser-defined-expected.txt
index b5ff20b..709fe62 100644
--- a/LayoutTests/fast/encoding/charset-xuser-defined-expected.txt
+++ b/LayoutTests/fast/encoding/charset-xuser-defined-expected.txt
@@ -1,4 +1,4 @@
Test bugzilla bug 18270 (Interpreting x-user-defined as windows-1252 when declared in meta tag). Two lines below should be identical.
-€ ‚ƒ„…†‡ˆ‰Š‹Œ Ž ‘’“”•–—˜™š›œ žŸ ¡¢£¤¥¦§¨©ª«¬ ®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ
-€ ‚ƒ„…†‡ˆ‰Š‹Œ Ž ‘’“”•–—˜™š›œ žŸ ¡¢£¤¥¦§¨©ª«¬ ®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ
+€ ‚ƒ„…†‡ˆ‰Š‹Œ Ž ‘’“”•–—˜™š›œ žŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ
+€ ‚ƒ„…†‡ˆ‰Š‹Œ Ž ‘’“”•–—˜™š›œ žŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ
diff --git a/LayoutTests/fast/events/touch/basic-multi-touch-events-limited-expected.txt b/LayoutTests/fast/events/touch/basic-multi-touch-events-limited-expected.txt
new file mode 100644
index 0000000..1e603fb
--- /dev/null
+++ b/LayoutTests/fast/events/touch/basic-multi-touch-events-limited-expected.txt
@@ -0,0 +1,97 @@
+This tests basic multi touch event support. This is a limited version of test basic-multi-touch-events.html that avoids the situation where one touch point is released while another is maintained.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS lastEvent.type is "touchstart"
+PASS lastEvent.touches.length is 2
+PASS lastEvent.changedTouches.length is 2
+PASS lastEvent.targetTouches.length is 2
+PASS lastEvent.pageX is 0
+PASS lastEvent.pageY is 0
+PASS lastEvent.touches[0].pageX is 10
+PASS lastEvent.touches[0].pageY is 10
+PASS lastEvent.touches[0].clientX is 10
+PASS lastEvent.touches[0].clientY is 10
+PASS lastEvent.touches[0].identifier is 0
+PASS lastEvent.touches[1].pageX is 20
+PASS lastEvent.touches[1].pageY is 30
+PASS lastEvent.touches[1].clientX is 20
+PASS lastEvent.touches[1].clientY is 30
+PASS lastEvent.touches[1].identifier is 1
+PASS lastEvent.changedTouches[0].pageX is 10
+PASS lastEvent.changedTouches[0].pageY is 10
+PASS lastEvent.changedTouches[0].clientX is 10
+PASS lastEvent.changedTouches[0].clientY is 10
+PASS lastEvent.changedTouches[0].identifier is 0
+PASS lastEvent.changedTouches[1].pageX is 20
+PASS lastEvent.changedTouches[1].pageY is 30
+PASS lastEvent.changedTouches[1].clientX is 20
+PASS lastEvent.changedTouches[1].clientY is 30
+PASS lastEvent.changedTouches[1].identifier is 1
+PASS lastEvent.targetTouches[0].pageX is 10
+PASS lastEvent.targetTouches[0].pageY is 10
+PASS lastEvent.targetTouches[0].clientX is 10
+PASS lastEvent.targetTouches[0].clientY is 10
+PASS lastEvent.targetTouches[0].identifier is 0
+PASS lastEvent.targetTouches[1].pageX is 20
+PASS lastEvent.targetTouches[1].pageY is 30
+PASS lastEvent.targetTouches[1].clientX is 20
+PASS lastEvent.targetTouches[1].clientY is 30
+PASS lastEvent.targetTouches[1].identifier is 1
+PASS lastEvent.type is "touchmove"
+PASS lastEvent.touches.length is 2
+PASS lastEvent.changedTouches.length is 2
+PASS lastEvent.targetTouches.length is 2
+PASS lastEvent.pageX is 0
+PASS lastEvent.pageY is 0
+PASS lastEvent.touches[0].pageX is 15
+PASS lastEvent.touches[0].pageY is 15
+PASS lastEvent.touches[0].clientX is 15
+PASS lastEvent.touches[0].clientY is 15
+PASS lastEvent.touches[0].identifier is 0
+PASS lastEvent.touches[1].pageX is 25
+PASS lastEvent.touches[1].pageY is 35
+PASS lastEvent.touches[1].clientX is 25
+PASS lastEvent.touches[1].clientY is 35
+PASS lastEvent.touches[1].identifier is 1
+PASS lastEvent.changedTouches[0].pageX is 15
+PASS lastEvent.changedTouches[0].pageY is 15
+PASS lastEvent.changedTouches[0].clientX is 15
+PASS lastEvent.changedTouches[0].clientY is 15
+PASS lastEvent.changedTouches[0].identifier is 0
+PASS lastEvent.changedTouches[1].pageX is 25
+PASS lastEvent.changedTouches[1].pageY is 35
+PASS lastEvent.changedTouches[1].clientX is 25
+PASS lastEvent.changedTouches[1].clientY is 35
+PASS lastEvent.changedTouches[1].identifier is 1
+PASS lastEvent.targetTouches[0].pageX is 15
+PASS lastEvent.targetTouches[0].pageY is 15
+PASS lastEvent.targetTouches[0].clientX is 15
+PASS lastEvent.targetTouches[0].clientY is 15
+PASS lastEvent.targetTouches[0].identifier is 0
+PASS lastEvent.targetTouches[1].pageX is 25
+PASS lastEvent.targetTouches[1].pageY is 35
+PASS lastEvent.targetTouches[1].clientX is 25
+PASS lastEvent.targetTouches[1].clientY is 35
+PASS lastEvent.targetTouches[1].identifier is 1
+PASS lastEvent.type is "touchend"
+PASS lastEvent.touches.length is 0
+PASS lastEvent.changedTouches.length is 2
+PASS lastEvent.targetTouches.length is 0
+PASS lastEvent.pageX is 0
+PASS lastEvent.pageY is 0
+PASS lastEvent.changedTouches[0].pageX is 15
+PASS lastEvent.changedTouches[0].pageY is 15
+PASS lastEvent.changedTouches[0].clientX is 15
+PASS lastEvent.changedTouches[0].clientY is 15
+PASS lastEvent.changedTouches[0].identifier is 0
+PASS lastEvent.changedTouches[1].pageX is 25
+PASS lastEvent.changedTouches[1].pageY is 35
+PASS lastEvent.changedTouches[1].clientX is 25
+PASS lastEvent.changedTouches[1].clientY is 35
+PASS lastEvent.changedTouches[1].identifier is 1
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/events/touch/basic-multi-touch-events-limited.html b/LayoutTests/fast/events/touch/basic-multi-touch-events-limited.html
new file mode 100644
index 0000000..7ba39a8
--- /dev/null
+++ b/LayoutTests/fast/events/touch/basic-multi-touch-events-limited.html
@@ -0,0 +1,19 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../../js/resources/js-test-style.css">
+<script src="../../js/resources/js-test-pre.js"></script>
+<script src="../../js/resources/js-test-post-function.js"></script>
+<!--
+ Touch tests that involve the ontouchstart, ontouchmove, ontouchend or ontouchcancel callbacks
+ should be written in an asynchronous fashion so they can be run on mobile platforms like Android.
+ This template will generate an asynchronous style test by using the js-test-post-function script.
+ You will need to invoke isSuccessfullyParsed() in your test script when the test completes.
+-->
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="script-tests/basic-multi-touch-events-limited.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/events/touch/script-tests/basic-multi-touch-events-limited.js b/LayoutTests/fast/events/touch/script-tests/basic-multi-touch-events-limited.js
new file mode 100644
index 0000000..c807ae5
--- /dev/null
+++ b/LayoutTests/fast/events/touch/script-tests/basic-multi-touch-events-limited.js
@@ -0,0 +1,108 @@
+var div = document.createElement("div");
+div.id = "touchtarget";
+div.style.width = "100px";
+div.style.height = "100px";
+div.style.backgroundColor = "blue";
+
+var lastEvent = null;
+var touchEventsReceived = 0;
+var EXPECTED_TOUCH_EVENTS_TOTAL = 3;
+
+function touchEventCallback() {
+ if (window.eventSender) {
+ lastEvent = event;
+ verifyTouch(touchEventsReceived++);
+ } else {
+ debug(event.type);
+ }
+
+ if (window.layoutTestController && touchEventsReceived == EXPECTED_TOUCH_EVENTS_TOTAL) {
+ // If we've got here, we can safely say we were successfully parsed :) We need to
+ // call the isSucccessfullyParsed function to output the correct TEST COMPLETE
+ // footer message.
+ successfullyParsed = true;
+ isSuccessfullyParsed();
+ layoutTestController.notifyDone();
+ }
+}
+
+div.addEventListener("touchstart", touchEventCallback, false);
+div.addEventListener("touchmove", touchEventCallback, false);
+div.addEventListener("touchend", touchEventCallback, false);
+document.body.insertBefore(div, document.body.firstChild);
+
+function verifyTouchEvent(type, totalTouchCount, changedTouchCount, targetTouchCount)
+{
+ shouldBeEqualToString("lastEvent.type", type);
+ shouldBe("lastEvent.touches.length", totalTouchCount.toString());
+ shouldBe("lastEvent.changedTouches.length", changedTouchCount.toString());
+ shouldBe("lastEvent.targetTouches.length", targetTouchCount.toString());
+ shouldBe("lastEvent.pageX", "0");
+ shouldBe("lastEvent.pageY", "0");
+}
+
+function verifyTouchPoint(list, point, x, y, id)
+{
+ shouldBe("lastEvent." + list + "[" + point + "].pageX", x.toString());
+ shouldBe("lastEvent." + list + "[" + point + "].pageY", y.toString());
+ shouldBe("lastEvent." + list + "[" + point + "].clientX", x.toString());
+ shouldBe("lastEvent." + list + "[" + point + "].clientY", y.toString());
+ shouldBe("lastEvent." + list + "[" + point + "].identifier", id.toString());
+}
+
+function verifyTouch(which) {
+ switch (which) {
+ case 0:
+ verifyTouchEvent("touchstart", 2, 2, 2);
+ verifyTouchPoint("touches", 0, 10, 10, 0);
+ verifyTouchPoint("touches", 1, 20, 30, 1);
+ verifyTouchPoint("changedTouches", 0, 10, 10, 0);
+ verifyTouchPoint("changedTouches", 1, 20, 30, 1);
+ verifyTouchPoint("targetTouches", 0, 10, 10, 0);
+ verifyTouchPoint("targetTouches", 1, 20, 30, 1);
+ break;
+ case 1:
+ verifyTouchEvent("touchmove", 2, 2, 2);
+ verifyTouchPoint("touches", 0, 15, 15, 0);
+ verifyTouchPoint("touches", 1, 25, 35, 1);
+ verifyTouchPoint("changedTouches", 0, 15, 15, 0);
+ verifyTouchPoint("changedTouches", 1, 25, 35, 1);
+ verifyTouchPoint("targetTouches", 0, 15, 15, 0);
+ verifyTouchPoint("targetTouches", 1, 25, 35, 1);
+ break;
+ case 2:
+ verifyTouchEvent("touchend", 0, 2, 0);
+ verifyTouchPoint("changedTouches", 0, 15, 15, 0);
+ verifyTouchPoint("changedTouches", 1, 25, 35, 1);
+ break;
+
+ default: testFailed("Wrong number of touch events! (" + which + ")");
+ }
+}
+
+function multiTouchSequence()
+{
+ eventSender.addTouchPoint(10, 10);
+ eventSender.addTouchPoint(20, 30);
+ eventSender.touchStart();
+
+ eventSender.updateTouchPoint(0, 15, 15);
+ eventSender.updateTouchPoint(1, 25, 35);
+ eventSender.touchMove();
+
+ eventSender.releaseTouchPoint(0);
+ eventSender.releaseTouchPoint(1);
+ eventSender.touchEnd();
+}
+
+if (window.eventSender) {
+ description("This tests basic multi touch event support. This is a limited version of test basic-multi-touch-events.html that avoids the situation where one touch point is released while another is maintained.");
+
+ lastEvent = null;
+ eventSender.clearTouchPoints();
+ multiTouchSequence();
+} else {
+ debug("This test requires DumpRenderTree. Tap on the blue rect to log.")
+}
+
+var successfullyParsed = true;
diff --git a/LayoutTests/fast/events/touch/script-tests/touch-target-limited.js b/LayoutTests/fast/events/touch/script-tests/touch-target-limited.js
new file mode 100644
index 0000000..fd3400c
--- /dev/null
+++ b/LayoutTests/fast/events/touch/script-tests/touch-target-limited.js
@@ -0,0 +1,103 @@
+var targetsDiv = document.createElement("div");
+targetsDiv.id = "targetsDiv";
+
+var div1 = document.createElement("div");
+div1.id = "targetA";
+div1.style.width = "100px";
+div1.style.height = "100px";
+div1.style.backgroundColor = "blue";
+
+var div2 = document.createElement("div");
+div2.id = "targetB";
+div2.style.width = "100px";
+div2.style.height = "100px";
+div2.style.backgroundColor = "green";
+
+var touchStartCount = 0;
+var touchMoveCount = 0;
+
+document.body.insertBefore(targetsDiv, document.getElementById('console'));
+targetsDiv.appendChild(div1);
+targetsDiv.appendChild(document.createElement('br'));
+targetsDiv.appendChild(div2);
+
+function touchStartHandler()
+{
+ shouldBeEqualToString('event.type', 'touchstart');
+ switch (touchStartCount) {
+ case 0:
+ shouldBeEqualToString('event.touches[0].target.id', div1.id);
+ shouldBeEqualToString('event.touches[1].target.id', div2.id);
+ break;
+ case 1:
+ shouldBeEqualToString('event.touches[0].target.id', div2.id);
+ shouldBeEqualToString('event.touches[1].target.id', div1.id);
+ break;
+ }
+
+ touchStartCount++;
+}
+
+function touchMoveHandler()
+{
+ shouldBeEqualToString('event.type', 'touchmove');
+ switch (touchMoveCount) {
+ case 0:
+ case 1:
+ shouldBeEqualToString('event.touches[0].target.id', div1.id);
+ shouldBeEqualToString('event.touches[1].target.id', div2.id);
+ break;
+ case 2:
+ shouldBeEqualToString('event.touches[0].target.id', div2.id);
+ shouldBeEqualToString('event.touches[1].target.id', div1.id);
+ break;
+ }
+
+ if (++touchMoveCount == 3)
+ {
+ successfullyParsed = true;
+ layoutTestController.notifyDone();
+ isSuccessfullyParsed();
+ }
+}
+
+div1.addEventListener("touchstart", touchStartHandler, false);
+div1.addEventListener("touchmove", touchMoveHandler, false);
+
+div2.addEventListener("touchstart", touchStartHandler, false);
+div2.addEventListener("touchmove", touchMoveHandler, false);
+
+description("Tests that the target of touches match the element where the event originated, not where the touch is currently occurring. This is a limited version of test touch-target.html that avoids the situation where one touch point is released while another is maintained.");
+
+if (window.layoutTestController) {
+ layoutTestController.waitUntilDone();
+}
+
+if (window.eventSender) {
+ eventSender.clearTouchPoints();
+ eventSender.addTouchPoint(50, 150);
+ eventSender.addTouchPoint(50, 250);
+ eventSender.touchStart();
+
+ eventSender.updateTouchPoint(0, 50, 250);
+ eventSender.updateTouchPoint(1, 50, 150);
+ eventSender.touchMove();
+
+ eventSender.updateTouchPoint(0, 1000, 1000);
+ eventSender.updateTouchPoint(1, 1000, 1000);
+ eventSender.touchMove();
+
+ eventSender.releaseTouchPoint(0);
+ eventSender.releaseTouchPoint(1);
+ eventSender.touchEnd();
+
+ eventSender.addTouchPoint(50, 250);
+ eventSender.addTouchPoint(50, 150);
+ eventSender.touchStart();
+
+ eventSender.updateTouchPoint(0, 500, 500);
+ eventSender.updateTouchPoint(1, 500, 500);
+ eventSender.touchMove();
+} else
+ debug('This test requires DRT.');
+
diff --git a/LayoutTests/fast/events/touch/touch-target-limited-expected.txt b/LayoutTests/fast/events/touch/touch-target-limited-expected.txt
new file mode 100644
index 0000000..0c1efd0
--- /dev/null
+++ b/LayoutTests/fast/events/touch/touch-target-limited-expected.txt
@@ -0,0 +1,25 @@
+Tests that the target of touches match the element where the event originated, not where the touch is currently occurring. This is a limited version of test touch-target.html that avoids the situation where one touch point is released while another is maintained.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+
+PASS event.type is "touchstart"
+PASS event.touches[0].target.id is "targetA"
+PASS event.touches[1].target.id is "targetB"
+PASS event.type is "touchmove"
+PASS event.touches[0].target.id is "targetA"
+PASS event.touches[1].target.id is "targetB"
+PASS event.type is "touchmove"
+PASS event.touches[0].target.id is "targetA"
+PASS event.touches[1].target.id is "targetB"
+PASS event.type is "touchstart"
+PASS event.touches[0].target.id is "targetB"
+PASS event.touches[1].target.id is "targetA"
+PASS event.type is "touchmove"
+PASS event.touches[0].target.id is "targetB"
+PASS event.touches[1].target.id is "targetA"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/events/touch/touch-target-limited.html b/LayoutTests/fast/events/touch/touch-target-limited.html
new file mode 100644
index 0000000..f903842
--- /dev/null
+++ b/LayoutTests/fast/events/touch/touch-target-limited.html
@@ -0,0 +1,19 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../../js/resources/js-test-style.css">
+<script src="../../js/resources/js-test-pre.js"></script>
+<script src="../../js/resources/js-test-post-function.js"></script>
+<!--
+ Touch tests that involve the ontouchstart, ontouchmove, ontouchend or ontouchcancel callbacks
+ should be written in an asynchronous fashion so they can be run on mobile platforms like Android.
+ This template will generate an asynchronous style test by using the js-test-post-function script.
+ You will need to invoke isSuccessfullyParsed() in your test script when the test completes.
+-->
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="script-tests/touch-target-limited.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/storage/indexeddb/basics-expected.txt b/LayoutTests/storage/indexeddb/basics-expected.txt
index 5365901..7632e40 100644
--- a/LayoutTests/storage/indexeddb/basics-expected.txt
+++ b/LayoutTests/storage/indexeddb/basics-expected.txt
@@ -8,7 +8,6 @@ PASS indexedDB == null is false
indexedDB.open('name', 'description')
PASS 'onsuccess' in result is true
PASS 'onerror' in result is true
-PASS 'abort' in result is true
PASS 'readyState' in result is true
An event should fire shortly...
@@ -20,7 +19,6 @@ PASS 'source' in event is true
PASS event.source != null is true
PASS 'onsuccess' in event.target is true
PASS 'onerror' in event.target is true
-PASS 'abort' in event.target is true
PASS 'readyState' in event.target is true
PASS event.target.readyState is event.target.DONE
diff --git a/LayoutTests/storage/indexeddb/database-basics-expected.txt b/LayoutTests/storage/indexeddb/database-basics-expected.txt
index fc224cc..42c9879 100644
--- a/LayoutTests/storage/indexeddb/database-basics-expected.txt
+++ b/LayoutTests/storage/indexeddb/database-basics-expected.txt
@@ -6,7 +6,6 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
indexedDB.open('name', 'description')
PASS 'onsuccess' in result is true
PASS 'onerror' in result is true
-PASS 'abort' in result is true
PASS 'readyState' in result is true
An event should fire shortly...
@@ -18,7 +17,6 @@ PASS 'source' in event is true
PASS event.source != null is true
PASS 'onsuccess' in event.target is true
PASS 'onerror' in event.target is true
-PASS 'abort' in event.target is true
PASS 'readyState' in event.target is true
PASS event.target.readyState is event.target.DONE
@@ -27,7 +25,6 @@ Testing setVersion.
db.setVersion("version a")
PASS 'onsuccess' in result is true
PASS 'onerror' in result is true
-PASS 'abort' in result is true
PASS 'readyState' in result is true
An event should fire shortly...
@@ -39,14 +36,12 @@ PASS 'source' in event is true
PASS event.source != null is true
PASS 'onsuccess' in event.target is true
PASS 'onerror' in event.target is true
-PASS 'abort' in event.target is true
PASS 'readyState' in event.target is true
PASS event.target.readyState is event.target.DONE
db.setVersion("version b")
PASS 'onsuccess' in result is true
PASS 'onerror' in result is true
-PASS 'abort' in result is true
PASS 'readyState' in result is true
An event should fire shortly...
@@ -58,7 +53,6 @@ PASS 'source' in event is true
PASS event.source != null is true
PASS 'onsuccess' in event.target is true
PASS 'onerror' in event.target is true
-PASS 'abort' in event.target is true
PASS 'readyState' in event.target is true
PASS event.target.readyState is event.target.DONE
@@ -70,7 +64,6 @@ PASS db.objectStores.contains('') is false
db.createObjectStore("test123")
PASS 'onsuccess' in result is true
PASS 'onerror' in result is true
-PASS 'abort' in result is true
PASS 'readyState' in result is true
An event should fire shortly...
@@ -82,7 +75,6 @@ PASS 'source' in event is true
PASS event.source != null is true
PASS 'onsuccess' in event.target is true
PASS 'onerror' in event.target is true
-PASS 'abort' in event.target is true
PASS 'readyState' in event.target is true
PASS event.target.readyState is event.target.DONE
@@ -94,3 +86,4 @@ PASS db.objectStores.contains('test123') is true
PASS successfullyParsed is true
TEST COMPLETE
+
diff --git a/LayoutTests/storage/indexeddb/index-basics-expected.txt b/LayoutTests/storage/indexeddb/index-basics-expected.txt
index a99bc86..564bdc8 100644
--- a/LayoutTests/storage/indexeddb/index-basics-expected.txt
+++ b/LayoutTests/storage/indexeddb/index-basics-expected.txt
@@ -6,7 +6,6 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
indexedDB.open('name', 'description')
PASS 'onsuccess' in result is true
PASS 'onerror' in result is true
-PASS 'abort' in result is true
PASS 'readyState' in result is true
An event should fire shortly...
@@ -18,7 +17,6 @@ PASS 'source' in event is true
PASS event.source != null is true
PASS 'onsuccess' in event.target is true
PASS 'onerror' in event.target is true
-PASS 'abort' in event.target is true
PASS 'readyState' in event.target is true
PASS event.target.readyState is event.target.DONE
@@ -26,7 +24,6 @@ db = event.result
db.createObjectStore('storeName', null)
PASS 'onsuccess' in result is true
PASS 'onerror' in result is true
-PASS 'abort' in result is true
PASS 'readyState' in result is true
An event should fire shortly...
@@ -38,7 +35,6 @@ PASS 'source' in event is true
PASS event.source != null is true
PASS 'onsuccess' in event.target is true
PASS 'onerror' in event.target is true
-PASS 'abort' in event.target is true
PASS 'readyState' in event.target is true
PASS event.target.readyState is event.target.DONE
@@ -46,7 +42,6 @@ store = event.result
event.result.createIndex('indexName', 'x')
PASS 'onsuccess' in result is true
PASS 'onerror' in result is true
-PASS 'abort' in result is true
PASS 'readyState' in result is true
An event should fire shortly...
@@ -58,7 +53,6 @@ PASS 'source' in event is true
PASS event.source != null is true
PASS 'onsuccess' in event.target is true
PASS 'onerror' in event.target is true
-PASS 'abort' in event.target is true
PASS 'readyState' in event.target is true
PASS event.target.readyState is event.target.DONE
@@ -79,7 +73,6 @@ PASS 'get' in indexObject is true
event.source.add({x: 'value', y: 'zzz'}, 'key')
PASS 'onsuccess' in result is true
PASS 'onerror' in result is true
-PASS 'abort' in result is true
PASS 'readyState' in result is true
An event should fire shortly...
@@ -91,14 +84,12 @@ PASS 'source' in event is true
PASS event.source != null is true
PASS 'onsuccess' in event.target is true
PASS 'onerror' in event.target is true
-PASS 'abort' in event.target is true
PASS 'readyState' in event.target is true
PASS event.target.readyState is event.target.DONE
event.source.add({x: 'value2', y: 'zzz2'}, 'key2')
PASS 'onsuccess' in result is true
PASS 'onerror' in result is true
-PASS 'abort' in result is true
PASS 'readyState' in result is true
An event should fire shortly...
@@ -110,14 +101,12 @@ PASS 'source' in event is true
PASS event.source != null is true
PASS 'onsuccess' in event.target is true
PASS 'onerror' in event.target is true
-PASS 'abort' in event.target is true
PASS 'readyState' in event.target is true
PASS event.target.readyState is event.target.DONE
indexObject.get('value')
PASS 'onsuccess' in result is true
PASS 'onerror' in result is true
-PASS 'abort' in result is true
PASS 'readyState' in result is true
An event should fire shortly...
@@ -129,7 +118,6 @@ PASS 'source' in event is true
PASS event.source != null is true
PASS 'onsuccess' in event.target is true
PASS 'onerror' in event.target is true
-PASS 'abort' in event.target is true
PASS 'readyState' in event.target is true
PASS event.target.readyState is event.target.DONE
@@ -137,7 +125,6 @@ PASS event.result is "key"
indexObject.getObject('value')
PASS 'onsuccess' in result is true
PASS 'onerror' in result is true
-PASS 'abort' in result is true
PASS 'readyState' in result is true
An event should fire shortly...
@@ -149,7 +136,6 @@ PASS 'source' in event is true
PASS event.source != null is true
PASS 'onsuccess' in event.target is true
PASS 'onerror' in event.target is true
-PASS 'abort' in event.target is true
PASS 'readyState' in event.target is true
PASS event.target.readyState is event.target.DONE
@@ -158,7 +144,6 @@ PASS event.result.y is "zzz"
indexObject.get('does not exist')
PASS 'onsuccess' in result is true
PASS 'onerror' in result is true
-PASS 'abort' in result is true
PASS 'readyState' in result is true
An event should fire shortly...
@@ -170,7 +155,6 @@ PASS 'source' in event is true
PASS event.source != null is true
PASS 'onsuccess' in event.target is true
PASS 'onerror' in event.target is true
-PASS 'abort' in event.target is true
PASS 'readyState' in event.target is true
PASS event.target.readyState is event.target.DONE
@@ -178,7 +162,6 @@ PASS event.code is IDBDatabaseException.NOT_FOUND_ERR
indexObject.getObject('does not exist')
PASS 'onsuccess' in result is true
PASS 'onerror' in result is true
-PASS 'abort' in result is true
PASS 'readyState' in result is true
An event should fire shortly...
@@ -190,7 +173,6 @@ PASS 'source' in event is true
PASS event.source != null is true
PASS 'onsuccess' in event.target is true
PASS 'onerror' in event.target is true
-PASS 'abort' in event.target is true
PASS 'readyState' in event.target is true
PASS event.target.readyState is event.target.DONE
@@ -198,7 +180,6 @@ PASS event.code is IDBDatabaseException.NOT_FOUND_ERR
indexObject.openCursor()
PASS 'onsuccess' in result is true
PASS 'onerror' in result is true
-PASS 'abort' in result is true
PASS 'readyState' in result is true
An event should fire shortly...
@@ -210,7 +191,6 @@ PASS 'source' in event is true
PASS event.source != null is true
PASS 'onsuccess' in event.target is true
PASS 'onerror' in event.target is true
-PASS 'abort' in event.target is true
PASS 'readyState' in event.target is true
PASS event.target.readyState is event.target.DONE
@@ -220,7 +200,6 @@ PASS event.result.value is "key"
event.result.continue()
PASS 'onsuccess' in result is true
PASS 'onerror' in result is true
-PASS 'abort' in result is true
PASS 'readyState' in result is true
An event should fire shortly...
@@ -232,7 +211,6 @@ PASS 'source' in event is true
PASS event.source != null is true
PASS 'onsuccess' in event.target is true
PASS 'onerror' in event.target is true
-PASS 'abort' in event.target is true
PASS 'readyState' in event.target is true
PASS event.target.readyState is event.target.DONE
@@ -242,7 +220,6 @@ PASS event.result.value is "key2"
event.result.continue()
PASS 'onsuccess' in result is true
PASS 'onerror' in result is true
-PASS 'abort' in result is true
PASS 'readyState' in result is true
An event should fire shortly...
@@ -254,7 +231,6 @@ PASS 'source' in event is true
PASS event.source != null is true
PASS 'onsuccess' in event.target is true
PASS 'onerror' in event.target is true
-PASS 'abort' in event.target is true
PASS 'readyState' in event.target is true
PASS event.target.readyState is event.target.DONE
@@ -262,7 +238,6 @@ PASS event.result === null is true
indexObject.openObjectCursor()
PASS 'onsuccess' in result is true
PASS 'onerror' in result is true
-PASS 'abort' in result is true
PASS 'readyState' in result is true
An event should fire shortly...
@@ -274,7 +249,6 @@ PASS 'source' in event is true
PASS event.source != null is true
PASS 'onsuccess' in event.target is true
PASS 'onerror' in event.target is true
-PASS 'abort' in event.target is true
PASS 'readyState' in event.target is true
PASS event.target.readyState is event.target.DONE
@@ -285,7 +259,6 @@ PASS event.result.value.y is "zzz"
event.result.continue()
PASS 'onsuccess' in result is true
PASS 'onerror' in result is true
-PASS 'abort' in result is true
PASS 'readyState' in result is true
An event should fire shortly...
@@ -297,7 +270,6 @@ PASS 'source' in event is true
PASS event.source != null is true
PASS 'onsuccess' in event.target is true
PASS 'onerror' in event.target is true
-PASS 'abort' in event.target is true
PASS 'readyState' in event.target is true
PASS event.target.readyState is event.target.DONE
@@ -308,7 +280,6 @@ PASS event.result.value.y is "zzz2"
event.result.continue()
PASS 'onsuccess' in result is true
PASS 'onerror' in result is true
-PASS 'abort' in result is true
PASS 'readyState' in result is true
An event should fire shortly...
@@ -320,7 +291,6 @@ PASS 'source' in event is true
PASS event.source != null is true
PASS 'onsuccess' in event.target is true
PASS 'onerror' in event.target is true
-PASS 'abort' in event.target is true
PASS 'readyState' in event.target is true
PASS event.target.readyState is event.target.DONE
diff --git a/LayoutTests/storage/indexeddb/index-cursor-expected.txt b/LayoutTests/storage/indexeddb/index-cursor-expected.txt
index 1442ad4..6d1417f 100644
--- a/LayoutTests/storage/indexeddb/index-cursor-expected.txt
+++ b/LayoutTests/storage/indexeddb/index-cursor-expected.txt
@@ -6,7 +6,6 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
indexedDB.open('someDB', 'some description')
PASS 'onsuccess' in result is true
PASS 'onerror' in result is true
-PASS 'abort' in result is true
PASS 'readyState' in result is true
An event should fire shortly...
@@ -18,7 +17,6 @@ PASS 'source' in event is true
PASS event.source != null is true
PASS 'onsuccess' in event.target is true
PASS 'onerror' in event.target is true
-PASS 'abort' in event.target is true
PASS 'readyState' in event.target is true
PASS event.target.readyState is event.target.DONE
@@ -26,7 +24,6 @@ db = event.result
db.createObjectStore('someObjectStore')
PASS 'onsuccess' in result is true
PASS 'onerror' in result is true
-PASS 'abort' in result is true
PASS 'readyState' in result is true
An event should fire shortly...
@@ -38,7 +35,6 @@ PASS 'source' in event is true
PASS event.source != null is true
PASS 'onsuccess' in event.target is true
PASS 'onerror' in event.target is true
-PASS 'abort' in event.target is true
PASS 'readyState' in event.target is true
PASS event.target.readyState is event.target.DONE
@@ -46,7 +42,6 @@ objectStore = event.result
objectStore.createIndex('someIndex', 'x')
PASS 'onsuccess' in result is true
PASS 'onerror' in result is true
-PASS 'abort' in result is true
PASS 'readyState' in result is true
An event should fire shortly...
@@ -58,7 +53,6 @@ PASS 'source' in event is true
PASS event.source != null is true
PASS 'onsuccess' in event.target is true
PASS 'onerror' in event.target is true
-PASS 'abort' in event.target is true
PASS 'readyState' in event.target is true
PASS event.target.readyState is event.target.DONE
@@ -71,14 +65,12 @@ PASS 'source' in event is true
PASS event.source != null is true
PASS 'onsuccess' in event.target is true
PASS 'onerror' in event.target is true
-PASS 'abort' in event.target is true
PASS 'readyState' in event.target is true
PASS event.target.readyState is event.target.DONE
objectStore.add({'x': testData[nextToAdd]}, nextToAdd)
PASS 'onsuccess' in result is true
PASS 'onerror' in result is true
-PASS 'abort' in result is true
PASS 'readyState' in result is true
An event should fire shortly...
@@ -90,14 +82,12 @@ PASS 'source' in event is true
PASS event.source != null is true
PASS 'onsuccess' in event.target is true
PASS 'onerror' in event.target is true
-PASS 'abort' in event.target is true
PASS 'readyState' in event.target is true
PASS event.target.readyState is event.target.DONE
objectStore.add({'x': testData[nextToAdd]}, nextToAdd)
PASS 'onsuccess' in result is true
PASS 'onerror' in result is true
-PASS 'abort' in result is true
PASS 'readyState' in result is true
An event should fire shortly...
@@ -109,14 +99,12 @@ PASS 'source' in event is true
PASS event.source != null is true
PASS 'onsuccess' in event.target is true
PASS 'onerror' in event.target is true
-PASS 'abort' in event.target is true
PASS 'readyState' in event.target is true
PASS event.target.readyState is event.target.DONE
objectStore.add({'x': testData[nextToAdd]}, nextToAdd)
PASS 'onsuccess' in result is true
PASS 'onerror' in result is true
-PASS 'abort' in result is true
PASS 'readyState' in result is true
An event should fire shortly...
@@ -128,14 +116,12 @@ PASS 'source' in event is true
PASS event.source != null is true
PASS 'onsuccess' in event.target is true
PASS 'onerror' in event.target is true
-PASS 'abort' in event.target is true
PASS 'readyState' in event.target is true
PASS event.target.readyState is event.target.DONE
objectStore.add({'x': testData[nextToAdd]}, nextToAdd)
PASS 'onsuccess' in result is true
PASS 'onerror' in result is true
-PASS 'abort' in result is true
PASS 'readyState' in result is true
An event should fire shortly...
@@ -147,14 +133,12 @@ PASS 'source' in event is true
PASS event.source != null is true
PASS 'onsuccess' in event.target is true
PASS 'onerror' in event.target is true
-PASS 'abort' in event.target is true
PASS 'readyState' in event.target is true
PASS event.target.readyState is event.target.DONE
objectStore.add({'x': testData[nextToAdd]}, nextToAdd)
PASS 'onsuccess' in result is true
PASS 'onerror' in result is true
-PASS 'abort' in result is true
PASS 'readyState' in result is true
An event should fire shortly...
@@ -166,14 +150,12 @@ PASS 'source' in event is true
PASS event.source != null is true
PASS 'onsuccess' in event.target is true
PASS 'onerror' in event.target is true
-PASS 'abort' in event.target is true
PASS 'readyState' in event.target is true
PASS event.target.readyState is event.target.DONE
objectStore.add({'x': testData[nextToAdd]}, nextToAdd)
PASS 'onsuccess' in result is true
PASS 'onerror' in result is true
-PASS 'abort' in result is true
PASS 'readyState' in result is true
An event should fire shortly...
@@ -185,14 +167,12 @@ PASS 'source' in event is true
PASS event.source != null is true
PASS 'onsuccess' in event.target is true
PASS 'onerror' in event.target is true
-PASS 'abort' in event.target is true
PASS 'readyState' in event.target is true
PASS event.target.readyState is event.target.DONE
objectStore.add({'x': testData[nextToAdd]}, nextToAdd)
PASS 'onsuccess' in result is true
PASS 'onerror' in result is true
-PASS 'abort' in result is true
PASS 'readyState' in result is true
An event should fire shortly...
@@ -204,14 +184,12 @@ PASS 'source' in event is true
PASS event.source != null is true
PASS 'onsuccess' in event.target is true
PASS 'onerror' in event.target is true
-PASS 'abort' in event.target is true
PASS 'readyState' in event.target is true
PASS event.target.readyState is event.target.DONE
objectStore.add({'x': testData[nextToAdd]}, nextToAdd)
PASS 'onsuccess' in result is true
PASS 'onerror' in result is true
-PASS 'abort' in result is true
PASS 'readyState' in result is true
An event should fire shortly...
diff --git a/LayoutTests/storage/indexeddb/objectstore-basics-expected.txt b/LayoutTests/storage/indexeddb/objectstore-basics-expected.txt
index 890c00f..7b5439a 100644
--- a/LayoutTests/storage/indexeddb/objectstore-basics-expected.txt
+++ b/LayoutTests/storage/indexeddb/objectstore-basics-expected.txt
@@ -6,7 +6,6 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
indexedDB.open('name', 'description')
PASS 'onsuccess' in result is true
PASS 'onerror' in result is true
-PASS 'abort' in result is true
PASS 'readyState' in result is true
An event should fire shortly...
@@ -19,7 +18,6 @@ PASS 'source' in event is true
PASS event.source != null is true
PASS 'onsuccess' in event.target is true
PASS 'onerror' in event.target is true
-PASS 'abort' in event.target is true
PASS 'readyState' in event.target is true
PASS event.target.readyState is event.target.DONE
@@ -27,7 +25,6 @@ db = event.result
db.createObjectStore('storeName', null)
PASS 'onsuccess' in result is true
PASS 'onerror' in result is true
-PASS 'abort' in result is true
PASS 'readyState' in result is true
An event should fire shortly...
@@ -40,7 +37,6 @@ PASS 'source' in event is true
PASS event.source != null is true
PASS 'onsuccess' in event.target is true
PASS 'onerror' in event.target is true
-PASS 'abort' in event.target is true
PASS 'readyState' in event.target is true
PASS event.target.readyState is event.target.DONE
@@ -50,10 +46,13 @@ PASS store.name is "storeName"
PASS store.keyPath is null
PASS storeNames.contains('storeName') is true
PASS storeNames.length is 1
+Ask for a store that doesn't exist:
+index = store.index('asdf')
+PASS index is null
+FAIL Asking for a store that doesn't exist should have thrown.
event.result.createIndex('indexName', 'x', true)
PASS 'onsuccess' in result is true
PASS 'onerror' in result is true
-PASS 'abort' in result is true
PASS 'readyState' in result is true
An event should fire shortly...
@@ -66,15 +65,20 @@ PASS 'source' in event is true
PASS event.source != null is true
PASS 'onsuccess' in event.target is true
PASS 'onerror' in event.target is true
-PASS 'abort' in event.target is true
PASS 'readyState' in event.target is true
PASS event.target.readyState is event.target.DONE
+PASS event.result !== null is true
PASS event.source.indexNames.contains('indexName') is true
+index = event.source.index('indexName')
+PASS index !== null is true
+Ask for a store that doesn't exist:
+index = store.index('asdf')
+PASS index is null
+FAIL Asking for a store that doesn't exist should have thrown.
event.source.add({x: 'value'}, 'key')
PASS 'onsuccess' in result is true
PASS 'onerror' in result is true
-PASS 'abort' in result is true
PASS 'readyState' in result is true
An event should fire shortly...
@@ -87,7 +91,6 @@ PASS 'source' in event is true
PASS event.source != null is true
PASS 'onsuccess' in event.target is true
PASS 'onerror' in event.target is true
-PASS 'abort' in event.target is true
PASS 'readyState' in event.target is true
PASS event.target.readyState is event.target.DONE
@@ -95,7 +98,6 @@ PASS event.result is "key"
event.source.add({x: 'value'}, 'zzz')
PASS 'onsuccess' in result is true
PASS 'onerror' in result is true
-PASS 'abort' in result is true
PASS 'readyState' in result is true
An event should fire shortly...
@@ -108,16 +110,15 @@ PASS 'source' in event is true
PASS event.source != null is true
PASS 'onsuccess' in event.target is true
PASS 'onerror' in event.target is true
-PASS 'abort' in event.target is true
PASS 'readyState' in event.target is true
PASS event.target.readyState is event.target.DONE
PASS event.code is IDBDatabaseException.UNKNOWN_ERR
-store = event.source
+db.transaction()
+store = transaction.objectStore('storeName')
store.get('key')
PASS 'onsuccess' in result is true
PASS 'onerror' in result is true
-PASS 'abort' in result is true
PASS 'readyState' in result is true
An event should fire shortly...
@@ -130,7 +131,6 @@ PASS 'source' in event is true
PASS event.source != null is true
PASS 'onsuccess' in event.target is true
PASS 'onerror' in event.target is true
-PASS 'abort' in event.target is true
PASS 'readyState' in event.target is true
PASS event.target.readyState is event.target.DONE
@@ -139,7 +139,6 @@ store = event.source
store.remove('key')
PASS 'onsuccess' in result is true
PASS 'onerror' in result is true
-PASS 'abort' in result is true
PASS 'readyState' in result is true
An event should fire shortly...
@@ -152,7 +151,6 @@ PASS 'source' in event is true
PASS event.source != null is true
PASS 'onsuccess' in event.target is true
PASS 'onerror' in event.target is true
-PASS 'abort' in event.target is true
PASS 'readyState' in event.target is true
PASS event.target.readyState is event.target.DONE
diff --git a/LayoutTests/storage/indexeddb/objectstore-basics.html b/LayoutTests/storage/indexeddb/objectstore-basics.html
index 731d421..b2d383a 100644
--- a/LayoutTests/storage/indexeddb/objectstore-basics.html
+++ b/LayoutTests/storage/indexeddb/objectstore-basics.html
@@ -49,6 +49,16 @@ function createSuccess()
shouldBe("storeNames.length", "1");
// FIXME: test all of object store's methods.
+ debug("Ask for a store that doesn't exist:");
+ try {
+ index = evalAndLog("index = store.index('asdf')");
+ shouldBeNull("index"); // Returning null is wrong, but less wrong than returning an actual object!
+ testFailed("Asking for a store that doesn't exist should have thrown.");
+ } catch (err) {
+ testPassed("Error thrown.");
+ // FIXME: Verify the correct exception thrown.
+ }
+
result = evalAndLog("event.result.createIndex('indexName', 'x', true)"); // true == unique requirement.
verifyResult(result);
result.onsuccess = addIndexSuccess;
@@ -59,7 +69,20 @@ function addIndexSuccess()
{
debug("addIndexSuccess():");
verifySuccessEvent(event);
+ shouldBeTrue("event.result !== null");
shouldBeTrue("event.source.indexNames.contains('indexName')");
+ index = evalAndLog("index = event.source.index('indexName')");
+ shouldBeTrue("index !== null");
+
+ debug("Ask for a store that doesn't exist:");
+ try {
+ index = evalAndLog("index = store.index('asdf')");
+ shouldBeNull("index"); // Returning null is wrong, but less wrong than returning an actual object!
+ testFailed("Asking for a store that doesn't exist should have thrown.");
+ } catch (err) {
+ testPassed("Error thrown.");
+ // FIXME: Verify the correct exception thrown.
+ }
result = evalAndLog("event.source.add({x: 'value'}, 'key')");
verifyResult(result);
@@ -85,7 +108,10 @@ function addAgainFailure()
verifyErrorEvent(event);
// FIXME: This error code needs to be specced.
shouldBe("event.code", "IDBDatabaseException.UNKNOWN_ERR");
- var store = evalAndLog("store = event.source");
+
+ transaction = evalAndLog("db.transaction()");
+ transaction.onabort = unexpectedErrorCallback;
+ var store = evalAndLog("store = transaction.objectStore('storeName')");
result = evalAndLog("store.get('key')");
verifyResult(result);
diff --git a/LayoutTests/storage/indexeddb/objectstore-cursor-expected.txt b/LayoutTests/storage/indexeddb/objectstore-cursor-expected.txt
index ce5514a..e7211f6 100644
--- a/LayoutTests/storage/indexeddb/objectstore-cursor-expected.txt
+++ b/LayoutTests/storage/indexeddb/objectstore-cursor-expected.txt
@@ -6,7 +6,6 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
indexedDB.open('someDB', 'some description')
PASS 'onsuccess' in result is true
PASS 'onerror' in result is true
-PASS 'abort' in result is true
PASS 'readyState' in result is true
An event should fire shortly...
@@ -18,7 +17,6 @@ PASS 'source' in event is true
PASS event.source != null is true
PASS 'onsuccess' in event.target is true
PASS 'onerror' in event.target is true
-PASS 'abort' in event.target is true
PASS 'readyState' in event.target is true
PASS event.target.readyState is event.target.DONE
@@ -26,7 +24,6 @@ db = event.result
db.createObjectStore('someObjectStore')
PASS 'onsuccess' in result is true
PASS 'onerror' in result is true
-PASS 'abort' in result is true
PASS 'readyState' in result is true
An event should fire shortly...
@@ -38,7 +35,6 @@ PASS 'source' in event is true
PASS event.source != null is true
PASS 'onsuccess' in event.target is true
PASS 'onerror' in event.target is true
-PASS 'abort' in event.target is true
PASS 'readyState' in event.target is true
PASS event.target.readyState is event.target.DONE
@@ -51,14 +47,12 @@ PASS 'source' in event is true
PASS event.source != null is true
PASS 'onsuccess' in event.target is true
PASS 'onerror' in event.target is true
-PASS 'abort' in event.target is true
PASS 'readyState' in event.target is true
PASS event.target.readyState is event.target.DONE
objectStore.add('', testData[nextToAdd])
PASS 'onsuccess' in result is true
PASS 'onerror' in result is true
-PASS 'abort' in result is true
PASS 'readyState' in result is true
An event should fire shortly...
@@ -70,14 +64,12 @@ PASS 'source' in event is true
PASS event.source != null is true
PASS 'onsuccess' in event.target is true
PASS 'onerror' in event.target is true
-PASS 'abort' in event.target is true
PASS 'readyState' in event.target is true
PASS event.target.readyState is event.target.DONE
objectStore.add('', testData[nextToAdd])
PASS 'onsuccess' in result is true
PASS 'onerror' in result is true
-PASS 'abort' in result is true
PASS 'readyState' in result is true
An event should fire shortly...
@@ -89,14 +81,12 @@ PASS 'source' in event is true
PASS event.source != null is true
PASS 'onsuccess' in event.target is true
PASS 'onerror' in event.target is true
-PASS 'abort' in event.target is true
PASS 'readyState' in event.target is true
PASS event.target.readyState is event.target.DONE
objectStore.add('', testData[nextToAdd])
PASS 'onsuccess' in result is true
PASS 'onerror' in result is true
-PASS 'abort' in result is true
PASS 'readyState' in result is true
An event should fire shortly...
@@ -108,14 +98,12 @@ PASS 'source' in event is true
PASS event.source != null is true
PASS 'onsuccess' in event.target is true
PASS 'onerror' in event.target is true
-PASS 'abort' in event.target is true
PASS 'readyState' in event.target is true
PASS event.target.readyState is event.target.DONE
objectStore.add('', testData[nextToAdd])
PASS 'onsuccess' in result is true
PASS 'onerror' in result is true
-PASS 'abort' in result is true
PASS 'readyState' in result is true
An event should fire shortly...
@@ -127,14 +115,12 @@ PASS 'source' in event is true
PASS event.source != null is true
PASS 'onsuccess' in event.target is true
PASS 'onerror' in event.target is true
-PASS 'abort' in event.target is true
PASS 'readyState' in event.target is true
PASS event.target.readyState is event.target.DONE
objectStore.add('', testData[nextToAdd])
PASS 'onsuccess' in result is true
PASS 'onerror' in result is true
-PASS 'abort' in result is true
PASS 'readyState' in result is true
An event should fire shortly...
@@ -146,14 +132,12 @@ PASS 'source' in event is true
PASS event.source != null is true
PASS 'onsuccess' in event.target is true
PASS 'onerror' in event.target is true
-PASS 'abort' in event.target is true
PASS 'readyState' in event.target is true
PASS event.target.readyState is event.target.DONE
objectStore.add('', testData[nextToAdd])
PASS 'onsuccess' in result is true
PASS 'onerror' in result is true
-PASS 'abort' in result is true
PASS 'readyState' in result is true
An event should fire shortly...
@@ -165,14 +149,12 @@ PASS 'source' in event is true
PASS event.source != null is true
PASS 'onsuccess' in event.target is true
PASS 'onerror' in event.target is true
-PASS 'abort' in event.target is true
PASS 'readyState' in event.target is true
PASS event.target.readyState is event.target.DONE
objectStore.add('', testData[nextToAdd])
PASS 'onsuccess' in result is true
PASS 'onerror' in result is true
-PASS 'abort' in result is true
PASS 'readyState' in result is true
An event should fire shortly...
diff --git a/LayoutTests/storage/indexeddb/objectstore-removeobjectstore-expected.txt b/LayoutTests/storage/indexeddb/objectstore-removeobjectstore-expected.txt
index 0a3d938..b7ba473 100644
--- a/LayoutTests/storage/indexeddb/objectstore-removeobjectstore-expected.txt
+++ b/LayoutTests/storage/indexeddb/objectstore-removeobjectstore-expected.txt
@@ -6,7 +6,6 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
indexedDB.open('name', 'description')
PASS 'onsuccess' in result is true
PASS 'onerror' in result is true
-PASS 'abort' in result is true
PASS 'readyState' in result is true
An event should fire shortly...
@@ -18,7 +17,6 @@ PASS 'source' in event is true
PASS event.source != null is true
PASS 'onsuccess' in event.target is true
PASS 'onerror' in event.target is true
-PASS 'abort' in event.target is true
PASS 'readyState' in event.target is true
PASS event.target.readyState is event.target.DONE
@@ -26,7 +24,6 @@ db = event.result
db.createObjectStore('storeName', null)
PASS 'onsuccess' in result is true
PASS 'onerror' in result is true
-PASS 'abort' in result is true
PASS 'readyState' in result is true
An event should fire shortly...
@@ -38,14 +35,12 @@ PASS 'source' in event is true
PASS event.source != null is true
PASS 'onsuccess' in event.target is true
PASS 'onerror' in event.target is true
-PASS 'abort' in event.target is true
PASS 'readyState' in event.target is true
PASS event.target.readyState is event.target.DONE
event.result.add('value', 'key')
PASS 'onsuccess' in result is true
PASS 'onerror' in result is true
-PASS 'abort' in result is true
PASS 'readyState' in result is true
An event should fire shortly...
@@ -57,14 +52,14 @@ PASS 'source' in event is true
PASS event.source != null is true
PASS 'onsuccess' in event.target is true
PASS 'onerror' in event.target is true
-PASS 'abort' in event.target is true
PASS 'readyState' in event.target is true
PASS event.target.readyState is event.target.DONE
-event.source.get('key')
+db.transaction()
+store = transaction.objectStore('storeName')
+store.get('key')
PASS 'onsuccess' in result is true
PASS 'onerror' in result is true
-PASS 'abort' in result is true
PASS 'readyState' in result is true
An event should fire shortly...
@@ -76,7 +71,6 @@ PASS 'source' in event is true
PASS event.source != null is true
PASS 'onsuccess' in event.target is true
PASS 'onerror' in event.target is true
-PASS 'abort' in event.target is true
PASS 'readyState' in event.target is true
PASS event.target.readyState is event.target.DONE
@@ -84,7 +78,6 @@ PASS event.result is "value"
event.source.createIndex('indexName', '')
PASS 'onsuccess' in result is true
PASS 'onerror' in result is true
-PASS 'abort' in result is true
PASS 'readyState' in result is true
An event should fire shortly...
@@ -96,7 +89,6 @@ PASS 'source' in event is true
PASS event.source != null is true
PASS 'onsuccess' in event.target is true
PASS 'onerror' in event.target is true
-PASS 'abort' in event.target is true
PASS 'readyState' in event.target is true
PASS event.target.readyState is event.target.DONE
@@ -104,7 +96,6 @@ PASS event.source.indexNames.contains('indexName') is true
db.removeObjectStore('storeName')
PASS 'onsuccess' in result is true
PASS 'onerror' in result is true
-PASS 'abort' in result is true
PASS 'readyState' in result is true
An event should fire shortly...
@@ -116,14 +107,12 @@ PASS 'source' in event is true
PASS event.source != null is true
PASS 'onsuccess' in event.target is true
PASS 'onerror' in event.target is true
-PASS 'abort' in event.target is true
PASS 'readyState' in event.target is true
PASS event.target.readyState is event.target.DONE
db.createObjectStore('storeName', null)
PASS 'onsuccess' in result is true
PASS 'onerror' in result is true
-PASS 'abort' in result is true
PASS 'readyState' in result is true
An event should fire shortly...
@@ -135,14 +124,14 @@ PASS 'source' in event is true
PASS event.source != null is true
PASS 'onsuccess' in event.target is true
PASS 'onerror' in event.target is true
-PASS 'abort' in event.target is true
PASS 'readyState' in event.target is true
PASS event.target.readyState is event.target.DONE
-event.result.get('key')
+db.transaction()
+store = transaction.objectStore('storeName')
+store.get('key')
PASS 'onsuccess' in result is true
PASS 'onerror' in result is true
-PASS 'abort' in result is true
PASS 'readyState' in result is true
An event should fire shortly...
@@ -154,7 +143,6 @@ PASS 'source' in event is true
PASS event.source != null is true
PASS 'onsuccess' in event.target is true
PASS 'onerror' in event.target is true
-PASS 'abort' in event.target is true
PASS 'readyState' in event.target is true
PASS event.target.readyState is event.target.DONE
diff --git a/LayoutTests/storage/indexeddb/objectstore-removeobjectstore.html b/LayoutTests/storage/indexeddb/objectstore-removeobjectstore.html
index e842f5b..7878c7f 100644
--- a/LayoutTests/storage/indexeddb/objectstore-removeobjectstore.html
+++ b/LayoutTests/storage/indexeddb/objectstore-removeobjectstore.html
@@ -49,7 +49,11 @@ function getValue()
{
verifySuccessEvent(event);
- result = evalAndLog("event.source.get('key')");
+ transaction = evalAndLog("db.transaction()");
+ transaction.onabort = unexpectedErrorCallback;
+ var store = evalAndLog("store = transaction.objectStore('storeName')");
+
+ result = evalAndLog("store.get('key')");
verifyResult(result);
result.onsuccess = addIndex;
result.onerror = unexpectedErrorCallback;
@@ -62,15 +66,20 @@ function addIndex()
result = evalAndLog("event.source.createIndex('indexName', '')");
verifyResult(result);
- result.onsuccess = removeObjectStore;
+ result.onsuccess = commitTransaction;
result.onerror = unexpectedErrorCallback;
}
-function removeObjectStore()
+function commitTransaction()
{
verifySuccessEvent(event);
shouldBeTrue("event.source.indexNames.contains('indexName')");
+ // Let the transaction commit.
+ window.setTimeout('removeObjectStore()', 0);
+}
+function removeObjectStore()
+{
result = evalAndLog("db.removeObjectStore('storeName')");
verifyResult(result);
result.onsuccess = createObjectStoreAgain;
@@ -91,7 +100,11 @@ function getValueAgain()
{
verifySuccessEvent(event);
- result = evalAndLog("event.result.get('key')");
+ transaction = evalAndLog("db.transaction()");
+ transaction.onabort = unexpectedErrorCallback;
+ var store = evalAndLog("store = transaction.objectStore('storeName')");
+
+ result = evalAndLog("store.get('key')");
verifyResult(result);
result.onsuccess = unexpectedSuccessCallback;
result.onerror = verifyError;
@@ -100,7 +113,6 @@ function getValueAgain()
function verifyError()
{
verifyErrorEvent(event);
- // FIXME: Should just be IDBDatabaseException.NOT_FOUND_ERR but that doesn't work yet.
shouldBe("event.code", "2");
shouldBeFalse("event.source.indexNames.contains('indexName')");
diff --git a/LayoutTests/storage/indexeddb/open-cursor-expected.txt b/LayoutTests/storage/indexeddb/open-cursor-expected.txt
index e4ddc69..bda103f 100644
--- a/LayoutTests/storage/indexeddb/open-cursor-expected.txt
+++ b/LayoutTests/storage/indexeddb/open-cursor-expected.txt
@@ -6,7 +6,6 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
indexedDB.open('name', 'description')
PASS 'onsuccess' in result is true
PASS 'onerror' in result is true
-PASS 'abort' in result is true
PASS 'readyState' in result is true
An event should fire shortly...
@@ -18,7 +17,6 @@ PASS 'source' in event is true
PASS event.source != null is true
PASS 'onsuccess' in event.target is true
PASS 'onerror' in event.target is true
-PASS 'abort' in event.target is true
PASS 'readyState' in event.target is true
PASS event.target.readyState is event.target.DONE
@@ -26,7 +24,6 @@ db = event.result
db.createObjectStore('test')
PASS 'onsuccess' in result is true
PASS 'onerror' in result is true
-PASS 'abort' in result is true
PASS 'readyState' in result is true
An event should fire shortly...
@@ -38,7 +35,6 @@ PASS 'source' in event is true
PASS event.source != null is true
PASS 'onsuccess' in event.target is true
PASS 'onerror' in event.target is true
-PASS 'abort' in event.target is true
PASS 'readyState' in event.target is true
PASS event.target.readyState is event.target.DONE
@@ -46,7 +42,6 @@ objectStore = event.result
objectStore.add('myValue', 'myKey')
PASS 'onsuccess' in result is true
PASS 'onerror' in result is true
-PASS 'abort' in result is true
PASS 'readyState' in result is true
An event should fire shortly...
@@ -54,7 +49,6 @@ Opening cursor
objectStore.openCursor(keyRange)
PASS 'onsuccess' in result is true
PASS 'onerror' in result is true
-PASS 'abort' in result is true
PASS 'readyState' in result is true
An event should fire shortly...
@@ -67,7 +61,6 @@ PASS 'source' in event is true
PASS event.source != null is true
PASS 'onsuccess' in event.target is true
PASS 'onerror' in event.target is true
-PASS 'abort' in event.target is true
PASS 'readyState' in event.target is true
PASS event.target.readyState is event.target.DONE
@@ -79,7 +72,6 @@ Opening an empty cursor.
objectStore.openCursor(keyRange)
PASS 'onsuccess' in result is true
PASS 'onerror' in result is true
-PASS 'abort' in result is true
PASS 'readyState' in result is true
An event should fire shortly...
@@ -92,10 +84,10 @@ PASS 'source' in event is true
PASS event.source != null is true
PASS 'onsuccess' in event.target is true
PASS 'onerror' in event.target is true
-PASS 'abort' in event.target is true
PASS 'readyState' in event.target is true
PASS event.target.readyState is event.target.DONE
PASS successfullyParsed is true
TEST COMPLETE
+
diff --git a/LayoutTests/storage/indexeddb/resources/shared.js b/LayoutTests/storage/indexeddb/resources/shared.js
index 112bf18..65da3bf 100644
--- a/LayoutTests/storage/indexeddb/resources/shared.js
+++ b/LayoutTests/storage/indexeddb/resources/shared.js
@@ -11,7 +11,6 @@ function verifyEventCommon(event)
shouldBeTrue("event.source != null");
shouldBeTrue("'onsuccess' in event.target");
shouldBeTrue("'onerror' in event.target");
- shouldBeTrue("'abort' in event.target");
shouldBeTrue("'readyState' in event.target");
shouldBe("event.target.readyState", "event.target.DONE");
debug("");
@@ -45,7 +44,6 @@ function verifyResult(result)
{
shouldBeTrue("'onsuccess' in result");
shouldBeTrue("'onerror' in result");
- shouldBeTrue("'abort' in result");
shouldBeTrue("'readyState' in result");
debug("An event should fire shortly...");
debug("");
diff --git a/LayoutTests/storage/indexeddb/transaction-basics-expected.txt b/LayoutTests/storage/indexeddb/transaction-basics-expected.txt
index 25d0694..bba62f0 100644
--- a/LayoutTests/storage/indexeddb/transaction-basics-expected.txt
+++ b/LayoutTests/storage/indexeddb/transaction-basics-expected.txt
@@ -8,7 +8,6 @@ PASS indexedDB == null is false
indexedDB.open('name', 'description')
PASS 'onsuccess' in result is true
PASS 'onerror' in result is true
-PASS 'abort' in result is true
PASS 'readyState' in result is true
An event should fire shortly...
@@ -21,7 +20,6 @@ PASS 'source' in event is true
PASS event.source != null is true
PASS 'onsuccess' in event.target is true
PASS 'onerror' in event.target is true
-PASS 'abort' in event.target is true
PASS 'readyState' in event.target is true
PASS event.target.readyState is event.target.DONE
@@ -29,7 +27,6 @@ db = event.result
db.createObjectStore('storeName', null)
PASS 'onsuccess' in result is true
PASS 'onerror' in result is true
-PASS 'abort' in result is true
PASS 'readyState' in result is true
An event should fire shortly...
@@ -41,7 +38,6 @@ PASS 'source' in event is true
PASS event.source != null is true
PASS 'onsuccess' in event.target is true
PASS 'onerror' in event.target is true
-PASS 'abort' in event.target is true
PASS 'readyState' in event.target is true
PASS event.target.readyState is event.target.DONE
@@ -53,3 +49,4 @@ PASS event.type is "abort"
PASS successfullyParsed is true
TEST COMPLETE
+
diff --git a/WebCore/Android.derived.jscbindings.mk b/WebCore/Android.derived.jscbindings.mk
index 2cc01d9..5dd03df 100644
--- a/WebCore/Android.derived.jscbindings.mk
+++ b/WebCore/Android.derived.jscbindings.mk
@@ -179,6 +179,7 @@ $(patsubst %.h,%.cpp,$(GEN)): $(intermediates)/fileapi/%.cpp : $(intermediates)/
# HTML
GEN := \
$(intermediates)/html/JSDOMFormData.h \
+ $(intermediates)/html/JSDOMTokenList.h \
$(intermediates)/html/JSDataGridColumn.h \
$(intermediates)/html/JSDataGridColumnList.h \
$(intermediates)/html/JSHTMLAllCollection.h \
diff --git a/WebCore/Android.derived.v8bindings.mk b/WebCore/Android.derived.v8bindings.mk
index 12e12d2..efdf73e 100644
--- a/WebCore/Android.derived.v8bindings.mk
+++ b/WebCore/Android.derived.v8bindings.mk
@@ -146,6 +146,12 @@ $(patsubst %.h,%.cpp,$(GEN)): $(intermediates)/bindings/%.cpp : $(intermediates)
GEN := \
$(intermediates)/bindings/V8Blob.h \
$(intermediates)/bindings/V8BlobBuilder.h \
+<<<<<<< HEAD
+=======
+ $(intermediates)/bindings/V8DOMTokenList.h \
+ $(intermediates)/bindings/V8DataGridColumn.h \
+ $(intermediates)/bindings/V8DataGridColumnList.h \
+>>>>>>> webkit.org at r68651
$(intermediates)/bindings/V8File.h \
$(intermediates)/bindings/V8FileError.h \
$(intermediates)/bindings/V8FileList.h \
diff --git a/WebCore/Android.jscbindings.mk b/WebCore/Android.jscbindings.mk
index e87ca3d..bfa4d1d 100644
--- a/WebCore/Android.jscbindings.mk
+++ b/WebCore/Android.jscbindings.mk
@@ -86,10 +86,14 @@ LOCAL_SRC_FILES += \
bindings/js/JSDOMBinding.cpp \
bindings/js/JSDOMFormDataCustom.cpp \
bindings/js/JSDOMGlobalObject.cpp \
+<<<<<<< HEAD
bindings/js/JSDOMMimeTypeArrayCustom.cpp \
bindings/js/JSDOMPluginArrayCustom.cpp \
bindings/js/JSDOMPluginCustom.cpp \
bindings/js/JSDOMStringMapCustom.cpp \
+=======
+ bindings/js/JSDOMTokenList.cpp \
+>>>>>>> webkit.org at r68651
bindings/js/JSDOMWindowBase.cpp \
bindings/js/JSDOMWindowCustom.cpp \
bindings/js/JSDOMWindowShell.cpp \
diff --git a/WebCore/Android.mk b/WebCore/Android.mk
index 6ef73e9..e148dcb 100644
--- a/WebCore/Android.mk
+++ b/WebCore/Android.mk
@@ -275,10 +275,22 @@ LOCAL_SRC_FILES := $(LOCAL_SRC_FILES) \
history/android/HistoryItemAndroid.cpp \
\
html/AsyncImageResizer.cpp \
+ html/BaseTextInputType.cpp \
+ html/ButtonInputType.cpp \
+ html/CheckboxInputType.cpp \
html/CollectionCache.cpp \
html/parser/CSSPreloadScanner.cpp \
+ html/ColorInputType.cpp \
html/DOMFormData.cpp \
+<<<<<<< HEAD
html/DateComponents.cpp \
+=======
+ html/DateInputType.cpp \
+ html/DateTimeInputType.cpp \
+ html/DateTimeLocalInputType.cpp \
+ html/EmailInputType.cpp \
+ html/FileInputType.cpp \
+>>>>>>> webkit.org at r68651
html/FormDataList.cpp \
html/HTMLAllCollection.cpp \
html/HTMLCollection.cpp \
@@ -292,16 +304,37 @@ LOCAL_SRC_FILES := $(LOCAL_SRC_FILES) \
html/HTMLParserErrorCodes.cpp \
html/HTMLTableRowsCollection.cpp \
html/HTMLViewSourceDocument.cpp \
+ html/HiddenInputType.cpp \
html/ImageData.cpp \
html/ImageDocument.cpp \
- html/MediaDocument.cpp \
+ html/ImageInputType.cpp \
html/ImageResizerThread.cpp \
+<<<<<<< HEAD
html/LabelsNodeList.cpp \
html/StepRange.cpp \
+=======
+ html/InputType.cpp \
+ html/IsIndexInputType.cpp \
+ html/MediaDocument.cpp \
+ html/MonthInputType.cpp \
+ html/NumberInputType.cpp \
+ html/PasswordInputType.cpp \
+>>>>>>> webkit.org at r68651
html/PluginDocument.cpp \
+ html/RadioInputType.cpp \
+ html/RangeInputType.cpp \
+ html/ResetInputType.cpp \
+ html/SearchInputType.cpp \
+ html/SubmitInputType.cpp \
+ html/TelephoneInputType.cpp \
html/TextDocument.cpp \
+ html/TextFieldInputType.cpp \
+ html/TextInputType.cpp \
+ html/TimeInputType.cpp \
html/TimeRanges.cpp \
+ html/URLInputType.cpp \
html/ValidityState.cpp \
+ html/WeekInputType.cpp \
\
html/canvas/CanvasGradient.cpp \
html/canvas/WebGLObject.cpp \
@@ -553,7 +586,18 @@ LOCAL_SRC_FILES := $(LOCAL_SRC_FILES) \
platform/graphics/filters/FEBlend.cpp \
platform/graphics/filters/FEColorMatrix.cpp \
platform/graphics/filters/FEComponentTransfer.cpp \
- platform/graphics/filters/FEComposite.cpp
+ platform/graphics/filters/FEComposite.cpp \
+ platform/graphics/filters/FEConvolveMatrix.cpp \
+ platform/graphics/filters/FEDiffuseLighting.cpp \
+ platform/graphics/filters/FEDisplacementMap.cpp \
+ platform/graphics/filters/FEFlood.cpp \
+ platform/graphics/filters/FEMerge.cpp \
+ platform/graphics/filters/FEMorphology.cpp \
+ platform/graphics/filters/FEOffset.cpp \
+ platform/graphics/filters/FESpecularLighting.cpp \
+ platform/graphics/filters/FETile.cpp \
+ platform/graphics/filters/FETurbulence.cpp \
+ platform/graphics/filters/LightSource.cpp
endif
LOCAL_SRC_FILES := $(LOCAL_SRC_FILES) \
@@ -1028,20 +1072,9 @@ LOCAL_SRC_FILES := $(LOCAL_SRC_FILES) \
\
svg/graphics/SVGImage.cpp \
\
- svg/graphics/filters/SVGFEConvolveMatrix.cpp \
- svg/graphics/filters/SVGFEDiffuseLighting.cpp \
- svg/graphics/filters/SVGFEDisplacementMap.cpp \
- svg/graphics/filters/SVGFEFlood.cpp \
svg/graphics/filters/SVGFEImage.cpp \
- svg/graphics/filters/SVGFEMerge.cpp \
- svg/graphics/filters/SVGFEMorphology.cpp \
- svg/graphics/filters/SVGFEOffset.cpp \
- svg/graphics/filters/SVGFESpecularLighting.cpp \
- svg/graphics/filters/SVGFETile.cpp \
- svg/graphics/filters/SVGFETurbulence.cpp \
svg/graphics/filters/SVGFilter.cpp \
- svg/graphics/filters/SVGFilterBuilder.cpp \
- svg/graphics/filters/SVGLightSource.cpp
+ svg/graphics/filters/SVGFilterBuilder.cpp
endif
LOCAL_SRC_FILES := $(LOCAL_SRC_FILES) \
diff --git a/WebCore/CMakeLists.txt b/WebCore/CMakeLists.txt
index eeb88b1..210244e 100644
--- a/WebCore/CMakeLists.txt
+++ b/WebCore/CMakeLists.txt
@@ -205,6 +205,7 @@ SET(WebCore_IDL_FILES
html/DataGridColumn.idl
html/DataGridColumnList.idl
html/DOMFormData.idl
+ html/DOMTokenList.idl
html/HTMLAllCollection.idl
html/HTMLAnchorElement.idl
html/HTMLAppletElement.idl
@@ -535,6 +536,10 @@ IF (ENABLE_SVG)
ENDIF()
SET(WebCore_SOURCES
+ ${DERIVED_SOURCES_DIR}/DocTypeStrings.cpp
+ ${DERIVED_SOURCES_DIR}/CSSValueKeywords.cpp
+ ${DERIVED_SOURCES_DIR}/CSSPropertyNames.cpp
+ ${DERIVED_SOURCES_DIR}/ColorData.cpp
${DERIVED_SOURCES_DIR}/HTMLEntityTable.cpp
${DERIVED_SOURCES_DIR}/UserAgentStyleSheetsData.cpp
${DERIVED_SOURCES_DIR}/InspectorBackendDispatcher.cpp
@@ -939,13 +944,23 @@ SET(WebCore_SOURCES
history/PageCache.cpp
html/AsyncImageResizer.cpp
+ html/BaseTextInputType.cpp
+ html/ButtonInputType.cpp
+ html/CheckboxInputType.cpp
html/CollectionCache.cpp
+ html/ColorInputType.cpp
html/DOMDataGridDataSource.cpp
html/DOMFormData.cpp
+ html/DOMTokenList.cpp
html/DataGridColumn.cpp
html/DataGridColumnList.cpp
html/DateComponents.cpp
+ html/DateInputType.cpp
+ html/DateTimeInputType.cpp
+ html/DateTimeLocalInputType.cpp
+ html/EmailInputType.cpp
html/FTPDirectoryDocument.cpp
+ html/FileInputType.cpp
html/FormDataList.cpp
html/HTMLAllCollection.cpp
html/HTMLAnchorElement.cpp
@@ -1028,15 +1043,33 @@ SET(WebCore_SOURCES
html/HTMLTitleElement.cpp
html/HTMLUListElement.cpp
html/HTMLViewSourceDocument.cpp
+ html/HiddenInputType.cpp
html/ImageData.cpp
html/ImageDocument.cpp
+ html/ImageInputType.cpp
html/ImageResizerThread.cpp
+ html/InputType.cpp
+ html/IsIndexInputType.cpp
html/LabelsNodeList.cpp
html/MediaDocument.cpp
+ html/MonthInputType.cpp
+ html/NumberInputType.cpp
+ html/PasswordInputType.cpp
html/PluginDocument.cpp
+ html/RadioInputType.cpp
+ html/RangeInputType.cpp
+ html/ResetInputType.cpp
+ html/SearchInputType.cpp
html/StepRange.cpp
+ html/SubmitInputType.cpp
+ html/TelephoneInputType.cpp
html/TextDocument.cpp
+ html/TextFieldInputType.cpp
+ html/TextInputType.cpp
+ html/TimeInputType.cpp
+ html/URLInputType.cpp
html/ValidityState.cpp
+ html/WeekInputType.cpp
html/canvas/CanvasGradient.cpp
html/canvas/CanvasPattern.cpp
html/canvas/CanvasPixelArray.cpp
@@ -1257,9 +1290,21 @@ SET(WebCore_SOURCES
platform/graphics/filters/FEColorMatrix.cpp
platform/graphics/filters/FEComponentTransfer.cpp
platform/graphics/filters/FEComposite.cpp
+ platform/graphics/filters/FEConvolveMatrix.cpp
+ platform/graphics/filters/FEDiffuseLighting.cpp
+ platform/graphics/filters/FEDisplacementMap.cpp
+ platform/graphics/filters/FEFlood.cpp
platform/graphics/filters/FEGaussianBlur.cpp
+ platform/graphics/filters/FELighting.cpp
+ platform/graphics/filters/FEMerge.cpp
+ platform/graphics/filters/FEMorphology.cpp
+ platform/graphics/filters/FEOffset.cpp
+ platform/graphics/filters/FESpecularLighting.cpp
+ platform/graphics/filters/FETile.cpp
+ platform/graphics/filters/FETurbulence.cpp
platform/graphics/filters/FilterEffect.cpp
platform/graphics/filters/ImageBufferFilter.cpp
+ platform/graphics/filters/LightSource.cpp
platform/graphics/filters/SourceAlpha.cpp
platform/graphics/filters/SourceGraphic.cpp
@@ -1812,21 +1857,9 @@ IF (ENABLE_SVG)
svg/animation/SMILTimeContainer.cpp
svg/animation/SVGSMILElement.cpp
svg/graphics/SVGImage.cpp
- svg/graphics/filters/SVGFEConvolveMatrix.cpp
- svg/graphics/filters/SVGFEDiffuseLighting.cpp
- svg/graphics/filters/SVGFEDisplacementMap.cpp
- svg/graphics/filters/SVGFEFlood.cpp
svg/graphics/filters/SVGFEImage.cpp
- svg/graphics/filters/SVGFELighting.cpp
- svg/graphics/filters/SVGFEMerge.cpp
- svg/graphics/filters/SVGFEMorphology.cpp
- svg/graphics/filters/SVGFEOffset.cpp
- svg/graphics/filters/SVGFESpecularLighting.cpp
- svg/graphics/filters/SVGFETile.cpp
- svg/graphics/filters/SVGFETurbulence.cpp
svg/graphics/filters/SVGFilter.cpp
svg/graphics/filters/SVGFilterBuilder.cpp
- svg/graphics/filters/SVGLightSource.cpp
)
ENDIF()
@@ -1887,6 +1920,12 @@ IF (ENABLE_WML)
)
ENDIF()
+IF (ENABLE_PROGRESS_TAG)
+ LIST(APPEND WebCore_SOURCES
+ accessibility/AccessibilityProgressIndicator.cpp
+ )
+ENDIF ()
+
SET(IDL_INCLUDES "")
FOREACH (_include ${WebCore_IDL_INCLUDES})
LIST(APPEND IDL_INCLUDES --include=${WEBCORE_DIR}/${_include})
@@ -1907,12 +1946,10 @@ LIST(APPEND WebCore_SOURCES ${JS_IDL_FILES} ${Inspector_IDL_FILES})
GENERATE_ENTITIES(${WEBCORE_DIR}/html/parser/HTMLEntityNames.in ${DERIVED_SOURCES_DIR}/HTMLEntityTable.cpp ${WEBCORE_DIR}/html/parser/create-html-entity-table)
-
-GENERATE_GPERF(${WEBCORE_DIR}/platform/ColorData.gperf ${DERIVED_SOURCES_DIR}/ColorData.cpp findColor "")
+MAKE_HASH_TOOLS(${WEBCORE_DIR}/platform/ColorData)
ADD_SOURCE_DERIVED_DEPENDENCIES(${WEBCORE_DIR}/platform/graphics/Color.cpp ColorData.cpp)
-
-GENERATE_GPERF(${WEBCORE_DIR}/html/DocTypeStrings.gperf ${DERIVED_SOURCES_DIR}/DocTypeStrings.cpp findDoctypeEntry "-F,PubIDInfo::eAlmostStandards,PubIDInfo::eAlmostStandards")
+MAKE_HASH_TOOLS(${WEBCORE_DIR}/html/DocTypeStrings)
ADD_SOURCE_DERIVED_DEPENDENCIES(${WEBCORE_DIR}/html/HTMLDocument.cpp DocTypeStrings.cpp)
@@ -1932,6 +1969,7 @@ GENERATE_CSS_PROPERTY_NAMES()
GENERATE_CSS_VALUE_KEYWORDS()
+ADD_SOURCE_DERIVED_DEPENDENCIES(${DERIVED_SOURCES_DIR}/HashTools.h DocTypeStrings.cpp CSSValueKeywords.cpp CSSPropertyNames.cpp ColorData.cpp)
ADD_SOURCE_DERIVED_DEPENDENCIES(${DERIVED_SOURCES_DIR}/CSSGrammar.cpp CSSValueKeywords.h)
ADD_SOURCE_DERIVED_DEPENDENCIES(${DERIVED_SOURCES_DIR}/CSSGrammar.cpp CSSPropertyNames.h)
ADD_SOURCE_DERIVED_DEPENDENCIES(${WEBCORE_DIR}/css/CSSPrimitiveValueMappings.h CSSValueKeywords.h)
diff --git a/WebCore/CMakeListsEfl.txt b/WebCore/CMakeListsEfl.txt
index c892cf4..a4d4a60 100644
--- a/WebCore/CMakeListsEfl.txt
+++ b/WebCore/CMakeListsEfl.txt
@@ -67,6 +67,7 @@ IF (WTF_PLATFORM_CAIRO)
"${WEBCORE_DIR}/platform/graphics/cairo"
)
LIST(APPEND WebCore_SOURCES
+ platform/graphics/cairo/CairoUtilities.cpp
platform/graphics/cairo/FontCacheFreeType.cpp
platform/graphics/cairo/FontCairo.cpp
platform/graphics/cairo/FontCustomPlatformData.cpp
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 1f755a4..c660e9d 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,6938 @@
+2010-09-29 Philippe Normand <pnormand@igalia.com>
+
+ Reviewed by Gustavo Noronha Silva.
+
+ build still broken since r68521
+ https://bugs.webkit.org/show_bug.cgi?id=46795
+
+ Call make-values.pl once only. It seems calling it multiple times
+ in the same build produces a wrong CSSValueKeywordsHash.h which
+ has a duplicate declaration of its valueList variable. The double
+ call is triggered by the double targets in the Makefile rules and
+ makevalues.pl generates one of them, which screws up the build. A
+ more proper fix should be done with the advices on
+ http://www.cmcrossroads.com/cm-basics/12905-rules-with-multiple-outputs-in-gnu-make
+
+ * GNUmakefile.am:
+
+2010-09-29 João Paulo Rechi Vita <jprvita@profusion.mobi>
+
+ Unreviewed build fix.
+
+ Fix CMake build for ENABLE_PROGRESS_TAG.
+ https://bugs.webkit.org/show_bug.cgi?id=46808
+
+ No new tests since it's a build fix.
+
+ * CMakeLists.txt:
+
+2010-09-29 Yury Semikhatsky <yurys@chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ [v8] Use generic mechanism to report exceptions in V8CustomVoidCallback
+ https://bugs.webkit.org/show_bug.cgi?id=46803
+
+ No new tests. It's covered by existing tests under LayoutTests/storage
+
+ * bindings/v8/custom/V8CustomVoidCallback.cpp:
+ (WebCore::invokeCallback):
+
+2010-09-29 Satish Sampath <satish@chromium.org>
+
+ Reviewed by Jeremy Orlow.
+
+ Rename the input element's @speech attribute to @webkitspeech since it is still experimental.
+ https://bugs.webkit.org/show_bug.cgi?id=46799
+
+ * bindings/generic/RuntimeEnabledFeatures.h:
+ (WebCore::RuntimeEnabledFeatures::webkitspeechEnabled): Rename the runtime feature flag getter.
+ * css/CSSPrimitiveValueMappings.h:
+ (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
+ * css/CSSValueKeywords.in: Rename the css style name.
+ * css/html.css: Rename the css style name.
+ (input::-webkit-input-speech-button):
+ * html/HTMLAttributeNames.in: Rename the @speech attribute.
+ * html/HTMLInputElement.cpp: Update code using the attribute.
+ (WebCore::HTMLInputElement::parseMappedAttribute):
+ (WebCore::HTMLInputElement::isSpeechEnabled):
+ * html/HTMLInputElement.idl: Rename the @speech attribute.
+
+2010-09-29 MORITA Hajime <morrita@google.com>
+
+ [Chromium] failed to build without ACCELERATED_COMPOSITING
+ https://bugs.webkit.org/show_bug.cgi?id=46793
+
+ Moved constant definitions from inside ACCELERATED_COMPOSITING to
+ outside of the condition.
+
+ * WebCore.gypi:
+ * platform/graphics/chromium/VideoFrameChromium.cpp: Added just for defining constants.
+ * platform/graphics/chromium/VideoLayerChromium.cpp:
+
+2010-09-28 Pavel Feldman <pfeldman@chromium.org>
+
+ Reviewed by Timothy Hatcher.
+
+ Web Inspector: [Resources panel] Need more visible "at a glance".
+ https://bugs.webkit.org/show_bug.cgi?id=45657
+
+ * WebCore.gypi:
+ * WebCore.vcproj/WebCore.vcproj:
+ * inspector/front-end/DataGrid.js:
+ (WebInspector.DataGrid):
+ (WebInspector.DataGrid.prototype.updateWidths):
+ (WebInspector.DataGrid.prototype.sortNodes):
+ (WebInspector.DataGrid.prototype._resizerDragging):
+ (WebInspector.DataGrid.prototype._endResizerDragging):
+ (WebInspector.DataGridNode.prototype.selectable.true.get element):
+ (WebInspector.DataGridNode.prototype.createCells):
+ (WebInspector.DataGridNode.prototype.refresh):
+ * inspector/front-end/Images/networkIcon.png: Copied from WebCore/inspector/front-end/Images/resourcesIcon.png.
+ * inspector/front-end/NetworkPanel.js: Added.
+ * inspector/front-end/Settings.js:
+ * inspector/front-end/WebKit.qrc:
+ * inspector/front-end/inspector.css:
+ (.toolbar-item.network .toolbar-icon):
+ (.data-grid .data-container):
+ * inspector/front-end/inspector.html:
+ * inspector/front-end/inspector.js:
+ (WebInspector._createPanels):
+ (WebInspector.updateResource):
+ * inspector/front-end/networkPanel.css: Added.
+
+2010-09-28 Ilya Tikhonovsky <loislo@chromium.org>
+
+ Reviewed by Yury Semikhatsky.
+
+ Web Inspector: move pauseOnExceptionState under control of InspectorState
+ It is Inspector Protocol cleanup activity.
+ The actual state of this flag can be obtained as a return value of setPauseOnExceptionState command
+ or as a value in InspectorState object.
+
+ https://bugs.webkit.org/show_bug.cgi?id=46724
+
+ * inspector/Inspector.idl:
+ * inspector/InspectorController.cpp:
+ (WebCore::InspectorController::getInspectorState):
+ (WebCore::InspectorController::populateScriptObjects):
+ * inspector/InspectorDebuggerAgent.cpp:
+ (WebCore::InspectorDebuggerAgent::setPauseOnExceptionsState):
+ (WebCore::InspectorDebuggerAgent::pauseOnExceptionsState):
+ * inspector/InspectorDebuggerAgent.h:
+ * inspector/front-end/ScriptsPanel.js:
+ (WebInspector.ScriptsPanel.prototype._togglePauseOnExceptions):
+ * inspector/front-end/inspector.js:
+ (WebInspector.doLoadedDone.populateInspectorState):
+ (WebInspector.doLoadedDone):
+ (WebInspector.reportProtocolError):
+
+2010-09-28 Philippe Normand <pnormand@igalia.com>
+
+ Reviewed by Martin Robinson.
+
+ check USE(GSTREAMER) instead of ENABLE(VIDEO) in gstreamer/ files
+ https://bugs.webkit.org/show_bug.cgi?id=46717
+
+ Guard the gstreamer/ files with USE(GSTREAMER), which is more
+ explicit than ENABLE(VIDEO).
+
+ * GNUmakefile.am: Define WTF_USE_GSTREAMER only if GStreamer
+ support is enabled.
+ * platform/graphics/gstreamer/DataSourceGStreamer.cpp:
+ * platform/graphics/gstreamer/DataSourceGStreamer.h:
+ * platform/graphics/gstreamer/GOwnPtrGStreamer.cpp:
+ * platform/graphics/gstreamer/GOwnPtrGStreamer.h:
+ * platform/graphics/gstreamer/GStreamerGWorld.cpp:
+ * platform/graphics/gstreamer/GStreamerGWorld.h:
+ * platform/graphics/gstreamer/ImageGStreamer.h:
+ * platform/graphics/gstreamer/ImageGStreamerCG.mm:
+ * platform/graphics/gstreamer/ImageGStreamerCairo.cpp:
+ * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
+ * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
+ * platform/graphics/gstreamer/PlatformVideoWindow.h:
+ * platform/graphics/gstreamer/PlatformVideoWindowEfl.cpp:
+ * platform/graphics/gstreamer/PlatformVideoWindowGtk.cpp:
+ * platform/graphics/gstreamer/VideoSinkGStreamer.cpp:
+ * platform/graphics/gstreamer/VideoSinkGStreamer.h:
+ * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
+ * platform/graphics/gstreamer/WebKitWebSourceGStreamer.h:
+
+2010-09-28 Kent Tamura <tkent@chromium.org>
+
+ Unreviewed, windows build fix for r68629.
+
+ * WebCore.vcproj/WebCore.vcproj: Add TimeInputType.{cpp,h}
+
+2010-09-28 Johnny Ding <jnd@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ https://bugs.webkit.org/show_bug.cgi?id=41292
+ Pass the right popupAllowed flag to current execution frame,
+ so WebKit can get right gesture status for popups initiated
+ from plugins.
+ This also makes v8 binding's ScriptController::processingUserGesture
+ match what jsc version.
+
+ Test: plugins/plugin-initiate-popup-window.html
+
+ * bindings/v8/NPV8Object.cpp:
+ (_NPN_EvaluateHelper):
+ * bindings/v8/ScriptController.cpp:
+ (WebCore::ScriptController::ScriptController):
+ (WebCore::ScriptController::processingUserGesture):
+ * bindings/v8/ScriptController.h:
+ (WebCore::ScriptController::setAllowPopupsFromPlugin):
+ (WebCore::ScriptController::allowPopupsFromPlugin):
+
+2010-09-28 Kent Tamura <tkent@chromium.org>
+
+ Reviewed by Darin Adler.
+
+ Refactor HTMLInputElement: Introducing InputType class and classes
+ for each input element types.
+ https://bugs.webkit.org/show_bug.cgi?id=45872
+
+ No new tests because this doesn't change any behavior.
+
+ * Android.mk: Add new files.
+ * CMakeLists.txt: ditto.
+ * GNUmakefile.am: ditto.
+ * WebCore.gypi: ditto.
+ * WebCore.pro: ditto.
+ * WebCore.vcproj/WebCore.vcproj: ditto.
+ * WebCore.xcodeproj/project.pbxproj: ditto.
+ * html/BaseTextInputType.cpp: Added.
+ (WebCore::BaseTextInputType::isTextType):
+ (WebCore::BaseTextInputType::patternMismatch):
+ * html/BaseTextInputType.h: Added.
+ (WebCore::BaseTextInputType::BaseTextInputType):
+ * html/ButtonInputType.cpp: Added.
+ (WebCore::ButtonInputType::create):
+ (WebCore::ButtonInputType::formControlType):
+ * html/ButtonInputType.h: Added.
+ (WebCore::ButtonInputType::ButtonInputType):
+ * html/CheckboxInputType.cpp: Added.
+ (WebCore::CheckboxInputType::create):
+ (WebCore::CheckboxInputType::formControlType):
+ * html/CheckboxInputType.h: Added.
+ (WebCore::CheckboxInputType::CheckboxInputType):
+ * html/ColorInputType.cpp: Added.
+ (WebCore::ColorInputType::create):
+ (WebCore::ColorInputType::formControlType):
+ * html/ColorInputType.h: Added.
+ (WebCore::ColorInputType::ColorInputType):
+ * html/DateInputType.cpp: Added.
+ (WebCore::DateInputType::create):
+ (WebCore::DateInputType::formControlType):
+ * html/DateInputType.h: Added.
+ (WebCore::DateInputType::DateInputType):
+ * html/DateTimeInputType.cpp: Added.
+ (WebCore::DateTimeInputType::create):
+ (WebCore::DateTimeInputType::formControlType):
+ * html/DateTimeInputType.h: Added.
+ (WebCore::DateTimeInputType::DateTimeInputType):
+ * html/DateTimeLocalInputType.cpp: Added.
+ (WebCore::DateTimeLocalInputType::create):
+ (WebCore::DateTimeLocalInputType::formControlType):
+ * html/DateTimeLocalInputType.h: Added.
+ (WebCore::DateTimeLocalInputType::DateTimeLocalInputType):
+ * html/EmailInputType.cpp: Added.
+ (WebCore::EmailInputType::create):
+ (WebCore::EmailInputType::formControlType):
+ * html/EmailInputType.h: Added.
+ (WebCore::EmailInputType::EmailInputType):
+ * html/FileInputType.cpp: Added.
+ (WebCore::FileInputType::create):
+ (WebCore::FileInputType::formControlType):
+ * html/FileInputType.h: Added.
+ (WebCore::FileInputType::FileInputType):
+ * html/HTMLInputElement.cpp:
+ (WebCore::HTMLInputElement::HTMLInputElement): Initialize m_inputType.
+ (WebCore::HTMLInputElement::patternMismatch): Delegate to InputType.
+ (WebCore::HTMLInputElement::updateType): Update m_inputType with new type.
+ (WebCore::HTMLInputElement::formControlType): Delegate to InputType.
+ (WebCore::HTMLInputElement::isTextField): ditto.
+ (WebCore::HTMLInputElement::isTextType): ditto.
+ * html/HTMLInputElement.h:
+ * html/HiddenInputType.cpp: Added.
+ (WebCore::HiddenInputType::create):
+ (WebCore::HiddenInputType::formControlType):
+ * html/HiddenInputType.h: Added.
+ (WebCore::HiddenInputType::HiddenInputType):
+ * html/ImageInputType.cpp: Added.
+ (WebCore::ImageInputType::create):
+ (WebCore::ImageInputType::formControlType):
+ * html/ImageInputType.h: Added.
+ (WebCore::ImageInputType::ImageInputType):
+ * html/InputType.cpp: Added.
+ (WebCore::createInputTypeFactoryMap):
+ (WebCore::InputType::create):
+ (WebCore::InputType::createText):
+ (WebCore::InputType::~InputType):
+ (WebCore::InputType::isTextField):
+ (WebCore::InputType::isTextType):
+ (WebCore::InputType::patternMismatch):
+ (WebCore::InputTypeNames::button):
+ (WebCore::InputTypeNames::checkbox):
+ (WebCore::InputTypeNames::color):
+ (WebCore::InputTypeNames::date):
+ (WebCore::InputTypeNames::datetime):
+ (WebCore::InputTypeNames::datetimelocal):
+ (WebCore::InputTypeNames::email):
+ (WebCore::InputTypeNames::file):
+ (WebCore::InputTypeNames::hidden):
+ (WebCore::InputTypeNames::image):
+ (WebCore::InputTypeNames::isindex):
+ (WebCore::InputTypeNames::month):
+ (WebCore::InputTypeNames::number):
+ (WebCore::InputTypeNames::password):
+ (WebCore::InputTypeNames::radio):
+ (WebCore::InputTypeNames::range):
+ (WebCore::InputTypeNames::reset):
+ (WebCore::InputTypeNames::search):
+ (WebCore::InputTypeNames::submit):
+ (WebCore::InputTypeNames::telephone):
+ (WebCore::InputTypeNames::text):
+ (WebCore::InputTypeNames::time):
+ (WebCore::InputTypeNames::url):
+ (WebCore::InputTypeNames::week):
+ * html/InputType.h: Added.
+ (WebCore::InputType::InputType):
+ (WebCore::InputType::element):
+ * html/IsIndexInputType.cpp: Added.
+ (WebCore::IsIndexInputType::create):
+ (WebCore::IsIndexInputType::formControlType):
+ * html/IsIndexInputType.h: Added.
+ (WebCore::IsIndexInputType::IsIndexInputType):
+ * html/MonthInputType.cpp: Added.
+ (WebCore::MonthInputType::create):
+ (WebCore::MonthInputType::formControlType):
+ * html/MonthInputType.h: Added.
+ (WebCore::MonthInputType::MonthInputType):
+ * html/NumberInputType.cpp: Added.
+ (WebCore::NumberInputType::create):
+ (WebCore::NumberInputType::formControlType):
+ * html/NumberInputType.h: Added.
+ (WebCore::NumberInputType::NumberInputType):
+ * html/PasswordInputType.cpp: Added.
+ (WebCore::PasswordInputType::create):
+ (WebCore::PasswordInputType::formControlType):
+ * html/PasswordInputType.h: Added.
+ (WebCore::PasswordInputType::PasswordInputType):
+ * html/RadioInputType.cpp: Added.
+ (WebCore::RadioInputType::create):
+ (WebCore::RadioInputType::formControlType):
+ * html/RadioInputType.h: Added.
+ (WebCore::RadioInputType::RadioInputType):
+ * html/RangeInputType.cpp: Added.
+ (WebCore::RangeInputType::create):
+ (WebCore::RangeInputType::formControlType):
+ * html/RangeInputType.h: Added.
+ (WebCore::RangeInputType::RangeInputType):
+ * html/ResetInputType.cpp: Added.
+ (WebCore::ResetInputType::create):
+ (WebCore::ResetInputType::formControlType):
+ * html/ResetInputType.h: Added.
+ (WebCore::ResetInputType::ResetInputType):
+ * html/SearchInputType.cpp: Added.
+ (WebCore::SearchInputType::create):
+ (WebCore::SearchInputType::formControlType):
+ * html/SearchInputType.h: Added.
+ (WebCore::SearchInputType::SearchInputType):
+ * html/SubmitInputType.cpp: Added.
+ (WebCore::SubmitInputType::create):
+ (WebCore::SubmitInputType::formControlType):
+ * html/SubmitInputType.h: Added.
+ (WebCore::SubmitInputType::SubmitInputType):
+ * html/TelephoneInputType.cpp: Added.
+ (WebCore::TelephoneInputType::create):
+ (WebCore::TelephoneInputType::formControlType):
+ * html/TelephoneInputType.h: Added.
+ (WebCore::TelephoneInputType::TelephoneInputType):
+ * html/TextFieldInputType.cpp: Added.
+ (WebCore::TextFieldInputType::isTextField):
+ * html/TextFieldInputType.h: Added.
+ (WebCore::TextFieldInputType::TextFieldInputType):
+ * html/TextInputType.cpp: Added.
+ (WebCore::TextInputType::create):
+ (WebCore::TextInputType::formControlType):
+ * html/TextInputType.h: Added.
+ (WebCore::TextInputType::TextInputType):
+ * html/TimeInputType.cpp: Added.
+ (WebCore::TimeInputType::create):
+ (WebCore::TimeInputType::formControlType):
+ * html/TimeInputType.h: Added.
+ (WebCore::TimeInputType::TimeInputType):
+ * html/URLInputType.cpp: Added.
+ (WebCore::URLInputType::create):
+ (WebCore::URLInputType::formControlType):
+ * html/URLInputType.h: Added.
+ (WebCore::URLInputType::URLInputType):
+ * html/WeekInputType.cpp: Added.
+ (WebCore::WeekInputType::create):
+ (WebCore::WeekInputType::formControlType):
+ * html/WeekInputType.h: Added.
+ (WebCore::WeekInputType::WeekInputType):
+
+2010-09-28 David Hyatt <hyatt@apple.com>
+
+ Reviewed by Maciej Stachowiak.
+
+ https://bugs.webkit.org/show_bug.cgi?id=46782, rename the top and bottom margin quirk getters/setters.
+
+ Also do a bit of cleanup for block flow roots. Make sure they don't try to propagate overhanging floats out
+ to ancestors.
+
+ * rendering/RenderBlock.cpp:
+ (WebCore::RenderBlock::layoutBlock):
+ (WebCore::RenderBlock::collapseMargins):
+ (WebCore::RenderBlock::setCollapsedBottomMargin):
+ (WebCore::RenderBlock::addOverhangingFloats):
+ * rendering/RenderObject.cpp:
+ (WebCore::RenderObject::RenderObject):
+ * rendering/RenderObject.h:
+ (WebCore::RenderObject::isMarginBeforeQuirk):
+ (WebCore::RenderObject::isMarginAfterQuirk):
+ (WebCore::RenderObject::setMarginBeforeQuirk):
+ (WebCore::RenderObject::setMarginAfterQuirk):
+
+2010-09-28 David Hyatt <hyatt@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ https://bugs.webkit.org/show_bug.cgi?id=46780
+
+ Rename the pos/neg/collapsed margin methods. Rename all the members of the RenderBlockRareData struct.
+ No logical changes. Just renames.
+
+ * editing/TextIterator.cpp:
+ (WebCore::shouldEmitExtraNewlineForNode):
+ * rendering/RenderBlock.cpp:
+ (WebCore::RenderBlock::MarginInfo::MarginInfo):
+ (WebCore::RenderBlock::layoutBlock):
+ (WebCore::RenderBlock::collapseMargins):
+ (WebCore::RenderBlock::clearFloatsIfNeeded):
+ (WebCore::RenderBlock::estimateVerticalPosition):
+ (WebCore::RenderBlock::setCollapsedBottomMargin):
+ (WebCore::RenderBlock::layoutBlockChild):
+ (WebCore::RenderBlock::paintChildren):
+ (WebCore::RenderBlock::lowestPosition):
+ (WebCore::RenderBlock::setMaxMarginBeforeValues):
+ (WebCore::RenderBlock::setMaxMarginAfterValues):
+ (WebCore::RenderBlock::absoluteRects):
+ (WebCore::RenderBlock::absoluteQuads):
+ (WebCore::RenderBlock::rectWithOutlineForRepaint):
+ (WebCore::RenderBlock::addFocusRingRects):
+ * rendering/RenderBlock.h:
+ (WebCore::RenderBlock::maxPosMarginBefore):
+ (WebCore::RenderBlock::maxNegMarginBefore):
+ (WebCore::RenderBlock::maxPosMarginAfter):
+ (WebCore::RenderBlock::maxNegMarginAfter):
+ (WebCore::RenderBlock::initMaxMarginValues):
+ (WebCore::RenderBlock::maxMarginBefore):
+ (WebCore::RenderBlock::maxMarginAfter):
+ (WebCore::RenderBlock::RenderBlockRareData::RenderBlockRareData):
+ (WebCore::RenderBlock::RenderBlockRareData::beforePosDefault):
+ (WebCore::RenderBlock::RenderBlockRareData::beforeNegDefault):
+ (WebCore::RenderBlock::RenderBlockRareData::afterPosDefault):
+ (WebCore::RenderBlock::RenderBlockRareData::afterNegDefault):
+ * rendering/RenderBox.cpp:
+ (WebCore::RenderBox::computeLogicalHeight):
+ * rendering/RenderBox.h:
+ (WebCore::RenderBox::collapsedMarginBefore):
+ (WebCore::RenderBox::collapsedMarginAfter):
+ (WebCore::RenderBox::maxMarginBefore):
+ (WebCore::RenderBox::maxMarginAfter):
+ * rendering/RenderFlexibleBox.cpp:
+ (WebCore::RenderFlexibleBox::layoutBlock):
+
+2010-09-28 Kevin Ollivier <kevino@theolliviers.com>
+
+ [wx] wxMSW build fix. Don't use multiple inheritance in PopupMenuWx to avoid debug build
+ compiler error about ambiguity over which new override (wx's or FastAllocBase's) to use.
+
+ * platform/wx/PopupMenuWx.cpp:
+ (WebCore::PopupMenuEventHandler::PopupMenuEventHandler):
+ (WebCore::PopupMenuEventHandler::OnMenuItemSelected):
+ (WebCore::PopupMenuWx::PopupMenuWx):
+ (WebCore::PopupMenuWx::show):
+ * platform/wx/PopupMenuWx.h:
+
+2010-09-28 Xiaomei Ji <xji@chromium.org>
+
+ Reviewed by NOBODY (revert unsquashed git commits)
+
+ Revert change sets 68583 to 68590, which are un-squashed git-commits: Performance improvement for FontLinux regarding issue 46374.
+ https://bugs.webkit.org/show_bug.cgi?id=46374
+
+2010-09-28 Marc-Antoine Ruel <maruel@chromium.org>
+
+ Reviewed by Tony Chang.
+
+ Split webcore_html off webcore_remaining.
+
+ webcore_remaining is still too large for certain 32 bits toolsets.
+ https://bugs.webkit.org/show_bug.cgi?id=46445
+
+ * WebCore.gyp/WebCore.gyp:
+
+2010-09-28 Jia Pu <jpu@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ Delete and forward delete shouldn't start autocorrection panel timer.
+ https://bugs.webkit.org/show_bug.cgi?id=46679
+ <rdar://problem/8463917>
+
+ * editing/TypingCommand.cpp:
+ (WebCore::TypingCommand::markMisspellingsAfterTyping): Only start correction panel timer
+ when the editing command is InsertText.
+ (WebCore::TypingCommand::typingAddedToOpenCommand): Add an argument to pass in command type.
+
+ * editing/TypingCommand.h: Add an argument to typingAddedToOpenCommand().
+
+2010-09-28 Mihai Parparita <mihaip@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ No back/forward list entry added when submitting a form via an onclick handler inside a frame
+ https://bugs.webkit.org/show_bug.cgi?id=44140
+
+ Lock the back/forward list for JavaScript form submissions inside frames
+ only if they're not in response to user gestures.
+
+ Tests: fast/history/form-submit-in-frame-via-onclick.html
+ fast/history/form-submit-in-frame.html
+
+ * loader/RedirectScheduler.cpp:
+ (WebCore::RedirectScheduler::scheduleFormSubmission):
+
+2010-09-28 David Hyatt <hyatt@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Fix typo in previous checkin.
+
+ * rendering/RenderBlock.cpp:
+ (WebCore::RenderBlock::MarginInfo::MarginInfo):
+
+2010-09-28 Nat Duca <nduca@chromium.org>
+
+ Reviewed by James Robinson.
+
+ [chromium] invalidateRootLayerRect needs to schedule compositor
+ https://bugs.webkit.org/show_bug.cgi?id=46219
+
+ Update comments on LayerChromium commit/display functions to clarify
+ their limitations. Remove unused dirtying logic from
+ LayerRendererChromium.
+
+ * platform/graphics/chromium/LayerChromium.cpp:
+ (WebCore::LayerChromium::setNeedsCommit):
+ (WebCore::LayerChromium::setNeedsDisplay):
+ * platform/graphics/chromium/LayerRendererChromium.cpp:
+ (WebCore::LayerRendererChromium::LayerRendererChromium):
+ (WebCore::LayerRendererChromium::present):
+ * platform/graphics/chromium/LayerRendererChromium.h:
+
+2010-09-28 Jenn Braithwaite <jennb@chromium.org>
+
+ Reviewed by Dmitry Titov.
+
+ Added oldPage param to FrameLoaderClient::didTransferChildFrameToNewDocument.
+ https://bugs.webkit.org/show_bug.cgi?id=46663
+
+ No new tests. API addition only. Will be used in separate patch.
+
+ * loader/EmptyClients.h:
+ (WebCore::EmptyFrameLoaderClient::didTransferChildFrameToNewDocument):
+ * loader/FrameLoaderClient.h:
+ * page/Frame.cpp:
+ (WebCore::Frame::transferChildFrameToNewDocument):
+ Pass former page to didTransferChildFrameToNewDocument.
+
+2010-09-28 W. James MacLean <wjmaclean@chromium.org>
+
+ Reviewed by James Robinson.
+
+ Scaled Resized images are blurred when sent to Skia
+ https://bugs.webkit.org/show_bug.cgi?id=42370
+
+ This patch modifies ImageSkia.cpp to fix the calculation of resampled
+ bitmap sizes so as to include the transform matrix of the canvas.
+
+ Test: svg/custom/image-rescale.svg
+
+ * platform/graphics/skia/ImageSkia.cpp:
+ (WebCore::computeResamplingMode):
+ (WebCore::drawResampledBitmap):
+
+2010-09-28 James Robinson <jamesr@chromium.org>
+
+ [chromium] Decrease warning level on chromium linux temporarily. This is causing failures on some bots
+
+ * WebCore.gyp/WebCore.gyp:
+
+2010-09-27 James Robinson <jamesr@chromium.org>
+
+ Reviewed by Tony Chang.
+
+ [chromium] Increase warning level for chromium linux build
+ https://bugs.webkit.org/show_bug.cgi?id=46687
+
+ This sets the chromium_code gyp variable to 1 for the chromium
+ linux WebCore build and fixes the warnings that exposes. This
+ matches the chromium mac build's compiler settings more closely
+ and should cut down on the number of patches that break mac but
+ compile cleaning on linux.
+
+ * WebCore.gyp/WebCore.gyp:
+ * platform/chromium/ScrollbarThemeChromiumLinux.cpp:
+ (WebCore::ScrollbarThemeChromiumLinux::paintButton):
+ * platform/graphics/chromium/FontLinux.cpp:
+ (WebCore::TextRunWalker::nextScriptRun):
+ (WebCore::TextRunWalker::getTextRun):
+ (WebCore::TextRunWalker::getNormalizedTextRun):
+ (WebCore::TextRunWalker::setGlyphXPositions):
+ (WebCore::glyphIndexForXPositionInScriptRun):
+ (WebCore::Font::offsetForPositionForComplexText):
+ (WebCore::Font::selectionRectForComplexText):
+ * platform/graphics/chromium/HarfbuzzSkia.cpp:
+ (WebCore::getOutlinePoint):
+ * platform/graphics/chromium/LayerRendererChromium.cpp:
+ (WebCore::LayerRendererChromium::updateRootLayerTextureRect):
+ * platform/graphics/gpu/Texture.cpp:
+ (WebCore::copySubRect):
+ * platform/graphics/skia/PlatformContextSkia.cpp:
+ (WebCore::PlatformContextSkia::readbackHardwareToSoftware):
+ * platform/image-decoders/gif/GIFImageDecoder.cpp:
+ (WebCore::GIFImageDecoder::setSize):
+ * platform/image-decoders/gif/GIFImageDecoder.h:
+
+2010-09-28 Stephen White <senorblanco@chromium.org>
+
+ Reviewed by Csaba Osztrogonác.
+
+ Fix for r68521 to build on VS2008/Release.
+
+ * html/DocTypeStrings.gperf:
+ Don't emit "#include <string.h>" here, since we're inside a namespace.
+ * make-hash-tools.pl:
+ Emit #include <string.h> manually where required.
+ * platform/ColorData.gperf:
+ Don't emit "#include <string.h>" here, since we're inside a namespace.
+
+2010-09-28 David Hyatt <hyatt@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Right now we have two properties named margin-top-collapse and margin-after-collapse. They are proprietary and only used by Safari RSS.
+
+ I am adding margin-before-collapse and margin-after-collapse and just aliasing the old properties to the new ones.
+ This way we have some names that are directionally independent.
+
+ Note that these properties aren't like other directional properties. They are about what to do with the before side and after side of
+ your block's margins when collapsing with adjacent blocks. The meaning of before/after depend on the block-flow directionality
+ of the containing block.
+
+ Computed style tests all changed and the remove-shorthand.html test covers manipulation of the shorthand.
+
+ * css/CSSComputedStyleDeclaration.cpp:
+ (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
+ * css/CSSParser.cpp:
+ (WebCore::CSSParser::parseValue):
+ * css/CSSPropertyLonghand.cpp:
+ (WebCore::initShorthandMap):
+ * css/CSSPropertyNames.in:
+ * css/CSSStyleSelector.cpp:
+ (WebCore::CSSStyleSelector::applyProperty):
+ * rendering/RenderBlock.cpp:
+ (WebCore::RenderBlock::MarginInfo::MarginInfo):
+ (WebCore::RenderBlock::isSelfCollapsingBlock):
+ (WebCore::RenderBlock::collapseMargins):
+ (WebCore::RenderBlock::layoutBlockChild):
+ * rendering/style/RenderStyle.cpp:
+ (WebCore::RenderStyle::diff):
+ * rendering/style/RenderStyle.h:
+ (WebCore::InheritedFlags::marginBeforeCollapse):
+ (WebCore::InheritedFlags::marginAfterCollapse):
+ (WebCore::InheritedFlags::setMarginBeforeCollapse):
+ (WebCore::InheritedFlags::setMarginAfterCollapse):
+ (WebCore::InheritedFlags::initialMarginBeforeCollapse):
+ (WebCore::InheritedFlags::initialMarginAfterCollapse):
+ * rendering/style/StyleRareNonInheritedData.cpp:
+ (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
+ (WebCore::StyleRareNonInheritedData::operator==):
+ * rendering/style/StyleRareNonInheritedData.h:
+
+2010-09-28 Martin Robinson <mrobinson@igalia.com>
+
+ Reviewed by Gustavo Noronha Silva.
+
+ [Cairo] FreeType fonts should obey FontConfig hinting/anti-aliasing settings
+ https://bugs.webkit.org/show_bug.cgi?id=46740
+
+ When creating a font from a FontConfig pattern, use the FontConfig pattern's
+ hinting and anti-aliasing settings. This follows the Chromium Linux approach
+ of having FontConfig settings take precedence over GTK+ settings, as GTK+
+ settings cannot be configured per-font and per-font-size.
+
+ Test: platform/gtk/fonts/fontconfig-aliasing-settings.html
+
+ * platform/graphics/cairo/FontPlatformDataFreeType.cpp:
+ (WebCore::convertFontConfigSubpixelOrder): Added this helper which converts
+ the FontConfig subpixel order into the cairo equivalent.
+ (WebCore::convertFontConfigHintStyle): Added this helper which converts the
+ FontConfig hint style into the cairo equivalent.
+ (WebCore::setCairoFontOptionsFromFontConfigPattern): Added this helper which
+ reads the font rendering settings from a pattern and translates them into the
+ appropriate cairo_font_options_t settings.
+ (WebCore::FontPlatformData::FontPlatformData): When creating a font from a
+ FontConfig pattern use setCairoFontOptionsFromFontConfigPattern to get the
+ appropriate rendering options for the font.
+
+2010-09-28 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Darin Adler and Dave Hyatt.
+
+ Vertical scroll bar on apple.com is too short with WebKit2
+ <rdar://problem/8379230>
+ https://bugs.webkit.org/show_bug.cgi?id=46739
+
+ Adds a function to recalculate the scrollbars to take advantage of
+ a changed window re-sizer rect.
+
+ * WebCore.exp.in:
+ * platform/ScrollView.cpp:
+ (WebCore::ScrollView::windowResizerRectChanged):
+ * platform/ScrollView.h:
+
+2010-09-28 David Hyatt <hyatt@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ https://bugs.webkit.org/show_bug.cgi?id=46750
+
+ Rename the MarginInfo members and functions to be block-flow independent.
+
+ * rendering/RenderBlock.cpp:
+ (WebCore::RenderBlock::MarginInfo::MarginInfo):
+ (WebCore::RenderBlock::adjustPositionedBlock):
+ (WebCore::RenderBlock::adjustFloatingBlock):
+ (WebCore::RenderBlock::collapseMargins):
+ (WebCore::RenderBlock::clearFloatsIfNeeded):
+ (WebCore::RenderBlock::estimateVerticalPosition):
+ (WebCore::RenderBlock::setCollapsedBottomMargin):
+ (WebCore::RenderBlock::handleBottomOfBlock):
+ (WebCore::RenderBlock::layoutBlockChild):
+ (WebCore::RenderBlock::applyAfterBreak):
+ * rendering/RenderBlock.h:
+ (WebCore::RenderBlock::MarginInfo::setAtBeforeSideOfBlock):
+ (WebCore::RenderBlock::MarginInfo::setAtAfterSideOfBlock):
+ (WebCore::RenderBlock::MarginInfo::setMarginBeforeQuirk):
+ (WebCore::RenderBlock::MarginInfo::setMarginAfterQuirk):
+ (WebCore::RenderBlock::MarginInfo::setDeterminedMarginBeforeQuirk):
+ (WebCore::RenderBlock::MarginInfo::atBeforeSideOfBlock):
+ (WebCore::RenderBlock::MarginInfo::canCollapseWithMarginBefore):
+ (WebCore::RenderBlock::MarginInfo::canCollapseWithMarginAfter):
+ (WebCore::RenderBlock::MarginInfo::canCollapseMarginBeforeWithChildren):
+ (WebCore::RenderBlock::MarginInfo::canCollapseMarginAfterWithChildren):
+ (WebCore::RenderBlock::MarginInfo::determinedMarginBeforeQuirk):
+ (WebCore::RenderBlock::MarginInfo::marginBeforeQuirk):
+ (WebCore::RenderBlock::MarginInfo::marginAfterQuirk):
+
+2010-09-28 Dan Bernstein <mitz@apple.com>
+
+ Reviewed by Darin Adler.
+
+ Improved the handling of soft hyphens in Copy and Find operations, addressing the following
+ bugs:
+
+ <rdar://problem/7938878> Soft hyphenation and the clipboard
+ https://bugs.webkit.org/show_bug.cgi?id=11154
+
+ window.getSelection().toString() breaks soft hyphen &shy;
+ https://bugs.webkit.org/show_bug.cgi?id=26774
+
+ <rdar://problem/5640505> soft hyphen breaks search function
+ https://bugs.webkit.org/show_bug.cgi?id=16675
+
+ Test: fast/text/find-soft-hyphen.html
+
+ Changed line layout code to not skip over soft hyphens but rather include them in the text
+ boxes. Changed font code to render the soft hyphen character as a zero width space, so that
+ the former change will not affect rendering of soft hyphens in the middle of the line. Also
+ changed line layout code to mark text boxes where hyphenation occurred due to a soft hyphen
+ as hyphenated, so that the hyphen string specified in CSS will be appended to them.
+
+ Not omitting the soft hyphens from the text boxes makes the text iterator emit them, which
+ solves the Copy and plain-text conversion issues. Previously, the iterator would emit a space
+ to account for non-rendered characters between adjacent boxes, which was wrong in this case.
+
+ To make Find work, soft hyphens are folded into 0, which is ignorable in the collation used
+ for Find.
+
+ * editing/TextIterator.cpp:
+ (WebCore::foldQuoteMarkOrSoftHyphen): Renamed foldQuoteMark() to this and added folding of
+ soft hyphen to 0.
+ (WebCore::foldQuoteMarksAndSoftHyphens): Renamed foldQuoteMarks() to thid and added folding
+ of soft hyphen to 0.
+ (WebCore::SearchBuffer::SearchBuffer): Updated for renames.
+ (WebCore::SearchBuffer::append): Ditto.
+ * platform/graphics/Font.h:
+ (WebCore::Font::treatAsSpace): Replaced number literal with name.
+ (WebCore::Font::treatAsZeroWidthSpace): Added softHyphen.
+ * platform/graphics/GlyphPageTreeNode.cpp:
+ (WebCore::GlyphPageTreeNode::initializePage): Get the zero width space glyph for soft hyphen.
+ * platform/graphics/mac/ComplexTextController.cpp:
+ (WebCore::ComplexTextController::collectComplexTextRuns): Removed special handling that made
+ a trailing soft hyphen render as hyphen-minus. All soft hyphens are now rendered as zero width
+ spaces, and where a line break actually occurs at a soft hyphen, rendering code appends the
+ CSS-specified hyphenate character to the text run that is passed to us here.
+ * rendering/RenderBlockLineLayout.cpp:
+ (WebCore::chopMidpointsAt): Removed this function, which was only used for skipping over soft
+ hyphens.
+ (WebCore::checkMidpoints): Removed code related to skipping over soft hyphens.
+ (WebCore::RenderBlock::findNextLineBreak): Removed code to skip over soft hyphens. Ignore
+ a line break opportunity at a soft hyphen if the style specifies 'hyphens: none'. Set
+ 'hyphenated' to true if a line break occurs at a soft hyphen.
+ * rendering/style/RenderStyle.cpp:
+ (WebCore::RenderStyle::hyphenString): Changed the assertion to allow querying for the hyphen
+ string for 'hyphens: manual'.
+
+2010-09-28 Martin Robinson <mrobinson@igalia.com>
+
+ More GTK+ build fixes after r68521.
+
+ * GNUmakefile.am: Added proper dependency tracking for some
+ new autogenerated files.
+
+2010-09-28 Andreas Kling <andreas.kling@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Text drawing taints GraphicsContext's QPainter::pen()
+ https://bugs.webkit.org/show_bug.cgi?id=46744
+
+ Test: fast/canvas/canvas-style-intact-after-text.html
+
+ * platform/graphics/qt/FontQt.cpp:
+ (WebCore::drawTextCommon): Make sure the QPainter's pen is
+ restored after filling and/or stroking text.
+
+2010-09-28 Jia Pu <jpu@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ Autocorrection panel is shown at incorrect location when WebView is scrolled.
+ https://bugs.webkit.org/show_bug.cgi?id=46531
+ <rdar://problem/8455376>
+
+ * dom/Range.h: Make getBorderAndTextQuads() public so that it can be used by Editor.
+ * editing/Editor.cpp:
+ (WebCore::Editor::markAllMisspellingsAndBadGrammarInRanges): Replaced call to textQuads()
+ with getBorderAndTextQuads().
+
+2010-09-28 Andrei Popescu <andreip@google.com>
+
+ Reviewed by Jeremy Orlow.
+
+ IDBRequest should not have a method called abort.
+ https://bugs.webkit.org/show_bug.cgi?id=46720
+
+ IDBRequest::abort() was dropped from the spec following discussion in
+ http://www.w3.org/Bugs/Public/show_bug.cgi?id=10165
+
+ * storage/IDBRequest.cpp:
+ (WebCore::IDBRequest::IDBRequest):
+ (WebCore::IDBRequest::~IDBRequest):
+ (WebCore::IDBRequest::resetReadyState):
+ (WebCore::IDBRequest::timerFired):
+ (WebCore::IDBRequest::scheduleEvent):
+ * storage/IDBRequest.h:
+ * storage/IDBRequest.idl:
+
+2010-09-28 Chris Fleizach <cfleizach@apple.com>
+
+ Reviewed by Beth Dakin.
+
+ CrashTracer: 1,382 crashes in Safari at com.apple.WebCore: WebCore::VisiblePosition::canonicalPosition + 78
+ https://bugs.webkit.org/show_bug.cgi?id=45927
+
+ AXTextMarkers store pointers to Nodes without any retain or reference. If a Node is deallocated and then
+ a client tries to use a text marker that references that node, it leads to this crash.
+
+ The AXObjectCache instance now keeps a HashSet of Node's being used. When a node becomes deallocated, it removes itself
+ from the HashSet. When creating a VisiblePosition from an AXTextMarker, the cache can then check if the node is valid
+ before proceeding.
+
+ Test: platform/mac/accessibility/crash-invalid-text-marker-node.html
+
+ * accessibility/AXObjectCache.cpp:
+ (WebCore::AXObjectCache::visiblePositionForTextMarkerData):
+ (WebCore::AXObjectCache::textMarkerDataForVisiblePosition):
+ Modify to check whether a node is valid before proceeeding.
+ * accessibility/AXObjectCache.h:
+ (WebCore::AXObjectCache::setNodeInUse):
+ (WebCore::AXObjectCache::removeNodeForUse):
+ (WebCore::AXObjectCache::isNodeInUse):
+ Methods for managing whether a node is in use by text markers.
+ * accessibility/mac/AccessibilityObjectWrapper.mm:
+ (textMarkerForVisiblePosition):
+ (-[AccessibilityObjectWrapper textMarkerForVisiblePosition:]):
+ (visiblePositionForTextMarker):
+ (-[AccessibilityObjectWrapper visiblePositionForTextMarker:]):
+ (visiblePositionForStartOfTextMarkerRange):
+ (visiblePositionForEndOfTextMarkerRange):
+ (-[AccessibilityObjectWrapper doAXAttributedStringForTextMarkerRange:]):
+ (textMarkerRangeFromVisiblePositions):
+ (-[AccessibilityObjectWrapper textMarkerRangeFromVisiblePositions:endPosition:]):
+ (-[AccessibilityObjectWrapper visiblePositionRangeForTextMarkerRange:]):
+ (-[AccessibilityObjectWrapper textMarkerRangeForSelection]):
+ (-[AccessibilityObjectWrapper accessibilityAttributeValue:]):
+ (-[AccessibilityObjectWrapper doAXAttributedStringForRange:]):
+ (-[AccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
+ Change these calls so that the axObjectCache() can be passed in to create the visible position.
+ * dom/Document.cpp:
+ (WebCore::Document::axObjectCacheExists):
+ * dom/Document.h:
+ * dom/Node.cpp:
+ (WebCore::Node::~Node):
+ If accessibility is enabled, inform the axObjectCache() that this node is disappearing.
+
+2010-09-28 Chris Rogers <crogers@google.com>
+
+ Reviewed by Kenneth Russell.
+
+ Add AudioDestinationNode files
+ https://bugs.webkit.org/show_bug.cgi?id=45009
+
+ No new tests since audio API is not yet implemented.
+
+ * webaudio/AudioDestinationNode.cpp: Added.
+ (WebCore::AudioDestinationNode::AudioDestinationNode):
+ (WebCore::AudioDestinationNode::~AudioDestinationNode):
+ (WebCore::AudioDestinationNode::initialize):
+ (WebCore::AudioDestinationNode::uninitialize):
+ (WebCore::AudioDestinationNode::provideInput):
+ * webaudio/AudioDestinationNode.h: Added.
+ (WebCore::AudioDestinationNode::create):
+ (WebCore::AudioDestinationNode::process):
+ (WebCore::AudioDestinationNode::reset):
+ (WebCore::AudioDestinationNode::currentTime):
+ (WebCore::AudioDestinationNode::sampleRate):
+ (WebCore::AudioDestinationNode::numberOfChannels):
+ * webaudio/AudioDestinationNode.idl: Added.
+
+2010-09-28 Chris Rogers <crogers@google.com>
+
+ Reviewed by Kenneth Russell.
+
+ audio engine: audio output classes
+ https://bugs.webkit.org/show_bug.cgi?id=34716
+
+ No new tests since audio API is not yet implemented.
+
+ * platform/audio/AudioDestination.h: Added.
+ (WebCore::AudioDestination::~AudioDestination):
+ * platform/audio/mac/AudioDestinationMac.cpp: Added.
+ (WebCore::AudioDestination::create):
+ (WebCore::AudioDestination::hardwareSampleRate):
+ (WebCore::AudioDestinationMac::AudioDestinationMac):
+ (WebCore::AudioDestinationMac::~AudioDestinationMac):
+ (WebCore::AudioDestinationMac::configure):
+ (WebCore::AudioDestinationMac::start):
+ (WebCore::AudioDestinationMac::stop):
+ (WebCore::AudioDestinationMac::render):
+ (WebCore::AudioDestinationMac::inputProc):
+ * platform/audio/mac/AudioDestinationMac.h: Added.
+ (WebCore::AudioDestinationMac::isPlaying):
+ (WebCore::AudioDestinationMac::sampleRate):
+
+2010-09-28 Chris Rogers <crogers@google.com>
+
+ Reviewed by Kenneth Russell.
+
+ Add AudioGain files
+ https://bugs.webkit.org/show_bug.cgi?id=46285
+
+ No new tests since audio API is not yet implemented.
+
+ * webaudio/AudioGain.h: Added.
+ (WebCore::AudioGain::create):
+ (WebCore::AudioGain::AudioGain):
+ * webaudio/AudioGain.idl: Added.
+
+2010-09-28 Chris Rogers <crogers@google.com>
+
+ Reviewed by Kenneth Russell.
+
+ Fix possible illegal float values in AudioParam
+ https://bugs.webkit.org/show_bug.cgi?id=46681
+
+ No new tests since audio API is not yet implemented.
+
+ * webaudio/AudioParam.h:
+ (WebCore::AudioParam::setValue):
+
+2010-09-28 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Rename member variable in MediaPlayerPrivateQt
+
+ * platform/graphics/qt/MediaPlayerPrivateQt.cpp:
+ * platform/graphics/qt/MediaPlayerPrivateQt.h:
+
+2010-09-28 Andras Becsi <abecsi@webkit.org>
+
+ [Gtk] Build fix. Remove leftover trailing backslash.
+
+ * GNUmakefile.am:
+
+2010-09-28 Andras Becsi <abecsi@webkit.org>
+
+ Unreviewed.
+
+ [Gtk] Build fix after r68521
+
+ No new tests needed.
+
+ * GNUmakefile.am:
+
+2010-09-28 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
+
+ Reviewed by Andreas Kling.
+
+ [Qt] Rename MediaPlayerPrivate to MediaPlayerPrivateQt/Phonon
+
+ https://bugs.webkit.org/show_bug.cgi?id=36663
+
+ * platform/graphics/MediaPlayer.cpp:
+ * platform/graphics/qt/MediaPlayerPrivateQt.cpp:
+ * platform/graphics/qt/MediaPlayerPrivateQt.h:
+ * platform/graphics/qt/MediaPlayerPrivatePhonon.cpp:
+ * platform/graphics/qt/MediaPlayerPrivatePhonon.h:
+
+2010-09-28 Andras Becsi <abecsi@webkit.org>
+
+ Reviewed by Csaba Osztrogonác.
+
+ Undefined reference errors when linking due to gperf and inlining.
+ webkit.org/b/29244
+
+ EFL CMake changes by Leandro Pereira <leandro@profusion.mobi>
+
+ Refactor gperf code generation and usage to fix the debug build with gcc>4.4.
+ Hitherto gperf generated C code, these files were included in multiple C++ files across WebCore
+ to access the functionality provided. This resulted in debug build failure with newer gcc versions
+ because of a behaviour change of gcc, which disables C style inlining in debug mode.
+ The make-hash-tools.pl script lets gperf generate C++ code for all gperf files now, which are compiled
+ in their own compilation unit.
+ The functionality provided by the generated code is wrapped behind HashTools.h, so there is no need
+ for multiple inclusions of generated C files to access these functions.
+
+ No new tests needed.
+
+ * CMakeLists.txt:
+ * WebCore.gyp/WebCore.gyp:
+ * WebCore.pri:
+ * WebCore.vcproj/WebCore.vcproj:
+ * WebCore.xcodeproj/project.pbxproj:
+ * css/CSSParser.cpp:
+ * css/makeprop.pl:
+ * css/makevalues.pl:
+ * html/DocTypeStrings.gperf:
+ * html/HTMLDocument.cpp:
+ * make-hash-tools.pl:
+ * platform/ColorData.gperf:
+ * platform/graphics/Color.cpp:
+
+2010-09-28 Andreas Kling <andreas.kling@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Canvas: Crash when setting a font with size in 'ex' units
+ https://bugs.webkit.org/show_bug.cgi?id=46538
+
+ update() the style's font after setting the style's font description.
+ Needed because CSSPrimitiveValue::computeLengthDouble() later assumes
+ that the style's font is properly initialized (for xHeight().)
+
+ Fixes crash on IE test center's canvas-text-font-002 test.
+
+ * html/canvas/CanvasRenderingContext2D.cpp:
+ (WebCore::CanvasRenderingContext2D::setFont):
+
+2010-09-28 Benjamin Poulain <benjamin.poulain@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Remove support for Qt 4.5
+ https://bugs.webkit.org/show_bug.cgi?id=46718
+
+ Remove the code for versions of Qt prior to 4.6.
+
+ * WebCore.pro:
+ * features.pri:
+ * platform/network/qt/QNetworkReplyHandler.cpp:
+ (WebCore::QNetworkReplyHandler::QNetworkReplyHandler):
+ (WebCore::QNetworkReplyHandler::start):
+ * platform/network/qt/ResourceRequestQt.cpp:
+ (WebCore::ResourceRequest::toNetworkRequest):
+ * platform/qt/QWebPageClient.h:
+
+2010-09-28 Kent Tamura <tkent@chromium.org>
+
+ Unreviewed, run sort-Xcode-project-file
+
+ * WebCore.xcodeproj/project.pbxproj:
+
+2010-09-28 Huahui Wu <mediadependent@gmail.com>
+
+ Reviewed by Steve Block.
+
+ Add multi-touch for Android.
+ https://bugs.webkit.org/show_bug.cgi?id=45221
+
+ The Android touch event used to take one point as the touch point,
+ it's now changed to a vector of points to support multi-touch.
+
+ Tests: fast/events/touch/basic-multi-touch-events-limited.html
+ fast/events/touch/touch-target-limited.html
+
+ * platform/PlatformTouchEvent.h:
+ * platform/PlatformTouchPoint.h:
+ * platform/android/PlatformTouchEventAndroid.cpp:
+ (WebCore::PlatformTouchEvent::PlatformTouchEvent):
+ * platform/android/PlatformTouchPointAndroid.cpp:
+ (WebCore::PlatformTouchPoint::PlatformTouchPoint):
+
+2010-09-27 Kent Tamura <tkent@chromium.org>
+
+ Reviewed by Alexey Proskuryakov.
+
+ Fix assertion failure in a case that the dirty flag of a textarea element is changed
+ https://bugs.webkit.org/show_bug.cgi?id=45681
+
+ We need to call setNeedsValidityCheck() after updating m_isDirty.
+
+ Test: fast/forms/textarea-checkValidity-crash.html
+
+ * html/HTMLTextAreaElement.cpp:
+ (WebCore::HTMLTextAreaElement::setValue):
+ (WebCore::HTMLTextAreaElement::setNonDirtyValue):
+ (WebCore::HTMLTextAreaElement::setValueCommon):
+ * html/HTMLTextAreaElement.h:
+
+2010-09-27 Abhishek Arya <inferno@chromium.org>
+
+ Reviewed by Dan Bernstein.
+
+ When the block RunIn is destroyed, its line box tree is not deleted. As a result, it
+ gets later used during dirtying of inline text boxes step where this deleted parent is
+ accessed. The fix is to delete the line box tree before destroying the runin block.
+
+ https://bugs.webkit.org/show_bug.cgi?id=46376
+
+ Test: fast/text/dirty-inline-textbox-crash.html
+
+ * rendering/RenderText.cpp:
+ (WebCore::RenderText::dirtyLineBoxes):
+
+2010-09-27 Eric Uhrhane <ericu@chromium.org>
+
+ Reviewed by David Levin.
+
+ Fix event sequencing in FileWriter
+ https://bugs.webkit.org/show_bug.cgi?id=46544
+
+ Only set readyState to DONE when we're about to send the last progress
+ event associated with an operation. Make sure all progress events come
+ from backend calls, and aren't ever fired synchronously in response to
+ user JS method calls.
+
+ No new tests, as none of this is fully implemented yet.
+
+ * fileapi/FileWriter.cpp:
+ (WebCore::FileWriter::write):
+ (WebCore::FileWriter::truncate):
+ (WebCore::FileWriter::abort):
+ (WebCore::FileWriter::didWrite):
+ (WebCore::FileWriter::didTruncate):
+ (WebCore::FileWriter::didFail):
+
+2010-09-27 Chris Rogers <crogers@google.com>
+
+ Reviewed by James Robinson.
+
+ Add HRTFDatabase files
+ https://bugs.webkit.org/show_bug.cgi?id=46233
+
+ No new tests since audio API is not yet implemented.
+
+ * platform/audio/HRTFDatabase.cpp: Added.
+ (WebCore::HRTFDatabase::create):
+ (WebCore::HRTFDatabase::HRTFDatabase):
+ (WebCore::HRTFDatabase::getKernelsFromAzimuthElevation):
+ (WebCore::HRTFDatabase::indexFromElevationAngle):
+ * platform/audio/HRTFDatabase.h: Added.
+ (WebCore::HRTFDatabase::numberOfAzimuths):
+ (WebCore::HRTFDatabase::sampleRate):
+
+2010-09-27 Alpha Lam <hclam@chromium.org>
+
+ Build fix. Not reviewed.
+
+ Move constant definitions to VideoLayerChromium.cpp.
+ A proper fix should come later.
+
+ * platform/graphics/chromium/VideoLayerChromium.cpp:
+
+2010-09-23 Antonio Gomes <agomes@rim.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Make Document::nodesFromRect more flexible
+ https://bugs.webkit.org/show_bug.cgi?id=46336
+
+ The patch changes the API for the Document::nodesFromRect() method as follows:
+
+ from
+ - RefPtf<NodeList> nodesFromRect(int x, int y, unsigned horizontalPadding, unsigned verticalPadding, bool ignoreClipping)
+ to
+ - RefPtf<NodeList> nodesFromRect(int x, int y, unsigned topPadding, unsigned rightPadding, unsigned bottomPadding,
+ unsigned leftPadding, bool ignoreClipping)
+
+ Previously the method was receiving as parameter horizontal and vertical padding values.
+ In practice, the horizontal padding was being used to expand a given center point in both
+ right and left directions, while vertical padding was expanding it to the top and bottom directions.
+
+ Although this design makes it possible to improve the touch experience on mobile devices
+ (Document::nodesFromRect exposes the rect based hit testing system), empirical experiments
+ showed that, specially in capacitive touch screens, users tend to tap below elements. So
+ for even more accurate results (which means here the possibility of pleasant tapping experience),
+ it makes sense to use a region that is offset more above the touch point, favoring elements
+ above the touch point.
+
+ The patch basically implements that, increasing the API flexible and power by making it possible
+ to specify different padding values for each direction in a given orientation.
+
+ Changes were made accordingly to the HitTestResult, RenderLayer, RenderImage and RenderLineBoxList
+ classes.
+
+ WebCore:
+
+ * WebCore.exp.in:
+ * dom/Document.h: API adjustment.
+ * dom/Document.idl: Ditto.
+ * dom/Document.cpp: API adjustment and method body implementation accordingly.
+ (WebCore::Document::nodesFromRect):
+ * page/EventHandler.cpp:
+ (WebCore::EventHandler::hitTestResultAtPoint): For simplicity, I did not change the signature
+ but the way the padding value passed in as parameter is being used to construct a HitTestResult.
+ * rendering/HitTestResult.cpp: Changed the rect-based bits from using IntSize (padding) to separated paddings for each direction.
+ (WebCore::HitTestResult::HitTestResult): Ditto.
+ (WebCore::HitTestResult::operator=): Ditto.
+ (WebCore::HitTestResult::rectFromPoint): Ditto.
+ * rendering/HitTestResult.h:
+ (WebCore::HitTestResult::topPadding): getter for the top padding.
+ (WebCore::HitTestResult::rightPadding): getter for the right padding.
+ (WebCore::HitTestResult::bottomPadding): getter for the bottom padding.
+ (WebCore::HitTestResult::leftPadding): getter for the left padding.
+ (WebCore::HitTestResult::rectFromPoint): Added a static method that given a center point and padding values for each direction,
+ returns the rect that is going to be used in WebCore's hit testing processing.
+ * rendering/RenderImage.cpp: Changed the rect-based bits from using IntSize (padding) to separated paddings for each direction.
+ (WebCore::RenderImage::nodeAtPoint): Ditto.
+ * rendering/RenderLayer.cpp: Ditto.
+ (WebCore::RenderLayer::hitTestLayer): Ditto.
+ (WebCore::RenderLayer::hitTestList): Ditto.
+ * rendering/RenderLineBoxList.cpp: Ditto.
+ (WebCore::RenderLineBoxList::hitTest): Ditto.
+
+2010-09-27 Chris Rogers <crogers@google.com>
+
+ Reviewed by James Robinson.
+
+ Add HRTFDatabaseLoader files
+ https://bugs.webkit.org/show_bug.cgi?id=46234
+
+ No new tests since audio API is not yet implemented.
+
+ * platform/audio/HRTFDatabaseLoader.cpp: Added.
+ (WebCore::HRTFDatabaseLoader::createAndLoadAsynchronouslyIfNecessary):
+ (WebCore::HRTFDatabaseLoader::HRTFDatabaseLoader):
+ (WebCore::HRTFDatabaseLoader::~HRTFDatabaseLoader):
+ (WebCore::databaseLoaderEntry):
+ (WebCore::HRTFDatabaseLoader::load):
+ (WebCore::HRTFDatabaseLoader::loadAsynchronously):
+ (WebCore::HRTFDatabaseLoader::isLoaded):
+ (WebCore::HRTFDatabaseLoader::defaultHRTFDatabase):
+ * platform/audio/HRTFDatabaseLoader.h: Added.
+ (WebCore::HRTFDatabaseLoader::database):
+ (WebCore::HRTFDatabaseLoader::databaseSampleRate):
+
+2010-09-27 Ryosuke Niwa <rniwa@webkit.org>
+
+ Reviewed by Darin Adler.
+
+ queryCommandState with justifyCenter, justifyLeft, and justifyRight always return false
+ https://bugs.webkit.org/show_bug.cgi?id=45910
+
+ Implemented queryCommandState for justifyCenter, justifyLeft, and justifyRight commands.
+ Added getTextAlignment to convert -webkit-center, -webkit-left, and -webkit-right to
+ center, left, and right respectively because they can be treated equally for editing purposes.
+
+ Test: editing/execCommand/query-text-alignment.html
+
+ * editing/ApplyStyleCommand.cpp:
+ (WebCore::getTextAlignment): Added.
+ (WebCore::getPropertiesNotIn): Uses getTextAlignment.
+ * editing/EditorCommand.cpp:
+ (WebCore::stateJustifyCenter): Added.
+ (WebCore::stateJustifyLeft): Added.
+ (WebCore::stateJustifyRight): Added.
+ (WebCore::createCommandMap): Refers to stateJustifyCenter, stateJustifyLeft, and stateJustifyRight.
+
+2010-09-27 Alpha Lam <hclam@chromium.org>
+
+ Unreviewed. Build fix.
+
+ Reorder member declarations and fix other warnings.
+
+ * platform/graphics/chromium/VideoLayerChromium.cpp:
+ (WebCore::VideoLayerChromium::VideoLayerChromium):
+ (WebCore::VideoLayerChromium::~VideoLayerChromium):
+ (WebCore::VideoLayerChromium::updateContents):
+ (WebCore::VideoLayerChromium::determineTextureFormat):
+ (WebCore::VideoLayerChromium::allocateTexturesIfNeeded):
+ * platform/graphics/chromium/VideoLayerChromium.h:
+
+2010-09-27 Kenneth Russell <kbr@google.com>
+
+ Unreviewed, Qt build fix. Stub out CanvasRenderingContext::checkOrigin(const HTMLVideoElement*)
+ on platforms that don't support video after r68460.
+
+ * html/canvas/CanvasRenderingContext.cpp:
+ (WebCore::CanvasRenderingContext::checkOrigin):
+
+2010-09-27 Chris Fleizach <cfleizach@apple.com>
+
+ Reviewed by Beth Dakin.
+
+ CrashTracer: 1,803 crashes in Safari at com.apple.WebCore: -[AccessibilityObjectWrapper accessibilityIsIgnored] + 56
+ https://bugs.webkit.org/show_bug.cgi?id=46662
+
+ Before calling updateBackingStore(), the wrapper object needs to be retained, lest it be invalidated during
+ the updateBackingStore call. This consolidates all calls to updateBackingStore().
+
+ Test: platform/mac/accessibility/removing-textarea-after-edit-crash.html
+
+ * accessibility/mac/AXObjectCacheMac.mm:
+ (WebCore::AXObjectCache::postPlatformNotification):
+ Use an ASSERT here to catch the crash because DRT won't cause AppKit to post notifications.
+ * accessibility/mac/AccessibilityObjectWrapper.mm:
+ (-[AccessibilityObjectWrapper prepareAccessibilityMethod]):
+ (-[AccessibilityObjectWrapper accessibilityActionNames]):
+ (-[AccessibilityObjectWrapper accessibilityAttributeNames]):
+ (-[AccessibilityObjectWrapper accessibilityAttributeValue:]):
+ (-[AccessibilityObjectWrapper accessibilityFocusedUIElement]):
+ (-[AccessibilityObjectWrapper accessibilityHitTest:]):
+ (-[AccessibilityObjectWrapper accessibilityIsAttributeSettable:]):
+ (-[AccessibilityObjectWrapper accessibilityIsIgnored]):
+ (-[AccessibilityObjectWrapper accessibilityParameterizedAttributeNames]):
+ (-[AccessibilityObjectWrapper accessibilityPerformPressAction]):
+ (-[AccessibilityObjectWrapper accessibilityPerformIncrementAction]):
+ (-[AccessibilityObjectWrapper accessibilityPerformDecrementAction]):
+ (-[AccessibilityObjectWrapper accessibilityPerformAction:]):
+ (-[AccessibilityObjectWrapper accessibilitySetValue:forAttribute:]):
+ (-[AccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
+ (-[AccessibilityObjectWrapper accessibilityIndexOfChild:]):
+ (-[AccessibilityObjectWrapper accessibilityArrayAttributeCount:]):
+ (-[AccessibilityObjectWrapper accessibilityArrayAttributeValues:index:maxCount:]):
+
+2010-09-27 Adrienne Walker <enne@google.com>
+
+ Reviewed by Adam Barth.
+
+ WebGL's readPixels doesn't respect origin-clean flag
+
+ Push CanvasRenderingContext2D checkOrigin logic into base class so it can be shared between different kinds of canvas contexts.
+ https://bugs.webkit.org/show_bug.cgi?id=45718
+
+ Test: LayoutTests/http/tests/canvas/webgl/origin-clean-conformance.html
+
+ * html/canvas/CanvasRenderingContext.cpp:
+ (WebCore::CanvasRenderingContext::checkOrigin):
+ * html/canvas/CanvasRenderingContext.h:
+ (WebCore::CanvasRenderingContext::~CanvasRenderingContext):
+ (WebCore::CanvasRenderingContext::canvas):
+ (WebCore::CanvasRenderingContext::is2d):
+ (WebCore::CanvasRenderingContext::is3d):
+ (WebCore::CanvasRenderingContext::isAccelerated):
+ (WebCore::CanvasRenderingContext::paintRenderingResultsToCanvas):
+ (WebCore::CanvasRenderingContext::paintsIntoCanvasBuffer):
+ (WebCore::CanvasRenderingContext::platformLayer):
+ * html/canvas/CanvasRenderingContext2D.cpp:
+ (WebCore::CanvasRenderingContext2D::setStrokeStyle):
+ (WebCore::CanvasRenderingContext2D::setFillStyle):
+ (WebCore::CanvasRenderingContext2D::drawImage):
+ (WebCore::CanvasRenderingContext2D::drawImageFromRect):
+ * html/canvas/CanvasRenderingContext2D.h:
+ * html/canvas/WebGLRenderingContext.cpp:
+ (WebCore::WebGLRenderingContext::readPixels):
+ (WebCore::WebGLRenderingContext::texImage2D):
+ (WebCore::WebGLRenderingContext::videoFrameToImage):
+ (WebCore::WebGLRenderingContext::texSubImage2D):
+ * html/canvas/WebGLRenderingContext.h:
+ * html/canvas/WebGLRenderingContext.idl:
+
+2010-09-27 Darin Adler <darin@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ REGRESSION (r68054): Buttons no longer render at correct sizes
+ https://bugs.webkit.org/show_bug.cgi?id=46513
+
+ Test: fast/forms/input-button-sizes.html
+
+ The setUpButtonCell function was running only once, but needed to run every time
+ through the button function.
+
+ * platform/mac/ThemeMac.mm:
+ (WebCore::leakButtonCell): Added. Separate one-time initialization code.
+ (WebCore::setUpButtonCell): Removed the first-time initialization part of this function.
+ (WebCore::button): Merged the three functions back into one.
+
+2010-09-27 Victoria Kirst <vrk@google.com>
+
+ Reviewed by James Robinson.
+
+ Modifies VideoLayerChromium to do YUV to RGB color conversion in the
+ GPU. Also adds support for RGBA video frame formats, though this code
+ path is currently never run because the video frames are in YV12
+ format.
+ https://bugs.webkit.org/show_bug.cgi?id=45069
+
+ * platform/graphics/chromium/LayerRendererChromium.cpp:
+ (WebCore::LayerRendererChromium::initializeSharedObjects):
+ (WebCore::LayerRendererChromium::cleanupSharedObjects):
+ * platform/graphics/chromium/LayerRendererChromium.h:
+ (WebCore::LayerRendererChromium::videoLayerSharedValues):
+ * platform/graphics/chromium/VideoLayerChromium.cpp:
+ (WebCore::VideoLayerChromium::SharedValues::SharedValues):
+ (WebCore::VideoLayerChromium::SharedValues::~SharedValues):
+ (WebCore::VideoLayerChromium::VideoLayerChromium):
+ (WebCore::VideoLayerChromium::~VideoLayerChromium):
+ (WebCore::VideoLayerChromium::updateContents):
+ (WebCore::VideoLayerChromium::updateYUVContents):
+ (WebCore::VideoLayerChromium::allocateYUVTextures):
+ (WebCore::VideoLayerChromium::updateYUVTextures):
+ (WebCore::VideoLayerChromium::updateRGBAContents):
+ (WebCore::VideoLayerChromium::allocateTexture):
+ (WebCore::VideoLayerChromium::updateTexture):
+ (WebCore::VideoLayerChromium::updateContentsCompleted):
+ (WebCore::VideoLayerChromium::draw):
+ (WebCore::VideoLayerChromium::drawYUV):
+ (WebCore::VideoLayerChromium::drawRGBA):
+ * platform/graphics/chromium/VideoLayerChromium.h:
+ (WebCore::VideoLayerChromium::drawsContent):
+ (WebCore::VideoLayerChromium::SharedValues::yuvShaderProgram):
+ (WebCore::VideoLayerChromium::SharedValues::rgbaShaderProgram):
+ (WebCore::VideoLayerChromium::SharedValues::yuvShaderMatrixLocation):
+ (WebCore::VideoLayerChromium::SharedValues::rgbaShaderMatrixLocation):
+ (WebCore::VideoLayerChromium::SharedValues::yuvWidthScaleFactorLocation):
+ (WebCore::VideoLayerChromium::SharedValues::rgbaWidthScaleFactorLocation):
+ (WebCore::VideoLayerChromium::SharedValues::yTextureLocation):
+ (WebCore::VideoLayerChromium::SharedValues::uTextureLocation):
+ (WebCore::VideoLayerChromium::SharedValues::vTextureLocation):
+ (WebCore::VideoLayerChromium::SharedValues::yuvAlphaLocation):
+ (WebCore::VideoLayerChromium::SharedValues::rgbaTextureLocation):
+ (WebCore::VideoLayerChromium::SharedValues::ccMatrixLocation):
+ (WebCore::VideoLayerChromium::SharedValues::initialized):
+
+2010-09-27 Peter Kasting <pkasting@google.com>
+
+ Reviewed by James Robinson.
+
+ ImageDecoderSkia.cpp needs to check for allocator failure when copying
+ bitmaps.
+ https://bugs.webkit.org/show_bug.cgi?id=46437
+
+ * manual-tests/large-size-image-crash.html: Added.
+ * manual-tests/resources/large-size-image-crash.gif: Added.
+ * platform/image-decoders/ImageDecoder.cpp:
+ (WebCore::RGBA32Buffer::copyBitmapData):
+ * platform/image-decoders/ImageDecoder.h:
+ * platform/image-decoders/gif/GIFImageDecoder.cpp:
+ (WebCore::GIFImageDecoder::initFrameBuffer):
+ * platform/image-decoders/qt/RGBA32BufferQt.cpp:
+ (WebCore::RGBA32Buffer::copyBitmapData):
+ * platform/image-decoders/skia/ImageDecoderSkia.cpp:
+ (WebCore::RGBA32Buffer::copyBitmapData):
+
+2010-09-27 James Robinson <jamesr@chromium.org>
+
+ Reviewed by Simon Fraser.
+
+ Revert r63307, it broke repainting dynamically changed SVG content
+ https://bugs.webkit.org/show_bug.cgi?id=46499
+
+ This patch reverts r63307 and adds a regression test for what broke.
+
+ Test: fast/repaint/repaint-svg-after-style-change.html
+
+ * rendering/RenderForeignObject.cpp:
+ (WebCore::RenderForeignObject::layout):
+ * rendering/RenderPath.cpp:
+ (WebCore::RenderPath::layout):
+ * rendering/RenderSVGContainer.cpp:
+ (WebCore::RenderSVGContainer::layout):
+ * rendering/RenderSVGImage.cpp:
+ (WebCore::RenderSVGImage::layout):
+ * rendering/RenderSVGRoot.cpp:
+ (WebCore::RenderSVGRoot::layout):
+ * rendering/RenderSVGText.cpp:
+ (WebCore::RenderSVGText::layout):
+
+2010-09-27 Vangelis Kokkevis <vangelis@chromium.org>
+
+ Reviewed by James Robinson.
+
+ [chromium] Making LayerChromium's destructor virtual so that the appropriate
+ derived class destructors get called when the layer tree is taken down.
+ ContentLayerChromium and its derived types (ImageLayerChromium for now) will
+ free up the texture allocated for their contents upon destruction. To avoid
+ having the LayerRendererChromium destructor getting called before the layers
+ are destroyed and thus leaving their textures orphaned, the layers now hold
+ a ref counted pointer to the renderer that uses them.
+ https://bugs.webkit.org/show_bug.cgi?id=46139
+
+ * platform/graphics/chromium/ContentLayerChromium.cpp:
+ (WebCore::ContentLayerChromium::~ContentLayerChromium):
+ (WebCore::ContentLayerChromium::setLayerRenderer):
+ (WebCore::ContentLayerChromium::cleanupResources):
+ * platform/graphics/chromium/ContentLayerChromium.h:
+ * platform/graphics/chromium/LayerChromium.cpp:
+ (WebCore::LayerChromium::setLayerRenderer):
+ * platform/graphics/chromium/LayerChromium.h:
+ (WebCore::LayerChromium::layerRenderer):
+ * platform/graphics/chromium/LayerRendererChromium.cpp:
+ (WebCore::LayerRendererChromium::create):
+ (WebCore::LayerRendererChromium::deleteLayerTexture):
+ (WebCore::LayerRendererChromium::cleanupSharedObjects):
+ * platform/graphics/chromium/LayerRendererChromium.h:
+
+2010-09-27 Erik Arvidsson <arv@chromium.org>
+
+ Reviewed by Darin Adler.
+
+ Implement HTML 5's HTMLElement.classList property
+ https://bugs.webkit.org/show_bug.cgi?id=20709
+
+ This adds a DOMTokenList class that is used for the classList property. DOMTokenList uses a SpaceSplitString for fast
+ contains check. In standards mode the existing classNames is used but in quirks mode we use an internal SpaceSplitString
+ because classList is always case sensitive.
+
+ Tests: fast/dom/HTMLElement/class-list-gc.html
+ fast/dom/HTMLElement/class-list-quirks.html
+ fast/dom/HTMLElement/class-list.html
+ perf/class-list-remove.html
+
+ * Android.derived.jscbindings.mk:
+ * Android.derived.v8bindings.mk:
+ * Android.jscbindings.mk:
+ * CMakeLists.txt:
+ * DerivedSources.cpp:
+ * DerivedSources.make:
+ * GNUmakefile.am:
+ * WebCore.gypi:
+ * WebCore.pri:
+ * WebCore.pro:
+ * WebCore.vcproj/WebCore.vcproj:
+ * WebCore.xcodeproj/project.pbxproj:
+ * bindings/gobject/GNUmakefile.am:
+ * bindings/js/JSElementCustom.cpp:
+ (WebCore::JSElement::markChildren): Make sure that we keep the wrapper while the element is alive.
+ * bindings/scripts/CodeGeneratorJS.pm: DOMTokenList has a string indexed getter.
+ * bindings/scripts/CodeGeneratorV8.pm:
+ * bindings/v8/custom/V8DOMTokenListCustom.cpp: Added.
+ (WebCore::toV8):
+ * dom/Element.cpp:
+ (WebCore::Element::classList):
+ (WebCore::Element::optionalClassList):
+ * dom/Element.h:
+ * dom/ElementRareData.h: This now has an OwnPtr to a ClassList if the Element::classList is ever called.
+ * dom/SpaceSplitString.h:
+ (WebCore::SpaceSplitString::isNull):
+ * dom/StyledElement.cpp:
+ (WebCore::StyledElement::classAttributeChanged): Update the classList if it exists.
+ * dom/StyledElement.h:
+ * html/DOMTokenList.cpp: Added.
+ (WebCore::validateToken):
+ (WebCore::DOMTokenList::DOMTokenList):
+ (WebCore::DOMTokenList::ref):
+ (WebCore::DOMTokenList::deref):
+ (WebCore::DOMTokenList::length):
+ (WebCore::DOMTokenList::item):
+ (WebCore::DOMTokenList::contains):
+ (WebCore::DOMTokenList::containsInternal): The internal methods do no validation of the token.
+ (WebCore::DOMTokenList::add):
+ (WebCore::DOMTokenList::addInternal):
+ (WebCore::DOMTokenList::remove):
+ (WebCore::DOMTokenList::removeInternal):
+ (WebCore::DOMTokenList::toggle):
+ (WebCore::DOMTokenList::toString):
+ (WebCore::DOMTokenList::reset):
+ (WebCore::DOMTokenList::classNames):
+ * html/DOMTokenList.h: Added.
+ (WebCore::DOMTokenList::create):
+ (WebCore::DOMTokenList::element):
+ * html/DOMTokenList.idl: Added.
+ * html/HTMLElement.idl:
+ * page/DOMWindow.cpp:
+ * page/DOMWindow.idl:
+
+2010-09-27 Kenneth Russell <kbr@google.com>
+
+ Reviewed by James Robinson.
+
+ Add local triangulation of cubic curve control points
+ https://bugs.webkit.org/show_bug.cgi?id=45252
+
+ (Re-landing; I neglected to actually add the new files in
+ http://trac.webkit.org/changeset/68045 .)
+
+ Adding a localized triangulation algorithm which takes as input
+ the four control points of a cubic curve segment and provides both
+ triangles as well as the ability to walk the interior edges. The
+ latter will be used later to fill the interior of shapes bounded
+ by these cubic curves, quadratic curves and line segments.
+
+ * platform/graphics/gpu/LoopBlinnLocalTriangulator.cpp: Added.
+ (WebCore::LoopBlinnLocalTriangulator::Triangle::contains):
+ (WebCore::LoopBlinnLocalTriangulator::Triangle::nextVertex):
+ (WebCore::LoopBlinnLocalTriangulator::Triangle::indexForVertex):
+ (WebCore::LoopBlinnLocalTriangulator::Triangle::makeCounterClockwise):
+ (WebCore::LoopBlinnLocalTriangulator::LoopBlinnLocalTriangulator):
+ (WebCore::LoopBlinnLocalTriangulator::reset):
+ (WebCore::LoopBlinnLocalTriangulator::triangulate):
+ (WebCore::LoopBlinnLocalTriangulator::triangulateHelper):
+ (WebCore::LoopBlinnLocalTriangulator::addTriangle):
+ (WebCore::LoopBlinnLocalTriangulator::addInteriorVertex):
+ (WebCore::LoopBlinnLocalTriangulator::isSharedEdge):
+ * platform/graphics/gpu/LoopBlinnLocalTriangulator.h: Added.
+ (WebCore::LoopBlinnLocalTriangulator::Vertex::Vertex):
+ (WebCore::LoopBlinnLocalTriangulator::Vertex::xyCoordinates):
+ (WebCore::LoopBlinnLocalTriangulator::Vertex::klmCoordinates):
+ (WebCore::LoopBlinnLocalTriangulator::Vertex::set):
+ (WebCore::LoopBlinnLocalTriangulator::Vertex::end):
+ (WebCore::LoopBlinnLocalTriangulator::Vertex::setEnd):
+ (WebCore::LoopBlinnLocalTriangulator::Vertex::marked):
+ (WebCore::LoopBlinnLocalTriangulator::Vertex::setMarked):
+ (WebCore::LoopBlinnLocalTriangulator::Vertex::interior):
+ (WebCore::LoopBlinnLocalTriangulator::Vertex::setInterior):
+ (WebCore::LoopBlinnLocalTriangulator::Vertex::resetFlags):
+ (WebCore::LoopBlinnLocalTriangulator::Triangle::Triangle):
+ (WebCore::LoopBlinnLocalTriangulator::Triangle::getVertex):
+ (WebCore::LoopBlinnLocalTriangulator::Triangle::setVertices):
+ (WebCore::LoopBlinnLocalTriangulator::getVertex):
+ (WebCore::LoopBlinnLocalTriangulator::numberOfTriangles):
+ (WebCore::LoopBlinnLocalTriangulator::getTriangle):
+ (WebCore::LoopBlinnLocalTriangulator::numberOfInteriorVertices):
+ (WebCore::LoopBlinnLocalTriangulator::getInteriorVertex):
+
+2010-09-27 Chris Rogers <crogers@google.com>
+
+ Reviewed by Kenneth Russell.
+
+ Add AudioNode files
+ https://bugs.webkit.org/show_bug.cgi?id=45571
+
+ No new tests since audio API is not yet implemented.
+
+ * webaudio/AudioNode.cpp: Added.
+ (WebCore::AudioNode::AudioNode):
+ (WebCore::AudioNode::~AudioNode):
+ (WebCore::AudioNode::setType):
+ (WebCore::AudioNode::lazyInitialize):
+ (WebCore::AudioNode::addInput):
+ (WebCore::AudioNode::addOutput):
+ (WebCore::AudioNode::input):
+ (WebCore::AudioNode::output):
+ (WebCore::AudioNode::connect):
+ (WebCore::AudioNode::disconnect):
+ (WebCore::AudioNode::processIfNecessary):
+ (WebCore::AudioNode::pullInputs):
+ (WebCore::AudioNode::ref):
+ (WebCore::AudioNode::deref):
+ (WebCore::AudioNode::finishDeref):
+ (WebCore::AudioNode::printNodeCounts):
+ * webaudio/AudioNode.h: Added.
+ (WebCore::AudioNode::context):
+ (WebCore::AudioNode::type):
+ (WebCore::AudioNode::isInitialized):
+ (WebCore::AudioNode::numberOfInputs):
+ (WebCore::AudioNode::numberOfOutputs):
+ (WebCore::AudioNode::sampleRate):
+ (WebCore::AudioNode::checkNumberOfChannelsForInput):
+ * webaudio/AudioNode.idl: Added.
+
+2010-09-27 David Hyatt <hyatt@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ https://bugs.webkit.org/show_bug.cgi?id=46665
+
+ Patch RenderView's layout and computeLogicalWidth/Height methods to be block-flow-aware.
+
+ Added fast/root-lr-basic.html
+
+ * rendering/RenderView.cpp:
+ (WebCore::RenderView::computeLogicalHeight):
+ (WebCore::RenderView::computeLogicalWidth):
+ (WebCore::RenderView::layout):
+ * rendering/RenderView.h:
+ (WebCore::RenderView::viewLogicalWidth):
+ (WebCore::RenderView::viewLogicalHeight):
+
+2010-09-24 Zhenyao Mo <zmo@google.com>
+
+ Reviewed by Kenneth Russell.
+
+ Hook up ANGLE with chromium --in-process-webgl port
+ https://bugs.webkit.org/show_bug.cgi?id=44309
+
+ * platform/graphics/GraphicsContext3D.h: Move Angle stuff inside MAC only section.
+
+2010-09-27 David Hyatt <hyatt@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ https://bugs.webkit.org/show_bug.cgi?id=46659
+
+ Patch the width/height/x/y calls in layoutBlock() to be their logical equivalents instead.
+
+ * rendering/RenderBlock.cpp:
+ (WebCore::RenderBlock::layoutBlock):
+
+2010-09-27 David Hyatt <hyatt@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ https://bugs.webkit.org/show_bug.cgi?id=46649, fix failing layout tests.
+
+ The implementation of setting the before/after margins was wrong and poking the wrong margin values.
+
+ Once I made them set the correct values, it revealed that one of the new block flow tests wasn't
+ actually working. In order to fix it, I had to make the block direction margin computation actually
+ use the containing block's block-flow in order to return the right answer. This involved cleaning
+ up computeBlockDirectionMargins to be more like computeInlineDirectionMargins.
+
+ fast/css/logical-property-resolution.html also caught the bug. Its results are now correct.
+
+ * rendering/RenderBlock.cpp:
+ (WebCore::RenderBlock::adjustPositionedBlock):
+ (WebCore::RenderBlock::determineHorizontalPosition):
+ (WebCore::RenderBlock::layoutBlockChild):
+ (WebCore::RenderBlock::insertFloatingObject):
+ * rendering/RenderBox.cpp:
+ (WebCore::RenderBox::setMarginBeforeUsing):
+ (WebCore::RenderBox::setMarginAfterUsing):
+ (WebCore::RenderBox::computeLogicalWidth):
+ (WebCore::RenderBox::computeInlineDirectionMargins):
+ (WebCore::RenderBox::computeLogicalHeight):
+ (WebCore::RenderBox::computeBlockDirectionMargins):
+ * rendering/RenderBox.h:
+ * rendering/RenderFlexibleBox.cpp:
+ (WebCore::RenderFlexibleBox::layoutHorizontalBox):
+ (WebCore::RenderFlexibleBox::layoutVerticalBox):
+ * rendering/RenderObject.h:
+ * rendering/RenderTable.cpp:
+ (WebCore::RenderTable::computeLogicalWidth):
+ * rendering/RenderTableRow.cpp:
+ (WebCore::RenderTableRow::layout):
+ * rendering/style/RenderStyle.cpp:
+ (WebCore::RenderStyle::marginBeforeUsing):
+ (WebCore::RenderStyle::marginAfterUsing):
+ * rendering/style/RenderStyle.h:
+
+2010-09-14 Zhenyao Mo <zmo@google.com>
+
+ Reviewed by Kenneth Russell.
+
+ Textures and renderbuffers should be detached first before deletion if they are attached to framebuffers
+ https://bugs.webkit.org/show_bug.cgi?id=43942
+
+ Test: fast/canvas/webgl/object-deletion-behaviour.html
+
+ * html/canvas/WebGLBuffer.cpp:
+ (WebCore::WebGLBuffer::deleteObjectImpl): Delete the object only once.
+ * html/canvas/WebGLFramebuffer.cpp: Use RefPtr for attachment WebGLObjects.
+ (WebCore::WebGLFramebuffer::WebGLFramebuffer):
+ (WebCore::WebGLFramebuffer::removeAttachment): Remove an attachment data ref.
+ (WebCore::WebGLFramebuffer::onAttachedObjectChange):
+ (WebCore::WebGLFramebuffer::getColorBufferFormat):
+ (WebCore::WebGLFramebuffer::deleteObjectImpl):
+ (WebCore::WebGLFramebuffer::initializeRenderbuffers):
+ * html/canvas/WebGLFramebuffer.h: Declare removeAttachment().
+ * html/canvas/WebGLObject.cpp:
+ (WebCore::WebGLObject::setObject): Make it protected and can only be called when initializing.
+ * html/canvas/WebGLObject.h:
+ (WebCore::WebGLObject::onDetached): Fix a bug.
+ (WebCore::WebGLObject::isDeleted): Expose the delete flag.
+ * html/canvas/WebGLProgram.cpp:
+ (WebCore::WebGLProgram::deleteObjectImpl): Detach shaders when deleting a program.
+ * html/canvas/WebGLRenderbuffer.cpp:
+ (WebCore::WebGLRenderbuffer::deleteObjectImpl): Delete the object only once.
+ * html/canvas/WebGLRenderingContext.cpp:
+ (WebCore::WebGLRenderingContext::deleteFramebuffer): Bind to internal fbo when deleting the currently-bound fbo.
+ (WebCore::WebGLRenderingContext::deleteRenderbuffer): Remove renderbuffer from currently-bound fbo upon deletion.
+ (WebCore::WebGLRenderingContext::deleteTexture): Remove texture from currently-bound fbo upon deletion.
+ (WebCore::WebGLRenderingContext::useProgram): Fix a condition.
+ * html/canvas/WebGLShader.cpp:
+ (WebCore::WebGLShader::deleteObjectImpl): Delete the object only once.
+ * html/canvas/WebGLTexture.cpp:
+ (WebCore::WebGLTexture::deleteObjectImpl): Ditto.
+
+2010-09-27 Ryosuke Niwa <rniwa@webkit.org>
+
+ Reviewed by Antonio Gomes.
+
+ stateStyle (@EditorCommand.cpp) should ask EditingBehavior for platform specific behavior
+ https://bugs.webkit.org/show_bug.cgi?id=41989
+
+ queryCommandState returns true even when in the mixed state
+ https://bugs.webkit.org/show_bug.cgi?id=46382
+
+ Fixed stateStyle so that it calls selectionStartHasStyle when shouldToggleStyleBasedOnStartOfSelection
+ is true (Mac platforms) and calls selectionHasStyle otherwise (non-Mac platforms).
+
+ Also fixed queryCommandState so that it only returns true when the state is TrueTriState
+ as supposed to returning true whenever the state is not FalseTriState. New behavior matches that of
+ other browsers such as Firefox and Internet Explorer.
+
+ * dom/Document.cpp:
+ (WebCore::Document::queryCommandState):
+ * editing/EditorCommand.cpp:
+ (WebCore::executeToggleStyle):
+ (WebCore::stateStyle):
+
+2010-09-27 David Hyatt <hyatt@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ https://bugs.webkit.org/show_bug.cgi?id=46647, add getters/setters for the logical position of a box.
+
+ Also made all of the logicalWidth/Height getters/setters inline for performance.
+
+ * rendering/RenderBox.cpp:
+ * rendering/RenderBox.h:
+ (WebCore::RenderBox::logicalLeft):
+ (WebCore::RenderBox::logicalTop):
+ (WebCore::RenderBox::logicalWidth):
+ (WebCore::RenderBox::logicalHeight):
+ (WebCore::RenderBox::setLogicalLeft):
+ (WebCore::RenderBox::setLogicalTop):
+ (WebCore::RenderBox::setLogicalWidth):
+ (WebCore::RenderBox::setLogicalHeight):
+ (WebCore::RenderBox::setLogicalLocation):
+
+2010-09-27 David Hyatt <hyatt@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ https://bugs.webkit.org/show_bug.cgi?id=46639, make computeLogicalHeight block-flow-aware.
+
+ This patch does the following:
+ (1) Makes computeLogicalHeight block-flow-aware (patching all helper functions as needed to make this work).
+ (2) Makes block flow roots (blocks whose parent has a different block-flow directionality) establish new block formatting contexts.
+ (This causes them to not collapse their margins with their children and to avoid floats).
+ (3) Patch all occurrences of setHeight in block and line layout to setLogicalHeight so that height doesn't get incorrectly
+ overwritten for lr/rl block-flow. This is necessary to write tests that examine the width/height of the blocks.
+
+ Added multiple new tests in fast/blockflow.
+ fast/css/logical-property-resolution gives the correct results now.
+
+ * rendering/RenderBlock.cpp:
+ (WebCore::RenderBlock::MarginInfo::MarginInfo):
+ (WebCore::RenderBlock::layoutBlock):
+ (WebCore::RenderBlock::expandsToEncloseOverhangingFloats):
+ (WebCore::RenderBlock::adjustFloatingBlock):
+ (WebCore::RenderBlock::collapseMargins):
+ (WebCore::RenderBlock::clearFloatsIfNeeded):
+ (WebCore::RenderBlock::determineHorizontalPosition):
+ (WebCore::RenderBlock::handleBottomOfBlock):
+ (WebCore::RenderBlock::layoutBlockChildren):
+ (WebCore::RenderBlock::layoutBlockChild):
+ (WebCore::RenderBlock::positionNewFloatOnLine):
+ (WebCore::RenderBlock::newLine):
+ (WebCore::RenderBlock::logicalLeftOffsetForLine):
+ (WebCore::RenderBlock::logicalRightOffsetForContent):
+ (WebCore::RenderBlock::logicalRightOffsetForLine):
+ (WebCore::RenderBlock::getClearDelta):
+ (WebCore::RenderBlock::layoutColumns):
+ * rendering/RenderBlock.h:
+ * rendering/RenderBlockLineLayout.cpp:
+ (WebCore::RenderBlock::computeBlockDirectionPositionsForLine):
+ (WebCore::RenderBlock::layoutInlineChildren):
+ (WebCore::RenderBlock::determineStartPosition):
+ (WebCore::RenderBlock::fitBelowFloats):
+ * rendering/RenderBox.cpp:
+ (WebCore::RenderBox::marginBefore):
+ (WebCore::RenderBox::marginBeforeUsing):
+ (WebCore::RenderBox::marginAfter):
+ (WebCore::RenderBox::marginAfterUsing):
+ (WebCore::RenderBox::setMarginBefore):
+ (WebCore::RenderBox::setMarginAfter):
+ (WebCore::RenderBox::setMarginBeforeUsing):
+ (WebCore::RenderBox::setMarginAfterUsing):
+ (WebCore::RenderBox::computeLogicalHeight):
+ (WebCore::RenderBox::computeLogicalHeightUsing):
+ (WebCore::RenderBox::computePercentageLogicalHeight):
+ (WebCore::RenderBox::computeReplacedHeightUsing):
+ (WebCore::RenderBox::availableLogicalHeight):
+ (WebCore::RenderBox::availableLogicalHeightUsing):
+ (WebCore::RenderBox::computeBlockDirectionMargins):
+ (WebCore::RenderBox::avoidsFloats):
+ * rendering/RenderBox.h:
+ (WebCore::RenderBox::contentLogicalWidth):
+ (WebCore::RenderBox::contentLogicalHeight):
+ (WebCore::RenderBox::stretchesToViewHeight):
+ (WebCore::RenderBox::availableLogicalWidth):
+ (WebCore::RenderBox::availableWidth):
+ (WebCore::RenderBox::availableHeight):
+ (WebCore::RenderBox::isBlockFlowRoot):
+ * rendering/RenderTable.cpp:
+ (WebCore::RenderTable::computeLogicalWidth):
+
+2010-09-27 Mario Sanchez Prada <msanchez@igalia.com>
+
+ Reviewed by Chris Fleizach.
+
+ [Gtk] Adjust atk_text_get_text_at_offset to account for bullets/numbers in list items
+ https://bugs.webkit.org/show_bug.cgi?id=45381
+
+ Ensure list markers are consistently used in the Atk wrapper.
+
+ This patch does two things (both needed to fix the bug): It
+ improves the way list items markers are exposed through the Atk
+ Wrapper (by exposing the exact text in the marker, including the
+ marker suffix, if any) and makes sure the marker is consistently
+ considered and treated in those methods of the AtkText interface
+ that would need it (like atk_text_get_character_count or
+ atk_text_get_run_attributes, for instance).
+
+ * accessibility/gtk/AccessibilityObjectWrapperAtk.cpp:
+ (textForObject):
+ Append/prepend list marker when needed.
+ (webkit_accessible_text_get_text):
+ Use the new function markerTextWithSuffix() to expose a more
+ accurate value.
+ (accessibilityObjectLength):
+ Consider list items marker to return the length of an object,
+ if needed. Also, added some extra checks.
+ (webkit_accessible_text_get_character_count):
+ Just delegate on accessibilityObjectLength, to make it
+ cleaner and more consistent.
+
+ * rendering/RenderListItem.cpp:
+ (WebCore::RenderListItem::markerTextWithSuffix):
+ New public function to return a single string with the
+ marker associated to the item and its suffix, considering
+ text direction (LTR or RTL).
+ * rendering/RenderListItem.h:
+ * rendering/RenderListMarker.cpp:
+ (WebCore::RenderListMarker::suffix):
+ New public function to return a String with the suffix
+ associated to the marker.
+ * rendering/RenderListMarker.h:
+
+2010-09-27 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r68389.
+ http://trac.webkit.org/changeset/68389
+ https://bugs.webkit.org/show_bug.cgi?id=46637
+
+ test_shell is crashing on chromium Win (Requested by loislo on
+ #webkit).
+
+ * inspector/InspectorTimelineAgent.cpp:
+ (WebCore::InspectorTimelineAgent::InspectorTimelineAgent):
+ (WebCore::InspectorTimelineAgent::pushGCEventRecords):
+ (WebCore::InspectorTimelineAgent::didGC):
+ (WebCore::InspectorTimelineAgent::~InspectorTimelineAgent):
+ (WebCore::InspectorTimelineAgent::willCallFunction):
+ (WebCore::InspectorTimelineAgent::didCallFunction):
+ (WebCore::InspectorTimelineAgent::willDispatchEvent):
+ (WebCore::InspectorTimelineAgent::didDispatchEvent):
+ (WebCore::InspectorTimelineAgent::willLayout):
+ (WebCore::InspectorTimelineAgent::didLayout):
+ (WebCore::InspectorTimelineAgent::willRecalculateStyle):
+ (WebCore::InspectorTimelineAgent::didRecalculateStyle):
+ (WebCore::InspectorTimelineAgent::willPaint):
+ (WebCore::InspectorTimelineAgent::didPaint):
+ (WebCore::InspectorTimelineAgent::willWriteHTML):
+ (WebCore::InspectorTimelineAgent::didWriteHTML):
+ (WebCore::InspectorTimelineAgent::didInstallTimer):
+ (WebCore::InspectorTimelineAgent::didRemoveTimer):
+ (WebCore::InspectorTimelineAgent::willFireTimer):
+ (WebCore::InspectorTimelineAgent::didFireTimer):
+ (WebCore::InspectorTimelineAgent::willChangeXHRReadyState):
+ (WebCore::InspectorTimelineAgent::didChangeXHRReadyState):
+ (WebCore::InspectorTimelineAgent::willLoadXHR):
+ (WebCore::InspectorTimelineAgent::didLoadXHR):
+ (WebCore::InspectorTimelineAgent::willEvaluateScript):
+ (WebCore::InspectorTimelineAgent::didEvaluateScript):
+ (WebCore::InspectorTimelineAgent::didScheduleResourceRequest):
+ (WebCore::InspectorTimelineAgent::willSendResourceRequest):
+ (WebCore::InspectorTimelineAgent::willReceiveResourceData):
+ (WebCore::InspectorTimelineAgent::didReceiveResourceData):
+ (WebCore::InspectorTimelineAgent::willReceiveResourceResponse):
+ (WebCore::InspectorTimelineAgent::didReceiveResourceResponse):
+ (WebCore::InspectorTimelineAgent::didFinishLoadingResource):
+ (WebCore::InspectorTimelineAgent::didMarkTimeline):
+ (WebCore::InspectorTimelineAgent::didMarkDOMContentEvent):
+ (WebCore::InspectorTimelineAgent::didMarkLoadEvent):
+ (WebCore::InspectorTimelineAgent::reset):
+ (WebCore::InspectorTimelineAgent::resetFrontendProxyObject):
+ (WebCore::InspectorTimelineAgent::addRecordToTimeline):
+ (WebCore::InspectorTimelineAgent::setHeapSizeStatistic):
+ (WebCore::InspectorTimelineAgent::didCompleteCurrentRecord):
+ (WebCore::InspectorTimelineAgent::pushCurrentRecord):
+ * inspector/InspectorTimelineAgent.h:
+ (WebCore::InspectorTimelineAgent::TimelineRecordEntry::TimelineRecordEntry):
+ (WebCore::InspectorTimelineAgent::GCEvent::GCEvent):
+
+2010-09-27 Kinuko Yasuda <kinuko@google.com>
+
+ Reviewed by Adam Barth.
+
+ [Cleanup] Add create method to FileSystemCallbacks to get rid of naked new's
+ https://bugs.webkit.org/show_bug.cgi?id=46561
+
+ Also cleanup the callbacks layering to pass AsyncFileSystemCallbacks
+ object to LocalFileSystem::requestFileSystem (rather than
+ FileSystemCallback and ErrorCallback) so that all the callbacks class
+ we pass from WebCore to WebKit/chromium/src will be
+ AsyncFileSystemCallbacks.
+
+ No new tests; this patch is only for cleanup and there should be no functionality changes.
+
+ * fileapi/DOMFileSystem.cpp:
+ (WebCore::DOMFileSystem::getMetadata):
+ (WebCore::DOMFileSystem::move):
+ (WebCore::DOMFileSystem::copy):
+ (WebCore::DOMFileSystem::remove):
+ (WebCore::DOMFileSystem::getParent):
+ (WebCore::DOMFileSystem::getFile):
+ (WebCore::DOMFileSystem::getDirectory):
+ (WebCore::DOMFileSystem::createWriter):
+ (WebCore::DOMFileSystem::readDirectory):
+ * fileapi/FileSystemCallbacks.cpp:
+ (WebCore::EntryCallbacks::create): Added.
+ (WebCore::EntriesCallbacks::create): Added.
+ (WebCore::FileSystemCallbacks::create): Added.
+ (WebCore::MetadataCallbacks::create): Added.
+ (WebCore::FileWriterCallbacks::create): Added.
+ (WebCore::VoidCallbacks::create): Added.
+ * fileapi/FileSystemCallbacks.h:
+ * fileapi/LocalFileSystem.cpp:
+ (WebCore::openFileSystem):
+ (WebCore::LocalFileSystem::requestFileSystem): Changed to take
+ AsyncFileSystemCallbacks as (a) callback argument(s).
+ * fileapi/LocalFileSystem.h:
+ * page/DOMWindow.cpp:
+ (WebCore::DOMWindow::requestFileSystem): Made a corresponding change
+ to LocalFileSystem::requestFileSystem.
+ * workers/WorkerContext.cpp:
+ (WebCore::WorkerContext::requestFileSystem): Made a corresponding change
+ to LocalFileSystem::requestFileSystem.
+
+2010-09-27 Abhishek Arya <inferno@chromium.org>
+
+ Reviewed by Dave Hyatt.
+
+ Fix memory safety issue during positioning list marker as a result of assuming
+ that list item's parent can always be casted to a RenderBox. The display of the parent
+ can be manipluated using css as Inline which causes a bad cast.
+
+ https://bugs.webkit.org/show_bug.cgi?id=46384
+
+ Test: fast/lists/parent-box-not-box-crash.html
+
+ * rendering/RenderListItem.cpp:
+ (WebCore::RenderListItem::positionListMarker):
+ * rendering/RenderListMarker.cpp:
+ (WebCore::RenderListMarker::layout):
+
+2010-09-19 Martin Robinson <mrobinson@igalia.com>
+
+ Reviewed by Gustavo Noronha Silva.
+
+ [GTK] Wrong font instantiated from an unknown font family
+ https://bugs.webkit.org/show_bug.cgi?id=36548
+
+ When FontConfig returns a match for a particular family name, ensure that
+ the family name matches the configured alias for the original pattern. This
+ should prevent selecting FontConfig fallbacks in situations where the next
+ font on the CSS fallback list should be used. This requires moving all FontConfig
+ matching logic into FontCacheFreeType and out of FontPlatformDataFreeType.
+ It should be there anyway.
+
+ Test: platform/gtk/fonts/font-family-fallback.html
+
+ * platform/graphics/cairo/FontCacheFreeType.cpp:
+ (WebCore::FontCache::platformInit): Simply call FcInit here instead of
+ deferring to FontPlatformData.
+ (WebCore::FontCache::getLastResortFallbackFont): The last resort font should
+ be a fallback font or else the new FontConfig logic may result in null font data
+ if it cannot find an appropriate match.
+ (WebCore::getFamilyNameStringFromFontDescriptionAndFamily): Added. Helper function
+ which converts WebCore fallback names into ones that FontConfig understands.
+ (WebCore::isFallbackFontAllowed): Added. Helper function that allows FontConfig
+ fallbacks to be used when generic family names are specified.
+ (WebCore::FontCache::createFontPlatformData): Move all FontConfig matching logic here
+ and prevent against the situation where FontConfig returns a different family name
+ than we asked for.
+ * platform/graphics/cairo/FontCustomPlatformData.cpp: Updated FontPlatformData constructor.
+ * platform/graphics/cairo/FontPlatformDataFreeType.cpp: Update the constructor to
+ take the FcPattern returned and the original FontDescription. We no longer need the other
+ arguments, because the selection is now done by FontCacheFreeType.
+ (WebCore::FontPlatformData::FontPlatformData): Remove the FontConfig selection logic from
+ this code.
+ * platform/graphics/cairo/FontPlatformDataFreeType.h: Updated method definitions.
+ * platform/graphics/cairo/GlyphPageTreeNodeCairo.cpp: Fixed includes.
+ * platform/graphics/cairo/PlatformRefPtrCairo.cpp: Added a PlatformRefPtr specialization
+ for cairo_font_face_t.
+ (WTF::refPlatformPtr): Added.
+ (WTF::derefPlatformPtr): Added.
+ * platform/graphics/cairo/PlatformRefPtrCairo.h: Updated method definitons.
+ * platform/graphics/cairo/SimpleFontDataCairo.cpp:
+ (WebCore::SimpleFontData::smallCapsFontData): Fixed FontPlatformData constructor.
+
+2010-09-27 Philippe Normand <pnormand@igalia.com>
+
+ Reviewed by Martin Robinson.
+
+ [GTK] Doesn't build with gtk+ 2.14
+ https://bugs.webkit.org/show_bug.cgi?id=46565
+
+ Fixed the build for GTK+ 2.14 by adding backward compatible
+ a backward-compatible function for gtk_menu_item_get_label and a
+ utility function to create a blank mouse cursor. Those functions
+ are used in the fullscreen video controller and in the DRT
+ EventSender.
+
+ * platform/gtk/GtkVersioning.c:
+ (gdk_window_get_root_coords):
+ (blankCursor):
+ (gtk_menu_item_get_label):
+ * platform/gtk/GtkVersioning.h:
+
+2010-09-23 Stephen White <senorblanco@chromium.org>
+
+ Reviewed by James Robinson.
+
+ [CHROMIUM] Fix for canvas clearRect() with clipping active, when
+ --enable-accelerated-2d-canvas is on.
+ https://bugs.webkit.org/show_bug.cgi?id=46412
+
+ Covered by layout test http://philip.html5.org/tests/canvas/suite/tests/2d.clearRect.clip.html.
+
+ * platform/graphics/skia/GraphicsContextSkia.cpp:
+ (WebCore::GraphicsContext::clearRect):
+ Check if a clip is active during clipRect(), and force to software
+ if so. Force a readback in this case, since clearRect() is not
+ compatible with mixed-mode rendering.
+ * platform/graphics/skia/PlatformContextSkia.cpp:
+ (WebCore::PlatformContextSkia::canvasClipApplied):
+ * platform/graphics/skia/PlatformContextSkia.h:
+ Implement accessor to check if a clip is active.
+
+2010-09-14 Zhenyao Mo <zmo@google.com>
+
+ Reviewed by Kenneth Russell.
+
+ drawElements with count=0 and offset = 0 should not generate GL error or crash
+ https://bugs.webkit.org/show_bug.cgi?id=45769
+
+ * html/canvas/WebGLRenderingContext.cpp: Deal with count=0 case.
+ (WebCore::WebGLRenderingContext::validateIndexArrayConservative):
+ (WebCore::WebGLRenderingContext::validateIndexArrayPrecise):
+ (WebCore::WebGLRenderingContext::drawElements):
+
+2010-09-16 Zhenyao Mo <zmo@google.com>
+
+ Reviewed by Kenneth Russell.
+
+ Fold getString into getParameter and implement new queries
+ https://bugs.webkit.org/show_bug.cgi?id=40321
+
+ Test: fast/canvas/webgl/gl-getstring.html
+
+ * html/canvas/WebGLRenderingContext.cpp: Merge getString enums into getParameter.
+ (WebCore::WebGLRenderingContext::getParameter):
+ * html/canvas/WebGLRenderingContext.h: Remove getString.
+ * html/canvas/WebGLRenderingContext.idl: Remove getString.
+
+2010-09-24 Zhenyao Mo <zmo@google.com>
+
+ Reviewed by Kenneth Russell.
+
+ gl-teximage fails on chrome mac bot
+ https://bugs.webkit.org/show_bug.cgi?id=45332
+
+ Add support for alpha first pixel formats.
+
+ * platform/graphics/GraphicsContext3D.cpp:
+ (WebCore::doPacking):
+ * platform/graphics/GraphicsContext3D.h:
+ * platform/graphics/cg/GraphicsContext3DCG.cpp:
+ (WebCore::GraphicsContext3D::getImageData):
+
+2010-09-17 Yury Semikhatsky <yurys@chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ Web Inspector: implement go-to-line feature
+ https://bugs.webkit.org/show_bug.cgi?id=45166
+
+ * English.lproj/localizedStrings.js:
+ * inspector/front-end/GoToLineDialog.js: Added.
+ (WebInspector.GoToLineDialog):
+ (WebInspector.GoToLineDialog.show):
+ (WebInspector.GoToLineDialog.prototype._hide):
+ (WebInspector.GoToLineDialog.prototype._onKeyDown):
+ (WebInspector.GoToLineDialog.prototype._onBlur):
+ * inspector/front-end/ScriptsPanel.js:
+ (WebInspector.ScriptsPanel.prototype._registerShortcuts):
+ (WebInspector.ScriptsPanel.prototype.jumpToPreviousSearchResult):
+ (WebInspector.ScriptsPanel.prototype.showGoToLineDialog):
+ * inspector/front-end/goToLineDialog.css: Added.
+ (.go-to-line-dialog):
+ * inspector/front-end/inspector.html:
+
+2010-09-24 Pavel Podivilov <podivilov@chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ Web Inspector: add XHR breakpoints sidebar pane to front-end
+ https://bugs.webkit.org/show_bug.cgi?id=46483
+
+ * English.lproj/localizedStrings.js:
+ * WebCore.gypi:
+ * inspector/InspectorController.cpp:
+ (WebCore::InspectorController::instrumentWillSendXMLHttpRequestImpl):
+ * inspector/InspectorTimelineAgent.h:
+ * inspector/front-end/BreakpointManager.js:
+ (WebInspector.BreakpointManager):
+ (WebInspector.BreakpointManager.prototype._setBreakpointOnBackend):
+ (WebInspector.BreakpointManager.prototype.createXHRBreakpoint):
+ (WebInspector.BreakpointManager.prototype._xhrBreakpointRemoved):
+ (WebInspector.Breakpoint.prototype.compareTo):
+ (WebInspector.XHRBreakpoint):
+ (WebInspector.XHRBreakpoint.prototype.get enabled):
+ (WebInspector.XHRBreakpoint.prototype.set enabled):
+ (WebInspector.XHRBreakpoint.prototype.get url):
+ (WebInspector.XHRBreakpoint.prototype.formatLabel):
+ (WebInspector.XHRBreakpoint.prototype.compareTo):
+ (WebInspector.XHRBreakpoint.prototype.remove):
+ (WebInspector.XHRBreakpoint.prototype._setOnBackend.didSet):
+ (WebInspector.XHRBreakpoint.prototype._setOnBackend):
+ (WebInspector.XHRBreakpoint.prototype._removeFromBackend):
+ * inspector/front-end/BreakpointsSidebarPane.js:
+ (WebInspector.XHRBreakpointsSidebarPane):
+ (WebInspector.XHRBreakpointsSidebarPane.prototype._showEditBreakpointDialog):
+ (WebInspector.XHRBreakpointsSidebarPane.prototype._hideEditBreakpointDialog):
+ (WebInspector.BreakpointItem.prototype.compareTo):
+ (WebInspector.BreakpointItem.prototype._checkboxClicked):
+ (WebInspector.BreakpointItem.prototype._enableChanged):
+ (WebInspector.BreakpointItem.prototype._breakpointClicked):
+ (WebInspector.XHRBreakpointItem):
+ * inspector/front-end/CallStackSidebarPane.js:
+ (WebInspector.CallStackSidebarPane.prototype.updateStatus.formatters.s):
+ (WebInspector.CallStackSidebarPane.prototype.updateStatus.append):
+ (WebInspector.CallStackSidebarPane.prototype.updateStatus):
+ * inspector/front-end/DOMAgent.js:
+ (WebInspector.DOMBreakpoint.prototype.compareTo):
+ * inspector/front-end/Images/paneAddButtons.png: Added.
+ * inspector/front-end/ScriptsPanel.js:
+ (WebInspector.ScriptsPanel):
+ (WebInspector.ScriptsPanel.prototype.reset):
+ * inspector/front-end/WebKit.qrc:
+ * inspector/front-end/inspector.css:
+ (.pane > .title > button.add):
+ (.pane > .title > button.add:hover):
+ (.pane > .title > button.add:active):
+ (.pane > .body .breakpoint-condition):
+ * inspector/front-end/inspector.js:
+ (WebInspector.createXHRBreakpointsSidebarPane.breakpointAdded):
+ (WebInspector.createXHRBreakpointsSidebarPane):
+
+2010-09-27 Pavel Feldman <pfeldman@chromium.org>
+
+ Reviewed by Timothy Hatcher.
+
+ Web Inspector: Merge AbstractTimelinePanel into ResourcesPanel.
+ https://bugs.webkit.org/show_bug.cgi?id=46612
+
+ I am refactoring resources panel and would like to merge abstract
+ one back in since it is not use anywhere else.
+
+ * WebCore.gypi:
+ * WebCore.vcproj/WebCore.vcproj:
+ * inspector/front-end/AbstractTimelinePanel.js: Removed.
+ * inspector/front-end/ResourceCategory.js:
+ (WebInspector.ResourceCategory):
+ (WebInspector.ResourceCategory.prototype.toString):
+ * inspector/front-end/ResourcesPanel.js:
+ (WebInspector.ResourcesPanel):
+ (WebInspector.ResourcesPanel.prototype.get items):
+ (WebInspector.ResourcesPanel.prototype.createInterface):
+ (WebInspector.ResourcesPanel.prototype.createFilterPanel.createFilterElement):
+ (WebInspector.ResourcesPanel.prototype.createFilterPanel):
+ (WebInspector.ResourcesPanel.prototype.showCategory):
+ (WebInspector.ResourcesPanel.prototype.hideCategory):
+ (WebInspector.ResourcesPanel.prototype.filter):
+ (WebInspector.ResourcesPanel.prototype._updateFilter):
+ (WebInspector.ResourcesPanel.prototype._updateDividersLabelBarPosition):
+ (WebInspector.ResourcesPanel.prototype.get needsRefresh):
+ (WebInspector.ResourcesPanel.prototype.set needsRefresh):
+ (WebInspector.ResourcesPanel.prototype.refreshIfNeeded):
+ (WebInspector.ResourcesPanel.prototype.resize):
+ (WebInspector.ResourcesPanel.prototype.invalidateAllItems):
+ (WebInspector.ResourcesPanel.prototype.get calculator):
+ (WebInspector.ResourcesPanel.prototype.set calculator):
+ (WebInspector.ResourcesPanel.prototype.addItem):
+ (WebInspector.ResourcesPanel.prototype.removeItem):
+ (WebInspector.ResourcesPanel.prototype.refreshItem):
+ (WebInspector.ResourcesPanel.prototype.revealAndSelectItem):
+ (WebInspector.ResourcesPanel.prototype.sortItems):
+ (WebInspector.ResourcesPanel.prototype.adjustScrollPosition):
+ (WebInspector.ResourcesPanel.prototype.addEventDivider):
+ (WebInspector.ResourcesPanel.prototype.hideEventDividers):
+ (WebInspector.ResourcesPanel.prototype.showEventDividers):
+ (WebInspector.ResourcesPanel.prototype.show):
+ (WebInspector.ResourcesPanel.prototype.refresh):
+ (WebInspector.ResourcesPanel.prototype.reset):
+ (WebInspector.ResourcesPanel.prototype.updateGraphDividersIfNeeded):
+ (WebInspector.ResourcesPanel.prototype.updateMainViewWidth):
+ (WebInspector.ResourceBaseCalculator):
+ (WebInspector.ResourceBaseCalculator.prototype.computeSummaryValues):
+ (WebInspector.ResourceBaseCalculator.prototype.computeBarGraphPercentages):
+ (WebInspector.ResourceBaseCalculator.prototype.computeBarGraphLabels):
+ (WebInspector.ResourceBaseCalculator.prototype.get boundarySpan):
+ (WebInspector.ResourceBaseCalculator.prototype.updateBoundaries):
+ (WebInspector.ResourceBaseCalculator.prototype.reset):
+ (WebInspector.ResourceBaseCalculator.prototype._value):
+ (WebInspector.ResourceBaseCalculator.prototype.formatValue):
+ (WebInspector.ResourceTimeCalculator):
+ (WebInspector.ResourceTransferSizeCalculator):
+ * inspector/front-end/WebKit.qrc:
+ * inspector/front-end/inspector.html:
+
+2010-09-27 Ragner Magalhaes <ragner.magalhaes@openbossa.org>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] New input style for Qt Mobile theme
+ https://bugs.webkit.org/show_bug.cgi?id=46461
+
+ Rename themeQtMaemo5.css to themeQtMobile.css since it is the theme for all Qt mobile platform.
+ Adjust new input style.
+
+ * WebCore.pri:
+ * css/themeQtMobile.css: Renamed from css/themeQtMaemo5.css
+ (select):
+ (select:disabled):
+ (select:active):
+ (select:active:disabled):
+ (textarea):
+ (textarea:disabled):
+ (textarea:active):
+ * platform/qt/RenderThemeQt.cpp:
+ (WebCore::RenderThemeQt::extraDefaultStyleSheet): Renamed themeQtMaemo5UserAgentStyleSheet to themeQtMobileUserAgentStyleSheet to match renamed file.
+
+2010-09-27 Girish Ramakrishnan <girish@forwardbias.in>
+
+ Reviewed by Antonio Gomes.
+
+ [Qt] Enable local rendering of NPAPI plugins on Maemo6.
+
+ https://bugs.webkit.org/show_bug.cgi?id=46618
+
+ * WebCore.pro:
+ * bridge/npapi.h:
+ * plugins/PluginView.cpp:
+ (WebCore::PluginView::setValue):
+ (WebCore::PluginView::PluginView):
+ * plugins/PluginView.h:
+ * plugins/qt/PluginViewQt.cpp:
+ (WebCore::PluginView::updatePluginWidget):
+ (WebCore::PluginView::paint):
+ (WebCore::PluginView::platformGetValueStatic):
+
+2010-09-27 Ilya Tikhonovsky <loislo@chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ Web Inspector: divide InspectorTimelineAgent into two parts.
+
+ We have an idea to split InspectorTimelineAgent into two parts.
+ The first part is an instrumentation API which can be used for DOM breakpoints too.
+ The other is the real Timeline agent which do a transformation of raw data into timeline data.
+
+ https://bugs.webkit.org/show_bug.cgi?id=46611
+
+ * inspector/InspectorTimelineAgent.cpp:
+ (WebCore::InspectorTimelineAgent2::TimelineRecordEntry::TimelineRecordEntry):
+ (WebCore::InspectorTimelineAgent2::GCEvent::GCEvent):
+ (WebCore::InspectorTimelineAgent2::InspectorTimelineAgent2):
+ (WebCore::InspectorTimelineAgent2::~InspectorTimelineAgent2):
+ (WebCore::InspectorTimelineAgent2::didGC):
+ (WebCore::InspectorTimelineAgent2::addRecordToTimeline):
+ (WebCore::InspectorTimelineAgent2::setHeapSizeStatistic):
+ (WebCore::InspectorTimelineAgent2::startNewRecord):
+ (WebCore::InspectorTimelineAgent2::completeCurrentRecord):
+ (WebCore::InspectorTimelineAgent2::asyncRecord):
+ (WebCore::InspectorTimelineAgent2::atomicRecord):
+ (WebCore::InspectorTimelineAgent2::getTopRecordData):
+ (WebCore::InspectorTimelineAgent2::reset):
+ (WebCore::InspectorTimelineAgent2::resetFrontendProxyObject):
+ (WebCore::InspectorTimelineAgent2::pushGCEventRecords):
+ (WebCore::InspectorTimelineAgent::InspectorTimelineAgent):
+ (WebCore::InspectorTimelineAgent::~InspectorTimelineAgent):
+ (WebCore::InspectorTimelineAgent::reset):
+ (WebCore::InspectorTimelineAgent::willCallFunction):
+ (WebCore::InspectorTimelineAgent::didCallFunction):
+ (WebCore::InspectorTimelineAgent::willDispatchEvent):
+ (WebCore::InspectorTimelineAgent::didDispatchEvent):
+ (WebCore::InspectorTimelineAgent::willLayout):
+ (WebCore::InspectorTimelineAgent::didLayout):
+ (WebCore::InspectorTimelineAgent::willRecalculateStyle):
+ (WebCore::InspectorTimelineAgent::didRecalculateStyle):
+ (WebCore::InspectorTimelineAgent::willPaint):
+ (WebCore::InspectorTimelineAgent::didPaint):
+ (WebCore::InspectorTimelineAgent::willWriteHTML):
+ (WebCore::InspectorTimelineAgent::didWriteHTML):
+ (WebCore::InspectorTimelineAgent::didInstallTimer):
+ (WebCore::InspectorTimelineAgent::didRemoveTimer):
+ (WebCore::InspectorTimelineAgent::willFireTimer):
+ (WebCore::InspectorTimelineAgent::didFireTimer):
+ (WebCore::InspectorTimelineAgent::willChangeXHRReadyState):
+ (WebCore::InspectorTimelineAgent::didChangeXHRReadyState):
+ (WebCore::InspectorTimelineAgent::willLoadXHR):
+ (WebCore::InspectorTimelineAgent::didLoadXHR):
+ (WebCore::InspectorTimelineAgent::willEvaluateScript):
+ (WebCore::InspectorTimelineAgent::didEvaluateScript):
+ (WebCore::InspectorTimelineAgent::didScheduleResourceRequest):
+ (WebCore::InspectorTimelineAgent::willSendResourceRequest):
+ (WebCore::InspectorTimelineAgent::willReceiveResourceData):
+ (WebCore::InspectorTimelineAgent::didReceiveResourceData):
+ (WebCore::InspectorTimelineAgent::willReceiveResourceResponse):
+ (WebCore::InspectorTimelineAgent::didReceiveResourceResponse):
+ (WebCore::InspectorTimelineAgent::didFinishLoadingResource):
+ (WebCore::InspectorTimelineAgent::didMarkTimeline):
+ (WebCore::InspectorTimelineAgent::didMarkDOMContentEvent):
+ (WebCore::InspectorTimelineAgent::didMarkLoadEvent):
+ (WebCore::InspectorTimelineAgent::resetFrontendProxyObject):
+ * inspector/InspectorTimelineAgent.h:
+
+2010-09-27 Alexander Pavlov <apavlov@chromium.org>
+
+ Reviewed by Sam Weinig.
+
+ Implement CSSStyleRule::setSelectorText()
+
+ This involves removing the "selectorText" "setter raises(DOMException)" clause from the IDL files,
+ since the setter no longer raises the exception, as per http://dev.w3.org/csswg/cssom/#dom-cssstylerule-selectortext
+ https://bugs.webkit.org/show_bug.cgi?id=46487
+
+ Test: fast/css/css-set-selector-text.html
+
+ * css/CSSPageRule.idl:
+ * css/CSSStyleRule.cpp:
+ (WebCore::CSSStyleRule::setSelectorText):
+ * css/CSSStyleRule.h:
+ * css/CSSStyleRule.idl:
+
+2010-09-27 Zoltan Herczeg <zherczeg@webkit.org>
+
+ Reviewed by Dirk Schulze.
+
+ Filter builder should be able to follow the filter object dependencies
+ https://bugs.webkit.org/show_bug.cgi?id=45812
+
+ To propagate the changes of a primitive object, a data structure
+ is needed which stores the dependent primitive objects. (Those
+ who use the resulting image.) This data structure is implemented
+ as a hash map, which contains primitive object and set of primitive
+ objects <key,value> pairs. The hash map is able to follow the
+ dynamic topology changes.
+
+ * rendering/RenderSVGResourceFilter.cpp:
+ (WebCore::RenderSVGResourceFilter::buildPrimitives):
+ * rendering/RenderSVGResourceFilterPrimitive.h:
+ (WebCore::RenderSVGResourceFilterPrimitive::renderName):
+ (WebCore::RenderSVGResourceFilterPrimitive::isSVGResourceFilterPrimitive):
+ * svg/graphics/filters/SVGFilterBuilder.cpp:
+ (WebCore::SVGFilterBuilder::SVGFilterBuilder):
+ (WebCore::SVGFilterBuilder::appendEffectToEffectReferences):
+ (WebCore::SVGFilterBuilder::clearEffects):
+ * svg/graphics/filters/SVGFilterBuilder.h:
+ (WebCore::SVGFilterBuilder::getEffectReferences):
+ (WebCore::SVGFilterBuilder::addBuiltinEffects):
+
+2010-09-27 Andreas Kling <andreas.kling@nokia.com>
+
+ Rubber-stamped by Kenneth Rohde Christiansen.
+
+ [Qt] 32-bit Flash crashes on repeated SetWindow calls
+ https://bugs.webkit.org/show_bug.cgi?id=46616
+
+ Re-enable PluginQuirkDontCallSetWindowMoreThanOnce for Qt on x86 Unix.
+
+ We incorrectly thought this was fixed in Flash 10, but it turns out it
+ was just never broken on 64-bit.
+
+ * plugins/PluginPackage.cpp:
+ (WebCore::PluginPackage::determineQuirks):
+
+2010-09-27 İsmail Dönmez <ismail@namtrac.org>
+
+ Reviewed by Andreas Kling.
+
+ Add PluginView::setJavaScriptPaused(bool) stub for WinCE.
+
+ * platform/qt/TemporaryLinkStubsQt.cpp:
+ (PluginView::setJavaScriptPaused):
+
+2010-09-27 Gyuyoung Kim <gyuyoung.kim@samsung.com>
+
+ Reviewed by Dirk Schulze.
+
+ Bug 46607 - [WML] Fix a build break when WML is enabled
+
+ Fix a build break when WML is enabled.
+
+ * wml/WMLElement.cpp: Include HTMLParserIdioms.h
+ (WebCore::WMLElement::parseMappedAttribute): Add additional parameter to invoke parseHTMLInteger() function.
+
+2010-09-26 Patrick Gansterer <paroga@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Remove dead code and fix header includes in ResourceHandleWin
+ https://bugs.webkit.org/show_bug.cgi?id=46479
+
+ Also add missing member varibale from r68167.
+
+ * platform/network/ResourceHandle.h:
+ * platform/network/ResourceHandleInternal.h:
+ (WebCore::ResourceHandleInternal::ResourceHandleInternal):
+ * platform/network/win/ResourceHandleWin.cpp:
+ (WebCore::ResourceHandleInternal::~ResourceHandleInternal):
+ (WebCore::ResourceHandle::~ResourceHandle):
+ (WebCore::ResourceHandle::onRequestComplete):
+ * platform/network/win/ResourceHandleWin.h: Removed.
+
+2010-09-26 Patrick Gansterer <paroga@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Add WTF::StringHasher::createBlobHash
+ https://bugs.webkit.org/show_bug.cgi?id=46514
+
+ Add this function for hashing FormElementKey and QualifiedNameComponents.
+
+ * dom/Document.cpp:
+ (WebCore::FormElementKeyHash::hash):
+ * dom/QualifiedName.h:
+ (WebCore::hashComponents):
+ (WebCore::QualifiedNameHash::hash):
+
+2010-09-26 David Hyatt <hyatt@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ https://bugs.webkit.org/show_bug.cgi?id=46519
+
+ Convert the implementation of computeLogicalWidth to work with block-flow.
+
+ * rendering/RenderBlock.cpp:
+ (WebCore::RenderBlock::determineHorizontalPosition):
+ Patched to call the new computeMarginsInContainingBlockInlineDirection. Eventually determineHorizontalPosition will
+ be placing children along the inline direction of the containing block, and those children may have mismatched
+ block flows. The new computeMarginsInContainingBlockInlineDirection function is designed to handle that.
+
+ * rendering/RenderBox.cpp:
+ (WebCore::RenderBox::marginStart):
+ (WebCore::RenderBox::marginStartUsing):
+ (WebCore::RenderBox::marginEnd):
+ (WebCore::RenderBox::marginEndUsing):
+ (WebCore::RenderBox::setMarginStart):
+ (WebCore::RenderBox::setMarginEnd):
+ (WebCore::RenderBox::setMarginStartUsing):
+ (WebCore::RenderBox::setMarginEndUsing):
+ Helpers that allow for marginStart/End access and that also allow for marginStart/End to be computed based off another
+ element's block-flow and direction (typically the containing block).
+
+ (WebCore::RenderBox::computeBorderBoxLogicalWidth):
+ (WebCore::RenderBox::computeBorderBoxLogicalHeight):
+ (WebCore::RenderBox::computeContentBoxLogicalWidth):
+ (WebCore::RenderBox::computeContentBoxLogicalHeight):
+ Patched to use logical border/padding widths and heights.
+
+ (WebCore::RenderBox::perpendicularContainingBlockLogicalHeight):
+ A function for returning the available logical height of a perpendicular containing block. If a child has vertical
+ text for example and its block-flow is "lr", its available logical width is determined by the logical
+ height of the containing block when that containing block is perpendicular, e.g. "tb".
+
+ (WebCore::RenderBox::computeLogicalWidth):
+ (WebCore::RenderBox::computeLogicalWidthUsing):
+ Patched to be block-flow-aware and to use logical width values everywhere.
+
+ (WebCore::RenderBox::sizesToIntrinsicLogicalWidth):
+ Patched to use logical widths.
+
+ (WebCore::RenderBox::computeMarginsInContainingBlockInlineDirection):
+ A new function that is directionally abstract and that can handle the computation of margins in the containing
+ block's inline direction. This function is written such that a perpendicular child block flow can still be
+ pushed to the center, left or right in the containing block's inline direction.
+
+ (WebCore::RenderBox::computePositionedLogicalWidth):
+ This function is still largely unpatched. A future patch will address positioend elements.
+
+ * rendering/RenderBox.h:
+ (WebCore::RenderBox::stretchesToMinIntrinsicLogicalWidth):
+ * rendering/RenderFieldset.h:
+ (WebCore::RenderFieldset::stretchesToMinIntrinsicLogicalWidth):
+ Renames.
+
+ * rendering/RenderTable.cpp:
+ (WebCore::RenderTable::computeLogicalWidth):
+ Renames, but not converted yet. Tables will happen in a future patch.
+
+ * rendering/style/RenderStyle.cpp:
+ (WebCore::RenderStyle::marginStartUsing):
+ (WebCore::RenderStyle::marginEndUsing):
+ * rendering/style/RenderStyle.h:
+ Added helpers for accessing marginStart and End using another style's direction and block flow (typically will
+ be the containing block's).
+
+ fast/block/basic/016.html changed, since centering now always awards the extra pixel for odd widths to the end margin
+ instead of the right margin. This is a progression.
+
+ fast/css/logical-property-values.html is now reporting garbage results, which is expected now that some of the core layout
+ functions have been patched.
+
+ Horizontal block flows are untestable still, since the normal layout process incorrectly blows away any computed height values.
+
+2010-09-26 Antonio Gomes <agomes@rim.comg>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ DRT/Mac nodesFromRect support
+
+ [Mac][DRT] Implement LayoutTestController::nodesFromRect
+ https://bugs.webkit.org/show_bug.cgi?id=46580
+
+ Symbol files updated.
+
+ * WebCore.exp.in: Added symbols to Document::nodesFromRect and bits of JSDocument now
+ needed in WebKit/mac.
+ * WebCore.xcodeproj/project.pbxproj: Set both JSDocument.h and JSNodeList as private headers
+ now that they are referred in WebKit/mac.
+
+2010-09-26 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ Implement location.origin and HTMLAnchorElement.origin
+ https://bugs.webkit.org/show_bug.cgi?id=46558
+
+ These attributes are part of my proposed URL API:
+ https://docs.google.com/document/edit?id=1r_VTFKApVOaNIkocrg0z-t7lZgzisTuGTXkdzAk4gLU&hl=en
+
+ Hixie thought we should implement as much of this API as makes sense on
+ Location and HTMLAnchorElement as well. I'm starting with the origin
+ attribute, because that seems like the biggest bang for the buck.
+
+ Tests: fast/dom/anchor-origin.html
+ http/tests/misc/location-origin.html
+
+ * WebCore.xcodeproj/project.pbxproj:
+ * html/HTMLAnchorElement.cpp:
+ (WebCore::HTMLAnchorElement::origin):
+ * html/HTMLAnchorElement.h:
+ * html/HTMLAnchorElement.idl:
+ * page/Location.cpp:
+ (WebCore::Location::origin):
+ * page/Location.h:
+ * page/Location.idl:
+
+2010-09-26 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r68343.
+ http://trac.webkit.org/changeset/68343
+ https://bugs.webkit.org/show_bug.cgi?id=46581
+
+ broke GTK+ (Requested by kling on #webkit).
+
+ * html/canvas/CanvasRenderingContext2D.cpp:
+ (WebCore::CanvasRenderingContext2D::setFont):
+
+2010-09-25 Antonio Gomes <agomes@rim.com>
+
+ Reviewed by Kenneth Christiansen and Andreas Kling.
+
+ document.nodesFromRect() needs to be removed from Document.idl
+ https://bugs.webkit.org/show_bug.cgi?id=46492
+
+ As discussed with Sam Weinig on IRC, it was decided to removed
+ nodesFromRect() from the Document.idl, and that way, not exposing
+ it to Web content.
+
+ Reason: there is no plan to make it standard at the moment, and at the
+ very least, the method should had been originally added with the "webkit"
+ prefix, which was not the case.
+
+ * dom/Document.idl:
+
+2010-09-26 Renata Hodovan <reni@inf.u-szeged.hu>
+
+ Reviewed by Dirk Schulze.
+
+ SVGFEBlendElement doesn't support dynamic invalidation, when attributes change.
+ https://bugs.webkit.org/show_bug.cgi?id=46464
+
+ Tests: svg/dynamic-updates/SVGFEBlendElement-dom-in-attr.html
+ svg/dynamic-updates/SVGFEBlendElement-dom-in2-attr.html
+ svg/dynamic-updates/SVGFEBlendElement-dom-mode-attr.html
+ svg/dynamic-updates/SVGFEBlendElement-svgdom-in-prop.html
+ svg/dynamic-updates/SVGFEBlendElement-svgdom-in2-prop.html
+ svg/dynamic-updates/SVGFEBlendElement-svgdom-mode-prop.html
+
+ * svg/SVGFEBlendElement.cpp:
+ (WebCore::SVGFEBlendElement::svgAttributeChanged):
+ * svg/SVGFEBlendElement.h:
+
+2010-09-26 Andreas Kling <andreas.kling@nokia.com>
+
+ Reviewed by Dan Bernstein.
+
+ Canvas: Crash when setting a font with size in 'ex' units
+ https://bugs.webkit.org/show_bug.cgi?id=46538
+
+ update() the style's font after setting the style's font description.
+ Needed because CSSPrimitiveValue::computeLengthDouble() later assumes
+ that the style's font is properly initialized (for xHeight().)
+
+ Fixes crash on IE test center's canvas-text-font-002 test.
+
+ * html/canvas/CanvasRenderingContext2D.cpp:
+ (WebCore::CanvasRenderingContext2D::setFont):
+
+2010-09-26 Kwang Yul Seo <skyul@company100.net>
+
+ Reviewed by Eric Seidel.
+
+ [BREWMP] Don't pass PassOwnPtr in makeAllDirectories
+ https://bugs.webkit.org/show_bug.cgi?id=42058
+
+ Change makeAllDirectories to take a raw FileMgr pointer
+ because it is not safe to pass PassOwnPtr recursively.
+
+ * platform/brew/FileSystemBrew.cpp:
+ (WebCore::makeAllDirectories):
+
+2010-09-26 Robert Hogan <robert@webkit.org>
+
+ Reviewed by Andreas Kling.
+
+ [Qt] fix http/tests/uri/escaped-entity.html
+
+ Replace invalid encodings with the appropriate escaped entity.
+
+ See also http://bugreports.qt.nokia.com/browse/QTBUG-13412
+
+ https://bugs.webkit.org/show_bug.cgi?id=45245
+
+ * platform/text/qt/TextCodecQt.cpp:
+ (WebCore::TextCodecQt::encode):
+
+2010-09-25 Abhishek Arya <inferno@chromium.org>
+
+ Reviewed by Nikolas Zimmermann.
+
+ Fix the macro to bail out after setting the SVG style to 'initial'. Check that color is
+ SVGColor before calling colorFromSVGColorCSSValue which makes sure we don't set invalid
+ color. Also, doing the static cast in the caller and keeping the function
+ colorFromSVGColorCSSValue clean to accept only take SVGColor objects.
+
+ https://bugs.webkit.org/show_bug.cgi?id=46471
+
+ Test: svg/css/invalid-color-crash.svg
+
+ * css/SVGCSSStyleSelector.cpp:
+ (WebCore::colorFromSVGColorCSSValue):
+ (WebCore::CSSStyleSelector::applySVGProperty):
+
+2010-09-25 Ryosuke Niwa <rniwa@webkit.org>
+
+ Reviewed by Tony Chang.
+
+ FormatBlockCommand's modifyRange and doApply should be merged
+ https://bugs.webkit.org/show_bug.cgi?id=46504
+
+ Isolated the code in doApply to insert and remove lists for single paragraph into doApplyForSingleParagraph.
+ Merged the code in modifyRange into doApply and cleaned up.
+
+ No new tests are added since this is a cleanup.
+
+ * editing/FormatBlockCommand.cpp:
+ (WebCore::FormatBlockCommand::doApply): Merged with modifyRange; calls doApplyForSingleParagraph.
+ (WebCore::FormatBlockCommand::doApplyForSingleParagraph): Added.
+ * editing/FormatBlockCommand.h:
+
+2010-09-25 Dan Bernstein <mitz@apple.com>
+
+ Reviewed by John Sullivan.
+
+ <rdar://problem/8478160> Null deref in InlineBox::height()
+ https://bugs.webkit.org/show_bug.cgi?id=45344
+
+ Test: fast/css/first-line-parent-style-different.html
+
+ * rendering/RenderObject.cpp:
+ (WebCore::RenderObject::firstLineStyleSlowCase): Set the pseudo style bit on the RenderStyle
+ which is going to supply the first-line style rather than on this object’s RenderStyle. The
+ styles may differ.
+
+2010-09-25 Dan Bernstein <mitz@apple.com>
+
+ Reviewed by John Sullivan.
+
+ <rdar://problem/8478182> Make canHyphenate() return false for unsupported locales
+
+ No change in functionality, hence no new test.
+
+ * platform/text/cf/HyphenationCF.cpp:
+ (WebCore::::createValueForKey): Return 0 if hyphenation is not available for the locale.
+ (WebCore::cfLocaleCache): Moved the definition of the cache from lastHyphenLocation() to
+ this new getter to allow canHyphenate() to share it.
+ (WebCore::canHyphenate): Now returns true only if hyphenation is available.
+ (WebCore::lastHyphenLocation): Added an assertion.
+
+2010-09-25 Andreas Kling <andreas.kling@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] GraphicsContext::setLineDash() should scale dashOffset to penWidth
+ https://bugs.webkit.org/show_bug.cgi?id=46548
+
+ Fixes incorrect rendering of <http://www.carto.net/svg/samples/animated_bustrack.shtml>
+
+ This is covered by existing layout tests which need to be rebaselined.
+
+ * platform/graphics/qt/GraphicsContextQt.cpp:
+ (WebCore::GraphicsContext::setLineDash):
+
+2010-09-24 Sam Weinig <sam@webkit.org>
+
+ Rubber-stamped by Dan Bernstein.
+
+ Fix accidental increase in the size of InlineBox by using a bit
+ field to indicate that a bool should only take up 1 bit.
+
+ * rendering/InlineBox.h:
+
+2010-09-24 Simon Fraser <simon.fraser@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Accelerated transitions do not suspend/resume properly.
+ https://bugs.webkit.org/show_bug.cgi?id=43792
+
+ (1) Fix regression from r68233, where if an animation affected two
+ properties, only one would animate. The testcase tests this.
+
+ (2) Fix a flash at the end of an animation or transition that has been
+ paused and resumed. The flash occurred because we used CAAnimation's
+ timeOffset when resuming to push the start of the animation into
+ the past. However, timeOffset does not play nicely with fill modes,
+ causing a single frame of animation with the element in its unanimated state.
+
+ Fixed this by offsetting the beginTime into the past, rather than setting
+ timeOffset. Normally we submit animations with beginTime == 0, and rely
+ on CA assigning a beginTime when the animation is committed. This beginTime
+ is then passed to AnimationController to sync hardware and software animations.
+ However, since the code now assigns beginTimes in the past (on resume),
+ we now have to denote whether we've done this, and send an appropriate
+ timestamp back to AnimationController.
+
+ (3) Finally, the patch removes PropertyAnimationPair and just uses LayerPropertyAnimation
+ instead. This is just cleanup.
+
+ Test: animations/opacity-transform-animation.html
+
+ * platform/graphics/mac/GraphicsLayerCA.h: Remove PropertyAnimationPair,
+ and change AnimationsMap to store a vector of LayerPropertyAnimation.
+ New method, animationDidStart(), is called from the -animationDidStart: callback.
+
+ * platform/graphics/mac/GraphicsLayerCA.mm:
+ (-[WebAnimationDelegate animationDidStart:]): Just call m_graphicsLayer->animationDidStart()
+ now.
+ (WebCore::animationIdentifier): We need to pass in the property, to fix (1)
+ (WebCore::GraphicsLayerCA::moveOrCopyAnimationsForProperty): Copy the WebKitAnimationBeginTimeSet
+ value, if present.
+ (WebCore::GraphicsLayerCA::animationDidStart): Call notifyAnimationStarted() on the client,
+ after testing if we set a non-zero beginTime on this particular animation.
+ (WebCore::GraphicsLayerCA::updateLayerAnimations): Change to use LayerPropertyAnimation.
+ (WebCore::GraphicsLayerCA::setCAAnimationOnLayer): Set value for WebKitAnimationBeginTimeSetKey
+ if we have a non-zero timeOffset. Make animationID an NSString, to avoid several conversions.
+ (WebCore::GraphicsLayerCA::removeCAAnimationFromLayer): Make animationID an NSString, to
+ avoid several conversions.
+ (WebCore::copyAnimationProperties): Copy WebKitAnimationBeginTimeSetKey if present.
+ (WebCore::GraphicsLayerCA::pauseCAAnimationOnLayer): Make animationID an NSString, to avoid
+ several conversions.
+
+2010-09-24 Andreas Kling <andreas.kling@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ SVG: Avoid calling pow() in genericParseNumber() unless necessary
+ https://bugs.webkit.org/show_bug.cgi?id=46537
+
+ 0.4% speedup on <http://themaninblue.com/experiment/AnimationBenchmark/svg/>
+
+ * svg/SVGParserUtilities.cpp:
+ (WebCore::genericParseNumber): Only call pow() when we have an exponent.
+
+2010-09-24 Martin Robinson <mrobinson@igalia.com>
+
+ Reviewed by Gustavo Noronha Silva.
+
+ [GTK] opening local files on win32
+ https://bugs.webkit.org/show_bug.cgi?id=31066
+
+ This is tested by changes to the testmimehandling API test.
+
+ * platform/network/soup/ResourceHandleSoup.cpp: Properly convert the GContentType
+ of a file into a mime type. This is important for non-Unix platforms.
+
+2010-09-24 Pawel Hajdan <phajdan.jr@chromium.org>
+
+ Reviewed by Dumitru Daniliuc.
+
+ Move the implementation of chromium_vfs to webkit for POSIX.
+ This allows us to link Chrome with system-provided SQLite on Linux.
+ See also http://code.google.com/p/chromium/issues/detail?id=22208.
+ https://bugs.webkit.org/show_bug.cgi?id=45416
+
+ No new tests.
+
+ * platform/sql/chromium/SQLiteFileSystemChromiumPosix.cpp:
+ (sqliteErrorFromPosixError):
+ (releaseLockInfo):
+ (releaseOpenInfo):
+ (findLockInfo):
+ (chromiumCheckReservedLock):
+ (rangeLock):
+ (chromiumLock):
+ (closePendingFds):
+ (chromiumUnlock):
+ (chromiumCloseNoLock):
+ (chromiumClose):
+ (chromiumCheckReservedLockNoop):
+ (chromiumLockNoop):
+ (chromiumUnlockNoop):
+ (seekAndRead):
+ (chromiumRead):
+ (seekAndWrite):
+ (chromiumWrite):
+ (syncWrapper):
+ (chromiumSync):
+ (chromiumTruncate):
+ (chromiumFileSize):
+ (chromiumFileControl):
+ (chromiumSectorSize):
+ (chromiumDeviceCharacteristics):
+ (fillInChromiumFile):
+ (findReusableFd):
+ (chromiumOpen):
+ (chromiumDelete):
+ (chromiumAccess):
+ (chromiumFullPathname):
+ (chromiumDlOpen):
+ (chromiumDlError):
+ (chromiumDlSym):
+ (chromiumDlClose):
+ (chromiumRandomness):
+ (chromiumSleep):
+ (chromiumCurrentTime):
+ (chromiumGetLastError):
+ (WebCore::SQLiteFileSystem::registerSQLiteVFS):
+
+2010-09-24 Andreas Kling <andreas.kling@nokia.com>
+
+ Reviewed by Dirk Schulze.
+
+ SVG: Make SVGLength's stringToLengthType() stricter and faster
+ https://bugs.webkit.org/show_bug.cgi?id=46066
+
+ Only accept unit names immediately following the numeric value.
+ This behavior matches Gecko.
+
+ Also, using String::endsWith("foo") caused a temporary WTF::String to be created.
+ Avoid this by comparing characters directly.
+
+ 10.5% speedup on <http://data.xeoh.net/svg.benchmark/>
+
+ Test: svg/custom/invalid-length-units.html
+
+ * svg/SVGLength.cpp:
+ (WebCore::stringToLengthType):
+ (WebCore::SVGLength::setValueAsString):
+
+2010-09-24 Luiz Agostini <luiz.agostini@openbossa.org>
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Keep viewport information in Document
+ https://bugs.webkit.org/show_bug.cgi?id=46385
+
+ The viewport meta data (layout viewport, scale) needs to be set again when bringing
+ back a page from the page cache. As the viewport metadata is only retrieved while parsing
+ the document, we need to store it in the Document class.
+
+ Test: fast/viewport/viewport-128.html
+
+ * WebCore.xcodeproj/project.pbxproj:
+ * dom/Document.cpp:
+ (WebCore::Document::processViewport):
+ (WebCore::Document::setInPageCache):
+ * dom/Document.h:
+ (WebCore::Document::viewportArguments):
+
+2010-09-24 David Hyatt <hyatt@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ https://bugs.webkit.org/show_bug.cgi?id=46496, rename containingBlockWidthForContent to
+ containingBlockLogicalWidthForContent.
+
+ * rendering/RenderBlock.cpp:
+ (WebCore::RenderBlock::localCaretRect):
+ * rendering/RenderBox.cpp:
+ (WebCore::RenderBox::containingBlockLogicalWidthForContent):
+ (WebCore::RenderBox::computeLogicalWidth):
+ (WebCore::RenderBox::computeReplacedWidthUsing):
+ * rendering/RenderBox.h:
+ * rendering/RenderBoxModelObject.cpp:
+ (WebCore::RenderBoxModelObject::relativePositionOffsetX):
+ (WebCore::RenderBoxModelObject::containingBlockLogicalWidthForContent):
+ * rendering/RenderBoxModelObject.h:
+
+2010-09-24 David Hyatt <hyatt@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ https://bugs.webkit.org/show_bug.cgi?id=46489, rename the lineWidth and left/RightOffset methods
+ to reflect that they will be logical.
+
+ * rendering/RenderBlock.cpp:
+ (WebCore::RenderBlock::determineHorizontalPosition):
+ (WebCore::RenderBlock::leftSelectionOffset):
+ (WebCore::RenderBlock::rightSelectionOffset):
+ (WebCore::RenderBlock::positionNewFloats):
+ (WebCore::RenderBlock::logicalLeftOffsetForContent):
+ (WebCore::RenderBlock::logicalLeftOffsetForLine):
+ (WebCore::RenderBlock::logicalRightOffsetForContent):
+ (WebCore::RenderBlock::logicalRightOffsetForLine):
+ (WebCore::RenderBlock::availableLogicalWidthForLine):
+ (WebCore::RenderBlock::getClearDelta):
+ * rendering/RenderBlock.h:
+ (WebCore::RenderBlock::logicalRightOffsetForLine):
+ (WebCore::RenderBlock::logicalLeftOffsetForLine):
+ * rendering/RenderBlockLineLayout.cpp:
+ (WebCore::RenderBlock::computeInlineDirectionPositionsForLine):
+ (WebCore::RenderBlock::layoutInlineChildren):
+ (WebCore::RenderBlock::skipTrailingWhitespace):
+ (WebCore::RenderBlock::skipLeadingWhitespace):
+ (WebCore::RenderBlock::fitBelowFloats):
+ (WebCore::RenderBlock::findNextLineBreak):
+ (WebCore::RenderBlock::checkLinesForTextOverflow):
+ * rendering/RenderBox.cpp:
+ (WebCore::RenderBox::containingBlockWidthForContent):
+ * rendering/RenderFlexibleBox.cpp:
+ (WebCore::RenderFlexibleBox::applyLineClamp):
+ * rendering/RenderListItem.cpp:
+ (WebCore::RenderListItem::positionListMarker):
+ * rendering/RenderTable.cpp:
+ (WebCore::RenderTable::computeLogicalWidth):
+ * rendering/RootInlineBox.cpp:
+ (WebCore::RootInlineBox::selectionTop):
+
+2010-09-24 Abhishek Arya <inferno@chromium.org>
+
+ Reviewed by Simon Fraser.
+
+ Comply with spec by generalizing container on which transforms can be applied.
+ https://bugs.webkit.org/show_bug.cgi?id=46485
+
+ Already covered by existing tests.
+
+ * rendering/RenderObject.cpp:
+ (WebCore::RenderObject::getTransformFromContainer):
+
+2010-09-24 David Hyatt <hyatt@apple.com>
+
+ Reviewed by Simon Fraser.
+
+ https://bugs.webkit.org/show_bug.cgi?id=46482, rename the various prefWidth functions to use
+ preferredLogicalWidth.
+
+ * rendering/AutoTableLayout.cpp:
+ (WebCore::AutoTableLayout::recalcColumn):
+ (WebCore::AutoTableLayout::computePreferredLogicalWidths):
+ (WebCore::AutoTableLayout::calcEffectiveWidth):
+ * rendering/AutoTableLayout.h:
+ * rendering/FixedTableLayout.cpp:
+ (WebCore::FixedTableLayout::calcWidthArray):
+ (WebCore::FixedTableLayout::computePreferredLogicalWidths):
+ * rendering/FixedTableLayout.h:
+ * rendering/RenderBlock.cpp:
+ (WebCore::RenderBlock::layoutBlockChildren):
+ (WebCore::RenderBlock::layoutPositionedObjects):
+ (WebCore::RenderBlock::getClearDelta):
+ (WebCore::RenderBlock::computePreferredLogicalWidths):
+ (WebCore::RenderBlock::computeInlinePreferredLogicalWidths):
+ (WebCore::RenderBlock::computeBlockPreferredLogicalWidths):
+ * rendering/RenderBlock.h:
+ * rendering/RenderBlockLineLayout.cpp:
+ (WebCore::dirtyLineBoxesForRenderer):
+ (WebCore::RenderBlock::layoutInlineChildren):
+ * rendering/RenderBox.cpp:
+ (WebCore::RenderBox::RenderBox):
+ (WebCore::RenderBox::minPreferredLogicalWidth):
+ (WebCore::RenderBox::maxPreferredLogicalWidth):
+ (WebCore::RenderBox::computeLogicalWidth):
+ (WebCore::RenderBox::computeLogicalWidthUsing):
+ (WebCore::RenderBox::computePositionedLogicalWidth):
+ (WebCore::RenderBox::computePositionedLogicalWidthUsing):
+ * rendering/RenderBox.h:
+ (WebCore::RenderBox::computePreferredLogicalWidths):
+ * rendering/RenderCounter.cpp:
+ (WebCore::RenderCounter::computePreferredLogicalWidths):
+ * rendering/RenderCounter.h:
+ * rendering/RenderDataGrid.cpp:
+ (WebCore::RenderDataGrid::computePreferredLogicalWidths):
+ * rendering/RenderDataGrid.h:
+ * rendering/RenderFieldset.cpp:
+ (WebCore::RenderFieldset::computePreferredLogicalWidths):
+ * rendering/RenderFieldset.h:
+ * rendering/RenderFileUploadControl.cpp:
+ (WebCore::RenderFileUploadControl::computePreferredLogicalWidths):
+ * rendering/RenderFileUploadControl.h:
+ * rendering/RenderFlexibleBox.cpp:
+ (WebCore::RenderFlexibleBox::calcHorizontalPrefWidths):
+ (WebCore::RenderFlexibleBox::calcVerticalPrefWidths):
+ (WebCore::RenderFlexibleBox::computePreferredLogicalWidths):
+ (WebCore::RenderFlexibleBox::allowedChildFlex):
+ * rendering/RenderFlexibleBox.h:
+ * rendering/RenderFrameBase.cpp:
+ (WebCore::RenderFrameBase::layoutWithFlattening):
+ * rendering/RenderHTMLCanvas.cpp:
+ (WebCore::RenderHTMLCanvas::canvasSizeChanged):
+ * rendering/RenderImage.cpp:
+ (WebCore::RenderImage::imageChanged):
+ * rendering/RenderListBox.cpp:
+ (WebCore::RenderListBox::computePreferredLogicalWidths):
+ * rendering/RenderListBox.h:
+ * rendering/RenderListItem.cpp:
+ (WebCore::RenderListItem::updateMarkerLocation):
+ (WebCore::RenderListItem::computePreferredLogicalWidths):
+ * rendering/RenderListItem.h:
+ * rendering/RenderListMarker.cpp:
+ (WebCore::RenderListMarker::layout):
+ (WebCore::RenderListMarker::computePreferredLogicalWidths):
+ (WebCore::RenderListMarker::updateMargins):
+ * rendering/RenderListMarker.h:
+ * rendering/RenderMenuList.cpp:
+ (WebCore::RenderMenuList::computePreferredLogicalWidths):
+ * rendering/RenderMenuList.h:
+ * rendering/RenderObject.cpp:
+ (WebCore::RenderObject::RenderObject):
+ (WebCore::RenderObject::setPreferredLogicalWidthsDirty):
+ (WebCore::RenderObject::invalidateContainerPreferredLogicalWidths):
+ * rendering/RenderObject.h:
+ (WebCore::RenderObject::preferredLogicalWidthsDirty):
+ (WebCore::RenderObject::setNeedsLayoutAndPrefWidthsRecalc):
+ (WebCore::RenderObject::minPreferredLogicalWidth):
+ (WebCore::RenderObject::maxPreferredLogicalWidth):
+ * rendering/RenderReplaced.cpp:
+ (WebCore::RenderReplaced::computePreferredLogicalWidths):
+ * rendering/RenderReplaced.h:
+ * rendering/RenderReplica.cpp:
+ (WebCore::RenderReplica::computePreferredLogicalWidths):
+ * rendering/RenderReplica.h:
+ * rendering/RenderSVGRoot.cpp:
+ (WebCore::RenderSVGRoot::computePreferredLogicalWidths):
+ * rendering/RenderSVGRoot.h:
+ * rendering/RenderScrollbarPart.cpp:
+ (WebCore::RenderScrollbarPart::computePreferredLogicalWidths):
+ * rendering/RenderScrollbarPart.h:
+ * rendering/RenderSlider.cpp:
+ (WebCore::RenderSlider::computePreferredLogicalWidths):
+ * rendering/RenderSlider.h:
+ * rendering/RenderTable.cpp:
+ (WebCore::RenderTable::computeLogicalWidth):
+ (WebCore::RenderTable::computePreferredLogicalWidths):
+ * rendering/RenderTable.h:
+ * rendering/RenderTableCell.cpp:
+ (WebCore::RenderTableCell::computePreferredLogicalWidths):
+ * rendering/RenderTableCell.h:
+ * rendering/RenderTableCol.cpp:
+ (WebCore::RenderTableCol::computePreferredLogicalWidths):
+ * rendering/RenderTableCol.h:
+ * rendering/RenderText.cpp:
+ (WebCore::RenderText::trimmedPrefWidths):
+ (WebCore::RenderText::minPreferredLogicalWidth):
+ (WebCore::RenderText::maxPreferredLogicalWidth):
+ (WebCore::RenderText::computePreferredLogicalWidths):
+ (WebCore::RenderText::width):
+ * rendering/RenderText.h:
+ * rendering/RenderTextControl.cpp:
+ (WebCore::RenderTextControl::computePreferredLogicalWidths):
+ * rendering/RenderTextControl.h:
+ * rendering/RenderTextControlSingleLine.cpp:
+ (WebCore::RenderTextControlSingleLine::preferredContentWidth):
+ (WebCore::RenderTextControlSingleLine::preferredDecorationWidthRight):
+ * rendering/RenderVideo.cpp:
+ (WebCore::RenderVideo::updateIntrinsicSize):
+ * rendering/RenderView.cpp:
+ (WebCore::RenderView::RenderView):
+ (WebCore::RenderView::computePreferredLogicalWidths):
+ (WebCore::RenderView::layout):
+ * rendering/RenderView.h:
+ * rendering/TableLayout.h:
+
+2010-09-24 Jian Li <jianli@chromium.org>
+
+ Reviewed by Alexey Proskuryakov.
+
+ DOMWindow::revokeBlobURL erroneously uses ParsedURLString.
+ https://bugs.webkit.org/show_bug.cgi?id=46434
+
+ Test: fast/files/revoke-blob-url.html
+
+ * page/DOMWindow.cpp:
+ (WebCore::DOMWindow::revokeBlobURL):
+
+2010-09-24 David Hyatt <hyatt@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ https://bugs.webkit.org/show_bug.cgi?id=46474
+
+ Patch computeWidthUsing to be block-flow-aware. Rename the WidthType enum to LogicalWidthType. Make computeLogicalWidthUsing
+ query the style for logical width properties instead of width properties.
+
+ fast/css/logical-property-resolution.html now fails and gives bad results. This is expected. It will become correct
+ again as more layout code gets patched.
+
+ * rendering/RenderBox.cpp:
+ (WebCore::RenderBox::computeLogicalWidth):
+ (WebCore::RenderBox::computeLogicalWidthUsing):
+ (WebCore::RenderBox::sizesToIntrinsicWidth):
+ * rendering/RenderBox.h:
+
+2010-09-24 Andrey Kosyakov <caseq@chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ Web Inspector: Clicking "Select All" in audits panel has no effect when the checkbox is unchecked
+ Only add category event listeners to real categories, not to "Select All"
+ https://bugs.webkit.org/show_bug.cgi?id=46467
+
+ * inspector/front-end/AuditLauncherView.js:
+ (WebInspector.AuditLauncherView.prototype._createCategoryElement):
+
+2010-09-24 Hans Wennborg <hans@chromium.org>
+
+ Reviewed by Steve Block.
+
+ Remove unnecessary casts in DeviceOrientation V8 bindings
+ https://bugs.webkit.org/show_bug.cgi?id=46466
+
+ Remove unnecessary casts of v8::Value::NumberValue() to double from
+ the custom v8 bindings code for DeviceOrientation/Motion.
+
+ No new tests: just cleanup, no new functionality.
+
+ * bindings/v8/custom/V8DeviceMotionEventCustom.cpp:
+ (WebCore::V8DeviceMotionEvent::initDeviceMotionEventCallback):
+ * bindings/v8/custom/V8DeviceOrientationEventCustom.cpp:
+ (WebCore::V8DeviceOrientationEvent::initDeviceOrientationEventCallback):
+
+2010-09-24 Ilya Tikhonovsky <loislo@chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ Web Inspector: move searchingForNode flag in InspectorController under control of InspectorCookies.
+
+ Four functions from Inspector IDL go away.
+ Searching for node feature of Inspector keeps alive even after navigation.
+
+ https://bugs.webkit.org/show_bug.cgi?id=46462
+
+ * inspector/Inspector.idl:
+ * inspector/InspectorController.cpp:
+ (WebCore::InspectorController::updateInspectorStateCookie):
+ (WebCore::InspectorController::restoreInspectorStateFromCookie):
+ (WebCore::InspectorController::setSearchingForNode):
+ (WebCore::InspectorController::populateScriptObjects):
+ * inspector/InspectorController.h:
+ * inspector/front-end/ElementsPanel.js:
+ (WebInspector.ElementsPanel.prototype.hide):
+ (WebInspector.ElementsPanel.prototype.updateFocusedNode):
+ (WebInspector.ElementsPanel.prototype._setSearchingForNode):
+ (WebInspector.ElementsPanel.prototype.setSearchingForNode):
+ (WebInspector.ElementsPanel.prototype.toggleSearchingForNode):
+ * inspector/front-end/inspector.js:
+ (WebInspector._updateFocusedNode):
+
+2010-09-24 Andrei Popescu <andreip@google.com>
+
+ Reviewed by Jeremy Orlow.
+
+ IDBTransactionCoordinator incorrectly assumes that aborted transactions must have been started or running.
+ https://bugs.webkit.org/show_bug.cgi?id=46459
+
+ No new tests, storage/indexeddb/transaction-basics.html covers this.
+
+ Also fixes http://code.google.com/p/chromium/issues/detail?id=56732
+
+ * storage/IDBTransactionCoordinator.cpp:
+ (WebCore::IDBTransactionCoordinator::didFinishTransaction):
+
+2010-09-24 Hans Wennborg <hans@chromium.org>
+
+ Reviewed by Steve Block.
+
+ Update DeviceMotionEvent to spec
+ https://bugs.webkit.org/show_bug.cgi?id=46344
+
+ The spec has changed: the DeviceMotionEvent attributes accelerationX,
+ accelerationY, etc. have been baked into an 'acceleration' attribute
+ which returns an object with x, y, and z values. Likewise for the
+ rotation rate. The 'accelerationIncludingGravity' attribute is new.
+
+ * WebCore.exp.in:
+ The DeviceMotionData::create member function has changed. Also export
+ create functions for DeviceMotionData::Acceleration and RotationRate.
+
+ * bindings/js/JSDeviceMotionEventCustom.cpp:
+ (WebCore::JSDeviceMotionEvent::acceleration):
+ (WebCore::JSDeviceMotionEvent::accelerationIncludingGravity):
+ (WebCore::JSDeviceMotionEvent::rotationRate):
+ (WebCore::JSDeviceMotionEvent::initDeviceMotionEvent):
+ Manually create and return objects with the right attributes for
+ acceleration, accelerationIncludingGravity, and rotationRate.
+ When creating the DeviceMotionData object in initDeviceMotionEvent,
+ accept any input objects that have the right attributes.
+
+ * bindings/v8/custom/V8DeviceMotionEventCustom.cpp:
+ (WebCore::V8DeviceMotionEvent::accelerationAccessorGetter):
+ (WebCore::V8DeviceMotionEvent::accelerationIncludingGravityAccessorGetter):
+ (WebCore::V8DeviceMotionEvent::rotationRateAccessorGetter):
+ (WebCore::V8DeviceMotionEvent::initDeviceMotionEventCallback):
+ V8 counterpart to the JSC code above.
+
+ * dom/DeviceMotionData.cpp:
+ (WebCore::DeviceMotionData::Acceleration::create):
+ (WebCore::DeviceMotionData::Acceleration::Acceleration):
+ (WebCore::DeviceMotionData::RotationRate::create):
+ (WebCore::DeviceMotionData::RotationRate::RotationRate):
+ (WebCore::DeviceMotionData::create):
+ (WebCore::DeviceMotionData::DeviceMotionData):
+ * dom/DeviceMotionData.h:
+ (WebCore::DeviceMotionData::Acceleration::canProvideX):
+ (WebCore::DeviceMotionData::Acceleration::canProvideY):
+ (WebCore::DeviceMotionData::Acceleration::canProvideZ):
+ (WebCore::DeviceMotionData::Acceleration::x):
+ (WebCore::DeviceMotionData::Acceleration::y):
+ (WebCore::DeviceMotionData::Acceleration::z):
+ (WebCore::DeviceMotionData::RotationRate::canProvideAlpha):
+ (WebCore::DeviceMotionData::RotationRate::canProvideBeta):
+ (WebCore::DeviceMotionData::RotationRate::canProvideGamma):
+ (WebCore::DeviceMotionData::RotationRate::alpha):
+ (WebCore::DeviceMotionData::RotationRate::beta):
+ (WebCore::DeviceMotionData::RotationRate::gamma):
+ (WebCore::DeviceMotionData::acceleration):
+ (WebCore::DeviceMotionData::accelerationIncludingGravity):
+ (WebCore::DeviceMotionData::rotationRate):
+ Add member classes Acceleration and RotationRate to DeviceMotionData.
+
+ * dom/DeviceMotionEvent.idl:
+ Update according to the spec. Acceleration and RotationRate need not
+ be backed by native classes.
+
+2010-09-24 Romain Pokrzywka <romain@kdab.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Fix the Wince build.
+
+ * WebCore.pro: Apply msvc flags to wince, too.
+
+2010-09-24 Anders Bakken <agbakken@gmail.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Enable building Qt/Webkit with debug symbols
+
+ With this patch one can configure with -webkit-debug to build Webkit
+ with debug symbols without having to manually edit WebCore.pro.
+
+ * WebCore.pro:
+
+2010-09-24 Yael Aharon <yael.aharon@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Web Sockets are insecure with QtWebKit
+ https://bugs.webkit.org/show_bug.cgi?id=44769
+
+ Throw an error when the server certificate is not valid.
+ DRT currently does not support secure websocket connection,
+ so no new tests. This was tested with the server at
+ http://code.google.com/p/pywebsocket instead.
+
+ * platform/network/qt/SocketStreamHandleQt.cpp:
+ (WebCore::SocketStreamHandlePrivate::socketSslErrors):
+
+2010-09-24 Jia Pu <jpu@apple.com>
+
+ Reviewed by Shinichiro Hamaji.
+
+ Need to remove autocorrection underlines in current line when newline is entered.
+ https://bugs.webkit.org/show_bug.cgi?id=45709
+ <rdar://problem/8335576>
+
+ This change affects only Mac OSX build.
+
+ * dom/DocumentMarker.h: Added "CorrectionIndicator" to indicate the words on which we need
+ to draw autocorrection underline. We cannot use existing "Replacement" for this purpose,
+ since it is not meant to be removed once it is added. But we need to remove all autocorrection
+ underlines when a line break or paragraph separator is inserted, which is the behavior in
+ NSTextView. Hence we need a separate marker value for drawing autocorrection underline.
+
+ * editing/Editor.cpp:
+ (WebCore::Editor::markAllMisspellingsAndBadGrammarInRanges): Add "CorrectionIndicator" when
+ autocorrection takes place.
+ (WebCore::Editor::changeSelectionAfterCommand): Remove "CorrectionIndicator" markers if the
+ command results in inserting paragraph separator.
+
+ * rendering/InlineTextBox.cpp:
+ (WebCore::textCheckingLineStyleForMarkerType): Use "CorrectionIndicator" marker instead of
+ "Replacement" to draw autocorrection underline.
+ (WebCore::InlineTextBox::paintDocumentMarkers): Ditto.
+
+2010-09-24 Eric Uhrhane <ericu@chromium.org>
+
+ Reviewed by David Levin.
+
+ Remove unnecessary parameter from AsyncFileWriterClient::didTruncate
+ https://bugs.webkit.org/show_bug.cgi?id=46390
+
+ * fileapi/AsyncFileWriterClient.h:
+
+ Added state to FileWriter to replace the parameter.
+ * fileapi/FileWriter.h:
+ * fileapi/FileWriter.cpp:
+ (WebCore::FileWriter::truncate):
+ (WebCore::FileWriter::didTruncate):
+
+2010-09-24 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r68236.
+ http://trac.webkit.org/changeset/68236
+ https://bugs.webkit.org/show_bug.cgi?id=46449
+
+ compile fix didn't work (Requested by dino___ on #webkit).
+
+ * WebCore.exp.in:
+ * bindings/js/JSDeviceMotionEventCustom.cpp:
+ (WebCore::JSDeviceMotionEvent::xAcceleration):
+ (WebCore::JSDeviceMotionEvent::yAcceleration):
+ (WebCore::JSDeviceMotionEvent::zAcceleration):
+ (WebCore::JSDeviceMotionEvent::xRotationRate):
+ (WebCore::JSDeviceMotionEvent::yRotationRate):
+ (WebCore::JSDeviceMotionEvent::zRotationRate):
+ (WebCore::JSDeviceMotionEvent::initDeviceMotionEvent):
+ * bindings/v8/custom/V8DeviceMotionEventCustom.cpp:
+ (WebCore::V8DeviceMotionEvent::xAccelerationAccessorGetter):
+ (WebCore::V8DeviceMotionEvent::yAccelerationAccessorGetter):
+ (WebCore::V8DeviceMotionEvent::zAccelerationAccessorGetter):
+ (WebCore::V8DeviceMotionEvent::xRotationRateAccessorGetter):
+ (WebCore::V8DeviceMotionEvent::yRotationRateAccessorGetter):
+ (WebCore::V8DeviceMotionEvent::zRotationRateAccessorGetter):
+ (WebCore::V8DeviceMotionEvent::initDeviceMotionEventCallback):
+ * dom/DeviceMotionData.cpp:
+ (WebCore::DeviceMotionData::create):
+ (WebCore::DeviceMotionData::DeviceMotionData):
+ * dom/DeviceMotionData.h:
+ (WebCore::DeviceMotionData::xAcceleration):
+ (WebCore::DeviceMotionData::yAcceleration):
+ (WebCore::DeviceMotionData::zAcceleration):
+ (WebCore::DeviceMotionData::xRotationRate):
+ (WebCore::DeviceMotionData::yRotationRate):
+ (WebCore::DeviceMotionData::zRotationRate):
+ (WebCore::DeviceMotionData::canProvideXAcceleration):
+ (WebCore::DeviceMotionData::canProvideYAcceleration):
+ (WebCore::DeviceMotionData::canProvideZAcceleration):
+ (WebCore::DeviceMotionData::canProvideXRotationRate):
+ (WebCore::DeviceMotionData::canProvideYRotationRate):
+ (WebCore::DeviceMotionData::canProvideZRotationRate):
+ * dom/DeviceMotionEvent.idl:
+
+2010-09-24 Chris Guillory <chris.guillory@google.com>
+
+ Reviewed by Chris Fleizach.
+
+ Send webkit accessibility notifications to Chromium.
+ https://bugs.webkit.org/show_bug.cgi?id=45156
+
+ * WebCore.gypi:
+ * accessibility/chromium/AXObjectCacheChromium.cpp:
+ (WebCore::AXObjectCache::postPlatformNotification):
+ (WebCore::AXObjectCache::handleFocusedUIElementChanged):
+ (WebCore::AXObjectCache::handleScrolledToAnchor):
+ * dom/Document.cpp:
+ (WebCore::Document::implicitClose):
+ (WebCore::Document::setFocusedNode):
+ * editing/SelectionController.h:
+ * page/ChromeClient.h:
+ (WebCore::ChromeClient::postAccessibilityNotification):
+ * page/FrameView.cpp:
+ (WebCore::FrameView::layout):
+
+2010-09-24 David Hyatt <hyatt@apple.com>
+
+ Reviewed by Maciej Stachowiak.
+
+ https://bugs.webkit.org/show_bug.cgi?id=46454, rename a bunch of the width and height calculation methods.
+
+ calcReplacedWidth -> computeReplacedWidth
+
+ calcHorizontalMargins -> computeInlineDirectionMargins
+
+ calcVerticalMargins -> computeBlockDirectionMargins
+
+ calcWidthUsing -> computeLogicalWidthUsing
+
+ calcHeightUsing -> computeLogicalHeightUsing
+
+ calcReplacedHeight/HeightUsing -> computeReplacedHeight/HeightUsing
+
+ calcAbsoluteHorizontalValues -> computePositionedLogicalWidthUsing
+
+ calcAbsoluteVerticalValues -> computePositionedLogicalHeightUsing
+
+ calcAbsoluteHorizontal -> computePositionedLogicalWIdth
+
+ calcAbsoluteVertical -> computePositionedLogicalHeight
+
+ calcAbsoluteHorizontalReplaced -> computePositionedLogicalWidthReplaced
+
+ calcAbsoluteVerticalReplaced -> computePositionedLogicalHeightReplaced
+
+ calcBorderBoxWidth/Height -> computeBorderBoxLogicalWidth/LogicalHeight
+
+ calcContentBoxWidth/Height -> computeContentBoxLogicalWidth/LogicalHeight
+
+ shouldCalculateSizeAsReplaced -> shouldComputeSizeAsReplaced
+
+ calcPercentageHeight -> computePercentageLogicalHeight
+
+ * rendering/AutoTableLayout.cpp:
+ (WebCore::AutoTableLayout::recalcColumn):
+ * rendering/RenderBlock.cpp:
+ (WebCore::RenderBlock::adjustPositionedBlock):
+ (WebCore::RenderBlock::determineHorizontalPosition):
+ (WebCore::RenderBlock::layoutBlockChild):
+ (WebCore::RenderBlock::insertFloatingObject):
+ (WebCore::RenderBlock::calcPrefWidths):
+ * rendering/RenderBox.cpp:
+ (WebCore::RenderBox::computeBorderBoxLogicalWidth):
+ (WebCore::RenderBox::computeBorderBoxLogicalHeight):
+ (WebCore::RenderBox::computeContentBoxLogicalWidth):
+ (WebCore::RenderBox::computeContentBoxLogicalHeight):
+ (WebCore::RenderBox::computeLogicalWidth):
+ (WebCore::RenderBox::computeLogicalWidthUsing):
+ (WebCore::RenderBox::computeInlineDirectionMargins):
+ (WebCore::RenderBox::computeLogicalHeight):
+ (WebCore::RenderBox::computeLogicalHeightUsing):
+ (WebCore::RenderBox::computePercentageLogicalHeight):
+ (WebCore::RenderBox::computeReplacedWidth):
+ (WebCore::RenderBox::computeReplacedWidthUsing):
+ (WebCore::RenderBox::computeReplacedHeight):
+ (WebCore::RenderBox::computeReplacedHeightUsing):
+ (WebCore::RenderBox::availableHeightUsing):
+ (WebCore::RenderBox::computeBlockDirectionMargins):
+ (WebCore::RenderBox::computePositionedLogicalWidth):
+ (WebCore::RenderBox::computePositionedLogicalWidthUsing):
+ (WebCore::RenderBox::computePositionedLogicalHeight):
+ (WebCore::RenderBox::computePositionedLogicalHeightUsing):
+ (WebCore::RenderBox::computePositionedLogicalWidthReplaced):
+ (WebCore::RenderBox::computePositionedLogicalHeightReplaced):
+ * rendering/RenderBox.h:
+ (WebCore::RenderBox::shouldComputeSizeAsReplaced):
+ * rendering/RenderDataGrid.cpp:
+ (WebCore::RenderDataGrid::calcPrefWidths):
+ * rendering/RenderFileUploadControl.cpp:
+ (WebCore::RenderFileUploadControl::calcPrefWidths):
+ * rendering/RenderFlexibleBox.cpp:
+ (WebCore::RenderFlexibleBox::calcPrefWidths):
+ (WebCore::RenderFlexibleBox::layoutHorizontalBox):
+ (WebCore::RenderFlexibleBox::layoutVerticalBox):
+ * rendering/RenderImage.cpp:
+ (WebCore::RenderImage::computeReplacedWidth):
+ (WebCore::RenderImage::computeReplacedHeight):
+ (WebCore::RenderImage::calcAspectRatioWidth):
+ (WebCore::RenderImage::calcAspectRatioHeight):
+ * rendering/RenderImage.h:
+ * rendering/RenderListBox.cpp:
+ (WebCore::RenderListBox::calcPrefWidths):
+ * rendering/RenderMenuList.cpp:
+ (WebCore::RenderMenuList::calcPrefWidths):
+ * rendering/RenderObject.cpp:
+ (WebCore::RenderObject::container):
+ * rendering/RenderObject.h:
+ (WebCore::RenderObject::computeBlockDirectionMargins):
+ * rendering/RenderReplaced.cpp:
+ (WebCore::RenderReplaced::computeReplacedWidth):
+ (WebCore::RenderReplaced::computeReplacedHeight):
+ (WebCore::RenderReplaced::calcAspectRatioWidth):
+ (WebCore::RenderReplaced::calcAspectRatioHeight):
+ (WebCore::RenderReplaced::calcPrefWidths):
+ * rendering/RenderReplaced.h:
+ * rendering/RenderSVGRoot.cpp:
+ (WebCore::RenderSVGRoot::calcPrefWidths):
+ (WebCore::RenderSVGRoot::computeReplacedWidth):
+ (WebCore::RenderSVGRoot::computeReplacedHeight):
+ * rendering/RenderSVGRoot.h:
+ * rendering/RenderSlider.cpp:
+ (WebCore::RenderSlider::calcPrefWidths):
+ * rendering/RenderTable.cpp:
+ (WebCore::RenderTable::computeLogicalWidth):
+ (WebCore::RenderTable::layout):
+ * rendering/RenderTableRow.cpp:
+ (WebCore::RenderTableRow::layout):
+ * rendering/RenderTextControl.cpp:
+ (WebCore::RenderTextControl::calcPrefWidths):
+ * rendering/RenderVideo.cpp:
+ (WebCore::RenderVideo::computeReplacedWidth):
+ (WebCore::RenderVideo::computeReplacedHeight):
+ * rendering/RenderVideo.h:
+
+2010-09-23 David Hyatt <hyatt@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ https://bugs.webkit.org/show_bug.cgi?id=46451
+
+ Rename calcWidth to computeLogicalWidth. Rename calcHeight to computeLogicalHeight.
+
+ * rendering/RenderApplet.cpp:
+ (WebCore::RenderApplet::layout):
+ * rendering/RenderBlock.cpp:
+ (WebCore::RenderBlock::layoutBlock):
+ (WebCore::RenderBlock::insertFloatingObject):
+ (WebCore::RenderBlock::getClearDelta):
+ * rendering/RenderBlockLineLayout.cpp:
+ (WebCore::RenderBlock::computeInlineDirectionPositionsForLine):
+ * rendering/RenderBox.cpp:
+ (WebCore::RenderBox::computeLogicalWidth):
+ (WebCore::RenderBox::computeLogicalHeight):
+ (WebCore::RenderBox::calcPercentageHeight):
+ (WebCore::RenderBox::calcReplacedHeightUsing):
+ (WebCore::RenderBox::availableHeightUsing):
+ (WebCore::RenderBox::calcAbsoluteHorizontal):
+ * rendering/RenderBox.h:
+ (WebCore::RenderBox::tryLayoutDoingPositionedMovementOnly):
+ * rendering/RenderEmbeddedObject.cpp:
+ (WebCore::RenderEmbeddedObject::layout):
+ * rendering/RenderFlexibleBox.cpp:
+ (WebCore::RenderFlexibleBox::layoutBlock):
+ (WebCore::RenderFlexibleBox::layoutHorizontalBox):
+ (WebCore::RenderFlexibleBox::layoutVerticalBox):
+ * rendering/RenderForeignObject.cpp:
+ (WebCore::RenderForeignObject::computeLogicalWidth):
+ (WebCore::RenderForeignObject::computeLogicalHeight):
+ * rendering/RenderForeignObject.h:
+ * rendering/RenderHTMLCanvas.cpp:
+ (WebCore::RenderHTMLCanvas::canvasSizeChanged):
+ * rendering/RenderIFrame.cpp:
+ (WebCore::RenderIFrame::computeLogicalHeight):
+ (WebCore::RenderIFrame::computeLogicalWidth):
+ (WebCore::RenderIFrame::layout):
+ * rendering/RenderIFrame.h:
+ * rendering/RenderImage.cpp:
+ (WebCore::RenderImage::imageChanged):
+ * rendering/RenderIndicator.cpp:
+ (WebCore::RenderIndicator::layout):
+ * rendering/RenderListBox.cpp:
+ (WebCore::RenderListBox::computeLogicalHeight):
+ * rendering/RenderListBox.h:
+ * rendering/RenderMeter.cpp:
+ (WebCore::RenderMeter::computeLogicalWidth):
+ (WebCore::RenderMeter::computeLogicalHeight):
+ * rendering/RenderMeter.h:
+ * rendering/RenderReplaced.cpp:
+ (WebCore::RenderReplaced::layout):
+ * rendering/RenderSVGRoot.cpp:
+ (WebCore::RenderSVGRoot::layout):
+ * rendering/RenderSlider.cpp:
+ (WebCore::RenderSlider::layout):
+ * rendering/RenderTable.cpp:
+ (WebCore::RenderTable::computeLogicalWidth):
+ (WebCore::RenderTable::layout):
+ * rendering/RenderTable.h:
+ * rendering/RenderTableCell.cpp:
+ (WebCore::RenderTableCell::computeLogicalWidth):
+ * rendering/RenderTableCell.h:
+ * rendering/RenderTextControl.cpp:
+ (WebCore::RenderTextControl::computeLogicalHeight):
+ * rendering/RenderTextControl.h:
+ * rendering/RenderTextControlSingleLine.cpp:
+ (WebCore::RenderTextControlSingleLine::layout):
+ (WebCore::RenderTextControlSingleLine::textBlockWidth):
+ (WebCore::RenderTextControlSingleLine::decorationWidthRight):
+ (WebCore::RenderTextControlSingleLine::preferredDecorationWidthRight):
+ (WebCore::RenderTextControlSingleLine::adjustControlHeightBasedOnLineHeight):
+ * rendering/RenderView.cpp:
+ (WebCore::RenderView::computeLogicalHeight):
+ (WebCore::RenderView::computeLogicalWidth):
+ * rendering/RenderView.h:
+ * svg/SVGSVGElement.cpp:
+ (WebCore::SVGSVGElement::svgAttributeChanged):
+
+2010-09-23 Hans Wennborg <hans@chromium.org>
+
+ Reviewed by Simon Fraser.
+
+ Update DeviceMotionEvent to spec
+ https://bugs.webkit.org/show_bug.cgi?id=46344
+
+ The spec has changed: the DeviceMotionEvent attributes accelerationX,
+ accelerationY, etc. have been baked into an 'acceleration' attribute
+ which returns an object with x, y, and z values. Likewise for the
+ rotation rate. The 'accelerationIncludingGravity' attribute is new.
+
+ * WebCore.exp.in:
+ The DeviceMotionData::create member function has changed. Also export
+ create functions for DeviceMotionData::Acceleration and RotationRate.
+
+ * bindings/js/JSDeviceMotionEventCustom.cpp:
+ (WebCore::JSDeviceMotionEvent::acceleration):
+ (WebCore::JSDeviceMotionEvent::accelerationIncludingGravity):
+ (WebCore::JSDeviceMotionEvent::rotationRate):
+ (WebCore::JSDeviceMotionEvent::initDeviceMotionEvent):
+ Manually create and return objects with the right attributes for
+ acceleration, accelerationIncludingGravity, and rotationRate.
+ When creating the DeviceMotionData object in initDeviceMotionEvent,
+ accept any input objects that have the right attributes.
+
+ * bindings/v8/custom/V8DeviceMotionEventCustom.cpp:
+ (WebCore::V8DeviceMotionEvent::accelerationAccessorGetter):
+ (WebCore::V8DeviceMotionEvent::accelerationIncludingGravityAccessorGetter):
+ (WebCore::V8DeviceMotionEvent::rotationRateAccessorGetter):
+ (WebCore::V8DeviceMotionEvent::initDeviceMotionEventCallback):
+ V8 counterpart to the JSC code above.
+
+ * dom/DeviceMotionData.cpp:
+ (WebCore::DeviceMotionData::Acceleration::create):
+ (WebCore::DeviceMotionData::Acceleration::Acceleration):
+ (WebCore::DeviceMotionData::RotationRate::create):
+ (WebCore::DeviceMotionData::RotationRate::RotationRate):
+ (WebCore::DeviceMotionData::create):
+ (WebCore::DeviceMotionData::DeviceMotionData):
+ * dom/DeviceMotionData.h:
+ (WebCore::DeviceMotionData::Acceleration::canProvideX):
+ (WebCore::DeviceMotionData::Acceleration::canProvideY):
+ (WebCore::DeviceMotionData::Acceleration::canProvideZ):
+ (WebCore::DeviceMotionData::Acceleration::x):
+ (WebCore::DeviceMotionData::Acceleration::y):
+ (WebCore::DeviceMotionData::Acceleration::z):
+ (WebCore::DeviceMotionData::RotationRate::canProvideAlpha):
+ (WebCore::DeviceMotionData::RotationRate::canProvideBeta):
+ (WebCore::DeviceMotionData::RotationRate::canProvideGamma):
+ (WebCore::DeviceMotionData::RotationRate::alpha):
+ (WebCore::DeviceMotionData::RotationRate::beta):
+ (WebCore::DeviceMotionData::RotationRate::gamma):
+ (WebCore::DeviceMotionData::acceleration):
+ (WebCore::DeviceMotionData::accelerationIncludingGravity):
+ (WebCore::DeviceMotionData::rotationRate):
+ Add member classes Acceleration and RotationRate to DeviceMotionData.
+
+ * dom/DeviceMotionEvent.idl:
+ Update according to the spec. Acceleration and RotationRate need not
+ be backed by native classes.
+
+2010-09-23 Simon Fraser <simon.fraser@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ Accelerated transitions do not suspend/resume properly.
+ https://bugs.webkit.org/show_bug.cgi?id=43792
+
+ Fix suspending of accelerated transitions.
+
+ GraphicsLayer changes unify the handling of transitions and animations
+ in GraphicsLayer. Both are now identified by name, so the code
+ now refers to "animationName" rather than "keyframesName". Transitions
+ use a dummy name which is not a valid keyframe identifier.
+
+ Tests: animations/suspend-transform-animation.html
+ transitions/suspend-transform-transition.html
+
+ * page/animation/ImplicitAnimation.h:
+ * page/animation/ImplicitAnimation.cpp:
+ (WebCore::ImplicitAnimation::pauseAnimation): Call down to the RenderLayerBacking
+ to tell it that an accelerated transition was paused.
+
+ * platform/graphics/GraphicsLayer.h:
+ * platform/graphics/GraphicsLayer.cpp:
+ (WebCore::GraphicsLayer::animationNameForTransition): Create a name
+ for the transition of the given property.
+ (WebCore::GraphicsLayer::addAnimation): Generalize "keyframe" to "animation" in the parameter names.
+ (WebCore::GraphicsLayer::pauseAnimation): ditto
+ (WebCore::GraphicsLayer::removeAnimation): ditto
+
+ * platform/graphics/mac/GraphicsLayerCA.h: Parameter renaming, and some method renames for clarity.
+ (WebCore::GraphicsLayerCA::animationIsRunning):
+ (WebCore::GraphicsLayerCA::LayerPropertyAnimation::LayerPropertyAnimation): struct rename for clarity.
+
+ * platform/graphics/mac/GraphicsLayerCA.mm:
+ (WebCore::animationIdentifier): the animationName already has the property baked in.
+ (WebCore::GraphicsLayerCA::moveOrCopyLayerAnimation): just deals with one animation now.
+ (WebCore::GraphicsLayerCA::moveOrCopyAnimationsForProperty): we have to trawl through
+ m_runningAnimations to get the identifiers for the animations that need to be copied.
+ (WebCore::GraphicsLayerCA::addAnimation): rename parameters.
+ (WebCore::GraphicsLayerCA::pauseAnimation): re-ordered methods here. member var renames.
+ (WebCore::GraphicsLayerCA::removeAnimation): ditto.
+ (WebCore::GraphicsLayerCA::updateLayerAnimations): no need to iterate over m_transitionPropertiesToRemove,
+ and no more divergence between transitions and animations.
+ (WebCore::GraphicsLayerCA::setCAAnimationOnLayer): renames for clarity.
+ (WebCore::GraphicsLayerCA::removeCAAnimationFromLayer): ditto
+ (WebCore::GraphicsLayerCA::pauseCAAnimationOnLayer): ditto
+ (WebCore::GraphicsLayerCA::createAnimationFromKeyframes): renames
+ (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes): renames
+ (WebCore::GraphicsLayerCA::suspendAnimations): whitespace.
+
+ * rendering/RenderLayerBacking.h: Group the transition and animation methods together.
+ * rendering/RenderLayerBacking.cpp:
+ (WebCore::RenderLayerBacking::animationPaused): Re-ordered methods for clarity.
+ (WebCore::RenderLayerBacking::animationFinished): ditto
+ (WebCore::RenderLayerBacking::startTransition): Use animationNameForTransition() to generate
+ the animation identifier.
+ (WebCore::RenderLayerBacking::transitionPaused): Call pauseAnimation, using animationNameForTransition()
+ to generate the animation identifier.
+ (WebCore::RenderLayerBacking::transitionFinished): Call removeAnimation, using animationNameForTransition()
+ to generate the animation identifier.
+ (WebCore::RenderLayerBacking::notifyAnimationStarted): Moved.
+ (WebCore::RenderLayerBacking::notifySyncRequired): Moved.
+
+2010-09-23 David Hyatt <hyatt@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ https://bugs.webkit.org/show_bug.cgi?id=46442
+
+ Disallow the setting of block-flow to anything other than "tb" for all table-related display types
+ and flexible box display types. By disallowing block-flow on the subclasses of RenderBlock like tables
+ and flexible boxes, we ensure that alterations to the RenderBlock base class won't result in misrenderings
+ in tables and flexible boxes that try to specify other block flow values.
+
+ * css/CSSStyleSelector.cpp:
+ (WebCore::CSSStyleSelector::adjustRenderStyle):
+
+2010-09-23 Kinuko Yasuda <kinuko@chromium.org>
+
+ Reviewed by David Levin.
+
+ Add Worker support for FileSystem API
+ https://bugs.webkit.org/show_bug.cgi?id=45808
+
+ Exposed requestFileSystem and Flags constructor on worker contexts.
+
+ Also changed how to get the base path for Web file systems (in
+ non-chromium ports) so that it works for workers too.
+ This patch assumes each port calls
+ LocalFileSystem::initializeLocalFileSystem() in its initialization
+ phase.
+
+ No new tests; tests will be added when we have complete implementation.
+
+ * bindings/generic/RuntimeEnabledFeatures.cpp:
+ (WebCore::RuntimeEnabledFeatures::fileSystemEnabled): Changed to
+ reflect AsyncFileSystem::isAvailable
+ * bindings/generic/RuntimeEnabledFeatures.h: Moved the implementation
+ of fileSystemEnabled to .cpp.
+ * fileapi/LocalFileSystem.cpp:
+ (WebCore::LocalFileSystem::initializeLocalFileSystem): Added.
+ (WebCore::LocalFileSystem::localFileSystem): Added.
+ (WebCore::LocalFileSystem::fileSystemBasePath): Added.
+ * fileapi/LocalFileSystem.h:
+ (WebCore::LocalFileSystem::~LocalFileSystem): Removed. (As now it's
+ going to be used as a singleton.)
+ * page/DOMWindow.cpp:
+ (WebCore::DOMWindow::requestFileSystem): Changed to use a singleton
+ instance of LocalFileSystem.
+ * page/SecurityOrigin.h:
+ (WebCore::SecurityOrigin::canAccessFileSystem): Added.
+ * page/Settings.cpp: Removed fileSystemRootPath method.
+ * page/Settings.h: Removed fileSystemRootPath method.
+ * platform/AsyncFileSystem.cpp:
+ (WebCore::AsyncFileSystem::isAvailable): Added.
+ * workers/WorkerContext.cpp:
+ (WebCore::WorkerContext::requestFileSystem): Added to expose
+ requestFileSystem method in worker contexts.
+ (WebCore::WorkerContext::Observer): Added.
+ (WebCore::WorkerContext::registerObserver): Added.
+ (WebCore::WorkerContext::unregisterObserver): Added.
+ (WebCore::WorkerContext::notifyObserversOfStop): Added.
+ * workers/WorkerContext.h:
+ * workers/WorkerContext.idl:
+ * workers/WorkerThread.cpp:
+ (WebCore::WorkerThreadShutdownStartTask::performTask): Modified to
+ call workerContext->notifyObserversOfStop to notify worker observers
+ of the worker thread termination.
+
+2010-09-23 Matthew Delaney <mdelaney@apple.com>
+
+ Reviewed by Oliver Hunt.
+
+ Lower the default canvas interpolation quality for platforms that use CG
+ https://bugs.webkit.org/show_bug.cgi?id=45722
+
+ Lowered the default image interpolation quality for platforms that
+ use CG down to low since this is as good as if not better than
+ other graphics platforms defaults (being bilinear interpolation).
+
+ * html/HTMLCanvasElement.cpp:
+ (WebCore::HTMLCanvasElement::createImageBuffer):
+ * html/HTMLCanvasElement.h: Moved in macros for default canvas interp quality.
+ * platform/graphics/GraphicsContext.h: Moved out macros for default canvas interp quality. It makes more sense for them to be housed where they're used.
+
+2010-09-23 David Hyatt <hyatt@apple.com>
+
+ Reviewed by Adele Peterson.
+
+ https://bugs.webkit.org/show_bug.cgi?id=46414, rename line box methods that refer specifically to
+ "horizontal" and "vertical." Replace those terms with "inline direction" and "block direction."
+
+ * rendering/InlineFlowBox.cpp:
+ (WebCore::InlineFlowBox::placeBoxesInInlineDirection):
+ (WebCore::InlineFlowBox::placeBoxesInBlockDirection):
+ (WebCore::InlineFlowBox::computeBlockDirectionOverflow):
+ * rendering/InlineFlowBox.h:
+ (WebCore::InlineFlowBox::setInlineDirectionOverflowPositions):
+ (WebCore::InlineFlowBox::setBlockDirectionOverflowPositions):
+ * rendering/RenderBlock.h:
+ * rendering/RenderBlockLineLayout.cpp:
+ (WebCore::RenderBlock::computeInlineDirectionPositionsForLine):
+ (WebCore::RenderBlock::computeBlockDirectionPositionsForLine):
+ (WebCore::RenderBlock::layoutInlineChildren):
+ * rendering/RootInlineBox.cpp:
+ (WebCore::RootInlineBox::alignBoxesInBlockDirection):
+ * rendering/RootInlineBox.h:
+
+2010-09-23 Andrew Wilson <atwilson@chromium.org>
+
+ Unreviewed, rolling out r68197.
+ http://trac.webkit.org/changeset/68197
+ https://bugs.webkit.org/show_bug.cgi?id=46344
+
+ Breaks
+
+ * WebCore.exp.in:
+ * bindings/js/JSDeviceMotionEventCustom.cpp:
+ (WebCore::JSDeviceMotionEvent::xAcceleration):
+ (WebCore::JSDeviceMotionEvent::yAcceleration):
+ (WebCore::JSDeviceMotionEvent::zAcceleration):
+ (WebCore::JSDeviceMotionEvent::xRotationRate):
+ (WebCore::JSDeviceMotionEvent::yRotationRate):
+ (WebCore::JSDeviceMotionEvent::zRotationRate):
+ (WebCore::JSDeviceMotionEvent::initDeviceMotionEvent):
+ * bindings/v8/custom/V8DeviceMotionEventCustom.cpp:
+ (WebCore::V8DeviceMotionEvent::xAccelerationAccessorGetter):
+ (WebCore::V8DeviceMotionEvent::yAccelerationAccessorGetter):
+ (WebCore::V8DeviceMotionEvent::zAccelerationAccessorGetter):
+ (WebCore::V8DeviceMotionEvent::xRotationRateAccessorGetter):
+ (WebCore::V8DeviceMotionEvent::yRotationRateAccessorGetter):
+ (WebCore::V8DeviceMotionEvent::zRotationRateAccessorGetter):
+ (WebCore::V8DeviceMotionEvent::initDeviceMotionEventCallback):
+ * dom/DeviceMotionData.cpp:
+ (WebCore::DeviceMotionData::create):
+ (WebCore::DeviceMotionData::DeviceMotionData):
+ * dom/DeviceMotionData.h:
+ (WebCore::DeviceMotionData::xAcceleration):
+ (WebCore::DeviceMotionData::yAcceleration):
+ (WebCore::DeviceMotionData::zAcceleration):
+ (WebCore::DeviceMotionData::xRotationRate):
+ (WebCore::DeviceMotionData::yRotationRate):
+ (WebCore::DeviceMotionData::zRotationRate):
+ (WebCore::DeviceMotionData::canProvideXAcceleration):
+ (WebCore::DeviceMotionData::canProvideYAcceleration):
+ (WebCore::DeviceMotionData::canProvideZAcceleration):
+ (WebCore::DeviceMotionData::canProvideXRotationRate):
+ (WebCore::DeviceMotionData::canProvideYRotationRate):
+ (WebCore::DeviceMotionData::canProvideZRotationRate):
+ * dom/DeviceMotionEvent.idl:
+
+2010-09-23 David Hyatt <hyatt@apple.com>
+
+ Reviewed by Adele Peterson.
+
+ https://bugs.webkit.org/show_bug.cgi?id=46403, convert the margin/border/padding accessors
+ to be logical.
+
+ * rendering/InlineFlowBox.cpp:
+ (WebCore::InlineFlowBox::getFlowSpacingLogicalWidth):
+ (WebCore::InlineFlowBox::placeBoxesHorizontally):
+ (WebCore::InlineFlowBox::paintBoxShadow):
+ (WebCore::InlineFlowBox::paintBoxDecorations):
+ (WebCore::InlineFlowBox::paintTextDecorations):
+ * rendering/InlineFlowBox.h:
+ (WebCore::InlineFlowBox::InlineFlowBox):
+ (WebCore::InlineFlowBox::marginBorderPaddingLogicalLeft):
+ (WebCore::InlineFlowBox::marginBorderPaddingLogicalRight):
+ (WebCore::InlineFlowBox::marginLogicalLeft):
+ (WebCore::InlineFlowBox::marginLogicalRight):
+ (WebCore::InlineFlowBox::borderLogicalLeft):
+ (WebCore::InlineFlowBox::borderLogicalRight):
+ (WebCore::InlineFlowBox::paddingLogicalLeft):
+ (WebCore::InlineFlowBox::paddingLogicalRight):
+ (WebCore::InlineFlowBox::includeLogicalLeftEdge):
+ (WebCore::InlineFlowBox::includeLogicalRightEdge):
+ (WebCore::InlineFlowBox::setEdges):
+ * rendering/RenderBlockLineLayout.cpp:
+ (WebCore::RenderBlock::computeHorizontalPositionsForLine):
+ * rendering/RenderBox.cpp:
+ (WebCore::RenderBox::containingBlockWidthForPositioned):
+ (WebCore::RenderBox::calcAbsoluteHorizontalValues):
+ (WebCore::RenderBox::calcAbsoluteHorizontalReplaced):
+ * rendering/RenderBoxModelObject.cpp:
+ (WebCore::RenderBoxModelObject::paintFillLayerExtended):
+
+2010-09-23 Jeff Schiller <jeffschiller@google.com>
+
+ Reviewed by David Hyatt.
+
+ Ensure that SVG documents included by reference (object, iframe, embed) have transparent
+ backgrounds (not white). https://bugs.webkit.org/show_bug.cgi?id=10687
+
+ Test: svg/in-html/by-reference.html
+
+ * dom/Document.cpp:
+ (WebCore::Document::hasSVGRootNode):
+ * dom/Document.h:
+ (WebCore::Document::hasSVGRootNode):
+ * rendering/RenderBoxModelObject.cpp:
+ (WebCore::RenderBoxModelObject::paintFillLayerExtended):
+
+2010-09-23 Hans Wennborg <hans@chromium.org>
+
+ Reviewed by Simon Fraser.
+
+ Update DeviceMotionEvent to spec
+ https://bugs.webkit.org/show_bug.cgi?id=46344
+
+ The spec has changed: the DeviceMotionEvent attributes accelerationX,
+ accelerationY, etc. have been baked into an 'acceleration' attribute
+ which returns an object with x, y, and z values. Likewise for the
+ rotation rate. The 'accelerationIncludingGravity' attribute is new.
+
+ * WebCore.exp.in:
+ The DeviceMotionData::create member function has changed. Also export
+ create functions for DeviceMotionData::Acceleration and RotationRate.
+
+ * bindings/js/JSDeviceMotionEventCustom.cpp:
+ (WebCore::JSDeviceMotionEvent::acceleration):
+ (WebCore::JSDeviceMotionEvent::accelerationIncludingGravity):
+ (WebCore::JSDeviceMotionEvent::rotationRate):
+ (WebCore::JSDeviceMotionEvent::initDeviceMotionEvent):
+ Manually create and return objects with the right attributes for
+ acceleration, accelerationIncludingGravity, and rotationRate.
+ When creating the DeviceMotionData object in initDeviceMotionEvent,
+ accept any input objects that have the right attributes.
+
+ * bindings/v8/custom/V8DeviceMotionEventCustom.cpp:
+ (WebCore::V8DeviceMotionEvent::accelerationAccessorGetter):
+ (WebCore::V8DeviceMotionEvent::accelerationIncludingGravityAccessorGetter):
+ (WebCore::V8DeviceMotionEvent::rotationRateAccessorGetter):
+ (WebCore::V8DeviceMotionEvent::initDeviceMotionEventCallback):
+ V8 counterpart to the JSC code above.
+
+ * dom/DeviceMotionData.cpp:
+ (WebCore::DeviceMotionData::Acceleration::create):
+ (WebCore::DeviceMotionData::Acceleration::Acceleration):
+ (WebCore::DeviceMotionData::RotationRate::create):
+ (WebCore::DeviceMotionData::RotationRate::RotationRate):
+ (WebCore::DeviceMotionData::create):
+ (WebCore::DeviceMotionData::DeviceMotionData):
+ * dom/DeviceMotionData.h:
+ (WebCore::DeviceMotionData::Acceleration::canProvideX):
+ (WebCore::DeviceMotionData::Acceleration::canProvideY):
+ (WebCore::DeviceMotionData::Acceleration::canProvideZ):
+ (WebCore::DeviceMotionData::Acceleration::x):
+ (WebCore::DeviceMotionData::Acceleration::y):
+ (WebCore::DeviceMotionData::Acceleration::z):
+ (WebCore::DeviceMotionData::RotationRate::canProvideAlpha):
+ (WebCore::DeviceMotionData::RotationRate::canProvideBeta):
+ (WebCore::DeviceMotionData::RotationRate::canProvideGamma):
+ (WebCore::DeviceMotionData::RotationRate::alpha):
+ (WebCore::DeviceMotionData::RotationRate::beta):
+ (WebCore::DeviceMotionData::RotationRate::gamma):
+ (WebCore::DeviceMotionData::acceleration):
+ (WebCore::DeviceMotionData::accelerationIncludingGravity):
+ (WebCore::DeviceMotionData::rotationRate):
+ Add member classes Acceleration and RotationRate to DeviceMotionData.
+
+ * dom/DeviceMotionEvent.idl:
+ Update according to the spec. Acceleration and RotationRate need not
+ be backed by native classes.
+
+2010-09-23 Patrick Gansterer <paroga@webkit.org>
+
+ Reviewed by Adam Roben.
+
+ Set synchronous handle in ResourceHandleWin
+ https://bugs.webkit.org/show_bug.cgi?id=46395
+
+ When loading synchronous network resources, we need to use a synchronous internet handle.
+
+ * platform/network/ResourceHandle.h:
+ * platform/network/win/ResourceHandleWin.cpp:
+ (WebCore::ResourceHandle::loadResourceSynchronously):
+ (WebCore::ResourceHandle::setSynchronousInternetHandle):
+
+2010-09-23 Alexey Proskuryakov <ap@apple.com>
+
+ Reviewed by Darin Adler.
+
+ https://bugs.webkit.org/show_bug.cgi?id=46326
+ Crash when trying to create a NodeIterator rooted at a document-less DocumentType node
+
+ Test: fast/dom/node-iterator-with-doctype-root.html
+
+ * dom/Document.cpp: (WebCore::Document::detachNodeIterator): Added a comment explaining that
+ attach/detach may not always be paired.
+
+ * dom/NodeIterator.cpp:
+ (WebCore::NodeIterator::NodeIterator): Don't try to register with the document if there is none.
+ (WebCore::NodeIterator::~NodeIterator): Ditto.
+ (WebCore::NodeIterator::detach): Ditto.
+ (WebCore::NodeIterator::updateForNodeRemoval): There should be a document if we're getting a
+ notification.
+
+2010-09-23 Patrick Gansterer <paroga@webkit.org>
+
+ Reviewed by Adam Roben.
+
+ Add synchronous loading for local files to ResourceHandleWin
+ https://bugs.webkit.org/show_bug.cgi?id=46392
+
+ * platform/network/win/ResourceHandleWin.cpp:
+ (WebCore::ResourceHandle::start):
+
+2010-09-23 Patrick Gansterer <paroga@webkit.org>
+
+ Reviewed by Adam Roben.
+
+ Remove (has|set)ReceivedResponse() from public ResourceHandleWin API
+ https://bugs.webkit.org/show_bug.cgi?id=46391
+
+ There is no need for this functions to be public, so remove them.
+
+ * platform/network/ResourceHandle.h:
+ * platform/network/win/ResourceHandleWin.cpp:
+ (WebCore::ResourceHandle::onRequestComplete):
+
+2010-09-23 David Hyatt <hyatt@apple.com>
+
+ Reviewed by Adele Peterson.
+
+ https://bugs.webkit.org/show_bug.cgi?id=46400
+
+ Add logicalLeft/Top getter/setters to line boxes.
+
+ * rendering/InlineBox.h:
+ (WebCore::InlineBox::logicalLeft):
+ (WebCore::InlineBox::setLogicalLeft):
+ (WebCore::InlineBox::logicalTop):
+ (WebCore::InlineBox::setLogicalTop):
+
+2010-09-23 Matthew Delaney <mdelaney@apple.com>
+
+ Reviewed by Simon Fraser.
+
+ Reduce minimum DOMTimer interval
+ https://bugs.webkit.org/show_bug.cgi?id=45362
+
+ Since the setInterval call is meant to reflect a global change for
+ all pages' DOMTimers, it's misleading to have it be a method on a
+ given page's settings' object. Thus, this patch changes the call to be static.
+
+ This simple change to using a static call instead of the page's setting's
+ method doesn't warrant a test.
+
+ * page/Settings.h: Changed the setInterval call to be static.
+
+2010-09-23 David Hyatt <hyatt@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ https://bugs.webkit.org/show_bug.cgi?id=46386, give line boxes a vertical bit so that it's easy to know
+ the overall direction of the line without having to ask the containing block.
+
+ Also couldn't resist some cleanup. Tightened up the type of the renderobject passed to RootInlineBox's
+ constructor to be a RenderBlock. Moved all the virtual logical height stuff outside of the SVG ifdef
+ since TrailingFloatsRootInlineBox uses it and should work without SVG enabled.
+
+ * rendering/EllipsisBox.h:
+ (WebCore::EllipsisBox::EllipsisBox):
+ * rendering/InlineBox.h:
+ (WebCore::InlineBox::InlineBox):
+ (WebCore::InlineBox::isVertical):
+ (WebCore::InlineBox::setIsVertical):
+ * rendering/InlineFlowBox.cpp:
+ (WebCore::InlineFlowBox::addToLine):
+ * rendering/RootInlineBox.cpp:
+ (WebCore::RootInlineBox::RootInlineBox):
+ (WebCore::RootInlineBox::placeEllipsis):
+ * rendering/RootInlineBox.h:
+ * rendering/SVGRootInlineBox.h:
+ (WebCore::SVGRootInlineBox::SVGRootInlineBox):
+ * rendering/TrailingFloatsRootInlineBox.h:
+ (WebCore::TrailingFloatsRootInlineBox::TrailingFloatsRootInlineBox):
+
+2010-09-23 Patrick Gansterer <paroga@webkit.org>
+
+ Reviewed by Adam Roben.
+
+ Check for a valid ResourceHandleClient in ResourceHandleWin
+ https://bugs.webkit.org/show_bug.cgi?id=46389
+
+ * platform/network/win/ResourceHandleWin.cpp:
+ (WebCore::ResourceHandle::onRequestComplete): Add checks to ensure client() is not 0.
+
+2010-09-23 Patrick Gansterer <paroga@webkit.org>
+
+ Reviewed by Adam Roben.
+
+ Fix ResourceHandleWin::cancel() for network resources
+ https://bugs.webkit.org/show_bug.cgi?id=46383
+
+ * platform/network/win/ResourceHandleWin.cpp:
+ (WebCore::ResourceHandle::onRequestComplete): Check it requestHandle is not 0.
+ (WebCore::ResourceHandle::cancel): Set requestHandle to 0.
+
+2010-09-23 Patrick Gansterer <paroga@webkit.org>
+
+ Reviewed by Adam Roben.
+
+ Add handling for form data and additional HTTP headers in ResourceHandleWin
+ https://bugs.webkit.org/show_bug.cgi?id=46369
+
+ * platform/network/win/ResourceHandleWin.cpp:
+ (WebCore::ResourceHandle::start):
+
+2010-09-23 Eric Carlson <eric.carlson@apple.com>
+
+ Reviewed by Simon Fraser
+
+ 'seeking' event should always fire
+ https://bugs.webkit.org/show_bug.cgi?id=45694
+
+ Update seek algorithm to match current spec.
+
+ * html/HTMLMediaElement.cpp:
+ (WebCore::HTMLMediaElement::setReadyState): Don't need to fire 'seeking' event here.
+ (WebCore::HTMLMediaElement::seek): Always fire 'seeking'. Update comments.
+ (WebCore::HTMLMediaElement::finishSeek): Update comments.
+ (WebCore::HTMLMediaElement::mediaPlayerTimeChanged): Ditto.
+
+2010-09-23 Eric Uhrhane <ericu@chromium.org>
+
+ Reviewed by David Levin.
+
+ Rename FileWriterClient to AsyncFileWriterClient.
+ https://bugs.webkit.org/show_bug.cgi?id=46325
+
+ * GNUmakefile.am:
+ * WebCore.gypi:
+ * WebCore.vcproj/WebCore.vcproj:
+ * WebCore.xcodeproj/project.pbxproj:
+ * fileapi/AsyncFileWriter.h:
+ * fileapi/AsyncFileWriterClient.h: Copied from WebCore/fileapi/FileWriterClient.h.
+ * fileapi/FileWriter.h:
+ * fileapi/FileWriterClient.h: Removed.
+ * platform/AsyncFileSystem.h:
+
+2010-09-23 David Hyatt <hyatt@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ https://bugs.webkit.org/show_bug.cgi?id=46378, rename width/height on line boxes to logicalWidth/logicalHeight.
+
+ * editing/visible_units.cpp:
+ (WebCore::previousLinePosition):
+ (WebCore::nextLinePosition):
+ * rendering/EllipsisBox.cpp:
+ (WebCore::EllipsisBox::paint):
+ (WebCore::EllipsisBox::paintSelection):
+ (WebCore::EllipsisBox::nodeAtPoint):
+ * rendering/InlineBox.cpp:
+ (WebCore::InlineBox::logicalHeight):
+ (WebCore::InlineBox::canAccommodateEllipsis):
+ * rendering/InlineBox.h:
+ (WebCore::InlineBox::InlineBox):
+ (WebCore::InlineBox::hasVirtualLogicalHeight):
+ (WebCore::InlineBox::setHasVirtualLogicalHeight):
+ (WebCore::InlineBox::virtualLogicalHeight):
+ (WebCore::InlineBox::setLogicalWidth):
+ (WebCore::InlineBox::logicalWidth):
+ * rendering/InlineFlowBox.cpp:
+ (WebCore::InlineFlowBox::placeBoxesHorizontally):
+ (WebCore::InlineFlowBox::placeBoxesVertically):
+ (WebCore::InlineFlowBox::computeVerticalOverflow):
+ (WebCore::InlineFlowBox::nodeAtPoint):
+ (WebCore::InlineFlowBox::paintFillLayer):
+ (WebCore::InlineFlowBox::paintBoxDecorations):
+ (WebCore::InlineFlowBox::paintMask):
+ (WebCore::InlineFlowBox::paintTextDecorations):
+ (WebCore::InlineFlowBox::placeEllipsisBox):
+ * rendering/InlineFlowBox.h:
+ (WebCore::InlineFlowBox::visibleOverflowRect):
+ (WebCore::InlineFlowBox::bottomLayoutOverflow):
+ (WebCore::InlineFlowBox::rightLayoutOverflow):
+ (WebCore::InlineFlowBox::layoutOverflowRect):
+ (WebCore::InlineFlowBox::bottomVisualOverflow):
+ (WebCore::InlineFlowBox::rightVisualOverflow):
+ (WebCore::InlineFlowBox::visualOverflowRect):
+ (WebCore::InlineFlowBox::setHorizontalOverflowPositions):
+ (WebCore::InlineFlowBox::setVerticalOverflowPositions):
+ * rendering/InlineTextBox.cpp:
+ (WebCore::InlineTextBox::selectionRect):
+ (WebCore::InlineTextBox::placeEllipsisBox):
+ (WebCore::InlineTextBox::nodeAtPoint):
+ (WebCore::InlineTextBox::paint):
+ (WebCore::InlineTextBox::paintSelection):
+ (WebCore::InlineTextBox::paintCustomHighlight):
+ (WebCore::InlineTextBox::paintDecoration):
+ (WebCore::InlineTextBox::paintSpellingOrGrammarMarker):
+ (WebCore::InlineTextBox::paintTextMatchMarker):
+ (WebCore::InlineTextBox::paintCompositionUnderline):
+ * rendering/InlineTextBox.h:
+ (WebCore::InlineTextBox::calculateBoundaries):
+ (WebCore::InlineTextBox::setSpaceAdd):
+ * rendering/RenderBlock.cpp:
+ (WebCore::RenderBlock::paintEllipsisBoxes):
+ (WebCore::RenderBlock::rightmostPosition):
+ (WebCore::RenderBlock::adjustForBorderFit):
+ (WebCore::RenderBlock::addFocusRingRects):
+ * rendering/RenderBlockLineLayout.cpp:
+ (WebCore::RenderBlock::computeHorizontalPositionsForLine):
+ (WebCore::RenderBlock::checkLinesForTextOverflow):
+ * rendering/RenderBox.cpp:
+ (WebCore::RenderBox::paintCustomHighlight):
+ (WebCore::RenderBox::containingBlockWidthForPositioned):
+ * rendering/RenderFlexibleBox.cpp:
+ (WebCore::RenderFlexibleBox::applyLineClamp):
+ * rendering/RenderInline.cpp:
+ (WebCore::RenderInline::absoluteRects):
+ (WebCore::RenderInline::absoluteQuads):
+ (WebCore::RenderInline::linesBoundingBox):
+ (WebCore::RenderInline::addFocusRingRects):
+ (WebCore::RenderInline::paintOutline):
+ * rendering/RenderSVGInline.cpp:
+ (WebCore::RenderSVGInline::createInlineFlowBox):
+ (WebCore::RenderSVGInline::absoluteQuads):
+ * rendering/RenderSVGInlineText.cpp:
+ (WebCore::RenderSVGInlineText::createTextBox):
+ * rendering/RenderSVGText.cpp:
+ (WebCore::RenderSVGText::createRootInlineBox):
+ * rendering/RenderText.cpp:
+ (WebCore::RenderText::absoluteRects):
+ (WebCore::RenderText::absoluteRectsForRange):
+ (WebCore::RenderText::absoluteQuadsForRange):
+ (WebCore::RenderText::positionForPoint):
+ (WebCore::RenderText::localCaretRect):
+ (WebCore::RenderText::linesBoundingBox):
+ * rendering/RenderTreeAsText.cpp:
+ (WebCore::writeTextRun):
+ * rendering/RootInlineBox.cpp:
+ (WebCore::RootInlineBox::canAccommodateEllipsis):
+ (WebCore::RootInlineBox::placeEllipsis):
+ (WebCore::RootInlineBox::addHighlightOverflow):
+ (WebCore::RootInlineBox::paintCustomHighlight):
+ (WebCore::RootInlineBox::fillLineSelectionGap):
+ (WebCore::RootInlineBox::closestLeafChildForXPos):
+ * rendering/SVGInlineFlowBox.h:
+ (WebCore::SVGInlineFlowBox::SVGInlineFlowBox):
+ (WebCore::SVGInlineFlowBox::virtualLogicalHeight):
+ (WebCore::SVGInlineFlowBox::setLogicalHeight):
+ * rendering/SVGInlineTextBox.cpp:
+ (WebCore::SVGInlineTextBox::SVGInlineTextBox):
+ * rendering/SVGInlineTextBox.h:
+ (WebCore::SVGInlineTextBox::virtualLogicalHeight):
+ (WebCore::SVGInlineTextBox::setLogicalHeight):
+ (WebCore::SVGInlineTextBox::selectionHeight):
+ * rendering/SVGRenderTreeAsText.cpp:
+ (WebCore::writeRenderSVGTextBox):
+ * rendering/SVGRootInlineBox.cpp:
+ (WebCore::SVGRootInlineBox::layoutChildBoxes):
+ (WebCore::SVGRootInlineBox::layoutRootBox):
+ * rendering/SVGRootInlineBox.h:
+ (WebCore::SVGRootInlineBox::SVGRootInlineBox):
+ (WebCore::SVGRootInlineBox::virtualLogicalHeight):
+ (WebCore::SVGRootInlineBox::setLogicalHeight):
+ * rendering/TrailingFloatsRootInlineBox.h:
+ (WebCore::TrailingFloatsRootInlineBox::TrailingFloatsRootInlineBox):
+ (WebCore::TrailingFloatsRootInlineBox::virtualLogicalHeight):
+
+2010-09-23 Matthew Delaney <mdelaney@apple.com>
+
+ Reviewed by Oliver Hunt.
+
+ context.drawImage with (source rect's height) = -(input image's native height) draws nothing
+ https://bugs.webkit.org/show_bug.cgi?id=46243
+
+ This patch changes canvasrenderingcontext2d's drawImage with an image element to
+ normalize the source and dest rects to acheive the desired canvas spec behavior
+ of allowing negative widths and heights that don't cause flipping and fix the
+ adverse behavior of specifying a source rect height of negative the source image's height
+
+ Tests: canvas/philip/tests/2d.drawImage.negativeSourceHeight.html
+ canvas/philip/tests/2d.drawImage.negativeSourceHeight2.html
+ canvas/philip/tests/2d.drawImage.negativeSourceHeightAndWidth.html
+
+ * html/canvas/CanvasRenderingContext2D.cpp: Normalize rects in drawImage before calling
+ lower level draw calls.
+
+2010-09-23 Renata Hodovan <reni@inf.u-szeged.hu>
+
+ Reviewed by Dirk Schulze.
+
+ SVGFEMorphologyElement doesn't support dynamic invalidation, when attributes change.
+ https://bugs.webkit.org/show_bug.cgi?id=46363
+ The patch also implements the simple setRadius method.
+
+ Tests: svg/dynamic-updates/SVGFEMorphologyElement-dom-in-attr.html
+ svg/dynamic-updates/SVGFEMorphologyElement-dom-operator-attr.html
+ svg/dynamic-updates/SVGFEMorphologyElement-dom-radius-attr.html
+ svg/dynamic-updates/SVGFEMorphologyElement-svgdom-in-prop.html
+ svg/dynamic-updates/SVGFEMorphologyElement-svgdom-operator-prop.html
+ svg/dynamic-updates/SVGFEMorphologyElement-svgdom-radius-call.html
+
+ * svg/SVGFEMorphologyElement.cpp:
+ (WebCore::SVGFEMorphologyElement::setRadius):
+ (WebCore::SVGFEMorphologyElement::svgAttributeChanged):
+ * svg/SVGFEMorphologyElement.h:
+
+2010-09-23 Patrick Gansterer <paroga@webkit.org>
+
+ Reviewed by Adam Roben.
+
+ Add synchronous loading for network resources to ResourceHandleWin
+ https://bugs.webkit.org/show_bug.cgi?id=46364
+
+ Use return value of onRequestComplete() to indicate that an additional
+ call to it is required for receiving remaining network data.
+
+ * platform/network/ResourceHandle.h:
+ * platform/network/win/ResourceHandleWin.cpp:
+ (WebCore::ResourceHandle::onRequestComplete):
+ (WebCore::ResourceHandle::start):
+
+2010-09-23 Nate Chapin <japhet@chromium.org>
+
+ Reviewed by Darin Fisher.
+
+ Implement <a ping> (disabled by default).
+ https://bugs.webkit.org/show_bug.cgi?id=30458
+
+ Tests: http/tests/navigation/ping-cross-origin-from-https.html
+ http/tests/navigation/ping-cross-origin.html
+ http/tests/navigation/ping-same-origin.html
+
+ * html/HTMLAnchorElement.cpp:
+ (WebCore::HTMLAnchorElement::defaultEventHandler):
+ (WebCore::HTMLAnchorElement::sendPings):
+ * html/HTMLAnchorElement.h:
+ * html/HTMLAttributeNames.in:
+ * loader/PingLoader.cpp:
+ (WebCore::PingLoader::sendPing): Set ping-specific headers.
+ (WebCore::PingLoader::PingLoader):
+ * loader/PingLoader.h:
+ (WebCore::PingLoader::timeout): Ensure pings eventually timeout, since
+ the normal cancel mechanism can't stop them.
+ * page/Settings.cpp:
+ * page/Settings.h: Add hyperlinkAuditingEnabled.
+
+2010-09-23 Steve VanDeBogart <vandebo@chromium.org>
+
+ Reviewed by David Levin.
+
+ https://bugs.webkit.org/show_bug.cgi?id=46312
+
+ Use Skia's SkSafeRef/SkSafeUnref functions instead of safeRef/safeUnref.
+
+ * platform/graphics/chromium/FontLinux.cpp:
+ (WebCore::Font::drawGlyphs):
+ * platform/graphics/chromium/FontPlatformDataLinux.cpp:
+ (WebCore::FontPlatformData::FontPlatformData):
+ (WebCore::FontPlatformData::~FontPlatformData):
+ * platform/graphics/skia/GradientSkia.cpp:
+ (WebCore::Gradient::platformDestroy):
+ * platform/graphics/skia/PatternSkia.cpp:
+ (WebCore::Pattern::platformDestroy):
+ * platform/graphics/skia/PlatformContextSkia.cpp:
+ (WebCore::PlatformContextSkia::State::State):
+ (WebCore::PlatformContextSkia::State::~State):
+ (WebCore::PlatformContextSkia::drawRect):
+ (WebCore::PlatformContextSkia::setStrokeShader):
+ (WebCore::PlatformContextSkia::setFillShader):
+ (WebCore::PlatformContextSkia::setDashPathEffect):
+ * platform/graphics/skia/SkiaFontWin.cpp:
+ (WebCore::paintSkiaText):
+
+2010-09-23 Lucas De Marchi <lucas.demarchi@profusion.mobi>
+
+ Reviewed by Csaba Osztrogonác.
+
+ Fix warnings regarding print format in 64 bits
+ https://bugs.webkit.org/show_bug.cgi?id=46357
+
+ Use inttypes.h in order to have portable print formats across 32 and
+ 64 bits.
+
+ * platform/sql/SQLiteFileSystem.cpp:
+ (WebCore::SQLiteFileSystem::getFileNameForNewDatabase):
+
+2010-09-23 Chris Rogers <crogers@google.com>
+
+ Reviewed by Kenneth Russell.
+
+ Add AudioContext files
+ https://bugs.webkit.org/show_bug.cgi?id=44890
+
+ No new tests since audio API is not yet implemented.
+
+ * webaudio/AudioContext.cpp: Added.
+ (WebCore::AudioContext::createAudioRequest):
+ (WebCore::AudioContext::create):
+ (WebCore::AudioContext::AudioContext):
+ (WebCore::AudioContext::~AudioContext):
+ (WebCore::AudioContext::lazyInitialize):
+ (WebCore::AudioContext::uninitialize):
+ (WebCore::AudioContext::isInitialized):
+ (WebCore::AudioContext::isRunnable):
+ (WebCore::AudioContext::stop):
+ (WebCore::AudioContext::document):
+ (WebCore::AudioContext::hasDocument):
+ (WebCore::AudioContext::refBuffer):
+ (WebCore::AudioContext::createBuffer):
+ (WebCore::AudioContext::createBufferSource):
+ (WebCore::AudioContext::createJavaScriptNode):
+ (WebCore::AudioContext::createLowPass2Filter):
+ (WebCore::AudioContext::createHighPass2Filter):
+ (WebCore::AudioContext::createPanner):
+ (WebCore::AudioContext::createConvolver):
+ (WebCore::AudioContext::createAnalyser):
+ (WebCore::AudioContext::createGainNode):
+ (WebCore::AudioContext::createDelayNode):
+ (WebCore::AudioContext::createChannelSplitter):
+ (WebCore::AudioContext::createChannelMerger):
+ (WebCore::AudioContext::notifyNodeFinishedProcessing):
+ (WebCore::AudioContext::derefFinishedSourceNodes):
+ (WebCore::AudioContext::refNode):
+ (WebCore::AudioContext::derefNode):
+ (WebCore::AudioContext::derefUnfinishedSourceNodes):
+ (WebCore::AudioContext::lock):
+ (WebCore::AudioContext::tryLock):
+ (WebCore::AudioContext::unlock):
+ (WebCore::AudioContext::isAudioThread):
+ (WebCore::AudioContext::isGraphOwner):
+ (WebCore::AudioContext::addDeferredFinishDeref):
+ (WebCore::AudioContext::handlePostRenderTasks):
+ (WebCore::AudioContext::handleDeferredFinishDerefs):
+ (WebCore::AudioContext::markForDeletion):
+ (WebCore::AudioContext::deleteMarkedNodes):
+ * webaudio/AudioContext.h: Added.
+ (WebCore::AudioContext::destination):
+ (WebCore::AudioContext::currentTime):
+ (WebCore::AudioContext::sampleRate):
+ (WebCore::AudioContext::listener):
+ (WebCore::AudioContext::temporaryMonoBus):
+ (WebCore::AudioContext::temporaryStereoBus):
+ (WebCore::AudioContext::incrementConnectionCount):
+ (WebCore::AudioContext::connectionCount):
+ (WebCore::AudioContext::setAudioThread):
+ (WebCore::AudioContext::audioThread):
+ (WebCore::AudioContext::isAudioThreadFinished):
+ (WebCore::AudioContext::AutoLocker::AutoLocker):
+ (WebCore::AudioContext::AutoLocker::~AutoLocker):
+ (WebCore::AudioContext::RefInfo::RefInfo):
+ * webaudio/AudioContext.idl: Added.
+
+2010-09-23 Jeremy Orlow <jorlow@chromium.org>
+
+ Reviewed by Steve Block.
+
+ IndexedDB shouldn't crash on invalid index names
+ https://bugs.webkit.org/show_bug.cgi?id=46362
+
+ For now, return null. In a later patch, we'll do proper exception raising.
+
+ * storage/IDBObjectStore.cpp:
+ (WebCore::IDBObjectStore::index):
+
+2010-09-23 Abhishek Arya <inferno@chromium.org>
+
+ Reviewed by Dave Hyatt.
+
+ Fix the memory safety issue by checking containerObject is a RenderBox
+ before doing the transforms.
+ https://bugs.webkit.org/show_bug.cgi?id=46365
+
+ Test: compositing/overflow/get-transform-from-non-box-container.html
+
+ * rendering/RenderObject.cpp:
+ (WebCore::RenderObject::getTransformFromContainer):
+
+2010-09-23 David Hyatt <hyatt@apple.com>
+
+ Reviewed by Simon Fraser.
+
+ https://bugs.webkit.org/show_bug.cgi?id=46314.
+
+ The RenderView's block-flow should match the root element's block-flow. When we create (or re-create) the style for the document, take
+ the block-flow from the document element's style and use it if it's available.
+
+ Also patch styleDidChange so that if the block-flow changes dynamically after we have already made the document style, we'll propagate
+ the change back up to the RenderView and have it do a relayout.
+
+ No tests possible yet, since you can't see the document's style anywhere, and block-flow isn't doing anything to affect layout
+ yet.
+
+ * css/CSSStyleSelector.cpp:
+ (WebCore::CSSStyleSelector::styleForDocument):
+ * rendering/RenderBox.cpp:
+ (WebCore::RenderBox::styleDidChange):
+
+2010-09-23 Pavel Podivilov <podivilov@chromium.org>
+
+ Reviewed by Yury Semikhatsky.
+
+ Web Inspector: source frame popups shouldn't disappear when hovered
+ https://bugs.webkit.org/show_bug.cgi?id=46358
+
+ * inspector/front-end/SourceFrame.js:
+ (WebInspector.SourceFrame.prototype._mouseMove):
+
+2010-09-23 Mario Sanchez Prada <msanchez@igalia.com>
+
+ Reviewed by Chris Fleizach.
+
+ [Regression][Gtk] Left and Right Arrows no longer function when caret browsing is enabled
+ https://bugs.webkit.org/show_bug.cgi?id=45375
+
+ Consider caret browsing for Move commands.
+
+ Test: platform/gtk/editing/selection/caret-mode-left-right-arrows.html
+
+ * editing/EditorCommand.cpp:
+ (WebCore::createCommandMap): Use "caret browsing aware functions"
+ as isEnabled() function for those commands moving the caret
+ forward and backward across characters, words, lines or paragraphs,
+ not just left and right, as it was the case so far.
+
+2010-09-23 Brad Moore <bradm@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ Address a remaining discrepancy in piecewise text measurement
+ https://bugs.webkit.org/show_bug.cgi?id=45796
+
+ Don't include always-integral space widths in the floating point accumulator designed
+ to minimize precision loss. This brings whole-string measurement in line with piecewise
+ text measurement when dealing with fonts with fractional advances.
+
+ * platform/graphics/WidthIterator.cpp:
+ (WebCore::WidthIterator::advance): Change the associativity of width addition to minimize precision loss.
+
+2010-09-23 Patrick Gansterer <paroga@webkit.org>
+
+ Reviewed by Adam Roben.
+
+ Cleanup network communication code in ResourceHandleWin
+ https://bugs.webkit.org/show_bug.cgi?id=46200
+
+ Add logic for request handling directly into ResourceHandle::start and fix style.
+ Use Unicode instead of ASCII Windows API functions.
+
+ * platform/network/ResourceHandleInternal.h:
+ (WebCore::ResourceHandleInternal::ResourceHandleInternal):
+ * platform/network/win/ResourceHandleWin.cpp:
+ (WebCore::ResourceHandle::onRequestComplete):
+ (WebCore::ResourceHandle::start):
+
+2010-09-23 Luiz Agostini <luiz.agostini@openbossa.org>
+
+ Reviewed by Andreas Kling.
+
+ Invalid assertion in ScriptCallback
+ https://bugs.webkit.org/show_bug.cgi?id=46348
+
+ Removing invalid ASSERT from method ScriptCallback::call().
+
+ * bindings/js/ScriptFunctionCall.cpp:
+ (WebCore::ScriptCallback::call):
+
+2010-09-23 Martin Robinson <mrobinson@igalia.com>
+
+ Reviewed by Ariya Hidayat.
+
+ [Cairo] Generalize ContextShadow from the Qt port and use it for shadow code
+ https://bugs.webkit.org/show_bug.cgi?id=45599
+
+ Make ContextShadow platform-independent and add a Cairo implementation. This is currently
+ disabled for Cairo, but will be enabled in a followup patch with new baselines.
+
+ No new tests as this does not change functionality.
+
+ * GNUmakefile.am: Update source lists.
+ * WebCore.pro: Update source lists.
+ * platform/graphics/ContextShadow.cpp: Added. A generalized version of Qt's ContextShadow.
+ (WebCore::ContextShadow::ContextShadow):
+ (WebCore::ContextShadow::clear):
+ (WebCore::ContextShadow::blurLayerImage):
+ (WebCore::ContextShadow::calculateMinimalLayerRect):
+ * platform/graphics/ContextShadow.h: Added.
+ (WebCore::ContextShadow::offset):
+ * platform/graphics/cairo/CairoUtilities.cpp: Added.
+ (WebCore::setSourceRGBAFromColor): A utility to set the source RGBA on a Cairo surface from a WebCore color.
+ * platform/graphics/cairo/CairoUtilities.h: Added.
+ * platform/graphics/cairo/ContextShadowCairo.cpp: Added.
+ (WebCore::purgeScratchBuffer): Static function to purge the shadow buffer.
+ (WebCore::PurgeScratchBufferTimer::fired): Timer callback.
+ (WebCore::scheduleScratchBufferPurge): Schedule's a WebCore timer to purge the shadow buffer.
+ (WebCore::getScratchBuffer): Create or reuse the scratch buffer.
+ (WebCore::ContextShadow::beginShadowLayer): Added.
+ (WebCore::ContextShadow::endShadowLayer): Added.
+ * platform/graphics/gtk/CairoUtilities.cpp: Removed.
+ * platform/graphics/gtk/CairoUtilities.h: Removed.
+ * platform/graphics/gtk/GdkCairoUtilities.cpp: Renamed from CairoUtilities.cpp.
+ (getCairoSurfacePixel):
+ (getGdkPixbufPixel):
+ (cairoImageSurfaceToGdkPixbuf):
+ * platform/graphics/gtk/GdkCairoUtilities.h: Added.
+ * platform/graphics/gtk/ImageBufferGtk.cpp:
+ * platform/graphics/gtk/ImageGtk.cpp:
+ * platform/graphics/qt/ContextShadow.cpp: Removed.
+ * platform/graphics/qt/ContextShadow.h: Removed.
+ * platform/graphics/qt/ContextShadowQt.cpp: Added. Adapted from code originally in ContextShadow.cpp.
+ (WebCore::ShadowBuffer::ShadowBuffer):
+ (WebCore::ShadowBuffer::scratchImage):
+ (WebCore::ShadowBuffer::schedulePurge):
+ (WebCore::ShadowBuffer::timerEvent):
+ (WebCore::ContextShadow::beginShadowLayer):
+ (WebCore::ContextShadow::endShadowLayer):
+ * platform/graphics/qt/FontQt.cpp:
+ (WebCore::drawTextCommon): Updated to reflect new ContextShadow members.
+ * platform/graphics/qt/GraphicsContextQt.cpp:
+ (WebCore::GraphicsContextPlatformPrivate::hasShadow): Updated to reflect new ContextShadow members.
+ (WebCore::GraphicsContext::strokeArc): Ditto.
+ (WebCore::GraphicsContext::drawConvexPolygon): Ditto.
+ (WebCore::GraphicsContext::fillPath): Ditto.
+ (WebCore::GraphicsContext::strokePath): Ditto.
+ (WebCore::GraphicsContext::fillRect): Ditto.
+ (WebCore::GraphicsContext::fillRoundedRect): Ditto.
+ (WebCore::GraphicsContext::setPlatformShadow): Ditto.
+
+2010-09-23 Patrick Gansterer <paroga@webkit.org>
+
+ Reviewed by Adam Roben.
+
+ Add internetStatusCallback to ResourceHandleWin.
+ https://bugs.webkit.org/show_bug.cgi?id=46187
+
+ Add callback for asynchronous network transfer.
+
+ * platform/network/ResourceHandle.h:
+ * platform/network/ResourceHandleInternal.h:
+ * platform/network/win/ResourceHandleWin.cpp:
+ (WebCore::callOnRedirect):
+ (WebCore::callOnRequestComplete):
+ (WebCore::ResourceHandle::internetStatusCallback):
+ (WebCore::ResourceHandle::onRedirect):
+
+2010-09-23 Andrei Popescu <andreip@google.com>
+
+ Reviewed by Jeremy Orlow.
+
+ IDBTransactionCoordinator contains a broken assertion.
+ https://bugs.webkit.org/show_bug.cgi?id=46356
+
+ Remove the broken assertion.
+
+ * storage/IDBTransactionCoordinator.cpp:
+ (WebCore::IDBTransactionCoordinator::processStartedTransactions):
+
+2010-09-23 Pavel Podivilov <podivilov@chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ Web Inspector: highlight DOM nodes when navigating the DOM with keyboard
+ https://bugs.webkit.org/show_bug.cgi?id=46346
+
+ * inspector/front-end/ElementsTreeOutline.js:
+ (WebInspector.ElementsTreeElement.prototype.onselect):
+ * inspector/front-end/treeoutline.js:
+ (TreeOutline.prototype._treeKeyDown):
+ (TreeElement.prototype.selectOnMouseDown):
+ (TreeElement.prototype.select):
+
+2010-09-23 Andrei Popescu <andreip@google.com>
+
+ Reviewed by Jeremy Orlow.
+
+ [Chromium] Build broken due to missing include in IDBTransactionBackendImpl.h
+ https://bugs.webkit.org/show_bug.cgi?id=46352
+
+ No new tests needed, build fix.
+
+ * storage/IDBTransaction.cpp:
+ (WebCore::IDBTransaction::objectStore):
+ * storage/IDBTransactionBackendImpl.h:
+
+2010-09-23 Andrei Popescu <andreip@google.com>
+
+ Reviewed by Jeremy Orlow.
+
+ IDBObjectStore::get should run in a transaction.
+ https://bugs.webkit.org/show_bug.cgi?id=44700
+
+ Implements logic for running IDBObjectStore::get() in a transaction.
+ Refactors the pending transaction monitor and the transaction coordinator
+ to use pointers instead of transaction IDs.
+
+ * bindings/v8/V8Proxy.cpp:
+ (WebCore::V8Proxy::didLeaveScriptContext):
+ * storage/IDBCursorBackendImpl.cpp:
+ * storage/IDBDatabase.cpp:
+ (WebCore::IDBDatabase::objectStore):
+ * storage/IDBDatabaseBackendImpl.cpp:
+ (WebCore::IDBDatabaseBackendImpl::objectStore):
+ * storage/IDBDatabaseBackendImpl.h:
+ (WebCore::IDBDatabaseBackendImpl::transactionCoordinator):
+ * storage/IDBFactoryBackendImpl.cpp:
+ * storage/IDBFactoryBackendImpl.h:
+ * storage/IDBFactoryBackendInterface.h:
+ * storage/IDBObjectStore.cpp:
+ (WebCore::IDBObjectStore::IDBObjectStore):
+ (WebCore::IDBObjectStore::get):
+ * storage/IDBObjectStore.h:
+ (WebCore::IDBObjectStore::create):
+ * storage/IDBObjectStoreBackendImpl.cpp:
+ (WebCore::IDBTask::IDBTask):
+ (WebCore::IDBTask::performTask):
+ (WebCore::createTask):
+ (WebCore::IDBObjectStoreBackendImpl::get):
+ (WebCore::IDBObjectStoreBackendImpl::getInternal):
+ * storage/IDBObjectStoreBackendImpl.h:
+ * storage/IDBObjectStoreBackendInterface.h:
+ * storage/IDBPendingTransactionMonitor.cpp:
+ (WebCore::IDBPendingTransactionMonitor::addPendingTransaction):
+ (WebCore::IDBPendingTransactionMonitor::removePendingTransaction):
+ (WebCore::IDBPendingTransactionMonitor::abortPendingTransactions):
+ * storage/IDBPendingTransactionMonitor.h:
+ * storage/IDBRequest.cpp:
+ (WebCore::IDBRequest::IDBRequest):
+ (WebCore::IDBRequest::~IDBRequest):
+ (WebCore::IDBRequest::onSuccess):
+ (WebCore::IDBRequest::timerFired):
+ * storage/IDBRequest.h:
+ (WebCore::IDBRequest::create):
+ * storage/IDBTransaction.cpp:
+ (WebCore::IDBTransaction::IDBTransaction):
+ (WebCore::IDBTransaction::objectStore):
+ * storage/IDBTransactionBackendImpl.cpp:
+ (WebCore::IDBTransactionBackendImpl::create):
+ (WebCore::IDBTransactionBackendImpl::IDBTransactionBackendImpl):
+ (WebCore::IDBTransactionBackendImpl::objectStore):
+ (WebCore::IDBTransactionBackendImpl::scheduleTask):
+ (WebCore::IDBTransactionBackendImpl::abort):
+ (WebCore::IDBTransactionBackendImpl::didCompleteTaskEvents):
+ (WebCore::IDBTransactionBackendImpl::run):
+ (WebCore::IDBTransactionBackendImpl::start):
+ (WebCore::IDBTransactionBackendImpl::commit):
+ (WebCore::IDBTransactionBackendImpl::timerFired):
+ * storage/IDBTransactionBackendImpl.h:
+ (WebCore::IDBTransactionBackendImpl::~IDBTransactionBackendImpl):
+ (WebCore::IDBTransactionBackendImpl::isFinished):
+ * storage/IDBTransactionBackendInterface.h:
+ * storage/IDBTransactionCoordinator.cpp:
+ (WebCore::IDBTransactionCoordinator::createTransaction):
+ (WebCore::IDBTransactionCoordinator::didStartTransaction):
+ (WebCore::IDBTransactionCoordinator::didFinishTransaction):
+ (WebCore::IDBTransactionCoordinator::processStartedTransactions):
+ * storage/IDBTransactionCoordinator.h:
+
+2010-09-23 Patrick Gansterer <paroga@webkit.org>
+
+ Reviewed by Adam Roben.
+
+ [WINCE] Remove usage of MemoryManager
+ https://bugs.webkit.org/show_bug.cgi?id=46206
+
+ MemoryManager does not provide any extra value, so remove it.
+
+ * page/wince/FrameWinCE.cpp:
+ (WebCore::imageFromSelection):
+ * platform/graphics/wince/PlatformPathWinCE.cpp:
+ (WebCore::drawPolygons):
+
+2010-09-23 Darin Adler <darin@apple.com>
+
+ Reviewed by Chris Fleizach.
+
+ media/video-controls-with-mutation-event-handler.html crashing
+ https://bugs.webkit.org/show_bug.cgi?id=46169
+
+ * rendering/MediaControlElements.cpp:
+ (WebCore::MediaControlInputElement::MediaControlInputElement): Don't take a type argument.
+ We can't set the type until after the element is created beacuse of reference counting rules.
+ (WebCore::MediaControlMuteButtonElement::MediaControlMuteButtonElement): Don't pass the type.
+ (WebCore::MediaControlMuteButtonElement::create): Set the type.
+ (WebCore::MediaControlPlayButtonElement::MediaControlPlayButtonElement): More of the same.
+ (WebCore::MediaControlPlayButtonElement::create): Ditto.
+ (WebCore::MediaControlSeekButtonElement::MediaControlSeekButtonElement): Ditto.
+ (WebCore::MediaControlSeekButtonElement::create): Ditto.
+ (WebCore::MediaControlRewindButtonElement::MediaControlRewindButtonElement): Ditto.
+ (WebCore::MediaControlRewindButtonElement::create): Ditto.
+ (WebCore::MediaControlReturnToRealtimeButtonElement::MediaControlReturnToRealtimeButtonElement): Ditto.
+ (WebCore::MediaControlReturnToRealtimeButtonElement::create): Ditto.
+ (WebCore::MediaControlToggleClosedCaptionsButtonElement::MediaControlToggleClosedCaptionsButtonElement): Ditto.
+ (WebCore::MediaControlToggleClosedCaptionsButtonElement::create): Ditto.
+ (WebCore::MediaControlTimelineElement::MediaControlTimelineElement): Ditto.
+ (WebCore::MediaControlTimelineElement::create): Ditto.
+ (WebCore::MediaControlVolumeSliderElement::MediaControlVolumeSliderElement): Ditto.
+ (WebCore::MediaControlVolumeSliderElement::create): Ditto.
+ (WebCore::MediaControlFullscreenButtonElement::MediaControlFullscreenButtonElement): Ditto.
+ (WebCore::MediaControlFullscreenButtonElement::create): Ditto.
+
+ * rendering/MediaControlElements.h: Removed the type argument from the MediaControlInputElement
+ constructor.
+
+2010-09-22 Luke Macpherson <macpherson@chromium.org>
+
+ Reviewed by Alexey Proskuryakov.
+
+ Don't allow empty strings as tokens in xmlhttprequest, as per rfc2616 section 2.2.
+
+ XMLHttpRequest: setRequestHeader() does not throw SYNTAX_ERR exception if the header field name is empty
+ https://bugs.webkit.org/show_bug.cgi?id=46151
+
+ Test: http/tests/xmlhttprequest/xmlhttprequest-setrequestheader-no-name.html
+
+ * xml/XMLHttpRequest.cpp:
+ (WebCore::isValidToken):
+
+2010-09-22 Kwang Yul Seo <skyul@company100.net>
+
+ Reviewed by Adam Barth.
+
+ [BREWMP] Enable touch events
+ https://bugs.webkit.org/show_bug.cgi?id=46321
+
+ Enable TOUCH_EVENTS by porting PlatformTouchEvent and PlatformTouchPoint.
+ Brew MP does not support multi touch, so enable only single touch for now.
+
+ * platform/PlatformTouchEvent.h:
+ * platform/PlatformTouchPoint.h:
+ * platform/brew/PlatformTouchEventBrew.cpp: Added.
+ (WebCore::PlatformTouchEvent::PlatformTouchEvent):
+ * platform/brew/PlatformTouchPointBrew.cpp: Added.
+ (WebCore::PlatformTouchPoint::PlatformTouchPoint):
+
+2010-09-22 Andy Estes <aestes@apple.com>
+
+ Reviewed by Darin Adler.
+
+ REGRESSION (r61285): Microsoft Entourage 2008 does not invoke My Day window
+ https://bugs.webkit.org/show_bug.cgi?id=46334
+
+ * WebCore.exp.in: Export __ZN7WebCore27applicationIsMicrosoftMyDayEv.
+ * platform/mac/RuntimeApplicationChecks.h:
+ * platform/mac/RuntimeApplicationChecks.mm:
+ (WebCore::applicationIsMicrosoftMyDay): Determine if the embeddding
+ application is Microsoft My Day by checking the bundle identifier.
+
+2010-09-22 Andy Estes <aestes@apple.com>
+
+ Rubber-stamped by Darin Adler.
+
+ Fix a typo and correct an inaccurate phrase in a comment.
+
+ * html/parser/HTMLTreeBuilder.cpp:
+ (WebCore::HTMLTreeBuilder::processEndTag):
+
+2010-09-22 Andy Estes <aestes@apple.com>
+
+ Reviewed by Adam Barth.
+
+ REGRESSION (r61285): <script /> parses differently in HTML5
+ https://bugs.webkit.org/show_bug.cgi?id=42909
+
+ If pre-HTML5 parser quirks are enabled, the HTMLTreeBuilder should
+ handle self-closing script tags like the old parser did. Specifically,
+ "<script />" should be treated as "<script></script>".
+
+ * html/parser/HTMLDocumentParser.cpp:
+ (WebCore::HTMLDocumentParser::HTMLDocumentParser): Instantiate
+ HTMLTreeBuilder with the value of usePreHTML5ParserQuirks().
+ * html/parser/HTMLTreeBuilder.cpp:
+ (WebCore::HTMLTreeBuilder::HTMLTreeBuilder):
+ (WebCore::HTMLTreeBuilder::processEndTag): If the tokenizer is not
+ currently in DataState, this means that the current end token is fake
+ and was created by the tree builder to handle a self-closing script tag.
+ Assert that pre-HTML5 quirks are enabled and set the tokenizer's state
+ to DataState in this case.
+ (WebCore::HTMLTreeBuilder::processStartTagForInHead): If pre-HTML5
+ parser quirks are enabled and the script tag is self-closing, create and
+ procses a fake script end tag.
+ * html/parser/HTMLTreeBuilder.h:
+ (WebCore::HTMLTreeBuilder::create):
+
+2010-09-22 Mihai Parparita <mihaip@chromium.org>
+
+ Reviewed by Darin Fisher.
+
+ [Chromium] User style layout tests don't pass on Chromium
+ https://bugs.webkit.org/show_bug.cgi?id=46069
+
+ Instead of making resetUserStyleCacheInAllFrames be a no-op for
+ Chromium, have it be controlled by a UserStyleInjectionTime enum.
+
+ Also move the UserStyleSheet::Level enum to be inside
+ UserStyleSheetTypes for consistency.
+
+ * WebCore.exp.in:
+ * dom/Document.cpp:
+ (WebCore::Document::pageGroupUserSheets):
+ * page/PageGroup.cpp:
+ (WebCore::PageGroup::addUserStyleSheetToWorld):
+ * page/PageGroup.h:
+ * page/UserStyleSheet.h:
+ (WebCore::UserStyleSheet::UserStyleSheet):
+ (WebCore::UserStyleSheet::level):
+ * page/UserStyleSheetTypes.h:
+
+2010-09-22 Ruben <chromium@hybridsource.org>
+
+ Reviewed by Tony Chang.
+
+ [chromium] added ifdefs for FreeBSD support
+ https://bugs.webkit.org/show_bug.cgi?id=46316
+
+ * bindings/js/JSInspectorFrontendHostCustom.cpp:
+ (WebCore::JSInspectorFrontendHost::platform):
+ * bindings/v8/custom/V8InspectorFrontendHostCustom.cpp:
+ (WebCore::V8InspectorFrontendHost::platformCallback):
+ * dom/SelectElement.cpp:
+ * loader/CachedFont.cpp:
+ * page/EventHandler.cpp:
+ * page/chromium/EventHandlerChromium.cpp:
+ * platform/Scrollbar.cpp:
+ * platform/chromium/ChromiumBridge.h:
+ * platform/graphics/chromium/FontPlatformData.h:
+ * platform/graphics/skia/FontCustomPlatformData.cpp:
+ (WebCore::FontCustomPlatformData::~FontCustomPlatformData):
+ (WebCore::FontCustomPlatformData::fontPlatformData):
+ (WebCore::createFontCustomPlatformData):
+ * platform/graphics/skia/FontCustomPlatformData.h:
+
+2010-09-22 Rafael Antognolli <antognolli@profusion.mobi>
+
+ Unreviewed build fix.
+
+ [EFL] Fix build due to latest EFL (Edje) changes.
+ https://bugs.webkit.org/show_bug.cgi?id=46317
+
+ Make the change int -> Edje_Load_Error (enum).
+
+ No new functionality, so no new tests.
+
+ * platform/efl/RenderThemeEfl.cpp:
+ (WebCore::RenderThemeEfl::themePartCacheEntryReset):
+ (WebCore::RenderThemeEfl::createEdje):
+ (WebCore::RenderThemeEfl::applyPartDescriptions):
+ * platform/efl/ScrollbarEfl.cpp:
+ (ScrollbarEfl::setParent):
+
+2010-09-22 Chris Fleizach <cfleizach@apple.com>
+
+ Reviewed by Darin Adler.
+
+ AX: aria-hidden change doesn't update the ax tree
+ https://bugs.webkit.org/show_bug.cgi?id=45836
+
+ Test: accessibility/aria-hidden-update.html
+
+ * dom/Element.cpp:
+ (WebCore::Element::updateAfterAttributeChanged):
+
+2010-09-22 Kinuko Yasuda <kinuko@chromium.org>
+
+ Reviewed by Dumitru Daniliuc.
+
+ [FileSystem] Fix Flags handling in DirectoryEntry custom binding code
+ https://bugs.webkit.org/show_bug.cgi?id=46028
+
+ Do not use adoptRef to get RefPtr from a raw pointer that is already
+ adopted in toNative/toJS.
+
+ Test: fast/filesystem/flags-passing.html
+
+ * bindings/js/JSDirectoryEntryCustom.cpp:
+ (WebCore::JSDirectoryEntry::getFile):
+ (WebCore::JSDirectoryEntry::getDirectory):
+ * bindings/v8/custom/V8DirectoryEntryCustom.cpp:
+ (WebCore::V8DirectoryEntry::getDirectoryCallback):
+ (WebCore::V8DirectoryEntry::getFileCallback):
+
+2010-09-22 Jia Pu <jpu@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ Need to stop autocorrection panel timer when selection changes.
+ https://bugs.webkit.org/show_bug.cgi?id=46201
+ <rdar://problem/8441042>
+
+ * editing/Editor.cpp:
+ (WebCore::Editor::appliedEditing): Stop correction timer after editing.
+ (WebCore::Editor::markAllMisspellingsAndBadGrammarInRanges): When text checking is done for
+ showing autocorrection panel, we suppress all corrections that are not at the end of
+ text checking range. So that we don't replace other words while showing correction panel
+ for the last word.
+ (WebCore::Editor::stopCorrectionPanelTimer): Stop correction timer.
+
+ * editing/Editor.h: Added stopCorrectionPanelTimer() method.
+
+2010-09-22 Eric Uhrhane <ericu@chromium.org>
+
+ Reviewed by Dumitru Daniliuc.
+
+ Add Chromium implementation for FileWriter
+ https://bugs.webkit.org/show_bug.cgi?id=44361
+
+ No new tests; the implementation's not yet far enough along for that.
+
+ This makes a chain of contruction-and-linking-up for various sorts of
+ FileWriter interfaces to call through to Chromium, and for various
+ sorts of FileWriterClients to call back, with object ownership always
+ pointing towards the Chromium API. That is, the DOM object owns an
+ AsyncFileWriter, which owns its implementation object, and the reverse
+ (client) direction is raw pointers.
+
+ File metadata is looked up before the FileWriter is returned, so that
+ we know the file exists and can cache its length.
+
+ The WebCore part of this is simple and generic enough to handle
+ Chromium, so it should be easy for me to put in a WebCore-only
+ implementation next.
+
+ * fileapi/AsyncFileWriter.h:
+ * fileapi/DOMFileSystem.cpp:
+ (WebCore::DOMFileSystem::createWriter):
+ * fileapi/DOMFileSystem.h:
+ * fileapi/FileSystemCallbacks.cpp:
+ (WebCore::FileSystemCallbacksBase::didCreateFileWriter):
+ (WebCore::FileWriterCallbacks::FileWriterCallbacks):
+ (WebCore::FileWriterCallbacks::didCreateFileWriter):
+ * fileapi/FileSystemCallbacks.h:
+ * platform/AsyncFileSystem.h:
+ * platform/AsyncFileSystemCallbacks.h:
+
+2010-09-22 Alexey Proskuryakov <ap@apple.com>
+
+ Reviewed by Adam Barth.
+
+ https://bugs.webkit.org/show_bug.cgi?id=46222
+ <rdar://problem/8461701> Document.getElementById() malfunctions if ID was changed via Attr node modification.
+
+ Test: fast/dom/Attr/change-id-via-attr-node-value.html
+
+ * dom/Attr.h:
+ * dom/Attr.cpp:
+ (WebCore::Attr::setValue): Separated a version callable from WebCore from one avaiable to JS.
+ Attr::setValue() can be called from Element::setAttribute(), and we don't want to update
+ m_elementsById (or to call attributeChanged()) twice in that case.
+ (WebCore::Attr::childrenChanged): If Attr's node children change, id changes.
+
+ * dom/Document.cpp: (WebCore::Document::removeElementById): Added an assertion that we are
+ not trying to remove something that isn't there. If we are, we probably failed to update
+ m_elementsById earlier.
+
+ * dom/Element.cpp: (WebCore::Element::setAttribute): If the attribute has an Attr node, its
+ children should be updated to match attribute value.
+
+2010-09-22 David Hyatt <hyatt@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ https://bugs.webkit.org/show_bug.cgi?id=46311, lock form controls and replaced elements to vertical block flow.
+
+ Patch form controls that don't use RenderReplaced by hand in html.css. Patch all RenderReplaced elements
+ with an override of setStyle that forces the new style to have a vertical block flow. We have to do something like
+ this to cover the CSS3 content: url(img) method of image replacement.
+
+ * css/html.css:
+ (input, textarea, keygen, select, button, isindex, meter, progress):
+ * rendering/RenderReplaced.cpp:
+ (WebCore::RenderReplaced::setStyle):
+ * rendering/RenderReplaced.h:
+
+2010-09-22 David Hyatt <hyatt@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ https://bugs.webkit.org/show_bug.cgi?id=46304
+
+ display:inline should become display:inline-block when an object's block flow does not match its parent's block flow.
+
+ Added fast/blockflow/display-mutation.html
+
+ * css/CSSStyleSelector.cpp:
+ (WebCore::CSSStyleSelector::styleForElement):
+ (WebCore::CSSStyleSelector::pseudoStyleForElement):
+ (WebCore::CSSStyleSelector::adjustRenderStyle):
+ * css/CSSStyleSelector.h:
+
+2010-09-22 Mario Sanchez Prada <msanchez@igalia.com>
+
+ Reviewed by Martin Robinson.
+
+ [Gtk] object:text-changed events should be emitted for entries and password text
+ https://bugs.webkit.org/show_bug.cgi?id=25898
+
+ Implement proper 'text-changed' signal emission for the GTK port
+
+ Call deleteTextFromNode() when needed while removing text nodes.
+ Do it even when removeNode() is going to be called afterwards, in
+ order to allow accessibility to get properly notified about the
+ text being removed alongside with that node.
+
+ * editing/DeleteSelectionCommand.cpp:
+ (WebCore::DeleteSelectionCommand::handleGeneralDelete):
+
+ New function in AXObjectCache to call when text changes in a node.
+ Added one new function to allow notifying something changed in a
+ text node through the associated RenderObject, making such a
+ function dependant on the platform-specific implementation,
+ provided through a protected function (provided a proper
+ implementation for the GTK port and a dummy one for the others).
+
+ * accessibility/AXObjectCache.cpp:
+ (WebCore::AXObjectCache::nodeTextChangeNotification): New
+ * accessibility/AXObjectCache.h:
+ (WebCore::AXObjectCache::AXTextChange): New enumeration
+ (WebCore::AXObjectCache::nodeTextChangeNotification): New
+ (WebCore::AXObjectCache::nodeTextChangePlatformNotification): New
+ * accessibility/AccessibilityRenderObject.h:
+ (WebCore::toAccessibilityRenderObject):
+ * accessibility/chromium/AXObjectCacheChromium.cpp:
+ (WebCore::AXObjectCache::nodeTextChangePlatformNotification): New
+ * accessibility/gtk/AXObjectCacheAtk.cpp:
+ (WebCore::emitTextChanged):
+ (WebCore::AXObjectCache::nodeTextChangePlatformNotification): New
+ * accessibility/mac/AXObjectCacheMac.mm:
+ (WebCore::AXObjectCache::nodeTextChangePlatformNotification): New
+ * accessibility/win/AXObjectCacheWin.cpp:
+ (WebCore::AXObjectCache::nodeTextChangePlatformNotification): New
+
+ Notify accessibility when something changes in a text node.
+ Call to AXObjectCache::nodeTextChangeNotification() to notify when
+ text was inserted/deleted when applying/unapplying a text edition
+ command, along with the offset in the original text where the
+ change took place and the number of characters that got affected.
+
+ * editing/AppendNodeCommand.cpp:
+ (WebCore::sendAXTextChangedIgnoringLineBreaks):
+ (WebCore::AppendNodeCommand::doApply):
+ (WebCore::AppendNodeCommand::doUnapply):
+ * editing/DeleteFromTextNodeCommand.cpp:
+ (WebCore::DeleteFromTextNodeCommand::doApply):
+ (WebCore::DeleteFromTextNodeCommand::doUnapply):
+ * editing/InsertIntoTextNodeCommand.cpp:
+ (WebCore::InsertIntoTextNodeCommand::doApply):
+ (WebCore::InsertIntoTextNodeCommand::doUnapply):
+ * editing/InsertNodeBeforeCommand.cpp:
+ (WebCore::InsertNodeBeforeCommand::doApply):
+ (WebCore::InsertNodeBeforeCommand::doUnapply):
+ (WebCore::DeleteSelectionCommand::handleGeneralDelete):
+
+2010-09-22 David Hyatt <hyatt@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ https://bugs.webkit.org/show_bug.cgi?id=46298, add logicalWidth/Height getters/setters to RenderBox.
+
+ * rendering/RenderBox.cpp:
+ (WebCore::RenderBox::logicalWidth):
+ (WebCore::RenderBox::logicalHeight):
+ (WebCore::RenderBox::setLogicalWidth):
+ (WebCore::RenderBox::setLogicalHeight):
+ * rendering/RenderBox.h:
+
+2010-09-22 Luiz Agostini <luiz.agostini@openbossa.org>
+
+ Reviewed by Oliver Hunt.
+
+ Script engine agnostic ScriptCallback class
+ https://bugs.webkit.org/show_bug.cgi?id=43216
+
+ Refactoring class ScriptFunctionCall to create a class (ScriptCallback) that
+ receives a script function as a ScriptValue and calls that function with provided parameters.
+
+ * bindings/js/ScriptFunctionCall.cpp:
+ (WebCore::ScriptCallArgumentHandler::appendArgument):
+ (WebCore::ScriptFunctionCall::ScriptFunctionCall):
+ (WebCore::ScriptCallback::ScriptCallback):
+ (WebCore::ScriptCallback::call):
+ * bindings/js/ScriptFunctionCall.h:
+ (WebCore::ScriptCallArgumentHandler::ScriptCallArgumentHandler):
+ * bindings/v8/ScriptFunctionCall.cpp:
+ (WebCore::ScriptCallArgumentHandler::appendArgument):
+ (WebCore::ScriptFunctionCall::ScriptFunctionCall):
+ (WebCore::ScriptCallback::ScriptCallback):
+ (WebCore::ScriptCallback::call):
+ * bindings/v8/ScriptFunctionCall.h:
+ (WebCore::ScriptCallArgumentHandler::ScriptCallArgumentHandler):
+
+2010-09-22 Brent Fulgham <bfulgham@webkit.org>
+
+ Unreviewed.
+
+ Build fix for invalid assertion after r68059.
+
+ * editing/ApplyStyleCommand.cpp:
+ (WebCore::getPropertiesNotIn): Correct assertion target after
+ name change.
+
+2010-09-22 David Hyatt <hyatt@apple.com>
+
+ Reviewed by Simon Fraser.
+
+ https://bugs.webkit.org/show_bug.cgi?id=45957, fix regression in column rules stacking test.
+
+ Rewrite how the pagination bit gets set in RenderLayers, since it was totally broken and not
+ accounting for whether or not the columns block was even in the layer's containing block
+ hierarchy.
+
+ * rendering/RenderLayer.cpp:
+ (WebCore::checkContainingBlockChainForPagination):
+ (WebCore::RenderLayer::updatePagination):
+
+2010-09-22 Brent Fulgham <bfulgham@webkit.org>
+
+ Unreviewed.
+
+ [WinCairo] Build fix for platform/cairo stuff after r67981.
+
+ * WebCore.vcproj/WebCore.vcproj: Add new files needed by all cairo
+ ports.
+
+2010-09-22 Erik Arvidsson <arv@chromium.org>
+
+ Reviewed by Nate Chapin.
+
+ [Chromium] Fix memory model for dataset
+ https://bugs.webkit.org/show_bug.cgi?id=46280
+
+ This is covered by existing tests.
+
+ * bindings/v8/custom/V8DOMStringMapCustom.cpp:
+ (WebCore::toV8):
+
+2010-09-22 Abhishek Arya <inferno@chromium.org>
+
+ Reviewed by Dave Hyatt.
+
+ Fix wrong casts for table cell since its parent is not a RenderBlock. Remove
+ the redundant destroy call for empty anonymous columns or column span block.
+ https://bugs.webkit.org/show_bug.cgi?id=46245
+
+ Tests: fast/table/table-anonymous-block-destroy-crash.html
+ fast/table/table-columns-blocks-calc-crash.html
+
+ * rendering/RenderBlock.cpp:
+ (WebCore::RenderBlock::addChildToAnonymousColumnBlocks):
+ (WebCore::RenderBlock::columnsBlockForSpanningElement):
+ (WebCore::RenderBlock::removeChild):
+
+2010-09-22 Matt Perry <mpcomplete@chromium.org>
+
+ Reviewed by Darin Fisher.
+
+ Trying to reland a version of r67749:
+ Have V8DOMWindowShell ask the embedder whether to run a V8 extension
+ in a particular script context.
+ https://bugs.webkit.org/show_bug.cgi?id=45721
+
+ * bindings/v8/V8DOMWindowShell.cpp:
+ (WebCore::V8DOMWindowShell::createNewContext):
+ * bindings/v8/V8Proxy.cpp:
+ (WebCore::V8Proxy::registerExtension):
+ * bindings/v8/V8Proxy.h:
+ * loader/EmptyClients.h:
+ (WebCore::EmptyFrameLoaderClient::allowScriptExtension):
+ * loader/FrameLoaderClient.h:
+
+2010-09-22 Ryosuke Niwa <rniwa@webkit.org>
+
+ Reviewed by Darin Adler.
+
+ queryCommandState returns false for Underline command when no selection is made
+ https://bugs.webkit.org/show_bug.cgi?id=17594
+
+ The bug was caused by selectionComputedStyle's adding -webkit-text-decorations-in-effect property
+ to a dummy span used to obtain the computed style when there is a typing style.
+ Since this property is for internal use only, the CSS parser always stripped the property.
+ As a result, we were always ignoring the text decorations set by the typing style.
+
+ Fixed the bug by making selectionComputedStyle directly merge the computed style of the current
+ caret position and the typing style. This also eliminates the need for a dummy span element.
+ Due to the merge, the return value of selectionComputedStyle had to be changed to CSSMutableStyleDeclaration
+ from CSSComputedStyleDeclaration.
+
+ Test: editing/execCommand/query-text-decoration-with-typing-style.html
+
+ * editing/ApplyStyleCommand.cpp:
+ (WebCore::StyleChange::init): Calls getPropertiesNotIn.
+ (WebCore::getPropertiesNotIn): Renamed from getPropertiesNotInComputedStyle since it takes
+ CSSStyleDeclaration* instead of CSSComputedStyleDeclaration* for the second argument.
+ (WebCore::ApplyStyleCommand::removeNonEditingProperties): Extracted from editingStyleAtPosition.
+ (WebCore::ApplyStyleCommand::editingStyleAtPosition): Calls removeNonEditingProperties.
+ * editing/ApplyStyleCommand.h:
+ * editing/Editor.cpp:
+ (WebCore::triStateOfStyle): Calls getPropertiesNotIn. Renamed from triStateOfStyleInComputedStyle
+ since it no longer takes CSSComputedStyleDeclaration.
+ (WebCore::Editor::selectionStartHasStyle): Calls selectionComputedStyle and triStateOfStyle.
+ (WebCore::Editor::selectionHasStyle): Ditto.
+ (WebCore::Editor::selectionStartCSSPropertyValue): Calls selectionComputedStyle.
+ (WebCore::Editor::selectionComputedStyle): See above.
+ * editing/Editor.h:
+ * editing/EditorCommand.cpp:
+ (WebCore::executeToggleStyleInList): Calls selectionComputedStyle.
+
+2010-09-22 Jamey Hicks <jamey.hicks@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Web Inspector: Remote Web Inspector support for QtWebKit
+ https://bugs.webkit.org/show_bug.cgi?id=43988
+
+ Runs a web debug server on port specified by QtTestBrowser
+ argument -remote-inspector-port. Property
+ _q_webInspectorServerPort of the QWebPage instance will be set
+ according to the argument. All pages with that property set will
+ be remotely inspectable.
+
+ URL for remote inspection of first QWebPage is
+ http://localhost:9222/webkit/inspector/inspector.html?page=1
+ where 1 is the number of the QWebPage instance.
+
+ The base URL yields an index page with links to the individual inspectors:
+ http://localhost:9222/
+
+ * WebCore.pro
+
+2010-09-21 Darin Adler <darin@apple.com>
+
+ Reviewed by Anders Carlsson.
+
+ Fix some Objective-C GC problems and use RetainPtr instead of HardRetain/Release
+ https://bugs.webkit.org/show_bug.cgi?id=46220
+
+ * WebCore.exp.in: Updated.
+
+ * bindings/objc/ObjCEventListener.h: Use a RetainPtr for m_listener, since that
+ will do a CFRetain, which is right for GC rather than an -[NSObject retain],
+ which is not.
+ * bindings/objc/ObjCEventListener.mm:
+ (WebCore::ObjCEventListener::ObjCEventListener): Removed explicit retain.
+ (WebCore::ObjCEventListener::~ObjCEventListener): Removed explicit release and
+ added get().
+ (WebCore::ObjCEventListener::handleEvent): Added get();
+
+ * bridge/objc/objc_instance.mm:
+ (ObjcInstance::setGlobalException): Use copy/release instead of
+ HardRetain/HardRelease.
+ (ObjcInstance::moveGlobalExceptionToExecState): Ditto.
+
+ * platform/Cursor.h: Use RetainPtr for PlatformCursor on Mac.
+
+ * platform/Cursor.cpp:
+ (WebCore::Cursor::platformCursor): Moved this to CursorMac for the Mac.
+
+ * platform/Widget.cpp: Removed retain/releasePlatformWidget and made them
+ both inlines in the header file.
+
+ * platform/Widget.h: Fixed includes and added an include of RetainPtr.
+ Made platformWidget and setPlatformWidget non-inline on the Mac platform.
+ Made releasePlatformWidget and retainPlatformWidget empty inline functions
+ for non-GTK platforms.
+
+ * platform/graphics/mac/ImageMac.mm: Removed unneeded FoundationExtras.h
+ include.
+
+ * platform/mac/ClipboardMac.mm:
+ (WebCore::cocoaTypeFromHTMLClipboardType): use RetainPtr for the return type.
+ (WebCore::ClipboardMac::clearData): Use RetainPtr.
+ (WebCore::ClipboardMac::getData): Ditto.
+ (WebCore::ClipboardMac::setData): Ditto.
+
+ * platform/mac/CursorMac.mm:
+ (WebCore::createCustomCursor): Use RetainPtr for the return type.
+ (WebCore::Cursor::ensurePlatformCursor): Removed all the calls to HardRetain
+ since m_platformCursor is now a RetainPtr.
+ (WebCore::Cursor::Cursor): Ditto.
+ (WebCore::Cursor::operator=): Ditto. Also HardRelease.
+ (WebCore::Cursor::~Cursor): Ditto.
+ (WebCore::Cursor::platformCursor): Use get here.
+
+ * platform/mac/FoundationExtras.h: Removed all the functions except for
+ HardAutorelease. Later we can remove that one too.
+
+ * platform/mac/ThemeMac.mm:
+ (WebCore::setUpButtonCell): Changed this function to have a return value.
+ Otherwise we end up taking a pointer (actually a reference) to a global
+ variable, which does not do the right thing for GC.
+ (WebCore::nonDefaultButton): Added.
+ (WebCore::defaultButton): Added.
+ (WebCore::button): Changed to call two separate functions with two separate
+ global variables to avoid the problem with pointers to globals.
+
+ * platform/mac/WidgetMac.mm:
+ (WebCore::Widget::~Widget): Removed unneeded call to releasePlatformWidget.
+ (WebCore::Widget::platformWidget): Non-inline so we can comipile the header
+ plain non-Objective-C C++.
+ (WebCore::Widget::setPlatformWidget): Ditto.
+
+ * platform/network/mac/WebCoreURLResponse.mm:
+ (mimeTypeFromUTITree): Use RetainPtr for the return type.
+ (-[NSURLResponse adjustMIMETypeIfNecessary]): Use RetainPtr.
+
+2010-09-22 Martin Robinson <mrobinson@igalia.com>
+
+ Reviewed by Xan Lopez.
+
+ [GTK] r68027 caused many crashes on the bots
+ https://bugs.webkit.org/show_bug.cgi?id=46268
+
+ Add the appropriate OwnPtrCairo.h include which has the OwnPtr
+ specialization for Cairo paths. Without it, we will have memory
+ corruption.
+
+ * platform/graphics/cairo/PathCairo.cpp: Add OwnPtrCairo.h include.
+
+2010-09-22 Pavel Podivilov <podivilov@chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ Web Inspector: implement pausing on XHR
+ https://bugs.webkit.org/show_bug.cgi?id=46086
+
+ * bindings/v8/custom/V8XMLHttpRequestCustom.cpp:
+ (WebCore::V8XMLHttpRequest::sendCallback):
+ * inspector/Inspector.idl:
+ * inspector/InspectorController.cpp:
+ (WebCore::InspectorController::InspectorController):
+ (WebCore::InspectorController::setNativeBreakpoint):
+ (WebCore::InspectorController::removeNativeBreakpoint):
+ (WebCore::InspectorController::willInsertDOMNodeImpl):
+ (WebCore::InspectorController::willRemoveDOMNodeImpl):
+ (WebCore::InspectorController::willModifyDOMAttrImpl):
+ (WebCore::InspectorController::instrumentWillSendXMLHttpRequestImpl):
+ * inspector/InspectorController.h:
+ (WebCore::InspectorController::instrumentWillSendXMLHttpRequest):
+ (WebCore::InspectorController::inspectorControllerForScriptExecutionContext):
+ (WebCore::InspectorController::inspectorControllerForNode):
+ (WebCore::InspectorController::inspectorControllerForDocument):
+ * inspector/InspectorDebuggerAgent.cpp:
+ (WebCore::InspectorDebuggerAgent::InspectorDebuggerAgent):
+ (WebCore::InspectorDebuggerAgent::didPause):
+ (WebCore::InspectorDebuggerAgent::breakProgram):
+ * inspector/InspectorDebuggerAgent.h:
+ * inspector/InspectorTimelineAgent.h:
+ * inspector/front-end/CallStackSidebarPane.js:
+ (WebInspector.CallStackSidebarPane.prototype.updateStatus):
+ * inspector/front-end/ElementsPanel.js:
+ (WebInspector.ElementsPanel):
+ (WebInspector.ElementsPanel.prototype.reset):
+ * inspector/front-end/ElementsTreeOutline.js:
+ (WebInspector.ElementsTreeElement.prototype._populateTagContextMenu):
+ * inspector/front-end/ScriptsPanel.js:
+ (WebInspector.ScriptsPanel):
+ (WebInspector.ScriptsPanel.prototype.debuggerPaused):
+ (WebInspector.ScriptsPanel.prototype.reset):
+ * inspector/front-end/Settings.js:
+ * xml/XMLHttpRequest.h:
+ (WebCore::XMLHttpRequest::url):
+
+2010-09-22 Kenneth Russell <kbr@google.com>
+
+ Reviewed by James Robinson.
+
+ Add local triangulation of cubic curve control points
+ https://bugs.webkit.org/show_bug.cgi?id=45252
+
+ Adding a localized triangulation algorithm which takes as input
+ the four control points of a cubic curve segment and provides both
+ triangles as well as the ability to walk the interior edges. The
+ latter will be used later to fill the interior of shapes bounded
+ by these cubic curves, quadratic curves and line segments.
+
+ * platform/graphics/gpu/LoopBlinnLocalTriangulator.cpp: Added.
+ (WebCore::LoopBlinnLocalTriangulator::Triangle::contains):
+ (WebCore::LoopBlinnLocalTriangulator::Triangle::nextVertex):
+ (WebCore::LoopBlinnLocalTriangulator::Triangle::indexForVertex):
+ (WebCore::LoopBlinnLocalTriangulator::Triangle::makeCounterClockwise):
+ (WebCore::LoopBlinnLocalTriangulator::LoopBlinnLocalTriangulator):
+ (WebCore::LoopBlinnLocalTriangulator::reset):
+ (WebCore::LoopBlinnLocalTriangulator::triangulate):
+ (WebCore::LoopBlinnLocalTriangulator::triangulateHelper):
+ (WebCore::LoopBlinnLocalTriangulator::addTriangle):
+ (WebCore::LoopBlinnLocalTriangulator::addInteriorVertex):
+ (WebCore::LoopBlinnLocalTriangulator::isSharedEdge):
+ * platform/graphics/gpu/LoopBlinnLocalTriangulator.h: Added.
+ (WebCore::LoopBlinnLocalTriangulator::Vertex::Vertex):
+ (WebCore::LoopBlinnLocalTriangulator::Vertex::xyCoordinates):
+ (WebCore::LoopBlinnLocalTriangulator::Vertex::klmCoordinates):
+ (WebCore::LoopBlinnLocalTriangulator::Vertex::set):
+ (WebCore::LoopBlinnLocalTriangulator::Vertex::end):
+ (WebCore::LoopBlinnLocalTriangulator::Vertex::setEnd):
+ (WebCore::LoopBlinnLocalTriangulator::Vertex::marked):
+ (WebCore::LoopBlinnLocalTriangulator::Vertex::setMarked):
+ (WebCore::LoopBlinnLocalTriangulator::Vertex::interior):
+ (WebCore::LoopBlinnLocalTriangulator::Vertex::setInterior):
+ (WebCore::LoopBlinnLocalTriangulator::Vertex::resetFlags):
+ (WebCore::LoopBlinnLocalTriangulator::Triangle::Triangle):
+ (WebCore::LoopBlinnLocalTriangulator::Triangle::getVertex):
+ (WebCore::LoopBlinnLocalTriangulator::Triangle::setVertices):
+ (WebCore::LoopBlinnLocalTriangulator::getVertex):
+ (WebCore::LoopBlinnLocalTriangulator::numberOfTriangles):
+ (WebCore::LoopBlinnLocalTriangulator::getTriangle):
+ (WebCore::LoopBlinnLocalTriangulator::numberOfInteriorVertices):
+ (WebCore::LoopBlinnLocalTriangulator::getInteriorVertex):
+
+2010-09-22 Lucas De Marchi <lucas.demarchi@profusion.mobi>
+
+ Unreviewed, EFL build fix.
+
+ * CMakeListsEfl.txt:
+ * platform/efl/ClipboardEfl.cpp:
+ (WebCore::ClipboardEfl::ClipboardEfl):
+
+2010-09-22 İsmail Dönmez <ismail@namtrac.org>
+
+ Reviewed by Andreas Kling.
+
+ [Qt] Build fix for WinCE
+
+ Add two missing stubs:
+ - privateBrowsingStateChanged(bool)
+ - bindingInstance()
+
+ * platform/qt/TemporaryLinkStubsQt.cpp:
+ (PluginView::privateBrowsingStateChanged):
+ (PluginView::bindingInstance):
+
+2010-09-22 Martin Robinson <mrobinson@igalia.com>
+
+ Reviewed by Xan Lopez.
+
+ [GTK] FontCustomPlatformData.cpp leaks FT_Faces
+ https://bugs.webkit.org/show_bug.cgi?id=16941
+
+ Attach lifetime of the FontCustomPlatformData FT_Face to the resulting cairo_font_face_t.
+ This will free the memory associated with the FT_Face once the cairo_font_face_t is
+ destroyed.
+
+ No new tests as functionality should not change.
+
+ * platform/graphics/cairo/FontCustomPlatformData.cpp:
+ (WebCore::releaseCustomFontData): Moved this helper method to the top of the file
+ and gave it a more descriptive name.
+ (WebCore::FontCustomPlatformData::FontCustomPlatformData): Changed the constructor to
+ take the FT_Face and the buffer, so to better encapsulate the creation of the cairo
+ face.
+ (WebCore::FontCustomPlatformData::~FontCustomPlatformData): Added a comment about the
+ fate of the FT_Face to the destructor.
+ (WebCore::createFontCustomPlatformData): Cleaned up the code here and moved some of the
+ logic into the constructor.
+ * platform/graphics/cairo/FontCustomPlatformData.h: Updated method definitions.
+
+2010-09-22 Balazs Kelemen <kb@inf.u-szeged.hu>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ PluginStrategy should satisfy the needs of Qt
+ https://bugs.webkit.org/show_bug.cgi?id=45857
+ No new functionality so no new tests.
+
+ * plugins/PluginData.cpp:
+ (WebCore::PluginData::initPlugins):
+ * plugins/PluginStrategy.h: Added a |const Page*| argument to getPluginInfo.
+
+2010-09-22 Pavel Feldman <pfeldman@chromium.org>
+
+ Reviewed by Yury Semikhatsky.
+
+ Web Inspector: Elements panel does not reflect changes to the text node values.
+ https://bugs.webkit.org/show_bug.cgi?id=46166
+
+ * dom/CharacterData.cpp:
+ (WebCore::CharacterData::dispatchModifiedEvent):
+ * inspector/Inspector.idl:
+ * inspector/InspectorController.cpp:
+ (WebCore::InspectorController::characterDataModifiedImpl):
+ * inspector/InspectorController.h:
+ (WebCore::InspectorController::characterDataModified):
+ * inspector/InspectorDOMAgent.cpp:
+ (WebCore::InspectorDOMAgent::characterDataModified):
+ * inspector/InspectorDOMAgent.h:
+ (WebCore::EventListenerInfo::EventListenerInfo):
+ (WebCore::InspectorDOMAgent::create):
+ (WebCore::InspectorDOMAgent::cast):
+ (WebCore::InspectorDOMAgent::cssStore):
+ * inspector/front-end/DOMAgent.js:
+ (WebInspector.DOMAgent.prototype._characterDataModified):
+ (WebInspector.characterDataModified):
+ * inspector/front-end/ElementsPanel.js:
+ (WebInspector.ElementsPanel.prototype._characterDataModified):
+ * inspector/front-end/ElementsTreeOutline.js:
+ (WebInspector.ElementsTreeElement.prototype._textNodeEditingCommitted):
+
+2010-09-21 Ragner Magalhaes <ragner.magalhaes@openbossa.org>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] On Maemo platform, web style is missing for some inputs
+ https://bugs.webkit.org/show_bug.cgi?id=46182
+
+ * css/themeQtMaemo5.css:
+
+2010-09-22 Patrick Gansterer <paroga@webkit.org>
+
+ Unreviewed.
+
+ [WINCE] Build fix for ResourceHandleWin after r67291.
+
+ * platform/network/win/ResourceHandleWin.cpp:
+ (WebCore::ResourceHandle::loadResourceSynchronously): Replace Frame* parameter with NetworkingContext*.
+
+2010-09-22 Chris Guillory <chris.guillory@google.com>
+
+ Reviewed by Chris Fleizach.
+
+ Crash due to bad cast in AXObjectCacheChromium.cpp.
+ https://bugs.webkit.org/show_bug.cgi?id=46237
+
+ * accessibility/chromium/AXObjectCacheChromium.cpp:
+ (WebCore::AXObjectCache::postPlatformNotification):
+ * page/ChromeClient.h:
+ (WebCore::ChromeClient::postAccessibilityNotification):
+ (WebCore::ChromeClient::didChangeAccessibilityObjectState):
+ (WebCore::ChromeClient::didChangeAccessibilityObjectChildren):
+ * page/chromium/ChromeClientChromium.h:
+
+2010-09-22 Chris Rogers <crogers@google.com>
+
+ Reviewed by James Robinson.
+
+ Add HRTFElevation files
+ https://bugs.webkit.org/show_bug.cgi?id=45864
+
+ No new tests since audio API is not yet implemented.
+
+ * platform/audio/HRTFElevation.cpp: Added.
+ (WebCore::HRTFElevation::calculateSymmetricKernelsForAzimuthElevation):
+ (WebCore::HRTFElevation::calculateKernelsForAzimuthElevation):
+ (WebCore::HRTFElevation::createForSubject):
+ (WebCore::HRTFElevation::createByInterpolatingSlices):
+ (WebCore::HRTFElevation::getKernelsFromAzimuth):
+ * platform/audio/HRTFElevation.h: Added.
+ (WebCore::HRTFElevation::kernelListL):
+ (WebCore::HRTFElevation::kernelListR):
+ (WebCore::HRTFElevation::elevationAngle):
+ (WebCore::HRTFElevation::numberOfAzimuths):
+ (WebCore::HRTFElevation::sampleRate):
+ (WebCore::HRTFElevation::HRTFElevation):
+
+2010-09-22 Alejandro G. Castro <alex@igalia.com>
+
+ Reviewed by Martin Robinson.
+
+ [gtk] Use the smart pointers to handle cairo_path_t
+ https://bugs.webkit.org/show_bug.cgi?id=46212
+
+ Modified the code to use smart pointers with cairo_path_t
+ variables.
+
+ * platform/graphics/cairo/GraphicsContextCairo.cpp:
+ (WebCore::appendPathToCairoContext):
+ (WebCore::GraphicsContext::clip):
+ (WebCore::GraphicsContext::drawTiledShadow):
+ * platform/graphics/cairo/PathCairo.cpp:
+ (WebCore::Path::Path):
+ (WebCore::Path::operator=):
+ (WebCore::Path::apply):
+ (WebCore::Path::debugString):
+
+2010-09-22 Kwang Yul Seo <skyul@company100.net>
+
+ Reviewed by Kent Tamura.
+
+ [BREWMP] Implement Image::loadPlatformResource
+ https://bugs.webkit.org/show_bug.cgi?id=45873
+
+ Load images from the resource directory.
+
+ * platform/graphics/brew/ImageBrew.cpp: Added.
+ (WebCore::Image::loadPlatformResource):
+
+2010-09-22 Chris Rogers <crogers@google.com>
+
+ Reviewed by James Robinson.
+
+ Add HRTFKernel files
+ https://bugs.webkit.org/show_bug.cgi?id=45863
+
+ No new tests since audio API is not yet implemented.
+
+ * platform/audio/HRTFKernel.cpp: Added.
+ (WebCore::extractAverageGroupDelay):
+ (WebCore::HRTFKernel::HRTFKernel):
+ (WebCore::HRTFKernel::createImpulseResponse):
+ (WebCore::HRTFKernel::createInterpolatedKernel):
+ * platform/audio/HRTFKernel.h: Added.
+ (WebCore::HRTFKernel::create):
+ (WebCore::HRTFKernel::fftFrame):
+ (WebCore::HRTFKernel::fftSize):
+ (WebCore::HRTFKernel::frameDelay):
+ (WebCore::HRTFKernel::sampleRate):
+ (WebCore::HRTFKernel::nyquist):
+ (WebCore::HRTFKernel::HRTFKernel):
+
+2010-09-22 Kent Tamura <tkent@chromium.org>
+
+ Reviewed by Chris Fleizach.
+
+ Support keyboard operations for <input type=range>.
+ https://bugs.webkit.org/show_bug.cgi?id=45803
+
+ Increasing the value with Up/Right arrow keys by its step value,
+ and decreasing with Down/Left arrow keys. If an input element has
+ step=any attribute, increasing/decreasing by 1/100 of max-min.
+
+ Note: This change is not useful on Mac because users can't set
+ focus on range controls.
+
+ Test: fast/forms/range-keyoperation.html
+
+ * html/HTMLInputElement.cpp:
+ (WebCore::HTMLInputElement::defaultEventHandler):
+ Calls handleKeyEventForRange() for RANGE and key events.
+ (WebCore::HTMLInputElement::handleKeyEventForRange):
+ * html/HTMLInputElement.h: Add handleKeyEventForRange() declaration.
+
+2010-09-22 Mario Sanchez Prada <msanchez@igalia.com>
+
+ Reviewed by Chris Fleizach.
+
+ [Gtk] Incorrect exposure of list items whose children are elements
+ https://bugs.webkit.org/show_bug.cgi?id=45383
+
+ Set ATK_ROLE_LIST_ITEM looking for the role of the parent object
+
+ Test: platform/gtk/accessibility/list-items-always-exposed.html
+
+ * accessibility/gtk/AccessibilityObjectAtk.cpp:
+ (WebCore::AccessibilityObject::accessibilityPlatformIncludesObject):
+ Always include objects with ListItemRole in accessibility for GTK.
+ * accessibility/gtk/AccessibilityObjectWrapperAtk.cpp:
+ (getInterfaceMaskFromObject): Add some specific code to handle the
+ special case of list markers by implementing AtkText when needed.
+
+2010-09-22 Dirk Schulze <krit@webkit.org>
+
+ Reviewed by Nikolas Zimmermann.
+
+ Make FilterEffects independent of SVG
+ https://bugs.webkit.org/show_bug.cgi?id=46177
+
+ Moving all FilterEffects from svg/graphics/filters to platform/graphics/filters, now that they
+ are independent of SVG. Removed the SVG prefix of the files and updated the headers.
+
+ * Android.mk:
+ * CMakeLists.txt:
+ * GNUmakefile.am:
+ * WebCore.gypi:
+ * WebCore.pro:
+ * WebCore.vcproj/WebCore.vcproj:
+ * WebCore.xcodeproj/project.pbxproj:
+ * platform/graphics/filters/DistantLightSource.h: Copied from WebCore/svg/graphics/filters/SVGDistantLightSource.h.
+ * platform/graphics/filters/FEConvolveMatrix.cpp: Copied from WebCore/svg/graphics/filters/SVGFEConvolveMatrix.cpp.
+ * platform/graphics/filters/FEConvolveMatrix.h: Copied from WebCore/svg/graphics/filters/SVGFEConvolveMatrix.h.
+ * platform/graphics/filters/FEDiffuseLighting.cpp: Copied from WebCore/svg/graphics/filters/SVGFEDiffuseLighting.cpp.
+ * platform/graphics/filters/FEDiffuseLighting.h: Copied from WebCore/svg/graphics/filters/SVGFEDiffuseLighting.h.
+ * platform/graphics/filters/FEDisplacementMap.cpp: Copied from WebCore/svg/graphics/filters/SVGFEDisplacementMap.cpp.
+ * platform/graphics/filters/FEDisplacementMap.h: Copied from WebCore/svg/graphics/filters/SVGFEDisplacementMap.h.
+ * platform/graphics/filters/FEFlood.cpp: Copied from WebCore/svg/graphics/filters/SVGFEFlood.cpp.
+ * platform/graphics/filters/FEFlood.h: Copied from WebCore/svg/graphics/filters/SVGFEFlood.h.
+ * platform/graphics/filters/FELighting.cpp: Copied from WebCore/svg/graphics/filters/SVGFELighting.cpp.
+ * platform/graphics/filters/FELighting.h: Copied from WebCore/svg/graphics/filters/SVGFELighting.h.
+ * platform/graphics/filters/FEMerge.cpp: Copied from WebCore/svg/graphics/filters/SVGFEMerge.cpp.
+ * platform/graphics/filters/FEMerge.h: Copied from WebCore/svg/graphics/filters/SVGFEMerge.h.
+ * platform/graphics/filters/FEMorphology.cpp: Copied from WebCore/svg/graphics/filters/SVGFEMorphology.cpp.
+ * platform/graphics/filters/FEMorphology.h: Copied from WebCore/svg/graphics/filters/SVGFEMorphology.h.
+ * platform/graphics/filters/FEOffset.cpp: Copied from WebCore/svg/graphics/filters/SVGFEOffset.cpp.
+ * platform/graphics/filters/FEOffset.h: Copied from WebCore/svg/graphics/filters/SVGFEOffset.h.
+ * platform/graphics/filters/FESpecularLighting.cpp: Copied from WebCore/svg/graphics/filters/SVGFESpecularLighting.cpp.
+ * platform/graphics/filters/FESpecularLighting.h: Copied from WebCore/svg/graphics/filters/SVGFESpecularLighting.h.
+ * platform/graphics/filters/FETile.cpp: Copied from WebCore/svg/graphics/filters/SVGFETile.cpp.
+ * platform/graphics/filters/FETile.h: Copied from WebCore/svg/graphics/filters/SVGFETile.h.
+ * platform/graphics/filters/FETurbulence.cpp: Copied from WebCore/svg/graphics/filters/SVGFETurbulence.cpp.
+ * platform/graphics/filters/FETurbulence.h: Copied from WebCore/svg/graphics/filters/SVGFETurbulence.h.
+ * platform/graphics/filters/LightSource.cpp: Copied from WebCore/svg/graphics/filters/SVGLightSource.cpp.
+ * platform/graphics/filters/LightSource.h: Copied from WebCore/svg/graphics/filters/SVGLightSource.h.
+ * platform/graphics/filters/PointLightSource.h: Copied from WebCore/svg/graphics/filters/SVGPointLightSource.h.
+ * platform/graphics/filters/SpotLightSource.h: Copied from WebCore/svg/graphics/filters/SVGSpotLightSource.h.
+ * svg/SVGFEConvolveMatrixElement.h:
+ * svg/SVGFEDiffuseLightingElement.cpp:
+ * svg/SVGFEDisplacementMapElement.h:
+ * svg/SVGFEDistantLightElement.cpp:
+ * svg/SVGFEFloodElement.h:
+ * svg/SVGFELightElement.h:
+ * svg/SVGFEMergeElement.h:
+ * svg/SVGFEMorphologyElement.h:
+ * svg/SVGFEOffsetElement.h:
+ * svg/SVGFEPointLightElement.cpp:
+ * svg/SVGFESpecularLightingElement.h:
+ * svg/SVGFESpotLightElement.cpp:
+ * svg/SVGFETileElement.h:
+ * svg/SVGFETurbulenceElement.h:
+ * svg/graphics/filters/SVGDistantLightSource.h: Removed.
+ * svg/graphics/filters/SVGFEConvolveMatrix.cpp: Removed.
+ * svg/graphics/filters/SVGFEConvolveMatrix.h: Removed.
+ * svg/graphics/filters/SVGFEDiffuseLighting.cpp: Removed.
+ * svg/graphics/filters/SVGFEDiffuseLighting.h: Removed.
+ * svg/graphics/filters/SVGFEDisplacementMap.cpp: Removed.
+ * svg/graphics/filters/SVGFEDisplacementMap.h: Removed.
+ * svg/graphics/filters/SVGFEFlood.cpp: Removed.
+ * svg/graphics/filters/SVGFEFlood.h: Removed.
+ * svg/graphics/filters/SVGFELighting.cpp: Removed.
+ * svg/graphics/filters/SVGFELighting.h: Removed.
+ * svg/graphics/filters/SVGFEMerge.cpp: Removed.
+ * svg/graphics/filters/SVGFEMerge.h: Removed.
+ * svg/graphics/filters/SVGFEMorphology.cpp: Removed.
+ * svg/graphics/filters/SVGFEMorphology.h: Removed.
+ * svg/graphics/filters/SVGFEOffset.cpp: Removed.
+ * svg/graphics/filters/SVGFEOffset.h: Removed.
+ * svg/graphics/filters/SVGFESpecularLighting.cpp: Removed.
+ * svg/graphics/filters/SVGFESpecularLighting.h: Removed.
+ * svg/graphics/filters/SVGFETile.cpp: Removed.
+ * svg/graphics/filters/SVGFETile.h: Removed.
+ * svg/graphics/filters/SVGFETurbulence.cpp: Removed.
+ * svg/graphics/filters/SVGFETurbulence.h: Removed.
+ * svg/graphics/filters/SVGLightSource.cpp: Removed.
+ * svg/graphics/filters/SVGLightSource.h: Removed.
+ * svg/graphics/filters/SVGPointLightSource.h: Removed.
+ * svg/graphics/filters/SVGSpotLightSource.h: Removed.
+
+2010-09-22 Patrick Gansterer <paroga@webkit.org>
+
+ Reviewed by Adam Roben.
+
+ [WIN] Add internetHandle to WebCoreSynchronousLoader.
+ https://bugs.webkit.org/show_bug.cgi?id=46185
+
+ For loading content via network the WebCoreSynchronousLoader needs its own (synchronous) internetHandle.
+ This also adds asynchronousInternetHandle() to create a static asynchronous internetHandle.
+
+ * platform/network/win/ResourceHandleWin.cpp:
+ (WebCore::createInternetHandle):
+ (WebCore::asynchronousInternetHandle):
+ (WebCore::WebCoreSynchronousLoader::internetHandle):
+ (WebCore::WebCoreSynchronousLoader::WebCoreSynchronousLoader): Create synchronous internetHandle.
+ (WebCore::WebCoreSynchronousLoader::~WebCoreSynchronousLoader): Delete synchronous internetHandle.
+
+2010-09-22 Kwang Yul Seo <skyul@company100.net>
+
+ Reviewed by Chris Fleizach.
+
+ [chromium] Remove unused sys/types.h in VDMXParser.cpp
+ https://bugs.webkit.org/show_bug.cgi?id=46136
+
+ sys/types.h is not needed here.
+
+ * platform/graphics/chromium/VDMXParser.cpp:
+
+2010-09-22 Kwang Yul Seo <skyul@company100.net>
+
+ Reviewed by Kent Tamura.
+
+ [BREWMP] Change the home directory path to the WebKit module directory
+ https://bugs.webkit.org/show_bug.cgi?id=45895
+
+ AEEFS_HOME_DIR denotes the currently running application's directory.
+ Change it to fs:/~<clsid> to use the WebKit module directory as home.
+
+ * platform/brew/FileSystemBrew.cpp:
+ (WebCore::homeDirectoryPath):
+
+2010-09-22 Kwang Yul Seo <skyul@company100.net>
+
+ Reviewed by Kent Tamura.
+
+ [BREWMP] Add dummy Pasteboard
+ https://bugs.webkit.org/show_bug.cgi?id=46107
+
+ Pasteboard is not supported yet. Add dummy implementation to avoid link errors.
+
+ * platform/brew/PasteboardBrew.cpp: Added.
+ (WebCore::Pasteboard::generalPasteboard):
+ (WebCore::Pasteboard::Pasteboard):
+ (WebCore::Pasteboard::clear):
+ (WebCore::Pasteboard::writeSelection):
+ (WebCore::Pasteboard::writePlainText):
+ (WebCore::Pasteboard::writeURL):
+ (WebCore::Pasteboard::writeImage):
+ (WebCore::Pasteboard::canSmartReplace):
+ (WebCore::Pasteboard::plainText):
+ (WebCore::Pasteboard::documentFragment):
+
+2010-09-21 Ryosuke Niwa <rniwa@webkit.org>
+
+ Reviewed by Kent Tamura.
+
+ Each EntityMaskIn* needs explanation
+ https://bugs.webkit.org/show_bug.cgi?id=44833
+
+ Added a description as to why we escape nbsp when serializing HTML documents but not when serializing XML documents.
+
+ * editing/markup.cpp:
+
+2010-09-21 Ryosuke Niwa <rniwa@webkit.org>
+
+ Reviewed by Kent Tamura.
+
+ cleanup: removeInlineStyleFromElement and extractInlineStyleToPushDown should be merged
+ https://bugs.webkit.org/show_bug.cgi?id=46205
+
+ Cleanup required to fix the bug 27818. Added the style extraction mechanism to removeInlineStyleFromElement
+ and removeCSSStyle and replaced the call to extractInlineStyleToPushDown by a call to removeInlineStyleFromElement.
+
+ * editing/ApplyStyleCommand.cpp:
+ (WebCore::ApplyStyleCommand::removeInlineStyleFromElement): Added extractedStyle argument.
+ (WebCore::ApplyStyleCommand::removeCSSStyle): Added extractedStyle argument.
+ (WebCore::ApplyStyleCommand::pushDownInlineStyleAroundNode): Calls removeInlineStyleFromElement instead of
+ extractInlineStyleToPushDown which has been deleted.
+ * editing/ApplyStyleCommand.h:
+
+2010-09-21 Andrew Wilson <atwilson@chromium.org>
+
+ Unreviewed, rolling out r67982.
+ http://trac.webkit.org/changeset/67982
+ https://bugs.webkit.org/show_bug.cgi?id=45156
+
+ Causes crashes on chromium testshell
+
+ * WebCore.gypi:
+ * accessibility/chromium/AXObjectCacheChromium.cpp:
+ (WebCore::AXObjectCache::postPlatformNotification):
+ (WebCore::AXObjectCache::handleFocusedUIElementChanged):
+ (WebCore::AXObjectCache::handleScrolledToAnchor):
+ * dom/Document.cpp:
+ (WebCore::Document::implicitClose):
+ (WebCore::Document::setFocusedNode):
+ * editing/SelectionController.h:
+ * editing/chromium/SelectionControllerChromium.cpp: Removed.
+ * page/FrameView.cpp:
+ (WebCore::FrameView::layout):
+ * page/chromium/ChromeClientChromium.h:
+
+2010-09-21 Cosmin Truta <ctruta@chromium.org>
+
+ Reviewed by James Robinson.
+
+ RenderImage::intrinsicSizeChanged crashes when m_imageResource is missing
+ https://bugs.webkit.org/show_bug.cgi?id=46120
+
+ Avoid applying operator -> to m_imageResource when its underlying pointer is NULL.
+
+ * rendering/RenderImage.h:
+ (WebCore::RenderImage::intrinsicSizeChanged): Checked m_imageResource.
+ * html/HTMLImageElement.cpp:
+ (HTMLImageElement::createRenderer): Fixed indentation.
+
+2010-09-21 Kenneth Russell <kbr@google.com>
+
+ Reviewed by James Robinson.
+
+ [chromium] Remove GLES2Context and WebGLES2Context
+ https://bugs.webkit.org/show_bug.cgi?id=46131
+
+ Removed now-obsolete GLES2Context and WebGLES2Context classes, and
+ dependency on command buffer client code from WebCore. Built and
+ tested 3D CSS and WebGL content on Mac OS X to test.
+
+ * WebCore.gypi:
+ * platform/chromium/GLES2Context.h: Removed.
+ * platform/graphics/skia/ImageSkia.cpp:
+
+2010-09-21 Geoffrey Garen <ggaren@apple.com>
+
+ Try to fix the Windows build.
+
+ * loader/Cache.cpp:
+ (WebCore::Cache::makeResourcePurgeable):
+ (WebCore::Cache::evict): Cast to int before using unary '-', to avoid an
+ MSVC warning.
+
+2010-09-21 Pratik Solanki <psolanki@apple.com>
+
+ Reviewed by Geoffrey Garen and Darin Adler.
+
+ Use purgeable memory to keep more dead resources in cache
+ https://bugs.webkit.org/show_bug.cgi?id=44806
+ <rdar://problem/8350901>
+
+ This changes the behavior of dead resources in the WebCore cache to be the following if
+ shouldMakeResourcePurgeableOnEviction() returns true.
+
+ 1. Dead resources in the cache are kept in non-purgeable memory.
+ 2. When we prune dead resources, instead of freeing them, we mark their memory as purgeable
+ and keep the resources until the kernel reclaims the purgeable memory.
+
+ By leaving the in-cache dead resources in dirty resident memory, we decrease the likelihood
+ of the kernel claiming that memory and forcing us to refetch the resource (for example when
+ a user presses back).
+
+ And by having an unbounded number of resource objects using purgeable memory, we can use
+ as much memory as is available on the machine. The trade-off is that the CachedResource
+ object (and its member variables) are allocated in non-purgeable TC-malloc'd memory so
+ we would see slightly more memory use due to this.
+
+ * loader/Cache.cpp:
+ (WebCore::Cache::resourceForURL): Adjust sizes appropriately if we made resource memory
+ non-purgeable.
+ (WebCore::Cache::pruneDeadResources): When removing dead resources, try first to mark their
+ memory as purgeable. If not, evict the resource.
+ (WebCore::Cache::makeResourcePurgeable): Added. Try to mark resource
+ memory as purgeable. If successful, adjust the sizes so that we don't
+ factor this resources size in the Cache size calculation.
+ (WebCore::Cache::evict): Don't decrement size if we already did it in makeResourcePurgeable.
+ (WebCore::Cache::dumpLRULists): Extra debug logging.
+ * loader/Cache.h:
+ (WebCore::Cache::shouldMakeResourcePurgeableOnEviction): Added. Indicates if the new
+ behaviour is enabled.
+ * loader/CachedCSSStyleSheet.cpp:
+ (WebCore::CachedCSSStyleSheet::allClientsRemoved): Do not mark memory as purgeable. The
+ Cache class takes care of this.
+ * loader/CachedImage.cpp:
+ (WebCore::CachedImage::destroyDecodedData): Ditto.
+ * loader/CachedScript.cpp:
+ (WebCore::CachedScript::destroyDecodedData): Ditto.
+
+2010-09-21 Dan Bernstein <mitz@apple.com>
+
+ Reviewed by Darin Adler.
+
+ <rdar://problem/7729077> Extending the selection to sentence boundary after a line break may select extra character
+ https://bugs.webkit.org/show_bug.cgi?id=46232
+
+ Test: editing/selection/extend-by-sentence-002.html
+
+ * editing/visible_units.cpp:
+ (WebCore::nextBoundary): The text iterator’s range end can be the position after
+ the line break, in which case the next visible is actually after the first character
+ of the next sentence. Instead, advance the text iterator past the newline character
+ and return the beginning of its range, which is guaranteed to still be before the
+ next sentence.
+
+2010-09-21 Robert Hogan <robert@webkit.org>
+
+ Rubber-stamped by Ariya Hidayat.
+
+ [Qt] Build fix against qt trunk
+
+ * platform/graphics/qt/ContextShadow.cpp:
+ (WebCore::ContextShadow::beginShadowLayer):
+
+2010-09-21 Tony Chang <tony@chromium.org>
+
+ Unreviewed, QT build fix.
+
+ * platform/qt/ClipboardQt.cpp:
+ (WebCore::ClipboardQt::ClipboardQt):
+
+2010-09-21 Andy Estes <aestes@apple.com>
+
+ Reviewed by Darin Adler.
+
+ REGRESSION (r61285): AIM 2.1.296: Code rendered as text in Welcome screen
+ https://bugs.webkit.org/show_bug.cgi?id=46134
+
+ * WebCore.exp.in: Export __ZN7WebCore32applicationIsAOLInstantMessengerEv.
+ * platform/mac/RuntimeApplicationChecks.h:
+ * platform/mac/RuntimeApplicationChecks.mm:
+ (WebCore::applicationIsAOLInstantMessenger): Determine if the embedding
+ application is AOL Instant Messenger by checking the bundle identifier.
+
+2010-09-21 Chris Guillory <chris.guillory@google.com>
+
+ Reviewed by Chris Fleizach.
+
+ Send webkit accessibility notifications to Chromium.
+ https://bugs.webkit.org/show_bug.cgi?id=45156
+
+ * WebCore.gypi:
+ * accessibility/chromium/AXObjectCacheChromium.cpp:
+ (WebCore::AXObjectCache::postPlatformNotification):
+ (WebCore::AXObjectCache::handleFocusedUIElementChanged):
+ (WebCore::AXObjectCache::handleScrolledToAnchor):
+ * dom/Document.cpp:
+ (WebCore::Document::implicitClose):
+ (WebCore::Document::setFocusedNode):
+ * editing/SelectionController.h:
+ * editing/chromium/SelectionControllerChromium.cpp: Added.
+ (WebCore::SelectionController::notifyAccessibilityForSelectionChange):
+ * page/FrameView.cpp:
+ (WebCore::FrameView::layout):
+ * page/chromium/ChromeClientChromium.h:
+
+2010-09-21 Alejandro G. Castro <alex@igalia.com>
+
+ Reviewed by Martin Robinson.
+
+ [gtk] Move copyContextProperties outside the GraphicsContextCairo
+ https://bugs.webkit.org/show_bug.cgi?id=46179.
+
+ Moved the copyContextProperties function to the CairoUtilities so
+ we can use it outside GraphicsContextCairo. We moved also the old
+ gtk CairoUtilities file to GdkCairoUtilities and added the new
+ file in the cairo directory.
+
+ * GNUmakefile.am:
+ * platform/graphics/cairo/CairoUtilities.cpp: Added.
+ (WebCore::copyContextProperties):
+ * platform/graphics/cairo/CairoUtilities.h: Added.
+ * platform/graphics/cairo/GraphicsContextCairo.cpp:
+ * platform/graphics/gtk/CairoUtilities.cpp: Removed.
+ * platform/graphics/gtk/CairoUtilities.h: Removed.
+ * platform/graphics/gtk/GdkCairoUtilities.cpp: Added.
+ (getCairoSurfacePixel):
+ (getGdkPixbufPixel):
+ (cairoImageSurfaceToGdkPixbuf):
+ * platform/graphics/gtk/GdkCairoUtilities.h: Added.
+ * platform/graphics/gtk/ImageBufferGtk.cpp:
+ * platform/graphics/gtk/ImageGtk.cpp:
+
+2010-09-21 Vangelis Kokkevis <vangelis@chromium.org>
+
+ Reviewed by James Robinson.
+
+ [chromium] Cleaned up LayerRendererChromium::prepareToDrawLayers
+ logic to avoid unnecessary copy operations if the existing root layer
+ contents aren't useful for scrolling. Also removed call to updateLayersRecursive()
+ as the composited layer update is actually happening in the drawLayers() method.
+ https://bugs.webkit.org/show_bug.cgi?id=46199
+
+
+ * platform/graphics/chromium/LayerRendererChromium.cpp:
+ (WebCore::LayerRendererChromium::prepareToDrawLayers):
+
+2010-09-21 Daniel Cheng <dcheng@chromium.org>
+
+ Reviewed by Tony Chang.
+
+ Change Clipboard to use an enum instead of isForDragging = true/false
+ https://bugs.webkit.org/show_bug.cgi?id=46004
+
+ No new tests, since it's just a refactoring change.
+
+ * bindings/js/JSClipboardCustom.cpp:
+ (WebCore::JSClipboard::setDragImage):
+ * bindings/v8/custom/V8ClipboardCustom.cpp:
+ (WebCore::V8Clipboard::setDragImageCallback):
+ * dom/Clipboard.cpp:
+ (WebCore::Clipboard::Clipboard):
+ (WebCore::Clipboard::setDropEffect):
+ (WebCore::Clipboard::setEffectAllowed):
+ * dom/Clipboard.h:
+ (WebCore::Clipboard::isForCopyAndPaste):
+ (WebCore::Clipboard::isForDragAndDrop):
+ * editing/android/EditorAndroid.cpp:
+ (WebCore::Editor::newGeneralClipboard):
+ * editing/brew/EditorBrew.cpp:
+ (WebCore::Editor::newGeneralClipboard):
+ * editing/chromium/EditorChromium.cpp:
+ (WebCore::Editor::newGeneralClipboard):
+ * editing/haiku/EditorHaiku.cpp:
+ (WebCore::Editor::newGeneralClipboard):
+ * editing/mac/EditorMac.mm:
+ (WebCore::Editor::newGeneralClipboard):
+ * editing/wx/EditorWx.cpp:
+ (WebCore::Editor::newGeneralClipboard):
+ * page/chromium/EventHandlerChromium.cpp:
+ (WebCore::EventHandler::createDraggingClipboard):
+ * page/efl/EventHandlerEfl.cpp:
+ (WebCore::EventHandler::createDraggingClipboard):
+ * page/gtk/EventHandlerGtk.cpp:
+ (WebCore::EventHandler::createDraggingClipboard):
+ * page/haiku/EventHandlerHaiku.cpp:
+ (WebCore::EventHandler::createDraggingClipboard):
+ * page/mac/EventHandlerMac.mm:
+ (WebCore::EventHandler::createDraggingClipboard):
+ * page/qt/EventHandlerQt.cpp:
+ (WebCore::EventHandler::createDraggingClipboard):
+ * page/win/EventHandlerWin.cpp:
+ (WebCore::EventHandler::createDraggingClipboard):
+ * page/wx/EventHandlerWx.cpp:
+ (WebCore::EventHandler::createDraggingClipboard):
+ * platform/android/ClipboardAndroid.cpp:
+ (WebCore::ClipboardAndroid::ClipboardAndroid):
+ (WebCore::ClipboardAndroid::clearData):
+ (WebCore::ClipboardAndroid::clearAllData):
+ (WebCore::ClipboardAndroid::setData):
+ * platform/android/ClipboardAndroid.h:
+ * platform/brew/ClipboardBrew.cpp:
+ (WebCore::ClipboardBrew::ClipboardBrew):
+ (WebCore::ClipboardBrew::clearData):
+ (WebCore::ClipboardBrew::clearAllData):
+ (WebCore::ClipboardBrew::setData):
+ * platform/brew/ClipboardBrew.h:
+ * platform/chromium/ClipboardChromium.cpp:
+ (WebCore::Clipboard::create):
+ (WebCore::ClipboardChromium::ClipboardChromium):
+ (WebCore::ClipboardChromium::create):
+ (WebCore::ClipboardChromium::getData):
+ * platform/chromium/ClipboardChromium.h:
+ * platform/efl/ClipboardEfl.cpp:
+ (WebCore::Editor::newGeneralClipboard):
+ (WebCore::ClipboardEfl::ClipboardEfl):
+ * platform/efl/ClipboardEfl.h:
+ (WebCore::ClipboardEfl::create):
+ * platform/gtk/ClipboardGtk.cpp:
+ (WebCore::Editor::newGeneralClipboard):
+ (WebCore::Clipboard::create):
+ (WebCore::ClipboardGtk::ClipboardGtk):
+ (WebCore::dataObjectTypeFromHTMLClipboardType):
+ (WebCore::ClipboardGtk::clearData):
+ (WebCore::ClipboardGtk::getData):
+ (WebCore::ClipboardGtk::setData):
+ * platform/gtk/ClipboardGtk.h:
+ (WebCore::ClipboardGtk::create):
+ * platform/haiku/ClipboardHaiku.cpp:
+ (WebCore::Clipboard::create):
+ (WebCore::ClipboardHaiku::ClipboardHaiku):
+ * platform/haiku/ClipboardHaiku.h:
+ (WebCore::ClipboardHaiku::create):
+ * platform/mac/ClipboardMac.h:
+ (WebCore::ClipboardMac::create):
+ * platform/mac/ClipboardMac.mm:
+ (WebCore::Clipboard::create):
+ (WebCore::ClipboardMac::ClipboardMac):
+ * platform/qt/ClipboardQt.cpp:
+ (WebCore::ClipboardQt::ClipboardQt):
+ (WebCore::ClipboardQt::~ClipboardQt):
+ (WebCore::ClipboardQt::clearData):
+ (WebCore::ClipboardQt::clearAllData):
+ (WebCore::ClipboardQt::setData):
+ (WebCore::ClipboardQt::declareAndWriteDragImage):
+ (WebCore::ClipboardQt::writeURL):
+ (WebCore::ClipboardQt::writeRange):
+ (WebCore::ClipboardQt::writePlainText):
+ * platform/qt/ClipboardQt.h:
+ (WebCore::ClipboardQt::create):
+ * platform/win/ClipboardWin.cpp:
+ (WebCore::Clipboard::create):
+ (WebCore::ClipboardWin::ClipboardWin):
+ (WebCore::ClipboardWin::clearData):
+ (WebCore::ClipboardWin::clearAllData):
+ (WebCore::ClipboardWin::setData):
+ (WebCore::ClipboardWin::setExternalDataObject):
+ * platform/win/ClipboardWin.h:
+ (WebCore::ClipboardWin::create):
+ * platform/win/EditorWin.cpp:
+ (WebCore::Editor::newGeneralClipboard):
+ * platform/wx/ClipboardWx.cpp:
+ (WebCore::ClipboardWx::ClipboardWx):
+ * platform/wx/ClipboardWx.h:
+ (WebCore::ClipboardWx::create):
+
+2010-09-21 Abhishek Arya <inferno@chromium.org>
+
+ Reviewed by Dave Hyatt.
+
+ Take isValueList() checks out of the asserts for memory safety.
+ https://bugs.webkit.org/show_bug.cgi?id=46194
+
+ Test: editing/execCommand/apply-style-text-decoration-crash.html
+
+ * editing/ApplyStyleCommand.cpp:
+ (WebCore::StyleChange::extractTextStyles):
+ (WebCore::ApplyStyleCommand::applyInlineStyleToPushDown):
+
+2010-09-21 Vangelis Kokkevis <vangelis@chromium.org>
+
+ Reviewed by Kenneth Russell.
+
+ [chromium] Fixing double translation of composited layers when scrolling.
+ The scrolling transform is now applied by a separate layer maintained in
+ the RenderLayerCompositor.
+ https://bugs.webkit.org/show_bug.cgi?id=46193
+
+ * platform/graphics/chromium/LayerRendererChromium.cpp:
+ (WebCore::LayerRendererChromium::drawLayers):
+
+2010-09-21 David Hyatt <hyatt@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ https://bugs.webkit.org/show_bug.cgi?id=46196, add marginStart/Before/End/After accessors to RenderBoxModelObject.
+
+ * rendering/RenderBox.cpp:
+ (WebCore::RenderBox::marginBefore):
+ (WebCore::RenderBox::marginAfter):
+ (WebCore::RenderBox::marginStart):
+ (WebCore::RenderBox::marginEnd):
+ * rendering/RenderBox.h:
+ * rendering/RenderBoxModelObject.h:
+ * rendering/RenderInline.cpp:
+ (WebCore::computeMargin):
+ (WebCore::RenderInline::marginLeft):
+ (WebCore::RenderInline::marginRight):
+ (WebCore::RenderInline::marginTop):
+ (WebCore::RenderInline::marginBottom):
+ (WebCore::RenderInline::marginStart):
+ (WebCore::RenderInline::marginEnd):
+ * rendering/RenderInline.h:
+ (WebCore::RenderInline::marginBefore):
+ (WebCore::RenderInline::marginAfter):
+
+2010-09-21 David Hyatt <hyatt@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ https://bugs.webkit.org/show_bug.cgi?id=46190, add borderStart/Before/End/After accessors to RenderBoxModelObject.
+
+ * rendering/RenderBoxModelObject.h:
+ (WebCore::RenderBoxModelObject::borderBefore):
+ (WebCore::RenderBoxModelObject::borderAfter):
+ (WebCore::RenderBoxModelObject::borderStart):
+ (WebCore::RenderBoxModelObject::borderEnd):
+ (WebCore::RenderBoxModelObject::borderAndPaddingLogicalHeight):
+ (WebCore::RenderBoxModelObject::borderAndPaddingLogicalWidth):
+ * rendering/RenderTableCell.cpp:
+ (WebCore::RenderTableCell::borderStart):
+ (WebCore::RenderTableCell::borderEnd):
+ (WebCore::RenderTableCell::borderBefore):
+ (WebCore::RenderTableCell::borderAfter):
+ * rendering/RenderTableCell.h:
+
+2010-09-21 Martin Robinson <mrobinson@igalia.com>
+
+ Reviewed by Xan Lopez.
+
+ [GTK] 'make dist' should be fixed in preparation for the next release
+ https://bugs.webkit.org/show_bug.cgi?id=46129
+
+ * GNUmakefile.am: Update the sources list to include missing headers.
+
+2010-09-21 David Hyatt <hyatt@apple.com>
+
+ Reviewed by John Sullivan.
+
+ https://bugs.webkit.org/show_bug.cgi?id=46188, make the cross-platform setPrinting method match the Mac version of the method.
+ Specifically don't pass the page size down to subframes of the one you're printing.
+
+ * page/Frame.cpp:
+ (WebCore::Frame::setPrinting):
+
+2010-09-21 Patrick Gansterer <paroga@webkit.org>
+
+ Reviewed by Adam Roben.
+
+ Use WTF::Vector for storing formData in ResourceHandleWin.
+ https://bugs.webkit.org/show_bug.cgi?id=46180
+
+ * platform/network/ResourceHandleInternal.h:
+ (WebCore::ResourceHandleInternal::ResourceHandleInternal):
+ * platform/network/win/ResourceHandleWin.cpp:
+ (WebCore::ResourceHandle::onHandleCreated):
+ (WebCore::ResourceHandle::onRequestComplete):
+
+2010-09-21 Jocelyn Turcotte <jocelyn.turcotte@nokia.com>
+
+ Reviewed by Andreas Kling.
+
+ [Qt] Check if the reply has been deleted before finishing a network request
+ https://bugs.webkit.org/show_bug.cgi?id=46174
+
+ A crash can happen with the following sequence:
+ 1. QNetworkReplyHandler::abort() emits reply->deleteLater()
+ 2. QNAM emits QNetworkReply::finished() -> calls QNetworkReplyHandler::finish()
+ 3. event loop would call reply->deleteLater()
+ However a crash occurs since m_reply == 0 on step 2.
+
+ * platform/network/qt/QNetworkReplyHandler.cpp:
+ (WebCore::QNetworkReplyHandler::finish):
+
+2010-09-21 Jochen Eisinger <jochen@chromium.org>
+
+ Reviewed by Jeremy Orlow.
+
+ Use @ to concatenate the database name and the database identifier when building
+ the filename to use for indexed databases. That character is valid for filenames
+ but cannot occur in a database identifier derived from a security origin.
+ https://bugs.webkit.org/show_bug.cgi?id=46178
+
+ * storage/IDBFactoryBackendImpl.cpp:
+ (WebCore::IDBFactoryBackendImpl::databaseFileName):
+
+2010-09-21 Steve Block <steveblock@google.com>
+
+ Reviewed by Jeremy Orlow.
+
+ DeviceOrientationClient and DeviceMotionClient should have controllerDestroyed() methods
+ https://bugs.webkit.org/show_bug.cgi?id=45891
+
+ Tested by existing DeviceOrientation tests.
+
+ * dom/DeviceMotionClient.h:
+ * dom/DeviceMotionController.cpp:
+ (WebCore::DeviceMotionController::~DeviceMotionController):
+ * dom/DeviceMotionController.h:
+ * dom/DeviceOrientationClient.h:
+ * dom/DeviceOrientationController.cpp:
+ (WebCore::DeviceOrientationController::~DeviceOrientationController):
+ * dom/DeviceOrientationController.h:
+ * loader/EmptyClients.h:
+ (WebCore::EmptyDeviceMotionClient::deviceOrientationControllerDestroyed):
+ (WebCore::EmptyDeviceOrientationClient::deviceOrientationControllerDestroyed):
+ * platform/mock/DeviceOrientationClientMock.h:
+ (WebCore::DeviceOrientationClientMock::deviceOrientationControllerDestroyed):
+
+2010-09-21 Jochen Eisinger <jochen@chromium.org>
+
+ Reviewed by Jeremy Orlow.
+
+ Factor out the file name used for a given indexed database to a static method.
+ https://bugs.webkit.org/show_bug.cgi?id=46090
+
+ * storage/IDBFactoryBackendImpl.cpp:
+ (WebCore::openSQLiteDatabase):
+ (WebCore::IDBFactoryBackendImpl::databaseFileName):
+ * storage/IDBFactoryBackendImpl.h:
+
+2010-09-21 Dirk Schulze <krit@webkit.org>
+
+ SVG Filter cleanup
+ https://bugs.webkit.org/show_bug.cgi?id=45612
+
+ Unreviewed change of epsilon back to a more tolerant value in RenderTreeAsText and made it a static const.
+ This should turn the bots green again.
+
+ * rendering/RenderTreeAsText.cpp:
+ (WebCore::hasFractions):
+
+2010-09-21 David Hyatt <hyatt@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ https://bugs.webkit.org/show_bug.cgi?id=46125, convert table cell intrinsic padding from top/bottom-based
+ to before/after-based. A vertical text table can have intrinsic padding built into the left/right
+ direction (and this allows the base class logical padding methods on RenderBoxModelObject to be safe to use).
+
+ * rendering/RenderTableCell.cpp:
+ (WebCore::RenderTableCell::RenderTableCell):
+ (WebCore::RenderTableCell::paddingTop):
+ (WebCore::RenderTableCell::paddingBottom):
+ (WebCore::RenderTableCell::paddingLeft):
+ (WebCore::RenderTableCell::paddingRight):
+ (WebCore::RenderTableCell::paddingBefore):
+ (WebCore::RenderTableCell::paddingAfter):
+ * rendering/RenderTableCell.h:
+ (WebCore::RenderTableCell::setIntrinsicPaddingBefore):
+ (WebCore::RenderTableCell::setIntrinsicPaddingAfter):
+ (WebCore::RenderTableCell::setIntrinsicPadding):
+ (WebCore::RenderTableCell::intrinsicPaddingBefore):
+ (WebCore::RenderTableCell::intrinsicPaddingAfter):
+ * rendering/RenderTableSection.cpp:
+ (WebCore::RenderTableSection::calcRowHeight):
+ (WebCore::RenderTableSection::layoutRows):
+ * rendering/RenderTreeAsText.cpp:
+ (WebCore::RenderTreeAsText::writeRenderObject):
+ (WebCore::writeTextRun):
+
+2010-09-21 Dirk Schulze <krit@webkit.org>
+
+ Reviewed by Nikolas Zimmermann.
+
+ SVG Filter cleanup
+ https://bugs.webkit.org/show_bug.cgi?id=45612
+
+ Second cleanup patch. Modified files to follow webkit style. Removed dependencies
+ to SVG of most of the filter effects and prepared them to move from WebCore/svg/graphics/filters
+ to WebCore/platform/graphics/filters/.
+ Renamed calculateDrawingIntRect and calculateDrawingRect to requestedRegionOfInputImageData and
+ drawingRegionOfInputImage to clarify the functionality and make both functions distinguishable.
+
+ * platform/graphics/filters/FEBlend.cpp:
+ (WebCore::FEBlend::apply):
+ * platform/graphics/filters/FEBlend.h:
+ * platform/graphics/filters/FEColorMatrix.cpp:
+ (WebCore::FEColorMatrix::apply):
+ * platform/graphics/filters/FEColorMatrix.h:
+ * platform/graphics/filters/FEComponentTransfer.cpp:
+ (WebCore::FEComponentTransfer::apply):
+ * platform/graphics/filters/FEComponentTransfer.h:
+ (WebCore::ComponentTransferFunction::ComponentTransferFunction):
+ * platform/graphics/filters/FEComposite.cpp:
+ (WebCore::FEComposite::apply):
+ * platform/graphics/filters/FEComposite.h:
+ * platform/graphics/filters/FEGaussianBlur.cpp:
+ (WebCore::FEGaussianBlur::apply):
+ * platform/graphics/filters/FEGaussianBlur.h:
+ * platform/graphics/filters/Filter.h:
+ * platform/graphics/filters/FilterEffect.cpp:
+ (WebCore::FilterEffect::requestedRegionOfInputImageData):
+ (WebCore::FilterEffect::drawingRegionOfInputImage):
+ (WebCore::FilterEffect::effectContext):
+ * platform/graphics/filters/FilterEffect.h:
+ * platform/graphics/filters/ImageBufferFilter.cpp:
+ * platform/graphics/filters/ImageBufferFilter.h:
+ * platform/graphics/filters/SourceAlpha.cpp:
+ (WebCore::SourceAlpha::apply):
+ * platform/graphics/filters/SourceAlpha.h:
+ (WebCore::SourceAlpha::isSourceInput):
+ (WebCore::SourceAlpha::SourceAlpha):
+ * platform/graphics/filters/SourceGraphic.cpp:
+ (WebCore::SourceGraphic::apply):
+ * platform/graphics/filters/SourceGraphic.h:
+ (WebCore::SourceGraphic::isSourceInput):
+ (WebCore::SourceGraphic::SourceGraphic):
+ * rendering/RenderTreeAsText.cpp:
+ (WebCore::hasFractions):
+ (WebCore::operator<<):
+ * rendering/RenderTreeAsText.h:
+ (WebCore::operator<<):
+ * rendering/SVGRenderTreeAsText.cpp:
+ * rendering/SVGRenderTreeAsText.h:
+ * svg/graphics/filters/SVGFEConvolveMatrix.cpp:
+ (WebCore::FEConvolveMatrix::apply):
+ * svg/graphics/filters/SVGFEConvolveMatrix.h:
+ * svg/graphics/filters/SVGFEDiffuseLighting.cpp:
+ * svg/graphics/filters/SVGFEDiffuseLighting.h:
+ * svg/graphics/filters/SVGFEDisplacementMap.cpp:
+ (WebCore::FEDisplacementMap::apply):
+ * svg/graphics/filters/SVGFEDisplacementMap.h:
+ * svg/graphics/filters/SVGFEFlood.cpp:
+ (WebCore::FEFlood::apply):
+ (WebCore::FEFlood::externalRepresentation):
+ * svg/graphics/filters/SVGFEFlood.h:
+ * svg/graphics/filters/SVGFEImage.cpp:
+ (WebCore::FEImage::apply):
+ * svg/graphics/filters/SVGFEImage.h:
+ * svg/graphics/filters/SVGFELighting.cpp:
+ (WebCore::FELighting::apply):
+ * svg/graphics/filters/SVGFELighting.h:
+ * svg/graphics/filters/SVGFEMerge.cpp:
+ (WebCore::FEMerge::apply):
+ * svg/graphics/filters/SVGFEMerge.h:
+ * svg/graphics/filters/SVGFEMorphology.cpp:
+ (WebCore::FEMorphology::apply):
+ * svg/graphics/filters/SVGFEMorphology.h:
+ * svg/graphics/filters/SVGFEOffset.cpp:
+ (WebCore::FEOffset::apply):
+ * svg/graphics/filters/SVGFEOffset.h:
+ * svg/graphics/filters/SVGFESpecularLighting.cpp:
+ * svg/graphics/filters/SVGFESpecularLighting.h:
+ * svg/graphics/filters/SVGFETile.cpp:
+ (WebCore::FETile::apply):
+ * svg/graphics/filters/SVGFETile.h:
+ * svg/graphics/filters/SVGFETurbulence.cpp:
+ (WebCore::FETurbulence::apply):
+ * svg/graphics/filters/SVGFETurbulence.h:
+
+2010-09-20 Philippe Normand <pnormand@igalia.com>
+
+ Reviewed by Eric Carlson.
+
+ [GTK] enhanced context menu for media elements
+ https://bugs.webkit.org/show_bug.cgi?id=45021
+
+ New items in the media Element context menu:
+ - play/pause
+ - mute/unmute
+ - controls display control
+ - switch to fullscreen (for video only)
+ - loop playback control
+ - copy media url to clipboard
+ - open in new window
+
+ Test: media/context-menu-actions.html
+
+ * page/ContextMenuController.cpp:
+ (WebCore::ContextMenuController::contextMenuItemSelected):
+ * platform/ContextMenu.cpp:
+ (WebCore::ContextMenu::populate):
+ (WebCore::ContextMenu::checkOrEnableIfNeeded):
+ * platform/ContextMenuItem.h:
+ * platform/LocalizationStrategy.h:
+ * platform/LocalizedStrings.cpp:
+ (WebCore::contextMenuItemTagOpenVideoInNewWindow):
+ (WebCore::contextMenuItemTagOpenAudioInNewWindow):
+ (WebCore::contextMenuItemTagCopyVideoLinkToClipboard):
+ (WebCore::contextMenuItemTagCopyAudioLinkToClipboard):
+ (WebCore::contextMenuItemTagToggleMediaControls):
+ (WebCore::contextMenuItemTagToggleMediaLoop):
+ (WebCore::contextMenuItemTagEnterVideoFullscreen):
+ (WebCore::contextMenuItemTagMediaPlay):
+ (WebCore::contextMenuItemTagMediaPause):
+ (WebCore::contextMenuItemTagMediaMute):
+ * platform/LocalizedStrings.h:
+ * platform/android/LocalizedStringsAndroid.cpp:
+ (WebCore::contextMenuItemTagOpenVideoInNewWindow):
+ (WebCore::contextMenuItemTagOpenAudioInNewWindow):
+ (WebCore::contextMenuItemTagCopyVideoLinkToClipboard):
+ (WebCore::contextMenuItemTagCopyAudioLinkToClipboard):
+ (WebCore::contextMenuItemTagToggleMediaControls):
+ (WebCore::contextMenuItemTagToggleMediaLoop):
+ (WebCore::contextMenuItemTagEnterVideoFullscreen):
+ (WebCore::contextMenuItemTagMediaPlay):
+ (WebCore::contextMenuItemTagMediaPause):
+ (WebCore::contextMenuItemTagMediaMute):
+ * platform/brew/LocalizedStringsBrew.cpp:
+ (WebCore::contextMenuItemTagOpenVideoInNewWindow):
+ (WebCore::contextMenuItemTagOpenAudioInNewWindow):
+ (WebCore::contextMenuItemTagCopyVideoLinkToClipboard):
+ (WebCore::contextMenuItemTagCopyAudioLinkToClipboard):
+ (WebCore::contextMenuItemTagToggleMediaControls):
+ (WebCore::contextMenuItemTagToggleMediaLoop):
+ (WebCore::contextMenuItemTagEnterVideoFullscreen):
+ (WebCore::contextMenuItemTagMediaPlay):
+ (WebCore::contextMenuItemTagMediaPause):
+ (WebCore::contextMenuItemTagMediaMute):
+ * platform/efl/LocalizedStringsEfl.cpp:
+ (WebCore::contextMenuItemTagOpenVideoInNewWindow):
+ (WebCore::contextMenuItemTagOpenAudioInNewWindow):
+ (WebCore::contextMenuItemTagCopyVideoLinkToClipboard):
+ (WebCore::contextMenuItemTagCopyAudioLinkToClipboard):
+ (WebCore::contextMenuItemTagToggleMediaControls):
+ (WebCore::contextMenuItemTagToggleMediaLoop):
+ (WebCore::contextMenuItemTagEnterVideoFullscreen):
+ (WebCore::contextMenuItemTagMediaPlay):
+ (WebCore::contextMenuItemTagMediaPause):
+ (WebCore::contextMenuItemTagMediaMute):
+ * platform/gtk/ContextMenuItemGtk.cpp:
+ (WebCore::gtkStockIDFromContextMenuAction):
+ * platform/gtk/LocalizedStringsGtk.cpp:
+ (WebCore::contextMenuItemTagOpenVideoInNewWindow):
+ (WebCore::contextMenuItemTagOpenAudioInNewWindow):
+ (WebCore::contextMenuItemTagCopyVideoLinkToClipboard):
+ (WebCore::contextMenuItemTagCopyAudioLinkToClipboard):
+ (WebCore::contextMenuItemTagToggleMediaControls):
+ (WebCore::contextMenuItemTagToggleMediaLoop):
+ (WebCore::contextMenuItemTagEnterVideoFullscreen):
+ (WebCore::contextMenuItemTagMediaPlay):
+ (WebCore::contextMenuItemTagMediaPause):
+ (WebCore::contextMenuItemTagMediaMute):
+ * platform/haiku/LocalizedStringsHaiku.cpp:
+ (WebCore::contextMenuItemTagOpenVideoInNewWindow):
+ (WebCore::contextMenuItemTagOpenAudioInNewWindow):
+ (WebCore::contextMenuItemTagCopyVideoLinkToClipboard):
+ (WebCore::contextMenuItemTagCopyAudioLinkToClipboard):
+ (WebCore::contextMenuItemTagToggleMediaControls):
+ (WebCore::contextMenuItemTagToggleMediaLoop):
+ (WebCore::contextMenuItemTagEnterVideoFullscreen):
+ (WebCore::contextMenuItemTagMediaPlay):
+ (WebCore::contextMenuItemTagMediaPause):
+ (WebCore::contextMenuItemTagMediaMute):
+ * platform/wx/LocalizedStringsWx.cpp:
+ (WebCore::contextMenuItemTagOpenVideoInNewWindow):
+ (WebCore::contextMenuItemTagOpenAudioInNewWindow):
+ (WebCore::contextMenuItemTagCopyVideoLinkToClipboard):
+ (WebCore::contextMenuItemTagCopyAudioLinkToClipboard):
+ (WebCore::contextMenuItemTagToggleMediaControls):
+ (WebCore::contextMenuItemTagToggleMediaLoop):
+ (WebCore::contextMenuItemTagEnterVideoFullscreen):
+ (WebCore::contextMenuItemTagMediaPlay):
+ (WebCore::contextMenuItemTagMediaPause):
+ (WebCore::contextMenuItemTagMediaMute):
+ * rendering/HitTestResult.cpp:
+ (WebCore::HitTestResult::absoluteMediaURL):
+ (WebCore::HitTestResult::mediaSupportsFullscreen):
+ (WebCore::HitTestResult::mediaElement):
+ (WebCore::HitTestResult::toggleMediaControlsDisplay):
+ (WebCore::HitTestResult::toggleMediaLoopPlayback):
+ (WebCore::HitTestResult::enterFullscreenForVideo):
+ (WebCore::HitTestResult::mediaControlsEnabled):
+ (WebCore::HitTestResult::mediaLoopEnabled):
+ (WebCore::HitTestResult::mediaPlaying):
+ (WebCore::HitTestResult::toggleMediaPlayState):
+ (WebCore::HitTestResult::mediaHasAudio):
+ (WebCore::HitTestResult::mediaMuted):
+ (WebCore::HitTestResult::toggleMediaMuteState):
+ * rendering/HitTestResult.h:
+
+2010-09-20 Kwang Yul Seo <skyul@company100.net>
+
+ Reviewed by Daniel Bates.
+
+ [BREWMP] Handle tab key
+ https://bugs.webkit.org/show_bug.cgi?id=46104
+
+ In Brew MP, AVK_FUNCTION is the key code for tab.
+ Process AVK_FUNCTION as tab in PlatformKeyboardEvent.
+
+ * platform/brew/PlatformKeyboardEventBrew.cpp:
+ (WebCore::keyIdentifierForBrewKeyCode):
+ (WebCore::windowsKeyCodeForKeyEvent):
+
+2010-09-20 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r67918.
+ http://trac.webkit.org/changeset/67918
+ https://bugs.webkit.org/show_bug.cgi?id=46162
+
+ Broke chromium win compile (Requested by jamesr on #webkit).
+
+ * WebCore.gyp/WebCore.gyp:
+ * WebCore.gypi:
+ * platform/graphics/chromium/GlyphPageTreeNodeLinux.cpp: Renamed from WebCore/platform/graphics/skia/GlyphPageTreeNodeSkia.cpp.
+ (WebCore::GlyphPage::fill):
+
+2010-09-20 Daniel Bates <dbates@rim.com>
+
+ Reviewed by Dan Bernstein.
+
+ Cleanup: Extract common border radii expansion code in
+ RenderBoxModelObject::paintBoxShadow() into function
+ https://bugs.webkit.org/show_bug.cgi?id=45934
+
+ Extracted code for expanding and clamping the border radii
+ into common function to remove duplicate code.
+
+ No functionality was changed. So, no new tests.
+
+ * rendering/RenderBoxModelObject.cpp:
+ (WebCore::uniformlyExpandBorderRadii): Added.
+ (WebCore::RenderBoxModelObject::paintBoxShadow): Moved common code to uniformlyExpandBorderRadii().
+
+2010-09-20 Kwang Yul Seo <skyul@company100.net>
+
+ Reviewed by James Robinson.
+
+ Make sure skia is not Chromium specific
+ https://bugs.webkit.org/show_bug.cgi?id=39672
+
+ GGlyphPageTreeNodeLinux does not depend on Linux or Chromium.
+ Move GGlyphPageTreeNodeLinux to platform/graphics/skia and rename it to
+ GlyphPageTreeNodeSkia.cpp so that other ports can use it.
+
+ * WebCore.gyp/WebCore.gyp:
+ * WebCore.gypi:
+ * platform/graphics/chromium/GlyphPageTreeNodeLinux.cpp: Removed.
+ * platform/graphics/skia/GlyphPageTreeNodeSkia.cpp: Added.
+
+2010-09-20 Kinuko Yasuda <kinuko@chromium.org>
+
+ Reviewed by David Levin.
+
+ Add NoStaticTables attributes to IDLs of FileSystem API for Worker support
+ https://bugs.webkit.org/show_bug.cgi?id=46021
+
+ Added NoStaticTables attributes to IDLs except for ones for Callbacks.
+ (As NoStaticTables only affects non-callback interfaces.)
+
+ * fileapi/DOMFileSystem.idl:
+ * fileapi/DirectoryEntry.idl:
+ * fileapi/DirectoryReader.idl:
+ * fileapi/Entry.idl:
+ * fileapi/EntryArray.idl:
+ * fileapi/FileEntry.idl:
+ * fileapi/Flags.idl:
+ * fileapi/Metadata.idl:
+
+2010-09-20 Nico Weber <thakis@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ Fix "operands of ? are integers of different signs" clang warnings
+ https://bugs.webkit.org/show_bug.cgi?id=46157
+
+ * platform/graphics/mac/ComplexTextController.cpp:
+ (WebCore::ComplexTextController::advance):
+ * rendering/RenderBox.cpp:
+ (WebCore::RenderBox::calcHeight):
+
+2010-09-20 Vangelis Kokkevis <vangelis@chromium.org>
+
+ Unreviewed, rolling out r67906.
+ http://trac.webkit.org/changeset/67906
+ https://bugs.webkit.org/show_bug.cgi?id=46139
+
+ Change causes chromium to crash when switching pages
+
+ * platform/graphics/chromium/ContentLayerChromium.h:
+ * platform/graphics/chromium/LayerChromium.h:
+
+2010-09-19 Antonio Gomes <agomes@rim.com>
+
+ Reviewed by Ojan Vafai.
+
+ SelectionController::modify should ask EditingBehavior for platform specific behavior
+ https://bugs.webkit.org/show_bug.cgi?id=41975
+
+ As a follow up of the refactoring work in bug 39854, patch makes SelectionController::modify()
+ stop accessing EditingBehaviorType values directly, and replaces its use by the EditingBehavior
+ class.
+
+ Since the "Settings*" parameter of the private SelectionController::modify() method becomes unneeded
+ with this change (it was used to query the editingBehaviorType), patch merges two modify() methods.
+
+ No behavior change, so no new tests.
+
+ * editing/EditingBehavior.h:
+ (WebCore::EditingBehavior::shouldAlwaysGrowSelectionWhenExtendingToBoundary):
+ * editing/SelectionController.cpp:
+ (WebCore::SelectionController::modify):
+ * editing/SelectionController.h:
+
2010-09-20 Vangelis Kokkevis <vangelis@chromium.org>
Reviewed by James Robinson.
diff --git a/WebCore/Configurations/Version.xcconfig b/WebCore/Configurations/Version.xcconfig
index 533d5e2..81913dd 100644
--- a/WebCore/Configurations/Version.xcconfig
+++ b/WebCore/Configurations/Version.xcconfig
@@ -22,7 +22,7 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
MAJOR_VERSION = 534;
-MINOR_VERSION = 9;
+MINOR_VERSION = 10;
TINY_VERSION = 0;
FULL_VERSION = $(MAJOR_VERSION).$(MINOR_VERSION);
diff --git a/WebCore/DerivedSources.cpp b/WebCore/DerivedSources.cpp
index bab8109..898da5c 100644
--- a/WebCore/DerivedSources.cpp
+++ b/WebCore/DerivedSources.cpp
@@ -91,6 +91,7 @@
#include "JSDOMSelection.cpp"
#include "JSDOMStringList.cpp"
#include "JSDOMStringMap.cpp"
+#include "JSDOMTokenList.cpp"
#include "JSDOMWindow.cpp"
#include "JSElement.cpp"
#include "JSEntity.cpp"
diff --git a/WebCore/DerivedSources.make b/WebCore/DerivedSources.make
index adbd30c..2fda5e9 100644
--- a/WebCore/DerivedSources.make
+++ b/WebCore/DerivedSources.make
@@ -124,6 +124,7 @@ DOM_CLASSES = \
DOMSelection \
DOMStringList \
DOMStringMap \
+ DOMTokenList \
DOMWindow \
Database \
DatabaseCallback \
diff --git a/WebCore/English.lproj/localizedStrings.js b/WebCore/English.lproj/localizedStrings.js
index a3720e2..62103d7 100644
--- a/WebCore/English.lproj/localizedStrings.js
+++ b/WebCore/English.lproj/localizedStrings.js
Binary files differ
diff --git a/WebCore/GNUmakefile.am b/WebCore/GNUmakefile.am
index 1a0a754..c80e8ed 100644
--- a/WebCore/GNUmakefile.am
+++ b/WebCore/GNUmakefile.am
@@ -71,7 +71,6 @@ webcore_cppflags += \
webcoregtk_cppflags += \
-DWEBKITGTK_API_VERSION_STRING=\"@WEBKITGTK_API_VERSION@\" \
-DWTF_USE_SOUP=1 \
- -DWTF_USE_GSTREAMER=1 \
-I$(srcdir)/WebCore/accessibility/gtk \
-I$(srcdir)/WebCore/loader/gtk \
-I$(srcdir)/WebCore/page/gtk \
@@ -82,15 +81,18 @@ webcoregtk_cppflags += \
-I$(srcdir)/WebCore/platform/network/soup
webcore_built_nosources += \
- DerivedSources/WebCore/DocTypeStrings.cpp \
- DerivedSources/WebCore/tokenizer.cpp \
- DerivedSources/WebCore/ColorData.cpp
+ DerivedSources/WebCore/tokenizer.cpp
webcore_built_sources += \
DerivedSources/WebCore/CSSGrammar.cpp \
DerivedSources/WebCore/CSSGrammar.h \
DerivedSources/WebCore/CSSPropertyNames.h \
+ DerivedSources/WebCore/CSSPropertyNames.cpp \
DerivedSources/WebCore/CSSValueKeywords.h \
+ DerivedSources/WebCore/CSSValueKeywords.cpp \
+ DerivedSources/WebCore/ColorData.cpp \
+ DerivedSources/WebCore/DocTypeStrings.cpp \
+ DerivedSources/WebCore/HashTools.h \
DerivedSources/WebCore/HTMLElementFactory.cpp \
DerivedSources/WebCore/HTMLElementFactory.h \
DerivedSources/WebCore/HTMLEntityTable.cpp \
@@ -216,6 +218,8 @@ webcore_built_sources += \
DerivedSources/WebCore/JSDOMStringList.h \
DerivedSources/WebCore/JSDOMStringMap.cpp \
DerivedSources/WebCore/JSDOMStringMap.h \
+ DerivedSources/WebCore/JSDOMTokenList.cpp \
+ DerivedSources/WebCore/JSDOMTokenList.h \
DerivedSources/WebCore/JSDOMWindow.cpp \
DerivedSources/WebCore/JSDOMWindow.h \
DerivedSources/WebCore/JSElement.cpp \
@@ -645,11 +649,13 @@ webcore_sources += \
WebCore/bindings/js/DOMWrapperWorld.h \
WebCore/bindings/js/GCController.cpp \
WebCore/bindings/js/GCController.h \
+ WebCore/bindings/js/IDBBindingUtilities.h \
WebCore/bindings/js/JavaScriptCallFrame.cpp \
WebCore/bindings/js/JavaScriptCallFrame.h \
WebCore/bindings/js/JSAttrCustom.cpp \
WebCore/bindings/js/JSAudioConstructor.cpp \
WebCore/bindings/js/JSAudioConstructor.h \
+ WebCore/bindings/js/JSBinding.h \
WebCore/bindings/js/JSCallbackData.cpp \
WebCore/bindings/js/JSCallbackData.h \
WebCore/bindings/js/JSCanvasRenderingContext2DCustom.cpp \
@@ -1348,6 +1354,7 @@ webcore_sources += \
WebCore/editing/WrapContentsInDummySpanCommand.cpp \
WebCore/editing/WrapContentsInDummySpanCommand.h \
WebCore/fileapi/AsyncFileWriter.h \
+ WebCore/fileapi/AsyncFileWriterClient.h \
WebCore/fileapi/BlobBuilder.cpp \
WebCore/fileapi/BlobBuilder.h \
WebCore/fileapi/Blob.cpp \
@@ -1391,7 +1398,6 @@ webcore_sources += \
WebCore/fileapi/FileThread.h \
WebCore/fileapi/FileThreadTask.h \
WebCore/fileapi/FileWriterCallback.h \
- WebCore/fileapi/FileWriterClient.h \
WebCore/fileapi/FileWriter.cpp \
WebCore/fileapi/FileWriter.h \
WebCore/fileapi/Flags.h \
@@ -1418,6 +1424,10 @@ webcore_sources += \
WebCore/history/PageCache.h \
WebCore/html/AsyncImageResizer.cpp \
WebCore/html/AsyncImageResizer.h \
+ WebCore/html/BaseTextInputType.cpp \
+ WebCore/html/BaseTextInputType.h \
+ WebCore/html/ButtonInputType.cpp \
+ WebCore/html/ButtonInputType.h \
WebCore/html/canvas/CanvasContextAttributes.h \
WebCore/html/canvas/CanvasGradient.cpp \
WebCore/html/canvas/CanvasGradient.h \
@@ -1431,9 +1441,15 @@ webcore_sources += \
WebCore/html/canvas/CanvasRenderingContext.h \
WebCore/html/canvas/CanvasStyle.cpp \
WebCore/html/canvas/CanvasStyle.h \
+ WebCore/html/DOMTokenList.cpp \
+ WebCore/html/DOMTokenList.h \
+ WebCore/html/CheckboxInputType.cpp \
+ WebCore/html/CheckboxInputType.h \
WebCore/html/CollectionCache.cpp \
WebCore/html/CollectionCache.h \
WebCore/html/CollectionType.h \
+ WebCore/html/ColorInputType.cpp \
+ WebCore/html/ColorInputType.h \
WebCore/html/DataGridColumn.cpp \
WebCore/html/DataGridColumn.h \
WebCore/html/DataGridColumnList.cpp \
@@ -1441,10 +1457,20 @@ webcore_sources += \
WebCore/html/DataGridDataSource.h \
WebCore/html/DateComponents.cpp \
WebCore/html/DateComponents.h \
+ WebCore/html/DateInputType.cpp \
+ WebCore/html/DateInputType.h \
+ WebCore/html/DateTimeInputType.cpp \
+ WebCore/html/DateTimeInputType.h \
+ WebCore/html/DateTimeLocalInputType.cpp \
+ WebCore/html/DateTimeLocalInputType.h \
WebCore/html/DOMDataGridDataSource.cpp \
WebCore/html/DOMDataGridDataSource.h \
WebCore/html/DOMFormData.cpp \
WebCore/html/DOMFormData.h \
+ WebCore/html/EmailInputType.cpp \
+ WebCore/html/EmailInputType.h \
+ WebCore/html/FileInputType.cpp \
+ WebCore/html/FileInputType.h \
WebCore/html/FormDataList.cpp \
WebCore/html/FormDataList.h \
WebCore/html/FTPDirectoryDocument.cpp \
@@ -1622,17 +1648,29 @@ webcore_sources += \
WebCore/html/HTMLVideoElement.h \
WebCore/html/HTMLViewSourceDocument.cpp \
WebCore/html/HTMLViewSourceDocument.h \
+ WebCore/html/HiddenInputType.cpp \
+ WebCore/html/HiddenInputType.h \
WebCore/html/ImageData.cpp \
WebCore/html/ImageData.h \
WebCore/html/ImageDocument.cpp \
WebCore/html/ImageDocument.h \
+ WebCore/html/ImageInputType.cpp \
+ WebCore/html/ImageInputType.h \
WebCore/html/ImageResizerThread.cpp \
WebCore/html/ImageResizerThread.h \
+ WebCore/html/InputType.cpp \
+ WebCore/html/InputType.h \
+ WebCore/html/IsIndexInputType.cpp \
+ WebCore/html/IsIndexInputType.h \
WebCore/html/LabelsNodeList.cpp \
WebCore/html/LabelsNodeList.h \
WebCore/html/MediaDocument.cpp \
WebCore/html/MediaDocument.h \
WebCore/html/MediaError.h \
+ WebCore/html/MonthInputType.cpp \
+ WebCore/html/MonthInputType.h \
+ WebCore/html/NumberInputType.cpp \
+ WebCore/html/NumberInputType.h \
WebCore/html/parser/CSSPreloadScanner.cpp \
WebCore/html/parser/CSSPreloadScanner.h \
WebCore/html/parser/HTMLConstructionSite.cpp \
@@ -1670,18 +1708,42 @@ webcore_sources += \
WebCore/html/parser/TextDocumentParser.h \
WebCore/html/parser/TextViewSourceParser.cpp \
WebCore/html/parser/TextViewSourceParser.h \
+ WebCore/html/PasswordInputType.cpp \
+ WebCore/html/PasswordInputType.h \
WebCore/html/PluginDocument.cpp \
WebCore/html/PluginDocument.h \
+ WebCore/html/RadioInputType.cpp \
+ WebCore/html/RadioInputType.h \
+ WebCore/html/RangeInputType.cpp \
+ WebCore/html/RangeInputType.h \
+ WebCore/html/ResetInputType.cpp \
+ WebCore/html/ResetInputType.h \
+ WebCore/html/SearchInputType.cpp \
+ WebCore/html/SearchInputType.h \
WebCore/html/StepRange.cpp \
WebCore/html/StepRange.h \
+ WebCore/html/SubmitInputType.cpp \
+ WebCore/html/SubmitInputType.h \
+ WebCore/html/TelephoneInputType.cpp \
+ WebCore/html/TelephoneInputType.h \
WebCore/html/TextDocument.cpp \
WebCore/html/TextDocument.h \
+ WebCore/html/TextFieldInputType.cpp \
+ WebCore/html/TextFieldInputType.h \
+ WebCore/html/TextInputType.cpp \
+ WebCore/html/TextInputType.h \
WebCore/html/TextMetrics.h \
+ WebCore/html/TimeInputType.cpp \
+ WebCore/html/TimeInputType.h \
WebCore/html/TimeRanges.cpp \
WebCore/html/TimeRanges.h \
+ WebCore/html/URLInputType.cpp \
+ WebCore/html/URLInputType.h \
WebCore/html/ValidityState.cpp \
WebCore/html/ValidityState.h \
WebCore/html/VoidCallback.h \
+ WebCore/html/WeekInputType.cpp \
+ WebCore/html/WeekInputType.h \
WebCore/icu/unicode/parseerr.h \
WebCore/icu/unicode/platform.h \
WebCore/icu/unicode/putil.h \
@@ -2084,7 +2146,10 @@ webcore_sources += \
WebCore/platform/graphics/Color.cpp \
WebCore/platform/graphics/Color.h \
WebCore/platform/graphics/ColorSpace.h \
+ WebCore/platform/graphics/ContextShadow.cpp \
+ WebCore/platform/graphics/ContextShadow.h \
WebCore/platform/graphics/DashArray.h \
+ WebCore/platform/graphics/filters/DistantLightSource.h \
WebCore/platform/graphics/filters/FEBlend.cpp \
WebCore/platform/graphics/filters/FEBlend.h \
WebCore/platform/graphics/filters/FEColorMatrix.cpp \
@@ -2093,17 +2158,43 @@ webcore_sources += \
WebCore/platform/graphics/filters/FEComponentTransfer.h \
WebCore/platform/graphics/filters/FEComposite.cpp \
WebCore/platform/graphics/filters/FEComposite.h \
+ WebCore/platform/graphics/filters/FEConvolveMatrix.cpp \
+ WebCore/platform/graphics/filters/FEConvolveMatrix.h \
+ WebCore/platform/graphics/filters/FEDiffuseLighting.cpp \
+ WebCore/platform/graphics/filters/FEDiffuseLighting.h \
+ WebCore/platform/graphics/filters/FEDisplacementMap.cpp \
+ WebCore/platform/graphics/filters/FEDisplacementMap.h \
WebCore/platform/graphics/filters/FEGaussianBlur.cpp \
WebCore/platform/graphics/filters/FEGaussianBlur.h \
+ WebCore/platform/graphics/filters/FEFlood.cpp \
+ WebCore/platform/graphics/filters/FEFlood.h \
+ WebCore/platform/graphics/filters/FELighting.cpp \
+ WebCore/platform/graphics/filters/FELighting.h \
+ WebCore/platform/graphics/filters/FEMerge.cpp \
+ WebCore/platform/graphics/filters/FEMerge.h \
+ WebCore/platform/graphics/filters/FEMorphology.cpp \
+ WebCore/platform/graphics/filters/FEMorphology.h \
+ WebCore/platform/graphics/filters/FEOffset.cpp \
+ WebCore/platform/graphics/filters/FEOffset.h \
+ WebCore/platform/graphics/filters/FESpecularLighting.cpp \
+ WebCore/platform/graphics/filters/FESpecularLighting.h \
+ WebCore/platform/graphics/filters/FETile.cpp \
+ WebCore/platform/graphics/filters/FETile.h \
+ WebCore/platform/graphics/filters/FETurbulence.cpp \
+ WebCore/platform/graphics/filters/FETurbulence.h \
WebCore/platform/graphics/filters/FilterEffect.cpp \
WebCore/platform/graphics/filters/FilterEffect.h \
WebCore/platform/graphics/filters/Filter.h \
WebCore/platform/graphics/filters/ImageBufferFilter.cpp \
WebCore/platform/graphics/filters/ImageBufferFilter.h \
+ WebCore/platform/graphics/filters/LightSource.cpp \
+ WebCore/platform/graphics/filters/LightSource.h \
+ WebCore/platform/graphics/filters/PointLightSource.h \
WebCore/platform/graphics/filters/SourceAlpha.cpp \
WebCore/platform/graphics/filters/SourceAlpha.h \
WebCore/platform/graphics/filters/SourceGraphic.cpp \
WebCore/platform/graphics/filters/SourceGraphic.h \
+ WebCore/platform/graphics/filters/SpotLightSource.h \
WebCore/platform/graphics/FloatPoint3D.cpp \
WebCore/platform/graphics/FloatPoint3D.h \
WebCore/platform/graphics/FloatPoint.cpp \
@@ -2781,6 +2872,8 @@ webcore_sources += \
WebCore/storage/IDBIndex.cpp \
WebCore/storage/IDBIndex.h \
WebCore/storage/IDBKey.h \
+ WebCore/storage/IDBKeyPath.h \
+ WebCore/storage/IDBKeyPathBackendImpl.h \
WebCore/storage/IDBKeyRange.cpp \
WebCore/storage/IDBKeyRange.h \
WebCore/storage/IDBObjectStoreBackendImpl.cpp \
@@ -2794,6 +2887,7 @@ webcore_sources += \
WebCore/storage/IDBSuccessEvent.cpp \
WebCore/storage/IDBSuccessEvent.h \
WebCore/storage/IDBTransactionBackendInterface.h \
+ WebCore/storage/IDBTransactionCoordinator.h \
WebCore/storage/IDBTransaction.cpp \
WebCore/storage/IDBTransaction.h \
WebCore/storage/LocalStorageTask.cpp \
@@ -2856,39 +2950,12 @@ webcore_sources += \
WebCore/svg/ColorDistance.h \
WebCore/svg/ElementTimeControl.h \
WebCore/svg/GradientAttributes.h \
- WebCore/svg/graphics/filters/SVGDistantLightSource.h \
- WebCore/svg/graphics/filters/SVGFEConvolveMatrix.cpp \
- WebCore/svg/graphics/filters/SVGFEConvolveMatrix.h \
- WebCore/svg/graphics/filters/SVGFEDiffuseLighting.cpp \
- WebCore/svg/graphics/filters/SVGFEDiffuseLighting.h \
- WebCore/svg/graphics/filters/SVGFEDisplacementMap.cpp \
- WebCore/svg/graphics/filters/SVGFEDisplacementMap.h \
- WebCore/svg/graphics/filters/SVGFEFlood.cpp \
- WebCore/svg/graphics/filters/SVGFEFlood.h \
WebCore/svg/graphics/filters/SVGFEImage.cpp \
WebCore/svg/graphics/filters/SVGFEImage.h \
- WebCore/svg/graphics/filters/SVGFELighting.cpp \
- WebCore/svg/graphics/filters/SVGFELighting.h \
- WebCore/svg/graphics/filters/SVGFEMerge.cpp \
- WebCore/svg/graphics/filters/SVGFEMerge.h \
- WebCore/svg/graphics/filters/SVGFEMorphology.cpp \
- WebCore/svg/graphics/filters/SVGFEMorphology.h \
- WebCore/svg/graphics/filters/SVGFEOffset.cpp \
- WebCore/svg/graphics/filters/SVGFEOffset.h \
- WebCore/svg/graphics/filters/SVGFESpecularLighting.cpp \
- WebCore/svg/graphics/filters/SVGFESpecularLighting.h \
- WebCore/svg/graphics/filters/SVGFETile.cpp \
- WebCore/svg/graphics/filters/SVGFETile.h \
- WebCore/svg/graphics/filters/SVGFETurbulence.cpp \
- WebCore/svg/graphics/filters/SVGFETurbulence.h \
WebCore/svg/graphics/filters/SVGFilterBuilder.cpp \
WebCore/svg/graphics/filters/SVGFilterBuilder.h \
WebCore/svg/graphics/filters/SVGFilter.cpp \
WebCore/svg/graphics/filters/SVGFilter.h \
- WebCore/svg/graphics/filters/SVGLightSource.cpp \
- WebCore/svg/graphics/filters/SVGLightSource.h \
- WebCore/svg/graphics/filters/SVGPointLightSource.h \
- WebCore/svg/graphics/filters/SVGSpotLightSource.h \
WebCore/svg/graphics/SVGImage.cpp \
WebCore/svg/graphics/SVGImage.h \
WebCore/svg/LinearGradientAttributes.h \
@@ -3349,6 +3416,9 @@ webcoregtk_sources += \
WebCore/page/gtk/EventHandlerGtk.cpp \
WebCore/page/gtk/FrameGtk.cpp \
WebCore/platform/graphics/cairo/CairoPath.h \
+ WebCore/platform/graphics/cairo/CairoUtilities.cpp \
+ WebCore/platform/graphics/cairo/CairoUtilities.h \
+ WebCore/platform/graphics/cairo/ContextShadowCairo.cpp \
WebCore/platform/graphics/cairo/FontCairo.cpp \
WebCore/platform/graphics/cairo/FontCustomPlatformData.h \
WebCore/platform/graphics/cairo/FontPlatformData.h \
@@ -3381,10 +3451,10 @@ webcoregtk_sources += \
WebCore/platform/graphics/gstreamer/VideoSinkGStreamer.h \
WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp \
WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.h \
- WebCore/platform/graphics/gtk/CairoUtilities.cpp \
- WebCore/platform/graphics/gtk/CairoUtilities.h \
WebCore/platform/graphics/gtk/ColorGtk.cpp \
WebCore/platform/graphics/gtk/FontGtk.cpp \
+ WebCore/platform/graphics/gtk/GdkCairoUtilities.cpp \
+ WebCore/platform/graphics/gtk/GdkCairoUtilities.h \
WebCore/platform/graphics/gtk/IconGtk.cpp \
WebCore/platform/graphics/gtk/ImageBufferGtk.cpp \
WebCore/platform/graphics/gtk/ImageGtk.cpp \
@@ -3544,6 +3614,7 @@ webcoregtk_sources += \
WebCore/platform/graphics/cairo/FontCacheFreeType.cpp \
WebCore/platform/graphics/cairo/FontCustomPlatformData.cpp \
WebCore/platform/graphics/cairo/FontPlatformDataFreeType.cpp \
+ WebCore/platform/graphics/cairo/FontPlatformDataFreeType.h \
WebCore/platform/graphics/cairo/GlyphPageTreeNodeCairo.cpp \
WebCore/platform/graphics/cairo/SimpleFontDataCairo.cpp
endif # END USE_FREETYPE
@@ -3557,6 +3628,7 @@ webcoregtk_sources += \
WebCore/platform/graphics/gtk/FontCachePango.cpp \
WebCore/platform/graphics/gtk/FontCustomPlatformDataPango.cpp \
WebCore/platform/graphics/gtk/FontPlatformDataPango.cpp \
+ WebCore/platform/graphics/gtk/FontPlatformDataPango.h \
WebCore/platform/graphics/gtk/GlyphPageTreeNodePango.cpp \
WebCore/platform/graphics/gtk/SimpleFontDataPango.cpp
endif # END USE_PANGO
@@ -3802,6 +3874,7 @@ FEATURE_DEFINES += ENABLE_VIDEO=1
HTML_FEATURES += ENABLE_VIDEO=1
webcore_cppflags += -DENABLE_VIDEO=1
+if USE_GSTREAMER
if ENABLE_DEBUG
webcore_cppflags += -DGST_DISABLE_DEPRECATED
endif # END ENABLE_DEBUG
@@ -3810,6 +3883,7 @@ webcore_libadd += \
-lgstvideo-0.10 \
-lgstpbutils-0.10 \
-lgstapp-0.10
+endif # END USE_GSTREAMER
endif # END ENABLE_VIDEO
# ----
@@ -4321,6 +4395,7 @@ FEATURE_DEFINES += ENABLE_BLOB=1
webcore_cppflags += -DENABLE_BLOB=1
endif # END ENABLE_BLOB
+DerivedSources/WebCore/CSSPropertyNames.cpp:
DerivedSources/WebCore/CSSPropertyNames.h: $(WEBCORE_CSS_PROPERTY_NAMES) $(WebCore)/css/makeprop.pl
if sort $(WEBCORE_CSS_PROPERTY_NAMES) | uniq -d | grep -E '^[^#]'; then echo 'Duplicate value!'; exit 1; fi
cat $(WEBCORE_CSS_PROPERTY_NAMES) > CSSPropertyNames.in
@@ -4328,18 +4403,19 @@ DerivedSources/WebCore/CSSPropertyNames.h: $(WEBCORE_CSS_PROPERTY_NAMES) $(WebCo
mv CSSPropertyNames.* $(GENSOURCES_WEBCORE)
# Lower case all the values, as CSS values are case-insensitive
-DerivedSources/WebCore/CSSValueKeywords.h : $(WEBCORE_CSS_VALUE_KEYWORDS) $(WebCore)/css/makevalues.pl
+DerivedSources/WebCore/CSSValueKeywords.cpp:
+DerivedSources/WebCore/CSSValueKeywords.h: $(WEBCORE_CSS_VALUE_KEYWORDS) $(WebCore)/css/makevalues.pl
$(PERL) -ne 'print lc' $(WEBCORE_CSS_VALUE_KEYWORDS) > CSSValueKeywords.in
if sort CSSValueKeywords.in | uniq -d | grep -E '^[^#]'; then echo 'Duplicate value!'; exit 1; fi
$(PERL) "$(WebCore)/css/makevalues.pl"
mv CSSValueKeywords.* $(GENSOURCES_WEBCORE)
# DOCTYPE strings
-DerivedSources/WebCore/DocTypeStrings.cpp : $(WebCore)/html/DocTypeStrings.gperf $(WebCore)/make-hash-tools.pl
+DerivedSources/WebCore/DocTypeStrings.cpp DerivedSources/WebCore/HashTools.h: $(WebCore)/html/DocTypeStrings.gperf $(WebCore)/make-hash-tools.pl
$(PERL) $(WebCore)/make-hash-tools.pl $(GENSOURCES_WEBCORE) $(WebCore)/html/DocTypeStrings.gperf
# HTML entity names
-DerivedSources/WebCore/HTMLEntityTable.cpp : $(WebCore)/html/parser/HTMLEntityNames.in $(WebCore)/html/parser/create-html-entity-table
+DerivedSources/WebCore/HTMLEntityTable.cpp: $(WebCore)/html/parser/HTMLEntityNames.in $(WebCore)/html/parser/create-html-entity-table
$(PYTHON) $(WebCore)/html/parser/create-html-entity-table -o $(GENSOURCES_WEBCORE)/HTMLEntityTable.cpp $(WebCore)/html/parser/HTMLEntityNames.in
# color names
diff --git a/WebCore/WebCore.exp.in b/WebCore/WebCore.exp.in
index d2a6edb..5d789dc 100644
--- a/WebCore/WebCore.exp.in
+++ b/WebCore/WebCore.exp.in
@@ -139,6 +139,7 @@ __ZN3WTF6StringC1EP8NSString
__ZN3WTF6StringC1EPK10__CFString
__ZN7WebCore10MouseEventC1ERKN3WTF12AtomicStringEbbNS1_10PassRefPtrINS_9DOMWindowEEEiiiiibbbbtNS5_INS_11EventTargetEEENS5_INS_9ClipboardEEEb
__ZN7WebCore10ScrollView20setCanHaveScrollbarsEb
+__ZN7WebCore10ScrollView24windowResizerRectChangedEv
__ZN7WebCore10deleteFileERKN3WTF6StringE
__ZN7WebCore10handCursorEv
__ZN7WebCore10setCookiesEPNS_8DocumentERKNS_4KURLERKN3WTF6StringE
@@ -360,7 +361,9 @@ __ZN7WebCore15VisiblePositionC1ERKNS_8PositionENS_9EAffinityE
__ZN7WebCore15reportExceptionEPN3JSC9ExecStateENS0_7JSValueE
__ZN7WebCore15visitedLinkHashEPKtj
__ZN7WebCore16AbstractDatabase14setIsAvailableEb
-__ZN7WebCore16DeviceMotionData6createEbdbdbdbdbdbdbd
+__ZN7WebCore16DeviceMotionData12Acceleration6createEbdbdbd
+__ZN7WebCore16DeviceMotionData12RotationRate6createEbdbdbd
+__ZN7WebCore16DeviceMotionData6createEN3WTF10PassRefPtrINS0_12AccelerationEEES4_NS2_INS0_12RotationRateEEEbd
__ZN7WebCore16FontFallbackList15releaseFontDataEv
__ZN7WebCore16FontPlatformDataC1EP6NSFontbb
__ZN7WebCore16FontPlatformDataD1Ev
@@ -493,6 +496,7 @@ __ZN7WebCore27CSSComputedStyleDeclarationC1EN3WTF10PassRefPtrINS_4NodeEEEbRKNS1_
__ZN7WebCore27DeviceOrientationClientMock14setOrientationEN3WTF10PassRefPtrINS_17DeviceOrientationEEE
__ZN7WebCore27DeviceOrientationClientMockC1Ev
__ZN7WebCore27applicationIsAdobeInstallerEv
+__ZN7WebCore27applicationIsMicrosoftMyDayEv
__ZN7WebCore27contextMenuItemTagShowFontsEv
__ZN7WebCore27contextMenuItemTagUnderlineEv
__ZN7WebCore28InspectorFrontendClientLocal20sendMessageToBackendERKN3WTF6StringE
@@ -516,6 +520,7 @@ __ZN7WebCore31contextMenuItemTagIgnoreGrammarEv
__ZN7WebCore31contextMenuItemTagMakeLowerCaseEv
__ZN7WebCore31contextMenuItemTagMakeUpperCaseEv
__ZN7WebCore31contextMenuItemTagStartSpeakingEv
+__ZN7WebCore32applicationIsAOLInstantMessengerEv
__ZN7WebCore32contextMenuItemTagInspectElementEv
__ZN7WebCore32contextMenuItemTagSmartCopyPasteEv
__ZN7WebCore32plainTextToMallocAllocatedBufferEPKNS_5RangeERjbNS_20TextIteratorBehaviorE
@@ -577,6 +582,7 @@ __ZN7WebCore4PageD1Ev
__ZN7WebCore4coreEP20NSURLProtectionSpace
__ZN7WebCore4toJSEPN3JSC9ExecStateEPNS_17JSDOMGlobalObjectEPNS_19CSSStyleDeclarationE
__ZN7WebCore4toJSEPN3JSC9ExecStateEPNS_17JSDOMGlobalObjectEPNS_5RangeE
+__ZN7WebCore4toJSEPN3JSC9ExecStateEPNS_17JSDOMGlobalObjectEPNS_8NodeListE
__ZN7WebCore5Cache11setDisabledEb
__ZN7WebCore5Cache13getStatisticsEv
__ZN7WebCore5Cache13setCapacitiesEjjj
@@ -650,8 +656,7 @@ __ZN7WebCore6Loader20servePendingRequestsENS0_8PriorityE
__ZN7WebCore6Widget12setFrameRectERKNS_7IntRectE
__ZN7WebCore6Widget16removeFromParentEv
__ZN7WebCore6Widget17frameRectsChangedEv
-__ZN7WebCore6Widget20retainPlatformWidgetEv
-__ZN7WebCore6Widget21releasePlatformWidgetEv
+__ZN7WebCore6Widget17setPlatformWidgetEP6NSView
__ZN7WebCore6Widget4hideEv
__ZN7WebCore6Widget4showEv
__ZN7WebCore6Widget5paintEPNS_15GraphicsContextERKNS_7IntRectE
@@ -684,6 +689,8 @@ __ZN7WebCore8Document26pageSizeAndMarginsInPixelsEiRNS_7IntSizeERiS3_S3_S3_
__ZN7WebCore8Document27removeMediaCanStartListenerEPNS_21MediaCanStartListenerE
__ZN7WebCore8Document36updateLayoutIgnorePendingStylesheetsEv
__ZN7WebCore8Document4headEv
+__ZNK7WebCore8Document13nodesFromRectEiijjjjb
+__ZN7WebCore10JSDocument6s_infoE
__ZN7WebCore8FormData6createEPKvm
__ZN7WebCore8FormDataD1Ev
__ZN7WebCore8IntPointC1ERK8_NSPoint
@@ -828,7 +835,7 @@ __ZN7WebCore9PageGroup18addVisitedLinkHashEy
__ZN7WebCore9PageGroup20addUserScriptToWorldEPNS_15DOMWrapperWorldERKN3WTF6StringERKNS_4KURLENS3_10PassOwnPtrINS3_6VectorIS4_Lm0EEEEESD_NS_23UserScriptInjectionTimeENS_25UserContentInjectedFramesE
__ZN7WebCore9PageGroup20removeAllUserContentEv
__ZN7WebCore9PageGroup21removeAllVisitedLinksEv
-__ZN7WebCore9PageGroup24addUserStyleSheetToWorldEPNS_15DOMWrapperWorldERKN3WTF6StringERKNS_4KURLENS3_10PassOwnPtrINS3_6VectorIS4_Lm0EEEEESD_NS_25UserContentInjectedFramesENS_14UserStyleSheet5LevelE
+__ZN7WebCore9PageGroup24addUserStyleSheetToWorldEPNS_15DOMWrapperWorldERKN3WTF6StringERKNS_4KURLENS3_10PassOwnPtrINS3_6VectorIS4_Lm0EEEEESD_NS_25UserContentInjectedFramesENS_14UserStyleLevelENS_22UserStyleInjectionTimeE
__ZN7WebCore9PageGroup25removeUserScriptFromWorldEPNS_15DOMWrapperWorldERKNS_4KURLE
__ZN7WebCore9PageGroup26removeUserScriptsFromWorldEPNS_15DOMWrapperWorldE
__ZN7WebCore9PageGroup26setShouldTrackVisitedLinksEb
@@ -917,6 +924,7 @@ __ZNK7WebCore13HitTestResult18titleDisplayStringEv
__ZNK7WebCore13HitTestResult5imageEv
__ZNK7WebCore13HitTestResult5titleERNS_13TextDirectionE
__ZNK7WebCore13HitTestResult9imageRectEv
+__ZN7WebCore13HitTestResult13rectFromPointERKNS_8IntPointEjjjj
__ZNK7WebCore13ResourceErrorcvP7NSErrorEv
__ZNK7WebCore14DocumentLoader10requestURLEv
__ZNK7WebCore14DocumentLoader11frameLoaderEv
@@ -1036,6 +1044,7 @@ __ZNK7WebCore6Editor7canCopyEv
__ZNK7WebCore6Editor7canEditEv
__ZNK7WebCore6Editor8canPasteEv
__ZNK7WebCore6Editor9canDeleteEv
+__ZNK7WebCore6Widget14platformWidgetEv
__ZNK7WebCore6Widget23convertToContainingViewERKNS_7IntRectE
__ZNK7WebCore6Widget23convertToContainingViewERKNS_8IntPointE
__ZNK7WebCore6Widget25convertFromContainingViewERKNS_7IntRectE
@@ -1144,7 +1153,6 @@ _wkSignalCFReadStreamEnd
_wkSignalCFReadStreamError
_wkSignalCFReadStreamHasBytes
-
#if ENABLE(3D_RENDERING)
_WebCoreHas3DRendering
#endif
diff --git a/WebCore/WebCore.gyp/WebCore.gyp b/WebCore/WebCore.gyp/WebCore.gyp
index 2745cfa..6b13eb5 100644
--- a/WebCore/WebCore.gyp/WebCore.gyp
+++ b/WebCore/WebCore.gyp/WebCore.gyp
@@ -244,10 +244,14 @@
'../platform/mac',
'../platform/text/mac',
],
- # enable -Wall and -Werror, just in Mac build for now
- # FIXME: Also enable this for Linux/Windows after verifying no warnings
+ # enable -Wall and -Werror, just for Mac and Linux builds for now
+ # FIXME: Also enable this for Windows after verifying no warnings
'chromium_code': 1,
}],
+# FIXME: disabled for now due to failures on different gcc versions
+# ['OS=="linux"', {
+# 'chromium_code': 1,
+# }],
['OS=="win"', {
'webcore_include_dirs': [
'../page/win',
@@ -646,7 +650,6 @@
'<(SHARED_INTERMEDIATE_DIR)/webkit',
'<(RULE_INPUT_PATH)',
],
- 'process_outputs_as_sources': 0,
},
# Rule to build generated JavaScript (V8) bindings from .idl source.
{
@@ -743,6 +746,12 @@
# in webcore_files.
'<@(derived_sources_aggregate_files)',
+ # Additional .cpp files for HashTools.h
+ '<(SHARED_INTERMEDIATE_DIR)/webkit/DocTypeStrings.cpp',
+ '<(SHARED_INTERMEDIATE_DIR)/webkit/ColorData.cpp',
+ '<(SHARED_INTERMEDIATE_DIR)/webkit/CSSPropertyNames.cpp',
+ '<(SHARED_INTERMEDIATE_DIR)/webkit/CSSValueKeywords.cpp',
+
# Additional .cpp files from webcore_bindings_sources actions.
'<(SHARED_INTERMEDIATE_DIR)/webkit/HTMLElementFactory.cpp',
'<(SHARED_INTERMEDIATE_DIR)/webkit/HTMLNames.cpp',
@@ -973,6 +982,21 @@
],
},
{
+ 'target_name': 'webcore_html',
+ 'type': '<(library)',
+ 'dependencies': [
+ 'webcore_prerequisites',
+ ],
+ 'sources': [
+ '<@(webcore_files)',
+ ],
+ 'sources/': [
+ # Start by excluding everything then include html files only.
+ ['exclude', '.*'],
+ ['include', 'html/'],
+ ],
+ },
+ {
'target_name': 'webcore_svg',
'type': '<(library)',
'dependencies': [
@@ -1201,7 +1225,7 @@
# Exclude things that don't apply to the Chromium platform on the basis
# of their enclosing directories and tags at the ends of their
# filenames.
- ['exclude', '(android|cairo|cf|cg|curl|gtk|haiku|linux|mac|opentype|platform|posix|qt|soup|svg|symbian|win|wx)/'],
+ ['exclude', '(android|cairo|cf|cg|curl|gtk|haiku|html|linux|mac|opentype|platform|posix|qt|soup|svg|symbian|win|wx)/'],
['exclude', '(?<!Chromium)(Android|Cairo|CF|CG|Curl|Gtk|Linux|Mac|OpenType|POSIX|Posix|Qt|Safari|Soup|Symbian|Win|Wx)\\.(cpp|mm?)$'],
# Exclude most of SVG except css and javascript bindings.
@@ -1331,6 +1355,7 @@
'target_name': 'webcore',
'type': 'none',
'dependencies': [
+ 'webcore_html',
'webcore_platform',
'webcore_remaining',
# Exported.
diff --git a/WebCore/WebCore.gypi b/WebCore/WebCore.gypi
index 528dc3c..8e6af6b 100644
--- a/WebCore/WebCore.gypi
+++ b/WebCore/WebCore.gypi
@@ -111,6 +111,7 @@
'fileapi/Metadata.idl',
'fileapi/MetadataCallback.idl',
'html/DOMFormData.idl',
+ 'html/DOMTokenList.idl',
'html/DataGridColumn.idl',
'html/DataGridColumnList.idl',
'html/HTMLAllCollection.idl',
@@ -766,6 +767,7 @@
'bindings/v8/custom/V8DocumentLocationCustom.cpp',
'bindings/v8/custom/V8DOMFormDataCustom.cpp',
'bindings/v8/custom/V8DOMStringMapCustom.cpp',
+ 'bindings/v8/custom/V8DOMTokenListCustom.cpp',
'bindings/v8/custom/V8DOMWindowCustom.cpp',
'bindings/v8/custom/V8DocumentCustom.cpp',
'bindings/v8/custom/V8ElementCustom.cpp',
@@ -1333,6 +1335,7 @@
'dom/XMLDocumentParserQt.cpp',
'editing/android/EditorAndroid.cpp',
'editing/chromium/EditorChromium.cpp',
+ 'editing/chromium/SelectionControllerChromium.cpp',
'editing/mac/EditorMac.mm',
'editing/mac/SelectionControllerMac.mm',
'editing/qt/EditorQt.cpp',
@@ -1438,6 +1441,7 @@
'editing/visible_units.cpp',
'editing/visible_units.h',
'fileapi/AsyncFileWriter.h',
+ 'fileapi/AsyncFileWriterClient.h',
'fileapi/Blob.cpp',
'fileapi/Blob.h',
'fileapi/BlobBuilder.cpp',
@@ -1483,7 +1487,6 @@
'fileapi/FileWriter.cpp',
'fileapi/FileWriter.h',
'fileapi/FileWriterCallback.h',
- 'fileapi/FileWriterClient.h',
'fileapi/Flags.h',
'fileapi/LocalFileSystem.h',
'fileapi/Metadata.h',
@@ -1509,21 +1512,41 @@
'history/PageCache.h',
'html/AsyncImageResizer.cpp',
'html/AsyncImageResizer.h',
+ 'html/BaseTextInputType.cpp',
+ 'html/BaseTextInputType.h',
+ 'html/ButtonInputType.cpp',
+ 'html/ButtonInputType.h',
+ 'html/CheckboxInputType.cpp',
+ 'html/CheckboxInputType.h',
'html/CollectionCache.cpp',
'html/CollectionCache.h',
'html/CollectionType.h',
+ 'html/ColorInputType.cpp',
+ 'html/ColorInputType.h',
'html/DOMDataGridDataSource.cpp',
'html/DOMDataGridDataSource.h',
'html/DOMFormData.cpp',
'html/DOMFormData.h',
+ 'html/DOMTokenList.cpp',
+ 'html/DOMTokenList.h',
'html/DataGridColumn.cpp',
'html/DataGridColumn.h',
'html/DataGridColumnList.cpp',
'html/DataGridColumnList.h',
'html/DateComponents.cpp',
'html/DateComponents.h',
+ 'html/DateInputType.cpp',
+ 'html/DateInputType.h',
+ 'html/DateTimeInputType.cpp',
+ 'html/DateTimeInputType.h',
+ 'html/DateTimeLocalInputType.cpp',
+ 'html/DateTimeLocalInputType.h',
+ 'html/EmailInputType.cpp',
+ 'html/EmailInputType.h',
'html/FTPDirectoryDocument.cpp',
'html/FTPDirectoryDocument.h',
+ 'html/FileInputType.cpp',
+ 'html/FileInputType.h',
'html/FormDataList.cpp',
'html/FormDataList.h',
'html/HTMLAllCollection.cpp',
@@ -1696,29 +1719,65 @@
'html/HTMLVideoElement.h',
'html/HTMLViewSourceDocument.cpp',
'html/HTMLViewSourceDocument.h',
+ 'html/HiddenInputType.cpp',
+ 'html/HiddenInputType.h',
'html/ImageData.cpp',
'html/ImageData.h',
'html/ImageDocument.cpp',
'html/ImageDocument.h',
+ 'html/ImageInputType.cpp',
+ 'html/ImageInputType.h',
'html/ImageResizerThread.cpp',
'html/ImageResizerThread.h',
+ 'html/InputType.cpp',
+ 'html/InputType.h',
+ 'html/IsIndexInputType.cpp',
+ 'html/IsIndexInputType.h',
'html/LabelsNodeList.cpp',
'html/LabelsNodeList.h',
'html/MediaDocument.cpp',
'html/MediaDocument.h',
'html/MediaError.h',
+ 'html/MonthInputType.cpp',
+ 'html/MonthInputType.h',
+ 'html/NumberInputType.cpp',
+ 'html/NumberInputType.h',
+ 'html/PasswordInputType.cpp',
+ 'html/PasswordInputType.h',
'html/PluginDocument.cpp',
'html/PluginDocument.h',
+ 'html/RadioInputType.cpp',
+ 'html/RadioInputType.h',
+ 'html/RangeInputType.cpp',
+ 'html/RangeInputType.h',
+ 'html/ResetInputType.cpp',
+ 'html/ResetInputType.h',
+ 'html/SearchInputType.cpp',
+ 'html/SearchInputType.h',
'html/StepRange.cpp',
'html/StepRange.h',
+ 'html/SubmitInputType.cpp',
+ 'html/SubmitInputType.h',
+ 'html/TelephoneInputType.cpp',
+ 'html/TelephoneInputType.h',
'html/TextDocument.cpp',
'html/TextDocument.h',
+ 'html/TextFieldInputType.cpp',
+ 'html/TextFieldInputType.h',
+ 'html/TextInputType.cpp',
+ 'html/TextInputType.h',
'html/TextMetrics.h',
+ 'html/TimeInputType.cpp',
+ 'html/TimeInputType.h',
'html/TimeRanges.cpp',
'html/TimeRanges.h',
+ 'html/URLInputType.cpp',
+ 'html/URLInputType.h',
'html/ValidityState.cpp',
'html/ValidityState.h',
'html/VoidCallback.h',
+ 'html/WeekInputType.cpp',
+ 'html/WeekInputType.h',
'html/canvas/ArrayBuffer.cpp',
'html/canvas/ArrayBuffer.h',
'html/canvas/ArrayBufferView.cpp',
@@ -2220,7 +2279,6 @@
'platform/chromium/FramelessScrollViewClient.h',
'platform/chromium/GeolocationServiceChromium.cpp',
'platform/chromium/GeolocationServiceChromium.h',
- 'platform/chromium/GLES2Context.h',
'platform/chromium/KeyCodeConversion.h',
'platform/chromium/KeyCodeConversionGtk.cpp',
'platform/chromium/Language.cpp',
@@ -2345,6 +2403,8 @@
'platform/graphics/chromium/UniscribeHelper.h',
'platform/graphics/chromium/UniscribeHelperTextRun.cpp',
'platform/graphics/chromium/UniscribeHelperTextRun.h',
+ 'platform/graphics/chromium/VideoFrameChromium.cpp',
+ 'platform/graphics/chromium/VideoFrameChromium.h',
'platform/graphics/chromium/VideoLayerChromium.cpp',
'platform/graphics/chromium/VideoLayerChromium.h',
'platform/graphics/chromium/VDMXParser.cpp',
@@ -2353,6 +2413,7 @@
'platform/graphics/chromium/WebGLLayerChromium.h',
'platform/graphics/cocoa/FontPlatformData.h',
'platform/graphics/cocoa/FontPlatformDataCocoa.mm',
+ 'platform/graphics/filters/DistantLightSource.h',
'platform/graphics/filters/FEBlend.cpp',
'platform/graphics/filters/FEBlend.h',
'platform/graphics/filters/FEColorMatrix.cpp',
@@ -2361,8 +2422,34 @@
'platform/graphics/filters/FEComponentTransfer.h',
'platform/graphics/filters/FEComposite.cpp',
'platform/graphics/filters/FEComposite.h',
+ 'platform/graphics/filters/FEConvolveMatrix.cpp',
+ 'platform/graphics/filters/FEConvolveMatrix.h',
+ 'platform/graphics/filters/FEDiffuseLighting.cpp',
+ 'platform/graphics/filters/FEDiffuseLighting.h',
+ 'platform/graphics/filters/FEDisplacementMap.cpp',
+ 'platform/graphics/filters/FEDisplacementMap.h',
+ 'platform/graphics/filters/FEFlood.cpp',
+ 'platform/graphics/filters/FEFlood.h',
'platform/graphics/filters/FEGaussianBlur.cpp',
'platform/graphics/filters/FEGaussianBlur.h',
+ 'platform/graphics/filters/FELighting.cpp',
+ 'platform/graphics/filters/FELighting.h',
+ 'platform/graphics/filters/FEMerge.cpp',
+ 'platform/graphics/filters/FEMerge.h',
+ 'platform/graphics/filters/FEMorphology.cpp',
+ 'platform/graphics/filters/FEMorphology.h',
+ 'platform/graphics/filters/FEOffset.cpp',
+ 'platform/graphics/filters/FEOffset.h',
+ 'platform/graphics/filters/FESpecularLighting.cpp',
+ 'platform/graphics/filters/FESpecularLighting.h',
+ 'platform/graphics/filters/FETile.cpp',
+ 'platform/graphics/filters/FETile.h',
+ 'platform/graphics/filters/FETurbulence.cpp',
+ 'platform/graphics/filters/FETurbulence.h',
+ 'platform/graphics/filters/LightSource.cpp',
+ 'platform/graphics/filters/LightSource.h',
+ 'platform/graphics/filters/PointLightSource.h',
+ 'platform/graphics/filters/SpotLightSource.h',
'platform/graphics/filters/Filter.h',
'platform/graphics/filters/FilterEffect.cpp',
'platform/graphics/filters/FilterEffect.h',
@@ -3772,39 +3859,12 @@
'svg/animation/SMILTimeContainer.h',
'svg/animation/SVGSMILElement.cpp',
'svg/animation/SVGSMILElement.h',
- 'svg/graphics/filters/SVGDistantLightSource.h',
- 'svg/graphics/filters/SVGFEConvolveMatrix.cpp',
- 'svg/graphics/filters/SVGFEConvolveMatrix.h',
- 'svg/graphics/filters/SVGFEDiffuseLighting.cpp',
- 'svg/graphics/filters/SVGFEDiffuseLighting.h',
- 'svg/graphics/filters/SVGFEDisplacementMap.cpp',
- 'svg/graphics/filters/SVGFEDisplacementMap.h',
- 'svg/graphics/filters/SVGFEFlood.cpp',
- 'svg/graphics/filters/SVGFEFlood.h',
'svg/graphics/filters/SVGFEImage.cpp',
'svg/graphics/filters/SVGFEImage.h',
- 'svg/graphics/filters/SVGFELighting.cpp',
- 'svg/graphics/filters/SVGFELighting.h',
- 'svg/graphics/filters/SVGFEMerge.cpp',
- 'svg/graphics/filters/SVGFEMerge.h',
- 'svg/graphics/filters/SVGFEMorphology.cpp',
- 'svg/graphics/filters/SVGFEMorphology.h',
- 'svg/graphics/filters/SVGFEOffset.cpp',
- 'svg/graphics/filters/SVGFEOffset.h',
- 'svg/graphics/filters/SVGFESpecularLighting.cpp',
- 'svg/graphics/filters/SVGFESpecularLighting.h',
- 'svg/graphics/filters/SVGFETile.cpp',
- 'svg/graphics/filters/SVGFETile.h',
- 'svg/graphics/filters/SVGFETurbulence.cpp',
- 'svg/graphics/filters/SVGFETurbulence.h',
'svg/graphics/filters/SVGFilter.cpp',
'svg/graphics/filters/SVGFilter.h',
'svg/graphics/filters/SVGFilterBuilder.cpp',
'svg/graphics/filters/SVGFilterBuilder.h',
- 'svg/graphics/filters/SVGLightSource.cpp',
- 'svg/graphics/filters/SVGLightSource.h',
- 'svg/graphics/filters/SVGPointLightSource.h',
- 'svg/graphics/filters/SVGSpotLightSource.h',
'svg/graphics/SVGImage.cpp',
'svg/graphics/SVGImage.h',
'svg/ColorDistance.cpp',
@@ -4224,7 +4284,6 @@
'webinspector_files': [
'inspector/front-end/inspector.html',
- 'inspector/front-end/AbstractTimelinePanel.js',
'inspector/front-end/ApplicationCacheItemsView.js',
'inspector/front-end/AuditCategories.js',
'inspector/front-end/AuditFormatters.js',
@@ -4265,6 +4324,7 @@
'inspector/front-end/ExtensionRegistryStub.js',
'inspector/front-end/ExtensionServer.js',
'inspector/front-end/FontView.js',
+ 'inspector/front-end/GoToLineDialog.js',
'inspector/front-end/HAREntry.js',
'inspector/front-end/HeapSnapshotView.js',
'inspector/front-end/HelpScreen.js',
@@ -4276,6 +4336,7 @@
'inspector/front-end/inspector.js',
'inspector/front-end/KeyboardShortcut.js',
'inspector/front-end/MetricsSidebarPane.js',
+ 'inspector/front-end/NetworkPanel.js',
'inspector/front-end/Object.js',
'inspector/front-end/ObjectPropertiesSection.js',
'inspector/front-end/Panel.js',
@@ -4329,10 +4390,12 @@
'inspector/front-end/WelcomeView.js',
'inspector/front-end/WorkersSidebarPane.js',
'inspector/front-end/audits.css',
+ 'inspector/front-end/goToLineDialog.css',
'inspector/front-end/heapProfiler.css',
'inspector/front-end/helpScreen.css',
'inspector/front-end/inspector.css',
'inspector/front-end/inspectorSyntaxHighlight.css',
+ 'inspector/front-end/networkPanel.css',
'inspector/front-end/popover.css',
'inspector/front-end/textViewer.css',
],
@@ -4389,7 +4452,9 @@
'inspector/front-end/Images/grayConnectorPoint.png',
'inspector/front-end/Images/largerResourcesButtonGlyph.png',
'inspector/front-end/Images/localStorage.png',
+ 'inspector/front-end/Images/networkIcon.png',
'inspector/front-end/Images/nodeSearchButtonGlyph.png',
+ 'inspector/front-end/Images/paneAddButtons.png',
'inspector/front-end/Images/paneBottomGrow.png',
'inspector/front-end/Images/paneBottomGrowActive.png',
'inspector/front-end/Images/paneGrowHandleLine.png',
diff --git a/WebCore/WebCore.pri b/WebCore/WebCore.pri
index 37bb205..3331626 100644
--- a/WebCore/WebCore.pri
+++ b/WebCore/WebCore.pri
@@ -61,7 +61,7 @@ STYLESHEETS_EMBED = \
$$PWD/css/mediaControls.css \
$$PWD/css/mediaControlsQt.css \
$$PWD/css/themeQtNoListboxes.css \
- $$PWD/css/themeQtMaemo5.css
+ $$PWD/css/themeQtMobile.css
v8 {
IDL_BINDINGS += \
@@ -201,6 +201,7 @@ IDL_BINDINGS += \
html/DataGridColumn.idl \
html/DataGridColumnList.idl \
html/DOMFormData.idl \
+ html/DOMTokenList.idl \
html/HTMLAllCollection.idl \
html/HTMLAudioElement.idl \
html/HTMLAnchorElement.idl \
@@ -546,7 +547,7 @@ cssprops.wkScript = $$PWD/css/makeprop.pl
cssprops.output = $${WC_GENERATED_SOURCES_DIR}/CSSPropertyNames.cpp
cssprops.input = WALDOCSSPROPS
cssprops.commands = perl -ne \"print lc\" ${QMAKE_FILE_NAME} $${DASHBOARDSUPPORTCSSPROPERTIES} $${EXTRACSSPROPERTIES} > $${WC_GENERATED_SOURCES_DIR}/${QMAKE_FILE_BASE}.in && cd $$WC_GENERATED_SOURCES_DIR && perl $$cssprops.wkScript && $(DEL_FILE) ${QMAKE_FILE_BASE}.in ${QMAKE_FILE_BASE}.gperf
-cssprops.depends = ${QMAKE_FILE_NAME} $${DASHBOARDSUPPORTCSSPROPERTIES} $${EXTRACSSPROPERTIES}
+cssprops.depends = ${QMAKE_FILE_NAME} $${DASHBOARDSUPPORTCSSPROPERTIES} $${EXTRACSSPROPERTIES} $$cssprops.wkScript
addExtraCompiler(cssprops)
# GENERATOR 6-B:
@@ -554,7 +555,7 @@ cssvalues.wkScript = $$PWD/css/makevalues.pl
cssvalues.output = $${WC_GENERATED_SOURCES_DIR}/CSSValueKeywords.cpp
cssvalues.input = WALDOCSSVALUES
cssvalues.commands = perl -ne \"print lc\" ${QMAKE_FILE_NAME} $$EXTRACSSVALUES > $${WC_GENERATED_SOURCES_DIR}/${QMAKE_FILE_BASE}.in && cd $$WC_GENERATED_SOURCES_DIR && perl $$cssvalues.wkScript && $(DEL_FILE) ${QMAKE_FILE_BASE}.in ${QMAKE_FILE_BASE}.gperf
-cssvalues.depends = ${QMAKE_FILE_NAME} $${EXTRACSSVALUES}
+cssvalues.depends = ${QMAKE_FILE_NAME} $${EXTRACSSVALUES} $$cssvalues.wkScript
cssvalues.clean = ${QMAKE_FILE_OUT} ${QMAKE_VAR_WC_GENERATED_SOURCES_DIR}/${QMAKE_FILE_BASE}.h
addExtraCompiler(cssvalues)
diff --git a/WebCore/WebCore.pro b/WebCore/WebCore.pro
index 9a9a3e5..e595f3b 100644
--- a/WebCore/WebCore.pro
+++ b/WebCore/WebCore.pro
@@ -128,7 +128,7 @@ CONFIG(release):!CONFIG(standalone_package) {
DEFINES += BUILD_WEBKIT
# Remove whole program optimizations due to miscompilations
-win32-msvc2005|win32-msvc2008:{
+win32-msvc2005|win32-msvc2008|wince*:{
QMAKE_CFLAGS_RELEASE -= -GL
QMAKE_CXXFLAGS_RELEASE -= -GL
}
@@ -403,7 +403,8 @@ v8 {
bindings/v8/custom/V8InjectedScriptHostCustom.cpp \
bindings/v8/custom/V8InspectorFrontendHostCustom.cpp \
bindings/v8/custom/V8CustomEventListener.cpp \
- bindings/v8/custom/V8DOMStringMapCustom.cpp
+ bindings/v8/custom/V8DOMStringMapCustom.cpp \
+ bindings/v8/custom/V8DOMTokenListCustom.cpp
SOURCES += \
bindings/v8/custom/V8CustomSQLStatementErrorCallback.cpp \
@@ -835,13 +836,23 @@ SOURCES += \
history/qt/HistoryItemQt.cpp \
history/PageCache.cpp \
html/AsyncImageResizer.cpp \
+ html/BaseTextInputType.cpp \
+ html/ButtonInputType.cpp \
+ html/CheckboxInputType.cpp \
html/CollectionCache.cpp \
+ html/ColorInputType.cpp \
html/DOMDataGridDataSource.cpp \
html/DOMFormData.cpp \
+ html/DOMTokenList.cpp \
html/DataGridColumn.cpp \
html/DataGridColumnList.cpp \
html/DateComponents.cpp \
+ html/DateInputType.cpp \
+ html/DateTimeInputType.cpp \
+ html/DateTimeLocalInputType.cpp \
+ html/EmailInputType.cpp \
html/FTPDirectoryDocument.cpp \
+ html/FileInputType.cpp \
html/FormDataList.cpp \
html/HTMLAllCollection.cpp \
html/HTMLAnchorElement.cpp \
@@ -924,15 +935,33 @@ SOURCES += \
html/HTMLTitleElement.cpp \
html/HTMLUListElement.cpp \
html/HTMLViewSourceDocument.cpp \
+ html/HiddenInputType.cpp \
html/ImageData.cpp \
html/ImageDocument.cpp \
+ html/ImageInputType.cpp \
html/ImageResizerThread.cpp \
+ html/InputType.cpp \
+ html/IsIndexInputType.cpp \
html/LabelsNodeList.cpp \
html/MediaDocument.cpp \
+ html/MonthInputType.cpp \
+ html/NumberInputType.cpp \
+ html/PasswordInputType.cpp \
html/PluginDocument.cpp \
+ html/RadioInputType.cpp \
+ html/RangeInputType.cpp \
+ html/ResetInputType.cpp \
+ html/SearchInputType.cpp \
html/StepRange.cpp \
+ html/SubmitInputType.cpp \
+ html/TelephoneInputType.cpp \
html/TextDocument.cpp \
+ html/TextFieldInputType.cpp \
+ html/TextInputType.cpp \
+ html/TimeInputType.cpp \
+ html/URLInputType.cpp \
html/ValidityState.cpp \
+ html/WeekInputType.cpp \
html/canvas/CanvasGradient.cpp \
html/canvas/CanvasPattern.cpp \
html/canvas/CanvasPixelArray.cpp \
@@ -1095,6 +1124,7 @@ SOURCES += \
platform/graphics/FontFamily.cpp \
platform/graphics/BitmapImage.cpp \
platform/graphics/Color.cpp \
+ platform/graphics/ContextShadow.cpp \
platform/graphics/FloatPoint3D.cpp \
platform/graphics/FloatPoint.cpp \
platform/graphics/FloatQuad.cpp \
@@ -1715,6 +1745,7 @@ HEADERS += \
html/DateComponents.h \
html/DOMDataGridDataSource.h \
html/DOMFormData.h \
+ html/DOMTokenList.h \
html/FormDataList.h \
html/FTPDirectoryDocument.h \
html/HTMLAllCollection.h \
@@ -1977,12 +2008,25 @@ HEADERS += \
platform/mock/SpeechInputClientMock.h \
platform/graphics/BitmapImage.h \
platform/graphics/Color.h \
+ platform/graphics/ContextShadow.h \
platform/graphics/filters/FEBlend.h \
platform/graphics/filters/FEColorMatrix.h \
platform/graphics/filters/FEComponentTransfer.h \
platform/graphics/filters/FEComposite.h \
+ platform/graphics/filters/FEConvolveMatrix.h \
+ platform/graphics/filters/FEDiffuseLighting.h \
+ platform/graphics/filters/FEDisplacementMap.h \
+ platform/graphics/filters/FEFlood.h \
platform/graphics/filters/FEGaussianBlur.h \
+ platform/graphics/filters/FELighting.h \
+ platform/graphics/filters/FEMerge.h \
+ platform/graphics/filters/FEMorphology.h \
+ platform/graphics/filters/FEOffset.h \
+ platform/graphics/filters/FESpecularLighting.h \
+ platform/graphics/filters/FETile.h \
+ platform/graphics/filters/FETurbulence.h \
platform/graphics/filters/FilterEffect.h \
+ platform/graphics/filters/LightSource.h \
platform/graphics/filters/SourceAlpha.h \
platform/graphics/filters/SourceGraphic.h \
platform/graphics/FloatPoint3D.h \
@@ -2010,7 +2054,6 @@ HEADERS += \
platform/graphics/PathTraversalState.h \
platform/graphics/Pattern.h \
platform/graphics/Pen.h \
- platform/graphics/qt/ContextShadow.h \
platform/graphics/qt/FontCustomPlatformData.h \
platform/graphics/qt/GraphicsLayerQt.h \
platform/graphics/qt/ImageDecoderQt.h \
@@ -2274,21 +2317,9 @@ HEADERS += \
svg/animation/SMILTime.h \
svg/animation/SVGSMILElement.h \
svg/ColorDistance.h \
- svg/graphics/filters/SVGFEConvolveMatrix.h \
- svg/graphics/filters/SVGFEDiffuseLighting.h \
- svg/graphics/filters/SVGFEDisplacementMap.h \
- svg/graphics/filters/SVGFEFlood.h \
svg/graphics/filters/SVGFEImage.h \
- svg/graphics/filters/SVGFELighting.h \
- svg/graphics/filters/SVGFEMerge.h \
- svg/graphics/filters/SVGFEMorphology.h \
- svg/graphics/filters/SVGFEOffset.h \
- svg/graphics/filters/SVGFESpecularLighting.h \
- svg/graphics/filters/SVGFETile.h \
- svg/graphics/filters/SVGFETurbulence.h \
svg/graphics/filters/SVGFilterBuilder.h \
svg/graphics/filters/SVGFilter.h \
- svg/graphics/filters/SVGLightSource.h \
svg/graphics/SVGImage.h \
svg/SVGAElement.h \
svg/SVGAltGlyphElement.h \
@@ -2503,6 +2534,7 @@ HEADERS += \
xml/XSLTProcessor.h \
xml/XSLTUnicodeSort.h \
$$PWD/../WebKit/qt/Api/qwebplugindatabase_p.h \
+ $$PWD/../WebKit/qt/WebCoreSupport/InspectorServerQt.h \
$$PWD/../WebKit/qt/WebCoreSupport/QtFallbackWebPopup.h \
$$PWD/../WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h \
$$PWD/../WebKit/qt/WebCoreSupport/FrameNetworkingContextQt.h \
@@ -2535,7 +2567,7 @@ SOURCES += \
page/qt/FrameQt.cpp \
platform/graphics/qt/TransformationMatrixQt.cpp \
platform/graphics/qt/ColorQt.cpp \
- platform/graphics/qt/ContextShadow.cpp \
+ platform/graphics/qt/ContextShadowQt.cpp \
platform/graphics/qt/FontQt.cpp \
platform/graphics/qt/FontPlatformDataQt.cpp \
platform/graphics/qt/FloatPointQt.cpp \
@@ -2609,6 +2641,7 @@ SOURCES += \
../WebKit/qt/WebCoreSupport/FrameNetworkingContextQt.cpp \
../WebKit/qt/WebCoreSupport/GeolocationPermissionClientQt.cpp \
../WebKit/qt/WebCoreSupport/InspectorClientQt.cpp \
+ ../WebKit/qt/WebCoreSupport/InspectorServerQt.cpp \
../WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.cpp \
../WebKit/qt/WebCoreSupport/PageClientQt.cpp \
../WebKit/qt/WebCoreSupport/PopupMenuQt.cpp \
@@ -2705,6 +2738,9 @@ contains(DEFINES, ENABLE_NETSCAPE_PLUGIN_API=1) {
maemo5 {
DEFINES += MOZ_PLATFORM_MAEMO=5
}
+ contains(DEFINES, Q_WS_MAEMO_6) {
+ DEFINES += MOZ_PLATFORM_MAEMO=6
+ }
SOURCES += \
plugins/qt/PluginContainerQt.cpp \
plugins/qt/PluginPackageQt.cpp \
@@ -3034,7 +3070,7 @@ contains(DEFINES, ENABLE_VIDEO=1) {
bindings/js/JSAudioConstructor.cpp
}
- !lessThan(QT_MINOR_VERSION, 6):contains(MOBILITY_CONFIG, multimedia) {
+ contains(MOBILITY_CONFIG, multimedia) {
HEADERS += platform/graphics/qt/MediaPlayerPrivateQt.h
SOURCES += platform/graphics/qt/MediaPlayerPrivateQt.cpp
@@ -3106,8 +3142,20 @@ contains(DEFINES, ENABLE_FILTERS=1) {
platform/graphics/filters/FEColorMatrix.cpp \
platform/graphics/filters/FEComponentTransfer.cpp \
platform/graphics/filters/FEComposite.cpp \
+ platform/graphics/filters/FEConvolveMatrix.cpp \
+ platform/graphics/filters/FEDiffuseLighting.cpp \
+ platform/graphics/filters/FEDisplacementMap.cpp \
+ platform/graphics/filters/FEFlood.cpp \
platform/graphics/filters/FEGaussianBlur.cpp \
+ platform/graphics/filters/FELighting.cpp \
+ platform/graphics/filters/FEMerge.cpp \
+ platform/graphics/filters/FEMorphology.cpp \
+ platform/graphics/filters/FEOffset.cpp \
+ platform/graphics/filters/FESpecularLighting.cpp \
+ platform/graphics/filters/FETile.cpp \
+ platform/graphics/filters/FETurbulence.cpp \
platform/graphics/filters/FilterEffect.cpp \
+ platform/graphics/filters/LightSource.cpp \
platform/graphics/filters/SourceAlpha.cpp \
platform/graphics/filters/SourceGraphic.cpp
}
@@ -3376,21 +3424,9 @@ contains(DEFINES, ENABLE_SVG=1) {
svg/animation/SMILTime.cpp \
svg/animation/SMILTimeContainer.cpp \
svg/animation/SVGSMILElement.cpp \
- svg/graphics/filters/SVGFEConvolveMatrix.cpp \
- svg/graphics/filters/SVGFEDiffuseLighting.cpp \
- svg/graphics/filters/SVGFEDisplacementMap.cpp \
- svg/graphics/filters/SVGFEFlood.cpp \
svg/graphics/filters/SVGFEImage.cpp \
- svg/graphics/filters/SVGFELighting.cpp \
- svg/graphics/filters/SVGFEMerge.cpp \
- svg/graphics/filters/SVGFEMorphology.cpp \
- svg/graphics/filters/SVGFEOffset.cpp \
- svg/graphics/filters/SVGFESpecularLighting.cpp \
- svg/graphics/filters/SVGFETile.cpp \
- svg/graphics/filters/SVGFETurbulence.cpp \
svg/graphics/filters/SVGFilter.cpp \
svg/graphics/filters/SVGFilterBuilder.cpp \
- svg/graphics/filters/SVGLightSource.cpp \
svg/graphics/SVGImage.cpp \
rendering/RenderForeignObject.cpp \
rendering/RenderPath.cpp \
@@ -3684,7 +3720,7 @@ HEADERS += $$WEBKIT_API_HEADERS
}
}
-CONFIG(QTDIR_build) {
+!CONFIG(webkit-debug):CONFIG(QTDIR_build) {
# Remove the following 2 lines if you want debug information in WebCore
CONFIG -= separate_debug_info
CONFIG += no_debug_info
diff --git a/WebCore/WebCore.vcproj/WebCore.vcproj b/WebCore/WebCore.vcproj/WebCore.vcproj
index 414a67d..1971e15 100644
--- a/WebCore/WebCore.vcproj/WebCore.vcproj
+++ b/WebCore/WebCore.vcproj/WebCore.vcproj
@@ -545,6 +545,26 @@
>
</File>
<File
+ RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\HashTools.h"
+ >
+ </File>
+ <File
+ RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\DocTypeStrings.cpp"
+ >
+ </File>
+ <File
+ RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\CSSValueKeywords.cpp"
+ >
+ </File>
+ <File
+ RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\CSSPropertyNames.cpp"
+ >
+ </File>
+ <File
+ RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\ColorData.cpp"
+ >
+ </File>
+ <File
RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\InspectorBackendDispatcher.cpp"
>
</File>
@@ -4033,6 +4053,14 @@
>
</File>
<File
+ RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSDOMTokenList.cpp"
+ >
+ </File>
+ <File
+ RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSDOMTokenList.h"
+ >
+ </File>
+ <File
RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSDOMWindow.cpp"
>
<FileConfiguration
@@ -5300,7 +5328,7 @@
RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSGeoposition.h"
>
</File>
- <File
+ <File
RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSHashChangeEvent.cpp"
>
<FileConfiguration
@@ -26363,6 +26391,78 @@
</FileConfiguration>
</File>
<File
+ RelativePath="..\platform\graphics\cairo\CairoUtilities.cpp"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug_Internal|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug_All|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\platform\graphics\cairo\CairoUtilities.h"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug_Internal|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug_All|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ </FileConfiguration>
+ </File>
+ <File
RelativePath="..\platform\graphics\cairo\DrawErrorUnderline.h"
>
<FileConfiguration
@@ -26687,6 +26787,42 @@
</FileConfiguration>
</File>
<File
+ RelativePath="..\platform\graphics\cairo\OwnPtrCairo.h"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug_Internal|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug_All|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ </FileConfiguration>
+ </File>
+ <File
RelativePath="..\platform\graphics\cairo\PathCairo.cpp"
>
<FileConfiguration
@@ -26795,6 +26931,42 @@
</FileConfiguration>
</File>
<File
+ RelativePath="..\platform\graphics\cairo\PlatformRefPtrCairo.h"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug_Internal|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug_All|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ </FileConfiguration>
+ </File>
+ <File
RelativePath="..\platform\graphics\cairo\TransformationMatrixCairo.cpp"
>
<FileConfiguration
@@ -26927,6 +27099,10 @@
Name="filters"
>
<File
+ RelativePath="..\platform\graphics\filters\DistantLightSource.h"
+ >
+ </File>
+ <File
RelativePath="..\platform\graphics\filters\FEBlend.cpp"
>
</File>
@@ -26959,6 +27135,38 @@
>
</File>
<File
+ RelativePath="..\platform\graphics\filters\FEConvolveMatrix.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\platform\graphics\filters\FEConvolveMatrix.h"
+ >
+ </File>
+ <File
+ RelativePath="..\platform\graphics\filters\FEDiffuseLighting.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\platform\graphics\filters\FEDiffuseLighting.h"
+ >
+ </File>
+ <File
+ RelativePath="..\platform\graphics\filters\FEDisplacementMap.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\platform\graphics\filters\FEDisplacementMap.h"
+ >
+ </File>
+ <File
+ RelativePath="..\platform\graphics\filters\FEFlood.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\platform\graphics\filters\FEFlood.h"
+ >
+ </File>
+ <File
RelativePath="..\platform\graphics\filters\FEGaussianBlur.cpp"
>
</File>
@@ -26967,6 +27175,62 @@
>
</File>
<File
+ RelativePath="..\platform\graphics\filters\FELighting.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\platform\graphics\filters\FELighting.h"
+ >
+ </File>
+ <File
+ RelativePath="..\platform\graphics\filters\FEMerge.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\platform\graphics\filters\FEMerge.h"
+ >
+ </File>
+ <File
+ RelativePath="..\platform\graphics\filters\FEMorphology.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\platform\graphics\filters\FEMorphology.h"
+ >
+ </File>
+ <File
+ RelativePath="..\platform\graphics\filters\FEOffset.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\platform\graphics\filters\FEOffset.h"
+ >
+ </File>
+ <File
+ RelativePath="..\platform\graphics\filters\FESpecularLighting.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\platform\graphics\filters\FESpecularLighting.h"
+ >
+ </File>
+ <File
+ RelativePath="..\platform\graphics\filters\FETile.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\platform\graphics\filters\FETile.h"
+ >
+ </File>
+ <File
+ RelativePath="..\platform\graphics\filters\FETurbulence.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\platform\graphics\filters\FETurbulence.h"
+ >
+ </File>
+ <File
RelativePath="..\platform\graphics\filters\Filter.h"
>
</File>
@@ -26987,6 +27251,18 @@
>
</File>
<File
+ RelativePath="..\platform\graphics\filters\LightSource.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\platform\graphics\filters\LightSource.h"
+ >
+ </File>
+ <File
+ RelativePath="..\platform\graphics\filters\PointLightSource.h"
+ >
+ </File>
+ <File
RelativePath="..\platform\graphics\filters\SourceAlpha.cpp"
>
</File>
@@ -27002,6 +27278,10 @@
RelativePath="..\platform\graphics\filters\SourceGraphic.h"
>
</File>
+ <File
+ RelativePath="..\platform\graphics\filters\SpotLightSource.h"
+ >
+ </File>
</Filter>
</Filter>
<Filter
@@ -33985,11 +34265,11 @@
>
</File>
<File
- RelativePath="..\dom\InputElement.cpp"
+ RelativePath="..\dom\HashChangeEvent.h"
>
</File>
<File
- RelativePath="..\dom\HashChangeEvent.h"
+ RelativePath="..\dom\InputElement.cpp"
>
</File>
<File
@@ -37289,6 +37569,10 @@
>
</File>
<File
+ RelativePath="..\fileapi\AsyncFileWriterClient.h"
+ >
+ </File>
+ <File
RelativePath="..\html\AsyncImageResizer.cpp"
>
</File>
@@ -37297,6 +37581,14 @@
>
</File>
<File
+ RelativePath="..\html\BaseTextInputType.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\html\BaseTextInputType.h"
+ >
+ </File>
+ <File
RelativePath="..\fileapi\Blob.cpp"
>
</File>
@@ -37321,6 +37613,14 @@
>
</File>
<File
+ RelativePath="..\html\ButtonInputType.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\html\ButtonInputType.h"
+ >
+ </File>
+ <File
RelativePath="..\html\canvas\CanvasGradient.cpp"
>
</File>
@@ -37369,6 +37669,14 @@
>
</File>
<File
+ RelativePath="..\html\CheckboxInputType.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\html\CheckboxInputType.h"
+ >
+ </File>
+ <File
RelativePath="..\html\CollectionCache.cpp"
>
<FileConfiguration
@@ -37389,6 +37697,14 @@
>
</File>
<File
+ RelativePath="..\html\ColorInputType.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\html\ColorInputType.h"
+ >
+ </File>
+ <File
RelativePath="..\html\DataGridColumn.cpp"
>
</File>
@@ -37417,6 +37733,30 @@
>
</File>
<File
+ RelativePath="..\html\DateInputType.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\html\DateInputType.h"
+ >
+ </File>
+ <File
+ RelativePath="..\html\DateTimeInputType.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\html\DateTimeInputType.h"
+ >
+ </File>
+ <File
+ RelativePath="..\html\DateTimeLocalInputType.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\html\DateTimeLocalInputType.h"
+ >
+ </File>
+ <File
RelativePath="..\fileapi\DirectoryEntry.cpp"
>
</File>
@@ -37465,6 +37805,14 @@
>
</File>
<File
+ RelativePath="..\html\EmailInputType.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\html\EmailInputType.h"
+ >
+ </File>
+ <File
RelativePath="..\fileapi\EntriesCallback.h"
>
</File>
@@ -37525,6 +37873,14 @@
>
</File>
<File
+ RelativePath="..\html\FileInputType.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\html\FileInputType.h"
+ >
+ </File>
+ <File
RelativePath="..\fileapi\FileList.cpp"
>
</File>
@@ -37593,10 +37949,6 @@
>
</File>
<File
- RelativePath="..\fileapi\FileWriterClient.h"
- >
- </File>
- <File
RelativePath="..\fileapi\Flags.h"
>
</File>
@@ -37613,6 +37965,18 @@
>
</File>
<File
+ RelativePath="..\html\DOMTokenList.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\html\DOMTokenList.h"
+ >
+ </File>
+ <File
+ RelativePath="..\html\FormDataList.cpp"
+ >
+ </File>
+ <File
RelativePath="..\html\FTPDirectoryDocument.h"
>
</File>
@@ -41965,6 +42329,14 @@
>
</File>
<File
+ RelativePath="..\html\HiddenInputType.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\html\HiddenInputType.h"
+ >
+ </File>
+ <File
RelativePath="..\html\ImageData.cpp"
>
</File>
@@ -41981,6 +42353,14 @@
>
</File>
<File
+ RelativePath="..\html\ImageInputType.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\html\ImageInputType.h"
+ >
+ </File>
+ <File
RelativePath="..\html\ImageResizerThread.cpp"
>
</File>
@@ -41989,6 +42369,22 @@
>
</File>
<File
+ RelativePath="..\html\InputType.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\html\InputType.h"
+ >
+ </File>
+ <File
+ RelativePath="..\html\IsIndexInputType.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\html\IsIndexInputType.h"
+ >
+ </File>
+ <File
RelativePath="..\html\LabelsNodeList.cpp"
>
</File>
@@ -42025,6 +42421,30 @@
>
</File>
<File
+ RelativePath="..\html\MonthInputType.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\html\MonthInputType.h"
+ >
+ </File>
+ <File
+ RelativePath="..\html\NumberInputType.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\html\NumberInputType.h"
+ >
+ </File>
+ <File
+ RelativePath="..\html\PasswordInputType.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\html\PasswordInputType.h"
+ >
+ </File>
+ <File
RelativePath="..\html\PluginDocument.cpp"
>
</File>
@@ -42033,6 +42453,38 @@
>
</File>
<File
+ RelativePath="..\html\RadioInputType.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\html\RadioInputType.h"
+ >
+ </File>
+ <File
+ RelativePath="..\html\RangeInputType.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\html\RangeInputType.h"
+ >
+ </File>
+ <File
+ RelativePath="..\html\ResetInputType.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\html\ResetInputType.h"
+ >
+ </File>
+ <File
+ RelativePath="..\html\SearchInputType.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\html\SearchInputType.h"
+ >
+ </File>
+ <File
RelativePath="..\html\StepRange.cpp"
>
</File>
@@ -42041,10 +42493,42 @@
>
</File>
<File
+ RelativePath="..\html\SubmitInputType.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\html\SubmitInputType.h"
+ >
+ </File>
+ <File
+ RelativePath="..\html\TelephoneInputType.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\html\TelephoneInputType.h"
+ >
+ </File>
+ <File
RelativePath="..\html\TextDocument.cpp"
>
</File>
<File
+ RelativePath="..\html\TextFieldInputType.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\html\TextFieldInputType.h"
+ >
+ </File>
+ <File
+ RelativePath="..\html\TextInputType.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\html\TextInputType.h"
+ >
+ </File>
+ <File
RelativePath="..\fileapi\ThreadableBlobRegistry.cpp"
>
</File>
@@ -42053,6 +42537,14 @@
>
</File>
<File
+ RelativePath="..\html\TimeInputType.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\html\TimeInputType.h"
+ >
+ </File>
+ <File
RelativePath="..\html\TimeRanges.cpp"
>
</File>
@@ -42061,6 +42553,14 @@
>
</File>
<File
+ RelativePath="..\html\URLInputType.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\html\URLInputType.h"
+ >
+ </File>
+ <File
RelativePath="..\html\ValidityState.cpp"
>
</File>
@@ -42072,6 +42572,14 @@
RelativePath="..\html\VoidCallback.h"
>
</File>
+ <File
+ RelativePath="..\html\WeekInputType.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\html\WeekInputType.h"
+ >
+ </File>
<Filter
Name="parser"
>
@@ -43896,6 +44404,10 @@
</FileConfiguration>
</File>
<File
+ RelativePath="..\bindings\js\JSDirectoryEntryCustom.cpp"
+ >
+ </File>
+ <File
RelativePath="..\bindings\js\JSDocumentCustom.cpp"
>
<FileConfiguration
@@ -46868,10 +47380,6 @@
>
</File>
<File
- RelativePath="..\bindings\js\JSDirectoryEntryCustom.cpp"
- >
- </File>
- <File
RelativePath="..\bindings\js\JSImageConstructor.cpp"
>
<FileConfiguration
@@ -51163,42 +51671,6 @@
Name="filters"
>
<File
- RelativePath="..\svg\graphics\filters\SVGDistantLightSource.h"
- >
- </File>
- <File
- RelativePath="..\svg\graphics\filters\SVGFEConvolveMatrix.cpp"
- >
- </File>
- <File
- RelativePath="..\svg\graphics\filters\SVGFEConvolveMatrix.h"
- >
- </File>
- <File
- RelativePath="..\svg\graphics\filters\SVGFEDiffuseLighting.cpp"
- >
- </File>
- <File
- RelativePath="..\svg\graphics\filters\SVGFEDiffuseLighting.h"
- >
- </File>
- <File
- RelativePath="..\svg\graphics\filters\SVGFEDisplacementMap.cpp"
- >
- </File>
- <File
- RelativePath="..\svg\graphics\filters\SVGFEDisplacementMap.h"
- >
- </File>
- <File
- RelativePath="..\svg\graphics\filters\SVGFEFlood.cpp"
- >
- </File>
- <File
- RelativePath="..\svg\graphics\filters\SVGFEFlood.h"
- >
- </File>
- <File
RelativePath="..\svg\graphics\filters\SVGFEImage.cpp"
>
</File>
@@ -51207,62 +51679,6 @@
>
</File>
<File
- RelativePath="..\svg\graphics\filters\SVGFELighting.cpp"
- >
- </File>
- <File
- RelativePath="..\svg\graphics\filters\SVGFELighting.h"
- >
- </File>
- <File
- RelativePath="..\svg\graphics\filters\SVGFEMerge.cpp"
- >
- </File>
- <File
- RelativePath="..\svg\graphics\filters\SVGFEMerge.h"
- >
- </File>
- <File
- RelativePath="..\svg\graphics\filters\SVGFEMorphology.cpp"
- >
- </File>
- <File
- RelativePath="..\svg\graphics\filters\SVGFEMorphology.h"
- >
- </File>
- <File
- RelativePath="..\svg\graphics\filters\SVGFEOffset.cpp"
- >
- </File>
- <File
- RelativePath="..\svg\graphics\filters\SVGFEOffset.h"
- >
- </File>
- <File
- RelativePath="..\svg\graphics\filters\SVGFESpecularLighting.cpp"
- >
- </File>
- <File
- RelativePath="..\svg\graphics\filters\SVGFESpecularLighting.h"
- >
- </File>
- <File
- RelativePath="..\svg\graphics\filters\SVGFETile.cpp"
- >
- </File>
- <File
- RelativePath="..\svg\graphics\filters\SVGFETile.h"
- >
- </File>
- <File
- RelativePath="..\svg\graphics\filters\SVGFETurbulence.cpp"
- >
- </File>
- <File
- RelativePath="..\svg\graphics\filters\SVGFETurbulence.h"
- >
- </File>
- <File
RelativePath="..\svg\graphics\filters\SVGFilter.cpp"
>
</File>
@@ -51278,22 +51694,6 @@
RelativePath="..\svg\graphics\filters\SVGFilterBuilder.h"
>
</File>
- <File
- RelativePath="..\svg\graphics\filters\SVGLightSource.cpp"
- >
- </File>
- <File
- RelativePath="..\svg\graphics\filters\SVGLightSource.h"
- >
- </File>
- <File
- RelativePath="..\svg\graphics\filters\SVGPointLightSource.h"
- >
- </File>
- <File
- RelativePath="..\svg\graphics\filters\SVGSpotLightSource.h"
- >
- </File>
</Filter>
</Filter>
</Filter>
@@ -52416,10 +52816,6 @@
Name="front-end"
>
<File
- RelativePath="..\inspector\front-end\AbstractTimelinePanel.js"
- >
- </File>
- <File
RelativePath="..\inspector\front-end\ApplicationCacheItemsView.js"
>
</File>
@@ -52576,6 +52972,14 @@
>
</File>
<File
+ RelativePath="..\inspector\front-end\GoToLineDialog.js"
+ >
+ </File>
+ <File
+ RelativePath="..\inspector\front-end\goToLineDialog.css"
+ >
+ </File>
+ <File
RelativePath="..\inspector\front-end\HAREntry.js"
>
</File>
@@ -52632,6 +53036,14 @@
>
</File>
<File
+ RelativePath="..\inspector\front-end\NetworkPanel.js"
+ >
+ </File>
+ <File
+ RelativePath="..\inspector\front-end\networkPanel.css"
+ >
+ </File>
+ <File
RelativePath="..\inspector\front-end\Object.js"
>
</File>
diff --git a/WebCore/WebCore.xcodeproj/project.pbxproj b/WebCore/WebCore.xcodeproj/project.pbxproj
index 735e9d5..d104455 100644
--- a/WebCore/WebCore.xcodeproj/project.pbxproj
+++ b/WebCore/WebCore.xcodeproj/project.pbxproj
@@ -495,6 +495,10 @@
1AB7FC860A8B92EC00D9D37B /* XPathValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AB7FC650A8B92EC00D9D37B /* XPathValue.h */; };
1AB7FC870A8B92EC00D9D37B /* XPathVariableReference.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AB7FC660A8B92EC00D9D37B /* XPathVariableReference.cpp */; };
1AB7FC880A8B92EC00D9D37B /* XPathVariableReference.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AB7FC670A8B92EC00D9D37B /* XPathVariableReference.h */; };
+ 1ABA76C911D20E47004C201C /* ColorData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E406F3FB1198307D009D59D6 /* ColorData.cpp */; };
+ 1ABA76CA11D20E50004C201C /* CSSPropertyNames.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E41EA038119836DB00710BC5 /* CSSPropertyNames.cpp */; };
+ 1ABA76CB11D20E57004C201C /* CSSValueKeywords.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E41EA0391198374900710BC5 /* CSSValueKeywords.cpp */; };
+ 1ABA76CC11D20E5B004C201C /* DocTypeStrings.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E406F3FA1198304D009D59D6 /* DocTypeStrings.cpp */; };
1ABFE7530CD968D000FE4834 /* SQLTransaction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1ABFE7520CD968D000FE4834 /* SQLTransaction.cpp */; };
1AC2260C0DB69F190089B669 /* JSDOMApplicationCache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC2260A0DB69F190089B669 /* JSDOMApplicationCache.cpp */; };
1AC2260D0DB69F190089B669 /* JSDOMApplicationCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AC2260B0DB69F190089B669 /* JSDOMApplicationCache.h */; };
@@ -822,6 +826,8 @@
37C238221098C84200EF9F72 /* ComplexTextControllerCoreText.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 37C238201098C84200EF9F72 /* ComplexTextControllerCoreText.cpp */; };
37C28A6810F659CC008C7813 /* TypesettingFeatures.h in Headers */ = {isa = PBXBuildFile; fileRef = 37C28A6710F659CC008C7813 /* TypesettingFeatures.h */; settings = {ATTRIBUTES = (Private, ); }; };
37C61F0112095C87007A3C67 /* AtomicStringKeyedMRUCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 37C61F0012095C87007A3C67 /* AtomicStringKeyedMRUCache.h */; };
+ 37E3524B12450C5200BAF5D9 /* InputType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 37E3524A12450C5200BAF5D9 /* InputType.cpp */; };
+ 37E3524D12450C6600BAF5D9 /* InputType.h in Headers */ = {isa = PBXBuildFile; fileRef = 37E3524C12450C6600BAF5D9 /* InputType.h */; settings = {ATTRIBUTES = (Private, ); }; };
37F818FD0D657606005E1F05 /* WebCoreURLResponse.h in Headers */ = {isa = PBXBuildFile; fileRef = 37F818FB0D657606005E1F05 /* WebCoreURLResponse.h */; settings = {ATTRIBUTES = (Private, ); }; };
37F818FE0D657606005E1F05 /* WebCoreURLResponse.mm in Sources */ = {isa = PBXBuildFile; fileRef = 37F818FC0D657606005E1F05 /* WebCoreURLResponse.mm */; };
37FD4298118368460093C029 /* TreeDepthLimit.h in Headers */ = {isa = PBXBuildFile; fileRef = 37FD4297118368460093C029 /* TreeDepthLimit.h */; };
@@ -1327,7 +1333,7 @@
6596F2C10B87325C001326BD /* DOMHTMLTextAreaElementInternal.h in Copy Generated Headers */ = {isa = PBXBuildFile; fileRef = 85E7117F0AC5D5350053270F /* DOMHTMLTextAreaElementInternal.h */; };
659A7D130B6DB4D9001155B3 /* SubstituteData.h in Headers */ = {isa = PBXBuildFile; fileRef = 659A7D120B6DB4D9001155B3 /* SubstituteData.h */; settings = {ATTRIBUTES = (Private, ); }; };
659DDC8209E198BA001BF3C6 /* JSDocument.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 659DDC8009E198BA001BF3C6 /* JSDocument.cpp */; };
- 659DDC8309E198BA001BF3C6 /* JSDocument.h in Headers */ = {isa = PBXBuildFile; fileRef = 659DDC8109E198BA001BF3C6 /* JSDocument.h */; };
+ 659DDC8309E198BA001BF3C6 /* JSDocument.h in Headers */ = {isa = PBXBuildFile; fileRef = 659DDC8109E198BA001BF3C6 /* JSDocument.h */; settings = {ATTRIBUTES = (Private, ); }; };
65A21468097A329100B9050A /* Page.h in Headers */ = {isa = PBXBuildFile; fileRef = 65A21467097A329100B9050A /* Page.h */; settings = {ATTRIBUTES = (Private, ); }; };
65A21484097A3F5300B9050A /* FrameTree.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 65A21482097A3F5300B9050A /* FrameTree.cpp */; };
65A21485097A3F5300B9050A /* FrameTree.h in Headers */ = {isa = PBXBuildFile; fileRef = 65A21483097A3F5300B9050A /* FrameTree.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -1412,12 +1418,18 @@
7693BAD3106C2DCA007B0823 /* PluginHalter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7693BACF106C2DCA007B0823 /* PluginHalter.cpp */; };
7693BAD4106C2DCA007B0823 /* PluginHalter.h in Headers */ = {isa = PBXBuildFile; fileRef = 7693BAD0106C2DCA007B0823 /* PluginHalter.h */; };
7693BAD5106C2DCA007B0823 /* PluginHalterClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 7693BAD1106C2DCA007B0823 /* PluginHalterClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 7694563C1214D97C0007CBAE /* JSDOMTokenList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7694563A1214D97C0007CBAE /* JSDOMTokenList.cpp */; };
+ 7694563D1214D97C0007CBAE /* JSDOMTokenList.h in Headers */ = {isa = PBXBuildFile; fileRef = 7694563B1214D97C0007CBAE /* JSDOMTokenList.h */; };
+ 7694565B1214DB630007CBAE /* DOMDOMTokenList.h in Headers */ = {isa = PBXBuildFile; fileRef = 769456591214DB630007CBAE /* DOMDOMTokenList.h */; };
+ 7694565C1214DB630007CBAE /* DOMDOMTokenList.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7694565A1214DB630007CBAE /* DOMDOMTokenList.mm */; };
76CDD2F21103DA6600680521 /* AccessibilityMenuList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 76CDD2EC1103DA6600680521 /* AccessibilityMenuList.cpp */; };
76CDD2F31103DA6600680521 /* AccessibilityMenuList.h in Headers */ = {isa = PBXBuildFile; fileRef = 76CDD2ED1103DA6600680521 /* AccessibilityMenuList.h */; };
76CDD2F41103DA6600680521 /* AccessibilityMenuListPopup.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 76CDD2EE1103DA6600680521 /* AccessibilityMenuListPopup.cpp */; };
76CDD2F51103DA6600680521 /* AccessibilityMenuListPopup.h in Headers */ = {isa = PBXBuildFile; fileRef = 76CDD2EF1103DA6600680521 /* AccessibilityMenuListPopup.h */; };
76CDD2F61103DA6600680521 /* AccessibilityMenuListOption.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 76CDD2F01103DA6600680521 /* AccessibilityMenuListOption.cpp */; };
76CDD2F71103DA6600680521 /* AccessibilityMenuListOption.h in Headers */ = {isa = PBXBuildFile; fileRef = 76CDD2F11103DA6600680521 /* AccessibilityMenuListOption.h */; };
+ 76FC2B0B12370DA0006A991A /* DOMTokenList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 76FC2B0812370DA0006A991A /* DOMTokenList.cpp */; };
+ 76FC2B0C12370DA0006A991A /* DOMTokenList.h in Headers */ = {isa = PBXBuildFile; fileRef = 76FC2B0912370DA0006A991A /* DOMTokenList.h */; };
76FF17E311235673001D61B5 /* PluginViewNone.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 76FF17E211235673001D61B5 /* PluginViewNone.cpp */; };
79AC9218109945C80021266E /* JSCompositionEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 79AC9216109945C80021266E /* JSCompositionEvent.cpp */; };
79AC9219109945C80021266E /* JSCompositionEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 79AC9217109945C80021266E /* JSCompositionEvent.h */; };
@@ -1479,6 +1491,33 @@
845E72F80FD261EE00A87D79 /* Filter.h in Headers */ = {isa = PBXBuildFile; fileRef = 845E72F70FD261EE00A87D79 /* Filter.h */; };
845E72FB0FD2623900A87D79 /* SVGFilter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 845E72F90FD2623900A87D79 /* SVGFilter.cpp */; };
845E72FC0FD2623900A87D79 /* SVGFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = 845E72FA0FD2623900A87D79 /* SVGFilter.h */; };
+ 84730D771248F0B300D3A9C9 /* DistantLightSource.h in Headers */ = {isa = PBXBuildFile; fileRef = 84730D5A1248F0B300D3A9C9 /* DistantLightSource.h */; };
+ 84730D781248F0B300D3A9C9 /* FEConvolveMatrix.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84730D5B1248F0B300D3A9C9 /* FEConvolveMatrix.cpp */; };
+ 84730D791248F0B300D3A9C9 /* FEConvolveMatrix.h in Headers */ = {isa = PBXBuildFile; fileRef = 84730D5C1248F0B300D3A9C9 /* FEConvolveMatrix.h */; };
+ 84730D7A1248F0B300D3A9C9 /* FEDiffuseLighting.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84730D5D1248F0B300D3A9C9 /* FEDiffuseLighting.cpp */; };
+ 84730D7B1248F0B300D3A9C9 /* FEDiffuseLighting.h in Headers */ = {isa = PBXBuildFile; fileRef = 84730D5E1248F0B300D3A9C9 /* FEDiffuseLighting.h */; };
+ 84730D7C1248F0B300D3A9C9 /* FEDisplacementMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84730D5F1248F0B300D3A9C9 /* FEDisplacementMap.cpp */; };
+ 84730D7D1248F0B300D3A9C9 /* FEDisplacementMap.h in Headers */ = {isa = PBXBuildFile; fileRef = 84730D601248F0B300D3A9C9 /* FEDisplacementMap.h */; };
+ 84730D7E1248F0B300D3A9C9 /* FEFlood.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84730D611248F0B300D3A9C9 /* FEFlood.cpp */; };
+ 84730D7F1248F0B300D3A9C9 /* FEFlood.h in Headers */ = {isa = PBXBuildFile; fileRef = 84730D621248F0B300D3A9C9 /* FEFlood.h */; };
+ 84730D801248F0B300D3A9C9 /* FELighting.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84730D631248F0B300D3A9C9 /* FELighting.cpp */; };
+ 84730D811248F0B300D3A9C9 /* FELighting.h in Headers */ = {isa = PBXBuildFile; fileRef = 84730D641248F0B300D3A9C9 /* FELighting.h */; };
+ 84730D821248F0B300D3A9C9 /* FEMerge.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84730D651248F0B300D3A9C9 /* FEMerge.cpp */; };
+ 84730D831248F0B300D3A9C9 /* FEMerge.h in Headers */ = {isa = PBXBuildFile; fileRef = 84730D661248F0B300D3A9C9 /* FEMerge.h */; };
+ 84730D841248F0B300D3A9C9 /* FEMorphology.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84730D671248F0B300D3A9C9 /* FEMorphology.cpp */; };
+ 84730D851248F0B300D3A9C9 /* FEMorphology.h in Headers */ = {isa = PBXBuildFile; fileRef = 84730D681248F0B300D3A9C9 /* FEMorphology.h */; };
+ 84730D861248F0B300D3A9C9 /* FEOffset.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84730D691248F0B300D3A9C9 /* FEOffset.cpp */; };
+ 84730D871248F0B300D3A9C9 /* FEOffset.h in Headers */ = {isa = PBXBuildFile; fileRef = 84730D6A1248F0B300D3A9C9 /* FEOffset.h */; };
+ 84730D881248F0B300D3A9C9 /* FESpecularLighting.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84730D6B1248F0B300D3A9C9 /* FESpecularLighting.cpp */; };
+ 84730D891248F0B300D3A9C9 /* FESpecularLighting.h in Headers */ = {isa = PBXBuildFile; fileRef = 84730D6C1248F0B300D3A9C9 /* FESpecularLighting.h */; };
+ 84730D8A1248F0B300D3A9C9 /* FETile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84730D6D1248F0B300D3A9C9 /* FETile.cpp */; };
+ 84730D8B1248F0B300D3A9C9 /* FETile.h in Headers */ = {isa = PBXBuildFile; fileRef = 84730D6E1248F0B300D3A9C9 /* FETile.h */; };
+ 84730D8C1248F0B300D3A9C9 /* FETurbulence.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84730D6F1248F0B300D3A9C9 /* FETurbulence.cpp */; };
+ 84730D8D1248F0B300D3A9C9 /* FETurbulence.h in Headers */ = {isa = PBXBuildFile; fileRef = 84730D701248F0B300D3A9C9 /* FETurbulence.h */; };
+ 84730D901248F0B300D3A9C9 /* LightSource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84730D731248F0B300D3A9C9 /* LightSource.cpp */; };
+ 84730D911248F0B300D3A9C9 /* LightSource.h in Headers */ = {isa = PBXBuildFile; fileRef = 84730D741248F0B300D3A9C9 /* LightSource.h */; };
+ 84730D921248F0B300D3A9C9 /* PointLightSource.h in Headers */ = {isa = PBXBuildFile; fileRef = 84730D751248F0B300D3A9C9 /* PointLightSource.h */; };
+ 84730D931248F0B300D3A9C9 /* SpotLightSource.h in Headers */ = {isa = PBXBuildFile; fileRef = 84730D761248F0B300D3A9C9 /* SpotLightSource.h */; };
8476C9E511DF6A0B00555B02 /* SVGPathSegListBuilder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8476C9E311DF6A0B00555B02 /* SVGPathSegListBuilder.cpp */; };
8476C9E611DF6A0B00555B02 /* SVGPathSegListBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = 8476C9E411DF6A0B00555B02 /* SVGPathSegListBuilder.h */; };
8476C9EA11DF6A2900555B02 /* SVGPathBuilder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8476C9E711DF6A2900555B02 /* SVGPathBuilder.cpp */; };
@@ -2770,7 +2809,7 @@
976D6C8F122B8A3D001FD1F7 /* FileThreadTask.h in Headers */ = {isa = PBXBuildFile; fileRef = 976D6C70122B8A3D001FD1F7 /* FileThreadTask.h */; };
976D6C90122B8A3D001FD1F7 /* FileWriter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 976D6C71122B8A3D001FD1F7 /* FileWriter.cpp */; };
976D6C91122B8A3D001FD1F7 /* FileWriter.h in Headers */ = {isa = PBXBuildFile; fileRef = 976D6C72122B8A3D001FD1F7 /* FileWriter.h */; };
- 976D6C93122B8A3D001FD1F7 /* FileWriterClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 976D6C74122B8A3D001FD1F7 /* FileWriterClient.h */; };
+ 976D6C93122B8A3D001FD1F7 /* AsyncFileWriterClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 976D6C74122B8A3D001FD1F7 /* AsyncFileWriterClient.h */; };
976D6C94122B8A3D001FD1F7 /* ThreadableBlobRegistry.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 976D6C75122B8A3D001FD1F7 /* ThreadableBlobRegistry.cpp */; };
976D6C95122B8A3D001FD1F7 /* ThreadableBlobRegistry.h in Headers */ = {isa = PBXBuildFile; fileRef = 976D6C76122B8A3D001FD1F7 /* ThreadableBlobRegistry.h */; };
977B37231228721700B81FF8 /* HTMLElementStack.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 977B371F1228721700B81FF8 /* HTMLElementStack.cpp */; };
@@ -2908,7 +2947,6 @@
A7D20F62107F406900A80392 /* JSWebGLActiveInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7D20F60107F406900A80392 /* JSWebGLActiveInfo.cpp */; };
A7D20F63107F406900A80392 /* JSWebGLActiveInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D20F61107F406900A80392 /* JSWebGLActiveInfo.h */; };
A7D20F6D107F438B00A80392 /* WebGLActiveInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D20F6B107F438B00A80392 /* WebGLActiveInfo.h */; };
- A7D27FC40E0A599F0079AD2B /* SVGFETile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7D27FC30E0A599F0079AD2B /* SVGFETile.cpp */; };
A7D3C5240B576B4B002CA450 /* PasteboardHelper.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D3C5230B576B4B002CA450 /* PasteboardHelper.h */; settings = {ATTRIBUTES = (Private, ); }; };
A7D6B3490F61104500B79FD1 /* WorkerScriptLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D6B3470F61104500B79FD1 /* WorkerScriptLoader.h */; };
A7D6B34A0F61104500B79FD1 /* WorkerScriptLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7D6B3480F61104500B79FD1 /* WorkerScriptLoader.cpp */; };
@@ -4048,32 +4086,8 @@
B237C8A80D344D110013F707 /* SVGFontData.h in Headers */ = {isa = PBXBuildFile; fileRef = B237C8A60D344D110013F707 /* SVGFontData.h */; };
B24055650B5BE640002A28C0 /* DOMSVGElementInstanceInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = B24055630B5BE640002A28C0 /* DOMSVGElementInstanceInternal.h */; };
B24055660B5BE640002A28C0 /* DOMSVGElementInstanceListInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = B24055640B5BE640002A28C0 /* DOMSVGElementInstanceListInternal.h */; };
- B25599710D00D8BA00BB825C /* SVGDistantLightSource.h in Headers */ = {isa = PBXBuildFile; fileRef = B25598D70D00D8B900BB825C /* SVGDistantLightSource.h */; };
- B255997A0D00D8BA00BB825C /* SVGFEConvolveMatrix.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B25598E00D00D8B900BB825C /* SVGFEConvolveMatrix.cpp */; };
- B255997B0D00D8BA00BB825C /* SVGFEConvolveMatrix.h in Headers */ = {isa = PBXBuildFile; fileRef = B25598E10D00D8B900BB825C /* SVGFEConvolveMatrix.h */; };
- B255997C0D00D8BA00BB825C /* SVGFEDiffuseLighting.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B25598E20D00D8B900BB825C /* SVGFEDiffuseLighting.cpp */; };
- B255997D0D00D8BA00BB825C /* SVGFEDiffuseLighting.h in Headers */ = {isa = PBXBuildFile; fileRef = B25598E30D00D8B900BB825C /* SVGFEDiffuseLighting.h */; };
- B255997E0D00D8BA00BB825C /* SVGFEDisplacementMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B25598E40D00D8B900BB825C /* SVGFEDisplacementMap.cpp */; };
- B255997F0D00D8BA00BB825C /* SVGFEDisplacementMap.h in Headers */ = {isa = PBXBuildFile; fileRef = B25598E50D00D8B900BB825C /* SVGFEDisplacementMap.h */; };
- B25599800D00D8BA00BB825C /* SVGFEFlood.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B25598E60D00D8B900BB825C /* SVGFEFlood.cpp */; };
- B25599810D00D8BA00BB825C /* SVGFEFlood.h in Headers */ = {isa = PBXBuildFile; fileRef = B25598E70D00D8B900BB825C /* SVGFEFlood.h */; };
B25599840D00D8BA00BB825C /* SVGFEImage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B25598EA0D00D8B900BB825C /* SVGFEImage.cpp */; };
B25599850D00D8BA00BB825C /* SVGFEImage.h in Headers */ = {isa = PBXBuildFile; fileRef = B25598EB0D00D8B900BB825C /* SVGFEImage.h */; };
- B25599860D00D8BA00BB825C /* SVGFEMerge.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B25598EC0D00D8B900BB825C /* SVGFEMerge.cpp */; };
- B25599870D00D8BA00BB825C /* SVGFEMerge.h in Headers */ = {isa = PBXBuildFile; fileRef = B25598ED0D00D8B900BB825C /* SVGFEMerge.h */; };
- B25599880D00D8BA00BB825C /* SVGFEMorphology.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B25598EE0D00D8B900BB825C /* SVGFEMorphology.cpp */; };
- B25599890D00D8BA00BB825C /* SVGFEMorphology.h in Headers */ = {isa = PBXBuildFile; fileRef = B25598EF0D00D8B900BB825C /* SVGFEMorphology.h */; };
- B255998A0D00D8BA00BB825C /* SVGFEOffset.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B25598F00D00D8B900BB825C /* SVGFEOffset.cpp */; };
- B255998B0D00D8BA00BB825C /* SVGFEOffset.h in Headers */ = {isa = PBXBuildFile; fileRef = B25598F10D00D8B900BB825C /* SVGFEOffset.h */; };
- B255998C0D00D8BA00BB825C /* SVGFESpecularLighting.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B25598F20D00D8B900BB825C /* SVGFESpecularLighting.cpp */; };
- B255998D0D00D8BA00BB825C /* SVGFESpecularLighting.h in Headers */ = {isa = PBXBuildFile; fileRef = B25598F30D00D8B900BB825C /* SVGFESpecularLighting.h */; };
- B255998E0D00D8BA00BB825C /* SVGFETile.h in Headers */ = {isa = PBXBuildFile; fileRef = B25598F40D00D8B900BB825C /* SVGFETile.h */; };
- B255998F0D00D8BA00BB825C /* SVGFETurbulence.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B25598F50D00D8B900BB825C /* SVGFETurbulence.cpp */; };
- B25599900D00D8BA00BB825C /* SVGFETurbulence.h in Headers */ = {isa = PBXBuildFile; fileRef = B25598F60D00D8B900BB825C /* SVGFETurbulence.h */; };
- B25599930D00D8BA00BB825C /* SVGLightSource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B25598F90D00D8B900BB825C /* SVGLightSource.cpp */; };
- B25599940D00D8BA00BB825C /* SVGLightSource.h in Headers */ = {isa = PBXBuildFile; fileRef = B25598FA0D00D8B900BB825C /* SVGLightSource.h */; };
- B25599950D00D8BA00BB825C /* SVGPointLightSource.h in Headers */ = {isa = PBXBuildFile; fileRef = B25598FB0D00D8B900BB825C /* SVGPointLightSource.h */; };
- B25599960D00D8BA00BB825C /* SVGSpotLightSource.h in Headers */ = {isa = PBXBuildFile; fileRef = B25598FC0D00D8B900BB825C /* SVGSpotLightSource.h */; };
B25599A30D00D8BA00BB825C /* SVGImage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B255990B0D00D8B900BB825C /* SVGImage.cpp */; };
B25599A40D00D8BA00BB825C /* SVGImage.h in Headers */ = {isa = PBXBuildFile; fileRef = B255990C0D00D8B900BB825C /* SVGImage.h */; };
B25599A50D00D8BA00BB825C /* EmptyClients.h in Headers */ = {isa = PBXBuildFile; fileRef = B255990D0D00D8B900BB825C /* EmptyClients.h */; };
@@ -4961,7 +4975,7 @@
BCD9C2C00C17B69E005C90A2 /* JSNamedNodeMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCD9C2BC0C17B69E005C90A2 /* JSNamedNodeMap.cpp */; };
BCD9C2C10C17B69E005C90A2 /* JSNamedNodeMap.h in Headers */ = {isa = PBXBuildFile; fileRef = BCD9C2BD0C17B69E005C90A2 /* JSNamedNodeMap.h */; };
BCD9C2C20C17B69E005C90A2 /* JSNodeList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCD9C2BE0C17B69E005C90A2 /* JSNodeList.cpp */; };
- BCD9C2C30C17B69E005C90A2 /* JSNodeList.h in Headers */ = {isa = PBXBuildFile; fileRef = BCD9C2BF0C17B69E005C90A2 /* JSNodeList.h */; };
+ BCD9C2C30C17B69E005C90A2 /* JSNodeList.h in Headers */ = {isa = PBXBuildFile; fileRef = BCD9C2BF0C17B69E005C90A2 /* JSNodeList.h */; settings = {ATTRIBUTES = (Private, ); }; };
BCDD454E1236C95C009A7985 /* ColumnInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = BCDD454D1236C95C009A7985 /* ColumnInfo.h */; settings = {ATTRIBUTES = (Private, ); }; };
BCDF317B11F8D683003C5BF8 /* UserTypingGestureIndicator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCDF317911F8D683003C5BF8 /* UserTypingGestureIndicator.cpp */; };
BCDF317C11F8D683003C5BF8 /* UserTypingGestureIndicator.h in Headers */ = {isa = PBXBuildFile; fileRef = BCDF317A11F8D683003C5BF8 /* UserTypingGestureIndicator.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -5170,7 +5184,7 @@
CEA3949C11D45CDA003094CF /* StaticHashSetNodeList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA3949A11D45CDA003094CF /* StaticHashSetNodeList.cpp */; };
CEA3949D11D45CDA003094CF /* StaticHashSetNodeList.h in Headers */ = {isa = PBXBuildFile; fileRef = CEA3949B11D45CDA003094CF /* StaticHashSetNodeList.h */; };
CEF418CE1179678C009D112C /* ViewportArguments.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEF418CC1179678C009D112C /* ViewportArguments.cpp */; };
- CEF418CF1179678C009D112C /* ViewportArguments.h in Headers */ = {isa = PBXBuildFile; fileRef = CEF418CD1179678C009D112C /* ViewportArguments.h */; };
+ CEF418CF1179678C009D112C /* ViewportArguments.h in Headers */ = {isa = PBXBuildFile; fileRef = CEF418CD1179678C009D112C /* ViewportArguments.h */; settings = {ATTRIBUTES = (Private, ); }; };
D000EBA211BDAFD400C47726 /* FrameLoaderStateMachine.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D000EBA011BDAFD400C47726 /* FrameLoaderStateMachine.cpp */; };
D000EBA311BDAFD400C47726 /* FrameLoaderStateMachine.h in Headers */ = {isa = PBXBuildFile; fileRef = D000EBA111BDAFD400C47726 /* FrameLoaderStateMachine.h */; settings = {ATTRIBUTES = (Private, ); }; };
D000ED2711C1B9CD00C47726 /* SubframeLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D000ED2511C1B9CD00C47726 /* SubframeLoader.cpp */; };
@@ -5291,8 +5305,6 @@
E1FF57A60F01256B00891EBB /* ThreadGlobalData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1FF57A50F01256B00891EBB /* ThreadGlobalData.cpp */; };
E415F1690D9A165D0033CE97 /* DOMElementTimeControl.h in Headers */ = {isa = PBXBuildFile; fileRef = E415F1680D9A165D0033CE97 /* DOMElementTimeControl.h */; };
E415F1840D9A1A830033CE97 /* ElementTimeControl.h in Headers */ = {isa = PBXBuildFile; fileRef = E415F1830D9A1A830033CE97 /* ElementTimeControl.h */; };
- E440A2D51191A50B000820B0 /* SVGFELighting.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E440A2D41191A50B000820B0 /* SVGFELighting.cpp */; };
- E440A2D71191A523000820B0 /* SVGFELighting.h in Headers */ = {isa = PBXBuildFile; fileRef = E440A2D61191A523000820B0 /* SVGFELighting.h */; };
E44613A10CD6331000FADA75 /* HTMLAudioElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E446138F0CD6331000FADA75 /* HTMLAudioElement.cpp */; };
E44613A20CD6331000FADA75 /* HTMLAudioElement.h in Headers */ = {isa = PBXBuildFile; fileRef = E44613900CD6331000FADA75 /* HTMLAudioElement.h */; };
E44613A40CD6331000FADA75 /* HTMLMediaElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E44613920CD6331000FADA75 /* HTMLMediaElement.cpp */; };
@@ -5365,6 +5377,58 @@
F3D461491161D53200CA0D09 /* JSWorkerContextErrorHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = F3D461471161D53200CA0D09 /* JSWorkerContextErrorHandler.h */; };
F4EAF4AE10C742B1009100D3 /* OpenTypeSanitizer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F4EAF4AC10C742B1009100D3 /* OpenTypeSanitizer.cpp */; };
F4EAF4AF10C742B1009100D3 /* OpenTypeSanitizer.h in Headers */ = {isa = PBXBuildFile; fileRef = F4EAF4AD10C742B1009100D3 /* OpenTypeSanitizer.h */; };
+ F55B3DAD1251F12D003EF269 /* BaseTextInputType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F55B3D791251F12D003EF269 /* BaseTextInputType.cpp */; };
+ F55B3DAE1251F12D003EF269 /* BaseTextInputType.h in Headers */ = {isa = PBXBuildFile; fileRef = F55B3D7A1251F12D003EF269 /* BaseTextInputType.h */; };
+ F55B3DAF1251F12D003EF269 /* ButtonInputType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F55B3D7B1251F12D003EF269 /* ButtonInputType.cpp */; };
+ F55B3DB01251F12D003EF269 /* ButtonInputType.h in Headers */ = {isa = PBXBuildFile; fileRef = F55B3D7C1251F12D003EF269 /* ButtonInputType.h */; };
+ F55B3DB11251F12D003EF269 /* CheckboxInputType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F55B3D7D1251F12D003EF269 /* CheckboxInputType.cpp */; };
+ F55B3DB21251F12D003EF269 /* CheckboxInputType.h in Headers */ = {isa = PBXBuildFile; fileRef = F55B3D7E1251F12D003EF269 /* CheckboxInputType.h */; };
+ F55B3DB31251F12D003EF269 /* ColorInputType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F55B3D7F1251F12D003EF269 /* ColorInputType.cpp */; };
+ F55B3DB41251F12D003EF269 /* ColorInputType.h in Headers */ = {isa = PBXBuildFile; fileRef = F55B3D801251F12D003EF269 /* ColorInputType.h */; };
+ F55B3DB51251F12D003EF269 /* DateInputType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F55B3D811251F12D003EF269 /* DateInputType.cpp */; };
+ F55B3DB61251F12D003EF269 /* DateInputType.h in Headers */ = {isa = PBXBuildFile; fileRef = F55B3D821251F12D003EF269 /* DateInputType.h */; };
+ F55B3DB71251F12D003EF269 /* DateTimeInputType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F55B3D831251F12D003EF269 /* DateTimeInputType.cpp */; };
+ F55B3DB81251F12D003EF269 /* DateTimeInputType.h in Headers */ = {isa = PBXBuildFile; fileRef = F55B3D841251F12D003EF269 /* DateTimeInputType.h */; };
+ F55B3DB91251F12D003EF269 /* DateTimeLocalInputType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F55B3D851251F12D003EF269 /* DateTimeLocalInputType.cpp */; };
+ F55B3DBA1251F12D003EF269 /* DateTimeLocalInputType.h in Headers */ = {isa = PBXBuildFile; fileRef = F55B3D861251F12D003EF269 /* DateTimeLocalInputType.h */; };
+ F55B3DBB1251F12D003EF269 /* EmailInputType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F55B3D871251F12D003EF269 /* EmailInputType.cpp */; };
+ F55B3DBC1251F12D003EF269 /* EmailInputType.h in Headers */ = {isa = PBXBuildFile; fileRef = F55B3D881251F12D003EF269 /* EmailInputType.h */; };
+ F55B3DBD1251F12D003EF269 /* FileInputType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F55B3D891251F12D003EF269 /* FileInputType.cpp */; };
+ F55B3DBE1251F12D003EF269 /* FileInputType.h in Headers */ = {isa = PBXBuildFile; fileRef = F55B3D8A1251F12D003EF269 /* FileInputType.h */; };
+ F55B3DBF1251F12D003EF269 /* HiddenInputType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F55B3D8B1251F12D003EF269 /* HiddenInputType.cpp */; };
+ F55B3DC01251F12D003EF269 /* HiddenInputType.h in Headers */ = {isa = PBXBuildFile; fileRef = F55B3D8C1251F12D003EF269 /* HiddenInputType.h */; };
+ F55B3DC11251F12D003EF269 /* ImageInputType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F55B3D8D1251F12D003EF269 /* ImageInputType.cpp */; };
+ F55B3DC21251F12D003EF269 /* ImageInputType.h in Headers */ = {isa = PBXBuildFile; fileRef = F55B3D8E1251F12D003EF269 /* ImageInputType.h */; };
+ F55B3DC31251F12D003EF269 /* IsIndexInputType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F55B3D8F1251F12D003EF269 /* IsIndexInputType.cpp */; };
+ F55B3DC41251F12D003EF269 /* IsIndexInputType.h in Headers */ = {isa = PBXBuildFile; fileRef = F55B3D901251F12D003EF269 /* IsIndexInputType.h */; };
+ F55B3DC51251F12D003EF269 /* MonthInputType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F55B3D911251F12D003EF269 /* MonthInputType.cpp */; };
+ F55B3DC61251F12D003EF269 /* MonthInputType.h in Headers */ = {isa = PBXBuildFile; fileRef = F55B3D921251F12D003EF269 /* MonthInputType.h */; };
+ F55B3DC71251F12D003EF269 /* NumberInputType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F55B3D931251F12D003EF269 /* NumberInputType.cpp */; };
+ F55B3DC81251F12D003EF269 /* NumberInputType.h in Headers */ = {isa = PBXBuildFile; fileRef = F55B3D941251F12D003EF269 /* NumberInputType.h */; };
+ F55B3DC91251F12D003EF269 /* PasswordInputType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F55B3D951251F12D003EF269 /* PasswordInputType.cpp */; };
+ F55B3DCA1251F12D003EF269 /* PasswordInputType.h in Headers */ = {isa = PBXBuildFile; fileRef = F55B3D961251F12D003EF269 /* PasswordInputType.h */; };
+ F55B3DCB1251F12D003EF269 /* RadioInputType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F55B3D971251F12D003EF269 /* RadioInputType.cpp */; };
+ F55B3DCC1251F12D003EF269 /* RadioInputType.h in Headers */ = {isa = PBXBuildFile; fileRef = F55B3D981251F12D003EF269 /* RadioInputType.h */; };
+ F55B3DCD1251F12D003EF269 /* RangeInputType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F55B3D991251F12D003EF269 /* RangeInputType.cpp */; };
+ F55B3DCE1251F12D003EF269 /* RangeInputType.h in Headers */ = {isa = PBXBuildFile; fileRef = F55B3D9A1251F12D003EF269 /* RangeInputType.h */; };
+ F55B3DCF1251F12D003EF269 /* ResetInputType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F55B3D9B1251F12D003EF269 /* ResetInputType.cpp */; };
+ F55B3DD01251F12D003EF269 /* ResetInputType.h in Headers */ = {isa = PBXBuildFile; fileRef = F55B3D9C1251F12D003EF269 /* ResetInputType.h */; };
+ F55B3DD11251F12D003EF269 /* SearchInputType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F55B3D9D1251F12D003EF269 /* SearchInputType.cpp */; };
+ F55B3DD21251F12D003EF269 /* SearchInputType.h in Headers */ = {isa = PBXBuildFile; fileRef = F55B3D9E1251F12D003EF269 /* SearchInputType.h */; };
+ F55B3DD31251F12D003EF269 /* SubmitInputType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F55B3D9F1251F12D003EF269 /* SubmitInputType.cpp */; };
+ F55B3DD41251F12D003EF269 /* SubmitInputType.h in Headers */ = {isa = PBXBuildFile; fileRef = F55B3DA01251F12D003EF269 /* SubmitInputType.h */; };
+ F55B3DD51251F12D003EF269 /* TelephoneInputType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F55B3DA11251F12D003EF269 /* TelephoneInputType.cpp */; };
+ F55B3DD61251F12D003EF269 /* TelephoneInputType.h in Headers */ = {isa = PBXBuildFile; fileRef = F55B3DA21251F12D003EF269 /* TelephoneInputType.h */; };
+ F55B3DD71251F12D003EF269 /* TextFieldInputType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F55B3DA31251F12D003EF269 /* TextFieldInputType.cpp */; };
+ F55B3DD81251F12D003EF269 /* TextFieldInputType.h in Headers */ = {isa = PBXBuildFile; fileRef = F55B3DA41251F12D003EF269 /* TextFieldInputType.h */; };
+ F55B3DD91251F12D003EF269 /* TextInputType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F55B3DA51251F12D003EF269 /* TextInputType.cpp */; };
+ F55B3DDA1251F12D003EF269 /* TextInputType.h in Headers */ = {isa = PBXBuildFile; fileRef = F55B3DA61251F12D003EF269 /* TextInputType.h */; };
+ F55B3DDB1251F12D003EF269 /* TimeInputType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F55B3DA71251F12D003EF269 /* TimeInputType.cpp */; };
+ F55B3DDC1251F12D003EF269 /* TimeInputType.h in Headers */ = {isa = PBXBuildFile; fileRef = F55B3DA81251F12D003EF269 /* TimeInputType.h */; };
+ F55B3DDD1251F12D003EF269 /* URLInputType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F55B3DA91251F12D003EF269 /* URLInputType.cpp */; };
+ F55B3DDE1251F12D003EF269 /* URLInputType.h in Headers */ = {isa = PBXBuildFile; fileRef = F55B3DAA1251F12D003EF269 /* URLInputType.h */; };
+ F55B3DDF1251F12D003EF269 /* WeekInputType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F55B3DAB1251F12D003EF269 /* WeekInputType.cpp */; };
+ F55B3DE01251F12D003EF269 /* WeekInputType.h in Headers */ = {isa = PBXBuildFile; fileRef = F55B3DAC1251F12D003EF269 /* WeekInputType.h */; };
F5C041DA0FFCA7CE00839D4A /* HTMLDataListElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F5C041D70FFCA7CE00839D4A /* HTMLDataListElement.cpp */; };
F5C041DB0FFCA7CE00839D4A /* HTMLDataListElement.h in Headers */ = {isa = PBXBuildFile; fileRef = F5C041D80FFCA7CE00839D4A /* HTMLDataListElement.h */; };
F5C041E30FFCA96D00839D4A /* DOMHTMLDataListElement.h in Headers */ = {isa = PBXBuildFile; fileRef = F5C041DE0FFCA96D00839D4A /* DOMHTMLDataListElement.h */; };
@@ -6710,6 +6774,8 @@
37C238201098C84200EF9F72 /* ComplexTextControllerCoreText.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ComplexTextControllerCoreText.cpp; sourceTree = "<group>"; };
37C28A6710F659CC008C7813 /* TypesettingFeatures.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TypesettingFeatures.h; sourceTree = "<group>"; };
37C61F0012095C87007A3C67 /* AtomicStringKeyedMRUCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AtomicStringKeyedMRUCache.h; sourceTree = "<group>"; };
+ 37E3524A12450C5200BAF5D9 /* InputType.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InputType.cpp; sourceTree = "<group>"; };
+ 37E3524C12450C6600BAF5D9 /* InputType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InputType.h; sourceTree = "<group>"; };
37F818FB0D657606005E1F05 /* WebCoreURLResponse.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebCoreURLResponse.h; sourceTree = "<group>"; };
37F818FC0D657606005E1F05 /* WebCoreURLResponse.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebCoreURLResponse.mm; sourceTree = "<group>"; };
37FC96DA1104ED71003E1FAD /* TrailingFloatsRootInlineBox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TrailingFloatsRootInlineBox.h; sourceTree = "<group>"; };
@@ -7370,12 +7436,19 @@
7693BACF106C2DCA007B0823 /* PluginHalter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PluginHalter.cpp; sourceTree = "<group>"; };
7693BAD0106C2DCA007B0823 /* PluginHalter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PluginHalter.h; sourceTree = "<group>"; };
7693BAD1106C2DCA007B0823 /* PluginHalterClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PluginHalterClient.h; sourceTree = "<group>"; };
+ 7694563A1214D97C0007CBAE /* JSDOMTokenList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDOMTokenList.cpp; sourceTree = "<group>"; };
+ 7694563B1214D97C0007CBAE /* JSDOMTokenList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSDOMTokenList.h; sourceTree = "<group>"; };
+ 769456591214DB630007CBAE /* DOMDOMTokenList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMDOMTokenList.h; sourceTree = "<group>"; };
+ 7694565A1214DB630007CBAE /* DOMDOMTokenList.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DOMDOMTokenList.mm; sourceTree = "<group>"; };
76CDD2EC1103DA6600680521 /* AccessibilityMenuList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AccessibilityMenuList.cpp; sourceTree = "<group>"; };
76CDD2ED1103DA6600680521 /* AccessibilityMenuList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AccessibilityMenuList.h; sourceTree = "<group>"; };
76CDD2EE1103DA6600680521 /* AccessibilityMenuListPopup.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AccessibilityMenuListPopup.cpp; sourceTree = "<group>"; };
76CDD2EF1103DA6600680521 /* AccessibilityMenuListPopup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AccessibilityMenuListPopup.h; sourceTree = "<group>"; };
76CDD2F01103DA6600680521 /* AccessibilityMenuListOption.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AccessibilityMenuListOption.cpp; sourceTree = "<group>"; };
76CDD2F11103DA6600680521 /* AccessibilityMenuListOption.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AccessibilityMenuListOption.h; sourceTree = "<group>"; };
+ 76FC2B0812370DA0006A991A /* DOMTokenList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DOMTokenList.cpp; sourceTree = "<group>"; };
+ 76FC2B0912370DA0006A991A /* DOMTokenList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMTokenList.h; sourceTree = "<group>"; };
+ 76FC2B0A12370DA0006A991A /* DOMTokenList.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DOMTokenList.idl; sourceTree = "<group>"; };
76FF17E211235673001D61B5 /* PluginViewNone.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PluginViewNone.cpp; sourceTree = "<group>"; };
79AC9216109945C80021266E /* JSCompositionEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSCompositionEvent.cpp; sourceTree = "<group>"; };
79AC9217109945C80021266E /* JSCompositionEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCompositionEvent.h; sourceTree = "<group>"; };
@@ -7442,6 +7515,33 @@
845E72F70FD261EE00A87D79 /* Filter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Filter.h; path = filters/Filter.h; sourceTree = "<group>"; };
845E72F90FD2623900A87D79 /* SVGFilter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGFilter.cpp; sourceTree = "<group>"; };
845E72FA0FD2623900A87D79 /* SVGFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGFilter.h; sourceTree = "<group>"; };
+ 84730D5A1248F0B300D3A9C9 /* DistantLightSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DistantLightSource.h; path = filters/DistantLightSource.h; sourceTree = "<group>"; };
+ 84730D5B1248F0B300D3A9C9 /* FEConvolveMatrix.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FEConvolveMatrix.cpp; path = filters/FEConvolveMatrix.cpp; sourceTree = "<group>"; };
+ 84730D5C1248F0B300D3A9C9 /* FEConvolveMatrix.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FEConvolveMatrix.h; path = filters/FEConvolveMatrix.h; sourceTree = "<group>"; };
+ 84730D5D1248F0B300D3A9C9 /* FEDiffuseLighting.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FEDiffuseLighting.cpp; path = filters/FEDiffuseLighting.cpp; sourceTree = "<group>"; };
+ 84730D5E1248F0B300D3A9C9 /* FEDiffuseLighting.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FEDiffuseLighting.h; path = filters/FEDiffuseLighting.h; sourceTree = "<group>"; };
+ 84730D5F1248F0B300D3A9C9 /* FEDisplacementMap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FEDisplacementMap.cpp; path = filters/FEDisplacementMap.cpp; sourceTree = "<group>"; };
+ 84730D601248F0B300D3A9C9 /* FEDisplacementMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FEDisplacementMap.h; path = filters/FEDisplacementMap.h; sourceTree = "<group>"; };
+ 84730D611248F0B300D3A9C9 /* FEFlood.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FEFlood.cpp; path = filters/FEFlood.cpp; sourceTree = "<group>"; };
+ 84730D621248F0B300D3A9C9 /* FEFlood.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FEFlood.h; path = filters/FEFlood.h; sourceTree = "<group>"; };
+ 84730D631248F0B300D3A9C9 /* FELighting.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FELighting.cpp; path = filters/FELighting.cpp; sourceTree = "<group>"; };
+ 84730D641248F0B300D3A9C9 /* FELighting.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FELighting.h; path = filters/FELighting.h; sourceTree = "<group>"; };
+ 84730D651248F0B300D3A9C9 /* FEMerge.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FEMerge.cpp; path = filters/FEMerge.cpp; sourceTree = "<group>"; };
+ 84730D661248F0B300D3A9C9 /* FEMerge.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FEMerge.h; path = filters/FEMerge.h; sourceTree = "<group>"; };
+ 84730D671248F0B300D3A9C9 /* FEMorphology.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FEMorphology.cpp; path = filters/FEMorphology.cpp; sourceTree = "<group>"; };
+ 84730D681248F0B300D3A9C9 /* FEMorphology.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FEMorphology.h; path = filters/FEMorphology.h; sourceTree = "<group>"; };
+ 84730D691248F0B300D3A9C9 /* FEOffset.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FEOffset.cpp; path = filters/FEOffset.cpp; sourceTree = "<group>"; };
+ 84730D6A1248F0B300D3A9C9 /* FEOffset.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FEOffset.h; path = filters/FEOffset.h; sourceTree = "<group>"; };
+ 84730D6B1248F0B300D3A9C9 /* FESpecularLighting.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FESpecularLighting.cpp; path = filters/FESpecularLighting.cpp; sourceTree = "<group>"; };
+ 84730D6C1248F0B300D3A9C9 /* FESpecularLighting.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FESpecularLighting.h; path = filters/FESpecularLighting.h; sourceTree = "<group>"; };
+ 84730D6D1248F0B300D3A9C9 /* FETile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FETile.cpp; path = filters/FETile.cpp; sourceTree = "<group>"; };
+ 84730D6E1248F0B300D3A9C9 /* FETile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FETile.h; path = filters/FETile.h; sourceTree = "<group>"; };
+ 84730D6F1248F0B300D3A9C9 /* FETurbulence.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FETurbulence.cpp; path = filters/FETurbulence.cpp; sourceTree = "<group>"; };
+ 84730D701248F0B300D3A9C9 /* FETurbulence.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FETurbulence.h; path = filters/FETurbulence.h; sourceTree = "<group>"; };
+ 84730D731248F0B300D3A9C9 /* LightSource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LightSource.cpp; path = filters/LightSource.cpp; sourceTree = "<group>"; };
+ 84730D741248F0B300D3A9C9 /* LightSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LightSource.h; path = filters/LightSource.h; sourceTree = "<group>"; };
+ 84730D751248F0B300D3A9C9 /* PointLightSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PointLightSource.h; path = filters/PointLightSource.h; sourceTree = "<group>"; };
+ 84730D761248F0B300D3A9C9 /* SpotLightSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SpotLightSource.h; path = filters/SpotLightSource.h; sourceTree = "<group>"; };
8476C9E311DF6A0B00555B02 /* SVGPathSegListBuilder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGPathSegListBuilder.cpp; sourceTree = "<group>"; };
8476C9E411DF6A0B00555B02 /* SVGPathSegListBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGPathSegListBuilder.h; sourceTree = "<group>"; };
8476C9E711DF6A2900555B02 /* SVGPathBuilder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGPathBuilder.cpp; sourceTree = "<group>"; };
@@ -8670,7 +8770,7 @@
976D6C70122B8A3D001FD1F7 /* FileThreadTask.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FileThreadTask.h; path = fileapi/FileThreadTask.h; sourceTree = "<group>"; };
976D6C71122B8A3D001FD1F7 /* FileWriter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FileWriter.cpp; path = fileapi/FileWriter.cpp; sourceTree = "<group>"; };
976D6C72122B8A3D001FD1F7 /* FileWriter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FileWriter.h; path = fileapi/FileWriter.h; sourceTree = "<group>"; };
- 976D6C74122B8A3D001FD1F7 /* FileWriterClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FileWriterClient.h; path = fileapi/FileWriterClient.h; sourceTree = "<group>"; };
+ 976D6C74122B8A3D001FD1F7 /* AsyncFileWriterClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AsyncFileWriterClient.h; path = fileapi/AsyncFileWriterClient.h; sourceTree = "<group>"; };
976D6C75122B8A3D001FD1F7 /* ThreadableBlobRegistry.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ThreadableBlobRegistry.cpp; path = fileapi/ThreadableBlobRegistry.cpp; sourceTree = "<group>"; };
976D6C76122B8A3D001FD1F7 /* ThreadableBlobRegistry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ThreadableBlobRegistry.h; path = fileapi/ThreadableBlobRegistry.h; sourceTree = "<group>"; };
977B371F1228721700B81FF8 /* HTMLElementStack.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = HTMLElementStack.cpp; path = parser/HTMLElementStack.cpp; sourceTree = "<group>"; };
@@ -8817,7 +8917,6 @@
A7D20F60107F406900A80392 /* JSWebGLActiveInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWebGLActiveInfo.cpp; sourceTree = "<group>"; };
A7D20F61107F406900A80392 /* JSWebGLActiveInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSWebGLActiveInfo.h; sourceTree = "<group>"; };
A7D20F6B107F438B00A80392 /* WebGLActiveInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebGLActiveInfo.h; path = canvas/WebGLActiveInfo.h; sourceTree = "<group>"; };
- A7D27FC30E0A599F0079AD2B /* SVGFETile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGFETile.cpp; sourceTree = "<group>"; };
A7D3C5230B576B4B002CA450 /* PasteboardHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PasteboardHelper.h; sourceTree = "<group>"; };
A7D6B3470F61104500B79FD1 /* WorkerScriptLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WorkerScriptLoader.h; path = workers/WorkerScriptLoader.h; sourceTree = "<group>"; };
A7D6B3480F61104500B79FD1 /* WorkerScriptLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WorkerScriptLoader.cpp; path = workers/WorkerScriptLoader.cpp; sourceTree = "<group>"; };
@@ -9844,32 +9943,8 @@
B237C8A60D344D110013F707 /* SVGFontData.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SVGFontData.h; sourceTree = "<group>"; };
B24055630B5BE640002A28C0 /* DOMSVGElementInstanceInternal.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DOMSVGElementInstanceInternal.h; sourceTree = "<group>"; };
B24055640B5BE640002A28C0 /* DOMSVGElementInstanceListInternal.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DOMSVGElementInstanceListInternal.h; sourceTree = "<group>"; };
- B25598D70D00D8B900BB825C /* SVGDistantLightSource.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SVGDistantLightSource.h; sourceTree = "<group>"; };
- B25598E00D00D8B900BB825C /* SVGFEConvolveMatrix.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = SVGFEConvolveMatrix.cpp; sourceTree = "<group>"; };
- B25598E10D00D8B900BB825C /* SVGFEConvolveMatrix.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SVGFEConvolveMatrix.h; sourceTree = "<group>"; };
- B25598E20D00D8B900BB825C /* SVGFEDiffuseLighting.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = SVGFEDiffuseLighting.cpp; sourceTree = "<group>"; };
- B25598E30D00D8B900BB825C /* SVGFEDiffuseLighting.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SVGFEDiffuseLighting.h; sourceTree = "<group>"; };
- B25598E40D00D8B900BB825C /* SVGFEDisplacementMap.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = SVGFEDisplacementMap.cpp; sourceTree = "<group>"; };
- B25598E50D00D8B900BB825C /* SVGFEDisplacementMap.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SVGFEDisplacementMap.h; sourceTree = "<group>"; };
- B25598E60D00D8B900BB825C /* SVGFEFlood.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = SVGFEFlood.cpp; sourceTree = "<group>"; };
- B25598E70D00D8B900BB825C /* SVGFEFlood.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SVGFEFlood.h; sourceTree = "<group>"; };
B25598EA0D00D8B900BB825C /* SVGFEImage.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = SVGFEImage.cpp; sourceTree = "<group>"; };
B25598EB0D00D8B900BB825C /* SVGFEImage.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SVGFEImage.h; sourceTree = "<group>"; };
- B25598EC0D00D8B900BB825C /* SVGFEMerge.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = SVGFEMerge.cpp; sourceTree = "<group>"; };
- B25598ED0D00D8B900BB825C /* SVGFEMerge.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SVGFEMerge.h; sourceTree = "<group>"; };
- B25598EE0D00D8B900BB825C /* SVGFEMorphology.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = SVGFEMorphology.cpp; sourceTree = "<group>"; };
- B25598EF0D00D8B900BB825C /* SVGFEMorphology.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SVGFEMorphology.h; sourceTree = "<group>"; };
- B25598F00D00D8B900BB825C /* SVGFEOffset.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = SVGFEOffset.cpp; sourceTree = "<group>"; };
- B25598F10D00D8B900BB825C /* SVGFEOffset.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SVGFEOffset.h; sourceTree = "<group>"; };
- B25598F20D00D8B900BB825C /* SVGFESpecularLighting.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = SVGFESpecularLighting.cpp; sourceTree = "<group>"; };
- B25598F30D00D8B900BB825C /* SVGFESpecularLighting.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SVGFESpecularLighting.h; sourceTree = "<group>"; };
- B25598F40D00D8B900BB825C /* SVGFETile.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SVGFETile.h; sourceTree = "<group>"; };
- B25598F50D00D8B900BB825C /* SVGFETurbulence.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = SVGFETurbulence.cpp; sourceTree = "<group>"; };
- B25598F60D00D8B900BB825C /* SVGFETurbulence.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SVGFETurbulence.h; sourceTree = "<group>"; };
- B25598F90D00D8B900BB825C /* SVGLightSource.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = SVGLightSource.cpp; sourceTree = "<group>"; };
- B25598FA0D00D8B900BB825C /* SVGLightSource.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SVGLightSource.h; sourceTree = "<group>"; };
- B25598FB0D00D8B900BB825C /* SVGPointLightSource.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SVGPointLightSource.h; sourceTree = "<group>"; };
- B25598FC0D00D8B900BB825C /* SVGSpotLightSource.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SVGSpotLightSource.h; sourceTree = "<group>"; };
B255990B0D00D8B900BB825C /* SVGImage.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = SVGImage.cpp; sourceTree = "<group>"; };
B255990C0D00D8B900BB825C /* SVGImage.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SVGImage.h; sourceTree = "<group>"; };
B255990D0D00D8B900BB825C /* EmptyClients.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = EmptyClients.h; sourceTree = "<group>"; };
@@ -11159,8 +11234,6 @@
E415F1830D9A1A830033CE97 /* ElementTimeControl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ElementTimeControl.h; sourceTree = "<group>"; };
E41EA038119836DB00710BC5 /* CSSPropertyNames.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSPropertyNames.cpp; sourceTree = "<group>"; };
E41EA0391198374900710BC5 /* CSSValueKeywords.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSValueKeywords.cpp; sourceTree = "<group>"; };
- E440A2D41191A50B000820B0 /* SVGFELighting.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGFELighting.cpp; sourceTree = "<group>"; };
- E440A2D61191A523000820B0 /* SVGFELighting.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGFELighting.h; sourceTree = "<group>"; };
E446138F0CD6331000FADA75 /* HTMLAudioElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLAudioElement.cpp; sourceTree = "<group>"; };
E44613900CD6331000FADA75 /* HTMLAudioElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTMLAudioElement.h; sourceTree = "<group>"; };
E44613910CD6331000FADA75 /* HTMLAudioElement.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = HTMLAudioElement.idl; sourceTree = "<group>"; };
@@ -11252,6 +11325,58 @@
F523D30402DE4476018635CA /* Range.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = Range.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
F523D30902DE4476018635CA /* XMLDocumentParser.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = XMLDocumentParser.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
F523D30A02DE4476018635CA /* XMLDocumentParser.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = XMLDocumentParser.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
+ F55B3D791251F12D003EF269 /* BaseTextInputType.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BaseTextInputType.cpp; sourceTree = "<group>"; };
+ F55B3D7A1251F12D003EF269 /* BaseTextInputType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BaseTextInputType.h; sourceTree = "<group>"; };
+ F55B3D7B1251F12D003EF269 /* ButtonInputType.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ButtonInputType.cpp; sourceTree = "<group>"; };
+ F55B3D7C1251F12D003EF269 /* ButtonInputType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ButtonInputType.h; sourceTree = "<group>"; };
+ F55B3D7D1251F12D003EF269 /* CheckboxInputType.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CheckboxInputType.cpp; sourceTree = "<group>"; };
+ F55B3D7E1251F12D003EF269 /* CheckboxInputType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CheckboxInputType.h; sourceTree = "<group>"; };
+ F55B3D7F1251F12D003EF269 /* ColorInputType.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ColorInputType.cpp; sourceTree = "<group>"; };
+ F55B3D801251F12D003EF269 /* ColorInputType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ColorInputType.h; sourceTree = "<group>"; };
+ F55B3D811251F12D003EF269 /* DateInputType.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DateInputType.cpp; sourceTree = "<group>"; };
+ F55B3D821251F12D003EF269 /* DateInputType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DateInputType.h; sourceTree = "<group>"; };
+ F55B3D831251F12D003EF269 /* DateTimeInputType.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DateTimeInputType.cpp; sourceTree = "<group>"; };
+ F55B3D841251F12D003EF269 /* DateTimeInputType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DateTimeInputType.h; sourceTree = "<group>"; };
+ F55B3D851251F12D003EF269 /* DateTimeLocalInputType.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DateTimeLocalInputType.cpp; sourceTree = "<group>"; };
+ F55B3D861251F12D003EF269 /* DateTimeLocalInputType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DateTimeLocalInputType.h; sourceTree = "<group>"; };
+ F55B3D871251F12D003EF269 /* EmailInputType.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EmailInputType.cpp; sourceTree = "<group>"; };
+ F55B3D881251F12D003EF269 /* EmailInputType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EmailInputType.h; sourceTree = "<group>"; };
+ F55B3D891251F12D003EF269 /* FileInputType.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FileInputType.cpp; sourceTree = "<group>"; };
+ F55B3D8A1251F12D003EF269 /* FileInputType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FileInputType.h; sourceTree = "<group>"; };
+ F55B3D8B1251F12D003EF269 /* HiddenInputType.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HiddenInputType.cpp; sourceTree = "<group>"; };
+ F55B3D8C1251F12D003EF269 /* HiddenInputType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HiddenInputType.h; sourceTree = "<group>"; };
+ F55B3D8D1251F12D003EF269 /* ImageInputType.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ImageInputType.cpp; sourceTree = "<group>"; };
+ F55B3D8E1251F12D003EF269 /* ImageInputType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ImageInputType.h; sourceTree = "<group>"; };
+ F55B3D8F1251F12D003EF269 /* IsIndexInputType.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IsIndexInputType.cpp; sourceTree = "<group>"; };
+ F55B3D901251F12D003EF269 /* IsIndexInputType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IsIndexInputType.h; sourceTree = "<group>"; };
+ F55B3D911251F12D003EF269 /* MonthInputType.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MonthInputType.cpp; sourceTree = "<group>"; };
+ F55B3D921251F12D003EF269 /* MonthInputType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MonthInputType.h; sourceTree = "<group>"; };
+ F55B3D931251F12D003EF269 /* NumberInputType.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NumberInputType.cpp; sourceTree = "<group>"; };
+ F55B3D941251F12D003EF269 /* NumberInputType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NumberInputType.h; sourceTree = "<group>"; };
+ F55B3D951251F12D003EF269 /* PasswordInputType.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PasswordInputType.cpp; sourceTree = "<group>"; };
+ F55B3D961251F12D003EF269 /* PasswordInputType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PasswordInputType.h; sourceTree = "<group>"; };
+ F55B3D971251F12D003EF269 /* RadioInputType.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RadioInputType.cpp; sourceTree = "<group>"; };
+ F55B3D981251F12D003EF269 /* RadioInputType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RadioInputType.h; sourceTree = "<group>"; };
+ F55B3D991251F12D003EF269 /* RangeInputType.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RangeInputType.cpp; sourceTree = "<group>"; };
+ F55B3D9A1251F12D003EF269 /* RangeInputType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RangeInputType.h; sourceTree = "<group>"; };
+ F55B3D9B1251F12D003EF269 /* ResetInputType.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ResetInputType.cpp; sourceTree = "<group>"; };
+ F55B3D9C1251F12D003EF269 /* ResetInputType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ResetInputType.h; sourceTree = "<group>"; };
+ F55B3D9D1251F12D003EF269 /* SearchInputType.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SearchInputType.cpp; sourceTree = "<group>"; };
+ F55B3D9E1251F12D003EF269 /* SearchInputType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SearchInputType.h; sourceTree = "<group>"; };
+ F55B3D9F1251F12D003EF269 /* SubmitInputType.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SubmitInputType.cpp; sourceTree = "<group>"; };
+ F55B3DA01251F12D003EF269 /* SubmitInputType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SubmitInputType.h; sourceTree = "<group>"; };
+ F55B3DA11251F12D003EF269 /* TelephoneInputType.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TelephoneInputType.cpp; sourceTree = "<group>"; };
+ F55B3DA21251F12D003EF269 /* TelephoneInputType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TelephoneInputType.h; sourceTree = "<group>"; };
+ F55B3DA31251F12D003EF269 /* TextFieldInputType.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TextFieldInputType.cpp; sourceTree = "<group>"; };
+ F55B3DA41251F12D003EF269 /* TextFieldInputType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextFieldInputType.h; sourceTree = "<group>"; };
+ F55B3DA51251F12D003EF269 /* TextInputType.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TextInputType.cpp; sourceTree = "<group>"; };
+ F55B3DA61251F12D003EF269 /* TextInputType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextInputType.h; sourceTree = "<group>"; };
+ F55B3DA71251F12D003EF269 /* TimeInputType.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TimeInputType.cpp; sourceTree = "<group>"; };
+ F55B3DA81251F12D003EF269 /* TimeInputType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TimeInputType.h; sourceTree = "<group>"; };
+ F55B3DA91251F12D003EF269 /* URLInputType.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = URLInputType.cpp; sourceTree = "<group>"; };
+ F55B3DAA1251F12D003EF269 /* URLInputType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = URLInputType.h; sourceTree = "<group>"; };
+ F55B3DAB1251F12D003EF269 /* WeekInputType.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WeekInputType.cpp; sourceTree = "<group>"; };
+ F55B3DAC1251F12D003EF269 /* WeekInputType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WeekInputType.h; sourceTree = "<group>"; };
F58784F002DE375901EA4122 /* CursorMac.mm */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CursorMac.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
F587851502DE375901EA4122 /* DeprecatedPtrListImpl.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = DeprecatedPtrListImpl.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
F587851602DE375901EA4122 /* DeprecatedPtrListImpl.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DeprecatedPtrListImpl.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
@@ -13520,6 +13645,8 @@
children = (
2E2D99E510E2BC1C00496337 /* DOMBlob.h */,
2E2D99E610E2BC1C00496337 /* DOMBlob.mm */,
+ 769456591214DB630007CBAE /* DOMDOMTokenList.h */,
+ 7694565A1214DB630007CBAE /* DOMDOMTokenList.mm */,
BC00EFFE0E0A185500FD04E3 /* DOMFile.h */,
BC00EFFF0E0A185500FD04E3 /* DOMFile.mm */,
2E3BC106117D479800B9409A /* DOMFileError.h */,
@@ -14126,9 +14253,17 @@
97C1F5511228558800EDE616 /* parser */,
B0149E7911A4B21500196A7B /* AsyncImageResizer.cpp */,
B0149E7A11A4B21500196A7B /* AsyncImageResizer.h */,
+ F55B3D791251F12D003EF269 /* BaseTextInputType.cpp */,
+ F55B3D7A1251F12D003EF269 /* BaseTextInputType.h */,
+ F55B3D7B1251F12D003EF269 /* ButtonInputType.cpp */,
+ F55B3D7C1251F12D003EF269 /* ButtonInputType.h */,
+ F55B3D7D1251F12D003EF269 /* CheckboxInputType.cpp */,
+ F55B3D7E1251F12D003EF269 /* CheckboxInputType.h */,
93C441ED0F813A1A00C1A634 /* CollectionCache.cpp */,
93C441EE0F813A1A00C1A634 /* CollectionCache.h */,
93C441FF0F813AE100C1A634 /* CollectionType.h */,
+ F55B3D7F1251F12D003EF269 /* ColorInputType.cpp */,
+ F55B3D801251F12D003EF269 /* ColorInputType.h */,
BC77D2380FF298080070887B /* DataGridColumn.cpp */,
BC77CFC10FF175550070887B /* DataGridColumn.h */,
BC77CF9E0FF172B30070887B /* DataGridColumn.idl */,
@@ -14138,15 +14273,30 @@
BCBCAE360FF19385000762AE /* DataGridDataSource.h */,
F5D3A57A106B83B300545297 /* DateComponents.cpp */,
F5D3A57B106B83B300545297 /* DateComponents.h */,
+ F55B3D811251F12D003EF269 /* DateInputType.cpp */,
+ F55B3D821251F12D003EF269 /* DateInputType.h */,
+ F55B3D831251F12D003EF269 /* DateTimeInputType.cpp */,
+ F55B3D841251F12D003EF269 /* DateTimeInputType.h */,
+ F55B3D851251F12D003EF269 /* DateTimeLocalInputType.cpp */,
+ F55B3D861251F12D003EF269 /* DateTimeLocalInputType.h */,
BC7DAAEC0FF9615D00CE0138 /* DOMDataGridDataSource.cpp */,
BC7DAAED0FF9615D00CE0138 /* DOMDataGridDataSource.h */,
2ED609BA1145B07100C8684E /* DOMFormData.cpp */,
2ED609BB1145B07100C8684E /* DOMFormData.h */,
2E0888C3114883A900AF4265 /* DOMFormData.idl */,
+ 76FC2B0812370DA0006A991A /* DOMTokenList.cpp */,
+ 76FC2B0912370DA0006A991A /* DOMTokenList.h */,
+ 76FC2B0A12370DA0006A991A /* DOMTokenList.idl */,
+ F55B3D871251F12D003EF269 /* EmailInputType.cpp */,
+ F55B3D881251F12D003EF269 /* EmailInputType.h */,
+ F55B3D891251F12D003EF269 /* FileInputType.cpp */,
+ F55B3D8A1251F12D003EF269 /* FileInputType.h */,
A8136D370973A8E700D74463 /* FormDataList.cpp */,
A8136D360973A8E700D74463 /* FormDataList.h */,
97205AAD123928CA00B17380 /* FTPDirectoryDocument.cpp */,
97205AAE123928CA00B17380 /* FTPDirectoryDocument.h */,
+ F55B3D8B1251F12D003EF269 /* HiddenInputType.cpp */,
+ F55B3D8C1251F12D003EF269 /* HiddenInputType.h */,
BC97E239109144950010D361 /* HTMLAllCollection.cpp */,
BC97E238109144950010D361 /* HTMLAllCollection.h */,
BC97E23C109146F10010D361 /* HTMLAllCollection.idl */,
@@ -14399,30 +14549,64 @@
A77979150D6B9D0C003851B9 /* ImageData.idl */,
97205AB11239291000B17380 /* ImageDocument.cpp */,
97205AB21239291000B17380 /* ImageDocument.h */,
+ F55B3D8D1251F12D003EF269 /* ImageInputType.cpp */,
+ F55B3D8E1251F12D003EF269 /* ImageInputType.h */,
B0149E7B11A4B21500196A7B /* ImageResizerThread.cpp */,
B0149E7C11A4B21500196A7B /* ImageResizerThread.h */,
+ 37E3524A12450C5200BAF5D9 /* InputType.cpp */,
+ 37E3524C12450C6600BAF5D9 /* InputType.h */,
+ F55B3D8F1251F12D003EF269 /* IsIndexInputType.cpp */,
+ F55B3D901251F12D003EF269 /* IsIndexInputType.h */,
A456FA2411AD4A830020B420 /* LabelsNodeList.cpp */,
A456FA2511AD4A830020B420 /* LabelsNodeList.h */,
97205AB31239291000B17380 /* MediaDocument.cpp */,
97205AB41239291000B17380 /* MediaDocument.h */,
E446139B0CD6331000FADA75 /* MediaError.h */,
E446139C0CD6331000FADA75 /* MediaError.idl */,
+ F55B3D911251F12D003EF269 /* MonthInputType.cpp */,
+ F55B3D921251F12D003EF269 /* MonthInputType.h */,
+ F55B3D931251F12D003EF269 /* NumberInputType.cpp */,
+ F55B3D941251F12D003EF269 /* NumberInputType.h */,
+ F55B3D951251F12D003EF269 /* PasswordInputType.cpp */,
+ F55B3D961251F12D003EF269 /* PasswordInputType.h */,
97205AB91239292700B17380 /* PluginDocument.cpp */,
97205ABA1239292700B17380 /* PluginDocument.h */,
+ F55B3D971251F12D003EF269 /* RadioInputType.cpp */,
+ F55B3D981251F12D003EF269 /* RadioInputType.h */,
+ F55B3D991251F12D003EF269 /* RangeInputType.cpp */,
+ F55B3D9A1251F12D003EF269 /* RangeInputType.h */,
+ F55B3D9B1251F12D003EF269 /* ResetInputType.cpp */,
+ F55B3D9C1251F12D003EF269 /* ResetInputType.h */,
+ F55B3D9D1251F12D003EF269 /* SearchInputType.cpp */,
+ F55B3D9E1251F12D003EF269 /* SearchInputType.h */,
A5AFB34D115151A700B045CB /* StepRange.cpp */,
A5AFB34E115151A700B045CB /* StepRange.h */,
+ F55B3D9F1251F12D003EF269 /* SubmitInputType.cpp */,
+ F55B3DA01251F12D003EF269 /* SubmitInputType.h */,
+ F55B3DA11251F12D003EF269 /* TelephoneInputType.cpp */,
+ F55B3DA21251F12D003EF269 /* TelephoneInputType.h */,
97BC84B112371180000C6161 /* TextDocument.cpp */,
97BC84B212371180000C6161 /* TextDocument.h */,
+ F55B3DA31251F12D003EF269 /* TextFieldInputType.cpp */,
+ F55B3DA41251F12D003EF269 /* TextFieldInputType.h */,
+ F55B3DA51251F12D003EF269 /* TextInputType.cpp */,
+ F55B3DA61251F12D003EF269 /* TextInputType.h */,
BCEF45E80E687767001C1287 /* TextMetrics.h */,
BCEF453F0E676AC1001C1287 /* TextMetrics.idl */,
+ F55B3DA71251F12D003EF269 /* TimeInputType.cpp */,
+ F55B3DA81251F12D003EF269 /* TimeInputType.h */,
E446139D0CD6331000FADA75 /* TimeRanges.cpp */,
E446139E0CD6331000FADA75 /* TimeRanges.h */,
E446139F0CD6331000FADA75 /* TimeRanges.idl */,
+ F55B3DA91251F12D003EF269 /* URLInputType.cpp */,
+ F55B3DAA1251F12D003EF269 /* URLInputType.h */,
15C7708B100D3C6A005BA267 /* ValidityState.cpp */,
15C7708A100D3C6A005BA267 /* ValidityState.h */,
15C77089100D3C6A005BA267 /* ValidityState.idl */,
E44613B40CD6344E00FADA75 /* VoidCallback.h */,
E44613A00CD6331000FADA75 /* VoidCallback.idl */,
+ F55B3DAB1251F12D003EF269 /* WeekInputType.cpp */,
+ F55B3DAC1251F12D003EF269 /* WeekInputType.h */,
);
path = html;
sourceTree = "<group>";
@@ -14433,6 +14617,7 @@
isa = PBXGroup;
children = (
976D6C58122B8A3D001FD1F7 /* AsyncFileWriter.h */,
+ 976D6C74122B8A3D001FD1F7 /* AsyncFileWriterClient.h */,
976D6C59122B8A3D001FD1F7 /* Blob.cpp */,
976D6C5A122B8A3D001FD1F7 /* Blob.h */,
976D6C5C122B8A3D001FD1F7 /* BlobBuilder.cpp */,
@@ -14478,7 +14663,6 @@
976D6C71122B8A3D001FD1F7 /* FileWriter.cpp */,
976D6C72122B8A3D001FD1F7 /* FileWriter.h */,
893C47A61238908B002B3D86 /* FileWriterCallback.h */,
- 976D6C74122B8A3D001FD1F7 /* FileWriterClient.h */,
8987854D122CA064003AABDA /* Flags.h */,
8987854E122CA064003AABDA /* LocalFileSystem.cpp */,
8987854F122CA064003AABDA /* LocalFileSystem.h */,
@@ -14565,6 +14749,7 @@
A75E8B7F0E1DE2B0007F2481 /* filters */ = {
isa = PBXGroup;
children = (
+ 84730D5A1248F0B300D3A9C9 /* DistantLightSource.h */,
A75E8B800E1DE2D6007F2481 /* FEBlend.cpp */,
A75E8B810E1DE2D6007F2481 /* FEBlend.h */,
A75E8B820E1DE2D6007F2481 /* FEColorMatrix.cpp */,
@@ -14573,15 +14758,41 @@
A75E8B850E1DE2D6007F2481 /* FEComponentTransfer.h */,
A75E8B860E1DE2D6007F2481 /* FEComposite.cpp */,
A75E8B870E1DE2D6007F2481 /* FEComposite.h */,
+ 84730D5B1248F0B300D3A9C9 /* FEConvolveMatrix.cpp */,
+ 84730D5C1248F0B300D3A9C9 /* FEConvolveMatrix.h */,
+ 84730D5D1248F0B300D3A9C9 /* FEDiffuseLighting.cpp */,
+ 84730D5E1248F0B300D3A9C9 /* FEDiffuseLighting.h */,
+ 84730D5F1248F0B300D3A9C9 /* FEDisplacementMap.cpp */,
+ 84730D601248F0B300D3A9C9 /* FEDisplacementMap.h */,
+ 84730D611248F0B300D3A9C9 /* FEFlood.cpp */,
+ 84730D621248F0B300D3A9C9 /* FEFlood.h */,
84801952108BAFB300CB2B1F /* FEGaussianBlur.cpp */,
84801953108BAFB300CB2B1F /* FEGaussianBlur.h */,
+ 84730D631248F0B300D3A9C9 /* FELighting.cpp */,
+ 84730D641248F0B300D3A9C9 /* FELighting.h */,
+ 84730D651248F0B300D3A9C9 /* FEMerge.cpp */,
+ 84730D661248F0B300D3A9C9 /* FEMerge.h */,
+ 84730D671248F0B300D3A9C9 /* FEMorphology.cpp */,
+ 84730D681248F0B300D3A9C9 /* FEMorphology.h */,
+ 84730D691248F0B300D3A9C9 /* FEOffset.cpp */,
+ 84730D6A1248F0B300D3A9C9 /* FEOffset.h */,
+ 84730D6B1248F0B300D3A9C9 /* FESpecularLighting.cpp */,
+ 84730D6C1248F0B300D3A9C9 /* FESpecularLighting.h */,
+ 84730D6D1248F0B300D3A9C9 /* FETile.cpp */,
+ 84730D6E1248F0B300D3A9C9 /* FETile.h */,
+ 84730D6F1248F0B300D3A9C9 /* FETurbulence.cpp */,
+ 84730D701248F0B300D3A9C9 /* FETurbulence.h */,
845E72F70FD261EE00A87D79 /* Filter.h */,
08C925170FCC7C4A00480DEC /* FilterEffect.cpp */,
08C925180FCC7C4A00480DEC /* FilterEffect.h */,
+ 84730D731248F0B300D3A9C9 /* LightSource.cpp */,
+ 84730D741248F0B300D3A9C9 /* LightSource.h */,
+ 84730D751248F0B300D3A9C9 /* PointLightSource.h */,
84A81F3B0FC7DFF000955300 /* SourceAlpha.cpp */,
84A81F3C0FC7DFF000955300 /* SourceAlpha.h */,
84A81F3F0FC7E02700955300 /* SourceGraphic.cpp */,
84A81F400FC7E02700955300 /* SourceGraphic.h */,
+ 84730D761248F0B300D3A9C9 /* SpotLightSource.h */,
);
name = filters;
sourceTree = "<group>";
@@ -14607,6 +14818,8 @@
BC77D1680FF19F550070887B /* JSDataGridColumnList.h */,
2E0888D21148848A00AF4265 /* JSDOMFormData.cpp */,
2E0888D31148848A00AF4265 /* JSDOMFormData.h */,
+ 7694563A1214D97C0007CBAE /* JSDOMTokenList.cpp */,
+ 7694563B1214D97C0007CBAE /* JSDOMTokenList.h */,
49EECEF4105070C400099FAB /* JSFloat32Array.cpp */,
49EECEF5105070C400099FAB /* JSFloat32Array.h */,
BC97E410109154FA0010D361 /* JSHTMLAllCollection.cpp */,
@@ -15857,39 +16070,12 @@
B255989C0D00D8B800BB825C /* filters */ = {
isa = PBXGroup;
children = (
- B25598D70D00D8B900BB825C /* SVGDistantLightSource.h */,
- B25598E00D00D8B900BB825C /* SVGFEConvolveMatrix.cpp */,
- B25598E10D00D8B900BB825C /* SVGFEConvolveMatrix.h */,
- B25598E20D00D8B900BB825C /* SVGFEDiffuseLighting.cpp */,
- B25598E30D00D8B900BB825C /* SVGFEDiffuseLighting.h */,
- B25598E40D00D8B900BB825C /* SVGFEDisplacementMap.cpp */,
- B25598E50D00D8B900BB825C /* SVGFEDisplacementMap.h */,
- B25598E60D00D8B900BB825C /* SVGFEFlood.cpp */,
- B25598E70D00D8B900BB825C /* SVGFEFlood.h */,
B25598EA0D00D8B900BB825C /* SVGFEImage.cpp */,
B25598EB0D00D8B900BB825C /* SVGFEImage.h */,
- E440A2D41191A50B000820B0 /* SVGFELighting.cpp */,
- E440A2D61191A523000820B0 /* SVGFELighting.h */,
- B25598EC0D00D8B900BB825C /* SVGFEMerge.cpp */,
- B25598ED0D00D8B900BB825C /* SVGFEMerge.h */,
- B25598EE0D00D8B900BB825C /* SVGFEMorphology.cpp */,
- B25598EF0D00D8B900BB825C /* SVGFEMorphology.h */,
- B25598F00D00D8B900BB825C /* SVGFEOffset.cpp */,
- B25598F10D00D8B900BB825C /* SVGFEOffset.h */,
- B25598F20D00D8B900BB825C /* SVGFESpecularLighting.cpp */,
- B25598F30D00D8B900BB825C /* SVGFESpecularLighting.h */,
- A7D27FC30E0A599F0079AD2B /* SVGFETile.cpp */,
- B25598F40D00D8B900BB825C /* SVGFETile.h */,
- B25598F50D00D8B900BB825C /* SVGFETurbulence.cpp */,
- B25598F60D00D8B900BB825C /* SVGFETurbulence.h */,
845E72F90FD2623900A87D79 /* SVGFilter.cpp */,
845E72FA0FD2623900A87D79 /* SVGFilter.h */,
081EBF380FD34F4100DA7559 /* SVGFilterBuilder.cpp */,
081EBF390FD34F4100DA7559 /* SVGFilterBuilder.h */,
- B25598F90D00D8B900BB825C /* SVGLightSource.cpp */,
- B25598FA0D00D8B900BB825C /* SVGLightSource.h */,
- B25598FB0D00D8B900BB825C /* SVGPointLightSource.h */,
- B25598FC0D00D8B900BB825C /* SVGSpotLightSource.h */,
);
path = filters;
sourceTree = "<group>";
@@ -17618,8 +17804,8 @@
93831B560D087D6000E5C984 /* ExceptionCode.cpp */,
935FBCF109BA143B00E230B1 /* ExceptionCode.h */,
A853123C11D0471B00D4D077 /* FragmentScriptingPermission.h */,
- 8482B7441198C32E00BFB005 /* HashChangeEvent.idl */,
2442BBF81194C9D300D49469 /* HashChangeEvent.h */,
+ 8482B7441198C32E00BFB005 /* HashChangeEvent.idl */,
08700BE60F086C5300919419 /* InputElement.cpp */,
08591AA40F085C4E009BACB1 /* InputElement.h */,
85031B2D0A44EFC700F992E0 /* KeyboardEvent.cpp */,
@@ -17876,6 +18062,7 @@
89D08DA012228451001241DF /* AsyncFileSystem.h in Headers */,
89D08DA112228451001241DF /* AsyncFileSystemCallbacks.h in Headers */,
976D6C77122B8A3D001FD1F7 /* AsyncFileWriter.h in Headers */,
+ 976D6C93122B8A3D001FD1F7 /* AsyncFileWriterClient.h in Headers */,
B0149E7E11A4B21500196A7B /* AsyncImageResizer.h in Headers */,
8A413AE01207BBA50082016E /* AsyncScriptRunner.h in Headers */,
37C61F0112095C87007A3C67 /* AtomicStringKeyedMRUCache.h in Headers */,
@@ -17894,6 +18081,7 @@
BCA8CA6011E4E6D100812FB7 /* BackForwardListImpl.h in Headers */,
BC124EE80C2641CD009E2349 /* BarInfo.h in Headers */,
B2C3DA220D006C1D00EF6F26 /* Base64.h in Headers */,
+ F55B3DAE1251F12D003EF269 /* BaseTextInputType.h in Headers */,
BC9462D8107A7B4C00857193 /* BeforeLoadEvent.h in Headers */,
51721FBB11D2790700638B42 /* BeforeProcessEvent.h in Headers */,
AB23A32809BBA7D00067CC53 /* BeforeTextInsertedEvent.h in Headers */,
@@ -17921,6 +18109,7 @@
93309DDB099E64920056E581 /* BreakBlockquoteCommand.h in Headers */,
599E759011055A1F00D904FA /* Bridge.h in Headers */,
59B5977511086579007159E8 /* BridgeJSC.h in Headers */,
+ F55B3DB01251F12D003EF269 /* ButtonInputType.h in Headers */,
1A569CF80D7E2B82007C3983 /* c_class.h in Headers */,
1A569CFA0D7E2B82007C3983 /* c_instance.h in Headers */,
1A569CFC0D7E2B82007C3983 /* c_runtime.h in Headers */,
@@ -17953,6 +18142,7 @@
6550B6A0099DF0270090D781 /* CharacterData.h in Headers */,
B2C3DA260D006C1D00EF6F26 /* CharacterNames.h in Headers */,
B2C3DA2A0D006C1D00EF6F26 /* CharsetData.h in Headers */,
+ F55B3DB21251F12D003EF269 /* CheckboxInputType.h in Headers */,
A00B721A11DE6428008AB9FF /* CheckedInt.h in Headers */,
93F925430F7EF5B8007E37C9 /* CheckedRadioButtons.h in Headers */,
A81872200977D3C0005826D9 /* ChildNodeList.h in Headers */,
@@ -17971,6 +18161,7 @@
93C442000F813AE100C1A634 /* CollectionType.h in Headers */,
B27535670B053814002CE64F /* Color.h in Headers */,
B22279630D00BF220071B782 /* ColorDistance.h in Headers */,
+ F55B3DB41251F12D003EF269 /* ColorInputType.h in Headers */,
EDE3A5000C7A430600956A37 /* ColorMac.h in Headers */,
9382DF5810A8D5C900925652 /* ColorSpace.h in Headers */,
BCDD454E1236C95C009A7985 /* ColumnInfo.h in Headers */,
@@ -18082,6 +18273,9 @@
BC22746F0E83664500E7F975 /* DataRef.h in Headers */,
BC64641C11D7F416006455B0 /* DatasetDOMStringMap.h in Headers */,
F5D3A57D106B83B300545297 /* DateComponents.h in Headers */,
+ F55B3DB61251F12D003EF269 /* DateInputType.h in Headers */,
+ F55B3DB81251F12D003EF269 /* DateTimeInputType.h in Headers */,
+ F55B3DBA1251F12D003EF269 /* DateTimeLocalInputType.h in Headers */,
A8C228A111D5722E00D5A7D3 /* DecodedDataDocumentParser.h in Headers */,
4162A451101145AE00DFF3ED /* DedicatedWorkerContext.h in Headers */,
41A3D58F101C152D00316D07 /* DedicatedWorkerThread.h in Headers */,
@@ -18103,6 +18297,7 @@
59A85EA4119D68EC00DEF1EF /* DeviceOrientationEvent.h in Headers */,
89878553122CA064003AABDA /* DirectoryEntry.h in Headers */,
89878555122CA064003AABDA /* DirectoryReader.h in Headers */,
+ 84730D771248F0B300D3A9C9 /* DistantLightSource.h in Headers */,
B2F34FE60E82F81400F627CD /* DNS.h in Headers */,
A8185F4009765766005826D9 /* Document.h in Headers */,
A8185F3D09765766005826D9 /* DocumentFragment.h in Headers */,
@@ -18176,6 +18371,7 @@
85E711960AC5D5350053270F /* DOMDocumentTypeInternal.h in Headers */,
8518DCE90A9CC80D0091B7A6 /* DOMDOMImplementation.h in Headers */,
85E711970AC5D5350053270F /* DOMDOMImplementationInternal.h in Headers */,
+ 7694565B1214DB630007CBAE /* DOMDOMTokenList.h in Headers */,
85ACA9C00A9B5FA500671E90 /* DOMElement.h in Headers */,
85E711980AC5D5350053270F /* DOMElementInternal.h in Headers */,
E415F1690D9A165D0033CE97 /* DOMElementTimeControl.h in Headers */,
@@ -18837,6 +19033,7 @@
DDE63ED50B7D45A800226998 /* DOMTextEvent.h in Headers */,
85E711D90AC5D5350053270F /* DOMTextInternal.h in Headers */,
188604B40F2E654A000B6443 /* DOMTimer.h in Headers */,
+ 76FC2B0C12370DA0006A991A /* DOMTokenList.h in Headers */,
BC1A37BE097C715F0019F3D8 /* DOMTraversal.h in Headers */,
85526CD20AB0B7D9000302EA /* DOMTreeWalker.h in Headers */,
850B41C30AD9E7E700A6ED4F /* DOMTreeWalkerInternal.h in Headers */,
@@ -18886,6 +19083,7 @@
63F5D4F70E8C4B7100C0BD04 /* ElementRareData.h in Headers */,
E415F1840D9A1A830033CE97 /* ElementTimeControl.h in Headers */,
A8CFF6BE0A156118000A4234 /* EllipsisBox.h in Headers */,
+ F55B3DBC1251F12D003EF269 /* EmailInputType.h in Headers */,
B25599A50D00D8BA00BB825C /* EmptyClients.h in Headers */,
5DC87EF011716DF2001C0E6D /* EmptyProtocolDefinitions.h in Headers */,
A8EA7EC20A1945D000A8EF5F /* Entity.h in Headers */,
@@ -18911,13 +19109,25 @@
A75E8B8B0E1DE2D6007F2481 /* FEColorMatrix.h in Headers */,
A75E8B8D0E1DE2D6007F2481 /* FEComponentTransfer.h in Headers */,
A75E8B8F0E1DE2D6007F2481 /* FEComposite.h in Headers */,
+ 84730D791248F0B300D3A9C9 /* FEConvolveMatrix.h in Headers */,
+ 84730D7B1248F0B300D3A9C9 /* FEDiffuseLighting.h in Headers */,
+ 84730D7D1248F0B300D3A9C9 /* FEDisplacementMap.h in Headers */,
+ 84730D7F1248F0B300D3A9C9 /* FEFlood.h in Headers */,
84801955108BAFB300CB2B1F /* FEGaussianBlur.h in Headers */,
+ 84730D811248F0B300D3A9C9 /* FELighting.h in Headers */,
+ 84730D831248F0B300D3A9C9 /* FEMerge.h in Headers */,
+ 84730D851248F0B300D3A9C9 /* FEMorphology.h in Headers */,
+ 84730D871248F0B300D3A9C9 /* FEOffset.h in Headers */,
+ 84730D891248F0B300D3A9C9 /* FESpecularLighting.h in Headers */,
+ 84730D8B1248F0B300D3A9C9 /* FETile.h in Headers */,
+ 84730D8D1248F0B300D3A9C9 /* FETurbulence.h in Headers */,
976D6C81122B8A3D001FD1F7 /* File.h in Headers */,
893C47A71238908B002B3D86 /* FileCallback.h in Headers */,
066C772B0AB603B700238CC4 /* FileChooser.h in Headers */,
89878562122CA064003AABDA /* FileEntry.h in Headers */,
976D6C83122B8A3D001FD1F7 /* FileError.h in Headers */,
2EDF369F122C94C8002F7D4E /* FileException.h in Headers */,
+ F55B3DBE1251F12D003EF269 /* FileInputType.h in Headers */,
976D6C86122B8A3D001FD1F7 /* FileList.h in Headers */,
976D6C89122B8A3D001FD1F7 /* FileReader.h in Headers */,
2EDF369D122C94B4002F7D4E /* FileReaderSync.h in Headers */,
@@ -18931,7 +19141,6 @@
976D6C8F122B8A3D001FD1F7 /* FileThreadTask.h in Headers */,
976D6C91122B8A3D001FD1F7 /* FileWriter.h in Headers */,
893C47A81238908B002B3D86 /* FileWriterCallback.h in Headers */,
- 976D6C93122B8A3D001FD1F7 /* FileWriterClient.h in Headers */,
BC5EB69F0E81DAEB00B25965 /* FillLayer.h in Headers */,
845E72F80FD261EE00A87D79 /* Filter.h in Headers */,
08C9251A0FCC7C4A00480DEC /* FilterEffect.h in Headers */,
@@ -19010,6 +19219,7 @@
C50B561712119D23008B46E0 /* GroupSettings.h in Headers */,
7693BAD2106C2DCA007B0823 /* HaltablePlugin.h in Headers */,
8482B7461198C35400BFB005 /* HashChangeEvent.h in Headers */,
+ F55B3DC01251F12D003EF269 /* HiddenInputType.h in Headers */,
BC94D1540C275C8B006BC617 /* History.h in Headers */,
97DCE20210807C750057D394 /* HistoryController.h in Headers */,
51741D110B07259A00ED442C /* HistoryItem.h in Headers */,
@@ -19169,6 +19379,7 @@
BCA979171215D055005C485C /* ImageBufferData.h in Headers */,
A779791A0D6B9D0C003851B9 /* ImageData.h in Headers */,
97205AB61239291000B17380 /* ImageDocument.h in Headers */,
+ F55B3DC21251F12D003EF269 /* ImageInputType.h in Headers */,
089582560E857A7E00F82C83 /* ImageLoader.h in Headers */,
BC7F44A80B9E324E00A9D081 /* ImageObserver.h in Headers */,
B0149E8011A4B21500196A7B /* ImageResizerThread.h in Headers */,
@@ -19183,6 +19394,7 @@
BCE789161120D6080060ECE5 /* InlineIterator.h in Headers */,
BCEA485A097D93020094C9E4 /* InlineTextBox.h in Headers */,
08591AA50F085C4E009BACB1 /* InputElement.h in Headers */,
+ 37E3524D12450C6600BAF5D9 /* InputType.h in Headers */,
93309DEA099E64920056E581 /* InsertIntoTextNodeCommand.h in Headers */,
93309DEC099E64920056E581 /* InsertLineBreakCommand.h in Headers */,
D07DEABA0A36554A00CA30F8 /* InsertListCommand.h in Headers */,
@@ -19217,6 +19429,7 @@
B27535740B053814002CE64F /* IntRect.h in Headers */,
B27535750B053814002CE64F /* IntSize.h in Headers */,
B27535760B053814002CE64F /* IntSizeHash.h in Headers */,
+ F55B3DC41251F12D003EF269 /* IsIndexInputType.h in Headers */,
59E560A71105336600AA1258 /* JavaClassJSC.h in Headers */,
59A9E7B21104759400DFB4C1 /* JavaInstanceJSC.h in Headers */,
E16982681134680700894115 /* JavaRuntimeObject.h in Headers */,
@@ -19306,6 +19519,7 @@
BC5A86B60C3367E800EEA649 /* JSDOMSelection.h in Headers */,
C5137CF311A58378004ADB99 /* JSDOMStringList.h in Headers */,
BC64649811D82349006455B0 /* JSDOMStringMap.h in Headers */,
+ 7694563D1214D97C0007CBAE /* JSDOMTokenList.h in Headers */,
BC6932740D7E293900AE44D1 /* JSDOMWindowBase.h in Headers */,
652FBBBC0DE27CB60001D386 /* JSDOMWindowCustom.h in Headers */,
BCBFB53D0DCD29CF0019B3E5 /* JSDOMWindowShell.h in Headers */,
@@ -19698,6 +19912,7 @@
BCE65BEB0EACDF16007E4533 /* Length.h in Headers */,
BCFF64910EAD15C200C1D6F7 /* LengthBox.h in Headers */,
BCFF64920EAD15C200C1D6F7 /* LengthSize.h in Headers */,
+ 84730D911248F0B300D3A9C9 /* LightSource.h in Headers */,
B22279650D00BF220071B782 /* LinearGradientAttributes.h in Headers */,
AB31C91E10AE1B8E000C7B92 /* LineClampValue.h in Headers */,
89B5EAA211E8003D00F2367E /* LineEnding.h in Headers */,
@@ -19744,6 +19959,7 @@
8987856A122CA064003AABDA /* MetadataCallback.h in Headers */,
BC772C4F0C4EB3040083285F /* MIMETypeRegistry.h in Headers */,
C6D74AD509AA282E000B0A52 /* ModifySelectionListLevel.h in Headers */,
+ F55B3DC61251F12D003EF269 /* MonthInputType.h in Headers */,
85031B460A44EFC700F992E0 /* MouseEvent.h in Headers */,
935C476309AC4CE600A6AAB4 /* MouseEventWithHitTestResults.h in Headers */,
85031B480A44EFC700F992E0 /* MouseRelatedEvent.h in Headers */,
@@ -19781,6 +19997,7 @@
1A569D100D7E2B82007C3983 /* npruntime_internal.h in Headers */,
1A569D110D7E2B82007C3983 /* npruntime_priv.h in Headers */,
1A27CF97118A354C0041D632 /* nptypes.h in Headers */,
+ F55B3DC81251F12D003EF269 /* NumberInputType.h in Headers */,
1A569D120D7E2B82007C3983 /* objc_class.h in Headers */,
1A569D140D7E2B82007C3983 /* objc_header.h in Headers */,
1A569D150D7E2B82007C3983 /* objc_instance.h in Headers */,
@@ -19808,6 +20025,7 @@
0885068011DA045B00182B98 /* PaintPhase.h in Headers */,
A80E6CFB0A1989CA007FB8C5 /* Pair.h in Headers */,
BC76AC130DD7AD5C00415F34 /* ParserUtilities.h in Headers */,
+ F55B3DCA1251F12D003EF269 /* PasswordInputType.h in Headers */,
4B2708C70AF19EE40065127F /* Pasteboard.h in Headers */,
A7D3C5240B576B4B002CA450 /* PasteboardHelper.h in Headers */,
B27535800B053814002CE64F /* Path.h in Headers */,
@@ -19837,6 +20055,7 @@
1AA8799011CBE846003C664F /* PluginStrategy.h in Headers */,
0AFDAC3D10F5448C00E1F3D2 /* PluginViewBase.h in Headers */,
B2B1F7170D00CAA8004AEA64 /* PointerEventsHitRules.h in Headers */,
+ 84730D921248F0B300D3A9C9 /* PointLightSource.h in Headers */,
97059978107D975200A50A7C /* PolicyCallback.h in Headers */,
9705997A107D975200A50A7C /* PolicyChecker.h in Headers */,
5174E20A10A1F44F00F95E6F /* PopStateEvent.h in Headers */,
@@ -19859,9 +20078,11 @@
E4D687790ED7AE4F006EA978 /* PurgeableBuffer.h in Headers */,
550A0BCA085F6039007353D6 /* QualifiedName.h in Headers */,
B22279720D00BF220071B782 /* RadialGradientAttributes.h in Headers */,
+ F55B3DCC1251F12D003EF269 /* RadioInputType.h in Headers */,
93F1991808245E59001E9ABC /* Range.h in Headers */,
93D9D53C0DA27E180077216C /* RangeBoundaryPoint.h in Headers */,
D23CA56C0AB0EB8D005108A5 /* RangeException.h in Headers */,
+ F55B3DCE1251F12D003EF269 /* RangeInputType.h in Headers */,
A84D827C11D333ED00972990 /* RawDataDocumentParser.h in Headers */,
BC4368E80C226E32005EFB5F /* Rect.h in Headers */,
979F43D41075E44A0000F83B /* RedirectScheduler.h in Headers */,
@@ -19983,6 +20204,7 @@
A89CCC530F44E98100B5DA10 /* ReplaceNodeWithSpanCommand.h in Headers */,
93309E0A099E64920056E581 /* ReplaceSelectionCommand.h in Headers */,
BCB16C2F0979C3BD00467741 /* Request.h in Headers */,
+ F55B3DD01251F12D003EF269 /* ResetInputType.h in Headers */,
934F71420D5A6F4400018D69 /* ResourceError.h in Headers */,
934F713C0D5A6F1900018D69 /* ResourceErrorBase.h in Headers */,
514C76790CE923A1007EF3CD /* ResourceHandle.h in Headers */,
@@ -20045,6 +20267,7 @@
5D925B680F64D4DD00B847F0 /* ScrollBehavior.h in Headers */,
93C09C860B0657AA005ABD4D /* ScrollTypes.h in Headers */,
BC6D6E2609AF943500F59759 /* ScrollView.h in Headers */,
+ F55B3DD21251F12D003EF269 /* SearchInputType.h in Headers */,
AB7170890B3118080017123E /* SearchPopupMenu.h in Headers */,
D39D009D11F907E6006041F2 /* SearchPopupMenuMac.h in Headers */,
33C0CCD5112C5E6200CE057D /* SecureTextInput.h in Headers */,
@@ -20092,6 +20315,7 @@
93309E12099E64920056E581 /* SplitElementCommand.h in Headers */,
93309E14099E64920056E581 /* SplitTextNodeCommand.h in Headers */,
93309E16099E64920056E581 /* SplitTextNodeContainingElementCommand.h in Headers */,
+ 84730D931248F0B300D3A9C9 /* SpotLightSource.h in Headers */,
51EC92590CE90DB400F90308 /* SQLError.h in Headers */,
B56EBA8511C9FF8100B04477 /* SQLException.h in Headers */,
1A22464A0CC98DDB00C05240 /* SQLiteDatabase.h in Headers */,
@@ -20154,6 +20378,7 @@
BC5EB8100E81F2CE00B25965 /* StyleTransformData.h in Headers */,
BC5EB69A0E81DA6300B25965 /* StyleVisualData.h in Headers */,
D000ED2811C1B9CD00C47726 /* SubframeLoader.h in Headers */,
+ F55B3DD41251F12D003EF269 /* SubmitInputType.h in Headers */,
656D37480ADBA5DE00A4554D /* SubresourceLoader.h in Headers */,
1A3178930B20A81600316987 /* SubresourceLoaderClient.h in Headers */,
659A7D130B6DB4D9001155B3 /* SubstituteData.h in Headers */,
@@ -20184,7 +20409,6 @@
B22279A80D00BF220071B782 /* SVGCursorElement.h in Headers */,
B22279AE0D00BF220071B782 /* SVGDefsElement.h in Headers */,
B22279B10D00BF220071B782 /* SVGDescElement.h in Headers */,
- B25599710D00D8BA00BB825C /* SVGDistantLightSource.h in Headers */,
B22279B40D00BF220071B782 /* SVGDocument.h in Headers */,
B28C6A280D00C44800334AA4 /* SVGDocumentExtensions.h in Headers */,
B22279B70D00BF220071B782 /* SVGElement.h in Headers */,
@@ -20199,14 +20423,10 @@
B22279CB0D00BF220071B782 /* SVGFEColorMatrixElement.h in Headers */,
B22279CE0D00BF220071B782 /* SVGFEComponentTransferElement.h in Headers */,
B22279D10D00BF220071B782 /* SVGFECompositeElement.h in Headers */,
- B255997B0D00D8BA00BB825C /* SVGFEConvolveMatrix.h in Headers */,
1921327511C0E6BB00456238 /* SVGFEConvolveMatrixElement.h in Headers */,
- B255997D0D00D8BA00BB825C /* SVGFEDiffuseLighting.h in Headers */,
B22279D40D00BF220071B782 /* SVGFEDiffuseLightingElement.h in Headers */,
- B255997F0D00D8BA00BB825C /* SVGFEDisplacementMap.h in Headers */,
B22279D70D00BF220071B782 /* SVGFEDisplacementMapElement.h in Headers */,
B22279DA0D00BF220071B782 /* SVGFEDistantLightElement.h in Headers */,
- B25599810D00D8BA00BB825C /* SVGFEFlood.h in Headers */,
B22279DD0D00BF220071B782 /* SVGFEFloodElement.h in Headers */,
B22279E00D00BF220071B782 /* SVGFEFuncAElement.h in Headers */,
B22279E30D00BF220071B782 /* SVGFEFuncBElement.h in Headers */,
@@ -20216,21 +20436,14 @@
B25599850D00D8BA00BB825C /* SVGFEImage.h in Headers */,
B22279EF0D00BF220071B782 /* SVGFEImageElement.h in Headers */,
B22279F20D00BF220071B782 /* SVGFELightElement.h in Headers */,
- E440A2D71191A523000820B0 /* SVGFELighting.h in Headers */,
- B25599870D00D8BA00BB825C /* SVGFEMerge.h in Headers */,
B22279F40D00BF220071B782 /* SVGFEMergeElement.h in Headers */,
B22279F70D00BF220071B782 /* SVGFEMergeNodeElement.h in Headers */,
- B25599890D00D8BA00BB825C /* SVGFEMorphology.h in Headers */,
84224194107E78A700766A87 /* SVGFEMorphologyElement.h in Headers */,
- B255998B0D00D8BA00BB825C /* SVGFEOffset.h in Headers */,
B22279FA0D00BF220071B782 /* SVGFEOffsetElement.h in Headers */,
B22279FD0D00BF220071B782 /* SVGFEPointLightElement.h in Headers */,
- B255998D0D00D8BA00BB825C /* SVGFESpecularLighting.h in Headers */,
B2227A000D00BF220071B782 /* SVGFESpecularLightingElement.h in Headers */,
B2227A030D00BF220071B782 /* SVGFESpotLightElement.h in Headers */,
- B255998E0D00D8BA00BB825C /* SVGFETile.h in Headers */,
B2227A060D00BF220071B782 /* SVGFETileElement.h in Headers */,
- B25599900D00D8BA00BB825C /* SVGFETurbulence.h in Headers */,
B2227A090D00BF220071B782 /* SVGFETurbulenceElement.h in Headers */,
845E72FC0FD2623900A87D79 /* SVGFilter.h in Headers */,
081EBF3B0FD34F4100DA7559 /* SVGFilterBuilder.h in Headers */,
@@ -20259,7 +20472,6 @@
B2227A300D00BF220071B782 /* SVGLangSpace.h in Headers */,
B2227A330D00BF220071B782 /* SVGLength.h in Headers */,
B2227A360D00BF220071B782 /* SVGLengthList.h in Headers */,
- B25599940D00D8BA00BB825C /* SVGLightSource.h in Headers */,
B2227A390D00BF220071B782 /* SVGLinearGradientElement.h in Headers */,
B2227A3C0D00BF220071B782 /* SVGLineElement.h in Headers */,
B2227A3E0D00BF220071B782 /* SVGList.h in Headers */,
@@ -20303,7 +20515,6 @@
84300BD6120C9AAC0021954A /* SVGPathStringSource.h in Headers */,
84C5B2FB1216DC810088B53A /* SVGPathTraversalStateBuilder.h in Headers */,
B2227A880D00BF220071B782 /* SVGPatternElement.h in Headers */,
- B25599950D00D8BA00BB825C /* SVGPointLightSource.h in Headers */,
B2227A8C0D00BF220071B782 /* SVGPointList.h in Headers */,
B2227A8F0D00BF220071B782 /* SVGPolyElement.h in Headers */,
B2227A910D00BF220071B782 /* SVGPolygonElement.h in Headers */,
@@ -20324,7 +20535,6 @@
B2227AA60D00BF220071B782 /* SVGSetElement.h in Headers */,
08DAB9C31103D9C1003E7ABA /* SVGShadowTreeElements.h in Headers */,
E4AFD0100DAF335500F5F55C /* SVGSMILElement.h in Headers */,
- B25599960D00D8BA00BB825C /* SVGSpotLightSource.h in Headers */,
B2227AA90D00BF220071B782 /* SVGStopElement.h in Headers */,
B2227AAC0D00BF220071B782 /* SVGStringList.h in Headers */,
B2227AAF0D00BF220071B782 /* SVGStylable.h in Headers */,
@@ -20363,6 +20573,7 @@
93E62D9B0985F41600E1B5E3 /* SystemTime.h in Headers */,
A8CFF0510A154F09000A4234 /* TableLayout.h in Headers */,
BCE3BEC30D222B1D007E06E4 /* TagNodeList.h in Headers */,
+ F55B3DD61251F12D003EF269 /* TelephoneInputType.h in Headers */,
6550B6A6099DF0270090D781 /* Text.h in Headers */,
93309E17099E64920056E581 /* TextAffinity.h in Headers */,
B2C3DA340D006C1D00EF6F26 /* TextBoundaries.h in Headers */,
@@ -20382,7 +20593,9 @@
C105DA640F3AA6B8001DD44F /* TextEncodingDetector.h in Headers */,
B2C3DA490D006C1D00EF6F26 /* TextEncodingRegistry.h in Headers */,
933A14300B7D188600A53FFD /* TextEvent.h in Headers */,
+ F55B3DD81251F12D003EF269 /* TextFieldInputType.h in Headers */,
93309E18099E64920056E581 /* TextGranularity.h in Headers */,
+ F55B3DDA1251F12D003EF269 /* TextInputType.h in Headers */,
93309E1C099E64920056E581 /* TextIterator.h in Headers */,
BCEF45E90E687767001C1287 /* TextMetrics.h in Headers */,
930FC68A1072B9280045293E /* TextRenderingMode.h in Headers */,
@@ -20401,6 +20614,7 @@
51DF6D7E0B92A16D00C2DC85 /* ThreadCheck.h in Headers */,
E1FF57A30F01255B00891EBB /* ThreadGlobalData.h in Headers */,
185BCF290F3279CE000EA262 /* ThreadTimers.h in Headers */,
+ F55B3DDC1251F12D003EF269 /* TimeInputType.h in Headers */,
7553CFE8108F473F00EA281E /* TimelineRecordFactory.h in Headers */,
9305B24D098F1B6B00C28855 /* Timer.h in Headers */,
E44613B00CD6331000FADA75 /* TimeRanges.h in Headers */,
@@ -20427,6 +20641,7 @@
B2C3DA4D0D006C1D00EF6F26 /* UnicodeRange.h in Headers */,
E4AFCFA50DAF29A300F5F55C /* UnitBezier.h in Headers */,
D086FE9809D53AAB005BC74D /* UnlinkCommand.h in Headers */,
+ F55B3DDE1251F12D003EF269 /* URLInputType.h in Headers */,
656581B209D14EE6000E61D7 /* UserAgentStyleSheets.h in Headers */,
003F1FEA11E6AB43008258D9 /* UserContentTypes.h in Headers */,
BCACF3BD1072921A00C0C8A3 /* UserContentURLPattern.h in Headers */,
@@ -20487,6 +20702,7 @@
7637C543112E7B7E003D6CDC /* WebSocketHandshakeRequest.h in Headers */,
767F99C011A119560080C51D /* WebSocketHandshakeResponse.h in Headers */,
0FCF332D0F2B9A25004B6795 /* WebTiledLayer.h in Headers */,
+ F55B3DE01251F12D003EF269 /* WeekInputType.h in Headers */,
85031B510A44EFC700F992E0 /* WheelEvent.h in Headers */,
9380F47409A11AB4001FDB34 /* Widget.h in Headers */,
939B02EF0EA2DBC400C54570 /* WidthIterator.h in Headers */,
@@ -20879,6 +21095,10 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
+ 1ABA76C911D20E47004C201C /* ColorData.cpp in Sources */,
+ 1ABA76CA11D20E50004C201C /* CSSPropertyNames.cpp in Sources */,
+ 1ABA76CB11D20E57004C201C /* CSSValueKeywords.cpp in Sources */,
+ 1ABA76CC11D20E5B004C201C /* DocTypeStrings.cpp in Sources */,
B5B5DC69119BB3D5002A8790 /* AbstractDatabase.cpp in Sources */,
41E1B1D00FF5986900576B3B /* AbstractWorker.cpp in Sources */,
29A812280FBB9C1D00510293 /* AccessibilityARIAGrid.cpp in Sources */,
@@ -20940,6 +21160,7 @@
BCA8CA5F11E4E6D100812FB7 /* BackForwardListImpl.cpp in Sources */,
BC124EE70C2641CD009E2349 /* BarInfo.cpp in Sources */,
B2C3DA210D006C1D00EF6F26 /* Base64.cpp in Sources */,
+ F55B3DAD1251F12D003EF269 /* BaseTextInputType.cpp in Sources */,
5172204B11D2960500638B42 /* BeforeProcessEvent.cpp in Sources */,
AB23A32709BBA7D00067CC53 /* BeforeTextInsertedEvent.cpp in Sources */,
85031B3C0A44EFC700F992E0 /* BeforeUnloadEvent.cpp in Sources */,
@@ -20958,6 +21179,7 @@
BCEA4854097D93020094C9E4 /* break_lines.cpp in Sources */,
93309DDA099E64920056E581 /* BreakBlockquoteCommand.cpp in Sources */,
59B597731108656B007159E8 /* BridgeJSC.cpp in Sources */,
+ F55B3DAF1251F12D003EF269 /* ButtonInputType.cpp in Sources */,
1A569CF70D7E2B82007C3983 /* c_class.cpp in Sources */,
1A569CF90D7E2B82007C3983 /* c_instance.cpp in Sources */,
1A569CFB0D7E2B82007C3983 /* c_runtime.cpp in Sources */,
@@ -20985,6 +21207,7 @@
514185EF0CD65F0400763C99 /* ChangeVersionWrapper.cpp in Sources */,
6550B69F099DF0270090D781 /* CharacterData.cpp in Sources */,
9326DC0C09DAD5D600AFC847 /* CharsetData.cpp in Sources */,
+ F55B3DB11251F12D003EF269 /* CheckboxInputType.cpp in Sources */,
93F925440F7EF5B8007E37C9 /* CheckedRadioButtons.cpp in Sources */,
A81872250977D3C0005826D9 /* ChildNodeList.cpp in Sources */,
14D8238B0AF92DF60004F057 /* Chrome.cpp in Sources */,
@@ -20999,6 +21222,7 @@
B27535660B053814002CE64F /* Color.cpp in Sources */,
0FCF33240F2B9715004B6795 /* ColorCG.cpp in Sources */,
B22279620D00BF220071B782 /* ColorDistance.cpp in Sources */,
+ F55B3DB31251F12D003EF269 /* ColorInputType.cpp in Sources */,
B27535770B053814002CE64F /* ColorMac.mm in Sources */,
6550B6A1099DF0270090D781 /* Comment.cpp in Sources */,
37C236101097EE7700EF9F72 /* ComplexTextController.cpp in Sources */,
@@ -21087,6 +21311,9 @@
BC77D1FD0FF28D9B0070887B /* DataGridColumnList.cpp in Sources */,
BC64641D11D7F416006455B0 /* DatasetDOMStringMap.cpp in Sources */,
F5D3A57C106B83B300545297 /* DateComponents.cpp in Sources */,
+ F55B3DB51251F12D003EF269 /* DateInputType.cpp in Sources */,
+ F55B3DB71251F12D003EF269 /* DateTimeInputType.cpp in Sources */,
+ F55B3DB91251F12D003EF269 /* DateTimeLocalInputType.cpp in Sources */,
A8C228A211D5722E00D5A7D3 /* DecodedDataDocumentParser.cpp in Sources */,
4162A450101145AE00DFF3ED /* DedicatedWorkerContext.cpp in Sources */,
41A3D58E101C152D00316D07 /* DedicatedWorkerThread.cpp in Sources */,
@@ -21148,6 +21375,7 @@
85089CDC0A98C42800A275AA /* DOMDocumentFragment.mm in Sources */,
85CA975D0A962E5400690CCF /* DOMDocumentType.mm in Sources */,
8518DCEA0A9CC80D0091B7A6 /* DOMDOMImplementation.mm in Sources */,
+ 7694565C1214DB630007CBAE /* DOMDOMTokenList.mm in Sources */,
85ACA9C10A9B5FA500671E90 /* DOMElement.mm in Sources */,
85CA96B90A9621A600690CCF /* DOMEntity.mm in Sources */,
85089CDE0A98C42800A275AA /* DOMEntityReference.mm in Sources */,
@@ -21393,6 +21621,7 @@
85ACA99D0A9B575900671E90 /* DOMText.mm in Sources */,
933A14AA0B7D1D0900A53FFD /* DOMTextEvent.mm in Sources */,
188604B30F2E654A000B6443 /* DOMTimer.cpp in Sources */,
+ 76FC2B0B12370DA0006A991A /* DOMTokenList.cpp in Sources */,
85526CD30AB0B7DA000302EA /* DOMTreeWalker.mm in Sources */,
85C7F4920AAF79DC004014DD /* DOMUIEvent.mm in Sources */,
BC1A37BF097C715F0019F3D8 /* DOMUtility.mm in Sources */,
@@ -21423,6 +21652,7 @@
ED501DC60B249F2900AE18D9 /* EditorMac.mm in Sources */,
A8C4A80809D563270003AC8D /* Element.cpp in Sources */,
A8CFF6CB0A1561CD000A4234 /* EllipsisBox.cpp in Sources */,
+ F55B3DBB1251F12D003EF269 /* EmailInputType.cpp in Sources */,
A8EA7EC30A1945D000A8EF5F /* Entity.cpp in Sources */,
A8EA7EC10A1945D000A8EF5F /* EntityReference.cpp in Sources */,
8987855B122CA064003AABDA /* Entry.cpp in Sources */,
@@ -21442,11 +21672,23 @@
A75E8B8A0E1DE2D6007F2481 /* FEColorMatrix.cpp in Sources */,
A75E8B8C0E1DE2D6007F2481 /* FEComponentTransfer.cpp in Sources */,
A75E8B8E0E1DE2D6007F2481 /* FEComposite.cpp in Sources */,
+ 84730D781248F0B300D3A9C9 /* FEConvolveMatrix.cpp in Sources */,
+ 84730D7A1248F0B300D3A9C9 /* FEDiffuseLighting.cpp in Sources */,
+ 84730D7C1248F0B300D3A9C9 /* FEDisplacementMap.cpp in Sources */,
+ 84730D7E1248F0B300D3A9C9 /* FEFlood.cpp in Sources */,
84801954108BAFB300CB2B1F /* FEGaussianBlur.cpp in Sources */,
+ 84730D801248F0B300D3A9C9 /* FELighting.cpp in Sources */,
+ 84730D821248F0B300D3A9C9 /* FEMerge.cpp in Sources */,
+ 84730D841248F0B300D3A9C9 /* FEMorphology.cpp in Sources */,
+ 84730D861248F0B300D3A9C9 /* FEOffset.cpp in Sources */,
+ 84730D881248F0B300D3A9C9 /* FESpecularLighting.cpp in Sources */,
+ 84730D8A1248F0B300D3A9C9 /* FETile.cpp in Sources */,
+ 84730D8C1248F0B300D3A9C9 /* FETurbulence.cpp in Sources */,
976D6C80122B8A3D001FD1F7 /* File.cpp in Sources */,
934FE9E50B5CA539003E4A73 /* FileChooser.cpp in Sources */,
066C772D0AB603D200238CC4 /* FileChooserMac.mm in Sources */,
89878561122CA064003AABDA /* FileEntry.cpp in Sources */,
+ F55B3DBD1251F12D003EF269 /* FileInputType.cpp in Sources */,
976D6C85122B8A3D001FD1F7 /* FileList.cpp in Sources */,
976D6C88122B8A3D001FD1F7 /* FileReader.cpp in Sources */,
2EDF369C122C94B4002F7D4E /* FileReaderSync.cpp in Sources */,
@@ -21525,6 +21767,7 @@
0F580B050F12A2550051D689 /* GraphicsLayerCA.mm in Sources */,
B2A015AA0AF6CD53006BCE0E /* GraphicsTypes.cpp in Sources */,
C50B561612119D23008B46E0 /* GroupSettings.cpp in Sources */,
+ F55B3DBF1251F12D003EF269 /* HiddenInputType.cpp in Sources */,
BC94D1530C275C8B006BC617 /* History.cpp in Sources */,
97DCE20110807C750057D394 /* HistoryController.cpp in Sources */,
51741D120B07259A00ED442C /* HistoryItem.cpp in Sources */,
@@ -21671,6 +21914,7 @@
B275355E0B053814002CE64F /* ImageCG.cpp in Sources */,
A77979190D6B9D0C003851B9 /* ImageData.cpp in Sources */,
97205AB51239291000B17380 /* ImageDocument.cpp in Sources */,
+ F55B3DC11251F12D003EF269 /* ImageInputType.cpp in Sources */,
089582550E857A7E00F82C83 /* ImageLoader.cpp in Sources */,
B275357B0B053814002CE64F /* ImageMac.mm in Sources */,
B0149E7F11A4B21500196A7B /* ImageResizerThread.cpp in Sources */,
@@ -21684,6 +21928,7 @@
A8CFF5E40A155A05000A4234 /* InlineFlowBox.cpp in Sources */,
BCEA4859097D93020094C9E4 /* InlineTextBox.cpp in Sources */,
08700BE70F086C5300919419 /* InputElement.cpp in Sources */,
+ 37E3524B12450C5200BAF5D9 /* InputType.cpp in Sources */,
93309DE9099E64920056E581 /* InsertIntoTextNodeCommand.cpp in Sources */,
93309DEB099E64920056E581 /* InsertLineBreakCommand.cpp in Sources */,
D07DEAB90A36554A00CA30F8 /* InsertListCommand.cpp in Sources */,
@@ -21717,6 +21962,7 @@
B275357D0B053814002CE64F /* IntRectMac.mm in Sources */,
B27535620B053814002CE64F /* IntSizeCG.cpp in Sources */,
B275357E0B053814002CE64F /* IntSizeMac.mm in Sources */,
+ F55B3DC31251F12D003EF269 /* IsIndexInputType.cpp in Sources */,
59E560A91105336F00AA1258 /* JavaClassJSC.cpp in Sources */,
59A9E7B01104758800DFB4C1 /* JavaInstanceJSC.cpp in Sources */,
E1698264113467F300894115 /* JavaRuntimeObject.cpp in Sources */,
@@ -21831,6 +22077,7 @@
C5137CF211A58378004ADB99 /* JSDOMStringList.cpp in Sources */,
BC64649711D82349006455B0 /* JSDOMStringMap.cpp in Sources */,
BC64649C11D8238C006455B0 /* JSDOMStringMapCustom.cpp in Sources */,
+ 7694563C1214D97C0007CBAE /* JSDOMTokenList.cpp in Sources */,
1403BA0C09EB18C700797C7F /* JSDOMWindow.cpp in Sources */,
BC6932730D7E293900AE44D1 /* JSDOMWindowBase.cpp in Sources */,
BCD9C2620C17AA67005C90A2 /* JSDOMWindowCustom.cpp in Sources */,
@@ -22291,6 +22538,7 @@
512DD8F40D91E6AF000F89EE /* LegacyWebArchive.cpp in Sources */,
51B2417B0D931F3F00E83F5C /* LegacyWebArchiveMac.mm in Sources */,
BCE65BEA0EACDF16007E4533 /* Length.cpp in Sources */,
+ 84730D901248F0B300D3A9C9 /* LightSource.cpp in Sources */,
89B5EAA111E8003D00F2367E /* LineEnding.cpp in Sources */,
A7AD2F870EC89D07008AB002 /* LinkHash.cpp in Sources */,
BCB16C2C0979C3BD00467741 /* loader.cpp in Sources */,
@@ -22332,6 +22580,7 @@
BC772C4E0C4EB3040083285F /* MIMETypeRegistry.cpp in Sources */,
BC772C5E0C4EB3440083285F /* MIMETypeRegistryMac.mm in Sources */,
C6D74AE409AA290A000B0A52 /* ModifySelectionListLevel.cpp in Sources */,
+ F55B3DC51251F12D003EF269 /* MonthInputType.cpp in Sources */,
85031B450A44EFC700F992E0 /* MouseEvent.cpp in Sources */,
93EB355F09E37FD600F43799 /* MouseEventWithHitTestResults.cpp in Sources */,
85031B470A44EFC700F992E0 /* MouseRelatedEvent.cpp in Sources */,
@@ -22357,6 +22606,7 @@
3390CA550FFC157B00921962 /* NotificationCenter.cpp in Sources */,
1A569D0A0D7E2B82007C3983 /* NP_jsobject.cpp in Sources */,
1A569D0D0D7E2B82007C3983 /* npruntime.cpp in Sources */,
+ F55B3DC71251F12D003EF269 /* NumberInputType.cpp in Sources */,
1A569D130D7E2B82007C3983 /* objc_class.mm in Sources */,
1A569D160D7E2B82007C3983 /* objc_instance.mm in Sources */,
1A569D180D7E2B82007C3983 /* objc_runtime.mm in Sources */,
@@ -22378,6 +22628,7 @@
1C26497C0D7E24EC00BD10F2 /* PageMac.cpp in Sources */,
E1284AEA10447DEE00EAEB52 /* PageTransitionEvent.cpp in Sources */,
51E1ECC20C91C90400DC255B /* PageURLRecord.cpp in Sources */,
+ F55B3DC91251F12D003EF269 /* PasswordInputType.cpp in Sources */,
4B2709830AF2E5E00065127F /* PasteboardMac.mm in Sources */,
B275357F0B053814002CE64F /* Path.cpp in Sources */,
B27535630B053814002CE64F /* PathCG.cpp in Sources */,
@@ -22414,7 +22665,9 @@
514C76740CE923A1007EF3CD /* ProtectionSpace.cpp in Sources */,
E4D687770ED7AE3D006EA978 /* PurgeableBufferMac.cpp in Sources */,
550A0BC9085F6039007353D6 /* QualifiedName.cpp in Sources */,
+ F55B3DCB1251F12D003EF269 /* RadioInputType.cpp in Sources */,
93F19AB908245E59001E9ABC /* Range.cpp in Sources */,
+ F55B3DCD1251F12D003EF269 /* RangeInputType.cpp in Sources */,
979F43D31075E44A0000F83B /* RedirectScheduler.cpp in Sources */,
85031B4B0A44EFC700F992E0 /* RegisteredEventListener.cpp in Sources */,
B2C3DA2C0D006C1D00EF6F26 /* RegularExpression.cpp in Sources */,
@@ -22532,6 +22785,7 @@
A89CCC520F44E98100B5DA10 /* ReplaceNodeWithSpanCommand.cpp in Sources */,
93309E09099E64920056E581 /* ReplaceSelectionCommand.cpp in Sources */,
BCB16C2E0979C3BD00467741 /* Request.cpp in Sources */,
+ F55B3DCF1251F12D003EF269 /* ResetInputType.cpp in Sources */,
934F713E0D5A6F2800018D69 /* ResourceErrorBase.cpp in Sources */,
514C76500CE9234E007EF3CD /* ResourceErrorMac.mm in Sources */,
514C76780CE923A1007EF3CD /* ResourceHandle.cpp in Sources */,
@@ -22586,6 +22840,7 @@
5D925B670F64D4DD00B847F0 /* ScrollBehavior.cpp in Sources */,
BC2441C40E8B65D00055320F /* ScrollView.cpp in Sources */,
9353676B09AED88B00D35CD6 /* ScrollViewMac.mm in Sources */,
+ F55B3DD11251F12D003EF269 /* SearchInputType.cpp in Sources */,
AB7170A00B31193B0017123E /* SearchPopupMenuMac.mm in Sources */,
33C0CCD4112C5E6200CE057D /* SecureTextInput.cpp in Sources */,
BCD0E0FA0E972C3500265DEA /* SecurityOrigin.cpp in Sources */,
@@ -22687,6 +22942,7 @@
BC5EB80F0E81F2CE00B25965 /* StyleTransformData.cpp in Sources */,
BC5EB6990E81DA6300B25965 /* StyleVisualData.cpp in Sources */,
D000ED2711C1B9CD00C47726 /* SubframeLoader.cpp in Sources */,
+ F55B3DD31251F12D003EF269 /* SubmitInputType.cpp in Sources */,
93E227E40AF589AD00D48324 /* SubresourceLoader.cpp in Sources */,
93B2D8180F9920EE006AE6B2 /* SuddenTermination.mm in Sources */,
62C1217C11AB9E77003C462C /* SuspendableTimer.cpp in Sources */,
@@ -22724,14 +22980,10 @@
B22279CA0D00BF220071B782 /* SVGFEColorMatrixElement.cpp in Sources */,
B22279CD0D00BF220071B782 /* SVGFEComponentTransferElement.cpp in Sources */,
B22279D00D00BF220071B782 /* SVGFECompositeElement.cpp in Sources */,
- B255997A0D00D8BA00BB825C /* SVGFEConvolveMatrix.cpp in Sources */,
1921327411C0E6BB00456238 /* SVGFEConvolveMatrixElement.cpp in Sources */,
- B255997C0D00D8BA00BB825C /* SVGFEDiffuseLighting.cpp in Sources */,
B22279D30D00BF220071B782 /* SVGFEDiffuseLightingElement.cpp in Sources */,
- B255997E0D00D8BA00BB825C /* SVGFEDisplacementMap.cpp in Sources */,
B22279D60D00BF220071B782 /* SVGFEDisplacementMapElement.cpp in Sources */,
B22279D90D00BF220071B782 /* SVGFEDistantLightElement.cpp in Sources */,
- B25599800D00D8BA00BB825C /* SVGFEFlood.cpp in Sources */,
B22279DC0D00BF220071B782 /* SVGFEFloodElement.cpp in Sources */,
B22279DF0D00BF220071B782 /* SVGFEFuncAElement.cpp in Sources */,
B22279E20D00BF220071B782 /* SVGFEFuncBElement.cpp in Sources */,
@@ -22741,21 +22993,14 @@
B25599840D00D8BA00BB825C /* SVGFEImage.cpp in Sources */,
B22279EE0D00BF220071B782 /* SVGFEImageElement.cpp in Sources */,
B22279F10D00BF220071B782 /* SVGFELightElement.cpp in Sources */,
- E440A2D51191A50B000820B0 /* SVGFELighting.cpp in Sources */,
- B25599860D00D8BA00BB825C /* SVGFEMerge.cpp in Sources */,
B22279F30D00BF220071B782 /* SVGFEMergeElement.cpp in Sources */,
B22279F60D00BF220071B782 /* SVGFEMergeNodeElement.cpp in Sources */,
- B25599880D00D8BA00BB825C /* SVGFEMorphology.cpp in Sources */,
84224193107E78A700766A87 /* SVGFEMorphologyElement.cpp in Sources */,
- B255998A0D00D8BA00BB825C /* SVGFEOffset.cpp in Sources */,
B22279F90D00BF220071B782 /* SVGFEOffsetElement.cpp in Sources */,
B22279FC0D00BF220071B782 /* SVGFEPointLightElement.cpp in Sources */,
- B255998C0D00D8BA00BB825C /* SVGFESpecularLighting.cpp in Sources */,
B22279FF0D00BF220071B782 /* SVGFESpecularLightingElement.cpp in Sources */,
B2227A020D00BF220071B782 /* SVGFESpotLightElement.cpp in Sources */,
- A7D27FC40E0A599F0079AD2B /* SVGFETile.cpp in Sources */,
B2227A050D00BF220071B782 /* SVGFETileElement.cpp in Sources */,
- B255998F0D00D8BA00BB825C /* SVGFETurbulence.cpp in Sources */,
B2227A080D00BF220071B782 /* SVGFETurbulenceElement.cpp in Sources */,
845E72FB0FD2623900A87D79 /* SVGFilter.cpp in Sources */,
081EBF3A0FD34F4100DA7559 /* SVGFilterBuilder.cpp in Sources */,
@@ -22784,7 +23029,6 @@
B2227A2F0D00BF220071B782 /* SVGLangSpace.cpp in Sources */,
B2227A320D00BF220071B782 /* SVGLength.cpp in Sources */,
B2227A350D00BF220071B782 /* SVGLengthList.cpp in Sources */,
- B25599930D00D8BA00BB825C /* SVGLightSource.cpp in Sources */,
B2227A380D00BF220071B782 /* SVGLinearGradientElement.cpp in Sources */,
B2227A3B0D00BF220071B782 /* SVGLineElement.cpp in Sources */,
B2227A400D00BF220071B782 /* SVGLocatable.cpp in Sources */,
@@ -22878,6 +23122,7 @@
B2E4EC970D00C22B00432643 /* SVGZoomEvent.cpp in Sources */,
6582A16309999D6D00BEEB6D /* SystemTimeMac.cpp in Sources */,
BCE3BEC20D222B1D007E06E4 /* TagNodeList.cpp in Sources */,
+ F55B3DD51251F12D003EF269 /* TelephoneInputType.cpp in Sources */,
6550B6A5099DF0270090D781 /* Text.cpp in Sources */,
B2AFFC970D00A5DF0030074D /* TextBoundaries.mm in Sources */,
B2C3DA370D006C1D00EF6F26 /* TextBreakIteratorICU.cpp in Sources */,
@@ -22895,6 +23140,8 @@
C105DA620F3AA68F001DD44F /* TextEncodingDetectorICU.cpp in Sources */,
B2C3DA480D006C1D00EF6F26 /* TextEncodingRegistry.cpp in Sources */,
933A142E0B7D188600A53FFD /* TextEvent.cpp in Sources */,
+ F55B3DD71251F12D003EF269 /* TextFieldInputType.cpp in Sources */,
+ F55B3DD91251F12D003EF269 /* TextInputType.cpp in Sources */,
93309E1B099E64920056E581 /* TextIterator.cpp in Sources */,
93F19A9D08245E59001E9ABC /* TextResourceDecoder.cpp in Sources */,
B2C3DA4A0D006C1D00EF6F26 /* TextStream.cpp in Sources */,
@@ -22907,6 +23154,7 @@
51DF6D800B92A18E00C2DC85 /* ThreadCheck.mm in Sources */,
E1FF57A60F01256B00891EBB /* ThreadGlobalData.cpp in Sources */,
185BCF280F3279CE000EA262 /* ThreadTimers.cpp in Sources */,
+ F55B3DDB1251F12D003EF269 /* TimeInputType.cpp in Sources */,
7553CFE9108F473F00EA281E /* TimelineRecordFactory.cpp in Sources */,
93309EA4099EB78C0056E581 /* Timer.cpp in Sources */,
E44613AF0CD6331000FADA75 /* TimeRanges.cpp in Sources */,
@@ -22927,6 +23175,7 @@
49EECDEE10503C2400099FAB /* Uint8Array.cpp in Sources */,
B2C3DA4C0D006C1D00EF6F26 /* UnicodeRange.cpp in Sources */,
D086FE9909D53AAB005BC74D /* UnlinkCommand.cpp in Sources */,
+ F55B3DDD1251F12D003EF269 /* URLInputType.cpp in Sources */,
65DF326109D1E199000BE325 /* UserAgentStyleSheetsData.cpp in Sources */,
BCACF3BC1072921A00C0C8A3 /* UserContentURLPattern.cpp in Sources */,
2542F4DA1166C25A00E89A86 /* UserGestureIndicator.cpp in Sources */,
@@ -22971,6 +23220,7 @@
7637C541112E7B74003D6CDC /* WebSocketHandshakeRequest.cpp in Sources */,
767F99BE11A1194A0080C51D /* WebSocketHandshakeResponse.cpp in Sources */,
0FCF332C0F2B9A25004B6795 /* WebTiledLayer.mm in Sources */,
+ F55B3DDF1251F12D003EF269 /* WeekInputType.cpp in Sources */,
85031B500A44EFC700F992E0 /* WheelEvent.cpp in Sources */,
935C477309AC4D7700A6AAB4 /* WheelEventMac.mm in Sources */,
9380F47309A11AB4001FDB34 /* Widget.cpp in Sources */,
diff --git a/WebCore/accessibility/AXObjectCache.cpp b/WebCore/accessibility/AXObjectCache.cpp
index 907bb15..30cce3a 100644
--- a/WebCore/accessibility/AXObjectCache.cpp
+++ b/WebCore/accessibility/AXObjectCache.cpp
@@ -465,6 +465,16 @@ void AXObjectCache::selectedChildrenChanged(RenderObject* renderer)
// to find the container which should send out the notification.
postNotification(renderer, AXSelectedChildrenChanged, false);
}
+
+void AXObjectCache::nodeTextChangeNotification(RenderObject* renderer, AXTextChange textChange, unsigned offset, unsigned count)
+{
+ if (!renderer)
+ return;
+
+ // Delegate on the right platform
+ AccessibilityObject* obj = getOrCreate(renderer);
+ nodeTextChangePlatformNotification(obj, textChange, offset, count);
+}
#endif
#if HAVE(ACCESSIBILITY)
@@ -495,9 +505,12 @@ void AXObjectCache::handleAriaRoleChanged(RenderObject* renderer)
static_cast<AccessibilityRenderObject*>(obj)->updateAccessibilityRole();
}
#endif
-
+
VisiblePosition AXObjectCache::visiblePositionForTextMarkerData(TextMarkerData& textMarkerData)
{
+ if (!isNodeInUse(textMarkerData.node))
+ return VisiblePosition();
+
VisiblePosition visiblePos = VisiblePosition(textMarkerData.node, textMarkerData.offset, textMarkerData.affinity);
Position deepPos = visiblePos.deepEquivalent();
if (deepPos.isNull())
@@ -549,7 +562,9 @@ void AXObjectCache::textMarkerDataForVisiblePosition(TextMarkerData& textMarkerD
textMarkerData.axID = obj.get()->axObjectID();
textMarkerData.node = domNode;
textMarkerData.offset = deepPos.deprecatedEditingOffset();
- textMarkerData.affinity = visiblePos.affinity();
+ textMarkerData.affinity = visiblePos.affinity();
+
+ cache->setNodeInUse(domNode);
}
} // namespace WebCore
diff --git a/WebCore/accessibility/AXObjectCache.h b/WebCore/accessibility/AXObjectCache.h
index 28a5917..2ee56ee 100644
--- a/WebCore/accessibility/AXObjectCache.h
+++ b/WebCore/accessibility/AXObjectCache.h
@@ -100,9 +100,14 @@ public:
AXID platformGenerateAXID() const;
AccessibilityObject* objectFromAXID(AXID id) const { return m_objects.get(id).get(); }
+ // This is a weak reference cache for knowing if Nodes used by TextMarkers are valid.
+ void setNodeInUse(Node* n) { m_textMarkerNodes.add(n); }
+ void removeNodeForUse(Node* n) { m_textMarkerNodes.remove(n); }
+ bool isNodeInUse(Node* n) { return m_textMarkerNodes.contains(n); }
+
// Text marker utilities.
- static void textMarkerDataForVisiblePosition(TextMarkerData&, const VisiblePosition&);
- static VisiblePosition visiblePositionForTextMarkerData(TextMarkerData&);
+ void textMarkerDataForVisiblePosition(TextMarkerData&, const VisiblePosition&);
+ VisiblePosition visiblePositionForTextMarkerData(TextMarkerData&);
enum AXNotification {
AXActiveDescendantChanged,
@@ -125,12 +130,23 @@ public:
void postNotification(RenderObject*, AXNotification, bool postToElement, PostType = PostAsynchronously);
void postNotification(AccessibilityObject*, Document*, AXNotification, bool postToElement, PostType = PostAsynchronously);
+ enum AXTextChange {
+ AXTextInserted,
+ AXTextDeleted,
+ };
+
+ void nodeTextChangeNotification(RenderObject*, AXTextChange, unsigned offset, unsigned count);
+
+ bool nodeHasRole(Node*, const AtomicString& role);
+
protected:
void postPlatformNotification(AccessibilityObject*, AXNotification);
+ void nodeTextChangePlatformNotification(AccessibilityObject*, AXTextChange, unsigned offset, unsigned count);
private:
HashMap<AXID, RefPtr<AccessibilityObject> > m_objects;
HashMap<RenderObject*, AXID> m_renderObjectMapping;
+ HashSet<Node*> m_textMarkerNodes;
static bool gAccessibilityEnabled;
static bool gAccessibilityEnhancedUserInterfaceEnabled;
@@ -156,6 +172,8 @@ inline void AXObjectCache::selectedChildrenChanged(RenderObject*) { }
inline void AXObjectCache::postNotification(RenderObject*, AXNotification, bool postToElement, PostType) { }
inline void AXObjectCache::postNotification(AccessibilityObject*, Document*, AXNotification, bool postToElement, PostType) { }
inline void AXObjectCache::postPlatformNotification(AccessibilityObject*, AXNotification) { }
+inline void AXObjectCache::nodeTextChangeNotification(RenderObject*, AXTextChange, unsigned, unsigned) { }
+inline void AXObjectCache::nodeTextChangePlatformNotification(AccessibilityObject*, AXTextChange, unsigned, unsigned) { }
inline void AXObjectCache::handleFocusedUIElementChanged(RenderObject*, RenderObject*) { }
inline void AXObjectCache::handleScrolledToAnchor(const Node*) { }
inline void AXObjectCache::contentChanged(RenderObject*) { }
diff --git a/WebCore/accessibility/AccessibilityRenderObject.h b/WebCore/accessibility/AccessibilityRenderObject.h
index cefaa94..b7b85fe 100644
--- a/WebCore/accessibility/AccessibilityRenderObject.h
+++ b/WebCore/accessibility/AccessibilityRenderObject.h
@@ -311,7 +311,22 @@ private:
mutable AccessibilityRole m_roleForMSAA;
};
-
+
+inline AccessibilityRenderObject* toAccessibilityRenderObject(AccessibilityObject* object)
+{
+ ASSERT(!object || object->isAccessibilityRenderObject());
+ return static_cast<AccessibilityRenderObject*>(object);
+}
+
+inline const AccessibilityRenderObject* toAccessibilityRenderObject(const AccessibilityObject* object)
+{
+ ASSERT(!object || object->isAccessibilityRenderObject());
+ return static_cast<const AccessibilityRenderObject*>(object);
+}
+
+// This will catch anyone doing an unnecessary cast.
+void toAccessibilityRenderObject(const AccessibilityRenderObject*);
+
} // namespace WebCore
#endif // AccessibilityRenderObject_h
diff --git a/WebCore/accessibility/chromium/AXObjectCacheChromium.cpp b/WebCore/accessibility/chromium/AXObjectCacheChromium.cpp
index 3ff0837..b02fe00 100644
--- a/WebCore/accessibility/chromium/AXObjectCacheChromium.cpp
+++ b/WebCore/accessibility/chromium/AXObjectCacheChromium.cpp
@@ -28,20 +28,11 @@
#include "AXObjectCache.h"
#include "AccessibilityObject.h"
#include "Chrome.h"
-#include "ChromeClientChromium.h"
+#include "ChromeClient.h"
#include "FrameView.h"
namespace WebCore {
-static ChromeClientChromium* toChromeClientChromium(FrameView* view)
-{
- Page* page = view->frame() ? view->frame()->page() : 0;
- if (!page)
- return 0;
-
- return static_cast<ChromeClientChromium*>(page->chrome()->client());
-}
-
void AXObjectCache::detachWrapper(AccessibilityObject* obj)
{
// In Chromium, AccessibilityObjects are wrapped lazily.
@@ -56,22 +47,24 @@ void AXObjectCache::attachWrapper(AccessibilityObject*)
void AXObjectCache::postPlatformNotification(AccessibilityObject* obj, AXNotification notification)
{
- if (!obj || !obj->document() || !obj->documentFrameView())
+ if (!obj || !obj->document() || !obj->documentFrameView() || !obj->documentFrameView()->frame() || !obj->documentFrameView()->frame()->page())
return;
- ChromeClientChromium* client = toChromeClientChromium(obj->documentFrameView());
+ ChromeClient* client = obj->documentFrameView()->frame()->page()->chrome()->client();
if (!client)
return;
- // TODO: Remove after the new postAccessibilityNotification is used downstream.
switch (notification) {
- case AXCheckedStateChanged:
- client->didChangeAccessibilityObjectState(obj);
+ case AXActiveDescendantChanged:
+ if (!obj->document()->focusedNode() || (obj->node() != obj->document()->focusedNode()))
+ break;
+
+ // Calling handleFocusedUIElementChanged will focus the new active
+ // descendant and send the AXFocusedUIElementChanged notification.
+ handleFocusedUIElementChanged(0, obj->document()->focusedNode()->renderer());
break;
+ case AXCheckedStateChanged:
case AXChildrenChanged:
- client->didChangeAccessibilityObjectChildren(obj);
- break;
- case AXActiveDescendantChanged:
case AXFocusedUIElementChanged:
case AXLayoutComplete:
case AXLiveRegionChanged:
@@ -90,12 +83,31 @@ void AXObjectCache::postPlatformNotification(AccessibilityObject* obj, AXNotific
client->postAccessibilityNotification(obj, notification);
}
-void AXObjectCache::handleFocusedUIElementChanged(RenderObject*, RenderObject*)
+void AXObjectCache::nodeTextChangePlatformNotification(AccessibilityObject*, AXTextChange, unsigned, unsigned)
{
}
-void AXObjectCache::handleScrolledToAnchor(const Node*)
+void AXObjectCache::handleFocusedUIElementChanged(RenderObject*, RenderObject* newFocusedRenderer)
+{
+ if (!newFocusedRenderer)
+ return;
+
+ Page* page = newFocusedRenderer->document()->page();
+ if (!page)
+ return;
+
+ AccessibilityObject* focusedObject = focusedUIElementForPage(page);
+ if (!focusedObject)
+ return;
+
+ postPlatformNotification(focusedObject, AXFocusedUIElementChanged);
+}
+
+void AXObjectCache::handleScrolledToAnchor(const Node* anchorNode)
{
+ // The anchor node may not be accessible. Post the notification for the
+ // first accessible object.
+ postPlatformNotification(AccessibilityObject::firstAccessibleObjectFromNode(anchorNode), AXScrolledToAnchor);
}
} // namespace WebCore
diff --git a/WebCore/accessibility/gtk/AXObjectCacheAtk.cpp b/WebCore/accessibility/gtk/AXObjectCacheAtk.cpp
index c30b006..a4ea87c 100644
--- a/WebCore/accessibility/gtk/AXObjectCacheAtk.cpp
+++ b/WebCore/accessibility/gtk/AXObjectCacheAtk.cpp
@@ -22,6 +22,10 @@
#include "AccessibilityObject.h"
#include "AccessibilityObjectWrapperAtk.h"
+#include "AccessibilityRenderObject.h"
+#include "GOwnPtr.h"
+#include "Range.h"
+#include "TextIterator.h"
namespace WebCore {
@@ -50,6 +54,39 @@ void AXObjectCache::postPlatformNotification(AccessibilityObject* coreObject, AX
}
}
+static void emitTextChanged(AccessibilityRenderObject* object, AXObjectCache::AXTextChange textChange, unsigned offset, unsigned count)
+{
+ // Get the axObject for the parent object
+ AtkObject* wrapper = object->parentObjectUnignored()->wrapper();
+ if (!wrapper || !ATK_IS_TEXT(wrapper))
+ return;
+
+ // Select the right signal to be emitted
+ CString detail;
+ switch (textChange) {
+ case AXObjectCache::AXTextInserted:
+ detail = "text-changed::insert";
+ break;
+ case AXObjectCache::AXTextDeleted:
+ detail = "text-changed::delete";
+ break;
+ }
+
+ if (!detail.isNull())
+ g_signal_emit_by_name(wrapper, detail.data(), offset, count);
+}
+
+void AXObjectCache::nodeTextChangePlatformNotification(AccessibilityObject* object, AXTextChange textChange, unsigned offset, unsigned count)
+{
+ // Sanity check
+ if (count < 1 || !object || !object->isAccessibilityRenderObject())
+ return;
+
+ Node* node = object->node();
+ RefPtr<Range> range = Range::create(node->document(), Position(node->parentNode(), 0), Position(node, 0));
+ emitTextChanged(toAccessibilityRenderObject(object), textChange, offset + TextIterator::rangeLength(range.get()), count);
+}
+
void AXObjectCache::handleFocusedUIElementChanged(RenderObject* oldFocusedRender, RenderObject* newFocusedRender)
{
RefPtr<AccessibilityObject> oldObject = getOrCreate(oldFocusedRender);
diff --git a/WebCore/accessibility/gtk/AccessibilityObjectAtk.cpp b/WebCore/accessibility/gtk/AccessibilityObjectAtk.cpp
index 7f9fd1a..9772b43 100644
--- a/WebCore/accessibility/gtk/AccessibilityObjectAtk.cpp
+++ b/WebCore/accessibility/gtk/AccessibilityObjectAtk.cpp
@@ -73,8 +73,12 @@ AccessibilityObjectInclusion AccessibilityObject::accessibilityPlatformIncludesO
if (role == StaticTextRole)
return IgnoreObject;
+ // Include all list items, regardless they have or not inline children
+ if (role == ListItemRole)
+ return IncludeObject;
+
// Bullets/numbers for list items shouldn't be exposed as AtkObjects.
- if (roleValue() == ListMarkerRole)
+ if (role == ListMarkerRole)
return IgnoreObject;
return DefaultBehavior;
diff --git a/WebCore/accessibility/gtk/AccessibilityObjectWrapperAtk.cpp b/WebCore/accessibility/gtk/AccessibilityObjectWrapperAtk.cpp
index 01dddd1..3575afe 100644
--- a/WebCore/accessibility/gtk/AccessibilityObjectWrapperAtk.cpp
+++ b/WebCore/accessibility/gtk/AccessibilityObjectWrapperAtk.cpp
@@ -55,6 +55,7 @@
#include "InlineTextBox.h"
#include "IntRect.h"
#include "NotImplemented.h"
+#include "RenderListItem.h"
#include "RenderListMarker.h"
#include "RenderText.h"
#include "TextEncoding.h"
@@ -878,9 +879,13 @@ gchar* textForObject(AccessibilityRenderObject* accObject)
g_string_append(str, "\n");
range = accObject->doAXRangeForLine(++lineNumber);
}
- } else if (accObject->renderer()) {
+ } else {
+ RenderObject* renderer = accObject->renderer();
+ if (!renderer)
+ return g_string_free(str, FALSE);
+
// For RenderBlocks, piece together the text from the RenderText objects they contain.
- for (RenderObject* obj = accObject->renderer()->firstChild(); obj; obj = obj->nextSibling()) {
+ for (RenderObject* obj = renderer->firstChild(); obj; obj = obj->nextSibling()) {
if (obj->isBR()) {
g_string_append(str, "\n");
continue;
@@ -907,7 +912,17 @@ gchar* textForObject(AccessibilityRenderObject* accObject)
box = box->nextTextBox();
}
}
+
+ // Insert the text of the marker for list item in the right place, if present
+ if (renderer->isListItem()) {
+ String markerText = toRenderListItem(renderer)->markerTextWithSuffix();
+ if (renderer->style()->direction() == LTR)
+ g_string_prepend(str, markerText.utf8().data());
+ else
+ g_string_append(str, markerText.utf8().data());
+ }
}
+
return g_string_free(str, FALSE);
}
@@ -939,10 +954,9 @@ static gchar* webkit_accessible_text_get_text(AtkText* text, gint startOffset, g
// Prefix a item number/bullet if needed
if (coreObject->roleValue() == ListItemRole) {
RenderObject* objRenderer = static_cast<AccessibilityRenderObject*>(coreObject)->renderer();
- RenderObject* markerRenderer = objRenderer ? objRenderer->firstChild() : 0;
- if (markerRenderer && markerRenderer->isListMarker()) {
- String markerTxt = toRenderListMarker(markerRenderer)->text();
- ret = markerTxt.length() > 0 ? markerTxt + " " + ret : ret;
+ if (objRenderer && objRenderer->isListItem()) {
+ String markerText = toRenderListItem(objRenderer)->markerTextWithSuffix();
+ ret = objRenderer->style()->direction() == LTR ? markerText + ret : ret + markerText;
}
}
@@ -1185,8 +1199,29 @@ static AtkAttributeSet* attributeSetDifference(AtkAttributeSet* a1, AtkAttribute
static guint accessibilityObjectLength(const AccessibilityObject* object)
{
- GOwnPtr<gchar> text(webkit_accessible_text_get_text(ATK_TEXT(object->wrapper()), 0, -1));
- return g_utf8_strlen(text.get(), -1);
+ // Non render objects are not taken into account
+ if (!object->isAccessibilityRenderObject())
+ return 0;
+
+ // For those objects implementing the AtkText interface we use the
+ // well known API to always get the text in a consistent way
+ AtkObject* atkObj = ATK_OBJECT(object->wrapper());
+ if (ATK_IS_TEXT(atkObj)) {
+ GOwnPtr<gchar> text(webkit_accessible_text_get_text(ATK_TEXT(atkObj), 0, -1));
+ return g_utf8_strlen(text.get(), -1);
+ }
+
+ // Even if we don't expose list markers to Assistive
+ // Technologies, we need to have a way to measure their length
+ // for those cases when it's needed to take it into account
+ // separately (as in getAccessibilityObjectForOffset)
+ RenderObject* renderer = static_cast<const AccessibilityRenderObject*>(object)->renderer();
+ if (renderer && renderer->isListMarker()) {
+ RenderListMarker* marker = toRenderListMarker(renderer);
+ return marker->text().length() + marker->suffix().length();
+ }
+
+ return 0;
}
static const AccessibilityObject* getAccessibilityObjectForOffset(const AccessibilityObject* object, guint offset, gint* startOffset, gint* endOffset)
@@ -1321,12 +1356,7 @@ static void webkit_accessible_text_get_range_extents(AtkText* text, gint startOf
static gint webkit_accessible_text_get_character_count(AtkText* text)
{
- AccessibilityObject* coreObject = core(text);
-
- if (coreObject->isTextControl())
- return coreObject->textLength();
- else
- return coreObject->textUnderElement().length();
+ return accessibilityObjectLength(core(text));
}
static gint webkit_accessible_text_get_offset_at_point(AtkText* text, gint x, gint y, AtkCoordType coords)
@@ -2026,8 +2056,21 @@ static guint16 getInterfaceMaskFromObject(AccessibilityObject* coreObject)
interfaceMask |= 1 << WAI_TEXT;
if (!coreObject->isReadOnly())
interfaceMask |= 1 << WAI_EDITABLE_TEXT;
- } else if (role != TableRole && static_cast<AccessibilityRenderObject*>(coreObject)->renderer()->childrenInline())
- interfaceMask |= 1 << WAI_TEXT;
+ } else {
+ AccessibilityRenderObject* axRenderObject = static_cast<AccessibilityRenderObject*>(coreObject);
+ RenderObject* renderer = axRenderObject->renderer();
+ if (role != TableRole && renderer && renderer->childrenInline())
+ interfaceMask |= 1 << WAI_TEXT;
+ else if (role == ListItemRole) {
+ // Add the TEXT interface for list items whose
+ // first accessible child has a text renderer
+ AccessibilityObject::AccessibilityChildrenVector children = axRenderObject->children();
+ if (children.size()) {
+ AccessibilityObject* axRenderChild = children.at(0).get();
+ interfaceMask |= getInterfaceMaskFromObject(axRenderChild);
+ }
+ }
+ }
// Image
if (coreObject->isImage())
diff --git a/WebCore/accessibility/mac/AXObjectCacheMac.mm b/WebCore/accessibility/mac/AXObjectCacheMac.mm
index a02bc75..fbb485d 100644
--- a/WebCore/accessibility/mac/AXObjectCacheMac.mm
+++ b/WebCore/accessibility/mac/AXObjectCacheMac.mm
@@ -108,12 +108,20 @@ void AXObjectCache::postPlatformNotification(AccessibilityObject* obj, AXNotific
return;
}
+ // NSAccessibilityPostNotification will call this method, (but not when running DRT), so ASSERT here to make sure it does not crash.
+ // https://bugs.webkit.org/show_bug.cgi?id=46662
+ ASSERT([obj->wrapper() accessibilityIsIgnored] || true);
+
NSAccessibilityPostNotification(obj->wrapper(), macNotification);
// Used by DRT to know when notifications are posted.
[obj->wrapper() accessibilityPostedNotification:macNotification];
}
+void AXObjectCache::nodeTextChangePlatformNotification(AccessibilityObject*, AXTextChange, unsigned, unsigned)
+{
+}
+
void AXObjectCache::handleFocusedUIElementChanged(RenderObject*, RenderObject*)
{
[[WebCoreViewFactory sharedFactory] accessibilityHandleFocusChanged];
diff --git a/WebCore/accessibility/mac/AccessibilityObjectWrapper.mm b/WebCore/accessibility/mac/AccessibilityObjectWrapper.mm
index e3e28d7..cb983eb 100644
--- a/WebCore/accessibility/mac/AccessibilityObjectWrapper.mm
+++ b/WebCore/accessibility/mac/AccessibilityObjectWrapper.mm
@@ -200,6 +200,22 @@ typedef unsigned NSUInteger;
m_object = 0;
}
+- (BOOL)updateObjectBackingStore
+{
+ // Calling updateBackingStore() can invalidate this element so self must be retained.
+ // If it does become invalidated, m_object will be nil.
+ [[self retain] autorelease];
+
+ if (!m_object)
+ return NO;
+
+ m_object->updateBackingStore();
+ if (!m_object)
+ return NO;
+
+ return YES;
+}
+
- (AccessibilityObject*)accessibilityObject
{
return m_object;
@@ -214,35 +230,49 @@ typedef unsigned NSUInteger;
return NSAccessibilityUnignoredDescendant(widget->platformWidget());
}
-static WebCoreTextMarker* textMarkerForVisiblePosition(const VisiblePosition& visiblePos)
+static WebCoreTextMarker* textMarkerForVisiblePosition(AXObjectCache* cache, const VisiblePosition& visiblePos)
{
+ ASSERT(cache);
+
TextMarkerData textMarkerData;
- AXObjectCache::textMarkerDataForVisiblePosition(textMarkerData, visiblePos);
+ cache->textMarkerDataForVisiblePosition(textMarkerData, visiblePos);
if (!textMarkerData.axID)
return nil;
return [[WebCoreViewFactory sharedFactory] textMarkerWithBytes:&textMarkerData length:sizeof(textMarkerData)];
}
-static VisiblePosition visiblePositionForTextMarker(WebCoreTextMarker* textMarker)
+- (WebCoreTextMarker *)textMarkerForVisiblePosition:(const VisiblePosition &)visiblePos
+{
+ return textMarkerForVisiblePosition(m_object->axObjectCache(), visiblePos);
+}
+
+static VisiblePosition visiblePositionForTextMarker(AXObjectCache* cache, WebCoreTextMarker* textMarker)
{
+ ASSERT(cache);
+
if (!textMarker)
return VisiblePosition();
TextMarkerData textMarkerData;
if (![[WebCoreViewFactory sharedFactory] getBytes:&textMarkerData fromTextMarker:textMarker length:sizeof(textMarkerData)])
return VisiblePosition();
- return AXObjectCache::visiblePositionForTextMarkerData(textMarkerData);
+ return cache->visiblePositionForTextMarkerData(textMarkerData);
+}
+
+- (VisiblePosition)visiblePositionForTextMarker:(WebCoreTextMarker *)textMarker
+{
+ return visiblePositionForTextMarker(m_object->axObjectCache(), textMarker);
}
-static VisiblePosition visiblePositionForStartOfTextMarkerRange(WebCoreTextMarkerRange* textMarkerRange)
+static VisiblePosition visiblePositionForStartOfTextMarkerRange(AXObjectCache *cache, WebCoreTextMarkerRange* textMarkerRange)
{
- return visiblePositionForTextMarker([[WebCoreViewFactory sharedFactory] startOfTextMarkerRange:textMarkerRange]);
+ return visiblePositionForTextMarker(cache, [[WebCoreViewFactory sharedFactory] startOfTextMarkerRange:textMarkerRange]);
}
-static VisiblePosition visiblePositionForEndOfTextMarkerRange(WebCoreTextMarkerRange* textMarkerRange)
+static VisiblePosition visiblePositionForEndOfTextMarkerRange(AXObjectCache *cache, WebCoreTextMarkerRange* textMarkerRange)
{
- return visiblePositionForTextMarker([[WebCoreViewFactory sharedFactory] endOfTextMarkerRange:textMarkerRange]);
+ return visiblePositionForTextMarker(cache, [[WebCoreViewFactory sharedFactory] endOfTextMarkerRange:textMarkerRange]);
}
static WebCoreTextMarkerRange* textMarkerRangeFromMarkers(WebCoreTextMarker* textMarker1, WebCoreTextMarker* textMarker2)
@@ -512,11 +542,11 @@ static NSString* nsStringForReplacedNode(Node* replacedNode)
return nil;
// extract the start and end VisiblePosition
- VisiblePosition startVisiblePosition = visiblePositionForStartOfTextMarkerRange(textMarkerRange);
+ VisiblePosition startVisiblePosition = visiblePositionForStartOfTextMarkerRange(m_object->axObjectCache(), textMarkerRange);
if (startVisiblePosition.isNull())
return nil;
- VisiblePosition endVisiblePosition = visiblePositionForEndOfTextMarkerRange(textMarkerRange);
+ VisiblePosition endVisiblePosition = visiblePositionForEndOfTextMarkerRange(m_object->axObjectCache(), textMarkerRange);
if (endVisiblePosition.isNull())
return nil;
@@ -562,20 +592,21 @@ static NSString* nsStringForReplacedNode(Node* replacedNode)
return [attrString autorelease];
}
-static WebCoreTextMarkerRange* textMarkerRangeFromVisiblePositions(VisiblePosition startPosition, VisiblePosition endPosition)
+static WebCoreTextMarkerRange* textMarkerRangeFromVisiblePositions(AXObjectCache *cache, VisiblePosition startPosition, VisiblePosition endPosition)
{
- WebCoreTextMarker* startTextMarker = textMarkerForVisiblePosition(startPosition);
- WebCoreTextMarker* endTextMarker = textMarkerForVisiblePosition(endPosition);
+ WebCoreTextMarker* startTextMarker = textMarkerForVisiblePosition(cache, startPosition);
+ WebCoreTextMarker* endTextMarker = textMarkerForVisiblePosition(cache, endPosition);
return textMarkerRangeFromMarkers(startTextMarker, endTextMarker);
}
-- (NSArray*)accessibilityActionNames
+- (WebCoreTextMarkerRange *)textMarkerRangeFromVisiblePositions:(VisiblePosition)startPosition endPosition:(VisiblePosition)endPosition
{
- if (!m_object)
- return nil;
+ return textMarkerRangeFromVisiblePositions(m_object->axObjectCache(), startPosition, endPosition);
+}
- m_object->updateBackingStore();
- if (!m_object)
+- (NSArray*)accessibilityActionNames
+{
+ if (![self updateObjectBackingStore])
return nil;
static NSArray* actionElementActions = [[NSArray alloc] initWithObjects: NSAccessibilityPressAction, NSAccessibilityShowMenuAction, nil];
@@ -638,11 +669,7 @@ static WebCoreTextMarkerRange* textMarkerRangeFromVisiblePositions(VisiblePositi
- (NSArray*)accessibilityAttributeNames
{
- if (!m_object)
- return nil;
-
- m_object->updateBackingStore();
- if (!m_object)
+ if (![self updateObjectBackingStore])
return nil;
if (m_object->isAttachment())
@@ -982,7 +1009,8 @@ static WebCoreTextMarkerRange* textMarkerRangeFromVisiblePositions(VisiblePositi
{
if (!textMarkerRange)
return VisiblePositionRange();
- return VisiblePositionRange(visiblePositionForStartOfTextMarkerRange(textMarkerRange), visiblePositionForEndOfTextMarkerRange(textMarkerRange));
+ AXObjectCache* cache = m_object->axObjectCache();
+ return VisiblePositionRange(visiblePositionForStartOfTextMarkerRange(cache, textMarkerRange), visiblePositionForEndOfTextMarkerRange(cache, textMarkerRange));
}
- (NSArray*)renderWidgetChildren
@@ -1028,7 +1056,7 @@ static NSMutableArray* convertToNSArray(const AccessibilityObject::Accessibility
VisibleSelection selection = m_object->selection();
if (selection.isNone())
return nil;
- return textMarkerRangeFromVisiblePositions(selection.visibleStart(), selection.visibleEnd());
+ return [self textMarkerRangeFromVisiblePositions:selection.visibleStart() endPosition:selection.visibleEnd()];
}
- (NSValue*)position
@@ -1354,11 +1382,7 @@ static NSString* roleValueToNSString(AccessibilityRole value)
// or maybe pointers to member functions
- (id)accessibilityAttributeValue:(NSString*)attributeName
{
- if (!m_object)
- return nil;
-
- m_object->updateBackingStore();
- if (!m_object)
+ if (![self updateObjectBackingStore])
return nil;
if ([attributeName isEqualToString: NSAccessibilityRoleAttribute])
@@ -1784,9 +1808,9 @@ static NSString* roleValueToNSString(AccessibilityRole value)
return nil;
if ([attributeName isEqualToString: @"AXStartTextMarker"])
- return textMarkerForVisiblePosition(startOfDocument(renderer->document()));
+ return [self textMarkerForVisiblePosition:startOfDocument(renderer->document())];
if ([attributeName isEqualToString: @"AXEndTextMarker"])
- return textMarkerForVisiblePosition(endOfDocument(renderer->document()));
+ return [self textMarkerForVisiblePosition:endOfDocument(renderer->document())];
if ([attributeName isEqualToString:NSAccessibilityBlockQuoteLevelAttribute])
return [NSNumber numberWithInt:blockquoteLevel(renderer)];
@@ -1889,11 +1913,7 @@ static NSString* roleValueToNSString(AccessibilityRole value)
- (id)accessibilityFocusedUIElement
{
- if (!m_object)
- return nil;
-
- m_object->updateBackingStore();
- if (!m_object)
+ if (![self updateObjectBackingStore])
return nil;
RefPtr<AccessibilityObject> focusedObj = m_object->focusedUIElement();
@@ -1906,11 +1926,7 @@ static NSString* roleValueToNSString(AccessibilityRole value)
- (id)accessibilityHitTest:(NSPoint)point
{
- if (!m_object)
- return nil;
-
- m_object->updateBackingStore();
- if (!m_object)
+ if (![self updateObjectBackingStore])
return nil;
RefPtr<AccessibilityObject> axObject = m_object->doAccessibilityHitTest(IntPoint(point));
@@ -1921,11 +1937,7 @@ static NSString* roleValueToNSString(AccessibilityRole value)
- (BOOL)accessibilityIsAttributeSettable:(NSString*)attributeName
{
- if (!m_object)
- return nil;
-
- m_object->updateBackingStore();
- if (!m_object)
+ if (![self updateObjectBackingStore])
return nil;
if ([attributeName isEqualToString: @"AXSelectedTextMarkerRange"])
@@ -1971,11 +1983,7 @@ static NSString* roleValueToNSString(AccessibilityRole value)
// Registering an object is also required for observing notifications. Only registered objects can be observed.
- (BOOL)accessibilityIsIgnored
{
- if (!m_object)
- return YES;
-
- m_object->updateBackingStore();
- if (!m_object)
+ if (![self updateObjectBackingStore])
return YES;
if (m_object->isAttachment())
@@ -1985,11 +1993,7 @@ static NSString* roleValueToNSString(AccessibilityRole value)
- (NSArray* )accessibilityParameterizedAttributeNames
{
- if (!m_object)
- return nil;
-
- m_object->updateBackingStore();
- if (!m_object)
+ if (![self updateObjectBackingStore])
return nil;
if (m_object->isAttachment())
@@ -2073,11 +2077,7 @@ static NSString* roleValueToNSString(AccessibilityRole value)
- (void)accessibilityPerformPressAction
{
- if (!m_object)
- return;
-
- m_object->updateBackingStore();
- if (!m_object)
+ if (![self updateObjectBackingStore])
return;
if (m_object->isAttachment())
@@ -2088,11 +2088,7 @@ static NSString* roleValueToNSString(AccessibilityRole value)
- (void)accessibilityPerformIncrementAction
{
- if (!m_object)
- return;
-
- m_object->updateBackingStore();
- if (!m_object)
+ if (![self updateObjectBackingStore])
return;
if (m_object->isAttachment())
@@ -2103,11 +2099,7 @@ static NSString* roleValueToNSString(AccessibilityRole value)
- (void)accessibilityPerformDecrementAction
{
- if (!m_object)
- return;
-
- m_object->updateBackingStore();
- if (!m_object)
+ if (![self updateObjectBackingStore])
return;
if (m_object->isAttachment())
@@ -2158,11 +2150,7 @@ static NSString* roleValueToNSString(AccessibilityRole value)
- (void)accessibilityPerformAction:(NSString*)action
{
- if (!m_object)
- return;
-
- m_object->updateBackingStore();
- if (!m_object)
+ if (![self updateObjectBackingStore])
return;
if ([action isEqualToString:NSAccessibilityPressAction])
@@ -2180,11 +2168,7 @@ static NSString* roleValueToNSString(AccessibilityRole value)
- (void)accessibilitySetValue:(id)value forAttribute:(NSString*)attributeName
{
- if (!m_object)
- return;
-
- m_object->updateBackingStore();
- if (!m_object)
+ if (![self updateObjectBackingStore])
return;
WebCoreTextMarkerRange* textMarkerRange = nil;
@@ -2290,7 +2274,7 @@ static RenderObject* rendererForView(NSView* view)
{
PlainTextRange textRange = PlainTextRange(range.location, range.length);
VisiblePositionRange visiblePosRange = m_object->visiblePositionRangeForRange(textRange);
- return [self doAXAttributedStringForTextMarkerRange:textMarkerRangeFromVisiblePositions(visiblePosRange.start, visiblePosRange.end)];
+ return [self doAXAttributedStringForTextMarkerRange:[self textMarkerRangeFromVisiblePositions:visiblePosRange.start endPosition:visiblePosRange.end]];
}
// The RTF representation of the text associated with this accessibility object that is
@@ -2317,8 +2301,7 @@ static RenderObject* rendererForView(NSView* view)
if (!m_object || !attribute || !parameter)
return nil;
- m_object->updateBackingStore();
- if (!m_object)
+ if (![self updateObjectBackingStore])
return nil;
// common parameter type check/casting. Nil checks in handlers catch wrong type case.
@@ -2353,7 +2336,7 @@ static RenderObject* rendererForView(NSView* view)
// dispatch
if ([attribute isEqualToString:@"AXUIElementForTextMarker"]) {
- VisiblePosition visiblePos = visiblePositionForTextMarker(textMarker);
+ VisiblePosition visiblePos = [self visiblePositionForTextMarker:(textMarker)];
AccessibilityObject* axObject = m_object->accessibilityObjectForPosition(visiblePos);
if (!axObject)
return nil;
@@ -2362,17 +2345,17 @@ static RenderObject* rendererForView(NSView* view)
if ([attribute isEqualToString:@"AXTextMarkerRangeForUIElement"]) {
VisiblePositionRange vpRange = uiElement.get()->visiblePositionRange();
- return (id)textMarkerRangeFromVisiblePositions(vpRange.start, vpRange.end);
+ return [self textMarkerRangeFromVisiblePositions:vpRange.start endPosition:vpRange.end];
}
if ([attribute isEqualToString:@"AXLineForTextMarker"]) {
- VisiblePosition visiblePos = visiblePositionForTextMarker(textMarker);
+ VisiblePosition visiblePos = [self visiblePositionForTextMarker:(textMarker)];
return [NSNumber numberWithUnsignedInt:m_object->lineForPosition(visiblePos)];
}
if ([attribute isEqualToString:@"AXTextMarkerRangeForLine"]) {
VisiblePositionRange vpRange = m_object->visiblePositionRangeForLine([number intValue]);
- return (id)textMarkerRangeFromVisiblePositions(vpRange.start, vpRange.end);
+ return [self textMarkerRangeFromVisiblePositions:vpRange.start endPosition:vpRange.end];
}
if ([attribute isEqualToString:@"AXStringForTextMarkerRange"]) {
@@ -2382,7 +2365,7 @@ static RenderObject* rendererForView(NSView* view)
if ([attribute isEqualToString:@"AXTextMarkerForPosition"]) {
IntPoint webCorePoint = IntPoint(point);
- return pointSet ? textMarkerForVisiblePosition(m_object->visiblePositionForPoint(webCorePoint)) : nil;
+ return pointSet ? [self textMarkerForVisiblePosition:m_object->visiblePositionForPoint(webCorePoint)] : nil;
}
if ([attribute isEqualToString:@"AXBoundsForTextMarkerRange"]) {
@@ -2421,102 +2404,102 @@ static RenderObject* rendererForView(NSView* view)
|| ![[WebCoreViewFactory sharedFactory] objectIsTextMarker:textMarker2])
return nil;
- VisiblePosition visiblePos1 = visiblePositionForTextMarker(textMarker1);
- VisiblePosition visiblePos2 = visiblePositionForTextMarker(textMarker2);
+ VisiblePosition visiblePos1 = [self visiblePositionForTextMarker:(textMarker1)];
+ VisiblePosition visiblePos2 = [self visiblePositionForTextMarker:(textMarker2)];
VisiblePositionRange vpRange = m_object->visiblePositionRangeForUnorderedPositions(visiblePos1, visiblePos2);
- return (id)textMarkerRangeFromVisiblePositions(vpRange.start, vpRange.end);
+ return [self textMarkerRangeFromVisiblePositions:vpRange.start endPosition:vpRange.end];
}
if ([attribute isEqualToString:@"AXNextTextMarkerForTextMarker"]) {
- VisiblePosition visiblePos = visiblePositionForTextMarker(textMarker);
- return textMarkerForVisiblePosition(m_object->nextVisiblePosition(visiblePos));
+ VisiblePosition visiblePos = [self visiblePositionForTextMarker:(textMarker)];
+ return [self textMarkerForVisiblePosition:m_object->nextVisiblePosition(visiblePos)];
}
if ([attribute isEqualToString:@"AXPreviousTextMarkerForTextMarker"]) {
- VisiblePosition visiblePos = visiblePositionForTextMarker(textMarker);
- return textMarkerForVisiblePosition(m_object->previousVisiblePosition(visiblePos));
+ VisiblePosition visiblePos = [self visiblePositionForTextMarker:(textMarker)];
+ return [self textMarkerForVisiblePosition:m_object->previousVisiblePosition(visiblePos)];
}
if ([attribute isEqualToString:@"AXLeftWordTextMarkerRangeForTextMarker"]) {
- VisiblePosition visiblePos = visiblePositionForTextMarker(textMarker);
+ VisiblePosition visiblePos = [self visiblePositionForTextMarker:(textMarker)];
VisiblePositionRange vpRange = m_object->positionOfLeftWord(visiblePos);
- return (id)textMarkerRangeFromVisiblePositions(vpRange.start, vpRange.end);
+ return [self textMarkerRangeFromVisiblePositions:vpRange.start endPosition:vpRange.end];
}
if ([attribute isEqualToString:@"AXRightWordTextMarkerRangeForTextMarker"]) {
- VisiblePosition visiblePos = visiblePositionForTextMarker(textMarker);
+ VisiblePosition visiblePos = [self visiblePositionForTextMarker:(textMarker)];
VisiblePositionRange vpRange = m_object->positionOfRightWord(visiblePos);
- return (id)textMarkerRangeFromVisiblePositions(vpRange.start, vpRange.end);
+ return [self textMarkerRangeFromVisiblePositions:vpRange.start endPosition:vpRange.end];
}
if ([attribute isEqualToString:@"AXLeftLineTextMarkerRangeForTextMarker"]) {
- VisiblePosition visiblePos = visiblePositionForTextMarker(textMarker);
+ VisiblePosition visiblePos = [self visiblePositionForTextMarker:(textMarker)];
VisiblePositionRange vpRange = m_object->leftLineVisiblePositionRange(visiblePos);
- return (id)textMarkerRangeFromVisiblePositions(vpRange.start, vpRange.end);
+ return [self textMarkerRangeFromVisiblePositions:vpRange.start endPosition:vpRange.end];
}
if ([attribute isEqualToString:@"AXRightLineTextMarkerRangeForTextMarker"]) {
- VisiblePosition visiblePos = visiblePositionForTextMarker(textMarker);
+ VisiblePosition visiblePos = [self visiblePositionForTextMarker:(textMarker)];
VisiblePositionRange vpRange = m_object->rightLineVisiblePositionRange(visiblePos);
- return (id)textMarkerRangeFromVisiblePositions(vpRange.start, vpRange.end);
+ return [self textMarkerRangeFromVisiblePositions:vpRange.start endPosition:vpRange.end];
}
if ([attribute isEqualToString:@"AXSentenceTextMarkerRangeForTextMarker"]) {
- VisiblePosition visiblePos = visiblePositionForTextMarker(textMarker);
+ VisiblePosition visiblePos = [self visiblePositionForTextMarker:(textMarker)];
VisiblePositionRange vpRange = m_object->sentenceForPosition(visiblePos);
- return (id)textMarkerRangeFromVisiblePositions(vpRange.start, vpRange.end);
+ return [self textMarkerRangeFromVisiblePositions:vpRange.start endPosition:vpRange.end];
}
if ([attribute isEqualToString:@"AXParagraphTextMarkerRangeForTextMarker"]) {
- VisiblePosition visiblePos = visiblePositionForTextMarker(textMarker);
+ VisiblePosition visiblePos = [self visiblePositionForTextMarker:(textMarker)];
VisiblePositionRange vpRange = m_object->paragraphForPosition(visiblePos);
- return (id)textMarkerRangeFromVisiblePositions(vpRange.start, vpRange.end);
+ return [self textMarkerRangeFromVisiblePositions:vpRange.start endPosition:vpRange.end];
}
if ([attribute isEqualToString:@"AXNextWordEndTextMarkerForTextMarker"]) {
- VisiblePosition visiblePos = visiblePositionForTextMarker(textMarker);
- return textMarkerForVisiblePosition(m_object->nextWordEnd(visiblePos));
+ VisiblePosition visiblePos = [self visiblePositionForTextMarker:(textMarker)];
+ return [self textMarkerForVisiblePosition:m_object->nextWordEnd(visiblePos)];
}
if ([attribute isEqualToString:@"AXPreviousWordStartTextMarkerForTextMarker"]) {
- VisiblePosition visiblePos = visiblePositionForTextMarker(textMarker);
- return textMarkerForVisiblePosition(m_object->previousWordStart(visiblePos));
+ VisiblePosition visiblePos = [self visiblePositionForTextMarker:(textMarker)];
+ return [self textMarkerForVisiblePosition:m_object->previousWordStart(visiblePos)];
}
if ([attribute isEqualToString:@"AXNextLineEndTextMarkerForTextMarker"]) {
- VisiblePosition visiblePos = visiblePositionForTextMarker(textMarker);
- return textMarkerForVisiblePosition(m_object->nextLineEndPosition(visiblePos));
+ VisiblePosition visiblePos = [self visiblePositionForTextMarker:(textMarker)];
+ return [self textMarkerForVisiblePosition:m_object->nextLineEndPosition(visiblePos)];
}
if ([attribute isEqualToString:@"AXPreviousLineStartTextMarkerForTextMarker"]) {
- VisiblePosition visiblePos = visiblePositionForTextMarker(textMarker);
- return textMarkerForVisiblePosition(m_object->previousLineStartPosition(visiblePos));
+ VisiblePosition visiblePos = [self visiblePositionForTextMarker:(textMarker)];
+ return [self textMarkerForVisiblePosition:m_object->previousLineStartPosition(visiblePos)];
}
if ([attribute isEqualToString:@"AXNextSentenceEndTextMarkerForTextMarker"]) {
- VisiblePosition visiblePos = visiblePositionForTextMarker(textMarker);
- return textMarkerForVisiblePosition(m_object->nextSentenceEndPosition(visiblePos));
+ VisiblePosition visiblePos = [self visiblePositionForTextMarker:(textMarker)];
+ return [self textMarkerForVisiblePosition:m_object->nextSentenceEndPosition(visiblePos)];
}
if ([attribute isEqualToString:@"AXPreviousSentenceStartTextMarkerForTextMarker"]) {
- VisiblePosition visiblePos = visiblePositionForTextMarker(textMarker);
- return textMarkerForVisiblePosition(m_object->previousSentenceStartPosition(visiblePos));
+ VisiblePosition visiblePos = [self visiblePositionForTextMarker:(textMarker)];
+ return [self textMarkerForVisiblePosition:m_object->previousSentenceStartPosition(visiblePos)];
}
if ([attribute isEqualToString:@"AXNextParagraphEndTextMarkerForTextMarker"]) {
- VisiblePosition visiblePos = visiblePositionForTextMarker(textMarker);
- return textMarkerForVisiblePosition(m_object->nextParagraphEndPosition(visiblePos));
+ VisiblePosition visiblePos = [self visiblePositionForTextMarker:(textMarker)];
+ return [self textMarkerForVisiblePosition:m_object->nextParagraphEndPosition(visiblePos)];
}
if ([attribute isEqualToString:@"AXPreviousParagraphStartTextMarkerForTextMarker"]) {
- VisiblePosition visiblePos = visiblePositionForTextMarker(textMarker);
- return textMarkerForVisiblePosition(m_object->previousParagraphStartPosition(visiblePos));
+ VisiblePosition visiblePos = [self visiblePositionForTextMarker:(textMarker)];
+ return [self textMarkerForVisiblePosition:m_object->previousParagraphStartPosition(visiblePos)];
}
if ([attribute isEqualToString:@"AXStyleTextMarkerRangeForTextMarker"]) {
- VisiblePosition visiblePos = visiblePositionForTextMarker(textMarker);
+ VisiblePosition visiblePos = [self visiblePositionForTextMarker:(textMarker)];
VisiblePositionRange vpRange = m_object->styleRangeForPosition(visiblePos);
- return (id)textMarkerRangeFromVisiblePositions(vpRange.start, vpRange.end);
+ return [self textMarkerRangeFromVisiblePositions:vpRange.start endPosition:vpRange.end];
}
if ([attribute isEqualToString:@"AXLengthForTextMarkerRange"]) {
@@ -2530,12 +2513,12 @@ static RenderObject* rendererForView(NSView* view)
// Used only by DumpRenderTree (so far).
if ([attribute isEqualToString:@"AXStartTextMarkerForTextMarkerRange"]) {
VisiblePositionRange visiblePosRange = [self visiblePositionRangeForTextMarkerRange:textMarkerRange];
- return textMarkerForVisiblePosition(visiblePosRange.start);
+ return [self textMarkerForVisiblePosition:visiblePosRange.start];
}
if ([attribute isEqualToString:@"AXEndTextMarkerForTextMarkerRange"]) {
VisiblePositionRange visiblePosRange = [self visiblePositionRangeForTextMarkerRange:textMarkerRange];
- return textMarkerForVisiblePosition(visiblePosRange.end);
+ return [self textMarkerForVisiblePosition:visiblePosRange.end];
}
if (m_object->isDataTable()) {
@@ -2614,11 +2597,7 @@ static RenderObject* rendererForView(NSView* view)
// API that AppKit uses for faster access
- (NSUInteger)accessibilityIndexOfChild:(id)child
{
- if (!m_object)
- return NSNotFound;
-
- m_object->updateBackingStore();
- if (!m_object)
+ if (![self updateObjectBackingStore])
return NSNotFound;
// Tree objects return their rows as their children. We can use the original method
@@ -2643,11 +2622,7 @@ static RenderObject* rendererForView(NSView* view)
- (NSUInteger)accessibilityArrayAttributeCount:(NSString *)attribute
{
- if (!m_object)
- return 0;
-
- m_object->updateBackingStore();
- if (!m_object)
+ if (![self updateObjectBackingStore])
return 0;
if ([attribute isEqualToString:NSAccessibilityChildrenAttribute]) {
@@ -2668,11 +2643,7 @@ static RenderObject* rendererForView(NSView* view)
- (NSArray *)accessibilityArrayAttributeValues:(NSString *)attribute index:(NSUInteger)index maxCount:(NSUInteger)maxCount
{
- if (!m_object)
- return nil;
-
- m_object->updateBackingStore();
- if (!m_object)
+ if (![self updateObjectBackingStore])
return nil;
if ([attribute isEqualToString:NSAccessibilityChildrenAttribute]) {
diff --git a/WebCore/accessibility/win/AXObjectCacheWin.cpp b/WebCore/accessibility/win/AXObjectCacheWin.cpp
index 21e61d9..b20b51a 100644
--- a/WebCore/accessibility/win/AXObjectCacheWin.cpp
+++ b/WebCore/accessibility/win/AXObjectCacheWin.cpp
@@ -103,6 +103,10 @@ void AXObjectCache::postPlatformNotification(AccessibilityObject* obj, AXNotific
NotifyWinEvent(msaaEvent, page->chrome()->platformPageClient(), OBJID_CLIENT, -static_cast<LONG>(obj->axObjectID()));
}
+void AXObjectCache::nodeTextChangePlatformNotification(AccessibilityObject*, AXTextChange, unsigned, unsigned)
+{
+}
+
AXID AXObjectCache::platformGenerateAXID() const
{
static AXID lastUsedID = 0;
diff --git a/WebCore/bindings/generic/RuntimeEnabledFeatures.cpp b/WebCore/bindings/generic/RuntimeEnabledFeatures.cpp
index a15fd6d..9a96f22 100644
--- a/WebCore/bindings/generic/RuntimeEnabledFeatures.cpp
+++ b/WebCore/bindings/generic/RuntimeEnabledFeatures.cpp
@@ -36,6 +36,10 @@
#include "SharedWorkerRepository.h"
#include "WebSocket.h"
+#if ENABLE(FILE_SYSTEM)
+#include "AsyncFileSystem.h"
+#endif
+
namespace WebCore {
bool RuntimeEnabledFeatures::isLocalStorageEnabled = true;
@@ -57,6 +61,11 @@ bool RuntimeEnabledFeatures::isXHRResponseBlobEnabled = false;
#if ENABLE(FILE_SYSTEM)
bool RuntimeEnabledFeatures::isFileSystemEnabled = false;
+
+bool RuntimeEnabledFeatures::fileSystemEnabled()
+{
+ return isFileSystemEnabled && AsyncFileSystem::isAvailable();
+}
#endif
#if ENABLE(VIDEO)
diff --git a/WebCore/bindings/generic/RuntimeEnabledFeatures.h b/WebCore/bindings/generic/RuntimeEnabledFeatures.h
index 91768b0..88350c7 100644
--- a/WebCore/bindings/generic/RuntimeEnabledFeatures.h
+++ b/WebCore/bindings/generic/RuntimeEnabledFeatures.h
@@ -138,7 +138,7 @@ public:
static void setSpeechInputEnabled(bool isEnabled) { isSpeechInputEnabled = isEnabled; }
static bool speechInputEnabled() { return isSpeechInputEnabled; }
- static bool speechEnabled() { return isSpeechInputEnabled; }
+ static bool webkitspeechEnabled() { return isSpeechInputEnabled; }
#if ENABLE(XHR_RESPONSE_BLOB)
static bool xhrResponseBlobEnabled() { return isXHRResponseBlobEnabled; }
@@ -148,7 +148,7 @@ public:
#endif
#if ENABLE(FILE_SYSTEM)
- static bool fileSystemEnabled() { return isFileSystemEnabled; }
+ static bool fileSystemEnabled();
static void setFileSystemEnabled(bool isEnabled) { isFileSystemEnabled = isEnabled; }
static bool requestFileSystemEnabled() { return isFileSystemEnabled; }
#endif
diff --git a/WebCore/bindings/gobject/GNUmakefile.am b/WebCore/bindings/gobject/GNUmakefile.am
index 12835cc..d808e18 100644
--- a/WebCore/bindings/gobject/GNUmakefile.am
+++ b/WebCore/bindings/gobject/GNUmakefile.am
@@ -49,6 +49,8 @@ webkitgtk_gdom_built_sources += \
DerivedSources/webkit/WebKitDOMDOMStringListPrivate.h \
DerivedSources/webkit/WebKitDOMDOMStringMap.cpp \
DerivedSources/webkit/WebKitDOMDOMStringMapPrivate.h \
+ DerivedSources/webkit/WebKitDOMDOMTokenList.cpp \
+ DerivedSources/webkit/WebKitDOMDOMTokenListPrivate.h \
DerivedSources/webkit/WebKitDOMDOMWindow.cpp \
DerivedSources/webkit/WebKitDOMDOMWindowPrivate.h \
DerivedSources/webkit/WebKitDOMElement.cpp \
@@ -263,6 +265,7 @@ webkitgtk_built_h_api += \
DerivedSources/webkit/WebKitDOMDOMImplementation.h \
DerivedSources/webkit/WebKitDOMDOMStringList.h \
DerivedSources/webkit/WebKitDOMDOMStringMap.h \
+ DerivedSources/webkit/WebKitDOMDOMTokenList.h \
DerivedSources/webkit/WebKitDOMElement.h \
DerivedSources/webkit/WebKitDOMEntityReference.h \
DerivedSources/webkit/WebKitDOMEvent.h \
diff --git a/WebCore/bindings/js/JSClipboardCustom.cpp b/WebCore/bindings/js/JSClipboardCustom.cpp
index 2a8d309..17c6640 100644
--- a/WebCore/bindings/js/JSClipboardCustom.cpp
+++ b/WebCore/bindings/js/JSClipboardCustom.cpp
@@ -101,7 +101,7 @@ JSValue JSClipboard::setDragImage(ExecState* exec)
{
Clipboard* clipboard = impl();
- if (!clipboard->isForDragging())
+ if (!clipboard->isForDragAndDrop())
return jsUndefined();
// FIXME: It does not match the rest of the JS bindings to throw on invalid number of arguments.
diff --git a/WebCore/bindings/js/JSDeviceMotionEventCustom.cpp b/WebCore/bindings/js/JSDeviceMotionEventCustom.cpp
index 225a626..f1c1bc0 100644
--- a/WebCore/bindings/js/JSDeviceMotionEventCustom.cpp
+++ b/WebCore/bindings/js/JSDeviceMotionEventCustom.cpp
@@ -35,54 +35,124 @@ using namespace JSC;
namespace WebCore {
-JSValue JSDeviceMotionEvent::xAcceleration(ExecState* exec) const
+static PassRefPtr<DeviceMotionData::Acceleration> readAccelerationArgument(JSValue value, ExecState* exec)
{
- DeviceMotionEvent* imp = static_cast<DeviceMotionEvent*>(impl());
- if (!imp->deviceMotionData()->canProvideXAcceleration())
- return jsNull();
- return jsNumber(exec, imp->deviceMotionData()->xAcceleration());
+ if (value.isUndefinedOrNull())
+ return 0;
+
+ // Given the above test, this will always yield an object.
+ JSObject* object = value.toObject(exec);
+
+ JSValue xValue = object->get(exec, Identifier(exec, "x"));
+ if (exec->hadException())
+ return 0;
+ bool canProvideX = !xValue.isUndefinedOrNull();
+ double x = xValue.toNumber(exec);
+ if (exec->hadException())
+ return 0;
+
+ JSValue yValue = object->get(exec, Identifier(exec, "y"));
+ if (exec->hadException())
+ return 0;
+ bool canProvideY = !yValue.isUndefinedOrNull();
+ double y = yValue.toNumber(exec);
+ if (exec->hadException())
+ return 0;
+
+ JSValue zValue = object->get(exec, Identifier(exec, "z"));
+ if (exec->hadException())
+ return 0;
+ bool canProvideZ = !zValue.isUndefinedOrNull();
+ double z = zValue.toNumber(exec);
+ if (exec->hadException())
+ return 0;
+
+ if (!canProvideX && !canProvideY && !canProvideZ)
+ return 0;
+
+ return DeviceMotionData::Acceleration::create(canProvideX, x, canProvideY, y, canProvideZ, z);
}
-JSValue JSDeviceMotionEvent::yAcceleration(ExecState* exec) const
+static PassRefPtr<DeviceMotionData::RotationRate> readRotationRateArgument(JSValue value, ExecState* exec)
{
- DeviceMotionEvent* imp = static_cast<DeviceMotionEvent*>(impl());
- if (!imp->deviceMotionData()->canProvideYAcceleration())
- return jsNull();
- return jsNumber(exec, imp->deviceMotionData()->yAcceleration());
+ if (value.isUndefinedOrNull())
+ return 0;
+
+ // Given the above test, this will always yield an object.
+ JSObject* object = value.toObject(exec);
+
+ JSValue alphaValue = object->get(exec, Identifier(exec, "alpha"));
+ if (exec->hadException())
+ return 0;
+ bool canProvideAlpha = !alphaValue.isUndefinedOrNull();
+ double alpha = alphaValue.toNumber(exec);
+ if (exec->hadException())
+ return 0;
+
+ JSValue betaValue = object->get(exec, Identifier(exec, "beta"));
+ if (exec->hadException())
+ return 0;
+ bool canProvideBeta = !betaValue.isUndefinedOrNull();
+ double beta = betaValue.toNumber(exec);
+ if (exec->hadException())
+ return 0;
+
+ JSValue gammaValue = object->get(exec, Identifier(exec, "gamma"));
+ if (exec->hadException())
+ return 0;
+ bool canProvideGamma = !gammaValue.isUndefinedOrNull();
+ double gamma = gammaValue.toNumber(exec);
+ if (exec->hadException())
+ return 0;
+
+ if (!canProvideAlpha && !canProvideBeta && !canProvideGamma)
+ return 0;
+
+ return DeviceMotionData::RotationRate::create(canProvideAlpha, alpha, canProvideBeta, beta, canProvideGamma, gamma);
}
-JSValue JSDeviceMotionEvent::zAcceleration(ExecState* exec) const
+static JSObject* createAccelerationObject(const DeviceMotionData::Acceleration* acceleration, ExecState* exec)
{
- DeviceMotionEvent* imp = static_cast<DeviceMotionEvent*>(impl());
- if (!imp->deviceMotionData()->canProvideZAcceleration())
- return jsNull();
- return jsNumber(exec, imp->deviceMotionData()->zAcceleration());
+ JSObject* object = constructEmptyObject(exec);
+ object->putDirect(Identifier(exec, "x"), acceleration->canProvideX() ? jsNumber(exec, acceleration->x()) : jsNull());
+ object->putDirect(Identifier(exec, "y"), acceleration->canProvideY() ? jsNumber(exec, acceleration->y()) : jsNull());
+ object->putDirect(Identifier(exec, "z"), acceleration->canProvideZ() ? jsNumber(exec, acceleration->z()) : jsNull());
+ return object;
+}
+
+static JSObject* createRotationRateObject(const DeviceMotionData::RotationRate* rotationRate, ExecState* exec)
+{
+ JSObject* object = constructEmptyObject(exec);
+ object->putDirect(Identifier(exec, "alpha"), rotationRate->canProvideAlpha() ? jsNumber(exec, rotationRate->alpha()) : jsNull());
+ object->putDirect(Identifier(exec, "beta"), rotationRate->canProvideBeta() ? jsNumber(exec, rotationRate->beta()) : jsNull());
+ object->putDirect(Identifier(exec, "gamma"), rotationRate->canProvideGamma() ? jsNumber(exec, rotationRate->gamma()) : jsNull());
+ return object;
}
-JSValue JSDeviceMotionEvent::xRotationRate(ExecState* exec) const
+JSValue JSDeviceMotionEvent::acceleration(ExecState* exec) const
{
DeviceMotionEvent* imp = static_cast<DeviceMotionEvent*>(impl());
- if (!imp->deviceMotionData()->canProvideXRotationRate())
+ if (!imp->deviceMotionData()->acceleration())
return jsNull();
- return jsNumber(exec, imp->deviceMotionData()->xRotationRate());
+ return createAccelerationObject(imp->deviceMotionData()->acceleration(), exec);
}
-JSValue JSDeviceMotionEvent::yRotationRate(ExecState* exec) const
+JSValue JSDeviceMotionEvent::accelerationIncludingGravity(ExecState* exec) const
{
DeviceMotionEvent* imp = static_cast<DeviceMotionEvent*>(impl());
- if (!imp->deviceMotionData()->canProvideYRotationRate())
+ if (!imp->deviceMotionData()->accelerationIncludingGravity())
return jsNull();
- return jsNumber(exec, imp->deviceMotionData()->yRotationRate());
+ return createAccelerationObject(imp->deviceMotionData()->accelerationIncludingGravity(), exec);
}
-JSValue JSDeviceMotionEvent::zRotationRate(ExecState* exec) const
+JSValue JSDeviceMotionEvent::rotationRate(ExecState* exec) const
{
DeviceMotionEvent* imp = static_cast<DeviceMotionEvent*>(impl());
- if (!imp->deviceMotionData()->canProvideZRotationRate())
+ if (!imp->deviceMotionData()->rotationRate())
return jsNull();
- return jsNumber(exec, imp->deviceMotionData()->zRotationRate());
+ return createRotationRateObject(imp->deviceMotionData()->rotationRate(), exec);
}
-
+
JSValue JSDeviceMotionEvent::interval(ExecState* exec) const
{
DeviceMotionEvent* imp = static_cast<DeviceMotionEvent*>(impl());
@@ -90,35 +160,30 @@ JSValue JSDeviceMotionEvent::interval(ExecState* exec) const
return jsNull();
return jsNumber(exec, imp->deviceMotionData()->interval());
}
-
+
JSValue JSDeviceMotionEvent::initDeviceMotionEvent(ExecState* exec)
{
const String& type = ustringToString(exec->argument(0).toString(exec));
bool bubbles = exec->argument(1).toBoolean(exec);
bool cancelable = exec->argument(2).toBoolean(exec);
+
// If any of the parameters are null or undefined, mark them as not provided.
// Otherwise, use the standard JavaScript conversion.
- bool xAccelerationProvided = !exec->argument(3).isUndefinedOrNull();
- double xAcceleration = exec->argument(3).toNumber(exec);
- bool yAccelerationProvided = !exec->argument(4).isUndefinedOrNull();
- double yAcceleration = exec->argument(4).toNumber(exec);
- bool zAccelerationProvided = !exec->argument(5).isUndefinedOrNull();
- double zAcceleration = exec->argument(5).toNumber(exec);
- bool xRotationRateProvided = !exec->argument(6).isUndefinedOrNull();
- double xRotationRate = exec->argument(6).toNumber(exec);
- bool yRotationRateProvided = !exec->argument(7).isUndefinedOrNull();
- double yRotationRate = exec->argument(7).toNumber(exec);
- bool zRotationRateProvided = !exec->argument(8).isUndefinedOrNull();
- double zRotationRate = exec->argument(8).toNumber(exec);
- bool intervalProvided = !exec->argument(9).isUndefinedOrNull();
- double interval = exec->argument(9).toNumber(exec);
- RefPtr<DeviceMotionData> deviceMotionData = DeviceMotionData::create(xAccelerationProvided, xAcceleration,
- yAccelerationProvided, yAcceleration,
- zAccelerationProvided, zAcceleration,
- xRotationRateProvided, xRotationRate,
- yRotationRateProvided, yRotationRate,
- zRotationRateProvided, zRotationRate,
- intervalProvided, interval);
+ RefPtr<DeviceMotionData::Acceleration> acceleration = readAccelerationArgument(exec->argument(3), exec);
+ if (exec->hadException())
+ return jsUndefined();
+
+ RefPtr<DeviceMotionData::Acceleration> accelerationIncludingGravity = readAccelerationArgument(exec->argument(4), exec);
+ if (exec->hadException())
+ return jsUndefined();
+
+ RefPtr<DeviceMotionData::RotationRate> rotationRate = readRotationRateArgument(exec->argument(5), exec);
+ if (exec->hadException())
+ return jsUndefined();
+
+ bool intervalProvided = !exec->argument(6).isUndefinedOrNull();
+ double interval = exec->argument(6).toNumber(exec);
+ RefPtr<DeviceMotionData> deviceMotionData = DeviceMotionData::create(acceleration, accelerationIncludingGravity, rotationRate, intervalProvided, interval);
DeviceMotionEvent* imp = static_cast<DeviceMotionEvent*>(impl());
imp->initDeviceMotionEvent(type, bubbles, cancelable, deviceMotionData.get());
return jsUndefined();
diff --git a/WebCore/bindings/js/JSDirectoryEntryCustom.cpp b/WebCore/bindings/js/JSDirectoryEntryCustom.cpp
index 35a6c32..a0e0455 100644
--- a/WebCore/bindings/js/JSDirectoryEntryCustom.cpp
+++ b/WebCore/bindings/js/JSDirectoryEntryCustom.cpp
@@ -66,7 +66,7 @@ JSValue JSDirectoryEntry::getFile(ExecState* exec)
JSValue jsExclusive = object->get(exec, Identifier(exec, "exclusive"));
flags->setExclusive(jsExclusive.toBoolean(exec));
} else
- flags = adoptRef(toFlags(exec->argument(1)));
+ flags = toFlags(exec->argument(1));
if (exec->hadException())
return jsUndefined();
RefPtr<EntryCallback> successCallback;
@@ -112,7 +112,7 @@ JSValue JSDirectoryEntry::getDirectory(ExecState* exec)
JSValue jsExclusive = object->get(exec, Identifier(exec, "exclusive"));
flags->setExclusive(jsExclusive.toBoolean(exec));
} else
- flags = adoptRef(toFlags(exec->argument(1)));
+ flags = toFlags(exec->argument(1));
if (exec->hadException())
return jsUndefined();
RefPtr<EntryCallback> successCallback;
diff --git a/WebCore/bindings/js/JSElementCustom.cpp b/WebCore/bindings/js/JSElementCustom.cpp
index 8a1df5c..f691620 100644
--- a/WebCore/bindings/js/JSElementCustom.cpp
+++ b/WebCore/bindings/js/JSElementCustom.cpp
@@ -60,6 +60,7 @@ void JSElement::markChildren(MarkStack& markStack)
JSGlobalData& globalData = *Heap::heap(this)->globalData();
markDOMObjectWrapper(markStack, globalData, element->attributeMap());
+ markDOMObjectWrapper(markStack, globalData, element->optionalClassList());
markDOMObjectWrapper(markStack, globalData, element->optionalDataset());
if (element->isStyledElement())
diff --git a/WebCore/bindings/js/JSInspectorFrontendHostCustom.cpp b/WebCore/bindings/js/JSInspectorFrontendHostCustom.cpp
index 1df1af0..ee79a38 100644
--- a/WebCore/bindings/js/JSInspectorFrontendHostCustom.cpp
+++ b/WebCore/bindings/js/JSInspectorFrontendHostCustom.cpp
@@ -58,6 +58,8 @@ JSValue JSInspectorFrontendHost::platform(ExecState* execState)
DEFINE_STATIC_LOCAL(const String, platform, ("windows"));
#elif OS(LINUX)
DEFINE_STATIC_LOCAL(const String, platform, ("linux"));
+#elif OS(FREEBSD)
+ DEFINE_STATIC_LOCAL(const String, platform, ("freebsd"));
#else
DEFINE_STATIC_LOCAL(const String, platform, ("unknown"));
#endif
diff --git a/WebCore/bindings/js/ScriptFunctionCall.cpp b/WebCore/bindings/js/ScriptFunctionCall.cpp
index 9baf809..2e4d536 100644
--- a/WebCore/bindings/js/ScriptFunctionCall.cpp
+++ b/WebCore/bindings/js/ScriptFunctionCall.cpp
@@ -43,14 +43,7 @@ using namespace JSC;
namespace WebCore {
-ScriptFunctionCall::ScriptFunctionCall(const ScriptObject& thisObject, const String& name)
- : m_exec(thisObject.scriptState())
- , m_thisObject(thisObject)
- , m_name(name)
-{
-}
-
-void ScriptFunctionCall::appendArgument(const ScriptObject& argument)
+void ScriptCallArgumentHandler::appendArgument(const ScriptObject& argument)
{
if (argument.scriptState() != m_exec) {
ASSERT_NOT_REACHED();
@@ -59,74 +52,81 @@ void ScriptFunctionCall::appendArgument(const ScriptObject& argument)
m_arguments.append(argument.jsObject());
}
-void ScriptFunctionCall::appendArgument(const ScriptString& argument)
+void ScriptCallArgumentHandler::appendArgument(const ScriptString& argument)
{
m_arguments.append(jsString(m_exec, argument.ustring()));
}
-void ScriptFunctionCall::appendArgument(const ScriptValue& argument)
+void ScriptCallArgumentHandler::appendArgument(const ScriptValue& argument)
{
m_arguments.append(argument.jsValue());
}
-void ScriptFunctionCall::appendArgument(const String& argument)
+void ScriptCallArgumentHandler::appendArgument(const String& argument)
{
JSLock lock(SilenceAssertionsOnly);
m_arguments.append(jsString(m_exec, argument));
}
-void ScriptFunctionCall::appendArgument(const JSC::UString& argument)
+void ScriptCallArgumentHandler::appendArgument(const JSC::UString& argument)
{
JSLock lock(SilenceAssertionsOnly);
m_arguments.append(jsString(m_exec, argument));
}
-void ScriptFunctionCall::appendArgument(const char* argument)
+void ScriptCallArgumentHandler::appendArgument(const char* argument)
{
JSLock lock(SilenceAssertionsOnly);
m_arguments.append(jsString(m_exec, UString(argument)));
}
-void ScriptFunctionCall::appendArgument(JSC::JSValue argument)
+void ScriptCallArgumentHandler::appendArgument(JSC::JSValue argument)
{
m_arguments.append(argument);
}
-void ScriptFunctionCall::appendArgument(long argument)
+void ScriptCallArgumentHandler::appendArgument(long argument)
{
JSLock lock(SilenceAssertionsOnly);
m_arguments.append(jsNumber(m_exec, argument));
}
-void ScriptFunctionCall::appendArgument(long long argument)
+void ScriptCallArgumentHandler::appendArgument(long long argument)
{
JSLock lock(SilenceAssertionsOnly);
m_arguments.append(jsNumber(m_exec, argument));
}
-void ScriptFunctionCall::appendArgument(unsigned int argument)
+void ScriptCallArgumentHandler::appendArgument(unsigned int argument)
{
JSLock lock(SilenceAssertionsOnly);
m_arguments.append(jsNumber(m_exec, argument));
}
-void ScriptFunctionCall::appendArgument(unsigned long argument)
+void ScriptCallArgumentHandler::appendArgument(unsigned long argument)
{
JSLock lock(SilenceAssertionsOnly);
m_arguments.append(jsNumber(m_exec, argument));
}
-void ScriptFunctionCall::appendArgument(int argument)
+void ScriptCallArgumentHandler::appendArgument(int argument)
{
JSLock lock(SilenceAssertionsOnly);
m_arguments.append(jsNumber(m_exec, argument));
}
-void ScriptFunctionCall::appendArgument(bool argument)
+void ScriptCallArgumentHandler::appendArgument(bool argument)
{
m_arguments.append(jsBoolean(argument));
}
+ScriptFunctionCall::ScriptFunctionCall(const ScriptObject& thisObject, const String& name)
+ : ScriptCallArgumentHandler(thisObject.scriptState())
+ , m_thisObject(thisObject)
+ , m_name(name)
+{
+}
+
ScriptValue ScriptFunctionCall::call(bool& hadException, bool reportExceptions)
{
JSObject* thisObject = m_thisObject.jsObject();
@@ -197,4 +197,36 @@ ScriptObject ScriptFunctionCall::construct(bool& hadException, bool reportExcept
return ScriptObject(m_exec, asObject(result));
}
+ScriptCallback::ScriptCallback(ScriptState* state, ScriptValue function)
+ : ScriptCallArgumentHandler(state)
+ , m_function(function)
+{
+}
+
+ScriptValue ScriptCallback::call()
+{
+ bool hadException;
+ return call(hadException);
+}
+
+ScriptValue ScriptCallback::call(bool& hadException)
+{
+ JSLock lock(SilenceAssertionsOnly);
+
+ CallData callData;
+ CallType callType = getCallData(m_function.jsValue(), callData);
+ if (callType == CallTypeNone)
+ return ScriptValue();
+
+ JSValue result = JSC::call(m_exec, m_function.jsValue(), callType, callData, m_function.jsValue(), m_arguments);
+ hadException = m_exec->hadException();
+
+ if (hadException) {
+ reportException(m_exec, m_exec->exception());
+ return ScriptValue();
+ }
+
+ return ScriptValue(result);
+}
+
} // namespace WebCore
diff --git a/WebCore/bindings/js/ScriptFunctionCall.h b/WebCore/bindings/js/ScriptFunctionCall.h
index 9742e8f..037a336 100644
--- a/WebCore/bindings/js/ScriptFunctionCall.h
+++ b/WebCore/bindings/js/ScriptFunctionCall.h
@@ -46,10 +46,9 @@ namespace WebCore {
class ScriptValue;
class ScriptString;
- class ScriptFunctionCall {
+ class ScriptCallArgumentHandler {
public:
- ScriptFunctionCall(const ScriptObject& thisObject, const String& name);
- virtual ~ScriptFunctionCall() {};
+ ScriptCallArgumentHandler(ScriptState* state) : m_exec(state) { }
void appendArgument(const ScriptObject&);
void appendArgument(const ScriptString&);
@@ -64,15 +63,10 @@ namespace WebCore {
void appendArgument(unsigned long);
void appendArgument(int);
void appendArgument(bool);
- ScriptValue call(bool& hadException, bool reportExceptions = true);
- ScriptValue call();
- ScriptObject construct(bool& hadException, bool reportExceptions = true);
protected:
- ScriptState* m_exec;
- ScriptObject m_thisObject;
- String m_name;
JSC::MarkedArgumentBuffer m_arguments;
+ ScriptState* m_exec;
private:
// MarkedArgumentBuffer must be stack allocated, so prevent heap
@@ -81,6 +75,29 @@ namespace WebCore {
void* operator new[](size_t) { ASSERT_NOT_REACHED(); return reinterpret_cast<void*>(0xbadbeef); }
};
+ class ScriptFunctionCall : public ScriptCallArgumentHandler {
+ public:
+ ScriptFunctionCall(const ScriptObject& thisObject, const String& name);
+ ScriptValue call(bool& hadException, bool reportExceptions = true);
+ ScriptValue call();
+ ScriptObject construct(bool& hadException, bool reportExceptions = true);
+
+ protected:
+ ScriptObject m_thisObject;
+ String m_name;
+ };
+
+ class ScriptCallback : public ScriptCallArgumentHandler {
+ public:
+ ScriptCallback(ScriptState*, ScriptValue);
+
+ ScriptValue call();
+ ScriptValue call(bool& hadException);
+
+ private:
+ ScriptValue m_function;
+ };
+
} // namespace WebCore
#endif // ScriptFunctionCall
diff --git a/WebCore/bindings/objc/ObjCEventListener.h b/WebCore/bindings/objc/ObjCEventListener.h
index 434ef45..5a2941f 100644
--- a/WebCore/bindings/objc/ObjCEventListener.h
+++ b/WebCore/bindings/objc/ObjCEventListener.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004, 2006, 2008 Apple Computer, Inc. All rights reserved.
+ * Copyright (C) 2004, 2006, 2008, 2010 Apple Inc. All rights reserved.
* Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
*
* Redistribution and use in source and binary forms, with or without
@@ -28,8 +28,8 @@
#define ObjCEventListener_h
#include "EventListener.h"
-
-#include <wtf/PassRefPtr.h>
+#include <wtf/Forward.h>
+#include <wtf/RetainPtr.h>
@protocol DOMEventListener;
@@ -37,7 +37,8 @@ namespace WebCore {
class ObjCEventListener : public EventListener {
public:
- static PassRefPtr<ObjCEventListener> wrap(id <DOMEventListener>);
+ typedef id<DOMEventListener> ObjCListener;
+ static PassRefPtr<ObjCEventListener> wrap(ObjCListener);
static const ObjCEventListener* cast(const EventListener* listener)
{
@@ -46,17 +47,15 @@ namespace WebCore {
: 0;
}
- virtual bool operator==(const EventListener& other);
-
private:
- static ObjCEventListener* find(id <DOMEventListener>);
+ static ObjCEventListener* find(ObjCListener);
- ObjCEventListener(id <DOMEventListener>);
+ ObjCEventListener(ObjCListener);
virtual ~ObjCEventListener();
-
+ virtual bool operator==(const EventListener&);
virtual void handleEvent(ScriptExecutionContext*, Event*);
- id <DOMEventListener> m_listener;
+ RetainPtr<ObjCListener> m_listener;
};
} // namespace WebCore
diff --git a/WebCore/bindings/objc/ObjCEventListener.mm b/WebCore/bindings/objc/ObjCEventListener.mm
index c1b8aa5..6e2a9fa 100644
--- a/WebCore/bindings/objc/ObjCEventListener.mm
+++ b/WebCore/bindings/objc/ObjCEventListener.mm
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
* Copyright (C) 2006 James G. Speth (speth@end.com)
* Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com)
*
@@ -40,7 +40,7 @@ namespace WebCore {
typedef HashMap<id, ObjCEventListener*> ListenerMap;
static ListenerMap* listenerMap;
-ObjCEventListener* ObjCEventListener::find(id <DOMEventListener> listener)
+ObjCEventListener* ObjCEventListener::find(ObjCListener listener)
{
ListenerMap* map = listenerMap;
if (!map)
@@ -48,7 +48,7 @@ ObjCEventListener* ObjCEventListener::find(id <DOMEventListener> listener)
return map->get(listener);
}
-PassRefPtr<ObjCEventListener> ObjCEventListener::wrap(id <DOMEventListener> listener)
+PassRefPtr<ObjCEventListener> ObjCEventListener::wrap(ObjCListener listener)
{
RefPtr<ObjCEventListener> wrapper = find(listener);
if (wrapper)
@@ -56,9 +56,9 @@ PassRefPtr<ObjCEventListener> ObjCEventListener::wrap(id <DOMEventListener> list
return adoptRef(new ObjCEventListener(listener));
}
-ObjCEventListener::ObjCEventListener(id <DOMEventListener> listener)
+ObjCEventListener::ObjCEventListener(ObjCListener listener)
: EventListener(ObjCEventListenerType)
- , m_listener([listener retain])
+ , m_listener(listener)
{
ListenerMap* map = listenerMap;
if (!map) {
@@ -70,13 +70,13 @@ ObjCEventListener::ObjCEventListener(id <DOMEventListener> listener)
ObjCEventListener::~ObjCEventListener()
{
- listenerMap->remove(m_listener);
- [m_listener release];
+ listenerMap->remove(m_listener.get());
}
void ObjCEventListener::handleEvent(ScriptExecutionContext*, Event* event)
{
- [m_listener handleEvent:kit(event)];
+ ObjCListener listener = m_listener.get();
+ [listener handleEvent:kit(event)];
}
bool ObjCEventListener::operator==(const EventListener& listener)
diff --git a/WebCore/bindings/scripts/CodeGeneratorJS.pm b/WebCore/bindings/scripts/CodeGeneratorJS.pm
index 1a114a4..803542e 100644
--- a/WebCore/bindings/scripts/CodeGeneratorJS.pm
+++ b/WebCore/bindings/scripts/CodeGeneratorJS.pm
@@ -240,7 +240,7 @@ sub IndexGetterReturnsStrings
{
my $type = shift;
- return 1 if $type eq "CSSStyleDeclaration" or $type eq "MediaList" or $type eq "CSSVariablesDeclaration" or $type eq "DOMStringList";
+ return 1 if $type eq "CSSStyleDeclaration" or $type eq "MediaList" or $type eq "CSSVariablesDeclaration" or $type eq "DOMStringList" or $type eq "DOMTokenList";
return 0;
}
diff --git a/WebCore/bindings/scripts/CodeGeneratorV8.pm b/WebCore/bindings/scripts/CodeGeneratorV8.pm
index f74f2b1..3353f0f 100644
--- a/WebCore/bindings/scripts/CodeGeneratorV8.pm
+++ b/WebCore/bindings/scripts/CodeGeneratorV8.pm
@@ -2510,6 +2510,7 @@ sub HasCustomToV8Implementation {
return 1 if $interfaceName eq "CanvasPixelArray";
return 1 if $interfaceName eq "DOMStringMap";
return 1 if $interfaceName eq "DOMWindow";
+ return 1 if $interfaceName eq "DOMTokenList";
return 1 if $interfaceName eq "Element";
return 1 if $interfaceName eq "HTMLDocument";
return 1 if $interfaceName eq "HTMLElement";
diff --git a/WebCore/bindings/v8/NPV8Object.cpp b/WebCore/bindings/v8/NPV8Object.cpp
index fb97d59..e4be0d8 100644
--- a/WebCore/bindings/v8/NPV8Object.cpp
+++ b/WebCore/bindings/v8/NPV8Object.cpp
@@ -34,6 +34,7 @@
#include "OwnArrayPtr.h"
#include "PlatformString.h"
#include "ScriptController.h"
+#include "UserGestureIndicator.h"
#include "V8GCController.h"
#include "V8Helpers.h"
#include "V8NPUtils.h"
@@ -278,8 +279,17 @@ bool _NPN_EvaluateHelper(NPP npp, bool popupsAllowed, NPObject* npObject, NPStri
if (!popupsAllowed)
filename = "npscript";
+ // Set popupsAllowed flag to the current execution frame, so WebKit can get
+ // right gesture status for popups initiated from plugins.
+ Frame* frame = proxy->frame();
+ ASSERT(frame);
+ bool oldAllowPopups = frame->script()->allowPopupsFromPlugin();
+ frame->script()->setAllowPopupsFromPlugin(popupsAllowed);
+
String script = String::fromUTF8(npScript->UTF8Characters, npScript->UTF8Length);
v8::Local<v8::Value> v8result = proxy->evaluate(ScriptSourceCode(script, KURL(ParsedURLString, filename)), 0);
+ // Restore the old flag.
+ frame->script()->setAllowPopupsFromPlugin(oldAllowPopups);
if (v8result.IsEmpty())
return false;
diff --git a/WebCore/bindings/v8/ScriptController.cpp b/WebCore/bindings/v8/ScriptController.cpp
index 5023254..8018a18 100644
--- a/WebCore/bindings/v8/ScriptController.cpp
+++ b/WebCore/bindings/v8/ScriptController.cpp
@@ -121,6 +121,7 @@ ScriptController::ScriptController(Frame* frame)
, m_inExecuteScript(false)
, m_processingTimerCallback(false)
, m_paused(false)
+ , m_allowPopupsFromPlugin(false)
, m_proxy(new V8Proxy(frame))
#if ENABLE(NETSCAPE_PLUGIN_API)
, m_windowScriptNPObject(0)
@@ -203,7 +204,8 @@ bool ScriptController::processingUserGesture()
// This is the <a href="javascript:window.open('...')> case -> we let it through.
return true;
}
-
+ if (activeFrame->script()->allowPopupsFromPlugin())
+ return true;
// This is the <script>window.open(...)</script> case or a timer callback -> block it.
// Based on JSC version, use returned value of UserGestureIndicator::processingUserGesture for all other situations.
return UserGestureIndicator::processingUserGesture();
diff --git a/WebCore/bindings/v8/ScriptController.h b/WebCore/bindings/v8/ScriptController.h
index 3bc42ef..8ac9064 100644
--- a/WebCore/bindings/v8/ScriptController.h
+++ b/WebCore/bindings/v8/ScriptController.h
@@ -193,6 +193,9 @@ public:
void evaluateInWorld(const ScriptSourceCode&, DOMWrapperWorld*);
static void getAllWorlds(Vector<DOMWrapperWorld*>& worlds);
+ void setAllowPopupsFromPlugin(bool allowPopupsFromPlugin) { m_allowPopupsFromPlugin = allowPopupsFromPlugin; }
+ bool allowPopupsFromPlugin() const { return m_allowPopupsFromPlugin; }
+
private:
Frame* m_frame;
const String* m_sourceURL;
@@ -201,6 +204,7 @@ private:
bool m_processingTimerCallback;
bool m_paused;
+ bool m_allowPopupsFromPlugin;
OwnPtr<V8Proxy> m_proxy;
typedef HashMap<Widget*, NPObject*> PluginObjectMap;
diff --git a/WebCore/bindings/v8/ScriptFunctionCall.cpp b/WebCore/bindings/v8/ScriptFunctionCall.cpp
index e6b22ee..29dbb02 100644
--- a/WebCore/bindings/v8/ScriptFunctionCall.cpp
+++ b/WebCore/bindings/v8/ScriptFunctionCall.cpp
@@ -45,14 +45,7 @@
namespace WebCore {
-ScriptFunctionCall::ScriptFunctionCall(const ScriptObject& thisObject, const String& name)
- : m_scriptState(thisObject.scriptState())
- , m_thisObject(thisObject)
- , m_name(name)
-{
-}
-
-void ScriptFunctionCall::appendArgument(const ScriptObject& argument)
+void ScriptCallArgumentHandler::appendArgument(const ScriptObject& argument)
{
if (argument.scriptState() != m_scriptState) {
ASSERT_NOT_REACHED();
@@ -61,64 +54,71 @@ void ScriptFunctionCall::appendArgument(const ScriptObject& argument)
m_arguments.append(argument);
}
-void ScriptFunctionCall::appendArgument(const ScriptString& argument)
+void ScriptCallArgumentHandler::appendArgument(const ScriptString& argument)
{
ScriptScope scope(m_scriptState);
m_arguments.append(v8String(argument));
}
-void ScriptFunctionCall::appendArgument(const ScriptValue& argument)
+void ScriptCallArgumentHandler::appendArgument(const ScriptValue& argument)
{
m_arguments.append(argument);
}
-void ScriptFunctionCall::appendArgument(const String& argument)
+void ScriptCallArgumentHandler::appendArgument(const String& argument)
{
ScriptScope scope(m_scriptState);
m_arguments.append(v8String(argument));
}
-void ScriptFunctionCall::appendArgument(const char* argument)
+void ScriptCallArgumentHandler::appendArgument(const char* argument)
{
ScriptScope scope(m_scriptState);
m_arguments.append(v8String(argument));
}
-void ScriptFunctionCall::appendArgument(long argument)
+void ScriptCallArgumentHandler::appendArgument(long argument)
{
ScriptScope scope(m_scriptState);
m_arguments.append(v8::Number::New(argument));
}
-void ScriptFunctionCall::appendArgument(long long argument)
+void ScriptCallArgumentHandler::appendArgument(long long argument)
{
ScriptScope scope(m_scriptState);
m_arguments.append(v8::Number::New(argument));
}
-void ScriptFunctionCall::appendArgument(unsigned int argument)
+void ScriptCallArgumentHandler::appendArgument(unsigned int argument)
{
ScriptScope scope(m_scriptState);
m_arguments.append(v8::Number::New(argument));
}
-void ScriptFunctionCall::appendArgument(unsigned long argument)
+void ScriptCallArgumentHandler::appendArgument(unsigned long argument)
{
ScriptScope scope(m_scriptState);
m_arguments.append(v8::Number::New(argument));
}
-void ScriptFunctionCall::appendArgument(int argument)
+void ScriptCallArgumentHandler::appendArgument(int argument)
{
ScriptScope scope(m_scriptState);
m_arguments.append(v8::Number::New(argument));
}
-void ScriptFunctionCall::appendArgument(bool argument)
+void ScriptCallArgumentHandler::appendArgument(bool argument)
{
m_arguments.append(v8Boolean(argument));
}
+ScriptFunctionCall::ScriptFunctionCall(const ScriptObject& thisObject, const String& name)
+ : ScriptCallArgumentHandler(thisObject.scriptState())
+ , m_thisObject(thisObject)
+ , m_name(name)
+{
+}
+
ScriptValue ScriptFunctionCall::call(bool& hadException, bool reportExceptions)
{
ScriptScope scope(m_scriptState, reportExceptions);
@@ -179,4 +179,40 @@ ScriptObject ScriptFunctionCall::construct(bool& hadException, bool reportExcept
return ScriptObject(m_scriptState, result);
}
+ScriptCallback::ScriptCallback(ScriptState* state, ScriptValue function)
+ : ScriptCallArgumentHandler(state)
+ , m_function(function)
+{
+}
+
+ScriptValue ScriptCallback::call()
+{
+ bool hadException = false;
+ return call(hadException);
+}
+
+ScriptValue ScriptCallback::call(bool& hadException)
+{
+ ASSERT(v8::Context::InContext());
+ ASSERT(m_function.v8Value()->IsFunction());
+
+ v8::TryCatch exceptionCatcher;
+ v8::Handle<v8::Object> object = v8::Context::GetCurrent()->Global();
+ v8::Handle<v8::Function> function = v8::Handle<v8::Function>::Cast(m_function.v8Value());
+
+ OwnArrayPtr<v8::Handle<v8::Value> > args(new v8::Handle<v8::Value>[m_arguments.size()]);
+ for (size_t i = 0; i < m_arguments.size(); ++i)
+ args[i] = m_arguments[i].v8Value();
+
+ v8::Handle<v8::Value> result = V8Proxy::callFunctionWithoutFrame(function, object, m_arguments.size(), args.get());
+
+ if (exceptionCatcher.HasCaught()) {
+ hadException = true;
+ m_scriptState->setException(exceptionCatcher.Exception());
+ return ScriptValue();
+ }
+
+ return ScriptValue(result);
+}
+
} // namespace WebCore
diff --git a/WebCore/bindings/v8/ScriptFunctionCall.h b/WebCore/bindings/v8/ScriptFunctionCall.h
index 4cbbf7e..04dddc8 100644
--- a/WebCore/bindings/v8/ScriptFunctionCall.h
+++ b/WebCore/bindings/v8/ScriptFunctionCall.h
@@ -41,10 +41,9 @@ namespace WebCore {
class ScriptState;
class ScriptString;
- class ScriptFunctionCall {
+ class ScriptCallArgumentHandler {
public:
- ScriptFunctionCall(const ScriptObject& thisObject, const String& name);
- virtual ~ScriptFunctionCall() {};
+ ScriptCallArgumentHandler(ScriptState* scriptState) : m_scriptState(scriptState) { }
void appendArgument(const ScriptObject&);
void appendArgument(const ScriptString&);
@@ -57,15 +56,33 @@ namespace WebCore {
void appendArgument(unsigned long);
void appendArgument(int);
void appendArgument(bool);
+
+ protected:
+ ScriptState* m_scriptState;
+ Vector<ScriptValue> m_arguments;
+ };
+
+ class ScriptFunctionCall : public ScriptCallArgumentHandler {
+ public:
+ ScriptFunctionCall(const ScriptObject& thisObject, const String& name);
ScriptValue call(bool& hadException, bool reportExceptions = true);
ScriptValue call();
ScriptObject construct(bool& hadException, bool reportExceptions = true);
protected:
- ScriptState* m_scriptState;
ScriptObject m_thisObject;
String m_name;
- Vector<ScriptValue> m_arguments;
+ };
+
+ class ScriptCallback : public ScriptCallArgumentHandler {
+ public:
+ ScriptCallback(ScriptState*, ScriptValue);
+
+ ScriptValue call();
+ ScriptValue call(bool& hadException);
+
+ private:
+ ScriptValue m_function;
};
} // namespace WebCore
diff --git a/WebCore/bindings/v8/V8DOMWindowShell.cpp b/WebCore/bindings/v8/V8DOMWindowShell.cpp
index f0f473d..bea1eb8 100644
--- a/WebCore/bindings/v8/V8DOMWindowShell.cpp
+++ b/WebCore/bindings/v8/V8DOMWindowShell.cpp
@@ -352,11 +352,18 @@ v8::Persistent<v8::Context> V8DOMWindowShell::createNewContext(v8::Handle<v8::Ob
if (extensions[i].group && extensions[i].group != extensionGroup)
continue;
- // Note: we check the loader URL here instead of the document URL
- // because we might be currently loading an URL into a blank page.
- // See http://code.google.com/p/chromium/issues/detail?id=10924
- if (extensions[i].scheme.length() > 0 && (extensions[i].scheme != m_frame->loader()->activeDocumentLoader()->url().protocol()))
- continue;
+ if (extensions[i].useCallback) {
+ // Ensure our date extension is always allowed.
+ if (extensions[i].extension != DateExtension::get()
+ && !m_frame->loader()->client()->allowScriptExtension(extensions[i].extension->name(), extensionGroup))
+ continue;
+ } else {
+ // Note: we check the loader URL here instead of the document URL
+ // because we might be currently loading an URL into a blank page.
+ // See http://code.google.com/p/chromium/issues/detail?id=10924
+ if (extensions[i].scheme.length() > 0 && (extensions[i].scheme != m_frame->loader()->activeDocumentLoader()->url().protocol()))
+ continue;
+ }
extensionNames[index++] = extensions[i].extension->name();
}
diff --git a/WebCore/bindings/v8/V8Proxy.cpp b/WebCore/bindings/v8/V8Proxy.cpp
index 27e09e6..be2be07 100644
--- a/WebCore/bindings/v8/V8Proxy.cpp
+++ b/WebCore/bindings/v8/V8Proxy.cpp
@@ -687,11 +687,7 @@ void V8Proxy::didLeaveScriptContext()
// If we've just left a script context and indexed database has been
// instantiated, we must let its transaction coordinator know so it can terminate
// any not-yet-started transactions.
- if (IDBPendingTransactionMonitor::hasPendingTransactions()) {
- ASSERT(page->group().hasIDBFactory());
- page->group().idbFactory()->abortPendingTransactions(IDBPendingTransactionMonitor::pendingTransactions());
- IDBPendingTransactionMonitor::clearPendingTransactions();
- }
+ IDBPendingTransactionMonitor::abortPendingTransactions();
#endif // ENABLE(INDEXED_DATABASE)
// If we've just left a top level script context and local storage has been
// instantiated, we must ensure that any storage locks have been freed.
@@ -876,14 +872,21 @@ bool V8Proxy::registeredExtensionWithV8(v8::Extension* extension)
void V8Proxy::registerExtension(v8::Extension* extension, const String& schemeRestriction)
{
registerExtensionWithV8(extension);
- V8ExtensionInfo info = {schemeRestriction, 0, extension};
+ V8ExtensionInfo info = {schemeRestriction, 0, extension, false};
m_extensions.append(info);
}
void V8Proxy::registerExtension(v8::Extension* extension, int extensionGroup)
{
registerExtensionWithV8(extension);
- V8ExtensionInfo info = {String(), extensionGroup, extension};
+ V8ExtensionInfo info = {String(), extensionGroup, extension, false};
+ m_extensions.append(info);
+}
+
+void V8Proxy::registerExtension(v8::Extension* extension)
+{
+ registerExtensionWithV8(extension);
+ V8ExtensionInfo info = {String(), 0, extension, true};
m_extensions.append(info);
}
diff --git a/WebCore/bindings/v8/V8Proxy.h b/WebCore/bindings/v8/V8Proxy.h
index 4d2404f..169883b 100644
--- a/WebCore/bindings/v8/V8Proxy.h
+++ b/WebCore/bindings/v8/V8Proxy.h
@@ -128,6 +128,7 @@ namespace WebCore {
String scheme;
int group;
v8::Extension* extension;
+ bool useCallback; // FIXME: remove
};
typedef WTF::Vector<V8ExtensionInfo> V8Extensions;
@@ -337,6 +338,11 @@ namespace WebCore {
static void registerExtension(v8::Extension*, const String& schemeRestriction);
static void registerExtension(v8::Extension*, int extensionGroup);
+ // Same as above, but new version.
+ // FIXME: remove the other 2 versions in phase 3 of multipart checkin:
+ // https://bugs.webkit.org/show_bug.cgi?id=45721
+ static void registerExtension(v8::Extension*);
+
static void registerExtensionWithV8(v8::Extension*);
static bool registeredExtensionWithV8(v8::Extension*);
diff --git a/WebCore/bindings/v8/custom/V8ClipboardCustom.cpp b/WebCore/bindings/v8/custom/V8ClipboardCustom.cpp
index 69742f8..d85d7a0 100644
--- a/WebCore/bindings/v8/custom/V8ClipboardCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8ClipboardCustom.cpp
@@ -101,7 +101,7 @@ v8::Handle<v8::Value> V8Clipboard::setDragImageCallback(const v8::Arguments& arg
INC_STATS("DOM.Clipboard.setDragImage()");
Clipboard* clipboard = V8Clipboard::toNative(args.Holder());
- if (!clipboard->isForDragging())
+ if (!clipboard->isForDragAndDrop())
return v8::Undefined();
if (args.Length() != 3)
diff --git a/WebCore/bindings/v8/custom/V8CustomVoidCallback.cpp b/WebCore/bindings/v8/custom/V8CustomVoidCallback.cpp
index 25e7e0d..11f309b 100644
--- a/WebCore/bindings/v8/custom/V8CustomVoidCallback.cpp
+++ b/WebCore/bindings/v8/custom/V8CustomVoidCallback.cpp
@@ -66,6 +66,7 @@ void V8CustomVoidCallback::handleEvent()
bool invokeCallback(v8::Persistent<v8::Object> callback, int argc, v8::Handle<v8::Value> argv[], bool& callbackReturnValue, ScriptExecutionContext* scriptExecutionContext)
{
v8::TryCatch exceptionCatcher;
+ exceptionCatcher.SetVerbose(true);
v8::Local<v8::Function> callbackFunction;
if (callback->IsFunction()) {
@@ -84,14 +85,7 @@ bool invokeCallback(v8::Persistent<v8::Object> callback, int argc, v8::Handle<v8
v8::Handle<v8::Value> result = callbackFunction->Call(thisObject, argc, argv);
callbackReturnValue = !result.IsEmpty() && result->BooleanValue();
-
- if (exceptionCatcher.HasCaught()) {
- v8::Local<v8::Message> message = exceptionCatcher.Message();
- scriptExecutionContext->reportException(toWebCoreString(message->Get()), message->GetLineNumber(), toWebCoreString(message->GetScriptResourceName()));
- return true;
- }
-
- return false;
+ return exceptionCatcher.HasCaught();
}
} // namespace WebCore
diff --git a/WebCore/bindings/v8/custom/V8DOMStringMapCustom.cpp b/WebCore/bindings/v8/custom/V8DOMStringMapCustom.cpp
index c8a975b..71ff357 100644
--- a/WebCore/bindings/v8/custom/V8DOMStringMapCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8DOMStringMapCustom.cpp
@@ -34,6 +34,7 @@
#include "DOMStringMap.h"
#include "V8Binding.h"
#include "V8DOMWrapper.h"
+#include "V8Element.h"
namespace WebCore {
@@ -101,8 +102,11 @@ v8::Handle<v8::Value> toV8(DOMStringMap* impl)
v8::Handle<v8::Object> wrapper = V8DOMStringMap::wrap(impl);
// Add a hidden reference from the element to the DOMStringMap.
Element* element = impl->element();
- if (!wrapper.IsEmpty() && element)
- V8DOMWrapper::setHiddenWindowReference(element->document()->frame(), wrapper);
+ if (!wrapper.IsEmpty() && element) {
+ v8::Handle<v8::Value> elementValue = toV8(element);
+ if (!elementValue.IsEmpty() && elementValue->IsObject())
+ V8DOMWrapper::setHiddenReference(elementValue.As<v8::Object>(), wrapper);
+ }
return wrapper;
}
diff --git a/WebCore/bindings/v8/custom/V8DOMTokenListCustom.cpp b/WebCore/bindings/v8/custom/V8DOMTokenListCustom.cpp
new file mode 100644
index 0000000..171ff5c
--- /dev/null
+++ b/WebCore/bindings/v8/custom/V8DOMTokenListCustom.cpp
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "V8DOMTokenList.h"
+
+#include "DOMTokenList.h"
+#include "V8Binding.h"
+#include "V8DOMWrapper.h"
+#include "V8Element.h"
+
+namespace WebCore {
+
+v8::Handle<v8::Value> toV8(DOMTokenList* impl)
+{
+ if (!impl)
+ return v8::Null();
+ v8::Handle<v8::Object> wrapper = V8DOMTokenList::wrap(impl);
+ // Add a hidden reference from the element to the DOMTokenList.
+ Element* element = impl->element();
+ if (!wrapper.IsEmpty() && element) {
+ v8::Handle<v8::Value> elementValue = toV8(element);
+ if (!elementValue.IsEmpty() && elementValue->IsObject())
+ V8DOMWrapper::setHiddenReference(elementValue.As<v8::Object>(), wrapper);
+ }
+ return wrapper;
+}
+
+} // namespace WebCore
diff --git a/WebCore/bindings/v8/custom/V8DeviceMotionEventCustom.cpp b/WebCore/bindings/v8/custom/V8DeviceMotionEventCustom.cpp
index 67f27c5..f7a03f9 100644
--- a/WebCore/bindings/v8/custom/V8DeviceMotionEventCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8DeviceMotionEventCustom.cpp
@@ -37,67 +37,122 @@
namespace WebCore {
-v8::Handle<v8::Value> V8DeviceMotionEvent::xAccelerationAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
+namespace {
+
+v8::Handle<v8::Value> createAccelerationObject(const DeviceMotionData::Acceleration* acceleration)
{
- INC_STATS("DOM.DeviceMotionEvent.xAcceleration._get");
- v8::Handle<v8::Object> holder = info.Holder();
- DeviceMotionEvent* imp = V8DeviceMotionEvent::toNative(holder);
- if (!imp->deviceMotionData()->canProvideXAcceleration())
- return v8::Null();
- return v8::Number::New(imp->deviceMotionData()->xAcceleration());
+ v8::Local<v8::Object> object = v8::Object::New();
+ object->Set(v8::String::New("x"), acceleration->canProvideX() ? v8::Number::New(acceleration->x()) : v8::Null());
+ object->Set(v8::String::New("y"), acceleration->canProvideY() ? v8::Number::New(acceleration->y()) : v8::Null());
+ object->Set(v8::String::New("z"), acceleration->canProvideZ() ? v8::Number::New(acceleration->z()) : v8::Null());
+ return object;
}
-v8::Handle<v8::Value> V8DeviceMotionEvent::yAccelerationAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
+v8::Handle<v8::Value> createRotationRateObject(const DeviceMotionData::RotationRate* rotationRate)
{
- INC_STATS("DOM.DeviceMotionEvent.yAcceleration._get");
- v8::Handle<v8::Object> holder = info.Holder();
- DeviceMotionEvent* imp = V8DeviceMotionEvent::toNative(holder);
- if (!imp->deviceMotionData()->canProvideYAcceleration())
- return v8::Null();
- return v8::Number::New(imp->deviceMotionData()->yAcceleration());
+ v8::Local<v8::Object> object = v8::Object::New();
+ object->Set(v8::String::New("alpha"), rotationRate->canProvideAlpha() ? v8::Number::New(rotationRate->alpha()) : v8::Null());
+ object->Set(v8::String::New("beta"), rotationRate->canProvideBeta() ? v8::Number::New(rotationRate->beta()) : v8::Null());
+ object->Set(v8::String::New("gamma"), rotationRate->canProvideGamma() ? v8::Number::New(rotationRate->gamma()) : v8::Null());
+ return object;
}
-v8::Handle<v8::Value> V8DeviceMotionEvent::zAccelerationAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
+RefPtr<DeviceMotionData::Acceleration> readAccelerationArgument(v8::Local<v8::Value> value)
{
- INC_STATS("DOM.DeviceMotionEvent.zAcceleration._get");
- v8::Handle<v8::Object> holder = info.Holder();
- DeviceMotionEvent* imp = V8DeviceMotionEvent::toNative(holder);
- if (!imp->deviceMotionData()->canProvideZAcceleration())
- return v8::Null();
- return v8::Number::New(imp->deviceMotionData()->zAcceleration());
+ if (isUndefinedOrNull(value))
+ return 0;
+
+ // Given the test above, this will always yield an object.
+ v8::Local<v8::Object> object = value->ToObject();
+
+ v8::Local<v8::Value> xValue = object->Get(v8::String::New("x"));
+ if (xValue.IsEmpty())
+ return 0;
+ bool canProvideX = !isUndefinedOrNull(xValue);
+ double x = xValue->NumberValue();
+
+ v8::Local<v8::Value> yValue = object->Get(v8::String::New("y"));
+ if (yValue.IsEmpty())
+ return 0;
+ bool canProvideY = !isUndefinedOrNull(yValue);
+ double y = yValue->NumberValue();
+
+ v8::Local<v8::Value> zValue = object->Get(v8::String::New("z"));
+ if (zValue.IsEmpty())
+ return 0;
+ bool canProvideZ = !isUndefinedOrNull(zValue);
+ double z = zValue->NumberValue();
+
+ if (!canProvideX && !canProvideY && !canProvideZ)
+ return 0;
+
+ return DeviceMotionData::Acceleration::create(canProvideX, x, canProvideY, y, canProvideZ, z);
}
-v8::Handle<v8::Value> V8DeviceMotionEvent::xRotationRateAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
+RefPtr<DeviceMotionData::RotationRate> readRotationRateArgument(v8::Local<v8::Value> value)
{
- INC_STATS("DOM.DeviceMotionEvent.xRotationRate._get");
+ if (isUndefinedOrNull(value))
+ return 0;
+
+ // Given the test above, this will always yield an object.
+ v8::Local<v8::Object> object = value->ToObject();
+
+ v8::Local<v8::Value> alphaValue = object->Get(v8::String::New("alpha"));
+ if (alphaValue.IsEmpty())
+ return 0;
+ bool canProvideAlpha = !isUndefinedOrNull(alphaValue);
+ double alpha = alphaValue->NumberValue();
+
+ v8::Local<v8::Value> betaValue = object->Get(v8::String::New("beta"));
+ if (betaValue.IsEmpty())
+ return 0;
+ bool canProvideBeta = !isUndefinedOrNull(betaValue);
+ double beta = betaValue->NumberValue();
+
+ v8::Local<v8::Value> gammaValue = object->Get(v8::String::New("gamma"));
+ if (gammaValue.IsEmpty())
+ return 0;
+ bool canProvideGamma = !isUndefinedOrNull(gammaValue);
+ double gamma = gammaValue->NumberValue();
+
+ if (!canProvideAlpha && !canProvideBeta && !canProvideGamma)
+ return 0;
+
+ return DeviceMotionData::RotationRate::create(canProvideAlpha, alpha, canProvideBeta, beta, canProvideGamma, gamma);
+}
+
+} // namespace
+
+v8::Handle<v8::Value> V8DeviceMotionEvent::accelerationAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
+{
+ INC_STATS("DOM.DeviceMotionEvent.acceleration._get");
v8::Handle<v8::Object> holder = info.Holder();
DeviceMotionEvent* imp = V8DeviceMotionEvent::toNative(holder);
- if (!imp->deviceMotionData()->canProvideXRotationRate())
+ if (!imp->deviceMotionData()->acceleration())
return v8::Null();
- return v8::Number::New(imp->deviceMotionData()->xRotationRate());
+ return createAccelerationObject(imp->deviceMotionData()->acceleration());
}
-v8::Handle<v8::Value> V8DeviceMotionEvent::yRotationRateAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
+v8::Handle<v8::Value> V8DeviceMotionEvent::accelerationIncludingGravityAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
- INC_STATS("DOM.DeviceMotionEvent.yRotationRate._get");
+ INC_STATS("DOM.DeviceMotionEvent.accelerationIncludingGravity._get");
v8::Handle<v8::Object> holder = info.Holder();
DeviceMotionEvent* imp = V8DeviceMotionEvent::toNative(holder);
- if (!imp->deviceMotionData()->canProvideYRotationRate())
+ if (!imp->deviceMotionData()->accelerationIncludingGravity())
return v8::Null();
- return v8::Number::New(imp->deviceMotionData()->yRotationRate());
+ return createAccelerationObject(imp->deviceMotionData()->accelerationIncludingGravity());
}
-v8::Handle<v8::Value> V8DeviceMotionEvent::zRotationRateAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
+v8::Handle<v8::Value> V8DeviceMotionEvent::rotationRateAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
- INC_STATS("DOM.DeviceMotionEvent.zRotationRate._get");
+ INC_STATS("DOM.DeviceMotionEvent.rotationRate._get");
v8::Handle<v8::Object> holder = info.Holder();
DeviceMotionEvent* imp = V8DeviceMotionEvent::toNative(holder);
- if (!imp->deviceMotionData()->canProvideZRotationRate())
+ if (!imp->deviceMotionData()->rotationRate())
return v8::Null();
- return v8::Number::New(imp->deviceMotionData()->zRotationRate());
+ return createRotationRateObject(imp->deviceMotionData()->rotationRate());
}
-
v8::Handle<v8::Value> V8DeviceMotionEvent::intervalAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
INC_STATS("DOM.DeviceMotionEvent.interval._get");
@@ -114,23 +169,12 @@ v8::Handle<v8::Value> V8DeviceMotionEvent::initDeviceMotionEventCallback(const v
STRING_TO_V8PARAMETER_EXCEPTION_BLOCK(V8Parameter<>, type, args[0]);
bool bubbles = args[1]->BooleanValue();
bool cancelable = args[2]->BooleanValue();
- // If any of the parameters are null or undefined, mark them as not provided.
- // Otherwise, use the standard JavaScript conversion.
- bool xAccelerationProvided = !isUndefinedOrNull(args[3]);
- double xAcceleration = static_cast<double>(args[3]->NumberValue());
- bool yAccelerationProvided = !isUndefinedOrNull(args[4]);
- double yAcceleration = static_cast<double>(args[4]->NumberValue());
- bool zAccelerationProvided = !isUndefinedOrNull(args[5]);
- double zAcceleration = static_cast<double>(args[5]->NumberValue());
- bool xRotationRateProvided = !isUndefinedOrNull(args[6]);
- double xRotationRate = static_cast<double>(args[6]->NumberValue());
- bool yRotationRateProvided = !isUndefinedOrNull(args[7]);
- double yRotationRate = static_cast<double>(args[7]->NumberValue());
- bool zRotationRateProvided = !isUndefinedOrNull(args[8]);
- double zRotationRate = static_cast<double>(args[8]->NumberValue());
- bool intervalProvided = !isUndefinedOrNull(args[9]);
- double interval = static_cast<double>(args[9]->NumberValue());
- RefPtr<DeviceMotionData> deviceMotionData = DeviceMotionData::create(xAccelerationProvided, xAcceleration, yAccelerationProvided, yAcceleration, zAccelerationProvided, zAcceleration, xRotationRateProvided, xRotationRate, yRotationRateProvided, yRotationRate, zRotationRateProvided, zRotationRate, intervalProvided, interval);
+ RefPtr<DeviceMotionData::Acceleration> acceleration = readAccelerationArgument(args[3]);
+ RefPtr<DeviceMotionData::Acceleration> accelerationIncludingGravity = readAccelerationArgument(args[4]);
+ RefPtr<DeviceMotionData::RotationRate> rotationRate = readRotationRateArgument(args[5]);
+ bool intervalProvided = !isUndefinedOrNull(args[6]);
+ double interval = args[6]->NumberValue();
+ RefPtr<DeviceMotionData> deviceMotionData = DeviceMotionData::create(acceleration, accelerationIncludingGravity, rotationRate, intervalProvided, interval);
imp->initDeviceMotionEvent(type, bubbles, cancelable, deviceMotionData.get());
return v8::Handle<v8::Value>();
}
diff --git a/WebCore/bindings/v8/custom/V8DeviceOrientationEventCustom.cpp b/WebCore/bindings/v8/custom/V8DeviceOrientationEventCustom.cpp
index 72f759a..ce8eaf3 100644
--- a/WebCore/bindings/v8/custom/V8DeviceOrientationEventCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8DeviceOrientationEventCustom.cpp
@@ -76,11 +76,11 @@ v8::Handle<v8::Value> V8DeviceOrientationEvent::initDeviceOrientationEventCallba
// If alpha, beta or gamma are null or undefined, mark them as not provided.
// Otherwise, use the standard JavaScript conversion.
bool alphaProvided = !isUndefinedOrNull(args[3]);
- double alpha = static_cast<double>(args[3]->NumberValue());
+ double alpha = args[3]->NumberValue();
bool betaProvided = !isUndefinedOrNull(args[4]);
- double beta = static_cast<double>(args[4]->NumberValue());
+ double beta = args[4]->NumberValue();
bool gammaProvided = !isUndefinedOrNull(args[5]);
- double gamma = static_cast<double>(args[5]->NumberValue());
+ double gamma = args[5]->NumberValue();
RefPtr<DeviceOrientation> orientation = DeviceOrientation::create(alphaProvided, alpha, betaProvided, beta, gammaProvided, gamma);
imp->initDeviceOrientationEvent(type, bubbles, cancelable, orientation.get());
return v8::Handle<v8::Value>();
diff --git a/WebCore/bindings/v8/custom/V8DirectoryEntryCustom.cpp b/WebCore/bindings/v8/custom/V8DirectoryEntryCustom.cpp
index 286b154..fc8cf98 100644
--- a/WebCore/bindings/v8/custom/V8DirectoryEntryCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8DirectoryEntryCustom.cpp
@@ -71,7 +71,7 @@ v8::Handle<v8::Value> V8DirectoryEntry::getDirectoryCallback(const v8::Arguments
}
} else {
EXCEPTION_BLOCK(Flags*, tmp_flags, V8Flags::HasInstance(args[1]) ? V8Flags::toNative(v8::Handle<v8::Object>::Cast(args[1])) : 0);
- flags = adoptRef(tmp_flags);
+ flags = tmp_flags;
}
RefPtr<EntryCallback> successCallback;
if (args.Length() > 2 && !args[2]->IsNull() && !args[2]->IsUndefined()) {
@@ -114,7 +114,7 @@ v8::Handle<v8::Value> V8DirectoryEntry::getFileCallback(const v8::Arguments& arg
}
} else {
EXCEPTION_BLOCK(Flags*, tmp_flags, V8Flags::HasInstance(args[1]) ? V8Flags::toNative(v8::Handle<v8::Object>::Cast(args[1])) : 0);
- flags = adoptRef(tmp_flags);
+ flags = tmp_flags;
}
RefPtr<EntryCallback> successCallback;
if (args.Length() > 2 && !args[2]->IsNull() && !args[2]->IsUndefined()) {
diff --git a/WebCore/bindings/v8/custom/V8InspectorFrontendHostCustom.cpp b/WebCore/bindings/v8/custom/V8InspectorFrontendHostCustom.cpp
index 25b9010..94fa86e 100644
--- a/WebCore/bindings/v8/custom/V8InspectorFrontendHostCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8InspectorFrontendHostCustom.cpp
@@ -47,6 +47,8 @@ v8::Handle<v8::Value> V8InspectorFrontendHost::platformCallback(const v8::Argume
return v8String("mac");
#elif defined(OS_LINUX)
return v8String("linux");
+#elif defined(OS_FREEBSD)
+ return v8String("freebsd");
#elif defined(OS_WIN)
return v8String("windows");
#else
diff --git a/WebCore/bindings/v8/custom/V8XMLHttpRequestCustom.cpp b/WebCore/bindings/v8/custom/V8XMLHttpRequestCustom.cpp
index cfeb503..2355d2a 100644
--- a/WebCore/bindings/v8/custom/V8XMLHttpRequestCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8XMLHttpRequestCustom.cpp
@@ -32,6 +32,7 @@
#include "V8XMLHttpRequest.h"
#include "Frame.h"
+#include "InspectorController.h"
#include "V8Binding.h"
#include "V8Blob.h"
#include "V8DOMFormData.h"
@@ -113,6 +114,8 @@ v8::Handle<v8::Value> V8XMLHttpRequest::sendCallback(const v8::Arguments& args)
INC_STATS("DOM.XMLHttpRequest.send()");
XMLHttpRequest* xmlHttpRequest = V8XMLHttpRequest::toNative(args.Holder());
+ InspectorController::instrumentWillSendXMLHttpRequest(xmlHttpRequest->scriptExecutionContext(), xmlHttpRequest->url());
+
ExceptionCode ec = 0;
if (args.Length() < 1)
xmlHttpRequest->send(ec);
diff --git a/WebCore/bridge/npapi.h b/WebCore/bridge/npapi.h
index 7e590ff..b1e8fcd 100644
--- a/WebCore/bridge/npapi.h
+++ b/WebCore/bridge/npapi.h
@@ -381,6 +381,7 @@ typedef enum {
, NPPVpluginCoreAnimationLayer = 1003
#endif
+<<<<<<< HEAD
#ifdef ANDROID
/* Used when the plugin returns 0 from NPN_WriteReady and wishes the browser
* to wait a certain amount of millis before calling NPN_WriteReady again.
@@ -392,6 +393,9 @@ typedef enum {
#endif
#if defined(MOZ_PLATFORM_MAEMO) && (MOZ_PLATFORM_MAEMO == 5)
+=======
+#if defined(MOZ_PLATFORM_MAEMO) && (MOZ_PLATFORM_MAEMO >= 5)
+>>>>>>> webkit.org at r68651
, NPPVpluginWindowlessLocalBool = 2002
#endif
} NPPVariable;
@@ -437,12 +441,16 @@ typedef enum {
#endif
, NPNVsupportsCocoaBool = 3001 /* TRUE if the browser supports the Cocoa event model */
#endif /* XP_MACOSX */
+<<<<<<< HEAD
#ifdef ANDROID
, NPNFakeValueToForce32Bits = 0x7FFFFFFF
#endif
#if defined(MOZ_PLATFORM_MAEMO) && (MOZ_PLATFORM_MAEMO == 5)
+=======
+#if defined(MOZ_PLATFORM_MAEMO) && (MOZ_PLATFORM_MAEMO >= 5)
+>>>>>>> webkit.org at r68651
, NPNVSupportsWindowlessLocal = 2002
#endif
} NPNVariable;
diff --git a/WebCore/bridge/objc/objc_instance.mm b/WebCore/bridge/objc/objc_instance.mm
index 6c56458..989d9eb 100644
--- a/WebCore/bridge/objc/objc_instance.mm
+++ b/WebCore/bridge/objc/objc_instance.mm
@@ -27,7 +27,6 @@
#import "objc_instance.h"
#import "runtime_method.h"
-#import "FoundationExtras.h"
#import "ObjCRuntimeObject.h"
#import "WebScriptObject.h"
#import <objc/objc-auto.h>
@@ -70,9 +69,9 @@ RuntimeObject* ObjcInstance::newRuntimeObject(ExecState* exec)
void ObjcInstance::setGlobalException(NSString* exception, JSGlobalObject* exceptionEnvironment)
{
- HardRelease(s_exception);
- HardRetain(exception);
- s_exception = exception;
+ NSString *oldException = s_exception;
+ s_exception = [exception copy];
+ [oldException release];
s_exceptionEnvironment = exceptionEnvironment;
}
@@ -89,9 +88,8 @@ void ObjcInstance::moveGlobalExceptionToExecState(ExecState* exec)
throwError(exec, s_exception);
}
- HardRelease(s_exception);
- s_exception = 0;
-
+ [s_exception release];
+ s_exception = nil;
s_exceptionEnvironment = 0;
}
diff --git a/WebCore/css/CSSComputedStyleDeclaration.cpp b/WebCore/css/CSSComputedStyleDeclaration.cpp
index 3746464..1d574ab 100644
--- a/WebCore/css/CSSComputedStyleDeclaration.cpp
+++ b/WebCore/css/CSSComputedStyleDeclaration.cpp
@@ -196,8 +196,8 @@ static const int computedProperties[] = {
CSSPropertyWebkitHighlight,
CSSPropertyWebkitLineBreak,
CSSPropertyWebkitLineClamp,
- CSSPropertyWebkitMarginBottomCollapse,
- CSSPropertyWebkitMarginTopCollapse,
+ CSSPropertyWebkitMarginBeforeCollapse,
+ CSSPropertyWebkitMarginAfterCollapse,
CSSPropertyWebkitMarqueeDirection,
CSSPropertyWebkitMarqueeIncrement,
CSSPropertyWebkitMarqueeRepetition,
@@ -1416,10 +1416,10 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(int proper
case CSSPropertyWebkitFontSizeDelta:
// Not a real style property -- used by the editing engine -- so has no computed value.
break;
- case CSSPropertyWebkitMarginBottomCollapse:
- return CSSPrimitiveValue::create(style->marginBottomCollapse());
- case CSSPropertyWebkitMarginTopCollapse:
- return CSSPrimitiveValue::create(style->marginTopCollapse());
+ case CSSPropertyWebkitMarginAfterCollapse:
+ return CSSPrimitiveValue::create(style->marginAfterCollapse());
+ case CSSPropertyWebkitMarginBeforeCollapse:
+ return CSSPrimitiveValue::create(style->marginBeforeCollapse());
case CSSPropertyWebkitPerspective:
if (!style->hasPerspective())
return CSSPrimitiveValue::createIdentifier(CSSValueNone);
diff --git a/WebCore/css/CSSPageRule.idl b/WebCore/css/CSSPageRule.idl
index 6b50b6d..989fd8d 100644
--- a/WebCore/css/CSSPageRule.idl
+++ b/WebCore/css/CSSPageRule.idl
@@ -23,8 +23,7 @@ module css {
// Introduced in DOM Level 2:
interface CSSPageRule : CSSRule {
- attribute [ConvertNullStringTo=Null, ConvertNullToNullString] DOMString selectorText
- setter raises(DOMException);
+ attribute [ConvertNullStringTo=Null, ConvertNullToNullString] DOMString selectorText;
readonly attribute CSSStyleDeclaration style;
diff --git a/WebCore/css/CSSParser.cpp b/WebCore/css/CSSParser.cpp
index 502bc77..5f3fb7d 100644
--- a/WebCore/css/CSSParser.cpp
+++ b/WebCore/css/CSSParser.cpp
@@ -62,6 +62,7 @@
#include "FloatConversion.h"
#include "FontFamilyValue.h"
#include "FontValue.h"
+#include "HashTools.h"
#include "MediaList.h"
#include "MediaQueryExp.h"
#include "Pair.h"
@@ -89,6 +90,7 @@ extern int cssyyparse(void* parser);
using namespace std;
using namespace WTF;
+<<<<<<< HEAD
#include "CSSPropertyNames.cpp"
#include "CSSValueKeywords.cpp"
@@ -96,6 +98,8 @@ using namespace WTF;
#include "TimeCounter.h"
#endif
+=======
+>>>>>>> webkit.org at r68651
namespace WebCore {
static const unsigned INVALID_NUM_PARSED_PROPERTIES = UINT_MAX;
@@ -1488,8 +1492,8 @@ bool CSSParser::parseValue(int propId, bool important)
return false;
}
case CSSPropertyWebkitMarginCollapse: {
- const int properties[2] = { CSSPropertyWebkitMarginTopCollapse,
- CSSPropertyWebkitMarginBottomCollapse };
+ const int properties[2] = { CSSPropertyWebkitMarginBeforeCollapse,
+ CSSPropertyWebkitMarginAfterCollapse };
if (num == 1) {
ShorthandScope scope(this, CSSPropertyWebkitMarginCollapse);
if (!parseValue(properties[0], important))
@@ -1506,6 +1510,8 @@ bool CSSParser::parseValue(int propId, bool important)
}
return false;
}
+ case CSSPropertyWebkitMarginBeforeCollapse:
+ case CSSPropertyWebkitMarginAfterCollapse:
case CSSPropertyWebkitMarginTopCollapse:
case CSSPropertyWebkitMarginBottomCollapse:
if (id == CSSValueCollapse || id == CSSValueSeparate || id == CSSValueDiscard)
diff --git a/WebCore/css/CSSPrimitiveValueMappings.h b/WebCore/css/CSSPrimitiveValueMappings.h
index a452733..14afdf6 100644
--- a/WebCore/css/CSSPrimitiveValueMappings.h
+++ b/WebCore/css/CSSPrimitiveValueMappings.h
@@ -352,7 +352,7 @@ template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ControlPart e)
break;
case InputSpeechButtonPart:
#if ENABLE(INPUT_SPEECH)
- m_value.ident = CSSValueInputSpeechButton;
+ m_value.ident = CSSValueWebkitInputSpeechButton;
#endif
break;
}
diff --git a/WebCore/css/CSSPropertyLonghand.cpp b/WebCore/css/CSSPropertyLonghand.cpp
index a4b3325..acca036 100644
--- a/WebCore/css/CSSPropertyLonghand.cpp
+++ b/WebCore/css/CSSPropertyLonghand.cpp
@@ -98,7 +98,7 @@ static void initShorthandMap(ShorthandMap& shorthandMap)
};
SET_SHORTHAND_MAP_ENTRY(shorthandMap, CSSPropertyMargin, marginProperties);
- static const int marginCollapseProperties[] = { CSSPropertyWebkitMarginTopCollapse, CSSPropertyWebkitMarginBottomCollapse };
+ static const int marginCollapseProperties[] = { CSSPropertyWebkitMarginBeforeCollapse, CSSPropertyWebkitMarginAfterCollapse };
SET_SHORTHAND_MAP_ENTRY(shorthandMap, CSSPropertyWebkitMarginCollapse, marginCollapseProperties);
static const int marqueeProperties[] = {
diff --git a/WebCore/css/CSSPropertyNames.in b/WebCore/css/CSSPropertyNames.in
index addecca..8584e5f 100644
--- a/WebCore/css/CSSPropertyNames.in
+++ b/WebCore/css/CSSPropertyNames.in
@@ -232,13 +232,15 @@ z-index
-webkit-line-clamp
-webkit-logical-width
-webkit-logical-height
+-webkit-margin-after-collapse
+-webkit-margin-before-collapse
-webkit-margin-bottom-collapse
+-webkit-margin-top-collapse
-webkit-margin-collapse
-webkit-margin-after
-webkit-margin-before
-webkit-margin-end
-webkit-margin-start
--webkit-margin-top-collapse
-webkit-marquee
-webkit-marquee-direction
-webkit-marquee-increment
diff --git a/WebCore/css/CSSStyleRule.cpp b/WebCore/css/CSSStyleRule.cpp
index 1036e8f..faf60b0 100644
--- a/WebCore/css/CSSStyleRule.cpp
+++ b/WebCore/css/CSSStyleRule.cpp
@@ -23,7 +23,11 @@
#include "CSSStyleRule.h"
#include "CSSMutableStyleDeclaration.h"
+#include "CSSParser.h"
#include "CSSSelector.h"
+#include "CSSStyleSheet.h"
+#include "Document.h"
+#include "StyleSheet.h"
namespace WebCore {
@@ -50,9 +54,34 @@ String CSSStyleRule::selectorText() const
return str;
}
-void CSSStyleRule::setSelectorText(const String& /*selectorText*/, ExceptionCode& /*ec*/)
+void CSSStyleRule::setSelectorText(const String& selectorText)
{
- // FIXME: Implement!
+ Document* doc = 0;
+ StyleSheet* ownerStyleSheet = m_style->stylesheet();
+ if (ownerStyleSheet) {
+ if (ownerStyleSheet->isCSSStyleSheet())
+ doc = static_cast<CSSStyleSheet*>(ownerStyleSheet)->document();
+ if (!doc)
+ doc = ownerStyleSheet->ownerNode() ? ownerStyleSheet->ownerNode()->document() : 0;
+ }
+ if (!doc)
+ doc = m_style->node() ? m_style->node()->document() : 0;
+
+ if (!doc)
+ return;
+
+ CSSParser p;
+ CSSSelectorList selectorList;
+ p.parseSelector(selectorText, doc, selectorList);
+ if (!selectorList.first())
+ return;
+
+ String oldSelectorText = this->selectorText();
+ m_selectorList.adopt(selectorList);
+ if (this->selectorText() == oldSelectorText)
+ return;
+
+ doc->styleSelectorChanged(DeferRecalcStyle);
}
String CSSStyleRule::cssText() const
diff --git a/WebCore/css/CSSStyleRule.h b/WebCore/css/CSSStyleRule.h
index d797c73..171b636 100644
--- a/WebCore/css/CSSStyleRule.h
+++ b/WebCore/css/CSSStyleRule.h
@@ -41,7 +41,7 @@ public:
virtual ~CSSStyleRule();
virtual String selectorText() const;
- void setSelectorText(const String&, ExceptionCode&);
+ void setSelectorText(const String&);
CSSMutableStyleDeclaration* style() const { return m_style.get(); }
diff --git a/WebCore/css/CSSStyleRule.idl b/WebCore/css/CSSStyleRule.idl
index 862acd8..4abfbfc 100644
--- a/WebCore/css/CSSStyleRule.idl
+++ b/WebCore/css/CSSStyleRule.idl
@@ -23,8 +23,7 @@ module css {
// Introduced in DOM Level 2:
interface CSSStyleRule : CSSRule {
- attribute [ConvertNullStringTo=Null, ConvertNullToNullString] DOMString selectorText
- setter raises(DOMException);
+ attribute [ConvertNullStringTo=Null, ConvertNullToNullString] DOMString selectorText;
readonly attribute CSSStyleDeclaration style;
diff --git a/WebCore/css/CSSStyleSelector.cpp b/WebCore/css/CSSStyleSelector.cpp
index 9b51fdb..bf95877 100644
--- a/WebCore/css/CSSStyleSelector.cpp
+++ b/WebCore/css/CSSStyleSelector.cpp
@@ -1106,6 +1106,10 @@ PassRefPtr<RenderStyle> CSSStyleSelector::styleForDocument(Document* document)
documentStyle->setVisuallyOrdered(document->visuallyOrdered());
documentStyle->setZoom(frame ? frame->pageZoomFactor() : 1);
+ Element* docElement = document->documentElement();
+ if (docElement && docElement->renderer())
+ documentStyle->setBlockFlow(docElement->renderer()->style()->blockFlow());
+
FontDescription fontDescription;
fontDescription.setUsePrinterFont(document->printing());
if (Settings* settings = document->settings()) {
@@ -1344,7 +1348,7 @@ PassRefPtr<RenderStyle> CSSStyleSelector::styleForElement(Element* e, RenderStyl
updateFont();
// Clean up our style object's display and text decorations (among other fixups).
- adjustRenderStyle(style(), e);
+ adjustRenderStyle(style(), m_parentStyle, e);
// Start loading images referenced by this style.
loadPendingImages();
@@ -1562,7 +1566,7 @@ PassRefPtr<RenderStyle> CSSStyleSelector::pseudoStyleForElement(PseudoId pseudo,
updateFont();
// Clean up our style object's display and text decorations (among other fixups).
- adjustRenderStyle(style(), 0);
+ adjustRenderStyle(style(), parentStyle, 0);
// Start loading images referenced by this style.
loadPendingImages();
@@ -1646,7 +1650,7 @@ static void addIntrinsicMargins(RenderStyle* style)
}
}
-void CSSStyleSelector::adjustRenderStyle(RenderStyle* style, Element *e)
+void CSSStyleSelector::adjustRenderStyle(RenderStyle* style, RenderStyle* parentStyle, Element *e)
{
// Cache our original display.
style->setOriginalDisplay(style->display());
@@ -1716,6 +1720,11 @@ void CSSStyleSelector::adjustRenderStyle(RenderStyle* style, Element *e)
style->setDisplay(BLOCK);
}
+ // FIXME: Don't support this mutation for pseudo styles like first-letter or first-line, since it's not completely
+ // clear how that should work.
+ if (style->display() == INLINE && style->styleType() == NOPSEUDO && parentStyle && style->blockFlow() != parentStyle->blockFlow())
+ style->setDisplay(INLINE_BLOCK);
+
// After performing the display mutation, check table rows. We do not honor position:relative on
// table rows or cells. This has been established in CSS2.1 (and caused a crash in containingBlock()
// on some sites).
@@ -1723,6 +1732,16 @@ void CSSStyleSelector::adjustRenderStyle(RenderStyle* style, Element *e)
style->display() == TABLE_FOOTER_GROUP || style->display() == TABLE_ROW || style->display() == TABLE_CELL) &&
style->position() == RelativePosition)
style->setPosition(StaticPosition);
+
+ // FIXME: Since we don't support block-flow on either tables or flexible boxes yet, disallow setting
+ // of block-flow to anything other than TopToBottomBlockFlow.
+ // https://bugs.webkit.org/show_bug.cgi?id=46417 - Tables support
+ // https://bugs.webkit.org/show_bug.cgi?id=46418 - Flexible box support.
+ if (style->blockFlow() != TopToBottomBlockFlow && (style->display() == TABLE || style->display() == INLINE_TABLE
+ || style->display() == TABLE_HEADER_GROUP || style->display() == TABLE_ROW_GROUP
+ || style->display() == TABLE_FOOTER_GROUP || style->display() == TABLE_ROW || style->display() == TABLE_CELL
+ || style->display() == BOX || style->display() == INLINE_BOX))
+ style->setBlockFlow(TopToBottomBlockFlow);
}
// Make sure our z-index value is only applied if the object is positioned.
@@ -5139,21 +5158,23 @@ void CSSStyleSelector::applyProperty(int id, CSSValue *value)
}
case CSSPropertyWebkitMarginCollapse: {
if (isInherit) {
- m_style->setMarginTopCollapse(m_parentStyle->marginTopCollapse());
- m_style->setMarginBottomCollapse(m_parentStyle->marginBottomCollapse());
+ m_style->setMarginBeforeCollapse(m_parentStyle->marginBeforeCollapse());
+ m_style->setMarginAfterCollapse(m_parentStyle->marginAfterCollapse());
}
else if (isInitial) {
- m_style->setMarginTopCollapse(MCOLLAPSE);
- m_style->setMarginBottomCollapse(MCOLLAPSE);
+ m_style->setMarginBeforeCollapse(MCOLLAPSE);
+ m_style->setMarginAfterCollapse(MCOLLAPSE);
}
return;
}
+ case CSSPropertyWebkitMarginBeforeCollapse:
case CSSPropertyWebkitMarginTopCollapse:
- HANDLE_INHERIT_AND_INITIAL_AND_PRIMITIVE(marginTopCollapse, MarginTopCollapse)
+ HANDLE_INHERIT_AND_INITIAL_AND_PRIMITIVE(marginBeforeCollapse, MarginBeforeCollapse)
return;
+ case CSSPropertyWebkitMarginAfterCollapse:
case CSSPropertyWebkitMarginBottomCollapse:
- HANDLE_INHERIT_AND_INITIAL_AND_PRIMITIVE(marginBottomCollapse, MarginBottomCollapse)
+ HANDLE_INHERIT_AND_INITIAL_AND_PRIMITIVE(marginAfterCollapse, MarginAfterCollapse)
return;
case CSSPropertyWebkitLineClamp: {
HANDLE_INHERIT_AND_INITIAL(lineClamp, LineClamp)
diff --git a/WebCore/css/CSSStyleSelector.h b/WebCore/css/CSSStyleSelector.h
index b77f23c..2bca2f4 100644
--- a/WebCore/css/CSSStyleSelector.h
+++ b/WebCore/css/CSSStyleSelector.h
@@ -181,7 +181,7 @@ public:
void checkForZoomChange(RenderStyle*, RenderStyle* parentStyle);
void checkForTextSizeAdjust();
- void adjustRenderStyle(RenderStyle*, Element*);
+ void adjustRenderStyle(RenderStyle* styleToAdjust, RenderStyle* parentStyle, Element*);
void addMatchedRule(CSSRuleData* rule) { m_matchedRules.append(rule); }
void addMatchedDeclaration(CSSMutableStyleDeclaration* decl);
diff --git a/WebCore/css/CSSValueKeywords.in b/WebCore/css/CSSValueKeywords.in
index 990bb36..556d0bc 100644
--- a/WebCore/css/CSSValueKeywords.in
+++ b/WebCore/css/CSSValueKeywords.in
@@ -568,7 +568,7 @@ button
button-bevel
default-button
inner-spin-button
-input-speech-button
+-webkit-input-speech-button
list-button
listbox
listitem
diff --git a/WebCore/css/SVGCSSStyleSelector.cpp b/WebCore/css/SVGCSSStyleSelector.cpp
index b8cc4f7..5ddaf99 100644
--- a/WebCore/css/SVGCSSStyleSelector.cpp
+++ b/WebCore/css/SVGCSSStyleSelector.cpp
@@ -48,15 +48,17 @@
#define HANDLE_INHERIT(prop, Prop) \
if (isInherit) \
-{\
- svgstyle->set##Prop(m_parentStyle->svgStyle()->prop());\
- return;\
+{ \
+ svgstyle->set##Prop(m_parentStyle->svgStyle()->prop()); \
+ return; \
}
#define HANDLE_INHERIT_AND_INITIAL(prop, Prop) \
HANDLE_INHERIT(prop, Prop) \
-else if (isInitial) \
- svgstyle->set##Prop(SVGRenderStyle::initial##Prop());
+if (isInitial) { \
+ svgstyle->set##Prop(SVGRenderStyle::initial##Prop()); \
+ return; \
+}
namespace WebCore {
@@ -90,15 +92,13 @@ static int angleToGlyphOrientation(float angle)
return -1;
}
-static Color colorFromSVGColorCSSValue(CSSValue* value, const Color& fgColor)
+static Color colorFromSVGColorCSSValue(SVGColor* svgColor, const Color& fgColor)
{
- ASSERT(value->isSVGColor());
- SVGColor* c = static_cast<SVGColor*>(value);
Color color;
- if (c->colorType() == SVGColor::SVG_COLORTYPE_CURRENTCOLOR)
+ if (svgColor->colorType() == SVGColor::SVG_COLORTYPE_CURRENTCOLOR)
color = fgColor;
else
- color = c->color();
+ color = svgColor->color();
return color;
}
@@ -468,13 +468,15 @@ void CSSStyleSelector::applySVGProperty(int id, CSSValue* value)
case CSSPropertyStopColor:
{
HANDLE_INHERIT_AND_INITIAL(stopColor, StopColor);
- svgstyle->setStopColor(colorFromSVGColorCSSValue(value, m_style->color()));
+ if (value->isSVGColor())
+ svgstyle->setStopColor(colorFromSVGColorCSSValue(static_cast<SVGColor*>(value), m_style->color()));
break;
}
case CSSPropertyLightingColor:
{
HANDLE_INHERIT_AND_INITIAL(lightingColor, LightingColor);
- svgstyle->setLightingColor(colorFromSVGColorCSSValue(value, m_style->color()));
+ if (value->isSVGColor())
+ svgstyle->setLightingColor(colorFromSVGColorCSSValue(static_cast<SVGColor*>(value), m_style->color()));
break;
}
case CSSPropertyFloodOpacity:
@@ -497,11 +499,9 @@ void CSSStyleSelector::applySVGProperty(int id, CSSValue* value)
}
case CSSPropertyFloodColor:
{
- if (isInitial) {
- svgstyle->setFloodColor(SVGRenderStyle::initialFloodColor());
- return;
- }
- svgstyle->setFloodColor(colorFromSVGColorCSSValue(value, m_style->color()));
+ HANDLE_INHERIT_AND_INITIAL(floodColor, FloodColor);
+ if (value->isSVGColor())
+ svgstyle->setFloodColor(colorFromSVGColorCSSValue(static_cast<SVGColor*>(value), m_style->color()));
break;
}
case CSSPropertyGlyphOrientationHorizontal:
diff --git a/WebCore/css/html.css b/WebCore/css/html.css
index d65acb0..5399c1c 100644
--- a/WebCore/css/html.css
+++ b/WebCore/css/html.css
@@ -301,6 +301,11 @@ button {
-webkit-appearance: button;
}
+/* Form controls don't go vertical. */
+input, textarea, keygen, select, button, isindex, meter, progress {
+ -webkit-block-flow: tb !important;
+}
+
input, textarea, keygen, select, button, isindex, datagrid {
margin: 0__qem;
font: -webkit-small-control;
@@ -373,7 +378,7 @@ input::-webkit-outer-spin-button {
}
input::-webkit-input-speech-button {
- -webkit-appearance: input-speech-button;
+ -webkit-appearance: -webkit-input-speech-button;
display: inline-block;
}
diff --git a/WebCore/css/makeprop.pl b/WebCore/css/makeprop.pl
index 8810e8d..64f5a6b 100644
--- a/WebCore/css/makeprop.pl
+++ b/WebCore/css/makeprop.pl
@@ -41,15 +41,14 @@ print GPERF << "EOF";
#include \"CSSPropertyNames.h\"
%}
%struct-type
-struct Property {
- const char* name;
- int id;
-};
-%language=ANSI-C
+struct Property;
+%omit-struct-type
+%language=C++
%readonly-tables
%global-table
%compare-strncmp
-%define lookup-function-name findProperty
+%define class-name CSSPropertyNamesHash
+%define lookup-function-name findPropertyImpl
%define hash-function-name propery_hash_function
%define word-array-name property_wordlist
%includes
@@ -72,6 +71,10 @@ print HEADER << "EOF";
#ifndef CSSPropertyNames_h
#define CSSPropertyNames_h
+#include <string.h>
+
+namespace WebCore {
+
enum CSSPropertyID {
CSSPropertyInvalid = 0,
EOF
@@ -105,17 +108,41 @@ print HEADER << "EOF";
const char* getPropertyName(CSSPropertyID);
+} // namespace WebCore
+
#endif // CSSPropertyNames_h
EOF
close HEADER;
-system("gperf --key-positions=\"*\" -D -n -s 2 CSSPropertyNames.gperf > CSSPropertyNames.cpp") == 0 || die "calling gperf failed: $?";
+system("gperf --key-positions=\"*\" -D -n -s 2 CSSPropertyNames.gperf > CSSPropertyNamesHash.h") == 0 || die "calling gperf failed: $?";
-open C, ">>CSSPropertyNames.cpp" || die "Could not open CSSPropertyNames.cpp for writing";
+open C, ">>CSSPropertyNamesHash.h" || die "Could not open CSSPropertyNamesHash.h for writing";
print C << "EOF";
+EOF
+
+close C;
+
+my $propertyNamesImpl = "CSSPropertyNames.cpp";
+
+open PROPERTYNAMES, ">$propertyNamesImpl" || die "Could not open $propertyNamesImpl for writing";
+print PROPERTYNAMES << "EOF";
+/* This file is automatically generated by make-hash-tools.pl, do not edit */
+
+
+#include "CSSPropertyNames.h"
+#include "HashTools.h"
+
+namespace WebCore {
+#include "CSSPropertyNamesHash.h"
+
+const Property* findProperty (register const char* str, register unsigned int len)
+{
+ return CSSPropertyNamesHash::findPropertyImpl(str, len);
+}
+
const char* getPropertyName(CSSPropertyID id)
{
if (id < firstCSSProperty)
@@ -125,7 +152,10 @@ const char* getPropertyName(CSSPropertyID id)
return 0;
return propertyNameStrings[index];
}
+
+} // namespace WebCore
+
EOF
-close C;
+close PROPERTYNAMES;
diff --git a/WebCore/css/makevalues.pl b/WebCore/css/makevalues.pl
index 421e470..c9f7f70 100644
--- a/WebCore/css/makevalues.pl
+++ b/WebCore/css/makevalues.pl
@@ -42,14 +42,13 @@ print GPERF << "EOF";
#include \"CSSValueKeywords.h\"
%}
%struct-type
-struct Value {
- const char* name;
- int id;
-};
-%language=ANSI-C
+struct Value;
+%omit-struct-type
+%language=C++
%readonly-tables
%compare-strncmp
-%define lookup-function-name findValue
+%define class-name CSSValueKeywordsHash
+%define lookup-function-name findValueImpl
%define hash-function-name value_hash_function
%define word-array-name value_word_list
%includes
@@ -72,6 +71,10 @@ print HEADER << "EOF";
#ifndef CSSValueKeywords_h
#define CSSValueKeywords_h
+#include <string.h>
+
+namespace WebCore {
+
const int CSSValueInvalid = 0;
EOF
@@ -92,13 +95,16 @@ print HEADER << "EOF";
const char* getValueName(unsigned short id);
+} // namespace WebCore
+
#endif // CSSValueKeywords_h
+
EOF
close HEADER;
-system("gperf --key-positions=\"*\" -D -n -s 2 CSSValueKeywords.gperf > CSSValueKeywords.cpp") == 0 || die "calling gperf failed: $?";
+system("gperf --key-positions=\"*\" -D -n -s 2 CSSValueKeywords.gperf > CSSValueKeywordsHash.h") == 0 || die "calling gperf failed: $?";
-open C, ">>CSSValueKeywords.cpp" || die "Could not open CSSValueKeywords.cpp for writing";
+open C, ">>CSSValueKeywordsHash.h" || die "Could not open CSSValueKeywordsHash.h for writing";
print C "static const char * const valueList[] = {\n";
print C "\"\",\n";
foreach my $name (@names) {
@@ -107,12 +113,38 @@ foreach my $name (@names) {
print C << "EOF";
0
};
+
+EOF
+
+close C;
+
+my $valueKeywordsImpl = "CSSValueKeywords.cpp";
+
+open VALUEKEYWORDS, ">$valueKeywordsImpl" || die "Could not open $valueKeywordsImpl for writing";
+print VALUEKEYWORDS << "EOF";
+/* This file is automatically generated by make-hash-tools.pl, do not edit */
+
+#include "CSSValueKeywords.h"
+#include "HashTools.h"
+
+namespace WebCore {
+#include "CSSValueKeywordsHash.h"
+
+const Value* findValue (register const char* str, register unsigned int len)
+{
+ return CSSValueKeywordsHash::findValueImpl(str, len);
+}
+
const char* getValueName(unsigned short id)
{
if (id >= numCSSValueKeywords || id <= 0)
return 0;
return valueList[id];
}
+
+} // namespace WebCore
+
EOF
-close C;
+close VALUEKEYWORDS;
+
diff --git a/WebCore/css/themeQtMaemo5.css b/WebCore/css/themeQtMobile.css
index c568d5d..ef2d182 100644
--- a/WebCore/css/themeQtMaemo5.css
+++ b/WebCore/css/themeQtMobile.css
@@ -66,21 +66,46 @@ select:active:disabled {
input:not([type]),
input[type="text"],
input[type="password"],
+input[type="email"],
+input[type="tel"],
+input[type="color"],
+input[type="search"],
+input[type="date"],
+input[type="number"],
+input[type="url"],
textarea {
- border: 1px solid black;
+ border: 1px solid gray;
+ background: -webkit-gradient(linear, left top, left 30, color-stop(0.0, #bfbfbf), color-stop(0.2, #ffffff));
+ color: #3e3e3e;
+ -webkit-border-radius:5px;
}
input:not([type]):disabled,
input[type="text"]:disabled,
input[type="password"]:disabled,
+input[type="email"]:disabled,
+input[type="tel"]:disabled,
+input[type="color"]:disabled,
+input[type="search"]:disabled,
+input[type="date"]:disabled,
+input[type="number"]:disabled,
+input[type="url"]:disabled,
textarea:disabled {
- border: 1px solid grey;
- background-color:ButtonHighlight;
+ border: 1px solid gray;
+ background: -webkit-gradient(linear, left top, left 30, color-stop(0.0, #e5e5e5), color-stop(0.2, #ffffff));
+ color: #e5e5e5;
}
input:not([type]):active,
input[type="text"]:active,
input[type="password"]:active,
+input[type="email"]:active,
+input[type="tel"]:active,
+input[type="color"]:active,
+input[type="search"]:active,
+input[type="date"]:active,
+input[type="number"]:active,
+input[type="url"]:active,
textarea:active {
- background-color:ButtonShadow;
+ background: ButtonShadow;
}
diff --git a/WebCore/dom/Attr.cpp b/WebCore/dom/Attr.cpp
index 59daa59..f497394 100644
--- a/WebCore/dom/Attr.cpp
+++ b/WebCore/dom/Attr.cpp
@@ -117,13 +117,21 @@ String Attr::nodeValue() const
return value();
}
-void Attr::setValue(const AtomicString& value, ExceptionCode&)
+void Attr::setValue(const AtomicString& value)
{
m_ignoreChildrenChanged++;
removeChildren();
m_attribute->setValue(value);
createTextChild();
m_ignoreChildrenChanged--;
+}
+
+void Attr::setValue(const AtomicString& value, ExceptionCode&)
+{
+ if (m_element && m_element->isIdAttributeName(m_attribute->name()))
+ m_element->updateId(m_element->getIdAttribute(), value);
+
+ setValue(value);
if (m_element)
m_element->attributeChanged(m_attribute.get());
@@ -167,7 +175,10 @@ void Attr::childrenChanged(bool changedByParser, Node* beforeChange, Node* after
if (n->isTextNode())
val += static_cast<Text *>(n)->data();
}
-
+
+ if (m_element && m_element->isIdAttributeName(m_attribute->name()))
+ m_element->updateId(m_attribute->value(), val);
+
m_attribute->setValue(val.impl());
if (m_element)
m_element->attributeChanged(m_attribute.get());
diff --git a/WebCore/dom/Attr.h b/WebCore/dom/Attr.h
index 2e02a02..e76d2fa 100644
--- a/WebCore/dom/Attr.h
+++ b/WebCore/dom/Attr.h
@@ -48,6 +48,7 @@ public:
const AtomicString& value() const { return m_attribute->value(); }
void setValue(const AtomicString&, ExceptionCode&);
+ void setValue(const AtomicString&);
Attribute* attr() const { return m_attribute.get(); }
const QualifiedName& qualifiedName() const { return m_attribute->name(); }
diff --git a/WebCore/dom/CharacterData.cpp b/WebCore/dom/CharacterData.cpp
index 7accbfb..bc9ec56 100644
--- a/WebCore/dom/CharacterData.cpp
+++ b/WebCore/dom/CharacterData.cpp
@@ -24,6 +24,7 @@
#include "EventNames.h"
#include "ExceptionCode.h"
+#include "InspectorController.h"
#include "MutationEvent.h"
#include "RenderText.h"
@@ -197,6 +198,9 @@ void CharacterData::dispatchModifiedEvent(StringImpl* prevValue)
if (document()->hasListenerType(Document::DOMCHARACTERDATAMODIFIED_LISTENER))
dispatchEvent(MutationEvent::create(eventNames().DOMCharacterDataModifiedEvent, true, 0, prevValue, m_data));
dispatchSubtreeModifiedEvent();
+#if ENABLE(INSPECTOR)
+ InspectorController::characterDataModified(this);
+#endif
}
void CharacterData::checkCharDataOperation(unsigned offset, ExceptionCode& ec)
diff --git a/WebCore/dom/Clipboard.cpp b/WebCore/dom/Clipboard.cpp
index d644bcc..6956257 100644
--- a/WebCore/dom/Clipboard.cpp
+++ b/WebCore/dom/Clipboard.cpp
@@ -33,12 +33,12 @@
namespace WebCore {
-Clipboard::Clipboard(ClipboardAccessPolicy policy, bool isForDragging)
+Clipboard::Clipboard(ClipboardAccessPolicy policy, ClipboardType clipboardType)
: m_policy(policy)
, m_dropEffect("uninitialized")
, m_effectAllowed("uninitialized")
, m_dragStarted(false)
- , m_forDragging(isForDragging)
+ , m_clipboardType(clipboardType)
, m_dragImage(0)
{
}
@@ -127,7 +127,7 @@ void Clipboard::setDestinationOperation(DragOperation op)
void Clipboard::setDropEffect(const String &effect)
{
- if (!m_forDragging)
+ if (!isForDragAndDrop())
return;
// The attribute must ignore any attempts to set it to a value other than none, copy, link, and move.
@@ -140,7 +140,7 @@ void Clipboard::setDropEffect(const String &effect)
void Clipboard::setEffectAllowed(const String &effect)
{
- if (!m_forDragging)
+ if (!isForDragAndDrop())
return;
if (dragOpFromIEOp(effect) == DragOperationPrivate) {
diff --git a/WebCore/dom/Clipboard.h b/WebCore/dom/Clipboard.h
index 0562280..b8eadfb 100644
--- a/WebCore/dom/Clipboard.h
+++ b/WebCore/dom/Clipboard.h
@@ -40,12 +40,17 @@ namespace WebCore {
// State available during IE's events for drag and drop and copy/paste
class Clipboard : public RefCounted<Clipboard> {
public:
+ // Whether this clipboard is serving a drag-drop or copy-paste request.
+ enum ClipboardType {
+ CopyAndPaste,
+ DragAndDrop,
+ };
static PassRefPtr<Clipboard> create(ClipboardAccessPolicy, DragData*, Frame*);
virtual ~Clipboard() { }
- // Is this operation a drag-drop or a copy-paste?
- bool isForDragging() const { return m_forDragging; }
+ bool isForCopyAndPaste() const { return m_clipboardType == CopyAndPaste; }
+ bool isForDragAndDrop() const { return m_clipboardType == DragAndDrop; }
String dropEffect() const { return dropEffectIsUninitialized() ? "none" : m_dropEffect; }
void setDropEffect(const String&);
@@ -88,7 +93,7 @@ namespace WebCore {
void setDragHasStarted() { m_dragStarted = true; }
protected:
- Clipboard(ClipboardAccessPolicy, bool isForDragging);
+ Clipboard(ClipboardAccessPolicy, ClipboardType);
ClipboardAccessPolicy policy() const { return m_policy; }
bool dragStarted() const { return m_dragStarted; }
@@ -98,9 +103,9 @@ namespace WebCore {
String m_dropEffect;
String m_effectAllowed;
bool m_dragStarted;
+ ClipboardType m_clipboardType;
protected:
- bool m_forDragging;
IntPoint m_dragLoc;
CachedResourceHandle<CachedImage> m_dragImage;
RefPtr<Node> m_dragImageElement;
diff --git a/WebCore/dom/ContainerNode.cpp b/WebCore/dom/ContainerNode.cpp
index 2dd50bb..e18f6fe 100644
--- a/WebCore/dom/ContainerNode.cpp
+++ b/WebCore/dom/ContainerNode.cpp
@@ -154,7 +154,9 @@ bool ContainerNode::insertBefore(PassRefPtr<Node> newChild, Node* refChild, Exce
if (child->parentNode())
break;
+#if ENABLE(INSPECTOR)
InspectorController::willInsertDOMNode(child, this);
+#endif
insertBeforeCommon(next.get(), child);
@@ -223,7 +225,9 @@ void ContainerNode::parserInsertBefore(PassRefPtr<Node> newChild, Node* nextChil
for (NodeVector::const_iterator it = targets.begin(); it != targets.end(); ++it) {
Node* child = it->get();
+#if ENABLE(INSPECTOR)
InspectorController::willInsertDOMNode(child, this);
+#endif
insertBeforeCommon(next.get(), child);
@@ -298,7 +302,9 @@ bool ContainerNode::replaceChild(PassRefPtr<Node> newChild, Node* oldChild, Exce
ASSERT(!child->nextSibling());
ASSERT(!child->previousSibling());
+#if ENABLE(INSPECTOR)
InspectorController::willInsertDOMNode(child.get(), this);
+#endif
// Add child after "prev".
forbidEventDispatch();
@@ -577,7 +583,9 @@ bool ContainerNode::appendChild(PassRefPtr<Node> newChild, ExceptionCode& ec, bo
break;
}
+#if ENABLE(INSPECTOR)
InspectorController::willInsertDOMNode(child, this);
+#endif
// Append child to the end of the list
forbidEventDispatch();
@@ -617,7 +625,9 @@ void ContainerNode::parserAddChild(PassRefPtr<Node> newChild)
ASSERT(newChild);
ASSERT(!newChild->parent()); // Use appendChild if you need to handle reparenting (and want DOM mutation events).
+#if ENABLE(INSPECTOR)
InspectorController::willInsertDOMNode(newChild.get(), this);
+#endif
forbidEventDispatch();
Node* last = m_lastChild;
@@ -990,7 +1000,9 @@ static void notifyChildInserted(Node* child)
{
ASSERT(!eventDispatchForbidden());
+#if ENABLE(INSPECTOR)
InspectorController::didInsertDOMNode(child);
+#endif
RefPtr<Node> c = child;
RefPtr<Document> document = child->document();
@@ -1024,7 +1036,9 @@ static void dispatchChildRemovalEvents(Node* child)
{
ASSERT(!eventDispatchForbidden());
+#if ENABLE(INSPECTOR)
InspectorController::willRemoveDOMNode(child);
+#endif
RefPtr<Node> c = child;
RefPtr<Document> document = child->document();
diff --git a/WebCore/dom/DeviceMotionClient.h b/WebCore/dom/DeviceMotionClient.h
index d19f92f..45bf11a 100644
--- a/WebCore/dom/DeviceMotionClient.h
+++ b/WebCore/dom/DeviceMotionClient.h
@@ -38,6 +38,7 @@ public:
virtual void startUpdating() = 0;
virtual void stopUpdating() = 0;
virtual DeviceMotionData* currentDeviceMotion() const = 0;
+ virtual void deviceMotionControllerDestroyed() = 0;
};
} // namespace WebCore
diff --git a/WebCore/dom/DeviceMotionController.cpp b/WebCore/dom/DeviceMotionController.cpp
index 73b948e..3385167 100644
--- a/WebCore/dom/DeviceMotionController.cpp
+++ b/WebCore/dom/DeviceMotionController.cpp
@@ -40,6 +40,11 @@ DeviceMotionController::DeviceMotionController(DeviceMotionClient* client)
m_client->setController(this);
}
+DeviceMotionController::~DeviceMotionController()
+{
+ m_client->deviceMotionControllerDestroyed();
+}
+
void DeviceMotionController::timerFired(Timer<DeviceMotionController>* timer)
{
ASSERT_UNUSED(timer, timer == &m_timer);
diff --git a/WebCore/dom/DeviceMotionController.h b/WebCore/dom/DeviceMotionController.h
index 2670e04..422be73 100644
--- a/WebCore/dom/DeviceMotionController.h
+++ b/WebCore/dom/DeviceMotionController.h
@@ -38,6 +38,7 @@ class DeviceMotionClient;
class DeviceMotionController {
public:
DeviceMotionController(DeviceMotionClient*);
+ ~DeviceMotionController();
void addListener(DOMWindow*);
void removeListener(DOMWindow*);
diff --git a/WebCore/dom/DeviceMotionData.cpp b/WebCore/dom/DeviceMotionData.cpp
index cf4b466..7344c1c 100644
--- a/WebCore/dom/DeviceMotionData.cpp
+++ b/WebCore/dom/DeviceMotionData.cpp
@@ -28,59 +28,63 @@
namespace WebCore {
+PassRefPtr<DeviceMotionData::Acceleration> DeviceMotionData::Acceleration::create(bool canProvideX, double x,
+ bool canProvideY, double y,
+ bool canProvideZ, double z)
+{
+ return adoptRef(new DeviceMotionData::Acceleration(canProvideX, x, canProvideY, y, canProvideZ, z));
+}
+
+DeviceMotionData::Acceleration::Acceleration(bool canProvideX, double x, bool canProvideY, double y, bool canProvideZ, double z)
+ : m_x(x)
+ , m_y(y)
+ , m_z(z)
+ , m_canProvideX(canProvideX)
+ , m_canProvideY(canProvideY)
+ , m_canProvideZ(canProvideZ)
+
+{
+}
+
+PassRefPtr<DeviceMotionData::RotationRate> DeviceMotionData::RotationRate::create(bool canProvideAlpha, double alpha,
+ bool canProvideBeta, double beta,
+ bool canProvideGamma, double gamma)
+{
+ return adoptRef(new DeviceMotionData::RotationRate(canProvideAlpha, alpha, canProvideBeta, beta, canProvideGamma, gamma));
+}
+
+DeviceMotionData::RotationRate::RotationRate(bool canProvideAlpha, double alpha, bool canProvideBeta, double beta, bool canProvideGamma, double gamma)
+ : m_alpha(alpha)
+ , m_beta(beta)
+ , m_gamma(gamma)
+ , m_canProvideAlpha(canProvideAlpha)
+ , m_canProvideBeta(canProvideBeta)
+ , m_canProvideGamma(canProvideGamma)
+{
+}
+
PassRefPtr<DeviceMotionData> DeviceMotionData::create()
{
return adoptRef(new DeviceMotionData);
}
-PassRefPtr<DeviceMotionData> DeviceMotionData::create(bool canProvideXAcceleration, double xAcceleration,
- bool canProvideYAcceleration, double yAcceleration,
- bool canProvideZAcceleration, double zAcceleration,
- bool canProvideXRotationRate, double xRotationRate,
- bool canProvideYRotationRate, double yRotationRate,
- bool canProvideZRotationRate, double zRotationRate,
- bool canProvideInterval, double interval)
+PassRefPtr<DeviceMotionData> DeviceMotionData::create(PassRefPtr<Acceleration> acceleration, PassRefPtr<Acceleration> accelerationIncludingGravity,
+ PassRefPtr<RotationRate> rotationRate, bool canProvideInterval, double interval)
{
- return adoptRef(new DeviceMotionData(canProvideXAcceleration, xAcceleration,
- canProvideYAcceleration, yAcceleration,
- canProvideZAcceleration, zAcceleration,
- canProvideXRotationRate, xRotationRate,
- canProvideYRotationRate, yRotationRate,
- canProvideZRotationRate, zRotationRate,
- canProvideInterval, interval));
+ return adoptRef(new DeviceMotionData(acceleration, accelerationIncludingGravity, rotationRate, canProvideInterval, interval));
}
DeviceMotionData::DeviceMotionData()
- : m_canProvideXAcceleration(false)
- , m_canProvideYAcceleration(false)
- , m_canProvideZAcceleration(false)
- , m_canProvideXRotationRate(false)
- , m_canProvideYRotationRate(false)
- , m_canProvideZRotationRate(false)
- , m_canProvideInterval(false)
+ : m_canProvideInterval(false)
{
}
-DeviceMotionData::DeviceMotionData(bool canProvideXAcceleration, double xAcceleration,
- bool canProvideYAcceleration, double yAcceleration,
- bool canProvideZAcceleration, double zAcceleration,
- bool canProvideXRotationRate, double xRotationRate,
- bool canProvideYRotationRate, double yRotationRate,
- bool canProvideZRotationRate, double zRotationRate,
- bool canProvideInterval, double interval)
- : m_canProvideXAcceleration(canProvideXAcceleration)
- , m_canProvideYAcceleration(canProvideYAcceleration)
- , m_canProvideZAcceleration(canProvideZAcceleration)
- , m_canProvideXRotationRate(canProvideXRotationRate)
- , m_canProvideYRotationRate(canProvideYRotationRate)
- , m_canProvideZRotationRate(canProvideZRotationRate)
+DeviceMotionData::DeviceMotionData(PassRefPtr<Acceleration> acceleration, PassRefPtr<Acceleration> accelerationIncludingGravity,
+ PassRefPtr<RotationRate> rotationRate, bool canProvideInterval, double interval)
+ : m_acceleration(acceleration)
+ , m_accelerationIncludingGravity(accelerationIncludingGravity)
+ , m_rotationRate(rotationRate)
, m_canProvideInterval(canProvideInterval)
- , m_xAcceleration(xAcceleration)
- , m_yAcceleration(yAcceleration)
- , m_zAcceleration(zAcceleration)
- , m_xRotationRate(xRotationRate)
- , m_yRotationRate(yRotationRate)
- , m_zRotationRate(zRotationRate)
, m_interval(interval)
{
}
diff --git a/WebCore/dom/DeviceMotionData.h b/WebCore/dom/DeviceMotionData.h
index cd90246..1d53b53 100644
--- a/WebCore/dom/DeviceMotionData.h
+++ b/WebCore/dom/DeviceMotionData.h
@@ -28,60 +28,79 @@
#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
+#include <wtf/RefPtr.h>
namespace WebCore {
class DeviceMotionData : public RefCounted<DeviceMotionData> {
public:
+ class Acceleration : public RefCounted<DeviceMotionData::Acceleration> {
+ public:
+ static PassRefPtr<Acceleration> create(bool canProvideX, double x, bool canProvideY, double y, bool canProvideZ, double z);
+
+ bool canProvideX() const { return m_canProvideX; }
+ bool canProvideY() const { return m_canProvideY; }
+ bool canProvideZ() const { return m_canProvideZ; }
+
+ double x() const { return m_x; }
+ double y() const { return m_y; }
+ double z() const { return m_z; }
+
+ private:
+ Acceleration(bool canProvideX, double x, bool canProvideY, double y, bool canProvideZ, double z);
+
+ double m_x;
+ double m_y;
+ double m_z;
+
+ bool m_canProvideX;
+ bool m_canProvideY;
+ bool m_canProvideZ;
+ };
+
+ class RotationRate : public RefCounted<DeviceMotionData::RotationRate> {
+ public:
+ static PassRefPtr<RotationRate> create(bool canProvideAlpha, double alpha, bool canProvideBeta, double beta, bool canProvideGamma, double gamma);
+
+ bool canProvideAlpha() const { return m_canProvideAlpha; }
+ bool canProvideBeta() const { return m_canProvideBeta; }
+ bool canProvideGamma() const { return m_canProvideGamma; }
+
+ double alpha() const { return m_alpha; }
+ double beta() const { return m_beta; }
+ double gamma() const { return m_gamma; }
+
+ private:
+ RotationRate(bool canProvideAlpha, double alpha, bool canProvideBeta, double beta, bool canProvideGamma, double gamma);
+
+ double m_alpha;
+ double m_beta;
+ double m_gamma;
+
+ bool m_canProvideAlpha;
+ bool m_canProvideBeta;
+ bool m_canProvideGamma;
+ };
+
static PassRefPtr<DeviceMotionData> create();
- static PassRefPtr<DeviceMotionData> create(bool canProvideXAcceleration, double xAcceleration,
- bool canProvideYAcceleration, double yAcceleration,
- bool canProvideZAcceleration, double zAcceleration,
- bool canProvideXRotationRate, double xRotationRate,
- bool canProvideYRotationRate, double yRotationRate,
- bool canProvideZRotationRate, double zRotationRate,
- bool canProvideInterval, double interval);
-
- double xAcceleration() const { return m_xAcceleration; }
- double yAcceleration() const { return m_yAcceleration; }
- double zAcceleration() const { return m_zAcceleration; }
- double xRotationRate() const { return m_xRotationRate; }
- double yRotationRate() const { return m_yRotationRate; }
- double zRotationRate() const { return m_zRotationRate; }
- double interval() const { return m_interval; }
+ static PassRefPtr<DeviceMotionData> create(PassRefPtr<Acceleration> acceleration, PassRefPtr<Acceleration> accelerationIncludingGravity,
+ PassRefPtr<RotationRate> rotationRate, bool canProvideInterval, double interval);
- bool canProvideXAcceleration() const { return m_canProvideXAcceleration; }
- bool canProvideYAcceleration() const { return m_canProvideYAcceleration; }
- bool canProvideZAcceleration() const { return m_canProvideZAcceleration; }
- bool canProvideXRotationRate() const { return m_canProvideXRotationRate; }
- bool canProvideYRotationRate() const { return m_canProvideYRotationRate; }
- bool canProvideZRotationRate() const { return m_canProvideZRotationRate; }
+ const Acceleration* acceleration() const { return m_acceleration.get(); }
+ const Acceleration* accelerationIncludingGravity() const { return m_accelerationIncludingGravity.get(); }
+ const RotationRate* rotationRate() const { return m_rotationRate.get(); }
+ double interval() const { return m_interval; }
bool canProvideInterval() const { return m_canProvideInterval; }
private:
DeviceMotionData();
- DeviceMotionData(bool canProvideXAcceleration, double xAcceleration,
- bool canProvideYAcceleration, double yAcceleration,
- bool canProvideZAcceleration, double zAcceleration,
- bool canProvideXRotationRate, double xRotationRate,
- bool canProvideYRotationRate, double yRotationRate,
- bool canProvideZRotationRate, double zRotationRate,
- bool canProvideInterval, double interval);
-
- bool m_canProvideXAcceleration;
- bool m_canProvideYAcceleration;
- bool m_canProvideZAcceleration;
- bool m_canProvideXRotationRate;
- bool m_canProvideYRotationRate;
- bool m_canProvideZRotationRate;
- bool m_canProvideInterval;
+ DeviceMotionData(PassRefPtr<Acceleration> acceleration, PassRefPtr<Acceleration> accelerationIncludingGravity,
+ PassRefPtr<RotationRate> rotationRate, bool canProvideInterval, double interval);
- double m_xAcceleration;
- double m_yAcceleration;
- double m_zAcceleration;
- double m_xRotationRate;
- double m_yRotationRate;
- double m_zRotationRate;
+ RefPtr<Acceleration> m_acceleration;
+ RefPtr<Acceleration> m_accelerationIncludingGravity;
+ RefPtr<RotationRate> m_rotationRate;
+ bool m_canProvideInterval;
double m_interval;
};
diff --git a/WebCore/dom/DeviceMotionEvent.idl b/WebCore/dom/DeviceMotionEvent.idl
index 97e8e71..437ba4c 100644
--- a/WebCore/dom/DeviceMotionEvent.idl
+++ b/WebCore/dom/DeviceMotionEvent.idl
@@ -28,14 +28,11 @@ module core {
interface [
Conditional=DEVICE_ORIENTATION
] DeviceMotionEvent : Event {
- readonly attribute [Custom] double xAcceleration;
- readonly attribute [Custom] double yAcceleration;
- readonly attribute [Custom] double zAcceleration;
- readonly attribute [Custom] double xRotationRate;
- readonly attribute [Custom] double yRotationRate;
- readonly attribute [Custom] double zRotationRate;
+ readonly attribute [Custom] Acceleration acceleration;
+ readonly attribute [Custom] Acceleration accelerationIncludingGravity;
+ readonly attribute [Custom] RotationRate rotationRate;
readonly attribute [Custom] double interval;
- [Custom] void initDeviceMotionEvent(in DOMString type, in boolean bubbles, in boolean cancelable, in double xAcceleration, in double yAcceleration, in double zAcceleration, in double xRotationRate, in double yRotationRate, in double zRotationRate, in double interval);
+ [Custom] void initDeviceMotionEvent(in DOMString type, in boolean bubbles, in boolean cancelable, in Acceleration acceleration, in Acceleration accelerationIncludingGravity, in RotationRate rotationRate, in double interval);
};
}
diff --git a/WebCore/dom/DeviceOrientationClient.h b/WebCore/dom/DeviceOrientationClient.h
index c969c95..347c3b3 100644
--- a/WebCore/dom/DeviceOrientationClient.h
+++ b/WebCore/dom/DeviceOrientationClient.h
@@ -39,6 +39,7 @@ public:
virtual void startUpdating() = 0;
virtual void stopUpdating() = 0;
virtual DeviceOrientation* lastOrientation() const = 0;
+ virtual void deviceOrientationControllerDestroyed() = 0;
};
} // namespace WebCore
diff --git a/WebCore/dom/DeviceOrientationController.cpp b/WebCore/dom/DeviceOrientationController.cpp
index a744366..60fcf13 100644
--- a/WebCore/dom/DeviceOrientationController.cpp
+++ b/WebCore/dom/DeviceOrientationController.cpp
@@ -41,6 +41,11 @@ DeviceOrientationController::DeviceOrientationController(Page* page, DeviceOrien
m_client->setController(this);
}
+DeviceOrientationController::~DeviceOrientationController()
+{
+ m_client->deviceOrientationControllerDestroyed();
+}
+
void DeviceOrientationController::timerFired(Timer<DeviceOrientationController>* timer)
{
ASSERT_UNUSED(timer, timer == &m_timer);
diff --git a/WebCore/dom/DeviceOrientationController.h b/WebCore/dom/DeviceOrientationController.h
index 9517791..53b80f8 100644
--- a/WebCore/dom/DeviceOrientationController.h
+++ b/WebCore/dom/DeviceOrientationController.h
@@ -40,6 +40,7 @@ class Page;
class DeviceOrientationController {
public:
DeviceOrientationController(Page*, DeviceOrientationClient*);
+ ~DeviceOrientationController();
void addListener(DOMWindow*);
void removeListener(DOMWindow*);
diff --git a/WebCore/dom/Document.cpp b/WebCore/dom/Document.cpp
index 180b943..359a3d3 100644
--- a/WebCore/dom/Document.cpp
+++ b/WebCore/dom/Document.cpp
@@ -129,7 +129,6 @@
#include "TreeWalker.h"
#include "UIEvent.h"
#include "UserContentURLPattern.h"
-#include "ViewportArguments.h"
#include "WebKitAnimationEvent.h"
#include "WebKitTransitionEvent.h"
#include "WheelEvent.h"
@@ -1079,7 +1078,7 @@ KURL Document::baseURI() const
// * making it receive a rect as parameter, i.e. nodesFromRect(x, y, w, h);
// * making it receive the expading size of each direction separately,
// i.e. nodesFromRect(x, y, topSize, rightSize, bottomSize, leftSize);
-PassRefPtr<NodeList> Document::nodesFromRect(int centerX, int centerY, unsigned hPadding, unsigned vPadding, bool ignoreClipping) const
+PassRefPtr<NodeList> Document::nodesFromRect(int centerX, int centerY, unsigned topPadding, unsigned rightPadding, unsigned bottomPadding, unsigned leftPadding, bool ignoreClipping) const
{
// FIXME: Share code between this, elementFromPoint and caretRangeFromPoint.
if (!renderer())
@@ -1093,26 +1092,25 @@ PassRefPtr<NodeList> Document::nodesFromRect(int centerX, int centerY, unsigned
float zoomFactor = frame->pageZoomFactor();
IntPoint point = roundedIntPoint(FloatPoint(centerX * zoomFactor + view()->scrollX(), centerY * zoomFactor + view()->scrollY()));
- IntSize padding(hPadding, vPadding);
int type = HitTestRequest::ReadOnly | HitTestRequest::Active;
// When ignoreClipping is false, this method returns null for coordinates outside of the viewport.
if (ignoreClipping)
type |= HitTestRequest::IgnoreClipping;
- else if (!frameView->visibleContentRect().intersects(IntRect(point, padding)))
+ else if (!frameView->visibleContentRect().intersects(HitTestResult::rectFromPoint(point, topPadding, rightPadding, bottomPadding, leftPadding)))
return 0;
HitTestRequest request(type);
// Passing a zero padding will trigger a rect hit test, however for the purposes of nodesFromRect,
// we special handle this case in order to return a valid NodeList.
- if (padding.isZero()) {
+ if (!topPadding && !rightPadding && !bottomPadding && !leftPadding) {
HitTestResult result(point);
return handleZeroPadding(request, result);
}
- HitTestResult result(point, padding);
+ HitTestResult result(point, topPadding, rightPadding, bottomPadding, leftPadding);
renderView()->layer()->hitTest(request, result);
return StaticHashSetNodeList::adopt(result.rectBasedTestResult());
@@ -1238,8 +1236,10 @@ void Document::removeElementById(const AtomicString& elementId, Element* element
if (m_elementsById.get(elementId.impl()) == element)
m_elementsById.remove(elementId.impl());
- else
+ else {
+ ASSERT(m_inRemovedLastRefFunction || m_duplicateIds.contains(elementId.impl()));
m_duplicateIds.remove(elementId.impl());
+ }
}
Element* Document::getElementByAccessKey(const String& key) const
@@ -1824,6 +1824,18 @@ void Document::clearAXObjectCache()
#endif
}
+bool Document::axObjectCacheExists() const
+{
+ if (m_axObjectCache)
+ return true;
+
+ Document* doc = topDocument();
+ if (doc != this)
+ return doc->axObjectCacheExists();
+
+ return false;
+}
+
AXObjectCache* Document::axObjectCache() const
{
#if PLATFORM(ANDROID)
@@ -2097,7 +2109,7 @@ void Document::implicitClose()
view()->layout();
}
-#if PLATFORM(MAC)
+#if PLATFORM(MAC) || PLATFORM(CHROMIUM)
if (f && renderObject && this == topDocument() && AXObjectCache::accessibilityEnabled()) {
// The AX cache may have been cleared at this point, but we need to make sure it contains an
// AX object to send the notification to. getOrCreate will make sure that an valid AX object
@@ -2352,7 +2364,7 @@ const Vector<RefPtr<CSSStyleSheet> >* Document::pageGroupUserSheets() const
if (!UserContentURLPattern::matchesPatterns(url(), sheet->whitelist(), sheet->blacklist()))
continue;
RefPtr<CSSStyleSheet> parsedSheet = CSSStyleSheet::createInline(const_cast<Document*>(this), sheet->url());
- parsedSheet->setIsUserStyleSheet(sheet->level() == UserStyleSheet::UserLevel);
+ parsedSheet->setIsUserStyleSheet(sheet->level() == UserStyleUserLevel);
parsedSheet->parseString(sheet->source(), !inQuirksMode());
if (!m_pageGroupUserSheets)
m_pageGroupUserSheets.set(new Vector<RefPtr<CSSStyleSheet> >);
@@ -2647,16 +2659,14 @@ void Document::processViewport(const String& features)
{
ASSERT(!features.isNull());
+ m_viewportArguments = ViewportArguments();
+ processArguments(features, (void*)&m_viewportArguments, &setViewportFeature);
+
Frame* frame = this->frame();
- if (!frame)
+ if (!frame || !frame->page())
return;
- if (frame->page()) {
- ViewportArguments arguments;
- processArguments(features, (void*)&arguments, &setViewportFeature);
-
- frame->page()->chrome()->client()->didReceiveViewportArguments(frame, arguments);
- }
+ frame->page()->chrome()->client()->didReceiveViewportArguments(frame, m_viewportArguments);
}
MouseEventWithHitTestResults Document::prepareMouseEvent(const HitTestRequest& request, const IntPoint& documentPoint, const PlatformMouseEvent& event)
@@ -3224,7 +3234,7 @@ bool Document::setFocusedNode(PassRefPtr<Node> newFocusedNode)
}
}
-#if ((PLATFORM(MAC) || PLATFORM(WIN)) && !PLATFORM(CHROMIUM)) || PLATFORM(GTK)
+#if PLATFORM(MAC) || PLATFORM(WIN) || PLATFORM(GTK) || PLATFORM(CHROMIUM)
if (!focusChangeBlocked && m_focusedNode && AXObjectCache::accessibilityEnabled()) {
RenderObject* oldFocusedRenderer = 0;
RenderObject* newFocusedRenderer = 0;
@@ -3271,6 +3281,8 @@ void Document::attachNodeIterator(NodeIterator* ni)
void Document::detachNodeIterator(NodeIterator* ni)
{
+ // The node iterator can be detached without having been attached if its root node didn't have a document
+ // when the iterator was created, but has it now.
m_nodeIterators.remove(ni);
}
@@ -3870,6 +3882,10 @@ void Document::setInPageCache(bool flag)
ASSERT(m_renderArena);
setRenderer(m_savedRenderer);
m_savedRenderer = 0;
+
+ if (frame() && frame()->page())
+ frame()->page()->chrome()->client()->didReceiveViewportArguments(frame(), m_viewportArguments);
+
if (childNeedsStyleRecalc())
scheduleStyleRecalc();
}
@@ -3967,7 +3983,7 @@ bool Document::queryCommandIndeterm(const String& commandName)
bool Document::queryCommandState(const String& commandName)
{
- return command(this, commandName).state() != FalseTriState;
+ return command(this, commandName).state() == TrueTriState;
}
bool Document::queryCommandSupported(const String& commandName)
@@ -4083,6 +4099,11 @@ SVGDocumentExtensions* Document::accessSVGExtensions()
m_svgExtensions = adoptPtr(new SVGDocumentExtensions(this));
return m_svgExtensions.get();
}
+
+bool Document::hasSVGRootNode() const
+{
+ return documentElement() && documentElement()->hasTagName(SVGNames::svgTag);
+}
#endif
PassRefPtr<HTMLCollection> Document::images()
@@ -4326,37 +4347,9 @@ void FormElementKey::deref() const
type()->deref();
}
-unsigned FormElementKeyHash::hash(const FormElementKey& k)
+unsigned FormElementKeyHash::hash(const FormElementKey& key)
{
- ASSERT(sizeof(k) % (sizeof(uint16_t) * 2) == 0);
-
- unsigned l = sizeof(k) / (sizeof(uint16_t) * 2);
- const uint16_t* s = reinterpret_cast<const uint16_t*>(&k);
- uint32_t hash = WTF::stringHashingStartValue;
-
- // Main loop
- for (; l > 0; l--) {
- hash += s[0];
- uint32_t tmp = (s[1] << 11) ^ hash;
- hash = (hash << 16) ^ tmp;
- s += 2;
- hash += hash >> 11;
- }
-
- // Force "avalanching" of final 127 bits
- hash ^= hash << 3;
- hash += hash >> 5;
- hash ^= hash << 2;
- hash += hash >> 15;
- hash ^= hash << 10;
-
- // this avoids ever returning a hash code of 0, since that is used to
- // signal "hash not computed yet", using a value that is likely to be
- // effectively the same as 0 when the low bits are masked
- if (!hash)
- hash = 0x80000000;
-
- return hash;
+ return WTF::StringHasher::createBlobHash<sizeof(FormElementKey)>(&key);
}
void Document::setIconURL(const String& iconURL, const String& type)
diff --git a/WebCore/dom/Document.h b/WebCore/dom/Document.h
index c1065fb..fa3d9fb 100644
--- a/WebCore/dom/Document.h
+++ b/WebCore/dom/Document.h
@@ -36,6 +36,7 @@
#include "QualifiedName.h"
#include "ScriptExecutionContext.h"
#include "Timer.h"
+#include "ViewportArguments.h"
#include <wtf/FixedArray.h>
#include <wtf/HashCountedSet.h>
#include <wtf/OwnPtr.h>
@@ -276,6 +277,8 @@ public:
DEFINE_ATTRIBUTE_EVENT_LISTENER(webkitfullscreenchange);
#endif
+ ViewportArguments viewportArguments() const { return m_viewportArguments; }
+
DocumentType* doctype() const { return m_docType.get(); }
DOMImplementation* implementation() const;
@@ -305,7 +308,7 @@ public:
/**
* Retrieve all nodes that intersect a rect in the window's document, until it is fully enclosed by
- * the boundaries of node.
+ * the boundaries of a node.
*
* @param centerX x reference for the rectangle in CSS pixels
* @param centerY y reference for the rectangle in CSS pixels
@@ -314,7 +317,8 @@ public:
* @param ignoreClipping whether or not to ignore the root scroll frame when retrieving the element.
* If false, this method returns null for coordinates outside of the viewport.
*/
- PassRefPtr<NodeList> nodesFromRect(int centerX, int centerY, unsigned hPadding, unsigned vPadding, bool ignoreClipping) const;
+ PassRefPtr<NodeList> nodesFromRect(int centerX, int centerY, unsigned topPadding, unsigned rightPadding,
+ unsigned bottomPadding, unsigned leftPadding, bool ignoreClipping) const;
Element* elementFromPoint(int x, int y) const;
PassRefPtr<Range> caretRangeFromPoint(int x, int y);
@@ -385,8 +389,10 @@ public:
virtual bool isImageDocument() const { return false; }
#if ENABLE(SVG)
virtual bool isSVGDocument() const { return false; }
+ bool hasSVGRootNode() const;
#else
static bool isSVGDocument() { return false; }
+ static bool hasSVGRootNode() { return false; }
#endif
virtual bool isPluginDocument() const { return false; }
virtual bool isMediaDocument() const { return false; }
@@ -520,6 +526,7 @@ public:
void clearAXObjectCache();
AXObjectCache* axObjectCache() const;
+ bool axObjectCacheExists() const;
// to get visually ordered hebrew and arabic pages right
void setVisuallyOrdered();
@@ -1323,6 +1330,8 @@ private:
#endif
int m_loadEventDelayCount;
+
+ ViewportArguments m_viewportArguments;
};
inline bool Document::hasElementWithId(AtomicStringImpl* id) const
diff --git a/WebCore/dom/Document.idl b/WebCore/dom/Document.idl
index 296bd44..e551f88 100644
--- a/WebCore/dom/Document.idl
+++ b/WebCore/dom/Document.idl
@@ -186,11 +186,6 @@ module core {
readonly attribute [ConvertNullStringTo=Undefined] DOMString defaultCharset;
readonly attribute [ConvertNullStringTo=Undefined] DOMString readyState;
-
- NodeList nodesFromRect(in long x, in long y,
- in unsigned long hPadding,
- in unsigned long vPadding,
- in boolean ignoreClipping);
Element elementFromPoint(in long x, in long y);
Range caretRangeFromPoint(in long x, in long y);
diff --git a/WebCore/dom/DocumentMarker.h b/WebCore/dom/DocumentMarker.h
index e6160ae..dd5e981 100644
--- a/WebCore/dom/DocumentMarker.h
+++ b/WebCore/dom/DocumentMarker.h
@@ -40,6 +40,7 @@ struct DocumentMarker {
Grammar,
TextMatch,
Replacement,
+ CorrectionIndicator,
RejectedCorrection
};
diff --git a/WebCore/dom/Element.cpp b/WebCore/dom/Element.cpp
index 5f53c2d..c408790 100644
--- a/WebCore/dom/Element.cpp
+++ b/WebCore/dom/Element.cpp
@@ -33,6 +33,7 @@
#include "CSSStyleSelector.h"
#include "ClientRect.h"
#include "ClientRectList.h"
+#include "DOMTokenList.h"
#include "DatasetDOMStringMap.h"
#include "Document.h"
#include "DocumentFragment.h"
@@ -578,7 +579,10 @@ void Element::setAttribute(const AtomicString& name, const AtomicString& value,
else if (!old && !value.isNull())
m_attributeMap->addAttribute(createAttribute(QualifiedName(nullAtom, localName, nullAtom), value));
else if (old && !value.isNull()) {
- old->setValue(value);
+ if (Attr* attrNode = old->attr())
+ attrNode->setValue(value);
+ else
+ old->setValue(value);
attributeChanged(old);
}
@@ -608,7 +612,10 @@ void Element::setAttribute(const QualifiedName& name, const AtomicString& value,
else if (!old && !value.isNull())
m_attributeMap->addAttribute(createAttribute(name, value));
else if (old) {
- old->setValue(value);
+ if (Attr* attrNode = old->attr())
+ attrNode->setValue(value);
+ else
+ old->setValue(value);
attributeChanged(old);
}
@@ -651,6 +658,8 @@ void Element::updateAfterAttributeChanged(Attribute* attr)
document()->axObjectCache()->selectedChildrenChanged(renderer());
else if (attrName == aria_expandedAttr)
document()->axObjectCache()->handleAriaExpandedChange(renderer());
+ else if (attrName == aria_hiddenAttr)
+ document()->axObjectCache()->childrenChanged(renderer());
}
void Element::recalcStyleIfNeededAfterAttributeChanged(Attribute* attr)
@@ -1565,6 +1574,21 @@ bool Element::webkitMatchesSelector(const String& selector, ExceptionCode& ec)
return false;
}
+DOMTokenList* Element::classList()
+{
+ ElementRareData* data = ensureRareData();
+ if (!data->m_classList)
+ data->m_classList = DOMTokenList::create(this);
+ return data->m_classList.get();
+}
+
+DOMTokenList* Element::optionalClassList() const
+{
+ if (!hasRareData())
+ return 0;
+ return rareData()->m_classList.get();
+}
+
DOMStringMap* Element::dataset()
{
ElementRareData* data = ensureRareData();
diff --git a/WebCore/dom/Element.h b/WebCore/dom/Element.h
index d9a5085..b51e750 100644
--- a/WebCore/dom/Element.h
+++ b/WebCore/dom/Element.h
@@ -36,6 +36,7 @@ class Attribute;
class ClientRect;
class ClientRectList;
class DOMStringMap;
+class DOMTokenList;
class ElementRareData;
class IntSize;
@@ -269,6 +270,9 @@ public:
bool webkitMatchesSelector(const String& selectors, ExceptionCode&);
+ DOMTokenList* classList();
+ DOMTokenList* optionalClassList() const;
+
DOMStringMap* dataset();
DOMStringMap* optionalDataset() const;
diff --git a/WebCore/dom/ElementRareData.h b/WebCore/dom/ElementRareData.h
index 8e338ab..f1e6334 100644
--- a/WebCore/dom/ElementRareData.h
+++ b/WebCore/dom/ElementRareData.h
@@ -22,6 +22,7 @@
#ifndef ElementRareData_h
#define ElementRareData_h
+#include "DOMTokenList.h"
#include "DatasetDOMStringMap.h"
#include "Element.h"
#include "NodeRareData.h"
@@ -42,6 +43,7 @@ public:
RefPtr<RenderStyle> m_computedStyle;
OwnPtr<DatasetDOMStringMap> m_datasetDOMStringMap;
+ OwnPtr<DOMTokenList> m_classList;
};
inline IntSize defaultMinimumSizeForResizing()
diff --git a/WebCore/dom/Node.cpp b/WebCore/dom/Node.cpp
index 92b42fe..5694dfe 100644
--- a/WebCore/dom/Node.cpp
+++ b/WebCore/dom/Node.cpp
@@ -25,11 +25,15 @@
#include "config.h"
#include "Node.h"
+<<<<<<< HEAD
#ifdef ANDROID_DOM_LOGGING
#define LOG_TAG "webcore"
#include "AndroidLog.h"
#endif
+=======
+#include "AXObjectCache.h"
+>>>>>>> webkit.org at r68651
#include "Attr.h"
#include "Attribute.h"
#include "CSSParser.h"
@@ -386,6 +390,9 @@ Node::~Node()
if (renderer())
detach();
+ if (AXObjectCache::accessibilityEnabled() && m_document && m_document->axObjectCacheExists())
+ m_document->axObjectCache()->removeNodeForUse(this);
+
if (m_previous)
m_previous->setNextSibling(0);
if (m_next)
diff --git a/WebCore/dom/NodeIterator.cpp b/WebCore/dom/NodeIterator.cpp
index af07f42..ce3103c 100644
--- a/WebCore/dom/NodeIterator.cpp
+++ b/WebCore/dom/NodeIterator.cpp
@@ -76,12 +76,16 @@ NodeIterator::NodeIterator(PassRefPtr<Node> rootNode, unsigned whatToShow, PassR
, m_referenceNode(root(), true)
, m_detached(false)
{
- root()->document()->attachNodeIterator(this);
+ // Document type nodes may have a null document. But since they can't have children, there is no need to listen for modifications to these.
+ ASSERT(root()->document() || root()->nodeType() == Node::DOCUMENT_TYPE_NODE);
+ if (Document* ownerDocument = root()->document())
+ ownerDocument->attachNodeIterator(this);
}
NodeIterator::~NodeIterator()
{
- root()->document()->detachNodeIterator(this);
+ if (Document* ownerDocument = root()->document())
+ ownerDocument->detachNodeIterator(this);
}
PassRefPtr<Node> NodeIterator::nextNode(ScriptState* state, ExceptionCode& ec)
@@ -144,7 +148,8 @@ PassRefPtr<Node> NodeIterator::previousNode(ScriptState* state, ExceptionCode& e
void NodeIterator::detach()
{
- root()->document()->detachNodeIterator(this);
+ if (Document* ownerDocument = root()->document())
+ ownerDocument->detachNodeIterator(this);
m_detached = true;
m_referenceNode.node.clear();
}
@@ -159,6 +164,7 @@ void NodeIterator::updateForNodeRemoval(Node* removedNode, NodePointer& referenc
{
ASSERT(!m_detached);
ASSERT(removedNode);
+ ASSERT(root()->document());
ASSERT(root()->document() == removedNode->document());
// Iterator is not affected if the removed node is the reference node and is the root.
diff --git a/WebCore/dom/QualifiedName.h b/WebCore/dom/QualifiedName.h
index ee90408..2da8f0c 100644
--- a/WebCore/dom/QualifiedName.h
+++ b/WebCore/dom/QualifiedName.h
@@ -112,52 +112,24 @@ inline bool operator!=(const QualifiedName& q, const AtomicString& a) { return a
inline unsigned hashComponents(const QualifiedNameComponents& buf)
{
- ASSERT(sizeof(QualifiedNameComponents) % (sizeof(uint16_t) * 2) == 0);
-
- unsigned l = sizeof(QualifiedNameComponents) / (sizeof(uint16_t) * 2);
- const uint16_t* s = reinterpret_cast<const uint16_t*>(&buf);
- uint32_t hash = WTF::stringHashingStartValue;
-
- // Main loop
- for (; l > 0; l--) {
- hash += s[0];
- uint32_t tmp = (s[1] << 11) ^ hash;
- hash = (hash << 16) ^ tmp;
- s += 2;
- hash += hash >> 11;
- }
-
- // Force "avalanching" of final 127 bits
- hash ^= hash << 3;
- hash += hash >> 5;
- hash ^= hash << 2;
- hash += hash >> 15;
- hash ^= hash << 10;
-
- // this avoids ever returning a hash code of 0, since that is used to
- // signal "hash not computed yet", using a value that is likely to be
- // effectively the same as 0 when the low bits are masked
- if (hash == 0)
- hash = 0x80000000;
-
- return hash;
+ return WTF::StringHasher::createBlobHash<sizeof(QualifiedNameComponents)>(&buf);
}
-
+
struct QualifiedNameHash {
static unsigned hash(const QualifiedName& name) { return hash(name.impl()); }
-
+
static unsigned hash(const QualifiedName::QualifiedNameImpl* name)
- {
+ {
QualifiedNameComponents c = { name->m_prefix.impl(), name->m_localName.impl(), name->m_namespace.impl() };
return hashComponents(c);
}
-
+
static bool equal(const QualifiedName& a, const QualifiedName& b) { return a == b; }
static bool equal(const QualifiedName::QualifiedNameImpl* a, const QualifiedName::QualifiedNameImpl* b) { return a == b; }
-
+
static const bool safeToCompareToEmptyOrDeleted = false;
};
-
+
}
namespace WTF {
diff --git a/WebCore/dom/Range.h b/WebCore/dom/Range.h
index 9834aec..aea76e1 100644
--- a/WebCore/dom/Range.h
+++ b/WebCore/dom/Range.h
@@ -109,6 +109,7 @@ public:
void textRects(Vector<IntRect>&, bool useSelectionHeight = false);
// Transform-friendly
void textQuads(Vector<FloatQuad>&, bool useSelectionHeight = false);
+ void getBorderAndTextQuads(Vector<FloatQuad>&) const;
void nodeChildrenChanged(ContainerNode*);
void nodeChildrenWillBeRemoved(ContainerNode*);
@@ -147,8 +148,6 @@ private:
enum ActionType { DELETE_CONTENTS, EXTRACT_CONTENTS, CLONE_CONTENTS };
PassRefPtr<DocumentFragment> processContents(ActionType, ExceptionCode&);
- void getBorderAndTextQuads(Vector<FloatQuad>&) const;
-
RefPtr<Document> m_ownerDocument;
RangeBoundaryPoint m_start;
RangeBoundaryPoint m_end;
diff --git a/WebCore/dom/SelectElement.cpp b/WebCore/dom/SelectElement.cpp
index 0ca6cb3..bcab08c 100644
--- a/WebCore/dom/SelectElement.cpp
+++ b/WebCore/dom/SelectElement.cpp
@@ -53,7 +53,7 @@
#if PLATFORM(MAC) || (PLATFORM(CHROMIUM) && OS(DARWIN))
#define ARROW_KEYS_POP_MENU 1
#define SPACE_OR_RETURN_POP_MENU 0
-#elif PLATFORM(GTK) || (PLATFORM(CHROMIUM) && OS(LINUX))
+#elif PLATFORM(GTK) || (PLATFORM(CHROMIUM) && (OS(LINUX) || OS(FREEBSD)))
#define ARROW_KEYS_POP_MENU 0
#define SPACE_OR_RETURN_POP_MENU 1
#else
diff --git a/WebCore/dom/SpaceSplitString.h b/WebCore/dom/SpaceSplitString.h
index f49670b..0d3650e 100644
--- a/WebCore/dom/SpaceSplitString.h
+++ b/WebCore/dom/SpaceSplitString.h
@@ -74,6 +74,7 @@ namespace WebCore {
bool containsAll(const SpaceSplitString& names) const { return !names.m_data || (m_data && m_data->containsAll(*names.m_data)); }
size_t size() const { return m_data ? m_data->size() : 0; }
+ bool isNull() const { return !m_data; }
const AtomicString& operator[](size_t i) const { ASSERT(i < size()); return (*m_data)[i]; }
private:
diff --git a/WebCore/dom/StyledElement.cpp b/WebCore/dom/StyledElement.cpp
index a158e2e..f07fda9 100644
--- a/WebCore/dom/StyledElement.cpp
+++ b/WebCore/dom/StyledElement.cpp
@@ -28,6 +28,7 @@
#include "CSSStyleSelector.h"
#include "CSSStyleSheet.h"
#include "CSSValueKeywords.h"
+#include "DOMTokenList.h"
#include "Document.h"
#include "HTMLNames.h"
#include <wtf/HashFunctions.h>
@@ -217,12 +218,12 @@ void StyledElement::classAttributeChanged(const AtomicString& newClassString)
}
bool hasClass = i < length;
setHasClass(hasClass);
- if (hasClass)
+ if (hasClass) {
attributes()->setClass(newClassString);
- else {
- if (attributeMap())
- attributeMap()->clearClass();
- }
+ if (DOMTokenList* classList = optionalClassList())
+ classList->reset(newClassString);
+ } else if (attributeMap())
+ attributeMap()->clearClass();
setNeedsStyleRecalc();
dispatchSubtreeModifiedEvent();
}
diff --git a/WebCore/dom/StyledElement.h b/WebCore/dom/StyledElement.h
index 8040dbf..4b62388 100644
--- a/WebCore/dom/StyledElement.h
+++ b/WebCore/dom/StyledElement.h
@@ -32,6 +32,7 @@
namespace WebCore {
class Attribute;
+class ClassList;
class CSSMappedAttributeDeclaration;
class StyledElement : public Element {
diff --git a/WebCore/editing/AppendNodeCommand.cpp b/WebCore/editing/AppendNodeCommand.cpp
index 6178641..eeecdd2 100644
--- a/WebCore/editing/AppendNodeCommand.cpp
+++ b/WebCore/editing/AppendNodeCommand.cpp
@@ -26,6 +26,7 @@
#include "config.h"
#include "AppendNodeCommand.h"
+#include "AXObjectCache.h"
#include "htmlediting.h"
namespace WebCore {
@@ -42,6 +43,17 @@ AppendNodeCommand::AppendNodeCommand(PassRefPtr<Element> parent, PassRefPtr<Node
ASSERT(m_parent->isContentEditable() || !m_parent->attached());
}
+static void sendAXTextChangedIgnoringLineBreaks(Node* node, AXObjectCache::AXTextChange textChange)
+{
+ String nodeValue = node->nodeValue();
+ unsigned len = nodeValue.length();
+ // Don't consider linebreaks in this command
+ if (nodeValue == "\n")
+ return;
+
+ node->document()->axObjectCache()->nodeTextChangeNotification(node->renderer(), textChange, 0, len);
+}
+
void AppendNodeCommand::doApply()
{
if (!m_parent->isContentEditable() && m_parent->attached())
@@ -49,6 +61,9 @@ void AppendNodeCommand::doApply()
ExceptionCode ec;
m_parent->appendChild(m_node.get(), ec);
+
+ if (AXObjectCache::accessibilityEnabled())
+ sendAXTextChangedIgnoringLineBreaks(m_node.get(), AXObjectCache::AXTextInserted);
}
void AppendNodeCommand::doUnapply()
@@ -56,6 +71,10 @@ void AppendNodeCommand::doUnapply()
if (!m_parent->isContentEditable())
return;
+ // Need to notify this before actually deleting the text
+ if (AXObjectCache::accessibilityEnabled())
+ sendAXTextChangedIgnoringLineBreaks(m_node.get(), AXObjectCache::AXTextDeleted);
+
ExceptionCode ec;
m_node->remove(ec);
}
diff --git a/WebCore/editing/ApplyStyleCommand.cpp b/WebCore/editing/ApplyStyleCommand.cpp
index b2e93ec..3ff7169 100644
--- a/WebCore/editing/ApplyStyleCommand.cpp
+++ b/WebCore/editing/ApplyStyleCommand.cpp
@@ -145,7 +145,7 @@ void StyleChange::init(PassRefPtr<CSSStyleDeclaration> style, const Position& po
return;
RefPtr<CSSComputedStyleDeclaration> computedStyle = position.computedStyle();
- RefPtr<CSSMutableStyleDeclaration> mutableStyle = getPropertiesNotInComputedStyle(style.get(), computedStyle.get());
+ RefPtr<CSSMutableStyleDeclaration> mutableStyle = getPropertiesNotIn(style.get(), computedStyle.get());
reconcileTextDecorationProperties(mutableStyle.get());
if (!document->frame()->editor()->shouldStyleWithCSS())
@@ -156,7 +156,7 @@ void StyleChange::init(PassRefPtr<CSSStyleDeclaration> style, const Position& po
mutableStyle->removeProperty(CSSPropertyWhiteSpace);
// If unicode-bidi is present in mutableStyle and direction is not, then add direction to mutableStyle.
- // FIXME: Shouldn't this be done in getPropertiesNotInComputedStyle?
+ // FIXME: Shouldn't this be done in getPropertiesNotIn?
if (mutableStyle->getPropertyCSSValue(CSSPropertyUnicodeBidi) && !style->getPropertyCSSValue(CSSPropertyDirection))
mutableStyle->setProperty(CSSPropertyDirection, style->getPropertyValue(CSSPropertyDirection));
@@ -221,8 +221,8 @@ void StyleChange::extractTextStyles(Document* document, CSSMutableStyleDeclarati
// Assuming reconcileTextDecorationProperties has been called, there should not be -webkit-text-decorations-in-effect
// Furthermore, text-decoration: none has been trimmed so that text-decoration property is always a CSSValueList.
- if (RefPtr<CSSValue> textDecoration = style->getPropertyCSSValue(CSSPropertyTextDecoration)) {
- ASSERT(textDecoration->isValueList());
+ RefPtr<CSSValue> textDecoration = style->getPropertyCSSValue(CSSPropertyTextDecoration);
+ if (textDecoration && textDecoration->isValueList()) {
DEFINE_STATIC_LOCAL(RefPtr<CSSPrimitiveValue>, underline, (CSSPrimitiveValue::createIdentifier(CSSValueUnderline)));
DEFINE_STATIC_LOCAL(RefPtr<CSSPrimitiveValue>, lineThrough, (CSSPrimitiveValue::createIdentifier(CSSValueLineThrough)));
@@ -388,23 +388,43 @@ static bool fontWeightIsBold(CSSStyleDeclaration* style)
return false; // Make compiler happy
}
-RefPtr<CSSMutableStyleDeclaration> getPropertiesNotInComputedStyle(CSSStyleDeclaration* style, CSSComputedStyleDeclaration* computedStyle)
+static int getTextAlignment(CSSStyleDeclaration* style)
{
- ASSERT(style);
- ASSERT(computedStyle);
- RefPtr<CSSMutableStyleDeclaration> result = style->copy();
- computedStyle->diff(result.get());
+ int textAlign = getIdentifierValue(style, CSSPropertyTextAlign);
+ switch (textAlign) {
+ case CSSValueCenter:
+ case CSSValueWebkitCenter:
+ return CSSValueCenter;
+ case CSSValueLeft:
+ case CSSValueWebkitLeft:
+ return CSSValueLeft;
+ case CSSValueRight:
+ case CSSValueWebkitRight:
+ return CSSValueRight;
+ }
+ return CSSValueInvalid;
+}
+
+RefPtr<CSSMutableStyleDeclaration> getPropertiesNotIn(CSSStyleDeclaration* styleWithRedundantProperties, CSSStyleDeclaration* baseStyle)
+{
+ ASSERT(styleWithRedundantProperties);
+ ASSERT(baseStyle);
+ RefPtr<CSSMutableStyleDeclaration> result = styleWithRedundantProperties->copy();
+ baseStyle->diff(result.get());
- RefPtr<CSSValue> computedTextDecorationsInEffect = computedStyle->getPropertyCSSValue(CSSPropertyWebkitTextDecorationsInEffect);
- diffTextDecorations(result.get(), CSSPropertyTextDecoration, computedTextDecorationsInEffect.get());
- diffTextDecorations(result.get(), CSSPropertyWebkitTextDecorationsInEffect, computedTextDecorationsInEffect.get());
+ RefPtr<CSSValue> baseTextDecorationsInEffect = baseStyle->getPropertyCSSValue(CSSPropertyWebkitTextDecorationsInEffect);
+ diffTextDecorations(result.get(), CSSPropertyTextDecoration, baseTextDecorationsInEffect.get());
+ diffTextDecorations(result.get(), CSSPropertyWebkitTextDecorationsInEffect, baseTextDecorationsInEffect.get());
- if (fontWeightIsBold(result.get()) == fontWeightIsBold(computedStyle))
+ if (fontWeightIsBold(result.get()) == fontWeightIsBold(baseStyle))
result->removeProperty(CSSPropertyFontWeight);
- if (getRGBAFontColor(result.get()) == getRGBAFontColor(computedStyle))
+ if (getRGBAFontColor(result.get()) == getRGBAFontColor(baseStyle))
result->removeProperty(CSSPropertyColor);
+ if (getTextAlignment(result.get()) == getTextAlignment(baseStyle))
+ result->removeProperty(CSSPropertyTextAlign);
+
return result;
}
@@ -439,6 +459,11 @@ static const int editingStyleProperties[] = {
};
size_t numEditingStyleProperties = sizeof(editingStyleProperties)/sizeof(editingStyleProperties[0]);
+RefPtr<CSSMutableStyleDeclaration> ApplyStyleCommand::removeNonEditingProperties(CSSStyleDeclaration* style)
+{
+ return style->copyPropertiesInSet(editingStyleProperties, numEditingStyleProperties);
+}
+
PassRefPtr<CSSMutableStyleDeclaration> ApplyStyleCommand::editingStyleAtPosition(Position pos, ShouldIncludeTypingStyle shouldIncludeTypingStyle)
{
RefPtr<CSSComputedStyleDeclaration> computedStyleAtPosition = pos.computedStyle();
@@ -446,7 +471,7 @@ PassRefPtr<CSSMutableStyleDeclaration> ApplyStyleCommand::editingStyleAtPosition
if (!computedStyleAtPosition)
style = CSSMutableStyleDeclaration::create();
else
- style = computedStyleAtPosition->copyPropertiesInSet(editingStyleProperties, numEditingStyleProperties);
+ style = removeNonEditingProperties(computedStyleAtPosition.get());
if (style && pos.node() && pos.node()->computedStyle()) {
RenderStyle* renderStyle = pos.node()->computedStyle();
@@ -1161,19 +1186,22 @@ bool ApplyStyleCommand::removeStyleFromRunBeforeApplyingStyle(CSSMutableStyleDec
return true;
}
-bool ApplyStyleCommand::removeInlineStyleFromElement(CSSMutableStyleDeclaration* style, HTMLElement* element, InlineStyleRemovalMode mode)
+bool ApplyStyleCommand::removeInlineStyleFromElement(CSSMutableStyleDeclaration* style, HTMLElement* element, InlineStyleRemovalMode mode, CSSMutableStyleDeclaration* extractedStyle)
{
ASSERT(style);
ASSERT(element);
if (m_styledInlineElement && element->hasTagName(m_styledInlineElement->tagQName())) {
- if (mode != RemoveNone)
+ if (mode != RemoveNone) {
+ if (extractedStyle && element->inlineStyleDecl())
+ extractedStyle->merge(element->inlineStyleDecl());
removeNodePreservingChildren(element);
+ }
return true;
}
bool removed = false;
- if (removeImplicitlyStyledElement(style, element, mode))
+ if (removeImplicitlyStyledElement(style, element, mode, extractedStyle))
removed = true;
if (!element->inDocument())
@@ -1181,7 +1209,7 @@ bool ApplyStyleCommand::removeInlineStyleFromElement(CSSMutableStyleDeclaration*
// If the node was converted to a span, the span may still contain relevant
// styles which must be removed (e.g. <b style='font-weight: bold'>)
- if (removeCSSStyle(style, element, mode))
+ if (removeCSSStyle(style, element, mode, extractedStyle))
removed = true;
return removed;
@@ -1313,27 +1341,35 @@ void ApplyStyleCommand::replaceWithSpanOrRemoveIfWithoutAttributes(HTMLElement*&
}
}
-bool ApplyStyleCommand::removeCSSStyle(CSSMutableStyleDeclaration* style, HTMLElement* elem, InlineStyleRemovalMode mode)
+bool ApplyStyleCommand::removeCSSStyle(CSSMutableStyleDeclaration* style, HTMLElement* element, InlineStyleRemovalMode mode, CSSMutableStyleDeclaration* extractedStyle)
{
ASSERT(style);
- ASSERT(elem);
+ ASSERT(element);
- CSSMutableStyleDeclaration* decl = elem->inlineStyleDecl();
+ CSSMutableStyleDeclaration* decl = element->inlineStyleDecl();
if (!decl)
return false;
bool removed = false;
CSSMutableStyleDeclaration::const_iterator end = style->end();
for (CSSMutableStyleDeclaration::const_iterator it = style->begin(); it != end; ++it) {
- CSSPropertyID propertyID = static_cast<CSSPropertyID>((*it).id());
+ CSSPropertyID propertyID = static_cast<CSSPropertyID>(it->id());
RefPtr<CSSValue> value = decl->getPropertyCSSValue(propertyID);
- if (value && (propertyID != CSSPropertyWhiteSpace || !isTabSpanNode(elem))) {
+ if (value && (propertyID != CSSPropertyWhiteSpace || !isTabSpanNode(element))) {
removed = true;
if (mode == RemoveNone)
return true;
- removeCSSProperty(elem, propertyID);
- if (propertyID == CSSPropertyUnicodeBidi && !decl->getPropertyValue(CSSPropertyDirection).isEmpty())
- removeCSSProperty(elem, CSSPropertyDirection);
+
+ ExceptionCode ec = 0;
+ if (extractedStyle)
+ extractedStyle->setProperty(propertyID, value->cssText(), decl->getPropertyPriority(propertyID), ec);
+ removeCSSProperty(element, propertyID);
+
+ if (propertyID == CSSPropertyUnicodeBidi && !decl->getPropertyValue(CSSPropertyDirection).isEmpty()) {
+ if (extractedStyle)
+ extractedStyle->setProperty(CSSPropertyDirection, decl->getPropertyValue(CSSPropertyDirection), decl->getPropertyPriority(CSSPropertyDirection), ec);
+ removeCSSProperty(element, CSSPropertyDirection);
+ }
}
}
@@ -1342,10 +1378,10 @@ bool ApplyStyleCommand::removeCSSStyle(CSSMutableStyleDeclaration* style, HTMLEl
// No need to serialize <foo style=""> if we just removed the last css property
if (decl->isEmpty())
- removeNodeAttribute(elem, styleAttr);
+ removeNodeAttribute(element, styleAttr);
- if (isSpanWithoutAttributesOrUnstyleStyleSpan(elem))
- removeNodePreservingChildren(elem);
+ if (isSpanWithoutAttributesOrUnstyleStyleSpan(element))
+ removeNodePreservingChildren(element);
return removed;
}
@@ -1370,51 +1406,6 @@ HTMLElement* ApplyStyleCommand::highestAncestorWithConflictingInlineStyle(CSSMut
return result;
}
-PassRefPtr<CSSMutableStyleDeclaration> ApplyStyleCommand::extractInlineStyleToPushDown(CSSMutableStyleDeclaration* styleToApply, Node* node, bool isStyledElement)
-{
- ASSERT(node);
- ASSERT(node->isElementNode());
-
- // non-html elements not handled yet
- if (!node->isHTMLElement())
- return 0;
-
- HTMLElement* element = static_cast<HTMLElement*>(node);
- RefPtr<CSSMutableStyleDeclaration> style = element->inlineStyleDecl();
- if (isStyledElement) {
- removeNodePreservingChildren(element);
- return style.release();
- }
-
- if (!style) {
- style = CSSMutableStyleDeclaration::create();
- removeImplicitlyStyledElement(styleToApply, element, RemoveIfNeeded, style.get());
- return style.release();
- }
-
- Vector<int> properties;
- CSSMutableStyleDeclaration::const_iterator end = styleToApply->end();
- for (CSSMutableStyleDeclaration::const_iterator it = styleToApply->begin(); it != end; ++it)
- properties.append(it->id());
-
- style = style->copyPropertiesInSet(properties.data(), properties.size());
- for (size_t i = 0; i < properties.size(); i++) {
- RefPtr<CSSValue> property = style->getPropertyCSSValue(properties[i]);
- if (property)
- removeCSSProperty(element, static_cast<CSSPropertyID>(properties[i]));
- }
-
- if (element->inlineStyleDecl() && element->inlineStyleDecl()->isEmpty())
- removeNodeAttribute(element, styleAttr);
-
- if (isSpanWithoutAttributesOrUnstyleStyleSpan(element))
- removeNodePreservingChildren(element);
-
- removeImplicitlyStyledElement(styleToApply, element, RemoveIfNeeded, style.get());
-
- return style.release();
-}
-
void ApplyStyleCommand::applyInlineStyleToPushDown(Node* node, CSSMutableStyleDeclaration* style)
{
ASSERT(node);
@@ -1437,11 +1428,9 @@ void ApplyStyleCommand::applyInlineStyleToPushDown(Node* node, CSSMutableStyleDe
newInlineStyle->setProperty(it->id(), it->value()->cssText(), it->isImportant(), ec);
// text-decorations adds up
- if (it->id() == CSSPropertyTextDecoration) {
- ASSERT(it->value()->isValueList());
+ if (it->id() == CSSPropertyTextDecoration && it->value()->isValueList()) {
RefPtr<CSSValue> textDecoration = newInlineStyle->getPropertyCSSValue(CSSPropertyTextDecoration);
- if (textDecoration) {
- ASSERT(textDecoration->isValueList());
+ if (textDecoration && textDecoration->isValueList()) {
CSSValueList* textDecorationOfInlineStyle = static_cast<CSSValueList*>(textDecoration.get());
CSSValueList* textDecorationOfStyleApplied = static_cast<CSSValueList*>(it->value());
@@ -1492,7 +1481,8 @@ void ApplyStyleCommand::pushDownInlineStyleAroundNode(CSSMutableStyleDeclaration
RefPtr<StyledElement> styledElement;
if (current->isStyledElement() && m_styledInlineElement && current->hasTagName(m_styledInlineElement->tagQName()))
styledElement = static_cast<StyledElement*>(current);
- RefPtr<CSSMutableStyleDeclaration> styleToPushDown = extractInlineStyleToPushDown(style, current, styledElement);
+ RefPtr<CSSMutableStyleDeclaration> styleToPushDown = CSSMutableStyleDeclaration::create();
+ removeInlineStyleFromElement(style, static_cast<HTMLElement*>(current), RemoveIfNeeded, styleToPushDown.get());
// The inner loop will go through children on each level
// FIXME: we should aggregate inline child elements together so that we don't wrap each child separately.
diff --git a/WebCore/editing/ApplyStyleCommand.h b/WebCore/editing/ApplyStyleCommand.h
index 78f592e..eb6a2bc 100644
--- a/WebCore/editing/ApplyStyleCommand.h
+++ b/WebCore/editing/ApplyStyleCommand.h
@@ -57,7 +57,8 @@ public:
{
return adoptRef(new ApplyStyleCommand(element, removeOnly, action));
}
-
+
+ static RefPtr<CSSMutableStyleDeclaration> removeNonEditingProperties(CSSStyleDeclaration* style);
static PassRefPtr<CSSMutableStyleDeclaration> editingStyleAtPosition(Position pos, ShouldIncludeTypingStyle shouldIncludeTypingStyle = IgnoreTypingStyle);
private:
@@ -72,13 +73,12 @@ private:
// style-removal helpers
bool removeStyleFromRunBeforeApplyingStyle(CSSMutableStyleDeclaration* style, Node*& runStart, Node*& runEnd);
- bool removeInlineStyleFromElement(CSSMutableStyleDeclaration*, HTMLElement*, InlineStyleRemovalMode = RemoveIfNeeded);
+ bool removeInlineStyleFromElement(CSSMutableStyleDeclaration*, HTMLElement*, InlineStyleRemovalMode = RemoveIfNeeded, CSSMutableStyleDeclaration* extractedStyle = 0);
inline bool shouldRemoveInlineStyleFromElement(CSSMutableStyleDeclaration* style, HTMLElement* element) {return removeInlineStyleFromElement(style, element, RemoveNone);}
- bool removeImplicitlyStyledElement(CSSMutableStyleDeclaration*, HTMLElement*, InlineStyleRemovalMode, CSSMutableStyleDeclaration* extractedStyle = 0);
+ bool removeImplicitlyStyledElement(CSSMutableStyleDeclaration*, HTMLElement*, InlineStyleRemovalMode, CSSMutableStyleDeclaration* extractedStyle);
void replaceWithSpanOrRemoveIfWithoutAttributes(HTMLElement*&);
- bool removeCSSStyle(CSSMutableStyleDeclaration*, HTMLElement*, InlineStyleRemovalMode = RemoveIfNeeded);
+ bool removeCSSStyle(CSSMutableStyleDeclaration*, HTMLElement*, InlineStyleRemovalMode = RemoveIfNeeded, CSSMutableStyleDeclaration* extractedStyle = 0);
HTMLElement* highestAncestorWithConflictingInlineStyle(CSSMutableStyleDeclaration*, Node*);
- PassRefPtr<CSSMutableStyleDeclaration> extractInlineStyleToPushDown(CSSMutableStyleDeclaration*, Node*, bool isStyledElement);
void applyInlineStyleToPushDown(Node*, CSSMutableStyleDeclaration *style);
void pushDownInlineStyleAroundNode(CSSMutableStyleDeclaration*, Node*);
void removeInlineStyle(PassRefPtr<CSSMutableStyleDeclaration>, const Position& start, const Position& end);
@@ -126,7 +126,7 @@ private:
bool isStyleSpan(const Node*);
PassRefPtr<HTMLElement> createStyleSpanElement(Document*);
-RefPtr<CSSMutableStyleDeclaration> getPropertiesNotInComputedStyle(CSSStyleDeclaration* style, CSSComputedStyleDeclaration* computedStyle);
+RefPtr<CSSMutableStyleDeclaration> getPropertiesNotIn(CSSStyleDeclaration* styleWithRedundantProperties, CSSStyleDeclaration* baseStyle);
void prepareEditingStyleToApplyAt(CSSMutableStyleDeclaration*, Position);
void removeStylesAddedByNode(CSSMutableStyleDeclaration*, Node*);
diff --git a/WebCore/editing/DeleteFromTextNodeCommand.cpp b/WebCore/editing/DeleteFromTextNodeCommand.cpp
index f1d79af..fe572e1 100644
--- a/WebCore/editing/DeleteFromTextNodeCommand.cpp
+++ b/WebCore/editing/DeleteFromTextNodeCommand.cpp
@@ -26,6 +26,7 @@
#include "config.h"
#include "DeleteFromTextNodeCommand.h"
+#include "AXObjectCache.h"
#include "Text.h"
namespace WebCore {
@@ -53,6 +54,10 @@ void DeleteFromTextNodeCommand::doApply()
if (ec)
return;
+ // Need to notify this before actually deleting the text
+ if (AXObjectCache::accessibilityEnabled())
+ document()->axObjectCache()->nodeTextChangeNotification(m_node->renderer(), AXObjectCache::AXTextDeleted, m_offset, m_count);
+
m_node->deleteData(m_offset, m_count, ec);
}
@@ -65,6 +70,9 @@ void DeleteFromTextNodeCommand::doUnapply()
ExceptionCode ec;
m_node->insertData(m_offset, m_text, ec);
+
+ if (AXObjectCache::accessibilityEnabled())
+ document()->axObjectCache()->nodeTextChangeNotification(m_node->renderer(), AXObjectCache::AXTextInserted, m_offset, m_count);
}
} // namespace WebCore
diff --git a/WebCore/editing/DeleteSelectionCommand.cpp b/WebCore/editing/DeleteSelectionCommand.cpp
index 4aa5c3c..4aca57e 100644
--- a/WebCore/editing/DeleteSelectionCommand.cpp
+++ b/WebCore/editing/DeleteSelectionCommand.cpp
@@ -443,11 +443,7 @@ void DeleteSelectionCommand::handleGeneralDelete()
return;
if (startNode == m_downstreamEnd.node()) {
- // The selection to delete is all in one node.
- if (!startNode->renderer() || (startOffset == 0 && m_downstreamEnd.atLastEditingPositionForNode())) {
- // just delete
- removeNode(startNode);
- } else if (m_downstreamEnd.deprecatedEditingOffset() - startOffset > 0) {
+ if (m_downstreamEnd.deprecatedEditingOffset() - startOffset > 0) {
if (startNode->isTextNode()) {
// in a text node that needs to be trimmed
Text* text = static_cast<Text*>(startNode);
@@ -457,6 +453,10 @@ void DeleteSelectionCommand::handleGeneralDelete()
m_endingPosition = m_upstreamStart;
}
}
+
+ // The selection to delete is all in one node.
+ if (!startNode->renderer() || (!startOffset && m_downstreamEnd.atLastEditingPositionForNode()))
+ removeNode(startNode);
}
else {
bool startNodeWasDescendantOfEndNode = m_upstreamStart.node()->isDescendantOf(m_downstreamEnd.node());
@@ -472,6 +472,9 @@ void DeleteSelectionCommand::handleGeneralDelete()
} else {
node = startNode->childNode(startOffset);
}
+ } else if (startNode == m_upstreamEnd.node() && startNode->isTextNode()) {
+ Text* text = static_cast<Text*>(m_upstreamEnd.node());
+ deleteTextFromNode(text, 0, m_upstreamEnd.deprecatedEditingOffset());
}
// handle deleting all nodes that are completely selected
diff --git a/WebCore/editing/EditingBehavior.h b/WebCore/editing/EditingBehavior.h
index d442ad6..842d3f2 100644
--- a/WebCore/editing/EditingBehavior.h
+++ b/WebCore/editing/EditingBehavior.h
@@ -53,6 +53,10 @@ public:
// style has to be present throughout the selection.
bool shouldToggleStyleBasedOnStartOfSelection() const { return m_type == EditingMacBehavior; }
+ // Standard Mac behavior when extending to a boundary is grow the selection rather than leaving the base
+ // in place and moving the extent. Matches NSTextView.
+ bool shouldAlwaysGrowSelectionWhenExtendingToBoundary() const { return m_type == EditingMacBehavior; }
+
private:
EditingBehaviorType m_type;
};
diff --git a/WebCore/editing/Editor.cpp b/WebCore/editing/Editor.cpp
index 24c1680..b267637 100644
--- a/WebCore/editing/Editor.cpp
+++ b/WebCore/editing/Editor.cpp
@@ -862,9 +862,9 @@ static const int textOnlyProperties[] = {
CSSPropertyColor,
};
-static TriState triStateOfStyleInComputedStyle(CSSStyleDeclaration* desiredStyle, CSSComputedStyleDeclaration* computedStyle, bool ignoreTextOnlyProperties = false)
+static TriState triStateOfStyle(CSSStyleDeclaration* desiredStyle, CSSStyleDeclaration* styleToCompare, bool ignoreTextOnlyProperties = false)
{
- RefPtr<CSSMutableStyleDeclaration> diff = getPropertiesNotInComputedStyle(desiredStyle, computedStyle);
+ RefPtr<CSSMutableStyleDeclaration> diff = getPropertiesNotIn(desiredStyle, styleToCompare);
if (ignoreTextOnlyProperties)
diff->removePropertiesInSet(textOnlyProperties, sizeof(textOnlyProperties) / sizeof(textOnlyProperties[0]));
@@ -878,17 +878,11 @@ static TriState triStateOfStyleInComputedStyle(CSSStyleDeclaration* desiredStyle
bool Editor::selectionStartHasStyle(CSSStyleDeclaration* style) const
{
- Node* nodeToRemove;
- RefPtr<CSSComputedStyleDeclaration> selectionStyle = selectionComputedStyle(nodeToRemove);
+ bool shouldUseFixedFontDefaultSize;
+ RefPtr<CSSMutableStyleDeclaration> selectionStyle = selectionComputedStyle(shouldUseFixedFontDefaultSize);
if (!selectionStyle)
return false;
- TriState state = triStateOfStyleInComputedStyle(style, selectionStyle.get());
- if (nodeToRemove) {
- ExceptionCode ec = 0;
- nodeToRemove->remove(ec);
- ASSERT(!ec);
- }
- return state == TrueTriState;
+ return triStateOfStyle(style, selectionStyle.get()) == TrueTriState;
}
TriState Editor::selectionHasStyle(CSSStyleDeclaration* style) const
@@ -896,21 +890,16 @@ TriState Editor::selectionHasStyle(CSSStyleDeclaration* style) const
TriState state = FalseTriState;
if (!m_frame->selection()->isRange()) {
- Node* nodeToRemove;
- RefPtr<CSSComputedStyleDeclaration> selectionStyle = selectionComputedStyle(nodeToRemove);
+ bool shouldUseFixedFontDefaultSize;
+ RefPtr<CSSMutableStyleDeclaration> selectionStyle = selectionComputedStyle(shouldUseFixedFontDefaultSize);
if (!selectionStyle)
return FalseTriState;
- state = triStateOfStyleInComputedStyle(style, selectionStyle.get());
- if (nodeToRemove) {
- ExceptionCode ec = 0;
- nodeToRemove->remove(ec);
- ASSERT(!ec);
- }
+ state = triStateOfStyle(style, selectionStyle.get());
} else {
for (Node* node = m_frame->selection()->start().node(); node; node = node->traverseNextNode()) {
RefPtr<CSSComputedStyleDeclaration> nodeStyle = computedStyle(node);
if (nodeStyle) {
- TriState nodeState = triStateOfStyleInComputedStyle(style, nodeStyle.get(), !node->isTextNode());
+ TriState nodeState = triStateOfStyle(style, nodeStyle.get(), !node->isTextNode());
if (node == m_frame->selection()->start().node())
state = nodeState;
else if (state != nodeState && node->isTextNode()) {
@@ -944,8 +933,8 @@ static bool hasTransparentBackgroundColor(CSSStyleDeclaration* style)
String Editor::selectionStartCSSPropertyValue(int propertyID)
{
- Node* nodeToRemove;
- RefPtr<CSSComputedStyleDeclaration> selectionStyle = selectionComputedStyle(nodeToRemove);
+ bool shouldUseFixedFontDefaultSize = false;
+ RefPtr<CSSMutableStyleDeclaration> selectionStyle = selectionComputedStyle(shouldUseFixedFontDefaultSize);
if (!selectionStyle)
return String();
@@ -958,7 +947,7 @@ String Editor::selectionStartCSSPropertyValue(int propertyID)
RefPtr<Range> range(m_frame->selection()->toNormalizedRange());
ExceptionCode ec = 0;
for (Node* ancestor = range->commonAncestorContainer(ec); ancestor; ancestor = ancestor->parentNode()) {
- selectionStyle = computedStyle(ancestor);
+ selectionStyle = computedStyle(ancestor)->copy();
if (!hasTransparentBackgroundColor(selectionStyle.get())) {
value = selectionStyle->getPropertyValue(CSSPropertyBackgroundColor);
break;
@@ -970,16 +959,10 @@ String Editor::selectionStartCSSPropertyValue(int propertyID)
RefPtr<CSSValue> cssValue = selectionStyle->getPropertyCSSValue(CSSPropertyFontSize);
ASSERT(cssValue->isPrimitiveValue());
int fontPixelSize = static_cast<CSSPrimitiveValue*>(cssValue.get())->getIntValue(CSSPrimitiveValue::CSS_PX);
- int size = CSSStyleSelector::legacyFontSize(m_frame->document(), fontPixelSize, selectionStyle->useFixedFontDefaultSize());
+ int size = CSSStyleSelector::legacyFontSize(m_frame->document(), fontPixelSize, shouldUseFixedFontDefaultSize);
value = String::number(size);
}
- if (nodeToRemove) {
- ExceptionCode ec = 0;
- nodeToRemove->remove(ec);
- ASSERT(!ec);
- }
-
return value;
}
@@ -1027,7 +1010,8 @@ void Editor::appliedEditing(PassRefPtr<EditCommand> cmd)
if (client())
client()->registerCommandForUndo(m_lastEditCommand);
}
- respondToChangedContents(newSelection);
+ respondToChangedContents(newSelection);
+ stopCorrectionPanelTimer();
}
void Editor::unappliedEditing(PassRefPtr<EditCommand> cmd)
@@ -2675,6 +2659,10 @@ void Editor::markAllMisspellingsAndBadGrammarInRanges(TextCheckingOptions textCh
|| result->type == TextCheckingTypeCorrection)) {
// In this case the result range just has to touch the spelling range, so we can handle replacing non-word text such as punctuation.
ASSERT(resultLength > 0 && resultLocation >= 0);
+
+ if (shouldShowCorrectionPanel && resultLocation + resultLength < spellingRangeEndOffset)
+ continue;
+
int replacementLength = result->replacement.length();
bool doReplacement = (replacementLength > 0);
RefPtr<Range> rangeToReplace = TextIterator::subrange(paragraphRange.get(), resultLocation, resultLength);
@@ -2728,7 +2716,7 @@ void Editor::markAllMisspellingsAndBadGrammarInRanges(TextCheckingOptions textCh
if (shouldShowCorrectionPanel && resultLocation + resultLength == spellingRangeEndOffset && result->type == TextCheckingTypeCorrection) {
// We only show the correction panel on the last word.
Vector<FloatQuad> textQuads;
- rangeToReplace->textQuads(textQuads);
+ rangeToReplace->getBorderAndTextQuads(textQuads);
Vector<FloatQuad>::const_iterator end = textQuads.end();
FloatRect totalBoundingBox;
for (Vector<FloatQuad>::const_iterator it = textQuads.begin(); it < end; ++it)
@@ -2753,6 +2741,7 @@ void Editor::markAllMisspellingsAndBadGrammarInRanges(TextCheckingOptions textCh
// Add a marker so that corrections can easily be undone and won't be re-corrected.
RefPtr<Range> replacedRange = TextIterator::subrange(paragraphRange.get(), resultLocation, replacementLength);
replacedRange->startContainer()->document()->markers()->addMarker(replacedRange.get(), DocumentMarker::Replacement, replacedString);
+ replacedRange->startContainer()->document()->markers()->addMarker(replacedRange.get(), DocumentMarker::CorrectionIndicator);
}
}
}
@@ -2844,6 +2833,13 @@ void Editor::startCorrectionPanelTimer()
#endif
}
+void Editor::stopCorrectionPanelTimer()
+{
+#if PLATFORM(MAC) && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
+ m_correctionPanelTimer.stop();
+#endif
+}
+
void Editor::handleCancelOperation()
{
#if PLATFORM(MAC) && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
@@ -3127,6 +3123,13 @@ void Editor::changeSelectionAfterCommand(const VisibleSelection& newSelection, b
if (newSelection.start().isOrphan() || newSelection.end().isOrphan())
return;
+#if PLATFORM(MAC) && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
+ // Check to see if the command introduced paragraph separator. If it did, we remove existing autocorrection underlines.
+ // This is in consistency with the behavior in AppKit
+ if (!inSameParagraph(m_frame->selection()->selection().visibleStart(), newSelection.visibleEnd()))
+ m_frame->document()->markers()->removeMarkers(DocumentMarker::CorrectionIndicator);
+#endif
+
// If there is no selection change, don't bother sending shouldChangeSelection, but still call setSelection,
// because there is work that it must do in this situation.
// The old selection can be invalid here and calling shouldChangeSelection can produce some strange calls.
@@ -3246,10 +3249,8 @@ void Editor::computeAndSetTypingStyle(CSSStyleDeclaration* style, EditAction edi
m_frame->selection()->setTypingStyle(mutableStyle.release());
}
-PassRefPtr<CSSComputedStyleDeclaration> Editor::selectionComputedStyle(Node*& nodeToRemove) const
+PassRefPtr<CSSMutableStyleDeclaration> Editor::selectionComputedStyle(bool& shouldUseFixedFontDefaultSize) const
{
- nodeToRemove = 0;
-
if (m_frame->selection()->isNone())
return 0;
@@ -3269,34 +3270,19 @@ PassRefPtr<CSSComputedStyleDeclaration> Editor::selectionComputedStyle(Node*& no
return 0;
RefPtr<Element> styleElement = element;
- ExceptionCode ec = 0;
+ RefPtr<CSSComputedStyleDeclaration> style = computedStyle(styleElement.release());
+ RefPtr<CSSMutableStyleDeclaration> mutableStyle = style->copy();
+ shouldUseFixedFontDefaultSize = style->useFixedFontDefaultSize();
- if (m_frame->selection()->typingStyle()) {
- styleElement = m_frame->document()->createElement(spanTag, false);
-
- styleElement->setAttribute(styleAttr, m_frame->selection()->typingStyle()->cssText(), ec);
- ASSERT(!ec);
-
- styleElement->appendChild(m_frame->document()->createEditingTextNode(""), ec);
- ASSERT(!ec);
-
- if (element->renderer() && element->renderer()->canHaveChildren())
- element->appendChild(styleElement, ec);
- else {
- Node* parent = element->parent();
- Node* next = element->nextSibling();
-
- if (next)
- parent->insertBefore(styleElement, next, ec);
- else
- parent->appendChild(styleElement, ec);
- }
- ASSERT(!ec);
+ if (!m_frame->selection()->typingStyle())
+ return mutableStyle;
- nodeToRemove = styleElement.get();
- }
+ RefPtr<CSSMutableStyleDeclaration> typingStyle = m_frame->selection()->typingStyle()->copy();
+ ApplyStyleCommand::removeNonEditingProperties(typingStyle.get());
+ prepareEditingStyleToApplyAt(typingStyle.get(), position);
+ mutableStyle->merge(typingStyle.get());
- return computedStyle(styleElement.release());
+ return mutableStyle;
}
void Editor::textFieldDidBeginEditing(Element* e)
diff --git a/WebCore/editing/Editor.h b/WebCore/editing/Editor.h
index 7a4a185..f167b16 100644
--- a/WebCore/editing/Editor.h
+++ b/WebCore/editing/Editor.h
@@ -347,7 +347,7 @@ public:
bool markedTextMatchesAreHighlighted() const;
void setMarkedTextMatchesAreHighlighted(bool);
- PassRefPtr<CSSComputedStyleDeclaration> selectionComputedStyle(Node*& nodeToRemove) const;
+ PassRefPtr<CSSMutableStyleDeclaration> selectionComputedStyle(bool& shouldUseFixedFontDefaultSize) const;
void textFieldDidBeginEditing(Element*);
void textFieldDidEndEditing(Element*);
@@ -402,6 +402,7 @@ private:
void changeSelectionAfterCommand(const VisibleSelection& newSelection, bool closeTyping, bool clearTypingStyle);
void correctionPanelTimerFired(Timer<Editor>*);
Node* findEventTargetFromSelection() const;
+ void stopCorrectionPanelTimer();
};
inline void Editor::setStartNewKillRingSequence(bool flag)
diff --git a/WebCore/editing/EditorCommand.cpp b/WebCore/editing/EditorCommand.cpp
index 1b1f14f..616c07b 100644
--- a/WebCore/editing/EditorCommand.cpp
+++ b/WebCore/editing/EditorCommand.cpp
@@ -131,8 +131,8 @@ static bool executeApplyStyle(Frame* frame, EditorCommandSource source, EditActi
static bool executeToggleStyleInList(Frame* frame, EditorCommandSource source, EditAction action, int propertyID, CSSValue* value)
{
ExceptionCode ec = 0;
- Node* nodeToRemove = 0;
- RefPtr<CSSComputedStyleDeclaration> selectionStyle = frame->editor()->selectionComputedStyle(nodeToRemove);
+ bool shouldUseFixedFontDefaultSize;
+ RefPtr<CSSMutableStyleDeclaration> selectionStyle = frame->editor()->selectionComputedStyle(shouldUseFixedFontDefaultSize);
if (!selectionStyle)
return false;
@@ -148,12 +148,6 @@ static bool executeToggleStyleInList(Frame* frame, EditorCommandSource source, E
} else if (selectedCSSValue->cssText() == "none")
newStyle = value->cssText();
- ASSERT(!ec);
- if (nodeToRemove) {
- nodeToRemove->remove(ec);
- ASSERT(!ec);
- }
-
// FIXME: We shouldn't be having to convert new style into text. We should have setPropertyCSSValue.
RefPtr<CSSMutableStyleDeclaration> newMutableStyle = CSSMutableStyleDeclaration::create();
newMutableStyle->setProperty(propertyID, newStyle, ec);
@@ -166,10 +160,9 @@ static bool executeToggleStyle(Frame* frame, EditorCommandSource source, EditAct
style->setProperty(propertyID, onValue); // We need to add this style to pass it to selectionStartHasStyle / selectionHasStyle
// Style is considered present when
- // mac: present at the beginning of selection
+ // Mac: present at the beginning of selection
// other: present throughout the selection
- // FIXME: Make stateStyle() to use this editing method too for the cases where it's used for queryCommandState.
bool styleIsPresent;
if (frame->editor()->behavior().shouldToggleStyleBasedOnStartOfSelection())
styleIsPresent = frame->editor()->selectionStartHasStyle(style.get());
@@ -237,6 +230,9 @@ static TriState stateStyle(Frame* frame, int propertyID, const char* desiredValu
{
RefPtr<CSSMutableStyleDeclaration> style = CSSMutableStyleDeclaration::create();
style->setProperty(propertyID, desiredValue);
+
+ if (frame->editor()->behavior().shouldToggleStyleBasedOnStartOfSelection())
+ return frame->editor()->selectionStartHasStyle(style.get()) ? TrueTriState : FalseTriState;
return frame->editor()->selectionHasStyle(style.get());
}
@@ -1303,6 +1299,21 @@ static TriState stateUnorderedList(Frame* frame, Event*)
return frame->editor()->selectionUnorderedListState();
}
+static TriState stateJustifyCenter(Frame* frame, Event*)
+{
+ return stateStyle(frame, CSSPropertyTextAlign, "center");
+}
+
+static TriState stateJustifyLeft(Frame* frame, Event*)
+{
+ return stateStyle(frame, CSSPropertyTextAlign, "left");
+}
+
+static TriState stateJustifyRight(Frame* frame, Event*)
+{
+ return stateStyle(frame, CSSPropertyTextAlign, "right");
+}
+
// Value functions
static String valueNull(Frame*, Event*)
@@ -1389,20 +1400,20 @@ static const CommandMap& createCommandMap()
{ "InsertText", { executeInsertText, supported, enabledInEditableText, stateNone, valueNull, isTextInsertion, doNotAllowExecutionWhenDisabled } },
{ "InsertUnorderedList", { executeInsertUnorderedList, supported, enabledInRichlyEditableText, stateUnorderedList, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
{ "Italic", { executeToggleItalic, supported, enabledInRichlyEditableText, stateItalic, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
- { "JustifyCenter", { executeJustifyCenter, supported, enabledInRichlyEditableText, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
+ { "JustifyCenter", { executeJustifyCenter, supported, enabledInRichlyEditableText, stateJustifyCenter, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
{ "JustifyFull", { executeJustifyFull, supported, enabledInRichlyEditableText, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
- { "JustifyLeft", { executeJustifyLeft, supported, enabledInRichlyEditableText, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
+ { "JustifyLeft", { executeJustifyLeft, supported, enabledInRichlyEditableText, stateJustifyLeft, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
{ "JustifyNone", { executeJustifyLeft, supported, enabledInRichlyEditableText, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
- { "JustifyRight", { executeJustifyRight, supported, enabledInRichlyEditableText, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
+ { "JustifyRight", { executeJustifyRight, supported, enabledInRichlyEditableText, stateJustifyRight, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
{ "MakeTextWritingDirectionLeftToRight", { executeMakeTextWritingDirectionLeftToRight, supportedFromMenuOrKeyBinding, enabledInRichlyEditableText, stateTextWritingDirectionLeftToRight, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
{ "MakeTextWritingDirectionNatural", { executeMakeTextWritingDirectionNatural, supportedFromMenuOrKeyBinding, enabledInRichlyEditableText, stateTextWritingDirectionNatural, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
{ "MakeTextWritingDirectionRightToLeft", { executeMakeTextWritingDirectionRightToLeft, supportedFromMenuOrKeyBinding, enabledInRichlyEditableText, stateTextWritingDirectionRightToLeft, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
- { "MoveBackward", { executeMoveBackward, supportedFromMenuOrKeyBinding, enabledInEditableText, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
- { "MoveBackwardAndModifySelection", { executeMoveBackwardAndModifySelection, supportedFromMenuOrKeyBinding, enabledVisibleSelection, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
+ { "MoveBackward", { executeMoveBackward, supportedFromMenuOrKeyBinding, enabledInEditableTextOrCaretBrowsing, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
+ { "MoveBackwardAndModifySelection", { executeMoveBackwardAndModifySelection, supportedFromMenuOrKeyBinding, enabledVisibleSelectionOrCaretBrowsing, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
{ "MoveDown", { executeMoveDown, supportedFromMenuOrKeyBinding, enabledInEditableTextOrCaretBrowsing, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
{ "MoveDownAndModifySelection", { executeMoveDownAndModifySelection, supportedFromMenuOrKeyBinding, enabledVisibleSelectionOrCaretBrowsing, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
- { "MoveForward", { executeMoveForward, supportedFromMenuOrKeyBinding, enabledInEditableText, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
- { "MoveForwardAndModifySelection", { executeMoveForwardAndModifySelection, supportedFromMenuOrKeyBinding, enabledVisibleSelection, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
+ { "MoveForward", { executeMoveForward, supportedFromMenuOrKeyBinding, enabledInEditableTextOrCaretBrowsing, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
+ { "MoveForwardAndModifySelection", { executeMoveForwardAndModifySelection, supportedFromMenuOrKeyBinding, enabledVisibleSelectionOrCaretBrowsing, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
{ "MoveLeft", { executeMoveLeft, supportedFromMenuOrKeyBinding, enabledInEditableTextOrCaretBrowsing, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
{ "MoveLeftAndModifySelection", { executeMoveLeftAndModifySelection, supportedFromMenuOrKeyBinding, enabledVisibleSelectionOrCaretBrowsing, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
{ "MovePageDown", { executeMovePageDown, supportedFromMenuOrKeyBinding, enabledInEditableText, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
@@ -1415,30 +1426,30 @@ static const CommandMap& createCommandMap()
{ "MoveRightAndModifySelection", { executeMoveRightAndModifySelection, supportedFromMenuOrKeyBinding, enabledVisibleSelectionOrCaretBrowsing, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
{ "MoveToBeginningOfDocument", { executeMoveToBeginningOfDocument, supportedFromMenuOrKeyBinding, enabledInEditableText, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
{ "MoveToBeginningOfDocumentAndModifySelection", { executeMoveToBeginningOfDocumentAndModifySelection, supportedFromMenuOrKeyBinding, enabledVisibleSelection, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
- { "MoveToBeginningOfLine", { executeMoveToBeginningOfLine, supportedFromMenuOrKeyBinding, enabledInEditableText, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
- { "MoveToBeginningOfLineAndModifySelection", { executeMoveToBeginningOfLineAndModifySelection, supportedFromMenuOrKeyBinding, enabledVisibleSelection, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
- { "MoveToBeginningOfParagraph", { executeMoveToBeginningOfParagraph, supportedFromMenuOrKeyBinding, enabledInEditableText, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
- { "MoveToBeginningOfParagraphAndModifySelection", { executeMoveToBeginningOfParagraphAndModifySelection, supportedFromMenuOrKeyBinding, enabledVisibleSelection, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
- { "MoveToBeginningOfSentence", { executeMoveToBeginningOfSentence, supportedFromMenuOrKeyBinding, enabledInEditableText, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
- { "MoveToBeginningOfSentenceAndModifySelection", { executeMoveToBeginningOfSentenceAndModifySelection, supportedFromMenuOrKeyBinding, enabledVisibleSelection, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
+ { "MoveToBeginningOfLine", { executeMoveToBeginningOfLine, supportedFromMenuOrKeyBinding, enabledInEditableTextOrCaretBrowsing, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
+ { "MoveToBeginningOfLineAndModifySelection", { executeMoveToBeginningOfLineAndModifySelection, supportedFromMenuOrKeyBinding, enabledVisibleSelectionOrCaretBrowsing, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
+ { "MoveToBeginningOfParagraph", { executeMoveToBeginningOfParagraph, supportedFromMenuOrKeyBinding, enabledInEditableTextOrCaretBrowsing, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
+ { "MoveToBeginningOfParagraphAndModifySelection", { executeMoveToBeginningOfParagraphAndModifySelection, supportedFromMenuOrKeyBinding, enabledVisibleSelectionOrCaretBrowsing, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
+ { "MoveToBeginningOfSentence", { executeMoveToBeginningOfSentence, supportedFromMenuOrKeyBinding, enabledInEditableTextOrCaretBrowsing, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
+ { "MoveToBeginningOfSentenceAndModifySelection", { executeMoveToBeginningOfSentenceAndModifySelection, supportedFromMenuOrKeyBinding, enabledVisibleSelectionOrCaretBrowsing, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
{ "MoveToEndOfDocument", { executeMoveToEndOfDocument, supportedFromMenuOrKeyBinding, enabledInEditableText, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
{ "MoveToEndOfDocumentAndModifySelection", { executeMoveToEndOfDocumentAndModifySelection, supportedFromMenuOrKeyBinding, enabledVisibleSelection, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
- { "MoveToEndOfLine", { executeMoveToEndOfLine, supportedFromMenuOrKeyBinding, enabledInEditableText, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
- { "MoveToEndOfLineAndModifySelection", { executeMoveToEndOfLineAndModifySelection, supportedFromMenuOrKeyBinding, enabledVisibleSelection, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
- { "MoveToEndOfParagraph", { executeMoveToEndOfParagraph, supportedFromMenuOrKeyBinding, enabledInEditableText, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
- { "MoveToEndOfParagraphAndModifySelection", { executeMoveToEndOfParagraphAndModifySelection, supportedFromMenuOrKeyBinding, enabledVisibleSelection, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
- { "MoveToEndOfSentence", { executeMoveToEndOfSentence, supportedFromMenuOrKeyBinding, enabledInEditableText, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
- { "MoveToEndOfSentenceAndModifySelection", { executeMoveToEndOfSentenceAndModifySelection, supportedFromMenuOrKeyBinding, enabledVisibleSelection, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
+ { "MoveToEndOfLine", { executeMoveToEndOfLine, supportedFromMenuOrKeyBinding, enabledInEditableTextOrCaretBrowsing, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
+ { "MoveToEndOfLineAndModifySelection", { executeMoveToEndOfLineAndModifySelection, supportedFromMenuOrKeyBinding, enabledVisibleSelectionOrCaretBrowsing, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
+ { "MoveToEndOfParagraph", { executeMoveToEndOfParagraph, supportedFromMenuOrKeyBinding, enabledInEditableTextOrCaretBrowsing, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
+ { "MoveToEndOfParagraphAndModifySelection", { executeMoveToEndOfParagraphAndModifySelection, supportedFromMenuOrKeyBinding, enabledVisibleSelectionOrCaretBrowsing, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
+ { "MoveToEndOfSentence", { executeMoveToEndOfSentence, supportedFromMenuOrKeyBinding, enabledInEditableTextOrCaretBrowsing, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
+ { "MoveToEndOfSentenceAndModifySelection", { executeMoveToEndOfSentenceAndModifySelection, supportedFromMenuOrKeyBinding, enabledVisibleSelectionOrCaretBrowsing, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
{ "MoveToLeftEndOfLine", { executeMoveToLeftEndOfLine, supportedFromMenuOrKeyBinding, enabledInEditableText, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
{ "MoveToLeftEndOfLineAndModifySelection", { executeMoveToLeftEndOfLineAndModifySelection, supportedFromMenuOrKeyBinding, enabledInEditableText, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
{ "MoveToRightEndOfLine", { executeMoveToRightEndOfLine, supportedFromMenuOrKeyBinding, enabledInEditableText, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
{ "MoveToRightEndOfLineAndModifySelection", { executeMoveToRightEndOfLineAndModifySelection, supportedFromMenuOrKeyBinding, enabledInEditableText, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
{ "MoveUp", { executeMoveUp, supportedFromMenuOrKeyBinding, enabledInEditableTextOrCaretBrowsing, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
{ "MoveUpAndModifySelection", { executeMoveUpAndModifySelection, supportedFromMenuOrKeyBinding, enabledVisibleSelectionOrCaretBrowsing, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
- { "MoveWordBackward", { executeMoveWordBackward, supportedFromMenuOrKeyBinding, enabledInEditableText, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
- { "MoveWordBackwardAndModifySelection", { executeMoveWordBackwardAndModifySelection, supportedFromMenuOrKeyBinding, enabledVisibleSelection, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
- { "MoveWordForward", { executeMoveWordForward, supportedFromMenuOrKeyBinding, enabledInEditableText, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
- { "MoveWordForwardAndModifySelection", { executeMoveWordForwardAndModifySelection, supportedFromMenuOrKeyBinding, enabledVisibleSelection, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
+ { "MoveWordBackward", { executeMoveWordBackward, supportedFromMenuOrKeyBinding, enabledInEditableTextOrCaretBrowsing, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
+ { "MoveWordBackwardAndModifySelection", { executeMoveWordBackwardAndModifySelection, supportedFromMenuOrKeyBinding, enabledVisibleSelectionOrCaretBrowsing, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
+ { "MoveWordForward", { executeMoveWordForward, supportedFromMenuOrKeyBinding, enabledInEditableTextOrCaretBrowsing, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
+ { "MoveWordForwardAndModifySelection", { executeMoveWordForwardAndModifySelection, supportedFromMenuOrKeyBinding, enabledVisibleSelectionOrCaretBrowsing, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
{ "MoveWordLeft", { executeMoveWordLeft, supportedFromMenuOrKeyBinding, enabledInEditableTextOrCaretBrowsing, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
{ "MoveWordLeftAndModifySelection", { executeMoveWordLeftAndModifySelection, supportedFromMenuOrKeyBinding, enabledVisibleSelectionOrCaretBrowsing, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
{ "MoveWordRight", { executeMoveWordRight, supportedFromMenuOrKeyBinding, enabledInEditableTextOrCaretBrowsing, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
diff --git a/WebCore/editing/FormatBlockCommand.cpp b/WebCore/editing/FormatBlockCommand.cpp
index 221aecf..6bb8ad5 100644
--- a/WebCore/editing/FormatBlockCommand.cpp
+++ b/WebCore/editing/FormatBlockCommand.cpp
@@ -41,33 +41,6 @@ FormatBlockCommand::FormatBlockCommand(Document* document, const AtomicString& t
{
}
-bool FormatBlockCommand::modifyRange()
-{
- ASSERT(endingSelection().isRange());
- VisiblePosition visibleStart = endingSelection().visibleStart();
- VisiblePosition visibleEnd = endingSelection().visibleEnd();
- VisiblePosition startOfLastParagraph = startOfParagraph(visibleEnd);
-
- if (startOfParagraph(visibleStart) == startOfLastParagraph)
- return false;
-
- setEndingSelection(visibleStart);
- doApply();
- visibleStart = endingSelection().visibleStart();
- VisiblePosition nextParagraph = endOfParagraph(visibleStart).next();
- while (nextParagraph.isNotNull() && nextParagraph != startOfLastParagraph) {
- setEndingSelection(nextParagraph);
- doApply();
- nextParagraph = endOfParagraph(endingSelection().visibleStart()).next();
- }
- setEndingSelection(visibleEnd);
- doApply();
- visibleEnd = endingSelection().visibleEnd();
- setEndingSelection(VisibleSelection(visibleStart.deepEquivalent(), visibleEnd.deepEquivalent(), DOWNSTREAM));
-
- return true;
-}
-
void FormatBlockCommand::doApply()
{
if (!endingSelection().isNonOrphanedCaretOrRange())
@@ -86,12 +59,35 @@ void FormatBlockCommand::doApply()
// FIXME: We paint the gap before some paragraphs that are indented with left
// margin/padding, but not others. We should make the gap painting more consistent and
// then use a left margin/padding rule here.
- if (visibleEnd != visibleStart && isStartOfParagraph(visibleEnd))
+ if (visibleEnd != visibleStart && isStartOfParagraph(visibleEnd)) {
setEndingSelection(VisibleSelection(visibleStart, visibleEnd.previous(true)));
+ visibleEnd = endingSelection().visibleEnd();
+ }
- if (endingSelection().isRange() && modifyRange())
+ VisiblePosition startOfLastParagraph = startOfParagraph(visibleEnd);
+ if (endingSelection().isCaret() || startOfParagraph(visibleStart) == startOfLastParagraph) {
+ doApplyForSingleParagraph();
return;
+ }
+
+ setEndingSelection(visibleStart);
+ doApplyForSingleParagraph();
+ visibleStart = endingSelection().visibleStart();
+ VisiblePosition nextParagraph = endOfParagraph(visibleStart).next();
+ while (nextParagraph.isNotNull() && nextParagraph != startOfLastParagraph) {
+ setEndingSelection(nextParagraph);
+ doApplyForSingleParagraph();
+ nextParagraph = endOfParagraph(endingSelection().visibleStart()).next();
+ }
+ setEndingSelection(visibleEnd);
+ doApplyForSingleParagraph();
+ visibleEnd = endingSelection().visibleEnd();
+ setEndingSelection(VisibleSelection(visibleStart.deepEquivalent(), visibleEnd.deepEquivalent(), DOWNSTREAM));
+}
+
+void FormatBlockCommand::doApplyForSingleParagraph()
+{
ExceptionCode ec;
String localName, prefix;
if (!Document::parseQualifiedName(m_tagName, prefix, localName, ec))
@@ -102,14 +98,14 @@ void FormatBlockCommand::doApply()
if (refNode->hasTagName(qTypeOfBlock))
// We're already in a block with the format we want, so we don't have to do anything
return;
-
+
VisiblePosition paragraphStart = startOfParagraph(endingSelection().visibleStart());
VisiblePosition paragraphEnd = endOfParagraph(endingSelection().visibleStart());
VisiblePosition blockStart = startOfBlock(endingSelection().visibleStart());
VisiblePosition blockEnd = endOfBlock(endingSelection().visibleStart());
RefPtr<Element> blockNode = createHTMLElement(document(), m_tagName);
RefPtr<Element> placeholder = createBreakElement(document());
-
+
Node* root = endingSelection().start().node()->rootEditableElement();
if (validBlockTag(refNode->nodeName().lower()) &&
paragraphStart == blockStart && paragraphEnd == blockEnd &&
@@ -122,7 +118,7 @@ void FormatBlockCommand::doApply()
insertNodeAt(blockNode, paragraphStart.deepEquivalent().upstream());
}
appendNode(placeholder, blockNode);
-
+
VisiblePosition destination(Position(placeholder.get(), 0));
if (paragraphStart == paragraphEnd && !lineBreakExistsAtVisiblePosition(paragraphStart)) {
setEndingSelection(destination);
diff --git a/WebCore/editing/FormatBlockCommand.h b/WebCore/editing/FormatBlockCommand.h
index 1c8d814..70e6fa6 100644
--- a/WebCore/editing/FormatBlockCommand.h
+++ b/WebCore/editing/FormatBlockCommand.h
@@ -41,9 +41,9 @@ private:
FormatBlockCommand(Document*, const AtomicString& tagName);
virtual void doApply();
+ void doApplyForSingleParagraph();
virtual EditAction editingAction() const { return EditActionFormatBlock; }
- bool modifyRange();
AtomicString m_tagName;
};
diff --git a/WebCore/editing/InsertIntoTextNodeCommand.cpp b/WebCore/editing/InsertIntoTextNodeCommand.cpp
index 9c3423a..9b7761c 100644
--- a/WebCore/editing/InsertIntoTextNodeCommand.cpp
+++ b/WebCore/editing/InsertIntoTextNodeCommand.cpp
@@ -26,6 +26,7 @@
#include "config.h"
#include "InsertIntoTextNodeCommand.h"
+#include "AXObjectCache.h"
#include "Text.h"
namespace WebCore {
@@ -48,6 +49,9 @@ void InsertIntoTextNodeCommand::doApply()
ExceptionCode ec;
m_node->insertData(m_offset, m_text, ec);
+
+ if (AXObjectCache::accessibilityEnabled())
+ document()->axObjectCache()->nodeTextChangeNotification(m_node->renderer(), AXObjectCache::AXTextInserted, m_offset, m_text.length());
}
void InsertIntoTextNodeCommand::doUnapply()
@@ -55,6 +59,10 @@ void InsertIntoTextNodeCommand::doUnapply()
if (!m_node->isContentEditable())
return;
+ // Need to notify this before actually deleting the text
+ if (AXObjectCache::accessibilityEnabled())
+ document()->axObjectCache()->nodeTextChangeNotification(m_node->renderer(), AXObjectCache::AXTextDeleted, m_offset, m_text.length());
+
ExceptionCode ec;
m_node->deleteData(m_offset, m_text.length(), ec);
}
diff --git a/WebCore/editing/InsertNodeBeforeCommand.cpp b/WebCore/editing/InsertNodeBeforeCommand.cpp
index 2ce9846..fb72312 100644
--- a/WebCore/editing/InsertNodeBeforeCommand.cpp
+++ b/WebCore/editing/InsertNodeBeforeCommand.cpp
@@ -26,6 +26,7 @@
#include "config.h"
#include "InsertNodeBeforeCommand.h"
+#include "AXObjectCache.h"
#include "htmlediting.h"
namespace WebCore {
@@ -51,6 +52,9 @@ void InsertNodeBeforeCommand::doApply()
ExceptionCode ec;
parent->insertBefore(m_insertChild.get(), m_refChild.get(), ec);
+
+ if (AXObjectCache::accessibilityEnabled())
+ document()->axObjectCache()->nodeTextChangeNotification(m_insertChild->renderer(), AXObjectCache::AXTextInserted, 0, m_insertChild->nodeValue().length());
}
void InsertNodeBeforeCommand::doUnapply()
@@ -58,6 +62,10 @@ void InsertNodeBeforeCommand::doUnapply()
if (!m_insertChild->isContentEditable())
return;
+ // Need to notify this before actually deleting the text
+ if (AXObjectCache::accessibilityEnabled())
+ document()->axObjectCache()->nodeTextChangeNotification(m_insertChild->renderer(), AXObjectCache::AXTextDeleted, 0, m_insertChild->nodeValue().length());
+
ExceptionCode ec;
m_insertChild->remove(ec);
}
diff --git a/WebCore/editing/SelectionController.cpp b/WebCore/editing/SelectionController.cpp
index c04fe25..c9295d3 100644
--- a/WebCore/editing/SelectionController.cpp
+++ b/WebCore/editing/SelectionController.cpp
@@ -622,24 +622,18 @@ VisiblePosition SelectionController::modifyMovingBackward(TextGranularity granul
return pos;
}
-bool SelectionController::modify(EAlteration alter, EDirection dir, TextGranularity granularity, bool userTriggered)
-{
- Settings* settings = m_frame ? m_frame->settings() : 0;
- return modify(alter, dir, granularity, userTriggered, settings);
-}
-
static bool isBoundary(TextGranularity granularity)
{
return granularity == LineBoundary || granularity == ParagraphBoundary || granularity == DocumentBoundary;
}
-bool SelectionController::modify(EAlteration alter, EDirection direction, TextGranularity granularity, bool userTriggered, Settings* settings)
+bool SelectionController::modify(EAlteration alter, EDirection direction, TextGranularity granularity, bool userTriggered)
{
if (userTriggered) {
SelectionController trialSelectionController;
trialSelectionController.setSelection(m_selection);
trialSelectionController.setIsDirectional(m_isDirectional);
- trialSelectionController.modify(alter, direction, granularity, false, settings);
+ trialSelectionController.modify(alter, direction, granularity, false);
bool change = shouldChangeSelection(trialSelectionController.selection());
if (!change)
@@ -690,16 +684,17 @@ bool SelectionController::modify(EAlteration alter, EDirection direction, TextGr
moveTo(position, userTriggered);
break;
case AlterationExtend:
- if (!settings || settings->editingBehaviorType() != EditingMacBehavior || m_selection.isCaret() || !isBoundary(granularity))
+ // Standard Mac behavior when extending to a boundary is grow the selection rather than leaving the
+ // base in place and moving the extent. Matches NSTextView.
+ if (!m_frame || !m_frame->editor()->behavior().shouldAlwaysGrowSelectionWhenExtendingToBoundary() || m_selection.isCaret() || !isBoundary(granularity))
setExtent(position, userTriggered);
else {
- // Standard Mac behavior when extending to a boundary is grow the selection rather
- // than leaving the base in place and moving the extent. Matches NSTextView.
if (direction == DirectionForward || direction == DirectionRight)
setEnd(position, userTriggered);
else
setStart(position, userTriggered);
}
+ break;
}
if (granularity == LineGranularity || granularity == ParagraphGranularity)
diff --git a/WebCore/editing/SelectionController.h b/WebCore/editing/SelectionController.h
index 90018cd..e5fe71b 100644
--- a/WebCore/editing/SelectionController.h
+++ b/WebCore/editing/SelectionController.h
@@ -181,8 +181,6 @@ private:
VisiblePosition startForPlatform() const;
VisiblePosition endForPlatform() const;
- bool modify(EAlteration, EDirection, TextGranularity, bool userTriggered, Settings*);
-
VisiblePosition modifyExtendingRight(TextGranularity);
VisiblePosition modifyExtendingForward(TextGranularity);
VisiblePosition modifyMovingRight(TextGranularity);
@@ -249,7 +247,7 @@ inline void SelectionController::setTypingStyle(PassRefPtr<CSSMutableStyleDeclar
m_typingStyle = style;
}
-#if !(PLATFORM(MAC) || PLATFORM(GTK))
+#if !(PLATFORM(MAC) || PLATFORM(GTK) || PLATFORM(CHROMIUM))
inline void SelectionController::notifyAccessibilityForSelectionChange()
{
}
diff --git a/WebCore/editing/TextIterator.cpp b/WebCore/editing/TextIterator.cpp
index d5a03ef..0612986 100644
--- a/WebCore/editing/TextIterator.cpp
+++ b/WebCore/editing/TextIterator.cpp
@@ -782,7 +782,7 @@ static bool shouldEmitExtraNewlineForNode(Node* node)
|| node->hasTagName(pTag)) {
RenderStyle* style = r->style();
if (style) {
- int bottomMargin = toRenderBox(r)->collapsedMarginBottom();
+ int bottomMargin = toRenderBox(r)->collapsedMarginAfter();
int fontSize = style->fontDescription().computedPixelSize();
if (bottomMargin * 2 >= fontSize)
return true;
@@ -1534,7 +1534,7 @@ const UChar* WordAwareIterator::characters() const
// --------
-static inline UChar foldQuoteMark(UChar c)
+static inline UChar foldQuoteMarkOrSoftHyphen(UChar c)
{
switch (c) {
case hebrewPunctuationGershayim:
@@ -1545,12 +1545,16 @@ static inline UChar foldQuoteMark(UChar c)
case leftSingleQuotationMark:
case rightSingleQuotationMark:
return '\'';
+ case softHyphen:
+ // Replace soft hyphen with an ignorable character so that their presence or absence will
+ // not affect string comparison.
+ return 0;
default:
return c;
}
}
-static inline void foldQuoteMarks(String& s)
+static inline void foldQuoteMarksAndSoftHyphens(String& s)
{
s.replace(hebrewPunctuationGeresh, '\'');
s.replace(hebrewPunctuationGershayim, '"');
@@ -1558,14 +1562,17 @@ static inline void foldQuoteMarks(String& s)
s.replace(leftSingleQuotationMark, '\'');
s.replace(rightDoubleQuotationMark, '"');
s.replace(rightSingleQuotationMark, '\'');
+ // Replace soft hyphen with an ignorable character so that their presence or absence will
+ // not affect string comparison.
+ s.replace(softHyphen, 0);
}
#if USE(ICU_UNICODE) && !UCONFIG_NO_COLLATION
-static inline void foldQuoteMarks(UChar* data, size_t length)
+static inline void foldQuoteMarksAndSoftHyphens(UChar* data, size_t length)
{
for (size_t i = 0; i < length; ++i)
- data[i] = foldQuoteMark(data[i]);
+ data[i] = foldQuoteMarkOrSoftHyphen(data[i]);
}
static const size_t minimumSearchBufferSize = 8192;
@@ -1819,7 +1826,7 @@ inline SearchBuffer::SearchBuffer(const String& target, bool isCaseSensitive)
// FIXME: We'd like to tailor the searcher to fold quote marks for us instead
// of doing it in a separate replacement pass here, but ICU doesn't offer a way
// to add tailoring on top of the locale-specific tailoring as of this writing.
- foldQuoteMarks(m_target);
+ foldQuoteMarksAndSoftHyphens(m_target);
size_t targetLength = m_target.length();
m_buffer.reserveInitialCapacity(max(targetLength * 8, minimumSearchBufferSize));
@@ -1869,7 +1876,7 @@ inline size_t SearchBuffer::append(const UChar* characters, size_t length)
size_t usableLength = min(m_buffer.capacity() - oldLength, length);
ASSERT(usableLength);
m_buffer.append(characters, usableLength);
- foldQuoteMarks(m_buffer.data() + oldLength, usableLength);
+ foldQuoteMarksAndSoftHyphens(m_buffer.data() + oldLength, usableLength);
return usableLength;
}
@@ -2008,7 +2015,7 @@ inline SearchBuffer::SearchBuffer(const String& target, bool isCaseSensitive)
{
ASSERT(!m_target.isEmpty());
m_target.replace(noBreakSpace, ' ');
- foldQuoteMarks(m_target);
+ foldQuoteMarksAndSoftHyphens(m_target);
}
inline SearchBuffer::~SearchBuffer()
@@ -2028,7 +2035,7 @@ inline bool SearchBuffer::atBreak() const
inline void SearchBuffer::append(UChar c, bool isStart)
{
- m_buffer[m_cursor] = c == noBreakSpace ? ' ' : foldQuoteMark(c);
+ m_buffer[m_cursor] = c == noBreakSpace ? ' ' : foldQuoteMarkOrSoftHyphen(c);
m_isCharacterStartBuffer[m_cursor] = isStart;
if (++m_cursor == m_target.length()) {
m_cursor = 0;
diff --git a/WebCore/editing/TypingCommand.cpp b/WebCore/editing/TypingCommand.cpp
index 1d1183a..60b3f7b 100644
--- a/WebCore/editing/TypingCommand.cpp
+++ b/WebCore/editing/TypingCommand.cpp
@@ -283,7 +283,7 @@ EditAction TypingCommand::editingAction() const
return EditActionTyping;
}
-void TypingCommand::markMisspellingsAfterTyping()
+void TypingCommand::markMisspellingsAfterTyping(ETypingCommand commandType)
{
#if PLATFORM(MAC) && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
if (!document()->frame()->editor()->isContinuousSpellCheckingEnabled()
@@ -308,8 +308,10 @@ void TypingCommand::markMisspellingsAfterTyping()
if (p1 != p2)
document()->frame()->editor()->markMisspellingsAfterTypingToPosition(p1);
#if PLATFORM(MAC) && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
- else
+ else if (commandType == TypingCommand::InsertText)
document()->frame()->editor()->startCorrectionPanelTimer();
+#else
+ UNUSED_PARAM(commandType);
#endif
}
}
@@ -317,14 +319,14 @@ void TypingCommand::markMisspellingsAfterTyping()
void TypingCommand::typingAddedToOpenCommand(ETypingCommand commandTypeForAddedTyping)
{
updatePreservesTypingStyle(commandTypeForAddedTyping);
-
+
#if PLATFORM(MAC) && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
document()->frame()->editor()->appliedEditing(this);
// Since the spellchecking code may also perform corrections and other replacements, it should happen after the typing changes.
- markMisspellingsAfterTyping();
+ markMisspellingsAfterTyping(commandTypeForAddedTyping);
#else
// The old spellchecking code requires that checking be done first, to prevent issues like that in 6864072, where <doesn't> is marked as misspelled.
- markMisspellingsAfterTyping();
+ markMisspellingsAfterTyping(commandTypeForAddedTyping);
document()->frame()->editor()->appliedEditing(this);
#endif
}
diff --git a/WebCore/editing/TypingCommand.h b/WebCore/editing/TypingCommand.h
index 7c89a7c..60b5f2a 100644
--- a/WebCore/editing/TypingCommand.h
+++ b/WebCore/editing/TypingCommand.h
@@ -82,10 +82,10 @@ private:
virtual bool preservesTypingStyle() const { return m_preservesTypingStyle; }
void updatePreservesTypingStyle(ETypingCommand);
- void markMisspellingsAfterTyping();
+ void markMisspellingsAfterTyping(ETypingCommand);
void typingAddedToOpenCommand(ETypingCommand);
bool makeEditableRootEmpty();
-
+
ETypingCommand m_commandType;
String m_textToInsert;
bool m_openForMoreTyping;
diff --git a/WebCore/editing/android/EditorAndroid.cpp b/WebCore/editing/android/EditorAndroid.cpp
index 61cce01..29c0be5 100644
--- a/WebCore/editing/android/EditorAndroid.cpp
+++ b/WebCore/editing/android/EditorAndroid.cpp
@@ -33,7 +33,7 @@ namespace WebCore {
PassRefPtr<Clipboard> Editor::newGeneralClipboard(ClipboardAccessPolicy policy, Frame*)
{
- return new ClipboardAndroid(policy, false);
+ return new ClipboardAndroid(policy, Clipboard::CopyAndPaste);
}
} // namespace WebCore
diff --git a/WebCore/editing/brew/EditorBrew.cpp b/WebCore/editing/brew/EditorBrew.cpp
index 4a1f4d7..e609891 100644
--- a/WebCore/editing/brew/EditorBrew.cpp
+++ b/WebCore/editing/brew/EditorBrew.cpp
@@ -33,7 +33,7 @@ namespace WebCore {
PassRefPtr<Clipboard> Editor::newGeneralClipboard(ClipboardAccessPolicy policy, Frame*)
{
- return new ClipboardBrew(policy, false);
+ return new ClipboardBrew(policy, Clipboard::CopyAndPaste);
}
} // namespace WebCore
diff --git a/WebCore/editing/chromium/EditorChromium.cpp b/WebCore/editing/chromium/EditorChromium.cpp
index 7a13b12..c938a7e 100644
--- a/WebCore/editing/chromium/EditorChromium.cpp
+++ b/WebCore/editing/chromium/EditorChromium.cpp
@@ -39,7 +39,7 @@ namespace WebCore {
PassRefPtr<Clipboard> Editor::newGeneralClipboard(ClipboardAccessPolicy policy, Frame* frame)
{
- return ClipboardChromium::create(false, ChromiumDataObject::create(), policy, frame);
+ return ClipboardChromium::create(Clipboard::CopyAndPaste, ChromiumDataObject::create(), policy, frame);
}
} // namespace WebCore
diff --git a/WebCore/editing/chromium/SelectionControllerChromium.cpp b/WebCore/editing/chromium/SelectionControllerChromium.cpp
new file mode 100644
index 0000000..d627d9b
--- /dev/null
+++ b/WebCore/editing/chromium/SelectionControllerChromium.cpp
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "SelectionController.h"
+
+#include "AXObjectCache.h"
+#include "Frame.h"
+
+namespace WebCore {
+
+void SelectionController::notifyAccessibilityForSelectionChange()
+{
+ // FIXME: Support editable text in chromium.
+ if (AXObjectCache::accessibilityEnabled() && m_selection.start().isNotNull() && m_selection.end().isNotNull()) {
+ Document* document = m_frame->document();
+ document->axObjectCache()->postNotification(m_selection.start().node()->renderer(), AXObjectCache::AXSelectedTextChanged, false);
+ }
+}
+
+} // namespace WebCore
diff --git a/WebCore/editing/haiku/EditorHaiku.cpp b/WebCore/editing/haiku/EditorHaiku.cpp
index 4596c9e..2b3d0ba 100644
--- a/WebCore/editing/haiku/EditorHaiku.cpp
+++ b/WebCore/editing/haiku/EditorHaiku.cpp
@@ -37,7 +37,7 @@ namespace WebCore {
PassRefPtr<Clipboard> Editor::newGeneralClipboard(ClipboardAccessPolicy policy, Frame*)
{
- return ClipboardHaiku::create(policy, false);
+ return ClipboardHaiku::create(policy, Clipboard::CopyAndPaste);
}
} // namespace WebCore
diff --git a/WebCore/editing/mac/EditorMac.mm b/WebCore/editing/mac/EditorMac.mm
index f010908..b5e3b25 100644
--- a/WebCore/editing/mac/EditorMac.mm
+++ b/WebCore/editing/mac/EditorMac.mm
@@ -42,7 +42,7 @@ namespace WebCore {
PassRefPtr<Clipboard> Editor::newGeneralClipboard(ClipboardAccessPolicy policy, Frame* frame)
{
- return ClipboardMac::create(false, [NSPasteboard generalPasteboard], policy, frame);
+ return ClipboardMac::create(Clipboard::CopyAndPaste, [NSPasteboard generalPasteboard], policy, frame);
}
void Editor::showFontPanel()
diff --git a/WebCore/editing/markup.cpp b/WebCore/editing/markup.cpp
index a279808..82499bf 100644
--- a/WebCore/editing/markup.cpp
+++ b/WebCore/editing/markup.cpp
@@ -93,14 +93,15 @@ private:
};
enum EntityMask {
- EntityNone = 0x0000,
EntityAmp = 0x0001,
EntityLt = 0x0002,
EntityGt = 0x0004,
EntityQuot = 0x0008,
EntityNbsp = 0x0010,
- EntityMaskInCDATA = EntityNone,
+ // Non-breaking space needs to be escaped in innerHTML for compatibility reason. See http://trac.webkit.org/changeset/32879
+ // However, we cannot do this in a XML document because it does not have the entity reference defined (See the bug 19215).
+ EntityMaskInCDATA = 0,
EntityMaskInPCDATA = EntityAmp | EntityLt | EntityGt,
EntityMaskInHTMLPCDATA = EntityMaskInPCDATA | EntityNbsp,
EntityMaskInAttributeValue = EntityAmp | EntityLt | EntityGt | EntityQuot,
diff --git a/WebCore/editing/visible_units.cpp b/WebCore/editing/visible_units.cpp
index f84fec0..d9ca223 100644
--- a/WebCore/editing/visible_units.cpp
+++ b/WebCore/editing/visible_units.cpp
@@ -222,13 +222,16 @@ static VisiblePosition nextBoundary(const VisiblePosition& c, BoundarySearchFunc
// Use the character iterator to translate the next value into a DOM position.
CharacterIterator charIt(searchRange.get(), TextIteratorEmitsCharactersBetweenAllVisiblePositions);
charIt.advance(next - prefixLength - 1);
- pos = charIt.range()->endPosition();
+ RefPtr<Range> characterRange = charIt.range();
+ pos = characterRange->endPosition();
if (*charIt.characters() == '\n') {
// FIXME: workaround for collapsed range (where only start position is correct) emitted for some emitted newlines (see rdar://5192593)
VisiblePosition visPos = VisiblePosition(pos);
- if (visPos == VisiblePosition(charIt.range()->startPosition()))
- pos = visPos.next(true).deepEquivalent();
+ if (visPos == VisiblePosition(characterRange->startPosition())) {
+ charIt.advance(1);
+ pos = charIt.range()->startPosition();
+ }
}
}
@@ -560,7 +563,7 @@ VisiblePosition previousLinePosition(const VisiblePosition &visiblePosition, int
root = box->root()->prevRootBox();
// We want to skip zero height boxes.
// This could happen in case it is a TrailingFloatsRootInlineBox.
- if (root && root->height())
+ if (root && root->logicalHeight())
containingBlock = renderer->containingBlock();
else
root = 0;
@@ -669,7 +672,7 @@ VisiblePosition nextLinePosition(const VisiblePosition &visiblePosition, int x)
root = box->root()->nextRootBox();
// We want to skip zero height boxes.
// This could happen in case it is a TrailingFloatsRootInlineBox.
- if (root && root->height())
+ if (root && root->logicalHeight())
containingBlock = renderer->containingBlock();
else
root = 0;
diff --git a/WebCore/editing/wx/EditorWx.cpp b/WebCore/editing/wx/EditorWx.cpp
index a2ec654..83d6b78 100644
--- a/WebCore/editing/wx/EditorWx.cpp
+++ b/WebCore/editing/wx/EditorWx.cpp
@@ -33,7 +33,7 @@ namespace WebCore {
PassRefPtr<Clipboard> Editor::newGeneralClipboard(ClipboardAccessPolicy policy, Frame*)
{
- return ClipboardWx::create(policy, true);
+ return ClipboardWx::create(policy, Clipboard::CopyAndPaste);
}
void Editor::showColorPanel()
diff --git a/WebCore/features.pri b/WebCore/features.pri
index df1c91f..f8b4bc3 100644
--- a/WebCore/features.pri
+++ b/WebCore/features.pri
@@ -68,10 +68,7 @@ contains(DEFINES, ENABLE_SINGLE_THREADED=1) {
!contains(DEFINES, ENABLE_NOTIFICATIONS=.): DEFINES += ENABLE_NOTIFICATIONS=1
!contains(DEFINES, ENABLE_IMAGE_RESIZER=.): DEFINES += ENABLE_IMAGE_RESIZER=0
!contains(DEFINES, ENABLE_INPUT_SPEECH=.): DEFINES += ENABLE_INPUT_SPEECH=0
-
-greaterThan(QT_MINOR_VERSION, 5) {
- !contains(DEFINES, ENABLE_3D_RENDERING=.): DEFINES += ENABLE_3D_RENDERING=1
-}
+!contains(DEFINES, ENABLE_3D_RENDERING=.): DEFINES += ENABLE_3D_RENDERING=1
# SVG support
!contains(DEFINES, ENABLE_SVG=0) {
@@ -89,9 +86,7 @@ greaterThan(QT_MINOR_VERSION, 5) {
!contains(DEFINES, ENABLE_DATALIST=.): DEFINES += ENABLE_DATALIST=1
# Tiled Backing Store support
-greaterThan(QT_MINOR_VERSION, 5) {
- !contains(DEFINES, ENABLE_TILED_BACKING_STORE=.): DEFINES += ENABLE_TILED_BACKING_STORE=1
-}
+!contains(DEFINES, ENABLE_TILED_BACKING_STORE=.): DEFINES += ENABLE_TILED_BACKING_STORE=1
# Nescape plugins support (NPAPI)
!contains(DEFINES, ENABLE_NETSCAPE_PLUGIN_API=.) {
@@ -133,8 +128,7 @@ greaterThan(QT_MINOR_VERSION, 5) {
}
}
-# Enable touch event support with Qt 4.6
-!lessThan(QT_MINOR_VERSION, 6): DEFINES += ENABLE_TOUCH_EVENTS=1
+DEFINES += ENABLE_TOUCH_EVENTS=1
# HTML5 Media Support
# We require QtMultimedia or Phonon
@@ -142,7 +136,7 @@ greaterThan(QT_MINOR_VERSION, 5) {
DEFINES -= ENABLE_VIDEO=1
DEFINES += ENABLE_VIDEO=0
- !lessThan(QT_MINOR_VERSION, 6):contains(MOBILITY_CONFIG, multimedia) {
+ contains(MOBILITY_CONFIG, multimedia) {
DEFINES -= ENABLE_VIDEO=0
DEFINES += ENABLE_VIDEO=1
} else:contains(QT_CONFIG, phonon) {
diff --git a/WebCore/fileapi/AsyncFileWriter.h b/WebCore/fileapi/AsyncFileWriter.h
index ff6c1fa..fef1643 100644
--- a/WebCore/fileapi/AsyncFileWriter.h
+++ b/WebCore/fileapi/AsyncFileWriter.h
@@ -39,14 +39,11 @@
namespace WebCore {
class Blob;
-class FileWriterClient;
class AsyncFileWriter {
public:
virtual ~AsyncFileWriter() {}
- virtual void setFileWriterClient(FileWriterClient* client) = 0;
-
virtual void write(long long position, Blob* data) = 0;
virtual void truncate(long long length) = 0;
virtual void abort() = 0;
diff --git a/WebCore/fileapi/FileWriterClient.h b/WebCore/fileapi/AsyncFileWriterClient.h
index 1bebbd6..327b19c 100644
--- a/WebCore/fileapi/FileWriterClient.h
+++ b/WebCore/fileapi/AsyncFileWriterClient.h
@@ -28,8 +28,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef FileWriterClient_h
-#define FileWriterClient_h
+#ifndef AsyncFileWriterClient_h
+#define AsyncFileWriterClient_h
#if ENABLE(FILE_SYSTEM)
@@ -37,12 +37,12 @@
namespace WebCore {
-class FileWriterClient {
+class AsyncFileWriterClient {
public:
- virtual ~FileWriterClient() {}
+ virtual ~AsyncFileWriterClient() {}
virtual void didWrite(long long bytes, bool complete) = 0;
- virtual void didTruncate(long long position) = 0;
+ virtual void didTruncate() = 0;
virtual void didFail(ExceptionCode) = 0;
};
@@ -50,4 +50,4 @@ public:
#endif // ENABLE(FILE_SYSTEM)
-#endif // FileWriterClient_h
+#endif // AsyncFileWriterClient_h
diff --git a/WebCore/fileapi/DOMFileSystem.cpp b/WebCore/fileapi/DOMFileSystem.cpp
index a8a7e6b..2bd09c2 100644
--- a/WebCore/fileapi/DOMFileSystem.cpp
+++ b/WebCore/fileapi/DOMFileSystem.cpp
@@ -38,10 +38,14 @@
#include "DirectoryEntry.h"
#include "EntriesCallback.h"
#include "Entry.h"
+#include "EntryArray.h"
#include "EntryCallback.h"
#include "ErrorCallback.h"
+#include "FileEntry.h"
#include "FileError.h"
#include "FileSystemCallbacks.h"
+#include "FileWriter.h"
+#include "FileWriterCallback.h"
#include "MetadataCallback.h"
#include "ScriptExecutionContext.h"
#include "VoidCallback.h"
@@ -84,7 +88,7 @@ void DOMFileSystem::contextDestroyed()
void DOMFileSystem::getMetadata(const Entry* entry, PassRefPtr<MetadataCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback)
{
String platformPath = m_asyncFileSystem->virtualToPlatformPath(entry->fullPath());
- m_asyncFileSystem->readMetadata(platformPath, new MetadataCallbacks(successCallback, errorCallback));
+ m_asyncFileSystem->readMetadata(platformPath, MetadataCallbacks::create(successCallback, errorCallback));
}
static bool checkValidityForForCopyOrMove(const Entry* src, Entry* parent, const String& newName)
@@ -123,7 +127,7 @@ void DOMFileSystem::move(const Entry* src, PassRefPtr<Entry> parent, const Strin
String srcPlatformPath = m_asyncFileSystem->virtualToPlatformPath(src->fullPath());
String destPlatformPath = parent->filesystem()->asyncFileSystem()->virtualToPlatformPath(destPath);
- m_asyncFileSystem->move(srcPlatformPath, destPlatformPath, new EntryCallbacks(successCallback, errorCallback, this, destPath, src->isDirectory()));
+ m_asyncFileSystem->move(srcPlatformPath, destPlatformPath, EntryCallbacks::create(successCallback, errorCallback, this, destPath, src->isDirectory()));
}
void DOMFileSystem::copy(const Entry* src, PassRefPtr<Entry> parent, const String& newName, PassRefPtr<EntryCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback)
@@ -141,14 +145,14 @@ void DOMFileSystem::copy(const Entry* src, PassRefPtr<Entry> parent, const Strin
String srcPlatformPath = m_asyncFileSystem->virtualToPlatformPath(src->fullPath());
String destPlatformPath = parent->filesystem()->asyncFileSystem()->virtualToPlatformPath(destPath);
- m_asyncFileSystem->copy(srcPlatformPath, destPlatformPath, new EntryCallbacks(successCallback, errorCallback, this, destPath, src->isDirectory()));
+ m_asyncFileSystem->copy(srcPlatformPath, destPlatformPath, EntryCallbacks::create(successCallback, errorCallback, this, destPath, src->isDirectory()));
}
void DOMFileSystem::remove(const Entry* entry, PassRefPtr<VoidCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback)
{
ASSERT(entry);
String platformPath = m_asyncFileSystem->virtualToPlatformPath(entry->fullPath());
- m_asyncFileSystem->remove(platformPath, new VoidCallbacks(successCallback, errorCallback));
+ m_asyncFileSystem->remove(platformPath, VoidCallbacks::create(successCallback, errorCallback));
}
void DOMFileSystem::getParent(const Entry* entry, PassRefPtr<EntryCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback)
@@ -156,7 +160,7 @@ void DOMFileSystem::getParent(const Entry* entry, PassRefPtr<EntryCallback> succ
ASSERT(entry);
String path = DOMFilePath::getDirectory(entry->fullPath());
String platformPath = m_asyncFileSystem->virtualToPlatformPath(path);
- m_asyncFileSystem->directoryExists(platformPath, new EntryCallbacks(successCallback, errorCallback, this, path, true));
+ m_asyncFileSystem->directoryExists(platformPath, EntryCallbacks::create(successCallback, errorCallback, this, path, true));
}
void DOMFileSystem::getFile(const Entry* base, const String& path, PassRefPtr<Flags> flags, PassRefPtr<EntryCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback)
@@ -172,7 +176,7 @@ void DOMFileSystem::getFile(const Entry* base, const String& path, PassRefPtr<Fl
absolutePath = DOMFilePath::removeExtraParentReferences(DOMFilePath::append(base->fullPath(), path));
String platformPath = m_asyncFileSystem->virtualToPlatformPath(absolutePath);
- OwnPtr<EntryCallbacks> callbacks = adoptPtr(new EntryCallbacks(successCallback, errorCallback, this, absolutePath, false));
+ OwnPtr<EntryCallbacks> callbacks = EntryCallbacks::create(successCallback, errorCallback, this, absolutePath, false);
if (flags && flags->isCreate())
m_asyncFileSystem->createFile(platformPath, flags->isExclusive(), callbacks.release());
else
@@ -192,18 +196,29 @@ void DOMFileSystem::getDirectory(const Entry* base, const String& path, PassRefP
absolutePath = DOMFilePath::removeExtraParentReferences(DOMFilePath::append(base->fullPath(), path));
String platformPath = m_asyncFileSystem->virtualToPlatformPath(absolutePath);
- OwnPtr<EntryCallbacks> callbacks = adoptPtr(new EntryCallbacks(successCallback, errorCallback, this, absolutePath, true));
+ OwnPtr<EntryCallbacks> callbacks = EntryCallbacks::create(successCallback, errorCallback, this, absolutePath, true);
if (flags && flags->isCreate())
m_asyncFileSystem->createDirectory(platformPath, flags->isExclusive(), callbacks.release());
else
m_asyncFileSystem->directoryExists(platformPath, callbacks.release());
}
+void DOMFileSystem::createWriter(const FileEntry* file, PassRefPtr<FileWriterCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback)
+{
+ ASSERT(file);
+
+ String platformPath = m_asyncFileSystem->virtualToPlatformPath(file->fullPath());
+
+ RefPtr<FileWriter> fileWriter = FileWriter::create(scriptExecutionContext());
+ OwnPtr<FileWriterCallbacks> callbacks = FileWriterCallbacks::create(fileWriter, successCallback, errorCallback);
+ m_asyncFileSystem->createWriter(fileWriter.get(), platformPath, callbacks.release());
+}
+
void DOMFileSystem::readDirectory(const String& path, PassRefPtr<EntriesCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback)
{
ASSERT(DOMFilePath::isAbsolute(path));
String platformPath = m_asyncFileSystem->virtualToPlatformPath(path);
- m_asyncFileSystem->readDirectory(platformPath, new EntriesCallbacks(successCallback, errorCallback, this, path));
+ m_asyncFileSystem->readDirectory(platformPath, EntriesCallbacks::create(successCallback, errorCallback, this, path));
}
} // namespace
diff --git a/WebCore/fileapi/DOMFileSystem.h b/WebCore/fileapi/DOMFileSystem.h
index f779aba..881ffc5 100644
--- a/WebCore/fileapi/DOMFileSystem.h
+++ b/WebCore/fileapi/DOMFileSystem.h
@@ -48,6 +48,8 @@ class Entry;
class EntryCallback;
class EntriesCallback;
class ErrorCallback;
+class FileEntry;
+class FileWriterCallback;
class MetadataCallback;
class VoidCallback;
@@ -77,6 +79,7 @@ public:
void getFile(const Entry* base, const String& path, PassRefPtr<Flags>, PassRefPtr<EntryCallback>, PassRefPtr<ErrorCallback>);
void getDirectory(const Entry* base, const String& path, PassRefPtr<Flags>, PassRefPtr<EntryCallback>, PassRefPtr<ErrorCallback>);
void readDirectory(const String& path, PassRefPtr<EntriesCallback>, PassRefPtr<ErrorCallback>);
+ void createWriter(const FileEntry* file, PassRefPtr<FileWriterCallback>, PassRefPtr<ErrorCallback>);
// Schedule a callback. This should not cross threads (should be called on the same context thread).
template <typename CB, typename CBArg>
diff --git a/WebCore/fileapi/DOMFileSystem.idl b/WebCore/fileapi/DOMFileSystem.idl
index b7307e2..037770b 100644
--- a/WebCore/fileapi/DOMFileSystem.idl
+++ b/WebCore/fileapi/DOMFileSystem.idl
@@ -30,7 +30,8 @@
module storage {
interface [
- Conditional=FILE_SYSTEM
+ Conditional=FILE_SYSTEM,
+ NoStaticTables
] DOMFileSystem {
readonly attribute DOMString name;
readonly attribute DirectoryEntry root;
diff --git a/WebCore/fileapi/DirectoryEntry.idl b/WebCore/fileapi/DirectoryEntry.idl
index 7a0efdd..2880ed0 100644
--- a/WebCore/fileapi/DirectoryEntry.idl
+++ b/WebCore/fileapi/DirectoryEntry.idl
@@ -32,7 +32,8 @@ module storage {
interface [
Conditional=FILE_SYSTEM,
GenerateNativeConverter,
- GenerateToJS
+ GenerateToJS,
+ NoStaticTables
] DirectoryEntry : Entry {
DirectoryReader createReader();
[Custom] void getFile(in [ConvertUndefinedOrNullToNullString] DOMString path, in [Optional] Flags flags, in [Optional, Callback] EntryCallback successCallback, in [Optional, Callback] ErrorCallback errorCallback);
diff --git a/WebCore/fileapi/DirectoryReader.idl b/WebCore/fileapi/DirectoryReader.idl
index c3c7012..831fb05 100644
--- a/WebCore/fileapi/DirectoryReader.idl
+++ b/WebCore/fileapi/DirectoryReader.idl
@@ -30,7 +30,8 @@
module storage {
interface [
- Conditional=FILE_SYSTEM
+ Conditional=FILE_SYSTEM,
+ NoStaticTables
] DirectoryReader {
void readEntries(in [Callback] EntriesCallback successCallback, in [Optional, Callback] ErrorCallback errorCallback);
};
diff --git a/WebCore/fileapi/Entry.idl b/WebCore/fileapi/Entry.idl
index b674455..d363bcd 100644
--- a/WebCore/fileapi/Entry.idl
+++ b/WebCore/fileapi/Entry.idl
@@ -31,7 +31,8 @@
module storage {
interface [
Conditional=FILE_SYSTEM,
- CustomToJS
+ CustomToJS,
+ NoStaticTables
] Entry {
readonly attribute boolean isFile;
readonly attribute boolean isDirectory;
diff --git a/WebCore/fileapi/EntryArray.idl b/WebCore/fileapi/EntryArray.idl
index e987ece..dca7827 100644
--- a/WebCore/fileapi/EntryArray.idl
+++ b/WebCore/fileapi/EntryArray.idl
@@ -32,6 +32,7 @@ module storage {
interface [
Conditional=FILE_SYSTEM,
HasIndexGetter,
+ NoStaticTables
] EntryArray {
readonly attribute unsigned long length;
Entry item(in [IsIndex] unsigned long index);
diff --git a/WebCore/fileapi/FileEntry.idl b/WebCore/fileapi/FileEntry.idl
index eb913b8..73ef895 100644
--- a/WebCore/fileapi/FileEntry.idl
+++ b/WebCore/fileapi/FileEntry.idl
@@ -32,7 +32,8 @@ module storage {
interface [
Conditional=FILE_SYSTEM,
GenerateNativeConverter,
- GenerateToJS
+ GenerateToJS,
+ NoStaticTables
] FileEntry : Entry {
void createWriter(in [Callback] FileWriterCallback successCallback, in [Optional, Callback] ErrorCallback errorCallback);
void file(in [Callback] FileCallback successCallback, in [Optional, Callback] ErrorCallback errorCallback);
diff --git a/WebCore/fileapi/FileSystemCallbacks.cpp b/WebCore/fileapi/FileSystemCallbacks.cpp
index d59e47a..550b509 100644
--- a/WebCore/fileapi/FileSystemCallbacks.cpp
+++ b/WebCore/fileapi/FileSystemCallbacks.cpp
@@ -34,6 +34,7 @@
#if ENABLE(FILE_SYSTEM)
#include "AsyncFileSystem.h"
+#include "AsyncFileWriter.h"
#include "DOMFilePath.h"
#include "DOMFileSystem.h"
#include "DirectoryEntry.h"
@@ -45,6 +46,8 @@
#include "FileEntry.h"
#include "FileError.h"
#include "FileSystemCallback.h"
+#include "FileWriter.h"
+#include "FileWriterCallback.h"
#include "Metadata.h"
#include "MetadataCallback.h"
#include "ScriptExecutionContext.h"
@@ -91,6 +94,12 @@ void FileSystemCallbacksBase::didReadDirectoryEntry(const String&, bool)
ASSERT_NOT_REACHED();
}
+void FileSystemCallbacksBase::didCreateFileWriter(PassOwnPtr<AsyncFileWriter>, long long)
+{
+ // Each subclass must implement an appropriate one.
+ ASSERT_NOT_REACHED();
+}
+
void FileSystemCallbacksBase::didFail(int code)
{
if (m_errorCallback) {
@@ -101,6 +110,11 @@ void FileSystemCallbacksBase::didFail(int code)
// EntryCallbacks -------------------------------------------------------------
+PassOwnPtr<EntryCallbacks> EntryCallbacks::create(PassRefPtr<EntryCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback, DOMFileSystem* fileSystem, const String& expectedPath, bool isDirectory)
+{
+ return adoptPtr(new EntryCallbacks(successCallback, errorCallback, fileSystem, expectedPath, isDirectory));
+}
+
EntryCallbacks::EntryCallbacks(PassRefPtr<EntryCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback, DOMFileSystem* fileSystem, const String& expectedPath, bool isDirectory)
: FileSystemCallbacksBase(errorCallback)
, m_successCallback(successCallback)
@@ -123,6 +137,11 @@ void EntryCallbacks::didSucceed()
// EntriesCallbacks -----------------------------------------------------------
+PassOwnPtr<EntriesCallbacks> EntriesCallbacks::create(PassRefPtr<EntriesCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback, DOMFileSystem* fileSystem, const String& basePath)
+{
+ return adoptPtr(new EntriesCallbacks(successCallback, errorCallback, fileSystem, basePath));
+}
+
EntriesCallbacks::EntriesCallbacks(PassRefPtr<EntriesCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback, DOMFileSystem* fileSystem, const String& basePath)
: FileSystemCallbacksBase(errorCallback)
, m_successCallback(successCallback)
@@ -155,6 +174,11 @@ void EntriesCallbacks::didReadDirectoryEntries(bool hasMore)
// FileSystemCallbacks --------------------------------------------------------
+PassOwnPtr<FileSystemCallbacks> FileSystemCallbacks::create(PassRefPtr<FileSystemCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback, ScriptExecutionContext* scriptExecutionContext)
+{
+ return adoptPtr(new FileSystemCallbacks(successCallback, errorCallback, scriptExecutionContext));
+}
+
FileSystemCallbacks::FileSystemCallbacks(PassRefPtr<FileSystemCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback, ScriptExecutionContext* context)
: FileSystemCallbacksBase(errorCallback)
, m_successCallback(successCallback)
@@ -174,6 +198,11 @@ void FileSystemCallbacks::didOpenFileSystem(const String& name, PassOwnPtr<Async
// MetadataCallbacks ----------------------------------------------------------
+PassOwnPtr<MetadataCallbacks> MetadataCallbacks::create(PassRefPtr<MetadataCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback)
+{
+ return adoptPtr(new MetadataCallbacks(successCallback, errorCallback));
+}
+
MetadataCallbacks::MetadataCallbacks(PassRefPtr<MetadataCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback)
: FileSystemCallbacksBase(errorCallback)
, m_successCallback(successCallback)
@@ -187,8 +216,35 @@ void MetadataCallbacks::didReadMetadata(double modificationTime)
m_successCallback.clear();
}
+// FileWriterCallbacks ----------------------------------------------------------
+
+PassOwnPtr<FileWriterCallbacks> FileWriterCallbacks::create(PassRefPtr<FileWriter> fileWriter, PassRefPtr<FileWriterCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback)
+{
+ return adoptPtr(new FileWriterCallbacks(fileWriter, successCallback, errorCallback));
+}
+
+FileWriterCallbacks::FileWriterCallbacks(PassRefPtr<FileWriter> fileWriter, PassRefPtr<FileWriterCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback)
+ : FileSystemCallbacksBase(errorCallback)
+ , m_fileWriter(fileWriter)
+ , m_successCallback(successCallback)
+{
+}
+
+void FileWriterCallbacks::didCreateFileWriter(PassOwnPtr<AsyncFileWriter> asyncFileWriter, long long length)
+{
+ m_fileWriter->initialize(asyncFileWriter, length);
+ if (m_successCallback)
+ m_successCallback->handleEvent(m_fileWriter.release().get());
+ m_successCallback.clear();
+}
+
// VoidCallbacks --------------------------------------------------------------
+PassOwnPtr<VoidCallbacks> VoidCallbacks::create(PassRefPtr<VoidCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback)
+{
+ return adoptPtr(new VoidCallbacks(successCallback, errorCallback));
+}
+
VoidCallbacks::VoidCallbacks(PassRefPtr<VoidCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback)
: FileSystemCallbacksBase(errorCallback)
, m_successCallback(successCallback)
diff --git a/WebCore/fileapi/FileSystemCallbacks.h b/WebCore/fileapi/FileSystemCallbacks.h
index 31a2a0c..3647ad3 100644
--- a/WebCore/fileapi/FileSystemCallbacks.h
+++ b/WebCore/fileapi/FileSystemCallbacks.h
@@ -40,12 +40,15 @@
namespace WebCore {
+class AsyncFileWriter;
class DOMFileSystem;
class ErrorCallback;
class EntriesCallback;
class EntryArray;
class EntryCallback;
class FileSystemCallback;
+class FileWriter;
+class FileWriterCallback;
class MetadataCallback;
class ScriptExecutionContext;
class VoidCallback;
@@ -67,6 +70,9 @@ public:
virtual void didReadDirectoryEntry(const String& name, bool isDirectory);
virtual void didReadDirectoryEntries(bool hasMore);
+ // For createFileWriter.
+ virtual void didCreateFileWriter(PassOwnPtr<AsyncFileWriter>, long long length);
+
// For ErrorCallback.
virtual void didFail(int code);
@@ -79,10 +85,11 @@ protected:
class EntryCallbacks : public FileSystemCallbacksBase {
public:
- EntryCallbacks(PassRefPtr<EntryCallback>, PassRefPtr<ErrorCallback>, DOMFileSystem*, const String& expectedPath, bool isDirectory);
+ static PassOwnPtr<EntryCallbacks> create(PassRefPtr<EntryCallback>, PassRefPtr<ErrorCallback>, DOMFileSystem*, const String& expectedPath, bool isDirectory);
virtual void didSucceed();
private:
+ EntryCallbacks(PassRefPtr<EntryCallback>, PassRefPtr<ErrorCallback>, DOMFileSystem*, const String& expectedPath, bool isDirectory);
RefPtr<EntryCallback> m_successCallback;
DOMFileSystem* m_fileSystem;
String m_expectedPath;
@@ -91,11 +98,12 @@ private:
class EntriesCallbacks : public FileSystemCallbacksBase {
public:
- EntriesCallbacks(PassRefPtr<EntriesCallback>, PassRefPtr<ErrorCallback>, DOMFileSystem*, const String& basePath);
+ static PassOwnPtr<EntriesCallbacks> create(PassRefPtr<EntriesCallback>, PassRefPtr<ErrorCallback>, DOMFileSystem*, const String& basePath);
virtual void didReadDirectoryEntry(const String& name, bool isDirectory);
virtual void didReadDirectoryEntries(bool hasMore);
private:
+ EntriesCallbacks(PassRefPtr<EntriesCallback>, PassRefPtr<ErrorCallback>, DOMFileSystem*, const String& basePath);
RefPtr<EntriesCallback> m_successCallback;
DOMFileSystem* m_fileSystem;
String m_basePath;
@@ -104,29 +112,43 @@ private:
class FileSystemCallbacks : public FileSystemCallbacksBase {
public:
- FileSystemCallbacks(PassRefPtr<FileSystemCallback>, PassRefPtr<ErrorCallback>, ScriptExecutionContext*);
+ static PassOwnPtr<FileSystemCallbacks> create(PassRefPtr<FileSystemCallback>, PassRefPtr<ErrorCallback>, ScriptExecutionContext*);
virtual void didOpenFileSystem(const String& name, PassOwnPtr<AsyncFileSystem>);
private:
+ FileSystemCallbacks(PassRefPtr<FileSystemCallback>, PassRefPtr<ErrorCallback>, ScriptExecutionContext*);
RefPtr<FileSystemCallback> m_successCallback;
RefPtr<ScriptExecutionContext> m_scriptExecutionContext;
};
class MetadataCallbacks : public FileSystemCallbacksBase {
public:
- MetadataCallbacks(PassRefPtr<MetadataCallback>, PassRefPtr<ErrorCallback>);
+ static PassOwnPtr<MetadataCallbacks> create(PassRefPtr<MetadataCallback>, PassRefPtr<ErrorCallback>);
virtual void didReadMetadata(double modificationTime);
private:
+ MetadataCallbacks(PassRefPtr<MetadataCallback>, PassRefPtr<ErrorCallback>);
RefPtr<MetadataCallback> m_successCallback;
};
+class FileWriterCallbacks : public FileSystemCallbacksBase {
+public:
+ static PassOwnPtr<FileWriterCallbacks> create(PassRefPtr<FileWriter>, PassRefPtr<FileWriterCallback>, PassRefPtr<ErrorCallback>);
+ virtual void didCreateFileWriter(PassOwnPtr<AsyncFileWriter>, long long length);
+
+private:
+ FileWriterCallbacks(PassRefPtr<FileWriter>, PassRefPtr<FileWriterCallback>, PassRefPtr<ErrorCallback>);
+ RefPtr<FileWriter> m_fileWriter;
+ RefPtr<FileWriterCallback> m_successCallback;
+};
+
class VoidCallbacks : public FileSystemCallbacksBase {
public:
- VoidCallbacks(PassRefPtr<VoidCallback>, PassRefPtr<ErrorCallback>);
+ static PassOwnPtr<VoidCallbacks> create(PassRefPtr<VoidCallback>, PassRefPtr<ErrorCallback>);
virtual void didSucceed();
private:
+ VoidCallbacks(PassRefPtr<VoidCallback>, PassRefPtr<ErrorCallback>);
RefPtr<VoidCallback> m_successCallback;
};
diff --git a/WebCore/fileapi/FileWriter.cpp b/WebCore/fileapi/FileWriter.cpp
index a9f9afd..8367bf9 100644
--- a/WebCore/fileapi/FileWriter.cpp
+++ b/WebCore/fileapi/FileWriter.cpp
@@ -48,6 +48,7 @@ FileWriter::FileWriter(ScriptExecutionContext* context)
, m_position(0)
, m_bytesWritten(0)
, m_bytesToWrite(0)
+ , m_truncateLength(-1)
{
}
@@ -95,7 +96,6 @@ void FileWriter::write(Blob* data, ExceptionCode& ec)
m_readyState = WRITING;
m_bytesWritten = 0;
m_bytesToWrite = data->size();
- fireEvent(eventNames().writestartEvent);
m_writer->write(m_position, data);
}
@@ -122,7 +122,7 @@ void FileWriter::seek(long long position, ExceptionCode& ec)
void FileWriter::truncate(long long position, ExceptionCode& ec)
{
ASSERT(m_writer);
- if (m_readyState == WRITING || position >= m_length) {
+ if (m_readyState == WRITING || position < 0) {
ec = INVALID_STATE_ERR;
m_error = FileError::create(ec);
return;
@@ -130,7 +130,7 @@ void FileWriter::truncate(long long position, ExceptionCode& ec)
m_readyState = WRITING;
m_bytesWritten = 0;
m_bytesToWrite = 0;
- fireEvent(eventNames().writestartEvent);
+ m_truncateLength = position;
m_writer->truncate(position);
}
@@ -142,11 +142,8 @@ void FileWriter::abort(ExceptionCode& ec)
m_error = FileError::create(ec);
return;
}
+
m_error = FileError::create(ABORT_ERR);
- m_readyState = DONE;
- fireEvent(eventNames().errorEvent);
- fireEvent(eventNames().abortEvent);
- fireEvent(eventNames().writeendEvent);
m_writer->abort();
}
@@ -155,36 +152,41 @@ void FileWriter::didWrite(long long bytes, bool complete)
ASSERT(bytes > 0);
ASSERT(bytes + m_bytesWritten > 0);
ASSERT(bytes + m_bytesWritten <= m_bytesToWrite);
+ if (!m_bytesWritten)
+ fireEvent(eventNames().writestartEvent);
m_bytesWritten += bytes;
ASSERT((m_bytesWritten == m_bytesToWrite) == complete);
m_position += bytes;
if (m_position > m_length)
m_length = m_position;
- if (complete)
- m_readyState = DONE;
fireEvent(eventNames().writeEvent);
- if (complete)
+ if (complete) {
+ m_readyState = DONE;
fireEvent(eventNames().writeendEvent);
+ }
}
-void FileWriter::didTruncate(long long length)
+void FileWriter::didTruncate()
{
- ASSERT(length > 0);
- ASSERT(length >= 0);
- ASSERT(length < m_length);
- m_length = length;
+ ASSERT(m_truncateLength >= 0);
+ fireEvent(eventNames().writestartEvent);
+ m_length = m_truncateLength;
if (m_position > m_length)
m_position = m_length;
- m_readyState = DONE;
+ m_truncateLength = -1;
fireEvent(eventNames().writeEvent);
+ m_readyState = DONE;
fireEvent(eventNames().writeendEvent);
}
void FileWriter::didFail(ExceptionCode ec)
{
m_error = FileError::create(ec);
- m_readyState = DONE;
fireEvent(eventNames().errorEvent);
+ if (ABORT_ERR == ec)
+ fireEvent(eventNames().abortEvent);
+ fireEvent(eventNames().errorEvent);
+ m_readyState = DONE;
fireEvent(eventNames().writeendEvent);
}
diff --git a/WebCore/fileapi/FileWriter.h b/WebCore/fileapi/FileWriter.h
index 0737085..4bb91ef 100644
--- a/WebCore/fileapi/FileWriter.h
+++ b/WebCore/fileapi/FileWriter.h
@@ -34,8 +34,8 @@
#if ENABLE(FILE_SYSTEM)
#include "ActiveDOMObject.h"
+#include "AsyncFileWriterClient.h"
#include "EventTarget.h"
-#include "FileWriterClient.h"
#include <wtf/OwnPtr.h>
#include <wtf/PassOwnPtr.h>
#include <wtf/PassRefPtr.h>
@@ -49,7 +49,7 @@ class Blob;
class FileError;
class ScriptExecutionContext;
-class FileWriter : public RefCounted<FileWriter>, public ActiveDOMObject, public EventTarget, public FileWriterClient {
+class FileWriter : public RefCounted<FileWriter>, public ActiveDOMObject, public EventTarget, public AsyncFileWriterClient {
public:
static PassRefPtr<FileWriter> create(ScriptExecutionContext* context)
{
@@ -74,9 +74,9 @@ public:
long long position() const { return m_position; }
long long length() const { return m_length; }
- // FileWriterClient
+ // AsyncFileWriterClient
void didWrite(long long bytes, bool complete);
- void didTruncate(long long length);
+ void didTruncate();
void didFail(ExceptionCode ec);
// ActiveDOMObject
@@ -121,6 +121,7 @@ private:
long long m_length;
long long m_bytesWritten;
long long m_bytesToWrite;
+ long long m_truncateLength;
};
} // namespace WebCore
diff --git a/WebCore/fileapi/Flags.idl b/WebCore/fileapi/Flags.idl
index 29658a1..88cede3 100644
--- a/WebCore/fileapi/Flags.idl
+++ b/WebCore/fileapi/Flags.idl
@@ -31,7 +31,8 @@
module storage {
interface [
Conditional=FILE_SYSTEM,
- CanBeConstructed
+ CanBeConstructed,
+ NoStaticTables
] Flags {
attribute boolean create;
attribute boolean exclusive;
diff --git a/WebCore/fileapi/LocalFileSystem.cpp b/WebCore/fileapi/LocalFileSystem.cpp
index 59ec2a1..567aafe 100644
--- a/WebCore/fileapi/LocalFileSystem.cpp
+++ b/WebCore/fileapi/LocalFileSystem.cpp
@@ -50,25 +50,41 @@
namespace WebCore {
-PassRefPtr<LocalFileSystem> LocalFileSystem::create(const String& basePath)
+LocalFileSystem* LocalFileSystem::s_instance = 0;
+
+void LocalFileSystem::initializeLocalFileSystem(const String& basePath)
{
- return adoptRef(new LocalFileSystem(basePath));
+ // FIXME: Should initialize the quota settings as well.
+ ASSERT(isMainThread());
+ ASSERT(!s_instance);
+ if (s_instance)
+ return;
+
+ OwnPtr<LocalFileSystem> localFileSystem = adoptPtr(new LocalFileSystem(basePath));
+ s_instance = localFileSystem.leakPtr();
}
-static void openFileSystem(ScriptExecutionContext*, const String& basePath, const String& identifier, AsyncFileSystem::Type type, PassOwnPtr<FileSystemCallbacks> callbacks)
+LocalFileSystem& LocalFileSystem::localFileSystem()
{
- AsyncFileSystem::openFileSystem(basePath, identifier, type, callbacks);
+ // initializeLocalFileSystem must be called prior calling this.
+ ASSERT(s_instance);
+ return *s_instance;
}
-void LocalFileSystem::requestFileSystem(ScriptExecutionContext* context, AsyncFileSystem::Type type, long long, PassRefPtr<FileSystemCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback)
+String LocalFileSystem::fileSystemBasePath() const
{
- if (type != AsyncFileSystem::Temporary && type != AsyncFileSystem::Persistent) {
- DOMFileSystem::scheduleCallback(context, errorCallback, FileError::create(INVALID_MODIFICATION_ERR));
- return;
- }
+ return m_basePath;
+}
+static void openFileSystem(ScriptExecutionContext*, const String& basePath, const String& identifier, AsyncFileSystem::Type type, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
+{
+ AsyncFileSystem::openFileSystem(basePath, identifier, type, callbacks);
+}
+
+void LocalFileSystem::requestFileSystem(ScriptExecutionContext* context, AsyncFileSystem::Type type, long long, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
+{
// AsyncFileSystem::openFileSystem calls callbacks synchronously, so the method needs to be called asynchronously.
- context->postTask(createCallbackTask(&openFileSystem, m_basePath, context->securityOrigin()->databaseIdentifier(), type, new FileSystemCallbacks(successCallback, errorCallback, context)));
+ context->postTask(createCallbackTask(&openFileSystem, fileSystemBasePath(), context->securityOrigin()->databaseIdentifier(), type, callbacks));
}
} // namespace
diff --git a/WebCore/fileapi/LocalFileSystem.h b/WebCore/fileapi/LocalFileSystem.h
index 48cfa8f..bb1d045 100644
--- a/WebCore/fileapi/LocalFileSystem.h
+++ b/WebCore/fileapi/LocalFileSystem.h
@@ -44,20 +44,44 @@ class ErrorCallback;
class FileSystemCallback;
class ScriptExecutionContext;
-class LocalFileSystem : public RefCounted<LocalFileSystem> {
+// Keeps per-process information and provides an entry point to open a file system.
+class LocalFileSystem : public Noncopyable {
public:
- static PassRefPtr<LocalFileSystem> create(const String& basePath);
- virtual ~LocalFileSystem() { }
+ // Returns a per-process instance of LocalFileSystem.
+ // Note that LocalFileSystem::initializeLocalFileSystem must be called before
+ // calling this one.
+ static LocalFileSystem& localFileSystem();
- void requestFileSystem(ScriptExecutionContext*, AsyncFileSystem::Type, long long size, PassRefPtr<FileSystemCallback>, PassRefPtr<ErrorCallback>);
+ void requestFileSystem(ScriptExecutionContext*, AsyncFileSystem::Type, long long size, PassOwnPtr<AsyncFileSystemCallbacks>);
-protected:
+#if !PLATFORM(CHROMIUM)
+ // This call is not thread-safe; must be called before any worker threads are created.
+ void initializeLocalFileSystem(const String&);
+
+ String fileSystemBasePath() const;
+#endif
+
+private:
LocalFileSystem(const String& basePath)
: m_basePath(basePath)
{
}
- String m_basePath;
+ static LocalFileSystem* s_instance;
+
+ // An inner class that enforces thread-safe string access.
+ class SystemBasePath {
+ public:
+ explicit SystemBasePath(const String& path) : m_value(path) { }
+ operator String() const
+ {
+ return m_value.threadsafeCopy();
+ }
+ private:
+ String m_value;
+ };
+
+ SystemBasePath m_basePath;
};
} // namespace
diff --git a/WebCore/fileapi/Metadata.idl b/WebCore/fileapi/Metadata.idl
index a5a90bc..df50b66 100644
--- a/WebCore/fileapi/Metadata.idl
+++ b/WebCore/fileapi/Metadata.idl
@@ -30,7 +30,8 @@
module storage {
interface [
- Conditional=FILE_SYSTEM
+ Conditional=FILE_SYSTEM,
+ NoStaticTables
] Metadata {
readonly attribute Date modificationTime;
};
diff --git a/WebCore/html/BaseTextInputType.cpp b/WebCore/html/BaseTextInputType.cpp
new file mode 100644
index 0000000..3e57ace
--- /dev/null
+++ b/WebCore/html/BaseTextInputType.cpp
@@ -0,0 +1,52 @@
+/*
+ * This file is part of the WebKit project.
+ *
+ * Copyright (C) 2009 Michelangelo De Simone <micdesim@gmail.com>
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "config.h"
+#include "BaseTextInputType.h"
+
+#include "HTMLInputElement.h"
+#include "HTMLNames.h"
+#include "RegularExpression.h"
+
+namespace WebCore {
+
+using namespace HTMLNames;
+
+bool BaseTextInputType::isTextType() const
+{
+ return true;
+}
+
+bool BaseTextInputType::patternMismatch(const String& value) const
+{
+ const AtomicString& pattern = element()->fastGetAttribute(patternAttr);
+ // Empty values can't be mismatched
+ if (pattern.isEmpty() || value.isEmpty())
+ return false;
+ int matchLength = 0;
+ int valueLength = value.length();
+ int matchOffset = RegularExpression(pattern, TextCaseSensitive).match(value, 0, &matchLength);
+ return matchOffset || matchLength != valueLength;
+}
+
+} // namespace WebCore
diff --git a/WebCore/html/BaseTextInputType.h b/WebCore/html/BaseTextInputType.h
new file mode 100644
index 0000000..9bd6c6d
--- /dev/null
+++ b/WebCore/html/BaseTextInputType.h
@@ -0,0 +1,49 @@
+/*
+ * 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 BaseTextInputType_h
+#define BaseTextInputType_h
+
+#include "TextFieldInputType.h"
+
+namespace WebCore {
+
+// Base of email, password, search, tel, text, and URL types.
+// They support maxlength, selection functions, and so on.
+class BaseTextInputType : public TextFieldInputType {
+protected:
+ BaseTextInputType(HTMLInputElement* element) : TextFieldInputType(element) { }
+ virtual bool isTextType() const;
+ virtual bool patternMismatch(const String&) const;
+};
+
+} // namespace WebCore
+
+#endif // BaseTextInputType_h
diff --git a/WebKit/chromium/src/GLES2ContextInternal.h b/WebCore/html/ButtonInputType.cpp
index 4668311..7f56970 100644
--- a/WebKit/chromium/src/GLES2ContextInternal.h
+++ b/WebCore/html/ButtonInputType.cpp
@@ -28,28 +28,21 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <wtf/PassOwnPtr.h>
+#include "config.h"
+#include "ButtonInputType.h"
-namespace WebKit {
-class WebGLES2Context;
-}
+#include <wtf/PassOwnPtr.h>
namespace WebCore {
-class GLES2ContextInternal {
-public:
- // If 'owns' is set to true, this GLES2ContextInternal takes ownership of the passed in WebKit::WebGLES2Context.
- static PassOwnPtr<GLES2ContextInternal> create(WebKit::WebGLES2Context* impl, bool owns);
-
- WebKit::WebGLES2Context* getWebGLES2Context() { return m_impl; }
-
- ~GLES2ContextInternal();
-
-private:
- GLES2ContextInternal(WebKit::WebGLES2Context* impl, bool owns);
-
- WebKit::WebGLES2Context* m_impl;
- bool m_owns;
-};
+PassOwnPtr<InputType> ButtonInputType::create(HTMLInputElement* element)
+{
+ return adoptPtr(new ButtonInputType(element));
+}
+const AtomicString& ButtonInputType::formControlType() const
+{
+ return InputTypeNames::button();
}
+
+} // namespace WebCore
diff --git a/WebCore/html/ButtonInputType.h b/WebCore/html/ButtonInputType.h
new file mode 100644
index 0000000..99b3574
--- /dev/null
+++ b/WebCore/html/ButtonInputType.h
@@ -0,0 +1,49 @@
+/*
+ * 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 ButtonInputType_h
+#define ButtonInputType_h
+
+#include "InputType.h"
+
+namespace WebCore {
+
+class ButtonInputType : public InputType {
+public:
+ static PassOwnPtr<InputType> create(HTMLInputElement*);
+
+private:
+ ButtonInputType(HTMLInputElement* element) : InputType(element) { }
+ virtual const AtomicString& formControlType() const;
+};
+
+} // namespace WebCore
+
+#endif // ButtonInputType_h
diff --git a/WebCore/html/CheckboxInputType.cpp b/WebCore/html/CheckboxInputType.cpp
new file mode 100644
index 0000000..1c7ea4b
--- /dev/null
+++ b/WebCore/html/CheckboxInputType.cpp
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "CheckboxInputType.h"
+
+#include <wtf/PassOwnPtr.h>
+
+namespace WebCore {
+
+PassOwnPtr<InputType> CheckboxInputType::create(HTMLInputElement* element)
+{
+ return adoptPtr(new CheckboxInputType(element));
+}
+
+const AtomicString& CheckboxInputType::formControlType() const
+{
+ return InputTypeNames::checkbox();
+}
+
+} // namespace WebCore
diff --git a/WebCore/html/CheckboxInputType.h b/WebCore/html/CheckboxInputType.h
new file mode 100644
index 0000000..6a152e9
--- /dev/null
+++ b/WebCore/html/CheckboxInputType.h
@@ -0,0 +1,49 @@
+/*
+ * 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 CheckboxInputType_h
+#define CheckboxInputType_h
+
+#include "InputType.h"
+
+namespace WebCore {
+
+class CheckboxInputType : public InputType {
+public:
+ static PassOwnPtr<InputType> create(HTMLInputElement*);
+
+private:
+ CheckboxInputType(HTMLInputElement* element) : InputType(element) { }
+ virtual const AtomicString& formControlType() const;
+};
+
+} // namespace WebCore
+
+#endif // CheckboxInputType_h
diff --git a/WebCore/html/ColorInputType.cpp b/WebCore/html/ColorInputType.cpp
new file mode 100644
index 0000000..c68acea
--- /dev/null
+++ b/WebCore/html/ColorInputType.cpp
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "ColorInputType.h"
+
+#include <wtf/PassOwnPtr.h>
+
+namespace WebCore {
+
+PassOwnPtr<InputType> ColorInputType::create(HTMLInputElement* element)
+{
+ return adoptPtr(new ColorInputType(element));
+}
+
+const AtomicString& ColorInputType::formControlType() const
+{
+ return InputTypeNames::color();
+}
+
+} // namespace WebCore
diff --git a/WebCore/html/ColorInputType.h b/WebCore/html/ColorInputType.h
new file mode 100644
index 0000000..7259346
--- /dev/null
+++ b/WebCore/html/ColorInputType.h
@@ -0,0 +1,49 @@
+/*
+ * 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 ColorInputType_h
+#define ColorInputType_h
+
+#include "TextFieldInputType.h"
+
+namespace WebCore {
+
+class ColorInputType : public TextFieldInputType {
+public:
+ static PassOwnPtr<InputType> create(HTMLInputElement*);
+
+private:
+ ColorInputType(HTMLInputElement* element) : TextFieldInputType(element) { }
+ virtual const AtomicString& formControlType() const;
+};
+
+} // namespace WebCore
+
+#endif // ButtonInputType_h
diff --git a/WebCore/html/DOMTokenList.cpp b/WebCore/html/DOMTokenList.cpp
new file mode 100644
index 0000000..8ee45a2
--- /dev/null
+++ b/WebCore/html/DOMTokenList.cpp
@@ -0,0 +1,206 @@
+/*
+ * Copyright (C) 2010, Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE 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 "DOMTokenList.h"
+
+#include "Element.h"
+#include "HTMLNames.h"
+#include "SpaceSplitString.h"
+#include "StringBuilder.h"
+
+namespace WebCore {
+
+using namespace HTMLNames;
+
+static bool validateToken(const AtomicString& token, ExceptionCode& ec)
+{
+ if (token.isEmpty()) {
+ ec = SYNTAX_ERR;
+ return false;
+ }
+
+ unsigned length = token.length();
+ for (unsigned i = 0; i < length; ++i) {
+ if (isClassWhitespace(token[i])) {
+ ec = INVALID_CHARACTER_ERR;
+ return false;
+ }
+ }
+
+ return true;
+}
+
+DOMTokenList::DOMTokenList(Element* element)
+ : m_element(element)
+{
+ if (m_element->document()->inQuirksMode())
+ m_classNamesForQuirksMode.set(m_element->fastGetAttribute(classAttr), false);
+}
+
+void DOMTokenList::ref()
+{
+ m_element->ref();
+}
+
+void DOMTokenList::deref()
+{
+ m_element->deref();
+}
+
+unsigned DOMTokenList::length() const
+{
+ return classNames().size();
+}
+
+const AtomicString DOMTokenList::item(unsigned index) const
+{
+ if (index >= length())
+ return AtomicString();
+ return classNames()[index];
+}
+
+bool DOMTokenList::contains(const AtomicString& token, ExceptionCode& ec) const
+{
+ if (!validateToken(token, ec))
+ return false;
+ return containsInternal(token);
+}
+
+bool DOMTokenList::containsInternal(const AtomicString& token) const
+{
+ return classNames().contains(token);
+}
+
+void DOMTokenList::add(const AtomicString& token, ExceptionCode& ec)
+{
+ if (!validateToken(token, ec))
+ return;
+ addInternal(token);
+}
+
+void DOMTokenList::addInternal(const AtomicString& token) const
+{
+ const AtomicString& oldClassName(m_element->fastGetAttribute(classAttr));
+ if (oldClassName.isEmpty())
+ m_element->setAttribute(classAttr, token);
+ else if (!containsInternal(token)) {
+ StringBuilder builder;
+ builder.append(oldClassName);
+ if (oldClassName[oldClassName.length() - 1] != ' ')
+ builder.append(' ');
+ builder.append(token);
+ m_element->setAttribute(classAttr, builder.toString());
+ }
+}
+
+void DOMTokenList::remove(const AtomicString& token, ExceptionCode& ec)
+{
+ if (!validateToken(token, ec))
+ return;
+ removeInternal(token);
+}
+
+void DOMTokenList::removeInternal(const AtomicString& token) const
+{
+ // Check using contains first since it uses AtomicString comparisons instead
+ // of character by character testing.
+ if (!containsInternal(token))
+ return;
+
+ // Algorithm defined at http://www.whatwg.org/specs/web-apps/current-work/multipage/common-microsyntaxes.html#remove-a-token-from-a-string
+
+ const AtomicString& input = m_element->fastGetAttribute(classAttr);
+ unsigned inputLength = input.length();
+ Vector<UChar> output; // 3
+ output.reserveCapacity(inputLength);
+ unsigned position = 0; // 4
+
+ // Step 5
+ while (position < inputLength) {
+ if (isClassWhitespace(input[position])) { // 6
+ output.append(input[position++]); // 6.1, 6.2
+ continue; // 6.3
+ }
+
+ // Step 7
+ Vector<UChar> s;
+ while (position < inputLength && !isClassWhitespace(input[position]))
+ s.append(input[position++]);
+
+ // Step 8
+ if (s == token) {
+ // Step 8.1
+ while (position < inputLength && isClassWhitespace(input[position]))
+ ++position;
+
+ // Step 8.2
+ size_t j = output.size();
+ while (j > 0 && isClassWhitespace(output[j - 1]))
+ --j;
+ output.resize(j);
+
+ // Step 8.3
+ if (position < inputLength && !output.isEmpty())
+ output.append(' ');
+ } else
+ output.append(s); // Step 9
+ }
+
+ output.shrinkToFit();
+ m_element->setAttribute(classAttr, String::adopt(output));
+}
+
+bool DOMTokenList::toggle(const AtomicString& token, ExceptionCode& ec)
+{
+ if (!validateToken(token, ec))
+ return false;
+
+ if (containsInternal(token)) {
+ removeInternal(token);
+ return false;
+ }
+ addInternal(token);
+ return true;
+}
+
+String DOMTokenList::toString() const
+{
+ return m_element->fastGetAttribute(classAttr);
+}
+
+void DOMTokenList::reset(const String& newClassName)
+{
+ if (!m_classNamesForQuirksMode.isNull())
+ m_classNamesForQuirksMode.set(newClassName, false);
+}
+
+const SpaceSplitString& DOMTokenList::classNames() const
+{
+ if (!m_classNamesForQuirksMode.isNull())
+ return m_classNamesForQuirksMode;
+ return m_element->attributeMap()->classNames();
+}
+
+} // namespace WebCore
diff --git a/WebCore/html/DOMTokenList.h b/WebCore/html/DOMTokenList.h
new file mode 100644
index 0000000..fad69ca
--- /dev/null
+++ b/WebCore/html/DOMTokenList.h
@@ -0,0 +1,74 @@
+/*
+ * Copyright (C) 2010, Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 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 DOMTokenList_h
+#define DOMTokenList_h
+
+#include "ExceptionCode.h"
+#include "SpaceSplitString.h"
+#include <wtf/Noncopyable.h>
+#include <wtf/PassOwnPtr.h>
+
+namespace WebCore {
+
+class Element;
+
+class DOMTokenList : public Noncopyable {
+public:
+ static PassOwnPtr<DOMTokenList> create(Element* element)
+ {
+ return adoptPtr(new DOMTokenList(element));
+ }
+
+ void ref();
+ void deref();
+
+ unsigned length() const;
+ const AtomicString item(unsigned index) const;
+ bool contains(const AtomicString&, ExceptionCode&) const;
+ void add(const AtomicString&, ExceptionCode&);
+ void remove(const AtomicString&, ExceptionCode&);
+ bool toggle(const AtomicString&, ExceptionCode&);
+ String toString() const;
+
+ void reset(const String&);
+
+ Element* element() { return m_element; }
+
+private:
+ DOMTokenList(Element*);
+
+ void addInternal(const AtomicString&) const;
+ bool containsInternal(const AtomicString&) const;
+ void removeInternal(const AtomicString&) const;
+
+ const SpaceSplitString& classNames() const;
+
+ Element* m_element;
+ SpaceSplitString m_classNamesForQuirksMode;
+};
+
+} // namespace WebCore
+
+#endif // DOMTokenList_h
diff --git a/WebCore/html/DOMTokenList.idl b/WebCore/html/DOMTokenList.idl
new file mode 100644
index 0000000..a46900e
--- /dev/null
+++ b/WebCore/html/DOMTokenList.idl
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 2010, Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE 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.
+ */
+
+module core {
+
+ interface [
+ GenerateConstructor,
+ HasIndexGetter
+ ] DOMTokenList {
+ readonly attribute unsigned long length;
+ [ConvertNullStringTo=Null] DOMString item(in unsigned long index);
+ boolean contains(in DOMString token) raises(DOMException);
+ void add(in DOMString token) raises(DOMException);
+ void remove(in DOMString token) raises(DOMException);
+ boolean toggle(in DOMString token) raises(DOMException);
+
+#if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT
+ [DontEnum] DOMString toString();
+#endif
+ };
+
+}
diff --git a/WebKit/chromium/src/GLES2ContextInternal.cpp b/WebCore/html/DateInputType.cpp
index 33eb602..0605846 100644
--- a/WebKit/chromium/src/GLES2ContextInternal.cpp
+++ b/WebCore/html/DateInputType.cpp
@@ -29,24 +29,20 @@
*/
#include "config.h"
+#include "DateInputType.h"
-#include "GLES2ContextInternal.h"
-
-#include "WebGLES2Context.h"
+#include <wtf/PassOwnPtr.h>
namespace WebCore {
-GLES2ContextInternal::GLES2ContextInternal(WebKit::WebGLES2Context* impl, bool owns)
- : m_impl(impl)
- , m_owns(owns)
+PassOwnPtr<InputType> DateInputType::create(HTMLInputElement* element)
{
+ return adoptPtr(new DateInputType(element));
}
-GLES2ContextInternal::~GLES2ContextInternal()
+const AtomicString& DateInputType::formControlType() const
{
- if (m_owns)
- delete m_impl;
+ return InputTypeNames::date();
}
} // namespace WebCore
-
diff --git a/WebCore/html/DateInputType.h b/WebCore/html/DateInputType.h
new file mode 100644
index 0000000..e6f60d7
--- /dev/null
+++ b/WebCore/html/DateInputType.h
@@ -0,0 +1,49 @@
+/*
+ * 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 DateInputType_h
+#define DateInputType_h
+
+#include "TextFieldInputType.h"
+
+namespace WebCore {
+
+class DateInputType : public TextFieldInputType {
+public:
+ static PassOwnPtr<InputType> create(HTMLInputElement*);
+
+private:
+ DateInputType(HTMLInputElement* element) : TextFieldInputType(element) { }
+ virtual const AtomicString& formControlType() const;
+};
+
+} // namespace WebCore
+
+#endif // DateInputType_h
diff --git a/WebCore/html/DateTimeInputType.cpp b/WebCore/html/DateTimeInputType.cpp
new file mode 100644
index 0000000..0bf5e04
--- /dev/null
+++ b/WebCore/html/DateTimeInputType.cpp
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "DateTimeInputType.h"
+
+#include <wtf/PassOwnPtr.h>
+
+namespace WebCore {
+
+PassOwnPtr<InputType> DateTimeInputType::create(HTMLInputElement* element)
+{
+ return adoptPtr(new DateTimeInputType(element));
+}
+
+const AtomicString& DateTimeInputType::formControlType() const
+{
+ return InputTypeNames::datetime();
+}
+
+} // namespace WebCore
diff --git a/WebCore/html/DateTimeInputType.h b/WebCore/html/DateTimeInputType.h
new file mode 100644
index 0000000..f24ebfb
--- /dev/null
+++ b/WebCore/html/DateTimeInputType.h
@@ -0,0 +1,49 @@
+/*
+ * 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 DateTimeInputType_h
+#define DateTimeInputType_h
+
+#include "TextFieldInputType.h"
+
+namespace WebCore {
+
+class DateTimeInputType : public TextFieldInputType {
+public:
+ static PassOwnPtr<InputType> create(HTMLInputElement*);
+
+private:
+ DateTimeInputType(HTMLInputElement* element) : TextFieldInputType(element) { }
+ virtual const AtomicString& formControlType() const;
+};
+
+} // namespace WebCore
+
+#endif // DateTimeInputType_h
diff --git a/WebCore/html/DateTimeLocalInputType.cpp b/WebCore/html/DateTimeLocalInputType.cpp
new file mode 100644
index 0000000..33c6cfa
--- /dev/null
+++ b/WebCore/html/DateTimeLocalInputType.cpp
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "DateTimeLocalInputType.h"
+
+#include <wtf/PassOwnPtr.h>
+
+namespace WebCore {
+
+PassOwnPtr<InputType> DateTimeLocalInputType::create(HTMLInputElement* element)
+{
+ return adoptPtr(new DateTimeLocalInputType(element));
+}
+
+const AtomicString& DateTimeLocalInputType::formControlType() const
+{
+ return InputTypeNames::datetimelocal();
+}
+
+} // namespace WebCore
diff --git a/WebCore/html/DateTimeLocalInputType.h b/WebCore/html/DateTimeLocalInputType.h
new file mode 100644
index 0000000..1a3d866
--- /dev/null
+++ b/WebCore/html/DateTimeLocalInputType.h
@@ -0,0 +1,49 @@
+/*
+ * 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 DateTimeLocalInputType_h
+#define DateTimeLocalInputType_h
+
+#include "TextFieldInputType.h"
+
+namespace WebCore {
+
+class DateTimeLocalInputType : public TextFieldInputType {
+public:
+ static PassOwnPtr<InputType> create(HTMLInputElement*);
+
+private:
+ DateTimeLocalInputType(HTMLInputElement* element) : TextFieldInputType(element) { }
+ virtual const AtomicString& formControlType() const;
+};
+
+} // namespace WebCore
+
+#endif // DateTimeLocalInputType_h
diff --git a/WebCore/html/DocTypeStrings.gperf b/WebCore/html/DocTypeStrings.gperf
index 5c213b0..22488eb 100644
--- a/WebCore/html/DocTypeStrings.gperf
+++ b/WebCore/html/DocTypeStrings.gperf
@@ -1,23 +1,14 @@
%struct-type
-struct PubIDInfo {
- enum eMode {
- eQuirks,
- eQuirks3,
- eAlmostStandards
- };
-
- const char* name;
- eMode mode_if_no_sysid;
- eMode mode_if_sysid;
-}
-%language=ANSI-C
+struct PubIDInfo;
+%omit-struct-type
+%language=C++
%readonly-tables
%global-table
%compare-strncmp
+%define class-name DocTypeStringsHash
%define initializer-suffix ,PubIDInfo::eAlmostStandards,PubIDInfo::eAlmostStandards
-%define lookup-function-name findDoctypeEntry
+%define lookup-function-name findDoctypeEntryImpl
%define hash-function-name doctype_hash_function
-%includes
%enum
%%
"+//silmaril//dtd html pro v0r11 19970101//en", PubIDInfo::eQuirks3, PubIDInfo::eQuirks3
diff --git a/WebCore/html/EmailInputType.cpp b/WebCore/html/EmailInputType.cpp
new file mode 100644
index 0000000..4472310
--- /dev/null
+++ b/WebCore/html/EmailInputType.cpp
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "EmailInputType.h"
+
+#include <wtf/PassOwnPtr.h>
+
+namespace WebCore {
+
+PassOwnPtr<InputType> EmailInputType::create(HTMLInputElement* element)
+{
+ return adoptPtr(new EmailInputType(element));
+}
+
+const AtomicString& EmailInputType::formControlType() const
+{
+ return InputTypeNames::email();
+}
+
+} // namespace WebCore
diff --git a/WebCore/html/EmailInputType.h b/WebCore/html/EmailInputType.h
new file mode 100644
index 0000000..bbf6f73
--- /dev/null
+++ b/WebCore/html/EmailInputType.h
@@ -0,0 +1,49 @@
+/*
+ * 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 EmailInputType_h
+#define EmailInputType_h
+
+#include "BaseTextInputType.h"
+
+namespace WebCore {
+
+class EmailInputType : public BaseTextInputType {
+public:
+ static PassOwnPtr<InputType> create(HTMLInputElement*);
+
+private:
+ EmailInputType(HTMLInputElement* element) : BaseTextInputType(element) { }
+ virtual const AtomicString& formControlType() const;
+};
+
+} // namespace WebCore
+
+#endif // ButtonInputType_h
diff --git a/WebCore/html/FileInputType.cpp b/WebCore/html/FileInputType.cpp
new file mode 100644
index 0000000..0e08362
--- /dev/null
+++ b/WebCore/html/FileInputType.cpp
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "FileInputType.h"
+
+#include <wtf/PassOwnPtr.h>
+
+namespace WebCore {
+
+PassOwnPtr<InputType> FileInputType::create(HTMLInputElement* element)
+{
+ return adoptPtr(new FileInputType(element));
+}
+
+const AtomicString& FileInputType::formControlType() const
+{
+ return InputTypeNames::file();
+}
+
+} // namespace WebCore
diff --git a/WebCore/html/FileInputType.h b/WebCore/html/FileInputType.h
new file mode 100644
index 0000000..cebfab7
--- /dev/null
+++ b/WebCore/html/FileInputType.h
@@ -0,0 +1,49 @@
+/*
+ * 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 FileInputType_h
+#define FileInputType_h
+
+#include "InputType.h"
+
+namespace WebCore {
+
+class FileInputType : public InputType {
+public:
+ static PassOwnPtr<InputType> create(HTMLInputElement*);
+
+private:
+ FileInputType(HTMLInputElement* element) : InputType(element) { }
+ virtual const AtomicString& formControlType() const;
+};
+
+} // namespace WebCore
+
+#endif // FileInputType_h
diff --git a/WebCore/html/HTMLAnchorElement.cpp b/WebCore/html/HTMLAnchorElement.cpp
index 995552e..8beccc2 100644
--- a/WebCore/html/HTMLAnchorElement.cpp
+++ b/WebCore/html/HTMLAnchorElement.cpp
@@ -33,6 +33,7 @@
#include "KeyboardEvent.h"
#include "MouseEvent.h"
#include "Page.h"
+#include "PingLoader.h"
#include "RenderImage.h"
#include "ResourceHandle.h"
#include "Settings.h"
@@ -147,6 +148,7 @@ void HTMLAnchorElement::defaultEventHandler(Event* event)
String url = deprecatedParseURL(getAttribute(hrefAttr));
appendServerMapMousePosition(url, event);
handleLinkClick(event, document(), url, getAttribute(targetAttr), hasRel(RelationNoReferrer));
+ sendPings(document()->completeURL(url));
return;
}
@@ -440,6 +442,12 @@ String HTMLAnchorElement::search() const
return query.isEmpty() ? "" : "?" + query;
}
+String HTMLAnchorElement::origin() const
+{
+ RefPtr<SecurityOrigin> origin = SecurityOrigin::create(href());
+ return origin->toString();
+}
+
void HTMLAnchorElement::setSearch(const String& value)
{
KURL url = href();
@@ -465,6 +473,16 @@ bool HTMLAnchorElement::isLiveLink() const
return isLink() && treatLinkAsLiveForEventType(m_wasShiftKeyDownOnMouseDown ? MouseEventWithShiftKey : MouseEventWithoutShiftKey);
}
+void HTMLAnchorElement::sendPings(const KURL& destinationURL)
+{
+ if (!hasAttribute(pingAttr) || !document()->settings()->hyperlinkAuditingEnabled())
+ return;
+
+ SpaceSplitString pingURLs(getAttribute(pingAttr), true);
+ for (unsigned i = 0; i < pingURLs.size(); i++)
+ PingLoader::sendPing(document()->frame(), document()->completeURL(pingURLs[i]), destinationURL);
+}
+
HTMLAnchorElement::EventType HTMLAnchorElement::eventType(Event* event)
{
if (!event->isMouseEvent())
diff --git a/WebCore/html/HTMLAnchorElement.h b/WebCore/html/HTMLAnchorElement.h
index 16baff1..a7e7eec 100644
--- a/WebCore/html/HTMLAnchorElement.h
+++ b/WebCore/html/HTMLAnchorElement.h
@@ -82,6 +82,8 @@ public:
String search() const;
void setSearch(const String&);
+ String origin() const;
+
String text() const;
String toString() const;
@@ -109,6 +111,8 @@ private:
virtual short tabIndex() const;
virtual bool draggable() const;
+ void sendPings(const KURL& destinationURL);
+
enum EventType {
MouseEventWithoutShiftKey,
MouseEventWithShiftKey,
diff --git a/WebCore/html/HTMLAnchorElement.idl b/WebCore/html/HTMLAnchorElement.idl
index f5e1bd9..c918fde 100644
--- a/WebCore/html/HTMLAnchorElement.idl
+++ b/WebCore/html/HTMLAnchorElement.idl
@@ -49,6 +49,8 @@ module html {
attribute [ConvertNullToNullString] DOMString port;
attribute [ConvertNullToNullString] DOMString protocol;
attribute [ConvertNullToNullString] DOMString search;
+
+ readonly attribute [ConvertNullToNullString] DOMString origin;
#endif
readonly attribute DOMString text;
diff --git a/WebCore/html/HTMLAttributeNames.in b/WebCore/html/HTMLAttributeNames.in
index 103d2c6..7a80c13 100644
--- a/WebCore/html/HTMLAttributeNames.in
+++ b/WebCore/html/HTMLAttributeNames.in
@@ -229,6 +229,7 @@ optimum
pattern
placeholder
pluginurl
+ping
poster
precision
preload
@@ -257,7 +258,7 @@ size
sortable
sortdirection
span
-speech
+webkitspeech
spellcheck
src
standby
diff --git a/WebCore/html/HTMLCanvasElement.cpp b/WebCore/html/HTMLCanvasElement.cpp
index 6f46ab4..634fe13 100644
--- a/WebCore/html/HTMLCanvasElement.cpp
+++ b/WebCore/html/HTMLCanvasElement.cpp
@@ -377,7 +377,7 @@ void HTMLCanvasElement::createImageBuffer() const
return;
m_imageBuffer->context()->scale(FloatSize(size.width() / unscaledSize.width(), size.height() / unscaledSize.height()));
m_imageBuffer->context()->setShadowsIgnoreTransforms(true);
- m_imageBuffer->context()->setImageInterpolationQuality(CanvasInterpolationQuality);
+ m_imageBuffer->context()->setImageInterpolationQuality(DefaultInterpolationQuality);
}
GraphicsContext* HTMLCanvasElement::drawingContext() const
diff --git a/WebCore/html/HTMLCanvasElement.h b/WebCore/html/HTMLCanvasElement.h
index 01665c8..e6c0155 100644
--- a/WebCore/html/HTMLCanvasElement.h
+++ b/WebCore/html/HTMLCanvasElement.h
@@ -32,6 +32,14 @@
#include "HTMLElement.h"
#include "IntSize.h"
+#if PLATFORM(CHROMIUM)
+#define DefaultInterpolationQuality InterpolationMedium
+#elif PLATFORM(CG)
+#define DefaultInterpolationQuality InterpolationLow
+#else
+#define DefaultInterpolationQuality InterpolationDefault
+#endif
+
namespace WebCore {
class CanvasContextAttributes;
diff --git a/WebCore/html/HTMLDocument.cpp b/WebCore/html/HTMLDocument.cpp
index f9efc4f..e20e729 100644
--- a/WebCore/html/HTMLDocument.cpp
+++ b/WebCore/html/HTMLDocument.cpp
@@ -64,6 +64,7 @@
#include "FrameLoader.h"
#include "FrameTree.h"
#include "FrameView.h"
+#include "HashTools.h"
#include "HTMLDocumentParser.h"
#include "HTMLBodyElement.h"
#include "HTMLElementFactory.h"
@@ -74,8 +75,6 @@
#include "Settings.h"
#include <wtf/text/CString.h>
-#include "DocTypeStrings.cpp"
-
namespace WebCore {
using namespace HTMLNames;
diff --git a/WebCore/html/HTMLElement.idl b/WebCore/html/HTMLElement.idl
index 863f28c..b127c51 100644
--- a/WebCore/html/HTMLElement.idl
+++ b/WebCore/html/HTMLElement.idl
@@ -31,6 +31,7 @@ module html {
attribute [Reflect] DOMString lang;
attribute [Reflect] DOMString dir;
attribute [Reflect=class] DOMString className;
+ readonly attribute DOMTokenList classList;
attribute long tabIndex;
attribute boolean draggable;
diff --git a/WebCore/html/HTMLImageElement.cpp b/WebCore/html/HTMLImageElement.cpp
index d223b1e..29ea592 100644
--- a/WebCore/html/HTMLImageElement.cpp
+++ b/WebCore/html/HTMLImageElement.cpp
@@ -180,7 +180,7 @@ String HTMLImageElement::altText() const
RenderObject* HTMLImageElement::createRenderer(RenderArena* arena, RenderStyle* style)
{
- if (style->contentData())
+ if (style->contentData())
return RenderObject::createObject(this, style);
RenderImage* image = new (arena) RenderImage(this);
diff --git a/WebCore/html/HTMLInputElement.cpp b/WebCore/html/HTMLInputElement.cpp
index 67b0c03..7e01de5 100644
--- a/WebCore/html/HTMLInputElement.cpp
+++ b/WebCore/html/HTMLInputElement.cpp
@@ -51,6 +51,7 @@
#include "HTMLNames.h"
#include "HTMLOptionElement.h"
#include "HTMLParserIdioms.h"
+#include "InputType.h"
#include "KeyboardEvent.h"
#include "LocalizedStrings.h"
#include "MouseEvent.h"
@@ -164,6 +165,7 @@ HTMLInputElement::HTMLInputElement(const QualifiedName& tagName, Document* docum
, m_autocomplete(Uninitialized)
, m_autofilled(false)
, m_inited(false)
+ , m_inputType(InputType::createText(this))
{
ASSERT(hasTagName(inputTag) || hasTagName(isindexTag));
}
@@ -348,17 +350,7 @@ bool HTMLInputElement::valueMissing(const String& value) const
bool HTMLInputElement::patternMismatch(const String& value) const
{
- if (!isTextType())
- return false;
- const AtomicString& pattern = getAttribute(patternAttr);
- // Empty values can't be mismatched
- if (pattern.isEmpty() || value.isEmpty())
- return false;
- RegularExpression patternRegExp(pattern, TextCaseSensitive);
- int matchLength = 0;
- int valueLength = value.length();
- int matchOffset = patternRegExp.match(value, 0, &matchLength);
- return matchOffset || matchLength != valueLength;
+ return m_inputType->patternMismatch(value);
}
bool HTMLInputElement::tooLong(const String& value, NeedsToCheckDirtyFlag check) const
@@ -918,6 +910,7 @@ void HTMLInputElement::updateType()
bool wasPasswordField = deprecatedInputType() == PASSWORD;
bool didRespectHeightAndWidth = respectHeightAndWidthAttrs();
m_deprecatedTypeNumber = newType;
+ m_inputType = InputType::create(this, typeString);
setNeedsWillValidateCheck();
bool willStoreValue = storesValueSeparateFromAttribute();
bool isPasswordField = deprecatedInputType() == PASSWORD;
@@ -966,42 +959,9 @@ void HTMLInputElement::updateType()
m_imageLoader.clear();
}
-static const AtomicString* createFormControlTypes()
-{
- AtomicString* types = new AtomicString[HTMLInputElement::deprecatedNumberOfTypes];
- // The values must be lowercased because they will be the return values of
- // input.type and it must be lowercase according to DOM Level 2.
- types[HTMLInputElement::BUTTON] = "button";
- types[HTMLInputElement::CHECKBOX] = "checkbox";
- types[HTMLInputElement::COLOR] = "color";
- types[HTMLInputElement::DATE] = "date";
- types[HTMLInputElement::DATETIME] = "datetime";
- types[HTMLInputElement::DATETIMELOCAL] = "datetime-local";
- types[HTMLInputElement::EMAIL] = "email";
- types[HTMLInputElement::FILE] = "file";
- types[HTMLInputElement::HIDDEN] = "hidden";
- types[HTMLInputElement::IMAGE] = "image";
- types[HTMLInputElement::ISINDEX] = emptyAtom;
- types[HTMLInputElement::MONTH] = "month";
- types[HTMLInputElement::NUMBER] = "number";
- types[HTMLInputElement::PASSWORD] = "password";
- types[HTMLInputElement::RADIO] = "radio";
- types[HTMLInputElement::RANGE] = "range";
- types[HTMLInputElement::RESET] = "reset";
- types[HTMLInputElement::SEARCH] = "search";
- types[HTMLInputElement::SUBMIT] = "submit";
- types[HTMLInputElement::TELEPHONE] = "tel";
- types[HTMLInputElement::TEXT] = "text";
- types[HTMLInputElement::TIME] = "time";
- types[HTMLInputElement::URL] = "url";
- types[HTMLInputElement::WEEK] = "week";
- return types;
-}
-
const AtomicString& HTMLInputElement::formControlType() const
{
- static const AtomicString* formControlTypes = createFormControlTypes();
- return formControlTypes[deprecatedInputType()];
+ return m_inputType->formControlType();
}
bool HTMLInputElement::saveFormControlState(String& result) const
@@ -1255,7 +1215,7 @@ void HTMLInputElement::parseMappedAttribute(Attribute* attr)
// FIXME: we need to tell this change to a renderer if the attribute affects the appearance.
#endif
#if ENABLE(INPUT_SPEECH)
- else if (attr->name() == speechAttr) {
+ else if (attr->name() == webkitspeechAttr) {
if (renderer())
renderer()->updateFromElement();
setNeedsStyleRecalc();
@@ -1488,70 +1448,12 @@ void HTMLInputElement::reset()
bool HTMLInputElement::isTextField() const
{
- switch (deprecatedInputType()) {
- case COLOR:
- case DATE:
- case DATETIME:
- case DATETIMELOCAL:
- case EMAIL:
- case ISINDEX:
- case MONTH:
- case NUMBER:
- case PASSWORD:
- case SEARCH:
- case TELEPHONE:
- case TEXT:
- case TIME:
- case URL:
- case WEEK:
- return true;
- case BUTTON:
- case CHECKBOX:
- case FILE:
- case HIDDEN:
- case IMAGE:
- case RADIO:
- case RANGE:
- case RESET:
- case SUBMIT:
- return false;
- }
- ASSERT_NOT_REACHED();
- return false;
+ return m_inputType->isTextField();
}
bool HTMLInputElement::isTextType() const
{
- switch (deprecatedInputType()) {
- case EMAIL:
- case PASSWORD:
- case SEARCH:
- case TELEPHONE:
- case TEXT:
- case URL:
- return true;
- case BUTTON:
- case CHECKBOX:
- case COLOR:
- case DATE:
- case DATETIME:
- case DATETIMELOCAL:
- case FILE:
- case HIDDEN:
- case IMAGE:
- case ISINDEX:
- case MONTH:
- case NUMBER:
- case RADIO:
- case RANGE:
- case RESET:
- case SUBMIT:
- case TIME:
- case WEEK:
- return false;
- }
- ASSERT_NOT_REACHED();
- return false;
+ return m_inputType->isTextType();
}
void HTMLInputElement::setChecked(bool nowChecked, bool sendChangeEvent)
@@ -2277,6 +2179,11 @@ void HTMLInputElement::defaultEventHandler(Event* evt)
return;
}
}
+ if (deprecatedInputType() == RANGE && evt->isKeyboardEvent()) {
+ handleKeyEventForRange(static_cast<KeyboardEvent*>(evt));
+ if (evt->defaultHandled())
+ return;
+ }
if (isTextField()
&& evt->type() == eventNames().keydownEvent
@@ -2583,6 +2490,47 @@ void HTMLInputElement::handleBeforeTextInsertedEvent(Event* event)
InputElement::handleBeforeTextInsertedEvent(m_data, this, this, event);
}
+void HTMLInputElement::handleKeyEventForRange(KeyboardEvent* event)
+{
+ if (event->type() != eventNames().keydownEvent)
+ return;
+ String key = event->keyIdentifier();
+ if (key != "Up" && key != "Right" && key != "Down" && key != "Left")
+ return;
+
+ ExceptionCode ec;
+ if (equalIgnoringCase(getAttribute(stepAttr), "any")) {
+ double min = minimum();
+ double max = maximum();
+ // FIXME: Is 1/100 reasonable?
+ double step = (max - min) / 100;
+ double current = parseToDouble(value(), numeric_limits<double>::quiet_NaN());
+ ASSERT(isfinite(current));
+ double newValue;
+ if (key == "Up" || key == "Right") {
+ newValue = current + step;
+ if (newValue > max)
+ newValue = max;
+ } else {
+ newValue = current - step;
+ if (newValue < min)
+ newValue = min;
+ }
+ if (newValue != current) {
+ setValueAsNumber(newValue, ec);
+ dispatchFormControlChangeEvent();
+ }
+ } else {
+ int stepMagnification = (key == "Up" || key == "Right") ? 1 : -1;
+ String lastStringValue = value();
+ stepUp(stepMagnification, ec);
+ if (lastStringValue != value())
+ dispatchFormControlChangeEvent();
+ }
+ event->setDefaultHandled();
+ return;
+}
+
PassRefPtr<HTMLFormElement> HTMLInputElement::createTemporaryFormForIsIndex()
{
RefPtr<HTMLFormElement> form = HTMLFormElement::create(document());
@@ -3010,7 +2958,7 @@ bool HTMLInputElement::isSpeechEnabled() const
case SEARCH:
case TELEPHONE:
case TEXT:
- return hasAttribute(speechAttr);
+ return hasAttribute(webkitspeechAttr);
case BUTTON:
case CHECKBOX:
case COLOR:
diff --git a/WebCore/html/HTMLInputElement.h b/WebCore/html/HTMLInputElement.h
index 7e601ca..88e2bf7 100644
--- a/WebCore/html/HTMLInputElement.h
+++ b/WebCore/html/HTMLInputElement.h
@@ -35,6 +35,7 @@ class FileList;
class HTMLDataListElement;
class HTMLImageLoader;
class HTMLOptionElement;
+class InputType;
class KURL;
class VisibleSelection;
@@ -65,9 +66,7 @@ public:
MONTH,
TIME,
WEEK,
- // If you add new types or change the order of enum values, update deprecatedNumberOfTypes below.
};
- static const int deprecatedNumberOfTypes = WEEK + 1;
static PassRefPtr<HTMLInputElement> create(const QualifiedName&, Document*, HTMLFormElement*);
virtual ~HTMLInputElement();
@@ -325,6 +324,7 @@ private:
void updateCheckedRadioButtons();
void handleBeforeTextInsertedEvent(Event*);
+ void handleKeyEventForRange(KeyboardEvent*);
PassRefPtr<HTMLFormElement> createTemporaryFormForIsIndex();
// Helper for getAllowedValueStep();
bool getStepParameters(double* defaultStep, double* stepScaleFactor) const;
@@ -374,6 +374,7 @@ private:
#if ENABLE(DATALIST)
bool m_hasNonEmptyList : 1;
#endif
+ OwnPtr<InputType> m_inputType;
};
} //namespace
diff --git a/WebCore/html/HTMLInputElement.idl b/WebCore/html/HTMLInputElement.idl
index 19e4226..19dfa5a 100644
--- a/WebCore/html/HTMLInputElement.idl
+++ b/WebCore/html/HTMLInputElement.idl
@@ -100,7 +100,7 @@ module html {
readonly attribute NodeList labels;
#if defined(ENABLE_INPUT_SPEECH) && ENABLE_INPUT_SPEECH
- attribute [Reflect, EnabledAtRuntime] boolean speech;
+ attribute [Reflect, EnabledAtRuntime] boolean webkitspeech;
#endif
};
diff --git a/WebCore/html/HTMLMediaElement.cpp b/WebCore/html/HTMLMediaElement.cpp
index f753183..6399f60 100644
--- a/WebCore/html/HTMLMediaElement.cpp
+++ b/WebCore/html/HTMLMediaElement.cpp
@@ -969,22 +969,16 @@ void HTMLMediaElement::setReadyState(MediaPlayer::ReadyState state)
return;
if (m_seeking) {
- // 4.8.10.10, step 8
+ // 4.8.10.9, step 11
if (wasPotentiallyPlaying && m_readyState < HAVE_FUTURE_DATA)
scheduleEvent(eventNames().waitingEvent);
- // 4.8.10.10, step 9
- if (m_readyState < HAVE_CURRENT_DATA) {
- if (oldState >= HAVE_CURRENT_DATA)
- scheduleEvent(eventNames().seekingEvent);
- } else {
- // 4.8.10.10 step 12 & 13.
+ // 4.8.10.10 step 14 & 15.
+ if (m_readyState >= HAVE_CURRENT_DATA)
finishSeek();
- }
-
} else {
if (wasPotentiallyPlaying && m_readyState < HAVE_FUTURE_DATA) {
- // 4.8.10.9
+ // 4.8.10.8
scheduleTimeupdateEvent(false);
scheduleEvent(eventNames().waitingEvent);
}
@@ -1107,27 +1101,39 @@ void HTMLMediaElement::seek(float time, ExceptionCode& ec)
// Get the current time before setting m_seeking, m_lastSeekTime is returned once it is set.
float now = currentTime();
+ // 2 - If the element's seeking IDL attribute is true, then another instance of this algorithm is
+ // already running. Abort that other instance of the algorithm without waiting for the step that
+ // it is running to complete.
+ // Nothing specific to be done here.
+
// 3 - Set the seeking IDL attribute to true.
- // The flag will be cleared when the engine tells is the time has actually changed
+ // The flag will be cleared when the engine tells us the time has actually changed.
m_seeking = true;
- // 4 - Queue a task to fire a simple event named timeupdate at the element.
- scheduleTimeupdateEvent(false);
-
- // 6 - If the new playback position is later than the end of the media resource, then let it be the end
+ // 5 - If the new playback position is later than the end of the media resource, then let it be the end
// of the media resource instead.
time = min(time, duration());
- // 7 - If the new playback position is less than the earliest possible position, let it be that position instead.
+ // 6 - If the new playback position is less than the earliest possible position, let it be that position instead.
float earliestTime = m_player->startTime();
time = max(time, earliestTime);
- // 8 - If the (possibly now changed) new playback position is not in one of the ranges given in the
+ // 7 - If the (possibly now changed) new playback position is not in one of the ranges given in the
// seekable attribute, then let it be the position in one of the ranges given in the seekable attribute
// that is the nearest to the new playback position. ... If there are no ranges given in the seekable
// attribute then set the seeking IDL attribute to false and abort these steps.
RefPtr<TimeRanges> seekableRanges = seekable();
- if (!seekableRanges->length() || time == now) {
+
+ // Short circuit seeking to the current time by just firing the events if no seek is required.
+ // Don't skip calling the media engine if we are in poster mode because a seek should always
+ // cancel poster display.
+ bool noSeekRequired = !seekableRanges->length() || (time == now && displayMode() != Poster);
+ if (noSeekRequired) {
+ if (time == now) {
+ scheduleEvent(eventNames().seekingEvent);
+ scheduleTimeupdateEvent(false);
+ scheduleEvent(eventNames().seekedEvent);
+ }
m_seeking = false;
return;
}
@@ -1140,20 +1146,26 @@ void HTMLMediaElement::seek(float time, ExceptionCode& ec)
m_lastSeekTime = time;
m_sentEndEvent = false;
- // 9 - Set the current playback position to the given new playback position
+ // 8 - Set the current playback position to the given new playback position
m_player->seek(time);
- // 10-15 are handled, if necessary, when the engine signals a readystate change.
+ // 9 - Queue a task to fire a simple event named seeking at the element.
+ scheduleEvent(eventNames().seekingEvent);
+
+ // 10 - Queue a task to fire a simple event named timeupdate at the element.
+ scheduleTimeupdateEvent(false);
+
+ // 11-15 are handled, if necessary, when the engine signals a readystate change.
}
void HTMLMediaElement::finishSeek()
{
LOG(Media, "HTMLMediaElement::finishSeek");
- // 4.8.10.10 Seeking step 12
+ // 4.8.10.9 Seeking step 14
m_seeking = false;
- // 4.8.10.10 Seeking step 13
+ // 4.8.10.9 Seeking step 15
scheduleEvent(eventNames().seekedEvent);
setDisplayMode(Video);
@@ -1666,8 +1678,8 @@ void HTMLMediaElement::mediaPlayerTimeChanged(MediaPlayer*)
// movie time.
scheduleTimeupdateEvent(false);
- // 4.8.10.10 step 12 & 13. Needed if no ReadyState change is associated with the seek.
- if (m_readyState >= HAVE_CURRENT_DATA && m_seeking)
+ // 4.8.10.9 step 14 & 15. Needed if no ReadyState change is associated with the seek.
+ if (m_seeking && m_readyState >= HAVE_CURRENT_DATA)
finishSeek();
float now = currentTime();
diff --git a/WebCore/html/HTMLTextAreaElement.cpp b/WebCore/html/HTMLTextAreaElement.cpp
index ad6c1b3..a5e7d1e 100644
--- a/WebCore/html/HTMLTextAreaElement.cpp
+++ b/WebCore/html/HTMLTextAreaElement.cpp
@@ -291,12 +291,20 @@ String HTMLTextAreaElement::value() const
void HTMLTextAreaElement::setValue(const String& value)
{
- setNonDirtyValue(value);
+ setValueCommon(value);
m_isDirty = true;
+ setNeedsValidityCheck();
}
void HTMLTextAreaElement::setNonDirtyValue(const String& value)
{
+ setValueCommon(value);
+ m_isDirty = false;
+ setNeedsValidityCheck();
+}
+
+void HTMLTextAreaElement::setValueCommon(const String& value)
+{
// Code elsewhere normalizes line endings added by the user via the keyboard or pasting.
// We normalize line endings coming from JavaScript here.
String normalizedValue = value.isNull() ? "" : value;
@@ -311,8 +319,6 @@ void HTMLTextAreaElement::setNonDirtyValue(const String& value)
m_value = normalizedValue;
updatePlaceholderVisibility(false);
setNeedsStyleRecalc();
- setNeedsValidityCheck();
- m_isDirty = false;
setFormControlValueMatchesRenderer(true);
// Set the caret to the end of the text value.
diff --git a/WebCore/html/HTMLTextAreaElement.h b/WebCore/html/HTMLTextAreaElement.h
index 28d0b61..d951c02 100644
--- a/WebCore/html/HTMLTextAreaElement.h
+++ b/WebCore/html/HTMLTextAreaElement.h
@@ -67,6 +67,7 @@ private:
static String sanitizeUserInputValue(const String&, unsigned maxLength);
void updateValue() const;
void setNonDirtyValue(const String&);
+ void setValueCommon(const String&);
virtual bool supportsPlaceholder() const { return true; }
virtual bool isEmptyValue() const { return value().isEmpty(); }
diff --git a/WebCore/html/HiddenInputType.cpp b/WebCore/html/HiddenInputType.cpp
new file mode 100644
index 0000000..d97fe3a
--- /dev/null
+++ b/WebCore/html/HiddenInputType.cpp
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "HiddenInputType.h"
+
+#include <wtf/PassOwnPtr.h>
+
+namespace WebCore {
+
+PassOwnPtr<InputType> HiddenInputType::create(HTMLInputElement* element)
+{
+ return adoptPtr(new HiddenInputType(element));
+}
+
+const AtomicString& HiddenInputType::formControlType() const {
+ return InputTypeNames::hidden();
+}
+
+} // namespace WebCore
diff --git a/WebCore/html/HiddenInputType.h b/WebCore/html/HiddenInputType.h
new file mode 100644
index 0000000..564f99e
--- /dev/null
+++ b/WebCore/html/HiddenInputType.h
@@ -0,0 +1,49 @@
+/*
+ * 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 HiddenInputType_h
+#define HiddenInputType_h
+
+#include "InputType.h"
+
+namespace WebCore {
+
+class HiddenInputType : public InputType {
+public:
+ static PassOwnPtr<InputType> create(HTMLInputElement*);
+
+private:
+ HiddenInputType(HTMLInputElement* element) : InputType(element) { }
+ virtual const AtomicString& formControlType() const;
+};
+
+} // namespace WebCore
+
+#endif // HiddenInputType_h
diff --git a/WebCore/html/ImageInputType.cpp b/WebCore/html/ImageInputType.cpp
new file mode 100644
index 0000000..78b3981
--- /dev/null
+++ b/WebCore/html/ImageInputType.cpp
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "ImageInputType.h"
+
+#include <wtf/PassOwnPtr.h>
+
+namespace WebCore {
+
+PassOwnPtr<InputType> ImageInputType::create(HTMLInputElement* element)
+{
+ return adoptPtr(new ImageInputType(element));
+}
+
+const AtomicString& ImageInputType::formControlType() const
+{
+ return InputTypeNames::image();
+}
+
+} // namespace WebCore
diff --git a/WebCore/html/ImageInputType.h b/WebCore/html/ImageInputType.h
new file mode 100644
index 0000000..00ac77b
--- /dev/null
+++ b/WebCore/html/ImageInputType.h
@@ -0,0 +1,49 @@
+/*
+ * 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 ImageInputType_h
+#define ImageInputType_h
+
+#include "InputType.h"
+
+namespace WebCore {
+
+class ImageInputType : public InputType {
+public:
+ static PassOwnPtr<InputType> create(HTMLInputElement*);
+
+private:
+ ImageInputType(HTMLInputElement* element) : InputType(element) { }
+ virtual const AtomicString& formControlType() const;
+};
+
+} // namespace WebCore
+
+#endif // ImageInputType_h
diff --git a/WebCore/html/InputType.cpp b/WebCore/html/InputType.cpp
new file mode 100644
index 0000000..c3435f7
--- /dev/null
+++ b/WebCore/html/InputType.cpp
@@ -0,0 +1,277 @@
+/*
+ * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
+ * (C) 1999 Antti Koivisto (koivisto@kde.org)
+ * (C) 2001 Dirk Mueller (mueller@kde.org)
+ * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 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.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "config.h"
+#include "InputType.h"
+
+#include "ButtonInputType.h"
+#include "CheckboxInputType.h"
+#include "ColorInputType.h"
+#include "DateInputType.h"
+#include "DateTimeInputType.h"
+#include "DateTimeLocalInputType.h"
+#include "EmailInputType.h"
+#include "FileInputType.h"
+#include "HTMLInputElement.h"
+#include "HiddenInputType.h"
+#include "ImageInputType.h"
+#include "IsIndexInputType.h"
+#include "MonthInputType.h"
+#include "NumberInputType.h"
+#include "PasswordInputType.h"
+#include "RadioInputType.h"
+#include "RangeInputType.h"
+#include "RegularExpression.h"
+#include "ResetInputType.h"
+#include "SearchInputType.h"
+#include "SubmitInputType.h"
+#include "TelephoneInputType.h"
+#include "TextInputType.h"
+#include "TimeInputType.h"
+#include "URLInputType.h"
+#include "WeekInputType.h"
+#include <wtf/HashMap.h>
+#include <wtf/text/StringHash.h>
+
+namespace WebCore {
+
+typedef HashMap<String, PassOwnPtr<InputType> (*)(HTMLInputElement*), CaseFoldingHash> InputTypeFactoryMap;
+static PassOwnPtr<InputTypeFactoryMap> createInputTypeFactoryMap()
+{
+ OwnPtr<InputTypeFactoryMap> map = adoptPtr(new InputTypeFactoryMap);
+ map->add(InputTypeNames::button(), ButtonInputType::create);
+ map->add(InputTypeNames::checkbox(), CheckboxInputType::create);
+ map->add(InputTypeNames::color(), ColorInputType::create);
+ map->add(InputTypeNames::date(), DateInputType::create);
+ map->add(InputTypeNames::datetime(), DateTimeInputType::create);
+ map->add(InputTypeNames::datetimelocal(), DateTimeLocalInputType::create);
+ map->add(InputTypeNames::email(), EmailInputType::create);
+ map->add(InputTypeNames::file(), FileInputType::create);
+ map->add(InputTypeNames::hidden(), HiddenInputType::create);
+ map->add(InputTypeNames::image(), ImageInputType::create);
+ map->add(InputTypeNames::isindex(), IsIndexInputType::create);
+ map->add(InputTypeNames::month(), MonthInputType::create);
+ map->add(InputTypeNames::number(), NumberInputType::create);
+ map->add(InputTypeNames::password(), PasswordInputType::create);
+ map->add(InputTypeNames::radio(), RadioInputType::create);
+ map->add(InputTypeNames::range(), RangeInputType::create);
+ map->add(InputTypeNames::reset(), ResetInputType::create);
+ map->add(InputTypeNames::search(), SearchInputType::create);
+ map->add(InputTypeNames::submit(), SubmitInputType::create);
+ map->add(InputTypeNames::telephone(), TelephoneInputType::create);
+ map->add(InputTypeNames::time(), TimeInputType::create);
+ map->add(InputTypeNames::url(), URLInputType::create);
+ map->add(InputTypeNames::week(), WeekInputType::create);
+ // No need to register "text" because it is the default type.
+ return map.release();
+}
+
+PassOwnPtr<InputType> InputType::create(HTMLInputElement* element, const AtomicString& typeName)
+{
+ static const InputTypeFactoryMap* factoryMap = createInputTypeFactoryMap().leakPtr();
+ PassOwnPtr<InputType> (*factory)(HTMLInputElement*) = typeName.isEmpty() ? 0 : factoryMap->get(typeName);
+ if (!factory)
+ factory = TextInputType::create;
+ return factory(element);
+}
+
+PassOwnPtr<InputType> InputType::createText(HTMLInputElement* element)
+{
+ return TextInputType::create(element);
+}
+
+InputType::~InputType()
+{
+}
+
+bool InputType::isTextField() const
+{
+ return false;
+}
+
+bool InputType::isTextType() const
+{
+ return false;
+}
+
+bool InputType::patternMismatch(const String&) const
+{
+ return false;
+}
+
+namespace InputTypeNames {
+
+// The type names must be lowercased because they will be the return values of
+// input.type and input.type must be lowercase according to DOM Level 2.
+
+const AtomicString& button()
+{
+ DEFINE_STATIC_LOCAL(AtomicString, name, ("button"));
+ return name;
+}
+
+const AtomicString& checkbox()
+{
+ DEFINE_STATIC_LOCAL(AtomicString, name, ("checkbox"));
+ return name;
+}
+
+const AtomicString& color()
+{
+ DEFINE_STATIC_LOCAL(AtomicString, name, ("color"));
+ return name;
+}
+
+const AtomicString& date()
+{
+ DEFINE_STATIC_LOCAL(AtomicString, name, ("date"));
+ return name;
+}
+
+const AtomicString& datetime()
+{
+ DEFINE_STATIC_LOCAL(AtomicString, name, ("datetime"));
+ return name;
+}
+
+const AtomicString& datetimelocal()
+{
+ DEFINE_STATIC_LOCAL(AtomicString, name, ("datetime-local"));
+ return name;
+}
+
+const AtomicString& email()
+{
+ DEFINE_STATIC_LOCAL(AtomicString, name, ("email"));
+ return name;
+}
+
+const AtomicString& file()
+{
+ DEFINE_STATIC_LOCAL(AtomicString, name, ("file"));
+ return name;
+}
+
+const AtomicString& hidden()
+{
+ DEFINE_STATIC_LOCAL(AtomicString, name, ("hidden"));
+ return name;
+}
+
+const AtomicString& image()
+{
+ DEFINE_STATIC_LOCAL(AtomicString, name, ("image"));
+ return name;
+}
+
+const AtomicString& isindex()
+{
+ DEFINE_STATIC_LOCAL(AtomicString, name, ("khtml_isindex"));
+ return name;
+}
+
+const AtomicString& month()
+{
+ DEFINE_STATIC_LOCAL(AtomicString, name, ("month"));
+ return name;
+}
+
+const AtomicString& number()
+{
+ DEFINE_STATIC_LOCAL(AtomicString, name, ("number"));
+ return name;
+}
+
+const AtomicString& password()
+{
+ DEFINE_STATIC_LOCAL(AtomicString, name, ("password"));
+ return name;
+}
+
+const AtomicString& radio()
+{
+ DEFINE_STATIC_LOCAL(AtomicString, name, ("radio"));
+ return name;
+}
+
+const AtomicString& range()
+{
+ DEFINE_STATIC_LOCAL(AtomicString, name, ("range"));
+ return name;
+}
+
+const AtomicString& reset()
+{
+ DEFINE_STATIC_LOCAL(AtomicString, name, ("reset"));
+ return name;
+}
+
+const AtomicString& search()
+{
+ DEFINE_STATIC_LOCAL(AtomicString, name, ("search"));
+ return name;
+}
+
+const AtomicString& submit()
+{
+ DEFINE_STATIC_LOCAL(AtomicString, name, ("submit"));
+ return name;
+}
+
+const AtomicString& telephone()
+{
+ DEFINE_STATIC_LOCAL(AtomicString, name, ("tel"));
+ return name;
+}
+
+const AtomicString& text()
+{
+ DEFINE_STATIC_LOCAL(AtomicString, name, ("text"));
+ return name;
+}
+
+const AtomicString& time()
+{
+ DEFINE_STATIC_LOCAL(AtomicString, name, ("time"));
+ return name;
+}
+
+const AtomicString& url()
+{
+ DEFINE_STATIC_LOCAL(AtomicString, name, ("url"));
+ return name;
+}
+
+const AtomicString& week()
+{
+ DEFINE_STATIC_LOCAL(AtomicString, name, ("week"));
+ return name;
+}
+
+} // namespace WebCore::InpuTypeNames
+
+} // namespace WebCore
+
diff --git a/WebCore/platform/chromium/GLES2Context.h b/WebCore/html/InputType.h
index d37885a..3141f34 100644
--- a/WebCore/platform/chromium/GLES2Context.h
+++ b/WebCore/html/InputType.h
@@ -28,43 +28,66 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef GLES2Context_h
-#define GLES2Context_h
+#ifndef InputType_h
+#define InputType_h
+#include <wtf/Forward.h>
#include <wtf/Noncopyable.h>
-#include <wtf/OwnPtr.h>
-#include <wtf/PassOwnPtr.h>
namespace WebCore {
-class GLES2ContextInternal;
-class IntSize;
-class Page;
+class HTMLInputElement;
-class GLES2Context : public Noncopyable {
+class InputType : public Noncopyable {
public:
- // Used by the implementation only
- static PassOwnPtr<GLES2Context> create(PassOwnPtr<GLES2ContextInternal>);
- ~GLES2Context();
+ static PassOwnPtr<InputType> create(HTMLInputElement*, const AtomicString&);
+ static PassOwnPtr<InputType> createText(HTMLInputElement*);
+ virtual ~InputType();
- bool makeCurrent();
- bool destroy();
- bool swapBuffers();
+ virtual bool isTextField() const;
+ virtual bool isTextType() const;
+ virtual const AtomicString& formControlType() const = 0;
- // Only valid for offscreen contexts.
- void resizeOffscreenContent(const IntSize&);
+ virtual bool patternMismatch(const String&) const;
- // Returns the ID of the texture used for offscreen rendering in the context of the parent.
- // This texture is accessible by the GPU page compositor.
- unsigned getOffscreenContentParentTextureId();
+protected:
+ InputType(HTMLInputElement* element) : m_element(element) { }
+ HTMLInputElement* element() const { return m_element; }
private:
- GLES2Context();
-
- friend class GLES2ContextInternal;
- OwnPtr<GLES2ContextInternal> m_internal;
+ // Raw pointer because the HTMLInputElement object owns this InputType object.
+ HTMLInputElement* m_element;
};
+namespace InputTypeNames {
+
+const AtomicString& button();
+const AtomicString& checkbox();
+const AtomicString& color();
+const AtomicString& date();
+const AtomicString& datetime();
+const AtomicString& datetimelocal();
+const AtomicString& email();
+const AtomicString& file();
+const AtomicString& hidden();
+const AtomicString& image();
+const AtomicString& isindex();
+const AtomicString& month();
+const AtomicString& number();
+const AtomicString& password();
+const AtomicString& radio();
+const AtomicString& range();
+const AtomicString& reset();
+const AtomicString& search();
+const AtomicString& submit();
+const AtomicString& telephone();
+const AtomicString& text();
+const AtomicString& time();
+const AtomicString& url();
+const AtomicString& week();
+
+} // namespace WebCore::InputTypeNames
+
} // namespace WebCore
#endif
diff --git a/WebCore/html/IsIndexInputType.cpp b/WebCore/html/IsIndexInputType.cpp
new file mode 100644
index 0000000..80e0617
--- /dev/null
+++ b/WebCore/html/IsIndexInputType.cpp
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "IsIndexInputType.h"
+
+#include <wtf/PassOwnPtr.h>
+
+namespace WebCore {
+
+PassOwnPtr<InputType> IsIndexInputType::create(HTMLInputElement* element)
+{
+ return adoptPtr(new IsIndexInputType(element));
+}
+
+const AtomicString& IsIndexInputType::formControlType() const
+{
+ return emptyAtom;
+}
+
+} // namespace WebCore
diff --git a/WebCore/html/IsIndexInputType.h b/WebCore/html/IsIndexInputType.h
new file mode 100644
index 0000000..93a1c08
--- /dev/null
+++ b/WebCore/html/IsIndexInputType.h
@@ -0,0 +1,50 @@
+/*
+ * 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 IsIndexInputType_h
+#define IsIndexInputType_h
+
+#include "TextFieldInputType.h"
+#include <wtf/text/AtomicString.h>
+
+namespace WebCore {
+
+class IsIndexInputType : public TextFieldInputType {
+public:
+ static PassOwnPtr<InputType> create(HTMLInputElement*);
+
+private:
+ IsIndexInputType(HTMLInputElement* element) : TextFieldInputType(element) { };
+ virtual const AtomicString& formControlType() const;
+};
+
+} // namespace WebCore
+
+#endif // IsIndexInputType_h
diff --git a/WebCore/html/MonthInputType.cpp b/WebCore/html/MonthInputType.cpp
new file mode 100644
index 0000000..54f78c6
--- /dev/null
+++ b/WebCore/html/MonthInputType.cpp
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "MonthInputType.h"
+
+#include <wtf/PassOwnPtr.h>
+
+namespace WebCore {
+
+PassOwnPtr<InputType> MonthInputType::create(HTMLInputElement* element)
+{
+ return adoptPtr(new MonthInputType(element));
+}
+
+const AtomicString& MonthInputType::formControlType() const
+{
+ return InputTypeNames::month();
+}
+
+} // namespace WebCore
diff --git a/WebCore/html/MonthInputType.h b/WebCore/html/MonthInputType.h
new file mode 100644
index 0000000..d605ffa
--- /dev/null
+++ b/WebCore/html/MonthInputType.h
@@ -0,0 +1,49 @@
+/*
+ * 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 MonthInputType_h
+#define MonthInputType_h
+
+#include "TextFieldInputType.h"
+
+namespace WebCore {
+
+class MonthInputType : public TextFieldInputType {
+public:
+ static PassOwnPtr<InputType> create(HTMLInputElement*);
+
+private:
+ MonthInputType(HTMLInputElement* element) : TextFieldInputType(element) { }
+ virtual const AtomicString& formControlType() const;
+};
+
+} // namespace WebCore
+
+#endif // MonthInputType_h
diff --git a/WebCore/html/NumberInputType.cpp b/WebCore/html/NumberInputType.cpp
new file mode 100644
index 0000000..9aba5c3
--- /dev/null
+++ b/WebCore/html/NumberInputType.cpp
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "NumberInputType.h"
+
+#include <wtf/PassOwnPtr.h>
+
+namespace WebCore {
+
+PassOwnPtr<InputType> NumberInputType::create(HTMLInputElement* element)
+{
+ return adoptPtr(new NumberInputType(element));
+}
+
+const AtomicString& NumberInputType::formControlType() const
+{
+ return InputTypeNames::number();
+}
+
+} // namespace WebCore
diff --git a/WebCore/html/NumberInputType.h b/WebCore/html/NumberInputType.h
new file mode 100644
index 0000000..5347249
--- /dev/null
+++ b/WebCore/html/NumberInputType.h
@@ -0,0 +1,49 @@
+/*
+ * 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 NumberInputType_h
+#define NumberInputType_h
+
+#include "TextFieldInputType.h"
+
+namespace WebCore {
+
+class NumberInputType : public TextFieldInputType {
+public:
+ static PassOwnPtr<InputType> create(HTMLInputElement*);
+
+private:
+ NumberInputType(HTMLInputElement* element) : TextFieldInputType(element) { }
+ virtual const AtomicString& formControlType() const;
+};
+
+} // namespace WebCore
+
+#endif // NumberInputType_h
diff --git a/WebCore/html/PasswordInputType.cpp b/WebCore/html/PasswordInputType.cpp
new file mode 100644
index 0000000..a645f96
--- /dev/null
+++ b/WebCore/html/PasswordInputType.cpp
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "PasswordInputType.h"
+
+#include <wtf/PassOwnPtr.h>
+
+namespace WebCore {
+
+PassOwnPtr<InputType> PasswordInputType::create(HTMLInputElement* element)
+{
+ return adoptPtr(new PasswordInputType(element));
+}
+
+const AtomicString& PasswordInputType::formControlType() const
+{
+ return InputTypeNames::password();
+}
+
+} // namespace WebCore
diff --git a/WebCore/html/PasswordInputType.h b/WebCore/html/PasswordInputType.h
new file mode 100644
index 0000000..db13449
--- /dev/null
+++ b/WebCore/html/PasswordInputType.h
@@ -0,0 +1,49 @@
+/*
+ * 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 PasswordInputType_h
+#define PasswordInputType_h
+
+#include "BaseTextInputType.h"
+
+namespace WebCore {
+
+class PasswordInputType : public BaseTextInputType {
+public:
+ static PassOwnPtr<InputType> create(HTMLInputElement*);
+
+private:
+ PasswordInputType(HTMLInputElement* element) : BaseTextInputType(element) { }
+ virtual const AtomicString& formControlType() const;
+};
+
+} // namespace WebCore
+
+#endif // PasswordInputType_h
diff --git a/WebCore/html/RadioInputType.cpp b/WebCore/html/RadioInputType.cpp
new file mode 100644
index 0000000..a1c8d04
--- /dev/null
+++ b/WebCore/html/RadioInputType.cpp
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "RadioInputType.h"
+
+#include <wtf/PassOwnPtr.h>
+
+namespace WebCore {
+
+PassOwnPtr<InputType> RadioInputType::create(HTMLInputElement* element)
+{
+ return adoptPtr(new RadioInputType(element));
+}
+
+const AtomicString& RadioInputType::formControlType() const
+{
+ return InputTypeNames::radio();
+}
+
+} // namespace WebCore
diff --git a/WebCore/html/RadioInputType.h b/WebCore/html/RadioInputType.h
new file mode 100644
index 0000000..180c6dd
--- /dev/null
+++ b/WebCore/html/RadioInputType.h
@@ -0,0 +1,49 @@
+/*
+ * 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 RadioInputType_h
+#define RadioInputType_h
+
+#include "InputType.h"
+
+namespace WebCore {
+
+class RadioInputType : public InputType {
+public:
+ static PassOwnPtr<InputType> create(HTMLInputElement*);
+
+private:
+ RadioInputType(HTMLInputElement* element) : InputType(element) { }
+ virtual const AtomicString& formControlType() const;
+};
+
+} // namespace WebCore
+
+#endif // RadioInputType_h
diff --git a/WebCore/html/RangeInputType.cpp b/WebCore/html/RangeInputType.cpp
new file mode 100644
index 0000000..f5f7322
--- /dev/null
+++ b/WebCore/html/RangeInputType.cpp
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "RangeInputType.h"
+
+#include <wtf/PassOwnPtr.h>
+
+namespace WebCore {
+
+PassOwnPtr<InputType> RangeInputType::create(HTMLInputElement* element)
+{
+ return adoptPtr(new RangeInputType(element));
+}
+
+const AtomicString& RangeInputType::formControlType() const
+{
+ return InputTypeNames::range();
+}
+
+} // namespace WebCore
diff --git a/WebCore/html/RangeInputType.h b/WebCore/html/RangeInputType.h
new file mode 100644
index 0000000..d42c617
--- /dev/null
+++ b/WebCore/html/RangeInputType.h
@@ -0,0 +1,49 @@
+/*
+ * 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 RangeInputType_h
+#define RangeInputType_h
+
+#include "InputType.h"
+
+namespace WebCore {
+
+class RangeInputType : public InputType {
+public:
+ static PassOwnPtr<InputType> create(HTMLInputElement*);
+
+private:
+ RangeInputType(HTMLInputElement* element) : InputType(element) { }
+ virtual const AtomicString& formControlType() const;
+};
+
+} // namespace WebCore
+
+#endif // RangeInputType_h
diff --git a/WebCore/html/ResetInputType.cpp b/WebCore/html/ResetInputType.cpp
new file mode 100644
index 0000000..8b18a8d
--- /dev/null
+++ b/WebCore/html/ResetInputType.cpp
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "ResetInputType.h"
+
+#include <wtf/PassOwnPtr.h>
+
+namespace WebCore {
+
+PassOwnPtr<InputType> ResetInputType::create(HTMLInputElement* element)
+{
+ return adoptPtr(new ResetInputType(element));
+}
+
+const AtomicString& ResetInputType::formControlType() const
+{
+ return InputTypeNames::reset();
+}
+
+} // namespace WebCore
diff --git a/WebCore/html/ResetInputType.h b/WebCore/html/ResetInputType.h
new file mode 100644
index 0000000..e0d8997
--- /dev/null
+++ b/WebCore/html/ResetInputType.h
@@ -0,0 +1,49 @@
+/*
+ * 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 ResetInputType_h
+#define ResetInputType_h
+
+#include "InputType.h"
+
+namespace WebCore {
+
+class ResetInputType : public InputType {
+public:
+ static PassOwnPtr<InputType> create(HTMLInputElement*);
+
+private:
+ ResetInputType(HTMLInputElement* element) : InputType(element) { }
+ virtual const AtomicString& formControlType() const;
+};
+
+} // namespace WebCore
+
+#endif // ResetInputType_h
diff --git a/WebCore/html/SearchInputType.cpp b/WebCore/html/SearchInputType.cpp
new file mode 100644
index 0000000..6f3a01c
--- /dev/null
+++ b/WebCore/html/SearchInputType.cpp
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "SearchInputType.h"
+
+#include <wtf/PassOwnPtr.h>
+
+namespace WebCore {
+
+PassOwnPtr<InputType> SearchInputType::create(HTMLInputElement* element)
+{
+ return adoptPtr(new SearchInputType(element));
+}
+
+const AtomicString& SearchInputType::formControlType() const
+{
+ return InputTypeNames::search();
+}
+
+} // namespace WebCore
diff --git a/WebCore/html/SearchInputType.h b/WebCore/html/SearchInputType.h
new file mode 100644
index 0000000..edffdb0
--- /dev/null
+++ b/WebCore/html/SearchInputType.h
@@ -0,0 +1,49 @@
+/*
+ * 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 SearchInputType_h
+#define SearchInputType_h
+
+#include "BaseTextInputType.h"
+
+namespace WebCore {
+
+class SearchInputType : public BaseTextInputType {
+public:
+ static PassOwnPtr<InputType> create(HTMLInputElement*);
+
+private:
+ SearchInputType(HTMLInputElement* element) : BaseTextInputType(element) { }
+ virtual const AtomicString& formControlType() const;
+};
+
+} // namespace WebCore
+
+#endif // SearchInputType_h
diff --git a/WebCore/html/SubmitInputType.cpp b/WebCore/html/SubmitInputType.cpp
new file mode 100644
index 0000000..dd13e6b
--- /dev/null
+++ b/WebCore/html/SubmitInputType.cpp
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "SubmitInputType.h"
+
+#include <wtf/PassOwnPtr.h>
+
+namespace WebCore {
+
+PassOwnPtr<InputType> SubmitInputType::create(HTMLInputElement* element)
+{
+ return adoptPtr(new SubmitInputType(element));
+}
+
+const AtomicString& SubmitInputType::formControlType() const
+{
+ return InputTypeNames::submit();
+}
+
+} // namespace WebCore
diff --git a/WebCore/html/SubmitInputType.h b/WebCore/html/SubmitInputType.h
new file mode 100644
index 0000000..7ea448e
--- /dev/null
+++ b/WebCore/html/SubmitInputType.h
@@ -0,0 +1,49 @@
+/*
+ * 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 SubmitInputType_h
+#define SubmitInputType_h
+
+#include "InputType.h"
+
+namespace WebCore {
+
+class SubmitInputType : public InputType {
+public:
+ static PassOwnPtr<InputType> create(HTMLInputElement*);
+
+private:
+ SubmitInputType(HTMLInputElement* element) : InputType(element) { }
+ virtual const AtomicString& formControlType() const;
+};
+
+} // namespace WebCore
+
+#endif // SubmitInputType_h
diff --git a/WebCore/html/TelephoneInputType.cpp b/WebCore/html/TelephoneInputType.cpp
new file mode 100644
index 0000000..27d66ce
--- /dev/null
+++ b/WebCore/html/TelephoneInputType.cpp
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "TelephoneInputType.h"
+
+#include <wtf/PassOwnPtr.h>
+
+namespace WebCore {
+
+PassOwnPtr<InputType> TelephoneInputType::create(HTMLInputElement* element)
+{
+ return adoptPtr(new TelephoneInputType(element));
+}
+
+const AtomicString& TelephoneInputType::formControlType() const
+{
+ return InputTypeNames::telephone();
+}
+
+} // namespace WebCore
diff --git a/WebCore/html/TelephoneInputType.h b/WebCore/html/TelephoneInputType.h
new file mode 100644
index 0000000..9458f50
--- /dev/null
+++ b/WebCore/html/TelephoneInputType.h
@@ -0,0 +1,49 @@
+/*
+ * 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 TelephoneInputType_h
+#define TelephoneInputType_h
+
+#include "BaseTextInputType.h"
+
+namespace WebCore {
+
+class TelephoneInputType : public BaseTextInputType {
+public:
+ static PassOwnPtr<InputType> create(HTMLInputElement*);
+
+private:
+ TelephoneInputType(HTMLInputElement* element) : BaseTextInputType(element) { }
+ virtual const AtomicString& formControlType() const;
+};
+
+} // namespace WebCore
+
+#endif // TelephoneInputType_h
diff --git a/WebKit/chromium/public/gtk/WebScreenInfoFactory.h b/WebCore/html/TextFieldInputType.cpp
index c964741..e681b40 100644
--- a/WebKit/chromium/public/gtk/WebScreenInfoFactory.h
+++ b/WebCore/html/TextFieldInputType.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2009 Google Inc. All rights reserved.
+ * Copyright (C) 2010 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -28,22 +28,14 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef WebScreenInfoFactory_h
-#define WebScreenInfoFactory_h
+#include "config.h"
+#include "TextFieldInputType.h"
-#include "../WebCommon.h"
+namespace WebCore {
-typedef struct _GtkWidget GtkWidget;
+bool TextFieldInputType::isTextField() const
+{
+ return true;
+}
-namespace WebKit {
-
-struct WebScreenInfo;
-
-class WebScreenInfoFactory {
-public:
- WEBKIT_API static WebScreenInfo screenInfo(GtkWidget*);
-};
-
-} // namespace WebKit
-
-#endif
+} // namespace WebCore
diff --git a/WebCore/html/TextFieldInputType.h b/WebCore/html/TextFieldInputType.h
new file mode 100644
index 0000000..fb33a01
--- /dev/null
+++ b/WebCore/html/TextFieldInputType.h
@@ -0,0 +1,48 @@
+/*
+ * 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 TextFieldInputType_h
+#define TextFieldInputType_h
+
+#include "InputType.h"
+
+namespace WebCore {
+
+// The class represents types of which UI contain text fields.
+// It supports not only the types for BaseTextInputType but also type=number.
+class TextFieldInputType : public InputType {
+protected:
+ TextFieldInputType(HTMLInputElement* element) : InputType(element) { }
+ virtual bool isTextField() const;
+};
+
+} // namespace WebCore
+
+#endif // TextFieldInputType_h
diff --git a/WebCore/html/TextInputType.cpp b/WebCore/html/TextInputType.cpp
new file mode 100644
index 0000000..23a8679
--- /dev/null
+++ b/WebCore/html/TextInputType.cpp
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "TextInputType.h"
+
+#include <wtf/PassOwnPtr.h>
+
+namespace WebCore {
+
+PassOwnPtr<InputType> TextInputType::create(HTMLInputElement* element)
+{
+ return adoptPtr(new TextInputType(element));
+}
+
+const AtomicString& TextInputType::formControlType() const
+{
+ return InputTypeNames::text();
+}
+
+} // namespace WebCore
diff --git a/WebCore/html/TextInputType.h b/WebCore/html/TextInputType.h
new file mode 100644
index 0000000..89fd9b0
--- /dev/null
+++ b/WebCore/html/TextInputType.h
@@ -0,0 +1,49 @@
+/*
+ * 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 TextInputType_h
+#define TextInputType_h
+
+#include "BaseTextInputType.h"
+
+namespace WebCore {
+
+class TextInputType : public BaseTextInputType {
+public:
+ static PassOwnPtr<InputType> create(HTMLInputElement*);
+
+private:
+ TextInputType(HTMLInputElement* element) : BaseTextInputType(element) { }
+ virtual const AtomicString& formControlType() const;
+};
+
+} // namespace WebCore
+
+#endif // TextInputType_h
diff --git a/WebCore/html/TimeInputType.cpp b/WebCore/html/TimeInputType.cpp
new file mode 100644
index 0000000..1564bc5
--- /dev/null
+++ b/WebCore/html/TimeInputType.cpp
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "TimeInputType.h"
+
+#include <wtf/PassOwnPtr.h>
+
+namespace WebCore {
+
+PassOwnPtr<InputType> TimeInputType::create(HTMLInputElement* element)
+{
+ return adoptPtr(new TimeInputType(element));
+}
+
+const AtomicString& TimeInputType::formControlType() const
+{
+ return InputTypeNames::time();
+}
+
+} // namespace WebCore
diff --git a/WebCore/html/TimeInputType.h b/WebCore/html/TimeInputType.h
new file mode 100644
index 0000000..9530f7d
--- /dev/null
+++ b/WebCore/html/TimeInputType.h
@@ -0,0 +1,49 @@
+/*
+ * 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 TimeInputType_h
+#define TimeInputType_h
+
+#include "TextFieldInputType.h"
+
+namespace WebCore {
+
+class TimeInputType : public TextFieldInputType {
+public:
+ static PassOwnPtr<InputType> create(HTMLInputElement*);
+
+private:
+ TimeInputType(HTMLInputElement* element) : TextFieldInputType(element) { }
+ virtual const AtomicString& formControlType() const;
+};
+
+} // namespace WebCore
+
+#endif // TimeInputType_h
diff --git a/WebCore/html/URLInputType.cpp b/WebCore/html/URLInputType.cpp
new file mode 100644
index 0000000..2afdcde
--- /dev/null
+++ b/WebCore/html/URLInputType.cpp
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "URLInputType.h"
+
+#include <wtf/PassOwnPtr.h>
+
+namespace WebCore {
+
+PassOwnPtr<InputType> URLInputType::create(HTMLInputElement* element)
+{
+ return adoptPtr(new URLInputType(element));
+}
+
+const AtomicString& URLInputType::formControlType() const
+{
+ return InputTypeNames::url();
+}
+
+} // namespace WebCore
diff --git a/WebCore/html/URLInputType.h b/WebCore/html/URLInputType.h
new file mode 100644
index 0000000..85d4f9f
--- /dev/null
+++ b/WebCore/html/URLInputType.h
@@ -0,0 +1,49 @@
+/*
+ * 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 URLInputType_h
+#define URLInputType_h
+
+#include "BaseTextInputType.h"
+
+namespace WebCore {
+
+class URLInputType : public BaseTextInputType {
+public:
+ static PassOwnPtr<InputType> create(HTMLInputElement*);
+
+private:
+ URLInputType(HTMLInputElement* element) : BaseTextInputType(element) { }
+ virtual const AtomicString& formControlType() const;
+};
+
+} // namespace WebCore
+
+#endif // URLInputType_h
diff --git a/WebCore/html/WeekInputType.cpp b/WebCore/html/WeekInputType.cpp
new file mode 100644
index 0000000..0b4ab30
--- /dev/null
+++ b/WebCore/html/WeekInputType.cpp
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "WeekInputType.h"
+
+#include <wtf/PassOwnPtr.h>
+
+namespace WebCore {
+
+PassOwnPtr<InputType> WeekInputType::create(HTMLInputElement* element)
+{
+ return adoptPtr(new WeekInputType(element));
+}
+
+const AtomicString& WeekInputType::formControlType() const
+{
+ return InputTypeNames::week();
+}
+
+} // namespace WebCore
diff --git a/WebCore/html/WeekInputType.h b/WebCore/html/WeekInputType.h
new file mode 100644
index 0000000..7b6ee23
--- /dev/null
+++ b/WebCore/html/WeekInputType.h
@@ -0,0 +1,49 @@
+/*
+ * 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 WeekInputType_h
+#define WeekInputType_h
+
+#include "TextFieldInputType.h"
+
+namespace WebCore {
+
+class WeekInputType : public TextFieldInputType {
+public:
+ static PassOwnPtr<InputType> create(HTMLInputElement*);
+
+private:
+ WeekInputType(HTMLInputElement* element) : TextFieldInputType(element) { }
+ virtual const AtomicString& formControlType() const;
+};
+
+} // namespace WebCore
+
+#endif // WeekInputType_h
diff --git a/WebCore/html/canvas/CanvasRenderingContext.cpp b/WebCore/html/canvas/CanvasRenderingContext.cpp
index e019332..c814c66 100644
--- a/WebCore/html/canvas/CanvasRenderingContext.cpp
+++ b/WebCore/html/canvas/CanvasRenderingContext.cpp
@@ -25,7 +25,14 @@
#include "config.h"
#include "CanvasRenderingContext.h"
+
+#include "CachedImage.h"
+#include "CanvasPattern.h"
#include "HTMLCanvasElement.h"
+#include "HTMLImageElement.h"
+#include "HTMLVideoElement.h"
+#include "KURL.h"
+#include "SecurityOrigin.h"
namespace WebCore {
@@ -44,4 +51,48 @@ void CanvasRenderingContext::deref()
m_canvas->deref();
}
+void CanvasRenderingContext::checkOrigin(const CanvasPattern* pattern)
+{
+ if (canvas()->originClean() && pattern && !pattern->originClean())
+ canvas()->setOriginTainted();
+}
+
+void CanvasRenderingContext::checkOrigin(const HTMLCanvasElement* sourceCanvas)
+{
+ if (canvas()->originClean() && sourceCanvas && !sourceCanvas->originClean())
+ canvas()->setOriginTainted();
+}
+
+void CanvasRenderingContext::checkOrigin(const HTMLImageElement* image)
+{
+ if (!image || !canvas()->originClean())
+ return;
+
+ CachedImage* cachedImage = image->cachedImage();
+ checkOrigin(cachedImage->response().url());
+
+ if (canvas()->originClean() && !cachedImage->image()->hasSingleSecurityOrigin())
+ canvas()->setOriginTainted();
+}
+
+void CanvasRenderingContext::checkOrigin(const HTMLVideoElement* video)
+{
+#if ENABLE(VIDEO)
+ checkOrigin(KURL(KURL(), video->currentSrc()));
+ if (canvas()->originClean() && video && !video->hasSingleSecurityOrigin())
+ canvas()->setOriginTainted();
+#endif
+}
+
+void CanvasRenderingContext::checkOrigin(const KURL& url)
+{
+ if (!canvas()->originClean() || m_cleanOrigins.contains(url.string()))
+ return;
+
+ if (canvas()->securityOrigin().taintsCanvas(url))
+ canvas()->setOriginTainted();
+ else
+ m_cleanOrigins.add(url.string());
+}
+
} // namespace WebCore
diff --git a/WebCore/html/canvas/CanvasRenderingContext.h b/WebCore/html/canvas/CanvasRenderingContext.h
index 8499b47..a25e8a1 100644
--- a/WebCore/html/canvas/CanvasRenderingContext.h
+++ b/WebCore/html/canvas/CanvasRenderingContext.h
@@ -28,38 +28,52 @@
#include "GraphicsLayer.h"
+#include <wtf/HashSet.h>
#include <wtf/Noncopyable.h>
+#include <wtf/text/StringHash.h>
namespace WebCore {
- class WebGLObject;
- class HTMLCanvasElement;
+class CanvasPattern;
+class HTMLCanvasElement;
+class HTMLImageElement;
+class HTMLVideoElement;
+class KURL;
+class WebGLObject;
- class CanvasRenderingContext : public Noncopyable {
- public:
- CanvasRenderingContext(HTMLCanvasElement*);
- virtual ~CanvasRenderingContext() { }
-
- // Ref and deref the m_canvas
- void ref();
- void deref();
-
- HTMLCanvasElement* canvas() const { return m_canvas; }
-
- virtual bool is2d() const { return false; }
- virtual bool is3d() const { return false; }
- virtual bool isAccelerated() const { return false; }
-
- virtual void paintRenderingResultsToCanvas() {}
- virtual bool paintsIntoCanvasBuffer() const { return true; }
+class CanvasRenderingContext : public Noncopyable {
+public:
+ CanvasRenderingContext(HTMLCanvasElement*);
+ virtual ~CanvasRenderingContext() { }
+
+ // Ref and deref the m_canvas
+ void ref();
+ void deref();
+
+ HTMLCanvasElement* canvas() const { return m_canvas; }
+
+ virtual bool is2d() const { return false; }
+ virtual bool is3d() const { return false; }
+ virtual bool isAccelerated() const { return false; }
+
+ virtual void paintRenderingResultsToCanvas() {}
+ virtual bool paintsIntoCanvasBuffer() const { return true; }
#if USE(ACCELERATED_COMPOSITING)
- virtual PlatformLayer* platformLayer() const { return 0; }
+ virtual PlatformLayer* platformLayer() const { return 0; }
#endif
- private:
- HTMLCanvasElement* m_canvas;
- };
+protected:
+ void checkOrigin(const CanvasPattern*);
+ void checkOrigin(const HTMLCanvasElement*);
+ void checkOrigin(const HTMLImageElement*);
+ void checkOrigin(const HTMLVideoElement*);
+ void checkOrigin(const KURL&);
+
+private:
+ HTMLCanvasElement* m_canvas;
+ HashSet<String> m_cleanOrigins;
+};
} // namespace WebCore
diff --git a/WebCore/html/canvas/CanvasRenderingContext2D.cpp b/WebCore/html/canvas/CanvasRenderingContext2D.cpp
index 0fb7ed5..161a891 100644
--- a/WebCore/html/canvas/CanvasRenderingContext2D.cpp
+++ b/WebCore/html/canvas/CanvasRenderingContext2D.cpp
@@ -249,12 +249,7 @@ void CanvasRenderingContext2D::setStrokeStyle(PassRefPtr<CanvasStyle> style)
if (state().m_strokeStyle && state().m_strokeStyle->isEquivalentColor(*style))
return;
- if (canvas()->originClean()) {
- if (CanvasPattern* pattern = style->canvasPattern()) {
- if (!pattern->originClean())
- canvas()->setOriginTainted();
- }
- }
+ checkOrigin(style->canvasPattern());
state().m_strokeStyle = style;
GraphicsContext* c = drawingContext();
@@ -277,12 +272,7 @@ void CanvasRenderingContext2D::setFillStyle(PassRefPtr<CanvasStyle> style)
if (state().m_fillStyle && state().m_fillStyle->isEquivalentColor(*style))
return;
- if (canvas()->originClean()) {
- if (CanvasPattern* pattern = style->canvasPattern()) {
- if (!pattern->originClean())
- canvas()->setOriginTainted();
- }
- }
+ checkOrigin(style->canvasPattern());
state().m_fillStyle = style;
GraphicsContext* c = drawingContext();
@@ -1121,25 +1111,6 @@ static inline FloatRect normalizeRect(const FloatRect& rect)
max(rect.height(), -rect.height()));
}
-void CanvasRenderingContext2D::checkOrigin(const KURL& url)
-{
- if (m_cleanOrigins.contains(url.string()))
- return;
-
- if (canvas()->securityOrigin().taintsCanvas(url))
- canvas()->setOriginTainted();
- else
- m_cleanOrigins.add(url.string());
-}
-
-void CanvasRenderingContext2D::checkOrigin(const String& url)
-{
- if (m_cleanOrigins.contains(url))
- return;
-
- checkOrigin(KURL(KURL(), url));
-}
-
void CanvasRenderingContext2D::drawImage(HTMLImageElement* image, float x, float y, ExceptionCode& ec)
{
if (!image) {
@@ -1186,18 +1157,21 @@ void CanvasRenderingContext2D::drawImage(HTMLImageElement* image, const FloatRec
|| !isfinite(srcRect.x()) || !isfinite(srcRect.y()) || !isfinite(srcRect.width()) || !isfinite(srcRect.height()))
return;
+ if (!dstRect.width() || !dstRect.height())
+ return;
+
if (!image->complete())
return;
+ FloatRect normalizedSrcRect = normalizeRect(srcRect);
+ FloatRect normalizedDstRect = normalizeRect(dstRect);
+
FloatRect imageRect = FloatRect(FloatPoint(), size(image));
- if (!imageRect.contains(normalizeRect(srcRect)) || !srcRect.width() || !srcRect.height()) {
+ if (!imageRect.contains(normalizedSrcRect) || !srcRect.width() || !srcRect.height()) {
ec = INDEX_SIZE_ERR;
return;
}
- if (!dstRect.width() || !dstRect.height())
- return;
-
GraphicsContext* c = drawingContext();
if (!c)
return;
@@ -1208,14 +1182,10 @@ void CanvasRenderingContext2D::drawImage(HTMLImageElement* image, const FloatRec
if (!cachedImage)
return;
- if (canvas()->originClean())
- checkOrigin(cachedImage->response().url());
-
- if (canvas()->originClean() && !cachedImage->image()->hasSingleSecurityOrigin())
- canvas()->setOriginTainted();
+ checkOrigin(image);
- FloatRect sourceRect = c->roundToDevicePixels(srcRect);
- FloatRect destRect = c->roundToDevicePixels(dstRect);
+ FloatRect sourceRect = c->roundToDevicePixels(normalizedSrcRect);
+ FloatRect destRect = c->roundToDevicePixels(normalizedDstRect);
c->drawImage(cachedImage->image(), DeviceColorSpace, destRect, sourceRect, state().m_globalComposite);
didDraw(destRect);
}
@@ -1285,8 +1255,7 @@ void CanvasRenderingContext2D::drawImage(HTMLCanvasElement* sourceCanvas, const
if (!buffer)
return;
- if (!sourceCanvas->originClean())
- canvas()->setOriginTainted();
+ checkOrigin(sourceCanvas);
#if ENABLE(ACCELERATED_2D_CANVAS)
// If we're drawing from one accelerated canvas 2d to another, avoid calling sourceCanvas->makeRenderingResultsAvailable()
@@ -1360,11 +1329,7 @@ void CanvasRenderingContext2D::drawImage(HTMLVideoElement* video, const FloatRec
if (!state().m_invertibleCTM)
return;
- if (canvas()->originClean())
- checkOrigin(video->currentSrc());
-
- if (canvas()->originClean() && !video->hasSingleSecurityOrigin())
- canvas()->setOriginTainted();
+ checkOrigin(video);
FloatRect sourceRect = c->roundToDevicePixels(srcRect);
FloatRect destRect = c->roundToDevicePixels(dstRect);
@@ -1393,11 +1358,7 @@ void CanvasRenderingContext2D::drawImageFromRect(HTMLImageElement* image,
if (!cachedImage)
return;
- if (canvas()->originClean())
- checkOrigin(cachedImage->response().url());
-
- if (canvas()->originClean() && !cachedImage->image()->hasSingleSecurityOrigin())
- canvas()->setOriginTainted();
+ checkOrigin(image);
GraphicsContext* c = drawingContext();
if (!c)
@@ -1689,6 +1650,7 @@ void CanvasRenderingContext2D::setFont(const String& newFont)
RefPtr<RenderStyle> newStyle = RenderStyle::create();
if (RenderStyle* computedStyle = canvas()->computedStyle())
newStyle->setFontDescription(computedStyle->fontDescription());
+ newStyle->font().update(newStyle->font().fontSelector());
// Now map the font property into the style.
CSSStyleSelector* styleSelector = canvas()->styleSelector();
diff --git a/WebCore/html/canvas/CanvasRenderingContext2D.h b/WebCore/html/canvas/CanvasRenderingContext2D.h
index 91b6549..2c88a31 100644
--- a/WebCore/html/canvas/CanvasRenderingContext2D.h
+++ b/WebCore/html/canvas/CanvasRenderingContext2D.h
@@ -36,7 +36,6 @@
#include "PlatformString.h"
#include <wtf/Vector.h>
-#include <wtf/text/StringHash.h>
#if PLATFORM(CG)
#include <ApplicationServices/ApplicationServices.h>
@@ -57,7 +56,6 @@ class HTMLCanvasElement;
class HTMLImageElement;
class HTMLVideoElement;
class ImageData;
-class KURL;
class TextMetrics;
#if ENABLE(ACCELERATED_2D_CANVAS)
@@ -289,11 +287,6 @@ private:
void prepareGradientForDashboard(CanvasGradient* gradient) const;
- HashSet<String> m_cleanOrigins;
-
- void checkOrigin(const KURL&);
- void checkOrigin(const String&);
-
Vector<State, 1> m_stateStack;
bool m_usesCSSCompatibilityParseMode;
#if ENABLE(DASHBOARD_SUPPORT)
diff --git a/WebCore/html/canvas/WebGLBuffer.cpp b/WebCore/html/canvas/WebGLBuffer.cpp
index d43868d..99d9cad 100644
--- a/WebCore/html/canvas/WebGLBuffer.cpp
+++ b/WebCore/html/canvas/WebGLBuffer.cpp
@@ -52,7 +52,8 @@ WebGLBuffer::WebGLBuffer(WebGLRenderingContext* ctx)
void WebGLBuffer::deleteObjectImpl(Platform3DObject object)
{
- context()->graphicsContext3D()->deleteBuffer(object);
+ if (!isDeleted())
+ context()->graphicsContext3D()->deleteBuffer(object);
}
bool WebGLBuffer::associateBufferDataImpl(ArrayBuffer* array, unsigned byteOffset, unsigned byteLength)
diff --git a/WebCore/html/canvas/WebGLFramebuffer.cpp b/WebCore/html/canvas/WebGLFramebuffer.cpp
index 6291705..a709341 100644
--- a/WebCore/html/canvas/WebGLFramebuffer.cpp
+++ b/WebCore/html/canvas/WebGLFramebuffer.cpp
@@ -40,10 +40,6 @@ PassRefPtr<WebGLFramebuffer> WebGLFramebuffer::create(WebGLRenderingContext* ctx
WebGLFramebuffer::WebGLFramebuffer(WebGLRenderingContext* ctx)
: WebGLObject(ctx)
- , m_colorAttachment(0)
- , m_depthAttachment(0)
- , m_stencilAttachment(0)
- , m_depthStencilAttachment(0)
{
setObject(context()->graphicsContext3D()->createFramebuffer());
}
@@ -73,6 +69,23 @@ void WebGLFramebuffer::setAttachment(unsigned long attachment, WebGLObject* atta
initializeRenderbuffers();
}
+void WebGLFramebuffer::removeAttachment(WebGLObject* attachment)
+{
+ if (!object())
+ return;
+ if (attachment == m_colorAttachment.get())
+ m_colorAttachment = 0;
+ else if (attachment == m_depthAttachment.get())
+ m_depthAttachment = 0;
+ else if (attachment == m_stencilAttachment.get())
+ m_stencilAttachment = 0;
+ else if (attachment == m_depthStencilAttachment.get())
+ m_depthStencilAttachment = 0;
+ else
+ return;
+ initializeRenderbuffers();
+}
+
void WebGLFramebuffer::onBind()
{
initializeRenderbuffers();
@@ -83,8 +96,8 @@ void WebGLFramebuffer::onAttachedObjectChange(WebGLObject* object)
// Currently object == 0 is not considered, but this might change if the
// lifespan of WebGLObject changes.
if (object
- && (object == m_colorAttachment || object == m_depthAttachment
- || object == m_stencilAttachment || object == m_depthStencilAttachment))
+ && (object == m_colorAttachment.get() || object == m_depthAttachment.get()
+ || object == m_stencilAttachment.get() || object == m_depthStencilAttachment.get()))
initializeRenderbuffers();
}
@@ -92,7 +105,7 @@ unsigned long WebGLFramebuffer::getColorBufferFormat()
{
if (object() && m_colorAttachment && m_colorAttachment->object()) {
if (m_colorAttachment->isRenderbuffer()) {
- unsigned long format = (reinterpret_cast<WebGLRenderbuffer*>(m_colorAttachment))->getInternalFormat();
+ unsigned long format = (reinterpret_cast<WebGLRenderbuffer*>(m_colorAttachment.get()))->getInternalFormat();
switch (format) {
case GraphicsContext3D::RGBA4:
case GraphicsContext3D::RGB5_A1:
@@ -101,14 +114,19 @@ unsigned long WebGLFramebuffer::getColorBufferFormat()
return GraphicsContext3D::RGB;
}
} else if (m_colorAttachment->isTexture())
- return (reinterpret_cast<WebGLTexture*>(m_colorAttachment))->getInternalFormat(0);
+ return (reinterpret_cast<WebGLTexture*>(m_colorAttachment.get()))->getInternalFormat(0);
}
return 0;
}
void WebGLFramebuffer::deleteObjectImpl(Platform3DObject object)
{
- context()->graphicsContext3D()->deleteFramebuffer(object);
+ if (!isDeleted())
+ context()->graphicsContext3D()->deleteFramebuffer(object);
+ m_colorAttachment = 0;
+ m_depthAttachment = 0;
+ m_stencilAttachment = 0;
+ m_depthStencilAttachment = 0;
}
bool WebGLFramebuffer::isUninitialized(WebGLObject* attachedObject)
@@ -131,19 +149,19 @@ void WebGLFramebuffer::initializeRenderbuffers()
return;
bool initColor = false, initDepth = false, initStencil = false;
unsigned long mask = 0;
- if (isUninitialized(m_colorAttachment)) {
+ if (isUninitialized(m_colorAttachment.get())) {
initColor = true;
mask |= GraphicsContext3D::COLOR_BUFFER_BIT;
}
- if (isUninitialized(m_depthAttachment)) {
+ if (isUninitialized(m_depthAttachment.get())) {
initDepth = true;
mask |= GraphicsContext3D::DEPTH_BUFFER_BIT;
}
- if (isUninitialized(m_stencilAttachment)) {
+ if (isUninitialized(m_stencilAttachment.get())) {
initStencil = true;
mask |= GraphicsContext3D::STENCIL_BUFFER_BIT;
}
- if (isUninitialized(m_depthStencilAttachment)) {
+ if (isUninitialized(m_depthStencilAttachment.get())) {
initDepth = true;
initStencil = true;
mask |= (GraphicsContext3D::DEPTH_BUFFER_BIT | GraphicsContext3D::STENCIL_BUFFER_BIT);
@@ -209,14 +227,14 @@ void WebGLFramebuffer::initializeRenderbuffers()
g3d->disable(GraphicsContext3D::DITHER);
if (initColor)
- setInitialized(m_colorAttachment);
+ setInitialized(m_colorAttachment.get());
if (initDepth && initStencil && m_depthStencilAttachment)
- setInitialized(m_depthStencilAttachment);
+ setInitialized(m_depthStencilAttachment.get());
else {
if (initDepth)
- setInitialized(m_depthAttachment);
+ setInitialized(m_depthAttachment.get());
if (initStencil)
- setInitialized(m_stencilAttachment);
+ setInitialized(m_stencilAttachment.get());
}
}
diff --git a/WebCore/html/canvas/WebGLFramebuffer.h b/WebCore/html/canvas/WebGLFramebuffer.h
index ac945dd..1892694 100644
--- a/WebCore/html/canvas/WebGLFramebuffer.h
+++ b/WebCore/html/canvas/WebGLFramebuffer.h
@@ -44,6 +44,8 @@ public:
bool isDepthStencilAttached() const { return (m_depthStencilAttachment && m_depthStencilAttachment->object()); }
void setAttachment(unsigned long, WebGLObject*);
+ // If an object is attached to the framebuffer, remove it.
+ void removeAttachment(WebGLObject*);
// This function is called right after a framebuffer is bound.
// Because renderbuffers and textures attached to the framebuffer might
@@ -71,12 +73,10 @@ private:
void setInitialized(WebGLObject*);
void initializeRenderbuffers();
- // These objects are kept alive by the global table in
- // WebGLRenderingContext.
- WebGLObject* m_colorAttachment;
- WebGLObject* m_depthAttachment;
- WebGLObject* m_stencilAttachment;
- WebGLObject* m_depthStencilAttachment;
+ RefPtr<WebGLObject> m_colorAttachment;
+ RefPtr<WebGLObject> m_depthAttachment;
+ RefPtr<WebGLObject> m_stencilAttachment;
+ RefPtr<WebGLObject> m_depthStencilAttachment;
};
} // namespace WebCore
diff --git a/WebCore/html/canvas/WebGLObject.cpp b/WebCore/html/canvas/WebGLObject.cpp
index 5fd5534..8aa4663 100644
--- a/WebCore/html/canvas/WebGLObject.cpp
+++ b/WebCore/html/canvas/WebGLObject.cpp
@@ -49,10 +49,8 @@ WebGLObject::~WebGLObject()
void WebGLObject::setObject(Platform3DObject object)
{
- if (object == m_object)
- return;
-
- deleteObject();
+ // object==0 && m_deleted==false indicating an uninitialized state;
+ ASSERT(!m_object && !m_deleted);
m_object = object;
}
diff --git a/WebCore/html/canvas/WebGLObject.h b/WebCore/html/canvas/WebGLObject.h
index 18d4cf9..82b8079 100644
--- a/WebCore/html/canvas/WebGLObject.h
+++ b/WebCore/html/canvas/WebGLObject.h
@@ -40,7 +40,6 @@ public:
virtual ~WebGLObject();
Platform3DObject object() const { return m_object; }
- void setObject(Platform3DObject);
void deleteObject();
void detachContext()
@@ -64,13 +63,22 @@ public:
if (m_attachmentCount)
--m_attachmentCount;
if (!m_attachmentCount && m_deleted)
- m_object = 0;
+ deleteObject();
}
unsigned getAttachmentCount() { return m_attachmentCount; }
protected:
WebGLObject(WebGLRenderingContext*);
+
+ // setObject should be only called once right after creating a WebGLObject.
+ void setObject(Platform3DObject);
+
+ // deleteObjectImpl() may be called multiple times for the same object;
+ // isDeleted() needs to be tested in implementations when deciding whether
+ // to delete the OpenGL resource.
virtual void deleteObjectImpl(Platform3DObject) = 0;
+ bool isDeleted() { return m_deleted; }
+ void setDeteled() { m_deleted = true; }
private:
Platform3DObject m_object;
diff --git a/WebCore/html/canvas/WebGLProgram.cpp b/WebCore/html/canvas/WebGLProgram.cpp
index 8cf3c42..0853b67 100644
--- a/WebCore/html/canvas/WebGLProgram.cpp
+++ b/WebCore/html/canvas/WebGLProgram.cpp
@@ -47,12 +47,17 @@ WebGLProgram::WebGLProgram(WebGLRenderingContext* ctx)
void WebGLProgram::deleteObjectImpl(Platform3DObject obj)
{
- context()->graphicsContext3D()->deleteProgram(obj);
- if (!object()) {
- if (m_vertexShader)
+ if (!isDeleted())
+ context()->graphicsContext3D()->deleteProgram(obj);
+ if (!getAttachmentCount()) {
+ if (m_vertexShader) {
m_vertexShader->onDetached();
- if (m_fragmentShader)
+ m_vertexShader = 0;
+ }
+ if (m_fragmentShader) {
m_fragmentShader->onDetached();
+ m_fragmentShader = 0;
+ }
}
}
diff --git a/WebCore/html/canvas/WebGLRenderbuffer.cpp b/WebCore/html/canvas/WebGLRenderbuffer.cpp
index 7bc2eec..4772873 100644
--- a/WebCore/html/canvas/WebGLRenderbuffer.cpp
+++ b/WebCore/html/canvas/WebGLRenderbuffer.cpp
@@ -48,7 +48,8 @@ WebGLRenderbuffer::WebGLRenderbuffer(WebGLRenderingContext* ctx)
void WebGLRenderbuffer::deleteObjectImpl(Platform3DObject object)
{
- context()->graphicsContext3D()->deleteRenderbuffer(object);
+ if (!isDeleted())
+ context()->graphicsContext3D()->deleteRenderbuffer(object);
}
}
diff --git a/WebCore/html/canvas/WebGLRenderingContext.cpp b/WebCore/html/canvas/WebGLRenderingContext.cpp
index 68a6954..d1bb0cd 100644
--- a/WebCore/html/canvas/WebGLRenderingContext.cpp
+++ b/WebCore/html/canvas/WebGLRenderingContext.cpp
@@ -635,7 +635,11 @@ void WebGLRenderingContext::deleteFramebuffer(WebGLFramebuffer* framebuffer)
{
if (!framebuffer)
return;
-
+ if (framebuffer == m_framebufferBinding) {
+ m_framebufferBinding = 0;
+ // Have to call bindFramebuffer here to bind back to internal fbo.
+ m_context->bindFramebuffer(GraphicsContext3D::FRAMEBUFFER, 0);
+ }
framebuffer->deleteObject();
}
@@ -656,10 +660,11 @@ void WebGLRenderingContext::deleteRenderbuffer(WebGLRenderbuffer* renderbuffer)
{
if (!renderbuffer)
return;
-
+ if (renderbuffer == m_renderbufferBinding)
+ m_renderbufferBinding = 0;
renderbuffer->deleteObject();
if (m_framebufferBinding)
- m_framebufferBinding->onAttachedObjectChange(renderbuffer);
+ m_framebufferBinding->removeAttachment(renderbuffer);
}
void WebGLRenderingContext::deleteShader(WebGLShader* shader)
@@ -677,7 +682,7 @@ void WebGLRenderingContext::deleteTexture(WebGLTexture* texture)
texture->deleteObject();
if (m_framebufferBinding)
- m_framebufferBinding->onAttachedObjectChange(texture);
+ m_framebufferBinding->removeAttachment(texture);
}
void WebGLRenderingContext::depthFunc(unsigned long func)
@@ -775,30 +780,31 @@ bool WebGLRenderingContext::validateIndexArrayConservative(unsigned long type, l
// index, skips the expensive per-draw-call iteration in
// validateIndexArrayPrecise.
+ if (!m_boundElementArrayBuffer)
+ return false;
+
+ unsigned numElements = m_boundElementArrayBuffer->byteLength();
+ // The case count==0 is already dealt with in drawElements before validateIndexArrayConservative.
+ if (!numElements)
+ return false;
+ const ArrayBuffer* buffer = m_boundElementArrayBuffer->elementArrayBuffer();
+ ASSERT(buffer);
+
long maxIndex = m_boundElementArrayBuffer->getCachedMaxIndex(type);
if (maxIndex < 0) {
// Compute the maximum index in the entire buffer for the given type of index.
switch (type) {
case GraphicsContext3D::UNSIGNED_BYTE: {
- unsigned numElements = m_boundElementArrayBuffer->byteLength();
- if (!numElements)
- maxIndex = 0;
- else {
- const unsigned char* p = static_cast<const unsigned char*>(m_boundElementArrayBuffer->elementArrayBuffer()->data());
- for (unsigned i = 0; i < numElements; i++)
- maxIndex = max(maxIndex, static_cast<long>(p[i]));
- }
+ const unsigned char* p = static_cast<const unsigned char*>(buffer->data());
+ for (unsigned i = 0; i < numElements; i++)
+ maxIndex = max(maxIndex, static_cast<long>(p[i]));
break;
}
case GraphicsContext3D::UNSIGNED_SHORT: {
- unsigned numElements = m_boundElementArrayBuffer->byteLength() / sizeof(unsigned short);
- if (!numElements)
- maxIndex = 0;
- else {
- const unsigned short* p = static_cast<const unsigned short*>(m_boundElementArrayBuffer->elementArrayBuffer()->data());
- for (unsigned i = 0; i < numElements; i++)
- maxIndex = max(maxIndex, static_cast<long>(p[i]));
- }
+ numElements /= sizeof(unsigned short);
+ const unsigned short* p = static_cast<const unsigned short*>(buffer->data());
+ for (unsigned i = 0; i < numElements; i++)
+ maxIndex = max(maxIndex, static_cast<long>(p[i]));
break;
}
default:
@@ -824,6 +830,14 @@ bool WebGLRenderingContext::validateIndexArrayPrecise(unsigned long count, unsig
if (!m_boundElementArrayBuffer)
return false;
+ if (!count) {
+ numElementsRequired = 0;
+ return true;
+ }
+
+ if (!m_boundElementArrayBuffer->elementArrayBuffer())
+ return false;
+
unsigned long uoffset = static_cast<unsigned long>(offset);
unsigned long n = count;
@@ -968,6 +982,8 @@ void WebGLRenderingContext::drawElements(unsigned long mode, long count, unsigne
m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
return;
}
+ if (!count)
+ return;
if (!validateIndexArrayConservative(type, numElements) || !validateRenderingState(numElements)) {
if (!validateIndexArrayPrecise(count, type, offset, numElements) || !validateRenderingState(numElements)) {
m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
@@ -1379,6 +1395,8 @@ WebGLGetInfo WebGLRenderingContext::getParameter(unsigned long pname, ExceptionC
return getLongParameter(pname);
case GraphicsContext3D::RENDERBUFFER_BINDING:
return WebGLGetInfo(PassRefPtr<WebGLRenderbuffer>(m_renderbufferBinding));
+ case GraphicsContext3D::RENDERER:
+ return WebGLGetInfo(m_context->getString(GraphicsContext3D::RENDERER));
case GraphicsContext3D::SAMPLE_BUFFERS:
return getLongParameter(pname);
case GraphicsContext3D::SAMPLE_COVERAGE_INVERT:
@@ -1391,6 +1409,8 @@ WebGLGetInfo WebGLRenderingContext::getParameter(unsigned long pname, ExceptionC
return getWebGLIntArrayParameter(pname);
case GraphicsContext3D::SCISSOR_TEST:
return getBooleanParameter(pname);
+ case GraphicsContext3D::SHADING_LANGUAGE_VERSION:
+ return WebGLGetInfo("WebGL GLSL ES 1.0 (" + m_context->getString(GraphicsContext3D::SHADING_LANGUAGE_VERSION) + ")");
case GraphicsContext3D::STENCIL_BACK_FAIL:
return getUnsignedLongParameter(pname);
case GraphicsContext3D::STENCIL_BACK_FUNC:
@@ -1438,6 +1458,10 @@ WebGLGetInfo WebGLRenderingContext::getParameter(unsigned long pname, ExceptionC
return WebGLGetInfo(m_unpackFlipY);
case GraphicsContext3D::UNPACK_PREMULTIPLY_ALPHA_WEBGL:
return WebGLGetInfo(m_unpackPremultiplyAlpha);
+ case GraphicsContext3D::VENDOR:
+ return WebGLGetInfo("Webkit (" + m_context->getString(GraphicsContext3D::VENDOR) + ")");
+ case GraphicsContext3D::VERSION:
+ return WebGLGetInfo("WebGL 1.0 (" + m_context->getString(GraphicsContext3D::VERSION) + ")");
case GraphicsContext3D::VIEWPORT:
return getWebGLIntArrayParameter(pname);
default:
@@ -1563,12 +1587,6 @@ String WebGLRenderingContext::getShaderSource(WebGLShader* shader, ExceptionCode
return m_context->getShaderSource(objectOrZero(shader));
}
-String WebGLRenderingContext::getString(unsigned long name)
-{
- WebGLStateRestorer(this, false);
- return m_context->getString(name);
-}
-
WebGLGetInfo WebGLRenderingContext::getTexParameter(unsigned long target, unsigned long pname, ExceptionCode& ec)
{
UNUSED_PARAM(ec);
@@ -1922,8 +1940,12 @@ void WebGLRenderingContext::polygonOffset(double factor, double units)
cleanupAfterGraphicsCall(false);
}
-void WebGLRenderingContext::readPixels(long x, long y, long width, long height, unsigned long format, unsigned long type, ArrayBufferView* pixels)
+void WebGLRenderingContext::readPixels(long x, long y, long width, long height, unsigned long format, unsigned long type, ArrayBufferView* pixels, ExceptionCode& ec)
{
+ if (!canvas()->originClean()) {
+ ec = SECURITY_ERR;
+ return;
+ }
// Validate input parameters.
unsigned long componentsPerPixel, bytesPerComponent;
if (!m_context->computeFormatAndTypeParameters(format, type, &componentsPerPixel, &bytesPerComponent)) {
@@ -2165,6 +2187,7 @@ void WebGLRenderingContext::texImage2D(unsigned target, unsigned level, unsigned
m_context->synthesizeGLError(GraphicsContext3D::INVALID_VALUE);
return;
}
+ checkOrigin(image);
texImage2DImpl(target, level, internalformat, format, type, image->cachedImage()->image(),
m_unpackFlipY, m_unpackPremultiplyAlpha, ec);
}
@@ -2177,7 +2200,7 @@ void WebGLRenderingContext::texImage2D(unsigned target, unsigned level, unsigned
m_context->synthesizeGLError(GraphicsContext3D::INVALID_VALUE);
return;
}
-
+ checkOrigin(canvas);
texImage2DImpl(target, level, internalformat, format, type, canvas->copiedImage(),
m_unpackFlipY, m_unpackPremultiplyAlpha, ec);
}
@@ -2194,6 +2217,7 @@ PassRefPtr<Image> WebGLRenderingContext::videoFrameToImage(HTMLVideoElement* vid
m_context->synthesizeGLError(GraphicsContext3D::OUT_OF_MEMORY);
return 0;
}
+ checkOrigin(video);
IntRect destRect(0, 0, size.width(), size.height());
// FIXME: Turn this into a GPU-GPU texture copy instead of CPU readback.
video->paintCurrentFrameInContext(buf->context(), destRect);
@@ -2326,6 +2350,7 @@ void WebGLRenderingContext::texSubImage2D(unsigned target, unsigned level, unsig
m_context->synthesizeGLError(GraphicsContext3D::INVALID_VALUE);
return;
}
+ checkOrigin(image);
texSubImage2DImpl(target, level, xoffset, yoffset, format, type, image->cachedImage()->image(),
m_unpackFlipY, m_unpackPremultiplyAlpha, ec);
}
@@ -2338,7 +2363,7 @@ void WebGLRenderingContext::texSubImage2D(unsigned target, unsigned level, unsig
m_context->synthesizeGLError(GraphicsContext3D::INVALID_VALUE);
return;
}
-
+ checkOrigin(canvas);
texSubImage2DImpl(target, level, xoffset, yoffset, format, type, canvas->copiedImage(),
m_unpackFlipY, m_unpackPremultiplyAlpha, ec);
}
@@ -2703,7 +2728,7 @@ void WebGLRenderingContext::useProgram(WebGLProgram* program, ExceptionCode& ec)
m_currentProgram->onDetached();
m_currentProgram = program;
m_context->useProgram(objectOrZero(program));
- if (program)
+ if (program && program->object())
program->onAttached();
}
cleanupAfterGraphicsCall(false);
diff --git a/WebCore/html/canvas/WebGLRenderingContext.h b/WebCore/html/canvas/WebGLRenderingContext.h
index d812c69..f507054 100644
--- a/WebCore/html/canvas/WebGLRenderingContext.h
+++ b/WebCore/html/canvas/WebGLRenderingContext.h
@@ -163,7 +163,6 @@ public:
// void glGetShaderPrecisionFormat (GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision);
String getShaderSource(WebGLShader*, ExceptionCode&);
- String getString(unsigned long name);
WebGLGetInfo getTexParameter(unsigned long target, unsigned long pname, ExceptionCode&);
@@ -187,7 +186,7 @@ public:
void linkProgram(WebGLProgram*, ExceptionCode&);
void pixelStorei(unsigned long pname, long param);
void polygonOffset(double factor, double units);
- void readPixels(long x, long y, long width, long height, unsigned long format, unsigned long type, ArrayBufferView* pixels);
+ void readPixels(long x, long y, long width, long height, unsigned long format, unsigned long type, ArrayBufferView* pixels, ExceptionCode&);
void releaseShaderCompiler();
void renderbufferStorage(unsigned long target, unsigned long internalformat, unsigned long width, unsigned long height);
void sampleCoverage(double value, bool invert);
diff --git a/WebCore/html/canvas/WebGLRenderingContext.idl b/WebCore/html/canvas/WebGLRenderingContext.idl
index 7a63752..f76646d 100644
--- a/WebCore/html/canvas/WebGLRenderingContext.idl
+++ b/WebCore/html/canvas/WebGLRenderingContext.idl
@@ -563,7 +563,6 @@ module html {
// void glGetShaderPrecisionFormat (GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision);
[StrictTypeChecking] DOMString getShaderSource(in WebGLShader shader) raises(DOMException);
- [StrictTypeChecking] DOMString getString(in unsigned long name);
// any getTexParameter(in unsigned long target, in unsigned long pname) raises(DOMException);
[StrictTypeChecking, Custom] void getTexParameter();
@@ -591,7 +590,7 @@ module html {
[StrictTypeChecking] void pixelStorei(in unsigned long pname, in long param);
[StrictTypeChecking] void polygonOffset(in double factor, in double units);
- [StrictTypeChecking] void readPixels(in long x, in long y, in long width, in long height, in unsigned long format, in unsigned long type, in ArrayBufferView pixels);
+ [StrictTypeChecking] void readPixels(in long x, in long y, in long width, in long height, in unsigned long format, in unsigned long type, in ArrayBufferView pixels) raises(DOMException);
[StrictTypeChecking] void releaseShaderCompiler();
[StrictTypeChecking] void renderbufferStorage(in unsigned long target, in unsigned long internalformat, in unsigned long width, in unsigned long height);
diff --git a/WebCore/html/canvas/WebGLShader.cpp b/WebCore/html/canvas/WebGLShader.cpp
index 4f8bf68..1ccaad8 100644
--- a/WebCore/html/canvas/WebGLShader.cpp
+++ b/WebCore/html/canvas/WebGLShader.cpp
@@ -47,7 +47,8 @@ WebGLShader::WebGLShader(WebGLRenderingContext* ctx, GraphicsContext3D::WebGLEnu
void WebGLShader::deleteObjectImpl(Platform3DObject object)
{
- context()->graphicsContext3D()->deleteShader(object);
+ if (!isDeleted())
+ context()->graphicsContext3D()->deleteShader(object);
}
}
diff --git a/WebCore/html/canvas/WebGLTexture.cpp b/WebCore/html/canvas/WebGLTexture.cpp
index 7fc84ad..c2b1c10 100644
--- a/WebCore/html/canvas/WebGLTexture.cpp
+++ b/WebCore/html/canvas/WebGLTexture.cpp
@@ -29,6 +29,7 @@
#include "WebGLTexture.h"
+#include "WebGLFramebuffer.h"
#include "WebGLRenderingContext.h"
namespace WebCore {
@@ -201,7 +202,8 @@ bool WebGLTexture::needToUseBlackTexture() const
void WebGLTexture::deleteObjectImpl(Platform3DObject object)
{
- context()->graphicsContext3D()->deleteTexture(object);
+ if (!isDeleted())
+ context()->graphicsContext3D()->deleteTexture(object);
}
int WebGLTexture::mapTargetToIndex(unsigned long target)
diff --git a/WebCore/html/parser/HTMLDocumentParser.cpp b/WebCore/html/parser/HTMLDocumentParser.cpp
index 2da403f..dc19c96 100644
--- a/WebCore/html/parser/HTMLDocumentParser.cpp
+++ b/WebCore/html/parser/HTMLDocumentParser.cpp
@@ -86,7 +86,7 @@ HTMLDocumentParser::HTMLDocumentParser(HTMLDocument* document, bool reportErrors
: ScriptableDocumentParser(document)
, m_tokenizer(HTMLTokenizer::create(usePreHTML5ParserQuirks(document)))
, m_scriptRunner(HTMLScriptRunner::create(document, this))
- , m_treeBuilder(HTMLTreeBuilder::create(m_tokenizer.get(), document, reportErrors))
+ , m_treeBuilder(HTMLTreeBuilder::create(m_tokenizer.get(), document, reportErrors, usePreHTML5ParserQuirks(document)))
, m_parserScheduler(HTMLParserScheduler::create(this))
, m_endWasDelayed(false)
, m_writeNestingLevel(0)
@@ -98,7 +98,7 @@ HTMLDocumentParser::HTMLDocumentParser(HTMLDocument* document, bool reportErrors
HTMLDocumentParser::HTMLDocumentParser(DocumentFragment* fragment, Element* contextElement, FragmentScriptingPermission scriptingPermission)
: ScriptableDocumentParser(fragment->document())
, m_tokenizer(HTMLTokenizer::create(usePreHTML5ParserQuirks(fragment->document())))
- , m_treeBuilder(HTMLTreeBuilder::create(m_tokenizer.get(), fragment, contextElement, scriptingPermission))
+ , m_treeBuilder(HTMLTreeBuilder::create(m_tokenizer.get(), fragment, contextElement, scriptingPermission, usePreHTML5ParserQuirks(fragment->document())))
, m_endWasDelayed(false)
, m_writeNestingLevel(0)
{
diff --git a/WebCore/html/parser/HTMLTreeBuilder.cpp b/WebCore/html/parser/HTMLTreeBuilder.cpp
index afac2a0..355dc8d 100644
--- a/WebCore/html/parser/HTMLTreeBuilder.cpp
+++ b/WebCore/html/parser/HTMLTreeBuilder.cpp
@@ -323,7 +323,7 @@ private:
};
-HTMLTreeBuilder::HTMLTreeBuilder(HTMLTokenizer* tokenizer, HTMLDocument* document, bool reportErrors)
+HTMLTreeBuilder::HTMLTreeBuilder(HTMLTokenizer* tokenizer, HTMLDocument* document, bool reportErrors, bool usePreHTML5ParserQuirks)
: m_framesetOk(true)
, m_document(document)
, m_tree(document, FragmentScriptingAllowed, false)
@@ -335,12 +335,13 @@ HTMLTreeBuilder::HTMLTreeBuilder(HTMLTokenizer* tokenizer, HTMLDocument* documen
, m_tokenizer(tokenizer)
, m_scriptToProcessStartLine(uninitializedLineNumberValue)
, m_lastScriptElementStartLine(uninitializedLineNumberValue)
+ , m_usePreHTML5ParserQuirks(usePreHTML5ParserQuirks)
{
}
// FIXME: Member variables should be grouped into self-initializing structs to
// minimize code duplication between these constructors.
-HTMLTreeBuilder::HTMLTreeBuilder(HTMLTokenizer* tokenizer, DocumentFragment* fragment, Element* contextElement, FragmentScriptingPermission scriptingPermission)
+HTMLTreeBuilder::HTMLTreeBuilder(HTMLTokenizer* tokenizer, DocumentFragment* fragment, Element* contextElement, FragmentScriptingPermission scriptingPermission, bool usePreHTML5ParserQuirks)
: m_framesetOk(true)
, m_fragmentContext(fragment, contextElement, scriptingPermission)
, m_document(m_fragmentContext.document())
@@ -353,6 +354,7 @@ HTMLTreeBuilder::HTMLTreeBuilder(HTMLTokenizer* tokenizer, DocumentFragment* fra
, m_tokenizer(tokenizer)
, m_scriptToProcessStartLine(uninitializedLineNumberValue)
, m_lastScriptElementStartLine(uninitializedLineNumberValue)
+ , m_usePreHTML5ParserQuirks(usePreHTML5ParserQuirks)
{
if (contextElement) {
// Steps 4.2-4.6 of the HTML5 Fragment Case parsing algorithm:
@@ -2204,6 +2206,13 @@ void HTMLTreeBuilder::processEndTag(AtomicHTMLToken& token)
if (isParsingFragment() && m_fragmentContext.scriptingPermission() == FragmentScriptingNotAllowed)
m_scriptToProcess->removeAllChildren();
setInsertionMode(m_originalInsertionMode);
+
+ // This token will not have been created by the tokenizer if a
+ // self-closing script tag was encountered and pre-HTML5 parser
+ // quirks are enabled. We must set the tokenizer's state to
+ // DataState explicitly if the tokenizer didn't have a chance to.
+ ASSERT(m_tokenizer->state() == HTMLTokenizer::DataState || m_usePreHTML5ParserQuirks);
+ m_tokenizer->setState(HTMLTokenizer::DataState);
return;
}
m_tree.openElements()->pop();
@@ -2706,6 +2715,8 @@ bool HTMLTreeBuilder::processStartTagForInHead(AtomicHTMLToken& token)
}
if (token.name() == scriptTag) {
processScriptStartTag(token);
+ if (m_usePreHTML5ParserQuirks && token.selfClosing())
+ processFakeEndTag(scriptTag);
return true;
}
if (token.name() == headTag) {
diff --git a/WebCore/html/parser/HTMLTreeBuilder.h b/WebCore/html/parser/HTMLTreeBuilder.h
index d522ea8..e61fe73 100644
--- a/WebCore/html/parser/HTMLTreeBuilder.h
+++ b/WebCore/html/parser/HTMLTreeBuilder.h
@@ -51,13 +51,13 @@ class Node;
class HTMLTreeBuilder : public Noncopyable {
public:
- static PassOwnPtr<HTMLTreeBuilder> create(HTMLTokenizer* tokenizer, HTMLDocument* document, bool reportErrors)
+ static PassOwnPtr<HTMLTreeBuilder> create(HTMLTokenizer* tokenizer, HTMLDocument* document, bool reportErrors, bool usePreHTML5ParserQuirks)
{
- return adoptPtr(new HTMLTreeBuilder(tokenizer, document, reportErrors));
+ return adoptPtr(new HTMLTreeBuilder(tokenizer, document, reportErrors, usePreHTML5ParserQuirks));
}
- static PassOwnPtr<HTMLTreeBuilder> create(HTMLTokenizer* tokenizer, DocumentFragment* fragment, Element* contextElement, FragmentScriptingPermission scriptingPermission)
+ static PassOwnPtr<HTMLTreeBuilder> create(HTMLTokenizer* tokenizer, DocumentFragment* fragment, Element* contextElement, FragmentScriptingPermission scriptingPermission, bool usePreHTML5ParserQuirks)
{
- return adoptPtr(new HTMLTreeBuilder(tokenizer, fragment, contextElement, scriptingPermission));
+ return adoptPtr(new HTMLTreeBuilder(tokenizer, fragment, contextElement, scriptingPermission, usePreHTML5ParserQuirks));
}
~HTMLTreeBuilder();
@@ -110,8 +110,8 @@ private:
AfterAfterFramesetMode,
};
- HTMLTreeBuilder(HTMLTokenizer*, HTMLDocument*, bool reportErrors);
- HTMLTreeBuilder(HTMLTokenizer*, DocumentFragment*, Element* contextElement, FragmentScriptingPermission);
+ HTMLTreeBuilder(HTMLTokenizer*, HTMLDocument*, bool reportErrors, bool usePreHTML5ParserQuirks);
+ HTMLTreeBuilder(HTMLTokenizer*, DocumentFragment*, Element* contextElement, FragmentScriptingPermission, bool usePreHTML5ParserQuirks);
bool isParsingFragment() const { return !!m_fragmentContext.fragment(); }
@@ -252,6 +252,8 @@ private:
// created to service the legacy tree builder, but it seems to be used for
// some other things now.
int m_lastScriptElementStartLine;
+
+ bool m_usePreHTML5ParserQuirks;
};
}
diff --git a/WebCore/inspector/Inspector.idl b/WebCore/inspector/Inspector.idl
index ae136b2..a08a622 100644
--- a/WebCore/inspector/Inspector.idl
+++ b/WebCore/inspector/Inspector.idl
@@ -37,9 +37,11 @@ module core {
[notify] void addNodesToSearchResult(out Array nodeIds);
[notify] void attributesUpdated(out long id, out Array attributes);
[notify] void bringToFront();
+ [notify] void characterDataModified(out long id, out String newValue);
[notify] void childNodeCountUpdated(out long id, out int newValue);
[notify] void childNodeInserted(out long parentId, out long prevId, out Object node);
[notify] void childNodeRemoved(out long parentId, out long id);
+ [notify] void consoleMessagesCleared();
[notify] void didCommitLoad();
[notify] void evaluateForTestInFrontend(out long testCallId, out String script);
[notify] void disconnectFromBackend();
@@ -47,8 +49,6 @@ module core {
[notify] void removeResource(out unsigned long identifier);
[notify] void reset();
[notify] void resetProfilesPanel();
- [notify] void searchingForNodeWasEnabled();
- [notify] void searchingForNodeWasDisabled();
[notify] void setChildNodes(out long parentId, out Array nodes);
[notify] void setDetachedRoot(out Object root);
[notify] void setDocument(out Value root);
@@ -59,7 +59,6 @@ module core {
[notify] void updateConsoleMessageRepeatCount(out unsigned long count);
[notify] void updateFocusedNode(out long nodeId);
[notify] void updateResource(out Value resource);
- [notify] void consoleMessagesCleared();
#if defined(ENABLE_JAVASCRIPT_DEBUGGER) && ENABLE_JAVASCRIPT_DEBUGGER
[notify] void addProfileHeader(out Object header);
@@ -104,8 +103,7 @@ module core {
[handler=Controller] void saveApplicationSettings(in String settings);
[handler=Controller] void saveSessionSettings(in String settings);
- [handler=Controller] void enableSearchingForNode();
- [handler=Controller] void disableSearchingForNode();
+ [handler=Controller] void setSearchingForNode(in boolean enabled, out boolean newState);
[handler=Controller] void setMonitoringXHREnabled(in boolean enable, out boolean newState);
@@ -132,11 +130,14 @@ module core {
[handler=Debug] void stepIntoStatement();
[handler=Debug] void stepOutOfFunction();
- [handler=Debug] void setPauseOnExceptionsState(in long pauseOnExceptionsState);
+ [handler=Debug] void setPauseOnExceptionsState(in long pauseOnExceptionsState, out long newState);
[handler=Debug] void editScriptSource(in String sourceID, in String newContent, out boolean success, out String result, out Value newCallFrames);
[handler=Debug] void getScriptSource(in String sourceID, out String scriptSource);
+ [handler=Controller] void setNativeBreakpoint(in Object breakpoint, out unsigned int breakpointId);
+ [handler=Controller] void removeNativeBreakpoint(in unsigned int breakpointId);
+
[handler=Controller] void enableProfiler(in boolean always);
[handler=Controller] void disableProfiler(in boolean always);
diff --git a/WebCore/inspector/InspectorController.cpp b/WebCore/inspector/InspectorController.cpp
index 5f8f190..f2ee2c1 100644
--- a/WebCore/inspector/InspectorController.cpp
+++ b/WebCore/inspector/InspectorController.cpp
@@ -111,10 +111,6 @@
#include "StorageArea.h"
#endif
-#if ENABLE(JAVASCRIPT_DEBUGGER)
-#include "ScriptDebugServer.h"
-#endif
-
using namespace std;
namespace WebCore {
@@ -127,9 +123,11 @@ static const char* const monitoringXHRSettingName = "xhrMonitor";
static const char* const resourceTrackingAlwaysEnabledSettingName = "resourceTrackingEnabled";
static const char* const profilerAlwaysEnabledSettingName = "profilerEnabled";
-static const char* const timelineProfilerEnabledStateName = "timelineProfilerEnabled";
-static const char* const resourceTrackingEnabledStateName = "resourceTrackingEnabled";
static const char* const monitoringXHRStateName = "monitoringXHREnabled";
+static const char* const resourceTrackingEnabledStateName = "resourceTrackingEnabled";
+static const char* const searchingForNodeEnabledStateName = "searchingForNodeEnabled";
+static const char* const timelineProfilerEnabledStateName = "timelineProfilerEnabled";
+static const char* const pauseOnExceptionsStateStateName = "pauseOnExceptionsState";
static const char* const inspectorAttachedHeightName = "inspectorAttachedHeight";
@@ -153,7 +151,7 @@ static const float maximumAttachedHeightRatio = 0.75f;
static const unsigned maximumConsoleMessages = 1000;
static const unsigned expireConsoleMessagesStep = 100;
-static unsigned s_inspectorControllerCount;
+unsigned InspectorController::s_inspectorControllerCount = 0;
InspectorController::InspectorController(Page* page, InspectorClient* client)
: m_inspectedPage(page)
@@ -174,6 +172,7 @@ InspectorController::InspectorController(Page* page, InspectorClient* client)
, m_injectedScriptHost(InjectedScriptHost::create(this))
#if ENABLE(JAVASCRIPT_DEBUGGER)
, m_attachDebuggerWhenShown(false)
+ , m_lastBreakpointId(0)
, m_profilerAgent(InspectorProfilerAgent::create(this))
#endif
{
@@ -256,6 +255,10 @@ void InspectorController::getInspectorState(RefPtr<InspectorObject>* state)
{
(*state)->setBoolean(monitoringXHRStateName, m_monitoringXHR);
(*state)->setBoolean(resourceTrackingEnabledStateName, m_resourceTrackingEnabled);
+#if ENABLE(JAVASCRIPT_DEBUGGER)
+ if (m_debuggerAgent)
+ (*state)->setNumber(pauseOnExceptionsStateStateName, m_debuggerAgent->pauseOnExceptionsState());
+#endif
}
void InspectorController::updateInspectorStateCookie()
@@ -264,6 +267,7 @@ void InspectorController::updateInspectorStateCookie()
state->setBoolean(monitoringXHRStateName, m_monitoringXHR);
state->setBoolean(resourceTrackingEnabledStateName, m_resourceTrackingEnabled);
state->setBoolean(timelineProfilerEnabledStateName, m_timelineAgent);
+ state->setBoolean(searchingForNodeEnabledStateName, m_searchingForNode);
m_client->updateInspectorStateCookie(state->toJSONString());
}
@@ -279,6 +283,7 @@ void InspectorController::restoreInspectorStateFromCookie(const String& inspecto
inspectorState->getBoolean(monitoringXHRStateName, &m_monitoringXHR);
inspectorState->getBoolean(resourceTrackingEnabledStateName, &m_resourceTrackingEnabled);
+ inspectorState->getBoolean(searchingForNodeEnabledStateName, &m_searchingForNode);
bool timelineProfilerEnabled = false;
inspectorState->getBoolean(timelineProfilerEnabledStateName, &timelineProfilerEnabled);
@@ -492,12 +497,13 @@ void InspectorController::setSearchingForNode(bool enabled)
m_searchingForNode = enabled;
if (!m_searchingForNode)
hideHighlight();
- if (m_frontend) {
- if (enabled)
- m_frontend->searchingForNodeWasEnabled();
- else
- m_frontend->searchingForNodeWasDisabled();
- }
+ updateInspectorStateCookie();
+}
+
+void InspectorController::setSearchingForNode(bool enabled, bool* newState)
+{
+ *newState = enabled;
+ setSearchingForNode(enabled);
}
void InspectorController::setMonitoringXHREnabled(bool enabled, bool* newState)
@@ -650,10 +656,6 @@ void InspectorController::populateScriptObjects()
showPanel(m_showAfterVisible);
- if (m_searchingForNode)
- m_frontend->searchingForNodeWasEnabled();
-
-
#if ENABLE(JAVASCRIPT_DEBUGGER)
if (m_profilerAgent->enabled())
m_frontend->profilerWasEnabled();
@@ -674,10 +676,6 @@ void InspectorController::populateScriptObjects()
for (unsigned i = 0; i < messageCount; ++i)
m_consoleMessages[i]->addToFrontend(m_frontend.get(), m_injectedScriptHost.get());
-#if ENABLE(JAVASCRIPT_DEBUGGER)
- if (debuggerEnabled())
- m_frontend->updatePauseOnExceptionsState(ScriptDebugServer::shared().pauseOnExceptionsState());
-#endif
#if ENABLE(DATABASE)
DatabaseResourcesMap::iterator databasesEnd = m_databaseResources.end();
for (DatabaseResourcesMap::iterator it = m_databaseResources.begin(); it != databasesEnd; ++it)
@@ -790,6 +788,8 @@ void InspectorController::didCommitLoad(DocumentLoader* loader)
#if ENABLE(JAVASCRIPT_DEBUGGER)
if (m_debuggerAgent)
m_debuggerAgent->clearForPageNavigation();
+
+ m_XHRBreakpoints.clear();
#endif
#if ENABLE(JAVASCRIPT_DEBUGGER) && USE(JSC)
m_profilerAgent->resetState();
@@ -1672,6 +1672,29 @@ void InspectorController::resume()
m_debuggerAgent->resume();
}
+void InspectorController::setNativeBreakpoint(PassRefPtr<InspectorObject> breakpoint, unsigned int* breakpointId)
+{
+ *breakpointId = 0;
+ String type;
+ if (!breakpoint->getString("type", &type))
+ return;
+ if (type == "XHR") {
+ RefPtr<InspectorObject> condition = breakpoint->getObject("condition");
+ if (!condition)
+ return;
+ String url;
+ if (!condition->getString("url", &url))
+ return;
+ *breakpointId = ++m_lastBreakpointId;
+ m_XHRBreakpoints.set(*breakpointId, url);
+ }
+}
+
+void InspectorController::removeNativeBreakpoint(unsigned int breakpointId)
+{
+ m_XHRBreakpoints.remove(breakpointId);
+}
+
#endif
void InspectorController::evaluateForTestInFrontend(long callId, const String& script)
@@ -2085,9 +2108,9 @@ void InspectorController::willInsertDOMNodeImpl(Node* node, Node* parent)
#if ENABLE(JAVASCRIPT_DEBUGGER)
if (!m_debuggerAgent || !m_domAgent)
return;
- PassRefPtr<InspectorValue> details;
- if (m_domAgent->shouldBreakOnNodeInsertion(node, parent, &details))
- m_debuggerAgent->breakProgram(details);
+ PassRefPtr<InspectorValue> eventData;
+ if (m_domAgent->shouldBreakOnNodeInsertion(node, parent, &eventData))
+ m_debuggerAgent->breakProgram(DOMBreakpointDebuggerEventType, eventData);
#endif
}
@@ -2102,9 +2125,9 @@ void InspectorController::willRemoveDOMNodeImpl(Node* node)
#if ENABLE(JAVASCRIPT_DEBUGGER)
if (!m_debuggerAgent || !m_domAgent)
return;
- PassRefPtr<InspectorValue> details;
- if (m_domAgent->shouldBreakOnNodeRemoval(node, &details))
- m_debuggerAgent->breakProgram(details);
+ PassRefPtr<InspectorValue> eventData;
+ if (m_domAgent->shouldBreakOnNodeRemoval(node, &eventData))
+ m_debuggerAgent->breakProgram(DOMBreakpointDebuggerEventType, eventData);
#endif
}
@@ -2119,9 +2142,9 @@ void InspectorController::willModifyDOMAttrImpl(Element* element)
#if ENABLE(JAVASCRIPT_DEBUGGER)
if (!m_debuggerAgent || !m_domAgent)
return;
- PassRefPtr<InspectorValue> details;
- if (m_domAgent->shouldBreakOnAttributeModification(element, &details))
- m_debuggerAgent->breakProgram(details);
+ PassRefPtr<InspectorValue> eventData;
+ if (m_domAgent->shouldBreakOnAttributeModification(element, &eventData))
+ m_debuggerAgent->breakProgram(DOMBreakpointDebuggerEventType, eventData);
#endif
}
@@ -2131,6 +2154,31 @@ void InspectorController::didModifyDOMAttrImpl(Element* element)
m_domAgent->didModifyDOMAttr(element);
}
+void InspectorController::characterDataModifiedImpl(CharacterData* characterData)
+{
+ if (m_domAgent)
+ m_domAgent->characterDataModified(characterData);
+}
+
+void InspectorController::instrumentWillSendXMLHttpRequestImpl(const KURL& url)
+{
+#if ENABLE(JAVASCRIPT_DEBUGGER)
+ if (m_debuggerAgent) {
+ if (!m_XHRBreakpoints.size())
+ return;
+ for (HashMap<unsigned int, String>::iterator it = m_XHRBreakpoints.begin(); it != m_XHRBreakpoints.end(); ++it) {
+ if (!url.string().contains(it->second))
+ continue;
+ RefPtr<InspectorObject> eventData = InspectorObject::create();
+ eventData->setString("type", "XHR");
+ eventData->setString("url", url);
+ m_debuggerAgent->breakProgram(NativeBreakpointDebuggerEventType, eventData);
+ break;
+ }
+ }
+#endif
+}
+
} // namespace WebCore
diff --git a/WebCore/inspector/InspectorController.h b/WebCore/inspector/InspectorController.h
index 6752044..9e63f01 100644
--- a/WebCore/inspector/InspectorController.h
+++ b/WebCore/inspector/InspectorController.h
@@ -29,6 +29,7 @@
#ifndef InspectorController_h
#define InspectorController_h
+#include "CharacterData.h"
#include "Console.h"
#include "Cookie.h"
#include "Element.h"
@@ -45,6 +46,7 @@
namespace WebCore {
class CachedResource;
+class CharacterData;
class ConsoleMessage;
class Database;
class Document;
@@ -201,6 +203,9 @@ public:
static void willRemoveDOMNode(Node*);
static void willModifyDOMAttr(Element*);
static void didModifyDOMAttr(Element*);
+ static void characterDataModified(CharacterData*);
+
+ static void instrumentWillSendXMLHttpRequest(ScriptExecutionContext*, const KURL&);
#if ENABLE(WORKERS)
enum WorkerAction { WorkerCreated, WorkerDestroyed };
@@ -264,6 +269,10 @@ public:
bool debuggerEnabled() const { return m_debuggerAgent; }
InspectorDebuggerAgent* debuggerAgent() const { return m_debuggerAgent.get(); }
void resume();
+
+ void setNativeBreakpoint(PassRefPtr<InspectorObject> breakpoint, unsigned int* breakpointId);
+ void removeNativeBreakpoint(unsigned int breakpointId);
+
#endif
void evaluateForTestInFrontend(long testCallId, const String& script);
@@ -288,11 +297,10 @@ private:
void restoreDebugger();
void restoreProfiler();
void unbindAllResources();
+ void setSearchingForNode(bool enabled);
// Following are used from InspectorBackend and internally.
- void setSearchingForNode(bool enabled);
- void enableSearchingForNode() { setSearchingForNode(true); }
- void disableSearchingForNode() { setSearchingForNode(false); }
+ void setSearchingForNode(bool enabled, bool* newState);
void setMonitoringXHREnabled(bool enabled, bool* newState);
void storeLastActivePanel(const String& panelName);
@@ -331,13 +339,19 @@ private:
void didEvaluateForTestInFrontend(long callId, const String& jsonResult);
+ static InspectorController* inspectorControllerForScriptExecutionContext(ScriptExecutionContext* context);
static InspectorController* inspectorControllerForNode(Node*);
+ static InspectorController* inspectorControllerForDocument(Document* document);
+
void willInsertDOMNodeImpl(Node* node, Node* parent);
void didInsertDOMNodeImpl(Node*);
void willRemoveDOMNodeImpl(Node*);
void didRemoveDOMNodeImpl(Node*);
void willModifyDOMAttrImpl(Element*);
void didModifyDOMAttrImpl(Element*);
+ void characterDataModifiedImpl(CharacterData*);
+
+ void instrumentWillSendXMLHttpRequestImpl(const KURL&);
#if ENABLE(JAVASCRIPT_DEBUGGER)
friend class InspectorDebuggerAgent;
@@ -346,6 +360,8 @@ private:
void saveBreakpoints(PassRefPtr<InspectorObject> breakpoints);
#endif
+ static unsigned s_inspectorControllerCount;
+
Page* m_inspectedPage;
InspectorClient* m_client;
OwnPtr<InspectorFrontendClient> m_inspectorFrontendClient;
@@ -400,6 +416,9 @@ private:
bool m_attachDebuggerWhenShown;
OwnPtr<InspectorDebuggerAgent> m_debuggerAgent;
+ HashMap<unsigned int, String> m_XHRBreakpoints;
+ unsigned int m_lastBreakpointId;
+
OwnPtr<InspectorProfilerAgent> m_profilerAgent;
#endif
#if ENABLE(WORKERS)
@@ -451,18 +470,48 @@ inline void InspectorController::didModifyDOMAttr(Element* element)
#endif
}
-inline InspectorController* InspectorController::inspectorControllerForNode(Node* node)
+inline void InspectorController::characterDataModified(CharacterData* characterData)
{
#if ENABLE(INSPECTOR)
- if (Page* page = node->document()->page()) {
- if (InspectorController* inspectorController = page->inspectorController()) {
- if (inspectorController->hasFrontend())
- return inspectorController;
- }
- }
+ if (InspectorController* inspectorController = inspectorControllerForNode(characterData))
+ inspectorController->characterDataModifiedImpl(characterData);
#endif
+}
- return 0;
+inline void InspectorController::instrumentWillSendXMLHttpRequest(ScriptExecutionContext* context, const KURL& url)
+{
+#if ENABLE(INSPECTOR)
+ if (InspectorController* inspectorController = inspectorControllerForScriptExecutionContext(context))
+ inspectorController->instrumentWillSendXMLHttpRequestImpl(url);
+#endif
+}
+
+inline InspectorController* InspectorController::inspectorControllerForScriptExecutionContext(ScriptExecutionContext* context)
+{
+ if (!s_inspectorControllerCount || !context || !context->isDocument())
+ return 0;
+ return inspectorControllerForDocument(static_cast<Document*>(context));
+}
+
+inline InspectorController* InspectorController::inspectorControllerForNode(Node* node)
+{
+ if (!s_inspectorControllerCount)
+ return 0;
+ return inspectorControllerForDocument(node->document());
+}
+
+inline InspectorController* InspectorController::inspectorControllerForDocument(Document* document)
+{
+ ASSERT(document);
+ Page* page = document->page();
+ if (!page)
+ return 0;
+ InspectorController* inspectorController = page->inspectorController();
+ if (!inspectorController)
+ return 0;
+ if (!inspectorController->hasFrontend())
+ return 0;
+ return inspectorController;
}
} // namespace WebCore
diff --git a/WebCore/inspector/InspectorDOMAgent.cpp b/WebCore/inspector/InspectorDOMAgent.cpp
index f1df5b0..f51da73 100644
--- a/WebCore/inspector/InspectorDOMAgent.cpp
+++ b/WebCore/inspector/InspectorDOMAgent.cpp
@@ -43,6 +43,7 @@
#include "CSSStyleRule.h"
#include "CSSStyleSelector.h"
#include "CSSStyleSheet.h"
+#include "CharacterData.h"
#include "ContainerNode.h"
#include "Cookie.h"
#include "CookieJar.h"
@@ -1120,6 +1121,14 @@ void InspectorDOMAgent::didModifyDOMAttr(Element* element)
m_frontend->attributesUpdated(id, buildArrayForElementAttributes(element));
}
+void InspectorDOMAgent::characterDataModified(CharacterData* characterData)
+{
+ long id = m_documentNodeToIdMap.get(characterData);
+ if (!id)
+ return;
+ m_frontend->characterDataModified(id, characterData->data());
+}
+
bool InspectorDOMAgent::hasBreakpoint(Node* node, long type)
{
uint32_t rootBit = 1 << type;
diff --git a/WebCore/inspector/InspectorDOMAgent.h b/WebCore/inspector/InspectorDOMAgent.h
index 7d86997..89c6fd0 100644
--- a/WebCore/inspector/InspectorDOMAgent.h
+++ b/WebCore/inspector/InspectorDOMAgent.h
@@ -53,6 +53,7 @@ namespace WebCore {
class CSSStyleDeclaration;
class CSSStyleRule;
class CSSStyleSheet;
+ class CharacterData;
class Element;
class Event;
class InspectorDOMAgent;
@@ -139,6 +140,7 @@ namespace WebCore {
void didInsertDOMNode(Node*);
void didRemoveDOMNode(Node*);
void didModifyDOMAttr(Element*);
+ void characterDataModified(CharacterData*);
Node* nodeForId(long nodeId);
long pushNodePathToFrontend(Node* node);
diff --git a/WebCore/inspector/InspectorDebuggerAgent.cpp b/WebCore/inspector/InspectorDebuggerAgent.cpp
index 3875be0..4964c09 100644
--- a/WebCore/inspector/InspectorDebuggerAgent.cpp
+++ b/WebCore/inspector/InspectorDebuggerAgent.cpp
@@ -64,7 +64,6 @@ InspectorDebuggerAgent::InspectorDebuggerAgent(InspectorController* inspectorCon
, m_frontend(frontend)
, m_pausedScriptState(0)
, m_breakpointsLoaded(false)
- , m_breakProgramReason(InspectorValue::null())
{
}
@@ -173,10 +172,15 @@ void InspectorDebuggerAgent::stepOutOfFunction()
ScriptDebugServer::shared().stepOutOfFunction();
}
-void InspectorDebuggerAgent::setPauseOnExceptionsState(long pauseState)
+void InspectorDebuggerAgent::setPauseOnExceptionsState(long pauseState, long* newState)
{
ScriptDebugServer::shared().setPauseOnExceptionsState(static_cast<ScriptDebugServer::PauseOnExceptionsState>(pauseState));
- m_frontend->updatePauseOnExceptionsState(ScriptDebugServer::shared().pauseOnExceptionsState());
+ *newState = ScriptDebugServer::shared().pauseOnExceptionsState();
+}
+
+long InspectorDebuggerAgent::pauseOnExceptionsState()
+{
+ return ScriptDebugServer::shared().pauseOnExceptionsState();
}
void InspectorDebuggerAgent::clearForPageNavigation()
@@ -289,12 +293,13 @@ void InspectorDebuggerAgent::failedToParseSource(const String& url, const String
void InspectorDebuggerAgent::didPause(ScriptState* scriptState)
{
ASSERT(scriptState && !m_pausedScriptState);
- ASSERT(m_breakProgramReason);
m_pausedScriptState = scriptState;
- RefPtr<InspectorObject> details = InspectorObject::create();
- details->setValue("callFrames", currentCallFrames());
- details->setValue("status", m_breakProgramReason);
- m_frontend->pausedScript(details);
+
+ if (!m_breakProgramDetails)
+ m_breakProgramDetails = InspectorObject::create();
+ m_breakProgramDetails->setValue("callFrames", currentCallFrames());
+
+ m_frontend->pausedScript(m_breakProgramDetails);
}
void InspectorDebuggerAgent::didContinue()
@@ -303,17 +308,19 @@ void InspectorDebuggerAgent::didContinue()
m_frontend->resumedScript();
}
-void InspectorDebuggerAgent::breakProgram(PassRefPtr<InspectorValue> reason)
+void InspectorDebuggerAgent::breakProgram(DebuggerEventType type, PassRefPtr<InspectorValue> data)
{
+ m_breakProgramDetails = InspectorObject::create();
+ m_breakProgramDetails->setNumber("eventType", type);
+ m_breakProgramDetails->setValue("eventData", data);
s_debuggerAgentOnBreakpoint = this;
- m_breakProgramReason = reason;
ScriptDebugServer::shared().breakProgram();
if (!s_debuggerAgentOnBreakpoint)
return;
s_debuggerAgentOnBreakpoint = 0;
- m_breakProgramReason = InspectorValue::null();
+ m_breakProgramDetails = 0;
}
} // namespace WebCore
diff --git a/WebCore/inspector/InspectorDebuggerAgent.h b/WebCore/inspector/InspectorDebuggerAgent.h
index 79b0a0e..8a5379d 100644
--- a/WebCore/inspector/InspectorDebuggerAgent.h
+++ b/WebCore/inspector/InspectorDebuggerAgent.h
@@ -43,8 +43,14 @@ namespace WebCore {
class InjectedScriptHost;
class InspectorController;
class InspectorFrontend;
+class InspectorObject;
class InspectorValue;
+enum DebuggerEventType {
+ DOMBreakpointDebuggerEventType,
+ NativeBreakpointDebuggerEventType
+};
+
class InspectorDebuggerAgent : public ScriptDebugListener, public Noncopyable {
public:
static PassOwnPtr<InspectorDebuggerAgent> create(InspectorController*, InspectorFrontend*);
@@ -61,13 +67,14 @@ public:
void getScriptSource(const String& sourceID, String* scriptSource);
void pause();
- void breakProgram(PassRefPtr<InspectorValue> reason);
+ void breakProgram(DebuggerEventType type, PassRefPtr<InspectorValue> data);
void resume();
void stepOverStatement();
void stepIntoStatement();
void stepOutOfFunction();
- void setPauseOnExceptionsState(long pauseState);
+ void setPauseOnExceptionsState(long pauseState, long* newState);
+ long pauseOnExceptionsState();
void clearForPageNavigation();
@@ -95,7 +102,7 @@ private:
HashMap<String, unsigned> m_breakpointsMapping;
bool m_breakpointsLoaded;
static InspectorDebuggerAgent* s_debuggerAgentOnBreakpoint;
- RefPtr<InspectorValue> m_breakProgramReason;
+ RefPtr<InspectorObject> m_breakProgramDetails;
};
} // namespace WebCore
diff --git a/WebCore/inspector/front-end/AbstractTimelinePanel.js b/WebCore/inspector/front-end/AbstractTimelinePanel.js
deleted file mode 100644
index 187ef86..0000000
--- a/WebCore/inspector/front-end/AbstractTimelinePanel.js
+++ /dev/null
@@ -1,527 +0,0 @@
-/*
- * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
- * Copyright (C) 2008, 2009 Anthony Ricaud <rik@webkit.org>
- * Copyright (C) 2009 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-WebInspector.AbstractTimelinePanel = function(name)
-{
- WebInspector.Panel.call(this, name);
- this._items = [];
- this._staleItems = [];
-}
-
-WebInspector.AbstractTimelinePanel.prototype = {
- get categories()
- {
- // Should be implemented by the concrete subclasses.
- return {};
- },
-
- populateSidebar: function()
- {
- // Should be implemented by the concrete subclasses.
- },
-
- createItemTreeElement: function(item)
- {
- // Should be implemented by the concrete subclasses.
- },
-
- createItemGraph: function(item)
- {
- // Should be implemented by the concrete subclasses.
- },
-
- get items()
- {
- return this._items;
- },
-
- createInterface: function()
- {
- this.containerElement = document.createElement("div");
- this.containerElement.id = "resources-container";
- this.containerElement.addEventListener("scroll", this._updateDividersLabelBarPosition.bind(this), false);
- this.element.appendChild(this.containerElement);
-
- this.createSidebar(this.containerElement, this.element);
- this.sidebarElement.id = "resources-sidebar";
- this.populateSidebar();
-
- this._containerContentElement = document.createElement("div");
- this._containerContentElement.id = "resources-container-content";
- this.containerElement.appendChild(this._containerContentElement);
-
- this.summaryBar = new WebInspector.SummaryBar(this.categories);
- this.summaryBar.element.id = "resources-summary";
- this._containerContentElement.appendChild(this.summaryBar.element);
-
- this._timelineGrid = new WebInspector.TimelineGrid();
- this._containerContentElement.appendChild(this._timelineGrid.element);
- this.itemsGraphsElement = this._timelineGrid.itemsGraphsElement;
- },
-
- createFilterPanel: function()
- {
- this.filterBarElement = document.createElement("div");
- this.filterBarElement.id = "resources-filter";
- this.filterBarElement.className = "scope-bar";
- this.element.appendChild(this.filterBarElement);
-
- function createFilterElement(category)
- {
- if (category === "all")
- var label = WebInspector.UIString("All");
- else if (this.categories[category])
- var label = this.categories[category].title;
-
- var categoryElement = document.createElement("li");
- categoryElement.category = category;
- categoryElement.addStyleClass(category);
- categoryElement.appendChild(document.createTextNode(label));
- categoryElement.addEventListener("click", this._updateFilter.bind(this), false);
- this.filterBarElement.appendChild(categoryElement);
-
- return categoryElement;
- }
-
- this.filterAllElement = createFilterElement.call(this, "all");
-
- // Add a divider
- var dividerElement = document.createElement("div");
- dividerElement.addStyleClass("divider");
- this.filterBarElement.appendChild(dividerElement);
-
- for (var category in this.categories)
- createFilterElement.call(this, category);
- },
-
- showCategory: function(category)
- {
- var filterClass = "filter-" + category.toLowerCase();
- this.itemsGraphsElement.addStyleClass(filterClass);
- this.itemsTreeElement.childrenListElement.addStyleClass(filterClass);
- },
-
- hideCategory: function(category)
- {
- var filterClass = "filter-" + category.toLowerCase();
- this.itemsGraphsElement.removeStyleClass(filterClass);
- this.itemsTreeElement.childrenListElement.removeStyleClass(filterClass);
- },
-
- filter: function(target, selectMultiple)
- {
- function unselectAll()
- {
- for (var i = 0; i < this.filterBarElement.childNodes.length; ++i) {
- var child = this.filterBarElement.childNodes[i];
- if (!child.category)
- continue;
-
- child.removeStyleClass("selected");
- this.hideCategory(child.category);
- }
- }
-
- if (target === this.filterAllElement) {
- if (target.hasStyleClass("selected")) {
- // We can't unselect All, so we break early here
- return;
- }
-
- // If All wasn't selected, and now is, unselect everything else.
- unselectAll.call(this);
- } else {
- // Something other than All is being selected, so we want to unselect All.
- if (this.filterAllElement.hasStyleClass("selected")) {
- this.filterAllElement.removeStyleClass("selected");
- this.hideCategory("all");
- }
- }
-
- if (!selectMultiple) {
- // If multiple selection is off, we want to unselect everything else
- // and just select ourselves.
- unselectAll.call(this);
-
- target.addStyleClass("selected");
- this.showCategory(target.category);
- return;
- }
-
- if (target.hasStyleClass("selected")) {
- // If selectMultiple is turned on, and we were selected, we just
- // want to unselect ourselves.
- target.removeStyleClass("selected");
- this.hideCategory(target.category);
- } else {
- // If selectMultiple is turned on, and we weren't selected, we just
- // want to select ourselves.
- target.addStyleClass("selected");
- this.showCategory(target.category);
- }
- },
-
- _updateFilter: function(e)
- {
- var isMac = WebInspector.isMac();
- var selectMultiple = false;
- if (isMac && e.metaKey && !e.ctrlKey && !e.altKey && !e.shiftKey)
- selectMultiple = true;
- if (!isMac && e.ctrlKey && !e.metaKey && !e.altKey && !e.shiftKey)
- selectMultiple = true;
-
- this.filter(e.target, selectMultiple);
-
- // When we are updating our filtering, scroll to the top so we don't end up
- // in blank graph under all the resources.
- this.containerElement.scrollTop = 0;
-
- var searchField = document.getElementById("search");
- WebInspector.doPerformSearch(searchField.value, WebInspector.shortSearchWasForcedByKeyEvent, false, true);
- },
-
- updateGraphDividersIfNeeded: function(force)
- {
- if (!this.visible) {
- this.needsRefresh = true;
- return false;
- }
- return this._timelineGrid.updateDividers(force, this.calculator);
- },
-
- _updateDividersLabelBarPosition: function()
- {
- const scrollTop = this.containerElement.scrollTop;
- const offsetHeight = this.summaryBar.element.offsetHeight;
- const dividersTop = (scrollTop < offsetHeight ? offsetHeight : scrollTop);
- this._timelineGrid.setScrollAndDividerTop(scrollTop, dividersTop);
- },
-
- get needsRefresh()
- {
- return this._needsRefresh;
- },
-
- set needsRefresh(x)
- {
- if (this._needsRefresh === x)
- return;
-
- this._needsRefresh = x;
-
- if (x) {
- if (this.visible && !("_refreshTimeout" in this))
- this._refreshTimeout = setTimeout(this.refresh.bind(this), 500);
- } else {
- if ("_refreshTimeout" in this) {
- clearTimeout(this._refreshTimeout);
- delete this._refreshTimeout;
- }
- }
- },
-
- refreshIfNeeded: function()
- {
- if (this.needsRefresh)
- this.refresh();
- },
-
- show: function()
- {
- WebInspector.Panel.prototype.show.call(this);
-
- this._updateDividersLabelBarPosition();
- this.refreshIfNeeded();
- },
-
- resize: function()
- {
- WebInspector.Panel.prototype.resize.call(this);
-
- this.updateGraphDividersIfNeeded();
- },
-
- updateMainViewWidth: function(width)
- {
- this._containerContentElement.style.left = width + "px";
- this.resize();
- },
-
- invalidateAllItems: function()
- {
- this._staleItems = this._items.slice();
- },
-
- refresh: function()
- {
- this.needsRefresh = false;
-
- var staleItemsLength = this._staleItems.length;
-
- var boundariesChanged = false;
-
- for (var i = 0; i < staleItemsLength; ++i) {
- var item = this._staleItems[i];
- if (!item._itemsTreeElement) {
- // Create the timeline tree element and graph.
- item._itemsTreeElement = this.createItemTreeElement(item);
- item._itemsTreeElement._itemGraph = this.createItemGraph(item);
-
- this.itemsTreeElement.appendChild(item._itemsTreeElement);
- this.itemsGraphsElement.appendChild(item._itemsTreeElement._itemGraph.graphElement);
- }
-
- if (item._itemsTreeElement.refresh)
- item._itemsTreeElement.refresh();
-
- if (this.calculator.updateBoundaries(item))
- boundariesChanged = true;
- }
-
- if (boundariesChanged) {
- // The boundaries changed, so all item graphs are stale.
- this._staleItems = this._items.slice();
- staleItemsLength = this._staleItems.length;
- }
-
-
- const isBarOpaqueAtLeft = this.sidebarTree.selectedTreeElement && this.sidebarTree.selectedTreeElement.isBarOpaqueAtLeft;
- for (var i = 0; i < staleItemsLength; ++i)
- this._staleItems[i]._itemsTreeElement._itemGraph.refresh(this.calculator, isBarOpaqueAtLeft);
-
- this._staleItems = [];
-
- this.updateGraphDividersIfNeeded();
- },
-
- reset: function()
- {
- this.containerElement.scrollTop = 0;
-
- if (this._calculator)
- this._calculator.reset();
-
- if (this._items) {
- var itemsLength = this._items.length;
- for (var i = 0; i < itemsLength; ++i) {
- var item = this._items[i];
- delete item._itemsTreeElement;
- }
- }
-
- this._items = [];
- this._staleItems = [];
-
- this.itemsTreeElement.removeChildren();
- this.itemsGraphsElement.removeChildren();
-
- this.updateGraphDividersIfNeeded(true);
- },
-
- get calculator()
- {
- return this._calculator;
- },
-
- set calculator(x)
- {
- if (!x || this._calculator === x)
- return;
-
- this._calculator = x;
- this._calculator.reset();
-
- this._staleItems = this._items.slice();
- this.refresh();
- },
-
- addItem: function(item)
- {
- this._items.push(item);
- this.refreshItem(item);
- },
-
- removeItem: function(item)
- {
- this._items.remove(item, true);
-
- if (item._itemsTreeElement) {
- this.itemsTreeElement.removeChild(item._itemsTreeElement);
- this.itemsGraphsElement.removeChild(item._itemsTreeElement._itemGraph.graphElement);
- }
-
- delete item._itemsTreeElement;
- this.adjustScrollPosition();
- },
-
- refreshItem: function(item)
- {
- this._staleItems.push(item);
- this.needsRefresh = true;
- },
-
- revealAndSelectItem: function(item)
- {
- if (item._itemsTreeElement) {
- item._itemsTreeElement.reveal();
- item._itemsTreeElement.select(true);
- }
- },
-
- sortItems: function(sortingFunction)
- {
- var sortedElements = [].concat(this.itemsTreeElement.children);
- sortedElements.sort(sortingFunction);
-
- var sortedElementsLength = sortedElements.length;
- for (var i = 0; i < sortedElementsLength; ++i) {
- var treeElement = sortedElements[i];
- if (treeElement === this.itemsTreeElement.children[i])
- continue;
-
- var wasSelected = treeElement.selected;
- this.itemsTreeElement.removeChild(treeElement);
- this.itemsTreeElement.insertChild(treeElement, i);
- if (wasSelected)
- treeElement.select(true);
-
- var graphElement = treeElement._itemGraph.graphElement;
- this.itemsGraphsElement.insertBefore(graphElement, this.itemsGraphsElement.children[i]);
- }
- },
-
- adjustScrollPosition: function()
- {
- // Prevent the container from being scrolled off the end.
- if ((this.containerElement.scrollTop + this.containerElement.offsetHeight) > this.sidebarElement.offsetHeight)
- this.containerElement.scrollTop = (this.sidebarElement.offsetHeight - this.containerElement.offsetHeight);
- },
-
- addEventDivider: function(divider)
- {
- this._timelineGrid.addEventDivider(divider);
- },
-
- hideEventDividers: function()
- {
- this._timelineGrid.hideEventDividers();
- },
-
- showEventDividers: function()
- {
- this._timelineGrid.showEventDividers();
- }
-}
-
-WebInspector.AbstractTimelinePanel.prototype.__proto__ = WebInspector.Panel.prototype;
-
-WebInspector.AbstractTimelineCalculator = function()
-{
-}
-
-WebInspector.AbstractTimelineCalculator.prototype = {
- computeSummaryValues: function(items)
- {
- var total = 0;
- var categoryValues = {};
-
- var itemsLength = items.length;
- for (var i = 0; i < itemsLength; ++i) {
- var item = items[i];
- var value = this._value(item);
- if (typeof value === "undefined")
- continue;
- if (!(item.category.name in categoryValues))
- categoryValues[item.category.name] = 0;
- categoryValues[item.category.name] += value;
- total += value;
- }
-
- return {categoryValues: categoryValues, total: total};
- },
-
- computeBarGraphPercentages: function(item)
- {
- return {start: 0, middle: 0, end: (this._value(item) / this.boundarySpan) * 100};
- },
-
- computeBarGraphLabels: function(item)
- {
- const label = this.formatValue(this._value(item));
- return {left: label, right: label, tooltip: label};
- },
-
- get boundarySpan()
- {
- return this.maximumBoundary - this.minimumBoundary;
- },
-
- updateBoundaries: function(item)
- {
- this.minimumBoundary = 0;
-
- var value = this._value(item);
- if (typeof this.maximumBoundary === "undefined" || value > this.maximumBoundary) {
- this.maximumBoundary = value;
- return true;
- }
- return false;
- },
-
- reset: function()
- {
- delete this.minimumBoundary;
- delete this.maximumBoundary;
- },
-
- _value: function(item)
- {
- return 0;
- },
-
- formatValue: function(value)
- {
- return value.toString();
- }
-}
-
-WebInspector.AbstractTimelineCategory = function(name, title, color)
-{
- this.name = name;
- this.title = title;
- this.color = color;
-}
-
-WebInspector.AbstractTimelineCategory.prototype = {
- toString: function()
- {
- return this.title;
- }
-}
diff --git a/WebCore/inspector/front-end/AuditLauncherView.js b/WebCore/inspector/front-end/AuditLauncherView.js
index 18daee6..a922715 100644
--- a/WebCore/inspector/front-end/AuditLauncherView.js
+++ b/WebCore/inspector/front-end/AuditLauncherView.js
@@ -190,7 +190,8 @@ WebInspector.AuditLauncherView.prototype = {
var element = document.createElement("input");
element.type = "checkbox";
- element.addEventListener("click", this._boundCategoryClickListener, false);
+ if (id !== "")
+ element.addEventListener("click", this._boundCategoryClickListener, false);
labelElement.appendChild(element);
labelElement.appendChild(document.createTextNode(title));
diff --git a/WebCore/inspector/front-end/BreakpointManager.js b/WebCore/inspector/front-end/BreakpointManager.js
index 8518618..ec4e7cf 100644
--- a/WebCore/inspector/front-end/BreakpointManager.js
+++ b/WebCore/inspector/front-end/BreakpointManager.js
@@ -27,6 +27,7 @@
WebInspector.BreakpointManager = function()
{
this._breakpoints = {};
+ this._xhrBreakpoints = {};
}
WebInspector.BreakpointManager.prototype = {
@@ -124,6 +125,22 @@ WebInspector.BreakpointManager.prototype = {
}
}
InspectorBackend.setBreakpoint(breakpoint.sourceID, breakpoint.line, breakpoint.enabled, breakpoint.condition, didSetBreakpoint.bind(this));
+ },
+
+ createXHRBreakpoint: function(url)
+ {
+ if (url in this._xhrBreakpoints)
+ return;
+ this._xhrBreakpoints[url] = true;
+
+ var breakpoint = new WebInspector.XHRBreakpoint(url);
+ breakpoint.addEventListener("removed", this._xhrBreakpointRemoved.bind(this));
+ this.dispatchEventToListeners("xhr-breakpoint-added", breakpoint);
+ },
+
+ _xhrBreakpointRemoved: function(event)
+ {
+ delete this._xhrBreakpoints[event.target.url];
}
}
@@ -189,6 +206,15 @@ WebInspector.Breakpoint.prototype = {
this.dispatchEventToListeners("condition-changed");
},
+ compareTo: function(other)
+ {
+ if (this.url != other.url)
+ return this.url < other.url ? -1 : 1;
+ if (this.line != other.line)
+ return this.line < other.line ? -1 : 1;
+ return 0;
+ },
+
remove: function()
{
InspectorBackend.removeBreakpoint(this.sourceID, this.line);
@@ -199,3 +225,83 @@ WebInspector.Breakpoint.prototype = {
}
WebInspector.Breakpoint.prototype.__proto__ = WebInspector.Object.prototype;
+
+WebInspector.XHRBreakpoint = function(url)
+{
+ this._url = url;
+ this._locked = false;
+ this.enabled = true;
+}
+
+WebInspector.XHRBreakpoint.prototype = {
+ get enabled()
+ {
+ return "_id" in this;
+ },
+
+ set enabled(enabled)
+ {
+ if (this._locked)
+ return;
+ if (this.enabled === enabled)
+ return;
+ if (enabled)
+ this._setOnBackend();
+ else
+ this._removeFromBackend();
+ },
+
+ get url()
+ {
+ return this._url;
+ },
+
+ formatLabel: function()
+ {
+ var label = "";
+ if (!this.url.length)
+ label = WebInspector.UIString("Any XHR");
+ else
+ label = WebInspector.UIString("URL contains \"%s\"", this.url);
+ return label;
+ },
+
+ compareTo: function(other)
+ {
+ if (this.url != other.url)
+ return this.url < other.url ? -1 : 1;
+ return 0;
+ },
+
+ remove: function()
+ {
+ if (this._locked)
+ return;
+ if (this.enabled)
+ this._removeFromBackend();
+ this.dispatchEventToListeners("removed");
+ },
+
+ _setOnBackend: function()
+ {
+ this._locked = true;
+ var data = { type: "XHR", condition: { url: this.url } };
+ InspectorBackend.setNativeBreakpoint(data, didSet.bind(this));
+
+ function didSet(breakpointId)
+ {
+ this._locked = false;
+ this._id = breakpointId;
+ this.dispatchEventToListeners("enable-changed");
+ }
+ },
+
+ _removeFromBackend: function()
+ {
+ InspectorBackend.removeNativeBreakpoint(this._id);
+ delete this._id;
+ this.dispatchEventToListeners("enable-changed");
+ }
+}
+
+WebInspector.XHRBreakpoint.prototype.__proto__ = WebInspector.Object.prototype;
diff --git a/WebCore/inspector/front-end/BreakpointsSidebarPane.js b/WebCore/inspector/front-end/BreakpointsSidebarPane.js
index 9688f3e..16ab041 100644
--- a/WebCore/inspector/front-end/BreakpointsSidebarPane.js
+++ b/WebCore/inspector/front-end/BreakpointsSidebarPane.js
@@ -92,6 +92,42 @@ WebInspector.BreakpointsSidebarPane.prototype = {
WebInspector.BreakpointsSidebarPane.prototype.__proto__ = WebInspector.SidebarPane.prototype;
+WebInspector.XHRBreakpointsSidebarPane = function()
+{
+ WebInspector.BreakpointsSidebarPane.call(this, WebInspector.UIString("XHR Breakpoints"));
+
+ var addButton = document.createElement("button");
+ addButton.className = "add";
+ addButton.addEventListener("click", this._showEditBreakpointDialog.bind(this), false);
+ this.titleElement.appendChild(addButton);
+
+ this.urlInputElement = document.createElement("span");
+ this.urlInputElement.className = "breakpoint-condition editing";
+}
+
+WebInspector.XHRBreakpointsSidebarPane.prototype = {
+ _showEditBreakpointDialog: function(event)
+ {
+ event.stopPropagation();
+
+ if (this.urlInputElement.parentElement)
+ return;
+
+ this.urlInputElement.textContent = "";
+ this.bodyElement.insertBefore(this.urlInputElement, this.bodyElement.firstChild);
+ WebInspector.startEditing(this.urlInputElement, this._hideEditBreakpointDialog.bind(this, false), this._hideEditBreakpointDialog.bind(this, true));
+ },
+
+ _hideEditBreakpointDialog: function(discard)
+ {
+ if (!discard)
+ WebInspector.breakpointManager.createXHRBreakpoint(this.urlInputElement.textContent.toLowerCase());
+ this.bodyElement.removeChild(this.urlInputElement);
+ }
+}
+
+WebInspector.XHRBreakpointsSidebarPane.prototype.__proto__ = WebInspector.BreakpointsSidebarPane.prototype;
+
WebInspector.BreakpointItem = function(breakpoint)
{
this._breakpoint = breakpoint;
@@ -116,6 +152,11 @@ WebInspector.BreakpointItem.prototype = {
return this._element;
},
+ compareTo: function(other)
+ {
+ return this._breakpoint.compareTo(other._breakpoint);
+ },
+
remove: function()
{
this._breakpoint.remove();
@@ -125,7 +166,7 @@ WebInspector.BreakpointItem.prototype = {
{
this._breakpoint.enabled = !this._breakpoint.enabled;
- // without this, we'd switch to the source of the clicked breakpoint
+ // Breakpoint element may have it's own click handler.
event.stopPropagation();
},
@@ -133,6 +174,10 @@ WebInspector.BreakpointItem.prototype = {
{
var checkbox = this._element.firstChild;
checkbox.checked = this._breakpoint.enabled;
+ },
+
+ _breakpointClicked: function(event)
+ {
}
}
@@ -155,15 +200,6 @@ WebInspector.JSBreakpointItem = function(breakpoint)
}
WebInspector.JSBreakpointItem.prototype = {
- compareTo: function(other)
- {
- if (this._breakpoint.url != other._breakpoint.url)
- return this._breakpoint.url < other._breakpoint.url ? -1 : 1;
- if (this._breakpoint.line != other._breakpoint.line)
- return this._breakpoint.line < other._breakpoint.line ? -1 : 1;
- return 0;
- },
-
_breakpointClicked: function()
{
WebInspector.panels.scripts.showSourceLine(this._breakpoint.url, this._breakpoint.line);
@@ -191,13 +227,6 @@ WebInspector.DOMBreakpointItem = function(breakpoint)
}
WebInspector.DOMBreakpointItem.prototype = {
- compareTo: function(other)
- {
- if (this._breakpoint.type != other._breakpoint.type)
- return this._breakpoint.type < other._breakpoint.type ? -1 : 1;
- return 0;
- },
-
_breakpointClicked: function()
{
WebInspector.updateFocusedNode(this._breakpoint.nodeId);
@@ -205,3 +234,13 @@ WebInspector.DOMBreakpointItem.prototype = {
}
WebInspector.DOMBreakpointItem.prototype.__proto__ = WebInspector.BreakpointItem.prototype;
+
+WebInspector.XHRBreakpointItem = function(breakpoint)
+{
+ WebInspector.BreakpointItem.call(this, breakpoint);
+
+ var label = document.createTextNode(this._breakpoint.formatLabel());
+ this._element.appendChild(label);
+}
+
+WebInspector.XHRBreakpointItem.prototype.__proto__ = WebInspector.BreakpointItem.prototype;
diff --git a/WebCore/inspector/front-end/CallStackSidebarPane.js b/WebCore/inspector/front-end/CallStackSidebarPane.js
index 91f35a6..6212ea1 100644
--- a/WebCore/inspector/front-end/CallStackSidebarPane.js
+++ b/WebCore/inspector/front-end/CallStackSidebarPane.js
@@ -28,6 +28,11 @@ WebInspector.CallStackSidebarPane = function()
WebInspector.SidebarPane.call(this, WebInspector.UIString("Call Stack"));
}
+WebInspector.CallStackSidebarPane.DebuggerEventType = {
+ DOMBreakpoint: 0,
+ NativeBreakpoint: 1
+};
+
WebInspector.CallStackSidebarPane.prototype = {
update: function(callFrames, sourceIDMap)
{
@@ -82,36 +87,41 @@ WebInspector.CallStackSidebarPane.prototype = {
}
},
- updateStatus: function(status)
+ updateStatus: function(eventType, eventData)
{
var statusElement = document.createElement("div");
- statusElement.className = "info";
-
- var breakpointType = status.breakpoint.type;
- var substitutions = [WebInspector.DOMBreakpoint.labelForType(breakpointType), WebInspector.panels.elements.linkifyNodeById(status.breakpoint.nodeId)];
- var formatters = {
- s: function(substitution)
+ if (eventType === WebInspector.CallStackSidebarPane.DebuggerEventType.DOMBreakpoint) {
+ var breakpoint = eventData.breakpoint;
+ var substitutions = [WebInspector.DOMBreakpoint.labelForType(breakpoint.type), WebInspector.panels.elements.linkifyNodeById(breakpoint.nodeId)];
+ var formatters = {
+ s: function(substitution)
+ {
+ return substitution;
+ }
+ };
+ function append(a, b)
{
- return substitution;
+ if (typeof b === "string")
+ b = document.createTextNode(b);
+ statusElement.appendChild(b);
}
- };
- function append(a, b)
- {
- if (typeof b === "string")
- b = document.createTextNode(b);
- statusElement.appendChild(b);
- }
- if (breakpointType === WebInspector.DOMBreakpoint.Types.SubtreeModified) {
- var targetNode = WebInspector.panels.elements.linkifyNodeById(status.targetNodeId);
- if (status.insertion) {
- if (status.targetNodeId !== status.breakpoint.nodeId)
- WebInspector.formatLocalized("Paused on a \"%s\" breakpoint set on %s, because a new child was added to its descendant %s.", substitutions.concat(targetNode), formatters, "", append);
- else
- WebInspector.formatLocalized("Paused on a \"%s\" breakpoint set on %s, because a new child was added to that node.", substitutions, formatters, "", append);
+ if (breakpoint.type === WebInspector.DOMBreakpoint.Types.SubtreeModified) {
+ var targetNode = WebInspector.panels.elements.linkifyNodeById(eventData.targetNodeId);
+ if (eventData.insertion) {
+ if (eventData.targetNodeId !== breakpoint.nodeId)
+ WebInspector.formatLocalized("Paused on a \"%s\" breakpoint set on %s, because a new child was added to its descendant %s.", substitutions.concat(targetNode), formatters, "", append);
+ else
+ WebInspector.formatLocalized("Paused on a \"%s\" breakpoint set on %s, because a new child was added to that node.", substitutions, formatters, "", append);
+ } else
+ WebInspector.formatLocalized("Paused on a \"%s\" breakpoint set on %s, because its descendant %s was removed.", substitutions.concat(targetNode), formatters, "", append);
} else
- WebInspector.formatLocalized("Paused on a \"%s\" breakpoint set on %s, because its descendant %s was removed.", substitutions.concat(targetNode), formatters, "", append);
- } else
- WebInspector.formatLocalized("Paused on a \"%s\" breakpoint set on %s.", substitutions, formatters, "", append);
+ WebInspector.formatLocalized("Paused on a \"%s\" breakpoint set on %s.", substitutions, formatters, "", append);
+ } else if (eventType === WebInspector.CallStackSidebarPane.DebuggerEventType.NativeBreakpoint && eventData.type === "XHR")
+ statusElement.appendChild(document.createTextNode(WebInspector.UIString("Paused on XMLHttpRequest.")));
+ else
+ return;
+
+ statusElement.className = "info";
this.bodyElement.appendChild(statusElement);
},
diff --git a/WebCore/inspector/front-end/DOMAgent.js b/WebCore/inspector/front-end/DOMAgent.js
index 9b386c3..279852e 100644
--- a/WebCore/inspector/front-end/DOMAgent.js
+++ b/WebCore/inspector/front-end/DOMAgent.js
@@ -98,13 +98,7 @@ WebInspector.DOMNode.prototype = {
set nodeValue(value) {
if (this.nodeType != Node.TEXT_NODE)
return;
- var self = this;
- var callback = function()
- {
- self._nodeValue = value;
- self.textContent = value;
- };
- this.ownerDocument._domAgent.setTextNodeValueAsync(this, value, callback);
+ this.ownerDocument._domAgent.setTextNodeValueAsync(this, value, function() {});
},
getAttribute: function(name)
@@ -384,6 +378,15 @@ WebInspector.DOMAgent.prototype = {
this.document._fireDomEvent("DOMAttrModified", event);
},
+ _characterDataModified: function(nodeId, newValue)
+ {
+ var node = this._idToDOMNode[nodeId];
+ node._nodeValue = newValue;
+ node.textContent = newValue;
+ var event = { target : node };
+ this.document._fireDomEvent("DOMCharacterDataModified", event);
+ },
+
nodeForId: function(nodeId)
{
return this._idToDOMNode[nodeId];
@@ -691,6 +694,11 @@ WebInspector.attributesUpdated = function()
this.domAgent._attributesUpdated.apply(this.domAgent, arguments);
}
+WebInspector.characterDataModified = function()
+{
+ this.domAgent._characterDataModified.apply(this.domAgent, arguments);
+}
+
WebInspector.setDocument = function()
{
this.domAgent._setDocument.apply(this.domAgent, arguments);
@@ -866,6 +874,13 @@ WebInspector.DOMBreakpoint.prototype = {
this.dispatchEventToListeners("enable-changed");
},
+ compareTo: function(other)
+ {
+ if (this.type != other.type)
+ return this.type < other.type ? -1 : 1;
+ return 0;
+ },
+
remove: function()
{
if (this.enabled)
diff --git a/WebCore/inspector/front-end/DataGrid.js b/WebCore/inspector/front-end/DataGrid.js
index 1ecc4f2..f68fe48 100644
--- a/WebCore/inspector/front-end/DataGrid.js
+++ b/WebCore/inspector/front-end/DataGrid.js
@@ -92,10 +92,8 @@ WebInspector.DataGrid = function(columns, editCallback, deleteCallback)
cell.addStyleClass("sortable");
}
- if (column.aligned) {
- cell.addStyleClass(column.aligned);
+ if (column.aligned)
this.aligned[columnIdentifier] = column.aligned;
- }
headerRow.appendChild(cell);
@@ -412,6 +410,7 @@ WebInspector.DataGrid.prototype = {
resizer.style.left = left + "px";
}
+ this.dispatchEventToListeners("width changed");
},
addCreationNode: function(hasChildren)
@@ -535,6 +534,35 @@ WebInspector.DataGrid.prototype = {
this.children = [];
},
+ sortNodes: function(comparator, descending)
+ {
+ function comparatorWrapper(a, b)
+ {
+ var aDataGirdNode = a._dataGridNode;
+ var bDataGirdNode = b._dataGridNode;
+ if (!aDataGirdNode)
+ return 1; // Filler row.
+ if (!bDataGirdNode)
+ return -1; // Filler row.
+ return descending ? comparator(bDataGirdNode, aDataGirdNode) : comparator(aDataGirdNode, bDataGirdNode);
+ }
+
+ var tbody = this.dataTableBody;
+ var tbodyParent = tbody.parentElement;
+ tbodyParent.removeChild(tbody);
+
+ var childNodes = tbody.childNodes;
+ var sortedNodes = Array.prototype.slice.call(childNodes);
+ sortedNodes.sort(comparatorWrapper.bind(this));
+
+ var sortedNodesLength = sortedNodes.length;
+ tbody.removeChildren();
+ for (var i = 0; i < sortedNodesLength; ++i) {
+ var node = sortedNodes[i];
+ tbody.appendChild(node);
+ }
+ tbodyParent.appendChild(tbody);
+ },
_keyDown: function(event)
{
@@ -772,12 +800,14 @@ WebInspector.DataGrid.prototype = {
this._dataTableColumnGroup.children[resizer.rightNeighboringColumnID].style.width = percentRightColumn;
event.preventDefault();
+ this.dispatchEventToListeners("width changed");
},
_endResizerDragging: function(event)
{
WebInspector.elementDragEnd(event);
this.currentResizer = null;
+ this.dispatchEventToListeners("width changed");
},
ColumnResizePadding: 10,
@@ -825,12 +855,16 @@ WebInspector.DataGridNode.prototype = {
if (this.revealed)
this._element.addStyleClass("revealed");
+ this.createCells();
+ return this._element;
+ },
+
+ createCells: function()
+ {
for (var columnIdentifier in this.dataGrid.columns) {
var cell = this.createCell(columnIdentifier);
this._element.appendChild(cell);
}
-
- return this._element;
},
get data()
@@ -964,11 +998,7 @@ WebInspector.DataGridNode.prototype = {
return;
this._element.removeChildren();
-
- for (var columnIdentifier in this.dataGrid.columns) {
- var cell = this.createCell(columnIdentifier);
- this._element.appendChild(cell);
- }
+ this.createCells();
},
createCell: function(columnIdentifier)
diff --git a/WebCore/inspector/front-end/ElementsPanel.js b/WebCore/inspector/front-end/ElementsPanel.js
index 72b23e1..d6437fc 100644
--- a/WebCore/inspector/front-end/ElementsPanel.js
+++ b/WebCore/inspector/front-end/ElementsPanel.js
@@ -74,7 +74,7 @@ WebInspector.ElementsPanel = function()
this.sidebarPanes.styles = new WebInspector.StylesSidebarPane(this.sidebarPanes.computedStyle);
this.sidebarPanes.metrics = new WebInspector.MetricsSidebarPane();
this.sidebarPanes.properties = new WebInspector.PropertiesSidebarPane();
- if (Preferences.domBreakpointsEnabled)
+ if (Preferences.nativeInstrumentationEnabled)
this.sidebarPanes.domBreakpoints = WebInspector.createDOMBreakpointsSidebarPane();
this.sidebarPanes.eventListeners = new WebInspector.EventListenersSidebarPane();
@@ -148,7 +148,7 @@ WebInspector.ElementsPanel.prototype = {
WebInspector.Panel.prototype.hide.call(this);
WebInspector.highlightDOMNode(0);
- InspectorBackend.disableSearchingForNode();
+ this.setSearchingForNode(false);
},
resize: function()
@@ -171,7 +171,7 @@ WebInspector.ElementsPanel.prototype = {
delete this.currentQuery;
- if (Preferences.domBreakpointsEnabled)
+ if (Preferences.nativeInstrumentationEnabled)
this.sidebarPanes.domBreakpoints.reset();
},
@@ -186,6 +186,7 @@ WebInspector.ElementsPanel.prototype = {
inspectedRootDocument.addEventListener("DOMNodeInserted", this._nodeInserted.bind(this));
inspectedRootDocument.addEventListener("DOMNodeRemoved", this._nodeRemoved.bind(this));
inspectedRootDocument.addEventListener("DOMAttrModified", this._attributesUpdated.bind(this));
+ inspectedRootDocument.addEventListener("DOMCharacterDataModified", this._characterDataModified.bind(this));
this.rootDOMNode = inspectedRootDocument;
@@ -247,16 +248,6 @@ WebInspector.ElementsPanel.prototype = {
InspectorBackend.performSearch(whitespaceTrimmedQuery, false);
},
- searchingForNodeWasEnabled: function()
- {
- this._nodeSearchButton.toggled = true;
- },
-
- searchingForNodeWasDisabled: function()
- {
- this._nodeSearchButton.toggled = false;
- },
-
populateHrefContextMenu: function(contextMenu, event, anchorElement)
{
if (!anchorElement.href)
@@ -491,6 +482,13 @@ WebInspector.ElementsPanel.prototype = {
this._updateModifiedNodesSoon();
},
+ _characterDataModified: function(event)
+ {
+ this.recentlyModifiedNodes.push({node: event.target, updated: true});
+ if (this.visible)
+ this._updateModifiedNodesSoon();
+ },
+
_nodeInserted: function(event)
{
this.recentlyModifiedNodes.push({node: event.target, parent: event.relatedNode, inserted: true});
@@ -1152,12 +1150,29 @@ WebInspector.ElementsPanel.prototype = {
this.treeOutline.updateSelection();
},
+ updateFocusedNode: function(nodeId)
+ {
+ var node = WebInspector.domAgent.nodeForId(nodeId);
+ if (!node)
+ return;
+
+ this.focusedDOMNode = node;
+ this._nodeSearchButton.toggled = false;
+ },
+
+ _setSearchingForNode: function(enabled)
+ {
+ this._nodeSearchButton.toggled = enabled;
+ },
+
+ setSearchingForNode: function(enabled)
+ {
+ InspectorBackend.setSearchingForNode(enabled, this._setSearchingForNode.bind(this));
+ },
+
toggleSearchingForNode: function()
{
- if (!this._nodeSearchButton.toggled)
- InspectorBackend.enableSearchingForNode();
- else
- InspectorBackend.disableSearchingForNode();
+ this.setSearchingForNode(!this._nodeSearchButton.toggled);
},
elementsToRestoreScrollPositionsFor: function()
diff --git a/WebCore/inspector/front-end/ElementsTreeOutline.js b/WebCore/inspector/front-end/ElementsTreeOutline.js
index e261234..1479c9a 100644
--- a/WebCore/inspector/front-end/ElementsTreeOutline.js
+++ b/WebCore/inspector/front-end/ElementsTreeOutline.js
@@ -637,10 +637,12 @@ WebInspector.ElementsTreeElement.prototype = {
this.listItemElement.scrollIntoViewIfNeeded(false);
},
- onselect: function()
+ onselect: function(treeElement, selectedByUser)
{
this.treeOutline.suppressRevealAndSelect = true;
this.treeOutline.focusedDOMNode = this.representedObject;
+ if (selectedByUser)
+ WebInspector.highlightDOMNode(this.representedObject.id);
this.updateSelection();
this.treeOutline.suppressRevealAndSelect = false;
},
@@ -752,7 +754,7 @@ WebInspector.ElementsTreeElement.prototype = {
contextMenu.appendItem(WebInspector.UIString("Copy as HTML"), this._copyHTML.bind(this));
contextMenu.appendItem(WebInspector.UIString("Delete Node"), this.remove.bind(this));
- if (Preferences.domBreakpointsEnabled) {
+ if (Preferences.nativeInstrumentationEnabled) {
// Add debbuging-related actions
contextMenu.appendSeparator();
@@ -1125,7 +1127,7 @@ WebInspector.ElementsTreeElement.prototype = {
delete this._editing;
var textNode;
- if (this.representedObject.nodeType == Node.ELEMENT_NODE) {
+ if (this.representedObject.nodeType === Node.ELEMENT_NODE) {
// We only show text nodes inline in elements if the element only
// has a single child, and that child is a text node.
textNode = this.representedObject.firstChild;
@@ -1133,9 +1135,6 @@ WebInspector.ElementsTreeElement.prototype = {
textNode = this.representedObject;
textNode.nodeValue = newText;
-
- // Need to restore attributes / node structure.
- this.updateTitle();
},
_editingCancelled: function(element, context)
diff --git a/WebCore/inspector/front-end/GoToLineDialog.js b/WebCore/inspector/front-end/GoToLineDialog.js
new file mode 100644
index 0000000..c96344c
--- /dev/null
+++ b/WebCore/inspector/front-end/GoToLineDialog.js
@@ -0,0 +1,127 @@
+/*
+ * 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.
+ */
+
+WebInspector.GoToLineDialog = function(view)
+{
+ this._element = document.createElement("div");
+ this._element.className = "go-to-line-dialog";
+ this._element.addEventListener("keydown", this._onKeyDown.bind(this), false);
+ this._closeKeys = [
+ WebInspector.KeyboardShortcut.Keys.Enter.code,
+ WebInspector.KeyboardShortcut.Keys.Esc.code,
+ ];
+
+ var dialogWindow = this._element;
+
+ dialogWindow.createChild("label").innerText = WebInspector.UIString("Go to line: ");
+
+ this._input = dialogWindow.createChild("input");
+ this._input.setAttribute("type", "text");
+ this._input.setAttribute("size", 6);
+ var linesCount = view.sourceFrame.textModel.linesCount;
+ if (linesCount)
+ this._input.setAttribute("title", WebInspector.UIString("1 - %d", linesCount));
+ var blurHandler = this._onBlur.bind(this);
+ this._input.addEventListener("blur", blurHandler, false);
+
+
+ var go = dialogWindow.createChild("button");
+ go.innerText = WebInspector.UIString("Go");
+ go.addEventListener("click", this._onClick.bind(this), false);
+ go.addEventListener("mousedown", function(e) {
+ // Ok button click will close the dialog, removing onBlur listener
+ // to let click event be handled.
+ this._input.removeEventListener("blur", blurHandler, false);
+ }.bind(this), false);
+
+ this._view = view;
+ view.element.appendChild(this._element);
+
+ this._previousFocusElement = WebInspector.currentFocusElement;
+ WebInspector.currentFocusElement = this._input;
+ this._input.select();
+}
+
+WebInspector.GoToLineDialog.show = function(sourceView)
+{
+ if (this._instance)
+ return;
+ this._instance = new WebInspector.GoToLineDialog(sourceView);
+}
+
+WebInspector.GoToLineDialog.prototype = {
+ _hide: function()
+ {
+ if (this._isHiding)
+ return;
+ this._isHiding = true;
+
+ WebInspector.currentFocusElement = this._previousFocusElement;
+ WebInspector.GoToLineDialog._instance = null;
+ this._element.parentElement.removeChild(this._element);
+ },
+
+ _onBlur: function(event)
+ {
+ this._hide();
+ },
+
+ _onKeyDown: function(event)
+ {
+ if (event.keyCode === WebInspector.KeyboardShortcut.Keys.Tab.code) {
+ event.preventDefault();
+ return;
+ }
+
+ if (event.keyCode === WebInspector.KeyboardShortcut.Keys.Enter.code)
+ this._highlightSelectedLine();
+
+ if (this._closeKeys.indexOf(event.keyCode) >= 0) {
+ this._hide();
+ event.stopPropagation();
+ }
+ },
+
+ _onClick: function(event)
+ {
+ this._highlightSelectedLine();
+ this._hide();
+ },
+
+ _highlightSelectedLine: function()
+ {
+ var value = this._input.value;
+ var lineNumber = parseInt(value, 10);
+ if (!isNaN(lineNumber) && lineNumber > 0) {
+ lineNumber = Math.min(lineNumber, this._view.sourceFrame.textModel.linesCount);
+ this._view.highlightLine(lineNumber);
+ }
+ }
+};
diff --git a/WebCore/inspector/front-end/Images/networkIcon.png b/WebCore/inspector/front-end/Images/networkIcon.png
new file mode 100644
index 0000000..982424d
--- /dev/null
+++ b/WebCore/inspector/front-end/Images/networkIcon.png
Binary files differ
diff --git a/WebCore/inspector/front-end/Images/paneAddButtons.png b/WebCore/inspector/front-end/Images/paneAddButtons.png
new file mode 100644
index 0000000..f1c0047
--- /dev/null
+++ b/WebCore/inspector/front-end/Images/paneAddButtons.png
Binary files differ
diff --git a/WebCore/inspector/front-end/NetworkPanel.js b/WebCore/inspector/front-end/NetworkPanel.js
new file mode 100644
index 0000000..f07b3b0
--- /dev/null
+++ b/WebCore/inspector/front-end/NetworkPanel.js
@@ -0,0 +1,1414 @@
+/*
+ * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2008, 2009 Anthony Ricaud <rik@webkit.org>
+ * Copyright (C) 2009, 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+WebInspector.NetworkPanel = function()
+{
+ WebInspector.Panel.call(this, "network");
+
+ this._resources = [];
+ this._staleResources = [];
+ this._resourceGridNodes = {};
+ this._mainResourceLoadTime = -1;
+ this._mainResourceDOMContentTime = -1;
+
+ this._viewsContainerElement = document.createElement("div");
+ this._viewsContainerElement.id = "network-views";
+ this.element.appendChild(this._viewsContainerElement);
+
+ this._createSortingFunctions();
+ this._createTimelineGrid();
+ this._createTable();
+ this._createStatusbarButtons();
+
+ this._popoverHelper = new WebInspector.PopoverHelper(this.element, this._getPopoverAnchor.bind(this), this._showPopover.bind(this), true);
+
+ this.calculator = new WebInspector.NetworkTransferTimeCalculator();
+ this.filter(this.filterAllElement, false);
+}
+
+WebInspector.NetworkPanel.prototype = {
+ get toolbarItemLabel()
+ {
+ return WebInspector.UIString("Network");
+ },
+
+ get statusBarItems()
+ {
+ return [this._largerResourcesButton.element, this._clearButton.element];
+ },
+
+ isCategoryVisible: function(categoryName)
+ {
+ return true;
+ },
+
+ elementsToRestoreScrollPositionsFor: function()
+ {
+ return [this.containerElement];
+ },
+
+ resize: function()
+ {
+ WebInspector.Panel.prototype.resize.call(this);
+ this._dataGrid.updateWidths();
+ },
+
+ _createTimelineGrid: function()
+ {
+ this._timelineGrid = new WebInspector.TimelineGrid();
+ this._timelineGrid.element.addStyleClass("network-timeline-grid");
+ this.element.appendChild(this._timelineGrid.element);
+ },
+
+ _createTable: function()
+ {
+ this.containerElement = document.createElement("div");
+ this.containerElement.id = "network-container";
+ this.element.appendChild(this.containerElement);
+
+ var columns = {url: {}, method: {}, status: {}, type: {}, size: {}, time: {}, timeline: {}};
+ columns.url.title = WebInspector.UIString("URL");
+ columns.url.sortable = true;
+ columns.url.width = "20%";
+ columns.url.disclosure = true;
+
+ columns.method.title = WebInspector.UIString("Method");
+ columns.method.sortable = true;
+ columns.method.width = "7%";
+
+ columns.status.title = WebInspector.UIString("Status");
+ columns.status.sortable = true;
+ columns.status.width = "8%";
+
+ columns.type.title = WebInspector.UIString("Type");
+ columns.type.sortable = true;
+ columns.type.width = "7%";
+
+ columns.size.title = WebInspector.UIString("Size");
+ columns.size.sortable = true;
+ columns.size.width = "10%";
+ columns.size.aligned = "right";
+
+ columns.time.title = WebInspector.UIString("Time");
+ columns.time.sortable = true;
+ columns.time.width = "10%";
+ columns.time.aligned = "right";
+
+ columns.timeline.title = "";
+ columns.timeline.sortable = true;
+ columns.timeline.width = "40%";
+ columns.timeline.sort = true;
+
+ this._dataGrid = new WebInspector.DataGrid(columns);
+ this.element.appendChild(this._dataGrid.element);
+ this._dataGrid.addEventListener("sorting changed", this._sortItems, this);
+ this._dataGrid.addEventListener("width changed", this._updateDividersIfNeeded, this);
+ },
+
+ _createSortingFunctions: function()
+ {
+ this._sortingFunctions = {};
+ this._sortingFunctions.url = WebInspector.NetworkDataGridNode.URLComparator;
+ this._sortingFunctions.method = WebInspector.NetworkDataGridNode.ResourcePropertyComparator.bind(null, "method");
+ this._sortingFunctions.status = WebInspector.NetworkDataGridNode.ResourcePropertyComparator.bind(null, "statusCode");
+ this._sortingFunctions.type = WebInspector.NetworkDataGridNode.ResourcePropertyComparator.bind(null, "mimeType");
+ this._sortingFunctions.size = WebInspector.NetworkDataGridNode.ResourcePropertyComparator.bind(null, "resourceSize");
+ this._sortingFunctions.time = WebInspector.NetworkDataGridNode.ResourcePropertyComparator.bind(null, "duration");
+ this._sortingFunctions.timeline = WebInspector.NetworkDataGridNode.ResourcePropertyComparator.bind(null, "startTime");
+ },
+
+ filter: function(target, selectMultiple)
+ {
+ },
+
+ _updateFilter: function(e)
+ {
+ var isMac = WebInspector.isMac();
+ var selectMultiple = false;
+ if (isMac && e.metaKey && !e.ctrlKey && !e.altKey && !e.shiftKey)
+ selectMultiple = true;
+ if (!isMac && e.ctrlKey && !e.metaKey && !e.altKey && !e.shiftKey)
+ selectMultiple = true;
+
+ this.filter(e.target, selectMultiple);
+
+ // When we are updating our filtering, scroll to the top so we don't end up
+ // in blank graph under all the resources.
+ this.containerElement.scrollTop = 0;
+
+ var searchField = document.getElementById("search");
+ WebInspector.doPerformSearch(searchField.value, WebInspector.shortSearchWasForcedByKeyEvent, false, true);
+ },
+
+ _scheduleRefresh: function()
+ {
+ if (this._needsRefresh)
+ return;
+
+ this._needsRefresh = true;
+
+ if (this.visible && !("_refreshTimeout" in this))
+ this._refreshTimeout = setTimeout(this.refresh.bind(this), 500);
+ },
+
+ _sortItems: function()
+ {
+ var columnIdentifier = this._dataGrid.sortColumnIdentifier;
+ var sortingFunction = this._sortingFunctions[columnIdentifier];
+ if (!sortingFunction)
+ return;
+ this._dataGrid.sortNodes(sortingFunction, this._dataGrid.sortOrder === "descending");
+ },
+
+ _updateDividersIfNeeded: function(force)
+ {
+ this._timelineGrid.element.style.left = this._dataGrid.resizers[this._dataGrid.resizers.length - 1].style.left;
+
+ var proceed = true;
+ if (!this.visible) {
+ this._scheduleRefresh();
+ proceed = false;
+ } else
+ proceed = this._timelineGrid.updateDividers(force, this.calculator);
+
+ if (!proceed)
+ return;
+
+ if (this.calculator.startAtZero || !this.calculator.computePercentageFromEventTime) {
+ // If our current sorting method starts at zero, that means it shows all
+ // resources starting at the same point, and so onLoad event and DOMContent
+ // event lines really wouldn't make much sense here, so don't render them.
+ // Additionally, if the calculator doesn't have the computePercentageFromEventTime
+ // function defined, we are probably sorting by size, and event times aren't relevant
+ // in this case.
+ return;
+ }
+
+ this._timelineGrid.removeEventDividers();
+ if (this._mainResourceLoadTime !== -1) {
+ var percent = this.calculator.computePercentageFromEventTime(this._mainResourceLoadTime);
+
+ var loadDivider = document.createElement("div");
+ loadDivider.className = "network-event-divider network-red-divider";
+
+ var loadDividerPadding = document.createElement("div");
+ loadDividerPadding.className = "network-event-divider-padding";
+ loadDividerPadding.title = WebInspector.UIString("Load event fired");
+ loadDividerPadding.appendChild(loadDivider);
+ loadDividerPadding.style.left = percent + "%";
+ this._timelineGrid.addEventDivider(loadDividerPadding);
+ }
+
+ if (this._mainResourceDOMContentTime !== -1) {
+ var percent = this.calculator.computePercentageFromEventTime(this._mainResourceDOMContentTime);
+
+ var domContentDivider = document.createElement("div");
+ domContentDivider.className = "network-event-divider network-blue-divider";
+
+ var domContentDividerPadding = document.createElement("div");
+ domContentDividerPadding.className = "network-event-divider-padding";
+ domContentDividerPadding.title = WebInspector.UIString("DOMContent event fired");
+ domContentDividerPadding.appendChild(domContentDivider);
+ domContentDividerPadding.style.left = percent + "%";
+ this._timelineGrid.addEventDivider(domContentDividerPadding);
+ }
+ },
+
+ _refreshIfNeeded: function()
+ {
+ if (this._needsRefresh)
+ this.refresh();
+ },
+
+ _invalidateAllItems: function()
+ {
+ this._staleResources = this._resources.slice();
+ },
+
+ get calculator()
+ {
+ return this._calculator;
+ },
+
+ set calculator(x)
+ {
+ if (!x || this._calculator === x)
+ return;
+
+ this._calculator = x;
+ this._calculator.reset();
+
+ this._invalidateAllItems();
+ this.refresh();
+ },
+
+ _resourceGridNode: function(resource)
+ {
+ return this._resourceGridNodes[resource.identifier];
+ },
+
+ revealAndSelectItem: function(resource)
+ {
+ var node = this._resourceGridNode(resource);
+ if (node) {
+ node.reveal();
+ node.select(true);
+ }
+ },
+
+ addEventDivider: function(divider)
+ {
+ this._timelineGrid.addEventDivider(divider);
+ },
+
+ get resourceTrackingEnabled()
+ {
+ return this._resourceTrackingEnabled;
+ },
+
+ _createStatusbarButtons: function()
+ {
+ this._clearButton = new WebInspector.StatusBarButton(WebInspector.UIString("Clear"), "clear-status-bar-item");
+ this._clearButton.addEventListener("click", this.reset.bind(this), false);
+
+ this._largerResourcesButton = new WebInspector.StatusBarButton(WebInspector.UIString("Use small resource rows."), "network-larger-resources-status-bar-item");
+ WebInspector.applicationSettings.addEventListener("loaded", this._settingsLoaded, this);
+ this._largerResourcesButton.addEventListener("click", this._toggleLargerResources.bind(this), false);
+ },
+
+ _settingsLoaded: function()
+ {
+ this._largerResourcesButton.toggled = WebInspector.applicationSettings.resourcesLargeRows;
+ if (!WebInspector.applicationSettings.resourcesLargeRows)
+ this._setLargerResources(WebInspector.applicationSettings.resourcesLargeRows);
+ },
+
+ set mainResourceLoadTime(x)
+ {
+ if (this._mainResourceLoadTime === x)
+ return;
+
+ this._mainResourceLoadTime = x || -1;
+ // Update the dividers to draw the new line
+ this._updateDividersIfNeeded(true);
+ },
+
+ set mainResourceDOMContentTime(x)
+ {
+ if (this._mainResourceDOMContentTime === x)
+ return;
+
+ this._mainResourceDOMContentTime = x || -1;
+ this._updateDividersIfNeeded(true);
+ },
+
+ show: function()
+ {
+ WebInspector.Panel.prototype.show.call(this);
+
+ this._refreshIfNeeded();
+
+ var visibleView = this.visibleView;
+ if (this.visibleResource) {
+ this.visibleView.headersVisible = true;
+ this.visibleView.show(this._viewsContainerElement);
+ } else if (visibleView)
+ visibleView.show();
+
+ // Hide any views that are visible that are not this panel's current visible view.
+ // This can happen when a ResourceView is visible in the Scripts panel then switched
+ // to the this panel.
+ var resourcesLength = this._resources.length;
+ for (var i = 0; i < resourcesLength; ++i) {
+ var resource = this._resources[i];
+ var view = resource._resourcesView;
+ if (!view || view === visibleView)
+ continue;
+ view.visible = false;
+ }
+ this._dataGrid.updateWidths();
+ },
+
+ get searchableViews()
+ {
+ var views = [];
+
+ const visibleView = this.visibleView;
+ if (visibleView && visibleView.performSearch)
+ views.push(visibleView);
+
+ var resourcesLength = this._resources.length;
+ for (var i = 0; i < resourcesLength; ++i) {
+ var resource = this._resources[i];
+ if (!this._resourceGridNode(resource) || !this._resourceGridNode(resource).selectable)
+ continue;
+ var resourceView = this.resourceViewForResource(resource);
+ if (!resourceView.performSearch || resourceView === visibleView)
+ continue;
+ views.push(resourceView);
+ }
+
+ return views;
+ },
+
+ searchMatchFound: function(view, matches)
+ {
+ this._resourceGridNode(view.resource).searchMatches = matches;
+ },
+
+ searchCanceled: function(startingNewSearch)
+ {
+ WebInspector.Panel.prototype.searchCanceled.call(this, startingNewSearch);
+
+ if (startingNewSearch || !this._resources)
+ return;
+ },
+
+ performSearch: function(query)
+ {
+ WebInspector.Panel.prototype.performSearch.call(this, query);
+ },
+
+ get visibleView()
+ {
+ if (this.visibleResource)
+ return this.visibleResource._resourcesView;
+ return null;
+ },
+
+ refresh: function()
+ {
+ this._needsRefresh = false;
+ if ("_refreshTimeout" in this) {
+ clearTimeout(this._refreshTimeout);
+ delete this._refreshTimeout;
+ }
+
+ var staleItemsLength = this._staleResources.length;
+
+ var boundariesChanged = false;
+
+ for (var i = 0; i < staleItemsLength; ++i) {
+ var resource = this._staleResources[i];
+ var node = this._resourceGridNode(resource);
+ if (!node) {
+ // Create the timeline tree element and graph.
+ node = new WebInspector.NetworkDataGridNode(resource);
+ this._resourceGridNodes[resource.identifier] = node;
+ this._dataGrid.appendChild(node);
+ }
+ node.refreshResource();
+
+ if (this.calculator.updateBoundaries(resource))
+ boundariesChanged = true;
+ }
+
+ if (boundariesChanged) {
+ // The boundaries changed, so all item graphs are stale.
+ this._invalidateAllItems();
+ staleItemsLength = this._staleResources.length;
+ }
+
+ for (var i = 0; i < staleItemsLength; ++i)
+ this._resourceGridNode(this._staleResources[i]).refreshGraph(this.calculator);
+
+ this._staleResources = [];
+ this._sortItems();
+ this._dataGrid.updateWidths();
+ },
+
+ reset: function()
+ {
+ this._popoverHelper.hidePopup();
+ this.closeVisibleResource();
+
+ delete this.currentQuery;
+ this.searchCanceled();
+
+ if (this._resources) {
+ var resourcesLength = this._resources.length;
+ for (var i = 0; i < resourcesLength; ++i) {
+ var resource = this._resources[i];
+
+ resource.warnings = 0;
+ resource.errors = 0;
+
+ delete resource._resourcesView;
+ }
+ }
+
+ // Begin reset timeline
+ this.containerElement.scrollTop = 0;
+
+ if (this._calculator)
+ this._calculator.reset();
+
+ if (this._resources) {
+ var itemsLength = this._resources.length;
+ for (var i = 0; i < itemsLength; ++i) {
+ var item = this._resources[i];
+ }
+ }
+
+ this._resources = [];
+ this._staleResources = [];
+ this._resourceGridNodes = {};
+
+ this._dataGrid.removeChildren();
+ this._updateDividersIfNeeded(true);
+ // End reset timeline.
+
+ this._mainResourceLoadTime = -1;
+ this._mainResourceDOMContentTime = -1;
+
+ this._viewsContainerElement.removeChildren();
+ },
+
+ addResource: function(resource)
+ {
+ this._resources.push(resource);
+ this.refreshResource(resource);
+ },
+
+ refreshResource: function(resource)
+ {
+ this._staleResources.push(resource);
+ this._scheduleRefresh();
+ },
+
+ recreateViewForResourceIfNeeded: function(resource)
+ {
+ if (!resource || !resource._resourcesView)
+ return;
+
+ var newView = this._createResourceView(resource);
+ if (newView.__proto__ === resource._resourcesView.__proto__)
+ return;
+
+ if (!this.currentQuery && this._resourceGridNode(resource))
+ this._resourceGridNode(resource).updateErrorsAndWarnings();
+
+ var oldView = resource._resourcesView;
+ var oldViewParentNode = oldView.visible ? oldView.element.parentNode : null;
+
+ resource._resourcesView.detach();
+ delete resource._resourcesView;
+
+ resource._resourcesView = newView;
+
+ newView.headersVisible = oldView.headersVisible;
+
+ if (oldViewParentNode)
+ newView.show(oldViewParentNode);
+
+ WebInspector.panels.scripts.viewRecreated(oldView, newView);
+ },
+
+ canShowSourceLine: function(url, line)
+ {
+ return this._resourceTrackingEnabled && !!WebInspector.resourceForURL(url);
+ },
+
+ showSourceLine: function(url, line)
+ {
+ this.showResource(WebInspector.resourceForURL(url), line);
+ },
+
+ showResource: function(resource, line)
+ {
+ if (!resource)
+ return;
+
+ this._popoverHelper.hidePopup();
+
+ this.containerElement.addStyleClass("viewing-resource");
+
+ if (this.visibleResource && this.visibleResource._resourcesView)
+ this.visibleResource._resourcesView.hide();
+
+ var view = this.resourceViewForResource(resource);
+ view.headersVisible = true;
+ view.show(this._viewsContainerElement);
+
+ if (line) {
+ view.selectContentTab(true);
+ if (view.revealLine)
+ view.revealLine(line);
+ if (view.highlightLine)
+ view.highlightLine(line);
+ }
+
+ this.revealAndSelectItem(resource);
+
+ this.visibleResource = resource;
+
+ this.updateSidebarWidth();
+ },
+
+ showView: function(view)
+ {
+ if (!view)
+ return;
+ this.showResource(view.resource);
+ },
+
+ closeVisibleResource: function()
+ {
+ this.containerElement.removeStyleClass("viewing-resource");
+
+ if (this.visibleResource && this.visibleResource._resourcesView)
+ this.visibleResource._resourcesView.hide();
+ delete this.visibleResource;
+
+ if (this._lastSelectedGraphTreeElement)
+ this._lastSelectedGraphTreeElement.select(true);
+
+ this.updateSidebarWidth();
+ },
+
+ resourceViewForResource: function(resource)
+ {
+ if (!resource)
+ return null;
+ if (!resource._resourcesView)
+ resource._resourcesView = this._createResourceView(resource);
+ return resource._resourcesView;
+ },
+
+ sourceFrameForResource: function(resource)
+ {
+ var view = this.resourceViewForResource(resource);
+ if (!view)
+ return null;
+
+ if (!view.setupSourceFrameIfNeeded)
+ return null;
+
+ // Setting up the source frame requires that we be attached.
+ if (!this.element.parentNode)
+ this.attach();
+
+ view.setupSourceFrameIfNeeded();
+ return view.sourceFrame;
+ },
+
+ _toggleLargerResources: function()
+ {
+ WebInspector.applicationSettings.resourcesLargeRows = !WebInspector.applicationSettings.resourcesLargeRows;
+ this._setLargerResources(WebInspector.applicationSettings.resourcesLargeRows);
+ },
+
+ _setLargerResources: function(enabled)
+ {
+ this._largerResourcesButton.toggled = enabled;
+ if (!enabled) {
+ this._largerResourcesButton.title = WebInspector.UIString("Use large resource rows.");
+ this._dataGrid.element.addStyleClass("small");
+ } else {
+ this._largerResourcesButton.title = WebInspector.UIString("Use small resource rows.");
+ this._dataGrid.element.removeStyleClass("small");
+ }
+ },
+
+ _createResourceView: function(resource)
+ {
+ switch (resource.category) {
+ case WebInspector.resourceCategories.documents:
+ case WebInspector.resourceCategories.stylesheets:
+ case WebInspector.resourceCategories.scripts:
+ case WebInspector.resourceCategories.xhr:
+ return new WebInspector.SourceView(resource);
+ case WebInspector.resourceCategories.images:
+ return new WebInspector.ImageView(resource);
+ case WebInspector.resourceCategories.fonts:
+ return new WebInspector.FontView(resource);
+ default:
+ return new WebInspector.ResourceView(resource);
+ }
+ },
+
+ _getPopoverAnchor: function(element)
+ {
+ var anchor = element.enclosingNodeOrSelfWithClass("network-graph-bar") || element.enclosingNodeOrSelfWithClass("network-graph-label");
+ if (!anchor)
+ return null;
+ var resource = anchor.parentElement.resource;
+ return resource && resource.timing ? anchor : null;
+ },
+
+ _showPopover: function(anchor)
+ {
+ var tableElement = document.createElement("table");
+ var resource = anchor.parentElement.resource;
+ var rows = [];
+
+ function addRow(title, start, end, color)
+ {
+ var row = {};
+ row.title = title;
+ row.start = start;
+ row.end = end;
+ rows.push(row);
+ }
+
+ if (resource.timing.proxyStart !== -1)
+ addRow(WebInspector.UIString("Proxy"), resource.timing.proxyStart, resource.timing.proxyEnd);
+
+ if (resource.timing.dnsStart !== -1)
+ addRow(WebInspector.UIString("DNS Lookup"), resource.timing.dnsStart, resource.timing.dnsEnd);
+
+ if (resource.timing.connectStart !== -1) {
+ if (resource.connectionReused)
+ addRow(WebInspector.UIString("Blocking"), resource.timing.connectStart, resource.timing.connectEnd);
+ else {
+ var connectStart = resource.timing.connectStart;
+ // Connection includes DNS, subtract it here.
+ if (resource.timing.dnsStart !== -1)
+ connectStart += resource.timing.dnsEnd - resource.timing.dnsStart;
+ addRow(WebInspector.UIString("Connecting"), connectStart, resource.timing.connectEnd);
+ }
+ }
+
+ if (resource.timing.sslStart !== -1)
+ addRow(WebInspector.UIString("SSL"), resource.timing.sslStart, resource.timing.sslEnd);
+
+ var sendStart = resource.timing.sendStart;
+ if (resource.timing.sslStart !== -1)
+ sendStart += resource.timing.sslEnd - resource.timing.sslStart;
+
+ addRow(WebInspector.UIString("Sending"), resource.timing.sendStart, resource.timing.sendEnd);
+ addRow(WebInspector.UIString("Waiting"), resource.timing.sendEnd, resource.timing.receiveHeadersEnd);
+ addRow(WebInspector.UIString("Receiving"), (resource.responseReceivedTime - resource.timing.requestTime) * 1000, (resource.endTime - resource.timing.requestTime) * 1000);
+
+ const chartWidth = 200;
+ var total = (resource.endTime - resource.timing.requestTime) * 1000;
+ var scale = chartWidth / total;
+
+ for (var i = 0; i < rows.length; ++i) {
+ var tr = document.createElement("tr");
+ tableElement.appendChild(tr);
+
+ var td = document.createElement("td");
+ td.textContent = rows[i].title;
+ tr.appendChild(td);
+
+ td = document.createElement("td");
+ td.width = chartWidth + "px";
+
+ var row = document.createElement("div");
+ row.className = "network-timing-row";
+ td.appendChild(row);
+
+ var bar = document.createElement("span");
+ bar.className = "network-timing-bar";
+ bar.style.left = scale * rows[i].start + "px";
+ bar.style.right = scale * (total - rows[i].end) + "px";
+ bar.style.backgroundColor = rows[i].color;
+ bar.textContent = "\u200B"; // Important for 0-time items to have 0 width.
+ row.appendChild(bar);
+
+ var title = document.createElement("span");
+ title.className = "network-timing-bar-title";
+ if (total - rows[i].end < rows[i].start)
+ title.style.right = (scale * (total - rows[i].end) + 3) + "px";
+ else
+ title.style.left = (scale * rows[i].start + 3) + "px";
+ title.textContent = Number.millisToString(rows[i].end - rows[i].start);
+ row.appendChild(title);
+
+ tr.appendChild(td);
+ }
+
+ var popover = new WebInspector.Popover(tableElement);
+ popover.show(anchor);
+ return popover;
+ },
+
+ hide: function()
+ {
+ WebInspector.Panel.prototype.hide.call(this);
+ this._popoverHelper.hidePopup();
+ }
+}
+
+WebInspector.NetworkPanel.prototype.__proto__ = WebInspector.Panel.prototype;
+
+WebInspector.getResourceContent = function(identifier, callback)
+{
+ InspectorBackend.getResourceContent(identifier, callback);
+}
+
+WebInspector.NetworkBaseCalculator = function()
+{
+}
+
+WebInspector.NetworkBaseCalculator.prototype = {
+ computeSummaryValues: function(items)
+ {
+ var total = 0;
+ var categoryValues = {};
+
+ var itemsLength = items.length;
+ for (var i = 0; i < itemsLength; ++i) {
+ var item = items[i];
+ var value = this._value(item);
+ if (typeof value === "undefined")
+ continue;
+ if (!(item.category.name in categoryValues))
+ categoryValues[item.category.name] = 0;
+ categoryValues[item.category.name] += value;
+ total += value;
+ }
+
+ return {categoryValues: categoryValues, total: total};
+ },
+
+ computeBarGraphPercentages: function(item)
+ {
+ return {start: 0, middle: 0, end: (this._value(item) / this.boundarySpan) * 100};
+ },
+
+ computeBarGraphLabels: function(item)
+ {
+ const label = this.formatValue(this._value(item));
+ return {left: label, right: label, tooltip: label};
+ },
+
+ get boundarySpan()
+ {
+ return this.maximumBoundary - this.minimumBoundary;
+ },
+
+ updateBoundaries: function(item)
+ {
+ this.minimumBoundary = 0;
+
+ var value = this._value(item);
+ if (typeof this.maximumBoundary === "undefined" || value > this.maximumBoundary) {
+ this.maximumBoundary = value;
+ return true;
+ }
+ return false;
+ },
+
+ reset: function()
+ {
+ delete this.minimumBoundary;
+ delete this.maximumBoundary;
+ },
+
+ _value: function(item)
+ {
+ return 0;
+ },
+
+ formatValue: function(value)
+ {
+ return value.toString();
+ }
+}
+
+WebInspector.NetworkTimeCalculator = function(startAtZero)
+{
+ WebInspector.NetworkBaseCalculator.call(this);
+ this.startAtZero = startAtZero;
+}
+
+WebInspector.NetworkTimeCalculator.prototype = {
+ computeSummaryValues: function(resources)
+ {
+ var resourcesByCategory = {};
+ var resourcesLength = resources.length;
+ for (var i = 0; i < resourcesLength; ++i) {
+ var resource = resources[i];
+ if (!(resource.category.name in resourcesByCategory))
+ resourcesByCategory[resource.category.name] = [];
+ resourcesByCategory[resource.category.name].push(resource);
+ }
+
+ var earliestStart;
+ var latestEnd;
+ var categoryValues = {};
+ for (var category in resourcesByCategory) {
+ resourcesByCategory[category].sort(WebInspector.Resource.CompareByTime);
+ categoryValues[category] = 0;
+
+ var segment = {start: -1, end: -1};
+
+ var categoryResources = resourcesByCategory[category];
+ var resourcesLength = categoryResources.length;
+ for (var i = 0; i < resourcesLength; ++i) {
+ var resource = categoryResources[i];
+ if (resource.startTime === -1 || resource.endTime === -1)
+ continue;
+
+ if (typeof earliestStart === "undefined")
+ earliestStart = resource.startTime;
+ else
+ earliestStart = Math.min(earliestStart, resource.startTime);
+
+ if (typeof latestEnd === "undefined")
+ latestEnd = resource.endTime;
+ else
+ latestEnd = Math.max(latestEnd, resource.endTime);
+
+ if (resource.startTime <= segment.end) {
+ segment.end = Math.max(segment.end, resource.endTime);
+ continue;
+ }
+
+ categoryValues[category] += segment.end - segment.start;
+
+ segment.start = resource.startTime;
+ segment.end = resource.endTime;
+ }
+
+ // Add the last segment
+ categoryValues[category] += segment.end - segment.start;
+ }
+
+ return {categoryValues: categoryValues, total: latestEnd - earliestStart};
+ },
+
+ computeBarGraphPercentages: function(resource)
+ {
+ if (resource.startTime !== -1)
+ var start = ((resource.startTime - this.minimumBoundary) / this.boundarySpan) * 100;
+ else
+ var start = 0;
+
+ if (resource.responseReceivedTime !== -1)
+ var middle = ((resource.responseReceivedTime - this.minimumBoundary) / this.boundarySpan) * 100;
+ else
+ var middle = (this.startAtZero ? start : 100);
+
+ if (resource.endTime !== -1)
+ var end = ((resource.endTime - this.minimumBoundary) / this.boundarySpan) * 100;
+ else
+ var end = (this.startAtZero ? middle : 100);
+
+ if (this.startAtZero) {
+ end -= start;
+ middle -= start;
+ start = 0;
+ }
+
+ return {start: start, middle: middle, end: end};
+ },
+
+ computePercentageFromEventTime: function(eventTime)
+ {
+ // This function computes a percentage in terms of the total loading time
+ // of a specific event. If startAtZero is set, then this is useless, and we
+ // want to return 0.
+ if (eventTime !== -1 && !this.startAtZero)
+ return ((eventTime - this.minimumBoundary) / this.boundarySpan) * 100;
+
+ return 0;
+ },
+
+ computeBarGraphLabels: function(resource)
+ {
+ var rightLabel = "";
+ if (resource.responseReceivedTime !== -1 && resource.endTime !== -1)
+ rightLabel = this.formatValue(resource.endTime - resource.responseReceivedTime);
+
+ var hasLatency = resource.latency > 0;
+ if (hasLatency)
+ var leftLabel = this.formatValue(resource.latency);
+ else
+ var leftLabel = rightLabel;
+
+ if (resource.timing)
+ return {left: leftLabel, right: rightLabel};
+
+ if (hasLatency && rightLabel) {
+ var total = this.formatValue(resource.duration);
+ var tooltip = WebInspector.UIString("%s latency, %s download (%s total)", leftLabel, rightLabel, total);
+ } else if (hasLatency)
+ var tooltip = WebInspector.UIString("%s latency", leftLabel);
+ else if (rightLabel)
+ var tooltip = WebInspector.UIString("%s download", rightLabel);
+
+ if (resource.cached)
+ tooltip = WebInspector.UIString("%s (from cache)", tooltip);
+ return {left: leftLabel, right: rightLabel, tooltip: tooltip};
+ },
+
+ updateBoundaries: function(resource)
+ {
+ var didChange = false;
+
+ var lowerBound;
+ if (this.startAtZero)
+ lowerBound = 0;
+ else
+ lowerBound = this._lowerBound(resource);
+
+ if (lowerBound !== -1 && (typeof this.minimumBoundary === "undefined" || lowerBound < this.minimumBoundary)) {
+ this.minimumBoundary = lowerBound;
+ didChange = true;
+ }
+
+ var upperBound = this._upperBound(resource);
+ if (upperBound !== -1 && (typeof this.maximumBoundary === "undefined" || upperBound > this.maximumBoundary)) {
+ this.maximumBoundary = upperBound;
+ didChange = true;
+ }
+
+ return didChange;
+ },
+
+ formatValue: function(value)
+ {
+ return Number.secondsToString(value, WebInspector.UIString);
+ },
+
+ _lowerBound: function(resource)
+ {
+ return 0;
+ },
+
+ _upperBound: function(resource)
+ {
+ return 0;
+ }
+}
+
+WebInspector.NetworkTimeCalculator.prototype.__proto__ = WebInspector.NetworkBaseCalculator.prototype;
+
+WebInspector.NetworkTransferTimeCalculator = function()
+{
+ WebInspector.NetworkTimeCalculator.call(this, false);
+}
+
+WebInspector.NetworkTransferTimeCalculator.prototype = {
+ formatValue: function(value)
+ {
+ return Number.secondsToString(value, WebInspector.UIString);
+ },
+
+ _lowerBound: function(resource)
+ {
+ return resource.startTime;
+ },
+
+ _upperBound: function(resource)
+ {
+ return resource.endTime;
+ }
+}
+
+WebInspector.NetworkTransferTimeCalculator.prototype.__proto__ = WebInspector.NetworkTimeCalculator.prototype;
+
+WebInspector.NetworkTransferDurationCalculator = function()
+{
+ WebInspector.NetworkTimeCalculator.call(this, true);
+}
+
+WebInspector.NetworkTransferDurationCalculator.prototype = {
+ formatValue: function(value)
+ {
+ return Number.secondsToString(value, WebInspector.UIString);
+ },
+
+ _upperBound: function(resource)
+ {
+ return resource.duration;
+ }
+}
+
+WebInspector.NetworkTransferDurationCalculator.prototype.__proto__ = WebInspector.NetworkTimeCalculator.prototype;
+
+WebInspector.NetworkTransferSizeCalculator = function()
+{
+ WebInspector.NetworkBaseCalculator.call(this);
+}
+
+WebInspector.NetworkTransferSizeCalculator.prototype = {
+ computeBarGraphLabels: function(resource)
+ {
+ var networkBytes = this._networkBytes(resource);
+ var resourceBytes = this._value(resource);
+ if (networkBytes && networkBytes !== resourceBytes) {
+ // Transferred size is not the same as reported resource length.
+ var networkBytesString = this.formatValue(networkBytes);
+ var left = networkBytesString;
+ var right = this.formatValue(resourceBytes);
+ var tooltip = right ? WebInspector.UIString("%s (%s transferred)", right, networkBytesString) : right;
+ } else {
+ var left = this.formatValue(resourceBytes);
+ var right = left;
+ var tooltip = left;
+ }
+ if (resource.cached)
+ tooltip = WebInspector.UIString("%s (from cache)", tooltip);
+ return {left: left, right: right, tooltip: tooltip};
+ },
+
+ computeBarGraphPercentages: function(item)
+ {
+ const resourceBytesAsPercent = (this._value(item) / this.boundarySpan) * 100;
+ const networkBytesAsPercent = this._networkBytes(item) ? (this._networkBytes(item) / this.boundarySpan) * 100 : resourceBytesAsPercent;
+ return {start: 0, middle: networkBytesAsPercent, end: resourceBytesAsPercent};
+ },
+
+ _value: function(resource)
+ {
+ return resource.resourceSize;
+ },
+
+ _networkBytes: function(resource)
+ {
+ return resource.transferSize;
+ },
+
+ formatValue: function(value)
+ {
+ return Number.bytesToString(value, WebInspector.UIString);
+ }
+}
+
+WebInspector.NetworkTransferSizeCalculator.prototype.__proto__ = WebInspector.NetworkBaseCalculator.prototype;
+
+WebInspector.NetworkDataGridNode = function(resource)
+{
+ WebInspector.DataGridNode.call(this, {});
+ this._resource = resource;
+}
+
+WebInspector.NetworkDataGridNode.prototype = {
+ createCells: function()
+ {
+ this._urlCell = this._createDivInTD("url-column");
+ this._methodCell = this._createDivInTD("optional-column");
+ this._statusCell = this._createDivInTD("optional-column");
+ this._typeCell = this._createDivInTD("optional-column");
+ this._sizeCell = this._createDivInTD("optional-column right");
+ this._timeCell = this._createDivInTD("optional-column right");
+ this._createTimelineCell();
+ },
+
+ _createDivInTD: function(className) {
+ var td = document.createElement("td");
+ if (className)
+ td.className = className;
+ var div = document.createElement("div");
+ td.appendChild(div);
+ this._element.appendChild(td);
+ return div;
+ },
+
+
+ _createTimelineCell: function()
+ {
+ this._graphElement = document.createElement("div");
+ this._graphElement.className = "network-graph-side";
+ this._graphElement.addEventListener("mouseover", this._refreshLabelPositions.bind(this), false);
+
+ this._barAreaElement = document.createElement("div");
+ // this._barAreaElement.className = "network-graph-bar-area hidden";
+ this._barAreaElement.className = "network-graph-bar-area";
+ this._barAreaElement.resource = this._resource;
+ this._graphElement.appendChild(this._barAreaElement);
+
+ this._barLeftElement = document.createElement("div");
+ this._barLeftElement.className = "network-graph-bar waiting";
+ this._barAreaElement.appendChild(this._barLeftElement);
+
+ this._barRightElement = document.createElement("div");
+ this._barRightElement.className = "network-graph-bar";
+ this._barAreaElement.appendChild(this._barRightElement);
+
+ this._labelLeftElement = document.createElement("div");
+ this._labelLeftElement.className = "network-graph-label waiting";
+ this._barAreaElement.appendChild(this._labelLeftElement);
+
+ this._labelRightElement = document.createElement("div");
+ this._labelRightElement.className = "network-graph-label";
+ this._barAreaElement.appendChild(this._labelRightElement);
+
+ this._timelineCell = document.createElement("td");
+ this._element.appendChild(this._timelineCell);
+ this._timelineCell.appendChild(this._graphElement);
+ },
+
+ refreshResource: function()
+ {
+ this._refreshURLCell();
+
+ this._methodCell.textContent = this._resource.requestMethod;
+
+ this._refreshStatusCell();
+
+ if (this._resource.mimeType) {
+ this._typeCell.removeStyleClass("network-dim-cell");
+ this._typeCell.textContent = this._resource.mimeType;
+ } else {
+ this._typeCell.addStyleClass("network-dim-cell");
+ this._typeCell.textContent = WebInspector.UIString("Pending");
+ }
+
+ this._refreshSizeCell();
+ this._refreshTimeCell();
+
+ if (this._resource.cached)
+ this._graphElement.addStyleClass("resource-cached");
+
+ if (!this._element.hasStyleClass("network-category-" + this._resource.category.name)) {
+ this._element.removeMatchingStyleClasses("network-category-\\w+");
+ this._element.addStyleClass("network-category-" + this._resource.category.name);
+ }
+ },
+
+ _refreshURLCell: function()
+ {
+ this._urlCell.removeChildren();
+
+ if (this._resource.category === WebInspector.resourceCategories.images) {
+ var previewImage = document.createElement("img");
+ previewImage.className = "image-network-icon-preview";
+ previewImage.src = this._resource.url;
+
+ var iconElement = document.createElement("div");
+ iconElement.className = "icon";
+ iconElement.appendChild(previewImage);
+ } else {
+ var iconElement = document.createElement("img");
+ iconElement.className = "icon";
+ }
+ this._urlCell.appendChild(iconElement);
+ this._urlCell.appendChild(document.createTextNode(this._fileName()));
+
+
+ var subtitle = this._resource.displayDomain;
+
+ if (this._resource.path && this._resource.lastPathComponent) {
+ var lastPathComponentIndex = this._resource.path.lastIndexOf("/" + this._resource.lastPathComponent);
+ if (lastPathComponentIndex != -1)
+ subtitle += this._resource.path.substring(0, lastPathComponentIndex);
+ }
+
+ var subtitleElement = document.createElement("div");
+ subtitleElement.className = "network-grid-subtitle";
+ subtitleElement.textContent = subtitle;
+ this._urlCell.appendChild(subtitleElement);
+
+
+ this._urlCell.title = this._resource.url;
+ },
+
+ _fileName: function()
+ {
+ var fileName = this._resource.displayName;
+ if (this._resource.queryString)
+ fileName += "?" + this._resource.queryString;
+ return fileName;
+ },
+
+ _refreshStatusCell: function()
+ {
+ this._statusCell.removeChildren();
+
+ if (this._resource.statusCode) {
+ var img = document.createElement("img");
+ if (this._resource.statusCode < 300)
+ img.src = "Images/successGreenDot.png";
+ else if (this._resource.statusCode < 400)
+ img.src = "Images/warningOrangeDot.png";
+ else
+ img.src = "Images/errorRedDot.png";
+
+ img.className = "resource-status-image";
+ this._statusCell.appendChild(img);
+ this._statusCell.appendChild(document.createTextNode(this._resource.statusCode));
+ this._statusCell.removeStyleClass("network-dim-cell");
+ this._appendSubtitle(this._statusCell, this._resource.statusText);
+ this._statusCell.title = this._resource.statusCode + " " + this._resource.statusText;
+ } else {
+ this._statusCell.addStyleClass("network-dim-cell");
+ this._statusCell.textContent = WebInspector.UIString("Pending");
+ }
+ },
+
+ _refreshSizeCell: function()
+ {
+ var resourceSize = typeof this._resource.resourceSize === "number" ? Number.bytesToString(this._resource.resourceSize) : "?";
+ var transferSize = typeof this._resource.transferSize === "number" ? Number.bytesToString(this._resource.transferSize) : "?";
+ var fromCache = this._resource.cached;
+ this._sizeCell.textContent = !fromCache ? resourceSize : WebInspector.UIString("(from cache)");
+ if (fromCache)
+ this._sizeCell.addStyleClass("network-dim-cell");
+ else
+ this._sizeCell.removeStyleClass("network-dim-cell");
+ if (!fromCache)
+ this._appendSubtitle(this._sizeCell, transferSize);
+ },
+
+ _refreshTimeCell: function()
+ {
+ if (this._resource.duration > 0) {
+ this._timeCell.removeStyleClass("network-dim-cell");
+ this._timeCell.textContent = Number.secondsToString(this._resource.duration);
+ this._appendSubtitle(this._timeCell, Number.secondsToString(this._resource.latency));
+ } else {
+ this._timeCell.addStyleClass("network-dim-cell");
+ this._timeCell.textContent = WebInspector.UIString("Pending");
+ }
+ },
+
+ _appendSubtitle: function(cellElement, subtitleText)
+ {
+ var subtitleElement = document.createElement("div");
+ subtitleElement.className = "network-grid-subtitle";
+ subtitleElement.textContent = subtitleText;
+ cellElement.appendChild(subtitleElement);
+ },
+
+ refreshGraph: function(calculator)
+ {
+ var percentages = calculator.computeBarGraphPercentages(this._resource);
+ var labels = calculator.computeBarGraphLabels(this._resource);
+
+ this._percentages = percentages;
+
+ this._barAreaElement.removeStyleClass("hidden");
+
+ if (!this._graphElement.hasStyleClass("network-category-" + this._resource.category.name)) {
+ this._graphElement.removeMatchingStyleClasses("network-category-\\w+");
+ this._graphElement.addStyleClass("network-category-" + this._resource.category.name);
+ }
+
+ this._barLeftElement.style.setProperty("left", percentages.start + "%");
+ this._barRightElement.style.setProperty("right", (100 - percentages.end) + "%");
+
+ this._barLeftElement.style.setProperty("right", (100 - percentages.end) + "%");
+ this._barRightElement.style.setProperty("left", percentages.middle + "%");
+
+ this._labelLeftElement.textContent = labels.left;
+ this._labelRightElement.textContent = labels.right;
+
+ var tooltip = (labels.tooltip || "");
+ this._barLeftElement.title = tooltip;
+ this._labelLeftElement.title = tooltip;
+ this._labelRightElement.title = tooltip;
+ this._barRightElement.title = tooltip;
+ },
+
+ _refreshLabelPositions: function()
+ {
+ this._labelLeftElement.style.removeProperty("left");
+ this._labelLeftElement.style.removeProperty("right");
+ this._labelLeftElement.removeStyleClass("before");
+ this._labelLeftElement.removeStyleClass("hidden");
+
+ this._labelRightElement.style.removeProperty("left");
+ this._labelRightElement.style.removeProperty("right");
+ this._labelRightElement.removeStyleClass("after");
+ this._labelRightElement.removeStyleClass("hidden");
+
+ const labelPadding = 10;
+ const barRightElementOffsetWidth = this._barRightElement.offsetWidth;
+ const barLeftElementOffsetWidth = this._barLeftElement.offsetWidth;
+
+ if (this._barLeftElement) {
+ var leftBarWidth = barLeftElementOffsetWidth - labelPadding;
+ var rightBarWidth = (barRightElementOffsetWidth - barLeftElementOffsetWidth) - labelPadding;
+ } else {
+ var leftBarWidth = (barLeftElementOffsetWidth - barRightElementOffsetWidth) - labelPadding;
+ var rightBarWidth = barRightElementOffsetWidth - labelPadding;
+ }
+
+ const labelLeftElementOffsetWidth = this._labelLeftElement.offsetWidth;
+ const labelRightElementOffsetWidth = this._labelRightElement.offsetWidth;
+
+ const labelBefore = (labelLeftElementOffsetWidth > leftBarWidth);
+ const labelAfter = (labelRightElementOffsetWidth > rightBarWidth);
+ const graphElementOffsetWidth = this._graphElement.offsetWidth;
+
+ if (labelBefore && (graphElementOffsetWidth * (this._percentages.start / 100)) < (labelLeftElementOffsetWidth + 10))
+ var leftHidden = true;
+
+ if (labelAfter && (graphElementOffsetWidth * ((100 - this._percentages.end) / 100)) < (labelRightElementOffsetWidth + 10))
+ var rightHidden = true;
+
+ if (barLeftElementOffsetWidth == barRightElementOffsetWidth) {
+ // The left/right label data are the same, so a before/after label can be replaced by an on-bar label.
+ if (labelBefore && !labelAfter)
+ leftHidden = true;
+ else if (labelAfter && !labelBefore)
+ rightHidden = true;
+ }
+
+ if (labelBefore) {
+ if (leftHidden)
+ this._labelLeftElement.addStyleClass("hidden");
+ this._labelLeftElement.style.setProperty("right", (100 - this._percentages.start) + "%");
+ this._labelLeftElement.addStyleClass("before");
+ } else {
+ this._labelLeftElement.style.setProperty("left", this._percentages.start + "%");
+ this._labelLeftElement.style.setProperty("right", (100 - this._percentages.middle) + "%");
+ }
+
+ if (labelAfter) {
+ if (rightHidden)
+ this._labelRightElement.addStyleClass("hidden");
+ this._labelRightElement.style.setProperty("left", this._percentages.end + "%");
+ this._labelRightElement.addStyleClass("after");
+ } else {
+ this._labelRightElement.style.setProperty("left", this._percentages.middle + "%");
+ this._labelRightElement.style.setProperty("right", (100 - this._percentages.end) + "%");
+ }
+ }
+}
+
+WebInspector.NetworkDataGridNode.URLComparator = function(a, b)
+{
+ var aFileName = a._resource.displayName + (a._resource.queryString ? a._resource.queryString : "");
+ var bFileName = b._resource.displayName + (b._resource.queryString ? b._resource.queryString : "");
+ if (aFileName > bFileName)
+ return 1;
+ if (bFileName > aFileName)
+ return -1;
+ return 0;
+}
+
+WebInspector.NetworkDataGridNode.ResourcePropertyComparator = function(propertyName, a, b)
+{
+ var aValue = a._resource[propertyName];
+ var bValue = b._resource[propertyName];
+ if (aValue > bValue)
+ return 1;
+ if (bValue > aValue)
+ return -1;
+ return 0;
+}
+
+WebInspector.NetworkDataGridNode.prototype.__proto__ = WebInspector.DataGridNode.prototype;
diff --git a/WebCore/inspector/front-end/ResourceCategory.js b/WebCore/inspector/front-end/ResourceCategory.js
index 6e94265..84f2cf9 100644
--- a/WebCore/inspector/front-end/ResourceCategory.js
+++ b/WebCore/inspector/front-end/ResourceCategory.js
@@ -28,12 +28,19 @@
WebInspector.ResourceCategory = function(name, title, color)
{
- WebInspector.AbstractTimelineCategory.call(this, name, title, color);
+ this.name = name;
+ this.title = title;
+ this.color = color;
this.resources = [];
}
WebInspector.ResourceCategory.prototype = {
+ toString: function()
+ {
+ return this.title;
+ },
+
addResource: function(resource)
{
var a = resource;
@@ -61,5 +68,3 @@ WebInspector.ResourceCategory.prototype = {
this.resources = [];
}
}
-
-WebInspector.ResourceCategory.prototype.__proto__ = WebInspector.AbstractTimelineCategory.prototype;
diff --git a/WebCore/inspector/front-end/ResourcesPanel.js b/WebCore/inspector/front-end/ResourcesPanel.js
index f329b1a..aa021ff 100644
--- a/WebCore/inspector/front-end/ResourcesPanel.js
+++ b/WebCore/inspector/front-end/ResourcesPanel.js
@@ -29,7 +29,10 @@
WebInspector.ResourcesPanel = function()
{
- WebInspector.AbstractTimelinePanel.call(this, "resources");
+ WebInspector.Panel.call(this, "resources");
+
+ this._items = [];
+ this._staleItems = [];
this._createPanelEnabler();
@@ -82,6 +85,299 @@ WebInspector.ResourcesPanel.prototype = {
return (this.itemsGraphsElement.hasStyleClass("filter-all") || this.itemsGraphsElement.hasStyleClass("filter-" + categoryName.toLowerCase()));
},
+ get items()
+ {
+ return this._items;
+ },
+
+ createInterface: function()
+ {
+ this.containerElement = document.createElement("div");
+ this.containerElement.id = "resources-container";
+ this.containerElement.addEventListener("scroll", this._updateDividersLabelBarPosition.bind(this), false);
+ this.element.appendChild(this.containerElement);
+
+ this.createSidebar(this.containerElement, this.element);
+ this.sidebarElement.id = "resources-sidebar";
+ this.populateSidebar();
+
+ this._containerContentElement = document.createElement("div");
+ this._containerContentElement.id = "resources-container-content";
+ this.containerElement.appendChild(this._containerContentElement);
+
+ this.summaryBar = new WebInspector.SummaryBar(this.categories);
+ this.summaryBar.element.id = "resources-summary";
+ this._containerContentElement.appendChild(this.summaryBar.element);
+
+ this._timelineGrid = new WebInspector.TimelineGrid();
+ this._containerContentElement.appendChild(this._timelineGrid.element);
+ this.itemsGraphsElement = this._timelineGrid.itemsGraphsElement;
+ },
+
+ createFilterPanel: function()
+ {
+ this.filterBarElement = document.createElement("div");
+ this.filterBarElement.id = "resources-filter";
+ this.filterBarElement.className = "scope-bar";
+ this.element.appendChild(this.filterBarElement);
+
+ function createFilterElement(category)
+ {
+ if (category === "all")
+ var label = WebInspector.UIString("All");
+ else if (this.categories[category])
+ var label = this.categories[category].title;
+
+ var categoryElement = document.createElement("li");
+ categoryElement.category = category;
+ categoryElement.addStyleClass(category);
+ categoryElement.appendChild(document.createTextNode(label));
+ categoryElement.addEventListener("click", this._updateFilter.bind(this), false);
+ this.filterBarElement.appendChild(categoryElement);
+
+ return categoryElement;
+ }
+
+ this.filterAllElement = createFilterElement.call(this, "all");
+
+ // Add a divider
+ var dividerElement = document.createElement("div");
+ dividerElement.addStyleClass("divider");
+ this.filterBarElement.appendChild(dividerElement);
+
+ for (var category in this.categories)
+ createFilterElement.call(this, category);
+ },
+
+ showCategory: function(category)
+ {
+ var filterClass = "filter-" + category.toLowerCase();
+ this.itemsGraphsElement.addStyleClass(filterClass);
+ this.itemsTreeElement.childrenListElement.addStyleClass(filterClass);
+ },
+
+ hideCategory: function(category)
+ {
+ var filterClass = "filter-" + category.toLowerCase();
+ this.itemsGraphsElement.removeStyleClass(filterClass);
+ this.itemsTreeElement.childrenListElement.removeStyleClass(filterClass);
+ },
+
+ filter: function(target, selectMultiple)
+ {
+ function unselectAll()
+ {
+ for (var i = 0; i < this.filterBarElement.childNodes.length; ++i) {
+ var child = this.filterBarElement.childNodes[i];
+ if (!child.category)
+ continue;
+
+ child.removeStyleClass("selected");
+ this.hideCategory(child.category);
+ }
+ }
+
+ if (target === this.filterAllElement) {
+ if (target.hasStyleClass("selected")) {
+ // We can't unselect All, so we break early here
+ return;
+ }
+
+ // If All wasn't selected, and now is, unselect everything else.
+ unselectAll.call(this);
+ } else {
+ // Something other than All is being selected, so we want to unselect All.
+ if (this.filterAllElement.hasStyleClass("selected")) {
+ this.filterAllElement.removeStyleClass("selected");
+ this.hideCategory("all");
+ }
+ }
+
+ if (!selectMultiple) {
+ // If multiple selection is off, we want to unselect everything else
+ // and just select ourselves.
+ unselectAll.call(this);
+
+ target.addStyleClass("selected");
+ this.showCategory(target.category);
+ return;
+ }
+
+ if (target.hasStyleClass("selected")) {
+ // If selectMultiple is turned on, and we were selected, we just
+ // want to unselect ourselves.
+ target.removeStyleClass("selected");
+ this.hideCategory(target.category);
+ } else {
+ // If selectMultiple is turned on, and we weren't selected, we just
+ // want to select ourselves.
+ target.addStyleClass("selected");
+ this.showCategory(target.category);
+ }
+ },
+
+ _updateFilter: function(e)
+ {
+ var isMac = WebInspector.isMac();
+ var selectMultiple = false;
+ if (isMac && e.metaKey && !e.ctrlKey && !e.altKey && !e.shiftKey)
+ selectMultiple = true;
+ if (!isMac && e.ctrlKey && !e.metaKey && !e.altKey && !e.shiftKey)
+ selectMultiple = true;
+
+ this.filter(e.target, selectMultiple);
+
+ // When we are updating our filtering, scroll to the top so we don't end up
+ // in blank graph under all the resources.
+ this.containerElement.scrollTop = 0;
+
+ var searchField = document.getElementById("search");
+ WebInspector.doPerformSearch(searchField.value, WebInspector.shortSearchWasForcedByKeyEvent, false, true);
+ },
+
+ _updateDividersLabelBarPosition: function()
+ {
+ const scrollTop = this.containerElement.scrollTop;
+ const offsetHeight = this.summaryBar.element.offsetHeight;
+ const dividersTop = (scrollTop < offsetHeight ? offsetHeight : scrollTop);
+ this._timelineGrid.setScrollAndDividerTop(scrollTop, dividersTop);
+ },
+
+ get needsRefresh()
+ {
+ return this._needsRefresh;
+ },
+
+ set needsRefresh(x)
+ {
+ if (this._needsRefresh === x)
+ return;
+
+ this._needsRefresh = x;
+
+ if (x) {
+ if (this.visible && !("_refreshTimeout" in this))
+ this._refreshTimeout = setTimeout(this.refresh.bind(this), 500);
+ } else {
+ if ("_refreshTimeout" in this) {
+ clearTimeout(this._refreshTimeout);
+ delete this._refreshTimeout;
+ }
+ }
+ },
+
+ refreshIfNeeded: function()
+ {
+ if (this.needsRefresh)
+ this.refresh();
+ },
+
+ resize: function()
+ {
+ WebInspector.Panel.prototype.resize.call(this);
+
+ this.updateGraphDividersIfNeeded();
+ },
+
+ invalidateAllItems: function()
+ {
+ this._staleItems = this._items.slice();
+ },
+
+ get calculator()
+ {
+ return this._calculator;
+ },
+
+ set calculator(x)
+ {
+ if (!x || this._calculator === x)
+ return;
+
+ this._calculator = x;
+ this._calculator.reset();
+
+ this._staleItems = this._items.slice();
+ this.refresh();
+ },
+
+ addItem: function(item)
+ {
+ this._items.push(item);
+ this.refreshItem(item);
+ },
+
+ removeItem: function(item)
+ {
+ this._items.remove(item, true);
+
+ if (item._itemsTreeElement) {
+ this.itemsTreeElement.removeChild(item._itemsTreeElement);
+ this.itemsGraphsElement.removeChild(item._itemsTreeElement._itemGraph.graphElement);
+ }
+
+ delete item._itemsTreeElement;
+ this.adjustScrollPosition();
+ },
+
+ refreshItem: function(item)
+ {
+ this._staleItems.push(item);
+ this.needsRefresh = true;
+ },
+
+ revealAndSelectItem: function(item)
+ {
+ if (item._itemsTreeElement) {
+ item._itemsTreeElement.reveal();
+ item._itemsTreeElement.select(true);
+ }
+ },
+
+ sortItems: function(sortingFunction)
+ {
+ var sortedElements = [].concat(this.itemsTreeElement.children);
+ sortedElements.sort(sortingFunction);
+
+ var sortedElementsLength = sortedElements.length;
+ for (var i = 0; i < sortedElementsLength; ++i) {
+ var treeElement = sortedElements[i];
+ if (treeElement === this.itemsTreeElement.children[i])
+ continue;
+
+ var wasSelected = treeElement.selected;
+ this.itemsTreeElement.removeChild(treeElement);
+ this.itemsTreeElement.insertChild(treeElement, i);
+ if (wasSelected)
+ treeElement.select(true);
+
+ var graphElement = treeElement._itemGraph.graphElement;
+ this.itemsGraphsElement.insertBefore(graphElement, this.itemsGraphsElement.children[i]);
+ }
+ },
+
+ adjustScrollPosition: function()
+ {
+ // Prevent the container from being scrolled off the end.
+ if ((this.containerElement.scrollTop + this.containerElement.offsetHeight) > this.sidebarElement.offsetHeight)
+ this.containerElement.scrollTop = (this.sidebarElement.offsetHeight - this.containerElement.offsetHeight);
+ },
+
+ addEventDivider: function(divider)
+ {
+ this._timelineGrid.addEventDivider(divider);
+ },
+
+ hideEventDividers: function()
+ {
+ this._timelineGrid.hideEventDividers();
+ },
+
+ showEventDividers: function()
+ {
+ this._timelineGrid.showEventDividers();
+ },
+
populateSidebar: function()
{
this.timeGraphItem = new WebInspector.SidebarTreeElement("resources-time-graph-sidebar-item", WebInspector.UIString("Time"));
@@ -223,7 +519,10 @@ WebInspector.ResourcesPanel.prototype = {
show: function()
{
- WebInspector.AbstractTimelinePanel.prototype.show.call(this);
+ WebInspector.Panel.prototype.show.call(this);
+
+ this._updateDividersLabelBarPosition();
+ this.refreshIfNeeded();
var visibleView = this.visibleView;
if (this.visibleResource) {
@@ -329,7 +628,44 @@ WebInspector.ResourcesPanel.prototype = {
refresh: function()
{
- WebInspector.AbstractTimelinePanel.prototype.refresh.call(this);
+ this.needsRefresh = false;
+
+ var staleItemsLength = this._staleItems.length;
+
+ var boundariesChanged = false;
+
+ for (var i = 0; i < staleItemsLength; ++i) {
+ var item = this._staleItems[i];
+ if (!item._itemsTreeElement) {
+ // Create the timeline tree element and graph.
+ item._itemsTreeElement = this.createItemTreeElement(item);
+ item._itemsTreeElement._itemGraph = this.createItemGraph(item);
+
+ this.itemsTreeElement.appendChild(item._itemsTreeElement);
+ this.itemsGraphsElement.appendChild(item._itemsTreeElement._itemGraph.graphElement);
+ }
+
+ if (item._itemsTreeElement.refresh)
+ item._itemsTreeElement.refresh();
+
+ if (this.calculator.updateBoundaries(item))
+ boundariesChanged = true;
+ }
+
+ if (boundariesChanged) {
+ // The boundaries changed, so all item graphs are stale.
+ this._staleItems = this._items.slice();
+ staleItemsLength = this._staleItems.length;
+ }
+
+
+ const isBarOpaqueAtLeft = this.sidebarTree.selectedTreeElement && this.sidebarTree.selectedTreeElement.isBarOpaqueAtLeft;
+ for (var i = 0; i < staleItemsLength; ++i)
+ this._staleItems[i]._itemsTreeElement._itemGraph.refresh(this.calculator, isBarOpaqueAtLeft);
+
+ this._staleItems = [];
+
+ this.updateGraphDividersIfNeeded();
this._sortResourcesIfNeeded();
this._updateSummaryGraph();
@@ -373,7 +709,28 @@ WebInspector.ResourcesPanel.prototype = {
}
}
- WebInspector.AbstractTimelinePanel.prototype.reset.call(this);
+ // Begin reset timeline
+ this.containerElement.scrollTop = 0;
+
+ if (this._calculator)
+ this._calculator.reset();
+
+ if (this._items) {
+ var itemsLength = this._items.length;
+ for (var i = 0; i < itemsLength; ++i) {
+ var item = this._items[i];
+ delete item._itemsTreeElement;
+ }
+ }
+
+ this._items = [];
+ this._staleItems = [];
+
+ this.itemsTreeElement.removeChildren();
+ this.itemsGraphsElement.removeChildren();
+
+ this.updateGraphDividersIfNeeded(true);
+ // End reset timeline.
this.mainResourceLoadTime = -1;
this.mainResourceDOMContentTime = -1;
@@ -585,7 +942,12 @@ WebInspector.ResourcesPanel.prototype = {
updateGraphDividersIfNeeded: function(force)
{
- var proceed = WebInspector.AbstractTimelinePanel.prototype.updateGraphDividersIfNeeded.call(this, force);
+ var proceed = true;
+ if (!this.visible) {
+ this.needsRefresh = true;
+ proceed = false;
+ } else
+ proceed = this._timelineGrid.updateDividers(force, this.calculator);
if (!proceed)
return;
@@ -739,8 +1101,7 @@ WebInspector.ResourcesPanel.prototype = {
updateMainViewWidth: function(width)
{
this.viewsContainerElement.style.left = width + "px";
-
- WebInspector.AbstractTimelinePanel.prototype.updateMainViewWidth.call(this, width);
+ this._containerContentElement.style.left = width + "px";
this.resize();
},
@@ -918,16 +1279,86 @@ WebInspector.ResourcesPanel.prototype = {
}
}
-WebInspector.ResourcesPanel.prototype.__proto__ = WebInspector.AbstractTimelinePanel.prototype;
+WebInspector.ResourcesPanel.prototype.__proto__ = WebInspector.Panel.prototype;
WebInspector.getResourceContent = function(identifier, callback)
{
InspectorBackend.getResourceContent(identifier, callback);
}
+WebInspector.ResourceBaseCalculator = function()
+{
+}
+
+WebInspector.ResourceBaseCalculator.prototype = {
+ computeSummaryValues: function(items)
+ {
+ var total = 0;
+ var categoryValues = {};
+
+ var itemsLength = items.length;
+ for (var i = 0; i < itemsLength; ++i) {
+ var item = items[i];
+ var value = this._value(item);
+ if (typeof value === "undefined")
+ continue;
+ if (!(item.category.name in categoryValues))
+ categoryValues[item.category.name] = 0;
+ categoryValues[item.category.name] += value;
+ total += value;
+ }
+
+ return {categoryValues: categoryValues, total: total};
+ },
+
+ computeBarGraphPercentages: function(item)
+ {
+ return {start: 0, middle: 0, end: (this._value(item) / this.boundarySpan) * 100};
+ },
+
+ computeBarGraphLabels: function(item)
+ {
+ const label = this.formatValue(this._value(item));
+ return {left: label, right: label, tooltip: label};
+ },
+
+ get boundarySpan()
+ {
+ return this.maximumBoundary - this.minimumBoundary;
+ },
+
+ updateBoundaries: function(item)
+ {
+ this.minimumBoundary = 0;
+
+ var value = this._value(item);
+ if (typeof this.maximumBoundary === "undefined" || value > this.maximumBoundary) {
+ this.maximumBoundary = value;
+ return true;
+ }
+ return false;
+ },
+
+ reset: function()
+ {
+ delete this.minimumBoundary;
+ delete this.maximumBoundary;
+ },
+
+ _value: function(item)
+ {
+ return 0;
+ },
+
+ formatValue: function(value)
+ {
+ return value.toString();
+ }
+}
+
WebInspector.ResourceTimeCalculator = function(startAtZero)
{
- WebInspector.AbstractTimelineCalculator.call(this);
+ WebInspector.ResourceBaseCalculator.call(this);
this.startAtZero = startAtZero;
}
@@ -1092,7 +1523,7 @@ WebInspector.ResourceTimeCalculator.prototype = {
}
}
-WebInspector.ResourceTimeCalculator.prototype.__proto__ = WebInspector.AbstractTimelineCalculator.prototype;
+WebInspector.ResourceTimeCalculator.prototype.__proto__ = WebInspector.ResourceBaseCalculator.prototype;
WebInspector.ResourceTransferTimeCalculator = function()
{
@@ -1139,7 +1570,7 @@ WebInspector.ResourceTransferDurationCalculator.prototype.__proto__ = WebInspect
WebInspector.ResourceTransferSizeCalculator = function()
{
- WebInspector.AbstractTimelineCalculator.call(this);
+ WebInspector.ResourceBaseCalculator.call(this);
}
WebInspector.ResourceTransferSizeCalculator.prototype = {
@@ -1186,7 +1617,7 @@ WebInspector.ResourceTransferSizeCalculator.prototype = {
}
}
-WebInspector.ResourceTransferSizeCalculator.prototype.__proto__ = WebInspector.AbstractTimelineCalculator.prototype;
+WebInspector.ResourceTransferSizeCalculator.prototype.__proto__ = WebInspector.ResourceBaseCalculator.prototype;
WebInspector.ResourceSidebarTreeElement = function(resource)
{
diff --git a/WebCore/inspector/front-end/ScriptsPanel.js b/WebCore/inspector/front-end/ScriptsPanel.js
index 715339d..8283528 100644
--- a/WebCore/inspector/front-end/ScriptsPanel.js
+++ b/WebCore/inspector/front-end/ScriptsPanel.js
@@ -104,7 +104,6 @@ WebInspector.ScriptsPanel = function()
this.sidebarButtonsElement.appendChild(this.stepOutButton);
this.toggleBreakpointsButton = new WebInspector.StatusBarButton(WebInspector.UIString("Deactivate all breakpoints."), "toggle-breakpoints");
- // Breakpoints should be activated by default, so emulate a click to toggle on.
this.toggleBreakpointsButton.toggled = true;
this.toggleBreakpointsButton.addEventListener("click", this.toggleBreakpointsClicked.bind(this), false);
this.sidebarButtonsElement.appendChild(this.toggleBreakpointsButton.element);
@@ -133,8 +132,13 @@ WebInspector.ScriptsPanel = function()
this.sidebarPanes.callstack = new WebInspector.CallStackSidebarPane();
this.sidebarPanes.scopechain = new WebInspector.ScopeChainSidebarPane();
this.sidebarPanes.jsBreakpoints = WebInspector.createJSBreakpointsSidebarPane();
- if (Preferences.domBreakpointsEnabled)
+ if (Preferences.nativeInstrumentationEnabled) {
this.sidebarPanes.domBreakpoints = WebInspector.createDOMBreakpointsSidebarPane();
+ this.sidebarPanes.domBreakpoints.expanded = true;
+ this.sidebarPanes.xhrBreakpoints = WebInspector.createXHRBreakpointsSidebarPane();
+ this.sidebarPanes.xhrBreakpoints.expanded = true;
+ }
+
this.sidebarPanes.workers = new WebInspector.WorkersSidebarPane();
for (var pane in this.sidebarPanes)
@@ -145,8 +149,6 @@ WebInspector.ScriptsPanel = function()
this.sidebarPanes.scopechain.expanded = true;
this.sidebarPanes.jsBreakpoints.expanded = true;
- if (Preferences.domBreakpointsEnabled)
- this.sidebarPanes.domBreakpoints.expanded = true;
var panelEnablerHeading = WebInspector.UIString("You need to enable debugging before you can use the Scripts panel.");
var panelEnablerDisclaimer = WebInspector.UIString("Enabling debugging will make scripts run slower.");
@@ -387,8 +389,8 @@ WebInspector.ScriptsPanel.prototype = {
this.sidebarPanes.callstack.update(details.callFrames, this._sourceIDMap);
this.sidebarPanes.callstack.selectedCallFrame = details.callFrames[0];
- if (details.status)
- this.sidebarPanes.callstack.updateStatus(details.status);
+ if ("eventType" in details)
+ this.sidebarPanes.callstack.updateStatus(details.eventType, details.eventData);
WebInspector.currentPanel = this;
window.focus();
@@ -467,8 +469,10 @@ WebInspector.ScriptsPanel.prototype = {
this.sidebarPanes.watchExpressions.refreshExpressions();
if (!preserveItems) {
this.sidebarPanes.jsBreakpoints.reset();
- if (Preferences.domBreakpointsEnabled)
+ if (Preferences.nativeInstrumentationEnabled) {
this.sidebarPanes.domBreakpoints.reset();
+ this.sidebarPanes.xhrBreakpoints.reset();
+ }
this.sidebarPanes.workers.reset();
}
},
@@ -891,7 +895,7 @@ WebInspector.ScriptsPanel.prototype = {
_togglePauseOnExceptions: function()
{
- InspectorBackend.setPauseOnExceptionsState((this._pauseOnExceptionButton.state + 1) % this._pauseOnExceptionButton.states);
+ InspectorBackend.setPauseOnExceptionsState((this._pauseOnExceptionButton.state + 1) % this._pauseOnExceptionButton.states, this.updatePauseOnExceptionsState.bind(this));
},
_togglePause: function()
@@ -998,6 +1002,9 @@ WebInspector.ScriptsPanel.prototype = {
this._shortcuts[shortcut2.key] = handler;
section.addAlternateKeys([ shortcut1.name, shortcut2.name ], WebInspector.UIString("Step out"));
+ shortcut1 = WebInspector.KeyboardShortcut.makeDescriptor("g", platformSpecificModifier);
+ this._shortcuts[shortcut1.key] = this.showGoToLineDialog.bind(this);
+ section.addAlternateKeys([ shortcut1.name ], WebInspector.UIString("Go to Line"));
this.sidebarPanes.callstack.registerShortcuts(section);
},
@@ -1067,6 +1074,13 @@ WebInspector.ScriptsPanel.prototype = {
this._searchView.jumpToLastSearchResult();
else
this._searchView.jumpToPreviousSearchResult();
+ },
+
+ showGoToLineDialog: function(e)
+ {
+ var view = this.visibleView;
+ if (view)
+ WebInspector.GoToLineDialog.show(view);
}
}
diff --git a/WebCore/inspector/front-end/Settings.js b/WebCore/inspector/front-end/Settings.js
index 63f2641..c6da14d 100644
--- a/WebCore/inspector/front-end/Settings.js
+++ b/WebCore/inspector/front-end/Settings.js
@@ -42,10 +42,10 @@ var Preferences = {
showColorNicknames: true,
debuggerAlwaysEnabled: false,
profilerAlwaysEnabled: false,
- auditsPanelEnabled: true,
onlineDetectionEnabled: true,
- domBreakpointsEnabled: false,
- resourceExportEnabled: false
+ nativeInstrumentationEnabled: false,
+ resourceExportEnabled: false,
+ networkPanelEnabled: false
}
WebInspector.Settings = function(sessionScope)
diff --git a/WebCore/inspector/front-end/SourceFrame.js b/WebCore/inspector/front-end/SourceFrame.js
index a9033f2..aecd57b 100644
--- a/WebCore/inspector/front-end/SourceFrame.js
+++ b/WebCore/inspector/front-end/SourceFrame.js
@@ -498,7 +498,8 @@ WebInspector.SourceFrame.prototype = {
self._hidePopup();
delete self._hidePopupTimer;
}
- this._hidePopupTimer = setTimeout(doHide, 500);
+ if (!("_hidePopupTimer" in this))
+ this._hidePopupTimer = setTimeout(doHide, 500);
}
this._hoverElement = event.target;
diff --git a/WebCore/inspector/front-end/WebKit.qrc b/WebCore/inspector/front-end/WebKit.qrc
index c222f0e..11382cd 100644
--- a/WebCore/inspector/front-end/WebKit.qrc
+++ b/WebCore/inspector/front-end/WebKit.qrc
@@ -1,7 +1,6 @@
<!DOCTYPE RCC><RCC version="1.0">
<qresource prefix="/webkit/inspector">
<file>inspector.html</file>
- <file>AbstractTimelinePanel.js</file>
<file>ApplicationCacheItemsView.js</file>
<file>AuditCategories.js</file>
<file>AuditFormatters.js</file>
@@ -42,6 +41,7 @@
<file>ExtensionRegistryStub.js</file>
<file>ExtensionServer.js</file>
<file>FontView.js</file>
+ <file>GoToLineDialog.js</file>
<file>HAREntry.js</file>
<file>HeapSnapshotView.js</file>
<file>HelpScreen.js</file>
@@ -53,6 +53,7 @@
<file>InspectorFrontendHostStub.js</file>
<file>KeyboardShortcut.js</file>
<file>MetricsSidebarPane.js</file>
+ <file>NetworkPanel.js</file>
<file>Object.js</file>
<file>ObjectPropertiesSection.js</file>
<file>Panel.js</file>
@@ -106,10 +107,12 @@
<file>WelcomeView.js</file>
<file>WorkersSidebarPane.js</file>
<file>audits.css</file>
+ <file>goToLineDialog.css</file>
<file>heapProfiler.css</file>
<file>helpScreen.css</file>
<file>inspector.css</file>
<file>inspectorSyntaxHighlight.css</file>
+ <file>networkPanel.css</file>
<file>popover.css</file>
<file>textViewer.css</file>
<file>Images/applicationCache.png</file>
@@ -164,7 +167,9 @@
<file>Images/grayConnectorPoint.png</file>
<file>Images/largerResourcesButtonGlyph.png</file>
<file>Images/localStorage.png</file>
+ <file>Images/networkIcon.png</file>
<file>Images/nodeSearchButtonGlyph.png</file>
+ <file>Images/paneAddButtons.png</file>
<file>Images/paneBottomGrow.png</file>
<file>Images/paneBottomGrowActive.png</file>
<file>Images/paneGrowHandleLine.png</file>
diff --git a/WebCore/inspector/front-end/goToLineDialog.css b/WebCore/inspector/front-end/goToLineDialog.css
new file mode 100644
index 0000000..725e4c8
--- /dev/null
+++ b/WebCore/inspector/front-end/goToLineDialog.css
@@ -0,0 +1,39 @@
+.go-to-line-dialog {
+ position: absolute;
+ top: 40%;
+ left: 40%;
+ z-index: 1900;
+
+ background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#E9E9E9), to(#CFCFCF));
+ display: -webkit-box;
+ -webkit-box-orient: vertical;
+ padding: 10px;
+ border-radius: 10px;
+ border: 1px solid gray;
+ -webkit-box-shadow: rgb(40,40,40) 0px 0px 50px;
+
+ font-size: 11px;
+ font-family: 'Lucida Grande', sans-serif;
+}
+
+.go-to-line-dialog input {
+ font-size: 11px;
+}
+
+.go-to-line-dialog button {
+ font-size: 11px;
+ color: rgb(6, 6, 6);
+ border: 1px solid rgb(165, 165, 165);
+ background-color: rgb(237, 237, 237);
+ background-image: -webkit-gradient(linear, left top, left bottom, from(rgb(252, 252, 252)), to(rgb(223, 223, 223)));
+ -webkit-border-radius: 12px;
+ -webkit-appearance: none;
+
+ padding: 3px 20px;
+ margin: 0 0 0 10px;
+}
+
+.go-to-line-dialog button:active {
+ background-color: rgb(215, 215, 215);
+ background-image: -webkit-gradient(linear, left top, left bottom, from(rgb(194, 194, 194)), to(rgb(239, 239, 239)));
+}
diff --git a/WebCore/inspector/front-end/inspector.css b/WebCore/inspector/front-end/inspector.css
index 6d8571c..848afdc 100644
--- a/WebCore/inspector/front-end/inspector.css
+++ b/WebCore/inspector/front-end/inspector.css
@@ -207,6 +207,10 @@ body.attached #search-results-matches {
background-image: url(Images/resourcesIcon.png);
}
+.toolbar-item.network .toolbar-icon {
+ background-image: url(Images/networkIcon.png);
+}
+
.toolbar-item.scripts .toolbar-icon {
background-image: url(Images/scriptsIcon.png);
}
@@ -1677,6 +1681,29 @@ li.editing .swatch, li.editing .enabled-button, li.editing-sub-part .delete-but
color: black;
}
+.pane > .title > button.add {
+ float: right;
+ width: 23px;
+ height: 17px;
+ color: transparent;
+ background-color: transparent;
+ border: none;
+ background-image: url(Images/paneAddButtons.png);
+ background-repeat: no-repeat;
+ margin: 1px 0 0 0;
+ padding: 0;
+ -webkit-border-radius: 0;
+ -webkit-appearance: none;
+}
+
+.pane > .title > button.add:hover {
+ background-position: -23px 0px;
+}
+
+.pane > .title > button.add:active {
+ background-position: -46px 0px;
+}
+
.pane > .body {
position: relative;
display: none;
@@ -1701,6 +1728,14 @@ li.editing .swatch, li.editing .enabled-button, li.editing-sub-part .delete-but
display: block;
}
+.pane > .body .breakpoint-condition {
+ display: block;
+ margin-top: 4px;
+ margin-bottom: 4px;
+ margin-left: 25px;
+ margin-right: 10px;
+}
+
.pane.expanded:nth-last-of-type(1) {
border-bottom: 1px solid rgb(189, 189, 189);
}
@@ -1950,8 +1985,6 @@ body.inactive .sidebar {
padding-right: 14px;
overflow-x: hidden;
overflow-y: overlay;
- background-image: -webkit-gradient(linear, left top, left bottom, from(white), color-stop(0.5, white), color-stop(0.5, rgb(234, 243, 255)), to(rgb(234, 243, 255)));
- -webkit-background-size: 1px 32px;
}
.data-grid.inline .data-container {
diff --git a/WebCore/inspector/front-end/inspector.html b/WebCore/inspector/front-end/inspector.html
index 0536ee6..949b18f 100644
--- a/WebCore/inspector/front-end/inspector.html
+++ b/WebCore/inspector/front-end/inspector.html
@@ -30,9 +30,11 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="audits.css">
+ <link rel="stylesheet" type="text/css" href="goToLineDialog.css">
<link rel="stylesheet" type="text/css" href="heapProfiler.css">
<link rel="stylesheet" type="text/css" href="inspector.css">
<link rel="stylesheet" type="text/css" href="inspectorSyntaxHighlight.css">
+ <link rel="stylesheet" type="text/css" href="networkPanel.css">
<link rel="stylesheet" type="text/css" href="popover.css">
<link rel="stylesheet" type="text/css" href="textViewer.css">
<script type="text/javascript" src="utilities.js"></script>
@@ -58,7 +60,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
<script type="text/javascript" src="ConsoleView.js"></script>
<script type="text/javascript" src="Panel.js"></script>
<script type="text/javascript" src="TimelineGrid.js"></script>
- <script type="text/javascript" src="AbstractTimelinePanel.js"></script>
<script type="text/javascript" src="Resource.js"></script>
<script type="text/javascript" src="ResourceCategory.js"></script>
<script type="text/javascript" src="Database.js"></script>
@@ -92,6 +93,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
<script type="text/javascript" src="StatusBarButton.js"></script>
<script type="text/javascript" src="SummaryBar.js"></script>
<script type="text/javascript" src="ElementsPanel.js"></script>
+ <script type="text/javascript" src="NetworkPanel.js"></script>
<script type="text/javascript" src="ResourcesPanel.js"></script>
<script type="text/javascript" src="InjectedFakeWorker.js"></script>
<script type="text/javascript" src="ScriptsPanel.js"></script>
@@ -138,6 +140,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
<script type="text/javascript" src="TimelineOverviewPane.js"></script>
<script type="text/javascript" src="TestController.js"></script>
<script type="text/javascript" src="HelpScreen.js"></script>
+ <script type="text/javascript" src="GoToLineDialog.js"></script>
<script type="text/javascript" src="ShortcutsHelp.js"></script>
<script type="text/javascript" src="HAREntry.js"></script>
</head>
diff --git a/WebCore/inspector/front-end/inspector.js b/WebCore/inspector/front-end/inspector.js
index f6fa06b..3edae8f 100644
--- a/WebCore/inspector/front-end/inspector.js
+++ b/WebCore/inspector/front-end/inspector.js
@@ -219,11 +219,24 @@ var WebInspector = {
return pane;
},
+ createXHRBreakpointsSidebarPane: function()
+ {
+ var pane = new WebInspector.XHRBreakpointsSidebarPane();
+ function breakpointAdded(event)
+ {
+ pane.addBreakpoint(new WebInspector.XHRBreakpointItem(event.data));
+ }
+ WebInspector.breakpointManager.addEventListener("xhr-breakpoint-added", breakpointAdded);
+ return pane;
+ },
+
_createPanels: function()
{
var hiddenPanels = (InspectorFrontendHost.hiddenPanels() || "").split(',');
if (hiddenPanels.indexOf("elements") === -1)
this.panels.elements = new WebInspector.ElementsPanel();
+ if (Preferences.networkPanelEnabled && hiddenPanels.indexOf("network") === -1)
+ this.panels.network = new WebInspector.NetworkPanel();
if (hiddenPanels.indexOf("resources") === -1)
this.panels.resources = new WebInspector.ResourcesPanel();
if (hiddenPanels.indexOf("scripts") === -1)
@@ -238,7 +251,7 @@ var WebInspector = {
}
if (hiddenPanels.indexOf("storage") === -1 && hiddenPanels.indexOf("databases") === -1)
this.panels.storage = new WebInspector.StoragePanel();
- if (Preferences.auditsPanelEnabled && hiddenPanels.indexOf("audits") === -1)
+ if (hiddenPanels.indexOf("audits") === -1)
this.panels.audits = new WebInspector.AuditsPanel();
if (hiddenPanels.indexOf("console") === -1)
this.panels.console = new WebInspector.ConsolePanel();
@@ -435,12 +448,8 @@ var WebInspector = {
_updateFocusedNode: function(nodeId)
{
- var node = WebInspector.domAgent.nodeForId(nodeId);
- if (!node)
- return;
-
this.currentPanel = this.panels.elements;
- this.panels.elements.focusedDOMNode = node;
+ this.panels.elements.updateFocusedNode(nodeId);
}
}
@@ -585,6 +594,8 @@ WebInspector.doLoadedDone = function()
function populateInspectorState(inspectorState)
{
WebInspector.monitoringXHREnabled = inspectorState.monitoringXHREnabled;
+ if ("pauseOnExceptionsState" in inspectorState)
+ WebInspector.panels.scripts.updatePauseOnExceptionsState(inspectorState.pauseOnExceptionsState);
if (inspectorState.resourceTrackingEnabled)
WebInspector.panels.resources.resourceTrackingWasEnabled();
else
@@ -677,8 +688,8 @@ WebInspector.dispatchMessageFromBackend = function(messageObject)
WebInspector.reportProtocolError = function(messageObject)
{
console.error("Protocol Error: InspectorBackend request with seq = %d failed.", messageObject.seq);
- for (var error in messageObject.errors)
- console.error(" " + error);
+ for (var i = 0; i < messageObject.errors.length; ++i)
+ console.error(" " + messageObject.errors[i]);
WebInspector.removeResponseCallbackEntry(messageObject.seq);
}
@@ -1216,10 +1227,10 @@ WebInspector.updateResource = function(payload)
resource = new WebInspector.Resource(identifier, payload.url);
this.resources[identifier] = resource;
this.resourceURLMap[resource.url] = resource;
- if (this.panels.resources)
- this.panels.resources.addResource(resource);
- if (this.panels.audits)
- this.panels.audits.resourceStarted(resource);
+ this.panels.resources.addResource(resource);
+ this.panels.audits.resourceStarted(resource);
+ if (this.panels.network)
+ this.panels.network.addResource(resource);
}
if (payload.didRequestChange) {
@@ -1261,13 +1272,11 @@ WebInspector.updateResource = function(payload)
resource.webSocketChallengeResponse = payload.webSocketChallengeResponse;
}
- if (payload.didTypeChange) {
+ if (payload.didTypeChange)
resource.type = payload.type;
- }
- if (payload.didLengthChange) {
+ if (payload.didLengthChange)
resource.resourceSize = payload.resourceSize;
- }
if (payload.didCompletionChange) {
resource.failed = payload.failed;
@@ -1289,21 +1298,24 @@ WebInspector.updateResource = function(payload)
// This loadEventTime is for the main resource, and we want to show it
// for all resources on this page. This means we want to set it as a member
// of the resources panel instead of the individual resource.
- if (this.panels.resources)
- this.panels.resources.mainResourceLoadTime = payload.loadEventTime;
- if (this.panels.audits)
- this.panels.audits.mainResourceLoadTime = payload.loadEventTime;
+ this.panels.resources.mainResourceLoadTime = payload.loadEventTime;
+ this.panels.audits.mainResourceLoadTime = payload.loadEventTime;
+ if (this.panels.network)
+ this.panels.network.mainResourceLoadTime = payload.loadEventTime;
}
if (payload.domContentEventTime) {
// This domContentEventTime is for the main resource, so it should go in
// the resources panel for the same reasons as above.
- if (this.panels.resources)
- this.panels.resources.mainResourceDOMContentTime = payload.domContentEventTime;
- if (this.panels.audits)
- this.panels.audits.mainResourceDOMContentTime = payload.domContentEventTime;
+ this.panels.resources.mainResourceDOMContentTime = payload.domContentEventTime;
+ this.panels.audits.mainResourceDOMContentTime = payload.domContentEventTime;
+ if (this.panels.network)
+ this.panels.network.mainResourceDOMContentTime = payload.domContentEventTime;
}
}
+
+ if (this.panels.network)
+ this.panels.network.refreshResource(resource);
}
WebInspector.removeResource = function(identifier)
@@ -1402,11 +1414,6 @@ WebInspector.debuggerWasEnabled = function()
this.panels.scripts.debuggerWasEnabled();
}
-WebInspector.updatePauseOnExceptionsState = function(pauseOnExceptionsState)
-{
- this.panels.scripts.updatePauseOnExceptionsState(pauseOnExceptionsState);
-}
-
WebInspector.debuggerWasDisabled = function()
{
this.panels.scripts.debuggerWasDisabled();
diff --git a/WebCore/inspector/front-end/networkPanel.css b/WebCore/inspector/front-end/networkPanel.css
new file mode 100644
index 0000000..cdea7fe
--- /dev/null
+++ b/WebCore/inspector/front-end/networkPanel.css
@@ -0,0 +1,383 @@
+.network-larger-resources-status-bar-item .glyph {
+ -webkit-mask-image: url(Images/largerResourcesButtonGlyph.png);
+}
+
+.network.panel .data-grid {
+ border: none;
+ position: absolute;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ font-size: 11px;
+}
+
+.network.panel .data-grid table.data {
+ -webkit-background-size: 1px 82px;
+ background-image: -webkit-gradient(linear, left top, left bottom, from(rgba(0, 0, 0, 0)), color-stop(0.5, rgba(0, 0, 0, 0)), color-stop(0.5, rgba(0, 0, 0, 0.05)), to(rgba(0, 0, 0, 0.05)));
+ font-size: 11px;
+}
+
+.network.panel .data-grid.small table.data {
+ -webkit-background-size: 1px 42px;
+}
+
+.network.panel .data-grid td {
+ line-height: 17px;
+ border-right: 1px solid rgb(210, 210, 210);
+ -webkit-user-select: none;
+}
+
+.network.panel .data-grid th {
+ border-bottom: 1px solid rgb(64%, 64%, 64%);
+ height: 22px;
+}
+
+.network.panel .data-grid th, .network.panel .data-grid th.sort-descending, .network.panel .data-grid th.sort-ascending {
+ background: -webkit-gradient(linear, left top, left bottom, from(rgb(236, 236, 236)), to(rgb(217, 217, 217)));
+}
+
+.network.panel .data-grid .data-container {
+ top: 23px;
+}
+
+.network.panel .data-grid td.url-column {
+ font-weight: bold;
+}
+
+.network.panel .data-grid td.optional-column {
+ background-color: rgba(0, 0, 0, 0.07);
+}
+
+.network.panel .small .network-graph-side {
+ height: 14px;
+}
+
+.network.panel .data-grid th.sortable:active {
+ background-image: none;
+}
+
+.network-grid-subtitle {
+ font-weight: normal;
+ color: grey;
+}
+
+.network.panel .data-grid.small .network-grid-subtitle {
+ display: none;
+}
+
+/* Resource preview icons */
+
+.network.panel .data-grid .icon {
+ content: url(Images/resourcePlainIcon.png);
+}
+
+.network.panel .data-grid.small .icon {
+ content: url(Images/resourcePlainIconSmall.png);
+}
+
+.network.panel .network-category-scripts .icon {
+ content: url(Images/resourceJSIcon.png);
+}
+
+.network.panel .data-grid.small .network-category-scripts .icon {
+ content: url(Images/resourceDocumentIconSmall.png);
+}
+
+.network.panel .network-category-documents .icon {
+ content: url(Images/resourceDocumentIcon.png);
+}
+
+.network.panel .data-grid.small .network-category-documents .icon {
+ content: url(Images/resourceDocumentIconSmall.png);
+}
+
+.network.panel .network-category-stylesheets .icon {
+ content: url(Images/resourceCSSIcon.png);
+}
+
+.network.panel .data-grid.small .network-category-stylesheets .icon {
+ content: url(Images/resourceDocumentIconSmall.png);
+}
+
+.network.panel .network-category-images .icon {
+ position: relative;
+ background-image: url(Images/resourcePlainIcon.png);
+ background-repeat: no-repeat;
+ content: "";
+}
+
+.network.panel .network-category-images .icon {
+ position: relative;
+ background-image: url(Images/resourcePlainIcon.png);
+ background-repeat: no-repeat;
+ content: "";
+}
+
+.network.panel .data-grid.small .network-category-images .icon {
+ background-image: url(Images/resourcePlainIconSmall.png);
+ content: "";
+}
+
+.network.panel .data-grid .icon {
+ float: left;
+ width: 32px;
+ height: 32px;
+ margin-top: 1px;
+ margin-right: 3px;
+}
+
+.network.panel .data-grid.small .icon {
+ width: 16px;
+ height: 16px;
+}
+
+.network.panel .image-network-icon-preview {
+ position: absolute;
+ margin: auto;
+ top: 3px;
+ bottom: 4px;
+ left: 5px;
+ right: 5px;
+ max-width: 18px;
+ max-height: 21px;
+ min-width: 1px;
+ min-height: 1px;
+}
+
+.network.panel .data-grid.small .image-network-icon-preview {
+ top: 2px;
+ bottom: 1px;
+ left: 3px;
+ right: 3px;
+ max-width: 8px;
+ max-height: 11px;
+}
+
+/* Graph styles */
+
+.network-graph-side {
+ position: relative;
+ height: 36px;
+ padding: 0 5px;
+ white-space: nowrap;
+ margin-top: 1px;
+ border-top: 1px solid transparent;
+ overflow: hidden;
+}
+
+.network-graph-bar-area {
+ position: absolute;
+ top: 0;
+ bottom: 0;
+ right: 8px;
+ left: 9px;
+}
+
+.network-graph-label {
+ position: absolute;
+ top: 0;
+ bottom: 0;
+ margin: auto -7px;
+ height: 13px;
+ line-height: 13px;
+ font-size: 9px;
+ color: rgba(0, 0, 0, 0.75);
+ text-shadow: rgba(255, 255, 255, 0.25) 1px 0 0, rgba(255, 255, 255, 0.25) -1px 0 0, rgba(255, 255, 255, 0.333) 0 1px 0, rgba(255, 255, 255, 0.25) 0 -1px 0;
+ z-index: 150;
+ overflow: hidden;
+ text-align: center;
+ font-weight: bold;
+ opacity: 0;
+ -webkit-transition: opacity 250ms ease-in-out;
+}
+
+.network-graph-side:hover .network-graph-label {
+ opacity: 1;
+}
+
+.network-graph-label:empty {
+ display: none;
+}
+
+.network-graph-label.waiting {
+ margin-right: 5px;
+}
+
+.network-graph-label.waiting-right {
+ margin-left: 5px;
+}
+
+.network-graph-label.before {
+ color: rgba(0, 0, 0, 0.7);
+ text-shadow: none;
+ text-align: right;
+ margin-right: 2px;
+}
+
+.network-graph-label.before::after {
+ padding-left: 2px;
+ height: 6px;
+ content: url(Images/graphLabelCalloutLeft.png);
+}
+
+.network-graph-label.after {
+ color: rgba(0, 0, 0, 0.7);
+ text-shadow: none;
+ text-align: left;
+ margin-left: 2px;
+}
+
+.network-graph-label.after::before {
+ padding-right: 2px;
+ height: 6px;
+ content: url(Images/graphLabelCalloutRight.png);
+}
+
+.network-graph-bar {
+ position: absolute;
+ top: 0;
+ bottom: 0;
+ margin: auto -7px;
+ border-width: 6px 7px;
+ height: 13px;
+ min-width: 14px;
+ opacity: 0.65;
+ -webkit-border-image: url(Images/timelinePillGray.png) 6 7 6 7;
+}
+
+.network-graph-bar.waiting, .network-graph-bar.waiting-right {
+ opacity: 0.35;
+}
+
+/* Resource categories */
+
+
+.resource-cached .network-graph-bar {
+ -webkit-border-image: url(Images/timelineHollowPillGray.png) 6 7 6 7;
+}
+
+.network-category-documents .network-graph-bar {
+ -webkit-border-image: url(Images/timelinePillBlue.png) 6 7 6 7;
+}
+
+.network-category-documents.resource-cached .network-graph-bar {
+ -webkit-border-image: url(Images/timelineHollowPillBlue.png) 6 7 6 7;
+}
+
+.network-category-stylesheets .network-graph-bar {
+ -webkit-border-image: url(Images/timelinePillGreen.png) 6 7 6 7;
+}
+
+.network-category-stylesheets.resource-cached .network-graph-bar {
+ -webkit-border-image: url(Images/timelineHollowPillGreen.png) 6 7 6 7;
+}
+
+.network-category-images .network-graph-bar {
+ -webkit-border-image: url(Images/timelinePillPurple.png) 6 7 6 7;
+}
+
+.network-category-images.resource-cached .network-graph-bar {
+ -webkit-border-image: url(Images/timelineHollowPillPurple.png) 6 7 6 7;
+}
+
+.network-category-fonts .network-graph-bar {
+ -webkit-border-image: url(Images/timelinePillRed.png) 6 7 6 7;
+}
+
+.network-category-fonts.resource-cached .network-graph-bar {
+ -webkit-border-image: url(Images/timelineHollowPillRed.png) 6 7 6 7;
+}
+
+.network-category-scripts .network-graph-bar {
+ -webkit-border-image: url(Images/timelinePillOrange.png) 6 7 6 7;
+}
+
+.network-category-scripts.resource-cached .network-graph-bar {
+ -webkit-border-image: url(Images/timelineHollowPillOrange.png) 6 7 6 7;
+}
+
+.network-category-xhr .network-graph-bar {
+ -webkit-border-image: url(Images/timelinePillYellow.png) 6 7 6 7;
+}
+
+.network-category-xhr.resource-cached .network-graph-bar {
+ -webkit-border-image: url(Images/timelineHollowPillYellow.png) 6 7 6 7;
+}
+
+.network-category-websockets .network-graph-bar {
+ -webkit-border-image: url(Images/timelinePillGray.png) 6 7 6 7;
+}
+
+.network-category-websockets.resource-cached .network-graph-bar {
+ -webkit-border-image: url(Images/timelineHollowPillGray.png) 6 7 6 7;
+}
+
+
+/* Popover */
+
+.network-timing-row {
+ position: relative;
+ height: 12px;
+}
+
+.network-timing-bar {
+ position: absolute;
+ background-color: red;
+ border-left: 1px solid red;
+ opacity: 0.4;
+}
+
+.network-timing-bar-title {
+ position: absolute;
+}
+
+.network-dim-cell {
+ color: grey;
+}
+
+/* Dividers */
+
+.network-timeline-grid {
+ position: absolute;
+ top: 0;
+ bottom: 0;
+ left: 0;
+ right: 0;
+}
+
+.network-event-divider-padding {
+ position: absolute;
+ width: 8px;
+ top: 0;
+ bottom: 0;
+ pointer-events: auto;
+}
+
+.network-event-divider {
+ position: absolute;
+ width: 2px;
+ top: 0;
+ bottom: 0;
+ z-index: 300;
+}
+
+.network-red-divider {
+ background-color: rgba(255, 0, 0, 0.5);
+}
+
+.network-blue-divider {
+ background-color: rgba(0, 0, 255, 0.5);
+}
+
+.network.panel .resources-dividers-label-bar {
+ background-color: transparent;
+ border: none;
+ height: 23px;
+ pointer-events: none;
+}
+
+.network.panel .resources-divider-label {
+ top: 6px;
+ color: black;
+}
diff --git a/WebCore/inspector/front-end/treeoutline.js b/WebCore/inspector/front-end/treeoutline.js
index c2a3fe7..e2f879c 100644
--- a/WebCore/inspector/front-end/treeoutline.js
+++ b/WebCore/inspector/front-end/treeoutline.js
@@ -399,7 +399,7 @@ TreeOutline.prototype._treeKeyDown = function(event)
if (nextSelectedElement) {
nextSelectedElement.reveal();
- nextSelectedElement.select();
+ nextSelectedElement.select(false, true);
}
if (handled) {
@@ -794,10 +794,10 @@ TreeElement.prototype.revealed = function()
TreeElement.prototype.selectOnMouseDown = function(event)
{
- this.select();
+ this.select(false, true);
}
-TreeElement.prototype.select = function(supressOnSelect)
+TreeElement.prototype.select = function(supressOnSelect, selectedByUser)
{
if (!this.treeOutline || !this.selectable || this.selected)
return;
@@ -812,7 +812,7 @@ TreeElement.prototype.select = function(supressOnSelect)
this._listItemNode.addStyleClass("selected");
if (this.onselect && !supressOnSelect)
- this.onselect(this);
+ this.onselect(this, selectedByUser);
}
TreeElement.prototype.deselect = function(supressOnDeselect)
diff --git a/WebCore/loader/Cache.cpp b/WebCore/loader/Cache.cpp
index dbcec00..28c9f93 100644
--- a/WebCore/loader/Cache.cpp
+++ b/WebCore/loader/Cache.cpp
@@ -238,11 +238,15 @@ void Cache::revalidationFailed(CachedResource* revalidatingResource)
CachedResource* Cache::resourceForURL(const String& url)
{
CachedResource* resource = m_resources.get(url);
+ bool wasPurgeable = Cache::shouldMakeResourcePurgeableOnEviction() && resource && resource->isPurgeable();
if (resource && !resource->makePurgeable(false)) {
ASSERT(!resource->hasClients());
evict(resource);
return 0;
}
+ // Add the size back since we had subtracted it when we marked the memory as purgeable.
+ if (wasPurgeable)
+ adjustSize(resource->hasClients(), resource->size());
return resource;
}
@@ -363,7 +367,9 @@ void Cache::pruneDeadResources()
while (current) {
CachedResource* prev = current->m_prevInAllResourcesList;
if (!current->hasClients() && !current->isPreloaded() && !current->isCacheValidator()) {
- evict(current);
+ if (!makeResourcePurgeable(current))
+ evict(current);
+
// If evict() caused pruneDeadResources() to be re-entered, bail out. This can happen when removing an
// SVG CachedImage that has subresources.
if (!m_inPruneDeadResources)
@@ -397,6 +403,25 @@ void Cache::setCapacities(unsigned minDeadBytes, unsigned maxDeadBytes, unsigned
prune();
}
+bool Cache::makeResourcePurgeable(CachedResource* resource)
+{
+ if (!Cache::shouldMakeResourcePurgeableOnEviction())
+ return false;
+
+ if (!resource->inCache())
+ return false;
+
+ if (!resource->isSafeToMakePurgeable())
+ return false;
+
+ if (!resource->makePurgeable(true))
+ return false;
+
+ adjustSize(resource->hasClients(), -static_cast<int>(resource->size()));
+
+ return true;
+}
+
void Cache::evict(CachedResource* resource)
{
// The resource may have already been removed by someone other than our caller,
@@ -410,10 +435,10 @@ void Cache::evict(CachedResource* resource)
removeFromLRUList(resource);
removeFromLiveDecodedResourcesList(resource);
- // Subtract from our size totals.
- int delta = -static_cast<int>(resource->size());
- if (delta)
- adjustSize(resource->hasClients(), delta);
+ // If the resource was purged, it means we had already decremented the size when we made the
+ // resource purgeable in makeResourcePurgeable().
+ if (!Cache::shouldMakeResourcePurgeableOnEviction() || !resource->wasPurged())
+ adjustSize(resource->hasClients(), -static_cast<int>(resource->size()));
} else
ASSERT(m_resources.get(resource->url()) != resource);
@@ -725,7 +750,7 @@ void Cache::dumpStats()
void Cache::dumpLRULists(bool includeLive) const
{
- printf("LRU-SP lists in eviction order (Kilobytes decoded, Kilobytes encoded, Access count, Referenced):\n");
+ printf("LRU-SP lists in eviction order (Kilobytes decoded, Kilobytes encoded, Access count, Referenced, isPurgeable, wasPurged):\n");
int size = m_allResources.size();
for (int i = size - 1; i >= 0; i--) {
@@ -734,7 +759,8 @@ void Cache::dumpLRULists(bool includeLive) const
while (current) {
CachedResource* prev = current->m_prevInAllResourcesList;
if (includeLive || !current->hasClients())
- printf("(%.1fK, %.1fK, %uA, %dR); ", current->decodedSize() / 1024.0f, (current->encodedSize() + current->overheadSize()) / 1024.0f, current->accessCount(), current->hasClients());
+ printf("(%.1fK, %.1fK, %uA, %dR, %d, %d); ", current->decodedSize() / 1024.0f, (current->encodedSize() + current->overheadSize()) / 1024.0f, current->accessCount(), current->hasClients(), current->isPurgeable(), current->wasPurged());
+
current = prev;
}
}
diff --git a/WebCore/loader/Cache.h b/WebCore/loader/Cache.h
index 9d7e8be..eb5b398 100644
--- a/WebCore/loader/Cache.h
+++ b/WebCore/loader/Cache.h
@@ -55,6 +55,22 @@ class KURL;
// -------|-----+++++++++++++++|
// -------|-----+++++++++++++++|+++++
+// The behavior of the cache changes in the following way if shouldMakeResourcePurgeableOnEviction
+// returns true.
+//
+// 1. Dead resources in the cache are kept in non-purgeable memory.
+// 2. When we prune dead resources, instead of freeing them, we mark their memory as purgeable and
+// keep the resources until the kernel reclaims the purgeable memory.
+//
+// By leaving the in-cache dead resources in dirty resident memory, we decrease the likelihood of
+// the kernel claiming that memory and forcing us to refetch the resource (for example when a user
+// presses back).
+//
+// And by having an unbounded number of resource objects using purgeable memory, we can use as much
+// memory as is available on the machine. The trade-off here is that the CachedResource object (and
+// its member variables) are allocated in non-purgeable TC-malloc'd memory so we would see slightly
+// more memory use due to this.
+
class Cache : public Noncopyable {
public:
friend Cache* cache();
@@ -148,6 +164,8 @@ public:
void addToLiveResourcesSize(CachedResource*);
void removeFromLiveResourcesSize(CachedResource*);
+ static bool shouldMakeResourcePurgeableOnEviction();
+
// Function to collect cache statistics for the caches window in the Safari Debug menu.
Statistics getStatistics();
@@ -173,6 +191,7 @@ private:
void pruneDeadResources(); // Flush decoded and encoded data from resources not referenced by Web pages.
void pruneLiveResources(); // Flush decoded data from resources still referenced by Web pages.
+ bool makeResourcePurgeable(CachedResource*);
void evict(CachedResource*);
// Member variables.
@@ -204,6 +223,15 @@ private:
HashMap<String, CachedResource*> m_resources;
};
+inline bool Cache::shouldMakeResourcePurgeableOnEviction()
+{
+#if PLATFORM(IOS)
+ return true;
+#else
+ return false;
+#endif
+}
+
// Function to obtain the global cache.
Cache* cache();
diff --git a/WebCore/loader/CachedCSSStyleSheet.cpp b/WebCore/loader/CachedCSSStyleSheet.cpp
index 7866efd..877cd1d 100644
--- a/WebCore/loader/CachedCSSStyleSheet.cpp
+++ b/WebCore/loader/CachedCSSStyleSheet.cpp
@@ -27,6 +27,7 @@
#include "config.h"
#include "CachedCSSStyleSheet.h"
+#include "Cache.h"
#include "CachedResourceClient.h"
#include "CachedResourceClientWalker.h"
#include "HTTPParsers.h"
@@ -58,7 +59,7 @@ void CachedCSSStyleSheet::didAddClient(CachedResourceClient *c)
void CachedCSSStyleSheet::allClientsRemoved()
{
- if (isSafeToMakePurgeable())
+ if (!Cache::shouldMakeResourcePurgeableOnEviction() && isSafeToMakePurgeable())
makePurgeable(true);
}
diff --git a/WebCore/loader/CachedFont.cpp b/WebCore/loader/CachedFont.cpp
index 166fa85..ef88af8 100644
--- a/WebCore/loader/CachedFont.cpp
+++ b/WebCore/loader/CachedFont.cpp
@@ -27,7 +27,7 @@
#include "config.h"
#include "CachedFont.h"
-#if PLATFORM(CG) || PLATFORM(QT) || PLATFORM(GTK) || (PLATFORM(CHROMIUM) && (OS(WINDOWS) || OS(LINUX))) || PLATFORM(HAIKU) || OS(WINCE) || PLATFORM(ANDROID)
+#if PLATFORM(CG) || PLATFORM(QT) || PLATFORM(GTK) || (PLATFORM(CHROMIUM) && (OS(WINDOWS) || OS(LINUX) || OS(FREEBSD))) || PLATFORM(HAIKU) || OS(WINCE) || PLATFORM(ANDROID)
#define STORE_FONT_CUSTOM_PLATFORM_DATA
#endif
diff --git a/WebCore/loader/CachedImage.cpp b/WebCore/loader/CachedImage.cpp
index 908c425..641ce94 100644
--- a/WebCore/loader/CachedImage.cpp
+++ b/WebCore/loader/CachedImage.cpp
@@ -338,7 +338,8 @@ void CachedImage::destroyDecodedData()
// Invoking addClient() will reconstruct the image object.
m_image = 0;
setDecodedSize(0);
- makePurgeable(true);
+ if (!Cache::shouldMakeResourcePurgeableOnEviction())
+ makePurgeable(true);
} else if (m_image && !errorOccurred())
m_image->destroyDecodedData();
}
diff --git a/WebCore/loader/CachedScript.cpp b/WebCore/loader/CachedScript.cpp
index 58895d6..1898438 100644
--- a/WebCore/loader/CachedScript.cpp
+++ b/WebCore/loader/CachedScript.cpp
@@ -27,6 +27,7 @@
#include "config.h"
#include "CachedScript.h"
+#include "Cache.h"
#include "CachedResourceClient.h"
#include "CachedResourceClientWalker.h"
#include "SharedBuffer.h"
@@ -110,7 +111,7 @@ void CachedScript::destroyDecodedData()
{
m_script = String();
setDecodedSize(0);
- if (isSafeToMakePurgeable())
+ if (!Cache::shouldMakeResourcePurgeableOnEviction() && isSafeToMakePurgeable())
makePurgeable(true);
}
diff --git a/WebCore/loader/EmptyClients.h b/WebCore/loader/EmptyClients.h
index f295663..6fb003e 100644
--- a/WebCore/loader/EmptyClients.h
+++ b/WebCore/loader/EmptyClients.h
@@ -340,7 +340,7 @@ public:
virtual void didDisplayInsecureContent() { }
virtual void didRunInsecureContent(SecurityOrigin*) { }
virtual PassRefPtr<Frame> createFrame(const KURL&, const String&, HTMLFrameOwnerElement*, const String&, bool, int, int) { return 0; }
- virtual void didTransferChildFrameToNewDocument() { }
+ virtual void didTransferChildFrameToNewDocument(Page*) { }
virtual PassRefPtr<Widget> createPlugin(const IntSize&, HTMLPlugInElement*, const KURL&, const Vector<String>&, const Vector<String>&, const String&, bool) { return 0; }
virtual PassRefPtr<Widget> createJavaAppletWidget(const IntSize&, HTMLAppletElement*, const KURL&, const Vector<String>&, const Vector<String>&) { return 0; }
#if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
@@ -361,6 +361,7 @@ public:
virtual void didCreateScriptContextForFrame() { }
virtual void didDestroyScriptContextForFrame() { }
virtual void didCreateIsolatedScriptContext() { }
+ virtual bool allowScriptExtension(const String& extensionName, int extensionGroup) { return false; }
#endif
virtual void registerForIconNotification(bool) { }
@@ -550,6 +551,7 @@ public:
virtual void startUpdating() { }
virtual void stopUpdating() { }
virtual DeviceMotionData* currentDeviceMotion() const { return 0; }
+ virtual void deviceMotionControllerDestroyed() { }
};
class EmptyDeviceOrientationClient : public DeviceOrientationClient {
@@ -558,6 +560,7 @@ public:
virtual void startUpdating() { }
virtual void stopUpdating() { }
virtual DeviceOrientation* lastOrientation() const { return 0; }
+ virtual void deviceOrientationControllerDestroyed() { }
};
}
diff --git a/WebCore/loader/FrameLoaderClient.h b/WebCore/loader/FrameLoaderClient.h
index 427b81e..803eb11 100644
--- a/WebCore/loader/FrameLoaderClient.h
+++ b/WebCore/loader/FrameLoaderClient.h
@@ -64,6 +64,7 @@ namespace WebCore {
class IntSize;
class KURL;
class NavigationAction;
+ class Page;
class ProtectionSpace;
class PluginView;
class PolicyChecker;
@@ -229,7 +230,7 @@ namespace WebCore {
virtual PassRefPtr<Frame> createFrame(const KURL& url, const String& name, HTMLFrameOwnerElement* ownerElement,
const String& referrer, bool allowsScrolling, int marginWidth, int marginHeight) = 0;
- virtual void didTransferChildFrameToNewDocument() = 0;
+ virtual void didTransferChildFrameToNewDocument(Page* oldPage) = 0;
virtual PassRefPtr<Widget> createPlugin(const IntSize&, HTMLPlugInElement*, const KURL&, const Vector<String>&, const Vector<String>&, const String&, bool loadManually) = 0;
virtual void redirectDataToPlugin(Widget* pluginWidget) = 0;
@@ -253,6 +254,7 @@ namespace WebCore {
virtual void didCreateScriptContextForFrame() = 0;
virtual void didDestroyScriptContextForFrame() = 0;
virtual void didCreateIsolatedScriptContext() = 0;
+ virtual bool allowScriptExtension(const String& extensionName, int extensionGroup) = 0;
#endif
virtual void registerForIconNotification(bool listen = true) = 0;
diff --git a/WebCore/loader/PingLoader.cpp b/WebCore/loader/PingLoader.cpp
index 2a628ce..dd00128 100644
--- a/WebCore/loader/PingLoader.cpp
+++ b/WebCore/loader/PingLoader.cpp
@@ -32,6 +32,7 @@
#include "config.h"
#include "PingLoader.h"
+#include "FormData.h"
#include "Frame.h"
#include "ResourceHandle.h"
#include "SecurityOrigin.h"
@@ -60,9 +61,40 @@ void PingLoader::loadImage(Frame* frame, const KURL& url)
UNUSED_PARAM(leakedPingLoader);
}
+// http://www.whatwg.org/specs/web-apps/current-work/multipage/links.html#hyperlink-auditing
+void PingLoader::sendPing(Frame* frame, const KURL& pingURL, const KURL& destinationURL)
+{
+ ResourceRequest request(pingURL);
+ request.setTargetType(ResourceRequest::TargetIsSubresource);
+ request.setHTTPMethod("POST");
+ request.setHTTPContentType("text/ping");
+ request.setHTTPBody(FormData::create("PING"));
+ request.setHTTPHeaderField("Cache-Control", "max-age=0");
+ frame->loader()->addExtraFieldsToSubresourceRequest(request);
+
+ SecurityOrigin* sourceOrigin = frame->document()->securityOrigin();
+ RefPtr<SecurityOrigin> pingOrigin = SecurityOrigin::create(pingURL);
+ FrameLoader::addHTTPOriginIfNeeded(request, sourceOrigin->toString());
+ request.setHTTPHeaderField("Ping-To", destinationURL);
+ if (sourceOrigin->isSameSchemeHostPort(pingOrigin.get()))
+ request.setHTTPHeaderField("Ping-From", frame->document()->url());
+ else if (!SecurityOrigin::shouldHideReferrer(pingURL, frame->loader()->outgoingReferrer()))
+ request.setHTTPReferrer(frame->loader()->outgoingReferrer());
+ OwnPtr<PingLoader> pingLoader = adoptPtr(new PingLoader(frame, request));
+
+ // Leak the ping loader, since it will kill itself as soon as it receives a response.
+ PingLoader* leakedPingLoader = pingLoader.leakPtr();
+ UNUSED_PARAM(leakedPingLoader);
+}
+
PingLoader::PingLoader(Frame* frame, const ResourceRequest& request)
+ : m_timeout(this, &PingLoader::timeout)
{
m_handle = ResourceHandle::create(frame->loader()->networkingContext(), request, this, false, false);
+
+ // If the server never responds, FrameLoader won't be able to cancel this load and
+ // we'll sit here waiting forever. Set a very generous timeout, just in case.
+ m_timeout.startOneShot(60000);
}
PingLoader::~PingLoader()
diff --git a/WebCore/loader/PingLoader.h b/WebCore/loader/PingLoader.h
index e26a9c9..eb43166 100644
--- a/WebCore/loader/PingLoader.h
+++ b/WebCore/loader/PingLoader.h
@@ -33,6 +33,7 @@
#define PingLoader_h
#include "ResourceHandleClient.h"
+#include "Timer.h"
#include <wtf/Noncopyable.h>
#include <wtf/RefPtr.h>
@@ -52,6 +53,7 @@ class ResourceResponse;
class PingLoader : private ResourceHandleClient, public Noncopyable {
public:
static void loadImage(Frame*, const KURL& url);
+ static void sendPing(Frame*, const KURL& pingURL, const KURL& destinationURL);
~PingLoader();
@@ -62,8 +64,10 @@ private:
void didReceiveData(ResourceHandle*, const char*, int) { delete this; }
void didFinishLoading(ResourceHandle*, double) { delete this; }
void didFail(ResourceHandle*, const ResourceError&) { delete this; }
+ void timeout(Timer<PingLoader>*) { delete this; }
RefPtr<ResourceHandle> m_handle;
+ Timer<PingLoader> m_timeout;
};
}
diff --git a/WebCore/loader/RedirectScheduler.cpp b/WebCore/loader/RedirectScheduler.cpp
index ce0e3f8..ce41cde 100644
--- a/WebCore/loader/RedirectScheduler.cpp
+++ b/WebCore/loader/RedirectScheduler.cpp
@@ -318,7 +318,7 @@ void RedirectScheduler::scheduleFormSubmission(PassRefPtr<FormSubmission> submis
// to match IE and Opera.
// See https://bugs.webkit.org/show_bug.cgi?id=32383 for the original motivation for this.
bool isUserGesture = m_frame->loader()->isProcessingUserGesture();
- bool lockBackForwardList = mustLockBackForwardList(m_frame, isUserGesture) || (submission->state()->formSubmissionTrigger() == SubmittedByJavaScript && m_frame->tree()->parent());
+ bool lockBackForwardList = mustLockBackForwardList(m_frame, isUserGesture) || (submission->state()->formSubmissionTrigger() == SubmittedByJavaScript && m_frame->tree()->parent() && !isUserGesture);
schedule(adoptPtr(new ScheduledFormSubmission(submission, lockBackForwardList, duringLoad, isUserGesture)));
}
diff --git a/WebCore/make-hash-tools.pl b/WebCore/make-hash-tools.pl
index 8cc9952..3ad5ee9 100644
--- a/WebCore/make-hash-tools.pl
+++ b/WebCore/make-hash-tools.pl
@@ -27,24 +27,123 @@ my $outdir = $ARGV[0];
shift;
my $option = basename($ARGV[0],".gperf");
+my $hashToolsHeader = "$outdir/HashTools.h";
+
+sub createHashToolsHeader() {
+
+open HEADER, ">$hashToolsHeader" || die "Could not open $hashToolsHeader for writing";
+print HEADER << "EOF";
+/* This file is automatically generated by make-hash-tools.pl, do not edit */
+
+#ifndef HashTools_h
+#define HashTools_h
+
+#include "wtf/Platform.h"
+
+namespace WebCore {
+
+struct PubIDInfo {
+ enum eMode {
+ eQuirks,
+ eQuirks3,
+ eAlmostStandards
+ };
+
+ const char* name;
+ eMode mode_if_no_sysid;
+ eMode mode_if_sysid;
+};
+
+struct NamedColor {
+ const char* name;
+ int RGBValue;
+};
+
+struct Property {
+ const char* name;
+ int id;
+};
+
+struct Value {
+ const char* name;
+ int id;
+};
+
+const PubIDInfo* findDoctypeEntry(register const char* str, register unsigned int len);
+const NamedColor* findColor(register const char* str, register unsigned int len);
+const Property* findProperty(register const char* str, register unsigned int len);
+const Value* findValue(register const char* str, register unsigned int len);
+}
+
+#endif // HashTools_h
+
+EOF
+close HEADER;
+
+}
+
switch ($option) {
case "DocTypeStrings" {
- my $docTypeStringsGenerated = "$outdir/DocTypeStrings.cpp";
+ createHashToolsHeader();
+
+ my $docTypeStringsImpl = "$outdir/DocTypeStrings.cpp";
+ my $docTypeStringsGenerated = "$outdir/DocTypeStringsHash.h";
my $docTypeStringsGperf = $ARGV[0];
shift;
+ open DOCTYPESTRINGS, ">$docTypeStringsImpl" || die "Could not open $docTypeStringsImpl for writing";
+ print DOCTYPESTRINGS << "EOF";
+/* This file is automatically generated by make-hash-tools.pl, do not edit */
+
+#include <string.h>
+#include "HashTools.h"
+
+namespace WebCore {
+#include "DocTypeStringsHash.h"
+
+const PubIDInfo* findDoctypeEntry (register const char* str, register unsigned int len)
+{
+ return DocTypeStringsHash::findDoctypeEntryImpl(str, len);
+}
+
+}
+
+EOF
+ close DOCTYPESTRINGS;
+
system("gperf --key-positions=\"*\" -s 2 $docTypeStringsGperf > $docTypeStringsGenerated") == 0 || die "calling gperf failed: $?";
} # case "DocTypeStrings"
case "ColorData" {
- my $colorDataGenerated = "$outdir/ColorData.cpp";
- my $colorDataGperf = $ARGV[0];
+ my $colorDataImpl = "$outdir/ColorData.cpp";
+ my $colorDataGenerated = "$outdir/ColorDataHash.h";
+ my $colorDataGperf = $ARGV[0];
shift;
+ open COLORDATA, ">$colorDataImpl" || die "Could not open $colorDataImpl for writing";
+ print COLORDATA << "EOF";
+/* This file is automatically generated by make-hash-tools.pl, do not edit */
+
+#include <string.h>
+#include "HashTools.h"
+
+namespace WebCore {
+#include "ColorDataHash.h"
+
+const struct NamedColor* findColor (register const char* str, register unsigned int len)
+{
+ return ColorDataHash::findColorImpl(str, len);
+}
+
+}
+
+EOF
+ close COLORDATA;
+
system("gperf --key-positions=\"*\" -D -s 2 $colorDataGperf > $colorDataGenerated") == 0 || die "calling gperf failed: $?";
} # case "ColorData"
diff --git a/WebCore/manual-tests/large-size-image-crash.html b/WebCore/manual-tests/large-size-image-crash.html
new file mode 100644
index 0000000..93cafa2
--- /dev/null
+++ b/WebCore/manual-tests/large-size-image-crash.html
@@ -0,0 +1,6 @@
+<html>
+ <body>
+ Displaying the animated GIF below should not result in memory corruption.
+ <img src="resources/large-size-image-crash.gif">
+ </body>
+</html>
diff --git a/WebCore/manual-tests/resources/large-size-image-crash.gif b/WebCore/manual-tests/resources/large-size-image-crash.gif
new file mode 100644
index 0000000..6da80af
--- /dev/null
+++ b/WebCore/manual-tests/resources/large-size-image-crash.gif
Binary files differ
diff --git a/WebCore/page/ChromeClient.h b/WebCore/page/ChromeClient.h
index f0aff33..c6555b9 100644
--- a/WebCore/page/ChromeClient.h
+++ b/WebCore/page/ChromeClient.h
@@ -21,6 +21,7 @@
#ifndef ChromeClient_h
#define ChromeClient_h
+#include "AXObjectCache.h"
#include "Console.h"
#include "Cursor.h"
#include "FocusDirection.h"
@@ -46,6 +47,7 @@ class NSResponder;
namespace WebCore {
+ class AccessibilityObject;
class Element;
class FileChooser;
class FloatRect;
@@ -268,9 +270,13 @@ namespace WebCore {
virtual PassRefPtr<PopupMenu> createPopupMenu(PopupMenuClient*) const = 0;
virtual PassRefPtr<SearchPopupMenu> createSearchPopupMenu(PopupMenuClient*) const = 0;
+<<<<<<< HEAD
#if ENABLE(ANDROID_INSTALLABLE_WEB_APPS)
virtual void webAppCanBeInstalled() = 0;
#endif
+=======
+ virtual void postAccessibilityNotification(AccessibilityObject*, AXObjectCache::AXNotification) { }
+>>>>>>> webkit.org at r68651
protected:
virtual ~ChromeClient() { }
diff --git a/WebCore/page/ContextMenuController.cpp b/WebCore/page/ContextMenuController.cpp
index d2317d2..de64988 100644
--- a/WebCore/page/ContextMenuController.cpp
+++ b/WebCore/page/ContextMenuController.cpp
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
+ * Copyright (C) 2010 Igalia S.L
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -186,6 +187,27 @@ void ContextMenuController::contextMenuItemSelected(ContextMenuItem* item)
// For now, call into the client. This is temporary!
frame->editor()->copyImage(result);
break;
+ case ContextMenuItemTagOpenMediaInNewWindow:
+ openNewWindow(result.absoluteMediaURL(), frame);
+ break;
+ case ContextMenuItemTagCopyMediaLinkToClipboard:
+ frame->editor()->copyURL(result.absoluteMediaURL(), result.textContent());
+ break;
+ case ContextMenuItemTagToggleMediaControls:
+ result.toggleMediaControlsDisplay();
+ break;
+ case ContextMenuItemTagToggleMediaLoop:
+ result.toggleMediaLoopPlayback();
+ break;
+ case ContextMenuItemTagEnterVideoFullscreen:
+ result.enterFullscreenForVideo();
+ break;
+ case ContextMenuItemTagMediaPlayPause:
+ result.toggleMediaPlayState();
+ break;
+ case ContextMenuItemTagMediaMute:
+ result.toggleMediaMuteState();
+ break;
case ContextMenuItemTagOpenFrameInNewWindow: {
DocumentLoader* loader = frame->loader()->documentLoader();
if (!loader->unreachableURL().isEmpty())
diff --git a/WebCore/page/DOMWindow.cpp b/WebCore/page/DOMWindow.cpp
index afd6bc7..200b82a 100644
--- a/WebCore/page/DOMWindow.cpp
+++ b/WebCore/page/DOMWindow.cpp
@@ -40,6 +40,7 @@
#include "DOMSelection.h"
#include "DOMStringList.h"
#include "DOMTimer.h"
+#include "DOMTokenList.h"
#include "Database.h"
#include "DatabaseCallback.h"
#include "DeviceMotionController.h"
@@ -93,6 +94,7 @@
#include "ErrorCallback.h"
#include "FileError.h"
#include "FileSystemCallback.h"
+#include "FileSystemCallbacks.h"
#include "LocalFileSystem.h"
#endif
@@ -727,25 +729,22 @@ void DOMWindow::requestFileSystem(int type, long long size, PassRefPtr<FileSyste
if (!document)
return;
- if (!m_localFileSystem) {
- // FIXME: See if access is allowed.
-
- Page* page = document->page();
- if (!page) {
- DOMFileSystem::scheduleCallback(document, errorCallback, FileError::create(INVALID_STATE_ERR));
- return;
- }
+ if (!AsyncFileSystem::isAvailable() || !document->securityOrigin()->canAccessFileSystem()) {
+ DOMFileSystem::scheduleCallback(document, errorCallback, FileError::create(SECURITY_ERR));
+ return;
+ }
- // FIXME: Get the quota settings as well.
- String path = page->settings()->fileSystemRootPath();
- m_localFileSystem = LocalFileSystem::create(path);
+ AsyncFileSystem::Type fileSystemType = static_cast<AsyncFileSystem::Type>(type);
+ if (fileSystemType != AsyncFileSystem::Temporary && fileSystemType != AsyncFileSystem::Persistent) {
+ DOMFileSystem::scheduleCallback(document, errorCallback, FileError::create(INVALID_MODIFICATION_ERR));
+ return;
}
- m_localFileSystem->requestFileSystem(document, static_cast<AsyncFileSystem::Type>(type), size, successCallback, errorCallback);
+ LocalFileSystem::localFileSystem().requestFileSystem(document, fileSystemType, size, FileSystemCallbacks::create(successCallback, errorCallback, document));
}
-COMPILE_ASSERT(int(DOMWindow::TEMPORARY) == int(AsyncFileSystem::Temporary), enum_mismatch);
-COMPILE_ASSERT(int(DOMWindow::PERSISTENT) == int(AsyncFileSystem::Persistent), enum_mismatch);
+COMPILE_ASSERT(static_cast<int>(DOMWindow::TEMPORARY) == static_cast<int>(AsyncFileSystem::Temporary), enum_mismatch);
+COMPILE_ASSERT(static_cast<int>(DOMWindow::PERSISTENT) == static_cast<int>(AsyncFileSystem::Persistent), enum_mismatch);
#endif
@@ -1624,7 +1623,7 @@ String DOMWindow::createBlobURL(Blob* blob)
void DOMWindow::revokeBlobURL(const String& blobURLString)
{
- scriptExecutionContext()->revokePublicBlobURL(KURL(ParsedURLString, blobURLString));
+ scriptExecutionContext()->revokePublicBlobURL(KURL(KURL(), blobURLString));
}
#endif
diff --git a/WebCore/page/DOMWindow.h b/WebCore/page/DOMWindow.h
index 1470628..6fd3775 100644
--- a/WebCore/page/DOMWindow.h
+++ b/WebCore/page/DOMWindow.h
@@ -58,7 +58,6 @@ namespace WebCore {
class History;
class IDBFactory;
class InspectorTimelineAgent;
- class LocalFileSystem;
class Location;
class StyleMedia;
class Navigator;
@@ -444,9 +443,6 @@ namespace WebCore {
#if ENABLE(INDEXED_DATABASE)
mutable RefPtr<IDBFactory> m_idbFactory;
#endif
-#if ENABLE(FILE_SYSTEM)
- RefPtr<LocalFileSystem> m_localFileSystem;
-#endif
EventTargetData m_eventTargetData;
diff --git a/WebCore/page/DOMWindow.idl b/WebCore/page/DOMWindow.idl
index 7ae948c..f7f9a85 100644
--- a/WebCore/page/DOMWindow.idl
+++ b/WebCore/page/DOMWindow.idl
@@ -380,6 +380,7 @@ module window {
// attribute DOMImplementationListConstructor DOMImplementationList;
// attribute DOMImplementationSourceConstructor DOMImplementationSource;
attribute DOMImplementationConstructor DOMImplementation;
+ attribute DOMTokenListConstructor DOMTokenList;
attribute DocumentFragmentConstructor DocumentFragment;
attribute DocumentConstructor Document;
attribute NodeConstructor Node;
diff --git a/WebCore/page/EventHandler.cpp b/WebCore/page/EventHandler.cpp
index b660918..b0c3911 100644
--- a/WebCore/page/EventHandler.cpp
+++ b/WebCore/page/EventHandler.cpp
@@ -873,7 +873,7 @@ void EventHandler::allowDHTMLDrag(bool& flagDHTML, bool& flagUA) const
HitTestResult EventHandler::hitTestResultAtPoint(const IntPoint& point, bool allowShadowContent, bool ignoreClipping, HitTestScrollbars testScrollbars, HitTestRequest::HitTestRequestType hitType, const IntSize& padding)
{
- HitTestResult result(point, padding);
+ HitTestResult result(point, padding.height(), padding.width(), padding.height(), padding.width());
if (!m_frame->contentRenderer())
return result;
if (ignoreClipping)
@@ -894,7 +894,7 @@ HitTestResult EventHandler::hitTestResultAtPoint(const IntPoint& point, bool all
FrameView* view = static_cast<FrameView*>(widget);
IntPoint widgetPoint(result.localPoint().x() + view->scrollX() - renderWidget->borderLeft() - renderWidget->paddingLeft(),
result.localPoint().y() + view->scrollY() - renderWidget->borderTop() - renderWidget->paddingTop());
- HitTestResult widgetHitTestResult(widgetPoint, padding);
+ HitTestResult widgetHitTestResult(widgetPoint, padding.height(), padding.width(), padding.height(), padding.width());
frame->contentRenderer()->layer()->hitTest(HitTestRequest(hitType), widgetHitTestResult);
result = widgetHitTestResult;
@@ -1915,7 +1915,7 @@ bool EventHandler::dispatchMouseEvent(const AtomicString& eventType, Node* targe
return swallowEvent;
}
-#if !PLATFORM(GTK) && !(PLATFORM(CHROMIUM) && OS(LINUX))
+#if !PLATFORM(GTK) && !(PLATFORM(CHROMIUM) && (OS(LINUX) || OS(FREEBSD)))
bool EventHandler::shouldTurnVerticalTicksIntoHorizontal(const HitTestResult&) const
{
return false;
diff --git a/WebCore/page/Frame.cpp b/WebCore/page/Frame.cpp
index 558f339..9817e87 100755
--- a/WebCore/page/Frame.cpp
+++ b/WebCore/page/Frame.cpp
@@ -503,8 +503,9 @@ void Frame::setPrinting(bool printing, const FloatSize& pageSize, float maximumS
m_doc->styleSelectorChanged(RecalcStyleImmediately);
view()->forceLayoutForPagination(pageSize, maximumShrinkRatio, shouldAdjustViewSize);
+ // Subframes of the one we're printing don't lay out to the page size.
for (Frame* child = tree()->firstChild(); child; child = child->tree()->nextSibling())
- child->setPrinting(printing, pageSize, maximumShrinkRatio, shouldAdjustViewSize);
+ child->setPrinting(printing, IntSize(), 0, shouldAdjustViewSize);
}
void Frame::injectUserScripts(UserScriptInjectionTime injectionTime)
@@ -720,6 +721,7 @@ void Frame::transferChildFrameToNewDocument()
// Switch page.
Page* newPage = newParent ? newParent->page() : 0;
+ Page* oldPage = m_page;
if (m_page != newPage) {
if (page()->focusController()->focusedFrame() == this)
page()->focusController()->setFocusedFrame(0);
@@ -751,7 +753,7 @@ void Frame::transferChildFrameToNewDocument()
// up on the same page and under the same parent frame.
if (didTransfer) {
// Let external clients update themselves.
- loader()->client()->didTransferChildFrameToNewDocument();
+ loader()->client()->didTransferChildFrameToNewDocument(oldPage);
// Do the same for all the children.
for (Frame* child = tree()->firstChild(); child; child = child->tree()->nextSibling())
diff --git a/WebCore/page/FrameView.cpp b/WebCore/page/FrameView.cpp
index e881c94..9a4daa7 100644
--- a/WebCore/page/FrameView.cpp
+++ b/WebCore/page/FrameView.cpp
@@ -815,7 +815,7 @@ void FrameView::layout(bool allowSubtree)
m_layoutCount++;
-#if PLATFORM(MAC)
+#if PLATFORM(MAC) || PLATFORM(CHROMIUM)
if (AXObjectCache::accessibilityEnabled())
root->document()->axObjectCache()->postNotification(root, AXObjectCache::AXLayoutComplete, true);
#endif
diff --git a/WebCore/page/Location.cpp b/WebCore/page/Location.cpp
index 5754357..c02304c 100644
--- a/WebCore/page/Location.cpp
+++ b/WebCore/page/Location.cpp
@@ -120,6 +120,15 @@ String Location::search() const
return url.query().isEmpty() ? "" : "?" + url.query();
}
+String Location::origin() const
+{
+ if (!m_frame)
+ return String();
+
+ RefPtr<SecurityOrigin> origin = SecurityOrigin::create(url());
+ return origin->toString();
+}
+
String Location::hash() const
{
if (!m_frame)
diff --git a/WebCore/page/Location.h b/WebCore/page/Location.h
index 808eff9..a4bc407 100644
--- a/WebCore/page/Location.h
+++ b/WebCore/page/Location.h
@@ -55,6 +55,7 @@ namespace WebCore {
String pathname() const;
String search() const;
String hash() const;
+ String origin() const;
String toString() const;
diff --git a/WebCore/page/Location.idl b/WebCore/page/Location.idl
index aad90ab..1668e05 100644
--- a/WebCore/page/Location.idl
+++ b/WebCore/page/Location.idl
@@ -58,6 +58,8 @@ module window {
attribute [CustomSetter] DOMString pathname;
attribute [CustomSetter] DOMString search;
attribute [CustomSetter] DOMString hash;
+
+ readonly attribute DOMString origin;
#endif
#if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT
diff --git a/WebCore/page/PageGroup.cpp b/WebCore/page/PageGroup.cpp
index 4c9403b..8b902c0 100644
--- a/WebCore/page/PageGroup.cpp
+++ b/WebCore/page/PageGroup.cpp
@@ -240,7 +240,8 @@ void PageGroup::addUserScriptToWorld(DOMWrapperWorld* world, const String& sourc
void PageGroup::addUserStyleSheetToWorld(DOMWrapperWorld* world, const String& source, const KURL& url,
PassOwnPtr<Vector<String> > whitelist, PassOwnPtr<Vector<String> > blacklist,
UserContentInjectedFrames injectedFrames,
- UserStyleSheet::Level level)
+ UserStyleLevel level,
+ UserStyleInjectionTime injectionTime)
{
ASSERT_ARG(world, world);
@@ -252,7 +253,8 @@ void PageGroup::addUserStyleSheetToWorld(DOMWrapperWorld* world, const String& s
styleSheetsInWorld = new UserStyleSheetVector;
styleSheetsInWorld->append(userStyleSheet.release());
- resetUserStyleCacheInAllFrames();
+ if (injectionTime == InjectInExistingDocuments)
+ resetUserStyleCacheInAllFrames();
}
void PageGroup::removeUserScriptFromWorld(DOMWrapperWorld* world, const KURL& url)
@@ -358,14 +360,12 @@ void PageGroup::removeAllUserContent()
void PageGroup::resetUserStyleCacheInAllFrames()
{
-#if !PLATFORM(CHROMIUM)
// Clear our cached sheets and have them just reparse.
HashSet<Page*>::const_iterator end = m_pages.end();
for (HashSet<Page*>::const_iterator it = m_pages.begin(); it != end; ++it) {
for (Frame* frame = (*it)->mainFrame(); frame; frame = frame->tree()->traverseNext())
frame->document()->updatePageGroupUserSheets();
}
-#endif
}
} // namespace WebCore
diff --git a/WebCore/page/PageGroup.h b/WebCore/page/PageGroup.h
index fcad773..cc47fba 100644
--- a/WebCore/page/PageGroup.h
+++ b/WebCore/page/PageGroup.h
@@ -83,8 +83,8 @@ namespace WebCore {
void addUserStyleSheetToWorld(DOMWrapperWorld*, const String& source, const KURL&,
PassOwnPtr<Vector<String> > whitelist, PassOwnPtr<Vector<String> > blacklist,
UserContentInjectedFrames,
- UserStyleSheet::Level level = UserStyleSheet::UserLevel);
-
+ UserStyleLevel level = UserStyleUserLevel,
+ UserStyleInjectionTime injectionTime = InjectInExistingDocuments);
void removeUserScriptFromWorld(DOMWrapperWorld*, const KURL&);
void removeUserStyleSheetFromWorld(DOMWrapperWorld*, const KURL&);
diff --git a/WebCore/page/SecurityOrigin.h b/WebCore/page/SecurityOrigin.h
index 4789d3c..2a63966 100644
--- a/WebCore/page/SecurityOrigin.h
+++ b/WebCore/page/SecurityOrigin.h
@@ -121,6 +121,7 @@ public:
bool canAccessLocalStorage() const { return !isUnique(); }
bool canAccessCookies() const { return !isUnique(); }
bool canAccessPasswordManager() const { return !isUnique(); }
+ bool canAccessFileSystem() const { return !isUnique(); }
// Technically, we should always allow access to sessionStorage, but we
// currently don't handle creating a sessionStorage area for unique
diff --git a/WebCore/page/Settings.cpp b/WebCore/page/Settings.cpp
index faa7140..2e67bf1 100644
--- a/WebCore/page/Settings.cpp
+++ b/WebCore/page/Settings.cpp
@@ -159,12 +159,16 @@ Settings::Settings(Page* page)
, m_memoryInfoEnabled(false)
, m_interactiveFormValidation(false)
, m_usePreHTML5ParserQuirks(false)
+<<<<<<< HEAD
#if ENABLE(WEB_AUTOFILL)
, m_autoFillEnabled(false)
#endif
#ifdef ANDROID_PLUGINS
, m_pluginsOnDemand(false)
#endif
+=======
+ , m_hyperlinkAuditingEnabled(false)
+>>>>>>> webkit.org at r68651
{
// A Frame may not have been created yet, so we initialize the AtomicString
// hash before trying to use it.
@@ -699,11 +703,6 @@ void Settings::setLocalStorageDatabasePath(const String& path)
m_localStorageDatabasePath = path;
}
-void Settings::setFileSystemRootPath(const String& path)
-{
- m_fileSystemRootPath = path;
-}
-
void Settings::setApplicationChromeMode(bool mode)
{
m_inApplicationChromeMode = mode;
diff --git a/WebCore/page/Settings.h b/WebCore/page/Settings.h
index b0a964d..7a65eaa 100644
--- a/WebCore/page/Settings.h
+++ b/WebCore/page/Settings.h
@@ -228,7 +228,7 @@ namespace WebCore {
void setDOMPasteAllowed(bool);
bool isDOMPasteAllowed() const { return m_isDOMPasteAllowed; }
- void setMinDOMTimerInterval(double); // Interval specified in seconds.
+ static void setMinDOMTimerInterval(double); // Interval specified in seconds.
void setUsesPageCache(bool);
bool usesPageCache() const { return m_usesPageCache; }
@@ -309,9 +309,6 @@ namespace WebCore {
void setLocalStorageDatabasePath(const String&);
const String& localStorageDatabasePath() const { return m_localStorageDatabasePath; }
- void setFileSystemRootPath(const String&);
- const String& fileSystemRootPath() const { return m_fileSystemRootPath; }
-
void setApplicationChromeMode(bool);
bool inApplicationChromeMode() const { return m_inApplicationChromeMode; }
@@ -398,10 +395,15 @@ namespace WebCore {
void setUsePreHTML5ParserQuirks(bool flag) { m_usePreHTML5ParserQuirks = flag; }
bool usePreHTML5ParserQuirks() const { return m_usePreHTML5ParserQuirks; }
+<<<<<<< HEAD
#if ENABLE(WEB_AUTOFILL)
void setAutoFillEnabled(bool flag) { m_autoFillEnabled = flag; }
bool autoFillEnabled() { return m_autoFillEnabled; }
#endif
+=======
+ void setHyperlinkAuditingEnabled(bool flag) { m_hyperlinkAuditingEnabled = flag; }
+ bool hyperlinkAuditingEnabled() const { return m_hyperlinkAuditingEnabled; }
+>>>>>>> webkit.org at r68651
private:
Page* m_page;
@@ -409,7 +411,6 @@ namespace WebCore {
String m_defaultTextEncodingName;
String m_ftpDirectoryTemplatePath;
String m_localStorageDatabasePath;
- String m_fileSystemRootPath;
KURL m_userStyleSheetLocation;
AtomicString m_standardFontFamily;
AtomicString m_fixedFontFamily;
@@ -528,12 +529,16 @@ namespace WebCore {
bool m_memoryInfoEnabled: 1;
bool m_interactiveFormValidation: 1;
bool m_usePreHTML5ParserQuirks: 1;
+<<<<<<< HEAD
#ifdef ANDROID_PLUGINS
bool m_pluginsOnDemand : 1;
#endif
#if ENABLE(WEB_AUTOFILL)
bool m_autoFillEnabled: 1;
#endif
+=======
+ bool m_hyperlinkAuditingEnabled : 1;
+>>>>>>> webkit.org at r68651
#if USE(SAFARI_THEME)
static bool gShouldPaintNativeControls;
diff --git a/WebCore/page/UserStyleSheet.h b/WebCore/page/UserStyleSheet.h
index 1acd296..fa42e2c 100644
--- a/WebCore/page/UserStyleSheet.h
+++ b/WebCore/page/UserStyleSheet.h
@@ -37,14 +37,9 @@ namespace WebCore {
class UserStyleSheet : public Noncopyable {
public:
- enum Level {
- UserLevel,
- AuthorLevel
- };
-
UserStyleSheet(const String& source, const KURL& url,
PassOwnPtr<Vector<String> > whitelist, PassOwnPtr<Vector<String> > blacklist,
- UserContentInjectedFrames injectedFrames, Level level)
+ UserContentInjectedFrames injectedFrames, UserStyleLevel level)
: m_source(source)
, m_url(url)
, m_whitelist(whitelist)
@@ -59,7 +54,7 @@ public:
const Vector<String>* whitelist() const { return m_whitelist.get(); }
const Vector<String>* blacklist() const { return m_blacklist.get(); }
UserContentInjectedFrames injectedFrames() const { return m_injectedFrames; }
- Level level() const { return m_level; }
+ UserStyleLevel level() const { return m_level; }
private:
String m_source;
@@ -67,7 +62,7 @@ private:
OwnPtr<Vector<String> > m_whitelist;
OwnPtr<Vector<String> > m_blacklist;
UserContentInjectedFrames m_injectedFrames;
- Level m_level;
+ UserStyleLevel m_level;
};
} // namespace WebCore
diff --git a/WebCore/page/UserStyleSheetTypes.h b/WebCore/page/UserStyleSheetTypes.h
index ef662f2..eda6604 100644
--- a/WebCore/page/UserStyleSheetTypes.h
+++ b/WebCore/page/UserStyleSheetTypes.h
@@ -31,6 +31,9 @@
namespace WebCore {
+enum UserStyleInjectionTime { InjectInExistingDocuments, InjectInSubsequentDocuments };
+enum UserStyleLevel { UserStyleUserLevel, UserStyleAuthorLevel };
+
class DOMWrapperWorld;
class UserStyleSheet;
diff --git a/WebCore/page/animation/ImplicitAnimation.cpp b/WebCore/page/animation/ImplicitAnimation.cpp
index da0a810..34607f6 100644
--- a/WebCore/page/animation/ImplicitAnimation.cpp
+++ b/WebCore/page/animation/ImplicitAnimation.cpp
@@ -120,6 +120,25 @@ bool ImplicitAnimation::startAnimation(double timeOffset)
return false;
}
+void ImplicitAnimation::pauseAnimation(double timeOffset)
+{
+ if (!m_object)
+ return;
+
+#if USE(ACCELERATED_COMPOSITING)
+ if (m_object->hasLayer()) {
+ RenderLayer* layer = toRenderBoxModelObject(m_object)->layer();
+ if (layer->isComposited())
+ layer->backing()->transitionPaused(timeOffset, m_animatingProperty);
+ }
+#else
+ UNUSED_PARAM(timeOffset);
+#endif
+ // Restore the original (unanimated) style
+ if (!paused())
+ setNeedsStyleRecalc(m_object->node());
+}
+
void ImplicitAnimation::endAnimation()
{
#if USE(ACCELERATED_COMPOSITING)
diff --git a/WebCore/page/animation/ImplicitAnimation.h b/WebCore/page/animation/ImplicitAnimation.h
index be5c197..c40c00a 100644
--- a/WebCore/page/animation/ImplicitAnimation.h
+++ b/WebCore/page/animation/ImplicitAnimation.h
@@ -48,7 +48,7 @@ public:
virtual void onAnimationEnd(double elapsedTime);
virtual bool startAnimation(double timeOffset);
- virtual void pauseAnimation(double /*timeOffset*/) { }
+ virtual void pauseAnimation(double /*timeOffset*/);
virtual void endAnimation();
virtual void animate(CompositeAnimation*, RenderObject*, const RenderStyle* currentStyle, RenderStyle* targetStyle, RefPtr<RenderStyle>& animatedStyle);
diff --git a/WebCore/page/chromium/ChromeClientChromium.h b/WebCore/page/chromium/ChromeClientChromium.h
index 44e005f..02e2a94 100644
--- a/WebCore/page/chromium/ChromeClientChromium.h
+++ b/WebCore/page/chromium/ChromeClientChromium.h
@@ -31,12 +31,10 @@
#ifndef ChromeClientChromium_h
#define ChromeClientChromium_h
-#include "AXObjectCache.h"
#include "ChromeClient.h"
#include <wtf/Forward.h>
namespace WebCore {
-class AccessibilityObject;
class IntRect;
class PopupContainer;
@@ -53,15 +51,6 @@ public:
// Notifies the client a popup was closed.
virtual void popupClosed(PopupContainer* popupContainer) = 0;
-
- // Notifies embedder that the state of an accessibility object has changed.
- virtual void didChangeAccessibilityObjectState(AccessibilityObject*) = 0;
-
- // Notified embedder that the children of an accessibility object has changed.
- virtual void didChangeAccessibilityObjectChildren(AccessibilityObject*) = 0;
-
- // Notifies embedder about an accessibility notification.
- virtual void postAccessibilityNotification(AccessibilityObject*, AXObjectCache::AXNotification) = 0;
};
} // namespace WebCore
diff --git a/WebCore/page/chromium/EventHandlerChromium.cpp b/WebCore/page/chromium/EventHandlerChromium.cpp
index dd6cf99..6bf907e 100644
--- a/WebCore/page/chromium/EventHandlerChromium.cpp
+++ b/WebCore/page/chromium/EventHandlerChromium.cpp
@@ -129,7 +129,7 @@ bool EventHandler::eventActivatedView(const PlatformMouseEvent& event) const
PassRefPtr<Clipboard> EventHandler::createDraggingClipboard() const
{
RefPtr<ChromiumDataObject> dataObject = ChromiumDataObject::create();
- return ClipboardChromium::create(true, dataObject.get(), ClipboardWritable, m_frame);
+ return ClipboardChromium::create(Clipboard::DragAndDrop, dataObject.get(), ClipboardWritable, m_frame);
}
void EventHandler::focusDocumentView()
@@ -154,7 +154,7 @@ unsigned EventHandler::accessKeyModifiers()
#endif
}
-#if OS(LINUX)
+#if OS(LINUX) || OS(FREEBSD)
// GTK+ must scroll horizontally if the mouse pointer is on top of the
// horizontal scrollbar while scrolling with the wheel.
// This code comes from gtk/EventHandlerGtk.cpp.
diff --git a/WebCore/page/efl/EventHandlerEfl.cpp b/WebCore/page/efl/EventHandlerEfl.cpp
index acf4343..33db17e 100644
--- a/WebCore/page/efl/EventHandlerEfl.cpp
+++ b/WebCore/page/efl/EventHandlerEfl.cpp
@@ -110,7 +110,7 @@ bool EventHandler::passWheelEventToWidget(PlatformWheelEvent& event, Widget* wid
PassRefPtr<Clipboard> EventHandler::createDraggingClipboard() const
{
- return ClipboardEfl::create(ClipboardWritable, true);
+ return ClipboardEfl::create(ClipboardWritable, Clipboard::DragAndDrop);
}
bool EventHandler::passMousePressEventToSubframe(MouseEventWithHitTestResults& mev, Frame* subframe)
diff --git a/WebCore/page/gtk/EventHandlerGtk.cpp b/WebCore/page/gtk/EventHandlerGtk.cpp
index 429aea6..6e69d9f 100644
--- a/WebCore/page/gtk/EventHandlerGtk.cpp
+++ b/WebCore/page/gtk/EventHandlerGtk.cpp
@@ -96,7 +96,7 @@ bool EventHandler::passWheelEventToWidget(PlatformWheelEvent& event, Widget* wid
PassRefPtr<Clipboard> EventHandler::createDraggingClipboard() const
{
- return ClipboardGtk::create(ClipboardWritable, DataObjectGtk::create(), true, m_frame);
+ return ClipboardGtk::create(ClipboardWritable, DataObjectGtk::create(), Clipboard::DragAndDrop, m_frame);
}
bool EventHandler::passMousePressEventToSubframe(MouseEventWithHitTestResults& mev, Frame* subframe)
diff --git a/WebCore/page/haiku/EventHandlerHaiku.cpp b/WebCore/page/haiku/EventHandlerHaiku.cpp
index 450414d..933921a 100644
--- a/WebCore/page/haiku/EventHandlerHaiku.cpp
+++ b/WebCore/page/haiku/EventHandlerHaiku.cpp
@@ -122,7 +122,7 @@ bool EventHandler::passWheelEventToWidget(PlatformWheelEvent& event, Widget* wid
PassRefPtr<Clipboard> EventHandler::createDraggingClipboard() const
{
- return ClipboardHaiku::create(ClipboardWritable, true);
+ return ClipboardHaiku::create(ClipboardWritable, Clipboard::DragAndDrop);
}
bool EventHandler::passMousePressEventToSubframe(MouseEventWithHitTestResults& mev, Frame* subframe)
diff --git a/WebCore/page/mac/EventHandlerMac.mm b/WebCore/page/mac/EventHandlerMac.mm
index 584f38f..2db713f 100644
--- a/WebCore/page/mac/EventHandlerMac.mm
+++ b/WebCore/page/mac/EventHandlerMac.mm
@@ -712,7 +712,7 @@ PassRefPtr<Clipboard> EventHandler::createDraggingClipboard() const
// Must be done before ondragstart adds types and data to the pboard,
// also done for security, as it erases data from the last drag
[pasteboard declareTypes:[NSArray array] owner:nil];
- return ClipboardMac::create(true, pasteboard, ClipboardWritable, m_frame);
+ return ClipboardMac::create(Clipboard::DragAndDrop, pasteboard, ClipboardWritable, m_frame);
}
#endif
diff --git a/WebCore/page/qt/EventHandlerQt.cpp b/WebCore/page/qt/EventHandlerQt.cpp
index 18d9b73..2c658e7 100644
--- a/WebCore/page/qt/EventHandlerQt.cpp
+++ b/WebCore/page/qt/EventHandlerQt.cpp
@@ -113,7 +113,7 @@ bool EventHandler::passWheelEventToWidget(PlatformWheelEvent& event, Widget* wid
PassRefPtr<Clipboard> EventHandler::createDraggingClipboard() const
{
- return ClipboardQt::create(ClipboardWritable, true);
+ return ClipboardQt::create(ClipboardWritable, Clipboard::DragAndDrop);
}
bool EventHandler::passMousePressEventToSubframe(MouseEventWithHitTestResults& mev, Frame* subframe)
diff --git a/WebCore/page/win/EventHandlerWin.cpp b/WebCore/page/win/EventHandlerWin.cpp
index ee4b360..a1c15c5 100644
--- a/WebCore/page/win/EventHandlerWin.cpp
+++ b/WebCore/page/win/EventHandlerWin.cpp
@@ -98,7 +98,7 @@ PassRefPtr<Clipboard> EventHandler::createDraggingClipboard() const
#else
COMPtr<WCDataObject> dataObject;
WCDataObject::createInstance(&dataObject);
- return ClipboardWin::create(true, dataObject.get(), ClipboardWritable, m_frame);
+ return ClipboardWin::create(Clipboard::DragAndDrop, dataObject.get(), ClipboardWritable, m_frame);
#endif
}
diff --git a/WebCore/page/wince/FrameWinCE.cpp b/WebCore/page/wince/FrameWinCE.cpp
index dfea864..9eb487b 100644
--- a/WebCore/page/wince/FrameWinCE.cpp
+++ b/WebCore/page/wince/FrameWinCE.cpp
@@ -129,11 +129,11 @@ HBITMAP imageFromSelection(Frame* frame, bool forceBlackText)
}
OwnPtr<HDC> bmpDC(CreateCompatibleDC(g_screenDC));
- HBITMAP hBmp = MemoryManager::createCompatibleBitmap(g_screenDC, w, h);
+ HBITMAP hBmp = CreateCompatibleBitmap(g_screenDC, w, h);
if (!hBmp)
return 0;
- HBITMAP hbmpOld = (HBITMAP)SelectObject(bmpDC.get(), hBmp);
+ HGDIOBJ hbmpOld = SelectObject(bmpDC.get(), hBmp);
{
GraphicsContext gc(bmpDC.get());
diff --git a/WebCore/page/wx/EventHandlerWx.cpp b/WebCore/page/wx/EventHandlerWx.cpp
index f4f6914..fbb1eaa 100644
--- a/WebCore/page/wx/EventHandlerWx.cpp
+++ b/WebCore/page/wx/EventHandlerWx.cpp
@@ -116,7 +116,7 @@ bool EventHandler::eventActivatedView(const PlatformMouseEvent&) const
PassRefPtr<Clipboard> EventHandler::createDraggingClipboard() const
{
- return ClipboardWx::create(ClipboardWritable, true);
+ return ClipboardWx::create(ClipboardWritable, Clipboard::DragAndDrop);
}
unsigned EventHandler::accessKeyModifiers()
diff --git a/WebCore/platform/AsyncFileSystem.cpp b/WebCore/platform/AsyncFileSystem.cpp
index b4fcd0d..57305ff 100644
--- a/WebCore/platform/AsyncFileSystem.cpp
+++ b/WebCore/platform/AsyncFileSystem.cpp
@@ -35,12 +35,20 @@
#include "AsyncFileSystemCallbacks.h"
#include "FileSystem.h"
+#include "NotImplemented.h"
namespace WebCore {
+#if !PLATFORM(CHROMIUM)
+bool AsyncFileSystem::isAvailable()
+{
+ notImplemented();
+ return false;
+}
+
PassOwnPtr<AsyncFileSystem> AsyncFileSystem::create(const String&)
{
- // FIXME: return default AsyncFileSystem implementation.
+ notImplemented();
return 0;
}
@@ -62,6 +70,7 @@ void AsyncFileSystem::openFileSystem(const String& basePath, const String& stora
callbacks->didOpenFileSystem(name, AsyncFileSystem::create(rootPath));
}
+#endif
// Default implementation.
String AsyncFileSystem::virtualToPlatformPath(const String& path) const
diff --git a/WebCore/platform/AsyncFileSystem.h b/WebCore/platform/AsyncFileSystem.h
index 601f0ea..1bf7580 100644
--- a/WebCore/platform/AsyncFileSystem.h
+++ b/WebCore/platform/AsyncFileSystem.h
@@ -41,6 +41,7 @@ namespace WebCore {
class AsyncFileSystem;
class AsyncFileSystemCallbacks;
+class AsyncFileWriterClient;
// This class provides async interface for platform-specific file system implementation. Note that all the methods take platform paths.
class AsyncFileSystem : public Noncopyable {
@@ -56,6 +57,8 @@ public:
virtual void stop() { }
virtual bool hasPendingActivity() { return false; }
+ static bool isAvailable();
+
// Creates and returns a new platform-specific AsyncFileSystem instance if the platform has its own implementation.
static PassOwnPtr<AsyncFileSystem> create(const String& rootPath);
@@ -107,6 +110,11 @@ public:
// AsyncFileSystemCallbacks::didFail() is when there is an error.
virtual void readDirectory(const String& 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;
+
// Converts a given absolute virtual path to a platform path that starts with the platform root path of this file system.
virtual String virtualToPlatformPath(const String& path) const;
diff --git a/WebCore/platform/AsyncFileSystemCallbacks.h b/WebCore/platform/AsyncFileSystemCallbacks.h
index 0547fad..451aead 100644
--- a/WebCore/platform/AsyncFileSystemCallbacks.h
+++ b/WebCore/platform/AsyncFileSystemCallbacks.h
@@ -38,6 +38,7 @@
namespace WebCore {
class AsyncFileSystem;
+class AsyncFileWriter;
class AsyncFileSystemCallbacks : public Noncopyable {
public:
@@ -56,6 +57,9 @@ public:
// Called after a chunk of directory entries have been read (i.e. indicates it's good time to call back to the application). If hasMore is true there can be more chunks.
virtual void didReadDirectoryEntries(bool hasMore) = 0;
+ // Called when an AsyncFileWrter has been created successfully.
+ virtual void didCreateFileWriter(PassOwnPtr<AsyncFileWriter> writer, long long length) = 0;
+
// Called when there was an error.
virtual void didFail(int code) = 0;
diff --git a/WebCore/platform/ColorData.gperf b/WebCore/platform/ColorData.gperf
index 11ef798..dd726cc 100644
--- a/WebCore/platform/ColorData.gperf
+++ b/WebCore/platform/ColorData.gperf
@@ -1,15 +1,13 @@
%struct-type
-struct NamedColor {
- const char *name;
- int RGBValue;
-};
-%language=ANSI-C
+struct NamedColor;
+%omit-struct-type
+%language=C++
%readonly-tables
%global-table
%compare-strncmp
-%define lookup-function-name findColor
+%define class-name ColorDataHash
+%define lookup-function-name findColorImpl
%define hash-function-name colordata_hash_function
-%includes
%enum
%%
aliceblue, 0xf0f8ff
diff --git a/WebCore/platform/ContextMenu.cpp b/WebCore/platform/ContextMenu.cpp
index 37d4c2b..ca1f719 100644
--- a/WebCore/platform/ContextMenu.cpp
+++ b/WebCore/platform/ContextMenu.cpp
@@ -1,6 +1,7 @@
/*
* Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
* Copyright (C) 2008 Christian Dywan <christian@imendio.com>
+ * Copyright (C) 2010 Igalia S.L
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -282,6 +283,19 @@ void ContextMenu::populate()
contextMenuItemTagDownloadImageToDisk());
ContextMenuItem CopyImageItem(ActionType, ContextMenuItemTagCopyImageToClipboard,
contextMenuItemTagCopyImageToClipboard());
+ ContextMenuItem OpenMediaInNewWindowItem(ActionType, ContextMenuItemTagOpenMediaInNewWindow, String());
+ ContextMenuItem CopyMediaLinkItem(ActionType, ContextMenuItemTagCopyMediaLinkToClipboard,
+ String());
+ ContextMenuItem MediaPlayPause(ActionType, ContextMenuItemTagMediaPlayPause,
+ contextMenuItemTagMediaPlay());
+ ContextMenuItem MediaMute(ActionType, ContextMenuItemTagMediaMute,
+ contextMenuItemTagMediaMute());
+ ContextMenuItem ToggleMediaControls(CheckableActionType, ContextMenuItemTagToggleMediaControls,
+ contextMenuItemTagToggleMediaControls());
+ ContextMenuItem ToggleMediaLoop(CheckableActionType, ContextMenuItemTagToggleMediaLoop,
+ contextMenuItemTagToggleMediaLoop());
+ ContextMenuItem EnterVideoFullscreen(ActionType, ContextMenuItemTagEnterVideoFullscreen,
+ contextMenuItemTagEnterVideoFullscreen());
#if PLATFORM(MAC)
ContextMenuItem SearchSpotlightItem(ActionType, ContextMenuItemTagSearchInSpotlight,
contextMenuItemTagSearchInSpotlight());
@@ -349,7 +363,23 @@ void ContextMenu::populate()
appendItem(CopyImageItem);
}
- if (imageURL.isEmpty() && linkURL.isEmpty()) {
+ KURL mediaURL = result.absoluteMediaURL();
+ if (!mediaURL.isEmpty()) {
+ if (!linkURL.isEmpty() || !imageURL.isEmpty())
+ appendItem(*separatorItem());
+
+ appendItem(MediaPlayPause);
+ appendItem(MediaMute);
+ appendItem(ToggleMediaControls);
+ appendItem(ToggleMediaLoop);
+ appendItem(EnterVideoFullscreen);
+
+ appendItem(*separatorItem());
+ appendItem(CopyMediaLinkItem);
+ appendItem(OpenMediaInNewWindowItem);
+ }
+
+ if (imageURL.isEmpty() && linkURL.isEmpty() && mediaURL.isEmpty()) {
if (result.isSelected()) {
if (selectionContainsPossibleWord(frame)) {
#if PLATFORM(MAC)
@@ -375,12 +405,6 @@ void ContextMenu::populate()
#if ENABLE(INSPECTOR)
if (!(frame->page() && frame->page()->inspectorController()->hasInspectorFrontendClient())) {
#endif
-#if PLATFORM(GTK)
- appendItem(BackItem);
- appendItem(ForwardItem);
- appendItem(StopItem);
- appendItem(ReloadItem);
-#else
if (frame->page() && frame->page()->canGoBackOrForward(-1))
appendItem(BackItem);
@@ -393,7 +417,6 @@ void ContextMenu::populate()
appendItem(StopItem);
else
appendItem(ReloadItem);
-#endif
#if ENABLE(INSPECTOR)
}
#endif
@@ -788,6 +811,28 @@ void ContextMenu::checkOrEnableIfNeeded(ContextMenuItem& item) const
case ContextMenuItemTagOpenImageInNewWindow:
case ContextMenuItemTagDownloadImageToDisk:
case ContextMenuItemTagCopyImageToClipboard:
+ break;
+ case ContextMenuItemTagOpenMediaInNewWindow:
+ if (m_hitTestResult.mediaIsVideo())
+ item.setTitle(contextMenuItemTagOpenVideoInNewWindow());
+ else
+ item.setTitle(contextMenuItemTagOpenAudioInNewWindow());
+ break;
+ case ContextMenuItemTagCopyMediaLinkToClipboard:
+ if (m_hitTestResult.mediaIsVideo())
+ item.setTitle(contextMenuItemTagCopyVideoLinkToClipboard());
+ else
+ item.setTitle(contextMenuItemTagCopyAudioLinkToClipboard());
+ break;
+ case ContextMenuItemTagToggleMediaControls:
+ shouldCheck = m_hitTestResult.mediaControlsEnabled();
+ break;
+ case ContextMenuItemTagToggleMediaLoop:
+ shouldCheck = m_hitTestResult.mediaLoopEnabled();
+ break;
+ case ContextMenuItemTagEnterVideoFullscreen:
+ shouldEnable = m_hitTestResult.mediaSupportsFullscreen();
+ break;
case ContextMenuItemTagOpenFrameInNewWindow:
case ContextMenuItemTagSpellingGuess:
case ContextMenuItemTagOther:
@@ -823,6 +868,16 @@ void ContextMenu::checkOrEnableIfNeeded(ContextMenuItem& item) const
case ContextMenuItemLastCustomTag:
case ContextMenuItemBaseApplicationTag:
break;
+ case ContextMenuItemTagMediaPlayPause:
+ if (m_hitTestResult.mediaPlaying())
+ item.setTitle(contextMenuItemTagMediaPause());
+ else
+ item.setTitle(contextMenuItemTagMediaPlay());
+ break;
+ case ContextMenuItemTagMediaMute:
+ shouldEnable = m_hitTestResult.mediaHasAudio();
+ shouldCheck = shouldEnable && m_hitTestResult.mediaMuted();
+ break;
}
item.setChecked(shouldCheck);
diff --git a/WebCore/platform/ContextMenuItem.h b/WebCore/platform/ContextMenuItem.h
index 3731e24..ee9d2a3 100644
--- a/WebCore/platform/ContextMenuItem.h
+++ b/WebCore/platform/ContextMenuItem.h
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2006 Apple Computer, Inc. All rights reserved.
+ * Copyright (C) 2010 Igalia S.L
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -143,6 +144,13 @@ namespace WebCore {
ContextMenuItemTagCapitalize,
ContextMenuItemTagChangeBack,
#endif
+ ContextMenuItemTagOpenMediaInNewWindow,
+ ContextMenuItemTagCopyMediaLinkToClipboard,
+ ContextMenuItemTagToggleMediaControls,
+ ContextMenuItemTagToggleMediaLoop,
+ ContextMenuItemTagEnterVideoFullscreen,
+ ContextMenuItemTagMediaPlayPause,
+ ContextMenuItemTagMediaMute,
ContextMenuItemBaseCustomTag = 5000,
ContextMenuItemCustomTagNoAction = 5998,
ContextMenuItemLastCustomTag = 5999,
diff --git a/WebCore/platform/Cursor.cpp b/WebCore/platform/Cursor.cpp
index 3f17ad9..dac5c24 100644
--- a/WebCore/platform/Cursor.cpp
+++ b/WebCore/platform/Cursor.cpp
@@ -253,12 +253,16 @@ Cursor::Cursor(Type type)
{
}
+#if !PLATFORM(MAC)
+
PlatformCursor Cursor::platformCursor() const
{
ensurePlatformCursor();
return m_platformCursor;
}
+#endif
+
const Cursor& pointerCursor()
{
DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::Pointer));
diff --git a/WebCore/platform/Cursor.h b/WebCore/platform/Cursor.h
index 92d3596..a962bbb 100644
--- a/WebCore/platform/Cursor.h
+++ b/WebCore/platform/Cursor.h
@@ -35,6 +35,8 @@ typedef struct HICON__* HICON;
typedef HICON HCURSOR;
#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
+#elif PLATFORM(MAC)
+#include <wtf/RetainPtr.h>
#elif PLATFORM(GTK)
#include "GRefPtrGtk.h"
#elif PLATFORM(QT)
@@ -82,7 +84,7 @@ namespace WebCore {
};
typedef RefPtr<SharedCursor> PlatformCursor;
#elif PLATFORM(MAC)
- typedef NSCursor* PlatformCursor;
+ typedef NSCursor *PlatformCursor;
#elif PLATFORM(GTK)
typedef PlatformRefPtr<GdkCursor> PlatformCursor;
#elif PLATFORM(EFL)
@@ -183,7 +185,11 @@ namespace WebCore {
IntPoint m_hotSpot;
#endif
+#if !PLATFORM(MAC)
mutable PlatformCursor m_platformCursor;
+#else
+ mutable RetainPtr<NSCursor> m_platformCursor;
+#endif
};
IntPoint determineHotSpot(Image*, const IntPoint& specifiedHotSpot);
diff --git a/WebCore/platform/LocalizationStrategy.h b/WebCore/platform/LocalizationStrategy.h
index 178cfa2..1fe138a 100644
--- a/WebCore/platform/LocalizationStrategy.h
+++ b/WebCore/platform/LocalizationStrategy.h
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2010 Apple Inc. All rights reserved.
+ * Copyright (C) 2010 Igalia S.L
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -112,6 +113,16 @@ public:
virtual String contextMenuItemTagCapitalize() = 0;
virtual String contextMenuItemTagChangeBack(const String& replacedString) = 0;
#endif
+ virtual String contextMenuItemTagOpenVideoInNewWindow() = 0;
+ virtual String contextMenuItemTagOpenAudioInNewWindow() = 0;
+ virtual String contextMenuItemTagCopyVideoLinkToClipboard() = 0;
+ virtual String contextMenuItemTagCopyAudioLinkToClipboard() = 0;
+ virtual String contextMenuItemTagToggleMediaControls() = 0;
+ virtual String contextMenuItemTagToggleMediaLoop() = 0;
+ virtual String contextMenuItemTagEnterVideoFullscreen() = 0;
+ virtual String contextMenuItemTagMediaPlay() = 0;
+ virtual String contextMenuItemTagMediaPause() = 0;
+ virtual String contextMenuItemTagMediaMute() = 0;
virtual String contextMenuItemTagInspectElement() = 0;
#endif // ENABLE(CONTEXT_MENUS)
diff --git a/WebCore/platform/LocalizedStrings.cpp b/WebCore/platform/LocalizedStrings.cpp
index a69e0fb..012d90e 100644
--- a/WebCore/platform/LocalizedStrings.cpp
+++ b/WebCore/platform/LocalizedStrings.cpp
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2003, 2006, 2009, 2010 Apple Inc. All rights reserved.
+ * Copyright (C) 2010 Igalia S.L
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -362,6 +363,56 @@ String contextMenuItemTagChangeBack(const String& replacedString)
}
#endif // PLATFORM(MAC)
+
+String contextMenuItemTagOpenVideoInNewWindow()
+{
+ return platformStrategies()->localizationStrategy()->contextMenuItemTagOpenVideoInNewWindow();
+}
+
+String contextMenuItemTagOpenAudioInNewWindow()
+{
+ return platformStrategies()->localizationStrategy()->contextMenuItemTagOpenAudioInNewWindow();
+}
+
+String contextMenuItemTagCopyVideoLinkToClipboard()
+{
+ return platformStrategies()->localizationStrategy()->contextMenuItemTagCopyVideoLinkToClipboard();
+}
+
+String contextMenuItemTagCopyAudioLinkToClipboard()
+{
+ return platformStrategies()->localizationStrategy()->contextMenuItemTagCopyAudioLinkToClipboard();
+}
+
+String contextMenuItemTagToggleMediaControls()
+{
+ return platformStrategies()->localizationStrategy()->contextMenuItemTagToggleMediaControls();
+}
+
+String contextMenuItemTagToggleMediaLoop()
+{
+ return platformStrategies()->localizationStrategy()->contextMenuItemTagToggleMediaLoop();
+}
+
+String contextMenuItemTagEnterVideoFullscreen()
+{
+ return platformStrategies()->localizationStrategy()->contextMenuItemTagEnterVideoFullscreen();
+}
+
+String contextMenuItemTagMediaPlay()
+{
+ return platformStrategies()->localizationStrategy()->contextMenuItemTagMediaPlay();
+}
+
+String contextMenuItemTagMediaPause()
+{
+ return platformStrategies()->localizationStrategy()->contextMenuItemTagMediaPause();
+}
+
+String contextMenuItemTagMediaMute()
+{
+ return platformStrategies()->localizationStrategy()->contextMenuItemTagMediaMute();
+}
String contextMenuItemTagInspectElement()
{
diff --git a/WebCore/platform/LocalizedStrings.h b/WebCore/platform/LocalizedStrings.h
index 04042b6..a72eb8a 100644
--- a/WebCore/platform/LocalizedStrings.h
+++ b/WebCore/platform/LocalizedStrings.h
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2003, 2006, 2009 Apple Computer, Inc. All rights reserved.
+ * Copyright (C) 2010 Igalia S.L
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -108,6 +109,16 @@ namespace WebCore {
String contextMenuItemTagCapitalize();
String contextMenuItemTagChangeBack(const String& replacedString);
#endif
+ String contextMenuItemTagOpenVideoInNewWindow();
+ String contextMenuItemTagOpenAudioInNewWindow();
+ String contextMenuItemTagCopyVideoLinkToClipboard();
+ String contextMenuItemTagCopyAudioLinkToClipboard();
+ String contextMenuItemTagToggleMediaControls();
+ String contextMenuItemTagToggleMediaLoop();
+ String contextMenuItemTagEnterVideoFullscreen();
+ String contextMenuItemTagMediaPlay();
+ String contextMenuItemTagMediaPause();
+ String contextMenuItemTagMediaMute();
String contextMenuItemTagInspectElement();
#endif // ENABLE(CONTEXT_MENUS)
diff --git a/WebCore/platform/PlatformTouchEvent.h b/WebCore/platform/PlatformTouchEvent.h
index 19cb8e9..f8d503d 100644
--- a/WebCore/platform/PlatformTouchEvent.h
+++ b/WebCore/platform/PlatformTouchEvent.h
@@ -35,6 +35,12 @@ QT_END_NAMESPACE
#include "IntPoint.h"
#endif
+#if PLATFORM(BREWMP)
+typedef unsigned short uint16;
+typedef unsigned long int uint32;
+#define AEEEvent uint16
+#endif
+
namespace WebCore {
enum TouchEventType {
@@ -61,6 +67,11 @@ public:
PlatformTouchEvent(QTouchEvent*);
#elif PLATFORM(ANDROID)
PlatformTouchEvent(const Vector<IntPoint>&, TouchEventType, PlatformTouchPoint::State, int metaState);
+<<<<<<< HEAD
+=======
+#elif PLATFORM(BREWMP)
+ PlatformTouchEvent(AEEEvent, uint16 wParam, uint32 dwParam);
+>>>>>>> webkit.org at r68651
#endif
TouchEventType type() const { return m_type; }
diff --git a/WebCore/platform/PlatformTouchPoint.h b/WebCore/platform/PlatformTouchPoint.h
index 4b8ebae..f330eb6 100644
--- a/WebCore/platform/PlatformTouchPoint.h
+++ b/WebCore/platform/PlatformTouchPoint.h
@@ -48,6 +48,11 @@ public:
PlatformTouchPoint() {};
#elif PLATFORM(ANDROID)
PlatformTouchPoint(unsigned id, const IntPoint& windowPos, State);
+<<<<<<< HEAD
+=======
+#elif PLATFORM(BREWMP)
+ PlatformTouchPoint(int id, const IntPoint& windowPos, State);
+>>>>>>> webkit.org at r68651
#endif
unsigned id() const { return m_id; }
diff --git a/WebCore/platform/ScrollView.cpp b/WebCore/platform/ScrollView.cpp
index 0273807..0e95e22 100644
--- a/WebCore/platform/ScrollView.cpp
+++ b/WebCore/platform/ScrollView.cpp
@@ -383,6 +383,14 @@ bool ScrollView::scroll(ScrollDirection direction, ScrollGranularity granularity
return false;
}
+void ScrollView::windowResizerRectChanged()
+{
+ if (platformWidget())
+ return;
+
+ updateScrollbars(scrollOffset());
+}
+
static const unsigned cMaxUpdateScrollbarsPass = 2;
void ScrollView::updateScrollbars(const IntSize& desiredOffset)
diff --git a/WebCore/platform/ScrollView.h b/WebCore/platform/ScrollView.h
index 751b276..1744963 100644
--- a/WebCore/platform/ScrollView.h
+++ b/WebCore/platform/ScrollView.h
@@ -195,6 +195,8 @@ public:
virtual IntRect windowResizerRect() const { return IntRect(); }
bool containsScrollbarsAvoidingResizer() const;
void adjustScrollbarsAvoidingResizerCount(int overlapDelta);
+ void windowResizerRectChanged();
+
virtual void setParent(ScrollView*); // Overridden to update the overlapping scrollbar count.
// Called when our frame rect changes (or the rect/scroll position of an ancestor changes).
diff --git a/WebCore/platform/Scrollbar.cpp b/WebCore/platform/Scrollbar.cpp
index 398584a..72f0639 100644
--- a/WebCore/platform/Scrollbar.cpp
+++ b/WebCore/platform/Scrollbar.cpp
@@ -40,7 +40,7 @@
using namespace std;
-#if PLATFORM(CHROMIUM) && OS(LINUX) || PLATFORM(GTK)
+#if (PLATFORM(CHROMIUM) && (OS(LINUX) || OS(FREEBSD))) || PLATFORM(GTK)
// The position of the scrollbar thumb affects the appearance of the steppers, so
// when the thumb moves, we have to invalidate them for painting.
#define THUMB_POSITION_AFFECTS_BUTTONS
diff --git a/WebCore/platform/Widget.cpp b/WebCore/platform/Widget.cpp
index 1370863..05a5237 100644
--- a/WebCore/platform/Widget.cpp
+++ b/WebCore/platform/Widget.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. All rights reserved.
+ * Copyright (C) 2004, 2005, 2006, 2010 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -127,6 +127,7 @@ IntPoint Widget::convertFromContainingWindowToRoot(const Widget*, const IntPoint
}
#endif
+<<<<<<< HEAD
#if !PLATFORM(MAC) && !PLATFORM(GTK) && !OS(ANDROID)
void Widget::releasePlatformWidget()
{
@@ -137,6 +138,8 @@ void Widget::retainPlatformWidget()
}
#endif
+=======
+>>>>>>> webkit.org at r68651
IntRect Widget::convertToContainingView(const IntRect& localRect) const
{
if (const ScrollView* parentScrollView = parent()) {
diff --git a/WebCore/platform/Widget.h b/WebCore/platform/Widget.h
index 58d4e57..90d38a9 100644
--- a/WebCore/platform/Widget.h
+++ b/WebCore/platform/Widget.h
@@ -27,6 +27,22 @@
#ifndef Widget_h
#define Widget_h
+#include "IntRect.h"
+#include <wtf/Forward.h>
+#include <wtf/RefCounted.h>
+
+#if PLATFORM(CHROMIUM)
+#include "PlatformWidget.h"
+#endif
+
+#if PLATFORM(MAC)
+#include <wtf/RetainPtr.h>
+#endif
+
+#if PLATFORM(QT)
+#include <qglobal.h>
+#endif
+
#if PLATFORM(MAC)
#ifdef __OBJC__
@class NSView;
@@ -35,7 +51,7 @@
class NSView;
class NSWindow;
#endif
-typedef NSView* PlatformWidget;
+typedef NSView *PlatformWidget;
#endif
#if PLATFORM(ANDROID)
@@ -56,7 +72,6 @@ typedef GtkWidget* PlatformWidget;
#endif
#if PLATFORM(QT)
-#include <qglobal.h>
QT_BEGIN_NAMESPACE
class QWidget;
QT_END_NAMESPACE
@@ -77,10 +92,6 @@ typedef BView* PlatformWidget;
typedef void* PlatformWidget;
#endif
-#if PLATFORM(CHROMIUM)
-#include "PlatformWidget.h"
-#endif
-
#if PLATFORM(EFL)
typedef struct _Evas_Object Evas_Object;
typedef struct _Evas Evas;
@@ -95,13 +106,6 @@ typedef QWebPageClient* PlatformPageClient;
typedef PlatformWidget PlatformPageClient;
#endif
-#include "IntPoint.h"
-#include "IntRect.h"
-#include "IntSize.h"
-
-#include <wtf/Forward.h>
-#include <wtf/RefCounted.h>
-
namespace WebCore {
class Cursor;
@@ -132,15 +136,9 @@ public:
Widget(PlatformWidget = 0);
virtual ~Widget();
- PlatformWidget platformWidget() const { return m_widget; }
- void setPlatformWidget(PlatformWidget widget)
- {
- if (widget != m_widget) {
- releasePlatformWidget();
- m_widget = widget;
- retainPlatformWidget();
- }
- }
+ PlatformWidget platformWidget() const;
+ void setPlatformWidget(PlatformWidget);
+
#if PLATFORM(HAIKU)
PlatformWidget topLevelPlatformWidget() const { return m_topLevelPlatformWidget; }
void setTopLevelPlatformWidget(PlatformWidget widget)
@@ -256,7 +254,11 @@ private:
private:
ScrollView* m_parent;
+#if !PLATFORM(MAC)
PlatformWidget m_widget;
+#else
+ RetainPtr<NSView> m_widget;
+#endif
bool m_selfVisible;
bool m_parentVisible;
@@ -283,6 +285,36 @@ public:
#endif
};
+#if !PLATFORM(MAC)
+
+inline PlatformWidget Widget::platformWidget() const
+{
+ return m_widget;
+}
+
+inline void Widget::setPlatformWidget(PlatformWidget widget)
+{
+ if (widget != m_widget) {
+ releasePlatformWidget();
+ m_widget = widget;
+ retainPlatformWidget();
+ }
+}
+
+#endif
+
+#if !PLATFORM(GTK)
+
+inline void Widget::releasePlatformWidget()
+{
+}
+
+inline void Widget::retainPlatformWidget()
+{
+}
+
+#endif
+
} // namespace WebCore
#endif // Widget_h
diff --git a/WebCore/platform/android/ClipboardAndroid.cpp b/WebCore/platform/android/ClipboardAndroid.cpp
index d9b2d68..a91fd21 100644
--- a/WebCore/platform/android/ClipboardAndroid.cpp
+++ b/WebCore/platform/android/ClipboardAndroid.cpp
@@ -40,8 +40,8 @@ PassRefPtr<Clipboard> Clipboard::create(ClipboardAccessPolicy, DragData*, Frame*
return 0;
}
-ClipboardAndroid::ClipboardAndroid(ClipboardAccessPolicy policy, bool isForDragging)
- : Clipboard(policy, isForDragging)
+ClipboardAndroid::ClipboardAndroid(ClipboardAccessPolicy policy, ClipboardType clipboardType)
+ : Clipboard(policy, clipboardType)
{
}
@@ -51,12 +51,12 @@ ClipboardAndroid::~ClipboardAndroid()
void ClipboardAndroid::clearData(const String&)
{
- ASSERT(isForDragging());
+ ASSERT(isForDragAndDrop());
}
void ClipboardAndroid::clearAllData()
{
- ASSERT(isForDragging());
+ ASSERT(isForDragAndDrop());
}
String ClipboardAndroid::getData(const String&, bool& success) const
@@ -67,7 +67,7 @@ String ClipboardAndroid::getData(const String&, bool& success) const
bool ClipboardAndroid::setData(const String&, const String&)
{
- ASSERT(isForDragging());
+ ASSERT(isForDragAndDrop());
return false;
}
diff --git a/WebCore/platform/android/ClipboardAndroid.h b/WebCore/platform/android/ClipboardAndroid.h
index 23bfdf6..807653b 100644
--- a/WebCore/platform/android/ClipboardAndroid.h
+++ b/WebCore/platform/android/ClipboardAndroid.h
@@ -37,7 +37,7 @@ class CachedImage;
class ClipboardAndroid : public Clipboard, public CachedResourceClient {
public:
- ClipboardAndroid(ClipboardAccessPolicy policy, bool isForDragging);
+ ClipboardAndroid(ClipboardAccessPolicy policy, ClipboardType);
~ClipboardAndroid();
void clearData(const String&);
diff --git a/WebCore/platform/android/LocalizedStringsAndroid.cpp b/WebCore/platform/android/LocalizedStringsAndroid.cpp
index 5ca7fa2..635f741 100644
--- a/WebCore/platform/android/LocalizedStringsAndroid.cpp
+++ b/WebCore/platform/android/LocalizedStringsAndroid.cpp
@@ -98,6 +98,66 @@ String contextMenuItemTagCopyImageToClipboard()
return String();
}
+String contextMenuItemTagOpenVideoInNewWindow()
+{
+ notImplemented();
+ return String();
+}
+
+String contextMenuItemTagOpenAudioInNewWindow()
+{
+ notImplemented();
+ return String();
+}
+
+String contextMenuItemTagCopyVideoLinkToClipboard()
+{
+ notImplemented();
+ return String();
+}
+
+String contextMenuItemTagCopyAudioLinkToClipboard()
+{
+ notImplemented();
+ return String();
+}
+
+String contextMenuItemTagToggleMediaControls()
+{
+ notImplemented();
+ return String();
+}
+
+String contextMenuItemTagToggleMediaLoop()
+{
+ notImplemented();
+ return String();
+}
+
+String contextMenuItemTagEnterVideoFullscreen()
+{
+ notImplemented();
+ return String();
+}
+
+String contextMenuItemTagMediaPlay()
+{
+ notImplemented();
+ return String();
+}
+
+String contextMenuItemTagMediaPause()
+{
+ notImplemented();
+ return String();
+}
+
+String contextMenuItemTagMediaMute()
+{
+ notImplemented();
+ return String();
+}
+
String contextMenuItemTagOpenFrameInNewWindow()
{
notImplemented();
diff --git a/WebCore/platform/android/PlatformTouchEventAndroid.cpp b/WebCore/platform/android/PlatformTouchEventAndroid.cpp
index 8b3d285..eb23322 100644
--- a/WebCore/platform/android/PlatformTouchEventAndroid.cpp
+++ b/WebCore/platform/android/PlatformTouchEventAndroid.cpp
@@ -43,7 +43,11 @@ PlatformTouchEvent::PlatformTouchEvent(const Vector<IntPoint>& windowPoints, Tou
{
m_touchPoints.reserveCapacity(windowPoints.size());
for (unsigned c = 0; c < windowPoints.size(); c++)
+<<<<<<< HEAD
m_touchPoints.append(PlatformTouchPoint(c, windowPoints[c], state));
+=======
+ m_touchPoints.append(PlatformTouchPoint(windowPos, state));
+>>>>>>> webkit.org at r68651
m_altKey = metaState & META_ALT_ON;
m_shiftKey = metaState & META_SHIFT_ON;
diff --git a/WebCore/platform/audio/AudioDestination.h b/WebCore/platform/audio/AudioDestination.h
new file mode 100644
index 0000000..9498110
--- /dev/null
+++ b/WebCore/platform/audio/AudioDestination.h
@@ -0,0 +1,59 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef AudioDestination_h
+#define AudioDestination_h
+
+#include <wtf/OwnPtr.h>
+#include <wtf/PassOwnPtr.h>
+
+namespace WebCore {
+
+class AudioSourceProvider;
+
+// Abstraction for an audio output to the audio hardware
+// An AudioSourceProvider is called back periodically to provide the rendered audio stream.
+
+class AudioDestination {
+public:
+ static PassOwnPtr<AudioDestination> create(AudioSourceProvider&, double sampleRate);
+
+ virtual ~AudioDestination() { }
+
+ virtual void start() = 0;
+ virtual void stop() = 0;
+ virtual bool isPlaying() = 0;
+
+ // Sample-rate conversion may happen in AudioDestination to the hardware sample-rate
+ virtual double sampleRate() const = 0;
+ static double hardwareSampleRate();
+};
+
+} // namespace WebCore
+
+#endif // AudioDestination_h
diff --git a/WebCore/platform/audio/HRTFDatabase.cpp b/WebCore/platform/audio/HRTFDatabase.cpp
new file mode 100644
index 0000000..ef1229f
--- /dev/null
+++ b/WebCore/platform/audio/HRTFDatabase.cpp
@@ -0,0 +1,124 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#if ENABLE(WEB_AUDIO)
+
+#include "HRTFDatabase.h"
+
+#include "HRTFElevation.h"
+
+using namespace std;
+
+namespace WebCore {
+
+const int HRTFDatabase::MinElevation = -45;
+const int HRTFDatabase::MaxElevation = 90;
+const unsigned HRTFDatabase::RawElevationAngleSpacing = 15;
+const unsigned HRTFDatabase::NumberOfRawElevations = 10; // -45 -> +90 (each 15 degrees)
+const unsigned HRTFDatabase::InterpolationFactor = 1;
+const unsigned HRTFDatabase::NumberOfTotalElevations = NumberOfRawElevations * InterpolationFactor;
+
+PassOwnPtr<HRTFDatabase> HRTFDatabase::create(double sampleRate)
+{
+ OwnPtr<HRTFDatabase> hrtfDatabase = adoptPtr(new HRTFDatabase(sampleRate));
+ return hrtfDatabase.release();
+}
+
+HRTFDatabase::HRTFDatabase(double sampleRate)
+ : m_elevations(NumberOfTotalElevations)
+ , m_sampleRate(sampleRate)
+{
+ unsigned elevationIndex = 0;
+ for (int elevation = MinElevation; elevation <= MaxElevation; elevation += RawElevationAngleSpacing) {
+ OwnPtr<HRTFElevation> hrtfElevation = HRTFElevation::createForSubject("Composite", elevation, sampleRate);
+ ASSERT(hrtfElevation.get());
+ if (!hrtfElevation.get())
+ return;
+
+ m_elevations[elevationIndex] = hrtfElevation.release();
+ elevationIndex += InterpolationFactor;
+ }
+
+ // Now, go back and interpolate elevations.
+ if (InterpolationFactor > 1) {
+ for (unsigned i = 0; i < NumberOfTotalElevations; i += InterpolationFactor) {
+ unsigned j = (i + InterpolationFactor);
+ if (j >= NumberOfTotalElevations)
+ j = i; // for last elevation interpolate with itself
+
+ // Create the interpolated convolution kernels and delays.
+ for (unsigned jj = 1; jj < InterpolationFactor; ++jj) {
+ double x = static_cast<double>(jj) / static_cast<double>(InterpolationFactor);
+ m_elevations[i + jj] = HRTFElevation::createByInterpolatingSlices(m_elevations[i].get(), m_elevations[j].get(), x, sampleRate);
+ ASSERT(m_elevations[i + jj].get());
+ }
+ }
+ }
+}
+
+void HRTFDatabase::getKernelsFromAzimuthElevation(double azimuthBlend, unsigned azimuthIndex, double elevationAngle, HRTFKernel* &kernelL, HRTFKernel* &kernelR,
+ double& frameDelayL, double& frameDelayR)
+{
+ unsigned elevationIndex = indexFromElevationAngle(elevationAngle);
+ ASSERT(elevationIndex < m_elevations.size() && m_elevations.size() > 0);
+
+ if (!m_elevations.size()) {
+ kernelL = 0;
+ kernelR = 0;
+ return;
+ }
+
+ if (elevationIndex > m_elevations.size() - 1)
+ elevationIndex = m_elevations.size() - 1;
+
+ HRTFElevation* hrtfElevation = m_elevations[elevationIndex].get();
+ ASSERT(hrtfElevation);
+ if (!hrtfElevation) {
+ kernelL = 0;
+ kernelR = 0;
+ return;
+ }
+
+ hrtfElevation->getKernelsFromAzimuth(azimuthBlend, azimuthIndex, kernelL, kernelR, frameDelayL, frameDelayR);
+}
+
+unsigned HRTFDatabase::indexFromElevationAngle(double elevationAngle)
+{
+ // Clamp to allowed range.
+ elevationAngle = max(static_cast<double>(MinElevation), elevationAngle);
+ elevationAngle = min(static_cast<double>(MaxElevation), elevationAngle);
+
+ unsigned elevationIndex = static_cast<int>(InterpolationFactor * (elevationAngle - MinElevation) / RawElevationAngleSpacing);
+ return elevationIndex;
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(WEB_AUDIO)
diff --git a/WebCore/platform/audio/HRTFDatabase.h b/WebCore/platform/audio/HRTFDatabase.h
new file mode 100644
index 0000000..c33b38f
--- /dev/null
+++ b/WebCore/platform/audio/HRTFDatabase.h
@@ -0,0 +1,87 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef HRTFDatabase_h
+#define HRTFDatabase_h
+
+#include "HRTFElevation.h"
+#include <wtf/HashMap.h>
+#include <wtf/Noncopyable.h>
+#include <wtf/OwnPtr.h>
+#include <wtf/PassRefPtr.h>
+#include <wtf/Vector.h>
+#include <wtf/text/CString.h>
+#include <wtf/text/StringHash.h>
+#include <wtf/text/WTFString.h>
+
+namespace WebCore {
+
+class HRTFKernel;
+
+class HRTFDatabase : public Noncopyable {
+public:
+ static PassOwnPtr<HRTFDatabase> create(double sampleRate);
+
+ // getKernelsFromAzimuthElevation() returns a left and right ear kernel, and an interpolated left and right frame delay for the given azimuth and elevation.
+ // azimuthBlend must be in the range 0 -> 1.
+ // Valid values for azimuthIndex are 0 -> HRTFElevation::NumberOfTotalAzimuths - 1 (corresponding to angles of 0 -> 360).
+ // Valid values for elevationAngle are MinElevation -> MaxElevation.
+ void getKernelsFromAzimuthElevation(double azimuthBlend, unsigned azimuthIndex, double elevationAngle, HRTFKernel* &kernelL, HRTFKernel* &kernelR, double& frameDelayL, double& frameDelayR);
+
+ // Returns the number of different azimuth angles.
+ static unsigned numberOfAzimuths() { return HRTFElevation::NumberOfTotalAzimuths; }
+
+ double sampleRate() const { return m_sampleRate; }
+
+private:
+ explicit HRTFDatabase(double sampleRate);
+
+ // Minimum and maximum elevation angles (inclusive) for a HRTFDatabase.
+ static const int MinElevation;
+ static const int MaxElevation;
+ static const unsigned RawElevationAngleSpacing;
+
+ // Number of elevations loaded from resource.
+ static const unsigned NumberOfRawElevations;
+
+ // Interpolates by this factor to get the total number of elevations from every elevation loaded from resource.
+ static const unsigned InterpolationFactor;
+
+ // Total number of elevations after interpolation.
+ static const unsigned NumberOfTotalElevations;
+
+ // Returns the index for the correct HRTFElevation given the elevation angle.
+ static unsigned indexFromElevationAngle(double);
+
+ Vector<OwnPtr<HRTFElevation> > m_elevations;
+ double m_sampleRate;
+};
+
+} // namespace WebCore
+
+#endif // HRTFDatabase_h
diff --git a/WebCore/platform/audio/HRTFDatabaseLoader.cpp b/WebCore/platform/audio/HRTFDatabaseLoader.cpp
new file mode 100644
index 0000000..4368d22
--- /dev/null
+++ b/WebCore/platform/audio/HRTFDatabaseLoader.cpp
@@ -0,0 +1,133 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#if ENABLE(WEB_AUDIO)
+
+#include "HRTFDatabaseLoader.h"
+
+#include "HRTFDatabase.h"
+
+namespace WebCore {
+
+// Singleton
+HRTFDatabaseLoader* HRTFDatabaseLoader::s_loader = 0;
+
+PassRefPtr<HRTFDatabaseLoader> HRTFDatabaseLoader::createAndLoadAsynchronouslyIfNecessary(double sampleRate)
+{
+ ASSERT(isMainThread());
+
+ RefPtr<HRTFDatabaseLoader> loader;
+
+ if (!s_loader) {
+ // Lazily create and load.
+ loader = adoptRef(new HRTFDatabaseLoader(sampleRate));
+ s_loader = loader.get();
+ loader->loadAsynchronously();
+ } else {
+ loader = s_loader;
+ ASSERT(sampleRate == loader->databaseSampleRate());
+ }
+
+ return loader;
+}
+
+HRTFDatabaseLoader::HRTFDatabaseLoader(double sampleRate)
+ : m_hrtfDatabase(0)
+ , m_databaseLoaderThread(0)
+ , m_startedLoadingDatabase(false)
+ , m_databaseSampleRate(sampleRate)
+{
+ ASSERT(isMainThread());
+}
+
+HRTFDatabaseLoader::~HRTFDatabaseLoader()
+{
+ ASSERT(isMainThread());
+
+ if (m_startedLoadingDatabase)
+ waitForThreadCompletion(m_databaseLoaderThread, 0);
+
+ m_startedLoadingDatabase = false;
+ m_databaseLoaderThread = 0;
+
+ m_hrtfDatabase.clear();
+
+ // Clear out singleton.
+ ASSERT(this == s_loader);
+ s_loader = 0;
+}
+
+
+// Asynchronously load the database in this thread.
+static void* databaseLoaderEntry(void* threadData)
+{
+ HRTFDatabaseLoader* loader = reinterpret_cast<HRTFDatabaseLoader*>(threadData);
+ ASSERT(loader);
+ loader->load();
+
+ return 0;
+}
+
+void HRTFDatabaseLoader::load()
+{
+ ASSERT(!isMainThread());
+ if (!m_hrtfDatabase.get()) {
+ // Load the default HRTF database.
+ m_hrtfDatabase = HRTFDatabase::create(m_databaseSampleRate);
+ }
+}
+
+void HRTFDatabaseLoader::loadAsynchronously()
+{
+ ASSERT(isMainThread());
+
+ if (!m_hrtfDatabase.get() && !m_startedLoadingDatabase) {
+ // Start the asynchronous database loading process.
+ m_startedLoadingDatabase = true;
+ m_databaseLoaderThread = createThread(databaseLoaderEntry, this, "HRTF database loader");
+ }
+}
+
+bool HRTFDatabaseLoader::isLoaded() const
+{
+ return m_hrtfDatabase.get();
+}
+
+HRTFDatabase* HRTFDatabaseLoader::defaultHRTFDatabase()
+{
+ if (!s_loader)
+ return 0;
+
+ return s_loader->database();
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(WEB_AUDIO)
diff --git a/WebCore/platform/audio/HRTFDatabaseLoader.h b/WebCore/platform/audio/HRTFDatabaseLoader.h
new file mode 100644
index 0000000..72002c5
--- /dev/null
+++ b/WebCore/platform/audio/HRTFDatabaseLoader.h
@@ -0,0 +1,85 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef HRTFDatabaseLoader_h
+#define HRTFDatabaseLoader_h
+
+#include "HRTFDatabase.h"
+#include <wtf/PassRefPtr.h>
+#include <wtf/RefCounted.h>
+#include <wtf/RefPtr.h>
+#include <wtf/Threading.h>
+
+namespace WebCore {
+
+// HRTFDatabaseLoader will asynchronously load the default HRTFDatabase in a new thread.
+
+class HRTFDatabaseLoader : public RefCounted<HRTFDatabaseLoader> {
+public:
+ // Lazily creates the singleton HRTFDatabaseLoader (if not already created) and starts loading asynchronously (when created the first time).
+ // Returns the singleton HRTFDatabaseLoader.
+ // Must be called from the main thread.
+ static PassRefPtr<HRTFDatabaseLoader> createAndLoadAsynchronouslyIfNecessary(double sampleRate);
+
+ // Both constructor and destructor must be called from the main thread.
+ ~HRTFDatabaseLoader();
+
+ // Returns true once the default database has been completely loaded.
+ bool isLoaded() const;
+
+ HRTFDatabase* database() { return m_hrtfDatabase.get(); }
+
+ // Called in asynchronous loading thread.
+ void load();
+
+ // defaultHRTFDatabase() gives access to the loaded database.
+ // This can be called from any thread, but it is the callers responsibilty to call this while the context (and thus HRTFDatabaseLoader)
+ // is still alive. Otherwise this will return 0.
+ static HRTFDatabase* defaultHRTFDatabase();
+
+private:
+ // Both constructor and destructor must be called from the main thread.
+ explicit HRTFDatabaseLoader(double sampleRate);
+
+ // If it hasn't already been loaded, creates a new thread and initiates asynchronous loading of the default database.
+ // This must be called from the main thread.
+ void loadAsynchronously();
+
+ double databaseSampleRate() const { return m_databaseSampleRate; }
+
+ static HRTFDatabaseLoader* s_loader; // singleton
+ OwnPtr<HRTFDatabase> m_hrtfDatabase;
+ ThreadIdentifier m_databaseLoaderThread;
+ bool m_startedLoadingDatabase;
+ double m_databaseSampleRate;
+};
+
+
+} // namespace WebCore
+
+#endif // HRTFDatabaseLoader_h
diff --git a/WebCore/platform/audio/HRTFElevation.cpp b/WebCore/platform/audio/HRTFElevation.cpp
new file mode 100644
index 0000000..ac1eb4d
--- /dev/null
+++ b/WebCore/platform/audio/HRTFElevation.cpp
@@ -0,0 +1,266 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#if ENABLE(WEB_AUDIO)
+
+#include "HRTFElevation.h"
+
+#include "AudioBus.h"
+#include "AudioFileReader.h"
+#include "AudioResources.h"
+#include "Biquad.h"
+#include "FFTFrame.h"
+#include "HRTFPanner.h"
+#include <algorithm>
+#include <math.h>
+#include <wtf/OwnPtr.h>
+
+using namespace std;
+
+namespace WebCore {
+
+const unsigned HRTFElevation::AzimuthSpacing = 15;
+const unsigned HRTFElevation::NumberOfRawAzimuths = 360 / AzimuthSpacing;
+const unsigned HRTFElevation::InterpolationFactor = 8;
+const unsigned HRTFElevation::NumberOfTotalAzimuths = NumberOfRawAzimuths * InterpolationFactor;
+
+// Takes advantage of the symmetry and creates a composite version of the two measured versions. For example, we have both azimuth 30 and -30 degrees
+// where the roles of left and right ears are reversed with respect to each other.
+bool HRTFElevation::calculateSymmetricKernelsForAzimuthElevation(int azimuth, int elevation, double sampleRate, const String& subjectName,
+ RefPtr<HRTFKernel>& kernelL, RefPtr<HRTFKernel>& kernelR)
+{
+ RefPtr<HRTFKernel> kernelL1;
+ RefPtr<HRTFKernel> kernelR1;
+ bool success = calculateKernelsForAzimuthElevation(azimuth, elevation, sampleRate, subjectName, kernelL1, kernelR1);
+ if (!success)
+ return false;
+
+ // And symmetric version
+ int symmetricAzimuth = !azimuth ? 0 : 360 - azimuth;
+
+ RefPtr<HRTFKernel> kernelL2;
+ RefPtr<HRTFKernel> kernelR2;
+ success = calculateKernelsForAzimuthElevation(symmetricAzimuth, elevation, sampleRate, subjectName, kernelL2, kernelR2);
+ if (!success)
+ return false;
+
+ // Notice L/R reversal in symmetric version.
+ kernelL = HRTFKernel::createInterpolatedKernel(kernelL1.get(), kernelR2.get(), 0.5);
+ kernelR = HRTFKernel::createInterpolatedKernel(kernelR1.get(), kernelL2.get(), 0.5);
+
+ return true;
+}
+
+bool HRTFElevation::calculateKernelsForAzimuthElevation(int azimuth, int elevation, double sampleRate, const String& subjectName,
+ RefPtr<HRTFKernel>& kernelL, RefPtr<HRTFKernel>& kernelR)
+{
+ // Valid values for azimuth are 0 -> 345 in 15 degree increments.
+ // Valid values for elevation are -45 -> +90 in 15 degree increments.
+
+ bool isAzimuthGood = azimuth >= 0 && azimuth <= 345 && (azimuth / 15) * 15 == azimuth;
+ ASSERT(isAzimuthGood);
+ if (!isAzimuthGood)
+ return false;
+
+ bool isElevationGood = elevation >= -45 && elevation <= 90 && (elevation / 15) * 15 == elevation;
+ ASSERT(isElevationGood);
+ if (!isElevationGood)
+ return false;
+
+ // Construct the resource name from the subject name, azimuth, and elevation, for example:
+ // "IRC_Composite_C_R0195_T015_P000"
+ // Note: the passed in subjectName is not a string passed in via JavaScript or the web.
+ // It's passed in as an internal ASCII identifier and is an implementation detail.
+ int positiveElevation = elevation < 0 ? elevation + 360 : elevation;
+ String resourceName = String::format("IRC_%s_C_R0195_T%03d_P%03d", subjectName.utf8().data(), azimuth, positiveElevation);
+
+ OwnPtr<AudioBus> impulseResponse(createBusFromAudioFileResource(resourceName, sampleRate));
+
+ ASSERT(impulseResponse.get());
+ if (!impulseResponse.get())
+ return false;
+
+ size_t responseLength = impulseResponse->length();
+
+ // Check number of channels and length. For now these are fixed and known.
+ bool isBusGood = responseLength == 512 && impulseResponse->numberOfChannels() == 2;
+ ASSERT(isBusGood);
+ if (!isBusGood)
+ return false;
+
+ AudioChannel* leftEarImpulseResponse = impulseResponse->channelByType(AudioBus::ChannelLeft);
+ AudioChannel* rightEarImpulseResponse = impulseResponse->channelByType(AudioBus::ChannelRight);
+
+ // Note that depending on the fftSize returned by the panner, we may be truncating the impulse response we just loaded in.
+ const size_t fftSize = HRTFPanner::fftSizeForSampleRate(sampleRate);
+ kernelL = HRTFKernel::create(leftEarImpulseResponse, fftSize, sampleRate, true);
+ kernelR = HRTFKernel::create(rightEarImpulseResponse, fftSize, sampleRate, true);
+
+ return true;
+}
+
+// The range of elevations for the IRCAM impulse responses varies depending on azimuth, but the minimum elevation appears to always be -45.
+//
+// Here's how it goes:
+static int maxElevations[] = {
+ // Azimuth
+ //
+ 90, // 0
+ 45, // 15
+ 60, // 30
+ 45, // 45
+ 75, // 60
+ 45, // 75
+ 60, // 90
+ 45, // 105
+ 75, // 120
+ 45, // 135
+ 60, // 150
+ 45, // 165
+ 75, // 180
+ 45, // 195
+ 60, // 210
+ 45, // 225
+ 75, // 240
+ 45, // 255
+ 60, // 270
+ 45, // 285
+ 75, // 300
+ 45, // 315
+ 60, // 330
+ 45 // 345
+};
+
+PassOwnPtr<HRTFElevation> HRTFElevation::createForSubject(const String& subjectName, int elevation, double sampleRate)
+{
+ bool isElevationGood = elevation >= -45 && elevation <= 90 && (elevation / 15) * 15 == elevation;
+ ASSERT(isElevationGood);
+ if (!isElevationGood)
+ return 0;
+
+ OwnPtr<HRTFKernelList> kernelListL = adoptPtr(new HRTFKernelList(NumberOfTotalAzimuths));
+ OwnPtr<HRTFKernelList> kernelListR = adoptPtr(new HRTFKernelList(NumberOfTotalAzimuths));
+
+ // Load convolution kernels from HRTF files.
+ int interpolatedIndex = 0;
+ for (unsigned rawIndex = 0; rawIndex < NumberOfRawAzimuths; ++rawIndex) {
+ // Don't let elevation exceed maximum for this azimuth.
+ int maxElevation = maxElevations[rawIndex];
+ int actualElevation = min(elevation, maxElevation);
+
+ bool success = calculateKernelsForAzimuthElevation(rawIndex * AzimuthSpacing, actualElevation, sampleRate, subjectName, kernelListL->at(interpolatedIndex), kernelListR->at(interpolatedIndex));
+ if (!success)
+ return 0;
+
+ interpolatedIndex += InterpolationFactor;
+ }
+
+ // Now go back and interpolate intermediate azimuth values.
+ for (unsigned i = 0; i < NumberOfTotalAzimuths; i += InterpolationFactor) {
+ int j = (i + InterpolationFactor) % NumberOfTotalAzimuths;
+
+ // Create the interpolated convolution kernels and delays.
+ for (unsigned jj = 1; jj < InterpolationFactor; ++jj) {
+ double x = double(jj) / double(InterpolationFactor); // interpolate from 0 -> 1
+
+ (*kernelListL)[i + jj] = HRTFKernel::createInterpolatedKernel(kernelListL->at(i).get(), kernelListL->at(j).get(), x);
+ (*kernelListR)[i + jj] = HRTFKernel::createInterpolatedKernel(kernelListR->at(i).get(), kernelListR->at(j).get(), x);
+ }
+ }
+
+ OwnPtr<HRTFElevation> hrtfElevation = adoptPtr(new HRTFElevation(kernelListL.release(), kernelListR.release(), elevation, sampleRate));
+ return hrtfElevation.release();
+}
+
+PassOwnPtr<HRTFElevation> HRTFElevation::createByInterpolatingSlices(HRTFElevation* hrtfElevation1, HRTFElevation* hrtfElevation2, double x, double sampleRate)
+{
+ ASSERT(hrtfElevation1 && hrtfElevation2);
+ if (!hrtfElevation1 || !hrtfElevation2)
+ return 0;
+
+ ASSERT(x >= 0.0 && x < 1.0);
+
+ OwnPtr<HRTFKernelList> kernelListL = adoptPtr(new HRTFKernelList(NumberOfTotalAzimuths));
+ OwnPtr<HRTFKernelList> kernelListR = adoptPtr(new HRTFKernelList(NumberOfTotalAzimuths));
+
+ HRTFKernelList* kernelListL1 = hrtfElevation1->kernelListL();
+ HRTFKernelList* kernelListR1 = hrtfElevation1->kernelListR();
+ HRTFKernelList* kernelListL2 = hrtfElevation2->kernelListL();
+ HRTFKernelList* kernelListR2 = hrtfElevation2->kernelListR();
+
+ // Interpolate kernels of corresponding azimuths of the two elevations.
+ for (unsigned i = 0; i < NumberOfTotalAzimuths; ++i) {
+ (*kernelListL)[i] = HRTFKernel::createInterpolatedKernel(kernelListL1->at(i).get(), kernelListL2->at(i).get(), x);
+ (*kernelListR)[i] = HRTFKernel::createInterpolatedKernel(kernelListR1->at(i).get(), kernelListR2->at(i).get(), x);
+ }
+
+ // Interpolate elevation angle.
+ double angle = (1.0 - x) * hrtfElevation1->elevationAngle() + x * hrtfElevation2->elevationAngle();
+
+ OwnPtr<HRTFElevation> hrtfElevation = adoptPtr(new HRTFElevation(kernelListL.release(), kernelListR.release(), angle, sampleRate));
+ return hrtfElevation.release();
+}
+
+void HRTFElevation::getKernelsFromAzimuth(double azimuthBlend, unsigned azimuthIndex, HRTFKernel* &kernelL, HRTFKernel* &kernelR, double& frameDelayL, double& frameDelayR)
+{
+ bool checkAzimuthBlend = azimuthBlend >= 0.0 && azimuthBlend < 1.0;
+ ASSERT(checkAzimuthBlend);
+ if (!checkAzimuthBlend)
+ azimuthBlend = 0.0;
+
+ unsigned numKernels = m_kernelListL->size();
+
+ bool isIndexGood = azimuthIndex < numKernels;
+ ASSERT(isIndexGood);
+ if (!isIndexGood) {
+ kernelL = 0;
+ kernelR = 0;
+ return;
+ }
+
+ // Return the left and right kernels.
+ kernelL = m_kernelListL->at(azimuthIndex).get();
+ kernelR = m_kernelListR->at(azimuthIndex).get();
+
+ frameDelayL = m_kernelListL->at(azimuthIndex)->frameDelay();
+ frameDelayR = m_kernelListR->at(azimuthIndex)->frameDelay();
+
+ int azimuthIndex2 = (azimuthIndex + 1) % numKernels;
+ double frameDelay2L = m_kernelListL->at(azimuthIndex2)->frameDelay();
+ double frameDelay2R = m_kernelListR->at(azimuthIndex2)->frameDelay();
+
+ // Linearly interpolate delays.
+ frameDelayL = (1.0 - azimuthBlend) * frameDelayL + azimuthBlend * frameDelay2L;
+ frameDelayR = (1.0 - azimuthBlend) * frameDelayR + azimuthBlend * frameDelay2R;
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(WEB_AUDIO)
diff --git a/WebCore/platform/audio/HRTFElevation.h b/WebCore/platform/audio/HRTFElevation.h
new file mode 100644
index 0000000..b388b34
--- /dev/null
+++ b/WebCore/platform/audio/HRTFElevation.h
@@ -0,0 +1,110 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef HRTFElevation_h
+#define HRTFElevation_h
+
+#include "HRTFKernel.h"
+#include <wtf/Noncopyable.h>
+#include <wtf/OwnPtr.h>
+#include <wtf/PassOwnPtr.h>
+#include <wtf/PassRefPtr.h>
+#include <wtf/RefCounted.h>
+#include <wtf/RefPtr.h>
+#include <wtf/text/CString.h>
+#include <wtf/text/WTFString.h>
+
+namespace WebCore {
+
+// HRTFElevation contains all of the HRTFKernels (one left ear and one right ear per azimuth angle) for a particular elevation.
+
+class HRTFElevation : public Noncopyable {
+public:
+ // Loads and returns an HRTFElevation with the given HRTF database subject name and elevation from browser (or WebKit.framework) resources.
+ // Normally, there will only be a single HRTF database set, but this API supports the possibility of multiple ones with different names.
+ // Interpolated azimuths will be generated based on InterpolationFactor.
+ // Valid values for elevation are -45 -> +90 in 15 degree increments.
+ static PassOwnPtr<HRTFElevation> createForSubject(const String& subjectName, int elevation, double sampleRate);
+
+ // Given two HRTFElevations, and an interpolation factor x: 0 -> 1, returns an interpolated HRTFElevation.
+ static PassOwnPtr<HRTFElevation> createByInterpolatingSlices(HRTFElevation* hrtfElevation1, HRTFElevation* hrtfElevation2, double x, double sampleRate);
+
+ // Returns the list of left or right ear HRTFKernels for all the azimuths going from 0 to 360 degrees.
+ HRTFKernelList* kernelListL() { return m_kernelListL.get(); }
+ HRTFKernelList* kernelListR() { return m_kernelListR.get(); }
+
+ double elevationAngle() const { return m_elevationAngle; }
+ unsigned numberOfAzimuths() { return NumberOfTotalAzimuths; }
+ double sampleRate() const { return m_sampleRate; }
+
+ // Returns the left and right kernels for the given azimuth index.
+ // The interpolated delays based on azimuthBlend: 0 -> 1 are returned in frameDelayL and frameDelayR.
+ void getKernelsFromAzimuth(double azimuthBlend, unsigned azimuthIndex, HRTFKernel* &kernelL, HRTFKernel* &kernelR, double& frameDelayL, double& frameDelayR);
+
+ // Spacing, in degrees, between every azimuth loaded from resource.
+ static const unsigned AzimuthSpacing;
+
+ // Number of azimuths loaded from resource.
+ static const unsigned NumberOfRawAzimuths;
+
+ // Interpolates by this factor to get the total number of azimuths from every azimuth loaded from resource.
+ static const unsigned InterpolationFactor;
+
+ // Total number of azimuths after interpolation.
+ static const unsigned NumberOfTotalAzimuths;
+
+ // Given a specific azimuth and elevation angle, returns the left and right HRTFKernel.
+ // Valid values for azimuth are 0 -> 345 in 15 degree increments.
+ // Valid values for elevation are -45 -> +90 in 15 degree increments.
+ // Returns true on success.
+ static bool calculateKernelsForAzimuthElevation(int azimuth, int elevation, double sampleRate, const String& subjectName,
+ RefPtr<HRTFKernel>& kernelL, RefPtr<HRTFKernel>& kernelR);
+
+ // Given a specific azimuth and elevation angle, returns the left and right HRTFKernel in kernelL and kernelR.
+ // This method averages the measured response using symmetry of azimuth (for example by averaging the -30.0 and +30.0 azimuth responses).
+ // Returns true on success.
+ static bool calculateSymmetricKernelsForAzimuthElevation(int azimuth, int elevation, double sampleRate, const String& subjectName,
+ RefPtr<HRTFKernel>& kernelL, RefPtr<HRTFKernel>& kernelR);
+private:
+ HRTFElevation(PassOwnPtr<HRTFKernelList> kernelListL, PassOwnPtr<HRTFKernelList> kernelListR, int elevation, double sampleRate)
+ : m_kernelListL(kernelListL)
+ , m_kernelListR(kernelListR)
+ , m_elevationAngle(elevation)
+ , m_sampleRate(sampleRate)
+ {
+ }
+
+ OwnPtr<HRTFKernelList> m_kernelListL;
+ OwnPtr<HRTFKernelList> m_kernelListR;
+ double m_elevationAngle;
+ double m_sampleRate;
+};
+
+} // namespace WebCore
+
+#endif // HRTFElevation_h
diff --git a/WebCore/platform/audio/HRTFKernel.cpp b/WebCore/platform/audio/HRTFKernel.cpp
new file mode 100644
index 0000000..852cdbf
--- /dev/null
+++ b/WebCore/platform/audio/HRTFKernel.cpp
@@ -0,0 +1,140 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#if ENABLE(WEB_AUDIO)
+
+#include "HRTFKernel.h"
+
+#include "AudioChannel.h"
+#include "Biquad.h"
+#include "FFTFrame.h"
+
+using namespace std;
+
+namespace WebCore {
+
+// Takes the input AudioChannel as an input impulse response and calculates the average group delay.
+// This represents the initial delay before the most energetic part of the impulse response.
+// The sample-frame delay is removed from the impulseP impulse response, and this value is returned.
+// the length of the passed in AudioChannel must be a power of 2.
+static double extractAverageGroupDelay(AudioChannel* channel)
+{
+ ASSERT(channel);
+
+ float* impulseP = channel->data();
+ size_t length = channel->length();
+
+ // Check that length is power-of-2;
+ ASSERT(1UL << static_cast<unsigned>(log2(length)) == length);
+
+ FFTFrame estimationFrame(length);
+ estimationFrame.doFFT(impulseP);
+
+ double frameDelay = estimationFrame.extractAverageGroupDelay();
+ estimationFrame.doInverseFFT(impulseP);
+
+ return frameDelay;
+}
+
+HRTFKernel::HRTFKernel(AudioChannel* channel, size_t fftSize, double sampleRate, bool bassBoost)
+ : m_frameDelay(0.0)
+ , m_sampleRate(sampleRate)
+{
+ ASSERT(channel);
+
+ // Determine the leading delay (average group delay) for the response.
+ m_frameDelay = extractAverageGroupDelay(channel);
+
+ float* impulseResponse = channel->data();
+ size_t responseLength = channel->length();
+
+ if (bassBoost) {
+ // Run through some post-processing to boost the bass a little -- the HRTF's seem to be a little bass-deficient.
+ // FIXME: this post-processing should have already been applied to the HRTF file resources. Once the files are put into this form,
+ // then this code path can be removed along with the bassBoost parameter.
+ Biquad filter;
+ filter.setLowShelfParams(700.0 / nyquist(), 6.0); // boost 6dB at 700Hz
+ filter.process(impulseResponse, impulseResponse, responseLength);
+ }
+
+ // We need to truncate to fit into 1/2 the FFT size (with zero padding) in order to do proper convolution.
+ size_t truncatedResponseLength = min(responseLength, fftSize / 2); // truncate if necessary to max impulse response length allowed by FFT
+
+ // Quick fade-out (apply window) at truncation point
+ unsigned numberOfFadeOutFrames = static_cast<unsigned>(sampleRate / 4410); // 10 sample-frames @44.1KHz sample-rate
+ ASSERT(numberOfFadeOutFrames < truncatedResponseLength);
+ if (numberOfFadeOutFrames < truncatedResponseLength) {
+ for (unsigned i = truncatedResponseLength - numberOfFadeOutFrames; i < truncatedResponseLength; ++i) {
+ float x = 1.0f - static_cast<float>(i - (truncatedResponseLength - numberOfFadeOutFrames)) / numberOfFadeOutFrames;
+ impulseResponse[i] *= x;
+ }
+ }
+
+ m_fftFrame = adoptPtr(new FFTFrame(fftSize));
+ m_fftFrame->doPaddedFFT(impulseResponse, truncatedResponseLength);
+}
+
+PassOwnPtr<AudioChannel> HRTFKernel::createImpulseResponse()
+{
+ OwnPtr<AudioChannel> channel = adoptPtr(new AudioChannel(fftSize()));
+ FFTFrame fftFrame(*m_fftFrame);
+
+ // Add leading delay back in.
+ fftFrame.addConstantGroupDelay(m_frameDelay);
+ fftFrame.doInverseFFT(channel->data());
+
+ return channel.release();
+}
+
+// Interpolates two kernels with x: 0 -> 1 and returns the result.
+PassRefPtr<HRTFKernel> HRTFKernel::createInterpolatedKernel(HRTFKernel* kernel1, HRTFKernel* kernel2, double x)
+{
+ ASSERT(kernel1 && kernel2);
+ if (!kernel1 || !kernel2)
+ return 0;
+
+ ASSERT(x >= 0.0 && x < 1.0);
+ x = min(1.0, max(0.0, x));
+
+ double sampleRate1 = kernel1->sampleRate();
+ double sampleRate2 = kernel2->sampleRate();
+ ASSERT(sampleRate1 == sampleRate2);
+ if (sampleRate1 != sampleRate2)
+ return 0;
+
+ double frameDelay = (1.0 - x) * kernel1->frameDelay() + x * kernel2->frameDelay();
+
+ OwnPtr<FFTFrame> interpolatedFrame = FFTFrame::createInterpolatedFrame(*kernel1->fftFrame(), *kernel2->fftFrame(), x);
+ return HRTFKernel::create(interpolatedFrame.release(), frameDelay, sampleRate1);
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(WEB_AUDIO)
diff --git a/WebCore/platform/audio/HRTFKernel.h b/WebCore/platform/audio/HRTFKernel.h
new file mode 100644
index 0000000..572a085
--- /dev/null
+++ b/WebCore/platform/audio/HRTFKernel.h
@@ -0,0 +1,98 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef HRTFKernel_h
+#define HRTFKernel_h
+
+#include "FFTFrame.h"
+#include <wtf/OwnPtr.h>
+#include <wtf/PassOwnPtr.h>
+#include <wtf/PassRefPtr.h>
+#include <wtf/RefCounted.h>
+#include <wtf/RefPtr.h>
+#include <wtf/Vector.h>
+
+namespace WebCore {
+
+class AudioChannel;
+
+// HRTF stands for Head-Related Transfer Function.
+// HRTFKernel is a frequency-domain representation of an impulse-response used as part of the spatialized panning system.
+// For a given azimuth / elevation angle there will be one HRTFKernel for the left ear transfer function, and one for the right ear.
+// The leading delay (average group delay) for each impulse response is extracted:
+// m_fftFrame is the frequency-domain representation of the impulse response with the delay removed
+// m_frameDelay is the leading delay of the original impulse response.
+class HRTFKernel : public RefCounted<HRTFKernel> {
+public:
+ // Note: this is destructive on the passed in AudioChannel.
+ // The length of channel must be a power of two.
+ static PassRefPtr<HRTFKernel> create(AudioChannel* channel, size_t fftSize, double sampleRate, bool bassBoost)
+ {
+ return adoptRef(new HRTFKernel(channel, fftSize, sampleRate, bassBoost));
+ }
+
+ static PassRefPtr<HRTFKernel> create(PassOwnPtr<FFTFrame> fftFrame, double frameDelay, double sampleRate)
+ {
+ return adoptRef(new HRTFKernel(fftFrame, frameDelay, sampleRate));
+ }
+
+ // Given two HRTFKernels, and an interpolation factor x: 0 -> 1, returns an interpolated HRTFKernel.
+ static PassRefPtr<HRTFKernel> createInterpolatedKernel(HRTFKernel* kernel1, HRTFKernel* kernel2, double x);
+
+ FFTFrame* fftFrame() { return m_fftFrame.get(); }
+
+ size_t fftSize() const { return m_fftFrame->fftSize(); }
+ double frameDelay() const { return m_frameDelay; }
+
+ double sampleRate() const { return m_sampleRate; }
+ double nyquist() const { return 0.5 * sampleRate(); }
+
+ // Converts back into impulse-response form.
+ PassOwnPtr<AudioChannel> createImpulseResponse();
+
+private:
+ // Note: this is destructive on the passed in AudioChannel.
+ HRTFKernel(AudioChannel* channel, size_t fftSize, double sampleRate, bool bassBoost);
+
+ HRTFKernel(PassOwnPtr<FFTFrame> fftFrame, double frameDelay, double sampleRate)
+ : m_fftFrame(fftFrame)
+ , m_frameDelay(frameDelay)
+ , m_sampleRate(sampleRate)
+ {
+ }
+
+ OwnPtr<FFTFrame> m_fftFrame;
+ double m_frameDelay;
+ double m_sampleRate;
+};
+
+typedef Vector<RefPtr<HRTFKernel> > HRTFKernelList;
+
+} // namespace WebCore
+
+#endif // HRTFKernel_h
diff --git a/WebCore/platform/audio/mac/AudioDestinationMac.cpp b/WebCore/platform/audio/mac/AudioDestinationMac.cpp
new file mode 100644
index 0000000..523729f
--- /dev/null
+++ b/WebCore/platform/audio/mac/AudioDestinationMac.cpp
@@ -0,0 +1,171 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#if ENABLE(WEB_AUDIO)
+
+#include "AudioDestinationMac.h"
+
+#include "AudioSourceProvider.h"
+#include <CoreAudio/AudioHardware.h>
+
+namespace WebCore {
+
+const int kBufferSize = 128;
+
+// Factory method: Mac-implementation
+PassOwnPtr<AudioDestination> AudioDestination::create(AudioSourceProvider& provider, double sampleRate)
+{
+ return adoptPtr(new AudioDestinationMac(provider, sampleRate));
+}
+
+double AudioDestination::hardwareSampleRate()
+{
+ // Determine the default output device's sample-rate.
+ AudioDeviceID deviceID = kAudioDeviceUnknown;
+ UInt32 infoSize = sizeof(deviceID);
+
+ AudioObjectPropertyAddress defaultInputDeviceAddress = { kAudioHardwarePropertyDefaultInputDevice, kAudioObjectPropertyScopeGlobal, kAudioObjectPropertyElementMaster };
+ OSStatus result = AudioObjectGetPropertyData(kAudioObjectSystemObject, &defaultInputDeviceAddress, 0, 0, &infoSize, (void*)&deviceID);
+ if (result)
+ return 0.0; // error
+
+ Float64 nominalSampleRate;
+ infoSize = sizeof(Float64);
+
+ AudioObjectPropertyAddress nominalSampleRateAddress = { kAudioDevicePropertyNominalSampleRate, kAudioObjectPropertyScopeGlobal, kAudioObjectPropertyElementMaster };
+ result = AudioObjectGetPropertyData(deviceID, &nominalSampleRateAddress, 0, 0, &infoSize, (void*)&nominalSampleRate);
+ if (result)
+ return 0.0; // error
+
+ return nominalSampleRate;
+}
+
+AudioDestinationMac::AudioDestinationMac(AudioSourceProvider& provider, double sampleRate)
+ : m_outputUnit(0)
+ , m_provider(provider)
+ , m_renderBus(2, kBufferSize, false)
+ , m_sampleRate(sampleRate)
+ , m_isPlaying(false)
+{
+ // Open and initialize DefaultOutputUnit
+ Component comp;
+ ComponentDescription desc;
+
+ desc.componentType = kAudioUnitType_Output;
+ desc.componentSubType = kAudioUnitSubType_DefaultOutput;
+ desc.componentManufacturer = kAudioUnitManufacturer_Apple;
+ desc.componentFlags = 0;
+ desc.componentFlagsMask = 0;
+ comp = FindNextComponent(0, &desc);
+
+ ASSERT(comp);
+
+ OSStatus result = OpenAComponent(comp, &m_outputUnit);
+ ASSERT(!result);
+
+ result = AudioUnitInitialize(m_outputUnit);
+ ASSERT(!result);
+
+ configure();
+}
+
+AudioDestinationMac::~AudioDestinationMac()
+{
+ if (m_outputUnit)
+ CloseComponent(m_outputUnit);
+}
+
+void AudioDestinationMac::configure()
+{
+ // Set render callback
+ AURenderCallbackStruct input;
+ input.inputProc = inputProc;
+ input.inputProcRefCon = this;
+ OSStatus result = AudioUnitSetProperty(m_outputUnit, kAudioUnitProperty_SetRenderCallback, kAudioUnitScope_Global, 0, &input, sizeof(input));
+ ASSERT(!result);
+
+ // Set stream format
+ AudioStreamBasicDescription streamFormat;
+ streamFormat.mSampleRate = m_sampleRate;
+ streamFormat.mFormatID = kAudioFormatLinearPCM;
+ streamFormat.mFormatFlags = kAudioFormatFlagsCanonical | kAudioFormatFlagIsNonInterleaved;
+ streamFormat.mBitsPerChannel = 8 * sizeof(AudioSampleType);
+ streamFormat.mChannelsPerFrame = 2;
+ streamFormat.mFramesPerPacket = 1;
+ streamFormat.mBytesPerPacket = sizeof(AudioSampleType);
+ streamFormat.mBytesPerFrame = sizeof(AudioSampleType);
+
+ result = AudioUnitSetProperty(m_outputUnit, kAudioUnitProperty_StreamFormat, kAudioUnitScope_Input, 0, (void*)&streamFormat, sizeof(AudioStreamBasicDescription));
+ ASSERT(!result);
+
+ // Set the buffer frame size.
+ UInt32 bufferSize = kBufferSize;
+ result = AudioUnitSetProperty(m_outputUnit, kAudioDevicePropertyBufferFrameSize, kAudioUnitScope_Output, 0, (void*)&bufferSize, sizeof(bufferSize));
+ ASSERT(!result);
+}
+
+void AudioDestinationMac::start()
+{
+ OSStatus result = AudioOutputUnitStart(m_outputUnit);
+
+ if (!result)
+ m_isPlaying = true;
+}
+
+void AudioDestinationMac::stop()
+{
+ OSStatus result = AudioOutputUnitStop(m_outputUnit);
+
+ if (!result)
+ m_isPlaying = false;
+}
+
+// Pulls on our provider to get rendered audio stream.
+OSStatus AudioDestinationMac::render(UInt32 numberOfFrames, AudioBufferList* ioData)
+{
+ AudioBuffer* buffers = ioData->mBuffers;
+ m_renderBus.setChannelMemory(0, (float*)buffers[0].mData, numberOfFrames);
+ m_renderBus.setChannelMemory(1, (float*)buffers[1].mData, numberOfFrames);
+
+ m_provider.provideInput(&m_renderBus, numberOfFrames);
+
+ return noErr;
+}
+
+// DefaultOutputUnit callback
+OSStatus AudioDestinationMac::inputProc(void* userData, AudioUnitRenderActionFlags*, const AudioTimeStamp*, UInt32 /*busNumber*/, UInt32 numberOfFrames, AudioBufferList* ioData)
+{
+ AudioDestinationMac* audioOutput = static_cast<AudioDestinationMac*>(userData);
+ return audioOutput->render(numberOfFrames, ioData);
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(WEB_AUDIO)
diff --git a/WebCore/platform/audio/mac/AudioDestinationMac.h b/WebCore/platform/audio/mac/AudioDestinationMac.h
new file mode 100644
index 0000000..197440c
--- /dev/null
+++ b/WebCore/platform/audio/mac/AudioDestinationMac.h
@@ -0,0 +1,69 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef AudioDestinationMac_h
+#define AudioDestinationMac_h
+
+#include "AudioBus.h"
+#include "AudioDestination.h"
+#include <AudioUnit/AudioUnit.h>
+
+namespace WebCore {
+
+// An AudioDestination using CoreAudio's default output AudioUnit
+
+class AudioDestinationMac : public AudioDestination {
+public:
+ AudioDestinationMac(AudioSourceProvider&, double sampleRate);
+ virtual ~AudioDestinationMac();
+
+ virtual void start();
+ virtual void stop();
+ bool isPlaying() { return m_isPlaying; }
+
+ double sampleRate() const { return m_sampleRate; }
+
+private:
+ void configure();
+
+ // DefaultOutputUnit callback
+ static OSStatus inputProc(void* userData, AudioUnitRenderActionFlags*, const AudioTimeStamp*, UInt32 busNumber, UInt32 numberOfFrames, AudioBufferList* ioData);
+
+ OSStatus render(UInt32 numberOfFrames, AudioBufferList* ioData);
+
+ AudioUnit m_outputUnit;
+ AudioSourceProvider& m_provider;
+ AudioBus m_renderBus;
+
+ double m_sampleRate;
+ bool m_isPlaying;
+};
+
+} // namespace WebCore
+
+#endif // AudioDestinationMac_h
diff --git a/WebCore/platform/brew/ClipboardBrew.cpp b/WebCore/platform/brew/ClipboardBrew.cpp
index 720d6a6..10025d6 100644
--- a/WebCore/platform/brew/ClipboardBrew.cpp
+++ b/WebCore/platform/brew/ClipboardBrew.cpp
@@ -41,8 +41,8 @@ PassRefPtr<Clipboard> Clipboard::create(ClipboardAccessPolicy, DragData*, Frame*
return 0;
}
-ClipboardBrew::ClipboardBrew(ClipboardAccessPolicy policy, bool isForDragging)
- : Clipboard(policy, isForDragging)
+ClipboardBrew::ClipboardBrew(ClipboardAccessPolicy policy, ClipboardType clipboardType)
+ : Clipboard(clipboardType, isForDragging)
{
}
@@ -52,12 +52,12 @@ ClipboardBrew::~ClipboardBrew()
void ClipboardBrew::clearData(const String&)
{
- ASSERT(isForDragging());
+ ASSERT(isForDragAndDrop());
}
void ClipboardBrew::clearAllData()
{
- ASSERT(isForDragging());
+ ASSERT(isForDragAndDrop());
}
String ClipboardBrew::getData(const String&, bool& success) const
@@ -68,7 +68,7 @@ String ClipboardBrew::getData(const String&, bool& success) const
bool ClipboardBrew::setData(const String&, const String&)
{
- ASSERT(isForDragging());
+ ASSERT(isForDragAndDrop());
return false;
}
diff --git a/WebCore/platform/brew/ClipboardBrew.h b/WebCore/platform/brew/ClipboardBrew.h
index a966db1..1faf031 100644
--- a/WebCore/platform/brew/ClipboardBrew.h
+++ b/WebCore/platform/brew/ClipboardBrew.h
@@ -36,7 +36,7 @@ class CachedImage;
class ClipboardBrew : public Clipboard, public CachedResourceClient {
public:
- ClipboardBrew(ClipboardAccessPolicy policy, bool isForDragging);
+ ClipboardBrew(ClipboardAccessPolicy policy, ClipboardType);
~ClipboardBrew();
void clearData(const String&);
diff --git a/WebCore/platform/brew/FileSystemBrew.cpp b/WebCore/platform/brew/FileSystemBrew.cpp
index 88aa05b..a723e63 100644
--- a/WebCore/platform/brew/FileSystemBrew.cpp
+++ b/WebCore/platform/brew/FileSystemBrew.cpp
@@ -131,7 +131,7 @@ static String canonicalPath(const String& path)
return canonPath;
}
-static bool makeAllDirectories(PassOwnPtr<IFileMgr> fileMgr, const String& path)
+static bool makeAllDirectories(IFileMgr* fileManager, const String& path)
{
if (path == canonicalPath(AEEFS_HOME_DIR))
return true;
@@ -144,7 +144,7 @@ static bool makeAllDirectories(PassOwnPtr<IFileMgr> fileMgr, const String& path)
}
if (lastDivPos > 0) {
- if (!makeAllDirectories(fileMgr.release(), path.substring(0, lastDivPos)))
+ if (!makeAllDirectories(fileManager, path.substring(0, lastDivPos)))
return false;
}
@@ -152,10 +152,10 @@ static bool makeAllDirectories(PassOwnPtr<IFileMgr> fileMgr, const String& path)
// IFILEMGR_MkDir return SUCCESS when the file is successfully created or if file already exists.
// So we need to check fileinfo.attrib.
- IFILEMGR_MkDir(fileMgr.get(), folder.utf8().data());
+ IFILEMGR_MkDir(fileManager, folder.utf8().data());
FileInfo fileInfo;
- if (IFILEMGR_GetInfo(fileMgr.get(), folder.utf8().data(), &fileInfo) != SUCCESS)
+ if (IFILEMGR_GetInfo(fileManager, folder.utf8().data(), &fileInfo) != SUCCESS)
return false;
return fileInfo.attrib & _FA_DIR;
@@ -165,12 +165,13 @@ bool makeAllDirectories(const String& path)
{
OwnPtr<IFileMgr> fileMgr = createInstance<IFileMgr>(AEECLSID_FILEMGR);
- return makeAllDirectories(fileMgr.release(), canonicalPath(path));
+ return makeAllDirectories(fileMgr.get(), canonicalPath(path));
}
String homeDirectoryPath()
{
- return String(AEEFS_HOME_DIR);
+ const int webViewClassId = 0x010aa04c;
+ return String::format("fs:/~0X%08X/", webViewClassId);
}
String pathGetFileName(const String& path)
diff --git a/WebCore/platform/brew/LocalizedStringsBrew.cpp b/WebCore/platform/brew/LocalizedStringsBrew.cpp
index 1bc5985..2dfd12b 100644
--- a/WebCore/platform/brew/LocalizedStringsBrew.cpp
+++ b/WebCore/platform/brew/LocalizedStringsBrew.cpp
@@ -96,6 +96,56 @@ String contextMenuItemTagCopyImageToClipboard()
return "Copy image to clipboard";
}
+String contextMenuItemTagOpenVideoInNewWindow()
+{
+ return "Open video in new window";
+}
+
+String contextMenuItemTagOpenAudioInNewWindow()
+{
+ return "Open audio in new window";
+}
+
+String contextMenuItemTagCopyVideoLinkToClipboard()
+{
+ return "Copy Video link location";
+}
+
+String contextMenuItemTagCopyAudioLinkToClipboard()
+{
+ return "Copy audio link location";
+}
+
+String contextMenuItemTagToggleMediaControls()
+{
+ return "Toggle media controls";
+}
+
+String contextMenuItemTagToggleMediaLoop()
+{
+ return "Toggle media loop playback";
+}
+
+String contextMenuItemTagEnterVideoFullscreen()
+{
+ return "Switch video to fullscreen";
+}
+
+String contextMenuItemTagMediaPlay()
+{
+ return "Play";
+}
+
+String contextMenuItemTagMediaPause()
+{
+ return "Pause";
+}
+
+String contextMenuItemTagMediaMute()
+{
+ return "Mute";
+}
+
String contextMenuItemTagOpenFrameInNewWindow()
{
return "Open frame in new window";
diff --git a/WebCore/platform/brew/PasteboardBrew.cpp b/WebCore/platform/brew/PasteboardBrew.cpp
new file mode 100644
index 0000000..e5049b4
--- /dev/null
+++ b/WebCore/platform/brew/PasteboardBrew.cpp
@@ -0,0 +1,93 @@
+/*
+ * Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
+ * Copyright (C) 2009 Company 100, Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+
+#include "config.h"
+#include "Pasteboard.h"
+
+#include "DocumentFragment.h"
+#include "NotImplemented.h"
+#include "Range.h"
+
+#include <wtf/text/CString.h>
+
+namespace WebCore {
+
+Pasteboard* Pasteboard::generalPasteboard()
+{
+ static Pasteboard* pasteboard = new Pasteboard;
+ return pasteboard;
+}
+
+Pasteboard::Pasteboard()
+{
+ notImplemented();
+}
+
+void Pasteboard::clear()
+{
+ notImplemented();
+}
+
+void Pasteboard::writeSelection(Range* selectedRange, bool canSmartCopyOrDelete, Frame* frame)
+{
+ notImplemented();
+}
+
+void Pasteboard::writePlainText(const String& text)
+{
+ notImplemented();
+}
+
+void Pasteboard::writeURL(const KURL& url, const String& titleStr, Frame* frame)
+{
+ notImplemented();
+}
+
+void Pasteboard::writeImage(Node* node, const KURL&, const String&)
+{
+ notImplemented();
+}
+
+bool Pasteboard::canSmartReplace()
+{
+ notImplemented();
+ return false;
+}
+
+String Pasteboard::plainText(Frame* frame)
+{
+ notImplemented();
+ return String();
+}
+
+PassRefPtr<DocumentFragment> Pasteboard::documentFragment(Frame* frame, PassRefPtr<Range> context, bool allowPlainText, bool& chosePlainText)
+{
+ notImplemented();
+ return 0;
+}
+
+} // namespace WebCore
diff --git a/WebCore/platform/brew/PlatformKeyboardEventBrew.cpp b/WebCore/platform/brew/PlatformKeyboardEventBrew.cpp
index d7a1279..3384a4f 100644
--- a/WebCore/platform/brew/PlatformKeyboardEventBrew.cpp
+++ b/WebCore/platform/brew/PlatformKeyboardEventBrew.cpp
@@ -98,6 +98,8 @@ static String keyIdentifierForBrewKeyCode(uint16 keyCode)
return "PageUp";
case AVK_TXPGDOWN:
return "PageDown";
+ case AVK_FUNCTION:
+ return "U+0009";
default:
return String::format("U+%04X", toASCIIUpper(keyCode));
}
@@ -132,6 +134,8 @@ static int windowsKeyCodeForKeyEvent(uint16 code)
return VK_INSERT; // (2D) INS key
case AVK_TXDELETE:
return VK_DELETE; // (2E) DEL key
+ case AVK_FUNCTION:
+ return VK_TAB; // (09) TAB key
default:
return 0;
}
diff --git a/WebCore/platform/brew/PlatformTouchEventBrew.cpp b/WebCore/platform/brew/PlatformTouchEventBrew.cpp
new file mode 100644
index 0000000..9f31dae
--- /dev/null
+++ b/WebCore/platform/brew/PlatformTouchEventBrew.cpp
@@ -0,0 +1,76 @@
+/*
+ * Copyright 2010, Company 100, 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``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 "PlatformTouchEvent.h"
+
+#include <AEEEvent.h>
+#include <AEEPointerHelpers.h>
+#include <AEEVCodes.h>
+
+#if ENABLE(TOUCH_EVENTS)
+
+namespace WebCore {
+
+PlatformTouchEvent::PlatformTouchEvent(AEEEvent event, uint16 wParam, uint32 dwParam)
+ : m_metaKey(false)
+{
+ PlatformTouchPoint::State state;
+
+ switch (event) {
+ case EVT_POINTER_DOWN:
+ m_type = TouchStart;
+ state = PlatformTouchPoint::TouchPressed;
+ break;
+ case EVT_POINTER_UP:
+ m_type = TouchEnd;
+ state = PlatformTouchPoint::TouchReleased;
+ break;
+ case EVT_POINTER_MOVE:
+ case EVT_POINTER_STALE_MOVE:
+ m_type = TouchMove;
+ state = PlatformTouchPoint::TouchMoved;
+ break;
+ default:
+ ASSERT_NOT_REACHED();
+ }
+
+ char* dwParamStr = reinterpret_cast<char*>(dwParam);
+ int x, y;
+ AEE_POINTER_GET_XY(dwParamStr, &x, &y);
+ IntPoint windowPos = IntPoint(x, y);
+
+ int id = AEE_POINTER_GET_PTRID(dwParamStr);
+ m_touchPoints.append(PlatformTouchPoint(id, windowPos, state));
+
+ uint32 keyModifiers = AEE_POINTER_GET_KEY_MODIFIERS(dwParamStr);
+ m_altKey = keyModifiers & (KB_LALT | KB_RALT);
+ m_shiftKey = keyModifiers & (KB_LSHIFT | KB_RSHIFT);
+ m_ctrlKey = keyModifiers & (KB_LCTRL | KB_RCTRL);
+}
+
+}
+
+#endif
diff --git a/WebCore/platform/brew/PlatformTouchPointBrew.cpp b/WebCore/platform/brew/PlatformTouchPointBrew.cpp
new file mode 100644
index 0000000..6943182
--- /dev/null
+++ b/WebCore/platform/brew/PlatformTouchPointBrew.cpp
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2010, Company 100, 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``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 "PlatformTouchPoint.h"
+
+#if ENABLE(TOUCH_EVENTS)
+
+namespace WebCore {
+
+PlatformTouchPoint::PlatformTouchPoint(int id, const IntPoint& windowPos, State state)
+ : m_id(id)
+ , m_state(state)
+ , m_screenPos(windowPos)
+ , m_pos(windowPos) { }
+
+}
+
+#endif
diff --git a/WebCore/platform/chromium/ChromiumBridge.h b/WebCore/platform/chromium/ChromiumBridge.h
index 894799c..121ec4b 100644
--- a/WebCore/platform/chromium/ChromiumBridge.h
+++ b/WebCore/platform/chromium/ChromiumBridge.h
@@ -143,7 +143,7 @@ namespace WebCore {
#if OS(WINDOWS)
static bool ensureFontLoaded(HFONT font);
#endif
-#if OS(LINUX)
+#if OS(LINUX) || OS(FREEBSD)
static void getRenderStyleForStrike(const char* family, int sizeAndStyle, FontRenderStyle* result);
static String getFontFamilyForCharacters(const UChar*, size_t numCharacters);
#endif
diff --git a/WebCore/platform/chromium/ClipboardChromium.cpp b/WebCore/platform/chromium/ClipboardChromium.cpp
index 3d82aea..c2ec80c 100644
--- a/WebCore/platform/chromium/ClipboardChromium.cpp
+++ b/WebCore/platform/chromium/ClipboardChromium.cpp
@@ -93,23 +93,23 @@ static ClipboardDataType clipboardTypeFromMIMEType(const String& type)
PassRefPtr<Clipboard> Clipboard::create(ClipboardAccessPolicy policy, DragData* dragData, Frame* frame)
{
- return ClipboardChromium::create(true, dragData->platformData(), policy, frame);
+ return ClipboardChromium::create(DragAndDrop, dragData->platformData(), policy, frame);
}
-ClipboardChromium::ClipboardChromium(bool isForDragging,
+ClipboardChromium::ClipboardChromium(ClipboardType clipboardType,
PassRefPtr<ChromiumDataObject> dataObject,
ClipboardAccessPolicy policy,
Frame* frame)
- : Clipboard(policy, isForDragging)
+ : Clipboard(policy, clipboardType)
, m_dataObject(dataObject)
, m_frame(frame)
{
}
-PassRefPtr<ClipboardChromium> ClipboardChromium::create(bool isForDragging,
+PassRefPtr<ClipboardChromium> ClipboardChromium::create(ClipboardType clipboardType,
PassRefPtr<ChromiumDataObject> dataObject, ClipboardAccessPolicy policy, Frame* frame)
{
- return adoptRef(new ClipboardChromium(isForDragging, dataObject, policy, frame));
+ return adoptRef(new ClipboardChromium(clipboardType, dataObject, policy, frame));
}
void ClipboardChromium::clearData(const String& type)
@@ -203,9 +203,7 @@ String ClipboardChromium::getData(const String& type, bool& success) const
return m_dataObject->downloadMetadata;
case ClipboardDataTypePlainText:
- if (!isForDragging()) {
- // If this isn't for a drag, it's for a cut/paste event handler.
- // In this case, we need to check the clipboard.
+ if (isForCopyAndPaste()) {
PasteboardPrivate::ClipboardBuffer buffer =
Pasteboard::generalPasteboard()->isSelectionMode() ?
PasteboardPrivate::SelectionBuffer :
@@ -219,9 +217,7 @@ String ClipboardChromium::getData(const String& type, bool& success) const
return m_dataObject->plainText;
case ClipboardDataTypeHTML:
- if (!isForDragging()) {
- // If this isn't for a drag, it's for a cut/paste event handler.
- // In this case, we need to check the clipboard.
+ if (isForCopyAndPaste()) {
PasteboardPrivate::ClipboardBuffer buffer =
Pasteboard::generalPasteboard()->isSelectionMode() ?
PasteboardPrivate::SelectionBuffer :
diff --git a/WebCore/platform/chromium/ClipboardChromium.h b/WebCore/platform/chromium/ClipboardChromium.h
index a4150d0..14f59e9 100644
--- a/WebCore/platform/chromium/ClipboardChromium.h
+++ b/WebCore/platform/chromium/ClipboardChromium.h
@@ -46,7 +46,7 @@ namespace WebCore {
~ClipboardChromium() {}
static PassRefPtr<ClipboardChromium> create(
- bool isForDragging, PassRefPtr<ChromiumDataObject>, ClipboardAccessPolicy, Frame*);
+ ClipboardType, PassRefPtr<ChromiumDataObject>, ClipboardAccessPolicy, Frame*);
// Returns the file name (not including the extension). This removes any
// invalid file system characters as well as making sure the
@@ -80,7 +80,7 @@ namespace WebCore {
virtual bool hasData();
private:
- ClipboardChromium(bool, PassRefPtr<ChromiumDataObject>, ClipboardAccessPolicy, Frame*);
+ ClipboardChromium(ClipboardType, PassRefPtr<ChromiumDataObject>, ClipboardAccessPolicy, Frame*);
void resetFromClipboard();
void setDragImage(CachedImage*, Node*, const IntPoint&);
diff --git a/WebCore/platform/chromium/ScrollbarThemeChromiumLinux.cpp b/WebCore/platform/chromium/ScrollbarThemeChromiumLinux.cpp
index 19b4a54..d8f2c79 100644
--- a/WebCore/platform/chromium/ScrollbarThemeChromiumLinux.cpp
+++ b/WebCore/platform/chromium/ScrollbarThemeChromiumLinux.cpp
@@ -115,7 +115,7 @@ void ScrollbarThemeChromiumLinux::paintButton(GraphicsContext* gc, Scrollbar* sc
ControlStates states = 0;
// Determine if the button can be pressed.
if (((direction == PlatformThemeChromiumGtk::West || direction == PlatformThemeChromiumGtk::North) && scrollbar->currentPos())
- || (direction == PlatformThemeChromiumGtk::East || direction == PlatformThemeChromiumGtk::South) && scrollbar->currentPos() != scrollbar->maximum())
+ || ((direction == PlatformThemeChromiumGtk::East || direction == PlatformThemeChromiumGtk::South) && scrollbar->currentPos() != scrollbar->maximum()))
states |= EnabledState;
if (states & EnabledState) {
diff --git a/WebCore/platform/efl/ClipboardEfl.cpp b/WebCore/platform/efl/ClipboardEfl.cpp
index 6fc80dc..a7c2a54 100644
--- a/WebCore/platform/efl/ClipboardEfl.cpp
+++ b/WebCore/platform/efl/ClipboardEfl.cpp
@@ -29,7 +29,7 @@
namespace WebCore {
PassRefPtr<Clipboard> Editor::newGeneralClipboard(ClipboardAccessPolicy policy, Frame*)
{
- return ClipboardEfl::create(policy, false);
+ return ClipboardEfl::create(policy, Clipboard::CopyAndPaste);
}
PassRefPtr<Clipboard> Clipboard::create(ClipboardAccessPolicy, DragData*, Frame*)
@@ -37,8 +37,8 @@ PassRefPtr<Clipboard> Clipboard::create(ClipboardAccessPolicy, DragData*, Frame*
return 0;
}
-ClipboardEfl::ClipboardEfl(ClipboardAccessPolicy policy, bool forDragging)
- : Clipboard(policy, forDragging)
+ClipboardEfl::ClipboardEfl(ClipboardAccessPolicy policy, ClipboardType clipboardType)
+ : Clipboard(policy, clipboardType)
{
notImplemented();
}
diff --git a/WebCore/platform/efl/ClipboardEfl.h b/WebCore/platform/efl/ClipboardEfl.h
index 5db2fed..06f4e58 100644
--- a/WebCore/platform/efl/ClipboardEfl.h
+++ b/WebCore/platform/efl/ClipboardEfl.h
@@ -28,9 +28,9 @@ class CachedImage;
class ClipboardEfl : public Clipboard {
public:
- static PassRefPtr<ClipboardEfl> create(ClipboardAccessPolicy policy, bool forDragging = false)
+ static PassRefPtr<ClipboardEfl> create(ClipboardAccessPolicy policy, ClipboardType clipboardType = CopyAndPaste)
{
- return adoptRef(new ClipboardEfl(policy, forDragging));
+ return adoptRef(new ClipboardEfl(policy, clipboardType));
}
~ClipboardEfl();
@@ -58,7 +58,7 @@ public:
virtual void writePlainText(const WTF::String&);
private:
- ClipboardEfl(ClipboardAccessPolicy, bool);
+ ClipboardEfl(ClipboardAccessPolicy, ClipboardType);
};
}
diff --git a/WebCore/platform/efl/LocalizedStringsEfl.cpp b/WebCore/platform/efl/LocalizedStringsEfl.cpp
index 6023205..a81434f 100644
--- a/WebCore/platform/efl/LocalizedStringsEfl.cpp
+++ b/WebCore/platform/efl/LocalizedStringsEfl.cpp
@@ -98,6 +98,56 @@ String contextMenuItemTagCopyImageToClipboard()
return String::fromUTF8("Copy Image");
}
+String contextMenuItemTagOpenVideoInNewWindow()
+{
+ return String::fromUTF8("Open Video in New Window");
+}
+
+String contextMenuItemTagOpenAudioInNewWindow()
+{
+ return String::fromUTF8("Open Audio in New Window");
+}
+
+String contextMenuItemTagCopyVideoLinkToClipboard()
+{
+ return String::fromUTF8("Copy Video Link Location");
+}
+
+String contextMenuItemTagCopyAudioLinkToClipboard()
+{
+ return String::fromUTF8("Copy Audio Link Location");
+}
+
+String contextMenuItemTagToggleMediaControls()
+{
+ return String::fromUTF8("Toggle Media Controls");
+}
+
+String contextMenuItemTagToggleMediaLoop()
+{
+ return String::fromUTF8("Toggle Media Loop Playback");
+}
+
+String contextMenuItemTagEnterVideoFullscreen()
+{
+ return String::fromUTF8("Switch Video to Fullscreen");
+}
+
+String contextMenuItemTagMediaPlay()
+{
+ return String::fromUTF8("Play");
+}
+
+String contextMenuItemTagMediaPause()
+{
+ return String::fromUTF8("Pause");
+}
+
+String contextMenuItemTagMediaMute()
+{
+ return String::fromUTF8("Mute");
+}
+
String contextMenuItemTagOpenFrameInNewWindow()
{
return String::fromUTF8("Open Frame in New Window");
diff --git a/WebCore/platform/efl/RenderThemeEfl.cpp b/WebCore/platform/efl/RenderThemeEfl.cpp
index 102f754..53997be 100644
--- a/WebCore/platform/efl/RenderThemeEfl.cpp
+++ b/WebCore/platform/efl/RenderThemeEfl.cpp
@@ -78,7 +78,7 @@ bool RenderThemeEfl::themePartCacheEntryReset(struct ThemePartCacheEntry* ce, Fo
ASSERT(group);
if (!edje_object_file_set(ce->o, file, group)) {
- int err = edje_object_load_error_get(ce->o);
+ Edje_Load_Error err = edje_object_load_error_get(ce->o);
const char *errmsg = edje_load_error_str(err);
EINA_LOG_ERR("Could not load '%s' from theme %s: %s",
group, file, errmsg);
@@ -421,7 +421,7 @@ void RenderThemeEfl::createEdje()
if (!m_edje)
EINA_LOG_ERR("Could not create base edje object.");
else if (!edje_object_file_set(m_edje, theme.utf8().data(), "webkit/base")) {
- int err = edje_object_load_error_get(m_edje);
+ Edje_Load_Error err = edje_object_load_error_get(m_edje);
const char* errmsg = edje_load_error_str(err);
EINA_LOG_ERR("Could not load 'webkit/base' from theme %s: %s",
theme.utf8().data(), errmsg);
@@ -600,7 +600,7 @@ void RenderThemeEfl::applyPartDescriptions()
const char* group = edjeGroupFromFormType(type);
m_partDescs[i].type = type;
if (!edje_object_file_set(o, file, group)) {
- int err = edje_object_load_error_get(o);
+ Edje_Load_Error err = edje_object_load_error_get(o);
const char* errmsg = edje_load_error_str(err);
EINA_LOG_ERR("Could not set theme group '%s' of file '%s': %s",
group, file, errmsg);
diff --git a/WebCore/platform/efl/ScrollbarEfl.cpp b/WebCore/platform/efl/ScrollbarEfl.cpp
index 6b00a37..282ca7c 100644
--- a/WebCore/platform/efl/ScrollbarEfl.cpp
+++ b/WebCore/platform/efl/ScrollbarEfl.cpp
@@ -122,7 +122,7 @@ void ScrollbarEfl::setParent(ScrollView* view)
}
if (!edje_object_file_set(o, theme.utf8().data(), group)) {
- int err = edje_object_load_error_get(o);
+ Edje_Load_Error err = edje_object_load_error_get(o);
const char* errmsg = edje_load_error_str(err);
EINA_LOG_ERR("Could not load theme '%s' from file '%s': #%d '%s'",
group, theme.utf8().data(), err, errmsg);
diff --git a/WebCore/platform/graphics/Color.cpp b/WebCore/platform/graphics/Color.cpp
index 80c8286..f28d51c 100644
--- a/WebCore/platform/graphics/Color.cpp
+++ b/WebCore/platform/graphics/Color.cpp
@@ -26,13 +26,12 @@
#include "config.h"
#include "Color.h"
+#include "HashTools.h"
#include "PlatformString.h"
#include <math.h>
#include <wtf/Assertions.h>
#include <wtf/MathExtras.h>
-#include "ColorData.cpp"
-
using namespace std;
using namespace WTF;
diff --git a/WebCore/platform/graphics/qt/ContextShadow.cpp b/WebCore/platform/graphics/ContextShadow.cpp
index 4609923..1007962 100644
--- a/WebCore/platform/graphics/qt/ContextShadow.cpp
+++ b/WebCore/platform/graphics/ContextShadow.cpp
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2010 Sencha, Inc.
+ * Copyright (C) 2010 Igalia S.L.
*
* All rights reserved.
*
@@ -28,115 +29,50 @@
#include "config.h"
#include "ContextShadow.h"
-#include <QTimerEvent>
+#include <wtf/MathExtras.h>
#include <wtf/Noncopyable.h>
-namespace WebCore {
-
-// ContextShadow needs a scratch image as the buffer for the blur filter.
-// Instead of creating and destroying the buffer for every operation,
-// we create a buffer which will be automatically purged via a timer.
-
-class ShadowBuffer: public QObject {
-public:
- ShadowBuffer(QObject* parent = 0);
-
- QImage* scratchImage(const QSize& size);
-
- void schedulePurge();
-
-protected:
- void timerEvent(QTimerEvent* event);
-
-private:
- QImage image;
- int timerId;
-};
-
-ShadowBuffer::ShadowBuffer(QObject* parent)
- : QObject(parent)
- , timerId(0)
-{
-}
-
-QImage* ShadowBuffer::scratchImage(const QSize& size)
-{
- int width = size.width();
- int height = size.height();
-
- // We do not need to recreate the buffer if the buffer is reasonably
- // larger than the requested size. However, if the requested size is
- // much smaller than our buffer, reduce our buffer so that we will not
- // keep too many allocated pixels for too long.
- if (!image.isNull() && (image.width() > width) && (image.height() > height))
- if (((2 * width) > image.width()) && ((2 * height) > image.height())) {
- image.fill(Qt::transparent);
- return &image;
- }
-
- // Round to the nearest 32 pixels so we do not grow the buffer everytime
- // there is larger request by 1 pixel.
- width = (1 + (width >> 5)) << 5;
- height = (1 + (height >> 5)) << 5;
-
- image = QImage(width, height, QImage::Format_ARGB32_Premultiplied);
- image.fill(Qt::transparent);
- return &image;
-}
-
-void ShadowBuffer::schedulePurge()
-{
- static const double BufferPurgeDelay = 2; // seconds
- killTimer(timerId);
- timerId = startTimer(BufferPurgeDelay * 1000);
-}
-
-void ShadowBuffer::timerEvent(QTimerEvent* event)
-{
- if (event->timerId() == timerId) {
- killTimer(timerId);
- image = QImage();
- }
- QObject::timerEvent(event);
-}
+using WTF::min;
+using WTF::max;
-Q_GLOBAL_STATIC(ShadowBuffer, scratchShadowBuffer)
+namespace WebCore {
ContextShadow::ContextShadow()
- : type(NoShadow)
- , blurRadius(0)
+ : m_type(NoShadow)
+ , m_blurRadius(0)
{
}
-ContextShadow::ContextShadow(const QColor& c, float r, qreal dx, qreal dy)
- : color(c)
- , blurRadius(qRound(r))
- , offset(dx, dy)
+ContextShadow::ContextShadow(const Color& color, float radius, const FloatSize& offset)
+ : m_color(color)
+ , m_blurRadius(round(radius))
+ , m_offset(offset)
{
+ // See comments in http://webkit.org/b/40793, it seems sensible
+ // to follow Skia's limit of 128 pixels of blur radius
+ m_blurRadius = min(m_blurRadius, 128);
+
// The type of shadow is decided by the blur radius, shadow offset, and shadow color.
- if (!color.isValid() || !color.alpha()) {
+ if (!m_color.isValid() || !color.alpha()) {
// Can't paint the shadow with invalid or invisible color.
- type = NoShadow;
- } else if (r > 0) {
+ m_type = NoShadow;
+ } else if (radius > 0) {
// Shadow is always blurred, even the offset is zero.
- type = BlurShadow;
- } else if (offset.isNull()) {
+ m_type = BlurShadow;
+ } else if (!m_offset.width() && !m_offset.height()) {
// Without blur and zero offset means the shadow is fully hidden.
- type = NoShadow;
+ m_type = NoShadow;
} else {
- if (color.alpha() > 0)
- type = AlphaSolidShadow;
- else
- type = OpaqueSolidShadow;
+ m_type = SolidShadow;
}
}
void ContextShadow::clear()
{
- type = NoShadow;
- color = QColor();
- blurRadius = 0;
- offset = QPointF(0, 0);
+ m_type = NoShadow;
+ m_color = Color();
+ m_blurRadius = 0;
+ m_offset = FloatSize();
}
// Instead of integer division, we use 17.15 for fixed-point division.
@@ -146,27 +82,22 @@ static const int BlurSumShift = 15;
// As noted in the SVG filter specification, running box blur 3x
// approximates a real gaussian blur nicely.
-void shadowBlur(QImage& image, int radius, const QColor& shadowColor)
+void ContextShadow::blurLayerImage(unsigned char* imageData, const IntSize& size, int rowStride)
{
- // See comments in http://webkit.org/b/40793, it seems sensible
- // to follow Skia's limit of 128 pixels for the blur radius.
- if (radius > 128)
- radius = 128;
-
int channels[4] = { 3, 0, 1, 3 };
- int dmax = radius >> 1;
- int dmin = dmax - 1 + (radius & 1);
+ int dmax = m_blurRadius >> 1;
+ int dmin = dmax - 1 + (m_blurRadius & 1);
if (dmin < 0)
dmin = 0;
// Two stages: horizontal and vertical
for (int k = 0; k < 2; ++k) {
- unsigned char* pixels = image.bits();
- int stride = (!k) ? 4 : image.bytesPerLine();
- int delta = (!k) ? image.bytesPerLine() : 4;
- int jfinal = (!k) ? image.height() : image.width();
- int dim = (!k) ? image.width() : image.height();
+ unsigned char* pixels = imageData;
+ int stride = (!k) ? 4 : rowStride;
+ int delta = (!k) ? rowStride : 4;
+ int jfinal = (!k) ? size.height() : size.width();
+ int dim = (!k) ? size.width() : size.height();
for (int j = 0; j < jfinal; ++j, pixels += delta) {
@@ -213,74 +144,31 @@ void shadowBlur(QImage& image, int radius, const QColor& shadowColor)
}
}
}
-
- // "Colorize" with the right shadow color.
- QPainter p(&image);
- p.setCompositionMode(QPainter::CompositionMode_SourceIn);
- p.fillRect(image.rect(), shadowColor.rgb());
- p.end();
}
-QPainter* ContextShadow::beginShadowLayer(QPainter* p, const QRectF &rect)
+void ContextShadow::calculateLayerBoundingRect(const FloatRect& layerArea, const IntRect& clipRect)
{
- // We expand the area by the blur radius * 2 to give extra space
- // for the blur transition.
- int extra = (type == BlurShadow) ? blurRadius * 2 : 0;
-
- QRectF shadowRect = rect.translated(offset);
- QRectF bufferRect = shadowRect.adjusted(-extra, -extra, extra, extra);
- m_layerRect = bufferRect.toAlignedRect();
+ // Calculate the destination of the blurred layer.
+ FloatRect destinationRect(layerArea);
+ destinationRect.move(m_offset);
+ m_layerRect = enclosingIntRect(destinationRect);
- QRect clipRect;
- if (p->hasClipping())
-#if QT_VERSION >= QT_VERSION_CHECK(4, 8, 0)
- clipRect = p->clipBoundingRect();
-#else
- clipRect = p->clipRegion().boundingRect();
-#endif
- else
- clipRect = p->transform().inverted().mapRect(p->window());
+ // We expand the area by the blur radius * 2 to give extra space for the blur transition.
+ m_layerRect.inflate((m_type == BlurShadow) ? ceil(m_blurRadius * 2) : 0);
if (!clipRect.contains(m_layerRect)) {
-
// No need to have the buffer larger than the clip.
- m_layerRect = m_layerRect.intersected(clipRect);
+ m_layerRect.intersect(clipRect);
+
+ // If we are totally outside the clip region, we aren't painting at all.
if (m_layerRect.isEmpty())
- return 0;
+ return;
// We adjust again because the pixels at the borders are still
// potentially affected by the pixels outside the buffer.
- if (type == BlurShadow)
- m_layerRect.adjust(-extra, -extra, extra, extra);
+ if (m_type == BlurShadow)
+ m_layerRect.inflate((m_type == BlurShadow) ? ceil(m_blurRadius * 2) : 0);
}
-
- ShadowBuffer* shadowBuffer = scratchShadowBuffer();
- QImage* shadowImage = shadowBuffer->scratchImage(m_layerRect.size());
- m_layerImage = QImage(*shadowImage);
-
- m_layerPainter = new QPainter;
- m_layerPainter->begin(&m_layerImage);
- m_layerPainter->setFont(p->font());
- m_layerPainter->translate(offset);
-
- // The origin is now the top left corner of the scratch image.
- m_layerPainter->translate(-m_layerRect.topLeft());
-
- return m_layerPainter;
}
-void ContextShadow::endShadowLayer(QPainter* p)
-{
- m_layerPainter->end();
- delete m_layerPainter;
- m_layerPainter = 0;
-
- if (type == BlurShadow)
- shadowBlur(m_layerImage, blurRadius, color);
-
- p->drawImage(m_layerRect.topLeft(), m_layerImage);
-
- scratchShadowBuffer()->schedulePurge();
-}
-
-}
+} // namespace WebCore
diff --git a/WebCore/platform/graphics/qt/ContextShadow.h b/WebCore/platform/graphics/ContextShadow.h
index 7140340..ede9336 100644
--- a/WebCore/platform/graphics/qt/ContextShadow.h
+++ b/WebCore/platform/graphics/ContextShadow.h
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2010 Sencha, Inc.
+ * Copyright (C) 2010 Igalia S.L.
*
* All rights reserved.
*
@@ -28,7 +29,22 @@
#ifndef ContextShadow_h
#define ContextShadow_h
-#include <QPainter>
+#include "Color.h"
+#include "FloatRect.h"
+#include "IntRect.h"
+#include "RefCounted.h"
+
+#if PLATFORM(CAIRO)
+typedef struct _cairo cairo_t;
+typedef struct _cairo_surface cairo_surface_t;
+typedef cairo_surface_t* PlatformImage;
+typedef cairo_t* PlatformContext;
+#elif PLATFORM(QT)
+#include <QImage>
+class QPainter;
+typedef QImage PlatformImage;
+typedef QPainter* PlatformContext;
+#endif
namespace WebCore {
@@ -44,49 +60,57 @@ class ContextShadow {
public:
enum {
NoShadow,
- OpaqueSolidShadow,
- AlphaSolidShadow,
+ SolidShadow,
BlurShadow
- } type;
+ } m_type;
- QColor color;
- int blurRadius;
- QPointF offset;
+ Color m_color;
+ int m_blurRadius;
+ FloatSize m_offset;
ContextShadow();
- ContextShadow(const QColor& c, float r, qreal dx, qreal dy);
+ ContextShadow(const Color&, float radius, const FloatSize& offset);
void clear();
// The pair beginShadowLayer and endShadowLayer creates a temporary image
- // where the caller can draw onto, using the returned QPainter. This
- // QPainter instance must be used only to draw between the call to
- // beginShadowLayer and endShadowLayer.
+ // where the caller can draw onto, using the returned context. This context
+ // must be used only to draw between the call to beginShadowLayer and
+ // endShadowLayer.
//
- // Note: multiple/nested shadow layer is NOT allowed.
+ // Note: multiple/nested shadow layers are NOT allowed.
//
// The current clip region will be used to optimize the size of the
- // temporary image. Thus, the original painter should not change any
- // clipping until endShadowLayer.
- // If the shadow will be completely outside the clipping region,
- // beginShadowLayer will return 0.
+ // temporary image. Thus, the original context should not change any
+ // clipping until endShadowLayer. If the shadow will be completely outside
+ // the clipping region, beginShadowLayer will return 0.
//
- // The returned QPainter will have the transformation matrix and clipping
- // properly initialized to start doing the painting (no need to account
- // for the shadow offset), however it will not have the same render hints,
- // pen, brush, etc as the passed QPainter. This is intentional, usually
- // shadow has different properties than the shape which casts the shadow.
+ // The returned context will have the transformation matrix and clipping
+ // properly initialized to start doing the painting (no need to account for
+ // the shadow offset), however it will not have the same render hints, pen,
+ // brush, etc as the passed context. This is intentional, usually shadows
+ // have different properties than the shapes which cast them.
//
- // Once endShadowLayer is called, the temporary image will be drawn
- // with the original painter. If blur radius is specified, the shadow
- // will be filtered first.
- QPainter* beginShadowLayer(QPainter* p, const QRectF& rect);
- void endShadowLayer(QPainter* p);
+ // Once endShadowLayer is called, the temporary image will be drawn with the
+ // original context. If blur radius is specified, the shadow will be
+ // filtered first.
+
+ PlatformContext beginShadowLayer(PlatformContext, const FloatRect& layerArea);
+ void endShadowLayer(PlatformContext);
+ static void purgeScratchBuffer();
+
+#if PLATFORM(QT)
+ QPointF offset() { return QPointF(m_offset.width(), m_offset.height()); }
+#endif
+
private:
- QRect m_layerRect;
- QImage m_layerImage;
- QPainter* m_layerPainter;
+ IntRect m_layerRect;
+ PlatformImage m_layerImage;
+ PlatformContext m_layerContext;
+
+ void blurLayerImage(unsigned char*, const IntSize& imageSize, int stride);
+ void calculateLayerBoundingRect(const FloatRect& layerArea, const IntRect& clipRect);
};
} // namespace WebCore
diff --git a/WebCore/platform/graphics/Font.h b/WebCore/platform/graphics/Font.h
index d6cf140..1a321bd 100644
--- a/WebCore/platform/graphics/Font.h
+++ b/WebCore/platform/graphics/Font.h
@@ -191,8 +191,8 @@ public:
}
FontSelector* fontSelector() const;
- static bool treatAsSpace(UChar c) { return c == ' ' || c == '\t' || c == '\n' || c == 0x00A0; }
- static bool treatAsZeroWidthSpace(UChar c) { return c < 0x20 || (c >= 0x7F && c < 0xA0) || (c >= 0x200c && c <= 0x200f) || (c >= 0x202a && c <= 0x202e) || c == 0xFFFC; }
+ static bool treatAsSpace(UChar c) { return c == ' ' || c == '\t' || c == '\n' || c == noBreakSpace; }
+ static bool treatAsZeroWidthSpace(UChar c) { return c < 0x20 || (c >= 0x7F && c < 0xA0) || c == softHyphen || (c >= 0x200c && c <= 0x200f) || (c >= 0x202a && c <= 0x202e) || c == objectReplacementCharacter; }
static inline UChar normalizeSpaces(UChar character)
{
diff --git a/WebCore/platform/graphics/GlyphPageTreeNode.cpp b/WebCore/platform/graphics/GlyphPageTreeNode.cpp
index dac26b3..3df14b9 100644
--- a/WebCore/platform/graphics/GlyphPageTreeNode.cpp
+++ b/WebCore/platform/graphics/GlyphPageTreeNode.cpp
@@ -171,6 +171,7 @@ void GlyphPageTreeNode::initializePage(const FontData* fontData, unsigned pageNu
buffer[i] = zeroWidthSpace;
for (i = 0x7F; i < 0xA0; i++)
buffer[i] = zeroWidthSpace;
+ buffer[softHyphen] = zeroWidthSpace;
// \n, \t, and nonbreaking space must render as a space.
buffer[(int)'\n'] = ' ';
diff --git a/WebCore/platform/graphics/GraphicsContext.h b/WebCore/platform/graphics/GraphicsContext.h
index 7863b95..fd3bf2c 100644
--- a/WebCore/platform/graphics/GraphicsContext.h
+++ b/WebCore/platform/graphics/GraphicsContext.h
@@ -108,12 +108,6 @@ typedef unsigned char UInt8;
#endif
#endif
-#if PLATFORM(CHROMIUM)
-#define CanvasInterpolationQuality InterpolationMedium
-#else
-#define CanvasInterpolationQuality InterpolationDefault
-#endif
-
#if PLATFORM(QT) && defined(Q_WS_WIN)
#include <windows.h>
#endif
diff --git a/WebCore/platform/graphics/GraphicsContext3D.cpp b/WebCore/platform/graphics/GraphicsContext3D.cpp
index 2da5862..86e9569 100644
--- a/WebCore/platform/graphics/GraphicsContext3D.cpp
+++ b/WebCore/platform/graphics/GraphicsContext3D.cpp
@@ -255,6 +255,14 @@ void unpackRGB8ToRGBA8(const uint8_t* source, uint8_t* destination)
destination[3] = 0xFF;
}
+void unpackARGB8ToRGBA8(const uint8_t* source, uint8_t* destination)
+{
+ destination[0] = source[1];
+ destination[1] = source[2];
+ destination[2] = source[3];
+ destination[3] = source[0];
+}
+
void unpackBGRA8ToRGBA8(const uint8_t* source, uint8_t* destination)
{
destination[0] = source[2];
@@ -316,6 +324,14 @@ void unpackRA8ToRGBA8(const uint8_t* source, uint8_t* destination)
destination[3] = source[1];
}
+void unpackAR8ToRGBA8(const uint8_t* source, uint8_t* destination)
+{
+ destination[0] = source[1];
+ destination[1] = source[1];
+ destination[2] = source[1];
+ destination[3] = source[0];
+}
+
void unpackA8ToRGBA8(const uint8_t* source, uint8_t* destination)
{
destination[0] = 0x0;
@@ -634,6 +650,12 @@ static void doPacking(const void* sourceData,
doUnpackingAndPacking<uint8_t, DestType, unpackRGB8ToRGBA8, packingFunc>(static_cast<const uint8_t*>(sourceData), width, height, sourceElementsPerPixel, sourceElementsPerRow, destinationData, destinationElementsPerPixel);
break;
}
+ case GraphicsContext3D::kSourceFormatARGB8: {
+ unsigned int sourceElementsPerPixel, sourceElementsPerRow;
+ computeIncrementParameters<uint8_t>(width, 4, sourceUnpackAlignment, &sourceElementsPerPixel, &sourceElementsPerRow);
+ doUnpackingAndPacking<uint8_t, DestType, unpackARGB8ToRGBA8, packingFunc>(static_cast<const uint8_t*>(sourceData), width, height, sourceElementsPerPixel, sourceElementsPerRow, destinationData, destinationElementsPerPixel);
+ break;
+ }
case GraphicsContext3D::kSourceFormatBGRA8: {
unsigned int sourceElementsPerPixel, sourceElementsPerRow;
computeIncrementParameters<uint8_t>(width, 4, sourceUnpackAlignment, &sourceElementsPerPixel, &sourceElementsPerRow);
@@ -670,6 +692,12 @@ static void doPacking(const void* sourceData,
doUnpackingAndPacking<uint8_t, DestType, unpackRA8ToRGBA8, packingFunc>(static_cast<const uint8_t*>(sourceData), width, height, sourceElementsPerPixel, sourceElementsPerRow, destinationData, destinationElementsPerPixel);
break;
}
+ case GraphicsContext3D::kSourceFormatAR8: {
+ unsigned int sourceElementsPerPixel, sourceElementsPerRow;
+ computeIncrementParameters<uint8_t>(width, 2, sourceUnpackAlignment, &sourceElementsPerPixel, &sourceElementsPerRow);
+ doUnpackingAndPacking<uint8_t, DestType, unpackAR8ToRGBA8, packingFunc>(static_cast<const uint8_t*>(sourceData), width, height, sourceElementsPerPixel, sourceElementsPerRow, destinationData, destinationElementsPerPixel);
+ break;
+ }
case GraphicsContext3D::kSourceFormatA8: {
unsigned int sourceElementsPerPixel, sourceElementsPerRow;
computeIncrementParameters<uint8_t>(width, 1, sourceUnpackAlignment, &sourceElementsPerPixel, &sourceElementsPerRow);
diff --git a/WebCore/platform/graphics/GraphicsContext3D.h b/WebCore/platform/graphics/GraphicsContext3D.h
index bcb7997..a12b1c4 100644
--- a/WebCore/platform/graphics/GraphicsContext3D.h
+++ b/WebCore/platform/graphics/GraphicsContext3D.h
@@ -537,11 +537,13 @@ public:
kSourceFormatRGBA8,
kSourceFormatRGB8,
kSourceFormatBGRA8,
+ kSourceFormatARGB8,
kSourceFormatRGBA5551,
kSourceFormatRGBA4444,
kSourceFormatRGB565,
kSourceFormatR8,
kSourceFormatRA8,
+ kSourceFormatAR8,
kSourceFormatA8
};
@@ -834,14 +836,14 @@ public:
int m_currentWidth, m_currentHeight;
- typedef struct {
- String source;
- String log;
+#if PLATFORM(MAC)
+ typedef struct {
+ String source;
+ String log;
bool isValid;
} ShaderSourceEntry;
HashMap<Platform3DObject, ShaderSourceEntry> m_shaderSourceMap;
-#if PLATFORM(MAC)
ANGLEWebKitBridge m_compiler;
Attributes m_attrs;
diff --git a/WebCore/platform/graphics/GraphicsLayer.cpp b/WebCore/platform/graphics/GraphicsLayer.cpp
index b0f529b..412f06d 100644
--- a/WebCore/platform/graphics/GraphicsLayer.cpp
+++ b/WebCore/platform/graphics/GraphicsLayer.cpp
@@ -246,6 +246,12 @@ void GraphicsLayer::paintGraphicsLayerContents(GraphicsContext& context, const I
m_client->paintContents(this, context, m_paintingPhase, clip);
}
+String GraphicsLayer::animationNameForTransition(AnimatedPropertyID property)
+{
+ // | is not a valid identifier character in CSS, so this can never conflict with a keyframe identifier.
+ return String::format("-|transition%c-", property);
+}
+
void GraphicsLayer::suspendAnimations(double)
{
}
diff --git a/WebCore/platform/graphics/GraphicsLayer.h b/WebCore/platform/graphics/GraphicsLayer.h
index 04899f2..ad4d056 100644
--- a/WebCore/platform/graphics/GraphicsLayer.h
+++ b/WebCore/platform/graphics/GraphicsLayer.h
@@ -284,13 +284,16 @@ public:
IntRect contentsRect() const { return m_contentsRect; }
virtual void setContentsRect(const IntRect& r) { m_contentsRect = r; }
+ // Transitions are identified by a special animation name that cannot clash with a keyframe identifier.
+ static String animationNameForTransition(AnimatedPropertyID);
+
// Return true if the animation is handled by the compositing system. If this returns
// false, the animation will be run by AnimationController.
- virtual bool addAnimation(const KeyframeValueList&, const IntSize& /*boxSize*/, const Animation*, const String& /*keyframesName*/, double /*timeOffset*/) { return false; }
- virtual void removeAnimationsForProperty(AnimatedPropertyID) { }
- virtual void removeAnimationsForKeyframes(const String& /* keyframesName */) { }
- virtual void pauseAnimation(const String& /* keyframesName */, double /*timeOffset*/) { }
-
+ // These methods handle both transitions and keyframe animations.
+ virtual bool addAnimation(const KeyframeValueList&, const IntSize& /*boxSize*/, const Animation*, const String& /*animationName*/, double /*timeOffset*/) { return false; }
+ virtual void pauseAnimation(const String& /*animationName*/, double /*timeOffset*/) { }
+ virtual void removeAnimation(const String& /*animationName*/) { }
+
virtual void suspendAnimations(double time);
virtual void resumeAnimations();
diff --git a/WebCore/platform/graphics/MediaPlayer.cpp b/WebCore/platform/graphics/MediaPlayer.cpp
index b4a669c..79c33e0 100644
--- a/WebCore/platform/graphics/MediaPlayer.cpp
+++ b/WebCore/platform/graphics/MediaPlayer.cpp
@@ -173,6 +173,12 @@ static Vector<MediaPlayerFactory*>& installedMediaEngines()
#if PLATFORM(WIN)
MediaPlayerPrivateQuickTimeVisualContext::registerMediaEngine(addMediaEngine);
+#elif PLATFORM(QT)
+#if USE(QT_MULTIMEDIA)
+ MediaPlayerPrivateQt::registerMediaEngine(addMediaEngine);
+#else
+ MediaPlayerPrivatePhonon::registerMediaEngine(addMediaEngine);
+#endif
#elif !PLATFORM(GTK) && !PLATFORM(EFL)
// FIXME: currently all the MediaEngines are named
// MediaPlayerPrivate. This code will need an update when bug
diff --git a/WebCore/platform/graphics/WidthIterator.cpp b/WebCore/platform/graphics/WidthIterator.cpp
index ef047e8..ae58918 100644
--- a/WebCore/platform/graphics/WidthIterator.cpp
+++ b/WebCore/platform/graphics/WidthIterator.cpp
@@ -212,20 +212,29 @@ void WidthIterator::advance(int offset, GlyphBuffer* glyphBuffer)
// Force characters that are used to determine word boundaries for the rounding hack
// to be integer width, so following words will start on an integer boundary.
- if (m_run.applyWordRounding() && Font::isRoundingHackCharacter(c))
+ if (m_run.applyWordRounding() && Font::isRoundingHackCharacter(c)) {
width = ceilf(width);
- // Check to see if the next character is a "rounding hack character", if so, adjust
- // width so that the total run width will be on an integer boundary.
- if ((m_run.applyWordRounding() && currentCharacter < m_run.length() && Font::isRoundingHackCharacter(*cp))
- || (m_run.applyRunRounding() && currentCharacter >= m_end)) {
- float totalWidth = widthSinceLastRounding + width;
- widthSinceLastRounding = ceilf(totalWidth);
- width += widthSinceLastRounding - totalWidth;
- m_runWidthSoFar += widthSinceLastRounding;
- widthSinceLastRounding = 0;
- } else
- widthSinceLastRounding += width;
+ // Since widthSinceLastRounding can lose precision if we include measurements for
+ // preceding whitespace, we bypass it here.
+ m_runWidthSoFar += width;
+
+ // Since this is a rounding hack character, we should have reset this sum on the previous
+ // iteration.
+ ASSERT(!widthSinceLastRounding);
+ } else {
+ // Check to see if the next character is a "rounding hack character", if so, adjust
+ // width so that the total run width will be on an integer boundary.
+ if ((m_run.applyWordRounding() && currentCharacter < m_run.length() && Font::isRoundingHackCharacter(*cp))
+ || (m_run.applyRunRounding() && currentCharacter >= m_end)) {
+ float totalWidth = widthSinceLastRounding + width;
+ widthSinceLastRounding = ceilf(totalWidth);
+ width += widthSinceLastRounding - totalWidth;
+ m_runWidthSoFar += widthSinceLastRounding;
+ widthSinceLastRounding = 0;
+ } else
+ widthSinceLastRounding += width;
+ }
if (glyphBuffer)
glyphBuffer->add(glyph, fontData, (rtl ? oldWidth + lastRoundingWidth : width));
diff --git a/WebCore/platform/graphics/brew/ImageBrew.cpp b/WebCore/platform/graphics/brew/ImageBrew.cpp
new file mode 100644
index 0000000..f5c855d
--- /dev/null
+++ b/WebCore/platform/graphics/brew/ImageBrew.cpp
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2010, Company 100, 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 "Image.h"
+
+#include "BitmapImage.h"
+#include "FileSystem.h"
+#include "SharedBuffer.h"
+
+#include <wtf/text/CString.h>
+#include <wtf/text/WTFString.h>
+
+namespace WebCore {
+
+PassRefPtr<Image> Image::loadPlatformResource(const char *name)
+{
+ String resourcePath = homeDirectoryPath() + String::format("res/%s.png", name);
+
+ RefPtr<SharedBuffer> buffer = SharedBuffer::createWithContentsOfFile(resourcePath.utf8().data());
+ if (!buffer)
+ return Image::nullImage();
+
+ RefPtr<Image> image = BitmapImage::create();
+ image->setData(buffer, true);
+ return image.release();
+}
+
+} // namespace WebCore
diff --git a/WebCore/platform/graphics/cairo/CairoUtilities.cpp b/WebCore/platform/graphics/cairo/CairoUtilities.cpp
new file mode 100644
index 0000000..8c2049f
--- /dev/null
+++ b/WebCore/platform/graphics/cairo/CairoUtilities.cpp
@@ -0,0 +1,59 @@
+/*
+ * Copyright (C) 2010 Igalia S.L.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "CairoUtilities.h"
+
+#include "Color.h"
+#include <cairo.h>
+#include <wtf/Vector.h>
+
+namespace WebCore {
+
+void copyContextProperties(cairo_t* srcCr, cairo_t* dstCr)
+{
+ cairo_set_antialias(dstCr, cairo_get_antialias(srcCr));
+
+ size_t dashCount = cairo_get_dash_count(srcCr);
+ Vector<double> dashes(dashCount);
+
+ double offset;
+ cairo_get_dash(srcCr, dashes.data(), &offset);
+ cairo_set_dash(dstCr, dashes.data(), dashCount, offset);
+ cairo_set_line_cap(dstCr, cairo_get_line_cap(srcCr));
+ cairo_set_line_join(dstCr, cairo_get_line_join(srcCr));
+ cairo_set_line_width(dstCr, cairo_get_line_width(srcCr));
+ cairo_set_miter_limit(dstCr, cairo_get_miter_limit(srcCr));
+ cairo_set_fill_rule(dstCr, cairo_get_fill_rule(srcCr));
+}
+
+void setSourceRGBAFromColor(cairo_t* context, const Color& color)
+{
+ float red, green, blue, alpha;
+ color.getRGBA(red, green, blue, alpha);
+ cairo_set_source_rgba(context, red, green, blue, alpha);
+}
+
+} // namespace WebCore
diff --git a/WebCore/platform/network/win/ResourceHandleWin.h b/WebCore/platform/graphics/cairo/CairoUtilities.h
index 2964bcb..0675b90 100644
--- a/WebCore/platform/network/win/ResourceHandleWin.h
+++ b/WebCore/platform/graphics/cairo/CairoUtilities.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004, 2006 Apple Computer, Inc. All rights reserved.
+ * Copyright (C) 2010 Igalia S.L.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -20,27 +20,20 @@
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef ResourceHandleWin_h
-#define ResourceHandleWin_h
+#ifndef CairoUtilities_h
+#define CairoUtilities_h
-#include <windows.h>
+typedef struct _cairo cairo_t;
namespace WebCore {
+class Color;
-struct PlatformDataStruct
-{
- DWORD error;
- BOOL loaded;
- LPTSTR errorString;
-};
+void copyContextProperties(cairo_t* srcCr, cairo_t* dstCr);
+void setSourceRGBAFromColor(cairo_t*, const Color&);
-struct PlatformResponseStruct
-{
-};
+} // namespace WebCore
-}
-
-#endif
+#endif // CairoUtilities_h
diff --git a/WebCore/platform/graphics/cairo/ContextShadowCairo.cpp b/WebCore/platform/graphics/cairo/ContextShadowCairo.cpp
new file mode 100644
index 0000000..4b94cb3
--- /dev/null
+++ b/WebCore/platform/graphics/cairo/ContextShadowCairo.cpp
@@ -0,0 +1,122 @@
+/*
+ * Copyright (C) 2010 Sencha, Inc.
+ * Copyright (C) 2010 Igalia S.L.
+ *
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "ContextShadow.h"
+
+#include "CairoUtilities.h"
+#include "Timer.h"
+#include <cairo.h>
+
+namespace WebCore {
+
+static cairo_surface_t* scratchBuffer = 0;
+static void purgeScratchBuffer()
+{
+ cairo_surface_destroy(scratchBuffer);
+ scratchBuffer = 0;
+}
+
+// ContextShadow needs a scratch image as the buffer for the blur filter.
+// Instead of creating and destroying the buffer for every operation,
+// we create a buffer which will be automatically purged via a timer.
+class PurgeScratchBufferTimer : public TimerBase {
+private:
+ virtual void fired() { purgeScratchBuffer(); }
+};
+static PurgeScratchBufferTimer purgeScratchBufferTimer;
+static void scheduleScratchBufferPurge()
+{
+ if (purgeScratchBufferTimer.isActive())
+ purgeScratchBufferTimer.stop();
+ purgeScratchBufferTimer.startOneShot(2);
+}
+
+static cairo_surface_t* getScratchBuffer(const IntSize& size)
+{
+ int width = size.width();
+ int height = size.height();
+ int scratchWidth = scratchBuffer ? cairo_image_surface_get_width(scratchBuffer) : 0;
+ int scratchHeight = scratchBuffer ? cairo_image_surface_get_height(scratchBuffer) : 0;
+
+ // We do not need to recreate the buffer if the current buffer is large enough.
+ if (scratchBuffer && scratchWidth >= width && scratchHeight >= height)
+ return scratchBuffer;
+
+ purgeScratchBuffer();
+
+ // Round to the nearest 32 pixels so we do not grow the buffer for similar sized requests.
+ width = (1 + (width >> 5)) << 5;
+ height = (1 + (height >> 5)) << 5;
+ scratchBuffer = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, width, height);
+ return scratchBuffer;
+}
+
+PlatformContext ContextShadow::beginShadowLayer(PlatformContext context, const FloatRect& layerArea)
+{
+ double x1, x2, y1, y2;
+ cairo_clip_extents(context, &x1, &y1, &x2, &y2);
+ calculateLayerBoundingRect(layerArea, IntRect(x1, y1, x2 - x1, y2 - y1));
+
+ // Don't paint if we are totally outside the clip region.
+ if (m_layerRect.isEmpty())
+ return 0;
+
+ m_layerImage = getScratchBuffer(m_layerRect.size());
+ m_layerContext = cairo_create(m_layerImage);
+
+ // Always clear the surface first.
+ cairo_set_operator(m_layerContext, CAIRO_OPERATOR_CLEAR);
+ cairo_paint(m_layerContext);
+ cairo_set_operator(m_layerContext, CAIRO_OPERATOR_OVER);
+
+ cairo_translate(m_layerContext, m_offset.width(), m_offset.height());
+ cairo_translate(m_layerContext, -m_layerRect.x(), -m_layerRect.y());
+ return m_layerContext;
+}
+
+void ContextShadow::endShadowLayer(cairo_t* cr)
+{
+ cairo_destroy(m_layerContext);
+ m_layerContext = 0;
+
+ if (m_type == BlurShadow)
+ blurLayerImage(cairo_image_surface_get_data(m_layerImage),
+ IntSize(cairo_image_surface_get_width(m_layerImage), cairo_image_surface_get_height(m_layerImage)),
+ cairo_image_surface_get_stride(m_layerImage));
+
+ cairo_save(cr);
+ setSourceRGBAFromColor(cr, m_color);
+ cairo_mask_surface(cr, m_layerImage, m_layerRect.x(), m_layerRect.y());
+ cairo_restore(cr);
+
+ // Schedule a purge of the scratch buffer. We do not need to destroy the surface.
+ scheduleScratchBufferPurge();
+}
+
+}
diff --git a/WebCore/platform/graphics/cairo/FontCacheFreeType.cpp b/WebCore/platform/graphics/cairo/FontCacheFreeType.cpp
index c09dd49..febad12 100644
--- a/WebCore/platform/graphics/cairo/FontCacheFreeType.cpp
+++ b/WebCore/platform/graphics/cairo/FontCacheFreeType.cpp
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2008 Alp Toker <alp@atoker.com>
+ * Copyright (C) 2010 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
@@ -26,13 +27,17 @@
#include "OwnPtrCairo.h"
#include "PlatformRefPtrCairo.h"
#include "SimpleFontData.h"
+#include <cairo-ft.h>
+#include <cairo.h>
+#include <fontconfig/fcfreetype.h>
#include <wtf/Assertions.h>
namespace WebCore {
void FontCache::platformInit()
{
- if (!FontPlatformData::init())
+ // It's fine to call FcInit multiple times per the documentation.
+ if (!FcInit())
ASSERT_NOT_REACHED();
}
@@ -72,9 +77,9 @@ SimpleFontData* FontCache::getSimilarFontPlatformData(const Font& font)
SimpleFontData* FontCache::getLastResortFallbackFont(const FontDescription& fontDescription)
{
- // FIXME: Would be even better to somehow get the user's default font here.
- // For now we'll pick the default that the user would get without changing any prefs.
- static AtomicString timesStr("Times New Roman");
+ // We want to return a fallback font here, otherwise the logic preventing FontConfig
+ // matches for non-fallback fonts might return 0. See isFallbackFontAllowed.
+ static AtomicString timesStr("serif");
return getCachedFontData(fontDescription, timesStr);
}
@@ -82,54 +87,106 @@ void FontCache::getTraitsInFamily(const AtomicString& familyName, Vector<unsigne
{
}
-static bool isWellKnownFontName(const AtomicString family)
+static CString getFamilyNameStringFromFontDescriptionAndFamily(const FontDescription& fontDescription, const AtomicString& family)
{
- // Fonts that are used by layout tests included. The fact that
- // they are used in Layout Tests indicate web compatibility issues
- // if we do not handle them correctly.
- if (equalIgnoringCase(family, "sans-serif") || equalIgnoringCase(family, "sans")
- || equalIgnoringCase(family, "serif") || equalIgnoringCase(family, "mono")
- || equalIgnoringCase(family, "monospace") || equalIgnoringCase(family, "cursive")
- || equalIgnoringCase(family, "fantasy") || equalIgnoringCase(family, "Times")
- || equalIgnoringCase(family, "Courier") || equalIgnoringCase(family, "Helvetica")
- || equalIgnoringCase(family, "Arial") || equalIgnoringCase(family, "Lucida Grande")
- || equalIgnoringCase(family, "Ahem") || equalIgnoringCase(family, "Georgia")
- || equalIgnoringCase(family, "Times New Roman"))
- return true;
-
- return false;
+ // If we're creating a fallback font (e.g. "-webkit-monospace"), convert the name into
+ // the fallback name (like "monospace") that fontconfig understands.
+ if (family.length() && !family.startsWith("-webkit-"))
+ return family.string().utf8();
+
+ switch (fontDescription.genericFamily()) {
+ case FontDescription::StandardFamily:
+ case FontDescription::SerifFamily:
+ return "serif";
+ case FontDescription::SansSerifFamily:
+ return "sans-serif";
+ case FontDescription::MonospaceFamily:
+ return "monospace";
+ case FontDescription::CursiveFamily:
+ return "cursive";
+ case FontDescription::FantasyFamily:
+ return "fantasy";
+ case FontDescription::NoFamily:
+ default:
+ return "";
+ }
}
-FontPlatformData* FontCache::createFontPlatformData(const FontDescription& fontDescription, const AtomicString& family)
-{
- // Handle generic family types specially, because fontconfig does not know them, but we have
- // code to fallback correctly in our platform data implementation.
- if (!family.length() || family.startsWith("-webkit-")
- || (fontDescription.genericFamily() != FontDescription::NoFamily)
- || isWellKnownFontName(family))
- return new FontPlatformData(fontDescription, family);
- // First check the font exists.
- CString familyNameString = family.string().utf8();
- const char* fcfamily = familyNameString.data();
+static bool isFallbackFontAllowed(const CString& familyName)
+{
+ return !strcasecmp(familyName.data(), "sans")
+ || !strcasecmp(familyName.data(), "sans-serif")
+ || !strcasecmp(familyName.data(), "serif")
+ || !strcasecmp(familyName.data(), "monospace");
+}
+FontPlatformData* FontCache::createFontPlatformData(const FontDescription& fontDescription, const AtomicString& family)
+{
+ // The CSS font matching algorithm (http://www.w3.org/TR/css3-fonts/#font-matching-algorithm)
+ // says that we must find an exact match for font family, slant (italic or oblique can be used)
+ // and font weight (we only match bold/non-bold here).
PlatformRefPtr<FcPattern> pattern = adoptPlatformRef(FcPatternCreate());
- if (!FcPatternAddString(pattern.get(), FC_FAMILY, reinterpret_cast<const FcChar8*>(fcfamily)))
+ CString familyNameString = getFamilyNameStringFromFontDescriptionAndFamily(fontDescription, family);
+ if (!FcPatternAddString(pattern.get(), FC_FAMILY, reinterpret_cast<const FcChar8*>(familyNameString.data())))
return 0;
- OwnPtr<FcObjectSet> objectSet(FcObjectSetCreate());
- if (!FcObjectSetAdd(objectSet.get(), FC_FAMILY))
+ bool italic = fontDescription.italic();
+ if (!FcPatternAddInteger(pattern.get(), FC_SLANT, italic ? FC_SLANT_ITALIC : FC_SLANT_ROMAN))
+ return 0;
+ bool bold = fontDescription.weight() >= FontWeightBold;
+ if (!FcPatternAddInteger(pattern.get(), FC_WEIGHT, bold ? FC_WEIGHT_BOLD : FC_WEIGHT_NORMAL))
+ return 0;
+ if (!FcPatternAddDouble(pattern.get(), FC_PIXEL_SIZE, fontDescription.computedPixelSize()))
return 0;
- OwnPtr<FcFontSet> fontSet(FcFontList(0, pattern.get(), objectSet.get()));
-
- if (!fontSet)
+ // The following comment and strategy are originally from Skia (src/ports/SkFontHost_fontconfig.cpp):
+ // Font matching:
+ // CSS often specifies a fallback list of families:
+ // font-family: a, b, c, serif;
+ // However, fontconfig will always do its best to find *a* font when asked
+ // for something so we need a way to tell if the match which it has found is
+ // "good enough" for us. Otherwise, we can return null which gets piped up
+ // and lets WebKit know to try the next CSS family name. However, fontconfig
+ // configs allow substitutions (mapping "Arial -> Helvetica" etc) and we
+ // wish to support that.
+ //
+ // Thus, if a specific family is requested we set @family_requested. Then we
+ // record two strings: the family name after config processing and the
+ // family name after resolving. If the two are equal, it's a good match.
+ //
+ // So consider the case where a user has mapped Arial to Helvetica in their
+ // config.
+ // requested family: "Arial"
+ // post_config_family: "Helvetica"
+ // post_match_family: "Helvetica"
+ // -> good match
+ //
+ // and for a missing font:
+ // requested family: "Monaco"
+ // post_config_family: "Monaco"
+ // post_match_family: "Times New Roman"
+ // -> BAD match
+ //
+ FcConfigSubstitute(0, pattern.get(), FcMatchPattern);
+ FcDefaultSubstitute(pattern.get());
+
+ FcChar8* familyNameAfterConfiguration;
+ FcPatternGetString(pattern.get(), FC_FAMILY, 0, &familyNameAfterConfiguration);
+
+ FcResult fontConfigResult;
+ PlatformRefPtr<FcPattern> resultPattern = adoptPlatformRef(FcFontMatch(0, pattern.get(), &fontConfigResult));
+ if (!resultPattern) // No match.
return 0;
- if (!fontSet->fonts)
+ // Properly handle the situation where Fontconfig gives us a font that has a different family than we requested.
+ FcChar8* familyNameAfterMatching;
+ FcPatternGetString(resultPattern.get(), FC_FAMILY, 0, &familyNameAfterMatching);
+ if (strcasecmp(reinterpret_cast<char*>(familyNameAfterConfiguration),
+ reinterpret_cast<char*>(familyNameAfterMatching)) && !isFallbackFontAllowed(familyNameString))
return 0;
- return new FontPlatformData(fontDescription, family);
+ return new FontPlatformData(resultPattern.get(), fontDescription);
}
}
diff --git a/WebCore/platform/graphics/cairo/FontCustomPlatformData.cpp b/WebCore/platform/graphics/cairo/FontCustomPlatformData.cpp
index 6b76c2a..0d195cb 100644
--- a/WebCore/platform/graphics/cairo/FontCustomPlatformData.cpp
+++ b/WebCore/platform/graphics/cairo/FontCustomPlatformData.cpp
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2008 Alp Toker <alp@atoker.com>
+ * Copyright (C) 2010 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
@@ -23,11 +24,37 @@
#include "FontPlatformData.h"
#include "SharedBuffer.h"
+#include <cairo-ft.h>
+#include <cairo.h>
namespace WebCore {
+static void releaseCustomFontData(void* data)
+{
+ static_cast<SharedBuffer*>(data)->deref();
+}
+
+FontCustomPlatformData::FontCustomPlatformData(FT_Face freeTypeFace, SharedBuffer* buffer)
+ : m_freeTypeFace(freeTypeFace)
+ , m_fontFace(cairo_ft_font_face_create_for_ft_face(freeTypeFace, 0))
+{
+ // FIXME Should we be setting some hinting options here?
+
+ buffer->ref(); // This is balanced by the buffer->deref() in releaseCustomFontData.
+ static cairo_user_data_key_t bufferKey;
+ cairo_font_face_set_user_data(m_fontFace, &bufferKey, buffer,
+ static_cast<cairo_destroy_func_t>(releaseCustomFontData));
+
+ // Cairo doesn't do FreeType reference counting, so we need to ensure that when
+ // this cairo_font_face_t is destroyed, it cleans up the FreeType face as well.
+ static cairo_user_data_key_t freeTypeFaceKey;
+ cairo_font_face_set_user_data(m_fontFace, &freeTypeFaceKey, freeTypeFace,
+ reinterpret_cast<cairo_destroy_func_t>(FT_Done_Face));
+}
+
FontCustomPlatformData::~FontCustomPlatformData()
{
+ // m_freeTypeFace will be destroyed along with m_fontFace. See the constructor.
cairo_font_face_destroy(m_fontFace);
}
@@ -36,38 +63,20 @@ FontPlatformData FontCustomPlatformData::fontPlatformData(int size, bool bold, b
return FontPlatformData(m_fontFace, size, bold, italic);
}
-static void releaseData(void* data)
-{
- static_cast<SharedBuffer*>(data)->deref();
-}
-
FontCustomPlatformData* createFontCustomPlatformData(SharedBuffer* buffer)
{
ASSERT_ARG(buffer, buffer);
- int error;
-
static FT_Library library = 0;
- if (!library) {
- error = FT_Init_FreeType(&library);
- if (error) {
- library = 0;
- return 0;
- }
+ if (!library && FT_Init_FreeType(&library)) {
+ library = 0;
+ return 0;
}
- FT_Face face;
- error = FT_New_Memory_Face(library, reinterpret_cast<const FT_Byte*>(buffer->data()), buffer->size(), 0, &face);
- if (error)
+ FT_Face freeTypeFace;
+ if (FT_New_Memory_Face(library, reinterpret_cast<const FT_Byte*>(buffer->data()), buffer->size(), 0, &freeTypeFace))
return 0;
-
- buffer->ref();
- cairo_font_face_t* fontFace = cairo_ft_font_face_create_for_ft_face(face, 0);
-
- static cairo_user_data_key_t bufferKey;
- cairo_font_face_set_user_data(fontFace, &bufferKey, buffer, releaseData);
-
- return new FontCustomPlatformData(fontFace);
+ return new FontCustomPlatformData(freeTypeFace, buffer);
}
bool FontCustomPlatformData::supportsFormat(const String& format)
diff --git a/WebCore/platform/graphics/cairo/FontCustomPlatformData.h b/WebCore/platform/graphics/cairo/FontCustomPlatformData.h
index a72a6a4..c48d110 100644
--- a/WebCore/platform/graphics/cairo/FontCustomPlatformData.h
+++ b/WebCore/platform/graphics/cairo/FontCustomPlatformData.h
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2008 Alp Toker <alp@atoker.com>
+ * Copyright (C) 2010 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
@@ -25,6 +26,7 @@
#include <wtf/Forward.h>
#include <wtf/Noncopyable.h>
+typedef struct FT_FaceRec_* FT_Face;
typedef struct _cairo_font_face cairo_font_face_t;
namespace WebCore {
@@ -33,16 +35,14 @@ class FontPlatformData;
class SharedBuffer;
struct FontCustomPlatformData : Noncopyable {
- FontCustomPlatformData(cairo_font_face_t* fontFace)
- : m_fontFace(fontFace)
- {}
-
+public:
+ FontCustomPlatformData(FT_Face, SharedBuffer*);
~FontCustomPlatformData();
-
FontPlatformData fontPlatformData(int size, bool bold, bool italic, FontRenderingMode = NormalRenderingMode);
-
static bool supportsFormat(const String&);
+private:
+ FT_Face m_freeTypeFace;
cairo_font_face_t* m_fontFace;
};
diff --git a/WebCore/platform/graphics/cairo/FontPlatformDataFreeType.cpp b/WebCore/platform/graphics/cairo/FontPlatformDataFreeType.cpp
index 7968966..0617e6c 100644
--- a/WebCore/platform/graphics/cairo/FontPlatformDataFreeType.cpp
+++ b/WebCore/platform/graphics/cairo/FontPlatformDataFreeType.cpp
@@ -3,7 +3,7 @@
* Copyright (C) 2006 Michael Emmel mike.emmel@gmail.com
* Copyright (C) 2007, 2008 Alp Toker <alp@atoker.com>
* Copyright (C) 2007 Holger Hans Peter Freyther
- * Copyright (C) 2009 Igalia S.L.
+ * Copyright (C) 2009, 2010 Igalia S.L.
* All rights reserved.
*
* This library is free software; you can redistribute it and/or
@@ -27,100 +27,88 @@
#include "PlatformString.h"
#include "FontDescription.h"
-#include <wtf/text/CString.h>
-
#include <cairo-ft.h>
#include <cairo.h>
#include <fontconfig/fcfreetype.h>
+
#if !PLATFORM(EFL) || ENABLE(GLIB_SUPPORT)
#include <gdk/gdk.h>
#endif
namespace WebCore {
-FontPlatformData::FontPlatformData(const FontDescription& fontDescription, const AtomicString& familyName)
- : m_fallbacks(0)
+cairo_subpixel_order_t convertFontConfigSubpixelOrder(int fontConfigOrder)
+{
+ switch (fontConfigOrder) {
+ case FC_RGBA_RGB:
+ return CAIRO_SUBPIXEL_ORDER_RGB;
+ case FC_RGBA_BGR:
+ return CAIRO_SUBPIXEL_ORDER_BGR;
+ case FC_RGBA_VRGB:
+ return CAIRO_SUBPIXEL_ORDER_VRGB;
+ case FC_RGBA_VBGR:
+ return CAIRO_SUBPIXEL_ORDER_VBGR;
+ case FC_RGBA_NONE:
+ case FC_RGBA_UNKNOWN:
+ return CAIRO_SUBPIXEL_ORDER_DEFAULT;
+ }
+ return CAIRO_SUBPIXEL_ORDER_DEFAULT;
+}
+
+cairo_hint_style_t convertFontConfigHintStyle(int fontConfigStyle)
+{
+ switch (fontConfigStyle) {
+ case FC_HINT_NONE:
+ return CAIRO_HINT_STYLE_NONE;
+ case FC_HINT_SLIGHT:
+ return CAIRO_HINT_STYLE_SLIGHT;
+ case FC_HINT_MEDIUM:
+ return CAIRO_HINT_STYLE_MEDIUM;
+ case FC_HINT_FULL:
+ return CAIRO_HINT_STYLE_FULL;
+ }
+ return CAIRO_HINT_STYLE_NONE;
+}
+
+void setCairoFontOptionsFromFontConfigPattern(cairo_font_options_t* options, FcPattern* pattern)
+{
+ FcBool booleanResult;
+ int integerResult;
+
+ // We will determine if subpixel anti-aliasing is enabled via the FC_RGBA setting.
+ if (FcPatternGetBool(pattern, FC_ANTIALIAS, 0, &booleanResult) == FcResultMatch && booleanResult)
+ cairo_font_options_set_antialias(options, CAIRO_ANTIALIAS_GRAY);
+
+ if (FcPatternGetInteger(pattern, FC_RGBA, 0, &integerResult) == FcResultMatch) {
+ if (integerResult != FC_RGBA_NONE)
+ cairo_font_options_set_antialias(options, CAIRO_ANTIALIAS_SUBPIXEL);
+ cairo_font_options_set_subpixel_order(options, convertFontConfigSubpixelOrder(integerResult));
+ }
+
+ if (FcPatternGetInteger(pattern, FC_HINT_STYLE, 0, &integerResult) == FcResultMatch)
+ cairo_font_options_set_hint_style(options, convertFontConfigHintStyle(integerResult));
+
+ if (FcPatternGetBool(pattern, FC_HINTING, 0, &booleanResult) == FcResultMatch && !booleanResult)
+ cairo_font_options_set_hint_style(options, CAIRO_HINT_STYLE_NONE);
+}
+
+FontPlatformData::FontPlatformData(FcPattern* pattern, const FontDescription& fontDescription)
+ : m_pattern(pattern)
+ , m_fallbacks(0)
, m_size(fontDescription.computedPixelSize())
, m_syntheticBold(false)
, m_syntheticOblique(false)
{
- FontPlatformData::init();
-
- CString familyNameString = familyName.string().utf8();
- const char* fcfamily = familyNameString.data();
- int fcslant = FC_SLANT_ROMAN;
- // FIXME: Map all FontWeight values to fontconfig weights.
- int fcweight = FC_WEIGHT_NORMAL;
- double fcsize = fontDescription.computedPixelSize();
- if (fontDescription.italic())
- fcslant = FC_SLANT_ITALIC;
- if (fontDescription.weight() >= FontWeight600)
- fcweight = FC_WEIGHT_BOLD;
-
- int type = fontDescription.genericFamily();
-
- PlatformRefPtr<FcPattern> pattern = adoptPlatformRef(FcPatternCreate());
- cairo_font_face_t* fontFace;
- static const cairo_font_options_t* defaultOptions = cairo_font_options_create();
- const cairo_font_options_t* options = NULL;
- cairo_matrix_t fontMatrix;
-
- if (!FcPatternAddString(pattern.get(), FC_FAMILY, reinterpret_cast<const FcChar8*>(fcfamily)))
- return;
-
- switch (type) {
- case FontDescription::SerifFamily:
- fcfamily = "serif";
- break;
- case FontDescription::SansSerifFamily:
- fcfamily = "sans-serif";
- break;
- case FontDescription::MonospaceFamily:
- fcfamily = "monospace";
- break;
- case FontDescription::StandardFamily:
- fcfamily = "sans-serif";
- break;
- case FontDescription::NoFamily:
- default:
- fcfamily = NULL;
- break;
- }
+ cairo_font_options_t* options = cairo_font_options_create();
+ setCairoFontOptionsFromFontConfigPattern(options, pattern);
- if (fcfamily && !FcPatternAddString(pattern.get(), FC_FAMILY, reinterpret_cast<const FcChar8*>(fcfamily)))
- return;
- if (!FcPatternAddInteger(pattern.get(), FC_WEIGHT, fcweight))
- return;
- if (!FcPatternAddInteger(pattern.get(), FC_SLANT, fcslant))
- return;
- if (!FcPatternAddDouble(pattern.get(), FC_PIXEL_SIZE, fcsize))
- return;
-
- FcConfigSubstitute(0, pattern.get(), FcMatchPattern);
- FcDefaultSubstitute(pattern.get());
-
- FcResult fcresult;
- m_pattern = adoptPlatformRef(FcFontMatch(0, pattern.get(), &fcresult));
- // FIXME: should we set some default font?
- if (!m_pattern)
- return;
- fontFace = cairo_ft_font_face_create_for_pattern(m_pattern.get());
+ cairo_matrix_t fontMatrix;
+ cairo_matrix_init_scale(&fontMatrix, m_size, m_size);
cairo_matrix_t ctm;
- cairo_matrix_init_scale(&fontMatrix, fontDescription.computedPixelSize(), fontDescription.computedPixelSize());
cairo_matrix_init_identity(&ctm);
-#if !PLATFORM(EFL) || ENABLE(GLIB_SUPPORT)
- if (GdkScreen* screen = gdk_screen_get_default())
-gdk_screen_get_font_options(screen);
-#endif
-
- // gdk_screen_get_font_options() returns NULL if no default options are
- // set, so we always have to check.
- if (!options)
- options = defaultOptions;
-
- m_scaledFont = adoptPlatformRef(cairo_scaled_font_create(fontFace, &fontMatrix, &ctm, options));
- cairo_font_face_destroy(fontFace);
+ PlatformRefPtr<cairo_font_face_t> fontFace = adoptPlatformRef(cairo_ft_font_face_create_for_pattern(m_pattern.get()));
+ m_scaledFont = adoptPlatformRef(cairo_scaled_font_create(fontFace.get(), &fontMatrix, &ctm, options));
}
FontPlatformData::FontPlatformData(float size, bool bold, bool italic)
@@ -184,19 +172,6 @@ FontPlatformData::FontPlatformData(const FontPlatformData& other)
*this = other;
}
-bool FontPlatformData::init()
-{
- static bool initialized = false;
- if (initialized)
- return true;
- if (!FcInit()) {
- fprintf(stderr, "Can't init font config library\n");
- return false;
- }
- initialized = true;
- return true;
-}
-
FontPlatformData::~FontPlatformData()
{
if (m_fallbacks) {
diff --git a/WebCore/platform/graphics/cairo/FontPlatformDataFreeType.h b/WebCore/platform/graphics/cairo/FontPlatformDataFreeType.h
index 987a684..f3488ef 100644
--- a/WebCore/platform/graphics/cairo/FontPlatformDataFreeType.h
+++ b/WebCore/platform/graphics/cairo/FontPlatformDataFreeType.h
@@ -3,6 +3,7 @@
* Copyright (C) 2006 Michael Emmel mike.emmel@gmail.com
* Copyright (C) 2007 Holger Hans Peter Freyther
* Copyright (C) 2007 Pioneer Research Center USA, Inc.
+ * Copyright (C) 2010 Igalia S.L.
* All rights reserved.
*
* This library is free software; you can redistribute it and/or
@@ -29,11 +30,10 @@
#include "GlyphBuffer.h"
#include "HashFunctions.h"
#include "PlatformRefPtrCairo.h"
-#include <cairo-ft.h>
-#include <cairo.h>
-#include <fontconfig/fcfreetype.h>
#include <wtf/Forward.h>
+typedef struct _FcFontSet FcFontSet;
+
namespace WebCore {
class FontPlatformData {
@@ -53,14 +53,13 @@ public:
, m_syntheticOblique(false)
{ }
- FontPlatformData(const FontDescription&, const AtomicString& family);
+ FontPlatformData(FcPattern*, const FontDescription&);
FontPlatformData(cairo_font_face_t* fontFace, float size, bool bold, bool italic);
FontPlatformData(float size, bool bold, bool italic);
FontPlatformData(const FontPlatformData&);
~FontPlatformData();
- static bool init();
bool isFixedPitch();
float size() const { return m_size; }
void setSize(float size) { m_size = size; }
diff --git a/WebCore/platform/graphics/cairo/GlyphPageTreeNodeCairo.cpp b/WebCore/platform/graphics/cairo/GlyphPageTreeNodeCairo.cpp
index 26da68d..66e9c16 100644
--- a/WebCore/platform/graphics/cairo/GlyphPageTreeNodeCairo.cpp
+++ b/WebCore/platform/graphics/cairo/GlyphPageTreeNodeCairo.cpp
@@ -32,6 +32,9 @@
#include "GlyphPageTreeNode.h"
#include "SimpleFontData.h"
+#include <cairo-ft.h>
+#include <cairo.h>
+#include <fontconfig/fcfreetype.h>
namespace WebCore {
diff --git a/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp b/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp
index 5de7e1f..05096a9 100644
--- a/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp
+++ b/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp
@@ -35,6 +35,7 @@
#include "AffineTransform.h"
#include "CairoPath.h"
+#include "CairoUtilities.h"
#include "FEGaussianBlur.h"
#include "FloatRect.h"
#include "Font.h"
@@ -131,28 +132,10 @@ static inline void fillRectSourceOver(cairo_t* cr, const FloatRect& rect, const
cairo_fill(cr);
}
-static inline void copyContextProperties(cairo_t* srcCr, cairo_t* dstCr)
-{
- cairo_set_antialias(dstCr, cairo_get_antialias(srcCr));
-
- size_t dashCount = cairo_get_dash_count(srcCr);
- Vector<double> dashes(dashCount);
-
- double offset;
- cairo_get_dash(srcCr, dashes.data(), &offset);
- cairo_set_dash(dstCr, dashes.data(), dashCount, offset);
- cairo_set_line_cap(dstCr, cairo_get_line_cap(srcCr));
- cairo_set_line_join(dstCr, cairo_get_line_join(srcCr));
- cairo_set_line_width(dstCr, cairo_get_line_width(srcCr));
- cairo_set_miter_limit(dstCr, cairo_get_miter_limit(srcCr));
- cairo_set_fill_rule(dstCr, cairo_get_fill_rule(srcCr));
-}
-
static void appendPathToCairoContext(cairo_t* to, cairo_t* from)
{
- cairo_path_t* cairoPath = cairo_copy_path(from);
- cairo_append_path(to, cairoPath);
- cairo_path_destroy(cairoPath);
+ OwnPtr<cairo_path_t> cairoPath(cairo_copy_path(from));
+ cairo_append_path(to, cairoPath.get());
}
// We apply the pending path built via addPath to the Cairo context
@@ -1182,9 +1165,8 @@ void GraphicsContext::clip(const Path& path)
return;
cairo_t* cr = m_data->cr;
- cairo_path_t* p = cairo_copy_path(path.platformPath()->context());
- cairo_append_path(cr, p);
- cairo_path_destroy(p);
+ OwnPtr<cairo_path_t> p(cairo_copy_path(path.platformPath()->context()));
+ cairo_append_path(cr, p.get());
cairo_fill_rule_t savedFillRule = cairo_get_fill_rule(cr);
cairo_set_fill_rule(cr, CAIRO_FILL_RULE_WINDING);
cairo_clip(cr);
@@ -1341,9 +1323,8 @@ void GraphicsContext::drawTiledShadow(const IntRect& rect, const FloatSize& topL
copyContextProperties(cr, shadowContext);
cairo_translate(shadowContext, -rect.x() + blurRadius, -rect.y() + blurRadius);
cairo_new_path(shadowContext);
- cairo_path_t* path = cairo_copy_path(cr);
- cairo_append_path(shadowContext, path);
- cairo_path_destroy(path);
+ OwnPtr<cairo_path_t> path(cairo_copy_path(cr));
+ cairo_append_path(shadowContext, path.get());
setPlatformFill(this, shadowContext, m_common);
diff --git a/WebCore/platform/graphics/cairo/PathCairo.cpp b/WebCore/platform/graphics/cairo/PathCairo.cpp
index 05c6952..776bceb 100644
--- a/WebCore/platform/graphics/cairo/PathCairo.cpp
+++ b/WebCore/platform/graphics/cairo/PathCairo.cpp
@@ -29,9 +29,9 @@
#include "CairoPath.h"
#include "FloatRect.h"
#include "GraphicsContext.h"
+#include "OwnPtrCairo.h"
#include "PlatformString.h"
#include "StrokeStyleApplier.h"
-
#include <cairo.h>
#include <math.h>
#include <wtf/MathExtras.h>
@@ -52,9 +52,8 @@ Path::Path(const Path& other)
: m_path(new CairoPath())
{
cairo_t* cr = platformPath()->context();
- cairo_path_t* p = cairo_copy_path(other.platformPath()->context());
- cairo_append_path(cr, p);
- cairo_path_destroy(p);
+ OwnPtr<cairo_path_t> p(cairo_copy_path(other.platformPath()->context()));
+ cairo_append_path(cr, p.get());
}
Path& Path::operator=(const Path& other)
@@ -64,9 +63,8 @@ Path& Path::operator=(const Path& other)
clear();
cairo_t* cr = platformPath()->context();
- cairo_path_t* p = cairo_copy_path(other.platformPath()->context());
- cairo_append_path(cr, p);
- cairo_path_destroy(p);
+ OwnPtr<cairo_path_t> p(cairo_copy_path(other.platformPath()->context()));
+ cairo_append_path(cr, p.get());
return *this;
}
@@ -297,7 +295,7 @@ bool Path::strokeContains(StrokeStyleApplier* applier, const FloatPoint& point)
void Path::apply(void* info, PathApplierFunction function) const
{
cairo_t* cr = platformPath()->context();
- cairo_path_t* path = cairo_copy_path(cr);
+ OwnPtr<cairo_path_t> path(cairo_copy_path(cr));
cairo_path_data_t* data;
PathElement pelement;
FloatPoint points[3];
@@ -329,7 +327,6 @@ void Path::apply(void* info, PathApplierFunction function) const
break;
}
}
- cairo_path_destroy(path);
}
void Path::transform(const AffineTransform& trans)
@@ -346,7 +343,7 @@ String Path::debugString() const
return String();
String pathString;
- cairo_path_t* path = cairo_copy_path(platformPath()->context());
+ OwnPtr<cairo_path_t> path(cairo_copy_path(platformPath()->context()));
cairo_path_data_t* data;
for (int i = 0; i < path->num_data; i += path->data[i].header.length) {
@@ -373,7 +370,6 @@ String Path::debugString() const
}
}
- cairo_path_destroy(path);
return pathString.simplifyWhiteSpace();
}
diff --git a/WebCore/platform/graphics/cairo/PlatformRefPtrCairo.cpp b/WebCore/platform/graphics/cairo/PlatformRefPtrCairo.cpp
index aa466f9..d289585 100644
--- a/WebCore/platform/graphics/cairo/PlatformRefPtrCairo.cpp
+++ b/WebCore/platform/graphics/cairo/PlatformRefPtrCairo.cpp
@@ -54,6 +54,19 @@ template <> void derefPlatformPtr(cairo_surface_t* ptr)
cairo_surface_destroy(ptr);
}
+template <> cairo_font_face_t* refPlatformPtr(cairo_font_face_t* ptr)
+{
+ if (ptr)
+ cairo_font_face_reference(ptr);
+ return ptr;
+}
+
+template <> void derefPlatformPtr(cairo_font_face_t* ptr)
+{
+ if (ptr)
+ cairo_font_face_destroy(ptr);
+}
+
template <> cairo_scaled_font_t* refPlatformPtr(cairo_scaled_font_t* ptr)
{
if (ptr)
diff --git a/WebCore/platform/graphics/cairo/PlatformRefPtrCairo.h b/WebCore/platform/graphics/cairo/PlatformRefPtrCairo.h
index 4b45c1b..3b720c6 100644
--- a/WebCore/platform/graphics/cairo/PlatformRefPtrCairo.h
+++ b/WebCore/platform/graphics/cairo/PlatformRefPtrCairo.h
@@ -24,6 +24,7 @@
typedef struct _cairo cairo_t;
typedef struct _cairo_surface cairo_surface_t;
+typedef struct _cairo_font_face cairo_font_face_t;
typedef struct _cairo_scaled_font cairo_scaled_font_t;
#if defined(USE_FREETYPE)
@@ -38,6 +39,9 @@ template <> void derefPlatformPtr(cairo_t* ptr);
template <> cairo_surface_t* refPlatformPtr(cairo_surface_t* ptr);
template <> void derefPlatformPtr(cairo_surface_t* ptr);
+template <> cairo_font_face_t* refPlatformPtr(cairo_font_face_t*);
+template <> void derefPlatformPtr(cairo_font_face_t*);
+
template <> cairo_scaled_font_t* refPlatformPtr(cairo_scaled_font_t*);
template <> void derefPlatformPtr(cairo_scaled_font_t*);
diff --git a/WebCore/platform/graphics/cairo/SimpleFontDataCairo.cpp b/WebCore/platform/graphics/cairo/SimpleFontDataCairo.cpp
index fd85d6f..3d7c34b 100644
--- a/WebCore/platform/graphics/cairo/SimpleFontDataCairo.cpp
+++ b/WebCore/platform/graphics/cairo/SimpleFontDataCairo.cpp
@@ -38,7 +38,9 @@
#include "FontCache.h"
#include "FontDescription.h"
#include "GlyphBuffer.h"
+#include <cairo-ft.h>
#include <cairo.h>
+#include <fontconfig/fcfreetype.h>
#include <wtf/MathExtras.h>
namespace WebCore {
@@ -81,12 +83,12 @@ void SimpleFontData::platformDestroy()
SimpleFontData* SimpleFontData::smallCapsFontData(const FontDescription& fontDescription) const
{
- if (!m_smallCapsFontData) {
- FontDescription desc = FontDescription(fontDescription);
- desc.setComputedSize(0.70f * fontDescription.computedSize());
- FontPlatformData platformData(desc, desc.family().family());
- m_smallCapsFontData = new SimpleFontData(platformData);
- }
+ // FIXME: I think we want to ask FontConfig for the right font again.
+ if (!m_smallCapsFontData)
+ m_smallCapsFontData = new SimpleFontData(
+ FontPlatformData(cairo_scaled_font_get_font_face(m_platformData.scaledFont()),
+ 0.70f * fontDescription.computedSize(), m_platformData.syntheticBold(), m_platformData.syntheticOblique()));
+
return m_smallCapsFontData;
}
diff --git a/WebCore/platform/graphics/cg/GraphicsContext3DCG.cpp b/WebCore/platform/graphics/cg/GraphicsContext3DCG.cpp
index fadc385..2a81fd2 100644
--- a/WebCore/platform/graphics/cg/GraphicsContext3DCG.cpp
+++ b/WebCore/platform/graphics/cg/GraphicsContext3DCG.cpp
@@ -71,9 +71,54 @@ bool GraphicsContext3D::getImageData(Image* image,
AlphaOp neededAlphaOp = kAlphaDoNothing;
switch (CGImageGetAlphaInfo(cgImage)) {
case kCGImageAlphaPremultipliedFirst:
+ // This path is only accessible for MacOS earlier than 10.6.4.
+ // This is a special case for texImage2D with HTMLCanvasElement input,
+ // in which case image->data() should be null.
+ ASSERT(!image->data());
+ if (!premultiplyAlpha)
+ neededAlphaOp = kAlphaDoUnmultiply;
+ switch (componentsPerPixel) {
+ case 2:
+ srcDataFormat = kSourceFormatAR8;
+ break;
+ case 4:
+ srcDataFormat = kSourceFormatARGB8;
+ break;
+ default:
+ return false;
+ }
+ break;
case kCGImageAlphaFirst:
+ // This path is only accessible for MacOS earlier than 10.6.4.
+ if (premultiplyAlpha)
+ neededAlphaOp = kAlphaDoPremultiply;
+ switch (componentsPerPixel) {
+ case 1:
+ srcDataFormat = kSourceFormatA8;
+ break;
+ case 2:
+ srcDataFormat = kSourceFormatAR8;
+ break;
+ case 4:
+ srcDataFormat = kSourceFormatARGB8;
+ break;
+ default:
+ return false;
+ }
+ break;
case kCGImageAlphaNoneSkipFirst:
- return false;
+ // This path is only accessible for MacOS earlier than 10.6.4.
+ switch (componentsPerPixel) {
+ case 2:
+ srcDataFormat = kSourceFormatAR8;
+ break;
+ case 4:
+ srcDataFormat = kSourceFormatARGB8;
+ break;
+ default:
+ return false;
+ }
+ break;
case kCGImageAlphaPremultipliedLast:
// This is a special case for texImage2D with HTMLCanvasElement input,
// in which case image->data() should be null.
diff --git a/WebCore/platform/graphics/chromium/ContentLayerChromium.cpp b/WebCore/platform/graphics/chromium/ContentLayerChromium.cpp
index 86be8da..8dda4d6 100644
--- a/WebCore/platform/graphics/chromium/ContentLayerChromium.cpp
+++ b/WebCore/platform/graphics/chromium/ContentLayerChromium.cpp
@@ -126,10 +126,28 @@ ContentLayerChromium::ContentLayerChromium(GraphicsLayerChromium* owner)
ContentLayerChromium::~ContentLayerChromium()
{
- if (m_contentsTexture)
- GLC(layerRendererContext(), layerRendererContext()->deleteTexture(m_contentsTexture));
+ cleanupResources();
}
+void ContentLayerChromium::setLayerRenderer(LayerRendererChromium* renderer)
+{
+ // If we're changing layer renderers then we need to free up any resources
+ // allocated by the old renderer.
+ if (layerRenderer() && layerRenderer() != renderer)
+ cleanupResources();
+
+ LayerChromium::setLayerRenderer(renderer);
+}
+
+void ContentLayerChromium::cleanupResources()
+{
+ if (layerRenderer()) {
+ if (m_contentsTexture) {
+ layerRenderer()->deleteLayerTexture(m_contentsTexture);
+ m_contentsTexture = 0;
+ }
+ }
+}
void ContentLayerChromium::updateContents()
{
diff --git a/WebCore/platform/graphics/chromium/ContentLayerChromium.h b/WebCore/platform/graphics/chromium/ContentLayerChromium.h
index 42a77c7..412ba06 100644
--- a/WebCore/platform/graphics/chromium/ContentLayerChromium.h
+++ b/WebCore/platform/graphics/chromium/ContentLayerChromium.h
@@ -49,6 +49,7 @@ public:
virtual void updateContents();
virtual void draw();
virtual bool drawsContent() { return m_owner && m_owner->drawsContent(); }
+ virtual void setLayerRenderer(LayerRendererChromium*);
// Stores values that are shared between instances of this class that are
// associated with the same LayerRendererChromium (and hence the same GL
@@ -79,6 +80,8 @@ protected:
void updateTextureRect(void* pixels, const IntSize& bitmapSize, const IntSize& requiredTextureSize,
const IntRect& updateRect, unsigned textureId);
+ void cleanupResources();
+
unsigned m_contentsTexture;
IntSize m_allocatedTextureSize;
bool m_skipsDraw;
diff --git a/WebCore/platform/graphics/chromium/FontLinux.cpp b/WebCore/platform/graphics/chromium/FontLinux.cpp
index 696cd9c..a242523 100644
--- a/WebCore/platform/graphics/chromium/FontLinux.cpp
+++ b/WebCore/platform/graphics/chromium/FontLinux.cpp
@@ -130,7 +130,7 @@ void Font::drawGlyphs(GraphicsContext* gc, const SimpleFontData* font,
if (textMode & cTextFill) {
// If we also filled, we don't want to draw shadows twice.
// See comment in FontChromiumWin.cpp::paintSkiaText() for more details.
- paint.setLooper(0)->safeUnref();
+ SkSafeUnref(paint.setLooper(0));
}
canvas->drawPosText(glyphs, numGlyphs << 1, pos, paint);
@@ -313,7 +313,7 @@ public:
// So we allow that to run first, then do a second pass over the range it
// found and take the largest subregion that stays within a single font.
const FontData* glyphData = m_font->glyphDataForCharacter(m_item.string[m_item.item.pos], false, false).fontData;
- int endOfRun;
+ unsigned endOfRun;
for (endOfRun = 1; endOfRun < m_item.item.length; ++endOfRun) {
const FontData* nextGlyphData = m_font->glyphDataForCharacter(m_item.string[m_item.item.pos + endOfRun], false, false).fontData;
if (nextGlyphData != glyphData)
@@ -406,7 +406,7 @@ private:
// Harfbuzz will do the same thing for us using the GSUB table.
// 2) Convert spacing characters into plain spaces, as some fonts will provide glyphs
// for characters like '\n' otherwise.
- for (unsigned i = 0; i < originalRun.length(); ++i) {
+ for (int i = 0; i < originalRun.length(); ++i) {
UChar ch = originalRun[i];
UBlockCode block = ::ublock_getCode(ch);
if (block == UBLOCK_COMBINING_DIACRITICAL_MARKS || (Font::treatAsSpace(ch) && ch != ' ')) {
@@ -428,7 +428,7 @@ private:
normalizedString.extract(m_normalizedBuffer.get(), normalizedString.length() + 1, error);
ASSERT(U_SUCCESS(error));
- for (unsigned i = 0; i < normalizedString.length(); ++i) {
+ for (int i = 0; i < normalizedString.length(); ++i) {
if (Font::treatAsSpace(m_normalizedBuffer[i]))
m_normalizedBuffer[i] = ' ';
}
@@ -517,7 +517,7 @@ private:
// glyph.
unsigned logClustersIndex = isRTL ? m_item.num_glyphs - 1 : 0;
- for (int iter = 0; iter < m_item.num_glyphs; ++iter) {
+ for (unsigned iter = 0; iter < m_item.num_glyphs; ++iter) {
// Glyphs are stored in logical order, but for layout purposes we
// always go left to right.
int i = isRTL ? m_item.num_glyphs - iter - 1 : iter;
@@ -683,7 +683,7 @@ static int glyphIndexForXPositionInScriptRun(const TextRunWalker& walker, int x)
x -= truncateFixedPointToInteger(advances[glyphIndex]);
}
} else {
- for (glyphIndex = 0; glyphIndex < walker.length(); ++glyphIndex) {
+ for (glyphIndex = 0; static_cast<unsigned>(glyphIndex) < walker.length(); ++glyphIndex) {
if (x < truncateFixedPointToInteger(advances[glyphIndex]))
break;
x -= truncateFixedPointToInteger(advances[glyphIndex]);
@@ -741,7 +741,7 @@ int Font::offsetForPositionForComplexText(const TextRun& run, float xFloat,
if (walker.rtl())
basePosition -= walker.numCodePoints();
- if (x >= 0 && x < walker.width()) {
+ if (x >= 0 && static_cast<unsigned>(x) < walker.width()) {
// The x value in question is within this script run. We consider
// each glyph in presentation order and stop when we find the one
// covering this position.
@@ -803,7 +803,7 @@ FloatRect Font::selectionRectForComplexText(const TextRun& run,
if (walker.rtl())
base -= walker.width();
- if (fromX == -1 && from < walker.numCodePoints()) {
+ if (fromX == -1 && from >= 0 && static_cast<unsigned>(from) < walker.numCodePoints()) {
// |from| is within this script run. So we index the clusters log to
// find which glyph this code-point contributed to and find its x
// position.
@@ -813,7 +813,7 @@ FloatRect Font::selectionRectForComplexText(const TextRun& run,
} else
from -= walker.numCodePoints();
- if (toX == -1 && to < walker.numCodePoints()) {
+ if (toX == -1 && to >= 0 && static_cast<unsigned>(to) < walker.numCodePoints()) {
int glyph = walker.logClusters()[to];
toX = base + walker.xPositions()[glyph];
toAdvance = walker.advances()[glyph];
diff --git a/WebCore/platform/graphics/chromium/FontPlatformData.h b/WebCore/platform/graphics/chromium/FontPlatformData.h
index 871fec8..d8ce3e2 100644
--- a/WebCore/platform/graphics/chromium/FontPlatformData.h
+++ b/WebCore/platform/graphics/chromium/FontPlatformData.h
@@ -33,7 +33,7 @@
#if OS(WINDOWS)
#include "FontPlatformDataChromiumWin.h"
-#elif OS(LINUX)
+#elif OS(LINUX) || OS(FREEBSD)
#include "FontPlatformDataLinux.h"
#endif
diff --git a/WebCore/platform/graphics/chromium/FontPlatformDataLinux.cpp b/WebCore/platform/graphics/chromium/FontPlatformDataLinux.cpp
index b51eb8c..0da873b 100644
--- a/WebCore/platform/graphics/chromium/FontPlatformDataLinux.cpp
+++ b/WebCore/platform/graphics/chromium/FontPlatformDataLinux.cpp
@@ -76,7 +76,7 @@ FontPlatformData::FontPlatformData(const FontPlatformData& src)
, m_style(src.m_style)
, m_harfbuzzFace(src.m_harfbuzzFace)
{
- m_typeface->safeRef();
+ SkSafeRef(m_typeface);
}
FontPlatformData::FontPlatformData(SkTypeface* tf, const char* family, float textSize, bool fakeBold, bool fakeItalic)
@@ -86,7 +86,7 @@ FontPlatformData::FontPlatformData(SkTypeface* tf, const char* family, float tex
, m_fakeBold(fakeBold)
, m_fakeItalic(fakeItalic)
{
- m_typeface->safeRef();
+ SkSafeRef(m_typeface);
querySystemForRenderStyle();
}
@@ -98,13 +98,13 @@ FontPlatformData::FontPlatformData(const FontPlatformData& src, float textSize)
, m_fakeItalic(src.m_fakeItalic)
, m_harfbuzzFace(src.m_harfbuzzFace)
{
- m_typeface->safeRef();
+ SkSafeRef(m_typeface);
querySystemForRenderStyle();
}
FontPlatformData::~FontPlatformData()
{
- m_typeface->safeUnref();
+ SkSafeUnref(m_typeface);
}
FontPlatformData& FontPlatformData::operator=(const FontPlatformData& src)
diff --git a/WebCore/platform/graphics/chromium/HarfbuzzSkia.cpp b/WebCore/platform/graphics/chromium/HarfbuzzSkia.cpp
index 59e8122..056d8eb 100644
--- a/WebCore/platform/graphics/chromium/HarfbuzzSkia.cpp
+++ b/WebCore/platform/graphics/chromium/HarfbuzzSkia.cpp
@@ -150,7 +150,7 @@ static HB_Error getOutlinePoint(HB_Font hbFont, HB_Glyph glyph, int flags, hb_ui
SkPath path;
paint.getTextPath(&glyph16, sizeof(glyph16), 0, 0, &path);
int numPoints = path.getPoints(0, 0);
- if (point >= numPoints)
+ if (point >= static_cast<unsigned>(numPoints))
return HB_Err_Invalid_SubTable;
SkPoint* points = reinterpret_cast<SkPoint*>(fastMalloc(sizeof(SkPoint) * (point + 1)));
if (!points)
diff --git a/WebCore/platform/graphics/chromium/LayerChromium.cpp b/WebCore/platform/graphics/chromium/LayerChromium.cpp
index e36c69d..5dba58d 100644
--- a/WebCore/platform/graphics/chromium/LayerChromium.cpp
+++ b/WebCore/platform/graphics/chromium/LayerChromium.cpp
@@ -174,9 +174,6 @@ LayerChromium::~LayerChromium()
void LayerChromium::setLayerRenderer(LayerRendererChromium* renderer)
{
- // It's not expected that layers will ever switch renderers.
- ASSERT(!renderer || !m_layerRenderer || renderer == m_layerRenderer);
-
m_layerRenderer = renderer;
}
@@ -224,9 +221,10 @@ unsigned LayerChromium::createShaderProgram(GraphicsContext3D* context, const ch
void LayerChromium::setNeedsCommit()
{
- // Call notifySyncRequired(), which in this implementation plumbs through to
+ // Call notifySyncRequired(), which for non-root layers plumbs through to
// call setRootLayerNeedsDisplay() on the WebView, which will cause LayerRendererChromium
// to render a frame.
+ // This function has no effect on root layers.
if (m_owner)
m_owner->notifySyncRequired();
}
@@ -352,8 +350,9 @@ LayerChromium* LayerChromium::superlayer() const
void LayerChromium::setNeedsDisplay(const FloatRect& dirtyRect)
{
- // Simply mark the contents as dirty. The actual redraw will
- // happen when it's time to do the compositing.
+ // Simply mark the contents as dirty. For non-root layers, the call to
+ // setNeedsCommit will schedule a fresh compositing pass.
+ // For the root layer, setNeedsCommit has no effect.
m_contentsDirty = true;
m_dirtyRect.unite(dirtyRect);
diff --git a/WebCore/platform/graphics/chromium/LayerChromium.h b/WebCore/platform/graphics/chromium/LayerChromium.h
index 30d35d1..0a66318 100644
--- a/WebCore/platform/graphics/chromium/LayerChromium.h
+++ b/WebCore/platform/graphics/chromium/LayerChromium.h
@@ -147,7 +147,9 @@ public:
bool preserves3D() { return m_owner && m_owner->preserves3D(); }
- void setLayerRenderer(LayerRendererChromium*);
+ // Derived types must override this method if they need to react to a change
+ // in the LayerRendererChromium.
+ virtual void setLayerRenderer(LayerRendererChromium*);
void setOwner(GraphicsLayerChromium* owner) { m_owner = owner; }
@@ -200,7 +202,7 @@ protected:
GraphicsLayerChromium* m_owner;
LayerChromium(GraphicsLayerChromium* owner);
- LayerRendererChromium* layerRenderer() const { return m_layerRenderer; }
+ LayerRendererChromium* layerRenderer() const { return m_layerRenderer.get(); }
GraphicsContext3D* layerRendererContext() const;
static void drawTexturedQuad(GraphicsContext3D*, const TransformationMatrix& projectionMatrix, const TransformationMatrix& layerMatrix,
@@ -260,7 +262,7 @@ private:
bool m_needsDisplayOnBoundsChange;
// Points to the layer renderer that updates and draws this layer.
- LayerRendererChromium* m_layerRenderer;
+ RefPtr<LayerRendererChromium> m_layerRenderer;
FloatRect m_frame;
TransformationMatrix m_transform;
diff --git a/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp b/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp
index 116a15d..c4031e5 100644
--- a/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp
+++ b/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp
@@ -73,12 +73,12 @@ static inline bool compareLayerZ(const LayerChromium* a, const LayerChromium* b)
return transformA.m43() < transformB.m43();
}
-PassOwnPtr<LayerRendererChromium> LayerRendererChromium::create(PassOwnPtr<GraphicsContext3D> context)
+PassRefPtr<LayerRendererChromium> LayerRendererChromium::create(PassOwnPtr<GraphicsContext3D> context)
{
if (!context)
return 0;
- OwnPtr<LayerRendererChromium> layerRenderer(new LayerRendererChromium(context));
+ RefPtr<LayerRendererChromium> layerRenderer(adoptRef(new LayerRendererChromium(context)));
if (!layerRenderer->hardwareCompositing())
return 0;
@@ -91,7 +91,6 @@ LayerRendererChromium::LayerRendererChromium(PassOwnPtr<GraphicsContext3D> conte
, m_rootLayerTextureHeight(0)
, m_scrollShaderProgram(0)
, m_rootLayer(0)
- , m_needsDisplay(false)
, m_scrollPosition(IntPoint(-1, -1))
, m_currentShader(0)
, m_context(context)
@@ -159,8 +158,10 @@ void LayerRendererChromium::useShader(unsigned programId)
}
}
-// Updates the contents of the root layer texture that fall inside the updateRect
-// and re-composits all sublayers.
+// This method must be called before any other updates are made to the
+// root layer texture. It resizes the root layer texture and scrolls its
+// contents as needed. It also sets up common GL state used by the rest
+// of the layer drawing code.
void LayerRendererChromium::prepareToDrawLayers(const IntRect& visibleRect, const IntRect& contentRect,
const IntPoint& scrollPosition)
{
@@ -172,6 +173,8 @@ void LayerRendererChromium::prepareToDrawLayers(const IntRect& visibleRect, cons
makeContextCurrent();
GLC(m_context, m_context->bindTexture(GraphicsContext3D::TEXTURE_2D, m_rootLayerTextureId));
+
+ bool skipScroll = false;
// If the size of the visible area has changed then allocate a new texture
// to store the contents of the root layer and adjust the projection matrix
@@ -184,6 +187,10 @@ void LayerRendererChromium::prepareToDrawLayers(const IntRect& visibleRect, cons
m_projectionMatrix = orthoMatrix(0, visibleRectWidth, visibleRectHeight, 0, -1000, 1000);
GLC(m_context, m_context->texImage2D(GraphicsContext3D::TEXTURE_2D, 0, GraphicsContext3D::RGBA, m_rootLayerTextureWidth, m_rootLayerTextureHeight, 0, GraphicsContext3D::RGBA, GraphicsContext3D::UNSIGNED_BYTE, 0));
+
+ // The root layer texture was just resized so its contents are not
+ // useful for scrolling.
+ skipScroll = true;
}
// The GL viewport covers the entire visible area, including the scrollbars.
@@ -198,12 +205,20 @@ void LayerRendererChromium::prepareToDrawLayers(const IntRect& visibleRect, cons
GLC(m_context, m_context->depthFunc(GraphicsContext3D::LEQUAL));
GLC(m_context, m_context->clearStencil(0));
- if (m_scrollPosition == IntPoint(-1, -1))
+ if (m_scrollPosition == IntPoint(-1, -1)) {
m_scrollPosition = scrollPosition;
+ skipScroll = true;
+ }
IntPoint scrollDelta = toPoint(scrollPosition - m_scrollPosition);
+
+ // Scrolling larger than the contentRect size does not preserve any of the pixels, so there is
+ // no need to copy framebuffer pixels back into the texture.
+ if (abs(scrollDelta.y()) > contentRect.height() || abs(scrollDelta.x()) > contentRect.width())
+ skipScroll = true;
+
// Scroll the backbuffer
- if (scrollDelta.x() || scrollDelta.y()) {
+ if (!skipScroll && (scrollDelta.x() || scrollDelta.y())) {
// Scrolling works as follows: We render a quad with the current root layer contents
// translated by the amount the page has scrolled since the last update and then read the
// pixels of the content area (visible area excluding the scroll bars) back into the
@@ -221,23 +236,9 @@ void LayerRendererChromium::prepareToDrawLayers(const IntRect& visibleRect, cons
m_scrollShaderMatrixLocation, -1);
GLC(m_context, m_context->copyTexSubImage2D(GraphicsContext3D::TEXTURE_2D, 0, 0, 0, 0, 0, contentRect.width(), contentRect.height()));
- m_scrollPosition = scrollPosition;
- } else if (abs(scrollDelta.y()) > contentRect.height() || abs(scrollDelta.x()) > contentRect.width()) {
- // Scrolling larger than the contentRect size does not preserve any of the pixels, so there is
- // no need to copy framebuffer pixels back into the texture.
- m_scrollPosition = scrollPosition;
}
- // Translate all the composited layers by the scroll position.
- TransformationMatrix matrix;
- matrix.translate3d(-m_scrollPosition.x(), -m_scrollPosition.y(), 0);
-
- // Traverse the layer tree and update the layer transforms.
- float opacity = 1;
- const Vector<RefPtr<LayerChromium> >& sublayers = m_rootLayer->getSublayers();
- size_t i;
- for (i = 0; i < sublayers.size(); i++)
- updateLayersRecursive(sublayers[i].get(), matrix, opacity);
+ m_scrollPosition = scrollPosition;
}
void LayerRendererChromium::updateRootLayerTextureRect(const IntRect& updateRect)
@@ -256,9 +257,7 @@ void LayerRendererChromium::updateRootLayerTextureRect(const IntRect& updateRect
#if PLATFORM(SKIA)
// Get the contents of the updated rect.
const SkBitmap bitmap = m_rootLayerCanvas->getDevice()->accessBitmap(false);
- int bitmapWidth = bitmap.width();
- int bitmapHeight = bitmap.height();
- ASSERT(bitmapWidth == updateRect.width() && bitmapHeight == updateRect.height());
+ ASSERT(bitmap.width() == updateRect.width() && bitmap.height() == updateRect.height());
void* pixels = bitmap.getPixels();
#elif PLATFORM(CG)
// Get the contents of the updated rect.
@@ -306,16 +305,13 @@ void LayerRendererChromium::drawLayers(const IntRect& visibleRect, const IntRect
// Set the rootVisibleRect --- used by subsequent drawLayers calls
m_rootVisibleRect = visibleRect;
- // Translate all the composited layers by the scroll position.
- TransformationMatrix matrix;
- matrix.translate3d(-m_scrollPosition.x(), -m_scrollPosition.y(), 0);
-
// Traverse the layer tree and update the layer transforms.
float opacity = 1;
const Vector<RefPtr<LayerChromium> >& sublayers = m_rootLayer->getSublayers();
size_t i;
+ TransformationMatrix identityMatrix;
for (i = 0; i < sublayers.size(); i++)
- updateLayersRecursive(sublayers[i].get(), matrix, opacity);
+ updateLayersRecursive(sublayers[i].get(), identityMatrix, opacity);
// Enable scissoring to avoid rendering composited layers over the scrollbars.
GLC(m_context, m_context->enable(GraphicsContext3D::SCISSOR_TEST));
@@ -349,7 +345,6 @@ void LayerRendererChromium::present()
// Note that currently this has the same effect as swapBuffers; we should
// consider exposing a different entry point on GraphicsContext3D.
m_context->prepareTexture();
- m_needsDisplay = false;
}
void LayerRendererChromium::getFramebufferPixels(void *pixels, const IntRect& rect)
@@ -381,6 +376,14 @@ unsigned LayerRendererChromium::createLayerTexture()
return textureId;
}
+void LayerRendererChromium::deleteLayerTexture(unsigned textureId)
+{
+ if (!textureId)
+ return;
+
+ GLC(m_context, m_context->deleteTexture(textureId));
+}
+
// Returns true if any part of the layer falls within the visibleRect
bool LayerRendererChromium::isLayerVisible(LayerChromium* layer, const TransformationMatrix& matrix, const IntRect& visibleRect)
{
@@ -717,7 +720,8 @@ bool LayerRendererChromium::initializeSharedObjects()
m_layerSharedValues = adoptPtr(new LayerChromium::SharedValues(m_context.get()));
m_contentLayerSharedValues = adoptPtr(new ContentLayerChromium::SharedValues(m_context.get()));
m_canvasLayerSharedValues = adoptPtr(new CanvasLayerChromium::SharedValues(m_context.get()));
- if (!m_layerSharedValues->initialized() || !m_contentLayerSharedValues->initialized() || !m_canvasLayerSharedValues->initialized()) {
+ m_videoLayerSharedValues = adoptPtr(new VideoLayerChromium::SharedValues(m_context.get()));
+ if (!m_layerSharedValues->initialized() || !m_contentLayerSharedValues->initialized() || !m_canvasLayerSharedValues->initialized() || !m_videoLayerSharedValues->initialized()) {
cleanupSharedObjects();
return false;
}
@@ -732,6 +736,7 @@ void LayerRendererChromium::cleanupSharedObjects()
m_layerSharedValues.clear();
m_contentLayerSharedValues.clear();
m_canvasLayerSharedValues.clear();
+ m_videoLayerSharedValues.clear();
if (m_scrollShaderProgram) {
GLC(m_context, m_context->deleteProgram(m_scrollShaderProgram));
@@ -739,7 +744,7 @@ void LayerRendererChromium::cleanupSharedObjects()
}
if (m_rootLayerTextureId) {
- GLC(m_context, m_context->deleteTexture(m_rootLayerTextureId));
+ deleteLayerTexture(m_rootLayerTextureId);
m_rootLayerTextureId = 0;
}
}
diff --git a/WebCore/platform/graphics/chromium/LayerRendererChromium.h b/WebCore/platform/graphics/chromium/LayerRendererChromium.h
index c733228..b714584 100644
--- a/WebCore/platform/graphics/chromium/LayerRendererChromium.h
+++ b/WebCore/platform/graphics/chromium/LayerRendererChromium.h
@@ -39,9 +39,12 @@
#include "IntRect.h"
#include "LayerChromium.h"
#include "SkBitmap.h"
+#include "VideoLayerChromium.h"
#include <wtf/HashMap.h>
#include <wtf/Noncopyable.h>
#include <wtf/PassOwnPtr.h>
+#include <wtf/PassRefPtr.h>
+#include <wtf/RefCounted.h>
#include <wtf/Vector.h>
#if PLATFORM(CG)
@@ -54,9 +57,9 @@ namespace WebCore {
class GraphicsContext3D;
// Class that handles drawing of composited render layers using GL.
-class LayerRendererChromium : public Noncopyable {
+class LayerRendererChromium : public RefCounted<LayerRendererChromium> {
public:
- static PassOwnPtr<LayerRendererChromium> create(PassOwnPtr<GraphicsContext3D> graphicsContext3D);
+ static PassRefPtr<LayerRendererChromium> create(PassOwnPtr<GraphicsContext3D> graphicsContext3D);
LayerRendererChromium(PassOwnPtr<GraphicsContext3D> graphicsContext3D);
~LayerRendererChromium();
@@ -81,8 +84,6 @@ public:
void setRootLayer(PassRefPtr<LayerChromium> layer) { m_rootLayer = layer; }
LayerChromium* rootLayer() { return m_rootLayer.get(); }
- void setNeedsDisplay() { m_needsDisplay = true; }
-
bool hardwareCompositing() const { return m_hardwareCompositing; }
void setRootLayerCanvasSize(const IntSize&);
@@ -90,6 +91,7 @@ public:
GraphicsContext* rootLayerGraphicsContext() const { return m_rootLayerGraphicsContext.get(); }
unsigned createLayerTexture();
+ void deleteLayerTexture(unsigned);
static void debugGLCall(GraphicsContext3D*, const char* command, const char* file, int line);
@@ -102,6 +104,7 @@ public:
const LayerChromium::SharedValues* layerSharedValues() const { return m_layerSharedValues.get(); }
const ContentLayerChromium::SharedValues* contentLayerSharedValues() const { return m_contentLayerSharedValues.get(); }
const CanvasLayerChromium::SharedValues* canvasLayerSharedValues() const { return m_canvasLayerSharedValues.get(); }
+ const VideoLayerChromium::SharedValues* videoLayerSharedValues() const { return m_videoLayerSharedValues.get(); }
void resizeOnscreenContent(const IntSize&);
@@ -139,7 +142,6 @@ private:
RefPtr<LayerChromium> m_rootLayer;
- bool m_needsDisplay;
IntPoint m_scrollPosition;
bool m_hardwareCompositing;
@@ -170,6 +172,7 @@ private:
OwnPtr<LayerChromium::SharedValues> m_layerSharedValues;
OwnPtr<ContentLayerChromium::SharedValues> m_contentLayerSharedValues;
OwnPtr<CanvasLayerChromium::SharedValues> m_canvasLayerSharedValues;
+ OwnPtr<VideoLayerChromium::SharedValues> m_videoLayerSharedValues;
OwnPtr<GraphicsContext3D> m_context;
};
diff --git a/WebCore/platform/graphics/chromium/VDMXParser.cpp b/WebCore/platform/graphics/chromium/VDMXParser.cpp
index 3347226..bd30a97 100644
--- a/WebCore/platform/graphics/chromium/VDMXParser.cpp
+++ b/WebCore/platform/graphics/chromium/VDMXParser.cpp
@@ -31,7 +31,6 @@
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
-#include <sys/types.h>
// For htons/ntohs
#include <arpa/inet.h>
diff --git a/WebCore/platform/graphics/chromium/VideoFrameChromium.cpp b/WebCore/platform/graphics/chromium/VideoFrameChromium.cpp
new file mode 100644
index 0000000..43b40e2
--- /dev/null
+++ b/WebCore/platform/graphics/chromium/VideoFrameChromium.cpp
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#include "VideoFrameChromium.h"
+
+namespace WebCore {
+
+const unsigned VideoFrameChromium::maxPlanes = 3;
+const unsigned VideoFrameChromium::numRGBPlanes = 1;
+const unsigned VideoFrameChromium::rgbPlane = 0;
+const unsigned VideoFrameChromium::numYUVPlanes = 3;
+const unsigned VideoFrameChromium::yPlane = 0;
+const unsigned VideoFrameChromium::uPlane = 1;
+const unsigned VideoFrameChromium::vPlane = 2;
+
+} // namespace WebCore
+
+
diff --git a/WebCore/platform/graphics/chromium/VideoFrameChromium.h b/WebCore/platform/graphics/chromium/VideoFrameChromium.h
index bbd677e..34e922b 100644
--- a/WebCore/platform/graphics/chromium/VideoFrameChromium.h
+++ b/WebCore/platform/graphics/chromium/VideoFrameChromium.h
@@ -31,18 +31,20 @@
#ifndef VideoFrameChromium_h
#define VideoFrameChromium_h
+#include "IntSize.h"
+
namespace WebCore {
// A class that represents a video frame in chromium.
class VideoFrameChromium {
public:
- static const unsigned cMaxPlanes;
- static const unsigned cNumRGBPlanes;
- static const unsigned cRGBPlane;
- static const unsigned cNumYUVPlanes;
- static const unsigned cYPlane;
- static const unsigned cUPlane;
- static const unsigned cVPlane;
+ static const unsigned maxPlanes;
+ static const unsigned numRGBPlanes;
+ static const unsigned rgbPlane;
+ static const unsigned numYUVPlanes;
+ static const unsigned yPlane;
+ static const unsigned uPlane;
+ static const unsigned vPlane;
// These enums must be kept in sync with WebKit::WebVideoFrame.
enum Format {
@@ -74,6 +76,7 @@ public:
virtual unsigned planes() const = 0;
virtual int stride(unsigned plane) const = 0;
virtual const void* data(unsigned plane) const = 0;
+ virtual const IntSize requiredTextureSize(unsigned plane) const = 0;
};
} // namespace WebCore
diff --git a/WebCore/platform/graphics/chromium/VideoLayerChromium.cpp b/WebCore/platform/graphics/chromium/VideoLayerChromium.cpp
index 0fb1bb4..26641a9 100644
--- a/WebCore/platform/graphics/chromium/VideoLayerChromium.cpp
+++ b/WebCore/platform/graphics/chromium/VideoLayerChromium.cpp
@@ -36,15 +36,134 @@
#include "GraphicsContext3D.h"
#include "LayerRendererChromium.h"
#include "RenderLayerBacking.h"
-#include "skia/ext/platform_canvas.h"
-
-#if PLATFORM(SKIA)
-#include "NativeImageSkia.h"
-#include "PlatformContextSkia.h"
-#endif
+#include "VideoFrameChromium.h"
+#include "VideoFrameProvider.h"
namespace WebCore {
+// These values are magic numbers that are used in the transformation
+// from YUV to RGB color values.
+const float VideoLayerChromium::yuv2RGB[9] = {
+ 1.f, 1.f, 1.f,
+ 0.f, -.344f, 1.772f,
+ 1.403f, -.714f, 0.f,
+};
+
+VideoLayerChromium::SharedValues::SharedValues(GraphicsContext3D* context)
+ : m_context(context)
+ , m_yuvShaderProgram(0)
+ , m_rgbaShaderProgram(0)
+ , m_yuvShaderMatrixLocation(0)
+ , m_yuvWidthScaleFactorLocation(0)
+ , m_rgbaShaderMatrixLocation(0)
+ , m_rgbaWidthScaleFactorLocation(0)
+ , m_ccMatrixLocation(0)
+ , m_yTextureLocation(0)
+ , m_uTextureLocation(0)
+ , m_vTextureLocation(0)
+ , m_rgbaTextureLocation(0)
+ , m_yuvAlphaLocation(0)
+ , m_rgbaAlphaLocation(0)
+ , m_initialized(false)
+{
+ // Frame textures are allocated based on stride width, not visible frame
+ // width, such that there is a guarantee that the frame rows line up
+ // properly and are not shifted by (stride - width) pixels. To hide the
+ // "padding" pixels between the edge of the visible frame width and the end
+ // of the stride, we give the shader a widthScaleFactor (<=1.0) of how much
+ // of the width of the texture should be shown when drawing the texture onto
+ // the vertices.
+ char vertexShaderString[] =
+ "precision mediump float; \n"
+ "attribute vec4 a_position; \n"
+ "attribute vec2 a_texCoord; \n"
+ "uniform mat4 matrix; \n"
+ "varying vec2 v_texCoord; \n"
+ "uniform float widthScaleFactor; \n"
+ "void main() \n"
+ "{ \n"
+ " gl_Position = matrix * a_position; \n"
+ " v_texCoord = vec2(widthScaleFactor * a_texCoord.x, a_texCoord.y); \n"
+ "} \n";
+
+ char yuvFragmentShaderString[] =
+ "precision mediump float; \n"
+ "precision mediump int; \n"
+ "varying vec2 v_texCoord; \n"
+ "uniform sampler2D y_texture; \n"
+ "uniform sampler2D u_texture; \n"
+ "uniform sampler2D v_texture; \n"
+ "uniform float alpha; \n"
+ "uniform mat3 cc_matrix; \n"
+ "void main() \n"
+ "{ \n"
+ " float y = texture2D(y_texture, v_texCoord).x; \n"
+ " float u = texture2D(u_texture, v_texCoord).r - .5; \n"
+ " float v = texture2D(v_texture, v_texCoord).r - .5; \n"
+ " vec3 rgb = cc_matrix * vec3(y, u, v); \n"
+ " gl_FragColor = vec4(rgb.x, rgb.y, rgb.z, 1.0) * alpha; \n"
+ "} \n";
+
+ char rgbaFragmentShaderString[] =
+ "precision mediump float; \n"
+ "varying vec2 v_texCoord; \n"
+ "uniform sampler2D rgba_texture; \n"
+ "uniform float alpha; \n"
+ "void main() \n"
+ "{ \n"
+ " vec4 texColor = texture2D(rgba_texture, vec2(v_texCoord.x, 1.0 - v_texCoord.y)); \n"
+ " gl_FragColor = vec4(texColor.x, texColor.y, texColor.z, texColor.w) * alpha; \n"
+ "} \n";
+
+ m_rgbaShaderProgram = createShaderProgram(m_context, vertexShaderString, rgbaFragmentShaderString);
+ if (!m_rgbaShaderProgram) {
+ LOG_ERROR("VideoLayerChromium: Failed to create rgba shader program");
+ return;
+ }
+
+ m_yuvShaderProgram = createShaderProgram(m_context, vertexShaderString, yuvFragmentShaderString);
+ if (!m_yuvShaderProgram) {
+ LOG_ERROR("VideoLayerChromium: Failed to create yuv shader program");
+ return;
+ }
+
+ m_yuvShaderMatrixLocation = m_context->getUniformLocation(m_yuvShaderProgram, "matrix");
+ m_yuvWidthScaleFactorLocation = m_context->getUniformLocation(m_yuvShaderProgram, "widthScaleFactor");
+ m_yTextureLocation = m_context->getUniformLocation(m_yuvShaderProgram, "y_texture");
+ m_uTextureLocation = m_context->getUniformLocation(m_yuvShaderProgram, "u_texture");
+ m_vTextureLocation = m_context->getUniformLocation(m_yuvShaderProgram, "v_texture");
+ m_ccMatrixLocation = m_context->getUniformLocation(m_yuvShaderProgram, "cc_matrix");
+ m_yuvAlphaLocation = m_context->getUniformLocation(m_yuvShaderProgram, "alpha");
+
+ ASSERT(m_yuvShaderMatrixLocation != -1);
+ ASSERT(m_yuvWidthScaleFactorLocation != -1);
+ ASSERT(m_yTextureLocation != -1);
+ ASSERT(m_uTextureLocation != -1);
+ ASSERT(m_vTextureLocation != -1);
+ ASSERT(m_ccMatrixLocation != -1);
+ ASSERT(m_yuvAlphaLocation != -1);
+
+ m_rgbaShaderMatrixLocation = m_context->getUniformLocation(m_rgbaShaderProgram, "matrix");
+ m_rgbaTextureLocation = m_context->getUniformLocation(m_rgbaShaderProgram, "rgba_texture");
+ m_rgbaWidthScaleFactorLocation = m_context->getUniformLocation(m_rgbaShaderProgram, "widthScaleFactor");
+ m_rgbaAlphaLocation = m_context->getUniformLocation(m_rgbaShaderProgram, "alpha");
+
+ ASSERT(m_rgbaShaderMatrixLocation != -1);
+ ASSERT(m_rgbaTextureLocation != -1);
+ ASSERT(m_rgbaWidthScaleFactorLocation != -1);
+ ASSERT(m_rgbaAlphaLocation != -1);
+
+ m_initialized = true;
+}
+
+VideoLayerChromium::SharedValues::~SharedValues()
+{
+ if (m_yuvShaderProgram)
+ GLC(m_context, m_context->deleteProgram(m_yuvShaderProgram));
+ if (m_rgbaShaderProgram)
+ GLC(m_context, m_context->deleteProgram(m_rgbaShaderProgram));
+}
+
PassRefPtr<VideoLayerChromium> VideoLayerChromium::create(GraphicsLayerChromium* owner,
VideoFrameProvider* provider)
{
@@ -52,14 +171,25 @@ PassRefPtr<VideoLayerChromium> VideoLayerChromium::create(GraphicsLayerChromium*
}
VideoLayerChromium::VideoLayerChromium(GraphicsLayerChromium* owner, VideoFrameProvider* provider)
- : ContentLayerChromium(owner)
-#if PLATFORM(SKIA)
- , m_canvas(0)
- , m_skiaContext(0)
-#endif
- , m_graphicsContext(0)
+ : LayerChromium(owner)
+ , m_skipsDraw(true)
+ , m_frameFormat(VideoFrameChromium::Invalid)
, m_provider(provider)
{
+ for (unsigned plane = 0; plane < VideoFrameChromium::maxPlanes; plane++) {
+ m_textures[plane] = 0;
+ m_textureSizes[plane] = IntSize();
+ m_frameSizes[plane] = IntSize();
+ }
+}
+
+VideoLayerChromium::~VideoLayerChromium()
+{
+ GraphicsContext3D* context = layerRendererContext();
+ for (unsigned plane = 0; plane < VideoFrameChromium::maxPlanes; plane++) {
+ if (m_textures[plane])
+ GLC(context, context->deleteTexture(m_textures[plane]));
+ }
}
void VideoLayerChromium::updateContents()
@@ -70,129 +200,176 @@ void VideoLayerChromium::updateContents()
ASSERT(drawsContent());
- IntRect dirtyRect(m_dirtyRect);
- IntSize requiredTextureSize;
-
-#if PLATFORM(SKIA)
- requiredTextureSize = m_bounds;
- IntRect boundsRect(IntPoint(0, 0), m_bounds);
-
- // If the texture needs to be reallocated, then we must redraw the entire
- // contents of the layer.
- if (requiredTextureSize != m_allocatedTextureSize)
- dirtyRect = boundsRect;
- else {
- // Clip the dirtyRect to the size of the layer to avoid drawing outside
- // the bounds of the backing texture.
- dirtyRect.intersect(boundsRect);
+ m_skipsDraw = false;
+ VideoFrameChromium* frame = m_provider->getCurrentFrame();
+ if (!frame) {
+ m_skipsDraw = true;
+ m_provider->putCurrentFrame(frame);
+ return;
}
- if (!m_canvas.get()
- || dirtyRect.width() != m_canvas->getDevice()->width()
- || dirtyRect.height() != m_canvas->getDevice()->height()) {
- m_canvas = new skia::PlatformCanvas(dirtyRect.width(), dirtyRect.height(), true);
- m_skiaContext = new PlatformContextSkia(m_canvas.get());
-
- // This is needed to get text to show up correctly.
- // FIXME: Does this take us down a very slow text rendering path?
- m_skiaContext->setDrawingToImageBuffer(true);
- m_graphicsContext = new GraphicsContext(reinterpret_cast<PlatformGraphicsContext*>(m_skiaContext.get()));
+ m_frameFormat = frame->format();
+ unsigned textureFormat = determineTextureFormat(frame);
+ if (textureFormat == GraphicsContext3D::INVALID_VALUE) {
+ // FIXME: Implement other paths.
+ notImplemented();
+ m_skipsDraw = true;
+ m_provider->putCurrentFrame(frame);
+ return;
}
- // Bring the canvas into the coordinate system of the paint rect.
- m_canvas->translate(static_cast<SkScalar>(-dirtyRect.x()), static_cast<SkScalar>(-dirtyRect.y()));
-
- // FIXME: Remove this test when tiled layers are implemented.
- m_skipsDraw = false;
- if (!layerRenderer()->checkTextureSize(requiredTextureSize)) {
+ // Allocate textures for planes if they are not allocated already, or
+ // reallocate textures that are the wrong size for the frame.
+ GraphicsContext3D* context = layerRendererContext();
+ bool texturesAllocated = allocateTexturesIfNeeded(context, frame, textureFormat);
+ if (!texturesAllocated) {
m_skipsDraw = true;
+ m_provider->putCurrentFrame(frame);
return;
}
- unsigned textureId = m_contentsTexture;
- if (!textureId)
- textureId = layerRenderer()->createLayerTexture();
-
- // If the texture id or size changed since last time, then we need to tell GL
- // to re-allocate a texture.
- if (m_contentsTexture != textureId || requiredTextureSize != m_allocatedTextureSize)
- createTextureRect(requiredTextureSize, dirtyRect, textureId);
- else
- updateTextureRect(dirtyRect, textureId);
-#else
- // FIXME: Implement non-skia path
- notImplemented();
-#endif
+ // Update texture planes.
+ for (unsigned plane = 0; plane < frame->planes(); plane++) {
+ ASSERT(frame->requiredTextureSize(plane) == m_textureSizes[plane]);
+ updateTexture(context, m_textures[plane], frame->requiredTextureSize(plane), textureFormat, frame->data(plane));
+ }
+
+ m_dirtyRect.setSize(FloatSize());
+ m_contentsDirty = false;
+ m_provider->putCurrentFrame(frame);
}
-void VideoLayerChromium::createTextureRect(const IntSize& requiredTextureSize, const IntRect& updateRect, unsigned textureId)
+unsigned VideoLayerChromium::determineTextureFormat(VideoFrameChromium* frame)
{
- // Paint into graphics context and get bitmap.
- m_owner->paintGraphicsLayerContents(*m_graphicsContext, updateRect);
- void* pixels = 0;
- IntSize bitmapSize = IntSize();
-#if PLATFORM(SKIA)
- const SkBitmap& bitmap = m_canvas->getDevice()->accessBitmap(false);
- const SkBitmap* skiaBitmap = &bitmap;
- ASSERT(skiaBitmap);
-
- SkAutoLockPixels lock(*skiaBitmap);
- SkBitmap::Config skiaConfig = skiaBitmap->config();
- // FIXME: Do we need to support more image configurations?
- if (skiaConfig == SkBitmap::kARGB_8888_Config) {
- pixels = skiaBitmap->getPixels();
- bitmapSize = IntSize(skiaBitmap->width(), skiaBitmap->height());
+ switch (frame->format()) {
+ case VideoFrameChromium::YV12:
+ return GraphicsContext3D::LUMINANCE;
+ case VideoFrameChromium::RGBA:
+ return GraphicsContext3D::RGBA;
+ default:
+ break;
}
-#else
- // FIXME: Implement non-skia path
- notImplemented();
-#endif
- if (!pixels)
- return;
+ return GraphicsContext3D::INVALID_VALUE;
+}
- GraphicsContext3D* context = layerRendererContext();
- context->bindTexture(GraphicsContext3D::TEXTURE_2D, textureId);
- ASSERT(bitmapSize == requiredTextureSize);
- context->texImage2D(GraphicsContext3D::TEXTURE_2D, 0, GraphicsContext3D::RGBA, requiredTextureSize.width(), requiredTextureSize.height(), 0, GraphicsContext3D::RGBA, GraphicsContext3D::UNSIGNED_BYTE, pixels);
+bool VideoLayerChromium::allocateTexturesIfNeeded(GraphicsContext3D* context, VideoFrameChromium* frame, unsigned textureFormat)
+{
+ ASSERT(context);
+ ASSERT(frame);
+
+ for (unsigned plane = 0; plane < frame->planes(); plane++) {
+ IntSize planeTextureSize = frame->requiredTextureSize(plane);
- m_contentsTexture = textureId;
- m_allocatedTextureSize = requiredTextureSize;
+ // If the renderer cannot handle this large of a texture, return false.
+ // FIXME: Remove this test when tiled layers are implemented.
+ if (!layerRenderer()->checkTextureSize(planeTextureSize))
+ return false;
- updateCompleted();
+ if (!m_textures[plane])
+ m_textures[plane] = layerRenderer()->createLayerTexture();
+
+ if (!planeTextureSize.isZero() && planeTextureSize != m_textureSizes[plane]) {
+ allocateTexture(context, m_textures[plane], planeTextureSize, textureFormat);
+ m_textureSizes[plane] = planeTextureSize;
+ m_frameSizes[plane] = IntSize(frame->width(), frame->height());
+ }
+ }
+ return true;
+}
+
+void VideoLayerChromium::allocateTexture(GraphicsContext3D* context, unsigned textureId, const IntSize& dimensions, unsigned textureFormat)
+{
+ GLC(context, context->bindTexture(GraphicsContext3D::TEXTURE_2D, textureId));
+ GLC(context, context->texImage2D(GraphicsContext3D::TEXTURE_2D, 0, textureFormat, dimensions.width(), dimensions.height(), 0, textureFormat, GraphicsContext3D::UNSIGNED_BYTE, 0));
}
-void VideoLayerChromium::updateTextureRect(const IntRect& updateRect, unsigned textureId)
+void VideoLayerChromium::updateTexture(GraphicsContext3D* context, unsigned textureId, const IntSize& dimensions, unsigned format, const void* data)
{
-#if PLATFORM(SKIA)
- const SkBitmap& bitmap = m_canvas->getDevice()->accessBitmap(true);
- SkBitmap* skiaBitmap = const_cast<SkBitmap*>(&bitmap);
- ASSERT(skiaBitmap);
-
- SkAutoLockPixels lock(*skiaBitmap);
- SkBitmap::Config skiaConfig = skiaBitmap->config();
-
- if (skiaConfig == SkBitmap::kARGB_8888_Config) {
- GraphicsContext3D* context = layerRendererContext();
- context->bindTexture(GraphicsContext3D::TEXTURE_2D, textureId);
- ASSERT(context->supportsMapSubCHROMIUM());
- void* mem = context->mapTexSubImage2DCHROMIUM(GraphicsContext3D::TEXTURE_2D, 0, updateRect.x(), updateRect.y(), updateRect.width(), updateRect.height(), GraphicsContext3D::RGBA, GraphicsContext3D::UNSIGNED_BYTE, GraphicsContext3D::WRITE_ONLY);
- skiaBitmap->setPixels(mem);
- m_owner->paintGraphicsLayerContents(*m_graphicsContext, updateRect);
- context->unmapTexSubImage2DCHROMIUM(mem);
+ ASSERT(context);
+ GLC(context, context->bindTexture(GraphicsContext3D::TEXTURE_2D, textureId));
+ void* mem = context->mapTexSubImage2DCHROMIUM(GraphicsContext3D::TEXTURE_2D, 0, 0, 0, dimensions.width(), dimensions.height(), format, GraphicsContext3D::UNSIGNED_BYTE, GraphicsContext3D::WRITE_ONLY);
+ if (mem) {
+ memcpy(mem, data, dimensions.width() * dimensions.height());
+ GLC(context, context->unmapTexSubImage2DCHROMIUM(mem));
+ } else {
+ // FIXME: We should have some sort of code to handle the case when
+ // mapTexSubImage2D fails.
+ m_skipsDraw = true;
}
+}
+
+void VideoLayerChromium::draw()
+{
+ if (m_skipsDraw)
+ return;
+
+ ASSERT(layerRenderer());
+ const VideoLayerChromium::SharedValues* sv = layerRenderer()->videoLayerSharedValues();
+ ASSERT(sv && sv->initialized());
- updateCompleted();
-#else
- // FIXME: Implement non-skia path
- notImplemented();
-#endif
+ switch (m_frameFormat) {
+ case VideoFrameChromium::YV12:
+ drawYUV(sv);
+ break;
+ case VideoFrameChromium::RGBA:
+ drawRGBA(sv);
+ break;
+ default:
+ // FIXME: Implement other paths.
+ notImplemented();
+ break;
+ }
}
-void VideoLayerChromium::updateCompleted()
+void VideoLayerChromium::drawYUV(const SharedValues* sv)
{
- m_dirtyRect.setSize(FloatSize());
- m_contentsDirty = false;
+ GraphicsContext3D* context = layerRendererContext();
+ GLC(context, context->activeTexture(GraphicsContext3D::TEXTURE1));
+ GLC(context, context->bindTexture(GraphicsContext3D::TEXTURE_2D, m_textures[VideoFrameChromium::yPlane]));
+ GLC(context, context->activeTexture(GraphicsContext3D::TEXTURE2));
+ GLC(context, context->bindTexture(GraphicsContext3D::TEXTURE_2D, m_textures[VideoFrameChromium::uPlane]));
+ GLC(context, context->activeTexture(GraphicsContext3D::TEXTURE3));
+ GLC(context, context->bindTexture(GraphicsContext3D::TEXTURE_2D, m_textures[VideoFrameChromium::vPlane]));
+
+ layerRenderer()->useShader(sv->yuvShaderProgram());
+ unsigned frameWidth = m_frameSizes[VideoFrameChromium::yPlane].width();
+ unsigned textureWidth = m_textureSizes[VideoFrameChromium::yPlane].width();
+ float widthScaleFactor = static_cast<float>(frameWidth) / textureWidth;
+ GLC(context, context->uniform1f(sv->yuvWidthScaleFactorLocation(), widthScaleFactor));
+
+ GLC(context, context->uniform1i(sv->yTextureLocation(), 1));
+ GLC(context, context->uniform1i(sv->uTextureLocation(), 2));
+ GLC(context, context->uniform1i(sv->vTextureLocation(), 3));
+
+ GLC(context, context->uniformMatrix3fv(sv->ccMatrixLocation(), 0, const_cast<float*>(yuv2RGB), 1));
+
+ drawTexturedQuad(context, layerRenderer()->projectionMatrix(), drawTransform(),
+ bounds().width(), bounds().height(), drawOpacity(),
+ sv->yuvShaderMatrixLocation(), sv->yuvAlphaLocation());
+
+ // Reset active texture back to texture 0.
+ GLC(context, context->activeTexture(GraphicsContext3D::TEXTURE0));
}
+void VideoLayerChromium::drawRGBA(const SharedValues* sv)
+{
+ GraphicsContext3D* context = layerRendererContext();
+ GLC(context, context->activeTexture(GraphicsContext3D::TEXTURE0));
+ GLC(context, context->bindTexture(GraphicsContext3D::TEXTURE_2D, m_textures[VideoFrameChromium::rgbPlane]));
+
+ layerRenderer()->useShader(sv->rgbaShaderProgram());
+ unsigned frameWidth = m_frameSizes[VideoFrameChromium::rgbPlane].width();
+ unsigned textureWidth = m_textureSizes[VideoFrameChromium::rgbPlane].width();
+ float widthScaleFactor = static_cast<float>(frameWidth) / textureWidth;
+ GLC(context, context->uniform1f(sv->rgbaWidthScaleFactorLocation(), widthScaleFactor));
+
+ GLC(context, context->uniform1i(sv->rgbaTextureLocation(), 0));
+
+ drawTexturedQuad(context, layerRenderer()->projectionMatrix(), drawTransform(),
+ bounds().width(), bounds().height(), drawOpacity(),
+ sv->rgbaShaderMatrixLocation(), sv->rgbaAlphaLocation());
}
+
+} // namespace WebCore
+
#endif // USE(ACCELERATED_COMPOSITING)
diff --git a/WebCore/platform/graphics/chromium/VideoLayerChromium.h b/WebCore/platform/graphics/chromium/VideoLayerChromium.h
index 3507cb2..620d1a7 100644
--- a/WebCore/platform/graphics/chromium/VideoLayerChromium.h
+++ b/WebCore/platform/graphics/chromium/VideoLayerChromium.h
@@ -34,31 +34,76 @@
#if USE(ACCELERATED_COMPOSITING)
-#include "ContentLayerChromium.h"
+#include "LayerChromium.h"
#include "VideoFrameProvider.h"
namespace WebCore {
// A Layer that contains a Video element.
-class VideoLayerChromium : public ContentLayerChromium {
+class VideoLayerChromium : public LayerChromium {
public:
static PassRefPtr<VideoLayerChromium> create(GraphicsLayerChromium* owner = 0,
VideoFrameProvider* = 0);
- virtual bool drawsContent() { return true; }
+ virtual ~VideoLayerChromium();
virtual void updateContents();
+ virtual bool drawsContent() { return true; }
+ virtual void draw();
+
+ class SharedValues {
+ public:
+ explicit SharedValues(GraphicsContext3D*);
+ ~SharedValues();
+ unsigned yuvShaderProgram() const { return m_yuvShaderProgram; }
+ unsigned rgbaShaderProgram() const { return m_rgbaShaderProgram; }
+ int yuvShaderMatrixLocation() const { return m_yuvShaderMatrixLocation; }
+ int rgbaShaderMatrixLocation() const { return m_rgbaShaderMatrixLocation; }
+ int yuvWidthScaleFactorLocation() const { return m_yuvWidthScaleFactorLocation; }
+ int rgbaWidthScaleFactorLocation() const { return m_rgbaWidthScaleFactorLocation; }
+ int yTextureLocation() const { return m_yTextureLocation; }
+ int uTextureLocation() const { return m_uTextureLocation; }
+ int vTextureLocation() const { return m_vTextureLocation; }
+ int yuvAlphaLocation() const { return m_yuvAlphaLocation; }
+ int rgbaAlphaLocation() const { return m_rgbaAlphaLocation; }
+ int rgbaTextureLocation() const { return m_rgbaTextureLocation; }
+ int ccMatrixLocation() const { return m_ccMatrixLocation; }
+ bool initialized() const { return m_initialized; };
+ private:
+ GraphicsContext3D* m_context;
+ unsigned m_yuvShaderProgram;
+ unsigned m_rgbaShaderProgram;
+ int m_yuvShaderMatrixLocation;
+ int m_yuvWidthScaleFactorLocation;
+ int m_rgbaShaderMatrixLocation;
+ int m_rgbaWidthScaleFactorLocation;
+ int m_ccMatrixLocation;
+ int m_yTextureLocation;
+ int m_uTextureLocation;
+ int m_vTextureLocation;
+ int m_rgbaTextureLocation;
+ int m_yuvAlphaLocation;
+ int m_rgbaAlphaLocation;
+ bool m_initialized;
+ };
private:
VideoLayerChromium(GraphicsLayerChromium* owner, VideoFrameProvider*);
- void createTextureRect(const IntSize& requiredTextureSize, const IntRect& updateRect, unsigned textureId);
- void updateTextureRect(const IntRect& updateRect, unsigned textureId);
- void updateCompleted();
+ static unsigned determineTextureFormat(VideoFrameChromium*);
+ bool allocateTexturesIfNeeded(GraphicsContext3D*, VideoFrameChromium*, unsigned textureFormat);
+ void updateYUVContents(GraphicsContext3D*, const VideoFrameChromium*);
+ void updateRGBAContents(GraphicsContext3D*, const VideoFrameChromium*);
+ void allocateTexture(GraphicsContext3D*, unsigned textureId, const IntSize& dimensions, unsigned textureFormat);
+ void updateTexture(GraphicsContext3D*, unsigned textureId, const IntSize& dimensions, unsigned textureFormat, const void* data);
+ void drawYUV(const SharedValues*);
+ void drawRGBA(const SharedValues*);
-#if PLATFORM(SKIA)
- OwnPtr<skia::PlatformCanvas> m_canvas;
- OwnPtr<PlatformContextSkia> m_skiaContext;
-#endif
- OwnPtr<GraphicsContext> m_graphicsContext;
+ static const float yuv2RGB[9];
+
+ bool m_skipsDraw;
+ VideoFrameChromium::Format m_frameFormat;
OwnPtr<VideoFrameProvider> m_provider;
+ unsigned m_textures[3];
+ IntSize m_textureSizes[3];
+ IntSize m_frameSizes[3];
};
}
diff --git a/WebCore/svg/graphics/filters/SVGDistantLightSource.h b/WebCore/platform/graphics/filters/DistantLightSource.h
index 93c5f2a..d5d474f 100644
--- a/WebCore/svg/graphics/filters/SVGDistantLightSource.h
+++ b/WebCore/platform/graphics/filters/DistantLightSource.h
@@ -20,11 +20,11 @@
* Boston, MA 02110-1301, USA.
*/
-#ifndef SVGDistantLightSource_h
-#define SVGDistantLightSource_h
+#ifndef DistantLightSource_h
+#define DistantLightSource_h
-#if ENABLE(SVG) && ENABLE(FILTERS)
-#include "SVGLightSource.h"
+#if ENABLE(FILTERS)
+#include "LightSource.h"
namespace WebCore {
@@ -57,6 +57,6 @@ private:
} // namespace WebCore
-#endif // ENABLE(SVG) && ENABLE(FILTERS)
+#endif // ENABLE(FILTERS)
-#endif // SVGDistantLightSource_h
+#endif // DistantLightSource_h
diff --git a/WebCore/platform/graphics/filters/FEBlend.cpp b/WebCore/platform/graphics/filters/FEBlend.cpp
index acd6545..4185f61 100644
--- a/WebCore/platform/graphics/filters/FEBlend.cpp
+++ b/WebCore/platform/graphics/filters/FEBlend.cpp
@@ -1,24 +1,24 @@
/*
- Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
- 2004, 2005 Rob Buis <buis@kde.org>
- 2005 Eric Seidel <eric@webkit.org>
- 2009 Dirk Schulze <krit@webkit.org>
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public License
- aint with this library; see the file COPYING.LIB. If not, write to
- the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
+ * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
+ * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
+ * Copyright (C) 2005 Eric Seidel <eric@webkit.org>
+ * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
#include "config.h"
@@ -98,13 +98,13 @@ void FEBlend::apply(Filter* filter)
if (m_mode == FEBLEND_MODE_UNKNOWN)
return;
- if (!getEffectContext())
+ if (!effectContext())
return;
- IntRect effectADrawingRect = calculateDrawingIntRect(in->repaintRectInLocalCoordinates());
+ IntRect effectADrawingRect = requestedRegionOfInputImageData(in->repaintRectInLocalCoordinates());
RefPtr<CanvasPixelArray> srcPixelArrayA(in->resultImage()->getPremultipliedImageData(effectADrawingRect)->data());
- IntRect effectBDrawingRect = calculateDrawingIntRect(in2->repaintRectInLocalCoordinates());
+ IntRect effectBDrawingRect = requestedRegionOfInputImageData(in2->repaintRectInLocalCoordinates());
RefPtr<CanvasPixelArray> srcPixelArrayB(in2->resultImage()->getPremultipliedImageData(effectBDrawingRect)->data());
IntRect imageRect(IntPoint(), resultImage()->size());
diff --git a/WebCore/platform/graphics/filters/FEBlend.h b/WebCore/platform/graphics/filters/FEBlend.h
index 2e67588..a6569e2 100644
--- a/WebCore/platform/graphics/filters/FEBlend.h
+++ b/WebCore/platform/graphics/filters/FEBlend.h
@@ -1,23 +1,23 @@
/*
- Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
- 2004, 2005 Rob Buis <buis@kde.org>
- 2005 Eric Seidel <eric@webkit.org>
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public License
- aint with this library; see the file COPYING.LIB. If not, write to
- the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
+ * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
+ * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
+ * Copyright (C) 2005 Eric Seidel <eric@webkit.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
#ifndef FEBlend_h
#define FEBlend_h
@@ -29,31 +29,32 @@
namespace WebCore {
- enum BlendModeType {
- FEBLEND_MODE_UNKNOWN = 0,
- FEBLEND_MODE_NORMAL = 1,
- FEBLEND_MODE_MULTIPLY = 2,
- FEBLEND_MODE_SCREEN = 3,
- FEBLEND_MODE_DARKEN = 4,
- FEBLEND_MODE_LIGHTEN = 5
- };
+enum BlendModeType {
+ FEBLEND_MODE_UNKNOWN = 0,
+ FEBLEND_MODE_NORMAL = 1,
+ FEBLEND_MODE_MULTIPLY = 2,
+ FEBLEND_MODE_SCREEN = 3,
+ FEBLEND_MODE_DARKEN = 4,
+ FEBLEND_MODE_LIGHTEN = 5
+};
- class FEBlend : public FilterEffect {
- public:
- static PassRefPtr<FEBlend> create(BlendModeType);
+class FEBlend : public FilterEffect {
+public:
+ static PassRefPtr<FEBlend> create(BlendModeType);
- BlendModeType blendMode() const;
- void setBlendMode(BlendModeType);
+ BlendModeType blendMode() const;
+ void setBlendMode(BlendModeType);
- void apply(Filter*);
- void dump();
- TextStream& externalRepresentation(TextStream&, int indent) const;
+ virtual void apply(Filter*);
+ virtual void dump();
- private:
- FEBlend(BlendModeType);
+ virtual TextStream& externalRepresentation(TextStream&, int indention) const;
- BlendModeType m_mode;
- };
+private:
+ FEBlend(BlendModeType);
+
+ BlendModeType m_mode;
+};
} // namespace WebCore
diff --git a/WebCore/platform/graphics/filters/FEColorMatrix.cpp b/WebCore/platform/graphics/filters/FEColorMatrix.cpp
index 1d9c66b..86c37c2 100644
--- a/WebCore/platform/graphics/filters/FEColorMatrix.cpp
+++ b/WebCore/platform/graphics/filters/FEColorMatrix.cpp
@@ -1,24 +1,24 @@
/*
- Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
- 2004, 2005 Rob Buis <buis@kde.org>
- 2005 Eric Seidel <eric@webkit.org>
- 2009 Dirk Schulze <krit@webkit.org>
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public License
- aint with this library; see the file COPYING.LIB. If not, write to
- the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
+ * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
+ * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
+ * Copyright (C) 2005 Eric Seidel <eric@webkit.org>
+ * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
#include "config.h"
@@ -160,11 +160,11 @@ void FEColorMatrix::apply(Filter* filter)
if (!in->resultImage())
return;
- GraphicsContext* filterContext = getEffectContext();
+ GraphicsContext* filterContext = effectContext();
if (!filterContext)
return;
- filterContext->drawImageBuffer(in->resultImage(), DeviceColorSpace, calculateDrawingRect(in->repaintRectInLocalCoordinates()));
+ filterContext->drawImageBuffer(in->resultImage(), DeviceColorSpace, drawingRegionOfInputImage(in->repaintRectInLocalCoordinates()));
IntRect imageRect(IntPoint(), resultImage()->size());
PassRefPtr<ImageData> imageData(resultImage()->getUnmultipliedImageData(imageRect));
diff --git a/WebCore/platform/graphics/filters/FEColorMatrix.h b/WebCore/platform/graphics/filters/FEColorMatrix.h
index 9b9084c..b898b17 100644
--- a/WebCore/platform/graphics/filters/FEColorMatrix.h
+++ b/WebCore/platform/graphics/filters/FEColorMatrix.h
@@ -1,23 +1,23 @@
/*
- Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
- 2004, 2005 Rob Buis <buis@kde.org>
- 2005 Eric Seidel <eric@webkit.org>
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public License
- aint with this library; see the file COPYING.LIB. If not, write to
- the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
+ * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
+ * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
+ * Copyright (C) 2005 Eric Seidel <eric@webkit.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
#ifndef FEColorMatrix_h
#define FEColorMatrix_h
@@ -30,34 +30,35 @@
namespace WebCore {
- enum ColorMatrixType {
- FECOLORMATRIX_TYPE_UNKNOWN = 0,
- FECOLORMATRIX_TYPE_MATRIX = 1,
- FECOLORMATRIX_TYPE_SATURATE = 2,
- FECOLORMATRIX_TYPE_HUEROTATE = 3,
- FECOLORMATRIX_TYPE_LUMINANCETOALPHA = 4
- };
+enum ColorMatrixType {
+ FECOLORMATRIX_TYPE_UNKNOWN = 0,
+ FECOLORMATRIX_TYPE_MATRIX = 1,
+ FECOLORMATRIX_TYPE_SATURATE = 2,
+ FECOLORMATRIX_TYPE_HUEROTATE = 3,
+ FECOLORMATRIX_TYPE_LUMINANCETOALPHA = 4
+};
+
+class FEColorMatrix : public FilterEffect {
+public:
+ static PassRefPtr<FEColorMatrix> create(ColorMatrixType, const Vector<float>&);
- class FEColorMatrix : public FilterEffect {
- public:
- static PassRefPtr<FEColorMatrix> create(ColorMatrixType, const Vector<float>&);
+ ColorMatrixType type() const;
+ void setType(ColorMatrixType);
- ColorMatrixType type() const;
- void setType(ColorMatrixType);
+ const Vector<float>& values() const;
+ void setValues(const Vector<float>&);
- const Vector<float>& values() const;
- void setValues(const Vector<float>&);
+ virtual void apply(Filter*);
+ virtual void dump();
- void apply(Filter*);
- void dump();
- TextStream& externalRepresentation(TextStream&, int indent) const;
+ virtual TextStream& externalRepresentation(TextStream&, int indention) const;
- private:
- FEColorMatrix(ColorMatrixType, const Vector<float>&);
+private:
+ FEColorMatrix(ColorMatrixType, const Vector<float>&);
- ColorMatrixType m_type;
- Vector<float> m_values;
- };
+ ColorMatrixType m_type;
+ Vector<float> m_values;
+};
} // namespace WebCore
diff --git a/WebCore/platform/graphics/filters/FEComponentTransfer.cpp b/WebCore/platform/graphics/filters/FEComponentTransfer.cpp
index 471fec8..6fe38e4 100644
--- a/WebCore/platform/graphics/filters/FEComponentTransfer.cpp
+++ b/WebCore/platform/graphics/filters/FEComponentTransfer.cpp
@@ -1,25 +1,25 @@
/*
- Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
- 2004, 2005 Rob Buis <buis@kde.org>
- 2005 Eric Seidel <eric@webkit.org>
- 2009 Dirk Schulze <krit@webkit.org>
- Copyright (C) Research In Motion Limited 2010. All rights reserved.
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public License
- aint with this library; see the file COPYING.LIB. If not, write to
- the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
+ * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
+ * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
+ * Copyright (C) 2005 Eric Seidel <eric@webkit.org>
+ * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
+ * Copyright (C) Research In Motion Limited 2010. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
#include "config.h"
@@ -36,8 +36,8 @@ namespace WebCore {
typedef void (*TransferType)(unsigned char*, const ComponentTransferFunction&);
-FEComponentTransfer::FEComponentTransfer(const ComponentTransferFunction& redFunc,
- const ComponentTransferFunction& greenFunc, const ComponentTransferFunction& blueFunc, const ComponentTransferFunction& alphaFunc)
+FEComponentTransfer::FEComponentTransfer(const ComponentTransferFunction& redFunc, const ComponentTransferFunction& greenFunc,
+ const ComponentTransferFunction& blueFunc, const ComponentTransferFunction& alphaFunc)
: FilterEffect()
, m_redFunc(redFunc)
, m_greenFunc(greenFunc)
@@ -154,7 +154,7 @@ void FEComponentTransfer::apply(Filter* filter)
if (!in->resultImage())
return;
- if (!getEffectContext())
+ if (!effectContext())
return;
unsigned char rValues[256], gValues[256], bValues[256], aValues[256];
@@ -167,7 +167,7 @@ void FEComponentTransfer::apply(Filter* filter)
for (unsigned channel = 0; channel < 4; channel++)
(*callEffect[transferFunction[channel].type])(tables[channel], transferFunction[channel]);
- IntRect drawingRect = calculateDrawingIntRect(in->repaintRectInLocalCoordinates());
+ IntRect drawingRect = requestedRegionOfInputImageData(in->repaintRectInLocalCoordinates());
RefPtr<ImageData> imageData(in->resultImage()->getUnmultipliedImageData(drawingRect));
CanvasPixelArray* srcPixelArray(imageData->data());
diff --git a/WebCore/platform/graphics/filters/FEComponentTransfer.h b/WebCore/platform/graphics/filters/FEComponentTransfer.h
index 55724db..d3145d4 100644
--- a/WebCore/platform/graphics/filters/FEComponentTransfer.h
+++ b/WebCore/platform/graphics/filters/FEComponentTransfer.h
@@ -1,23 +1,23 @@
/*
- Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
- 2004, 2005 Rob Buis <buis@kde.org>
- 2005 Eric Seidel <eric@webkit.org>
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public License
- aint with this library; see the file COPYING.LIB. If not, write to
- the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
+ * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
+ * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
+ * Copyright (C) 2005 Eric Seidel <eric@webkit.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
#ifndef FEComponentTransfer_h
#define FEComponentTransfer_h
@@ -30,67 +30,68 @@
namespace WebCore {
- enum ComponentTransferType {
- FECOMPONENTTRANSFER_TYPE_UNKNOWN = 0,
- FECOMPONENTTRANSFER_TYPE_IDENTITY = 1,
- FECOMPONENTTRANSFER_TYPE_TABLE = 2,
- FECOMPONENTTRANSFER_TYPE_DISCRETE = 3,
- FECOMPONENTTRANSFER_TYPE_LINEAR = 4,
- FECOMPONENTTRANSFER_TYPE_GAMMA = 5
- };
-
- struct ComponentTransferFunction {
- ComponentTransferFunction()
- : type(FECOMPONENTTRANSFER_TYPE_UNKNOWN)
- , slope(0.0f)
- , intercept(0.0f)
- , amplitude(0.0f)
- , exponent(0.0f)
- , offset(0.0f)
- {
- }
-
- ComponentTransferType type;
-
- float slope;
- float intercept;
- float amplitude;
- float exponent;
- float offset;
-
- Vector<float> tableValues;
- };
-
- class FEComponentTransfer : public FilterEffect {
- public:
- static PassRefPtr<FEComponentTransfer> create(const ComponentTransferFunction&,
- const ComponentTransferFunction&, const ComponentTransferFunction&, const ComponentTransferFunction&);
-
- ComponentTransferFunction redFunction() const;
- void setRedFunction(const ComponentTransferFunction&);
-
- ComponentTransferFunction greenFunction() const;
- void setGreenFunction(const ComponentTransferFunction&);
-
- ComponentTransferFunction blueFunction() const;
- void setBlueFunction(const ComponentTransferFunction&);
-
- ComponentTransferFunction alphaFunction() const;
- void setAlphaFunction(const ComponentTransferFunction&);
-
- void apply(Filter*);
- void dump();
- TextStream& externalRepresentation(TextStream&, int indent) const;
-
- private:
- FEComponentTransfer(const ComponentTransferFunction&, const ComponentTransferFunction&,
- const ComponentTransferFunction&, const ComponentTransferFunction&);
-
- ComponentTransferFunction m_redFunc;
- ComponentTransferFunction m_greenFunc;
- ComponentTransferFunction m_blueFunc;
- ComponentTransferFunction m_alphaFunc;
- };
+enum ComponentTransferType {
+ FECOMPONENTTRANSFER_TYPE_UNKNOWN = 0,
+ FECOMPONENTTRANSFER_TYPE_IDENTITY = 1,
+ FECOMPONENTTRANSFER_TYPE_TABLE = 2,
+ FECOMPONENTTRANSFER_TYPE_DISCRETE = 3,
+ FECOMPONENTTRANSFER_TYPE_LINEAR = 4,
+ FECOMPONENTTRANSFER_TYPE_GAMMA = 5
+};
+
+struct ComponentTransferFunction {
+ ComponentTransferFunction()
+ : type(FECOMPONENTTRANSFER_TYPE_UNKNOWN)
+ , slope(0)
+ , intercept(0)
+ , amplitude(0)
+ , exponent(0)
+ , offset(0)
+ {
+ }
+
+ ComponentTransferType type;
+
+ float slope;
+ float intercept;
+ float amplitude;
+ float exponent;
+ float offset;
+
+ Vector<float> tableValues;
+};
+
+class FEComponentTransfer : public FilterEffect {
+public:
+ static PassRefPtr<FEComponentTransfer> create(const ComponentTransferFunction& redFunc, const ComponentTransferFunction& greenFunc,
+ const ComponentTransferFunction& blueFunc, const ComponentTransferFunction& alphaFunc);
+
+ ComponentTransferFunction redFunction() const;
+ void setRedFunction(const ComponentTransferFunction&);
+
+ ComponentTransferFunction greenFunction() const;
+ void setGreenFunction(const ComponentTransferFunction&);
+
+ ComponentTransferFunction blueFunction() const;
+ void setBlueFunction(const ComponentTransferFunction&);
+
+ ComponentTransferFunction alphaFunction() const;
+ void setAlphaFunction(const ComponentTransferFunction&);
+
+ virtual void apply(Filter*);
+ virtual void dump();
+
+ virtual TextStream& externalRepresentation(TextStream&, int indention) const;
+
+private:
+ FEComponentTransfer(const ComponentTransferFunction& redFunc, const ComponentTransferFunction& greenFunc,
+ const ComponentTransferFunction& blueFunc, const ComponentTransferFunction& alphaFunc);
+
+ ComponentTransferFunction m_redFunc;
+ ComponentTransferFunction m_greenFunc;
+ ComponentTransferFunction m_blueFunc;
+ ComponentTransferFunction m_alphaFunc;
+};
} // namespace WebCore
diff --git a/WebCore/platform/graphics/filters/FEComposite.cpp b/WebCore/platform/graphics/filters/FEComposite.cpp
index c10a0f2..94e2524 100644
--- a/WebCore/platform/graphics/filters/FEComposite.cpp
+++ b/WebCore/platform/graphics/filters/FEComposite.cpp
@@ -1,24 +1,24 @@
/*
- Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
- 2004, 2005 Rob Buis <buis@kde.org>
- 2005 Eric Seidel <eric@webkit.org>
- 2009 Dirk Schulze <krit@webkit.org>
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public License
- aint with this library; see the file COPYING.LIB. If not, write to
- the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
+ * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
+ * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
+ * Copyright (C) 2005 Eric Seidel <eric@webkit.org>
+ * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
#include "config.h"
@@ -122,39 +122,39 @@ void FEComposite::apply(Filter* filter)
if (!in->resultImage() || !in2->resultImage())
return;
- GraphicsContext* filterContext = getEffectContext();
+ GraphicsContext* filterContext = effectContext();
if (!filterContext)
return;
- FloatRect srcRect = FloatRect(0.f, 0.f, -1.f, -1.f);
+ FloatRect srcRect = FloatRect(0, 0, -1, -1);
switch (m_type) {
case FECOMPOSITE_OPERATOR_OVER:
- filterContext->drawImageBuffer(in2->resultImage(), DeviceColorSpace, calculateDrawingRect(in2->repaintRectInLocalCoordinates()));
- filterContext->drawImageBuffer(in->resultImage(), DeviceColorSpace, calculateDrawingRect(in->repaintRectInLocalCoordinates()));
+ filterContext->drawImageBuffer(in2->resultImage(), DeviceColorSpace, drawingRegionOfInputImage(in2->repaintRectInLocalCoordinates()));
+ filterContext->drawImageBuffer(in->resultImage(), DeviceColorSpace, drawingRegionOfInputImage(in->repaintRectInLocalCoordinates()));
break;
case FECOMPOSITE_OPERATOR_IN:
filterContext->save();
- filterContext->clipToImageBuffer(in2->resultImage(), calculateDrawingRect(in2->repaintRectInLocalCoordinates()));
- filterContext->drawImageBuffer(in->resultImage(), DeviceColorSpace, calculateDrawingRect(in->repaintRectInLocalCoordinates()));
+ filterContext->clipToImageBuffer(in2->resultImage(), drawingRegionOfInputImage(in2->repaintRectInLocalCoordinates()));
+ filterContext->drawImageBuffer(in->resultImage(), DeviceColorSpace, drawingRegionOfInputImage(in->repaintRectInLocalCoordinates()));
filterContext->restore();
break;
case FECOMPOSITE_OPERATOR_OUT:
- filterContext->drawImageBuffer(in->resultImage(), DeviceColorSpace, calculateDrawingRect(in->repaintRectInLocalCoordinates()));
- filterContext->drawImageBuffer(in2->resultImage(), DeviceColorSpace, calculateDrawingRect(in2->repaintRectInLocalCoordinates()), srcRect, CompositeDestinationOut);
+ filterContext->drawImageBuffer(in->resultImage(), DeviceColorSpace, drawingRegionOfInputImage(in->repaintRectInLocalCoordinates()));
+ filterContext->drawImageBuffer(in2->resultImage(), DeviceColorSpace, drawingRegionOfInputImage(in2->repaintRectInLocalCoordinates()), srcRect, CompositeDestinationOut);
break;
case FECOMPOSITE_OPERATOR_ATOP:
- filterContext->drawImageBuffer(in2->resultImage(), DeviceColorSpace, calculateDrawingRect(in2->repaintRectInLocalCoordinates()));
- filterContext->drawImageBuffer(in->resultImage(), DeviceColorSpace, calculateDrawingRect(in->repaintRectInLocalCoordinates()), srcRect, CompositeSourceAtop);
+ filterContext->drawImageBuffer(in2->resultImage(), DeviceColorSpace, drawingRegionOfInputImage(in2->repaintRectInLocalCoordinates()));
+ filterContext->drawImageBuffer(in->resultImage(), DeviceColorSpace, drawingRegionOfInputImage(in->repaintRectInLocalCoordinates()), srcRect, CompositeSourceAtop);
break;
case FECOMPOSITE_OPERATOR_XOR:
- filterContext->drawImageBuffer(in2->resultImage(), DeviceColorSpace, calculateDrawingRect(in2->repaintRectInLocalCoordinates()));
- filterContext->drawImageBuffer(in->resultImage(), DeviceColorSpace, calculateDrawingRect(in->repaintRectInLocalCoordinates()), srcRect, CompositeXOR);
+ filterContext->drawImageBuffer(in2->resultImage(), DeviceColorSpace, drawingRegionOfInputImage(in2->repaintRectInLocalCoordinates()));
+ filterContext->drawImageBuffer(in->resultImage(), DeviceColorSpace, drawingRegionOfInputImage(in->repaintRectInLocalCoordinates()), srcRect, CompositeXOR);
break;
case FECOMPOSITE_OPERATOR_ARITHMETIC: {
- IntRect effectADrawingRect = calculateDrawingIntRect(in->repaintRectInLocalCoordinates());
+ IntRect effectADrawingRect = requestedRegionOfInputImageData(in->repaintRectInLocalCoordinates());
RefPtr<CanvasPixelArray> srcPixelArrayA(in->resultImage()->getPremultipliedImageData(effectADrawingRect)->data());
- IntRect effectBDrawingRect = calculateDrawingIntRect(in2->repaintRectInLocalCoordinates());
+ IntRect effectBDrawingRect = requestedRegionOfInputImageData(in2->repaintRectInLocalCoordinates());
RefPtr<ImageData> imageData(in2->resultImage()->getPremultipliedImageData(effectBDrawingRect));
CanvasPixelArray* srcPixelArrayB(imageData->data());
diff --git a/WebCore/platform/graphics/filters/FEComposite.h b/WebCore/platform/graphics/filters/FEComposite.h
index 448d036..82a3b06 100644
--- a/WebCore/platform/graphics/filters/FEComposite.h
+++ b/WebCore/platform/graphics/filters/FEComposite.h
@@ -1,23 +1,23 @@
/*
- Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
- 2004, 2005 Rob Buis <buis@kde.org>
- 2005 Eric Seidel <eric@webkit.org>
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public License
- aint with this library; see the file COPYING.LIB. If not, write to
- the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
+ * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
+ * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
+ * Copyright (C) 2005 Eric Seidel <eric@webkit.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
#ifndef FEComposite_h
#define FEComposite_h
@@ -59,9 +59,10 @@ public:
float k4() const;
void setK4(float);
- void apply(Filter*);
- void dump();
- TextStream& externalRepresentation(TextStream&, int indent) const;
+ virtual void apply(Filter*);
+ virtual void dump();
+
+ virtual TextStream& externalRepresentation(TextStream&, int indention) const;
private:
FEComposite(const CompositeOperationType&, float, float, float, float);
diff --git a/WebCore/svg/graphics/filters/SVGFEConvolveMatrix.cpp b/WebCore/platform/graphics/filters/FEConvolveMatrix.cpp
index 2dbc7ab..dd66c6a 100644
--- a/WebCore/svg/graphics/filters/SVGFEConvolveMatrix.cpp
+++ b/WebCore/platform/graphics/filters/FEConvolveMatrix.cpp
@@ -23,13 +23,12 @@
#include "config.h"
-#if ENABLE(SVG) && ENABLE(FILTERS)
-#include "SVGFEConvolveMatrix.h"
+#if ENABLE(FILTERS)
+#include "FEConvolveMatrix.h"
#include "CanvasPixelArray.h"
#include "Filter.h"
#include "ImageData.h"
-#include "SVGRenderTreeAsText.h"
namespace WebCore {
@@ -378,11 +377,11 @@ void FEConvolveMatrix::apply(Filter* filter)
if (!in->resultImage())
return;
- if (!getEffectContext())
+ if (!effectContext())
return;
IntRect imageRect(IntPoint(), resultImage()->size());
- IntRect effectDrawingRect = calculateDrawingIntRect(in->filterPrimitiveSubregion());
+ IntRect effectDrawingRect = requestedRegionOfInputImageData(in->filterPrimitiveSubregion());
RefPtr<CanvasPixelArray> srcPixelArray;
if (m_preserveAlpha)
@@ -469,4 +468,4 @@ TextStream& FEConvolveMatrix::externalRepresentation(TextStream& ts, int indent)
}; // namespace WebCore
-#endif // ENABLE(SVG) && ENABLE(FILTERS)
+#endif // ENABLE(FILTERS)
diff --git a/WebCore/svg/graphics/filters/SVGFEConvolveMatrix.h b/WebCore/platform/graphics/filters/FEConvolveMatrix.h
index 736933c..2fe634f 100644
--- a/WebCore/svg/graphics/filters/SVGFEConvolveMatrix.h
+++ b/WebCore/platform/graphics/filters/FEConvolveMatrix.h
@@ -20,10 +20,10 @@
* Boston, MA 02110-1301, USA.
*/
-#ifndef SVGFEConvolveMatrix_h
-#define SVGFEConvolveMatrix_h
+#ifndef FEConvolveMatrix_h
+#define FEConvolveMatrix_h
-#if ENABLE(SVG) && ENABLE(FILTERS)
+#if ENABLE(FILTERS)
#include "FilterEffect.h"
#include "FloatPoint.h"
#include "FloatSize.h"
@@ -72,9 +72,10 @@ public:
bool preserveAlpha() const;
void setPreserveAlpha(bool);
- void apply(Filter*);
- void dump();
- TextStream& externalRepresentation(TextStream&, int indent) const;
+ virtual void apply(Filter*);
+ virtual void dump();
+
+ virtual TextStream& externalRepresentation(TextStream&, int indention) const;
private:
FEConvolveMatrix(const IntSize&, float, float,
@@ -112,6 +113,6 @@ private:
} // namespace WebCore
-#endif // ENABLE(SVG) && ENABLE(FILTERS)
+#endif // ENABLE(FILTERS)
-#endif // SVGFEConvolveMatrix_h
+#endif // FEConvolveMatrix_h
diff --git a/WebCore/svg/graphics/filters/SVGFEDiffuseLighting.cpp b/WebCore/platform/graphics/filters/FEDiffuseLighting.cpp
index b439c46..98b5adf 100644
--- a/WebCore/svg/graphics/filters/SVGFEDiffuseLighting.cpp
+++ b/WebCore/platform/graphics/filters/FEDiffuseLighting.cpp
@@ -21,11 +21,10 @@
#include "config.h"
-#if ENABLE(SVG) && ENABLE(FILTERS)
-#include "SVGFEDiffuseLighting.h"
+#if ENABLE(FILTERS)
+#include "FEDiffuseLighting.h"
-#include "SVGLightSource.h"
-#include "SVGRenderTreeAsText.h"
+#include "LightSource.h"
namespace WebCore {
@@ -124,4 +123,4 @@ TextStream& FEDiffuseLighting::externalRepresentation(TextStream& ts, int indent
} // namespace WebCore
-#endif // ENABLE(SVG) && ENABLE(FILTERS)
+#endif // ENABLE(FILTERS)
diff --git a/WebCore/svg/graphics/filters/SVGFEDiffuseLighting.h b/WebCore/platform/graphics/filters/FEDiffuseLighting.h
index 0cdeae3..5273144 100644
--- a/WebCore/svg/graphics/filters/SVGFEDiffuseLighting.h
+++ b/WebCore/platform/graphics/filters/FEDiffuseLighting.h
@@ -19,11 +19,11 @@
* Boston, MA 02110-1301, USA.
*/
-#ifndef SVGFEDiffuseLighting_h
-#define SVGFEDiffuseLighting_h
+#ifndef FEDiffuseLighting_h
+#define FEDiffuseLighting_h
-#if ENABLE(SVG) && ENABLE(FILTERS)
-#include "SVGFELighting.h"
+#if ENABLE(FILTERS)
+#include "FELighting.h"
namespace WebCore {
@@ -53,16 +53,16 @@ public:
const LightSource* lightSource() const;
void setLightSource(PassRefPtr<LightSource>);
- void dump();
- TextStream& externalRepresentation(TextStream&, int indent) const;
+ virtual void dump();
+
+ virtual TextStream& externalRepresentation(TextStream&, int indention) const;
private:
- FEDiffuseLighting(const Color&, float, float,
- float, float, PassRefPtr<LightSource>);
+ FEDiffuseLighting(const Color&, float, float, float, float, PassRefPtr<LightSource>);
};
} // namespace WebCore
-#endif // ENABLE(SVG) && ENABLE(FILTERS)
+#endif // ENABLE(FILTERS)
-#endif // SVGFEDiffuseLighting_h
+#endif // FEDiffuseLighting_h
diff --git a/WebCore/svg/graphics/filters/SVGFEDisplacementMap.cpp b/WebCore/platform/graphics/filters/FEDisplacementMap.cpp
index 9d9857e..6b5dbaa 100644
--- a/WebCore/svg/graphics/filters/SVGFEDisplacementMap.cpp
+++ b/WebCore/platform/graphics/filters/FEDisplacementMap.cpp
@@ -22,14 +22,13 @@
#include "config.h"
-#if ENABLE(SVG) && ENABLE(FILTERS)
-#include "SVGFEDisplacementMap.h"
+#if ENABLE(FILTERS)
+#include "FEDisplacementMap.h"
#include "CanvasPixelArray.h"
#include "Filter.h"
#include "GraphicsContext.h"
#include "ImageData.h"
-#include "SVGRenderTreeAsText.h"
namespace WebCore {
@@ -89,13 +88,13 @@ void FEDisplacementMap::apply(Filter* filter)
if (m_xChannelSelector == CHANNEL_UNKNOWN || m_yChannelSelector == CHANNEL_UNKNOWN)
return;
- if (!getEffectContext())
+ if (!effectContext())
return;
- IntRect effectADrawingRect = calculateDrawingIntRect(in->repaintRectInLocalCoordinates());
+ IntRect effectADrawingRect = requestedRegionOfInputImageData(in->repaintRectInLocalCoordinates());
RefPtr<CanvasPixelArray> srcPixelArrayA(in->resultImage()->getPremultipliedImageData(effectADrawingRect)->data());
- IntRect effectBDrawingRect = calculateDrawingIntRect(in2->repaintRectInLocalCoordinates());
+ IntRect effectBDrawingRect = requestedRegionOfInputImageData(in2->repaintRectInLocalCoordinates());
RefPtr<CanvasPixelArray> srcPixelArrayB(in2->resultImage()->getUnmultipliedImageData(effectBDrawingRect)->data());
IntRect imageRect(IntPoint(), resultImage()->size());
@@ -169,4 +168,4 @@ TextStream& FEDisplacementMap::externalRepresentation(TextStream& ts, int indent
} // namespace WebCore
-#endif // ENABLE(SVG) && ENABLE(FILTERS)
+#endif // ENABLE(FILTERS)
diff --git a/WebCore/platform/graphics/filters/FEDisplacementMap.h b/WebCore/platform/graphics/filters/FEDisplacementMap.h
new file mode 100644
index 0000000..dc87b90
--- /dev/null
+++ b/WebCore/platform/graphics/filters/FEDisplacementMap.h
@@ -0,0 +1,70 @@
+/*
+ * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
+ * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
+ * Copyright (C) 2005 Eric Seidel <eric@webkit.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef FEDisplacementMap_h
+#define FEDisplacementMap_h
+
+#if ENABLE(FILTERS)
+#include "PlatformString.h"
+#include "FilterEffect.h"
+#include "Filter.h"
+
+namespace WebCore {
+
+enum ChannelSelectorType {
+ CHANNEL_UNKNOWN = 0,
+ CHANNEL_R = 1,
+ CHANNEL_G = 2,
+ CHANNEL_B = 3,
+ CHANNEL_A = 4
+};
+
+class FEDisplacementMap : public FilterEffect {
+public:
+ static PassRefPtr<FEDisplacementMap> create(ChannelSelectorType xChannelSelector, ChannelSelectorType yChannelSelector, float);
+
+ ChannelSelectorType xChannelSelector() const;
+ void setXChannelSelector(const ChannelSelectorType);
+
+ ChannelSelectorType yChannelSelector() const;
+ void setYChannelSelector(const ChannelSelectorType);
+
+ float scale() const;
+ void setScale(float scale);
+
+ virtual void apply(Filter*);
+ virtual void dump();
+
+ virtual TextStream& externalRepresentation(TextStream&, int indention) const;
+
+private:
+ FEDisplacementMap(ChannelSelectorType xChannelSelector, ChannelSelectorType yChannelSelector, float);
+
+ ChannelSelectorType m_xChannelSelector;
+ ChannelSelectorType m_yChannelSelector;
+ float m_scale;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(FILTERS)
+
+#endif // FEDisplacementMap_h
diff --git a/WebCore/svg/graphics/filters/SVGFEFlood.cpp b/WebCore/platform/graphics/filters/FEFlood.cpp
index a2b2cd2..7804d89 100644
--- a/WebCore/svg/graphics/filters/SVGFEFlood.cpp
+++ b/WebCore/platform/graphics/filters/FEFlood.cpp
@@ -22,23 +22,22 @@
#include "config.h"
-#if ENABLE(SVG) && ENABLE(FILTERS)
-#include "SVGFEFlood.h"
+#if ENABLE(FILTERS)
+#include "FEFlood.h"
#include "Filter.h"
#include "GraphicsContext.h"
-#include "SVGRenderTreeAsText.h"
namespace WebCore {
-FEFlood::FEFlood(const Color& floodColor, const float& floodOpacity)
+FEFlood::FEFlood(const Color& floodColor, float floodOpacity)
: FilterEffect()
, m_floodColor(floodColor)
, m_floodOpacity(floodOpacity)
{
}
-PassRefPtr<FEFlood> FEFlood::create(const Color& floodColor, const float& floodOpacity)
+PassRefPtr<FEFlood> FEFlood::create(const Color& floodColor, float floodOpacity)
{
return adoptRef(new FEFlood(floodColor, floodOpacity));
}
@@ -65,7 +64,7 @@ void FEFlood::setFloodOpacity(float floodOpacity)
void FEFlood::apply(Filter*)
{
- GraphicsContext* filterContext = getEffectContext();
+ GraphicsContext* filterContext = effectContext();
if (!filterContext)
return;
@@ -82,11 +81,11 @@ TextStream& FEFlood::externalRepresentation(TextStream& ts, int indent) const
writeIndent(ts, indent);
ts << "[feFlood";
FilterEffect::externalRepresentation(ts);
- ts << " flood-color=\"" << floodColor() << "\" "
+ ts << " flood-color=\"" << floodColor().name() << "\" "
<< "flood-opacity=\"" << floodOpacity() << "\"]\n";
return ts;
}
} // namespace WebCore
-#endif // ENABLE(SVG) && ENABLE(FILTERS)
+#endif // ENABLE(FILTERS)
diff --git a/WebCore/svg/graphics/filters/SVGFEFlood.h b/WebCore/platform/graphics/filters/FEFlood.h
index 8ae251d..b615531 100644
--- a/WebCore/svg/graphics/filters/SVGFEFlood.h
+++ b/WebCore/platform/graphics/filters/FEFlood.h
@@ -19,39 +19,40 @@
* Boston, MA 02110-1301, USA.
*/
-#ifndef SVGFEFlood_h
-#define SVGFEFlood_h
+#ifndef FEFlood_h
+#define FEFlood_h
-#if ENABLE(SVG) && ENABLE(FILTERS)
+#if ENABLE(FILTERS)
#include "Color.h"
#include "Filter.h"
#include "FilterEffect.h"
namespace WebCore {
- class FEFlood : public FilterEffect {
- public:
- static PassRefPtr<FEFlood> create(const Color&, const float&);
+class FEFlood : public FilterEffect {
+public:
+ static PassRefPtr<FEFlood> create(const Color&, float);
- Color floodColor() const;
- void setFloodColor(const Color &);
+ Color floodColor() const;
+ void setFloodColor(const Color &);
- float floodOpacity() const;
- void setFloodOpacity(float);
+ float floodOpacity() const;
+ void setFloodOpacity(float);
- void apply(Filter*);
- void dump();
- TextStream& externalRepresentation(TextStream&, int indent) const;
+ virtual void apply(Filter*);
+ virtual void dump();
- private:
- FEFlood(const Color&, const float&);
+ virtual TextStream& externalRepresentation(TextStream&, int indention) const;
- Color m_floodColor;
- float m_floodOpacity;
- };
+private:
+ FEFlood(const Color&, float);
+
+ Color m_floodColor;
+ float m_floodOpacity;
+};
} // namespace WebCore
-#endif // ENABLE(SVG) && ENABLE(FILTERS)
+#endif // ENABLE(FILTERS)
-#endif // SVGFEFlood_h
+#endif // FEFlood_h
diff --git a/WebCore/platform/graphics/filters/FEGaussianBlur.cpp b/WebCore/platform/graphics/filters/FEGaussianBlur.cpp
index 72a5a04..fd9a3d8 100644
--- a/WebCore/platform/graphics/filters/FEGaussianBlur.cpp
+++ b/WebCore/platform/graphics/filters/FEGaussianBlur.cpp
@@ -1,25 +1,25 @@
/*
- Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
- 2004, 2005 Rob Buis <buis@kde.org>
- 2005 Eric Seidel <eric@webkit.org>
- 2009 Dirk Schulze <krit@webkit.org>
- 2010 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
- aint with this library; see the file COPYING.LIB. If not, write to
- the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
+ * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
+ * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
+ * Copyright (C) 2005 Eric Seidel <eric@webkit.org>
+ * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
+ * Copyright (C) 2010 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.
+ */
#include "config.h"
@@ -132,12 +132,12 @@ void FEGaussianBlur::apply(Filter* filter)
if (!in->resultImage())
return;
- if (!getEffectContext())
+ if (!effectContext())
return;
setIsAlphaImage(in->isAlphaImage());
- IntRect effectDrawingRect = calculateDrawingIntRect(in->repaintRectInLocalCoordinates());
+ IntRect effectDrawingRect = requestedRegionOfInputImageData(in->repaintRectInLocalCoordinates());
RefPtr<ImageData> srcImageData(in->resultImage()->getPremultipliedImageData(effectDrawingRect));
IntRect imageRect(IntPoint(), resultImage()->size());
diff --git a/WebCore/platform/graphics/filters/FEGaussianBlur.h b/WebCore/platform/graphics/filters/FEGaussianBlur.h
index 63d763e..745bcc8 100644
--- a/WebCore/platform/graphics/filters/FEGaussianBlur.h
+++ b/WebCore/platform/graphics/filters/FEGaussianBlur.h
@@ -1,23 +1,23 @@
/*
- Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
- 2004, 2005 Rob Buis <buis@kde.org>
- 2005 Eric Seidel <eric@webkit.org>
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public License
- aint with this library; see the file COPYING.LIB. If not, write to
- the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
+ * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
+ * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
+ * Copyright (C) 2005 Eric Seidel <eric@webkit.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
#ifndef FEGaussianBlur_h
#define FEGaussianBlur_h
@@ -38,12 +38,13 @@ public:
float stdDeviationY() const;
void setStdDeviationY(float);
- void apply(Filter*);
- void dump();
- TextStream& externalRepresentation(TextStream&, int indent) const;
-
static float calculateStdDeviation(float);
+ virtual void apply(Filter*);
+ virtual void dump();
+
+ virtual TextStream& externalRepresentation(TextStream&, int indention) const;
+
private:
FEGaussianBlur(float, float);
static void kernelPosition(int boxBlur, unsigned& std, int& dLeft, int& dRight);
diff --git a/WebCore/svg/graphics/filters/SVGFELighting.cpp b/WebCore/platform/graphics/filters/FELighting.cpp
index dc82840..f49b67d 100644
--- a/WebCore/svg/graphics/filters/SVGFELighting.cpp
+++ b/WebCore/platform/graphics/filters/FELighting.cpp
@@ -26,12 +26,12 @@
#include "config.h"
-#if ENABLE(SVG) && ENABLE(FILTERS)
-#include "SVGFELighting.h"
+#if ENABLE(FILTERS)
+#include "FELighting.h"
#include "CanvasPixelArray.h"
#include "ImageData.h"
-#include "SVGLightSource.h"
+#include "LightSource.h"
namespace WebCore {
@@ -247,12 +247,12 @@ void FELighting::apply(Filter* filter)
if (!in->resultImage())
return;
- if (!getEffectContext())
+ if (!effectContext())
return;
setIsAlphaImage(false);
- IntRect effectDrawingRect = calculateDrawingIntRect(in->repaintRectInLocalCoordinates());
+ IntRect effectDrawingRect = requestedRegionOfInputImageData(in->repaintRectInLocalCoordinates());
RefPtr<ImageData> srcImageData(in->resultImage()->getUnmultipliedImageData(effectDrawingRect));
CanvasPixelArray* srcPixelArray(srcImageData->data());
@@ -267,4 +267,4 @@ void FELighting::apply(Filter* filter)
} // namespace WebCore
-#endif // ENABLE(SVG) && ENABLE(FILTERS)
+#endif // ENABLE(FILTERS)
diff --git a/WebCore/svg/graphics/filters/SVGFELighting.h b/WebCore/platform/graphics/filters/FELighting.h
index 55802ca..28c00c4 100644
--- a/WebCore/svg/graphics/filters/SVGFELighting.h
+++ b/WebCore/platform/graphics/filters/FELighting.h
@@ -24,14 +24,14 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef SVGFELighting_h
-#define SVGFELighting_h
+#ifndef FELighting_h
+#define FELighting_h
-#if ENABLE(SVG) && ENABLE(FILTERS)
+#if ENABLE(FILTERS)
#include "Color.h"
#include "Filter.h"
#include "FilterEffect.h"
-#include "SVGLightSource.h"
+#include "LightSource.h"
#include <wtf/AlwaysInline.h>
// Common base class for FEDiffuseLighting and FESpecularLighting
@@ -42,7 +42,7 @@ class CanvasPixelArray;
class FELighting : public FilterEffect {
public:
- void apply(Filter*);
+ virtual void apply(Filter*);
protected:
enum LightingType {
@@ -91,6 +91,6 @@ protected:
} // namespace WebCore
-#endif // ENABLE(SVG) && ENABLE(FILTERS)
+#endif // ENABLE(FILTERS)
-#endif // SVGFELighting_h
+#endif // FELighting_h
diff --git a/WebCore/svg/graphics/filters/SVGFEMerge.cpp b/WebCore/platform/graphics/filters/FEMerge.cpp
index e92ce4c..19c832a 100644
--- a/WebCore/svg/graphics/filters/SVGFEMerge.cpp
+++ b/WebCore/platform/graphics/filters/FEMerge.cpp
@@ -21,12 +21,11 @@
#include "config.h"
-#if ENABLE(SVG) && ENABLE(FILTERS)
-#include "SVGFEMerge.h"
+#if ENABLE(FILTERS)
+#include "FEMerge.h"
#include "Filter.h"
#include "GraphicsContext.h"
-#include "SVGRenderTreeAsText.h"
namespace WebCore {
@@ -51,13 +50,13 @@ void FEMerge::apply(Filter* filter)
return;
}
- GraphicsContext* filterContext = getEffectContext();
+ GraphicsContext* filterContext = effectContext();
if (!filterContext)
return;
for (unsigned i = 0; i < size; ++i) {
FilterEffect* in = inputEffect(i);
- filterContext->drawImageBuffer(in->resultImage(), DeviceColorSpace, calculateDrawingRect(in->repaintRectInLocalCoordinates()));
+ filterContext->drawImageBuffer(in->resultImage(), DeviceColorSpace, drawingRegionOfInputImage(in->repaintRectInLocalCoordinates()));
}
}
@@ -80,4 +79,4 @@ TextStream& FEMerge::externalRepresentation(TextStream& ts, int indent) const
} // namespace WebCore
-#endif // ENABLE(SVG) && ENABLE(FILTERS)
+#endif // ENABLE(FILTERS)
diff --git a/WebCore/svg/graphics/filters/SVGFEMerge.h b/WebCore/platform/graphics/filters/FEMerge.h
index 439d789..46b882f 100644
--- a/WebCore/svg/graphics/filters/SVGFEMerge.h
+++ b/WebCore/platform/graphics/filters/FEMerge.h
@@ -19,30 +19,31 @@
* Boston, MA 02110-1301, USA.
*/
-#ifndef SVGFEMerge_h
-#define SVGFEMerge_h
+#ifndef FEMerge_h
+#define EMerge_h
-#if ENABLE(SVG) && ENABLE(FILTERS)
+#if ENABLE(FILTERS)
#include "FilterEffect.h"
#include "Filter.h"
#include <wtf/Vector.h>
namespace WebCore {
- class FEMerge : public FilterEffect {
- public:
- static PassRefPtr<FEMerge> create();
+class FEMerge : public FilterEffect {
+public:
+ static PassRefPtr<FEMerge> create();
- void apply(Filter*);
- void dump();
- TextStream& externalRepresentation(TextStream&, int indent) const;
+ virtual void apply(Filter*);
+ virtual void dump();
- private:
- FEMerge();
- };
+ virtual TextStream& externalRepresentation(TextStream&, int indention) const;
+
+private:
+ FEMerge();
+};
} // namespace WebCore
-#endif // ENABLE(SVG) && ENABLE(FILTERS)
+#endif // ENABLE(FILTERS)
-#endif // SVGFEMerge_h
+#endif // FEMerge_h
diff --git a/WebCore/svg/graphics/filters/SVGFEMorphology.cpp b/WebCore/platform/graphics/filters/FEMorphology.cpp
index 6645259..7329e1e 100644
--- a/WebCore/svg/graphics/filters/SVGFEMorphology.cpp
+++ b/WebCore/platform/graphics/filters/FEMorphology.cpp
@@ -22,13 +22,12 @@
#include "config.h"
-#if ENABLE(SVG) && ENABLE(FILTERS)
-#include "SVGFEMorphology.h"
+#if ENABLE(FILTERS)
+#include "FEMorphology.h"
#include "CanvasPixelArray.h"
#include "Filter.h"
#include "ImageData.h"
-#include "SVGRenderTreeAsText.h"
#include <wtf/Vector.h>
@@ -87,7 +86,7 @@ void FEMorphology::apply(Filter* filter)
if (!in->resultImage())
return;
- if (!getEffectContext())
+ if (!effectContext())
return;
setIsAlphaImage(in->isAlphaImage());
@@ -98,7 +97,7 @@ void FEMorphology::apply(Filter* filter)
return;
IntRect imageRect(IntPoint(), resultImage()->size());
- IntRect effectDrawingRect = calculateDrawingIntRect(in->repaintRectInLocalCoordinates());
+ IntRect effectDrawingRect = requestedRegionOfInputImageData(in->repaintRectInLocalCoordinates());
RefPtr<CanvasPixelArray> srcPixelArray(in->resultImage()->getPremultipliedImageData(effectDrawingRect)->data());
RefPtr<ImageData> imageData = ImageData::create(imageRect.width(), imageRect.height());
@@ -186,4 +185,4 @@ TextStream& FEMorphology::externalRepresentation(TextStream& ts, int indent) con
} // namespace WebCore
-#endif // ENABLE(SVG) && ENABLE(FILTERS)
+#endif // ENABLE(FILTERS)
diff --git a/WebCore/platform/graphics/filters/FEMorphology.h b/WebCore/platform/graphics/filters/FEMorphology.h
new file mode 100644
index 0000000..c8ce058
--- /dev/null
+++ b/WebCore/platform/graphics/filters/FEMorphology.h
@@ -0,0 +1,66 @@
+/*
+ * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
+ * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
+ * Copyright (C) 2005 Eric Seidel <eric@webkit.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef FEMorphology_h
+#define FEMorphology_h
+
+#if ENABLE(FILTERS)
+#include "FilterEffect.h"
+#include "Filter.h"
+
+namespace WebCore {
+
+enum MorphologyOperatorType {
+ FEMORPHOLOGY_OPERATOR_UNKNOWN = 0,
+ FEMORPHOLOGY_OPERATOR_ERODE = 1,
+ FEMORPHOLOGY_OPERATOR_DILATE = 2
+};
+
+class FEMorphology : public FilterEffect {
+public:
+ static PassRefPtr<FEMorphology> create(MorphologyOperatorType, float radiusX, float radiusY);
+ MorphologyOperatorType morphologyOperator() const;
+ void setMorphologyOperator(MorphologyOperatorType);
+
+ float radiusX() const;
+ void setRadiusX(float);
+
+ float radiusY() const;
+ void setRadiusY(float);
+
+ virtual void apply(Filter*);
+ virtual void dump();
+
+ virtual TextStream& externalRepresentation(TextStream&, int indention) const;
+
+private:
+ FEMorphology(MorphologyOperatorType, float radiusX, float radiusY);
+
+ MorphologyOperatorType m_type;
+ float m_radiusX;
+ float m_radiusY;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(FILTERS)
+
+#endif // FEMorphology_h
diff --git a/WebCore/svg/graphics/filters/SVGFEOffset.cpp b/WebCore/platform/graphics/filters/FEOffset.cpp
index 685bd7b..ea84cf0 100644
--- a/WebCore/svg/graphics/filters/SVGFEOffset.cpp
+++ b/WebCore/platform/graphics/filters/FEOffset.cpp
@@ -22,12 +22,11 @@
#include "config.h"
-#if ENABLE(SVG) && ENABLE(FILTERS)
-#include "SVGFEOffset.h"
+#if ENABLE(FILTERS)
+#include "FEOffset.h"
#include "Filter.h"
#include "GraphicsContext.h"
-#include "SVGRenderTreeAsText.h"
namespace WebCore {
@@ -70,7 +69,7 @@ void FEOffset::apply(Filter* filter)
if (!in->resultImage())
return;
- GraphicsContext* filterContext = getEffectContext();
+ GraphicsContext* filterContext = effectContext();
if (!filterContext)
return;
@@ -110,4 +109,4 @@ TextStream& FEOffset::externalRepresentation(TextStream& ts, int indent) const
} // namespace WebCore
-#endif // ENABLE(SVG) && ENABLE(FILTERS)
+#endif // ENABLE(FILTERS)
diff --git a/WebCore/svg/graphics/filters/SVGFEOffset.h b/WebCore/platform/graphics/filters/FEOffset.h
index 34ed97b..052ba74 100644
--- a/WebCore/svg/graphics/filters/SVGFEOffset.h
+++ b/WebCore/platform/graphics/filters/FEOffset.h
@@ -19,38 +19,39 @@
* Boston, MA 02110-1301, USA.
*/
-#ifndef SVGFEOffset_h
-#define SVGFEOffset_h
+#ifndef FEOffset_h
+#define FEOffset_h
-#if ENABLE(SVG) && ENABLE(FILTERS)
+#if ENABLE(FILTERS)
#include "FilterEffect.h"
#include "Filter.h"
namespace WebCore {
- class FEOffset : public FilterEffect {
- public:
- static PassRefPtr<FEOffset> create(float, float);
+class FEOffset : public FilterEffect {
+public:
+ static PassRefPtr<FEOffset> create(float dx, float dy);
- float dx() const;
- void setDx(float);
+ float dx() const;
+ void setDx(float);
- float dy() const;
- void setDy(float);
+ float dy() const;
+ void setDy(float);
- void apply(Filter*);
- void dump();
- TextStream& externalRepresentation(TextStream&, int indent) const;
+ virtual void apply(Filter*);
+ virtual void dump();
- private:
- FEOffset(float, float);
+ virtual TextStream& externalRepresentation(TextStream&, int indention) const;
- float m_dx;
- float m_dy;
- };
+private:
+ FEOffset(float dx, float dy);
+
+ float m_dx;
+ float m_dy;
+};
} // namespace WebCore
-#endif // ENABLE(SVG) && ENABLE(FILTERS)
+#endif // ENABLE(FILTERS)
-#endif // SVGFEOffset_h
+#endif // FEOffset_h
diff --git a/WebCore/svg/graphics/filters/SVGFESpecularLighting.cpp b/WebCore/platform/graphics/filters/FESpecularLighting.cpp
index 33f7b6c..2606600 100644
--- a/WebCore/svg/graphics/filters/SVGFESpecularLighting.cpp
+++ b/WebCore/platform/graphics/filters/FESpecularLighting.cpp
@@ -21,11 +21,10 @@
#include "config.h"
-#if ENABLE(SVG) && ENABLE(FILTERS)
-#include "SVGFESpecularLighting.h"
+#if ENABLE(FILTERS)
+#include "FESpecularLighting.h"
-#include "SVGLightSource.h"
-#include "SVGRenderTreeAsText.h"
+#include "LightSource.h"
namespace WebCore {
@@ -136,4 +135,4 @@ TextStream& FESpecularLighting::externalRepresentation(TextStream& ts, int inden
} // namespace WebCore
-#endif // ENABLE(SVG) && ENABLE(FILTERS)
+#endif // ENABLE(FILTERS)
diff --git a/WebCore/svg/graphics/filters/SVGFESpecularLighting.h b/WebCore/platform/graphics/filters/FESpecularLighting.h
index 6067a76..f6e7b66 100644
--- a/WebCore/svg/graphics/filters/SVGFESpecularLighting.h
+++ b/WebCore/platform/graphics/filters/FESpecularLighting.h
@@ -19,11 +19,11 @@
* Boston, MA 02110-1301, USA.
*/
-#ifndef SVGFESpecularLighting_h
-#define SVGFESpecularLighting_h
+#ifndef FESpecularLighting_h
+#define FESpecularLighting_h
-#if ENABLE(SVG) && ENABLE(FILTERS)
-#include "SVGFELighting.h"
+#if ENABLE(FILTERS)
+#include "FELighting.h"
namespace WebCore {
@@ -54,8 +54,9 @@ public:
const LightSource* lightSource() const;
void setLightSource(PassRefPtr<LightSource>);
- void dump();
- TextStream& externalRepresentation(TextStream&, int indent) const;
+ virtual void dump();
+
+ virtual TextStream& externalRepresentation(TextStream&, int indention) const;
private:
FESpecularLighting(const Color&, float, float, float, float, float, PassRefPtr<LightSource>);
@@ -63,6 +64,6 @@ private:
} // namespace WebCore
-#endif // ENABLE(SVG) && ENABLE(FILTERS)
+#endif // ENABLE(FILTERS)
-#endif // SVGFESpecularLighting_h
+#endif // FESpecularLighting_h
diff --git a/WebCore/svg/graphics/filters/SVGFETile.cpp b/WebCore/platform/graphics/filters/FETile.cpp
index 80eb9b3..41abd34 100644
--- a/WebCore/svg/graphics/filters/SVGFETile.cpp
+++ b/WebCore/platform/graphics/filters/FETile.cpp
@@ -20,14 +20,13 @@
#include "config.h"
-#if ENABLE(SVG) && ENABLE(FILTERS)
-#include "SVGFETile.h"
+#if ENABLE(FILTERS)
+#include "FETile.h"
#include "AffineTransform.h"
#include "Filter.h"
#include "GraphicsContext.h"
#include "Pattern.h"
-#include "SVGRenderTreeAsText.h"
namespace WebCore {
@@ -56,7 +55,7 @@ void FETile::apply(Filter* filter)
if (!in->resultImage())
return;
- GraphicsContext* filterContext = getEffectContext();
+ GraphicsContext* filterContext = effectContext();
if (!filterContext)
return;
@@ -103,5 +102,5 @@ TextStream& FETile::externalRepresentation(TextStream& ts, int indent) const
} // namespace WebCore
-#endif // ENABLE(SVG) && ENABLE(FILTERS)
+#endif // ENABLE(FILTERS)
diff --git a/WebCore/svg/graphics/filters/SVGFETile.h b/WebCore/platform/graphics/filters/FETile.h
index 128c9cb..20efbcd 100644
--- a/WebCore/svg/graphics/filters/SVGFETile.h
+++ b/WebCore/platform/graphics/filters/FETile.h
@@ -19,31 +19,32 @@
* Boston, MA 02110-1301, USA.
*/
-#ifndef SVGFETile_h
-#define SVGFETile_h
+#ifndef FETile_h
+#define FETile_h
-#if ENABLE(SVG) && ENABLE(FILTERS)
+#if ENABLE(FILTERS)
#include "FilterEffect.h"
#include "Filter.h"
namespace WebCore {
- class FETile : public FilterEffect {
- public:
- static PassRefPtr<FETile> create();
+class FETile : public FilterEffect {
+public:
+ static PassRefPtr<FETile> create();
- void apply(Filter*);
- void dump();
- TextStream& externalRepresentation(TextStream&, int indent) const;
+ virtual void apply(Filter*);
+ virtual void dump();
- virtual FloatRect determineFilterPrimitiveSubregion(Filter*);
-
- private:
- FETile();
- };
+ virtual TextStream& externalRepresentation(TextStream&, int indention) const;
+
+ virtual FloatRect determineFilterPrimitiveSubregion(Filter*);
+
+private:
+ FETile();
+};
} // namespace WebCore
-#endif // ENABLE(SVG) && ENABLE(FILTERS)
+#endif // ENABLE(FILTERS)
-#endif // SVGFETile_h
+#endif // FETile_h
diff --git a/WebCore/svg/graphics/filters/SVGFETurbulence.cpp b/WebCore/platform/graphics/filters/FETurbulence.cpp
index 399f7fc..bb24362 100644
--- a/WebCore/svg/graphics/filters/SVGFETurbulence.cpp
+++ b/WebCore/platform/graphics/filters/FETurbulence.cpp
@@ -23,13 +23,12 @@
#include "config.h"
-#if ENABLE(SVG) && ENABLE(FILTERS)
-#include "SVGFETurbulence.h"
+#if ENABLE(FILTERS)
+#include "FETurbulence.h"
#include "CanvasPixelArray.h"
#include "Filter.h"
#include "ImageData.h"
-#include "SVGRenderTreeAsText.h"
#include <wtf/MathExtras.h>
@@ -322,7 +321,7 @@ unsigned char FETurbulence::calculateTurbulenceValueForPoint(PaintingData& paint
void FETurbulence::apply(Filter* filter)
{
- if (!getEffectContext())
+ if (!effectContext())
return;
IntRect imageRect(IntPoint(), resultImage()->size());
@@ -384,4 +383,4 @@ TextStream& FETurbulence::externalRepresentation(TextStream& ts, int indent) con
} // namespace WebCore
-#endif // ENABLE(SVG) && ENABLE(FILTERS)
+#endif // ENABLE(FILTERS)
diff --git a/WebCore/svg/graphics/filters/SVGFETurbulence.h b/WebCore/platform/graphics/filters/FETurbulence.h
index d27b7f6..1a5a28a 100644
--- a/WebCore/svg/graphics/filters/SVGFETurbulence.h
+++ b/WebCore/platform/graphics/filters/FETurbulence.h
@@ -21,10 +21,10 @@
* Boston, MA 02110-1301, USA.
*/
-#ifndef SVGFETurbulence_h
-#define SVGFETurbulence_h
+#ifndef FETurbulence_h
+#define FETurbulence_h
-#if ENABLE(SVG) && ENABLE(FILTERS)
+#if ENABLE(FILTERS)
#include "FilterEffect.h"
#include "Filter.h"
@@ -58,9 +58,10 @@ public:
bool stitchTiles() const;
void setStitchTiles(bool);
- void apply(Filter*);
- void dump();
- TextStream& externalRepresentation(TextStream&, int indent) const;
+ virtual void apply(Filter*);
+ virtual void dump();
+
+ virtual TextStream& externalRepresentation(TextStream&, int indention) const;
private:
static const int s_blockSize = 256;
@@ -97,6 +98,6 @@ private:
} // namespace WebCore
-#endif // ENABLE(SVG) && ENABLE(FILTERS)
+#endif // ENABLE(FILTERS)
-#endif // SVGFETurbulence_h
+#endif // FETurbulence_h
diff --git a/WebCore/platform/graphics/filters/Filter.h b/WebCore/platform/graphics/filters/Filter.h
index 7ad25aa..bce4be3 100644
--- a/WebCore/platform/graphics/filters/Filter.h
+++ b/WebCore/platform/graphics/filters/Filter.h
@@ -1,20 +1,20 @@
/*
- * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
+ * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
*
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
+ * This library is 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.
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
*
- * You should have received a copy of the GNU Library General Public License
- * aint with this library; see the file COPYING.LIB. If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
*/
#ifndef Filter_h
diff --git a/WebCore/platform/graphics/filters/FilterEffect.cpp b/WebCore/platform/graphics/filters/FilterEffect.cpp
index b6278b2..461b22a 100644
--- a/WebCore/platform/graphics/filters/FilterEffect.cpp
+++ b/WebCore/platform/graphics/filters/FilterEffect.cpp
@@ -56,7 +56,7 @@ FloatRect FilterEffect::determineFilterPrimitiveSubregion(Filter* filter)
return m_filterPrimitiveSubregion;
}
-IntRect FilterEffect::calculateDrawingIntRect(const FloatRect& effectRect) const
+IntRect FilterEffect::requestedRegionOfInputImageData(const FloatRect& effectRect) const
{
ASSERT(m_effectBuffer);
FloatPoint location = m_repaintRectInLocalCoordinates.location();
@@ -64,7 +64,7 @@ IntRect FilterEffect::calculateDrawingIntRect(const FloatRect& effectRect) const
return IntRect(roundedIntPoint(location), m_effectBuffer->size());
}
-FloatRect FilterEffect::calculateDrawingRect(const FloatRect& srcRect) const
+FloatRect FilterEffect::drawingRegionOfInputImage(const FloatRect& srcRect) const
{
return FloatRect(FloatPoint(srcRect.x() - m_repaintRectInLocalCoordinates.x(),
srcRect.y() - m_repaintRectInLocalCoordinates.y()), srcRect.size());
@@ -76,7 +76,7 @@ FilterEffect* FilterEffect::inputEffect(unsigned number) const
return m_inputEffects.at(number).get();
}
-GraphicsContext* FilterEffect::getEffectContext()
+GraphicsContext* FilterEffect::effectContext()
{
IntRect bufferRect = enclosingIntRect(m_repaintRectInLocalCoordinates);
m_effectBuffer = ImageBuffer::create(bufferRect.size(), LinearRGB);
diff --git a/WebCore/platform/graphics/filters/FilterEffect.h b/WebCore/platform/graphics/filters/FilterEffect.h
index 91c52f3..ebe1880 100644
--- a/WebCore/platform/graphics/filters/FilterEffect.h
+++ b/WebCore/platform/graphics/filters/FilterEffect.h
@@ -49,14 +49,14 @@ public:
// Creates the ImageBuffer for the current filter primitive result in the size of the
// repaintRect. Gives back the GraphicsContext of the own ImageBuffer.
- GraphicsContext* getEffectContext();
+ GraphicsContext* effectContext();
FilterEffectVector& inputEffects() { return m_inputEffects; }
FilterEffect* inputEffect(unsigned) const;
unsigned numberOfEffectInputs() const { return m_inputEffects.size(); }
- FloatRect calculateDrawingRect(const FloatRect&) const;
- IntRect calculateDrawingIntRect(const FloatRect&) const;
+ FloatRect drawingRegionOfInputImage(const FloatRect&) const;
+ IntRect requestedRegionOfInputImageData(const FloatRect&) const;
// Solid black image with different alpha values.
bool isAlphaImage() const { return m_alphaImage; }
diff --git a/WebCore/platform/graphics/filters/ImageBufferFilter.cpp b/WebCore/platform/graphics/filters/ImageBufferFilter.cpp
index 33953d6..12407f8 100644
--- a/WebCore/platform/graphics/filters/ImageBufferFilter.cpp
+++ b/WebCore/platform/graphics/filters/ImageBufferFilter.cpp
@@ -1,21 +1,21 @@
/*
- * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
- * Copyright (C) 2009 Brent Fulgham <bfulgham@webkit.org>
+ * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
+ * Copyright (C) 2009 Brent Fulgham <bfulgham@webkit.org>
*
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
+ * This library is 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.
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
*
- * You should have received a copy of the GNU Library General Public License
- * aint with this library; see the file COPYING.LIB. If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
*/
#include "config.h"
diff --git a/WebCore/platform/graphics/filters/ImageBufferFilter.h b/WebCore/platform/graphics/filters/ImageBufferFilter.h
index a2775ea..cd4bc2f 100644
--- a/WebCore/platform/graphics/filters/ImageBufferFilter.h
+++ b/WebCore/platform/graphics/filters/ImageBufferFilter.h
@@ -1,21 +1,21 @@
/*
- * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
- * Copyright (C) 2009 Brent Fulgham <bfulgham@webkit.org>
+ * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
+ * Copyright (C) 2009 Brent Fulgham <bfulgham@webkit.org>
*
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
+ * This library is 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.
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
*
- * You should have received a copy of the GNU Library General Public License
- * aint with this library; see the file COPYING.LIB. If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
*/
#ifndef ImageBufferFilter_h
diff --git a/WebCore/svg/graphics/filters/SVGLightSource.cpp b/WebCore/platform/graphics/filters/LightSource.cpp
index 2981f25..a80b14b 100644
--- a/WebCore/svg/graphics/filters/SVGLightSource.cpp
+++ b/WebCore/platform/graphics/filters/LightSource.cpp
@@ -22,13 +22,13 @@
#include "config.h"
-#if ENABLE(SVG) && ENABLE(FILTERS)
-#include "SVGLightSource.h"
+#if ENABLE(FILTERS)
+#include "LightSource.h"
-#include "SVGDistantLightSource.h"
-#include "SVGPointLightSource.h"
-#include "SVGRenderTreeAsText.h"
-#include "SVGSpotLightSource.h"
+#include "DistantLightSource.h"
+#include "PointLightSource.h"
+#include "RenderTreeAsText.h"
+#include "SpotLightSource.h"
#include <wtf/MathExtras.h>
namespace WebCore {
@@ -166,4 +166,4 @@ TextStream& DistantLightSource::externalRepresentation(TextStream& ts) const
} // namespace WebCore
-#endif // ENABLE(SVG) && ENABLE(FILTERS)
+#endif // ENABLE(FILTERS)
diff --git a/WebCore/svg/graphics/filters/SVGLightSource.h b/WebCore/platform/graphics/filters/LightSource.h
index 6795107..2e4c579 100644
--- a/WebCore/svg/graphics/filters/SVGLightSource.h
+++ b/WebCore/platform/graphics/filters/LightSource.h
@@ -21,10 +21,10 @@
* Boston, MA 02110-1301, USA.
*/
-#ifndef SVGLightSource_h
-#define SVGLightSource_h
+#ifndef LightSource_h
+#define LightSource_h
-#if ENABLE(SVG) && ENABLE(FILTERS)
+#if ENABLE(FILTERS)
#include "FloatPoint3D.h"
#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
@@ -79,6 +79,6 @@ private:
} // namespace WebCore
-#endif // ENABLE(SVG) && ENABLE(FILTERS)
+#endif // ENABLE(FILTERS)
-#endif // SVGLightSource_h
+#endif // LightSource_h
diff --git a/WebCore/svg/graphics/filters/SVGPointLightSource.h b/WebCore/platform/graphics/filters/PointLightSource.h
index cd8f9b2..163c829 100644
--- a/WebCore/svg/graphics/filters/SVGPointLightSource.h
+++ b/WebCore/platform/graphics/filters/PointLightSource.h
@@ -20,11 +20,11 @@
* Boston, MA 02110-1301, USA.
*/
-#ifndef SVGPointLightSource_h
-#define SVGPointLightSource_h
+#ifndef PointLightSource_h
+#define PointLightSource_h
-#if ENABLE(SVG) && ENABLE(FILTERS)
-#include "SVGLightSource.h"
+#if ENABLE(FILTERS)
+#include "LightSource.h"
namespace WebCore {
@@ -54,6 +54,6 @@ private:
} // namespace WebCore
-#endif // ENABLE(SVG) && ENABLE(FILTERS)
+#endif // ENABLE(FILTERS)
-#endif // SVGPointLightSource_h
+#endif // PointLightSource_h
diff --git a/WebCore/platform/graphics/filters/SourceAlpha.cpp b/WebCore/platform/graphics/filters/SourceAlpha.cpp
index 9c6a953..beaf2e7 100644
--- a/WebCore/platform/graphics/filters/SourceAlpha.cpp
+++ b/WebCore/platform/graphics/filters/SourceAlpha.cpp
@@ -1,20 +1,20 @@
/*
- * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
+ * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
*
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
+ * This library is 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.
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
*
- * You should have received a copy of the GNU Library General Public License
- * aint with this library; see the file COPYING.LIB. If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
*/
#include "config.h"
@@ -57,7 +57,7 @@ FloatRect SourceAlpha::determineFilterPrimitiveSubregion(Filter* filter)
void SourceAlpha::apply(Filter* filter)
{
- GraphicsContext* filterContext = getEffectContext();
+ GraphicsContext* filterContext = effectContext();
if (!filterContext)
return;
diff --git a/WebCore/platform/graphics/filters/SourceAlpha.h b/WebCore/platform/graphics/filters/SourceAlpha.h
index 25a17b2..f0fa319 100644
--- a/WebCore/platform/graphics/filters/SourceAlpha.h
+++ b/WebCore/platform/graphics/filters/SourceAlpha.h
@@ -1,21 +1,21 @@
/*
- Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public License
- aint with this library; see the file COPYING.LIB. If not, write to
- the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
+ * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
#ifndef SourceAlpha_h
#define SourceAlpha_h
@@ -28,22 +28,25 @@
namespace WebCore {
- class SourceAlpha : public FilterEffect {
- public:
- static PassRefPtr<SourceAlpha> create();
+class SourceAlpha : public FilterEffect {
+public:
+ static PassRefPtr<SourceAlpha> create();
+
+ static const AtomicString& effectName();
+
+ virtual FloatRect determineFilterPrimitiveSubregion(Filter*);
+
+ virtual void apply(Filter*);
+ virtual void dump();
+
+ virtual bool isSourceInput() const { return true; }
- static const AtomicString& effectName();
+ virtual TextStream& externalRepresentation(TextStream&, int indention) const;
- void apply(Filter*);
- void dump();
- TextStream& externalRepresentation(TextStream&, int indent) const;
+private:
+ SourceAlpha() { }
+};
- virtual bool isSourceInput() const { return true; }
- virtual FloatRect determineFilterPrimitiveSubregion(Filter*);
-
- private:
- SourceAlpha() { }
- };
} //namespace WebCore
#endif // ENABLE(FILTERS)
diff --git a/WebCore/platform/graphics/filters/SourceGraphic.cpp b/WebCore/platform/graphics/filters/SourceGraphic.cpp
index 6a32e36..c014e68 100644
--- a/WebCore/platform/graphics/filters/SourceGraphic.cpp
+++ b/WebCore/platform/graphics/filters/SourceGraphic.cpp
@@ -1,20 +1,20 @@
/*
- * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
+ * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
*
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
+ * This library is 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.
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
*
- * You should have received a copy of the GNU Library General Public License
- * aint with this library; see the file COPYING.LIB. If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
*/
#include "config.h"
@@ -56,7 +56,7 @@ FloatRect SourceGraphic::determineFilterPrimitiveSubregion(Filter* filter)
void SourceGraphic::apply(Filter* filter)
{
- GraphicsContext* filterContext = getEffectContext();
+ GraphicsContext* filterContext = effectContext();
if (!filterContext)
return;
diff --git a/WebCore/platform/graphics/filters/SourceGraphic.h b/WebCore/platform/graphics/filters/SourceGraphic.h
index 911648c..2378798 100644
--- a/WebCore/platform/graphics/filters/SourceGraphic.h
+++ b/WebCore/platform/graphics/filters/SourceGraphic.h
@@ -1,22 +1,22 @@
/*
- Copyright (C) 2008 Alex Mathews <possessedpenguinbob@gmail.com>
- 2009 Dirk Schulze <krit@webkit.org>
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public License
- aint with this library; see the file COPYING.LIB. If not, write to
- the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
+ * Copyright (C) 2008 Alex Mathews <possessedpenguinbob@gmail.com>
+ * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
#ifndef SourceGraphic_h
#define SourceGrahpic_h
@@ -29,22 +29,25 @@
namespace WebCore {
- class SourceGraphic : public FilterEffect {
- public:
- static PassRefPtr<SourceGraphic> create();
+class SourceGraphic : public FilterEffect {
+public:
+ static PassRefPtr<SourceGraphic> create();
+
+ static const AtomicString& effectName();
+
+ virtual FloatRect determineFilterPrimitiveSubregion(Filter*);
+
+ virtual void apply(Filter*);
+ virtual void dump();
- static const AtomicString& effectName();
+ virtual bool isSourceInput() const { return true; }
- void apply(Filter*);
- void dump();
- TextStream& externalRepresentation(TextStream&, int indent) const;
+ virtual TextStream& externalRepresentation(TextStream&, int indention) const;
- virtual bool isSourceInput() const { return true; }
- virtual FloatRect determineFilterPrimitiveSubregion(Filter*);
+private:
+ SourceGraphic() { }
+};
- private:
- SourceGraphic() { }
- };
} //namespace WebCore
#endif // ENABLE(FILTERS)
diff --git a/WebCore/svg/graphics/filters/SVGSpotLightSource.h b/WebCore/platform/graphics/filters/SpotLightSource.h
index 31c5674..cd6a614 100644
--- a/WebCore/svg/graphics/filters/SVGSpotLightSource.h
+++ b/WebCore/platform/graphics/filters/SpotLightSource.h
@@ -20,11 +20,11 @@
* Boston, MA 02110-1301, USA.
*/
-#ifndef SVGSpotLightSource_h
-#define SVGSpotLightSource_h
+#ifndef SpotLightSource_h
+#define SpotLightSource_h
-#if ENABLE(SVG) && ENABLE(FILTERS)
-#include "SVGLightSource.h"
+#if ENABLE(FILTERS)
+#include "LightSource.h"
namespace WebCore {
@@ -67,6 +67,6 @@ private:
} // namespace WebCore
-#endif // ENABLE(SVG) && ENABLE(FILTERS)
+#endif // ENABLE(FILTERS)
-#endif // SVGSpotLightSource_h
+#endif // SpotLightSource_h
diff --git a/WebCore/platform/graphics/gpu/LoopBlinnLocalTriangulator.cpp b/WebCore/platform/graphics/gpu/LoopBlinnLocalTriangulator.cpp
new file mode 100644
index 0000000..3b73ff6
--- /dev/null
+++ b/WebCore/platform/graphics/gpu/LoopBlinnLocalTriangulator.cpp
@@ -0,0 +1,275 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE 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 "LoopBlinnLocalTriangulator.h"
+
+#include "LoopBlinnMathUtils.h"
+#include <algorithm>
+
+namespace WebCore {
+
+using LoopBlinnMathUtils::approxEqual;
+using LoopBlinnMathUtils::linesIntersect;
+using LoopBlinnMathUtils::pointInTriangle;
+
+bool LoopBlinnLocalTriangulator::Triangle::contains(LoopBlinnLocalTriangulator::Vertex* v)
+{
+ return indexForVertex(v) >= 0;
+}
+
+LoopBlinnLocalTriangulator::Vertex* LoopBlinnLocalTriangulator::Triangle::nextVertex(LoopBlinnLocalTriangulator::Vertex* current, bool traverseCounterClockwise)
+{
+ int index = indexForVertex(current);
+ ASSERT(index >= 0);
+ if (traverseCounterClockwise)
+ ++index;
+ else
+ --index;
+ if (index < 0)
+ index += 3;
+ else
+ index = index % 3;
+ return m_vertices[index];
+}
+
+int LoopBlinnLocalTriangulator::Triangle::indexForVertex(LoopBlinnLocalTriangulator::Vertex* vertex)
+{
+ for (int i = 0; i < 3; ++i)
+ if (m_vertices[i] == vertex)
+ return i;
+ return -1;
+}
+
+void LoopBlinnLocalTriangulator::Triangle::makeCounterClockwise()
+{
+ // Possibly swaps two vertices so that the triangle's vertices are
+ // always specified in counterclockwise order. This orders the
+ // vertices canonically when walking the interior edges from the
+ // start to the end vertex.
+ FloatPoint3D point0(m_vertices[0]->xyCoordinates());
+ FloatPoint3D point1(m_vertices[1]->xyCoordinates());
+ FloatPoint3D point2(m_vertices[2]->xyCoordinates());
+ FloatPoint3D crossProduct = (point1 - point0).cross(point2 - point0);
+ if (crossProduct.z() < 0)
+ std::swap(m_vertices[1], m_vertices[2]);
+}
+
+LoopBlinnLocalTriangulator::LoopBlinnLocalTriangulator()
+{
+ reset();
+}
+
+void LoopBlinnLocalTriangulator::reset()
+{
+ m_numberOfTriangles = 0;
+ m_numberOfInteriorVertices = 0;
+ for (int i = 0; i < 4; ++i) {
+ m_interiorVertices[i] = 0;
+ m_vertices[i].resetFlags();
+ }
+}
+
+void LoopBlinnLocalTriangulator::triangulate(InsideEdgeComputation computeInsideEdges, LoopBlinnConstants::FillSide sideToFill)
+{
+ triangulateHelper(sideToFill);
+
+ if (computeInsideEdges == ComputeInsideEdges) {
+ // We need to compute which vertices describe the path along the
+ // interior portion of the shape, to feed these vertices to the
+ // more general tessellation algorithm. It is possible that we
+ // could determine this directly while producing triangles above.
+ // Here we try to do it generally just by examining the triangles
+ // that have already been produced. We walk around them in a
+ // specific direction determined by which side of the curve is
+ // being filled. We ignore the interior vertex unless it is also
+ // the ending vertex, and skip the edges shared between two
+ // triangles.
+ Vertex* v = &m_vertices[0];
+ addInteriorVertex(v);
+ int numSteps = 0;
+ while (!v->end() && numSteps < 4) {
+ // Find the next vertex according to the above rules
+ bool gotNext = false;
+ for (int i = 0; i < numberOfTriangles() && !gotNext; ++i) {
+ Triangle* tri = getTriangle(i);
+ if (tri->contains(v)) {
+ Vertex* next = tri->nextVertex(v, sideToFill == LoopBlinnConstants::RightSide);
+ if (!next->marked() && !isSharedEdge(v, next) && (!next->interior() || next->end())) {
+ addInteriorVertex(next);
+ v = next;
+ // Break out of for loop
+ gotNext = true;
+ }
+ }
+ }
+ ++numSteps;
+ }
+ if (!v->end()) {
+ // Something went wrong with the above algorithm; add the last
+ // vertex to the interior vertices anyway. (FIXME: should we
+ // add an assert here and do more extensive testing?)
+ addInteriorVertex(&m_vertices[3]);
+ }
+ }
+}
+
+void LoopBlinnLocalTriangulator::triangulateHelper(LoopBlinnConstants::FillSide sideToFill)
+{
+ reset();
+
+ m_vertices[3].setEnd(true);
+
+ // First test for degenerate cases.
+ for (int i = 0; i < 4; ++i) {
+ for (int j = i + 1; j < 4; ++j) {
+ if (approxEqual(m_vertices[i].xyCoordinates(), m_vertices[j].xyCoordinates())) {
+ // Two of the vertices are coincident, so we can eliminate at
+ // least one triangle. We might be able to eliminate the other
+ // as well, but this seems sufficient to avoid degenerate
+ // triangulations.
+ int indices[3] = { 0 };
+ int index = 0;
+ for (int k = 0; k < 4; ++k)
+ if (k != j)
+ indices[index++] = k;
+ addTriangle(&m_vertices[indices[0]],
+ &m_vertices[indices[1]],
+ &m_vertices[indices[2]]);
+ return;
+ }
+ }
+ }
+
+ // See whether any of the points are fully contained in the
+ // triangle defined by the other three.
+ for (int i = 0; i < 4; ++i) {
+ int indices[3] = { 0 };
+ int index = 0;
+ for (int j = 0; j < 4; ++j)
+ if (i != j)
+ indices[index++] = j;
+ if (pointInTriangle(m_vertices[i].xyCoordinates(),
+ m_vertices[indices[0]].xyCoordinates(),
+ m_vertices[indices[1]].xyCoordinates(),
+ m_vertices[indices[2]].xyCoordinates())) {
+ // Produce three triangles surrounding this interior vertex.
+ for (int j = 0; j < 3; ++j)
+ addTriangle(&m_vertices[indices[j % 3]],
+ &m_vertices[indices[(j + 1) % 3]],
+ &m_vertices[i]);
+ // Mark the interior vertex so we ignore it if trying to trace
+ // the interior edge.
+ m_vertices[i].setInterior(true);
+ return;
+ }
+ }
+
+ // There are only a few permutations of the vertices, ignoring
+ // rotations, which are irrelevant:
+ //
+ // 0--3 0--2 0--3 0--1 0--2 0--1
+ // | | | | | | | | | | | |
+ // | | | | | | | | | | | |
+ // 1--2 1--3 2--1 2--3 3--1 3--2
+ //
+ // Note that three of these are reflections of each other.
+ // Therefore there are only three possible triangulations:
+ //
+ // 0--3 0--2 0--3
+ // |\ | |\ | |\ |
+ // | \| | \| | \|
+ // 1--2 1--3 2--1
+ //
+ // From which we can choose by seeing which of the potential
+ // diagonals intersect. Note that we choose the shortest diagonal
+ // to split the quad.
+ if (linesIntersect(m_vertices[0].xyCoordinates(),
+ m_vertices[2].xyCoordinates(),
+ m_vertices[1].xyCoordinates(),
+ m_vertices[3].xyCoordinates())) {
+ if ((m_vertices[2].xyCoordinates() - m_vertices[0].xyCoordinates()).diagonalLengthSquared() <
+ (m_vertices[3].xyCoordinates() - m_vertices[1].xyCoordinates()).diagonalLengthSquared()) {
+ addTriangle(&m_vertices[0], &m_vertices[1], &m_vertices[2]);
+ addTriangle(&m_vertices[0], &m_vertices[2], &m_vertices[3]);
+ } else {
+ addTriangle(&m_vertices[0], &m_vertices[1], &m_vertices[3]);
+ addTriangle(&m_vertices[1], &m_vertices[2], &m_vertices[3]);
+ }
+ } else if (linesIntersect(m_vertices[0].xyCoordinates(),
+ m_vertices[3].xyCoordinates(),
+ m_vertices[1].xyCoordinates(),
+ m_vertices[2].xyCoordinates())) {
+ if ((m_vertices[3].xyCoordinates() - m_vertices[0].xyCoordinates()).diagonalLengthSquared() <
+ (m_vertices[2].xyCoordinates() - m_vertices[1].xyCoordinates()).diagonalLengthSquared()) {
+ addTriangle(&m_vertices[0], &m_vertices[1], &m_vertices[3]);
+ addTriangle(&m_vertices[0], &m_vertices[3], &m_vertices[2]);
+ } else {
+ addTriangle(&m_vertices[0], &m_vertices[1], &m_vertices[2]);
+ addTriangle(&m_vertices[2], &m_vertices[1], &m_vertices[3]);
+ }
+ } else {
+ // Lines (0->1), (2->3) intersect -- or should, modulo numerical
+ // precision issues
+ if ((m_vertices[1].xyCoordinates() - m_vertices[0].xyCoordinates()).diagonalLengthSquared() <
+ (m_vertices[3].xyCoordinates() - m_vertices[2].xyCoordinates()).diagonalLengthSquared()) {
+ addTriangle(&m_vertices[0], &m_vertices[2], &m_vertices[1]);
+ addTriangle(&m_vertices[0], &m_vertices[1], &m_vertices[3]);
+ } else {
+ addTriangle(&m_vertices[0], &m_vertices[2], &m_vertices[3]);
+ addTriangle(&m_vertices[3], &m_vertices[2], &m_vertices[1]);
+ }
+ }
+}
+
+void LoopBlinnLocalTriangulator::addTriangle(Vertex* v0, Vertex* v1, Vertex* v2)
+{
+ ASSERT(m_numberOfTriangles < 3);
+ m_triangles[m_numberOfTriangles++].setVertices(v0, v1, v2);
+}
+
+void LoopBlinnLocalTriangulator::addInteriorVertex(Vertex* v)
+{
+ ASSERT(m_numberOfInteriorVertices < 4);
+ m_interiorVertices[m_numberOfInteriorVertices++] = v;
+ v->setMarked(true);
+}
+
+bool LoopBlinnLocalTriangulator::isSharedEdge(Vertex* v0, Vertex* v1)
+{
+ bool haveEdge01 = false;
+ bool haveEdge10 = false;
+ for (int i = 0; i < numberOfTriangles(); ++i) {
+ Triangle* tri = getTriangle(i);
+ if (tri->contains(v0) && tri->nextVertex(v0, true) == v1)
+ haveEdge01 = true;
+ if (tri->contains(v1) && tri->nextVertex(v1, true) == v0)
+ haveEdge10 = true;
+ }
+ return haveEdge01 && haveEdge10;
+}
+
+} // namespace WebCore
diff --git a/WebCore/platform/graphics/gpu/LoopBlinnLocalTriangulator.h b/WebCore/platform/graphics/gpu/LoopBlinnLocalTriangulator.h
new file mode 100644
index 0000000..ea3d7e3
--- /dev/null
+++ b/WebCore/platform/graphics/gpu/LoopBlinnLocalTriangulator.h
@@ -0,0 +1,268 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE 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 LoopBlinnLocalTriangulator_h
+#define LoopBlinnLocalTriangulator_h
+
+#include "FloatPoint.h"
+#include "FloatPoint3D.h"
+#include "LoopBlinnConstants.h"
+#include <wtf/Assertions.h>
+#include <wtf/Noncopyable.h>
+
+namespace WebCore {
+
+// Performs a localized triangulation of the triangle mesh
+// corresponding to the four control point vertices of a cubic curve
+// segment.
+class LoopBlinnLocalTriangulator : public Noncopyable {
+public:
+ // The vertices that the triangulator operates upon, containing both
+ // the position information as well as the cubic texture
+ // coordinates.
+ class Vertex : public Noncopyable {
+ public:
+ Vertex()
+ {
+ resetFlags();
+ }
+
+ const FloatPoint& xyCoordinates() const
+ {
+ return m_xyCoordinates;
+ }
+
+ const FloatPoint3D& klmCoordinates() const
+ {
+ return m_klmCoordinates;
+ }
+
+ // Sets the position and texture coordinates of the vertex.
+ void set(float x, float y,
+ float k, float l, float m)
+ {
+ m_xyCoordinates.set(x, y);
+ m_klmCoordinates.set(k, l, m);
+ }
+
+ // Flags for walking from the start vertex to the end vertex.
+ bool end()
+ {
+ return m_end;
+ }
+
+ void setEnd(bool end)
+ {
+ m_end = end;
+ }
+
+ bool marked()
+ {
+ return m_marked;
+ }
+
+ void setMarked(bool marked)
+ {
+ m_marked = marked;
+ }
+
+ bool interior()
+ {
+ return m_interior;
+ }
+
+ void setInterior(bool interior)
+ {
+ m_interior = interior;
+ }
+
+ void resetFlags()
+ {
+ m_end = false;
+ m_marked = false;
+ m_interior = false;
+ }
+
+ private:
+ // 2D coordinates of the vertex in the plane.
+ FloatPoint m_xyCoordinates;
+ // Cubic texture coordinates for rendering the curve.
+ FloatPoint3D m_klmCoordinates;
+
+ // Flags for walking from the start vertex to the end vertex.
+ bool m_end;
+ bool m_marked;
+ bool m_interior;
+ };
+
+ // The triangles the Triangulator produces.
+ class Triangle {
+ public:
+ Triangle()
+ {
+ m_vertices[0] = 0;
+ m_vertices[1] = 0;
+ m_vertices[2] = 0;
+ }
+
+ // Gets the vertex at the given index, 0 <= index < 3.
+ Vertex* getVertex(int index)
+ {
+ ASSERT(index >= 0 && index < 3);
+ return m_vertices[index];
+ }
+
+ // Returns true if this triangle contains the given vertex (by
+ // identity, not geometrically).
+ bool contains(Vertex* v);
+
+ // Returns the vertex following the current one in the specified
+ // direction, counterclockwise or clockwise.
+ Vertex* nextVertex(Vertex* current, bool traverseCounterClockwise);
+
+ // Sets the vertices of this triangle, potentially reordering them
+ // to produce a canonical orientation.
+ void setVertices(Vertex* v0,
+ Vertex* v1,
+ Vertex* v2)
+ {
+ m_vertices[0] = v0;
+ m_vertices[1] = v1;
+ m_vertices[2] = v2;
+ makeCounterClockwise();
+ }
+
+ private:
+ // Returns the index [0..2] associated with the given vertex, or
+ // -1 if not found.
+ int indexForVertex(Vertex* vertex);
+
+ // Reorders the vertices in this triangle to make them
+ // counterclockwise when viewed in the 2D plane, in order to
+ // achieve a canonical ordering.
+ void makeCounterClockwise();
+
+ // Note: these are raw pointers because they point to the
+ // m_vertices contained in the surrounding triangulator.
+ Vertex* m_vertices[3];
+ };
+
+ LoopBlinnLocalTriangulator();
+
+ // Resets the triangulator's state. After each triangulation and
+ // before the next, call this to re-initialize the internal
+ // vertices' state.
+ void reset();
+
+ // Returns a mutable vertex stored in the triangulator. Use this to
+ // set up the vertices before a triangulation.
+ Vertex* getVertex(int index)
+ {
+ ASSERT(index >= 0 && index < 4);
+ return &m_vertices[index];
+ }
+
+ enum InsideEdgeComputation {
+ ComputeInsideEdges,
+ DontComputeInsideEdges
+ };
+
+ // Once the vertices' contents have been set up, call triangulate()
+ // to recompute the triangles.
+ //
+ // If computeInsideEdges is ComputeInsideEdges, then sideToFill
+ // will be used to determine which side of the cubic curve defined
+ // by the four control points is to be filled.
+ //
+ // The triangulation obeys the following guarantees:
+ // - If the convex hull is a quadrilateral, then the shortest edge
+ // will be chosen for the cut into two triangles.
+ // - If one of the vertices is contained in the triangle spanned
+ // by the other three, three triangles will be produced.
+ void triangulate(InsideEdgeComputation computeInsideEdges,
+ LoopBlinnConstants::FillSide sideToFill);
+
+ // Number of triangles computed by triangulate().
+ int numberOfTriangles() const
+ {
+ return m_numberOfTriangles;
+ }
+
+ // Returns the computed triangle at index, 0 <= index < numberOfTriangles().
+ Triangle* getTriangle(int index)
+ {
+ ASSERT(index >= 0 && index < m_numberOfTriangles);
+ return &m_triangles[index];
+ }
+
+ // Number of vertices facing the inside of the shape, if
+ // ComputeInsideEdges was passed when triangulate() was called.
+ int numberOfInteriorVertices() const
+ {
+ return m_numberOfInteriorVertices;
+ }
+
+ // Fetches the given interior vertex, 0 <= index < numberOfInteriorVertices().
+ Vertex* getInteriorVertex(int index)
+ {
+ ASSERT(index >= 0 && index < m_numberOfInteriorVertices);
+ return m_interiorVertices[index];
+ }
+
+private:
+ void triangulateHelper(LoopBlinnConstants::FillSide sideToFill);
+
+ // Adds a triangle to the triangulation.
+ void addTriangle(Vertex* v0, Vertex* v1, Vertex* v2);
+
+ // Adds a vertex to the list of interior vertices.
+ void addInteriorVertex(Vertex* v);
+
+ // Indicates whether the edge between vertex v0 and v1 is shared
+ // between two or more triangles.
+ bool isSharedEdge(Vertex* v0, Vertex* v1);
+
+ // The vertices being triangulated.
+ Vertex m_vertices[4];
+
+ // The vertices corresponding to the edges facing the inside of the
+ // shape, in order from the start vertex to the end vertex. The more
+ // general triangulation algorithm tessellates this interior region.
+ Vertex* m_interiorVertices[4];
+ // The number of interior vertices that are valid for the current
+ // triangulation.
+ int m_numberOfInteriorVertices;
+
+ // There can be at most three triangles computed by this local
+ // algorithm, which occurs when one of the vertices is contained in
+ // the triangle spanned by the other three. Most of the time the
+ // algorithm computes two triangles.
+ Triangle m_triangles[3];
+ int m_numberOfTriangles;
+};
+
+} // namespace WebCore
+
+#endif // LoopBlinnLocalTriangulator_h
diff --git a/WebCore/platform/graphics/gpu/Texture.cpp b/WebCore/platform/graphics/gpu/Texture.cpp
index 95436ba..6023fe9 100644
--- a/WebCore/platform/graphics/gpu/Texture.cpp
+++ b/WebCore/platform/graphics/gpu/Texture.cpp
@@ -129,7 +129,7 @@ static uint32_t* copySubRect(uint32_t* src, int srcX, int srcY, uint32_t* dst, i
for (int y = 0; y < height; ++y) {
for (int x = 0; x < width ; ++x) {
uint32_t pixel = srcOffset[x + y * srcStride];
- *dstPixel = pixel & 0xFF00FF00 | ((pixel & 0x00FF0000) >> 16) | ((pixel & 0x000000FF) << 16);
+ *dstPixel = (pixel & 0xFF00FF00) | ((pixel & 0x00FF0000) >> 16) | ((pixel & 0x000000FF) << 16);
dstPixel++;
}
}
diff --git a/WebCore/platform/graphics/gstreamer/DataSourceGStreamer.cpp b/WebCore/platform/graphics/gstreamer/DataSourceGStreamer.cpp
index 63555bf..5a94fd4 100644
--- a/WebCore/platform/graphics/gstreamer/DataSourceGStreamer.cpp
+++ b/WebCore/platform/graphics/gstreamer/DataSourceGStreamer.cpp
@@ -18,7 +18,7 @@
#include "config.h"
#include "DataSourceGStreamer.h"
-#if ENABLE(VIDEO)
+#if USE(GSTREAMER)
#include <gio/gio.h>
#include <glib.h>
@@ -243,4 +243,4 @@ static void webkit_data_src_uri_handler_init(gpointer g_iface, gpointer iface_da
iface->set_uri = webkit_data_src_uri_set_uri;
}
-#endif // ENABLE(VIDEO)
+#endif // USE(GSTREAMER)
diff --git a/WebCore/platform/graphics/gstreamer/DataSourceGStreamer.h b/WebCore/platform/graphics/gstreamer/DataSourceGStreamer.h
index 453685a..d462ccc4 100644
--- a/WebCore/platform/graphics/gstreamer/DataSourceGStreamer.h
+++ b/WebCore/platform/graphics/gstreamer/DataSourceGStreamer.h
@@ -19,7 +19,7 @@
#ifndef DataSourceGStreamer_h
#define DataSourceGStreamer_h
-#if ENABLE(VIDEO)
+#if USE(GSTREAMER)
#include <glib-object.h>
#include <gst/base/gstbasesrc.h>
@@ -53,5 +53,5 @@ GType webkit_data_src_get_type(void);
G_END_DECLS
-#endif // ENABLE(VIDEO)
+#endif // USE(GSTREAMER)
#endif
diff --git a/WebCore/platform/graphics/gstreamer/GOwnPtrGStreamer.cpp b/WebCore/platform/graphics/gstreamer/GOwnPtrGStreamer.cpp
index 6333437..06eec14 100644
--- a/WebCore/platform/graphics/gstreamer/GOwnPtrGStreamer.cpp
+++ b/WebCore/platform/graphics/gstreamer/GOwnPtrGStreamer.cpp
@@ -20,7 +20,7 @@
#include "config.h"
#include "GOwnPtrGStreamer.h"
-#if ENABLE(VIDEO)
+#if USE(GSTREAMER)
#include <gst/gstelement.h>
namespace WTF {
@@ -32,4 +32,4 @@ template <> void freeOwnedGPtr<GstElement>(GstElement* ptr)
}
}
-#endif // ENABLE(VIDEO)
+#endif // USE(GSTREAMER)
diff --git a/WebCore/platform/graphics/gstreamer/GOwnPtrGStreamer.h b/WebCore/platform/graphics/gstreamer/GOwnPtrGStreamer.h
index 84a3e30..672a23d 100644
--- a/WebCore/platform/graphics/gstreamer/GOwnPtrGStreamer.h
+++ b/WebCore/platform/graphics/gstreamer/GOwnPtrGStreamer.h
@@ -19,7 +19,7 @@
#ifndef GOwnPtrGStreamer_h
#define GOwnPtrGStreamer_h
-#if ENABLE(VIDEO)
+#if USE(GSTREAMER)
#include "GOwnPtr.h"
@@ -31,5 +31,5 @@ template<> void freeOwnedGPtr<GstElement>(GstElement* ptr);
}
-#endif // ENABLE(VIDEO)
+#endif // USE(GSTREAMER)
#endif
diff --git a/WebCore/platform/graphics/gstreamer/GStreamerGWorld.cpp b/WebCore/platform/graphics/gstreamer/GStreamerGWorld.cpp
index efccff0..539d92a 100644
--- a/WebCore/platform/graphics/gstreamer/GStreamerGWorld.cpp
+++ b/WebCore/platform/graphics/gstreamer/GStreamerGWorld.cpp
@@ -19,7 +19,7 @@
#include "config.h"
#include "GStreamerGWorld.h"
-#if ENABLE(VIDEO)
+#if USE(GSTREAMER)
#include "GOwnPtrGStreamer.h"
#include <gst/gst.h>
@@ -203,4 +203,4 @@ void GStreamerGWorld::setWindowOverlay(GstMessage* message)
}
}
-#endif // ENABLE(VIDEO)
+#endif // USE(GSTREAMER)
diff --git a/WebCore/platform/graphics/gstreamer/GStreamerGWorld.h b/WebCore/platform/graphics/gstreamer/GStreamerGWorld.h
index 282f13c..f519911 100644
--- a/WebCore/platform/graphics/gstreamer/GStreamerGWorld.h
+++ b/WebCore/platform/graphics/gstreamer/GStreamerGWorld.h
@@ -20,7 +20,7 @@
#ifndef GStreamerGWorld_h
#define GStreamerGWorld_h
-#if ENABLE(VIDEO)
+#if USE(GSTREAMER)
#include "PlatformVideoWindow.h"
#include "RefCounted.h"
@@ -62,5 +62,5 @@ private:
};
}
-#endif // ENABLE(VIDEO)
+#endif // USE(GSTREAMER)
#endif
diff --git a/WebCore/platform/graphics/gstreamer/ImageGStreamer.h b/WebCore/platform/graphics/gstreamer/ImageGStreamer.h
index 4a4ff2b..cf2b9d6 100644
--- a/WebCore/platform/graphics/gstreamer/ImageGStreamer.h
+++ b/WebCore/platform/graphics/gstreamer/ImageGStreamer.h
@@ -20,7 +20,7 @@
#ifndef ImageGStreamer_h
#define ImageGStreamer_h
-#if ENABLE(VIDEO)
+#if USE(GSTREAMER)
#include "BitmapImage.h"
#include <gst/gst.h>
@@ -59,5 +59,5 @@ class ImageGStreamer : public RefCounted<ImageGStreamer> {
};
}
-#endif // ENABLE(VIDEO)
+#endif // USE(GSTREAMER)
#endif
diff --git a/WebCore/platform/graphics/gstreamer/ImageGStreamerCG.mm b/WebCore/platform/graphics/gstreamer/ImageGStreamerCG.mm
index 076df4a..c73adc0 100644
--- a/WebCore/platform/graphics/gstreamer/ImageGStreamerCG.mm
+++ b/WebCore/platform/graphics/gstreamer/ImageGStreamerCG.mm
@@ -19,7 +19,7 @@
#include "config.h"
#include "ImageGStreamer.h"
-#if ENABLE(VIDEO)
+#if USE(GSTREAMER)
using namespace WebCore;
@@ -57,4 +57,4 @@ ImageGStreamer::~ImageGStreamer()
m_image = 0;
}
-#endif // ENABLE(VIDEO)
+#endif // USE(GSTREAMER)
diff --git a/WebCore/platform/graphics/gstreamer/ImageGStreamerCairo.cpp b/WebCore/platform/graphics/gstreamer/ImageGStreamerCairo.cpp
index 2fed892..6a9d068 100644
--- a/WebCore/platform/graphics/gstreamer/ImageGStreamerCairo.cpp
+++ b/WebCore/platform/graphics/gstreamer/ImageGStreamerCairo.cpp
@@ -20,7 +20,7 @@
#include "config.h"
#include "ImageGStreamer.h"
-#if ENABLE(VIDEO)
+#if USE(GSTREAMER)
#include "GOwnPtr.h"
@@ -65,4 +65,4 @@ ImageGStreamer::~ImageGStreamer()
m_image = 0;
}
-#endif // ENABLE(VIDEO)
+#endif // USE(GSTREAMER)
diff --git a/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp b/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp
index 0071d67..da9255b 100644
--- a/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp
+++ b/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp
@@ -24,7 +24,7 @@
#include "config.h"
#include "MediaPlayerPrivateGStreamer.h"
-#if ENABLE(VIDEO)
+#if USE(GSTREAMER)
#include "ColorSpace.h"
#include "DataSourceGStreamer.h"
@@ -1459,4 +1459,4 @@ void MediaPlayerPrivateGStreamer::createGSTPlayBin()
}
-#endif // ENABLE(VIDEO)
+#endif // USE(GSTREAMER)
diff --git a/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h b/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h
index 6d1392d..800ca6d 100644
--- a/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h
+++ b/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h
@@ -22,7 +22,7 @@
#ifndef MediaPlayerPrivateGStreamer_h
#define MediaPlayerPrivateGStreamer_h
-#if ENABLE(VIDEO)
+#if USE(GSTREAMER)
#include <wtf/Forward.h>
#include "MediaPlayerPrivate.h"
@@ -179,5 +179,5 @@ class MediaPlayerPrivateGStreamer : public MediaPlayerPrivateInterface {
};
}
-#endif // ENABLE(VIDEO)
+#endif // USE(GSTREAMER)
#endif
diff --git a/WebCore/platform/graphics/gstreamer/PlatformVideoWindow.h b/WebCore/platform/graphics/gstreamer/PlatformVideoWindow.h
index 3c4904b..f3df207 100644
--- a/WebCore/platform/graphics/gstreamer/PlatformVideoWindow.h
+++ b/WebCore/platform/graphics/gstreamer/PlatformVideoWindow.h
@@ -19,7 +19,7 @@
#ifndef PlatformVideoWindow_h
#define PlatformVideoWindow_h
-#if ENABLE(VIDEO)
+#if USE(GSTREAMER)
#include "Widget.h"
#include <wtf/PassRefPtr.h>
@@ -44,5 +44,5 @@ class PlatformVideoWindow : public RefCounted<PlatformVideoWindow> {
};
}
-#endif // ENABLE(VIDEO)
+#endif // USE(GSTREAMER)
#endif
diff --git a/WebCore/platform/graphics/gstreamer/PlatformVideoWindowEfl.cpp b/WebCore/platform/graphics/gstreamer/PlatformVideoWindowEfl.cpp
index 68ab7ac..c55b9cc 100644
--- a/WebCore/platform/graphics/gstreamer/PlatformVideoWindowEfl.cpp
+++ b/WebCore/platform/graphics/gstreamer/PlatformVideoWindowEfl.cpp
@@ -19,7 +19,7 @@
#include "config.h"
#include "PlatformVideoWindow.h"
-#if ENABLE(VIDEO)
+#if USE(GSTREAMER)
#include "NotImplemented.h"
@@ -35,4 +35,4 @@ PlatformVideoWindow::~PlatformVideoWindow()
notImplemented();
}
-#endif // ENABLE(VIDEO)
+#endif // USE(GSTREAMER)
diff --git a/WebCore/platform/graphics/gstreamer/PlatformVideoWindowGtk.cpp b/WebCore/platform/graphics/gstreamer/PlatformVideoWindowGtk.cpp
index 88b6552..77343ae 100644
--- a/WebCore/platform/graphics/gstreamer/PlatformVideoWindowGtk.cpp
+++ b/WebCore/platform/graphics/gstreamer/PlatformVideoWindowGtk.cpp
@@ -19,7 +19,7 @@
#include "config.h"
#include "PlatformVideoWindow.h"
-#if ENABLE(VIDEO)
+#if USE(GSTREAMER)
#include <gtk/gtk.h>
@@ -61,4 +61,4 @@ PlatformVideoWindow::~PlatformVideoWindow()
m_videoWindowId = 0;
}
-#endif // ENABLE(VIDEO)
+#endif // USE(GSTREAMER)
diff --git a/WebCore/platform/graphics/gstreamer/VideoSinkGStreamer.cpp b/WebCore/platform/graphics/gstreamer/VideoSinkGStreamer.cpp
index 00fef4b..4319f6c 100644
--- a/WebCore/platform/graphics/gstreamer/VideoSinkGStreamer.cpp
+++ b/WebCore/platform/graphics/gstreamer/VideoSinkGStreamer.cpp
@@ -28,7 +28,7 @@
#include "config.h"
#include "VideoSinkGStreamer.h"
-#if ENABLE(VIDEO)
+#if USE(GSTREAMER)
#include <glib.h>
#include <gst/gst.h>
@@ -371,4 +371,4 @@ webkit_video_sink_new(void)
return (GstElement*)g_object_new(WEBKIT_TYPE_VIDEO_SINK, 0);
}
-#endif // ENABLE(VIDEO)
+#endif // USE(GSTREAMER)
diff --git a/WebCore/platform/graphics/gstreamer/VideoSinkGStreamer.h b/WebCore/platform/graphics/gstreamer/VideoSinkGStreamer.h
index 767e83f..6cd86c2 100644
--- a/WebCore/platform/graphics/gstreamer/VideoSinkGStreamer.h
+++ b/WebCore/platform/graphics/gstreamer/VideoSinkGStreamer.h
@@ -20,7 +20,7 @@
#ifndef VideoSinkGStreamer_h
#define VideoSinkGStreamer_h
-#if ENABLE(VIDEO)
+#if USE(GSTREAMER)
#include <glib-object.h>
#include <gst/video/gstvideosink.h>
@@ -77,5 +77,5 @@ GstElement *webkit_video_sink_new(void);
G_END_DECLS
-#endif // ENABLE(VIDEO)
+#endif // USE(GSTREAMER)
#endif
diff --git a/WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp b/WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp
index 4e57193..635feff 100644
--- a/WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp
+++ b/WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp
@@ -18,7 +18,7 @@
#include "config.h"
#include "WebKitWebSourceGStreamer.h"
-#if ENABLE(VIDEO)
+#if USE(GSTREAMER)
#include "Document.h"
#include "GOwnPtr.h"
@@ -795,5 +795,5 @@ void StreamingClient::cannotShowURL(ResourceHandle*)
GST_ELEMENT_ERROR(m_src, RESOURCE, OPEN_READ, ("Can't show \"%s\"", m_src->priv->uri), (0));
}
-#endif // ENABLE(VIDEO)
+#endif // USE(GSTREAMER)
diff --git a/WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.h b/WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.h
index 1594062..bdb0833 100644
--- a/WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.h
+++ b/WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.h
@@ -18,7 +18,7 @@
#ifndef WebKitWebSourceGStreamer_h
#define WebKitWebSourceGStreamer_h
-#if ENABLE(VIDEO)
+#if USE(GSTREAMER)
#include "Frame.h"
#include <gst/gst.h>
@@ -50,5 +50,5 @@ void webKitWebSrcSetFrame(WebKitWebSrc* src, WebCore::Frame* frame);
G_END_DECLS
-#endif // ENABLE(VIDEO)
+#endif // USE(GSTREAMER)
#endif
diff --git a/WebCore/platform/graphics/gtk/CairoUtilities.cpp b/WebCore/platform/graphics/gtk/GdkCairoUtilities.cpp
index 81e00f0..d768ce2 100644
--- a/WebCore/platform/graphics/gtk/CairoUtilities.cpp
+++ b/WebCore/platform/graphics/gtk/GdkCairoUtilities.cpp
@@ -24,7 +24,7 @@
*/
#include "config.h"
-#include "CairoUtilities.h"
+#include "GdkCairoUtilities.h"
#include <cairo.h>
#include <gtk/gtk.h>
diff --git a/WebCore/platform/graphics/gtk/CairoUtilities.h b/WebCore/platform/graphics/gtk/GdkCairoUtilities.h
index 594abc0..ff5b3ed 100644
--- a/WebCore/platform/graphics/gtk/CairoUtilities.h
+++ b/WebCore/platform/graphics/gtk/GdkCairoUtilities.h
@@ -23,9 +23,9 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef CairoUtilities_h
-#define CairoUtilities_h
+#ifndef GdkCairoUtilities_h
+#define GdkCairoUtilities_h
GdkPixbuf* cairoImageSurfaceToGdkPixbuf(cairo_surface_t* surface);
-#endif // CairoUtilities_h
+#endif // GdkCairoUtilities_h
diff --git a/WebCore/platform/graphics/gtk/ImageBufferGtk.cpp b/WebCore/platform/graphics/gtk/ImageBufferGtk.cpp
index 821cc12..edb26f0 100644
--- a/WebCore/platform/graphics/gtk/ImageBufferGtk.cpp
+++ b/WebCore/platform/graphics/gtk/ImageBufferGtk.cpp
@@ -21,7 +21,7 @@
#include "ImageBuffer.h"
#include "Base64.h"
-#include "CairoUtilities.h"
+#include "GdkCairoUtilities.h"
#include "GOwnPtr.h"
#include "GRefPtrGtk.h"
#include "MIMETypeRegistry.h"
diff --git a/WebCore/platform/graphics/gtk/ImageGtk.cpp b/WebCore/platform/graphics/gtk/ImageGtk.cpp
index 5272243..623ace6 100644
--- a/WebCore/platform/graphics/gtk/ImageGtk.cpp
+++ b/WebCore/platform/graphics/gtk/ImageGtk.cpp
@@ -26,7 +26,7 @@
#include "config.h"
#include "BitmapImage.h"
-#include "CairoUtilities.h"
+#include "GdkCairoUtilities.h"
#include "GOwnPtrGtk.h"
#include "SharedBuffer.h"
#include <wtf/text/CString.h>
diff --git a/WebCore/platform/graphics/mac/ComplexTextController.cpp b/WebCore/platform/graphics/mac/ComplexTextController.cpp
index da381f2..a2733f8 100644
--- a/WebCore/platform/graphics/mac/ComplexTextController.cpp
+++ b/WebCore/platform/graphics/mac/ComplexTextController.cpp
@@ -185,25 +185,14 @@ void ComplexTextController::collectComplexTextRuns()
// We break up glyph run generation for the string by FontData and (if needed) the use of small caps.
const UChar* cp = m_run.characters();
- bool hasTrailingSoftHyphen = m_run[m_end - 1] == softHyphen;
- if (m_font.isSmallCaps() || hasTrailingSoftHyphen)
+ if (m_font.isSmallCaps())
m_smallCapsBuffer.resize(m_end);
unsigned indexOfFontTransition = m_run.rtl() ? m_end - 1 : 0;
const UChar* curr = m_run.rtl() ? cp + m_end - 1 : cp;
const UChar* end = m_run.rtl() ? cp - 1 : cp + m_end;
- // FIXME: Using HYPHEN-MINUS rather than HYPHEN because Times has a HYPHEN-MINUS glyph that looks like its
- // SOFT-HYPHEN glyph, and has no HYPHEN glyph.
- static const UChar hyphen = '-';
-
- if (hasTrailingSoftHyphen && m_run.rtl()) {
- collectComplexTextRunsForCharacters(&hyphen, 1, m_end - 1, m_font.glyphDataForCharacter(hyphen, false).fontData);
- indexOfFontTransition--;
- curr--;
- }
-
GlyphData glyphData;
GlyphData nextGlyphData;
@@ -267,14 +256,11 @@ void ComplexTextController::collectComplexTextRuns()
}
}
- int itemLength = m_run.rtl() ? indexOfFontTransition + 1 : m_end - indexOfFontTransition - (hasTrailingSoftHyphen ? 1 : 0);
+ int itemLength = m_run.rtl() ? indexOfFontTransition + 1 : m_end - indexOfFontTransition;
if (itemLength) {
int itemStart = m_run.rtl() ? 0 : indexOfFontTransition;
collectComplexTextRunsForCharacters((nextIsSmallCaps ? m_smallCapsBuffer.data() : cp) + itemStart, itemLength, itemStart, nextGlyphData.glyph ? nextGlyphData.fontData : 0);
}
-
- if (hasTrailingSoftHyphen && m_run.ltr())
- collectComplexTextRunsForCharacters(&hyphen, 1, m_end - 1, m_font.glyphDataForCharacter(hyphen, false).fontData);
}
#if USE(CORE_TEXT) && USE(ATSUI)
@@ -382,9 +368,9 @@ void ComplexTextController::advance(unsigned offset, GlyphBuffer* glyphBuffer)
unsigned glyphEndOffset;
if (complexTextRun.isMonotonic()) {
if (ltr)
- glyphEndOffset = max<unsigned>(glyphStartOffset, g + 1 < glyphCount ? complexTextRun.indexAt(g + 1) : complexTextRun.stringLength());
+ glyphEndOffset = max<unsigned>(glyphStartOffset, g + 1 < glyphCount ? static_cast<unsigned>(complexTextRun.indexAt(g + 1)) : complexTextRun.stringLength());
else
- glyphEndOffset = max<unsigned>(glyphStartOffset, g > 0 ? complexTextRun.indexAt(g - 1) : complexTextRun.stringLength());
+ glyphEndOffset = max<unsigned>(glyphStartOffset, g > 0 ? static_cast<unsigned>(complexTextRun.indexAt(g - 1)) : complexTextRun.stringLength());
} else
glyphEndOffset = complexTextRun.endOffsetAt(g);
diff --git a/WebCore/platform/graphics/mac/GraphicsLayerCA.h b/WebCore/platform/graphics/mac/GraphicsLayerCA.h
index 6ff3ff0..17a67ac 100644
--- a/WebCore/platform/graphics/mac/GraphicsLayerCA.h
+++ b/WebCore/platform/graphics/mac/GraphicsLayerCA.h
@@ -96,11 +96,10 @@ public:
virtual void suspendAnimations(double time);
virtual void resumeAnimations();
- virtual bool addAnimation(const KeyframeValueList&, const IntSize& boxSize, const Animation*, const String& keyframesName, double timeOffset);
- virtual void removeAnimationsForProperty(AnimatedPropertyID);
- virtual void removeAnimationsForKeyframes(const String& keyframesName);
- virtual void pauseAnimation(const String& keyframesName, double timeOffset);
-
+ virtual bool addAnimation(const KeyframeValueList&, const IntSize& boxSize, const Animation*, const String& animationName, double timeOffset);
+ virtual void pauseAnimation(const String& animationName, double timeOffset);
+ virtual void removeAnimation(const String& animationName);
+
virtual void setContentsToImage(Image*);
virtual void setContentsToMedia(PlatformLayer*);
virtual void setContentsToCanvas(PlatformLayer*);
@@ -119,6 +118,9 @@ public:
virtual void syncCompositingState();
virtual void syncCompositingStateForThisLayerOnly();
+ // Should only be called by animationDidStart: callback
+ void animationDidStart(CAAnimation*);
+
protected:
virtual void setOpacityInternal(float);
@@ -128,17 +130,17 @@ private:
CALayer* primaryLayer() const { return m_structuralLayer.get() ? m_structuralLayer.get() : m_layer.get(); }
CALayer* hostLayerForSublayers() const;
CALayer* layerForSuperlayer() const;
- CALayer* animatedLayer(AnimatedPropertyID property) const;
+ CALayer* animatedLayer(AnimatedPropertyID) const;
typedef String CloneID; // Identifier for a given clone, based on original/replica branching down the tree.
static bool isReplicatedRootClone(const CloneID& cloneID) { return cloneID[0U] & 1; }
typedef HashMap<CloneID, RetainPtr<CALayer> > LayerMap;
LayerMap* primaryLayerClones() const { return m_structuralLayer.get() ? m_structuralLayerClones.get() : m_layerClones.get(); }
- LayerMap* animatedLayerClones(AnimatedPropertyID property) const;
+ LayerMap* animatedLayerClones(AnimatedPropertyID) const;
- bool createAnimationFromKeyframes(const KeyframeValueList&, const Animation*, const String& keyframesName, double timeOffset);
- bool createTransformAnimationsFromKeyframes(const KeyframeValueList&, const Animation*, const String& keyframesName, double timeOffset, const IntSize& boxSize);
+ bool createAnimationFromKeyframes(const KeyframeValueList&, const Animation*, const String& animationName, double timeOffset);
+ bool createTransformAnimationsFromKeyframes(const KeyframeValueList&, const Animation*, const String& animationName, double timeOffset, const IntSize& boxSize);
// Return autoreleased animation (use RetainPtr?)
CABasicAnimation* createBasicAnimation(const Animation*, AnimatedPropertyID, bool additive);
@@ -153,9 +155,9 @@ private:
bool setTransformAnimationEndpoints(const KeyframeValueList&, const Animation*, CABasicAnimation*, int functionIndex, TransformOperation::OperationType, bool isMatrixAnimation, const IntSize& boxSize);
bool setTransformAnimationKeyframes(const KeyframeValueList&, const Animation*, CAKeyframeAnimation*, int functionIndex, TransformOperation::OperationType, bool isMatrixAnimation, const IntSize& boxSize);
- bool animationIsRunning(const String& keyframesName) const
+ bool animationIsRunning(const String& animationName) const
{
- return m_runningKeyframeAnimations.find(keyframesName) != m_runningKeyframeAnimations.end();
+ return m_runningAnimations.find(animationName) != m_runningAnimations.end();
}
void commitLayerChangesBeforeSublayers();
@@ -271,13 +273,13 @@ private:
void ensureStructuralLayer(StructuralLayerPurpose);
StructuralLayerPurpose structuralLayerPurpose() const;
- void setAnimationOnLayer(CAPropertyAnimation*, AnimatedPropertyID, const String& keyframesName, int index, double timeOffset);
- bool removeAnimationFromLayer(AnimatedPropertyID, const String& keyframesName, int index);
- void pauseAnimationOnLayer(AnimatedPropertyID, const String& keyframesName, int index, double timeOffset);
+ void setCAAnimationOnLayer(CAPropertyAnimation*, AnimatedPropertyID, const String& animationName, int index, double timeOffset);
+ bool removeCAAnimationFromLayer(AnimatedPropertyID, const String& animationName, int index);
+ void pauseCAAnimationOnLayer(AnimatedPropertyID, const String& animationName, int index, double timeOffset);
enum MoveOrCopy { Move, Copy };
- void moveOrCopyAnimationsForProperty(MoveOrCopy, AnimatedPropertyID property, CALayer * fromLayer, CALayer * toLayer);
- static void moveOrCopyAllAnimationsForProperty(MoveOrCopy operation, AnimatedPropertyID property, const String& keyframesName, CALayer * fromLayer, CALayer * toLayer);
+ static void moveOrCopyLayerAnimation(MoveOrCopy, const String& animationIdentifier, CALayer *fromLayer, CALayer *toLayer);
+ void moveOrCopyAnimationsForProperty(MoveOrCopy, AnimatedPropertyID, CALayer * fromLayer, CALayer * toLayer);
enum LayerChange {
NoChange = 0,
@@ -335,29 +337,26 @@ private:
RetainPtr<CGImageRef> m_uncorrectedContentsImage;
RetainPtr<CGImageRef> m_pendingContentsImage;
- struct LayerAnimation {
- LayerAnimation(CAPropertyAnimation* caAnim, const String& keyframesName, AnimatedPropertyID property, int index, double timeOffset)
- : m_animation(caAnim)
- , m_keyframesName(keyframesName)
+ // This represents the animation of a single property. There may be multiple transform animations for
+ // a single transition or keyframe animation, so index is used to distinguish these.
+ struct LayerPropertyAnimation {
+ LayerPropertyAnimation(CAPropertyAnimation* caAnimation, const String& animationName, AnimatedPropertyID property, int index, double timeOffset)
+ : m_animation(caAnimation)
+ , m_name(animationName)
, m_property(property)
, m_index(index)
, m_timeOffset(timeOffset)
{ }
RetainPtr<CAPropertyAnimation*> m_animation;
- String m_keyframesName;
+ String m_name;
AnimatedPropertyID m_property;
int m_index;
double m_timeOffset;
};
- Vector<LayerAnimation> m_uncomittedAnimations;
-
- // Animations on the layer are identified by property + index.
- typedef int AnimatedProperty; // std containers choke on the AnimatedPropertyID enum
- typedef pair<AnimatedProperty, int> AnimationPair;
-
- HashSet<AnimatedProperty> m_transitionPropertiesToRemove;
+ // Uncommitted transitions and animations.
+ Vector<LayerPropertyAnimation> m_uncomittedAnimations;
enum Action { Remove, Pause };
struct AnimationProcessingAction {
@@ -367,15 +366,15 @@ private:
{
}
Action action;
- double timeOffset; // only used for pause
+ double timeOffset; // only used for pause
};
typedef HashMap<String, AnimationProcessingAction> AnimationsToProcessMap;
- AnimationsToProcessMap m_keyframeAnimationsToProcess;
+ AnimationsToProcessMap m_animationsToProcess;
+
+ // Map of animation names to their associated lists of property animations, so we can remove/pause them.
+ typedef HashMap<String, Vector<LayerPropertyAnimation> > AnimationsMap;
+ AnimationsMap m_runningAnimations;
- // Map of keyframe names to their associated lists of animations for running animations, so we can remove/pause them.
- typedef HashMap<String, Vector<AnimationPair> > KeyframeAnimationsMap;
- KeyframeAnimationsMap m_runningKeyframeAnimations;
-
Vector<FloatRect> m_dirtyRects;
LayerChangeFlags m_uncommittedChanges;
diff --git a/WebCore/platform/graphics/mac/GraphicsLayerCA.mm b/WebCore/platform/graphics/mac/GraphicsLayerCA.mm
index 395a691..d4cd851 100644
--- a/WebCore/platform/graphics/mac/GraphicsLayerCA.mm
+++ b/WebCore/platform/graphics/mac/GraphicsLayerCA.mm
@@ -55,6 +55,8 @@ using namespace std;
namespace WebCore {
+static NSString * const WebKitAnimationBeginTimeSetKey = @"WebKitAnimationBeginTimeSet";
+
// The threshold width or height above which a tiled layer will be used. This should be
// large enough to avoid tiled layers for most GraphicsLayers, but less than the OpenGL
// texture size limit on all supported hardware.
@@ -101,11 +103,8 @@ static double mediaTimeToCurrentTime(CFTimeInterval t)
- (void)animationDidStart:(CAAnimation *)animation
{
- if (!m_graphicsLayer)
- return;
-
- double startTime = WebCore::mediaTimeToCurrentTime([animation beginTime]);
- m_graphicsLayer->client()->notifyAnimationStarted(m_graphicsLayer, startTime);
+ if (m_graphicsLayer)
+ m_graphicsLayer->animationDidStart(animation);
}
- (WebCore::GraphicsLayerCA*)graphicsLayer
@@ -197,7 +196,7 @@ static NSValue* getTransformFunctionValue(const TransformOperation* transformOp,
}
#if HAVE_MODERN_QUARTZCORE
-static NSString* getValueFunctionNameForTransformOperation(TransformOperation::OperationType transformType)
+static NSString *getValueFunctionNameForTransformOperation(TransformOperation::OperationType transformType)
{
// Use literal strings to avoid link-time dependency on those symbols.
switch (transformType) {
@@ -247,20 +246,9 @@ static String propertyIdToString(AnimatedPropertyID property)
return "";
}
-static String animationIdentifier(AnimatedPropertyID property, const String& keyframesName, int index)
+static String animationIdentifier(const String& animationName, AnimatedPropertyID property, int index)
{
- StringBuilder builder;
-
- builder.append(propertyIdToString(property));
- builder.append("_");
-
- if (!keyframesName.isEmpty()) {
- builder.append(keyframesName);
- builder.append("_");
- }
- builder.append("_");
- builder.append(String::number(index));
- return builder.toString();
+ return animationName + String::format("_%d_%d", property, index);
}
static CAMediaTimingFunction* getCAMediaTimingFunction(const TimingFunction* timingFunction)
@@ -550,39 +538,40 @@ void GraphicsLayerCA::setChildrenTransform(const TransformationMatrix& t)
noteLayerPropertyChanged(ChildrenTransformChanged);
}
-void GraphicsLayerCA::moveOrCopyAllAnimationsForProperty(MoveOrCopy operation, AnimatedPropertyID property, const String& keyframesName, CALayer *fromLayer, CALayer *toLayer)
+void GraphicsLayerCA::moveOrCopyLayerAnimation(MoveOrCopy operation, const String& animationIdentifier, CALayer *fromLayer, CALayer *toLayer)
{
- for (int index = 0; ; ++index) {
- String animName = animationIdentifier(property, keyframesName, index);
+ NSString *animationID = animationIdentifier;
+ CAAnimation *anim = [fromLayer animationForKey:animationID];
+ if (!anim)
+ return;
- CAAnimation* anim = [fromLayer animationForKey:animName];
- if (!anim)
+ switch (operation) {
+ case Move:
+ [anim retain];
+ [fromLayer removeAnimationForKey:animationID];
+ [toLayer addAnimation:anim forKey:animationID];
+ [anim release];
break;
- switch (operation) {
- case Move:
- [anim retain];
- [fromLayer removeAnimationForKey:animName];
- [toLayer addAnimation:anim forKey:animName];
- [anim release];
- break;
-
- case Copy:
- [toLayer addAnimation:anim forKey:animName];
- break;
- }
+ case Copy:
+ [toLayer addAnimation:anim forKey:animationID];
+ break;
}
}
void GraphicsLayerCA::moveOrCopyAnimationsForProperty(MoveOrCopy operation, AnimatedPropertyID property, CALayer *fromLayer, CALayer *toLayer)
{
- // Move transitions for this property.
- moveOrCopyAllAnimationsForProperty(operation, property, "", fromLayer, toLayer);
-
// Look for running animations affecting this property.
- KeyframeAnimationsMap::const_iterator end = m_runningKeyframeAnimations.end();
- for (KeyframeAnimationsMap::const_iterator it = m_runningKeyframeAnimations.begin(); it != end; ++it)
- moveOrCopyAllAnimationsForProperty(operation, property, it->first, fromLayer, toLayer);
+ AnimationsMap::const_iterator end = m_runningAnimations.end();
+ for (AnimationsMap::const_iterator it = m_runningAnimations.begin(); it != end; ++it) {
+ const Vector<LayerPropertyAnimation>& propertyAnimations = it->second;
+ size_t numAnimations = propertyAnimations.size();
+ for (size_t i = 0; i < numAnimations; ++i) {
+ const LayerPropertyAnimation& currAnimation = propertyAnimations[i];
+ if (currAnimation.m_property == property)
+ moveOrCopyLayerAnimation(operation, animationIdentifier(currAnimation.m_name, currAnimation.m_property, currAnimation.m_index), fromLayer, toLayer);
+ }
+ }
}
void GraphicsLayerCA::setPreserves3D(bool preserves3D)
@@ -704,8 +693,10 @@ void GraphicsLayerCA::setContentsRect(const IntRect& rect)
noteLayerPropertyChanged(ContentsRectChanged);
}
-bool GraphicsLayerCA::addAnimation(const KeyframeValueList& valueList, const IntSize& boxSize, const Animation* anim, const String& keyframesName, double timeOffset)
+bool GraphicsLayerCA::addAnimation(const KeyframeValueList& valueList, const IntSize& boxSize, const Animation* anim, const String& animationName, double timeOffset)
{
+ ASSERT(!animationName.isEmpty());
+
if (forceSoftwareAnimation() || !anim || anim->isEmptyOrZeroDuration() || valueList.size() < 2)
return false;
@@ -723,9 +714,9 @@ bool GraphicsLayerCA::addAnimation(const KeyframeValueList& valueList, const Int
bool createdAnimations = false;
if (valueList.property() == AnimatedPropertyWebkitTransform)
- createdAnimations = createTransformAnimationsFromKeyframes(valueList, anim, keyframesName, timeOffset, boxSize);
+ createdAnimations = createTransformAnimationsFromKeyframes(valueList, anim, animationName, timeOffset, boxSize);
else
- createdAnimations = createAnimationFromKeyframes(valueList, anim, keyframesName, timeOffset);
+ createdAnimations = createAnimationFromKeyframes(valueList, anim, animationName, timeOffset);
if (createdAnimations)
noteLayerPropertyChanged(AnimationChanged);
@@ -733,39 +724,46 @@ bool GraphicsLayerCA::addAnimation(const KeyframeValueList& valueList, const Int
return createdAnimations;
}
-void GraphicsLayerCA::removeAnimationsForProperty(AnimatedPropertyID property)
+void GraphicsLayerCA::pauseAnimation(const String& animationName, double timeOffset)
{
- if (m_transitionPropertiesToRemove.find(property) != m_transitionPropertiesToRemove.end())
+ if (!animationIsRunning(animationName))
return;
- m_transitionPropertiesToRemove.add(property);
+ AnimationsToProcessMap::iterator it = m_animationsToProcess.find(animationName);
+ if (it != m_animationsToProcess.end()) {
+ AnimationProcessingAction& processingInfo = it->second;
+ // If an animation is scheduled to be removed, don't change the remove to a pause.
+ if (processingInfo.action != Remove)
+ processingInfo.action = Pause;
+ } else
+ m_animationsToProcess.add(animationName, AnimationProcessingAction(Pause, timeOffset));
+
noteLayerPropertyChanged(AnimationChanged);
}
-void GraphicsLayerCA::removeAnimationsForKeyframes(const String& animationName)
+void GraphicsLayerCA::removeAnimation(const String& animationName)
{
if (!animationIsRunning(animationName))
return;
- m_keyframeAnimationsToProcess.add(animationName, AnimationProcessingAction(Remove));
+ m_animationsToProcess.add(animationName, AnimationProcessingAction(Remove));
noteLayerPropertyChanged(AnimationChanged);
}
-void GraphicsLayerCA::pauseAnimation(const String& keyframesName, double timeOffset)
+void GraphicsLayerCA::animationDidStart(CAAnimation* caAnimation)
{
- if (!animationIsRunning(keyframesName))
- return;
+ bool hadNonZeroBeginTime = [[caAnimation valueForKey:WebKitAnimationBeginTimeSetKey] boolValue];
- AnimationsToProcessMap::iterator it = m_keyframeAnimationsToProcess.find(keyframesName);
- if (it != m_keyframeAnimationsToProcess.end()) {
- AnimationProcessingAction& processingInfo = it->second;
- // If an animation is scheduled to be removed, don't change the remove to a pause.
- if (processingInfo.action != Remove)
- processingInfo.action = Pause;
+ double startTime;
+ if (hadNonZeroBeginTime) {
+ // We don't know what time CA used to commit the animation, so just use the current time
+ // (even though this will be slightly off).
+ startTime = WebCore::mediaTimeToCurrentTime(CACurrentMediaTime());
} else
- m_keyframeAnimationsToProcess.add(keyframesName, AnimationProcessingAction(Pause, timeOffset));
+ startTime = WebCore::mediaTimeToCurrentTime([caAnimation beginTime]);
- noteLayerPropertyChanged(AnimationChanged);
+ if (m_client)
+ m_client->notifyAnimationStarted(this, startTime);
}
void GraphicsLayerCA::setContentsToImage(Image* image)
@@ -1496,68 +1494,49 @@ CALayer *GraphicsLayerCA::replicatedLayerRoot(ReplicaState& replicaState)
void GraphicsLayerCA::updateLayerAnimations()
{
- if (m_transitionPropertiesToRemove.size()) {
- HashSet<int>::const_iterator end = m_transitionPropertiesToRemove.end();
- for (HashSet<AnimatedProperty>::const_iterator it = m_transitionPropertiesToRemove.begin(); it != end; ++it) {
- AnimatedPropertyID currProperty = static_cast<AnimatedPropertyID>(*it);
- // Remove all animations with this property in the key.
- for (int index = 0; ; ++index) {
- if (!removeAnimationFromLayer(currProperty, "", index))
- break;
- }
- }
-
- m_transitionPropertiesToRemove.clear();
- }
-
- if (m_keyframeAnimationsToProcess.size()) {
- AnimationsToProcessMap::const_iterator end = m_keyframeAnimationsToProcess.end();
- for (AnimationsToProcessMap::const_iterator it = m_keyframeAnimationsToProcess.begin(); it != end; ++it) {
- const String& currKeyframeName = it->first;
- KeyframeAnimationsMap::iterator animationIt = m_runningKeyframeAnimations.find(currKeyframeName);
- if (animationIt == m_runningKeyframeAnimations.end())
+ if (m_animationsToProcess.size()) {
+ AnimationsToProcessMap::const_iterator end = m_animationsToProcess.end();
+ for (AnimationsToProcessMap::const_iterator it = m_animationsToProcess.begin(); it != end; ++it) {
+ const String& currAnimationName = it->first;
+ AnimationsMap::iterator animationIt = m_runningAnimations.find(currAnimationName);
+ if (animationIt == m_runningAnimations.end())
continue;
const AnimationProcessingAction& processingInfo = it->second;
- const Vector<AnimationPair>& animations = animationIt->second;
+ const Vector<LayerPropertyAnimation>& animations = animationIt->second;
for (size_t i = 0; i < animations.size(); ++i) {
- const AnimationPair& currPair = animations[i];
+ const LayerPropertyAnimation& currAnimation = animations[i];
switch (processingInfo.action) {
case Remove:
- removeAnimationFromLayer(static_cast<AnimatedPropertyID>(currPair.first), currKeyframeName, currPair.second);
+ removeCAAnimationFromLayer(currAnimation.m_property, currAnimationName, currAnimation.m_index);
break;
case Pause:
- pauseAnimationOnLayer(static_cast<AnimatedPropertyID>(currPair.first), currKeyframeName, currPair.second, processingInfo.timeOffset);
+ pauseCAAnimationOnLayer(currAnimation.m_property, currAnimationName, currAnimation.m_index, processingInfo.timeOffset);
break;
}
}
if (processingInfo.action == Remove)
- m_runningKeyframeAnimations.remove(currKeyframeName);
+ m_runningAnimations.remove(currAnimationName);
}
- m_keyframeAnimationsToProcess.clear();
+ m_animationsToProcess.clear();
}
size_t numAnimations;
if ((numAnimations = m_uncomittedAnimations.size())) {
for (size_t i = 0; i < numAnimations; ++i) {
- const LayerAnimation& pendingAnimation = m_uncomittedAnimations[i];
- setAnimationOnLayer(pendingAnimation.m_animation.get(), pendingAnimation.m_property, pendingAnimation.m_keyframesName, pendingAnimation.m_index, pendingAnimation.m_timeOffset);
+ const LayerPropertyAnimation& pendingAnimation = m_uncomittedAnimations[i];
+ setCAAnimationOnLayer(pendingAnimation.m_animation.get(), pendingAnimation.m_property, pendingAnimation.m_name, pendingAnimation.m_index, pendingAnimation.m_timeOffset);
- if (!pendingAnimation.m_keyframesName.isEmpty()) {
- // If this is a keyframe anim, we have to remember the association of keyframes name to property/index pairs,
- // so we can remove the animations later if needed.
- // For transitions, we can just generate animation names with property and index.
- KeyframeAnimationsMap::iterator it = m_runningKeyframeAnimations.find(pendingAnimation.m_keyframesName);
- if (it == m_runningKeyframeAnimations.end()) {
- Vector<AnimationPair> firstPair;
- firstPair.append(AnimationPair(pendingAnimation.m_property, pendingAnimation.m_index));
- m_runningKeyframeAnimations.add(pendingAnimation.m_keyframesName, firstPair);
- } else {
- Vector<AnimationPair>& animPairs = it->second;
- animPairs.append(AnimationPair(pendingAnimation.m_property, pendingAnimation.m_index));
- }
+ AnimationsMap::iterator it = m_runningAnimations.find(pendingAnimation.m_name);
+ if (it == m_runningAnimations.end()) {
+ Vector<LayerPropertyAnimation> animations;
+ animations.append(pendingAnimation);
+ m_runningAnimations.add(pendingAnimation.m_name, animations);
+ } else {
+ Vector<LayerPropertyAnimation>& animations = it->second;
+ animations.append(pendingAnimation);
}
}
@@ -1565,16 +1544,19 @@ void GraphicsLayerCA::updateLayerAnimations()
}
}
-void GraphicsLayerCA::setAnimationOnLayer(CAPropertyAnimation* caAnim, AnimatedPropertyID property, const String& keyframesName, int index, double timeOffset)
+void GraphicsLayerCA::setCAAnimationOnLayer(CAPropertyAnimation* caAnim, AnimatedPropertyID property, const String& animationName, int index, double timeOffset)
{
PlatformLayer* layer = animatedLayer(property);
- [caAnim setTimeOffset:timeOffset];
-
- String animationName = animationIdentifier(property, keyframesName, index);
-
- [layer removeAnimationForKey:animationName];
- [layer addAnimation:caAnim forKey:animationName];
+ if (timeOffset) {
+ [caAnim setBeginTime:CACurrentMediaTime() - timeOffset];
+ [caAnim setValue:[NSNumber numberWithBool:YES] forKey:WebKitAnimationBeginTimeSetKey];
+ }
+
+ NSString *animationID = animationIdentifier(animationName, property, index);
+
+ [layer removeAnimationForKey:animationID];
+ [layer addAnimation:caAnim forKey:animationID];
if (LayerMap* layerCloneMap = animatedLayerClones(property)) {
LayerMap::const_iterator end = layerCloneMap->end();
@@ -1583,8 +1565,8 @@ void GraphicsLayerCA::setAnimationOnLayer(CAPropertyAnimation* caAnim, AnimatedP
if (m_replicaLayer && isReplicatedRootClone(it->first))
continue;
CALayer *currLayer = it->second.get();
- [currLayer removeAnimationForKey:animationName];
- [currLayer addAnimation:caAnim forKey:animationName];
+ [currLayer removeAnimationForKey:animationID];
+ [currLayer addAnimation:caAnim forKey:animationID];
}
}
}
@@ -1604,16 +1586,16 @@ static void bug7311367Workaround(CALayer* transformLayer, const TransformationMa
[transformLayer setTransform:caTransform];
}
-bool GraphicsLayerCA::removeAnimationFromLayer(AnimatedPropertyID property, const String& keyframesName, int index)
+bool GraphicsLayerCA::removeCAAnimationFromLayer(AnimatedPropertyID property, const String& animationName, int index)
{
PlatformLayer* layer = animatedLayer(property);
- String animationName = animationIdentifier(property, keyframesName, index);
+ NSString *animationID = animationIdentifier(animationName, property, index);
- if (![layer animationForKey:animationName])
+ if (![layer animationForKey:animationID])
return false;
- [layer removeAnimationForKey:animationName];
+ [layer removeAnimationForKey:animationID];
bug7311367Workaround(m_structuralLayer.get(), m_transform);
if (LayerMap* layerCloneMap = animatedLayerClones(property)) {
@@ -1624,7 +1606,7 @@ bool GraphicsLayerCA::removeAnimationFromLayer(AnimatedPropertyID property, cons
continue;
CALayer *currLayer = it->second.get();
- [currLayer removeAnimationForKey:animationName];
+ [currLayer removeAnimationForKey:animationID];
}
}
return true;
@@ -1644,15 +1626,18 @@ static void copyAnimationProperties(CAPropertyAnimation* from, CAPropertyAnimati
#if HAVE_MODERN_QUARTZCORE
[to setValueFunction:[from valueFunction]];
#endif
+
+ if (id object = [from valueForKey:WebKitAnimationBeginTimeSetKey])
+ [to setValue:object forKey:WebKitAnimationBeginTimeSetKey];
}
-void GraphicsLayerCA::pauseAnimationOnLayer(AnimatedPropertyID property, const String& keyframesName, int index, double timeOffset)
+void GraphicsLayerCA::pauseCAAnimationOnLayer(AnimatedPropertyID property, const String& animationName, int index, double timeOffset)
{
PlatformLayer* layer = animatedLayer(property);
- String animationName = animationIdentifier(property, keyframesName, index);
+ NSString *animationID = animationIdentifier(animationName, property, index);
- CAAnimation* caAnim = [layer animationForKey:animationName];
+ CAAnimation *caAnim = [layer animationForKey:animationID];
if (!caAnim)
return;
@@ -1679,7 +1664,7 @@ void GraphicsLayerCA::pauseAnimationOnLayer(AnimatedPropertyID property, const S
[pausedAnim setSpeed:0];
[pausedAnim setTimeOffset:timeOffset];
- [layer addAnimation:pausedAnim forKey:animationName]; // This will replace the running animation.
+ [layer addAnimation:pausedAnim forKey:animationID]; // This will replace the running animation.
// Pause the animations on the clones too.
if (LayerMap* layerCloneMap = animatedLayerClones(property)) {
@@ -1689,7 +1674,7 @@ void GraphicsLayerCA::pauseAnimationOnLayer(AnimatedPropertyID property, const S
if (m_replicaLayer && isReplicatedRootClone(it->first))
continue;
CALayer *currLayer = it->second.get();
- [currLayer addAnimation:pausedAnim forKey:animationName];
+ [currLayer addAnimation:pausedAnim forKey:animationID];
}
}
}
@@ -1726,7 +1711,7 @@ void GraphicsLayerCA::updateContentsNeedsDisplay()
[m_contentsLayer.get() setNeedsDisplay];
}
-bool GraphicsLayerCA::createAnimationFromKeyframes(const KeyframeValueList& valueList, const Animation* animation, const String& keyframesName, double timeOffset)
+bool GraphicsLayerCA::createAnimationFromKeyframes(const KeyframeValueList& valueList, const Animation* animation, const String& animationName, double timeOffset)
{
ASSERT(valueList.property() != AnimatedPropertyWebkitTransform);
@@ -1752,14 +1737,14 @@ bool GraphicsLayerCA::createAnimationFromKeyframes(const KeyframeValueList& valu
if (!valuesOK)
return false;
- m_uncomittedAnimations.append(LayerAnimation(caAnimation, keyframesName, valueList.property(), animationIndex, timeOffset));
+ m_uncomittedAnimations.append(LayerPropertyAnimation(caAnimation, animationName, valueList.property(), animationIndex, timeOffset));
END_BLOCK_OBJC_EXCEPTIONS;
return true;
}
-bool GraphicsLayerCA::createTransformAnimationsFromKeyframes(const KeyframeValueList& valueList, const Animation* animation, const String& keyframesName, double timeOffset, const IntSize& boxSize)
+bool GraphicsLayerCA::createTransformAnimationsFromKeyframes(const KeyframeValueList& valueList, const Animation* animation, const String& animationName, double timeOffset, const IntSize& boxSize)
{
ASSERT(valueList.property() == AnimatedPropertyWebkitTransform);
@@ -1810,7 +1795,7 @@ bool GraphicsLayerCA::createTransformAnimationsFromKeyframes(const KeyframeValue
if (!validMatrices)
break;
- m_uncomittedAnimations.append(LayerAnimation(caAnimation, keyframesName, valueList.property(), animationIndex, timeOffset));
+ m_uncomittedAnimations.append(LayerPropertyAnimation(caAnimation, animationName, valueList.property(), animationIndex, timeOffset));
}
END_BLOCK_OBJC_EXCEPTIONS;
@@ -1844,7 +1829,7 @@ void GraphicsLayerCA::setupAnimation(CAPropertyAnimation* propertyAnim, const An
else if (anim->direction() == Animation::AnimationDirectionAlternate)
repeatCount /= 2;
- NSString* fillMode = 0;
+ NSString *fillMode = 0;
switch (anim->fillMode()) {
case AnimationFillModeNone:
fillMode = kCAFillModeForwards; // Use "forwards" rather than "removed" because the style system will remove the animation when it is finished. This avoids a flash.
@@ -1983,7 +1968,7 @@ bool GraphicsLayerCA::setTransformAnimationEndpoints(const KeyframeValueList& va
[basicAnim setToValue:toValue];
#if HAVE_MODERN_QUARTZCORE
- if (NSString* valueFunctionName = getValueFunctionNameForTransformOperation(transformOp))
+ if (NSString *valueFunctionName = getValueFunctionNameForTransformOperation(transformOp))
[basicAnim setValueFunction:[CAValueFunction functionWithName:valueFunctionName]];
#endif
@@ -2028,7 +2013,7 @@ bool GraphicsLayerCA::setTransformAnimationKeyframes(const KeyframeValueList& va
[keyframeAnim setTimingFunctions:timingFunctions.get()];
#if HAVE_MODERN_QUARTZCORE
- if (NSString* valueFunctionName = getValueFunctionNameForTransformOperation(transformOpType))
+ if (NSString *valueFunctionName = getValueFunctionNameForTransformOperation(transformOpType))
[keyframeAnim setValueFunction:[CAValueFunction functionWithName:valueFunctionName]];
#endif
return true;
@@ -2045,7 +2030,7 @@ void GraphicsLayerCA::suspendAnimations(double time)
LayerMap::const_iterator end = layerCloneMap->end();
for (LayerMap::const_iterator it = layerCloneMap->begin(); it != end; ++it) {
CALayer *currLayer = it->second.get();
- [currLayer setSpeed:0 ];
+ [currLayer setSpeed:0];
[currLayer setTimeOffset:t];
}
}
diff --git a/WebCore/platform/graphics/mac/ImageMac.mm b/WebCore/platform/graphics/mac/ImageMac.mm
index 96b93be..6ad3080 100644
--- a/WebCore/platform/graphics/mac/ImageMac.mm
+++ b/WebCore/platform/graphics/mac/ImageMac.mm
@@ -27,7 +27,6 @@
#import "BitmapImage.h"
#import "FloatRect.h"
-#import "FoundationExtras.h"
#import "GraphicsContext.h"
#import "PlatformString.h"
#import "SharedBuffer.h"
diff --git a/WebCore/platform/graphics/qt/ContextShadowQt.cpp b/WebCore/platform/graphics/qt/ContextShadowQt.cpp
new file mode 100644
index 0000000..342e027
--- /dev/null
+++ b/WebCore/platform/graphics/qt/ContextShadowQt.cpp
@@ -0,0 +1,159 @@
+/*
+ * Copyright (C) 2010 Sencha, Inc.
+ *
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "ContextShadow.h"
+
+#include <QPainter>
+#include <QTimerEvent>
+
+namespace WebCore {
+
+// ContextShadow needs a scratch image as the buffer for the blur filter.
+// Instead of creating and destroying the buffer for every operation,
+// we create a buffer which will be automatically purged via a timer.
+
+class ShadowBuffer: public QObject {
+public:
+ ShadowBuffer(QObject* parent = 0);
+
+ QImage* scratchImage(const QSize& size);
+
+ void schedulePurge();
+
+protected:
+ void timerEvent(QTimerEvent* event);
+
+private:
+ QImage image;
+ int timerId;
+};
+
+ShadowBuffer::ShadowBuffer(QObject* parent)
+ : QObject(parent)
+ , timerId(0)
+{
+}
+
+QImage* ShadowBuffer::scratchImage(const QSize& size)
+{
+ int width = size.width();
+ int height = size.height();
+
+ // We do not need to recreate the buffer if the buffer is reasonably
+ // larger than the requested size. However, if the requested size is
+ // much smaller than our buffer, reduce our buffer so that we will not
+ // keep too many allocated pixels for too long.
+ if (!image.isNull() && (image.width() > width) && (image.height() > height))
+ if (((2 * width) > image.width()) && ((2 * height) > image.height())) {
+ image.fill(Qt::transparent);
+ return &image;
+ }
+
+ // Round to the nearest 32 pixels so we do not grow the buffer everytime
+ // there is larger request by 1 pixel.
+ width = (1 + (width >> 5)) << 5;
+ height = (1 + (height >> 5)) << 5;
+
+ image = QImage(width, height, QImage::Format_ARGB32_Premultiplied);
+ image.fill(Qt::transparent);
+ return &image;
+}
+
+void ShadowBuffer::schedulePurge()
+{
+ static const double BufferPurgeDelay = 2; // seconds
+ killTimer(timerId);
+ timerId = startTimer(BufferPurgeDelay * 1000);
+}
+
+void ShadowBuffer::timerEvent(QTimerEvent* event)
+{
+ if (event->timerId() == timerId) {
+ killTimer(timerId);
+ image = QImage();
+ }
+ QObject::timerEvent(event);
+}
+
+Q_GLOBAL_STATIC(ShadowBuffer, scratchShadowBuffer)
+
+PlatformContext ContextShadow::beginShadowLayer(PlatformContext p, const FloatRect& layerArea)
+{
+ QRect clipRect;
+ if (p->hasClipping())
+#if QT_VERSION >= QT_VERSION_CHECK(4, 8, 0)
+ clipRect = p->clipBoundingRect().toAlignedRect();
+#else
+ clipRect = p->clipRegion().boundingRect();
+#endif
+ else
+ clipRect = p->transform().inverted().mapRect(p->window());
+
+ calculateLayerBoundingRect(layerArea, IntRect(clipRect.x(), clipRect.y(), clipRect.width(), clipRect.height()));
+
+ // Don't paint if we are totally outside the clip region.
+ if (m_layerRect.isEmpty())
+ return 0;
+
+ ShadowBuffer* shadowBuffer = scratchShadowBuffer();
+ QImage* shadowImage = shadowBuffer->scratchImage(m_layerRect.size());
+ m_layerImage = QImage(*shadowImage);
+
+ m_layerContext = new QPainter;
+ m_layerContext->begin(&m_layerImage);
+ m_layerContext->setFont(p->font());
+ m_layerContext->translate(m_offset.width(), m_offset.height());
+
+ // The origin is now the top left corner of the scratch image.
+ m_layerContext->translate(-m_layerRect.x(), -m_layerRect.y());
+
+ return m_layerContext;
+}
+
+void ContextShadow::endShadowLayer(PlatformContext p)
+{
+ m_layerContext->end();
+ delete m_layerContext;
+ m_layerContext = 0;
+
+ if (m_type == BlurShadow) {
+ blurLayerImage(m_layerImage.bits(), IntSize(m_layerImage.width(), m_layerImage.height()),
+ m_layerImage.bytesPerLine());
+
+ // "Colorize" with the right shadow color.
+ QPainter p(&m_layerImage);
+ p.setCompositionMode(QPainter::CompositionMode_SourceIn);
+ p.fillRect(m_layerImage.rect(), m_color.rgb());
+ p.end();
+ }
+
+ p->drawImage(m_layerRect.topLeft(), m_layerImage);
+ scratchShadowBuffer()->schedulePurge();
+}
+
+}
diff --git a/WebCore/platform/graphics/qt/FontQt.cpp b/WebCore/platform/graphics/qt/FontQt.cpp
index 2b246de..e7566eb 100644
--- a/WebCore/platform/graphics/qt/FontQt.cpp
+++ b/WebCore/platform/graphics/qt/FontQt.cpp
@@ -125,37 +125,38 @@ static void drawTextCommon(GraphicsContext* ctx, const TextRun& run, const Float
ContextShadow* ctxShadow = ctx->contextShadow();
- if (ctxShadow->type != ContextShadow::NoShadow) {
+ if (ctxShadow->m_type != ContextShadow::NoShadow) {
qreal dx1 = 0, dx2 = 0, dy1 = 0, dy2 = 0;
- if (ctxShadow->offset.x() > 0)
- dx2 = ctxShadow->offset.x();
+ if (ctxShadow->offset().x() > 0)
+ dx2 = ctxShadow->offset().x();
else
- dx1 = -ctxShadow->offset.x();
- if (ctxShadow->offset.y() > 0)
- dy2 = ctxShadow->offset.y();
+ dx1 = -ctxShadow->offset().x();
+ if (ctxShadow->offset().y() > 0)
+ dy2 = ctxShadow->offset().y();
else
- dy1 = -ctxShadow->offset.y();
+ dy1 = -ctxShadow->offset().y();
// expand the clip rect to include the text shadow as well
clip.adjust(dx1, dx2, dy1, dy2);
- clip.adjust(-ctxShadow->blurRadius, -ctxShadow->blurRadius, ctxShadow->blurRadius, ctxShadow->blurRadius);
+ clip.adjust(-ctxShadow->m_blurRadius, -ctxShadow->m_blurRadius, ctxShadow->m_blurRadius, ctxShadow->m_blurRadius);
}
p->save();
p->setClipRect(clip.toRect(), Qt::IntersectClip);
pt.setY(pt.y() - ascent);
- if (ctxShadow->type != ContextShadow::NoShadow) {
+ if (ctxShadow->m_type != ContextShadow::NoShadow) {
ContextShadow* ctxShadow = ctx->contextShadow();
- if (ctxShadow->type != ContextShadow::BlurShadow) {
+ if (ctxShadow->m_type != ContextShadow::BlurShadow) {
p->save();
- p->setPen(ctxShadow->color);
- p->translate(ctxShadow->offset);
+ p->setPen(ctxShadow->m_color);
+ p->translate(ctxShadow->offset());
line.draw(p, pt);
p->restore();
} else {
QPainter* shadowPainter = ctxShadow->beginShadowLayer(p, boundingRect);
if (shadowPainter) {
// Since it will be blurred anyway, we don't care about render hints.
- shadowPainter->setPen(ctxShadow->color);
+ shadowPainter->setFont(p->font());
+ shadowPainter->setPen(ctxShadow->m_color);
line.draw(shadowPainter, pt);
ctxShadow->endShadowLayer(p);
}
@@ -181,12 +182,12 @@ static void drawTextCommon(GraphicsContext* ctx, const TextRun& run, const Float
if (!isComplexText && !(ctx->textDrawingMode() & cTextStroke))
flags |= Qt::TextBypassShaping;
#endif
- if (ctx->contextShadow()->type != ContextShadow::NoShadow) {
+ if (ctx->contextShadow()->m_type != ContextShadow::NoShadow) {
ContextShadow* ctxShadow = ctx->contextShadow();
- if (ctxShadow->type != ContextShadow::BlurShadow) {
+ if (ctxShadow->m_type != ContextShadow::BlurShadow) {
p->save();
- p->setPen(ctxShadow->color);
- p->translate(ctxShadow->offset);
+ p->setPen(ctxShadow->m_color);
+ p->translate(ctxShadow->offset());
p->drawText(pt, string, flags, run.padding());
p->restore();
} else {
@@ -196,7 +197,7 @@ static void drawTextCommon(GraphicsContext* ctx, const TextRun& run, const Float
if (shadowPainter) {
// Since it will be blurred anyway, we don't care about render hints.
shadowPainter->setFont(p->font());
- shadowPainter->setPen(ctxShadow->color);
+ shadowPainter->setPen(ctxShadow->m_color);
shadowPainter->drawText(pt, string, flags, run.padding());
ctxShadow->endShadowLayer(p);
}
@@ -205,12 +206,13 @@ static void drawTextCommon(GraphicsContext* ctx, const TextRun& run, const Float
if (ctx->textDrawingMode() & cTextStroke) {
QPainterPath path;
path.addText(pt, font, string);
- p->setPen(textStrokePen);
- p->strokePath(path, p->pen());
+ p->strokePath(path, textStrokePen);
}
if (ctx->textDrawingMode() & cTextFill) {
+ QPen previousPen = p->pen();
p->setPen(textFillPen);
p->drawText(pt, string, flags, run.padding());
+ p->setPen(previousPen);
}
}
diff --git a/WebCore/platform/graphics/qt/GraphicsContextQt.cpp b/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
index 5a29ad4..7e4af40 100644
--- a/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
+++ b/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
@@ -201,7 +201,7 @@ public:
bool hasShadow() const
{
- return shadow.type != ContextShadow::NoShadow;
+ return shadow.m_type != ContextShadow::NoShadow;
}
QRectF clipBoundingRect() const
@@ -440,9 +440,9 @@ void GraphicsContext::strokeArc(const IntRect& rect, int startAngle, int angleSp
if (m_data->hasShadow()) {
p->save();
- p->translate(m_data->shadow.offset);
+ p->translate(m_data->shadow.offset());
QPen pen(p->pen());
- pen.setColor(m_data->shadow.color);
+ pen.setColor(m_data->shadow.m_color);
p->setPen(pen);
p->drawArc(rect, startAngle, angleSpan);
p->restore();
@@ -470,12 +470,12 @@ void GraphicsContext::drawConvexPolygon(size_t npoints, const FloatPoint* points
p->setRenderHint(QPainter::Antialiasing, shouldAntialias);
if (m_data->hasShadow()) {
p->save();
- p->translate(m_data->shadow.offset);
+ p->translate(m_data->shadow.offset());
if (p->brush().style() != Qt::NoBrush)
- p->setBrush(QBrush(m_data->shadow.color));
+ p->setBrush(QBrush(m_data->shadow.m_color));
QPen pen(p->pen());
if (pen.style() != Qt::NoPen) {
- pen.setColor(m_data->shadow.color);
+ pen.setColor(m_data->shadow.m_color);
p->setPen(pen);
}
p->drawConvexPolygon(polygon);
@@ -519,9 +519,9 @@ void GraphicsContext::fillPath()
path.setFillRule(toQtFillRule(fillRule()));
if (m_data->hasShadow()) {
- p->translate(m_data->shadow.offset);
- p->fillPath(path, m_data->shadow.color);
- p->translate(-m_data->shadow.offset);
+ p->translate(m_data->shadow.offset());
+ p->fillPath(path, QColor(m_data->shadow.m_color));
+ p->translate(-m_data->shadow.offset());
}
if (m_common->state.fillPattern) {
AffineTransform affine;
@@ -547,11 +547,11 @@ void GraphicsContext::strokePath()
path.setFillRule(toQtFillRule(fillRule()));
if (m_data->hasShadow()) {
- p->translate(m_data->shadow.offset);
+ p->translate(m_data->shadow.offset());
QPen shadowPen(pen);
- shadowPen.setColor(m_data->shadow.color);
+ shadowPen.setColor(m_data->shadow.m_color);
p->strokePath(path, shadowPen);
- p->translate(-m_data->shadow.offset);
+ p->translate(-m_data->shadow.offset());
}
if (m_common->state.strokePattern) {
AffineTransform affine;
@@ -653,7 +653,7 @@ void GraphicsContext::fillRect(const FloatRect& rect)
if (shadowPainter) {
drawRepeatPattern(shadowPainter, image, normalizedRect, m_common->state.fillPattern->repeatX(), m_common->state.fillPattern->repeatY());
shadowPainter->setCompositionMode(QPainter::CompositionMode_SourceIn);
- shadowPainter->fillRect(normalizedRect, shadow->color);
+ shadowPainter->fillRect(normalizedRect, shadow->m_color);
shadow->endShadowLayer(p);
}
drawRepeatPattern(p, image, normalizedRect, m_common->state.fillPattern->repeatX(), m_common->state.fillPattern->repeatY());
@@ -664,13 +664,13 @@ void GraphicsContext::fillRect(const FloatRect& rect)
if (shadowPainter) {
shadowPainter->fillRect(normalizedRect, brush);
shadowPainter->setCompositionMode(QPainter::CompositionMode_SourceIn);
- shadowPainter->fillRect(normalizedRect, shadow->color);
+ shadowPainter->fillRect(normalizedRect, shadow->m_color);
shadow->endShadowLayer(p);
}
p->fillRect(normalizedRect, brush);
} else {
if (m_data->hasShadow()) {
- if (shadow->type == ContextShadow::BlurShadow) {
+ if (shadow->m_type == ContextShadow::BlurShadow) {
QPainter* shadowPainter = shadow->beginShadowLayer(p, normalizedRect);
if (shadowPainter) {
shadowPainter->fillRect(normalizedRect, p->brush());
@@ -679,9 +679,9 @@ void GraphicsContext::fillRect(const FloatRect& rect)
} else {
// Solid rectangle fill with no blur shadow can be done faster
// without using the shadow layer at all.
- QColor shadowColor = shadow->color;
+ QColor shadowColor = shadow->m_color;
shadowColor.setAlphaF(shadowColor.alphaF() * p->brush().color().alphaF());
- p->fillRect(normalizedRect.translated(shadow->offset), shadowColor);
+ p->fillRect(normalizedRect.translated(shadow->offset()), shadowColor);
}
}
p->fillRect(normalizedRect, p->brush());
@@ -701,14 +701,14 @@ void GraphicsContext::fillRect(const FloatRect& rect, const Color& color, ColorS
if (m_data->hasShadow()) {
ContextShadow* shadow = contextShadow();
- if (shadow->type != ContextShadow::BlurShadow) {
+ if (shadow->m_type != ContextShadow::BlurShadow) {
// We do not need any layer for simple shadow.
- p->fillRect(normalizedRect.translated(shadow->offset), shadow->color);
+ p->fillRect(normalizedRect.translated(shadow->offset()), shadow->m_color);
} else {
QPainter* shadowPainter = shadow->beginShadowLayer(p, normalizedRect);
if (shadowPainter) {
shadowPainter->setCompositionMode(QPainter::CompositionMode_Source);
- shadowPainter->fillRect(normalizedRect, shadow->color);
+ shadowPainter->fillRect(normalizedRect, shadow->m_color);
shadow->endShadowLayer(p);
}
}
@@ -725,9 +725,9 @@ void GraphicsContext::fillRoundedRect(const IntRect& rect, const IntSize& topLef
Path path = Path::createRoundedRectangle(rect, topLeft, topRight, bottomLeft, bottomRight);
QPainter* p = m_data->p();
if (m_data->hasShadow()) {
- p->translate(m_data->shadow.offset);
- p->fillPath(path.platformPath(), m_data->shadow.color);
- p->translate(-m_data->shadow.offset);
+ p->translate(m_data->shadow.offset());
+ p->fillPath(path.platformPath(), QColor(m_data->shadow.m_color));
+ p->translate(-m_data->shadow.offset());
}
p->fillPath(path.platformPath(), QColor(color));
}
@@ -884,9 +884,9 @@ void GraphicsContext::setPlatformShadow(const FloatSize& size, float blur, const
// Meaning that this graphics context is associated with a CanvasRenderingContext
// We flip the height since CG and HTML5 Canvas have opposite Y axis
m_common->state.shadowOffset = FloatSize(size.width(), -size.height());
- m_data->shadow = ContextShadow(color, blur, size.width(), -size.height());
+ m_data->shadow = ContextShadow(color, blur, FloatSize(size.width(), -size.height()));
} else {
- m_data->shadow = ContextShadow(color, blur, size.width(), size.height());
+ m_data->shadow = ContextShadow(color, blur, FloatSize(size.width(), size.height()));
}
}
@@ -1002,7 +1002,7 @@ void GraphicsContext::setLineDash(const DashArray& dashes, float dashOffset)
pattern.append(dashes[i % dashLength] / penWidth);
pen.setDashPattern(pattern);
- pen.setDashOffset(dashOffset);
+ pen.setDashOffset(dashOffset / penWidth);
} else
pen.setStyle(Qt::SolidLine);
p->setPen(pen);
diff --git a/WebCore/platform/graphics/qt/MediaPlayerPrivatePhonon.cpp b/WebCore/platform/graphics/qt/MediaPlayerPrivatePhonon.cpp
index 08eb816..b881036 100644
--- a/WebCore/platform/graphics/qt/MediaPlayerPrivatePhonon.cpp
+++ b/WebCore/platform/graphics/qt/MediaPlayerPrivatePhonon.cpp
@@ -51,7 +51,7 @@ using namespace Phonon;
#define LOG_MEDIAOBJECT() (LOG(Media, "%s", debugMediaObject(this, *m_mediaObject).constData()))
#if !LOG_DISABLED
-static QByteArray debugMediaObject(WebCore::MediaPlayerPrivate* mediaPlayer, const MediaObject& mediaObject)
+static QByteArray debugMediaObject(WebCore::MediaPlayerPrivatePhonon* mediaPlayer, const MediaObject& mediaObject)
{
QByteArray byteArray;
QTextStream stream(&byteArray);
@@ -84,7 +84,7 @@ using namespace WTF;
namespace WebCore {
-MediaPlayerPrivate::MediaPlayerPrivate(MediaPlayer* player)
+MediaPlayerPrivatePhonon::MediaPlayerPrivatePhonon(MediaPlayer* player)
: m_player(player)
, m_networkState(MediaPlayer::Empty)
, m_readyState(MediaPlayer::HaveNothing)
@@ -118,19 +118,19 @@ MediaPlayerPrivate::MediaPlayerPrivate(MediaPlayer* player)
connect(m_mediaObject, SIGNAL(totalTimeChanged(qint64)), this, SLOT(totalTimeChanged(qint64)));
}
-MediaPlayerPrivateInterface* MediaPlayerPrivate::create(MediaPlayer* player)
+MediaPlayerPrivateInterface* MediaPlayerPrivatePhonon::create(MediaPlayer* player)
{
- return new MediaPlayerPrivate(player);
+ return new MediaPlayerPrivatePhonon(player);
}
-void MediaPlayerPrivate::registerMediaEngine(MediaEngineRegistrar registrar)
+void MediaPlayerPrivatePhonon::registerMediaEngine(MediaEngineRegistrar registrar)
{
if (isAvailable())
registrar(create, getSupportedTypes, supportsType);
}
-MediaPlayerPrivate::~MediaPlayerPrivate()
+MediaPlayerPrivatePhonon::~MediaPlayerPrivatePhonon()
{
LOG(Media, "MediaPlayerPrivatePhonon::dtor deleting videowidget");
m_videoWidget->close();
@@ -146,7 +146,7 @@ MediaPlayerPrivate::~MediaPlayerPrivate()
m_mediaObject = 0;
}
-HashSet<String>& MediaPlayerPrivate::supportedTypesCache()
+HashSet<String>& MediaPlayerPrivatePhonon::supportedTypesCache()
{
static HashSet<String> supportedTypes;
if (!supportedTypes.isEmpty())
@@ -190,12 +190,12 @@ HashSet<String>& MediaPlayerPrivate::supportedTypesCache()
return supportedTypes;
}
-void MediaPlayerPrivate::getSupportedTypes(HashSet<String>& types)
+void MediaPlayerPrivatePhonon::getSupportedTypes(HashSet<String>& types)
{
types = supportedTypesCache();
}
-MediaPlayer::SupportsType MediaPlayerPrivate::supportsType(const String& type, const String& codecs)
+MediaPlayer::SupportsType MediaPlayerPrivatePhonon::supportsType(const String& type, const String& codecs)
{
if (type.isEmpty())
return MediaPlayer::IsNotSupported;
@@ -205,14 +205,14 @@ MediaPlayer::SupportsType MediaPlayerPrivate::supportsType(const String& type, c
return MediaPlayer::IsNotSupported;
}
-bool MediaPlayerPrivate::hasVideo() const
+bool MediaPlayerPrivatePhonon::hasVideo() const
{
bool hasVideo = m_mediaObject->hasVideo();
LOG(Media, "MediaPlayerPrivatePhonon::hasVideo() -> %s", hasVideo ? "true" : "false");
return hasVideo;
}
-bool MediaPlayerPrivate::hasAudio() const
+bool MediaPlayerPrivatePhonon::hasAudio() const
{
// FIXME: Phonon::MediaObject does not have such a hasAudio() function
bool hasAudio = true;
@@ -220,7 +220,7 @@ bool MediaPlayerPrivate::hasAudio() const
return hasAudio;
}
-void MediaPlayerPrivate::load(const String& url)
+void MediaPlayerPrivatePhonon::load(const String& url)
{
LOG(Media, "MediaPlayerPrivatePhonon::load(\"%s\")", url.utf8().data());
@@ -241,33 +241,33 @@ void MediaPlayerPrivate::load(const String& url)
setVisible(m_player->visible());
}
-void MediaPlayerPrivate::cancelLoad()
+void MediaPlayerPrivatePhonon::cancelLoad()
{
notImplemented();
}
-void MediaPlayerPrivate::play()
+void MediaPlayerPrivatePhonon::play()
{
LOG(Media, "MediaPlayerPrivatePhonon::play()");
m_mediaObject->play();
}
-void MediaPlayerPrivate::pause()
+void MediaPlayerPrivatePhonon::pause()
{
LOG(Media, "MediaPlayerPrivatePhonon::pause()");
m_mediaObject->pause();
}
-bool MediaPlayerPrivate::paused() const
+bool MediaPlayerPrivatePhonon::paused() const
{
bool paused = m_mediaObject->state() == Phonon::PausedState;
LOG(Media, "MediaPlayerPrivatePhonon::paused() --> %s", paused ? "true" : "false");
return paused;
}
-void MediaPlayerPrivate::seek(float position)
+void MediaPlayerPrivatePhonon::seek(float position)
{
LOG(Media, "MediaPlayerPrivatePhonon::seek(%f)", position);
@@ -280,12 +280,12 @@ void MediaPlayerPrivate::seek(float position)
m_mediaObject->seek(position * 1000.0f);
}
-bool MediaPlayerPrivate::seeking() const
+bool MediaPlayerPrivatePhonon::seeking() const
{
return false;
}
-float MediaPlayerPrivate::duration() const
+float MediaPlayerPrivatePhonon::duration() const
{
if (m_readyState < MediaPlayer::HaveMetadata)
return 0.0f;
@@ -299,7 +299,7 @@ float MediaPlayerPrivate::duration() const
return duration;
}
-float MediaPlayerPrivate::currentTime() const
+float MediaPlayerPrivatePhonon::currentTime() const
{
float currentTime = m_mediaObject->currentTime() / 1000.0f;
@@ -307,48 +307,48 @@ float MediaPlayerPrivate::currentTime() const
return currentTime;
}
-PassRefPtr<TimeRanges> MediaPlayerPrivate::buffered() const
+PassRefPtr<TimeRanges> MediaPlayerPrivatePhonon::buffered() const
{
notImplemented();
return TimeRanges::create();
}
-float MediaPlayerPrivate::maxTimeSeekable() const
+float MediaPlayerPrivatePhonon::maxTimeSeekable() const
{
notImplemented();
return 0.0f;
}
-unsigned MediaPlayerPrivate::bytesLoaded() const
+unsigned MediaPlayerPrivatePhonon::bytesLoaded() const
{
notImplemented();
return 0;
}
-unsigned MediaPlayerPrivate::totalBytes() const
+unsigned MediaPlayerPrivatePhonon::totalBytes() const
{
//notImplemented();
return 0;
}
-void MediaPlayerPrivate::setRate(float)
+void MediaPlayerPrivatePhonon::setRate(float)
{
notImplemented();
}
-void MediaPlayerPrivate::setVolume(float volume)
+void MediaPlayerPrivatePhonon::setVolume(float volume)
{
LOG(Media, "MediaPlayerPrivatePhonon::setVolume()");
m_audioOutput->setVolume(volume);
}
-void MediaPlayerPrivate::setMuted(bool muted)
+void MediaPlayerPrivatePhonon::setMuted(bool muted)
{
LOG(Media, "MediaPlayerPrivatePhonon::setMuted()");
m_audioOutput->setMuted(muted);
}
-MediaPlayer::NetworkState MediaPlayerPrivate::networkState() const
+MediaPlayer::NetworkState MediaPlayerPrivatePhonon::networkState() const
{
const QMetaObject* metaObj = this->metaObject();
QMetaEnum networkStates = metaObj->enumerator(metaObj->indexOfEnumerator("NetworkState"));
@@ -356,7 +356,7 @@ MediaPlayer::NetworkState MediaPlayerPrivate::networkState() const
return m_networkState;
}
-MediaPlayer::ReadyState MediaPlayerPrivate::readyState() const
+MediaPlayer::ReadyState MediaPlayerPrivatePhonon::readyState() const
{
const QMetaObject* metaObj = this->metaObject();
QMetaEnum readyStates = metaObj->enumerator(metaObj->indexOfEnumerator("ReadyState"));
@@ -364,7 +364,7 @@ MediaPlayer::ReadyState MediaPlayerPrivate::readyState() const
return m_readyState;
}
-void MediaPlayerPrivate::updateStates()
+void MediaPlayerPrivatePhonon::updateStates()
{
MediaPlayer::NetworkState oldNetworkState = m_networkState;
MediaPlayer::ReadyState oldReadyState = m_readyState;
@@ -412,7 +412,7 @@ void MediaPlayerPrivate::updateStates()
}
}
-void MediaPlayerPrivate::setVisible(bool visible)
+void MediaPlayerPrivatePhonon::setVisible(bool visible)
{
m_isVisible = visible;
LOG(Media, "MediaPlayerPrivatePhonon::setVisible(%s)", visible ? "true" : "false");
@@ -420,7 +420,7 @@ void MediaPlayerPrivate::setVisible(bool visible)
m_videoWidget->setVisible(m_isVisible);
}
-void MediaPlayerPrivate::setSize(const IntSize& newSize)
+void MediaPlayerPrivatePhonon::setSize(const IntSize& newSize)
{
if (!m_videoWidget)
return;
@@ -434,7 +434,7 @@ void MediaPlayerPrivate::setSize(const IntSize& newSize)
m_videoWidget->resize(newSize.width(), newSize.height());
}
-IntSize MediaPlayerPrivate::naturalSize() const
+IntSize MediaPlayerPrivatePhonon::naturalSize() const
{
if (!hasVideo()) {
LOG(Media, "MediaPlayerPrivatePhonon::naturalSize() -> %dx%d",
@@ -455,7 +455,7 @@ IntSize MediaPlayerPrivate::naturalSize() const
return naturalSize;
}
-bool MediaPlayerPrivate::eventFilter(QObject* obj, QEvent* event)
+bool MediaPlayerPrivatePhonon::eventFilter(QObject* obj, QEvent* event)
{
if (event->type() == QEvent::UpdateRequest)
m_player->repaint();
@@ -463,7 +463,7 @@ bool MediaPlayerPrivate::eventFilter(QObject* obj, QEvent* event)
return QObject::eventFilter(obj, event);
}
-void MediaPlayerPrivate::paint(GraphicsContext* graphicsContect, const IntRect& rect)
+void MediaPlayerPrivatePhonon::paint(GraphicsContext* graphicsContect, const IntRect& rect)
{
if (graphicsContect->paintingDisabled())
return;
@@ -481,7 +481,7 @@ void MediaPlayerPrivate::paint(GraphicsContext* graphicsContect, const IntRect&
// ====================== Phonon::MediaObject signals ======================
-void MediaPlayerPrivate::stateChanged(Phonon::State newState, Phonon::State oldState)
+void MediaPlayerPrivatePhonon::stateChanged(Phonon::State newState, Phonon::State oldState)
{
const QMetaObject* metaObj = this->metaObject();
QMetaEnum phononStates = metaObj->enumerator(metaObj->indexOfEnumerator("PhononState"));
@@ -491,48 +491,48 @@ void MediaPlayerPrivate::stateChanged(Phonon::State newState, Phonon::State oldS
updateStates();
}
-void MediaPlayerPrivate::metaDataChanged()
+void MediaPlayerPrivatePhonon::metaDataChanged()
{
LOG(Media, "MediaPlayerPrivatePhonon::metaDataChanged()");
LOG_MEDIAOBJECT();
}
-void MediaPlayerPrivate::seekableChanged(bool)
+void MediaPlayerPrivatePhonon::seekableChanged(bool)
{
notImplemented();
LOG_MEDIAOBJECT();
}
-void MediaPlayerPrivate::hasVideoChanged(bool hasVideo)
+void MediaPlayerPrivatePhonon::hasVideoChanged(bool hasVideo)
{
LOG(Media, "MediaPlayerPrivatePhonon::hasVideoChanged(%s)", hasVideo ? "true" : "false");
}
-void MediaPlayerPrivate::bufferStatus(int)
+void MediaPlayerPrivatePhonon::bufferStatus(int)
{
notImplemented();
LOG_MEDIAOBJECT();
}
-void MediaPlayerPrivate::finished()
+void MediaPlayerPrivatePhonon::finished()
{
notImplemented();
LOG_MEDIAOBJECT();
}
-void MediaPlayerPrivate::currentSourceChanged(const Phonon::MediaSource&)
+void MediaPlayerPrivatePhonon::currentSourceChanged(const Phonon::MediaSource&)
{
notImplemented();
LOG_MEDIAOBJECT();
}
-void MediaPlayerPrivate::aboutToFinish()
+void MediaPlayerPrivatePhonon::aboutToFinish()
{
notImplemented();
LOG_MEDIAOBJECT();
}
-void MediaPlayerPrivate::totalTimeChanged(qint64 totalTime)
+void MediaPlayerPrivatePhonon::totalTimeChanged(qint64 totalTime)
{
#if OS(WINDOWS)
LOG(Media, "MediaPlayerPrivatePhonon::totalTimeChanged(%I64d)", totalTime);
diff --git a/WebCore/platform/graphics/qt/MediaPlayerPrivatePhonon.h b/WebCore/platform/graphics/qt/MediaPlayerPrivatePhonon.h
index ff6a01c..d793675 100644
--- a/WebCore/platform/graphics/qt/MediaPlayerPrivatePhonon.h
+++ b/WebCore/platform/graphics/qt/MediaPlayerPrivatePhonon.h
@@ -40,13 +40,13 @@ QT_END_NAMESPACE
namespace WebCore {
- class MediaPlayerPrivate : public QObject, public MediaPlayerPrivateInterface {
+ class MediaPlayerPrivatePhonon : public QObject, public MediaPlayerPrivateInterface {
Q_OBJECT
public:
static void registerMediaEngine(MediaEngineRegistrar);
- ~MediaPlayerPrivate();
+ ~MediaPlayerPrivatePhonon();
// These enums are used for debugging
Q_ENUMS(ReadyState NetworkState PhononState)
@@ -127,7 +127,7 @@ namespace WebCore {
void totalTimeChanged(qint64);
private:
- MediaPlayerPrivate(MediaPlayer*);
+ MediaPlayerPrivatePhonon(MediaPlayer*);
static MediaPlayerPrivateInterface* create(MediaPlayer* player);
static void getSupportedTypes(HashSet<String>&);
diff --git a/WebCore/platform/graphics/qt/MediaPlayerPrivateQt.cpp b/WebCore/platform/graphics/qt/MediaPlayerPrivateQt.cpp
index 1bf1a3d..1a31d1e 100644
--- a/WebCore/platform/graphics/qt/MediaPlayerPrivateQt.cpp
+++ b/WebCore/platform/graphics/qt/MediaPlayerPrivateQt.cpp
@@ -53,17 +53,17 @@ using namespace WTF;
namespace WebCore {
-MediaPlayerPrivateInterface* MediaPlayerPrivate::create(MediaPlayer* player)
+MediaPlayerPrivateInterface* MediaPlayerPrivateQt::create(MediaPlayer* player)
{
- return new MediaPlayerPrivate(player);
+ return new MediaPlayerPrivateQt(player);
}
-void MediaPlayerPrivate::registerMediaEngine(MediaEngineRegistrar registrar)
+void MediaPlayerPrivateQt::registerMediaEngine(MediaEngineRegistrar registrar)
{
registrar(create, getSupportedTypes, supportsType);
}
-void MediaPlayerPrivate::getSupportedTypes(HashSet<String> &supported)
+void MediaPlayerPrivateQt::getSupportedTypes(HashSet<String> &supported)
{
QStringList types = QMediaPlayer::supportedMimeTypes();
@@ -74,7 +74,7 @@ void MediaPlayerPrivate::getSupportedTypes(HashSet<String> &supported)
}
}
-MediaPlayer::SupportsType MediaPlayerPrivate::supportsType(const String& mime, const String& codec)
+MediaPlayer::SupportsType MediaPlayerPrivateQt::supportsType(const String& mime, const String& codec)
{
if (!mime.startsWith("audio/") && !mime.startsWith("video/"))
return MediaPlayer::IsNotSupported;
@@ -85,8 +85,8 @@ MediaPlayer::SupportsType MediaPlayerPrivate::supportsType(const String& mime, c
return MediaPlayer::MayBeSupported;
}
-MediaPlayerPrivate::MediaPlayerPrivate(MediaPlayer* player)
- : m_player(player)
+MediaPlayerPrivateQt::MediaPlayerPrivateQt(MediaPlayer* player)
+ : m_webCorePlayer(player)
, m_mediaPlayer(new QMediaPlayer)
, m_mediaPlayerControl(0)
, m_videoItem(new QGraphicsVideoItem)
@@ -132,23 +132,23 @@ MediaPlayerPrivate::MediaPlayerPrivate(MediaPlayer* player)
}
}
-MediaPlayerPrivate::~MediaPlayerPrivate()
+MediaPlayerPrivateQt::~MediaPlayerPrivateQt()
{
delete m_mediaPlayer;
delete m_videoScene;
}
-bool MediaPlayerPrivate::hasVideo() const
+bool MediaPlayerPrivateQt::hasVideo() const
{
return m_mediaPlayer->isVideoAvailable();
}
-bool MediaPlayerPrivate::hasAudio() const
+bool MediaPlayerPrivateQt::hasAudio() const
{
return true;
}
-void MediaPlayerPrivate::load(const String& url)
+void MediaPlayerPrivateQt::load(const String& url)
{
m_mediaUrl = url;
@@ -162,25 +162,25 @@ void MediaPlayerPrivate::load(const String& url)
commitLoad(url);
}
-void MediaPlayerPrivate::commitLoad(const String& url)
+void MediaPlayerPrivateQt::commitLoad(const String& url)
{
// We are now loading
if (m_networkState != MediaPlayer::Loading) {
m_networkState = MediaPlayer::Loading;
- m_player->networkStateChanged();
+ m_webCorePlayer->networkStateChanged();
}
// And we don't have any data yet
if (m_readyState != MediaPlayer::HaveNothing) {
m_readyState = MediaPlayer::HaveNothing;
- m_player->readyStateChanged();
+ m_webCorePlayer->readyStateChanged();
}
const QUrl rUrl = QUrl(QString(url));
const QString scheme = rUrl.scheme().toLower();
// Grab the client media element
- HTMLMediaElement* element = static_cast<HTMLMediaElement*>(m_player->mediaPlayerClient());
+ HTMLMediaElement* element = static_cast<HTMLMediaElement*>(m_webCorePlayer->mediaPlayerClient());
// Construct the media content with a network request if the resource is http[s]
if (scheme == "http" || scheme == "https") {
@@ -236,7 +236,7 @@ void MediaPlayerPrivate::commitLoad(const String& url)
m_mediaPlayer->play();
}
-void MediaPlayerPrivate::resumeLoad()
+void MediaPlayerPrivateQt::resumeLoad()
{
m_delayingLoad = false;
@@ -244,36 +244,36 @@ void MediaPlayerPrivate::resumeLoad()
commitLoad(m_mediaUrl);
}
-void MediaPlayerPrivate::cancelLoad()
+void MediaPlayerPrivateQt::cancelLoad()
{
m_mediaPlayer->setMedia(QMediaContent());
updateStates();
}
-void MediaPlayerPrivate::prepareToPlay()
+void MediaPlayerPrivateQt::prepareToPlay()
{
if (m_mediaPlayer->media().isNull() || m_delayingLoad)
resumeLoad();
}
-void MediaPlayerPrivate::play()
+void MediaPlayerPrivateQt::play()
{
if (m_mediaPlayer->state() != QMediaPlayer::PlayingState)
m_mediaPlayer->play();
}
-void MediaPlayerPrivate::pause()
+void MediaPlayerPrivateQt::pause()
{
if (m_mediaPlayer->state() == QMediaPlayer::PlayingState)
m_mediaPlayer->pause();
}
-bool MediaPlayerPrivate::paused() const
+bool MediaPlayerPrivateQt::paused() const
{
return (m_mediaPlayer->state() != QMediaPlayer::PlayingState);
}
-void MediaPlayerPrivate::seek(float position)
+void MediaPlayerPrivateQt::seek(float position)
{
if (!m_mediaPlayer->isSeekable())
return;
@@ -309,12 +309,12 @@ void MediaPlayerPrivate::seek(float position)
}
}
-bool MediaPlayerPrivate::seeking() const
+bool MediaPlayerPrivateQt::seeking() const
{
return m_isSeeking;
}
-float MediaPlayerPrivate::duration() const
+float MediaPlayerPrivateQt::duration() const
{
if (m_readyState < MediaPlayer::HaveMetadata)
return 0.0f;
@@ -328,13 +328,13 @@ float MediaPlayerPrivate::duration() const
return duration;
}
-float MediaPlayerPrivate::currentTime() const
+float MediaPlayerPrivateQt::currentTime() const
{
float currentTime = m_mediaPlayer->position() / 1000.0f;
return currentTime;
}
-PassRefPtr<TimeRanges> MediaPlayerPrivate::buffered() const
+PassRefPtr<TimeRanges> MediaPlayerPrivateQt::buffered() const
{
RefPtr<TimeRanges> buffered = TimeRanges::create();
@@ -352,7 +352,7 @@ PassRefPtr<TimeRanges> MediaPlayerPrivate::buffered() const
return buffered.release();
}
-float MediaPlayerPrivate::maxTimeSeekable() const
+float MediaPlayerPrivateQt::maxTimeSeekable() const
{
if (!m_mediaPlayerControl)
return 0;
@@ -360,7 +360,7 @@ float MediaPlayerPrivate::maxTimeSeekable() const
return static_cast<float>(m_mediaPlayerControl->availablePlaybackRanges().latestTime()) / 1000.0f;
}
-unsigned MediaPlayerPrivate::bytesLoaded() const
+unsigned MediaPlayerPrivateQt::bytesLoaded() const
{
QLatin1String bytesLoadedKey("bytes-loaded");
if (m_mediaPlayer->availableExtendedMetaData().contains(bytesLoadedKey))
@@ -369,7 +369,7 @@ unsigned MediaPlayerPrivate::bytesLoaded() const
return m_mediaPlayer->bufferStatus();
}
-unsigned MediaPlayerPrivate::totalBytes() const
+unsigned MediaPlayerPrivateQt::totalBytes() const
{
if (m_mediaPlayer->availableMetaData().contains(QtMultimediaKit::Size))
return m_mediaPlayer->metaData(QtMultimediaKit::Size).toInt();
@@ -377,59 +377,59 @@ unsigned MediaPlayerPrivate::totalBytes() const
return 100;
}
-void MediaPlayerPrivate::setPreload(MediaPlayer::Preload preload)
+void MediaPlayerPrivateQt::setPreload(MediaPlayer::Preload preload)
{
m_preload = preload;
if (m_delayingLoad && m_preload != MediaPlayer::None)
resumeLoad();
}
-void MediaPlayerPrivate::setRate(float rate)
+void MediaPlayerPrivateQt::setRate(float rate)
{
m_mediaPlayer->setPlaybackRate(rate);
}
-void MediaPlayerPrivate::setVolume(float volume)
+void MediaPlayerPrivateQt::setVolume(float volume)
{
m_mediaPlayer->setVolume(static_cast<int>(volume * 100.0));
}
-bool MediaPlayerPrivate::supportsMuting() const
+bool MediaPlayerPrivateQt::supportsMuting() const
{
return true;
}
-void MediaPlayerPrivate::setMuted(bool muted)
+void MediaPlayerPrivateQt::setMuted(bool muted)
{
m_mediaPlayer->setMuted(muted);
}
-MediaPlayer::NetworkState MediaPlayerPrivate::networkState() const
+MediaPlayer::NetworkState MediaPlayerPrivateQt::networkState() const
{
return m_networkState;
}
-MediaPlayer::ReadyState MediaPlayerPrivate::readyState() const
+MediaPlayer::ReadyState MediaPlayerPrivateQt::readyState() const
{
return m_readyState;
}
-void MediaPlayerPrivate::setVisible(bool visible)
+void MediaPlayerPrivateQt::setVisible(bool visible)
{
m_isVisible = visible;
}
-void MediaPlayerPrivate::mediaStatusChanged(QMediaPlayer::MediaStatus)
+void MediaPlayerPrivateQt::mediaStatusChanged(QMediaPlayer::MediaStatus)
{
updateStates();
}
-void MediaPlayerPrivate::handleError(QMediaPlayer::Error)
+void MediaPlayerPrivateQt::handleError(QMediaPlayer::Error)
{
updateStates();
}
-void MediaPlayerPrivate::stateChanged(QMediaPlayer::State state)
+void MediaPlayerPrivateQt::stateChanged(QMediaPlayer::State state)
{
if (state != QMediaPlayer::PlayingState && m_isSeeking && m_queuedSeek >= 0) {
m_mediaPlayer->setPosition(m_queuedSeek);
@@ -437,12 +437,12 @@ void MediaPlayerPrivate::stateChanged(QMediaPlayer::State state)
}
}
-void MediaPlayerPrivate::nativeSizeChanged(const QSizeF&)
+void MediaPlayerPrivateQt::nativeSizeChanged(const QSizeF&)
{
- m_player->sizeChanged();
+ m_webCorePlayer->sizeChanged();
}
-void MediaPlayerPrivate::queuedSeekTimeout()
+void MediaPlayerPrivateQt::queuedSeekTimeout()
{
// If we haven't heard anything, assume the player is now paused
// and we can attempt the seek
@@ -455,45 +455,45 @@ void MediaPlayerPrivate::queuedSeekTimeout()
}
}
-void MediaPlayerPrivate::seekTimeout()
+void MediaPlayerPrivateQt::seekTimeout()
{
// If we haven't heard anything, assume the seek succeeded
if (m_isSeeking) {
- m_player->timeChanged();
+ m_webCorePlayer->timeChanged();
m_isSeeking = false;
}
}
-void MediaPlayerPrivate::positionChanged(qint64)
+void MediaPlayerPrivateQt::positionChanged(qint64)
{
// Only propogate this event if we are seeking
if (m_isSeeking && m_queuedSeek == -1) {
- m_player->timeChanged();
+ m_webCorePlayer->timeChanged();
m_isSeeking = false;
}
}
-void MediaPlayerPrivate::bufferStatusChanged(int)
+void MediaPlayerPrivateQt::bufferStatusChanged(int)
{
notImplemented();
}
-void MediaPlayerPrivate::durationChanged(qint64)
+void MediaPlayerPrivateQt::durationChanged(qint64)
{
- m_player->durationChanged();
+ m_webCorePlayer->durationChanged();
}
-void MediaPlayerPrivate::volumeChanged(int volume)
+void MediaPlayerPrivateQt::volumeChanged(int volume)
{
- m_player->volumeChanged(static_cast<float>(volume) / 100.0);
+ m_webCorePlayer->volumeChanged(static_cast<float>(volume) / 100.0);
}
-void MediaPlayerPrivate::mutedChanged(bool muted)
+void MediaPlayerPrivateQt::mutedChanged(bool muted)
{
- m_player->muteChanged(muted);
+ m_webCorePlayer->muteChanged(muted);
}
-void MediaPlayerPrivate::updateStates()
+void MediaPlayerPrivateQt::updateStates()
{
// Store the old states so that we can detect a change and raise change events
MediaPlayer::NetworkState oldNetworkState = m_networkState;
@@ -538,13 +538,13 @@ void MediaPlayerPrivate::updateStates()
// Breaking this invariant will cause the resource selection algorithm for multiple
// sources to fail.
if (m_readyState != oldReadyState)
- m_player->readyStateChanged();
+ m_webCorePlayer->readyStateChanged();
if (m_networkState != oldNetworkState)
- m_player->networkStateChanged();
+ m_webCorePlayer->networkStateChanged();
}
-void MediaPlayerPrivate::setSize(const IntSize& size)
+void MediaPlayerPrivateQt::setSize(const IntSize& size)
{
if (size == m_currentSize)
return;
@@ -553,7 +553,7 @@ void MediaPlayerPrivate::setSize(const IntSize& size)
m_videoItem->setSize(QSizeF(QSize(size)));
}
-IntSize MediaPlayerPrivate::naturalSize() const
+IntSize MediaPlayerPrivateQt::naturalSize() const
{
if (!hasVideo() || m_readyState < MediaPlayer::HaveMetadata)
return IntSize();
@@ -561,7 +561,7 @@ IntSize MediaPlayerPrivate::naturalSize() const
return IntSize(m_videoItem->nativeSize().toSize());
}
-void MediaPlayerPrivate::paint(GraphicsContext* context, const IntRect& rect)
+void MediaPlayerPrivateQt::paint(GraphicsContext* context, const IntRect& rect)
{
#if USE(ACCELERATED_COMPOSITING)
if (m_composited)
@@ -580,15 +580,16 @@ void MediaPlayerPrivate::paint(GraphicsContext* context, const IntRect& rect)
m_videoScene->render(painter, QRectF(QRect(rect)), m_videoItem->sceneBoundingRect());
}
-void MediaPlayerPrivate::repaint()
+void MediaPlayerPrivateQt::repaint()
{
- m_player->repaint();
+ m_webCorePlayer->repaint();
}
#if USE(ACCELERATED_COMPOSITING)
-void MediaPlayerPrivate::acceleratedRenderingStateChanged()
+void MediaPlayerPrivateQt::acceleratedRenderingStateChanged()
{
- bool composited = m_player->mediaPlayerClient()->mediaPlayerRenderingCanBeAccelerated(m_player);
+ MediaPlayerClient* client = m_webCorePlayer->mediaPlayerClient();
+ bool composited = client->mediaPlayerRenderingCanBeAccelerated(m_webCorePlayer);
if (composited == m_composited)
return;
@@ -599,17 +600,17 @@ void MediaPlayerPrivate::acceleratedRenderingStateChanged()
m_videoScene->addItem(m_videoItem);
}
-PlatformLayer* MediaPlayerPrivate::platformLayer() const
+PlatformLayer* MediaPlayerPrivateQt::platformLayer() const
{
return m_composited ? m_videoItem : 0;
}
#endif
-PlatformMedia MediaPlayerPrivate::platformMedia() const
+PlatformMedia MediaPlayerPrivateQt::platformMedia() const
{
PlatformMedia pm;
pm.type = PlatformMedia::QtMediaPlayerType;
- pm.media.qtMediaPlayer = const_cast<MediaPlayerPrivate*>(this);
+ pm.media.qtMediaPlayer = const_cast<MediaPlayerPrivateQt*>(this);
return pm;
}
diff --git a/WebCore/platform/graphics/qt/MediaPlayerPrivateQt.h b/WebCore/platform/graphics/qt/MediaPlayerPrivateQt.h
index 117187d..179bf2a 100644
--- a/WebCore/platform/graphics/qt/MediaPlayerPrivateQt.h
+++ b/WebCore/platform/graphics/qt/MediaPlayerPrivateQt.h
@@ -33,13 +33,13 @@ QT_END_NAMESPACE
namespace WebCore {
-class MediaPlayerPrivate : public QObject, public MediaPlayerPrivateInterface {
+class MediaPlayerPrivateQt : public QObject, public MediaPlayerPrivateInterface {
Q_OBJECT
public:
static MediaPlayerPrivateInterface* create(MediaPlayer* player);
- ~MediaPlayerPrivate();
+ ~MediaPlayerPrivateQt();
static void registerMediaEngine(MediaEngineRegistrar);
static void getSupportedTypes(HashSet<String>&);
@@ -118,9 +118,9 @@ private:
void updateStates();
private:
- MediaPlayerPrivate(MediaPlayer*);
+ MediaPlayerPrivateQt(MediaPlayer*);
- MediaPlayer* m_player;
+ MediaPlayer* m_webCorePlayer;
QMediaPlayer* m_mediaPlayer;
QMediaPlayerControl* m_mediaPlayerControl;
QGraphicsVideoItem* m_videoItem;
diff --git a/WebCore/platform/graphics/skia/FontCustomPlatformData.cpp b/WebCore/platform/graphics/skia/FontCustomPlatformData.cpp
index b6d6e65..8301871 100644
--- a/WebCore/platform/graphics/skia/FontCustomPlatformData.cpp
+++ b/WebCore/platform/graphics/skia/FontCustomPlatformData.cpp
@@ -36,7 +36,7 @@
#include "Base64.h"
#include "ChromiumBridge.h"
#include "OpenTypeUtilities.h"
-#elif OS(LINUX)
+#elif OS(LINUX) || OS(FREEBSD)
#include "SkStream.h"
#endif
@@ -47,7 +47,7 @@
#if OS(WINDOWS)
#include <objbase.h>
-#elif OS(LINUX)
+#elif OS(LINUX) || OS(FREEBSD)
#include <cstring>
#endif
@@ -58,7 +58,7 @@ FontCustomPlatformData::~FontCustomPlatformData()
#if OS(WINDOWS)
if (m_fontReference)
RemoveFontMemResourceEx(m_fontReference);
-#elif OS(LINUX)
+#elif OS(LINUX) || OS(FREEBSD)
if (m_fontReference)
m_fontReference->unref();
#endif
@@ -99,7 +99,7 @@ FontPlatformData FontCustomPlatformData::fontPlatformData(int size, bool bold, b
HFONT hfont = CreateFontIndirect(&logFont);
return FontPlatformData(hfont, size);
-#elif OS(LINUX)
+#elif OS(LINUX) || OS(FREEBSD)
ASSERT(m_fontReference);
return FontPlatformData(m_fontReference, "", size, bold && !m_fontReference->isBold(), italic && !m_fontReference->isItalic());
#else
@@ -123,7 +123,7 @@ static String createUniqueFontName()
}
#endif
-#if OS(LINUX)
+#if OS(LINUX) || OS(FREEBSD)
class RemoteFontStream : public SkStream {
public:
explicit RemoteFontStream(PassRefPtr<SharedBuffer> buffer)
@@ -189,7 +189,7 @@ FontCustomPlatformData* createFontCustomPlatformData(SharedBuffer* buffer)
if (!fontReference)
return 0;
return new FontCustomPlatformData(fontReference, fontName);
-#elif OS(LINUX)
+#elif OS(LINUX) || OS(FREEBSD)
RemoteFontStream* stream = new RemoteFontStream(buffer);
SkTypeface* typeface = SkTypeface::CreateFromStream(stream);
if (!typeface)
diff --git a/WebCore/platform/graphics/skia/FontCustomPlatformData.h b/WebCore/platform/graphics/skia/FontCustomPlatformData.h
index d451c9c..94d7ec3 100644
--- a/WebCore/platform/graphics/skia/FontCustomPlatformData.h
+++ b/WebCore/platform/graphics/skia/FontCustomPlatformData.h
@@ -39,7 +39,7 @@
#if OS(WINDOWS)
#include "PlatformString.h"
#include <windows.h>
-#elif OS(LINUX)
+#elif OS(LINUX) || OS(FREEBSD)
#include "SkTypeface.h"
#endif
@@ -54,7 +54,7 @@ struct FontCustomPlatformData : Noncopyable {
: m_fontReference(fontReference)
, m_name(name)
{}
-#elif OS(LINUX)
+#elif OS(LINUX) || OS(FREEBSD)
explicit FontCustomPlatformData(SkTypeface* typeface)
: m_fontReference(typeface)
{}
@@ -70,7 +70,7 @@ struct FontCustomPlatformData : Noncopyable {
#if OS(WINDOWS)
HANDLE m_fontReference;
String m_name;
-#elif OS(LINUX)
+#elif OS(LINUX) || OS(FREEBSD)
SkTypeface* m_fontReference;
#endif
};
diff --git a/WebCore/platform/graphics/skia/GradientSkia.cpp b/WebCore/platform/graphics/skia/GradientSkia.cpp
index 66a8976..a636d10 100644
--- a/WebCore/platform/graphics/skia/GradientSkia.cpp
+++ b/WebCore/platform/graphics/skia/GradientSkia.cpp
@@ -42,7 +42,7 @@ namespace WebCore {
void Gradient::platformDestroy()
{
if (m_gradient)
- m_gradient->safeUnref();
+ SkSafeUnref(m_gradient);
m_gradient = 0;
}
diff --git a/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp b/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp
index d618c19..4bc98fb 100644
--- a/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp
+++ b/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp
@@ -338,13 +338,15 @@ void GraphicsContext::clearRect(const FloatRect& rect)
if (paintingDisabled())
return;
- if (platformContext()->useGPU()) {
+ if (platformContext()->useGPU() && !platformContext()->canvasClipApplied()) {
platformContext()->prepareForHardwareDraw();
platformContext()->gpuCanvas()->clearRect(rect);
return;
}
- platformContext()->prepareForSoftwareDraw();
+ // Force a readback here (if we're using the GPU), since clearRect() is
+ // incompatible with mixed-mode rendering.
+ platformContext()->syncSoftwareCanvas();
SkRect r = rect;
if (!isRectSkiaSafe(getCTM(), r))
diff --git a/WebCore/platform/graphics/skia/ImageSkia.cpp b/WebCore/platform/graphics/skia/ImageSkia.cpp
index 0b96d80..e123256 100644
--- a/WebCore/platform/graphics/skia/ImageSkia.cpp
+++ b/WebCore/platform/graphics/skia/ImageSkia.cpp
@@ -36,7 +36,6 @@
#include "FloatConversion.h"
#include "FloatRect.h"
#include "GLES2Canvas.h"
-#include "GLES2Context.h"
#include "GraphicsContext.h"
#include "Logging.h"
#include "NativeImageSkia.h"
@@ -144,7 +143,9 @@ static ResamplingMode computeResamplingMode(PlatformContextSkia* platformContext
// Everything else gets resampled.
// If the platform context permits high quality interpolation, use it.
- if (platformContext->interpolationQuality() == InterpolationHigh)
+ // High quality interpolation only enabled for scaling and translation.
+ if (platformContext->interpolationQuality() == InterpolationHigh
+ && !(platformContext->canvas()->getTotalMatrix().getType() & (SkMatrix::kAffine_Mask | SkMatrix::kPerspective_Mask)))
return RESAMPLE_AWESOME;
return RESAMPLE_LINEAR;
@@ -174,8 +175,12 @@ static void drawResampledBitmap(SkCanvas& canvas, SkPaint& paint, const NativeIm
&& srcIRect.height() == bitmap.height();
// We will always draw in integer sizes, so round the destination rect.
+ // First we need to apply canvas transformation matrix to get desired size of
+ // resampled image.
+ SkRect destRectTransformed;
+ canvas.getTotalMatrix().mapRect(&destRectTransformed, destRect);
SkIRect destRectRounded;
- destRect.round(&destRectRounded);
+ destRectTransformed.round(&destRectRounded);
SkIRect resizedImageRect = // Represents the size of the resized image.
{ 0, 0, destRectRounded.width(), destRectRounded.height() };
@@ -189,7 +194,10 @@ static void drawResampledBitmap(SkCanvas& canvas, SkPaint& paint, const NativeIm
// Compute the visible portion of our rect.
SkRect destBitmapSubsetSk;
ClipRectToCanvas(canvas, destRect, &destBitmapSubsetSk);
- destBitmapSubsetSk.offset(-destRect.fLeft, -destRect.fTop);
+ // Determine size of resampled image based on clipped destination rect.
+ SkRect destBitmapSubsetSkTransformed;
+ canvas.getTotalMatrix().mapRect(&destBitmapSubsetSkTransformed, destBitmapSubsetSk);
+ destBitmapSubsetSkTransformed.offset(-destBitmapSubsetSkTransformed.fLeft, -destBitmapSubsetSkTransformed.fTop);
// The matrix inverting, etc. could have introduced rounding error which
// causes the bounds to be outside of the resized bitmap. We round outward
@@ -197,7 +205,7 @@ static void drawResampledBitmap(SkCanvas& canvas, SkPaint& paint, const NativeIm
// need, and then clamp to the bitmap bounds so we don't get any invalid
// data.
SkIRect destBitmapSubsetSkI;
- destBitmapSubsetSk.roundOut(&destBitmapSubsetSkI);
+ destBitmapSubsetSkTransformed.roundOut(&destBitmapSubsetSkI);
if (!destBitmapSubsetSkI.intersect(resizedImageRect))
return; // Resized image does not intersect.
diff --git a/WebCore/platform/graphics/skia/PatternSkia.cpp b/WebCore/platform/graphics/skia/PatternSkia.cpp
index bd27b6a..72fac77 100644
--- a/WebCore/platform/graphics/skia/PatternSkia.cpp
+++ b/WebCore/platform/graphics/skia/PatternSkia.cpp
@@ -42,7 +42,7 @@ namespace WebCore {
void Pattern::platformDestroy()
{
- m_pattern->safeUnref();
+ SkSafeUnref(m_pattern);
m_pattern = 0;
}
diff --git a/WebCore/platform/graphics/skia/PlatformContextSkia.cpp b/WebCore/platform/graphics/skia/PlatformContextSkia.cpp
index 88fbcdd..b469312 100644
--- a/WebCore/platform/graphics/skia/PlatformContextSkia.cpp
+++ b/WebCore/platform/graphics/skia/PlatformContextSkia.cpp
@@ -162,19 +162,19 @@ PlatformContextSkia::State::State(const State& other)
, m_interpolationQuality(other.m_interpolationQuality)
, m_canvasClipApplied(other.m_canvasClipApplied)
{
- // Up the ref count of these. saveRef does nothing if 'this' is NULL.
- m_looper->safeRef();
- m_dash->safeRef();
- m_fillShader->safeRef();
- m_strokeShader->safeRef();
+ // Up the ref count of these. SkSafeRef does nothing if its argument is 0.
+ SkSafeRef(m_looper);
+ SkSafeRef(m_dash);
+ SkSafeRef(m_fillShader);
+ SkSafeRef(m_strokeShader);
}
PlatformContextSkia::State::~State()
{
- m_looper->safeUnref();
- m_dash->safeUnref();
- m_fillShader->safeUnref();
- m_strokeShader->safeUnref();
+ SkSafeUnref(m_looper);
+ SkSafeUnref(m_dash);
+ SkSafeUnref(m_fillShader);
+ SkSafeUnref(m_strokeShader);
}
// Returns a new State with all of this object's inherited properties copied.
@@ -327,7 +327,7 @@ void PlatformContextSkia::drawRect(SkRect rect)
// setFillColor() will set the shader to NULL, so save a ref to it now.
SkShader* oldFillShader = m_state->m_fillShader;
- oldFillShader->safeRef();
+ SkSafeRef(oldFillShader);
setFillColor(m_state->m_strokeColor);
paint.reset();
setupPaintForFilling(&paint);
@@ -341,7 +341,7 @@ void PlatformContextSkia::drawRect(SkRect rect)
canvas()->drawRect(rightBorder, paint);
setFillColor(oldFillColor);
setFillShader(oldFillShader);
- oldFillShader->safeUnref();
+ SkSafeUnref(oldFillShader);
}
}
@@ -487,9 +487,9 @@ void PlatformContextSkia::setStrokeThickness(float thickness)
void PlatformContextSkia::setStrokeShader(SkShader* strokeShader)
{
if (strokeShader != m_state->m_strokeShader) {
- m_state->m_strokeShader->safeUnref();
+ SkSafeUnref(m_state->m_strokeShader);
m_state->m_strokeShader = strokeShader;
- m_state->m_strokeShader->safeRef();
+ SkSafeRef(m_state->m_strokeShader);
}
}
@@ -561,9 +561,9 @@ void PlatformContextSkia::setFillRule(SkPath::FillType fr)
void PlatformContextSkia::setFillShader(SkShader* fillShader)
{
if (fillShader != m_state->m_fillShader) {
- m_state->m_fillShader->safeUnref();
+ SkSafeUnref(m_state->m_fillShader);
m_state->m_fillShader = fillShader;
- m_state->m_fillShader->safeRef();
+ SkSafeRef(m_state->m_fillShader);
}
}
@@ -580,7 +580,7 @@ void PlatformContextSkia::setInterpolationQuality(InterpolationQuality interpola
void PlatformContextSkia::setDashPathEffect(SkDashPathEffect* dash)
{
if (dash != m_state->m_dash) {
- m_state->m_dash->safeUnref();
+ SkSafeUnref(m_state->m_dash);
m_state->m_dash = dash;
}
}
@@ -677,6 +677,11 @@ bool PlatformContextSkia::canAccelerate() const
&& !m_state->m_canvasClipApplied; // Can't accelerate with a clip to path applied.
}
+bool PlatformContextSkia::canvasClipApplied() const
+{
+ return m_state->m_canvasClipApplied;
+}
+
class WillPublishCallbackImpl : public DrawingBuffer::WillPublishCallback {
public:
static PassOwnPtr<WillPublishCallback> create(PlatformContextSkia* pcs)
@@ -840,7 +845,7 @@ void PlatformContextSkia::readbackHardwareToSoftware() const
for (int i = 0; i < width; ++i) {
uint32_t pixel = pixels[i];
// Swizzles from RGBA -> BGRA.
- pixels[i] = pixel & 0xFF00FF00 | ((pixel & 0x00FF0000) >> 16) | ((pixel & 0x000000FF) << 16);
+ pixels[i] = (pixel & 0xFF00FF00) | ((pixel & 0x00FF0000) >> 16) | ((pixel & 0x000000FF) << 16);
}
}
}
diff --git a/WebCore/platform/graphics/skia/PlatformContextSkia.h b/WebCore/platform/graphics/skia/PlatformContextSkia.h
index 4ba85d1..eb03224 100644
--- a/WebCore/platform/graphics/skia/PlatformContextSkia.h
+++ b/WebCore/platform/graphics/skia/PlatformContextSkia.h
@@ -180,6 +180,7 @@ public:
bool hasImageResamplingHint() const;
bool canAccelerate() const;
+ bool canvasClipApplied() const;
bool useGPU() { return m_useGPU; }
void setSharedGraphicsContext3D(SharedGraphicsContext3D*, DrawingBuffer*, const IntSize&);
GLES2Canvas* gpuCanvas() const { return m_gpuCanvas.get(); }
diff --git a/WebCore/platform/graphics/skia/SkiaFontWin.cpp b/WebCore/platform/graphics/skia/SkiaFontWin.cpp
index 9edb775..6acfd35 100644
--- a/WebCore/platform/graphics/skia/SkiaFontWin.cpp
+++ b/WebCore/platform/graphics/skia/SkiaFontWin.cpp
@@ -340,7 +340,7 @@ bool paintSkiaText(GraphicsContext* context,
// thing would be to draw to a new layer and then draw that layer
// with a shadow. But this is a lot of extra work for something
// that isn't normally an issue.
- paint.setLooper(0)->safeUnref();
+ SkSafeUnref(paint.setLooper(0));
}
if (!skiaDrawText(hfont, dc, platformContext->canvas(), *origin, &paint,
diff --git a/WebCore/platform/graphics/wince/PlatformPathWinCE.cpp b/WebCore/platform/graphics/wince/PlatformPathWinCE.cpp
index 4072a18..80e01a9 100644
--- a/WebCore/platform/graphics/wince/PlatformPathWinCE.cpp
+++ b/WebCore/platform/graphics/wince/PlatformPathWinCE.cpp
@@ -234,7 +234,6 @@ static void addArcPoints(PathPolygon& poly, const PlatformPathElement::ArcTo& da
static void drawPolygons(HDC dc, const Vector<PathPolygon>& polygons, bool fill, const AffineTransform* transformation)
{
- MemoryAllocationCanFail canFail;
for (Vector<PathPolygon>::const_iterator i = polygons.begin(); i != polygons.end(); ++i) {
int npoints = i->size();
if (!npoints)
diff --git a/WebCore/platform/gtk/ClipboardGtk.cpp b/WebCore/platform/gtk/ClipboardGtk.cpp
index 327f069..e7ee432 100644
--- a/WebCore/platform/gtk/ClipboardGtk.cpp
+++ b/WebCore/platform/gtk/ClipboardGtk.cpp
@@ -37,27 +37,27 @@
namespace WebCore {
-enum ClipboardType {
- ClipboardTypeText,
- ClipboardTypeMarkup,
- ClipboardTypeURIList,
- ClipboardTypeURL,
- ClipboardTypeImage,
- ClipboardTypeUnknown
+enum ClipboardDataType {
+ ClipboardDataTypeText,
+ ClipboardDataTypeMarkup,
+ ClipboardDataTypeURIList,
+ ClipboardDataTypeURL,
+ ClipboardDataTypeImage,
+ ClipboardDataTypeUnknown
};
PassRefPtr<Clipboard> Editor::newGeneralClipboard(ClipboardAccessPolicy policy, Frame* frame)
{
- return ClipboardGtk::create(policy, gtk_clipboard_get_for_display(gdk_display_get_default(), GDK_SELECTION_CLIPBOARD), false, frame);
+ return ClipboardGtk::create(policy, gtk_clipboard_get_for_display(gdk_display_get_default(), GDK_SELECTION_CLIPBOARD), frame);
}
PassRefPtr<Clipboard> Clipboard::create(ClipboardAccessPolicy policy, DragData* dragData, Frame* frame)
{
- return ClipboardGtk::create(policy, dragData->platformData(), true, frame);
+ return ClipboardGtk::create(policy, dragData->platformData(), DragAndDrop, frame);
}
ClipboardGtk::ClipboardGtk(ClipboardAccessPolicy policy, GtkClipboard* clipboard, Frame* frame)
- : Clipboard(policy, false)
+ : Clipboard(policy, CopyAndPaste)
, m_dataObject(DataObjectGtk::forClipboard(clipboard))
, m_clipboard(clipboard)
, m_helper(Pasteboard::generalPasteboard()->helper())
@@ -65,8 +65,8 @@ ClipboardGtk::ClipboardGtk(ClipboardAccessPolicy policy, GtkClipboard* clipboard
{
}
-ClipboardGtk::ClipboardGtk(ClipboardAccessPolicy policy, PassRefPtr<DataObjectGtk> dataObject, bool forDragging, Frame* frame)
- : Clipboard(policy, forDragging)
+ClipboardGtk::ClipboardGtk(ClipboardAccessPolicy policy, PassRefPtr<DataObjectGtk> dataObject, ClipboardType clipboardType, Frame* frame)
+ : Clipboard(policy, clipboardType)
, m_dataObject(dataObject)
, m_clipboard(0)
, m_helper(Pasteboard::generalPasteboard()->helper())
@@ -78,27 +78,27 @@ ClipboardGtk::~ClipboardGtk()
{
}
-static ClipboardType dataObjectTypeFromHTMLClipboardType(const String& rawType)
+static ClipboardDataType dataObjectTypeFromHTMLClipboardType(const String& rawType)
{
String type(rawType.stripWhiteSpace());
// Two special cases for IE compatibility
if (type == "Text")
- return ClipboardTypeText;
+ return ClipboardDataTypeText;
if (type == "URL")
- return ClipboardTypeURL;
+ return ClipboardDataTypeURL;
// From the Mac port: Ignore any trailing charset - JS strings are
// Unicode, which encapsulates the charset issue.
if (type == "text/plain" || type.startsWith("text/plain;"))
- return ClipboardTypeText;
+ return ClipboardDataTypeText;
if (type == "text/html" || type.startsWith("text/html;"))
- return ClipboardTypeMarkup;
+ return ClipboardDataTypeMarkup;
if (type == "Files" || type == "text/uri-list" || type.startsWith("text/uri-list;"))
- return ClipboardTypeURIList;
+ return ClipboardDataTypeURIList;
// Not a known type, so just default to using the text portion.
- return ClipboardTypeUnknown;
+ return ClipboardDataTypeUnknown;
}
void ClipboardGtk::clearData(const String& typeString)
@@ -106,19 +106,19 @@ void ClipboardGtk::clearData(const String& typeString)
if (policy() != ClipboardWritable)
return;
- ClipboardType type = dataObjectTypeFromHTMLClipboardType(typeString);
+ ClipboardDataType type = dataObjectTypeFromHTMLClipboardType(typeString);
switch (type) {
- case ClipboardTypeURIList:
- case ClipboardTypeURL:
+ case ClipboardDataTypeURIList:
+ case ClipboardDataTypeURL:
m_dataObject->clearURIList();
break;
- case ClipboardTypeMarkup:
+ case ClipboardDataTypeMarkup:
m_dataObject->clearMarkup();
break;
- case ClipboardTypeText:
+ case ClipboardDataTypeText:
m_dataObject->clearText();
break;
- case ClipboardTypeUnknown:
+ case ClipboardDataTypeUnknown:
default:
m_dataObject->clear();
}
@@ -162,29 +162,29 @@ String ClipboardGtk::getData(const String& typeString, bool& success) const
if (m_clipboard)
m_helper->getClipboardContents(m_clipboard);
- ClipboardType type = dataObjectTypeFromHTMLClipboardType(typeString);
- if (type == ClipboardTypeURIList) {
+ ClipboardDataType type = dataObjectTypeFromHTMLClipboardType(typeString);
+ if (type == ClipboardDataTypeURIList) {
if (!m_dataObject->hasURIList())
return String();
success = true;
return joinURIList(m_dataObject->uriList());
}
- if (type == ClipboardTypeURL) {
+ if (type == ClipboardDataTypeURL) {
if (!m_dataObject->hasURL())
return String();
success = true;
return m_dataObject->url();
}
- if (type == ClipboardTypeMarkup) {
+ if (type == ClipboardDataTypeMarkup) {
if (!m_dataObject->hasMarkup())
return String();
success = true;
return m_dataObject->markup();
}
- if (type == ClipboardTypeText) {
+ if (type == ClipboardDataTypeText) {
if (!m_dataObject->hasText())
return String();
success = true;
@@ -200,8 +200,8 @@ bool ClipboardGtk::setData(const String& typeString, const String& data)
return false;
bool success = false;
- ClipboardType type = dataObjectTypeFromHTMLClipboardType(typeString);
- if (type == ClipboardTypeURIList || type == ClipboardTypeURL) {
+ ClipboardDataType type = dataObjectTypeFromHTMLClipboardType(typeString);
+ if (type == ClipboardDataTypeURIList || type == ClipboardDataTypeURL) {
Vector<KURL> uriList;
gchar** uris = g_uri_list_extract_uris(data.utf8().data());
if (uris) {
@@ -214,10 +214,10 @@ bool ClipboardGtk::setData(const String& typeString, const String& data)
m_dataObject->setURIList(uriList);
success = true;
}
- } else if (type == ClipboardTypeMarkup) {
+ } else if (type == ClipboardDataTypeMarkup) {
m_dataObject->setMarkup(data);
success = true;
- } else if (type == ClipboardTypeText) {
+ } else if (type == ClipboardDataTypeText) {
m_dataObject->setText(data);
success = true;
}
diff --git a/WebCore/platform/gtk/ClipboardGtk.h b/WebCore/platform/gtk/ClipboardGtk.h
index f0af318..e14a583 100644
--- a/WebCore/platform/gtk/ClipboardGtk.h
+++ b/WebCore/platform/gtk/ClipboardGtk.h
@@ -40,14 +40,14 @@ namespace WebCore {
// Created from the EventHandlerGtk to be used by the dom
class ClipboardGtk : public Clipboard, public CachedResourceClient {
public:
- static PassRefPtr<ClipboardGtk> create(ClipboardAccessPolicy policy, GtkClipboard* clipboard, bool isForDragging, Frame* frame)
+ static PassRefPtr<ClipboardGtk> create(ClipboardAccessPolicy policy, GtkClipboard* clipboard, Frame* frame)
{
return adoptRef(new ClipboardGtk(policy, clipboard, frame));
}
- static PassRefPtr<ClipboardGtk> create(ClipboardAccessPolicy policy, PassRefPtr<DataObjectGtk> dataObject, bool isForDragging, Frame* frame)
+ static PassRefPtr<ClipboardGtk> create(ClipboardAccessPolicy policy, PassRefPtr<DataObjectGtk> dataObject, ClipboardType clipboardType, Frame* frame)
{
- return adoptRef(new ClipboardGtk(policy, dataObject, isForDragging, frame));
+ return adoptRef(new ClipboardGtk(policy, dataObject, clipboardType, frame));
}
virtual ~ClipboardGtk();
@@ -78,7 +78,7 @@ namespace WebCore {
private:
ClipboardGtk(ClipboardAccessPolicy, GtkClipboard*, Frame*);
- ClipboardGtk(ClipboardAccessPolicy, PassRefPtr<DataObjectGtk>, bool, Frame*);
+ ClipboardGtk(ClipboardAccessPolicy, PassRefPtr<DataObjectGtk>, ClipboardType, Frame*);
RefPtr<DataObjectGtk> m_dataObject;
GtkClipboard* m_clipboard;
diff --git a/WebCore/platform/gtk/ContextMenuItemGtk.cpp b/WebCore/platform/gtk/ContextMenuItemGtk.cpp
index e2c5b84..68d0a9a 100644
--- a/WebCore/platform/gtk/ContextMenuItemGtk.cpp
+++ b/WebCore/platform/gtk/ContextMenuItemGtk.cpp
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2007 Holger Hans Peter Freyther
+ * Copyright (C) 2010 Igalia S.L
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -33,11 +34,13 @@ static const char* gtkStockIDFromContextMenuAction(const ContextMenuAction& acti
switch (action) {
case ContextMenuItemTagCopyLinkToClipboard:
case ContextMenuItemTagCopyImageToClipboard:
+ case ContextMenuItemTagCopyMediaLinkToClipboard:
case ContextMenuItemTagCopy:
return GTK_STOCK_COPY;
case ContextMenuItemTagOpenLinkInNewWindow:
case ContextMenuItemTagOpenImageInNewWindow:
case ContextMenuItemTagOpenFrameInNewWindow:
+ case ContextMenuItemTagOpenMediaInNewWindow:
return GTK_STOCK_OPEN;
case ContextMenuItemTagDownloadLinkToDisk:
case ContextMenuItemTagDownloadImageToDisk:
@@ -59,7 +62,7 @@ static const char* gtkStockIDFromContextMenuAction(const ContextMenuAction& acti
case ContextMenuItemTagSelectAll:
return GTK_STOCK_SELECT_ALL;
case ContextMenuItemTagSpellingGuess:
- return NULL;
+ return 0;
case ContextMenuItemTagIgnoreSpelling:
return GTK_STOCK_NO;
case ContextMenuItemTagLearnSpelling:
@@ -99,8 +102,14 @@ static const char* gtkStockIDFromContextMenuAction(const ContextMenuAction& acti
return GTK_STOCK_UNDERLINE;
case ContextMenuItemTagShowColors:
return GTK_STOCK_SELECT_COLOR;
+ case ContextMenuItemTagToggleMediaControls:
+ case ContextMenuItemTagToggleMediaLoop:
+ // No icon for this.
+ return 0;
+ case ContextMenuItemTagEnterVideoFullscreen:
+ return GTK_STOCK_FULLSCREEN;
default:
- return NULL;
+ return 0;
}
}
diff --git a/WebCore/platform/gtk/GtkVersioning.c b/WebCore/platform/gtk/GtkVersioning.c
index 7dd601e..f5466be 100644
--- a/WebCore/platform/gtk/GtkVersioning.c
+++ b/WebCore/platform/gtk/GtkVersioning.c
@@ -60,10 +60,41 @@ GdkDevice *getDefaultGDKPointerDevice(GdkWindow* window)
}
#if !GTK_CHECK_VERSION(2, 17, 3)
-static void gdk_window_get_root_coords(GdkWindow* window, gint x, gint y, gint* rootX, gint* rootY)
+void gdk_window_get_root_coords(GdkWindow* window, gint x, gint y, gint* rootX, gint* rootY)
{
gdk_window_get_root_origin(window, rootX, rootY);
*rootX = *rootX + x;
*rootY = *rootY + y;
}
#endif
+
+GdkCursor * blankCursor()
+{
+#if GTK_CHECK_VERSION(2, 16, 0)
+ return gdk_cursor_new(GDK_BLANK_CURSOR);
+#else
+ GdkCursor * cursor;
+ GdkPixmap * source;
+ GdkPixmap * mask;
+ GdkColor foreground = { 0, 65535, 0, 0 }; // Red.
+ GdkColor background = { 0, 0, 0, 65535 }; // Blue.
+ static gchar cursorBits[] = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0};
+
+ source = gdk_bitmap_create_from_data(0, cursorBits, 8, 8);
+ mask = gdk_bitmap_create_from_data(0, cursorBits, 8, 8);
+ cursor = gdk_cursor_new_from_pixmap(source, mask, &foreground, &background, 8, 8);
+ gdk_pixmap_unref(source);
+ gdk_pixmap_unref(mask);
+ return cursor;
+#endif // GTK_CHECK_VERSION(2, 16, 0)
+}
+
+#if !GTK_CHECK_VERSION(2, 16, 0)
+const gchar* gtk_menu_item_get_label(GtkMenuItem* menuItem)
+{
+ GtkWidget * label = gtk_bin_get_child(GTK_BIN(menuItem));
+ if (GTK_IS_LABEL(label))
+ return gtk_label_get_text(GTK_LABEL(label));
+ return 0;
+}
+#endif // GTK_CHECK_VERSION(2, 16, 0)
diff --git a/WebCore/platform/gtk/GtkVersioning.h b/WebCore/platform/gtk/GtkVersioning.h
index 867e14f..a874e9e 100644
--- a/WebCore/platform/gtk/GtkVersioning.h
+++ b/WebCore/platform/gtk/GtkVersioning.h
@@ -57,6 +57,8 @@ G_BEGIN_DECLS
#if !GTK_CHECK_VERSION(2, 18, 0)
#define gtk_widget_set_visible(widget, FALSE) GTK_WIDGET_UNSET_FLAGS((widget), GTK_VISIBLE)
+#define gtk_widget_get_visible(widget) (GTK_WIDGET_FLAGS(widget) & GTK_VISIBLE)
+
#define gtk_widget_set_window(widget, new_window) (widget)->window = (new_window)
#define gtk_widget_set_can_focus(widget, TRUE) GTK_WIDGET_SET_FLAGS((widget), GTK_CAN_FOCUS)
#define gtk_widget_get_allocation(widget, alloc) (*(alloc) = (widget)->allocation)
@@ -64,8 +66,13 @@ G_BEGIN_DECLS
#endif // GTK_CHECK_VERSION(2, 18, 0)
#if !GTK_CHECK_VERSION(2, 17, 3)
-static void gdk_window_get_root_coords(GdkWindow* window, gint x, gint y, gint* rootX, gint* rootY);
-#endif //GTK_CHECK_VERSION(2, 17, 3)
+void gdk_window_get_root_coords(GdkWindow* window, gint x, gint y, gint* rootX, gint* rootY);
+#endif // GTK_CHECK_VERSION(2, 17, 3)
+
+#if !GTK_CHECK_VERSION(2, 16, 0)
+const gchar* gtk_menu_item_get_label(GtkMenuItem*);
+#endif // GTK_CHECK_VERSION(2, 16, 0)
+
#if !GTK_CHECK_VERSION(2, 14, 0)
#define gtk_widget_get_window(widget) (widget)->window
@@ -84,6 +91,7 @@ void gtk_adjustment_set_value(GtkAdjustment* adjusment, gdouble value);
#endif // GTK_CHECK_VERSION(2, 14, 0)
GdkDevice* getDefaultGDKPointerDevice(GdkWindow* window);
+GdkCursor* blankCursor();
G_END_DECLS
diff --git a/WebCore/platform/gtk/LocalizedStringsGtk.cpp b/WebCore/platform/gtk/LocalizedStringsGtk.cpp
index 432c92f..7851326 100644
--- a/WebCore/platform/gtk/LocalizedStringsGtk.cpp
+++ b/WebCore/platform/gtk/LocalizedStringsGtk.cpp
@@ -4,6 +4,7 @@
* Copyright (C) 2007 Holger Hans Peter Freyther
* Copyright (C) 2008 Christian Dywan <christian@imendio.com>
* Copyright (C) 2008 Nuanti Ltd.
+ * Copyright (C) 2010 Igalia S.L
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -110,6 +111,56 @@ String contextMenuItemTagCopyImageToClipboard()
return String::fromUTF8(_("Cop_y Image"));
}
+String contextMenuItemTagOpenVideoInNewWindow()
+{
+ return String::fromUTF8(_("Open _Video in New Window"));
+}
+
+String contextMenuItemTagOpenAudioInNewWindow()
+{
+ return String::fromUTF8(_("Open _Audio in New Window"));
+}
+
+String contextMenuItemTagCopyVideoLinkToClipboard()
+{
+ return String::fromUTF8(_("Cop_y Video Link Location"));
+}
+
+String contextMenuItemTagCopyAudioLinkToClipboard()
+{
+ return String::fromUTF8(_("Cop_y Audio Link Location"));
+}
+
+String contextMenuItemTagToggleMediaControls()
+{
+ return String::fromUTF8(_("_Toggle Media Controls"));
+}
+
+String contextMenuItemTagToggleMediaLoop()
+{
+ return String::fromUTF8(_("Toggle Media _Loop Playback"));
+}
+
+String contextMenuItemTagEnterVideoFullscreen()
+{
+ return String::fromUTF8(_("Switch Video to _Fullscreen"));
+}
+
+String contextMenuItemTagMediaPlay()
+{
+ return String::fromUTF8(_("_Play"));
+}
+
+String contextMenuItemTagMediaPause()
+{
+ return String::fromUTF8(_("_Pause"));
+}
+
+String contextMenuItemTagMediaMute()
+{
+ return String::fromUTF8(_("_Mute"));
+}
+
String contextMenuItemTagOpenFrameInNewWindow()
{
return String::fromUTF8(_("Open _Frame in New Window"));
diff --git a/WebCore/platform/haiku/ClipboardHaiku.cpp b/WebCore/platform/haiku/ClipboardHaiku.cpp
index da242c1..495f1d2 100644
--- a/WebCore/platform/haiku/ClipboardHaiku.cpp
+++ b/WebCore/platform/haiku/ClipboardHaiku.cpp
@@ -44,11 +44,11 @@ namespace WebCore {
PassRefPtr<Clipboard> Clipboard::create(ClipboardAccessPolicy policy, DragData*, Frame*)
{
- return ClipboardHaiku::create(policy, true);
+ return ClipboardHaiku::create(policy, DragAndDrop);
}
-ClipboardHaiku::ClipboardHaiku(ClipboardAccessPolicy policy, bool forDragging)
- : Clipboard(policy, forDragging)
+ClipboardHaiku::ClipboardHaiku(ClipboardAccessPolicy policy, ClipboardType clipboardType)
+ : Clipboard(policy, clipboardType)
{
}
diff --git a/WebCore/platform/haiku/ClipboardHaiku.h b/WebCore/platform/haiku/ClipboardHaiku.h
index 37ffe5c..89dc7bd 100644
--- a/WebCore/platform/haiku/ClipboardHaiku.h
+++ b/WebCore/platform/haiku/ClipboardHaiku.h
@@ -36,9 +36,9 @@ namespace WebCore {
// State available during IE's events for drag and drop and copy/paste.
class ClipboardHaiku : public Clipboard {
public:
- static PassRefPtr<ClipboardHaiku> create(ClipboardAccessPolicy policy, bool forDragging)
+ static PassRefPtr<ClipboardHaiku> create(ClipboardAccessPolicy policy, ClipboardType clipboardType)
{
- return adoptRef(new ClipboardHaiku(policy, forDragging));
+ return adoptRef(new ClipboardHaiku(policy, clipboardType));
}
~ClipboardHaiku() { }
@@ -66,7 +66,7 @@ namespace WebCore {
virtual bool hasData();
private:
- ClipboardHaiku(ClipboardAccessPolicy, bool forDragging);
+ ClipboardHaiku(ClipboardAccessPolicy, ClipboardType);
};
} // namespace WebCore
diff --git a/WebCore/platform/haiku/LocalizedStringsHaiku.cpp b/WebCore/platform/haiku/LocalizedStringsHaiku.cpp
index 5321792..4c12cf3 100644
--- a/WebCore/platform/haiku/LocalizedStringsHaiku.cpp
+++ b/WebCore/platform/haiku/LocalizedStringsHaiku.cpp
@@ -98,6 +98,56 @@ String contextMenuItemTagCopyImageToClipboard()
return "Copy image to clipboard";
}
+String contextMenuItemTagOpenVideoInNewWindow()
+{
+ return "Open video in new window";
+}
+
+String contextMenuItemTagOpenAudioInNewWindow()
+{
+ return "Open audio in new window";
+}
+
+String contextMenuItemTagCopyVideoLinkToClipboard()
+{
+ return "Copy video link location";
+}
+
+String contextMenuItemTagCopyAudioLinkToClipboard()
+{
+ return "Copy audio link location";
+}
+
+String contextMenuItemTagToggleMediaControls()
+{
+ return "Toggle media controls";
+}
+
+String contextMenuItemTagToggleMediaLoop()
+{
+ return "Toggle media loop playback";
+}
+
+String contextMenuItemTagEnterVideoFullscreen()
+{
+ return "Switch video to fullscreen";
+}
+
+String contextMenuItemTagMediaPlay()
+{
+ return "Play";
+}
+
+String contextMenuItemTagMediaPause()
+{
+ return "Pause";
+}
+
+String contextMenuItemTagMediaMute()
+{
+ return "Mute";
+}
+
String contextMenuItemTagOpenFrameInNewWindow()
{
return "Open frame in new window";
diff --git a/WebCore/platform/image-decoders/ImageDecoder.cpp b/WebCore/platform/image-decoders/ImageDecoder.cpp
index 475bd9f..1c3dcf8 100644
--- a/WebCore/platform/image-decoders/ImageDecoder.cpp
+++ b/WebCore/platform/image-decoders/ImageDecoder.cpp
@@ -133,14 +133,15 @@ void RGBA32Buffer::zeroFill()
m_hasAlpha = true;
}
-void RGBA32Buffer::copyBitmapData(const RGBA32Buffer& other)
+bool RGBA32Buffer::copyBitmapData(const RGBA32Buffer& other)
{
if (this == &other)
- return;
+ return true;
m_bytes = other.m_bytes;
m_size = other.m_size;
setHasAlpha(other.m_hasAlpha);
+ return true;
}
bool RGBA32Buffer::setSize(int newWidth, int newHeight)
diff --git a/WebCore/platform/image-decoders/ImageDecoder.h b/WebCore/platform/image-decoders/ImageDecoder.h
index 4012168..90e8ae2 100644
--- a/WebCore/platform/image-decoders/ImageDecoder.h
+++ b/WebCore/platform/image-decoders/ImageDecoder.h
@@ -85,8 +85,8 @@ namespace WebCore {
void zeroFill();
// Creates a new copy of the image data in |other|, so the two images
- // can be modified independently.
- void copyBitmapData(const RGBA32Buffer& other);
+ // can be modified independently. Returns whether the copy succeeded.
+ bool copyBitmapData(const RGBA32Buffer& other);
// Copies the pixel data at [(startX, startY), (endX, startY)) to the
// same X-coordinates on each subsequent row up to but not including
diff --git a/WebCore/platform/image-decoders/gif/GIFImageDecoder.cpp b/WebCore/platform/image-decoders/gif/GIFImageDecoder.cpp
index 4d2a92d..4797495 100644
--- a/WebCore/platform/image-decoders/gif/GIFImageDecoder.cpp
+++ b/WebCore/platform/image-decoders/gif/GIFImageDecoder.cpp
@@ -60,7 +60,7 @@ bool GIFImageDecoder::isSizeAvailable()
return ImageDecoder::isSizeAvailable();
}
-bool GIFImageDecoder::setSize(unsigned width, unsigned height)
+bool GIFImageDecoder::setSize(int width, int height)
{
if (ImageDecoder::isSizeAvailable() && size().width() == width && size().height() == height)
return true;
@@ -356,7 +356,8 @@ bool GIFImageDecoder::initFrameBuffer(unsigned frameIndex)
if ((prevMethod == RGBA32Buffer::DisposeNotSpecified) || (prevMethod == RGBA32Buffer::DisposeKeep)) {
// Preserve the last frame as the starting state for this frame.
- buffer->copyBitmapData(*prevBuffer);
+ if (!buffer->copyBitmapData(*prevBuffer))
+ return setFailed();
} else {
// We want to clear the previous frame to transparent, without
// affecting pixels in the image outside of the frame.
@@ -369,7 +370,8 @@ bool GIFImageDecoder::initFrameBuffer(unsigned frameIndex)
return setFailed();
} else {
// Copy the whole previous buffer, then clear just its frame.
- buffer->copyBitmapData(*prevBuffer);
+ if (!buffer->copyBitmapData(*prevBuffer))
+ return setFailed();
for (int y = prevRect.y(); y < prevRect.bottom(); ++y) {
for (int x = prevRect.x(); x < prevRect.right(); ++x)
buffer->setRGBA(x, y, 0, 0, 0, 0);
diff --git a/WebCore/platform/image-decoders/gif/GIFImageDecoder.h b/WebCore/platform/image-decoders/gif/GIFImageDecoder.h
index 21c1c57..0a88ffd 100644
--- a/WebCore/platform/image-decoders/gif/GIFImageDecoder.h
+++ b/WebCore/platform/image-decoders/gif/GIFImageDecoder.h
@@ -45,7 +45,7 @@ namespace WebCore {
virtual String filenameExtension() const { return "gif"; }
virtual void setData(SharedBuffer* data, bool allDataReceived);
virtual bool isSizeAvailable();
- virtual bool setSize(unsigned width, unsigned height);
+ virtual bool setSize(int width, int height);
virtual size_t frameCount();
virtual int repetitionCount() const;
virtual RGBA32Buffer* frameBufferAtIndex(size_t index);
diff --git a/WebCore/platform/image-decoders/qt/RGBA32BufferQt.cpp b/WebCore/platform/image-decoders/qt/RGBA32BufferQt.cpp
index 044515a..a782373 100644
--- a/WebCore/platform/image-decoders/qt/RGBA32BufferQt.cpp
+++ b/WebCore/platform/image-decoders/qt/RGBA32BufferQt.cpp
@@ -75,15 +75,16 @@ void RGBA32Buffer::zeroFill()
m_pixmap.fill(QColor(0, 0, 0, 0));
}
-void RGBA32Buffer::copyBitmapData(const RGBA32Buffer& other)
+bool RGBA32Buffer::copyBitmapData(const RGBA32Buffer& other)
{
if (this == &other)
- return;
+ return true;
m_image = other.m_image;
m_pixmap = other.m_pixmap;
m_size = other.m_size;
m_hasAlpha = other.m_hasAlpha;
+ return true;
}
bool RGBA32Buffer::setSize(int newWidth, int newHeight)
diff --git a/WebCore/platform/image-decoders/skia/ImageDecoderSkia.cpp b/WebCore/platform/image-decoders/skia/ImageDecoderSkia.cpp
index c7e2114..7baca5f 100644
--- a/WebCore/platform/image-decoders/skia/ImageDecoderSkia.cpp
+++ b/WebCore/platform/image-decoders/skia/ImageDecoderSkia.cpp
@@ -72,14 +72,14 @@ void RGBA32Buffer::zeroFill()
m_bitmap.eraseARGB(0, 0, 0, 0);
}
-void RGBA32Buffer::copyBitmapData(const RGBA32Buffer& other)
+bool RGBA32Buffer::copyBitmapData(const RGBA32Buffer& other)
{
if (this == &other)
- return;
+ return true;
m_bitmap.reset();
const NativeImageSkia& otherBitmap = other.m_bitmap;
- otherBitmap.copyTo(&m_bitmap, otherBitmap.config());
+ return otherBitmap.copyTo(&m_bitmap, otherBitmap.config());
}
bool RGBA32Buffer::setSize(int newWidth, int newHeight)
diff --git a/WebCore/platform/mac/ClipboardMac.h b/WebCore/platform/mac/ClipboardMac.h
index adde09c..7187ecf 100644
--- a/WebCore/platform/mac/ClipboardMac.h
+++ b/WebCore/platform/mac/ClipboardMac.h
@@ -45,9 +45,9 @@ class FileList;
class ClipboardMac : public Clipboard, public CachedResourceClient {
public:
- static PassRefPtr<ClipboardMac> create(bool forDragging, NSPasteboard *pasteboard, ClipboardAccessPolicy policy, Frame* frame)
+ static PassRefPtr<ClipboardMac> create(ClipboardType clipboardType, NSPasteboard *pasteboard, ClipboardAccessPolicy policy, Frame* frame)
{
- return adoptRef(new ClipboardMac(forDragging, pasteboard, policy, frame));
+ return adoptRef(new ClipboardMac(clipboardType, pasteboard, policy, frame));
}
virtual ~ClipboardMac();
@@ -79,7 +79,7 @@ public:
NSPasteboard *pasteboard() { return m_pasteboard.get(); }
private:
- ClipboardMac(bool forDragging, NSPasteboard *, ClipboardAccessPolicy, Frame*);
+ ClipboardMac(ClipboardType, NSPasteboard *, ClipboardAccessPolicy, Frame*);
void setDragImage(CachedImage*, Node*, const IntPoint&);
diff --git a/WebCore/platform/mac/ClipboardMac.mm b/WebCore/platform/mac/ClipboardMac.mm
index 74a93b6..10d196a 100644
--- a/WebCore/platform/mac/ClipboardMac.mm
+++ b/WebCore/platform/mac/ClipboardMac.mm
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004, 2005, 2006, 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2004, 2005, 2006, 2008, 2010 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -31,7 +31,6 @@
#import "DragController.h"
#import "DragData.h"
#import "Editor.h"
-#import "FoundationExtras.h"
#import "FileList.h"
#import "Frame.h"
#import "Image.h"
@@ -50,11 +49,11 @@ namespace WebCore {
PassRefPtr<Clipboard> Clipboard::create(ClipboardAccessPolicy policy, DragData* dragData, Frame* frame)
{
- return ClipboardMac::create(true, [dragData->platformData() draggingPasteboard], policy, frame);
+ return ClipboardMac::create(DragAndDrop, [dragData->platformData() draggingPasteboard], policy, frame);
}
-ClipboardMac::ClipboardMac(bool forDragging, NSPasteboard *pasteboard, ClipboardAccessPolicy policy, Frame *frame)
- : Clipboard(policy, forDragging)
+ClipboardMac::ClipboardMac(ClipboardType clipboardType, NSPasteboard *pasteboard, ClipboardAccessPolicy policy, Frame *frame)
+ : Clipboard(policy, clipboardType)
, m_pasteboard(pasteboard)
, m_frame(frame)
{
@@ -70,7 +69,7 @@ bool ClipboardMac::hasData()
return m_pasteboard && [m_pasteboard.get() types] && [[m_pasteboard.get() types] count] > 0;
}
-static NSString *cocoaTypeFromHTMLClipboardType(const String& type)
+static RetainPtr<NSString> cocoaTypeFromHTMLClipboardType(const String& type)
{
String qType = type.stripWhiteSpace();
@@ -93,11 +92,11 @@ static NSString *cocoaTypeFromHTMLClipboardType(const String& type)
if (utiType) {
CFStringRef pbType = UTTypeCopyPreferredTagWithClass(utiType.get(), kUTTagClassNSPboardType);
if (pbType)
- return HardAutorelease(pbType);
+ return (NSString *)pbType;
}
- // No mapping, just pass the whole string though
- return qType;
+ // No mapping, just pass the whole string though
+ return (NSString *)qType;
}
static String utiTypeFromCocoaType(NSString *type)
@@ -151,9 +150,8 @@ void ClipboardMac::clearData(const String& type)
// note NSPasteboard enforces changeCount itself on writing - can't write if not the owner
- NSString *cocoaType = cocoaTypeFromHTMLClipboardType(type);
- if (cocoaType)
- [m_pasteboard.get() setString:@"" forType:cocoaType];
+ if (RetainPtr<NSString> cocoaType = cocoaTypeFromHTMLClipboardType(type))
+ [m_pasteboard.get() setString:@"" forType:cocoaType.get()];
}
void ClipboardMac::clearAllData()
@@ -218,19 +216,19 @@ String ClipboardMac::getData(const String& type, bool& success) const
if (policy() != ClipboardReadable)
return String();
- NSString *cocoaType = cocoaTypeFromHTMLClipboardType(type);
+ RetainPtr<NSString> cocoaType = cocoaTypeFromHTMLClipboardType(type);
NSString *cocoaValue = nil;
// Grab the value off the pasteboard corresponding to the cocoaType
- if ([cocoaType isEqualToString:NSURLPboardType]) {
+ if ([cocoaType.get() isEqualToString:NSURLPboardType]) {
// "URL" and "text/url-list" both map to NSURLPboardType in cocoaTypeFromHTMLClipboardType(), "URL" only wants the first URL
bool onlyFirstURL = (type == "URL");
NSArray *absoluteURLs = absoluteURLsFromPasteboard(m_pasteboard.get(), onlyFirstURL);
cocoaValue = [absoluteURLs componentsJoinedByString:@"\n"];
- } else if ([cocoaType isEqualToString:NSStringPboardType]) {
- cocoaValue = [[m_pasteboard.get() stringForType:cocoaType] precomposedStringWithCanonicalMapping];
+ } else if ([cocoaType.get() isEqualToString:NSStringPboardType]) {
+ cocoaValue = [[m_pasteboard.get() stringForType:cocoaType.get()] precomposedStringWithCanonicalMapping];
} else if (cocoaType)
- cocoaValue = [m_pasteboard.get() stringForType:cocoaType];
+ cocoaValue = [m_pasteboard.get() stringForType:cocoaType.get()];
// Enforce changeCount ourselves for security. We check after reading instead of before to be
// sure it doesn't change between our testing the change count and accessing the data.
@@ -248,10 +246,10 @@ bool ClipboardMac::setData(const String &type, const String &data)
return false;
// note NSPasteboard enforces changeCount itself on writing - can't write if not the owner
- NSString *cocoaType = cocoaTypeFromHTMLClipboardType(type);
+ RetainPtr<NSString> cocoaType = cocoaTypeFromHTMLClipboardType(type);
NSString *cocoaData = data;
- if ([cocoaType isEqualToString:NSURLPboardType]) {
+ if ([cocoaType.get() isEqualToString:NSURLPboardType]) {
[m_pasteboard.get() addTypes:[NSArray arrayWithObject:NSURLPboardType] owner:nil];
NSURL *url = [[NSURL alloc] initWithString:cocoaData];
[url writeToPasteboard:m_pasteboard.get()];
@@ -268,8 +266,8 @@ bool ClipboardMac::setData(const String &type, const String &data)
if (cocoaType) {
// everything else we know of goes on the pboard as a string
- [m_pasteboard.get() addTypes:[NSArray arrayWithObject:cocoaType] owner:nil];
- return [m_pasteboard.get() setString:cocoaData forType:cocoaType];
+ [m_pasteboard.get() addTypes:[NSArray arrayWithObject:cocoaType.get()] owner:nil];
+ return [m_pasteboard.get() setString:cocoaData forType:cocoaType.get()];
}
return false;
diff --git a/WebCore/platform/mac/CursorMac.mm b/WebCore/platform/mac/CursorMac.mm
index 1b4c1b1..c006cbc 100644
--- a/WebCore/platform/mac/CursorMac.mm
+++ b/WebCore/platform/mac/CursorMac.mm
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004, 2006 Apple Inc. All rights reserved.
+ * Copyright (C) 2004, 2006, 2010 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -27,7 +27,6 @@
#import "Cursor.h"
#import "BlockExceptions.h"
-#import "FoundationExtras.h"
#import <wtf/StdLibExtras.h>
@interface WebCoreCursorBundle : NSObject { }
@@ -41,14 +40,14 @@ namespace WebCore {
// Simple NSCursor calls shouldn't need protection,
// but creating a cursor with a bad image might throw.
-static NSCursor* createCustomCursor(Image* image, const IntPoint& hotSpot)
+static RetainPtr<NSCursor> createCustomCursor(Image* image, const IntPoint& hotSpot)
{
// FIXME: The cursor won't animate. Not sure if that's a big deal.
- NSImage* img = image->getNSImage();
- if (!img)
+ NSImage* nsImage = image->getNSImage();
+ if (!nsImage)
return 0;
BEGIN_BLOCK_OBJC_EXCEPTIONS;
- return [[NSCursor alloc] initWithImage:img hotSpot:hotSpot];
+ return RetainPtr<NSCursor>(AdoptNS, [[NSCursor alloc] initWithImage:nsImage hotSpot:hotSpot]);
END_BLOCK_OBJC_EXCEPTIONS;
return 0;
}
@@ -81,118 +80,118 @@ void Cursor::ensurePlatformCursor() const
switch (m_type) {
case Cursor::Pointer:
- m_platformCursor = HardRetain([NSCursor arrowCursor]);
+ m_platformCursor = [NSCursor arrowCursor];
break;
case Cursor::Cross:
- m_platformCursor = HardRetain(leakNamedCursor("crossHairCursor", 11, 11));
+ m_platformCursor = leakNamedCursor("crossHairCursor", 11, 11);
break;
case Cursor::Hand:
- m_platformCursor = HardRetain(leakNamedCursor("linkCursor", 6, 1));
+ m_platformCursor = leakNamedCursor("linkCursor", 6, 1);
break;
case Cursor::IBeam:
- m_platformCursor = HardRetain([NSCursor IBeamCursor]);
+ m_platformCursor = [NSCursor IBeamCursor];
break;
case Cursor::Wait:
- m_platformCursor = HardRetain(leakNamedCursor("waitCursor", 7, 7));
+ m_platformCursor = leakNamedCursor("waitCursor", 7, 7);
break;
case Cursor::Help:
- m_platformCursor = HardRetain(leakNamedCursor("helpCursor", 8, 8));
+ m_platformCursor = leakNamedCursor("helpCursor", 8, 8);
break;
case Cursor::Move:
case Cursor::MiddlePanning:
- m_platformCursor = HardRetain(leakNamedCursor("moveCursor", 7, 7));
+ m_platformCursor = leakNamedCursor("moveCursor", 7, 7);
break;
case Cursor::EastResize:
case Cursor::EastPanning:
- m_platformCursor = HardRetain(leakNamedCursor("eastResizeCursor", 14, 7));
+ m_platformCursor = leakNamedCursor("eastResizeCursor", 14, 7);
break;
case Cursor::NorthResize:
case Cursor::NorthPanning:
- m_platformCursor = HardRetain(leakNamedCursor("northResizeCursor", 7, 1));
+ m_platformCursor = leakNamedCursor("northResizeCursor", 7, 1);
break;
case Cursor::NorthEastResize:
case Cursor::NorthEastPanning:
- m_platformCursor = HardRetain(leakNamedCursor("northEastResizeCursor", 14, 1));
+ m_platformCursor = leakNamedCursor("northEastResizeCursor", 14, 1);
break;
case Cursor::NorthWestResize:
case Cursor::NorthWestPanning:
- m_platformCursor = HardRetain(leakNamedCursor("northWestResizeCursor", 0, 0));
+ m_platformCursor = leakNamedCursor("northWestResizeCursor", 0, 0);
break;
case Cursor::SouthResize:
case Cursor::SouthPanning:
- m_platformCursor = HardRetain(leakNamedCursor("southResizeCursor", 7, 14));
+ m_platformCursor = leakNamedCursor("southResizeCursor", 7, 14);
break;
case Cursor::SouthEastResize:
case Cursor::SouthEastPanning:
- m_platformCursor = HardRetain(leakNamedCursor("southEastResizeCursor", 14, 14));
+ m_platformCursor = leakNamedCursor("southEastResizeCursor", 14, 14);
break;
case Cursor::SouthWestResize:
case Cursor::SouthWestPanning:
- m_platformCursor = HardRetain(leakNamedCursor("southWestResizeCursor", 1, 14));
+ m_platformCursor = leakNamedCursor("southWestResizeCursor", 1, 14);
break;
case Cursor::WestResize:
- m_platformCursor = HardRetain(leakNamedCursor("westResizeCursor", 1, 7));
+ m_platformCursor = leakNamedCursor("westResizeCursor", 1, 7);
break;
case Cursor::NorthSouthResize:
- m_platformCursor = HardRetain(leakNamedCursor("northSouthResizeCursor", 7, 7));
+ m_platformCursor = leakNamedCursor("northSouthResizeCursor", 7, 7);
break;
case Cursor::EastWestResize:
case Cursor::WestPanning:
- m_platformCursor = HardRetain(leakNamedCursor("eastWestResizeCursor", 7, 7));
+ m_platformCursor = leakNamedCursor("eastWestResizeCursor", 7, 7);
break;
case Cursor::NorthEastSouthWestResize:
- m_platformCursor = HardRetain(leakNamedCursor("northEastSouthWestResizeCursor", 7, 7));
+ m_platformCursor = leakNamedCursor("northEastSouthWestResizeCursor", 7, 7);
break;
case Cursor::NorthWestSouthEastResize:
- m_platformCursor = HardRetain(leakNamedCursor("northWestSouthEastResizeCursor", 7, 7));
+ m_platformCursor = leakNamedCursor("northWestSouthEastResizeCursor", 7, 7);
break;
case Cursor::ColumnResize:
- m_platformCursor = HardRetain([NSCursor resizeLeftRightCursor]);
+ m_platformCursor = [NSCursor resizeLeftRightCursor];
break;
case Cursor::RowResize:
- m_platformCursor = HardRetain([NSCursor resizeUpDownCursor]);
+ m_platformCursor = [NSCursor resizeUpDownCursor];
break;
case Cursor::VerticalText:
- m_platformCursor = HardRetain(leakNamedCursor("verticalTextCursor", 7, 7));
+ m_platformCursor = leakNamedCursor("verticalTextCursor", 7, 7);
break;
case Cursor::Cell:
- m_platformCursor = HardRetain(leakNamedCursor("cellCursor", 7, 7));
+ m_platformCursor = leakNamedCursor("cellCursor", 7, 7);
break;
case Cursor::ContextMenu:
- m_platformCursor = HardRetain(leakNamedCursor("contextMenuCursor", 3, 2));
+ m_platformCursor = leakNamedCursor("contextMenuCursor", 3, 2);
break;
case Cursor::Alias:
- m_platformCursor = HardRetain(leakNamedCursor("aliasCursor", 11, 3));
+ m_platformCursor = leakNamedCursor("aliasCursor", 11, 3);
break;
case Cursor::Progress:
- m_platformCursor = HardRetain(leakNamedCursor("progressCursor", 3, 2));
+ m_platformCursor = leakNamedCursor("progressCursor", 3, 2);
break;
case Cursor::NoDrop:
- m_platformCursor = HardRetain(leakNamedCursor("noDropCursor", 3, 1));
+ m_platformCursor = leakNamedCursor("noDropCursor", 3, 1);
break;
case Cursor::Copy:
- m_platformCursor = HardRetain(leakNamedCursor("copyCursor", 3, 2));
+ m_platformCursor = leakNamedCursor("copyCursor", 3, 2);
break;
case Cursor::None:
- m_platformCursor = HardRetain(leakNamedCursor("noneCursor", 7, 7));
+ m_platformCursor = leakNamedCursor("noneCursor", 7, 7);
break;
case Cursor::NotAllowed:
- m_platformCursor = HardRetain(leakNamedCursor("notAllowedCursor", 11, 11));
+ m_platformCursor = leakNamedCursor("notAllowedCursor", 11, 11);
break;
case Cursor::ZoomIn:
- m_platformCursor = HardRetain(leakNamedCursor("zoomInCursor", 7, 7));
+ m_platformCursor = leakNamedCursor("zoomInCursor", 7, 7);
break;
case Cursor::ZoomOut:
- m_platformCursor = HardRetain(leakNamedCursor("zoomOutCursor", 7, 7));
+ m_platformCursor = leakNamedCursor("zoomOutCursor", 7, 7);
break;
case Cursor::Grab:
- m_platformCursor = HardRetain([NSCursor openHandCursor]);
+ m_platformCursor = [NSCursor openHandCursor];
break;
case Cursor::Grabbing:
- m_platformCursor = HardRetain([NSCursor closedHandCursor]);
+ m_platformCursor = [NSCursor closedHandCursor];
break;
case Cursor::Custom:
- m_platformCursor = HardRetainWithNSRelease(createCustomCursor(m_image.get(), m_hotSpot));
+ m_platformCursor = createCustomCursor(m_image.get(), m_hotSpot);
break;
}
}
@@ -201,7 +200,7 @@ Cursor::Cursor(const Cursor& other)
: m_type(other.m_type)
, m_image(other.m_image)
, m_hotSpot(other.m_hotSpot)
- , m_platformCursor(HardRetain(other.m_platformCursor))
+ , m_platformCursor(other.m_platformCursor)
{
}
@@ -210,16 +209,18 @@ Cursor& Cursor::operator=(const Cursor& other)
m_type = other.m_type;
m_image = other.m_image;
m_hotSpot = other.m_hotSpot;
-
- HardRetain(other.m_platformCursor);
- HardRelease(m_platformCursor);
m_platformCursor = other.m_platformCursor;
return *this;
}
Cursor::~Cursor()
{
- HardRelease(m_platformCursor);
+}
+
+NSCursor *Cursor::platformCursor() const
+{
+ ensurePlatformCursor();
+ return m_platformCursor.get();
}
} // namespace WebCore
diff --git a/WebCore/platform/mac/FoundationExtras.h b/WebCore/platform/mac/FoundationExtras.h
index 85ce8d7..39b12ea 100644
--- a/WebCore/platform/mac/FoundationExtras.h
+++ b/WebCore/platform/mac/FoundationExtras.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004 Apple Computer, Inc. All rights reserved.
+ * Copyright (C) 2004 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -26,50 +26,15 @@
#import <CoreFoundation/CFBase.h>
#import <Foundation/NSObject.h>
-// nil-checked CFRetain/CFRelease covers for Objective-C ids
-
-// Use CFRetain, CFRelease, HardRetain, or HardRelease instead of
-// -[NSObject retain] and -[NSObject release] if you want to store
-// a pointer to an Objective-C object into memory that won't
-// be scanned for GC, like a C++ object.
-
-static inline id HardRetain(id obj)
-{
- if (obj) CFRetain(obj);
- return obj;
-}
-
-static inline void HardRelease(id obj)
-{
- if (obj) CFRelease(obj);
-}
-
-// As if CF and Foundation had logically separate reference counts,
-// this function first increments the CF retain count, and then
-// decrements the NS retain count. This is needed to handle cases where
-// -retain/-release aren't equivalent to CFRetain/HardRelease, such as
-// when GC is used.
-
-// Use HardRetainWithNSRelease after allocating and initializing a NSObject
-// if you want to store a pointer to that object into memory that won't
-// be scanned for GC, like a C++ object.
-
-static inline id HardRetainWithNSRelease(id obj)
-{
- HardRetain(obj);
- [obj release];
- return obj;
-}
-
// Use HardAutorelease to return an object made by a CoreFoundation
// "create" or "copy" function as an autoreleased and garbage collected
// object. CF objects need to be "made collectable" for autorelease to work
// properly under GC.
-static inline id HardAutorelease(CFTypeRef obj)
+static inline id HardAutorelease(CFTypeRef object)
{
- if (obj)
- CFMakeCollectable(obj);
- [(id)obj autorelease];
- return (id)obj;
+ if (object)
+ CFMakeCollectable(object);
+ [(id)object autorelease];
+ return (id)object;
}
diff --git a/WebCore/platform/mac/RuntimeApplicationChecks.h b/WebCore/platform/mac/RuntimeApplicationChecks.h
index 24b8ae1..f938048 100644
--- a/WebCore/platform/mac/RuntimeApplicationChecks.h
+++ b/WebCore/platform/mac/RuntimeApplicationChecks.h
@@ -32,6 +32,8 @@ bool applicationIsAppleMail();
bool applicationIsSafari();
bool applicationIsMicrosoftMessenger();
bool applicationIsAdobeInstaller();
+bool applicationIsAOLInstantMessenger();
+bool applicationIsMicrosoftMyDay();
} // namespace WebCore
diff --git a/WebCore/platform/mac/RuntimeApplicationChecks.mm b/WebCore/platform/mac/RuntimeApplicationChecks.mm
index bcc1dc9..7fe8378 100644
--- a/WebCore/platform/mac/RuntimeApplicationChecks.mm
+++ b/WebCore/platform/mac/RuntimeApplicationChecks.mm
@@ -52,5 +52,17 @@ bool applicationIsAdobeInstaller()
static bool isAdobeInstaller = [[[NSBundle mainBundle] bundleIdentifier] isEqualToString:@"com.adobe.Installers.Setup"];
return isAdobeInstaller;
}
+
+bool applicationIsAOLInstantMessenger()
+{
+ static bool isAOLInstantMessenger = [[[NSBundle mainBundle] bundleIdentifier] isEqualToString:@"com.aol.aim.desktop"];
+ return isAOLInstantMessenger;
+}
+
+bool applicationIsMicrosoftMyDay()
+{
+ static bool isMicrosoftMyDay = [[[NSBundle mainBundle] bundleIdentifier] isEqualToString:@"com.microsoft.myday"];
+ return isMicrosoftMyDay;
+}
} // namespace WebCore
diff --git a/WebCore/platform/mac/ThemeMac.mm b/WebCore/platform/mac/ThemeMac.mm
index c57e8df..75cbd36 100644
--- a/WebCore/platform/mac/ThemeMac.mm
+++ b/WebCore/platform/mac/ThemeMac.mm
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 Apple Inc. All Rights Reserved.
+ * Copyright (C) 2008, 2010 Apple Inc. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -375,43 +375,53 @@ static const int* buttonMargins(NSControlSize controlSize)
return margins[controlSize];
}
-static void setupButtonCell(NSButtonCell *&buttonCell, ControlPart part, ControlStates states, const IntRect& zoomedRect, float zoomFactor)
+enum ButtonCellType { NormalButtonCell, DefaultButtonCell };
+
+static NSButtonCell *leakButtonCell(ButtonCellType type)
{
- if (!buttonCell) {
- buttonCell = [[NSButtonCell alloc] init];
- [buttonCell setTitle:nil];
- [buttonCell setButtonType:NSMomentaryPushInButton];
- if (states & DefaultState)
- [buttonCell setKeyEquivalent:@"\r"];
- }
+ NSButtonCell *cell = [[NSButtonCell alloc] init];
+ [cell setTitle:nil];
+ [cell setButtonType:NSMomentaryPushInButton];
+ if (type == DefaultButtonCell)
+ [cell setKeyEquivalent:@"\r"];
+ return cell;
+}
+static void setUpButtonCell(NSButtonCell *cell, ControlPart part, ControlStates states, const IntRect& zoomedRect, float zoomFactor)
+{
// Set the control size based off the rectangle we're painting into.
const IntSize* sizes = buttonSizes();
#if ENABLE(DATALIST)
if (part == ListButtonPart) {
- [buttonCell setBezelStyle:NSRoundedDisclosureBezelStyle];
+ [cell setBezelStyle:NSRoundedDisclosureBezelStyle];
sizes = listButtonSizes();
} else
#endif
if (part == SquareButtonPart || zoomedRect.height() > buttonSizes()[NSRegularControlSize].height() * zoomFactor) {
// Use the square button
- if ([buttonCell bezelStyle] != NSShadowlessSquareBezelStyle)
- [buttonCell setBezelStyle:NSShadowlessSquareBezelStyle];
- } else if ([buttonCell bezelStyle] != NSRoundedBezelStyle)
- [buttonCell setBezelStyle:NSRoundedBezelStyle];
+ if ([cell bezelStyle] != NSShadowlessSquareBezelStyle)
+ [cell setBezelStyle:NSShadowlessSquareBezelStyle];
+ } else if ([cell bezelStyle] != NSRoundedBezelStyle)
+ [cell setBezelStyle:NSRoundedBezelStyle];
- setControlSize(buttonCell, sizes, zoomedRect.size(), zoomFactor);
+ setControlSize(cell, sizes, zoomedRect.size(), zoomFactor);
// Update the various states we respond to.
- updateStates(buttonCell, states);
+ updateStates(cell, states);
}
-
+
static NSButtonCell *button(ControlPart part, ControlStates states, const IntRect& zoomedRect, float zoomFactor)
{
- bool isDefault = states & DefaultState;
- static NSButtonCell *cells[2];
- setupButtonCell(cells[isDefault], part, states, zoomedRect, zoomFactor);
- return cells[isDefault];
+ NSButtonCell *cell;
+ if (states & DefaultState) {
+ static NSButtonCell *defaultCell = leakButtonCell(DefaultButtonCell);
+ cell = defaultCell;
+ } else {
+ static NSButtonCell *normalCell = leakButtonCell(NormalButtonCell);
+ cell = normalCell;
+ }
+ setUpButtonCell(cell, part, states, zoomedRect, zoomFactor);
+ return cell;
}
static void paintButton(ControlPart part, ControlStates states, GraphicsContext* context, const IntRect& zoomedRect, float zoomFactor, ScrollView* scrollView)
diff --git a/WebCore/platform/mac/WidgetMac.mm b/WebCore/platform/mac/WidgetMac.mm
index 2598591..e8bb81d 100644
--- a/WebCore/platform/mac/WidgetMac.mm
+++ b/WebCore/platform/mac/WidgetMac.mm
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004, 2005, 2006, 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2004, 2005, 2006, 2008, 2010 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -35,7 +35,6 @@
#import "Cursor.h"
#import "Document.h"
#import "Font.h"
-#import "FoundationExtras.h"
#import "Frame.h"
#import "GraphicsContext.h"
#import "NotImplemented.h"
@@ -100,7 +99,6 @@ Widget::Widget(NSView *view)
Widget::~Widget()
{
- releasePlatformWidget();
delete m_data;
}
@@ -354,16 +352,18 @@ IntPoint Widget::convertFromContainingWindowToRoot(const Widget* rootWidget, con
return point;
}
-void Widget::releasePlatformWidget()
+NSView *Widget::platformWidget() const
{
- HardRelease(m_widget);
- m_data->previousVisibleRect = NSZeroRect;
+ return m_widget.get();
}
-void Widget::retainPlatformWidget()
+void Widget::setPlatformWidget(NSView *widget)
{
- HardRetain(m_widget);
+ if (widget == m_widget)
+ return;
+
+ m_widget = widget;
+ m_data->previousVisibleRect = NSZeroRect;
}
} // namespace WebCore
-
diff --git a/WebCore/platform/mock/DeviceOrientationClientMock.h b/WebCore/platform/mock/DeviceOrientationClientMock.h
index 6691130..baa4245 100644
--- a/WebCore/platform/mock/DeviceOrientationClientMock.h
+++ b/WebCore/platform/mock/DeviceOrientationClientMock.h
@@ -49,6 +49,7 @@ public:
virtual void startUpdating();
virtual void stopUpdating();
virtual DeviceOrientation* lastOrientation() const { return m_orientation.get(); }
+ virtual void deviceOrientationControllerDestroyed() { }
void setOrientation(PassRefPtr<DeviceOrientation>);
diff --git a/WebCore/platform/network/ResourceHandle.h b/WebCore/platform/network/ResourceHandle.h
index 1cb9ee0..2ea42b1 100644
--- a/WebCore/platform/network/ResourceHandle.h
+++ b/WebCore/platform/network/ResourceHandle.h
@@ -46,11 +46,6 @@ typedef unsigned long DWORD;
typedef unsigned long DWORD_PTR;
typedef void* LPVOID;
typedef LPVOID HINTERNET;
-typedef unsigned WPARAM;
-typedef long LPARAM;
-typedef struct HWND__* HWND;
-typedef _W64 long LONG_PTR;
-typedef LONG_PTR LRESULT;
#endif
@@ -168,14 +163,11 @@ public:
static void forceContentSniffing();
#if USE(WININET)
- void setHasReceivedResponse(bool = true);
- bool hasReceivedResponse() const;
+ void setSynchronousInternetHandle(HINTERNET);
void fileLoadTimer(Timer<ResourceHandle>*);
- void onHandleCreated(LPARAM);
- void onRequestRedirected(LPARAM);
- void onRequestComplete(LPARAM);
- friend void __stdcall transferJobStatusCallback(HINTERNET, DWORD_PTR, DWORD, LPVOID, DWORD);
- friend LRESULT __stdcall ResourceHandleWndProc(HWND, unsigned message, WPARAM, LPARAM);
+ void onRedirect();
+ bool onRequestComplete();
+ static void CALLBACK internetStatusCallback(HINTERNET, DWORD_PTR, DWORD, LPVOID, DWORD);
#endif
#if PLATFORM(QT) || USE(CURL) || USE(SOUP) || PLATFORM(ANDROID)
diff --git a/WebCore/platform/network/ResourceHandleInternal.h b/WebCore/platform/network/ResourceHandleInternal.h
index 7b6db90..96fbf00 100644
--- a/WebCore/platform/network/ResourceHandleInternal.h
+++ b/WebCore/platform/network/ResourceHandleInternal.h
@@ -92,16 +92,13 @@ namespace WebCore {
#endif
#if USE(WININET)
, m_fileLoadTimer(loader, &ResourceHandle::fileLoadTimer)
- , m_resourceHandle(0)
- , m_secondaryHandle(0)
- , m_jobId(0)
- , m_threadId(0)
- , m_writing(false)
- , m_formDataString(0)
- , m_formDataLength(0)
+ , m_internetHandle(0)
+ , m_connectHandle(0)
+ , m_requestHandle(0)
+ , m_sentEndRequest(false)
, m_bytesRemainingToWrite(0)
+ , m_loadSynchronously(false)
, m_hasReceivedResponse(false)
- , m_resend(false)
#endif
#if USE(CURL)
, m_handle(0)
@@ -167,17 +164,15 @@ namespace WebCore {
#endif
#if USE(WININET)
Timer<ResourceHandle> m_fileLoadTimer;
- HINTERNET m_resourceHandle;
- HINTERNET m_secondaryHandle;
- unsigned m_jobId;
- DWORD m_threadId;
- bool m_writing;
- char* m_formDataString;
- int m_formDataLength;
- int m_bytesRemainingToWrite;
- String m_postReferrer;
+ HINTERNET m_internetHandle;
+ HINTERNET m_connectHandle;
+ HINTERNET m_requestHandle;
+ bool m_sentEndRequest;
+ Vector<char> m_formData;
+ size_t m_bytesRemainingToWrite;
+ bool m_loadSynchronously;
bool m_hasReceivedResponse;
- bool m_resend;
+ String m_redirectUrl;
#endif
#if USE(CURL)
CURL* m_handle;
diff --git a/WebCore/platform/network/mac/WebCoreURLResponse.mm b/WebCore/platform/network/mac/WebCoreURLResponse.mm
index 9be4714..e287e5f 100644
--- a/WebCore/platform/network/mac/WebCoreURLResponse.mm
+++ b/WebCore/platform/network/mac/WebCoreURLResponse.mm
@@ -29,7 +29,6 @@
#import "config.h"
#import "WebCoreURLResponse.h"
-#import "FoundationExtras.h"
#import "MIMETypeRegistry.h"
#import <objc/objc-class.h>
#import <wtf/Assertions.h>
@@ -327,12 +326,12 @@ static NSDictionary *createExtensionToMIMETypeMap()
];
}
-static NSString *mimeTypeFromUTITree(CFStringRef uti)
+static RetainPtr<NSString> mimeTypeFromUTITree(CFStringRef uti)
{
// Check if this UTI has a MIME type.
RetainPtr<CFStringRef> mimeType(AdoptCF, UTTypeCopyPreferredTagWithClass(uti, kUTTagClassMIMEType));
if (mimeType)
- return (NSString *)HardAutorelease(mimeType.releaseRef());
+ return (NSString *)mimeType.get();
// If not, walk the ancestory of this UTI via its "ConformsTo" tags and return the first MIME type we find.
RetainPtr<CFDictionaryRef> decl(AdoptCF, UTTypeCopyDeclaration(uti));
@@ -354,7 +353,7 @@ static NSString *mimeTypeFromUTITree(CFStringRef uti)
if (CFGetTypeID(object) != CFStringGetTypeID())
continue;
- if (NSString *mimeType = mimeTypeFromUTITree((CFStringRef)object))
+ if (RetainPtr<NSString> mimeType = mimeTypeFromUTITree((CFStringRef)object))
return mimeType;
}
}
@@ -366,13 +365,13 @@ static NSString *mimeTypeFromUTITree(CFStringRef uti)
-(void)adjustMIMETypeIfNecessary
{
- NSString *result = [self MIMEType];
- NSString *originalResult = result;
+ RetainPtr<NSString> result = [self MIMEType];
+ RetainPtr<NSString> originalResult = result;
#ifdef BUILDING_ON_TIGER
// When content sniffing is disabled, Tiger's CFNetwork automatically returns application/octet-stream for certain
// extensions even when scouring the UTI maps would end up with a better result, so we'll give a chance for that to happen.
- if ([[self URL] isFileURL] && [result caseInsensitiveCompare:@"application/octet-stream"] == NSOrderedSame)
+ if ([[self URL] isFileURL] && [result.get() caseInsensitiveCompare:@"application/octet-stream"] == NSOrderedSame)
result = nil;
#endif
@@ -403,7 +402,7 @@ static NSString *mimeTypeFromUTITree(CFStringRef uti)
#ifndef BUILDING_ON_TIGER
// <rdar://problem/5321972> Plain text document from HTTP server detected as application/octet-stream
// Make the best guess when deciding between "generic binary" and "generic text" using a table of known binary MIME types.
- if ([result isEqualToString:@"application/octet-stream"] && [self respondsToSelector:@selector(allHeaderFields)] && [[[self performSelector:@selector(allHeaderFields)] objectForKey:@"Content-Type"] hasPrefix:@"text/plain"]) {
+ if ([result.get() isEqualToString:@"application/octet-stream"] && [self respondsToSelector:@selector(allHeaderFields)] && [[[self performSelector:@selector(allHeaderFields)] objectForKey:@"Content-Type"] hasPrefix:@"text/plain"]) {
static NSSet *binaryExtensions = createBinaryExtensionsSet();
if (![binaryExtensions containsObject:[[[self suggestedFilename] pathExtension] lowercaseString]])
result = @"text/plain";
@@ -413,12 +412,12 @@ static NSString *mimeTypeFromUTITree(CFStringRef uti)
#ifdef BUILDING_ON_LEOPARD
// Workaround for <rdar://problem/5539824>
- if ([result isEqualToString:@"text/xml"])
+ if ([result.get() isEqualToString:@"text/xml"])
result = @"application/xml";
#endif
if (result != originalResult)
- [self _setMIMEType:result];
+ [self _setMIMEType:result.get()];
}
@end
diff --git a/WebCore/platform/network/qt/QNetworkReplyHandler.cpp b/WebCore/platform/network/qt/QNetworkReplyHandler.cpp
index 30f7011..ca3af75 100644
--- a/WebCore/platform/network/qt/QNetworkReplyHandler.cpp
+++ b/WebCore/platform/network/qt/QNetworkReplyHandler.cpp
@@ -161,10 +161,8 @@ QNetworkReplyHandler::QNetworkReplyHandler(ResourceHandle* handle, LoadMode load
m_method = QNetworkAccessManager::PostOperation;
else if (r.httpMethod() == "PUT")
m_method = QNetworkAccessManager::PutOperation;
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
else if (r.httpMethod() == "DELETE")
m_method = QNetworkAccessManager::DeleteOperation;
-#endif
#if QT_VERSION >= QT_VERSION_CHECK(4, 7, 0)
else if (r.httpMethod() == "OPTIONS")
m_method = QNetworkAccessManager::CustomOperation;
@@ -246,6 +244,9 @@ void QNetworkReplyHandler::finish()
if (m_shouldFinish)
return;
+ if (!m_reply)
+ return;
+
sendResponseIfNeeded();
if (!m_resourceHandle)
@@ -465,12 +466,10 @@ void QNetworkReplyHandler::start()
putDevice->setParent(m_reply);
break;
}
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
case QNetworkAccessManager::DeleteOperation: {
m_reply = manager->deleteResource(m_request);
break;
}
-#endif
#if QT_VERSION >= QT_VERSION_CHECK(4, 7, 0)
case QNetworkAccessManager::CustomOperation:
m_reply = manager->sendCustomRequest(m_request, m_resourceHandle->firstRequest().httpMethod().latin1().data());
diff --git a/WebCore/platform/network/qt/ResourceRequestQt.cpp b/WebCore/platform/network/qt/ResourceRequestQt.cpp
index 4d576c7..7e162ed 100644
--- a/WebCore/platform/network/qt/ResourceRequestQt.cpp
+++ b/WebCore/platform/network/qt/ResourceRequestQt.cpp
@@ -47,9 +47,7 @@ QNetworkRequest ResourceRequest::toNetworkRequest(QObject* originatingFrame) con
{
QNetworkRequest request;
request.setUrl(url());
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
request.setOriginatingObject(originatingFrame);
-#endif
const HTTPHeaderMap &headers = httpHeaderFields();
for (HTTPHeaderMap::const_iterator it = headers.begin(), end = headers.end();
diff --git a/WebCore/platform/network/qt/SocketStreamHandleQt.cpp b/WebCore/platform/network/qt/SocketStreamHandleQt.cpp
index e666ff7..cc508b6 100644
--- a/WebCore/platform/network/qt/SocketStreamHandleQt.cpp
+++ b/WebCore/platform/network/qt/SocketStreamHandleQt.cpp
@@ -148,12 +148,9 @@ void SocketStreamHandlePrivate::socketErrorCallback(int error)
}
#ifndef QT_NO_OPENSSL
-void SocketStreamHandlePrivate::socketSslErrors(const QList<QSslError>&)
+void SocketStreamHandlePrivate::socketSslErrors(const QList<QSslError>& error)
{
- // FIXME: based on http://tools.ietf.org/html/draft-hixie-thewebsocketprotocol-68#page-15
- // we should abort on certificate errors.
- // We don't abort while this is still work in progress.
- static_cast<QSslSocket*>(m_socket)->ignoreSslErrors();
+ QMetaObject::invokeMethod(this, "socketErrorCallback", Qt::QueuedConnection, Q_ARG(int, error[0].error()));
}
#endif
diff --git a/WebCore/platform/network/soup/ResourceHandleSoup.cpp b/WebCore/platform/network/soup/ResourceHandleSoup.cpp
index 0009e36..0d84388 100644
--- a/WebCore/platform/network/soup/ResourceHandleSoup.cpp
+++ b/WebCore/platform/network/soup/ResourceHandleSoup.cpp
@@ -866,7 +866,10 @@ static void queryInfoCallback(GObject* source, GAsyncResult* res, gpointer)
return;
}
- response.setMimeType(g_file_info_get_content_type(info));
+ // According to http://library.gnome.org/devel/gio/stable/gio-GContentType.html
+ // GContentType on Unix is the mime type, but not on Win32.
+ GOwnPtr<gchar> mimeType(g_content_type_get_mime_type(g_file_info_get_content_type(info)));
+ response.setMimeType(mimeType.get());
response.setExpectedContentLength(g_file_info_get_size(info));
GTimeVal tv;
diff --git a/WebCore/platform/network/win/ResourceHandleWin.cpp b/WebCore/platform/network/win/ResourceHandleWin.cpp
index 832a8e2..5de2e1b 100644
--- a/WebCore/platform/network/win/ResourceHandleWin.cpp
+++ b/WebCore/platform/network/win/ResourceHandleWin.cpp
@@ -27,43 +27,38 @@
#include "config.h"
#include "ResourceHandle.h"
-#include "CachedResourceLoader.h"
-#include "Document.h"
-#include "Frame.h"
-#include "FrameLoader.h"
-#include "Page.h"
+#include "HTTPParsers.h"
+#include "MIMETypeRegistry.h"
+#include "MainThread.h"
+#include "NotImplemented.h"
#include "ResourceError.h"
#include "ResourceHandleClient.h"
#include "ResourceHandleInternal.h"
-#include "ResourceHandleWin.h"
+#include "SharedBuffer.h"
#include "Timer.h"
-#include "WebCoreInstanceHandle.h"
-
+#include "UnusedParam.h"
#include <wtf/text/CString.h>
#include <windows.h>
#include <wininet.h>
namespace WebCore {
-static unsigned transferJobId = 0;
-static HashMap<int, ResourceHandle*>* jobIdMap = 0;
+static inline HINTERNET createInternetHandle(const String& userAgent, bool asynchronous)
+{
+ String userAgentString = userAgent;
+ HINTERNET internetHandle = InternetOpenW(userAgentString.charactersWithNullTermination(), INTERNET_OPEN_TYPE_PRECONFIG, 0, 0, asynchronous ? INTERNET_FLAG_ASYNC : 0);
-static HWND transferJobWindowHandle = 0;
-const LPCWSTR kResourceHandleWindowClassName = L"ResourceHandleWindowClass";
+ if (asynchronous)
+ InternetSetStatusCallback(internetHandle, &ResourceHandle::internetStatusCallback);
-// Message types for internal use (keep in sync with kMessageHandlers)
-enum {
- handleCreatedMessage = WM_USER,
- requestRedirectedMessage,
- requestCompleteMessage
-};
+ return internetHandle;
+}
-typedef void (ResourceHandle:: *ResourceHandleEventHandler)(LPARAM);
-static const ResourceHandleEventHandler messageHandlers[] = {
- &ResourceHandle::onHandleCreated,
- &ResourceHandle::onRequestRedirected,
- &ResourceHandle::onRequestComplete
-};
+static HINTERNET asynchronousInternetHandle(const String& userAgent)
+{
+ static HINTERNET internetHandle = createInternetHandle(userAgent, true);
+ return internetHandle;
+}
static String queryHTTPHeader(HINTERNET requestHandle, DWORD infoLevel)
{
@@ -79,69 +74,13 @@ static String queryHTTPHeader(HINTERNET requestHandle, DWORD infoLevel)
return String::adopt(characters);
}
-static int addToOutstandingJobs(ResourceHandle* job)
-{
- if (!jobIdMap)
- jobIdMap = new HashMap<int, ResourceHandle*>;
- transferJobId++;
- jobIdMap->set(transferJobId, job);
- return transferJobId;
-}
-
-static void removeFromOutstandingJobs(int jobId)
-{
- if (!jobIdMap)
- return;
- jobIdMap->remove(jobId);
-}
-
-static ResourceHandle* lookupResourceHandle(int jobId)
-{
- if (!jobIdMap)
- return 0;
- return jobIdMap->get(jobId);
-}
-
-static LRESULT CALLBACK ResourceHandleWndProc(HWND hWnd, UINT message,
- WPARAM wParam, LPARAM lParam)
-{
- if (message >= handleCreatedMessage) {
- UINT index = message - handleCreatedMessage;
- if (index < _countof(messageHandlers)) {
- unsigned jobId = (unsigned) wParam;
- ResourceHandle* job = lookupResourceHandle(jobId);
- if (job) {
- ASSERT(job->d->m_jobId == jobId);
- ASSERT(job->d->m_threadId == GetCurrentThreadId());
- (job->*(messageHandlers[index]))(lParam);
- }
- return 0;
- }
- }
- return DefWindowProc(hWnd, message, wParam, lParam);
-}
-
-static void initializeOffScreenResourceHandleWindow()
-{
- if (transferJobWindowHandle)
- return;
-
- WNDCLASSEX wcex;
- memset(&wcex, 0, sizeof(WNDCLASSEX));
- wcex.cbSize = sizeof(WNDCLASSEX);
- wcex.lpfnWndProc = ResourceHandleWndProc;
- wcex.hInstance = WebCore::instanceHandle();
- wcex.lpszClassName = kResourceHandleWindowClassName;
- RegisterClassEx(&wcex);
-
- transferJobWindowHandle = CreateWindow(kResourceHandleWindowClassName, 0, 0, CW_USEDEFAULT, 0, CW_USEDEFAULT, 0,
- HWND_MESSAGE, 0, WebCore::instanceHandle(), 0);
-}
-
class WebCoreSynchronousLoader : public ResourceHandleClient, public Noncopyable {
public:
WebCoreSynchronousLoader(ResourceError&, ResourceResponse&, Vector<char>&, const String& userAgent);
+ ~WebCoreSynchronousLoader();
+
+ HINTERNET internetHandle() const { return m_internetHandle; }
virtual void didReceiveResponse(ResourceHandle*, const ResourceResponse&);
virtual void didReceiveData(ResourceHandle*, const char*, int, int lengthReceived);
@@ -152,13 +91,20 @@ private:
ResourceError& m_error;
ResourceResponse& m_response;
Vector<char>& m_data;
+ HINTERNET m_internetHandle;
};
WebCoreSynchronousLoader::WebCoreSynchronousLoader(ResourceError& error, ResourceResponse& response, Vector<char>& data, const String& userAgent)
: m_error(error)
, m_response(response)
, m_data(data)
+ , m_internetHandle(createInternetHandle(userAgent, false))
+{
+}
+
+WebCoreSynchronousLoader::~WebCoreSynchronousLoader()
{
+ InternetCloseHandle(m_internetHandle);
}
void WebCoreSynchronousLoader::didReceiveResponse(ResourceHandle*, const ResourceResponse& response)
@@ -183,107 +129,79 @@ void WebCoreSynchronousLoader::didFail(ResourceHandle*, const ResourceError& err
ResourceHandleInternal::~ResourceHandleInternal()
{
- if (m_fileHandle != INVALID_HANDLE_VALUE)
- CloseHandle(m_fileHandle);
}
ResourceHandle::~ResourceHandle()
{
- if (d->m_jobId)
- removeFromOutstandingJobs(d->m_jobId);
}
-void ResourceHandle::onHandleCreated(LPARAM lParam)
+static void callOnRedirect(void* context)
{
- if (!d->m_resourceHandle) {
- d->m_resourceHandle = HINTERNET(lParam);
- if (d->status != 0) {
- // We were canceled before Windows actually created a handle for us, close and delete now.
- InternetCloseHandle(d->m_resourceHandle);
- delete this;
- return;
- }
+ ResourceHandle* handle = static_cast<ResourceHandle*>(context);
+ handle->onRedirect();
+}
- if (request().httpMethod() == "POST") {
- // FIXME: Too late to set referrer properly.
- String urlStr = request().url().path();
- int fragmentIndex = urlStr.find('#');
- if (fragmentIndex != -1)
- urlStr = urlStr.left(fragmentIndex);
- static LPCSTR accept[2]={"*/*", NULL};
- HINTERNET urlHandle = HttpOpenRequestA(d->m_resourceHandle,
- "POST", urlStr.latin1().data(), 0, 0, accept,
- INTERNET_FLAG_KEEP_CONNECTION |
- INTERNET_FLAG_FORMS_SUBMIT |
- INTERNET_FLAG_RELOAD |
- INTERNET_FLAG_NO_CACHE_WRITE |
- INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTPS |
- INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTP,
- (DWORD_PTR)d->m_jobId);
- if (urlHandle == INVALID_HANDLE_VALUE) {
- InternetCloseHandle(d->m_resourceHandle);
- delete this;
- }
- }
- } else if (!d->m_secondaryHandle) {
- assert(request().httpMethod() == "POST");
- d->m_secondaryHandle = HINTERNET(lParam);
-
- // Need to actually send the request now.
- String headers = "Content-Type: application/x-www-form-urlencoded\n";
- headers += "Referer: ";
- headers += d->m_postReferrer;
- headers += "\n";
- const CString& headersLatin1 = headers.latin1();
- String formData = request().httpBody()->flattenToString();
- INTERNET_BUFFERSA buffers;
- memset(&buffers, 0, sizeof(buffers));
- buffers.dwStructSize = sizeof(INTERNET_BUFFERSA);
- buffers.lpcszHeader = headersLatin1.data();
- buffers.dwHeadersLength = headers.length();
- buffers.dwBufferTotal = formData.length();
-
- d->m_bytesRemainingToWrite = formData.length();
- d->m_formDataString = (char*)malloc(formData.length());
- d->m_formDataLength = formData.length();
- strncpy(d->m_formDataString, formData.latin1().data(), formData.length());
- d->m_writing = true;
- HttpSendRequestExA(d->m_secondaryHandle, &buffers, 0, 0, (DWORD_PTR)d->m_jobId);
- // FIXME: add proper error handling
+static void callOnRequestComplete(void* context)
+{
+ ResourceHandle* handle = static_cast<ResourceHandle*>(context);
+ handle->onRequestComplete();
+}
+
+void ResourceHandle::internetStatusCallback(HINTERNET internetHandle, DWORD_PTR context, DWORD internetStatus,
+ LPVOID statusInformation, DWORD statusInformationLength)
+{
+ ResourceHandle* handle = reinterpret_cast<ResourceHandle*>(context);
+
+ switch (internetStatus) {
+ case INTERNET_STATUS_REDIRECT:
+ handle->d->m_redirectUrl = String(static_cast<UChar*>(statusInformation), statusInformationLength);
+ callOnMainThread(callOnRedirect, handle);
+ break;
+
+ case INTERNET_STATUS_REQUEST_COMPLETE:
+ callOnMainThread(callOnRequestComplete, handle);
+ break;
+
+ default:
+ break;
}
}
-void ResourceHandle::onRequestRedirected(LPARAM lParam)
+void ResourceHandle::onRedirect()
{
- // If already canceled, then ignore this event.
- if (d->status != 0)
- return;
+ ResourceRequest newRequest = firstRequest();
+ newRequest.setURL(KURL(ParsedURLString, d->m_redirectUrl));
+
+ ResourceResponse response(firstRequest().url(), String(), 0, String(), String());
- ResourceRequest request((StringImpl*) lParam);
- ResourceResponse redirectResponse;
- client()->willSendRequest(this, request, redirectResponse);
+ if (ResourceHandleClient* resourceHandleClient = client())
+ resourceHandleClient->willSendRequest(this, newRequest, response);
}
-void ResourceHandle::onRequestComplete(LPARAM lParam)
+bool ResourceHandle::onRequestComplete()
{
- if (d->m_writing) {
+ if (!d->m_internetHandle) { // 0 if canceled.
+ deref(); // balances ref in start
+ return false;
+ }
+
+ if (d->m_bytesRemainingToWrite) {
DWORD bytesWritten;
- InternetWriteFile(d->m_secondaryHandle,
- d->m_formDataString + (d->m_formDataLength - d->m_bytesRemainingToWrite),
+ InternetWriteFile(d->m_requestHandle,
+ d->m_formData.data() + (d->m_formData.size() - d->m_bytesRemainingToWrite),
d->m_bytesRemainingToWrite,
&bytesWritten);
d->m_bytesRemainingToWrite -= bytesWritten;
- if (!d->m_bytesRemainingToWrite) {
- // End the request.
- d->m_writing = false;
- HttpEndRequest(d->m_secondaryHandle, 0, 0, (DWORD_PTR)d->m_jobId);
- free(d->m_formDataString);
- d->m_formDataString = 0;
- }
- return;
+ if (d->m_bytesRemainingToWrite)
+ return true;
+ d->m_formData.clear();
}
- HINTERNET handle = (request().httpMethod() == "POST") ? d->m_secondaryHandle : d->m_resourceHandle;
+ if (!d->m_sentEndRequest) {
+ HttpEndRequestW(d->m_requestHandle, 0, 0, reinterpret_cast<DWORD_PTR>(this));
+ d->m_sentEndRequest = true;
+ return true;
+ }
static const int bufferSize = 32768;
char buffer[bufferSize];
@@ -293,9 +211,10 @@ void ResourceHandle::onRequestComplete(LPARAM lParam)
buffers.dwBufferLength = bufferSize;
BOOL ok = FALSE;
- while ((ok = InternetReadFileExA(handle, &buffers, IRF_NO_WAIT, (DWORD_PTR)this)) && buffers.dwBufferLength) {
- if (!hasReceivedResponse()) {
- setHasReceivedResponse();
+ while ((ok = InternetReadFileExA(d->m_requestHandle, &buffers, d->m_loadSynchronously ? 0 : IRF_NO_WAIT, reinterpret_cast<DWORD_PTR>(this))) && buffers.dwBufferLength) {
+ if (!d->m_hasReceivedResponse) {
+ d->m_hasReceivedResponse = true;
+
ResourceResponse response;
response.setURL(firstRequest().url());
@@ -317,160 +236,112 @@ void ResourceHandle::onRequestComplete(LPARAM lParam)
response.setTextEncodingName(extractCharsetFromMediaType(httpContentType));
}
- client()->didReceiveResponse(this, response);
+ if (ResourceHandleClient* resourceHandleClient = client())
+ resourceHandleClient->didReceiveResponse(this, response);
}
- client()->didReceiveData(this, buffer, buffers.dwBufferLength, 0);
+
+ if (ResourceHandleClient* resourceHandleClient = client())
+ resourceHandleClient->didReceiveData(this, buffer, buffers.dwBufferLength, 0);
buffers.dwBufferLength = bufferSize;
}
- PlatformDataStruct platformData;
- platformData.errorString = 0;
- platformData.error = 0;
- platformData.loaded = ok;
-
- if (!ok) {
- int error = GetLastError();
- if (error == ERROR_IO_PENDING)
- return;
- DWORD errorStringChars = 0;
- if (!InternetGetLastResponseInfo(&platformData.error, 0, &errorStringChars)) {
- if (GetLastError() == ERROR_INSUFFICIENT_BUFFER) {
- platformData.errorString = new TCHAR[errorStringChars];
- InternetGetLastResponseInfo(&platformData.error, platformData.errorString, &errorStringChars);
- }
- }
-#ifdef RESOURCE_LOADER_DEBUG
- char buf[64];
- _snprintf(buf, sizeof(buf), "Load error: %i\n", error);
- OutputDebugStringA(buf);
-#endif
- }
-
- if (d->m_secondaryHandle)
- InternetCloseHandle(d->m_secondaryHandle);
- InternetCloseHandle(d->m_resourceHandle);
+ if (!ok && GetLastError() == ERROR_IO_PENDING)
+ return true;
- client()->didFinishLoading(this, 0);
- delete this;
+ if (ResourceHandleClient* resourceHandleClient = client())
+ resourceHandleClient->didFinishLoading(this, 0);
+
+ InternetCloseHandle(d->m_requestHandle);
+ InternetCloseHandle(d->m_connectHandle);
+ deref(); // balances ref in start
+ return false;
}
-static void __stdcall transferJobStatusCallback(HINTERNET internetHandle,
- DWORD_PTR jobId,
- DWORD internetStatus,
- LPVOID statusInformation,
- DWORD statusInformationLength)
+bool ResourceHandle::start(NetworkingContext* context)
{
-#ifdef RESOURCE_LOADER_DEBUG
- char buf[64];
- _snprintf(buf, sizeof(buf), "status-callback: status=%u, job=%p\n",
- internetStatus, jobId);
- OutputDebugStringA(buf);
-#endif
+ if (request().url().isLocalFile()) {
+ ref(); // balanced by deref in fileLoadTimer
+ if (d->m_loadSynchronously)
+ fileLoadTimer(0);
+ else
+ d->m_fileLoadTimer.startOneShot(0.0);
+ return true;
+ }
- UINT msg;
- LPARAM lParam;
+ if (!d->m_internetHandle)
+ d->m_internetHandle = asynchronousInternetHandle(context->userAgent());
- switch (internetStatus) {
- case INTERNET_STATUS_HANDLE_CREATED:
- // tell the main thread about the newly created handle
- msg = handleCreatedMessage;
- lParam = (LPARAM) LPINTERNET_ASYNC_RESULT(statusInformation)->dwResult;
- break;
- case INTERNET_STATUS_REQUEST_COMPLETE:
-#ifdef RESOURCE_LOADER_DEBUG
- _snprintf(buf, sizeof(buf), "request-complete: result=%p, error=%u\n",
- LPINTERNET_ASYNC_RESULT(statusInformation)->dwResult,
- LPINTERNET_ASYNC_RESULT(statusInformation)->dwError);
- OutputDebugStringA(buf);
-#endif
- // tell the main thread that the request is done
- msg = requestCompleteMessage;
- lParam = 0;
- break;
- case INTERNET_STATUS_REDIRECT:
- // tell the main thread to observe this redirect (FIXME: we probably
- // need to block the redirect at this point so the application can
- // decide whether or not to follow the redirect)
- msg = requestRedirectedMessage;
- lParam = (LPARAM) StringImpl::create((const UChar*) statusInformation,
- statusInformationLength).releaseRef();
- break;
- case INTERNET_STATUS_USER_INPUT_REQUIRED:
- // FIXME: prompt the user if necessary
- ResumeSuspendedDownload(internetHandle, 0);
- case INTERNET_STATUS_STATE_CHANGE:
- // may need to call ResumeSuspendedDownload here as well
- default:
- return;
+ if (!d->m_internetHandle)
+ return false;
+
+ DWORD flags = INTERNET_FLAG_KEEP_CONNECTION
+ | INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTPS
+ | INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTP;
+
+ d->m_connectHandle = InternetConnectW(d->m_internetHandle, firstRequest().url().host().charactersWithNullTermination(), firstRequest().url().port(),
+ 0, 0, INTERNET_SERVICE_HTTP, flags, reinterpret_cast<DWORD_PTR>(this));
+
+ if (!d->m_connectHandle)
+ return false;
+
+ String urlStr = firstRequest().url().path();
+ String urlQuery = firstRequest().url().query();
+
+ if (!urlQuery.isEmpty()) {
+ urlStr.append('?');
+ urlStr.append(urlQuery);
}
- PostMessage(transferJobWindowHandle, msg, (WPARAM) jobId, lParam);
-}
+ String httpMethod = firstRequest().httpMethod();
+ String httpReferrer = firstRequest().httpReferrer();
-bool ResourceHandle::start(NetworkingContext* context)
-{
- ref();
- if (request().url().isLocalFile()) {
- d->m_fileLoadTimer.startOneShot(0.0);
- return true;
- } else {
- static HINTERNET internetHandle = 0;
- if (!internetHandle) {
- String userAgentStr = context->userAgent() + String("", 1);
- LPCWSTR userAgent = reinterpret_cast<const WCHAR*>(userAgentStr.characters());
- // leak the Internet for now
- internetHandle = InternetOpen(userAgent, INTERNET_OPEN_TYPE_PRECONFIG, 0, 0, INTERNET_FLAG_ASYNC);
- }
- if (!internetHandle) {
- delete this;
- return false;
- }
- static INTERNET_STATUS_CALLBACK callbackHandle =
- InternetSetStatusCallback(internetHandle, transferJobStatusCallback);
-
- initializeOffScreenResourceHandleWindow();
- d->m_jobId = addToOutstandingJobs(this);
-
- DWORD flags =
- INTERNET_FLAG_KEEP_CONNECTION |
- INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTPS |
- INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTP;
-
- // For form posting, we can't use InternetOpenURL. We have to use
- // InternetConnect followed by HttpSendRequest.
- HINTERNET urlHandle;
- String referrer = context->referrer();
- if (request().httpMethod() == "POST") {
- d->m_postReferrer = referrer;
- String host = request().url().host();
- urlHandle = InternetConnectA(internetHandle, host.latin1().data(),
- request().url().port(),
- NULL, // no username
- NULL, // no password
- INTERNET_SERVICE_HTTP,
- flags, (DWORD_PTR)d->m_jobId);
- } else {
- String urlStr = request().url().string();
- int fragmentIndex = urlStr.find('#');
- if (fragmentIndex != -1)
- urlStr = urlStr.left(fragmentIndex);
- String headers;
- if (!referrer.isEmpty())
- headers += String("Referer: ") + referrer + "\r\n";
-
- urlHandle = InternetOpenUrlA(internetHandle, urlStr.latin1().data(),
- headers.latin1().data(), headers.length(),
- flags, (DWORD_PTR)d->m_jobId);
- }
+ LPCWSTR httpAccept[] = { L"*/*", 0 };
- if (urlHandle == INVALID_HANDLE_VALUE) {
- delete this;
- return false;
- }
- d->m_threadId = GetCurrentThreadId();
+ d->m_requestHandle = HttpOpenRequestW(d->m_connectHandle, httpMethod.charactersWithNullTermination(), urlStr.charactersWithNullTermination(),
+ 0, httpReferrer.charactersWithNullTermination(), httpAccept, flags, reinterpret_cast<DWORD_PTR>(this));
- return true;
+ if (!d->m_requestHandle) {
+ InternetCloseHandle(d->m_connectHandle);
+ return false;
+ }
+
+ if (firstRequest().httpBody()) {
+ firstRequest().httpBody()->flatten(d->m_formData);
+ d->m_bytesRemainingToWrite = d->m_formData.size();
+ }
+
+ Vector<UChar> httpHeaders;
+ const HTTPHeaderMap& httpHeaderFields = firstRequest().httpHeaderFields();
+
+ for (HTTPHeaderMap::const_iterator it = httpHeaderFields.begin(); it != httpHeaderFields.end(); ++it) {
+ if (equalIgnoringCase(it->first, "Accept") || equalIgnoringCase(it->first, "Referer") || equalIgnoringCase(it->first, "User-Agent"))
+ continue;
+
+ if (!httpHeaders.isEmpty())
+ httpHeaders.append('\n');
+
+ httpHeaders.append(it->first.characters(), it->first.length());
+ httpHeaders.append(':');
+ httpHeaders.append(it->second.characters(), it->second.length());
}
+
+ INTERNET_BUFFERSW internetBuffers;
+ ZeroMemory(&internetBuffers, sizeof(internetBuffers));
+ internetBuffers.dwStructSize = sizeof(internetBuffers);
+ internetBuffers.lpcszHeader = httpHeaders.data();
+ internetBuffers.dwHeadersLength = httpHeaders.size();
+ internetBuffers.dwBufferTotal = d->m_bytesRemainingToWrite;
+
+ HttpSendRequestExW(d->m_requestHandle, &internetBuffers, 0, 0, reinterpret_cast<DWORD_PTR>(this));
+
+ ref(); // balanced by deref in onRequestComplete
+
+ if (d->m_loadSynchronously)
+ while (onRequestComplete()) {
+ // Loop until finished.
+ }
+
+ return true;
}
void ResourceHandle::fileLoadTimer(Timer<ResourceHandle>*)
@@ -517,37 +388,29 @@ void ResourceHandle::fileLoadTimer(Timer<ResourceHandle>*)
void ResourceHandle::cancel()
{
- if (d->m_resourceHandle)
- InternetCloseHandle(d->m_resourceHandle);
- else
+ if (d->m_requestHandle) {
+ d->m_internetHandle = 0;
+ InternetCloseHandle(d->m_requestHandle);
+ InternetCloseHandle(d->m_connectHandle);
+ } else
d->m_fileLoadTimer.stop();
-
- client()->didFinishLoading(this, 0);
-
- if (!d->m_resourceHandle)
- // Async load canceled before we have a handle -- mark ourselves as in error, to be deleted later.
- // FIXME: need real cancel error
- client()->didFail(this, ResourceError());
}
-void ResourceHandle::loadResourceSynchronously(const ResourceRequest& request, StoredCredentials storedCredentials, ResourceError& error, ResourceResponse& response, Vector<char>& data, Frame* frame)
+void ResourceHandle::loadResourceSynchronously(NetworkingContext* context, const ResourceRequest& request, StoredCredentials storedCredentials, ResourceError& error, ResourceResponse& response, Vector<char>& data)
{
UNUSED_PARAM(storedCredentials);
WebCoreSynchronousLoader syncLoader(error, response, data, request.httpUserAgent());
ResourceHandle handle(request, &syncLoader, true, false);
- handle.start(frame);
-}
-
-void ResourceHandle::setHasReceivedResponse(bool b)
-{
- d->m_hasReceivedResponse = b;
+ handle.setSynchronousInternetHandle(syncLoader.internetHandle());
+ handle.start(context);
}
-bool ResourceHandle::hasReceivedResponse() const
+void ResourceHandle::setSynchronousInternetHandle(HINTERNET internetHandle)
{
- return d->m_hasReceivedResponse;
+ d->m_internetHandle = internetHandle;
+ d->m_loadSynchronously = true;
}
bool ResourceHandle::willLoadFromCache(ResourceRequest&, Frame*)
diff --git a/WebCore/platform/qt/ClipboardQt.cpp b/WebCore/platform/qt/ClipboardQt.cpp
index 6cbde0c..90e3bfe 100644
--- a/WebCore/platform/qt/ClipboardQt.cpp
+++ b/WebCore/platform/qt/ClipboardQt.cpp
@@ -75,15 +75,15 @@ PassRefPtr<Clipboard> Clipboard::create(ClipboardAccessPolicy policy, DragData*
}
ClipboardQt::ClipboardQt(ClipboardAccessPolicy policy, const QMimeData* readableClipboard)
- : Clipboard(policy, true)
+ : Clipboard(policy, DragAndDrop)
, m_readableData(readableClipboard)
, m_writableData(0)
{
Q_ASSERT(policy == ClipboardReadable || policy == ClipboardTypesReadable);
}
-ClipboardQt::ClipboardQt(ClipboardAccessPolicy policy, bool forDragging)
- : Clipboard(policy, forDragging)
+ClipboardQt::ClipboardQt(ClipboardAccessPolicy policy, ClipboardType clipboardType)
+ : Clipboard(policy, clipboardType)
, m_readableData(0)
, m_writableData(0)
{
@@ -91,7 +91,7 @@ ClipboardQt::ClipboardQt(ClipboardAccessPolicy policy, bool forDragging)
#ifndef QT_NO_CLIPBOARD
if (policy != ClipboardWritable) {
- Q_ASSERT(!forDragging);
+ Q_ASSERT(isForCopyAndPaste());
m_readableData = QApplication::clipboard()->mimeData();
}
#endif
@@ -99,7 +99,7 @@ ClipboardQt::ClipboardQt(ClipboardAccessPolicy policy, bool forDragging)
ClipboardQt::~ClipboardQt()
{
- if (m_writableData && !isForDragging())
+ if (m_writableData && isForCopyAndPaste())
m_writableData = 0;
else
delete m_writableData;
@@ -114,13 +114,13 @@ void ClipboardQt::clearData(const String& type)
if (m_writableData) {
m_writableData->removeFormat(type);
if (m_writableData->formats().isEmpty()) {
- if (isForDragging())
+ if (isForDragAndDrop())
delete m_writableData;
m_writableData = 0;
}
}
#ifndef QT_NO_CLIPBOARD
- if (!isForDragging())
+ if (isForCopyAndPaste())
QApplication::clipboard()->setMimeData(m_writableData);
#endif
}
@@ -131,7 +131,7 @@ void ClipboardQt::clearAllData()
return;
#ifndef QT_NO_CLIPBOARD
- if (!isForDragging())
+ if (isForCopyAndPaste())
QApplication::clipboard()->setMimeData(0);
else
#endif
@@ -182,7 +182,7 @@ bool ClipboardQt::setData(const String& type, const String& data)
}
#ifndef QT_NO_CLIPBOARD
- if (!isForDragging())
+ if (isForCopyAndPaste())
QApplication::clipboard()->setMimeData(m_writableData);
#endif
return true;
@@ -287,7 +287,7 @@ void ClipboardQt::declareAndWriteDragImage(Element* element, const KURL& url, co
m_writableData->setText(title);
m_writableData->setUrls(urls);
#ifndef QT_NO_CLIPBOARD
- if (!isForDragging())
+ if (isForCopyAndPaste())
QApplication::clipboard()->setMimeData(m_writableData);
#endif
}
@@ -303,7 +303,7 @@ void ClipboardQt::writeURL(const KURL& url, const String& title, Frame* frame)
m_writableData->setUrls(urls);
m_writableData->setText(title);
#ifndef QT_NO_CLIPBOARD
- if (!isForDragging())
+ if (isForCopyAndPaste())
QApplication::clipboard()->setMimeData(m_writableData);
#endif
}
@@ -320,7 +320,7 @@ void ClipboardQt::writeRange(Range* range, Frame* frame)
m_writableData->setText(text);
m_writableData->setHtml(createMarkup(range, 0, AnnotateForInterchange, false, AbsoluteURLs));
#ifndef QT_NO_CLIPBOARD
- if (!isForDragging())
+ if (isForCopyAndPaste())
QApplication::clipboard()->setMimeData(m_writableData);
#endif
}
@@ -333,7 +333,7 @@ void ClipboardQt::writePlainText(const String& str)
text.replace(QChar(0xa0), QLatin1Char(' '));
m_writableData->setText(text);
#ifndef QT_NO_CLIPBOARD
- if (!isForDragging())
+ if (isForCopyAndPaste())
QApplication::clipboard()->setMimeData(m_writableData);
#endif
}
diff --git a/WebCore/platform/qt/ClipboardQt.h b/WebCore/platform/qt/ClipboardQt.h
index 9b54d5f..5aca1a6 100644
--- a/WebCore/platform/qt/ClipboardQt.h
+++ b/WebCore/platform/qt/ClipboardQt.h
@@ -44,9 +44,9 @@ namespace WebCore {
{
return adoptRef(new ClipboardQt(policy, readableClipboard));
}
- static PassRefPtr<ClipboardQt> create(ClipboardAccessPolicy policy, bool forDragging = false)
+ static PassRefPtr<ClipboardQt> create(ClipboardAccessPolicy policy, ClipboardType clipboardType = CopyAndPaste)
{
- return adoptRef(new ClipboardQt(policy, forDragging));
+ return adoptRef(new ClipboardQt(policy, clipboardType));
}
virtual ~ClipboardQt();
@@ -77,7 +77,7 @@ namespace WebCore {
ClipboardQt(ClipboardAccessPolicy, const QMimeData* readableClipboard);
// Clipboard is writable so it will create its own QMimeData object
- ClipboardQt(ClipboardAccessPolicy, bool forDragging);
+ ClipboardQt(ClipboardAccessPolicy, ClipboardType);
void setDragImage(CachedImage*, Node*, const IntPoint& loc);
diff --git a/WebCore/platform/qt/QWebPageClient.h b/WebCore/platform/qt/QWebPageClient.h
index a0a0218..9301cd5 100644
--- a/WebCore/platform/qt/QWebPageClient.h
+++ b/WebCore/platform/qt/QWebPageClient.h
@@ -58,9 +58,7 @@ public:
virtual bool allowsAcceleratedCompositing() const { return false; }
#endif
-#if QT_VERSION >= 0x040600
virtual void setInputMethodHints(Qt::InputMethodHints hint) = 0;
-#endif
#ifndef QT_NO_CURSOR
inline void resetCursor()
diff --git a/WebCore/platform/qt/RenderThemeQt.cpp b/WebCore/platform/qt/RenderThemeQt.cpp
index 4a461ac..7388b76 100644
--- a/WebCore/platform/qt/RenderThemeQt.cpp
+++ b/WebCore/platform/qt/RenderThemeQt.cpp
@@ -219,7 +219,7 @@ String RenderThemeQt::extraDefaultStyleSheet()
result += String(themeQtNoListboxesUserAgentStyleSheet, sizeof(themeQtNoListboxesUserAgentStyleSheet));
#endif
#if USE(QT_MOBILE_THEME)
- result += String(themeQtMaemo5UserAgentStyleSheet, sizeof(themeQtMaemo5UserAgentStyleSheet));
+ result += String(themeQtMobileUserAgentStyleSheet, sizeof(themeQtMobileUserAgentStyleSheet));
#endif
return result;
}
diff --git a/WebCore/platform/qt/TemporaryLinkStubsQt.cpp b/WebCore/platform/qt/TemporaryLinkStubsQt.cpp
index 51e25b8..15933e8 100644
--- a/WebCore/platform/qt/TemporaryLinkStubsQt.cpp
+++ b/WebCore/platform/qt/TemporaryLinkStubsQt.cpp
@@ -87,6 +87,19 @@ bool PluginDatabase::isPreferredPluginDirectory(const String& directory)
notImplemented();
return false;
}
+
+void PluginView::privateBrowsingStateChanged(bool)
+{
+}
+
+PassRefPtr<JSC::Bindings::Instance> PluginView::bindingInstance()
+{
+ return 0;
+}
+
+void PluginView::setJavaScriptPaused(bool)
+{
+}
#endif
namespace WebCore {
diff --git a/WebCore/platform/sql/SQLiteFileSystem.cpp b/WebCore/platform/sql/SQLiteFileSystem.cpp
index c9583eb..d487b95 100644
--- a/WebCore/platform/sql/SQLiteFileSystem.cpp
+++ b/WebCore/platform/sql/SQLiteFileSystem.cpp
@@ -28,12 +28,14 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#define __STDC_FORMAT_MACROS
#include "config.h"
#include "SQLiteFileSystem.h"
#include "FileSystem.h"
#include "SQLiteDatabase.h"
#include "SQLiteStatement.h"
+#include <inttypes.h>
#include <sqlite3.h>
namespace WebCore {
@@ -73,10 +75,10 @@ String SQLiteFileSystem::getFileNameForNewDatabase(const String& dbDir, const St
String fileName;
do {
++seq;
- fileName = pathByAppendingComponent(dbDir, String::format("%016llx.db", seq));
+ fileName = pathByAppendingComponent(dbDir, String::format("%016"PRIx64".db", seq));
} while (fileExists(fileName));
- return String::format("%016llx.db", seq);
+ return String::format("%016"PRIx64".db", seq);
}
String SQLiteFileSystem::appendDatabaseFileNameToPath(const String& path, const String& fileName)
diff --git a/WebCore/platform/sql/chromium/SQLiteFileSystemChromiumPosix.cpp b/WebCore/platform/sql/chromium/SQLiteFileSystemChromiumPosix.cpp
index 6549936..1102df5 100644
--- a/WebCore/platform/sql/chromium/SQLiteFileSystemChromiumPosix.cpp
+++ b/WebCore/platform/sql/chromium/SQLiteFileSystemChromiumPosix.cpp
@@ -34,23 +34,938 @@
#include "ChromiumBridge.h"
#include <sqlite3.h>
+#include <errno.h>
#include <fcntl.h>
#include <string.h>
+#include <sys/stat.h>
+#include <sys/time.h>
+#include <sys/types.h>
#include <unistd.h>
using namespace WebCore;
-// Defined in Chromium's codebase in third_party/sqlite/src/os_unix.c
-extern "C" {
-void chromium_sqlite3_initialize_unix_sqlite3_file(sqlite3_file* file);
-int chromium_sqlite3_fill_in_unix_sqlite3_file(sqlite3_vfs* vfs, int fd, int dirfd, sqlite3_file* file, const char* fileName, int noLock);
-int chromium_sqlite3_get_reusable_file_handle(sqlite3_file* file, const char* fileName, int flags, int* fd);
-void chromium_sqlite3_update_reusable_file_handle(sqlite3_file* file, int fd, int flags);
-void chromium_sqlite3_destroy_reusable_file_handle(sqlite3_file* file);
+// Chromium's Posix implementation of SQLite VFS.
+// This is heavily based on SQLite's os_unix.c,
+// without parts we don't need.
+
+// Identifies a file by its device number and inode.
+struct ChromiumFileId {
+ dev_t dev; // Device number.
+ ino_t ino; // Inode number.
+};
+
+// Information about file locks (one per open inode). Note that many open
+// file descriptors may refer to the same inode.
+struct ChromiumLockInfo {
+ ChromiumFileId lockKey; // File identifier.
+ int cnt; // Number of shared locks held.
+ int locktype; // Type of the lock.
+ int nRef; // Reference count.
+
+ // Double-linked list pointers.
+ ChromiumLockInfo* pNext;
+ ChromiumLockInfo* pPrev;
+};
+
+// Information about a file descriptor that cannot be closed immediately.
+struct ChromiumUnusedFd {
+ int fd; // File descriptor.
+ int flags; // Flags this file descriptor was opened with.
+ ChromiumUnusedFd* pNext; // Next unused file descriptor on the same file.
+};
+
+// Information about an open inode. When we want to close an inode
+// that still has locks, we defer the close until all locks are cleared.
+struct ChromiumOpenInfo {
+ ChromiumFileId fileId; // The lookup key.
+ int nRef; // Reference count.
+ int nLock; // Number of outstanding locks.
+ ChromiumUnusedFd* pUnused; // List of file descriptors to close.
+
+ // Double-linked list pointers.
+ ChromiumOpenInfo* pNext;
+ ChromiumOpenInfo* pPrev;
+};
+
+// Keep track of locks and inodes in double-linked lists.
+static struct ChromiumLockInfo* lockList = 0;
+static struct ChromiumOpenInfo* openList = 0;
+
+// Extension of sqlite3_file specific to the chromium VFS.
+struct ChromiumFile {
+ sqlite3_io_methods const* pMethod; // Implementation of sqlite3_file.
+ ChromiumOpenInfo* pOpen; // Information about all open file descriptors for this file.
+ ChromiumLockInfo* pLock; // Information about all locks for this file.
+ int h; // File descriptor.
+ int dirfd; // File descriptor for the file directory.
+ unsigned char locktype; // Type of the lock used for this file.
+ int lastErrno; // Value of errno for last operation on this file.
+ ChromiumUnusedFd* pUnused; // Information about unused file descriptors for this file.
+};
+
+// The following constants specify the range of bytes used for locking.
+// SQLiteSharedSize is the number of bytes available in the pool from which
+// a random byte is selected for a shared lock. The pool of bytes for
+// shared locks begins at SQLiteSharedFirstByte.
+// The values are the same as used by SQLite for compatibility.
+static const off_t SQLitePendingByte = 0x40000000;
+static const off_t SQLiteReservedByte = SQLitePendingByte + 1;
+static const off_t SQLiteSharedFirstByte = SQLitePendingByte + 2;
+static const off_t SQLiteSharedSize = 510;
+
+// Maps a POSIX error code to an SQLite error code.
+static int sqliteErrorFromPosixError(int posixError, int sqliteIOErr)
+{
+ switch (posixError) {
+ case 0:
+ return SQLITE_OK;
+ case EAGAIN:
+ case ETIMEDOUT:
+ case EBUSY:
+ case EINTR:
+ case ENOLCK:
+ return SQLITE_BUSY;
+ case EACCES:
+ // EACCES is like EAGAIN during locking operations.
+ if ((sqliteIOErr == SQLITE_IOERR_LOCK) ||
+ (sqliteIOErr == SQLITE_IOERR_UNLOCK) ||
+ (sqliteIOErr == SQLITE_IOERR_RDLOCK) ||
+ (sqliteIOErr == SQLITE_IOERR_CHECKRESERVEDLOCK))
+ return SQLITE_BUSY;
+ return SQLITE_PERM;
+ case EPERM:
+ return SQLITE_PERM;
+ case EDEADLK:
+ return SQLITE_IOERR_BLOCKED;
+ default:
+ return sqliteIOErr;
+ }
+}
+
+// Releases a ChromiumLockInfo structure previously allocated by findLockInfo().
+static void releaseLockInfo(ChromiumLockInfo* pLock)
+{
+ if (!pLock)
+ return;
+
+ pLock->nRef--;
+ if (pLock->nRef > 0)
+ return;
+
+ if (pLock->pPrev) {
+ ASSERT(pLock->pPrev->pNext == pLock);
+ pLock->pPrev->pNext = pLock->pNext;
+ } else {
+ ASSERT(lockList == pLock);
+ lockList = pLock->pNext;
+ }
+ if (pLock->pNext) {
+ ASSERT(pLock->pNext->pPrev == pLock);
+ pLock->pNext->pPrev = pLock->pPrev;
+ }
+
+ sqlite3_free(pLock);
+}
+
+// Releases a ChromiumOpenInfo structure previously allocated by findLockInfo().
+static void releaseOpenInfo(ChromiumOpenInfo* pOpen)
+{
+ if (!pOpen)
+ return;
+
+ pOpen->nRef--;
+ if (pOpen->nRef > 0)
+ return;
+
+ if (pOpen->pPrev) {
+ ASSERT(pOpen->pPrev->pNext == pOpen);
+ pOpen->pPrev->pNext = pOpen->pNext;
+ } else {
+ ASSERT(openList == pOpen);
+ openList = pOpen->pNext;
+ }
+ if (pOpen->pNext) {
+ ASSERT(pOpen->pNext->pPrev == pOpen);
+ pOpen->pNext->pPrev = pOpen->pPrev;
+ }
+
+ ASSERT(!pOpen->pUnused); // Make sure we're not leaking memory and file descriptors.
+
+ sqlite3_free(pOpen);
+}
+
+// Locates ChromiumLockInfo and ChromiumOpenInfo for given file descriptor (creating new ones if needed).
+// Returns a SQLite error code.
+static int findLockInfo(ChromiumFile* pFile, ChromiumLockInfo** ppLock, ChromiumOpenInfo** ppOpen)
+{
+ int fd = pFile->h;
+ struct stat statbuf;
+ int rc = fstat(fd, &statbuf);
+ if (rc) {
+ pFile->lastErrno = errno;
+#ifdef EOVERFLOW
+ if (pFile->lastErrno == EOVERFLOW)
+ return SQLITE_NOLFS;
+#endif
+ return SQLITE_IOERR;
+ }
+
+#if OS(DARWIN)
+ // On OS X on an msdos/fat filesystems, the inode number is reported
+ // incorrectly for zero-size files. See http://www.sqlite.org/cvstrac/tktview?tn=3260.
+ // To work around this problem we always increase the file size to 1 by writing a single byte
+ // prior to accessing the inode number. The one byte written is an ASCII 'S' character which
+ // also happens to be the first byte in the header of every SQLite database. In this way,
+ // if there is a race condition such that another thread has already populated the first page
+ // of the database, no damage is done.
+ if (!statbuf.st_size) {
+ rc = write(fd, "S", 1);
+ if (rc != 1)
+ return SQLITE_IOERR;
+ rc = fstat(fd, &statbuf);
+ if (rc) {
+ pFile->lastErrno = errno;
+ return SQLITE_IOERR;
+ }
+ }
+#endif
+
+ ChromiumFileId fileId;
+ memset(&fileId, 0, sizeof(fileId));
+ fileId.dev = statbuf.st_dev;
+ fileId.ino = statbuf.st_ino;
+
+ ChromiumLockInfo* pLock = 0;
+
+ if (ppLock) {
+ pLock = lockList;
+ while (pLock && memcmp(&fileId, &pLock->lockKey, sizeof(fileId)))
+ pLock = pLock->pNext;
+ if (pLock)
+ pLock->nRef++;
+ else {
+ pLock = static_cast<ChromiumLockInfo*>(sqlite3_malloc(sizeof(*pLock)));
+ if (!pLock)
+ return SQLITE_NOMEM;
+ pLock->lockKey = fileId;
+ pLock->nRef = 1;
+ pLock->cnt = 0;
+ pLock->locktype = 0;
+ pLock->pNext = lockList;
+ pLock->pPrev = 0;
+ if (lockList)
+ lockList->pPrev = pLock;
+ lockList = pLock;
+ }
+ *ppLock = pLock;
+ }
+
+ if (ppOpen) {
+ ChromiumOpenInfo* pOpen = openList;
+ while (pOpen && memcmp(&fileId, &pOpen->fileId, sizeof(fileId)))
+ pOpen = pOpen->pNext;
+ if (pOpen)
+ pOpen->nRef++;
+ else {
+ pOpen = static_cast<ChromiumOpenInfo*>(sqlite3_malloc(sizeof(*pOpen)));
+ if (!pOpen) {
+ releaseLockInfo(pLock);
+ return SQLITE_NOMEM;
+ }
+ memset(pOpen, 0, sizeof(*pOpen));
+ pOpen->fileId = fileId;
+ pOpen->nRef = 1;
+ pOpen->pNext = openList;
+ if (openList)
+ openList->pPrev = pOpen;
+ openList = pOpen;
+ }
+ *ppOpen = pOpen;
+ }
+
+ return rc;
+}
+
+// Checks if there is a RESERVED lock held on the specified file by this or any other process.
+// If the lock is held, sets pResOut to a non-zero value. Returns a SQLite error code.
+static int chromiumCheckReservedLock(sqlite3_file* id, int* pResOut)
+{
+ ChromiumFile* pFile = reinterpret_cast<ChromiumFile*>(id);
+ ASSERT(pFile);
+
+ // Look for locks held by this process.
+ int reserved = 0;
+ if (pFile->pLock->locktype > SQLITE_LOCK_SHARED)
+ reserved = 1;
+
+ // Look for locks held by other processes.
+ int rc = SQLITE_OK;
+ if (!reserved) {
+ struct flock lock;
+ lock.l_whence = SEEK_SET;
+ lock.l_start = SQLiteReservedByte;
+ lock.l_len = 1;
+ lock.l_type = F_WRLCK;
+ if (-1 == fcntl(pFile->h, F_GETLK, &lock)) {
+ int tErrno = errno;
+ rc = sqliteErrorFromPosixError(tErrno, SQLITE_IOERR_CHECKRESERVEDLOCK);
+ pFile->lastErrno = tErrno;
+ } else if (lock.l_type != F_UNLCK)
+ reserved = 1;
+ }
+
+ *pResOut = reserved;
+ return rc;
+}
+
+// Performs a file locking operation on a range of bytes in a file.
+// The |op| parameter should be one of F_RFLCK, F_WRLCK or F_UNLCK.
+// Returns a Unix error code, and also writes it to pErrcode.
+static int rangeLock(ChromiumFile* pFile, int op, int* pErrcode)
+{
+ struct flock lock;
+ lock.l_type = op;
+ lock.l_start = SQLiteSharedFirstByte;
+ lock.l_whence = SEEK_SET;
+ lock.l_len = SQLiteSharedSize;
+ int rc = fcntl(pFile->h, F_SETLK, &lock);
+ *pErrcode = errno;
+ return rc;
+}
+
+// Locks the file with the lock specified by parameter locktype - one
+// of the following:
+//
+// (1) SQLITE_LOCK_SHARED
+// (2) SQLITE_LOCK_RESERVED
+// (3) SQLITE_LOCK_PENDING
+// (4) SQLITE_LOCK_EXCLUSIVE
+//
+// Sometimes when requesting one lock state, additional lock states
+// are inserted in between. The locking might fail on one of the later
+// transitions leaving the lock state different from what it started but
+// still short of its goal. The following chart shows the allowed
+// transitions and the inserted intermediate states:
+//
+// UNLOCKED -> SHARED
+// SHARED -> RESERVED
+// SHARED -> (PENDING) -> EXCLUSIVE
+// RESERVED -> (PENDING) -> EXCLUSIVE
+// PENDING -> EXCLUSIVE
+static int chromiumLock(sqlite3_file* id, int locktype)
+{
+ // To obtain a SHARED lock, a read-lock is obtained on the 'pending
+ // byte'. If this is successful, a random byte from the 'shared byte
+ // range' is read-locked and the lock on the 'pending byte' released.
+ //
+ // A process may only obtain a RESERVED lock after it has a SHARED lock.
+ // A RESERVED lock is implemented by grabbing a write-lock on the
+ // 'reserved byte'.
+ //
+ // A process may only obtain a PENDING lock after it has obtained a
+ // SHARED lock. A PENDING lock is implemented by obtaining a write-lock
+ // on the 'pending byte'. This ensures that no new SHARED locks can be
+ // obtained, but existing SHARED locks are allowed to persist. A process
+ // does not have to obtain a RESERVED lock on the way to a PENDING lock.
+ // This property is used by the algorithm for rolling back a journal file
+ // after a crash.
+ //
+ // An EXCLUSIVE lock, obtained after a PENDING lock is held, is
+ // implemented by obtaining a write-lock on the entire 'shared byte
+ // range'. Since all other locks require a read-lock on one of the bytes
+ // within this range, this ensures that no other locks are held on the
+ // database.
+
+ int rc = SQLITE_OK;
+ struct flock lock;
+ int s = 0;
+ int tErrno;
+
+ ChromiumFile* pFile = reinterpret_cast<ChromiumFile*>(id);
+ ASSERT(pFile);
+
+ ChromiumLockInfo* pLock = pFile->pLock;
+
+ // If there is already a lock of this type or more restrictive, do nothing.
+ if (pFile->locktype >= locktype)
+ return SQLITE_OK;
+
+ // Make sure we never move from unlocked to anything higher than shared lock.
+ ASSERT(pFile->locktype != SQLITE_LOCK_NONE || locktype == SQLITE_LOCK_SHARED);
+
+ // Make sure we never request a pending lock.
+ ASSERT(locktype != SQLITE_LOCK_PENDING);
+
+ // Make sure a shared lock is always held when a RESERVED lock is requested.
+ ASSERT(locktype != SQLITE_LOCK_RESERVED || pFile->locktype == SQLITE_LOCK_SHARED);
+
+ // If some thread using this PID has a lock via a different ChromiumFile
+ // handle that precludes the requested lock, return BUSY.
+ if (pFile->locktype != pLock->locktype &&
+ (pLock->locktype >= SQLITE_LOCK_PENDING || locktype > SQLITE_LOCK_SHARED))
+ return SQLITE_BUSY;
+
+ // If a SHARED lock is requested, and some thread using this PID already
+ // has a SHARED or RESERVED lock, then just increment reference counts.
+ if (locktype == SQLITE_LOCK_SHARED &&
+ (pLock->locktype == SQLITE_LOCK_SHARED || pLock->locktype == SQLITE_LOCK_RESERVED)) {
+ ASSERT(!pFile->locktype);
+ ASSERT(pLock->cnt > 0);
+ pFile->locktype = SQLITE_LOCK_SHARED;
+ pLock->cnt++;
+ pFile->pOpen->nLock++;
+ return SQLITE_OK;
+ }
+
+ // A PENDING lock is needed before acquiring a SHARED lock and before
+ // acquiring an EXCLUSIVE lock. For the SHARED lock, the PENDING will
+ // be released.
+ lock.l_len = 1;
+ lock.l_whence = SEEK_SET;
+ if (locktype == SQLITE_LOCK_SHARED ||
+ (locktype == SQLITE_LOCK_EXCLUSIVE && pFile->locktype < SQLITE_LOCK_PENDING)) {
+ lock.l_type = (locktype == SQLITE_LOCK_SHARED ? F_RDLCK : F_WRLCK);
+ lock.l_start = SQLitePendingByte;
+ s = fcntl(pFile->h, F_SETLK, &lock);
+ if (s == -1) {
+ tErrno = errno;
+ rc = sqliteErrorFromPosixError(tErrno, SQLITE_IOERR_LOCK);
+ if ((rc != SQLITE_OK) && (rc != SQLITE_BUSY))
+ pFile->lastErrno = tErrno;
+ return rc;
+ }
+ }
+
+ if (locktype == SQLITE_LOCK_SHARED) {
+ ASSERT(!pLock->cnt);
+ ASSERT(!pLock->locktype);
+
+ s = rangeLock(pFile, F_RDLCK, &tErrno);
+
+ // Drop the temporary PENDING lock.
+ lock.l_start = SQLitePendingByte;
+ lock.l_len = 1;
+ lock.l_type = F_UNLCK;
+ if (fcntl(pFile->h, F_SETLK, &lock)) {
+ if (s != -1) {
+ tErrno = errno;
+ rc = sqliteErrorFromPosixError(tErrno, SQLITE_IOERR_UNLOCK);
+ if ((rc != SQLITE_OK) && (rc != SQLITE_BUSY))
+ pFile->lastErrno = tErrno;
+ return rc;
+ }
+ }
+ if (s == -1) {
+ rc = sqliteErrorFromPosixError(tErrno, SQLITE_IOERR_LOCK);
+ if ((rc != SQLITE_OK) && (rc != SQLITE_BUSY))
+ pFile->lastErrno = tErrno;
+ } else {
+ pFile->locktype = SQLITE_LOCK_SHARED;
+ pFile->pOpen->nLock++;
+ pLock->cnt = 1;
+ }
+ } else if (locktype == SQLITE_LOCK_EXCLUSIVE && pLock->cnt > 1) {
+ // We are trying for an exclusive lock but another thread in the
+ // same process is still holding a shared lock.
+ rc = SQLITE_BUSY;
+ } else {
+ // The request was for a RESERVED or EXCLUSIVE lock. It is
+ // assumed that there is a SHARED or greater lock on the file
+ // already.
+ ASSERT(pFile->locktype);
+ lock.l_type = F_WRLCK;
+ switch (locktype) {
+ case SQLITE_LOCK_RESERVED:
+ lock.l_start = SQLiteReservedByte;
+ s = fcntl(pFile->h, F_SETLK, &lock);
+ tErrno = errno;
+ break;
+ case SQLITE_LOCK_EXCLUSIVE:
+ s = rangeLock(pFile, F_WRLCK, &tErrno);
+ break;
+ default:
+ ASSERT_NOT_REACHED();
+ }
+ if (s == -1) {
+ rc = sqliteErrorFromPosixError(tErrno, SQLITE_IOERR_LOCK);
+ if ((rc != SQLITE_OK) && (rc != SQLITE_BUSY))
+ pFile->lastErrno = tErrno;
+ }
+ }
+
+ if (rc == SQLITE_OK) {
+ pFile->locktype = locktype;
+ pLock->locktype = locktype;
+ } else if (locktype == SQLITE_LOCK_EXCLUSIVE) {
+ pFile->locktype = SQLITE_LOCK_PENDING;
+ pLock->locktype = SQLITE_LOCK_PENDING;
+ }
+
+ return rc;
+}
+
+// Closes all file descriptors for given ChromiumFile for which the close has been deferred.
+// Returns a SQLite error code.
+static int closePendingFds(ChromiumFile* pFile)
+{
+ int rc = SQLITE_OK;
+ ChromiumOpenInfo* pOpen = pFile->pOpen;
+ ChromiumUnusedFd* pError = 0;
+ ChromiumUnusedFd* pNext;
+ for (ChromiumUnusedFd* p = pOpen->pUnused; p; p = pNext) {
+ pNext = p->pNext;
+ if (close(p->fd)) {
+ pFile->lastErrno = errno;
+ rc = SQLITE_IOERR_CLOSE;
+ p->pNext = pError;
+ pError = p;
+ } else
+ sqlite3_free(p);
+ }
+ pOpen->pUnused = pError;
+ return rc;
+}
+
+// Lowers the locking level on file descriptor.
+// locktype must be either SQLITE_LOCK_NONE or SQLITE_LOCK_SHARED.
+static int chromiumUnlock(sqlite3_file* id, int locktype)
+{
+ ChromiumFile* pFile = reinterpret_cast<ChromiumFile*>(id);
+ ASSERT(pFile);
+ ASSERT(locktype <= SQLITE_LOCK_SHARED);
+
+ if (pFile->locktype <= locktype)
+ return SQLITE_OK;
+
+ ChromiumLockInfo* pLock = pFile->pLock;
+ ASSERT(pLock->cnt);
+
+ struct flock lock;
+ int rc = SQLITE_OK;
+ int h = pFile->h;
+ int tErrno;
+
+ if (pFile->locktype > SQLITE_LOCK_SHARED) {
+ ASSERT(pLock->locktype == pFile->locktype);
+
+ if (locktype == SQLITE_LOCK_SHARED && rangeLock(pFile, F_RDLCK, &tErrno) == -1) {
+ rc = sqliteErrorFromPosixError(tErrno, SQLITE_IOERR_RDLOCK);
+ if ((rc != SQLITE_OK) && (rc != SQLITE_BUSY))
+ pFile->lastErrno = tErrno;
+ if (rc == SQLITE_OK)
+ pFile->locktype = locktype;
+ return rc;
+ }
+ lock.l_type = F_UNLCK;
+ lock.l_whence = SEEK_SET;
+ lock.l_start = SQLitePendingByte;
+ lock.l_len = 2;
+ if (fcntl(h, F_SETLK, &lock) != -1)
+ pLock->locktype = SQLITE_LOCK_SHARED;
+ else {
+ tErrno = errno;
+ rc = sqliteErrorFromPosixError(tErrno, SQLITE_IOERR_UNLOCK);
+ if ((rc != SQLITE_OK) && (rc != SQLITE_BUSY))
+ pFile->lastErrno = tErrno;
+ if (rc == SQLITE_OK)
+ pFile->locktype = locktype;
+ return rc;
+ }
+ }
+ if (locktype == SQLITE_LOCK_NONE) {
+ struct ChromiumOpenInfo *pOpen;
+
+ pLock->cnt--;
+
+ // Release the lock using an OS call only when all threads in this same process have released the lock.
+ if (!pLock->cnt) {
+ lock.l_type = F_UNLCK;
+ lock.l_whence = SEEK_SET;
+ lock.l_start = lock.l_len = 0L;
+ if (fcntl(h, F_SETLK, &lock) != -1)
+ pLock->locktype = SQLITE_LOCK_NONE;
+ else {
+ tErrno = errno;
+ rc = sqliteErrorFromPosixError(tErrno, SQLITE_IOERR_UNLOCK);
+ if ((rc != SQLITE_OK) && (rc != SQLITE_BUSY))
+ pFile->lastErrno = tErrno;
+ pLock->locktype = SQLITE_LOCK_NONE;
+ pFile->locktype = SQLITE_LOCK_NONE;
+ }
+ }
+
+ pOpen = pFile->pOpen;
+ pOpen->nLock--;
+ ASSERT(pOpen->nLock >= 0);
+ if (!pOpen->nLock) {
+ int rc2 = closePendingFds(pFile);
+ if (rc == SQLITE_OK)
+ rc = rc2;
+ }
+ }
+
+ if (rc == SQLITE_OK)
+ pFile->locktype = locktype;
+ return rc;
}
-// Chromium's Posix implementation of SQLite VFS
-namespace {
+// Closes all file handles for given ChromiumFile and sets all its fields to 0.
+// Returns a SQLite error code.
+static int chromiumCloseNoLock(sqlite3_file* id)
+{
+ ChromiumFile* pFile = reinterpret_cast<ChromiumFile*>(id);
+ if (!pFile)
+ return SQLITE_OK;
+ if (pFile->dirfd >= 0) {
+ if (close(pFile->dirfd)) {
+ pFile->lastErrno = errno;
+ return SQLITE_IOERR_DIR_CLOSE;
+ }
+ pFile->dirfd = -1;
+ }
+ if (pFile->h >= 0 && close(pFile->h)) {
+ pFile->lastErrno = errno;
+ return SQLITE_IOERR_CLOSE;
+ }
+ sqlite3_free(pFile->pUnused);
+ memset(pFile, 0, sizeof(ChromiumFile));
+ return SQLITE_OK;
+}
+
+// Closes a ChromiumFile, including locking operations. Returns a SQLite error code.
+static int chromiumClose(sqlite3_file* id)
+{
+ if (!id)
+ return SQLITE_OK;
+
+ ChromiumFile* pFile = reinterpret_cast<ChromiumFile*>(id);
+ chromiumUnlock(id, SQLITE_LOCK_NONE);
+ if (pFile->pOpen && pFile->pOpen->nLock) {
+ // If there are outstanding locks, do not actually close the file just
+ // yet because that would clear those locks.
+ ChromiumOpenInfo* pOpen = pFile->pOpen;
+ ChromiumUnusedFd* p = pFile->pUnused;
+ p->pNext = pOpen->pUnused;
+ pOpen->pUnused = p;
+ pFile->h = -1;
+ pFile->pUnused = 0;
+ }
+ releaseLockInfo(pFile->pLock);
+ releaseOpenInfo(pFile->pOpen);
+ return chromiumCloseNoLock(id);
+}
+
+static int chromiumCheckReservedLockNoop(sqlite3_file*, int* pResOut)
+{
+ *pResOut = 0;
+ return SQLITE_OK;
+}
+
+static int chromiumLockNoop(sqlite3_file*, int)
+{
+ return SQLITE_OK;
+}
+
+static int chromiumUnlockNoop(sqlite3_file*, int)
+{
+ return SQLITE_OK;
+}
+
+// Seeks to the requested offset and reads up to |cnt| bytes into |pBuf|. Returns number of bytes actually read.
+static int seekAndRead(ChromiumFile* id, sqlite3_int64 offset, void* pBuf, int cnt)
+{
+ sqlite_int64 newOffset = lseek(id->h, offset, SEEK_SET);
+ if (newOffset != offset) {
+ id->lastErrno = (newOffset == -1) ? errno : 0;
+ return -1;
+ }
+ int got = read(id->h, pBuf, cnt);
+ if (got < 0)
+ id->lastErrno = errno;
+ return got;
+}
+
+// Reads data from file into a buffer. Returns a SQLite error code.
+static int chromiumRead(sqlite3_file* id, void* pBuf, int amt, sqlite3_int64 offset)
+{
+ ChromiumFile* pFile = reinterpret_cast<ChromiumFile*>(id);
+ ASSERT(pFile);
+
+ // The bytes in the locking range should never be read.
+ ASSERT(!pFile->pUnused || offset >= SQLitePendingByte + 512 || offset + amt <= SQLitePendingByte);
+
+ int got = seekAndRead(pFile, offset, pBuf, amt);
+ if (got == amt)
+ return SQLITE_OK;
+
+ if (got < 0)
+ return SQLITE_IOERR_READ;
+
+ // Unread parts of the buffer must be zero-filled.
+ memset(&(reinterpret_cast<char*>(pBuf))[got], 0, amt - got);
+ pFile->lastErrno = 0;
+ return SQLITE_IOERR_SHORT_READ;
+}
+
+// Seeks to the requested offset and writes up to |cnt| bytes. Returns number of bytes actually written.
+static int seekAndWrite(ChromiumFile* id, sqlite_int64 offset, const void* pBuf, int cnt)
+{
+ sqlite_int64 newOffset = lseek(id->h, offset, SEEK_SET);
+ if (newOffset != offset) {
+ id->lastErrno = (newOffset == -1) ? errno : 0;
+ return -1;
+ }
+ int got = write(id->h, pBuf, cnt);
+ if (got < 0)
+ id->lastErrno = errno;
+ return got;
+}
+
+// Writes data from buffer into a file. Returns a SQLite error code.
+static int chromiumWrite(sqlite3_file* id, const void* pBuf, int amt, sqlite3_int64 offset)
+{
+ ChromiumFile* pFile = reinterpret_cast<ChromiumFile*>(id);
+ ASSERT(pFile);
+ ASSERT(amt > 0);
+
+ // The bytes in the locking range should never be written.
+ ASSERT(!pFile->pUnused || offset >= SQLitePendingByte + 512 || offset + amt <= SQLitePendingByte);
+
+ int wrote = 0;
+ while (amt > 0 && (wrote = seekAndWrite(pFile, offset, pBuf, amt)) > 0) {
+ amt -= wrote;
+ offset += wrote;
+ pBuf = &(reinterpret_cast<const char*>(pBuf))[wrote];
+ }
+ if (amt > 0) {
+ if (wrote < 0)
+ return SQLITE_IOERR_WRITE;
+ pFile->lastErrno = 0;
+ return SQLITE_FULL;
+ }
+ return SQLITE_OK;
+}
+
+static bool syncWrapper(int fd, bool fullSync)
+{
+#if OS(DARWIN)
+ bool success = false;
+ if (fullSync)
+ success = !fcntl(fd, F_FULLFSYNC, 0);
+ if (!success)
+ success = !fsync(fd);
+ return success;
+#else
+ return !fdatasync(fd);
+#endif
+}
+
+// Makes sure all writes to a particular file are committed to disk. Returns a SQLite error code.
+static int chromiumSync(sqlite3_file* id, int flags)
+{
+ ASSERT((flags & 0x0F) == SQLITE_SYNC_NORMAL || (flags & 0x0F) == SQLITE_SYNC_FULL);
+
+ ChromiumFile* pFile = reinterpret_cast<ChromiumFile*>(id);
+ ASSERT(pFile);
+
+ bool isFullSync = ((flags & 0x0F) == SQLITE_SYNC_FULL);
+
+ if (!syncWrapper(pFile->h, isFullSync)) {
+ pFile->lastErrno = errno;
+ return SQLITE_IOERR_FSYNC;
+ }
+
+ if (pFile->dirfd >= 0) {
+#if !OS(DARWIN)
+ if (!isFullSync) {
+ // Ignore directory sync failures, see http://www.sqlite.org/cvstrac/tktview?tn=1657.
+ syncWrapper(pFile->dirfd, false);
+ }
+#endif
+ if (!close(pFile->dirfd))
+ pFile->dirfd = -1;
+ else {
+ pFile->lastErrno = errno;
+ return SQLITE_IOERR_DIR_CLOSE;
+ }
+ }
+
+ return SQLITE_OK;
+}
+
+// Truncates an open file to the specified size. Returns a SQLite error code.
+static int chromiumTruncate(sqlite3_file* id, sqlite_int64 nByte)
+{
+ ChromiumFile* pFile = reinterpret_cast<ChromiumFile*>(id);
+ ASSERT(pFile);
+
+ if (ftruncate(pFile->h, nByte)) {
+ pFile->lastErrno = errno;
+ return SQLITE_IOERR_TRUNCATE;
+ }
+
+ return SQLITE_OK;
+}
+
+// Determines the size of a file in bytes. Returns a SQLite error code.
+static int chromiumFileSize(sqlite3_file* id, sqlite_int64* pSize)
+{
+ ChromiumFile* pFile = reinterpret_cast<ChromiumFile*>(id);
+ ASSERT(pFile);
+
+ struct stat buf;
+ if (fstat(pFile->h, &buf)) {
+ pFile->lastErrno = errno;
+ return SQLITE_IOERR_FSTAT;
+ }
+ *pSize = buf.st_size;
+
+ // When opening a zero-size database, findLockInfo writes a single byte into that file
+ // in order to work around a bug in the OS X msdos filesystem. In order to avoid problems
+ // with upper layers, we need to report this file size as zero even though it is really 1.
+ // See http://www.sqlite.org/cvstrac/tktview?tn=3260.
+ if (*pSize == 1)
+ *pSize = 0;
+
+ return SQLITE_OK;
+}
+
+static int chromiumFileControl(sqlite3_file* id, int op, void* pArg)
+{
+ ChromiumFile* pFile = reinterpret_cast<ChromiumFile*>(id);
+ ASSERT(pFile);
+
+ switch (op) {
+ case SQLITE_FCNTL_LOCKSTATE:
+ *reinterpret_cast<int*>(pArg) = pFile->locktype;
+ return SQLITE_OK;
+ case SQLITE_LAST_ERRNO:
+ *reinterpret_cast<int*>(pArg) = pFile->lastErrno;
+ return SQLITE_OK;
+ }
+ return SQLITE_ERROR;
+}
+
+// Same as SQLITE_DEFAULT_SECTOR_SIZE from sqlite's os.h.
+static const int SQLiteDefaultSectorSize = 512;
+
+static int chromiumSectorSize(sqlite3_file*)
+{
+ return SQLiteDefaultSectorSize;
+}
+
+static int chromiumDeviceCharacteristics(sqlite3_file*)
+{
+ return 0;
+}
+
+static const sqlite3_io_methods posixIoMethods = {
+ 1,
+ chromiumClose,
+ chromiumRead,
+ chromiumWrite,
+ chromiumTruncate,
+ chromiumSync,
+ chromiumFileSize,
+ chromiumLock,
+ chromiumUnlock,
+ chromiumCheckReservedLock,
+ chromiumFileControl,
+ chromiumSectorSize,
+ chromiumDeviceCharacteristics
+};
+
+static const sqlite3_io_methods nolockIoMethods = {
+ 1,
+ chromiumCloseNoLock,
+ chromiumRead,
+ chromiumWrite,
+ chromiumTruncate,
+ chromiumSync,
+ chromiumFileSize,
+ chromiumLockNoop,
+ chromiumUnlockNoop,
+ chromiumCheckReservedLockNoop,
+ chromiumFileControl,
+ chromiumSectorSize,
+ chromiumDeviceCharacteristics
+};
+
+// Initializes a ChromiumFile. Returns a SQLite error code.
+static int fillInChromiumFile(sqlite3_vfs* pVfs, int h, int dirfd, sqlite3_file* pId, const char* zFilename, int noLock)
+{
+ ChromiumFile* pNew = reinterpret_cast<ChromiumFile*>(pId);
+
+ ASSERT(!pNew->pLock);
+ ASSERT(!pNew->pOpen);
+
+ pNew->h = h;
+ pNew->dirfd = dirfd;
+
+ int rc = SQLITE_OK;
+ const sqlite3_io_methods* pLockingStyle;
+ if (noLock)
+ pLockingStyle = &nolockIoMethods;
+ else {
+ pLockingStyle = &posixIoMethods;
+ rc = findLockInfo(pNew, &pNew->pLock, &pNew->pOpen);
+ if (rc != SQLITE_OK) {
+ // If an error occured in findLockInfo(), close the file descriptor
+ // immediately. This can happen in two scenarios:
+ //
+ // (a) A call to fstat() failed.
+ // (b) A malloc failed.
+ //
+ // Scenario (b) may only occur if the process is holding no other
+ // file descriptors open on the same file. If there were other file
+ // descriptors on this file, then no malloc would be required by
+ // findLockInfo(). If this is the case, it is quite safe to close
+ // handle h - as it is guaranteed that no posix locks will be released
+ // by doing so.
+ //
+ // If scenario (a) caused the error then things are not so safe. The
+ // implicit assumption here is that if fstat() fails, things are in
+ // such bad shape that dropping a lock or two doesn't matter much.
+ close(h);
+ h = -1;
+ }
+ }
+
+ pNew->lastErrno = 0;
+ if (rc != SQLITE_OK) {
+ if (dirfd >= 0)
+ close(dirfd);
+ if (h >= 0)
+ close(h);
+ } else
+ pNew->pMethod = pLockingStyle;
+ return rc;
+}
+
+// Searches for an unused file descriptor that was opened on the database
+// file identified by zPath with matching flags. Returns 0 if not found.
+static ChromiumUnusedFd* findReusableFd(const char* zPath, int flags)
+{
+ ChromiumUnusedFd* pUnused = 0;
+
+ struct stat sStat;
+ if (!stat(zPath, &sStat)) {
+ ChromiumFileId id;
+ id.dev = sStat.st_dev;
+ id.ino = sStat.st_ino;
+
+ ChromiumOpenInfo* pO = 0;
+ for (pO = openList; pO && memcmp(&id, &pO->fileId, sizeof(id)); pO = pO->pNext) { }
+ if (pO) {
+ ChromiumUnusedFd** pp;
+ for (pp = &pO->pUnused; *pp && (*pp)->flags != flags; pp = &((*pp)->pNext)) { }
+ pUnused = *pp;
+ if (pUnused)
+ *pp = pUnused->pNext;
+ }
+ }
+ return pUnused;
+}
// Opens a file.
//
@@ -59,14 +974,26 @@ namespace {
// id - the structure that will manipulate the newly opened file.
// desiredFlags - the desired open mode flags.
// usedFlags - the actual open mode flags that were used.
-int chromiumOpen(sqlite3_vfs* vfs, const char* fileName,
- sqlite3_file* id, int desiredFlags, int* usedFlags)
+static int chromiumOpen(sqlite3_vfs* vfs, const char* fileName,
+ sqlite3_file* id, int desiredFlags, int* usedFlags)
{
- chromium_sqlite3_initialize_unix_sqlite3_file(id);
+ // The mask 0x00007F00 gives us the 7 bits that determine the type of the file SQLite is trying to open.
+ int fileType = desiredFlags & 0x00007F00;
+
+ memset(id, 0, sizeof(ChromiumFile));
+ ChromiumFile* chromiumFile = reinterpret_cast<ChromiumFile*>(id);
int fd = -1;
- int result = chromium_sqlite3_get_reusable_file_handle(id, fileName, desiredFlags, &fd);
- if (result != SQLITE_OK)
- return result;
+ if (fileType == SQLITE_OPEN_MAIN_DB) {
+ ChromiumUnusedFd* unusedFd = findReusableFd(fileName, desiredFlags);
+ if (unusedFd)
+ fd = unusedFd->fd;
+ else {
+ unusedFd = static_cast<ChromiumUnusedFd*>(sqlite3_malloc(sizeof(*unusedFd)));
+ if (!unusedFd)
+ return SQLITE_NOMEM;
+ }
+ chromiumFile->pUnused = unusedFd;
+ }
if (fd < 0) {
fd = ChromiumBridge::databaseOpenFile(fileName, desiredFlags);
@@ -76,23 +1003,24 @@ int chromiumOpen(sqlite3_vfs* vfs, const char* fileName,
}
}
if (fd < 0) {
- chromium_sqlite3_destroy_reusable_file_handle(id);
+ sqlite3_free(chromiumFile->pUnused);
return SQLITE_CANTOPEN;
}
if (usedFlags)
*usedFlags = desiredFlags;
- chromium_sqlite3_update_reusable_file_handle(id, fd, desiredFlags);
+ if (chromiumFile->pUnused) {
+ chromiumFile->pUnused->fd = fd;
+ chromiumFile->pUnused->flags = desiredFlags;
+ }
fcntl(fd, F_SETFD, fcntl(fd, F_GETFD) | FD_CLOEXEC);
- // The mask 0x00007F00 gives us the 7 bits that determine the type of the file SQLite is trying to open.
- int fileType = desiredFlags & 0x00007F00;
int noLock = (fileType != SQLITE_OPEN_MAIN_DB);
- result = chromium_sqlite3_fill_in_unix_sqlite3_file(vfs, fd, -1, id, fileName, noLock);
- if (result != SQLITE_OK)
- chromium_sqlite3_destroy_reusable_file_handle(id);
- return result;
+ int rc = fillInChromiumFile(vfs, fd, -1, id, fileName, noLock);
+ if (rc != SQLITE_OK)
+ sqlite3_free(chromiumFile->pUnused);
+ return rc;
}
// Deletes the given file.
@@ -101,7 +1029,7 @@ int chromiumOpen(sqlite3_vfs* vfs, const char* fileName,
// fileName - the name of the file.
// syncDir - determines if the directory to which this file belongs
// should be synched after the file is deleted.
-int chromiumDelete(sqlite3_vfs*, const char* fileName, int syncDir)
+static int chromiumDelete(sqlite3_vfs*, const char* fileName, int syncDir)
{
return ChromiumBridge::databaseDeleteFile(fileName, syncDir);
}
@@ -112,7 +1040,7 @@ int chromiumDelete(sqlite3_vfs*, const char* fileName, int syncDir)
// fileName - the name of the file.
// flag - the type of test to make on this file.
// res - the result.
-int chromiumAccess(sqlite3_vfs*, const char* fileName, int flag, int* res)
+static int chromiumAccess(sqlite3_vfs*, const char* fileName, int flag, int* res)
{
int attr = static_cast<int>(ChromiumBridge::databaseGetFileAttributes(fileName));
if (attr < 0) {
@@ -122,7 +1050,7 @@ int chromiumAccess(sqlite3_vfs*, const char* fileName, int flag, int* res)
switch (flag) {
case SQLITE_ACCESS_EXISTS:
- *res = 1; // if the file doesn't exist, attr < 0
+ *res = 1; // if the file doesn't exist, attr < 0
break;
case SQLITE_ACCESS_READWRITE:
*res = (attr & W_OK) && (attr & R_OK);
@@ -143,8 +1071,8 @@ int chromiumAccess(sqlite3_vfs*, const char* fileName, int flag, int* res)
// relativePath - the relative path.
// bufSize - the size of the output buffer in bytes.
// absolutePath - the output buffer where the absolute path will be stored.
-int chromiumFullPathname(sqlite3_vfs* vfs, const char* relativePath,
- int, char* absolutePath)
+static int chromiumFullPathname(sqlite3_vfs* vfs, const char* relativePath,
+ int, char* absolutePath)
{
// The renderer process doesn't need to know the absolute path of the file
sqlite3_snprintf(vfs->mxPathname, absolutePath, "%s", relativePath);
@@ -152,44 +1080,107 @@ int chromiumFullPathname(sqlite3_vfs* vfs, const char* relativePath,
}
#ifndef SQLITE_OMIT_LOAD_EXTENSION
-// Returns NULL, thus disallowing loading libraries in the renderer process.
-//
-// vfs - pointer to the sqlite3_vfs object.
-// fileName - the name of the shared library file.
-void* chromiumDlOpen(sqlite3_vfs*, const char*)
+// We disallow loading DSOs inside the renderer process, so the following procedures are no-op.
+static void* chromiumDlOpen(sqlite3_vfs*, const char*)
+{
+ return 0;
+}
+
+static void chromiumDlError(sqlite3_vfs*, int, char*)
+{
+}
+
+static void (*chromiumDlSym(sqlite3_vfs*, void*, const char*))()
{
return 0;
}
+
+static void chromiumDlClose(sqlite3_vfs*, void*)
+{
+}
#else
#define chromiumDlOpen 0
+#define chromiumDlError 0
+#define chromiumDlSym 0
+#define chromiumDlClose 0
#endif // SQLITE_OMIT_LOAD_EXTENSION
-} // namespace
+// Generates a seed for SQLite's PRNG.
+static int chromiumRandomness(sqlite3_vfs*, int nBuf, char *zBuf)
+{
+ ASSERT(static_cast<size_t>(nBuf) >= (sizeof(time_t) + sizeof(int)));
+
+ memset(zBuf, 0, nBuf);
+ int fd = open("/dev/urandom", O_RDONLY);
+ if (fd < 0) {
+ time_t t;
+ time(&t);
+ memcpy(zBuf, &t, sizeof(t));
+ int pid = getpid();
+ memcpy(&zBuf[sizeof(t)], &pid, sizeof(pid));
+ return sizeof(t) + sizeof(pid);
+ }
+ nBuf = read(fd, zBuf, nBuf);
+ close(fd);
+ return nBuf;
+}
+
+// Sleeps for at least |microseconds|, and returns the actual
+// amount of time spent sleeping (in microseconds).
+static int chromiumSleep(sqlite3_vfs*, int microseconds)
+{
+#if OS(DARWIN)
+ usleep(microseconds);
+ return microseconds;
+#else
+ // Round to the nearest second.
+ int seconds = (microseconds + 999999) / 1000000;
+ sleep(seconds);
+ return seconds * 1000000;
+#endif
+}
+
+// Retrieves the current system time (UTC).
+static int chromiumCurrentTime(sqlite3_vfs*, double* now)
+{
+ struct timeval timeval;
+ gettimeofday(&timeval, 0);
+ *now = 2440587.5 + timeval.tv_sec / 86400.0 + timeval.tv_usec / 86400000000.0;
+ return 0;
+}
+
+// This is not yet implemented in SQLite core.
+static int chromiumGetLastError(sqlite3_vfs*, int, char*)
+{
+ return 0;
+}
+
+// Same as MAX_PATHNAME from sqlite's os_unix.c.
+static const int chromiumMaxPathname = 512;
namespace WebCore {
void SQLiteFileSystem::registerSQLiteVFS()
{
- sqlite3_vfs* unix_vfs = sqlite3_vfs_find("unix");
static sqlite3_vfs chromium_vfs = {
1,
- unix_vfs->szOsFile,
- unix_vfs->mxPathname,
+ sizeof(ChromiumFile),
+ chromiumMaxPathname,
0,
"chromium_vfs",
- unix_vfs->pAppData,
+ 0,
chromiumOpen,
chromiumDelete,
chromiumAccess,
chromiumFullPathname,
chromiumDlOpen,
- unix_vfs->xDlError,
- unix_vfs->xDlSym,
- unix_vfs->xDlClose,
- unix_vfs->xRandomness,
- unix_vfs->xSleep,
- unix_vfs->xCurrentTime,
- unix_vfs->xGetLastError
+ chromiumDlError,
+ chromiumDlSym,
+ chromiumDlClose,
+ chromiumRandomness,
+ chromiumSleep,
+ chromiumCurrentTime,
+ chromiumGetLastError
};
sqlite3_vfs_register(&chromium_vfs, 0);
}
diff --git a/WebCore/platform/text/cf/HyphenationCF.cpp b/WebCore/platform/text/cf/HyphenationCF.cpp
index 8be537d..b265c56 100644
--- a/WebCore/platform/text/cf/HyphenationCF.cpp
+++ b/WebCore/platform/text/cf/HyphenationCF.cpp
@@ -48,20 +48,27 @@ RetainPtr<CFLocaleRef> AtomicStringKeyedMRUCache<RetainPtr<CFLocaleRef> >::creat
{
RetainPtr<CFStringRef> cfLocaleIdentifier(AdoptCF, localeIdentifier.createCFString());
RetainPtr<CFLocaleRef> locale(AdoptCF, CFLocaleCreate(kCFAllocatorDefault, cfLocaleIdentifier.get()));
- return locale;
+
+ return CFStringIsHyphenationAvailableForLocale(locale.get()) ? locale : 0;
+}
+
+static AtomicStringKeyedMRUCache<RetainPtr<CFLocaleRef> >& cfLocaleCache()
+{
+ DEFINE_STATIC_LOCAL(AtomicStringKeyedMRUCache<RetainPtr<CFLocaleRef> >, cache, ());
+ return cache;
}
-bool canHyphenate(const AtomicString& /* localeIdentifer */)
+bool canHyphenate(const AtomicString& localeIdentifier)
{
- return true;
+ return cfLocaleCache().get(localeIdentifier);
}
size_t lastHyphenLocation(const UChar* characters, size_t length, size_t beforeIndex, const AtomicString& localeIdentifier)
{
RetainPtr<CFStringRef> string(AdoptCF, CFStringCreateWithCharactersNoCopy(kCFAllocatorDefault, characters, length, kCFAllocatorNull));
- DEFINE_STATIC_LOCAL(AtomicStringKeyedMRUCache<RetainPtr<CFLocaleRef> >, cfLocaleCache, ());
- RetainPtr<CFLocaleRef> locale = cfLocaleCache.get(localeIdentifier);
+ RetainPtr<CFLocaleRef> locale = cfLocaleCache().get(localeIdentifier);
+ ASSERT(locale);
CFIndex result = CFStringGetHyphenationLocationBeforeIndex(string.get(), beforeIndex, CFRangeMake(0, length), 0, locale.get(), 0);
return result == kCFNotFound ? 0 : result;
diff --git a/WebCore/platform/text/qt/TextCodecQt.cpp b/WebCore/platform/text/qt/TextCodecQt.cpp
index 94a2b7b..1e95d87 100644
--- a/WebCore/platform/text/qt/TextCodecQt.cpp
+++ b/WebCore/platform/text/qt/TextCodecQt.cpp
@@ -29,7 +29,6 @@
#include "PlatformString.h"
#include <wtf/text/CString.h>
#include <qset.h>
-// #include <QDebug>
namespace WebCore {
@@ -125,14 +124,41 @@ String TextCodecQt::decode(const char* bytes, size_t length, bool flush, bool /*
return unicode;
}
-CString TextCodecQt::encode(const UChar* characters, size_t length, UnencodableHandling)
+CString TextCodecQt::encode(const UChar* characters, size_t length, UnencodableHandling handling)
{
+ QTextCodec::ConverterState state;
+ state.flags = QTextCodec::ConversionFlags(QTextCodec::ConvertInvalidToNull | QTextCodec::IgnoreHeader);
+
if (!length)
return "";
- // FIXME: do something sensible with UnencodableHandling
+ QByteArray ba = m_codec->fromUnicode(reinterpret_cast<const QChar*>(characters), length, &state);
+
+ // If some <b> characters </b> are unencodable, escape them as specified by <b> handling </b>
+ // We append one valid encoded chunk to a QByteArray at a time. When we encounter an unencodable chunk we
+ // escape it with getUnencodableReplacement, append it, then move to the next chunk.
+ if (state.invalidChars) {
+ state.invalidChars = 0;
+ state.remainingChars = 0;
+ int len = 0;
+ ba.clear();
+ for (size_t pos = 0; pos < length; ++pos) {
+ QByteArray tba = m_codec->fromUnicode(reinterpret_cast<const QChar*>(characters), ++len, &state);
+ if (state.remainingChars)
+ continue;
+ if (state.invalidChars) {
+ UnencodableReplacementArray replacement;
+ getUnencodableReplacement(characters[0], handling, replacement);
+ tba.replace('\0', replacement);
+ state.invalidChars = 0;
+ }
+ ba.append(tba);
+ characters += len;
+ len = 0;
+ state.remainingChars = 0;
+ }
+ }
- QByteArray ba = m_codec->fromUnicode(reinterpret_cast<const QChar*>(characters), length, 0);
return CString(ba.constData(), ba.length());
}
diff --git a/WebCore/platform/win/ClipboardWin.cpp b/WebCore/platform/win/ClipboardWin.cpp
index b13473a..529963f 100644
--- a/WebCore/platform/win/ClipboardWin.cpp
+++ b/WebCore/platform/win/ClipboardWin.cpp
@@ -397,19 +397,19 @@ exit:
PassRefPtr<Clipboard> Clipboard::create(ClipboardAccessPolicy policy, DragData* dragData, Frame* frame)
{
- return ClipboardWin::create(true, dragData->platformData(), policy, frame);
+ return ClipboardWin::create(DragAndDrop, dragData->platformData(), policy, frame);
}
-ClipboardWin::ClipboardWin(bool isForDragging, IDataObject* dataObject, ClipboardAccessPolicy policy, Frame* frame)
- : Clipboard(policy, isForDragging)
+ClipboardWin::ClipboardWin(ClipboardType clipboardType, IDataObject* dataObject, ClipboardAccessPolicy policy, Frame* frame)
+ : Clipboard(policy, clipboardType)
, m_dataObject(dataObject)
, m_writableDataObject(0)
, m_frame(frame)
{
}
-ClipboardWin::ClipboardWin(bool isForDragging, WCDataObject* dataObject, ClipboardAccessPolicy policy, Frame* frame)
- : Clipboard(policy, isForDragging)
+ClipboardWin::ClipboardWin(ClipboardType clipboardType, WCDataObject* dataObject, ClipboardAccessPolicy policy, Frame* frame)
+ : Clipboard(policy, clipboardType)
, m_dataObject(dataObject)
, m_writableDataObject(dataObject)
, m_frame(frame)
@@ -467,7 +467,7 @@ static bool writeURL(WCDataObject *data, const KURL& url, String title, bool wit
void ClipboardWin::clearData(const String& type)
{
// FIXME: Need to be able to write to the system clipboard <rdar://problem/5015941>
- ASSERT(isForDragging());
+ ASSERT(isForDragAndDrop());
if (policy() != ClipboardWritable || !m_writableDataObject)
return;
@@ -487,7 +487,7 @@ void ClipboardWin::clearData(const String& type)
void ClipboardWin::clearAllData()
{
// FIXME: Need to be able to write to the system clipboard <rdar://problem/5015941>
- ASSERT(isForDragging());
+ ASSERT(isForDragAndDrop());
if (policy() != ClipboardWritable)
return;
@@ -520,7 +520,7 @@ String ClipboardWin::getData(const String& type, bool& success) const
bool ClipboardWin::setData(const String& type, const String& data)
{
// FIXME: Need to be able to write to the system clipboard <rdar://problem/5015941>
- ASSERT(isForDragging());
+ ASSERT(isForDragAndDrop());
if (policy() != ClipboardWritable || !m_writableDataObject)
return false;
@@ -831,7 +831,7 @@ bool ClipboardWin::hasData()
void ClipboardWin::setExternalDataObject(IDataObject *dataObject)
{
- ASSERT(isForDragging());
+ ASSERT(isForDragAndDrop());
m_writableDataObject = 0;
m_dataObject = dataObject;
diff --git a/WebCore/platform/win/ClipboardWin.h b/WebCore/platform/win/ClipboardWin.h
index 6a08087..ce64b85 100644
--- a/WebCore/platform/win/ClipboardWin.h
+++ b/WebCore/platform/win/ClipboardWin.h
@@ -42,13 +42,13 @@ class WCDataObject;
// State available during IE's events for drag and drop and copy/paste
class ClipboardWin : public Clipboard, public CachedResourceClient {
public:
- static PassRefPtr<ClipboardWin> create(bool isForDragging, IDataObject* dataObject, ClipboardAccessPolicy policy, Frame* frame)
+ static PassRefPtr<ClipboardWin> create(ClipboardType clipboardType, IDataObject* dataObject, ClipboardAccessPolicy policy, Frame* frame)
{
- return adoptRef(new ClipboardWin(isForDragging, dataObject, policy, frame));
+ return adoptRef(new ClipboardWin(clipboardType, dataObject, policy, frame));
}
- static PassRefPtr<ClipboardWin> create(bool isForDragging, WCDataObject* dataObject, ClipboardAccessPolicy policy, Frame* frame)
+ static PassRefPtr<ClipboardWin> create(ClipboardType clipboardType, WCDataObject* dataObject, ClipboardAccessPolicy policy, Frame* frame)
{
- return adoptRef(new ClipboardWin(isForDragging, dataObject, policy, frame));
+ return adoptRef(new ClipboardWin(clipboardType, dataObject, policy, frame));
}
~ClipboardWin();
@@ -77,8 +77,8 @@ public:
void setExternalDataObject(IDataObject *dataObject);
private:
- ClipboardWin(bool isForDragging, IDataObject*, ClipboardAccessPolicy, Frame*);
- ClipboardWin(bool isForDragging, WCDataObject*, ClipboardAccessPolicy, Frame*);
+ ClipboardWin(ClipboardType, IDataObject*, ClipboardAccessPolicy, Frame*);
+ ClipboardWin(ClipboardType, WCDataObject*, ClipboardAccessPolicy, Frame*);
void resetFromClipboard();
void setDragImage(CachedImage*, Node*, const IntPoint&);
diff --git a/WebCore/platform/win/EditorWin.cpp b/WebCore/platform/win/EditorWin.cpp
index 075827d..4965c97 100644
--- a/WebCore/platform/win/EditorWin.cpp
+++ b/WebCore/platform/win/EditorWin.cpp
@@ -45,7 +45,7 @@ PassRefPtr<Clipboard> Editor::newGeneralClipboard(ClipboardAccessPolicy policy,
if (!SUCCEEDED(OleGetClipboard(&clipboardData)))
clipboardData = 0;
- return ClipboardWin::create(false, clipboardData.get(), policy, frame);
+ return ClipboardWin::create(Clipboard::CopyAndPaste, clipboardData.get(), policy, frame);
}
} // namespace WebCore
diff --git a/WebCore/platform/wx/ClipboardWx.cpp b/WebCore/platform/wx/ClipboardWx.cpp
index 2ef943f..32216a6 100644
--- a/WebCore/platform/wx/ClipboardWx.cpp
+++ b/WebCore/platform/wx/ClipboardWx.cpp
@@ -42,8 +42,8 @@ PassRefPtr<Clipboard> Clipboard::create(ClipboardAccessPolicy, DragData*, Frame*
return 0;
}
-ClipboardWx::ClipboardWx(ClipboardAccessPolicy policy, bool forDragging)
- : Clipboard(policy, forDragging)
+ClipboardWx::ClipboardWx(ClipboardAccessPolicy policy, ClipboardType clipboardType)
+ : Clipboard(policy, clipboardType)
{
}
diff --git a/WebCore/platform/wx/ClipboardWx.h b/WebCore/platform/wx/ClipboardWx.h
index 45d1cf3..138635a 100644
--- a/WebCore/platform/wx/ClipboardWx.h
+++ b/WebCore/platform/wx/ClipboardWx.h
@@ -35,9 +35,9 @@ namespace WebCore {
// State available during IE's events for drag and drop and copy/paste
class ClipboardWx : public Clipboard {
public:
- static PassRefPtr<ClipboardWx> create(ClipboardAccessPolicy policy, bool forDragging)
+ static PassRefPtr<ClipboardWx> create(ClipboardAccessPolicy policy, ClipboardType clipboardType)
{
- return adoptRef(new ClipboardWx(policy, forDragging));
+ return adoptRef(new ClipboardWx(policy, clipboardType));
}
void clearData(const String& type);
@@ -65,7 +65,7 @@ namespace WebCore {
virtual bool hasData();
private:
- ClipboardWx(ClipboardAccessPolicy, bool forDragging);
+ ClipboardWx(ClipboardAccessPolicy, ClipboardType);
};
}
diff --git a/WebCore/platform/wx/LocalizedStringsWx.cpp b/WebCore/platform/wx/LocalizedStringsWx.cpp
index 4112f64..10ea435 100644
--- a/WebCore/platform/wx/LocalizedStringsWx.cpp
+++ b/WebCore/platform/wx/LocalizedStringsWx.cpp
@@ -97,6 +97,56 @@ String contextMenuItemTagCopyImageToClipboard()
return String("Copy Image to Clipboard");
}
+String contextMenuItemTagOpenVideoInNewWindow()
+{
+ return String("Open Video in New Window");
+}
+
+String contextMenuItemTagOpenAudioInNewWindow()
+{
+ return String("Open Audio in New Window");
+}
+
+String contextMenuItemTagCopyVideoLinkToClipboard()
+{
+ return String("Copy Video Link Location");
+}
+
+String contextMenuItemTagCopyAudioLinkToClipboard()
+{
+ return String("Copy Audio Link Location");
+}
+
+String contextMenuItemTagToggleMediaControls()
+{
+ return String("Toggle Media Controls");
+}
+
+String contextMenuItemTagToggleMediaLoop()
+{
+ return String("Toggle Media Loop Playback");
+}
+
+String contextMenuItemTagEnterVideoFullscreen()
+{
+ return String("Switch Video to Fullscreen");
+}
+
+String contextMenuItemTagMediaPlay()
+{
+ return String("Play");
+}
+
+String contextMenuItemTagMediaPause()
+{
+ return String("Pause");
+}
+
+String contextMenuItemTagMediaMute()
+{
+ return String("Mute");
+}
+
String contextMenuItemTagOpenFrameInNewWindow()
{
return String("Open Frame in New Window");
diff --git a/WebCore/platform/wx/PopupMenuWx.cpp b/WebCore/platform/wx/PopupMenuWx.cpp
index e88d1e5..b850ef5 100644
--- a/WebCore/platform/wx/PopupMenuWx.cpp
+++ b/WebCore/platform/wx/PopupMenuWx.cpp
@@ -38,14 +38,34 @@
static int s_menuStartId = wxNewId();
+namespace WebCore {
+
+class PopupMenuEventHandler : public wxEvtHandler
+{
+public:
+ PopupMenuEventHandler(PopupMenuClient* client) :
+ m_client(client)
+ {}
+
+ void OnMenuItemSelected(wxCommandEvent& event)
+ {
+ if (m_client) {
+ m_client->valueChanged(event.GetId() - s_menuStartId);
+ m_client->popupDidHide();
+ }
+ // TODO: Do we need to call Disconnect here? Do we have a ref to the native window still?
+ }
+private:
+ PopupMenuClient* m_client;
-namespace WebCore {
+};
PopupMenuWx::PopupMenuWx(PopupMenuClient* client)
: m_popupClient(client)
- , m_menu(NULL)
+ , m_menu(0)
{
+ PopupMenuEventHandler m_popupHandler(client);
}
PopupMenuWx::~PopupMenuWx()
@@ -69,6 +89,7 @@ void PopupMenuWx::show(const IntRect& r, FrameView* v, int index)
if (nativeWin) {
// construct the menu
m_menu = new wxMenu();
+
int size = client()->listSize();
for (int i = 0; i < size; i++) {
int id = s_menuStartId + i;
@@ -84,19 +105,10 @@ void PopupMenuWx::show(const IntRect& r, FrameView* v, int index)
m_menu->Append(s_menuStartId + i, client()->itemText(i));
}
}
- nativeWin->Connect(s_menuStartId, s_menuStartId + (size-1), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(PopupMenuWx::OnMenuItemSelected), 0, this);
+ nativeWin->Connect(s_menuStartId, s_menuStartId + (size-1), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(PopupMenuEventHandler::OnMenuItemSelected), 0, m_popupHandler);
nativeWin->PopupMenu(m_menu, r.x() - v->scrollX(), r.y() - v->scrollY());
- nativeWin->Disconnect(s_menuStartId, s_menuStartId + (size-1), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(PopupMenuWx::OnMenuItemSelected), 0, this);
- }
-}
-
-void PopupMenuWx::OnMenuItemSelected(wxCommandEvent& event)
-{
- if (client()) {
- client()->valueChanged(event.GetId() - s_menuStartId);
- client()->popupDidHide();
+ nativeWin->Disconnect(s_menuStartId, s_menuStartId + (size-1), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(PopupMenuEventHandler::OnMenuItemSelected), 0, m_popupHandler);
}
- // TODO: Do we need to call Disconnect here? Do we have a ref to the native window still?
}
void PopupMenuWx::hide()
diff --git a/WebCore/platform/wx/PopupMenuWx.h b/WebCore/platform/wx/PopupMenuWx.h
index c2573fc..ad947a7 100644
--- a/WebCore/platform/wx/PopupMenuWx.h
+++ b/WebCore/platform/wx/PopupMenuWx.h
@@ -37,9 +37,10 @@ class wxMenu;
namespace WebCore {
class FrameView;
+class PopupMenuEventHandler;
class Scrollbar;
-class PopupMenuWx : public PopupMenu, public wxEvtHandler {
+class PopupMenuWx : public PopupMenu {
public:
PopupMenuWx(PopupMenuClient*);
~PopupMenuWx();
@@ -55,6 +56,7 @@ private:
PopupMenuClient* m_popupClient;
wxMenu* m_menu;
+ PopupMenuEventHandler* m_popupHandler;
};
}
diff --git a/WebCore/plugins/PluginData.cpp b/WebCore/plugins/PluginData.cpp
index ff90747..d24d234 100644
--- a/WebCore/plugins/PluginData.cpp
+++ b/WebCore/plugins/PluginData.cpp
@@ -75,7 +75,7 @@ void PluginData::initPlugins()
{
ASSERT(m_plugins.isEmpty());
- platformStrategies()->pluginStrategy()->getPluginInfo(m_plugins);
+ platformStrategies()->pluginStrategy()->getPluginInfo(m_page, m_plugins);
}
#endif
diff --git a/WebCore/plugins/PluginPackage.cpp b/WebCore/plugins/PluginPackage.cpp
index 660d8f0..1d41dc6 100644
--- a/WebCore/plugins/PluginPackage.cpp
+++ b/WebCore/plugins/PluginPackage.cpp
@@ -210,12 +210,13 @@ void PluginPackage::determineQuirks(const String& mimeType)
} else {
// Flash 9 and older requests windowless plugins if we return a mozilla user agent
m_quirks.add(PluginQuirkWantsMozillaUserAgent);
-#if PLATFORM(QT)
- // Flash 9 and older would crash on repeated calls to SetWindow in windowed mode
- m_quirks.add(PluginQuirkDontCallSetWindowMoreThanOnce);
-#endif
}
+#if PLATFORM(QT) && CPU(X86)
+ // 32-bit Flash will crash on repeated calls to SetWindow in windowed mode
+ m_quirks.add(PluginQuirkDontCallSetWindowMoreThanOnce);
+#endif
+
m_quirks.add(PluginQuirkRequiresDefaultScreenDepth);
m_quirks.add(PluginQuirkThrottleInvalidate);
m_quirks.add(PluginQuirkThrottleWMUserPlusOneMessages);
diff --git a/WebCore/plugins/PluginStrategy.h b/WebCore/plugins/PluginStrategy.h
index 7e92196..9d8a7b5 100644
--- a/WebCore/plugins/PluginStrategy.h
+++ b/WebCore/plugins/PluginStrategy.h
@@ -32,10 +32,12 @@
namespace WebCore {
+class Page;
+
class PluginStrategy {
public:
virtual void refreshPlugins() = 0;
- virtual void getPluginInfo(Vector<PluginInfo>&) = 0;
+ virtual void getPluginInfo(const Page*, Vector<PluginInfo>&) = 0;
protected:
virtual ~PluginStrategy() { }
diff --git a/WebCore/plugins/PluginView.cpp b/WebCore/plugins/PluginView.cpp
index ca358b7..2522e0f 100644
--- a/WebCore/plugins/PluginView.cpp
+++ b/WebCore/plugins/PluginView.cpp
@@ -713,7 +713,7 @@ NPError PluginView::setValue(NPPVariable variable, void* value)
}
#endif // defined(XP_MACOSX)
-#if PLATFORM(QT) && defined(MOZ_PLATFORM_MAEMO) && (MOZ_PLATFORM_MAEMO == 5)
+#if PLATFORM(QT) && defined(MOZ_PLATFORM_MAEMO) && (MOZ_PLATFORM_MAEMO >= 5)
case NPPVpluginWindowlessLocalBool:
m_renderToImage = true;
return NPERR_NO_ERROR;
@@ -943,7 +943,7 @@ PluginView::PluginView(Frame* parentFrame, const IntSize& size, PluginPackage* p
, m_colormap(0)
, m_pluginDisplay(0)
#endif
-#if PLATFORM(QT) && defined(MOZ_PLATFORM_MAEMO) && (MOZ_PLATFORM_MAEMO == 5)
+#if PLATFORM(QT) && defined(MOZ_PLATFORM_MAEMO) && (MOZ_PLATFORM_MAEMO >= 5)
, m_renderToImage(false)
#endif
, m_loadManually(loadManually)
diff --git a/WebCore/plugins/PluginView.h b/WebCore/plugins/PluginView.h
index 8587c37..3d4e13e 100644
--- a/WebCore/plugins/PluginView.h
+++ b/WebCore/plugins/PluginView.h
@@ -65,7 +65,7 @@ typedef PlatformWidget PlatformPluginWidget;
#include <QPixmap>
#endif
#endif
-#if PLATFORM(QT) && defined(MOZ_PLATFORM_MAEMO) && (MOZ_PLATFORM_MAEMO == 5)
+#if PLATFORM(QT) && defined(MOZ_PLATFORM_MAEMO) && (MOZ_PLATFORM_MAEMO >= 5)
#include <QImage>
class QPainter;
#endif
@@ -448,7 +448,7 @@ private:
void initXEvent(XEvent* event);
#endif
-#if PLATFORM(QT) && defined(MOZ_PLATFORM_MAEMO) && (MOZ_PLATFORM_MAEMO == 5)
+#if PLATFORM(QT) && defined(MOZ_PLATFORM_MAEMO) && (MOZ_PLATFORM_MAEMO >= 5)
QImage m_image;
bool m_renderToImage;
void paintUsingImageSurfaceExtension(QPainter* painter, const IntRect& exposedRect);
diff --git a/WebCore/plugins/qt/PluginViewQt.cpp b/WebCore/plugins/qt/PluginViewQt.cpp
index de7d12d..b7e1268 100644
--- a/WebCore/plugins/qt/PluginViewQt.cpp
+++ b/WebCore/plugins/qt/PluginViewQt.cpp
@@ -115,7 +115,7 @@ void PluginView::updatePluginWidget()
return;
if (!m_isWindowed && m_windowRect.size() != oldWindowRect.size()) {
-#if defined(MOZ_PLATFORM_MAEMO) && (MOZ_PLATFORM_MAEMO == 5)
+#if defined(MOZ_PLATFORM_MAEMO) && (MOZ_PLATFORM_MAEMO >= 5)
// On Maemo5, Flash always renders to 16-bit buffer
if (m_renderToImage)
m_image = QImage(m_windowRect.width(), m_windowRect.height(), QImage::Format_RGB16);
@@ -172,7 +172,7 @@ void PluginView::hide()
Widget::hide();
}
-#if defined(MOZ_PLATFORM_MAEMO) && (MOZ_PLATFORM_MAEMO == 5)
+#if defined(MOZ_PLATFORM_MAEMO) && (MOZ_PLATFORM_MAEMO >= 5)
void PluginView::paintUsingImageSurfaceExtension(QPainter* painter, const IntRect& exposedRect)
{
NPImageExpose imageExpose;
@@ -253,7 +253,7 @@ void PluginView::paint(GraphicsContext* context, const IntRect& rect)
return;
if (!m_drawable
-#if defined(MOZ_PLATFORM_MAEMO) && (MOZ_PLATFORM_MAEMO == 5)
+#if defined(MOZ_PLATFORM_MAEMO) && (MOZ_PLATFORM_MAEMO >= 5)
&& m_image.isNull()
#endif
)
@@ -264,7 +264,7 @@ void PluginView::paint(GraphicsContext* context, const IntRect& rect)
exposedRect.intersect(frameRect());
exposedRect.move(-frameRect().x(), -frameRect().y());
-#if defined(MOZ_PLATFORM_MAEMO) && (MOZ_PLATFORM_MAEMO == 5)
+#if defined(MOZ_PLATFORM_MAEMO) && (MOZ_PLATFORM_MAEMO >= 5)
if (!m_image.isNull()) {
paintUsingImageSurfaceExtension(painter, exposedRect);
return;
@@ -697,7 +697,7 @@ bool PluginView::platformGetValueStatic(NPNVariable variable, void* value, NPErr
*result = NPERR_NO_ERROR;
return true;
-#if defined(MOZ_PLATFORM_MAEMO) && (MOZ_PLATFORM_MAEMO == 5)
+#if defined(MOZ_PLATFORM_MAEMO) && (MOZ_PLATFORM_MAEMO >= 5)
case NPNVSupportsWindowlessLocal:
*static_cast<NPBool*>(value) = true;
*result = NPERR_NO_ERROR;
diff --git a/WebCore/rendering/AutoTableLayout.cpp b/WebCore/rendering/AutoTableLayout.cpp
index d9233a2..bf1bcd9 100644
--- a/WebCore/rendering/AutoTableLayout.cpp
+++ b/WebCore/rendering/AutoTableLayout.cpp
@@ -60,7 +60,7 @@ void AutoTableLayout::recalcColumn(int effCol)
while (child) {
if (child->isTableCol())
- toRenderTableCol(child)->calcPrefWidths();
+ toRenderTableCol(child)->computePreferredLogicalWidths();
else if (child->isTableSection()) {
RenderTableSection* section = toRenderTableSection(child);
int numRows = section->numRows();
@@ -79,11 +79,11 @@ void AutoTableLayout::recalcColumn(int effCol)
// a min/max width of at least 1px for this column now.
l.minWidth = max(l.minWidth, cellHasContent ? 1 : 0);
l.maxWidth = max(l.maxWidth, 1);
- if (cell->prefWidthsDirty())
- cell->calcPrefWidths();
- l.minWidth = max(cell->minPrefWidth(), l.minWidth);
- if (cell->maxPrefWidth() > l.maxWidth) {
- l.maxWidth = cell->maxPrefWidth();
+ if (cell->preferredLogicalWidthsDirty())
+ cell->computePreferredLogicalWidths();
+ l.minWidth = max(cell->minPreferredLogicalWidth(), l.minWidth);
+ if (cell->maxPreferredLogicalWidth() > l.maxWidth) {
+ l.maxWidth = cell->maxPreferredLogicalWidth();
maxContributor = cell;
}
@@ -97,7 +97,7 @@ void AutoTableLayout::recalcColumn(int effCol)
case Fixed:
// ignore width=0
if (w.value() > 0 && (int)l.width.type() != Percent) {
- int wval = cell->calcBorderBoxWidth(w.value());
+ int wval = cell->computeBorderBoxLogicalWidth(w.value());
if (l.width.isFixed()) {
// Nav/IE weirdness
if ((wval > l.width.value()) ||
@@ -239,7 +239,7 @@ static bool shouldScaleColumns(RenderTable* table)
return scale;
}
-void AutoTableLayout::calcPrefWidths(int& minWidth, int& maxWidth)
+void AutoTableLayout::computePreferredLogicalWidths(int& minWidth, int& maxWidth)
{
fullRecalc();
@@ -317,8 +317,8 @@ int AutoTableLayout::calcEffectiveWidth()
int col = m_table->colToEffCol(cell->col());
unsigned int lastCol = col;
- int cMinWidth = cell->minPrefWidth() + hspacing;
- float cMaxWidth = cell->maxPrefWidth() + hspacing;
+ int cMinWidth = cell->minPreferredLogicalWidth() + hspacing;
+ float cMaxWidth = cell->maxPreferredLogicalWidth() + hspacing;
int totalPercent = 0;
int minWidth = 0;
float maxWidth = 0;
diff --git a/WebCore/rendering/AutoTableLayout.h b/WebCore/rendering/AutoTableLayout.h
index f1ef768..5726ba6 100644
--- a/WebCore/rendering/AutoTableLayout.h
+++ b/WebCore/rendering/AutoTableLayout.h
@@ -35,7 +35,7 @@ public:
AutoTableLayout(RenderTable*);
~AutoTableLayout();
- virtual void calcPrefWidths(int& minWidth, int& maxWidth);
+ virtual void computePreferredLogicalWidths(int& minWidth, int& maxWidth);
virtual void layout();
protected:
diff --git a/WebCore/rendering/EllipsisBox.cpp b/WebCore/rendering/EllipsisBox.cpp
index 61cd524..1d71d35 100644
--- a/WebCore/rendering/EllipsisBox.cpp
+++ b/WebCore/rendering/EllipsisBox.cpp
@@ -62,7 +62,7 @@ void EllipsisBox::paint(PaintInfo& paintInfo, int tx, int ty)
if (m_markupBox) {
// Paint the markup box
- tx += m_x + m_width - m_markupBox->x();
+ tx += m_x + m_logicalWidth - m_markupBox->x();
ty += m_y + style->font().ascent() - (m_markupBox->y() + m_markupBox->renderer()->style(m_firstLine)->font().ascent());
m_markupBox->paint(paintInfo, tx, ty);
}
@@ -91,7 +91,7 @@ void EllipsisBox::paintSelection(GraphicsContext* context, int tx, int ty, Rende
context->save();
int y = root()->selectionTop();
int h = root()->selectionHeight();
- context->clip(IntRect(m_x + tx, y + ty, m_width, h));
+ context->clip(IntRect(m_x + tx, y + ty, m_logicalWidth, h));
context->drawHighlightForText(font, TextRun(m_str.characters(), m_str.length(), false, 0, 0, false, style->visuallyOrdered()),
IntPoint(m_x + tx, m_y + ty + y), h, c, style->colorSpace());
context->restore();
@@ -105,7 +105,7 @@ bool EllipsisBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& resu
// Hit test the markup box.
if (m_markupBox) {
RenderStyle* style = m_renderer->style(m_firstLine);
- int mtx = tx + m_width - m_markupBox->x();
+ int mtx = tx + m_logicalWidth - m_markupBox->x();
int mty = ty + style->font().ascent() - (m_markupBox->y() + m_markupBox->renderer()->style(m_firstLine)->font().ascent());
if (m_markupBox->nodeAtPoint(request, result, x, y, mtx, mty)) {
renderer()->updateHitTestResult(result, IntPoint(x - mtx, y - mty));
@@ -113,7 +113,7 @@ bool EllipsisBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& resu
}
}
- IntRect boundsRect = IntRect(tx, ty, m_width, m_height);
+ IntRect boundsRect = IntRect(tx, ty, m_logicalWidth, m_height);
if (visibleToHitTesting() && boundsRect.intersects(result.rectFromPoint(x, y))) {
renderer()->updateHitTestResult(result, IntPoint(x - tx, y - ty));
if (!result.addNodeToRectBasedTestResult(renderer()->node(), x, y, boundsRect))
diff --git a/WebCore/rendering/EllipsisBox.h b/WebCore/rendering/EllipsisBox.h
index 476331c..ec1b00b 100644
--- a/WebCore/rendering/EllipsisBox.h
+++ b/WebCore/rendering/EllipsisBox.h
@@ -30,8 +30,8 @@ class HitTestResult;
class EllipsisBox : public InlineBox {
public:
EllipsisBox(RenderObject* obj, const AtomicString& ellipsisStr, InlineFlowBox* parent,
- int width, int height, int y, bool firstLine, InlineBox* markupBox)
- : InlineBox(obj, 0, y, width, firstLine, true, false, false, 0, 0, parent)
+ int width, int height, int y, bool firstLine, bool isVertical, InlineBox* markupBox)
+ : InlineBox(obj, 0, y, width, firstLine, true, false, false, isVertical, 0, 0, parent)
, m_height(height)
, m_str(ellipsisStr)
, m_markupBox(markupBox)
diff --git a/WebCore/rendering/FixedTableLayout.cpp b/WebCore/rendering/FixedTableLayout.cpp
index b5ff971..ba99336 100644
--- a/WebCore/rendering/FixedTableLayout.cpp
+++ b/WebCore/rendering/FixedTableLayout.cpp
@@ -126,7 +126,7 @@ int FixedTableLayout::calcWidthArray(int)
currentEffectiveColumn++;
}
}
- toRenderTableCol(child)->calcPrefWidths();
+ toRenderTableCol(child)->computePreferredLogicalWidths();
} else
break;
@@ -155,8 +155,8 @@ int FixedTableLayout::calcWidthArray(int)
while (child) {
if (child->isTableCell()) {
RenderTableCell* cell = toRenderTableCell(child);
- if (cell->prefWidthsDirty())
- cell->calcPrefWidths();
+ if (cell->preferredLogicalWidthsDirty())
+ cell->computePreferredLogicalWidths();
Length w = cell->styleOrColWidth();
int span = cell->colSpan();
@@ -190,7 +190,7 @@ int FixedTableLayout::calcWidthArray(int)
// Keep this in synch with BLOCK_MAX_WIDTH in RenderBlock.cpp
#define TABLE_MAX_WIDTH 15000
-void FixedTableLayout::calcPrefWidths(int& minWidth, int& maxWidth)
+void FixedTableLayout::computePreferredLogicalWidths(int& minWidth, int& maxWidth)
{
// FIXME: This entire calculation is incorrect for both minwidth and maxwidth.
diff --git a/WebCore/rendering/FixedTableLayout.h b/WebCore/rendering/FixedTableLayout.h
index 758ddbb..bf26d1b 100644
--- a/WebCore/rendering/FixedTableLayout.h
+++ b/WebCore/rendering/FixedTableLayout.h
@@ -33,7 +33,7 @@ class FixedTableLayout : public TableLayout {
public:
FixedTableLayout(RenderTable*);
- virtual void calcPrefWidths(int& minWidth, int& maxWidth);
+ virtual void computePreferredLogicalWidths(int& minWidth, int& maxWidth);
virtual void layout();
protected:
diff --git a/WebCore/rendering/HitTestResult.cpp b/WebCore/rendering/HitTestResult.cpp
index 496c4ba..35a6d23 100644
--- a/WebCore/rendering/HitTestResult.cpp
+++ b/WebCore/rendering/HitTestResult.cpp
@@ -24,6 +24,7 @@
#include "Frame.h"
#include "FrameTree.h"
#include "HTMLAnchorElement.h"
+#include "HTMLVideoElement.h"
#include "HTMLImageElement.h"
#include "HTMLInputElement.h"
#include "HTMLMediaElement.h"
@@ -50,17 +51,27 @@ HitTestResult::HitTestResult(const IntPoint& point)
: m_point(point)
, m_isOverWidget(false)
, m_isRectBased(false)
+ , m_topPadding(0)
+ , m_rightPadding(0)
+ , m_bottomPadding(0)
+ , m_leftPadding(0)
{
}
-HitTestResult::HitTestResult(const IntPoint& centerPoint, const IntSize& padding)
+HitTestResult::HitTestResult(const IntPoint& centerPoint, unsigned topPadding, unsigned rightPadding, unsigned bottomPadding, unsigned leftPadding)
: m_point(centerPoint)
, m_isOverWidget(false)
+ , m_topPadding(topPadding)
+ , m_rightPadding(rightPadding)
+ , m_bottomPadding(bottomPadding)
+ , m_leftPadding(leftPadding)
{
- // If a zero padding is passed in or either width or height is negative, then it
- // is not a valid padding and hence not a rect based hit test.
- m_isRectBased = !(padding.isZero() || (padding.width() < 0 || padding.height() < 0));
- m_padding = m_isRectBased ? padding : IntSize();
+ // If all padding values passed in are zero then it is not a rect based hit test.
+ m_isRectBased = topPadding || rightPadding || bottomPadding || leftPadding;
+
+ // Make sure all padding values are clamped to zero if it is not a rect hit test.
+ if (!m_isRectBased)
+ m_topPadding = m_rightPadding = m_bottomPadding = m_leftPadding = 0;
}
HitTestResult::HitTestResult(const HitTestResult& other)
@@ -75,9 +86,13 @@ HitTestResult::HitTestResult(const HitTestResult& other)
// Only copy the padding and ListHashSet in case of rect hit test.
// Copying the later is rather expensive.
if ((m_isRectBased = other.isRectBasedTest())) {
- m_padding = other.padding();
+ m_topPadding = other.m_topPadding;
+ m_rightPadding = other.m_rightPadding;
+ m_bottomPadding = other.m_bottomPadding;
+ m_leftPadding = other.m_leftPadding;
m_rectBasedTestResult = other.rectBasedTestResult();
- }
+ } else
+ m_topPadding = m_rightPadding = m_bottomPadding = m_leftPadding = 0;
}
HitTestResult::~HitTestResult()
@@ -96,9 +111,13 @@ HitTestResult& HitTestResult::operator=(const HitTestResult& other)
// Only copy the padding and ListHashSet in case of rect hit test.
// Copying the later is rather expensive.
if ((m_isRectBased = other.isRectBasedTest())) {
- m_padding = other.padding();
+ m_topPadding = other.m_topPadding;
+ m_rightPadding = other.m_rightPadding;
+ m_bottomPadding = other.m_bottomPadding;
+ m_leftPadding = other.m_leftPadding;
m_rectBasedTestResult = other.rectBasedTestResult();
- }
+ } else
+ m_topPadding = m_rightPadding = m_bottomPadding = m_leftPadding = 0;
return *this;
}
@@ -292,22 +311,134 @@ KURL HitTestResult::absoluteImageURL() const
KURL HitTestResult::absoluteMediaURL() const
{
#if ENABLE(VIDEO)
+ if (HTMLMediaElement* mediaElt = mediaElement())
+ return m_innerNonSharedNode->document()->completeURL(deprecatedParseURL(mediaElt->currentSrc()));
+ return KURL();
+#else
+ return KURL();
+#endif
+}
+
+bool HitTestResult::mediaSupportsFullscreen() const
+{
+#if ENABLE(VIDEO)
+ HTMLMediaElement* mediaElt(mediaElement());
+ return (mediaElt && mediaElt->hasTagName(HTMLNames::videoTag) && mediaElt->supportsFullscreen());
+#else
+ return false;
+#endif
+}
+
+#if ENABLE(VIDEO)
+HTMLMediaElement* HitTestResult::mediaElement() const
+{
if (!(m_innerNonSharedNode && m_innerNonSharedNode->document()))
- return KURL();
+ return 0;
if (!(m_innerNonSharedNode->renderer() && m_innerNonSharedNode->renderer()->isMedia()))
- return KURL();
+ return 0;
- AtomicString urlString;
- if (m_innerNonSharedNode->hasTagName(HTMLNames::videoTag) || m_innerNonSharedNode->hasTagName(HTMLNames::audioTag)) {
- HTMLMediaElement* mediaElement = static_cast<HTMLMediaElement*>(m_innerNonSharedNode.get());
- urlString = mediaElement->currentSrc();
- } else
- return KURL();
+ if (m_innerNonSharedNode->hasTagName(HTMLNames::videoTag) || m_innerNonSharedNode->hasTagName(HTMLNames::audioTag))
+ return static_cast<HTMLMediaElement*>(m_innerNonSharedNode.get());
+ return 0;
+}
+#endif
- return m_innerNonSharedNode->document()->completeURL(deprecatedParseURL(urlString));
-#else
- return KURL();
+void HitTestResult::toggleMediaControlsDisplay() const
+{
+#if ENABLE(VIDEO)
+ if (HTMLMediaElement* mediaElt = mediaElement())
+ mediaElt->setControls(!mediaElt->controls());
+#endif
+}
+
+void HitTestResult::toggleMediaLoopPlayback() const
+{
+#if ENABLE(VIDEO)
+ if (HTMLMediaElement* mediaElt = mediaElement())
+ mediaElt->setLoop(!mediaElt->loop());
+#endif
+}
+
+void HitTestResult::enterFullscreenForVideo() const
+{
+#if ENABLE(VIDEO)
+ HTMLMediaElement* mediaElt(mediaElement());
+ if (mediaElt && mediaElt->hasTagName(HTMLNames::videoTag)) {
+ HTMLVideoElement* videoElt = static_cast<HTMLVideoElement*>(mediaElt);
+ if (!videoElt->isFullscreen() && mediaElt->supportsFullscreen())
+ videoElt->enterFullscreen();
+ }
+#endif
+}
+
+bool HitTestResult::mediaControlsEnabled() const
+{
+#if ENABLE(VIDEO)
+ if (HTMLMediaElement* mediaElt = mediaElement())
+ return mediaElt->controls();
+#endif
+ return false;
+}
+
+bool HitTestResult::mediaLoopEnabled() const
+{
+#if ENABLE(VIDEO)
+ if (HTMLMediaElement* mediaElt = mediaElement())
+ return mediaElt->loop();
+#endif
+ return false;
+}
+
+bool HitTestResult::mediaPlaying() const
+{
+#if ENABLE(VIDEO)
+ if (HTMLMediaElement* mediaElt = mediaElement())
+ return !mediaElt->paused();
+#endif
+ return false;
+}
+
+void HitTestResult::toggleMediaPlayState() const
+{
+#if ENABLE(VIDEO)
+ if (HTMLMediaElement* mediaElt = mediaElement())
+ mediaElt->togglePlayState();
+#endif
+}
+
+bool HitTestResult::mediaHasAudio() const
+{
+#if ENABLE(VIDEO)
+ if (HTMLMediaElement* mediaElt = mediaElement())
+ return mediaElt->hasAudio();
+#endif
+ return false;
+}
+
+bool HitTestResult::mediaIsVideo() const
+{
+#if ENABLE(VIDEO)
+ if (HTMLMediaElement* mediaElt = mediaElement())
+ return mediaElt->hasTagName(HTMLNames::videoTag);
+#endif
+ return false;
+}
+
+bool HitTestResult::mediaMuted() const
+{
+#if ENABLE(VIDEO)
+ if (HTMLMediaElement* mediaElt = mediaElement())
+ return mediaElt->muted();
+#endif
+ return false;
+}
+
+void HitTestResult::toggleMediaMuteState() const
+{
+#if ENABLE(VIDEO)
+ if (HTMLMediaElement* mediaElt = mediaElement())
+ mediaElt->setMuted(!mediaElt->muted());
#endif
}
@@ -421,4 +552,16 @@ void HitTestResult::append(const HitTestResult& other)
m_rectBasedTestResult.add(it->get());
}
+IntRect HitTestResult::rectFromPoint(const IntPoint& point, unsigned topPadding, unsigned rightPadding, unsigned bottomPadding, unsigned leftPadding)
+{
+ IntPoint actualPoint(point);
+ actualPoint -= IntSize(leftPadding, topPadding);
+
+ IntSize actualPadding(leftPadding + rightPadding, topPadding + bottomPadding);
+ // As IntRect is left inclusive and right exclusive (seeing IntRect::contains(x, y)), adding "1".
+ actualPadding += IntSize(1, 1);
+
+ return IntRect(actualPoint, actualPadding);
+}
+
} // namespace WebCore
diff --git a/WebCore/rendering/HitTestResult.h b/WebCore/rendering/HitTestResult.h
index 3a42719..1304e22 100644
--- a/WebCore/rendering/HitTestResult.h
+++ b/WebCore/rendering/HitTestResult.h
@@ -32,6 +32,9 @@ namespace WebCore {
class Element;
class Frame;
+#if ENABLE(VIDEO)
+class HTMLMediaElement;
+#endif
class Image;
class IntRect;
class KURL;
@@ -41,8 +44,8 @@ class Scrollbar;
class HitTestResult {
public:
HitTestResult(const IntPoint&);
- // Pass a non-negative IntSize value as padding to perform a rect-based hit test.
- HitTestResult(const IntPoint& centerPoint, const IntSize& padding);
+ // Pass non-negative padding values to perform a rect-based hit test.
+ HitTestResult(const IntPoint& centerPoint, unsigned topPadding, unsigned rightPadding, unsigned bottomPadding, unsigned leftPadding);
HitTestResult(const HitTestResult&);
~HitTestResult();
HitTestResult& operator=(const HitTestResult&);
@@ -80,14 +83,29 @@ public:
String textContent() const;
bool isLiveLink() const;
bool isContentEditable() const;
+ void toggleMediaControlsDisplay() const;
+ void toggleMediaLoopPlayback() const;
+ void enterFullscreenForVideo() const;
+ bool mediaControlsEnabled() const;
+ bool mediaLoopEnabled() const;
+ bool mediaPlaying() const;
+ bool mediaSupportsFullscreen() const;
+ void toggleMediaPlayState() const;
+ bool mediaHasAudio() const;
+ bool mediaIsVideo() const;
+ bool mediaMuted() const;
+ void toggleMediaMuteState() const;
// Rect-based hit test related methods.
bool isRectBasedTest() const { return m_isRectBased; }
IntRect rectFromPoint(int x, int y) const;
IntRect rectFromPoint(const IntPoint&) const;
- IntSize padding() const { return m_padding; }
- int paddingWidth() const { return m_padding.width(); }
- int paddingHeight() const { return m_padding.height(); }
+ static IntRect rectFromPoint(const IntPoint&, unsigned topPadding, unsigned rightPadding, unsigned bottomPadding, unsigned leftPadding);
+ int topPadding() const { return m_topPadding; }
+ int rightPadding() const { return m_rightPadding; }
+ int bottomPadding() const { return m_bottomPadding; }
+ int leftPadding() const { return m_leftPadding; }
+
// Returns true if it is rect-based hit test and needs to continue until the rect is fully
// enclosed by the boundaries of a node.
bool addNodeToRectBasedTestResult(Node*, int x, int y, const IntRect& rect = IntRect());
@@ -96,6 +114,10 @@ public:
private:
+#if ENABLE(VIDEO)
+ HTMLMediaElement* mediaElement() const;
+#endif
+
RefPtr<Node> m_innerNode;
RefPtr<Node> m_innerNonSharedNode;
IntPoint m_point;
@@ -105,34 +127,26 @@ private:
RefPtr<Scrollbar> m_scrollbar;
bool m_isOverWidget; // Returns true if we are over a widget (and not in the border/padding area of a RenderWidget for example).
bool m_isRectBased;
- IntSize m_padding;
+ int m_topPadding;
+ int m_rightPadding;
+ int m_bottomPadding;
+ int m_leftPadding;
ListHashSet<RefPtr<Node> > m_rectBasedTestResult;
};
inline IntRect HitTestResult::rectFromPoint(int x, int y) const
{
- return rectFromPoint(IntPoint(x, y));
+ return rectFromPoint(IntPoint(x, y), m_topPadding, m_rightPadding, m_bottomPadding, m_leftPadding);
}
// Formula:
-// x = p.x() - padding.width()
-// y = p.y() - padding.height()
-// width = 2 * padding.width() + 1
-// height = 2 * m_padding.height() + 1
+// x = p.x() - rightPadding
+// y = p.y() - topPadding
+// width = leftPadding + rightPadding + 1
+// height = topPadding + bottomPadding + 1
inline IntRect HitTestResult::rectFromPoint(const IntPoint& point) const
{
- IntPoint realPoint(point);
- IntSize realPadding(m_padding);
-
- // Real IntPoint for the rect.
- realPadding.clampNegativeToZero();
- realPoint -= realPadding;
-
- // Real IntSize for the rect.
- realPadding.scale(2);
- realPadding += IntSize(1, 1);
-
- return IntRect(realPoint, realPadding);
+ return rectFromPoint(point, m_topPadding, m_rightPadding, m_bottomPadding, m_leftPadding);
}
String displayString(const String&, const Node*);
diff --git a/WebCore/rendering/InlineBox.cpp b/WebCore/rendering/InlineBox.cpp
index 5475187..91cbaff 100644
--- a/WebCore/rendering/InlineBox.cpp
+++ b/WebCore/rendering/InlineBox.cpp
@@ -85,11 +85,11 @@ void InlineBox::showTreeForThis() const
}
#endif
-int InlineBox::height() const
+int InlineBox::logicalHeight() const
{
#if ENABLE(SVG)
- if (hasVirtualHeight())
- return virtualHeight();
+ if (hasVirtualLogicalHeight())
+ return virtualLogicalHeight();
#endif
if (renderer()->isText())
@@ -268,7 +268,7 @@ bool InlineBox::canAccommodateEllipsis(bool ltr, int blockEdge, int ellipsisWidt
if (!m_renderer || !m_renderer->isReplaced())
return true;
- IntRect boxRect(m_x, 0, m_width, 10);
+ IntRect boxRect(m_x, 0, m_logicalWidth, 10);
IntRect ellipsisRect(ltr ? blockEdge - ellipsisWidth : blockEdge, 0, ellipsisWidth, 10);
return !(boxRect.intersects(ellipsisRect));
}
diff --git a/WebCore/rendering/InlineBox.h b/WebCore/rendering/InlineBox.h
index ab0167c..1cd88ff 100644
--- a/WebCore/rendering/InlineBox.h
+++ b/WebCore/rendering/InlineBox.h
@@ -30,7 +30,6 @@ class HitTestRequest;
class HitTestResult;
class RootInlineBox;
-
// InlineBox represents a rectangle that occurs on a line. It corresponds to
// some RenderObject (i.e., it represents a portion of that RenderObject).
class InlineBox {
@@ -42,15 +41,16 @@ public:
, m_renderer(obj)
, m_x(0)
, m_y(0)
- , m_width(0)
+ , m_logicalWidth(0)
, m_firstLine(false)
, m_constructed(false)
, m_bidiEmbeddingLevel(0)
, m_dirty(false)
, m_extracted(false)
#if ENABLE(SVG)
- , m_hasVirtualHeight(false)
+ , m_hasVirtualLogicalHeight(false)
#endif
+ , m_isVertical(false)
, m_endsWithBreak(false)
, m_hasSelectedChildren(false)
, m_hasEllipsisBoxOrHyphen(false)
@@ -67,23 +67,24 @@ public:
{
}
- InlineBox(RenderObject* obj, int x, int y, int width, bool firstLine, bool constructed,
- bool dirty, bool extracted, InlineBox* next, InlineBox* prev, InlineFlowBox* parent)
+ InlineBox(RenderObject* obj, int x, int y, int logicalWidth, bool firstLine, bool constructed,
+ bool dirty, bool extracted, bool isVertical, InlineBox* next, InlineBox* prev, InlineFlowBox* parent)
: m_next(next)
, m_prev(prev)
, m_parent(parent)
, m_renderer(obj)
, m_x(x)
, m_y(y)
- , m_width(width)
+ , m_logicalWidth(logicalWidth)
, m_firstLine(firstLine)
, m_constructed(constructed)
, m_bidiEmbeddingLevel(0)
, m_dirty(dirty)
, m_extracted(extracted)
#if ENABLE(SVG)
- , m_hasVirtualHeight(false)
+ , m_hasVirtualLogicalHeight(false)
#endif
+ , m_isVertical(isVertical)
, m_endsWithBreak(false)
, m_hasSelectedChildren(false)
, m_hasEllipsisBoxOrHyphen(false)
@@ -139,15 +140,18 @@ public:
#if ENABLE(SVG)
virtual bool isSVGInlineTextBox() const { return false; }
virtual bool isSVGRootInlineBox() const { return false; }
+#endif
- bool hasVirtualHeight() const { return m_hasVirtualHeight; }
- void setHasVirtualHeight() { m_hasVirtualHeight = true; }
- virtual int virtualHeight() const
+ bool hasVirtualLogicalHeight() const { return m_hasVirtualLogicalHeight; }
+ void setHasVirtualLogicalHeight() { m_hasVirtualLogicalHeight = true; }
+ virtual int virtualLogicalHeight() const
{
ASSERT_NOT_REACHED();
return 0;
}
-#endif
+
+ bool isVertical() const { return m_isVertical; }
+ void setIsVertical(bool v) { m_isVertical = v; }
virtual IntRect calculateBoundaries() const
{
@@ -202,18 +206,40 @@ public:
const RootInlineBox* root() const;
RootInlineBox* root();
- void setWidth(int w) { m_width = w; }
- int width() const { return m_width; }
-
- // x() is the left side of the box in the parent's coordinate system.
+ // x() is the left side of the box in the containing block's coordinate system.
void setX(int x) { m_x = x; }
int x() const { return m_x; }
- // y() is the top of the box in the parent's coordinate system.
+ // y() is the top side of the box in the containing block's coordinate system.
void setY(int y) { m_y = y; }
int y() const { return m_y; }
- int height() const;
+ // The logicalLeft position is the left edge of the line box in a horizontal line and the top edge in a vertical line.
+ int logicalLeft() const { return !m_isVertical ? m_x : m_y; }
+ void setLogicalLeft(int left)
+ {
+ if (!m_isVertical)
+ m_x = left;
+ else
+ m_y = left;
+ }
+
+ // The logicalTop[ position is the top edge of the line box in a horizontal line and the left edge in a vertical line.
+ int logicalTop() const { return !m_isVertical ? m_y : m_x; }
+ void setLogicalTop(int top)
+ {
+ if (!m_isVertical)
+ m_y = top;
+ else
+ m_x = top;
+ }
+
+ // The logical width is our extent in the line's overall inline direction, i.e., width for horizontal text and height for vertical text.
+ void setLogicalWidth(int w) { m_logicalWidth = w; }
+ int logicalWidth() const { return m_logicalWidth; }
+
+ // The logical height is our extent in the block flow direction, i.e., height for horizontal text and width for vertical text.
+ int logicalHeight() const;
inline int baselinePosition(bool isRootLineBox) const { return renderer()->baselinePosition(m_firstLine, isRootLineBox); }
inline int lineHeight(bool isRootLineBox) const { return renderer()->lineHeight(m_firstLine, isRootLineBox); }
@@ -266,7 +292,7 @@ public:
int m_x;
int m_y;
- int m_width;
+ int m_logicalWidth;
// Some of these bits are actually for subclasses and moved here to compact the structures.
@@ -279,7 +305,9 @@ private:
protected:
bool m_dirty : 1;
bool m_extracted : 1;
- bool m_hasVirtualHeight : 1;
+ bool m_hasVirtualLogicalHeight : 1;
+
+ bool m_isVertical : 1;
// for RootInlineBox
bool m_endsWithBreak : 1; // Whether the line ends with a <br>.
@@ -295,7 +323,7 @@ protected:
mutable bool m_determinedIfPrevOnLineExists : 1;
mutable bool m_nextOnLineExists : 1;
mutable bool m_prevOnLineExists : 1;
- int m_toAdd : 12; // for justified text
+ int m_toAdd : 11; // for justified text
#ifndef NDEBUG
private:
diff --git a/WebCore/rendering/InlineFlowBox.cpp b/WebCore/rendering/InlineFlowBox.cpp
index a71b796..588d054 100644
--- a/WebCore/rendering/InlineFlowBox.cpp
+++ b/WebCore/rendering/InlineFlowBox.cpp
@@ -53,12 +53,12 @@ InlineFlowBox::~InlineFlowBox()
#endif
-int InlineFlowBox::getFlowSpacingWidth()
+int InlineFlowBox::getFlowSpacingLogicalWidth()
{
- int totWidth = marginBorderPaddingLeft() + marginBorderPaddingRight();
+ int totWidth = marginBorderPaddingLogicalLeft() + marginBorderPaddingLogicalRight();
for (InlineBox* curr = firstChild(); curr; curr = curr->nextOnLine()) {
if (curr->isInlineFlowBox())
- totWidth += static_cast<InlineFlowBox*>(curr)->getFlowSpacingWidth();
+ totWidth += static_cast<InlineFlowBox*>(curr)->getFlowSpacingLogicalWidth();
}
return totWidth;
}
@@ -80,6 +80,7 @@ void InlineFlowBox::addToLine(InlineBox* child)
m_lastChild = child;
}
child->setFirstLineStyleBit(m_firstLine);
+ child->setIsVertical(m_isVertical);
if (child->isText())
m_hasTextChildren = true;
if (child->renderer()->selectionState() != RenderObject::SelectionNone)
@@ -252,7 +253,7 @@ void InlineFlowBox::determineSpacingForFlowBoxes(bool lastLine, RenderObject* en
}
}
-int InlineFlowBox::placeBoxesHorizontally(int xPos, bool& needsWordSpacing, GlyphOverflowAndFallbackFontsMap& textBoxDataMap)
+int InlineFlowBox::placeBoxesInInlineDirection(int xPos, bool& needsWordSpacing, GlyphOverflowAndFallbackFontsMap& textBoxDataMap)
{
// Set our x position.
setX(xPos);
@@ -269,7 +270,7 @@ int InlineFlowBox::placeBoxesHorizontally(int xPos, bool& needsWordSpacing, Glyp
leftVisualOverflow = min(xPos + boxShadowLeft, leftVisualOverflow);
int startX = xPos;
- xPos += borderLeft() + paddingLeft();
+ xPos += borderLogicalLeft() + paddingLogicalLeft();
for (InlineBox* curr = firstChild(); curr; curr = curr->nextOnLine()) {
if (curr->renderer()->isText()) {
@@ -287,7 +288,7 @@ int InlineFlowBox::placeBoxesHorizontally(int xPos, bool& needsWordSpacing, Glyp
// If letter-spacing is negative, we should factor that into right layout overflow. (Even in RTL, letter-spacing is
// applied to the right, so this is not an issue with left overflow.
int letterSpacing = min(0, (int)rt->style(m_firstLine)->font().letterSpacing());
- rightLayoutOverflow = max(xPos + text->width() - letterSpacing, rightLayoutOverflow);
+ rightLayoutOverflow = max(xPos + text->logicalWidth() - letterSpacing, rightLayoutOverflow);
GlyphOverflowAndFallbackFontsMap::iterator it = textBoxDataMap.find(static_cast<InlineTextBox*>(curr));
GlyphOverflow* glyphOverflow = it == textBoxDataMap.end() ? 0 : &it->second.second;
@@ -303,9 +304,9 @@ int InlineFlowBox::placeBoxesHorizontally(int xPos, bool& needsWordSpacing, Glyp
}
leftVisualOverflow = min(xPos + childOverflowLeft, leftVisualOverflow);
- rightVisualOverflow = max(xPos + text->width() + childOverflowRight, rightVisualOverflow);
+ rightVisualOverflow = max(xPos + text->logicalWidth() + childOverflowRight, rightVisualOverflow);
- xPos += text->width();
+ xPos += text->logicalWidth();
} else {
if (curr->renderer()->isPositioned()) {
if (curr->renderer()->parent()->style()->direction() == LTR)
@@ -319,9 +320,9 @@ int InlineFlowBox::placeBoxesHorizontally(int xPos, bool& needsWordSpacing, Glyp
}
if (curr->renderer()->isRenderInline()) {
InlineFlowBox* flow = static_cast<InlineFlowBox*>(curr);
- xPos += flow->marginLeft();
- xPos = flow->placeBoxesHorizontally(xPos, needsWordSpacing, textBoxDataMap);
- xPos += flow->marginRight();
+ xPos += flow->marginLogicalLeft();
+ xPos = flow->placeBoxesInInlineDirection(xPos, needsWordSpacing, textBoxDataMap);
+ xPos += flow->marginLogicalRight();
leftLayoutOverflow = min(leftLayoutOverflow, flow->leftLayoutOverflow());
rightLayoutOverflow = max(rightLayoutOverflow, flow->rightLayoutOverflow());
leftVisualOverflow = min(leftVisualOverflow, flow->leftVisualOverflow());
@@ -332,7 +333,7 @@ int InlineFlowBox::placeBoxesHorizontally(int xPos, bool& needsWordSpacing, Glyp
RenderBox* box = toRenderBox(curr->renderer());
int childLeftOverflow = box->hasOverflowClip() ? 0 : box->leftLayoutOverflow();
- int childRightOverflow = box->hasOverflowClip() ? curr->width() : box->rightLayoutOverflow();
+ int childRightOverflow = box->hasOverflowClip() ? curr->logicalWidth() : box->rightLayoutOverflow();
leftLayoutOverflow = min(xPos + childLeftOverflow, leftLayoutOverflow);
rightLayoutOverflow = max(xPos + childRightOverflow, rightLayoutOverflow);
@@ -340,17 +341,17 @@ int InlineFlowBox::placeBoxesHorizontally(int xPos, bool& needsWordSpacing, Glyp
leftVisualOverflow = min(xPos + box->leftVisualOverflow(), leftVisualOverflow);
rightVisualOverflow = max(xPos + box->rightVisualOverflow(), rightVisualOverflow);
- xPos += curr->width() + curr->boxModelObject()->marginRight();
+ xPos += curr->logicalWidth() + curr->boxModelObject()->marginRight();
}
}
}
- xPos += borderRight() + paddingRight();
- setWidth(xPos - startX);
- rightVisualOverflow = max(x() + width() + boxShadowRight, rightVisualOverflow);
- rightLayoutOverflow = max(x() + width(), rightLayoutOverflow);
+ xPos += borderLogicalRight() + paddingLogicalRight();
+ setLogicalWidth(xPos - startX);
+ rightVisualOverflow = max(x() + logicalWidth() + boxShadowRight, rightVisualOverflow);
+ rightLayoutOverflow = max(x() + logicalWidth(), rightLayoutOverflow);
- setHorizontalOverflowPositions(leftLayoutOverflow, rightLayoutOverflow, leftVisualOverflow, rightVisualOverflow);
+ setInlineDirectionOverflowPositions(leftLayoutOverflow, rightLayoutOverflow, leftVisualOverflow, rightVisualOverflow);
return xPos;
}
@@ -475,7 +476,7 @@ void InlineFlowBox::computeLogicalBoxHeights(int& maxPositionTop, int& maxPositi
}
}
-void InlineFlowBox::placeBoxesVertically(int yPos, int maxHeight, int maxAscent, bool strictMode, int& selectionTop, int& selectionBottom)
+void InlineFlowBox::placeBoxesInBlockDirection(int yPos, int maxHeight, int maxAscent, bool strictMode, int& selectionTop, int& selectionBottom)
{
if (isRootInlineBox())
setY(yPos + maxAscent - baselinePosition(true)); // Place our root box.
@@ -488,7 +489,7 @@ void InlineFlowBox::placeBoxesVertically(int yPos, int maxHeight, int maxAscent,
// line-height).
bool isInlineFlow = curr->isInlineFlowBox();
if (isInlineFlow)
- static_cast<InlineFlowBox*>(curr)->placeBoxesVertically(yPos, maxHeight, maxAscent, strictMode, selectionTop, selectionBottom);
+ static_cast<InlineFlowBox*>(curr)->placeBoxesInBlockDirection(yPos, maxHeight, maxAscent, strictMode, selectionTop, selectionBottom);
bool childAffectsTopBottomPos = true;
if (curr->y() == PositionTop)
@@ -516,7 +517,7 @@ void InlineFlowBox::placeBoxesVertically(int yPos, int maxHeight, int maxAscent,
curr->setY(newY);
if (childAffectsTopBottomPos) {
- int boxHeight = curr->height();
+ int boxHeight = curr->logicalHeight();
selectionTop = min(selectionTop, newY);
selectionBottom = max(selectionBottom, newY + boxHeight);
}
@@ -527,14 +528,14 @@ void InlineFlowBox::placeBoxesVertically(int yPos, int maxHeight, int maxAscent,
setY(y() + baselinePosition(true) - font.ascent());
if (hasTextChildren() || strictMode) {
selectionTop = min(selectionTop, y());
- selectionBottom = max(selectionBottom, y() + height());
+ selectionBottom = max(selectionBottom, y() + logicalHeight());
}
}
}
-void InlineFlowBox::computeVerticalOverflow(int lineTop, int lineBottom, bool strictMode, GlyphOverflowAndFallbackFontsMap& textBoxDataMap)
+void InlineFlowBox::computeBlockDirectionOverflow(int lineTop, int lineBottom, bool strictMode, GlyphOverflowAndFallbackFontsMap& textBoxDataMap)
{
- int boxHeight = height();
+ int boxHeight = logicalHeight();
// Any spillage outside of the line top and bottom is not considered overflow. We just ignore this, since it only happens
// from the "your ascent/descent don't affect the line" quirk.
@@ -583,10 +584,10 @@ void InlineFlowBox::computeVerticalOverflow(int lineTop, int lineBottom, bool st
}
topVisualOverflow = min(curr->y() + childOverflowTop, topVisualOverflow);
- bottomVisualOverflow = max(curr->y() + text->height() + childOverflowBottom, bottomVisualOverflow);
+ bottomVisualOverflow = max(curr->y() + text->logicalHeight() + childOverflowBottom, bottomVisualOverflow);
} else if (curr->renderer()->isRenderInline()) {
InlineFlowBox* flow = static_cast<InlineFlowBox*>(curr);
- flow->computeVerticalOverflow(lineTop, lineBottom, strictMode, textBoxDataMap);
+ flow->computeBlockDirectionOverflow(lineTop, lineBottom, strictMode, textBoxDataMap);
topLayoutOverflow = min(topLayoutOverflow, flow->topLayoutOverflow());
bottomLayoutOverflow = max(bottomLayoutOverflow, flow->bottomLayoutOverflow());
topVisualOverflow = min(topVisualOverflow, flow->topVisualOverflow());
@@ -596,7 +597,7 @@ void InlineFlowBox::computeVerticalOverflow(int lineTop, int lineBottom, bool st
RenderBox* box = toRenderBox(curr->renderer());
int boxY = curr->y();
int childTopOverflow = box->hasOverflowClip() ? 0 : box->topLayoutOverflow();
- int childBottomOverflow = box->hasOverflowClip() ? curr->height() : box->bottomLayoutOverflow();
+ int childBottomOverflow = box->hasOverflowClip() ? curr->logicalHeight() : box->bottomLayoutOverflow();
topLayoutOverflow = min(boxY + childTopOverflow, topLayoutOverflow);
bottomLayoutOverflow = max(boxY + childBottomOverflow, bottomLayoutOverflow);
topVisualOverflow = min(boxY + box->topVisualOverflow(), topVisualOverflow);
@@ -604,7 +605,7 @@ void InlineFlowBox::computeVerticalOverflow(int lineTop, int lineBottom, bool st
}
}
- setVerticalOverflowPositions(topLayoutOverflow, bottomLayoutOverflow, topVisualOverflow, bottomVisualOverflow, boxHeight);
+ setBlockDirectionOverflowPositions(topLayoutOverflow, bottomLayoutOverflow, topVisualOverflow, bottomVisualOverflow, boxHeight);
}
bool InlineFlowBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, int x, int y, int tx, int ty)
@@ -623,7 +624,7 @@ bool InlineFlowBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& re
}
// Now check ourselves.
- IntRect rect(tx + m_x, ty + m_y, m_width, height());
+ IntRect rect(tx + m_x, ty + m_y, m_logicalWidth, logicalHeight());
if (visibleToHitTesting() && rect.intersects(result.rectFromPoint(x, y))) {
renderer()->updateHitTestResult(result, IntPoint(x - tx, y - ty)); // Don't add in m_x or m_y here, we want coords in the containing block's space.
if (!result.addNodeToRectBasedTestResult(renderer()->node(), x, y, rect))
@@ -727,13 +728,13 @@ void InlineFlowBox::paintFillLayer(const PaintInfo& paintInfo, const Color& c, c
// but it isn't even clear how this should work at all.
int xOffsetOnLine = 0;
for (InlineFlowBox* curr = prevLineBox(); curr; curr = curr->prevLineBox())
- xOffsetOnLine += curr->width();
+ xOffsetOnLine += curr->logicalWidth();
int startX = tx - xOffsetOnLine;
int totalWidth = xOffsetOnLine;
for (InlineFlowBox* curr = this; curr; curr = curr->nextLineBox())
- totalWidth += curr->width();
+ totalWidth += curr->logicalWidth();
paintInfo.context->save();
- paintInfo.context->clip(IntRect(tx, ty, width(), height()));
+ paintInfo.context->clip(IntRect(tx, ty, logicalWidth(), logicalHeight()));
boxModelObject()->paintFillLayerExtended(paintInfo, c, fillLayer, startX, ty, totalWidth, h, this, op);
paintInfo.context->restore();
}
@@ -746,7 +747,7 @@ void InlineFlowBox::paintBoxShadow(GraphicsContext* context, RenderStyle* s, Sha
else {
// FIXME: We can do better here in the multi-line case. We want to push a clip so that the shadow doesn't
// protrude incorrectly at the edges, and we want to possibly include shadows cast from the previous/following lines
- boxModelObject()->paintBoxShadow(context, tx, ty, w, h, s, shadowStyle, includeLeftEdge(), includeRightEdge());
+ boxModelObject()->paintBoxShadow(context, tx, ty, w, h, s, shadowStyle, includeLogicalLeftEdge(), includeLogicalRightEdge());
}
}
@@ -757,8 +758,8 @@ void InlineFlowBox::paintBoxDecorations(PaintInfo& paintInfo, int tx, int ty)
int x = m_x;
int y = m_y;
- int w = width();
- int h = height();
+ int w = logicalWidth();
+ int h = logicalHeight();
// Constrain our background/border painting to the line top and bottom if necessary.
bool noQuirksMode = renderer()->document()->inNoQuirksMode();
@@ -800,7 +801,7 @@ void InlineFlowBox::paintBoxDecorations(PaintInfo& paintInfo, int tx, int ty)
// The simple case is where we either have no border image or we are the only box for this object. In those
// cases only a single call to draw is required.
if (!hasBorderImage || (!prevLineBox() && !nextLineBox()))
- boxModelObject()->paintBorder(context, tx, ty, w, h, renderer()->style(), includeLeftEdge(), includeRightEdge());
+ boxModelObject()->paintBorder(context, tx, ty, w, h, renderer()->style(), includeLogicalLeftEdge(), includeLogicalRightEdge());
else {
// We have a border image that spans multiple lines.
// We need to adjust _tx and _ty by the width of all previous lines.
@@ -812,11 +813,11 @@ void InlineFlowBox::paintBoxDecorations(PaintInfo& paintInfo, int tx, int ty)
// but it isn't even clear how this should work at all.
int xOffsetOnLine = 0;
for (InlineFlowBox* curr = prevLineBox(); curr; curr = curr->prevLineBox())
- xOffsetOnLine += curr->width();
+ xOffsetOnLine += curr->logicalWidth();
int startX = tx - xOffsetOnLine;
int totalWidth = xOffsetOnLine;
for (InlineFlowBox* curr = this; curr; curr = curr->nextLineBox())
- totalWidth += curr->width();
+ totalWidth += curr->logicalWidth();
context->save();
context->clip(IntRect(tx, ty, w, h));
boxModelObject()->paintBorder(context, startX, ty, totalWidth, h, renderer()->style());
@@ -833,8 +834,8 @@ void InlineFlowBox::paintMask(PaintInfo& paintInfo, int tx, int ty)
int x = m_x;
int y = m_y;
- int w = width();
- int h = height();
+ int w = logicalWidth();
+ int h = logicalHeight();
// Constrain our background/border painting to the line top and bottom if necessary.
bool noQuirksMode = renderer()->document()->inNoQuirksMode();
@@ -883,11 +884,11 @@ void InlineFlowBox::paintMask(PaintInfo& paintInfo, int tx, int ty)
// We need to adjust _tx and _ty by the width of all previous lines.
int xOffsetOnLine = 0;
for (InlineFlowBox* curr = prevLineBox(); curr; curr = curr->prevLineBox())
- xOffsetOnLine += curr->width();
+ xOffsetOnLine += curr->logicalWidth();
int startX = tx - xOffsetOnLine;
int totalWidth = xOffsetOnLine;
for (InlineFlowBox* curr = this; curr; curr = curr->nextLineBox())
- totalWidth += curr->width();
+ totalWidth += curr->logicalWidth();
paintInfo.context->save();
paintInfo.context->clip(IntRect(tx, ty, w, h));
boxModelObject()->paintNinePieceImage(paintInfo.context, startX, ty, totalWidth, h, renderer()->style(), maskNinePieceImage, compositeOp);
@@ -938,12 +939,12 @@ void InlineFlowBox::paintTextDecorations(PaintInfo& paintInfo, int tx, int ty, b
if (deco != TDNONE &&
((!paintedChildren && ((deco & UNDERLINE) || (deco & OVERLINE))) || (paintedChildren && (deco & LINE_THROUGH))) &&
shouldDrawTextDecoration(renderer())) {
- int x = m_x + borderLeft() + paddingLeft();
- int w = m_width - (borderLeft() + paddingLeft() + borderRight() + paddingRight());
+ int x = m_x + borderLogicalLeft() + paddingLogicalLeft();
+ int w = m_logicalWidth - (borderLogicalLeft() + paddingLogicalLeft() + borderLogicalRight() + paddingLogicalRight());
RootInlineBox* rootLine = root();
if (rootLine->ellipsisBox()) {
int ellipsisX = m_x + rootLine->ellipsisBox()->x();
- int ellipsisWidth = rootLine->ellipsisBox()->width();
+ int ellipsisWidth = rootLine->ellipsisBox()->logicalWidth();
bool ltr = renderer()->style()->direction() == LTR;
if (rootLine == this) {
// Trim w and x so that the underline isn't drawn underneath the ellipsis.
@@ -977,7 +978,7 @@ void InlineFlowBox::paintTextDecorations(PaintInfo& paintInfo, int tx, int ty, b
}
// We must have child boxes and have decorations defined.
- tx += borderLeft() + paddingLeft();
+ tx += borderLogicalLeft() + paddingLogicalLeft();
Color underline, overline, linethrough;
underline = overline = linethrough = styleToUse->visitedDependentColor(CSSPropertyColor);
@@ -995,7 +996,7 @@ void InlineFlowBox::paintTextDecorations(PaintInfo& paintInfo, int tx, int ty, b
int baselinePos = renderer()->style(m_firstLine)->font().ascent();
if (!isRootInlineBox())
- baselinePos += borderTop() + paddingTop();
+ baselinePos += boxModelObject()->borderTop() + boxModelObject()->paddingTop();
bool setClip = false;
int extraOffset = 0;
@@ -1104,11 +1105,11 @@ int InlineFlowBox::placeEllipsisBox(bool ltr, int blockLeftEdge, int blockRightE
result = currResult;
if (ltr) {
- visibleLeftEdge += box->width();
+ visibleLeftEdge += box->logicalWidth();
box = box->nextOnLine();
}
else {
- visibleRightEdge -= box->width();
+ visibleRightEdge -= box->logicalWidth();
box = box->prevOnLine();
}
}
diff --git a/WebCore/rendering/InlineFlowBox.h b/WebCore/rendering/InlineFlowBox.h
index b4ba59f..2d57cca 100644
--- a/WebCore/rendering/InlineFlowBox.h
+++ b/WebCore/rendering/InlineFlowBox.h
@@ -41,8 +41,8 @@ public:
, m_lastChild(0)
, m_prevLineBox(0)
, m_nextLineBox(0)
- , m_includeLeftEdge(false)
- , m_includeRightEdge(false)
+ , m_includeLogicalLeftEdge(false)
+ , m_includeLogicalRightEdge(false)
#ifndef NDEBUG
, m_hasBadChildList(false)
#endif
@@ -102,38 +102,65 @@ public:
virtual RenderLineBoxList* rendererLineBoxes() const;
- int marginBorderPaddingLeft() const { return marginLeft() + borderLeft() + paddingLeft(); }
- int marginBorderPaddingRight() const { return marginRight() + borderRight() + paddingRight(); }
- int marginLeft() const { if (includeLeftEdge()) return boxModelObject()->marginLeft(); return 0; }
- int marginRight() const { if (includeRightEdge()) return boxModelObject()->marginRight(); return 0; }
- int borderLeft() const { if (includeLeftEdge()) return renderer()->style()->borderLeftWidth(); return 0; }
- int borderRight() const { if (includeRightEdge()) return renderer()->style()->borderRightWidth(); return 0; }
- int borderTop() const { return renderer()->style()->borderTopWidth(); }
- int borderBottom() const { return renderer()->style()->borderBottomWidth(); }
- int paddingLeft() const { if (includeLeftEdge()) return boxModelObject()->paddingLeft(); return 0; }
- int paddingRight() const { if (includeRightEdge()) return boxModelObject()->paddingRight(); return 0; }
- int paddingTop() const { return boxModelObject()->paddingTop(); }
- int paddingBottom() const { return boxModelObject()->paddingBottom(); }
-
- bool includeLeftEdge() const { return m_includeLeftEdge; }
- bool includeRightEdge() const { return m_includeRightEdge; }
+ // logicalLeft = left in a horizontal line and top in a vertical line.
+ int marginBorderPaddingLogicalLeft() const { return marginLogicalLeft() + borderLogicalLeft() + paddingLogicalLeft(); }
+ int marginBorderPaddingLogicalRight() const { return marginLogicalRight() + borderLogicalRight() + paddingLogicalRight(); }
+ int marginLogicalLeft() const
+ {
+ if (!includeLogicalLeftEdge())
+ return 0;
+ return !isVertical() ? boxModelObject()->marginLeft() : boxModelObject()->marginTop();
+ }
+ int marginLogicalRight() const
+ {
+ if (!includeLogicalRightEdge())
+ return 0;
+ return !isVertical() ? boxModelObject()->marginRight() : boxModelObject()->marginBottom();
+ }
+ int borderLogicalLeft() const
+ {
+ if (!includeLogicalLeftEdge())
+ return 0;
+ return !isVertical() ? renderer()->style()->borderLeftWidth() : renderer()->style()->borderTopWidth();
+ }
+ int borderLogicalRight() const
+ {
+ if (!includeLogicalRightEdge())
+ return 0;
+ return !isVertical() ? renderer()->style()->borderRightWidth() : renderer()->style()->borderBottomWidth();
+ }
+ int paddingLogicalLeft() const
+ {
+ if (!includeLogicalLeftEdge())
+ return 0;
+ return !isVertical() ? boxModelObject()->paddingLeft() : boxModelObject()->paddingTop();
+ }
+ int paddingLogicalRight() const
+ {
+ if (!includeLogicalRightEdge())
+ return 0;
+ return !isVertical() ? boxModelObject()->paddingRight() : boxModelObject()->paddingBottom();
+ }
+
+ bool includeLogicalLeftEdge() const { return m_includeLogicalLeftEdge; }
+ bool includeLogicalRightEdge() const { return m_includeLogicalRightEdge; }
void setEdges(bool includeLeft, bool includeRight)
{
- m_includeLeftEdge = includeLeft;
- m_includeRightEdge = includeRight;
+ m_includeLogicalLeftEdge = includeLeft;
+ m_includeLogicalRightEdge = includeRight;
}
// Helper functions used during line construction and placement.
void determineSpacingForFlowBoxes(bool lastLine, RenderObject* endObject);
- int getFlowSpacingWidth();
+ int getFlowSpacingLogicalWidth();
bool onEndChain(RenderObject* endObject);
- int placeBoxesHorizontally(int x, bool& needsWordSpacing, GlyphOverflowAndFallbackFontsMap&);
+ int placeBoxesInInlineDirection(int x, bool& needsWordSpacing, GlyphOverflowAndFallbackFontsMap&);
void computeLogicalBoxHeights(int& maxPositionTop, int& maxPositionBottom,
int& maxAscent, int& maxDescent, bool strictMode, GlyphOverflowAndFallbackFontsMap&);
void adjustMaxAscentAndDescent(int& maxAscent, int& maxDescent,
int maxPositionTop, int maxPositionBottom);
- void placeBoxesVertically(int y, int maxHeight, int maxAscent, bool strictMode, int& lineTop, int& lineBottom);
- void computeVerticalOverflow(int lineTop, int lineBottom, bool strictMode, GlyphOverflowAndFallbackFontsMap&);
+ void placeBoxesInBlockDirection(int y, int maxHeight, int maxAscent, bool strictMode, int& lineTop, int& lineBottom);
+ void computeBlockDirectionOverflow(int lineTop, int lineBottom, bool strictMode, GlyphOverflowAndFallbackFontsMap&);
void removeChild(InlineBox* child);
@@ -151,22 +178,22 @@ public:
int bottomVisibleOverflow() const { return std::max(bottomLayoutOverflow(), bottomVisualOverflow()); }
int leftVisibleOverflow() const { return std::min(leftLayoutOverflow(), leftVisualOverflow()); }
int rightVisibleOverflow() const { return std::max(rightLayoutOverflow(), rightVisualOverflow()); }
- IntRect visibleOverflowRect() const { return m_overflow ? m_overflow->visibleOverflowRect() : IntRect(m_x, m_y, m_width, height()); }
+ IntRect visibleOverflowRect() const { return m_overflow ? m_overflow->visibleOverflowRect() : IntRect(m_x, m_y, m_logicalWidth, logicalHeight()); }
int topLayoutOverflow() const { return m_overflow ? m_overflow->topLayoutOverflow() : m_y; }
- int bottomLayoutOverflow() const { return m_overflow ? m_overflow->bottomLayoutOverflow() : m_y + height(); }
+ int bottomLayoutOverflow() const { return m_overflow ? m_overflow->bottomLayoutOverflow() : m_y + logicalHeight(); }
int leftLayoutOverflow() const { return m_overflow ? m_overflow->leftLayoutOverflow() : m_x; }
- int rightLayoutOverflow() const { return m_overflow ? m_overflow->rightLayoutOverflow() : m_x + m_width; }
- IntRect layoutOverflowRect() const { return m_overflow ? m_overflow->layoutOverflowRect() : IntRect(m_x, m_y, m_width, height()); }
+ int rightLayoutOverflow() const { return m_overflow ? m_overflow->rightLayoutOverflow() : m_x + m_logicalWidth; }
+ IntRect layoutOverflowRect() const { return m_overflow ? m_overflow->layoutOverflowRect() : IntRect(m_x, m_y, m_logicalWidth, logicalHeight()); }
int topVisualOverflow() const { return m_overflow ? m_overflow->topVisualOverflow() : m_y; }
- int bottomVisualOverflow() const { return m_overflow ? m_overflow->bottomVisualOverflow() : m_y + height(); }
+ int bottomVisualOverflow() const { return m_overflow ? m_overflow->bottomVisualOverflow() : m_y + logicalHeight(); }
int leftVisualOverflow() const { return m_overflow ? m_overflow->leftVisualOverflow() : m_x; }
- int rightVisualOverflow() const { return m_overflow ? m_overflow->rightVisualOverflow() : m_x + m_width; }
- IntRect visualOverflowRect() const { return m_overflow ? m_overflow->visualOverflowRect() : IntRect(m_x, m_y, m_width, height()); }
+ int rightVisualOverflow() const { return m_overflow ? m_overflow->rightVisualOverflow() : m_x + m_logicalWidth; }
+ IntRect visualOverflowRect() const { return m_overflow ? m_overflow->visualOverflowRect() : IntRect(m_x, m_y, m_logicalWidth, logicalHeight()); }
- void setHorizontalOverflowPositions(int leftLayoutOverflow, int rightLayoutOverflow, int leftVisualOverflow, int rightVisualOverflow);
- void setVerticalOverflowPositions(int topLayoutOverflow, int bottomLayoutOverflow, int topVisualOverflow, int bottomVisualOverflow, int boxHeight);
+ void setInlineDirectionOverflowPositions(int leftLayoutOverflow, int rightLayoutOverflow, int leftVisualOverflow, int rightVisualOverflow);
+ void setBlockDirectionOverflowPositions(int topLayoutOverflow, int bottomLayoutOverflow, int topVisualOverflow, int bottomVisualOverflow, int boxHeight);
protected:
OwnPtr<RenderOverflow> m_overflow;
@@ -179,8 +206,8 @@ protected:
InlineFlowBox* m_prevLineBox; // The previous box that also uses our RenderObject
InlineFlowBox* m_nextLineBox; // The next box that also uses our RenderObject
- bool m_includeLeftEdge : 1;
- bool m_includeRightEdge : 1;
+ bool m_includeLogicalLeftEdge : 1;
+ bool m_includeLogicalRightEdge : 1;
bool m_hasTextChildren : 1;
#ifndef NDEBUG
@@ -188,12 +215,12 @@ protected:
#endif
};
-inline void InlineFlowBox::setHorizontalOverflowPositions(int leftLayoutOverflow, int rightLayoutOverflow, int leftVisualOverflow, int rightVisualOverflow)
+inline void InlineFlowBox::setInlineDirectionOverflowPositions(int leftLayoutOverflow, int rightLayoutOverflow, int leftVisualOverflow, int rightVisualOverflow)
{
if (!m_overflow) {
- if (leftLayoutOverflow == m_x && rightLayoutOverflow == m_x + m_width && leftVisualOverflow == m_x && rightVisualOverflow == m_x + m_width)
+ if (leftLayoutOverflow == m_x && rightLayoutOverflow == m_x + m_logicalWidth && leftVisualOverflow == m_x && rightVisualOverflow == m_x + m_logicalWidth)
return;
- m_overflow = adoptPtr(new RenderOverflow(IntRect(m_x, m_y, m_width, m_renderer->style(m_firstLine)->font().height())));
+ m_overflow = adoptPtr(new RenderOverflow(IntRect(m_x, m_y, m_logicalWidth, m_renderer->style(m_firstLine)->font().height())));
}
m_overflow->setLeftLayoutOverflow(leftLayoutOverflow);
@@ -202,12 +229,12 @@ inline void InlineFlowBox::setHorizontalOverflowPositions(int leftLayoutOverflow
m_overflow->setRightVisualOverflow(rightVisualOverflow);
}
-inline void InlineFlowBox::setVerticalOverflowPositions(int topLayoutOverflow, int bottomLayoutOverflow, int topVisualOverflow, int bottomVisualOverflow, int boxHeight)
+inline void InlineFlowBox::setBlockDirectionOverflowPositions(int topLayoutOverflow, int bottomLayoutOverflow, int topVisualOverflow, int bottomVisualOverflow, int boxHeight)
{
if (!m_overflow) {
if (topLayoutOverflow == m_y && bottomLayoutOverflow == m_y + boxHeight && topVisualOverflow == m_y && bottomVisualOverflow == m_y + boxHeight)
return;
- m_overflow = adoptPtr(new RenderOverflow(IntRect(m_x, m_y, m_width, boxHeight)));
+ m_overflow = adoptPtr(new RenderOverflow(IntRect(m_x, m_y, m_logicalWidth, boxHeight)));
}
m_overflow->setTopLayoutOverflow(topLayoutOverflow);
diff --git a/WebCore/rendering/InlineTextBox.cpp b/WebCore/rendering/InlineTextBox.cpp
index eb5947c..68bff3c 100644
--- a/WebCore/rendering/InlineTextBox.cpp
+++ b/WebCore/rendering/InlineTextBox.cpp
@@ -139,10 +139,10 @@ IntRect InlineTextBox::selectionRect(int tx, int ty, int startPos, int endPos)
IntRect r = enclosingIntRect(f.selectionRectForText(TextRun(characters, len, textObj->allowTabs(), textPos(), m_toAdd, direction() == RTL, m_dirOverride),
IntPoint(tx + m_x, ty + selTop), selHeight, sPos, ePos));
- if (r.x() > tx + m_x + m_width)
+ if (r.x() > tx + m_x + m_logicalWidth)
r.setWidth(0);
- else if (r.right() - 1 > tx + m_x + m_width)
- r.setWidth(tx + m_x + m_width - r.x());
+ else if (r.right() - 1 > tx + m_x + m_logicalWidth)
+ r.setWidth(tx + m_x + m_logicalWidth - r.x());
return r;
}
@@ -182,7 +182,7 @@ int InlineTextBox::placeEllipsisBox(bool flowIsLTR, int visibleLeftEdge, int vis
// LTR: the left edge of the ellipsis is to the left of our text run.
// RTL: the right edge of the ellipsis is to the right of our text run.
bool ltrFullTruncation = flowIsLTR && ellipsisX <= m_x;
- bool rtlFullTruncation = !flowIsLTR && ellipsisX >= (m_x + m_width);
+ bool rtlFullTruncation = !flowIsLTR && ellipsisX >= (m_x + m_logicalWidth);
if (ltrFullTruncation || rtlFullTruncation) {
// Too far. Just set full truncation, but return -1 and let the ellipsis just be placed at the edge of the box.
m_truncation = cFullTruncation;
@@ -190,7 +190,7 @@ int InlineTextBox::placeEllipsisBox(bool flowIsLTR, int visibleLeftEdge, int vis
return -1;
}
- bool ltrEllipsisWithinBox = flowIsLTR && (ellipsisX < m_x + m_width);
+ bool ltrEllipsisWithinBox = flowIsLTR && (ellipsisX < m_x + m_logicalWidth);
bool rtlEllipsisWithinBox = !flowIsLTR && (ellipsisX > m_x);
if (ltrEllipsisWithinBox || rtlEllipsisWithinBox) {
foundBox = true;
@@ -202,7 +202,7 @@ int InlineTextBox::placeEllipsisBox(bool flowIsLTR, int visibleLeftEdge, int vis
if (ltr != flowIsLTR) {
// Width in pixels of the visible portion of the box, excluding the ellipsis.
int visibleBoxWidth = visibleRightEdge - visibleLeftEdge - ellipsisWidth;
- ellipsisX = ltr ? m_x + visibleBoxWidth : m_x + m_width - visibleBoxWidth;
+ ellipsisX = ltr ? m_x + visibleBoxWidth : m_x + m_logicalWidth - visibleBoxWidth;
}
int offset = offsetForPosition(ellipsisX, false);
@@ -228,7 +228,7 @@ int InlineTextBox::placeEllipsisBox(bool flowIsLTR, int visibleLeftEdge, int vis
if (flowIsLTR)
return m_x + widthOfVisibleText;
else
- return (m_x + m_width) - widthOfVisibleText - ellipsisWidth;
+ return (m_x + m_logicalWidth) - widthOfVisibleText - ellipsisWidth;
}
return -1;
}
@@ -286,7 +286,7 @@ bool InlineTextBox::nodeAtPoint(const HitTestRequest&, HitTestResult& result, in
if (isLineBreak())
return false;
- IntRect rect(tx + m_x, ty + m_y, m_width, height());
+ IntRect rect(tx + m_x, ty + m_y, m_logicalWidth, logicalHeight());
if (m_truncation != cFullTruncation && visibleToHitTesting() && rect.intersects(result.rectFromPoint(x, y))) {
renderer()->updateHitTestResult(result, IntPoint(x - tx, y - ty));
if (!result.addNodeToRectBasedTestResult(renderer()->node(), x, y, rect))
@@ -367,9 +367,9 @@ void InlineTextBox::paint(PaintInfo& paintInfo, int tx, int ty)
// FIXME: Technically we're potentially incorporating other visual overflow that had nothing to do with us.
// Would it be simpler to just check our own shadow and stroke overflow by hand here?
int leftOverflow = parent()->x() - parent()->leftVisualOverflow();
- int rightOverflow = parent()->rightVisualOverflow() - (parent()->x() + parent()->width());
+ int rightOverflow = parent()->rightVisualOverflow() - (parent()->x() + parent()->logicalWidth());
int xPos = tx + m_x - leftOverflow;
- int w = width() + leftOverflow + rightOverflow;
+ int w = logicalWidth() + leftOverflow + rightOverflow;
if (xPos >= paintInfo.rect.right() || xPos + w <= paintInfo.rect.x())
return;
@@ -393,7 +393,7 @@ void InlineTextBox::paint(PaintInfo& paintInfo, int tx, int ty)
// NOTE: WebKit's behavior differs from that of IE which appears to just overlay the ellipsis on top of the
// truncated string i.e. |Hello|CBA| -> |...lo|CBA|
int widthOfVisibleText = toRenderText(renderer())->width(m_start, m_truncation, textPos(), m_firstLine);
- int widthOfHiddenText = m_width - widthOfVisibleText;
+ int widthOfHiddenText = m_logicalWidth - widthOfVisibleText;
// FIXME: The hit testing logic also needs to take this translation int account.
tx += direction() == LTR ? widthOfHiddenText : -widthOfHiddenText;
}
@@ -526,9 +526,9 @@ void InlineTextBox::paint(PaintInfo& paintInfo, int tx, int ty)
updateGraphicsContext(context, textFillColor, textStrokeColor, textStrokeWidth, styleToUse->colorSpace());
if (!paintSelectedTextSeparately || ePos <= sPos) {
// FIXME: Truncate right-to-left text correctly.
- paintTextWithShadows(context, font, textRun, 0, length, length, textOrigin, m_x + tx, m_y + ty, width(), height(), textShadow, textStrokeWidth > 0);
+ paintTextWithShadows(context, font, textRun, 0, length, length, textOrigin, m_x + tx, m_y + ty, logicalWidth(), logicalHeight(), textShadow, textStrokeWidth > 0);
} else
- paintTextWithShadows(context, font, textRun, ePos, sPos, length, textOrigin, m_x + tx, m_y + ty, width(), height(), textShadow, textStrokeWidth > 0);
+ paintTextWithShadows(context, font, textRun, ePos, sPos, length, textOrigin, m_x + tx, m_y + ty, logicalWidth(), logicalHeight(), textShadow, textStrokeWidth > 0);
if (textStrokeWidth > 0)
context->restore();
@@ -540,7 +540,7 @@ void InlineTextBox::paint(PaintInfo& paintInfo, int tx, int ty)
context->save();
updateGraphicsContext(context, selectionFillColor, selectionStrokeColor, selectionStrokeWidth, styleToUse->colorSpace());
- paintTextWithShadows(context, font, textRun, sPos, ePos, length, textOrigin, m_x + tx, m_y + ty, width(), height(), selectionShadow, selectionStrokeWidth > 0);
+ paintTextWithShadows(context, font, textRun, sPos, ePos, length, textOrigin, m_x + tx, m_y + ty, logicalWidth(), logicalHeight(), selectionShadow, selectionStrokeWidth > 0);
if (selectionStrokeWidth > 0)
context->restore();
@@ -633,7 +633,7 @@ void InlineTextBox::paintSelection(GraphicsContext* context, int tx, int ty, Ren
ePos = length;
}
- context->clip(IntRect(m_x + tx, y + ty, m_width, h));
+ context->clip(IntRect(m_x + tx, y + ty, m_logicalWidth, h));
context->drawHighlightForText(font, TextRun(characters, length, textRenderer()->allowTabs(), textPos(), m_toAdd,
direction() == RTL, m_dirOverride || style->visuallyOrdered()),
IntPoint(m_x + tx, y + ty), h, c, style->colorSpace(), sPos, ePos);
@@ -675,8 +675,8 @@ void InlineTextBox::paintCustomHighlight(int tx, int ty, const AtomicString& typ
return;
RootInlineBox* r = root();
- FloatRect rootRect(tx + r->x(), ty + selectionTop(), r->width(), selectionHeight());
- FloatRect textRect(tx + x(), rootRect.y(), width(), rootRect.height());
+ FloatRect rootRect(tx + r->x(), ty + selectionTop(), r->logicalWidth(), selectionHeight());
+ FloatRect textRect(tx + x(), rootRect.y(), logicalWidth(), rootRect.height());
page->chrome()->client()->paintCustomHighlight(renderer()->node(), type, textRect, rootRect, true, false);
}
@@ -691,11 +691,11 @@ void InlineTextBox::paintDecoration(GraphicsContext* context, int tx, int ty, in
if (m_truncation == cFullTruncation)
return;
- int width = m_width;
+ int width = m_logicalWidth;
if (m_truncation != cNoTruncation) {
width = toRenderText(renderer())->width(m_start, m_truncation, textPos(), m_firstLine);
if (direction() == RTL)
- tx += (m_width - width);
+ tx += (m_logicalWidth - width);
}
// Get the text decoration colors.
@@ -775,7 +775,7 @@ static GraphicsContext::TextCheckingLineStyle textCheckingLineStyleForMarkerType
return GraphicsContext::TextCheckingSpellingLineStyle;
case DocumentMarker::Grammar:
return GraphicsContext::TextCheckingGrammarLineStyle;
- case DocumentMarker::Replacement:
+ case DocumentMarker::CorrectionIndicator:
return GraphicsContext::TextCheckingReplacementLineStyle;
default:
ASSERT_NOT_REACHED();
@@ -793,7 +793,7 @@ void InlineTextBox::paintSpellingOrGrammarMarker(GraphicsContext* pt, int tx, in
return;
int start = 0; // start of line to draw, relative to tx
- int width = m_width; // how much line to draw
+ int width = m_logicalWidth; // how much line to draw
// Determine whether we need to measure text
bool markerSpansWholeBox = true;
@@ -837,11 +837,11 @@ void InlineTextBox::paintSpellingOrGrammarMarker(GraphicsContext* pt, int tx, in
// we pin to two pixels under the baseline.
int lineThickness = cMisspellingLineThickness;
int baseline = renderer()->style(m_firstLine)->font().ascent();
- int descent = height() - baseline;
+ int descent = logicalHeight() - baseline;
int underlineOffset;
if (descent <= (2 + lineThickness)) {
// Place the underline at the very bottom of the text in small/medium fonts.
- underlineOffset = height() - lineThickness;
+ underlineOffset = logicalHeight() - lineThickness;
} else {
// In larger fonts, though, place the underline up near the baseline to prevent a big gap.
underlineOffset = baseline + 2;
@@ -872,7 +872,7 @@ void InlineTextBox::paintTextMatchMarker(GraphicsContext* pt, int tx, int ty, co
renderer()->theme()->platformInactiveTextSearchHighlightColor();
pt->save();
updateGraphicsContext(pt, color, color, 0, style->colorSpace()); // Don't draw text at all!
- pt->clip(IntRect(tx + m_x, ty + y, m_width, h));
+ pt->clip(IntRect(tx + m_x, ty + y, m_logicalWidth, h));
pt->drawHighlightForText(font, run, IntPoint(m_x + tx, y + ty), h, color, style->colorSpace(), sPos, ePos);
pt->restore();
}
@@ -913,6 +913,7 @@ void InlineTextBox::paintDocumentMarkers(GraphicsContext* pt, int tx, int ty, Re
case DocumentMarker::Grammar:
case DocumentMarker::Spelling:
case DocumentMarker::Replacement:
+ case DocumentMarker::CorrectionIndicator:
case DocumentMarker::RejectedCorrection:
if (background)
continue;
@@ -946,10 +947,11 @@ void InlineTextBox::paintDocumentMarkers(GraphicsContext* pt, int tx, int ty, Re
case DocumentMarker::TextMatch:
paintTextMatchMarker(pt, tx, ty, marker, style, font);
break;
- case DocumentMarker::Replacement:
+ case DocumentMarker::CorrectionIndicator:
computeRectForReplacementMarker(tx, ty, marker, style, font);
paintSpellingOrGrammarMarker(pt, tx, ty, marker, style, font, false);
break;
+ case DocumentMarker::Replacement:
case DocumentMarker::RejectedCorrection:
break;
default:
@@ -969,7 +971,7 @@ void InlineTextBox::paintCompositionUnderline(GraphicsContext* ctx, int tx, int
return;
int start = 0; // start of line to draw, relative to tx
- int width = m_width; // how much line to draw
+ int width = m_logicalWidth; // how much line to draw
bool useWholeWidth = true;
unsigned paintStart = m_start;
unsigned paintEnd = end() + 1; // end points at the last char, not past it
@@ -995,7 +997,7 @@ void InlineTextBox::paintCompositionUnderline(GraphicsContext* ctx, int tx, int
// If there's not enough space the underline will touch or overlap characters.
int lineThickness = 1;
int baseline = renderer()->style(m_firstLine)->font().ascent();
- if (underline.thick && height() - baseline >= 2)
+ if (underline.thick && logicalHeight() - baseline >= 2)
lineThickness = 2;
// We need to have some space between underlines of subsequent clauses, because some input methods do not use different underline styles for those.
@@ -1005,7 +1007,7 @@ void InlineTextBox::paintCompositionUnderline(GraphicsContext* ctx, int tx, int
ctx->setStrokeColor(underline.color, renderer()->style()->colorSpace());
ctx->setStrokeThickness(lineThickness);
- ctx->drawLineForText(IntPoint(tx + start, ty + height() - lineThickness), width, textRenderer()->document()->printing());
+ ctx->drawLineForText(IntPoint(tx + start, ty + logicalHeight() - lineThickness), width, textRenderer()->document()->printing());
}
int InlineTextBox::caretMinOffset() const
diff --git a/WebCore/rendering/InlineTextBox.h b/WebCore/rendering/InlineTextBox.h
index 7d828f3..2bf099b 100644
--- a/WebCore/rendering/InlineTextBox.h
+++ b/WebCore/rendering/InlineTextBox.h
@@ -74,7 +74,7 @@ private:
virtual int selectionHeight();
public:
- virtual IntRect calculateBoundaries() const { return IntRect(x(), y(), width(), height()); }
+ virtual IntRect calculateBoundaries() const { return IntRect(x(), y(), logicalWidth(), logicalHeight()); }
virtual IntRect selectionRect(int absx, int absy, int startPos, int endPos);
bool isSelected(int startPos, int endPos) const;
@@ -102,7 +102,7 @@ private:
public:
virtual bool isLineBreak() const;
- void setSpaceAdd(int add) { m_width -= m_toAdd; m_toAdd = add; m_width += m_toAdd; }
+ void setSpaceAdd(int add) { m_logicalWidth -= m_toAdd; m_toAdd = add; m_logicalWidth += m_toAdd; }
private:
virtual bool isInlineTextBox() const { return true; }
diff --git a/WebCore/rendering/MediaControlElements.cpp b/WebCore/rendering/MediaControlElements.cpp
index 5533326..adaac03 100644
--- a/WebCore/rendering/MediaControlElements.cpp
+++ b/WebCore/rendering/MediaControlElements.cpp
@@ -345,12 +345,11 @@ bool MediaControlStatusDisplayElement::rendererIsNeeded(RenderStyle* style)
// ----------------------------
-MediaControlInputElement::MediaControlInputElement(HTMLMediaElement* mediaElement, PseudoId pseudo, const String& type)
+MediaControlInputElement::MediaControlInputElement(HTMLMediaElement* mediaElement, PseudoId pseudo)
: HTMLInputElement(inputTag, mediaElement->document())
, m_mediaElement(mediaElement)
, m_pseudoStyleId(pseudo)
{
- setType(type);
setInDocument();
switch (pseudo) {
@@ -484,13 +483,15 @@ void MediaControlInputElement::setDisplayType(MediaControlElementType displayTyp
// ----------------------------
inline MediaControlMuteButtonElement::MediaControlMuteButtonElement(HTMLMediaElement* mediaElement, ButtonLocation location)
- : MediaControlInputElement(mediaElement, location == Controller ? MEDIA_CONTROLS_MUTE_BUTTON : MEDIA_CONTROLS_VOLUME_SLIDER_MUTE_BUTTON, "button")
+ : MediaControlInputElement(mediaElement, location == Controller ? MEDIA_CONTROLS_MUTE_BUTTON : MEDIA_CONTROLS_VOLUME_SLIDER_MUTE_BUTTON)
{
}
PassRefPtr<MediaControlMuteButtonElement> MediaControlMuteButtonElement::create(HTMLMediaElement* mediaElement, ButtonLocation location)
{
- return adoptRef(new MediaControlMuteButtonElement(mediaElement, location));
+ RefPtr<MediaControlMuteButtonElement> button = adoptRef(new MediaControlMuteButtonElement(mediaElement, location));
+ button->setType("button");
+ return button.release();
}
void MediaControlMuteButtonElement::defaultEventHandler(Event* event)
@@ -510,13 +511,15 @@ void MediaControlMuteButtonElement::updateDisplayType()
// ----------------------------
inline MediaControlPlayButtonElement::MediaControlPlayButtonElement(HTMLMediaElement* mediaElement)
- : MediaControlInputElement(mediaElement, MEDIA_CONTROLS_PLAY_BUTTON, "button")
+ : MediaControlInputElement(mediaElement, MEDIA_CONTROLS_PLAY_BUTTON)
{
}
PassRefPtr<MediaControlPlayButtonElement> MediaControlPlayButtonElement::create(HTMLMediaElement* mediaElement)
{
- return adoptRef(new MediaControlPlayButtonElement(mediaElement));
+ RefPtr<MediaControlPlayButtonElement> button = adoptRef(new MediaControlPlayButtonElement(mediaElement));
+ button->setType("button");
+ return button.release();
}
void MediaControlPlayButtonElement::defaultEventHandler(Event* event)
@@ -536,7 +539,7 @@ void MediaControlPlayButtonElement::updateDisplayType()
// ----------------------------
inline MediaControlSeekButtonElement::MediaControlSeekButtonElement(HTMLMediaElement* mediaElement, PseudoId pseudoId)
- : MediaControlInputElement(mediaElement, pseudoId, "button")
+ : MediaControlInputElement(mediaElement, pseudoId)
, m_seeking(false)
, m_capturing(false)
, m_seekTimer(this, &MediaControlSeekButtonElement::seekTimerFired)
@@ -545,7 +548,9 @@ inline MediaControlSeekButtonElement::MediaControlSeekButtonElement(HTMLMediaEle
PassRefPtr<MediaControlSeekButtonElement> MediaControlSeekButtonElement::create(HTMLMediaElement* mediaElement, PseudoId pseudoStyleId)
{
- return adoptRef(new MediaControlSeekButtonElement(mediaElement, pseudoStyleId));
+ RefPtr<MediaControlSeekButtonElement> button = adoptRef(new MediaControlSeekButtonElement(mediaElement, pseudoStyleId));
+ button->setType("button");
+ return button.release();
}
inline bool MediaControlSeekButtonElement::isForwardButton() const
@@ -603,13 +608,15 @@ void MediaControlSeekButtonElement::detach()
// ----------------------------
inline MediaControlRewindButtonElement::MediaControlRewindButtonElement(HTMLMediaElement* element)
- : MediaControlInputElement(element, MEDIA_CONTROLS_REWIND_BUTTON, "button")
+ : MediaControlInputElement(element, MEDIA_CONTROLS_REWIND_BUTTON)
{
}
PassRefPtr<MediaControlRewindButtonElement> MediaControlRewindButtonElement::create(HTMLMediaElement* mediaElement)
{
- return adoptRef(new MediaControlRewindButtonElement(mediaElement));
+ RefPtr<MediaControlRewindButtonElement> button = adoptRef(new MediaControlRewindButtonElement(mediaElement));
+ button->setType("button");
+ return button.release();
}
void MediaControlRewindButtonElement::defaultEventHandler(Event* event)
@@ -621,17 +628,18 @@ void MediaControlRewindButtonElement::defaultEventHandler(Event* event)
HTMLInputElement::defaultEventHandler(event);
}
-
// ----------------------------
inline MediaControlReturnToRealtimeButtonElement::MediaControlReturnToRealtimeButtonElement(HTMLMediaElement* mediaElement)
- : MediaControlInputElement(mediaElement, MEDIA_CONTROLS_RETURN_TO_REALTIME_BUTTON, "button")
+ : MediaControlInputElement(mediaElement, MEDIA_CONTROLS_RETURN_TO_REALTIME_BUTTON)
{
}
PassRefPtr<MediaControlReturnToRealtimeButtonElement> MediaControlReturnToRealtimeButtonElement::create(HTMLMediaElement* mediaElement)
{
- return adoptRef(new MediaControlReturnToRealtimeButtonElement(mediaElement));
+ RefPtr<MediaControlReturnToRealtimeButtonElement> button = adoptRef(new MediaControlReturnToRealtimeButtonElement(mediaElement));
+ button->setType("button");
+ return button.release();
}
void MediaControlReturnToRealtimeButtonElement::defaultEventHandler(Event* event)
@@ -647,13 +655,15 @@ void MediaControlReturnToRealtimeButtonElement::defaultEventHandler(Event* event
// ----------------------------
inline MediaControlToggleClosedCaptionsButtonElement::MediaControlToggleClosedCaptionsButtonElement(HTMLMediaElement* mediaElement)
- : MediaControlInputElement(mediaElement, MEDIA_CONTROLS_TOGGLE_CLOSED_CAPTIONS_BUTTON, "button")
+ : MediaControlInputElement(mediaElement, MEDIA_CONTROLS_TOGGLE_CLOSED_CAPTIONS_BUTTON)
{
}
PassRefPtr<MediaControlToggleClosedCaptionsButtonElement> MediaControlToggleClosedCaptionsButtonElement::create(HTMLMediaElement* mediaElement)
{
- return adoptRef(new MediaControlToggleClosedCaptionsButtonElement(mediaElement));
+ RefPtr<MediaControlToggleClosedCaptionsButtonElement> button = adoptRef(new MediaControlToggleClosedCaptionsButtonElement(mediaElement));
+ button->setType("button");
+ return button.release();
}
void MediaControlToggleClosedCaptionsButtonElement::defaultEventHandler(Event* event)
@@ -674,13 +684,15 @@ void MediaControlToggleClosedCaptionsButtonElement::updateDisplayType()
// ----------------------------
MediaControlTimelineElement::MediaControlTimelineElement(HTMLMediaElement* mediaElement)
- : MediaControlInputElement(mediaElement, MEDIA_CONTROLS_TIMELINE, "range")
+ : MediaControlInputElement(mediaElement, MEDIA_CONTROLS_TIMELINE)
{
}
PassRefPtr<MediaControlTimelineElement> MediaControlTimelineElement::create(HTMLMediaElement* mediaElement)
{
- return adoptRef(new MediaControlTimelineElement(mediaElement));
+ RefPtr<MediaControlTimelineElement> timeline = adoptRef(new MediaControlTimelineElement(mediaElement));
+ timeline->setType("range");
+ return timeline.release();
}
void MediaControlTimelineElement::defaultEventHandler(Event* event)
@@ -727,13 +739,15 @@ void MediaControlTimelineElement::update(bool updateDuration)
// ----------------------------
inline MediaControlVolumeSliderElement::MediaControlVolumeSliderElement(HTMLMediaElement* mediaElement)
- : MediaControlInputElement(mediaElement, MEDIA_CONTROLS_VOLUME_SLIDER, "range")
+ : MediaControlInputElement(mediaElement, MEDIA_CONTROLS_VOLUME_SLIDER)
{
}
PassRefPtr<MediaControlVolumeSliderElement> MediaControlVolumeSliderElement::create(HTMLMediaElement* mediaElement)
{
- return adoptRef(new MediaControlVolumeSliderElement(mediaElement));
+ RefPtr<MediaControlVolumeSliderElement> slider = adoptRef(new MediaControlVolumeSliderElement(mediaElement));
+ slider->setType("range");
+ return slider.release();
}
void MediaControlVolumeSliderElement::defaultEventHandler(Event* event)
@@ -769,13 +783,15 @@ void MediaControlVolumeSliderElement::update()
// ----------------------------
inline MediaControlFullscreenButtonElement::MediaControlFullscreenButtonElement(HTMLMediaElement* mediaElement)
- : MediaControlInputElement(mediaElement, MEDIA_CONTROLS_FULLSCREEN_BUTTON, "button")
+ : MediaControlInputElement(mediaElement, MEDIA_CONTROLS_FULLSCREEN_BUTTON)
{
}
PassRefPtr<MediaControlFullscreenButtonElement> MediaControlFullscreenButtonElement::create(HTMLMediaElement* mediaElement)
{
- return adoptRef(new MediaControlFullscreenButtonElement(mediaElement));
+ RefPtr<MediaControlFullscreenButtonElement> button = adoptRef(new MediaControlFullscreenButtonElement(mediaElement));
+ button->setType("button");
+ return button.release();
}
void MediaControlFullscreenButtonElement::defaultEventHandler(Event* event)
diff --git a/WebCore/rendering/MediaControlElements.h b/WebCore/rendering/MediaControlElements.h
index 1dcf6be..a9ffb0b 100644
--- a/WebCore/rendering/MediaControlElements.h
+++ b/WebCore/rendering/MediaControlElements.h
@@ -178,7 +178,7 @@ public:
HTMLMediaElement* mediaElement() const { return m_mediaElement; }
protected:
- MediaControlInputElement(HTMLMediaElement*, PseudoId, const String& type);
+ MediaControlInputElement(HTMLMediaElement*, PseudoId);
void setDisplayType(MediaControlElementType);
diff --git a/WebCore/rendering/RenderApplet.cpp b/WebCore/rendering/RenderApplet.cpp
index 12eb4fb..63a18a0 100644
--- a/WebCore/rendering/RenderApplet.cpp
+++ b/WebCore/rendering/RenderApplet.cpp
@@ -79,8 +79,8 @@ void RenderApplet::layout()
{
ASSERT(needsLayout());
- calcWidth();
- calcHeight();
+ computeLogicalWidth();
+ computeLogicalHeight();
// The applet's widget gets created lazily upon first layout.
createWidgetIfNecessary();
diff --git a/WebCore/rendering/RenderBlock.cpp b/WebCore/rendering/RenderBlock.cpp
index 0e44b32..1e378d8 100644
--- a/WebCore/rendering/RenderBlock.cpp
+++ b/WebCore/rendering/RenderBlock.cpp
@@ -82,33 +82,34 @@ static int gDelayUpdateScrollInfo = 0;
static DelayedUpdateScrollInfoSet* gDelayedUpdateScrollInfoSet = 0;
// Our MarginInfo state used when laying out block children.
-RenderBlock::MarginInfo::MarginInfo(RenderBlock* block, int top, int bottom)
+RenderBlock::MarginInfo::MarginInfo(RenderBlock* block, int beforeBorderPadding, int afterBorderPadding)
+ : m_atBeforeSideOfBlock(true)
+ , m_atAfterSideOfBlock(false)
+ , m_marginBeforeQuirk(false)
+ , m_marginAfterQuirk(false)
+ , m_determinedMarginBeforeQuirk(false)
{
// Whether or not we can collapse our own margins with our children. We don't do this
// if we had any border/padding (obviously), if we're the root or HTML elements, or if
// we're positioned, floating, a table cell.
- m_canCollapseWithChildren = !block->isRenderView() && !block->isRoot() && !block->isPositioned() &&
- !block->isFloating() && !block->isTableCell() && !block->hasOverflowClip() && !block->isInlineBlockOrInlineTable();
+ m_canCollapseWithChildren = !block->isRenderView() && !block->isRoot() && !block->isPositioned()
+ && !block->isFloating() && !block->isTableCell() && !block->hasOverflowClip() && !block->isInlineBlockOrInlineTable()
+ && !block->isBlockFlowRoot();
- m_canCollapseTopWithChildren = m_canCollapseWithChildren && (top == 0) && block->style()->marginTopCollapse() != MSEPARATE;
+ m_canCollapseMarginBeforeWithChildren = m_canCollapseWithChildren && (beforeBorderPadding == 0) && block->style()->marginBeforeCollapse() != MSEPARATE;
// If any height other than auto is specified in CSS, then we don't collapse our bottom
// margins with our children's margins. To do otherwise would be to risk odd visual
// effects when the children overflow out of the parent block and yet still collapse
// with it. We also don't collapse if we have any bottom border/padding.
- m_canCollapseBottomWithChildren = m_canCollapseWithChildren && (bottom == 0) &&
- (block->style()->height().isAuto() && block->style()->height().value() == 0) && block->style()->marginBottomCollapse() != MSEPARATE;
+ m_canCollapseMarginAfterWithChildren = m_canCollapseWithChildren && (afterBorderPadding == 0) &&
+ (block->style()->logicalHeight().isAuto() && block->style()->logicalHeight().value() == 0) && block->style()->marginAfterCollapse() != MSEPARATE;
- m_quirkContainer = block->isTableCell() || block->isBody() || block->style()->marginTopCollapse() == MDISCARD ||
- block->style()->marginBottomCollapse() == MDISCARD;
+ m_quirkContainer = block->isTableCell() || block->isBody() || block->style()->marginBeforeCollapse() == MDISCARD ||
+ block->style()->marginAfterCollapse() == MDISCARD;
- m_atTopOfBlock = true;
- m_atBottomOfBlock = false;
-
- m_posMargin = m_canCollapseTopWithChildren ? block->maxTopMargin(true) : 0;
- m_negMargin = m_canCollapseTopWithChildren ? block->maxTopMargin(false) : 0;
-
- m_topQuirk = m_bottomQuirk = m_determinedTopQuirk = false;
+ m_posMargin = m_canCollapseMarginBeforeWithChildren ? block->maxMarginBefore(RenderBox::PositiveMargin) : 0;
+ m_negMargin = m_canCollapseMarginBeforeWithChildren ? block->maxMarginBefore(RenderBox::NegativeMargin) : 0;
}
// -------------------------------------------------------------------------------------------------------
@@ -337,7 +338,7 @@ void RenderBlock::addChildToAnonymousColumnBlocks(RenderObject* newChild, Render
ASSERT(!continuation()); // We don't yet support column spans that aren't immediate children of the multi-column block.
// The goal is to locate a suitable box in which to place our child.
- RenderBlock* beforeChildParent = toRenderBlock(beforeChild ? beforeChild->parent() : lastChild());
+ RenderBlock* beforeChildParent = toRenderBlock(beforeChild && beforeChild->parent()->isRenderBlock() ? beforeChild->parent() : lastChild());
// If the new child is floating or positioned it can just go in that block.
if (newChild->isFloatingOrPositioned())
@@ -614,7 +615,7 @@ RenderBlock* RenderBlock::columnsBlockForSpanningElement(RenderObject* newChild)
&& !newChild->isInline() && !isAnonymousColumnSpanBlock()) {
if (style()->specifiesColumns())
columnsBlockAncestor = this;
- else
+ else if (parent() && parent()->isRenderBlock())
columnsBlockAncestor = toRenderBlock(parent())->containingColumnsBlock(false);
}
return columnsBlockAncestor;
@@ -1011,9 +1012,6 @@ void RenderBlock::removeChild(RenderObject* oldChild)
// If this was our last child be sure to clear out our line boxes.
if (childrenInline())
lineBoxes()->deleteLineBoxes(renderArena());
- // If we're now an empty anonymous columns or column span block, then go ahead and delete ourselves.
- else if ((isAnonymousColumnsBlock() || isAnonymousColumnSpanBlock()) && parent() && parent()->isRenderBlock() && !continuation())
- destroy();
}
}
@@ -1028,7 +1026,7 @@ bool RenderBlock::isSelfCollapsingBlock() const
if (height() > 0
|| isTable() || borderAndPaddingHeight()
|| style()->minHeight().isPositive()
- || style()->marginTopCollapse() == MSEPARATE || style()->marginBottomCollapse() == MSEPARATE)
+ || style()->marginBeforeCollapse() == MSEPARATE || style()->marginAfterCollapse() == MSEPARATE)
return false;
bool hasAutoHeight = style()->height().isAuto();
@@ -1130,12 +1128,12 @@ void RenderBlock::layoutBlock(bool relayoutChildren, int pageHeight)
int oldWidth = width();
int oldColumnWidth = desiredColumnWidth();
- calcWidth();
+ computeLogicalWidth();
calcColumnWidth();
m_overflow.clear();
- if (oldWidth != width() || oldColumnWidth != desiredColumnWidth())
+ if (oldWidth != logicalWidth() || oldColumnWidth != desiredColumnWidth())
relayoutChildren = true;
#ifdef ANDROID_LAYOUT
@@ -1144,21 +1142,21 @@ void RenderBlock::layoutBlock(bool relayoutChildren, int pageHeight)
clearFloats();
- int previousHeight = height();
- setHeight(0);
+ int previousHeight = logicalHeight();
+ setLogicalHeight(0);
bool hasSpecifiedPageHeight = false;
ColumnInfo* colInfo = columnInfo();
if (hasColumns()) {
if (!pageHeight) {
// We need to go ahead and set our explicit page height if one exists, so that we can
// avoid doing two layout passes.
- calcHeight();
- int columnHeight = contentHeight();
+ computeLogicalHeight();
+ int columnHeight = contentLogicalHeight();
if (columnHeight > 0) {
pageHeight = columnHeight;
hasSpecifiedPageHeight = true;
}
- setHeight(0);
+ setLogicalHeight(0);
}
if (colInfo->columnHeight() != pageHeight && m_everHadLayout) {
colInfo->setColumnHeight(pageHeight);
@@ -1185,14 +1183,14 @@ void RenderBlock::layoutBlock(bool relayoutChildren, int pageHeight)
if (!isCell) {
initMaxMarginValues();
- setTopMarginQuirk(style()->marginTop().quirk());
- setBottomMarginQuirk(style()->marginBottom().quirk());
+ setMarginBeforeQuirk(style()->marginBefore().quirk());
+ setMarginAfterQuirk(style()->marginAfter().quirk());
Node* n = node();
if (n && n->hasTagName(formTag) && static_cast<HTMLFormElement*>(n)->isMalformed()) {
// See if this form is malformed (i.e., unclosed). If so, don't give the form
// a bottom margin.
- setMaxBottomMargins(0, 0);
+ setMaxMarginAfterValues(0, 0);
}
setPaginationStrut(0);
@@ -1217,30 +1215,31 @@ void RenderBlock::layoutBlock(bool relayoutChildren, int pageHeight)
layoutBlockChildren(relayoutChildren, maxFloatBottom);
// Expand our intrinsic height to encompass floats.
- int toAdd = borderBottom() + paddingBottom() + horizontalScrollbarHeight();
- if (floatBottom() > (height() - toAdd) && expandsToEncloseOverhangingFloats())
- setHeight(floatBottom() + toAdd);
+ int toAdd = borderAfter() + paddingAfter() + horizontalScrollbarHeight(); // FIXME: https://bugs.webkit.org/show_bug.cgi?id=46645, overflow and block-flow.
+ if (floatBottom() > (logicalHeight() - toAdd) && expandsToEncloseOverhangingFloats())
+ setLogicalHeight(floatBottom() + toAdd);
if (layoutColumns(hasSpecifiedPageHeight, pageHeight, statePusher))
return;
// Calculate our new height.
- int oldHeight = height();
- calcHeight();
- if (oldHeight != height()) {
- if (oldHeight > height() && maxFloatBottom > height() && !childrenInline()) {
+ int oldHeight = logicalHeight();
+ computeLogicalHeight();
+ int newHeight = logicalHeight();
+ if (oldHeight != newHeight) {
+ if (oldHeight > newHeight && maxFloatBottom > newHeight && !childrenInline()) {
// One of our children's floats may have become an overhanging float for us. We need to look for it.
for (RenderObject* child = firstChild(); child; child = child->nextSibling()) {
if (child->isBlockFlow() && !child->isFloatingOrPositioned()) {
RenderBlock* block = toRenderBlock(child);
- if (block->floatBottom() + block->y() > height())
+ if (block->floatBottom() + block->logicalTop() > newHeight)
addOverhangingFloats(block, -block->x(), -block->y(), false);
}
}
}
}
- if (previousHeight != height())
+ if (previousHeight != newHeight)
relayoutChildren = true;
// Add overflow from children (unless we're multi-column, since in that case all our child overflow is clipped anyway).
@@ -1326,7 +1325,8 @@ void RenderBlock::addOverflowFromFloats()
bool RenderBlock::expandsToEncloseOverhangingFloats() const
{
- return isInlineBlockOrInlineTable() || isFloatingOrPositioned() || hasOverflowClip() || (parent() && parent()->isFlexibleBox()) || hasColumns() || isTableCell() || isFieldset();
+ return isInlineBlockOrInlineTable() || isFloatingOrPositioned() || hasOverflowClip() || (parent() && parent()->isFlexibleBox())
+ || hasColumns() || isTableCell() || isFieldset() || isBlockFlowRoot();
}
void RenderBlock::adjustPositionedBlock(RenderBox* child, const MarginInfo& marginInfo)
@@ -1340,8 +1340,8 @@ void RenderBlock::adjustPositionedBlock(RenderBox* child, const MarginInfo& marg
if (child->style()->hasStaticY()) {
int y = height();
- if (!marginInfo.canCollapseWithTop()) {
- child->calcVerticalMargins();
+ if (!marginInfo.canCollapseWithMarginBefore()) {
+ child->computeBlockDirectionMargins(this);
int marginTop = child->marginTop();
int collapsedTopPos = marginInfo.posMargin();
int collapsedTopNeg = marginInfo.negMargin();
@@ -1374,13 +1374,13 @@ void RenderBlock::adjustFloatingBlock(const MarginInfo& marginInfo)
// Note also that the previous flow may collapse its margin into the top of
// our block. If this is the case, then we do not add the margin in to our
// height when computing the position of the float. This condition can be tested
- // for by simply calling canCollapseWithTop. See
+ // for by simply calling canCollapseWithMarginBefore. See
// http://www.hixie.ch/tests/adhoc/css/box/block/margin-collapse/046.html for
// an example of this scenario.
- int marginOffset = marginInfo.canCollapseWithTop() ? 0 : marginInfo.margin();
- setHeight(height() + marginOffset);
+ int marginOffset = marginInfo.canCollapseWithMarginBefore() ? 0 : marginInfo.margin();
+ setLogicalHeight(height() + marginOffset);
positionNewFloats();
- setHeight(height() - marginOffset);
+ setLogicalHeight(height() - marginOffset);
}
bool RenderBlock::handleSpecialChild(RenderBox* child, const MarginInfo& marginInfo)
@@ -1462,7 +1462,8 @@ bool RenderBlock::handleRunInChild(RenderBox* child)
if (runInNode)
runInNode->setRenderer(inlineRunIn);
- // Destroy the block run-in.
+ // Destroy the block run-in, which includes deleting its line box tree.
+ blockRunIn->deleteLineBoxTree();
blockRunIn->destroy();
// The block acts like an inline, so just null out its
@@ -1474,47 +1475,47 @@ bool RenderBlock::handleRunInChild(RenderBox* child)
int RenderBlock::collapseMargins(RenderBox* child, MarginInfo& marginInfo)
{
// Get our max pos and neg top margins.
- int posTop = child->maxTopMargin(true);
- int negTop = child->maxTopMargin(false);
+ int posTop = child->maxMarginBefore(PositiveMargin);
+ int negTop = child->maxMarginBefore(NegativeMargin);
// For self-collapsing blocks, collapse our bottom margins into our
// top to get new posTop and negTop values.
if (child->isSelfCollapsingBlock()) {
- posTop = max(posTop, child->maxBottomMargin(true));
- negTop = max(negTop, child->maxBottomMargin(false));
+ posTop = max(posTop, child->maxMarginAfter(PositiveMargin));
+ negTop = max(negTop, child->maxMarginAfter(NegativeMargin));
}
// See if the top margin is quirky. We only care if this child has
// margins that will collapse with us.
- bool topQuirk = child->isTopMarginQuirk() || style()->marginTopCollapse() == MDISCARD;
+ bool topQuirk = child->isMarginBeforeQuirk() || style()->marginBeforeCollapse() == MDISCARD;
- if (marginInfo.canCollapseWithTop()) {
+ if (marginInfo.canCollapseWithMarginBefore()) {
// This child is collapsing with the top of the
// block. If it has larger margin values, then we need to update
// our own maximal values.
if (!document()->inQuirksMode() || !marginInfo.quirkContainer() || !topQuirk)
- setMaxTopMargins(max(posTop, maxTopPosMargin()), max(negTop, maxTopNegMargin()));
+ setMaxMarginBeforeValues(max(posTop, maxPosMarginBefore()), max(negTop, maxNegMarginBefore()));
// The minute any of the margins involved isn't a quirk, don't
// collapse it away, even if the margin is smaller (www.webreference.com
// has an example of this, a <dt> with 0.8em author-specified inside
// a <dl> inside a <td>.
- if (!marginInfo.determinedTopQuirk() && !topQuirk && (posTop-negTop)) {
- setTopMarginQuirk(false);
- marginInfo.setDeterminedTopQuirk(true);
+ if (!marginInfo.determinedMarginBeforeQuirk() && !topQuirk && (posTop-negTop)) {
+ setMarginBeforeQuirk(false);
+ marginInfo.setDeterminedMarginBeforeQuirk(true);
}
- if (!marginInfo.determinedTopQuirk() && topQuirk && marginTop() == 0)
+ if (!marginInfo.determinedMarginBeforeQuirk() && topQuirk && marginTop() == 0)
// We have no top margin and our top child has a quirky margin.
// We will pick up this quirky margin and pass it through.
// This deals with the <td><div><p> case.
// Don't do this for a block that split two inlines though. You do
// still apply margins in this case.
- setTopMarginQuirk(true);
+ setMarginBeforeQuirk(true);
}
- if (marginInfo.quirkContainer() && marginInfo.atTopOfBlock() && (posTop - negTop))
- marginInfo.setTopQuirk(topQuirk);
+ if (marginInfo.quirkContainer() && marginInfo.atBeforeSideOfBlock() && (posTop - negTop))
+ marginInfo.setMarginBeforeQuirk(topQuirk);
int beforeCollapseY = height();
int ypos = beforeCollapseY;
@@ -1522,16 +1523,16 @@ int RenderBlock::collapseMargins(RenderBox* child, MarginInfo& marginInfo)
// This child has no height. We need to compute our
// position before we collapse the child's margins together,
// so that we can get an accurate position for the zero-height block.
- int collapsedTopPos = max(marginInfo.posMargin(), child->maxTopMargin(true));
- int collapsedTopNeg = max(marginInfo.negMargin(), child->maxTopMargin(false));
+ int collapsedTopPos = max(marginInfo.posMargin(), child->maxMarginBefore(PositiveMargin));
+ int collapsedTopNeg = max(marginInfo.negMargin(), child->maxMarginBefore(NegativeMargin));
marginInfo.setMargin(collapsedTopPos, collapsedTopNeg);
// Now collapse the child's margins together, which means examining our
// bottom margin values as well.
- marginInfo.setPosMarginIfLarger(child->maxBottomMargin(true));
- marginInfo.setNegMarginIfLarger(child->maxBottomMargin(false));
+ marginInfo.setPosMarginIfLarger(child->maxMarginAfter(PositiveMargin));
+ marginInfo.setNegMarginIfLarger(child->maxMarginAfter(NegativeMargin));
- if (!marginInfo.canCollapseWithTop())
+ if (!marginInfo.canCollapseWithMarginBefore())
// We need to make sure that the position of the self-collapsing block
// is correct, since it could have overflowing content
// that needs to be positioned correctly (e.g., a block that
@@ -1539,24 +1540,24 @@ int RenderBlock::collapseMargins(RenderBox* child, MarginInfo& marginInfo)
ypos = height() + collapsedTopPos - collapsedTopNeg;
}
else {
- if (child->style()->marginTopCollapse() == MSEPARATE) {
- setHeight(height() + marginInfo.margin() + child->marginTop());
+ if (child->style()->marginBeforeCollapse() == MSEPARATE) {
+ setLogicalHeight(height() + marginInfo.margin() + child->marginTop());
ypos = height();
}
- else if (!marginInfo.atTopOfBlock() ||
- (!marginInfo.canCollapseTopWithChildren()
- && (!document()->inQuirksMode() || !marginInfo.quirkContainer() || !marginInfo.topQuirk()))) {
+ else if (!marginInfo.atBeforeSideOfBlock() ||
+ (!marginInfo.canCollapseMarginBeforeWithChildren()
+ && (!document()->inQuirksMode() || !marginInfo.quirkContainer() || !marginInfo.marginBeforeQuirk()))) {
// We're collapsing with a previous sibling's margins and not
// with the top of the block.
- setHeight(height() + max(marginInfo.posMargin(), posTop) - max(marginInfo.negMargin(), negTop));
+ setLogicalHeight(height() + max(marginInfo.posMargin(), posTop) - max(marginInfo.negMargin(), negTop));
ypos = height();
}
- marginInfo.setPosMargin(child->maxBottomMargin(true));
- marginInfo.setNegMargin(child->maxBottomMargin(false));
+ marginInfo.setPosMargin(child->maxMarginAfter(PositiveMargin));
+ marginInfo.setNegMargin(child->maxMarginAfter(NegativeMargin));
if (marginInfo.margin())
- marginInfo.setBottomQuirk(child->isBottomMarginQuirk() || style()->marginBottomCollapse() == MDISCARD);
+ marginInfo.setMarginAfterQuirk(child->isMarginAfterQuirk() || style()->marginAfterCollapse() == MDISCARD);
}
// If margins would pull us past the top of the next page, then we need to pull back and pretend like the margins
@@ -1565,7 +1566,7 @@ int RenderBlock::collapseMargins(RenderBox* child, MarginInfo& marginInfo)
if (paginated && ypos > beforeCollapseY) {
int oldY = ypos;
ypos = min(ypos, nextPageTop(beforeCollapseY));
- setHeight(height() + (ypos - oldY));
+ setLogicalHeight(height() + (ypos - oldY));
}
return ypos;
}
@@ -1590,28 +1591,28 @@ int RenderBlock::clearFloatsIfNeeded(RenderBox* child, MarginInfo& marginInfo, i
atBottomOfBlock = false;
}
if (atBottomOfBlock) {
- marginInfo.setPosMargin(child->maxBottomMargin(true));
- marginInfo.setNegMargin(child->maxBottomMargin(false));
+ marginInfo.setPosMargin(child->maxMarginAfter(PositiveMargin));
+ marginInfo.setNegMargin(child->maxMarginAfter(NegativeMargin));
} else {
- marginInfo.setPosMargin(max(child->maxTopMargin(true), child->maxBottomMargin(true)));
- marginInfo.setNegMargin(max(child->maxTopMargin(false), child->maxBottomMargin(false)));
+ marginInfo.setPosMargin(max(child->maxMarginBefore(PositiveMargin), child->maxMarginAfter(PositiveMargin)));
+ marginInfo.setNegMargin(max(child->maxMarginBefore(NegativeMargin), child->maxMarginAfter(NegativeMargin)));
}
// Adjust our height such that we are ready to be collapsed with subsequent siblings (or the bottom
// of the parent block).
- setHeight(child->y() - max(0, marginInfo.margin()));
+ setLogicalHeight(child->y() - max(0, marginInfo.margin()));
} else
// Increase our height by the amount we had to clear.
- setHeight(height() + heightIncrease);
+ setLogicalHeight(height() + heightIncrease);
- if (marginInfo.canCollapseWithTop()) {
+ if (marginInfo.canCollapseWithMarginBefore()) {
// We can no longer collapse with the top of the block since a clear
// occurred. The empty blocks collapse into the cleared block.
// FIXME: This isn't quite correct. Need clarification for what to do
// if the height the cleared block is offset by is smaller than the
// margins involved.
- setMaxTopMargins(oldTopPosMargin, oldTopNegMargin);
- marginInfo.setAtTopOfBlock(false);
+ setMaxMarginBeforeValues(oldTopPosMargin, oldTopNegMargin);
+ marginInfo.setAtBeforeSideOfBlock(false);
}
return yPos + heightIncrease;
@@ -1622,8 +1623,8 @@ int RenderBlock::estimateVerticalPosition(RenderBox* child, const MarginInfo& ma
// FIXME: We need to eliminate the estimation of vertical position, because when it's wrong we sometimes trigger a pathological
// relayout if there are intruding floats.
int yPosEstimate = height();
- if (!marginInfo.canCollapseWithTop()) {
- int childMarginTop = child->selfNeedsLayout() ? child->marginTop() : child->collapsedMarginTop();
+ if (!marginInfo.canCollapseWithMarginBefore()) {
+ int childMarginTop = child->selfNeedsLayout() ? child->marginTop() : child->collapsedMarginBefore();
yPosEstimate += max(marginInfo.margin(), childMarginTop);
}
@@ -1660,7 +1661,7 @@ void RenderBlock::determineHorizontalPosition(RenderBox* child)
// Some objects (e.g., tables, horizontal rules, overflow:auto blocks) avoid floats. They need
// to shift over as necessary to dodge any floats that might get in the way.
if (child->avoidsFloats()) {
- int leftOff = leftOffset(height(), false);
+ int leftOff = logicalLeftOffsetForLine(height(), false);
if (style()->textAlign() != WEBKIT_CENTER && child->style()->marginLeft().type() != Auto) {
if (child->marginLeft() < 0)
leftOff += child->marginLeft();
@@ -1670,19 +1671,19 @@ void RenderBlock::determineHorizontalPosition(RenderBox* child)
// The object is shifting right. The object might be centered, so we need to
// recalculate our horizontal margins. Note that the containing block content
// width computation will take into account the delta between |leftOff| and |xPos|
- // so that we can just pass the content width in directly to the |calcHorizontalMargins|
+ // so that we can just pass the content width in directly to the |computeMarginsInContainingBlockInlineDirection|
// function.
- child->calcHorizontalMargins(child->style()->marginLeft(), child->style()->marginRight(), lineWidth(child->y(), false));
+ child->computeInlineDirectionMargins(this, availableLogicalWidthForLine(child->y(), false), child->width());
chPos = leftOff + child->marginLeft();
}
}
view()->addLayoutDelta(IntSize(child->x() - chPos, 0));
child->setLocation(chPos, child->y());
} else {
- xPos += availableWidth();
+ xPos += availableLogicalWidth();
int chPos = xPos - (child->width() + child->marginRight());
if (child->avoidsFloats()) {
- int rightOff = rightOffset(height(), false);
+ int rightOff = logicalRightOffsetForLine(height(), false);
if (style()->textAlign() != WEBKIT_CENTER && child->style()->marginRight().type() != Auto) {
if (child->marginRight() < 0)
rightOff -= child->marginRight();
@@ -1691,9 +1692,9 @@ void RenderBlock::determineHorizontalPosition(RenderBox* child)
// The object is shifting left. The object might be centered, so we need to
// recalculate our horizontal margins. Note that the containing block content
// width computation will take into account the delta between |rightOff| and |xPos|
- // so that we can just pass the content width in directly to the |calcHorizontalMargins|
+ // so that we can just pass the content width in directly to the |computeInlineDirectionMargins|
// function.
- child->calcHorizontalMargins(child->style()->marginLeft(), child->style()->marginRight(), lineWidth(child->y(), false));
+ child->computeInlineDirectionMargins(this, availableLogicalWidthForLine(child->y(), false), child->width());
chPos = rightOff - child->marginRight() - child->width();
}
}
@@ -1704,37 +1705,37 @@ void RenderBlock::determineHorizontalPosition(RenderBox* child)
void RenderBlock::setCollapsedBottomMargin(const MarginInfo& marginInfo)
{
- if (marginInfo.canCollapseWithBottom() && !marginInfo.canCollapseWithTop()) {
+ if (marginInfo.canCollapseWithMarginAfter() && !marginInfo.canCollapseWithMarginBefore()) {
// Update our max pos/neg bottom margins, since we collapsed our bottom margins
// with our children.
- setMaxBottomMargins(max(maxBottomPosMargin(), marginInfo.posMargin()), max(maxBottomNegMargin(), marginInfo.negMargin()));
+ setMaxMarginAfterValues(max(maxPosMarginAfter(), marginInfo.posMargin()), max(maxNegMarginAfter(), marginInfo.negMargin()));
- if (!marginInfo.bottomQuirk())
- setBottomMarginQuirk(false);
+ if (!marginInfo.marginAfterQuirk())
+ setMarginAfterQuirk(false);
- if (marginInfo.bottomQuirk() && marginBottom() == 0)
+ if (marginInfo.marginAfterQuirk() && marginBottom() == 0)
// We have no bottom margin and our last child has a quirky margin.
// We will pick up this quirky margin and pass it through.
// This deals with the <td><div><p> case.
- setBottomMarginQuirk(true);
+ setMarginAfterQuirk(true);
}
}
void RenderBlock::handleBottomOfBlock(int top, int bottom, MarginInfo& marginInfo)
{
- marginInfo.setAtBottomOfBlock(true);
+ marginInfo.setAtAfterSideOfBlock(true);
// If we can't collapse with children then go ahead and add in the bottom margin.
- if (!marginInfo.canCollapseWithBottom() && !marginInfo.canCollapseWithTop()
- && (!document()->inQuirksMode() || !marginInfo.quirkContainer() || !marginInfo.bottomQuirk()))
- setHeight(height() + marginInfo.margin());
+ if (!marginInfo.canCollapseWithMarginAfter() && !marginInfo.canCollapseWithMarginBefore()
+ && (!document()->inQuirksMode() || !marginInfo.quirkContainer() || !marginInfo.marginAfterQuirk()))
+ setLogicalHeight(height() + marginInfo.margin());
// Now add in our bottom border/padding.
- setHeight(height() + bottom);
+ setLogicalHeight(height() + bottom);
// Negative margins can cause our height to shrink below our minimal height (border/padding).
// If this happens, ensure that the computed height is increased to the minimal height.
- setHeight(max(height(), top + bottom));
+ setLogicalHeight(max(height(), top + bottom));
// Update our bottom collapsed margin info.
setCollapsedBottomMargin(marginInfo);
@@ -1763,7 +1764,7 @@ void RenderBlock::layoutBlockChildren(bool relayoutChildren, int& maxFloatBottom
int top = borderTop() + paddingTop();
int bottom = borderBottom() + paddingBottom() + horizontalScrollbarHeight();
- setHeight(top);
+ setLogicalHeight(top);
// The margin struct caches all our current margin collapsing state. The compact struct caches state when we encounter compacts,
MarginInfo marginInfo(this, top, bottom);
@@ -1792,7 +1793,7 @@ void RenderBlock::layoutBlockChildren(bool relayoutChildren, int& maxFloatBottom
// If relayoutChildren is set and we have percentage padding, we also need to invalidate the child's pref widths.
if (relayoutChildren && (child->style()->paddingLeft().isPercent() || child->style()->paddingRight().isPercent()))
- child->setPrefWidthsDirty(true, false);
+ child->setPreferredLogicalWidthsDirty(true, false);
// Handle the four types of special elements first. These include positioned content, floating content, compacts and
// run-ins. When we encounter these four types of objects, we don't actually lay them out as normal flow blocks.
@@ -1810,15 +1811,15 @@ void RenderBlock::layoutBlockChildren(bool relayoutChildren, int& maxFloatBottom
void RenderBlock::layoutBlockChild(RenderBox* child, MarginInfo& marginInfo, int& previousFloatBottom, int& maxFloatBottom)
{
- int oldTopPosMargin = maxTopPosMargin();
- int oldTopNegMargin = maxTopNegMargin();
+ int oldTopPosMargin = maxPosMarginBefore();
+ int oldTopNegMargin = maxNegMarginBefore();
// The child is a normal flow object. Compute its vertical margins now.
- child->calcVerticalMargins();
+ child->computeBlockDirectionMargins(this);
// Do not allow a collapse if the margin top collapse style is set to SEPARATE.
- if (child->style()->marginTopCollapse() == MSEPARATE) {
- marginInfo.setAtTopOfBlock(false);
+ if (child->style()->marginBeforeCollapse() == MSEPARATE) {
+ marginInfo.setAtBeforeSideOfBlock(false);
marginInfo.clearMargin();
}
@@ -1864,7 +1865,7 @@ void RenderBlock::layoutBlockChild(RenderBox* child, MarginInfo& marginInfo, int
child->layout();
// Cache if we are at the top of the block right now.
- bool atTopOfBlock = marginInfo.atTopOfBlock();
+ bool atBeforeSideOfBlock = marginInfo.atBeforeSideOfBlock();
// Now determine the correct ypos based off examination of collapsing margin
// values.
@@ -1893,7 +1894,7 @@ void RenderBlock::layoutBlockChild(RenderBox* child, MarginInfo& marginInfo, int
if (paginationStrut) {
// We are willing to propagate out to our parent block as long as we were at the top of the block prior
// to collapsing our margins, and as long as we didn't clear or move as a result of other pagination.
- if (atTopOfBlock && oldY == yBeforeClear && !isPositioned() && !isTableCell()) {
+ if (atBeforeSideOfBlock && oldY == yBeforeClear && !isPositioned() && !isTableCell()) {
// FIXME: Should really check if we're exceeding the page height before propagating the strut, but we don't
// have all the information to do so (the strut only has the remaining amount to push). Gecko gets this wrong too
// and pushes to the next page anyway, so not too concerned about it.
@@ -1905,7 +1906,7 @@ void RenderBlock::layoutBlockChild(RenderBox* child, MarginInfo& marginInfo, int
}
// Similar to how we apply clearance. Go ahead and boost height() to be the place where we're going to position the child.
- setHeight(height() + (yAfterClear - oldY));
+ setLogicalHeight(height() + (yAfterClear - oldY));
}
view()->addLayoutDelta(IntSize(0, yPosEstimate - yAfterClear));
@@ -1933,16 +1934,16 @@ void RenderBlock::layoutBlockChild(RenderBox* child, MarginInfo& marginInfo, int
// We are no longer at the top of the block if we encounter a non-empty child.
// This has to be done after checking for clear, so that margins can be reset if a clear occurred.
- if (marginInfo.atTopOfBlock() && !child->isSelfCollapsingBlock())
- marginInfo.setAtTopOfBlock(false);
+ if (marginInfo.atBeforeSideOfBlock() && !child->isSelfCollapsingBlock())
+ marginInfo.setAtBeforeSideOfBlock(false);
// Now place the child in the correct horizontal position
determineHorizontalPosition(child);
// Update our height now that the child has been placed in the correct position.
- setHeight(height() + child->height());
- if (child->style()->marginBottomCollapse() == MSEPARATE) {
- setHeight(height() + child->marginBottom());
+ setLogicalHeight(height() + child->height());
+ if (child->style()->marginAfterCollapse() == MSEPARATE) {
+ setLogicalHeight(height() + child->marginBottom());
marginInfo.clearMargin();
}
// If the child has overhanging floats that intrude into following siblings (or possibly out
@@ -1970,7 +1971,7 @@ void RenderBlock::layoutBlockChild(RenderBox* child, MarginInfo& marginInfo, int
// Check for an after page/column break.
int newHeight = applyAfterBreak(child, height(), marginInfo);
if (newHeight != height())
- setHeight(newHeight);
+ setLogicalHeight(newHeight);
}
ASSERT(oldLayoutDelta == view()->layoutDelta());
@@ -2028,7 +2029,7 @@ void RenderBlock::layoutPositionedObjects(bool relayoutChildren)
// If relayoutChildren is set and we have percentage padding, we also need to invalidate the child's pref widths.
//if (relayoutChildren && (r->style()->paddingLeft().isPercent() || r->style()->paddingRight().isPercent()))
- r->setPrefWidthsDirty(true, false);
+ r->setPreferredLogicalWidthsDirty(true, false);
if (!r->needsLayout() && paginated && view()->layoutState()->m_pageHeight) {
RenderBlock* childRenderBlock = r->isRenderBlock() ? toRenderBlock(r) : 0;
@@ -2266,7 +2267,7 @@ void RenderBlock::paintChildren(PaintInfo& paintInfo, int tx, int ty)
if (checkAfterAlways
&& (ty + child->y() + child->height()) > paintInfo.rect.y()
&& (ty + child->y() + child->height()) < paintInfo.rect.bottom()) {
- view()->setBestTruncatedAt(ty + child->y() + child->height() + max(0, child->collapsedMarginBottom()), this, true);
+ view()->setBestTruncatedAt(ty + child->y() + child->height() + max(0, child->collapsedMarginAfter()), this, true);
return;
}
}
@@ -2418,7 +2419,7 @@ void RenderBlock::paintEllipsisBoxes(PaintInfo& paintInfo, int tx, int ty)
// We can check the first box and last box and avoid painting if we don't
// intersect.
int yPos = ty + firstLineBox()->y();
- int h = lastLineBox()->y() + lastLineBox()->height() - firstLineBox()->y();
+ int h = lastLineBox()->y() + lastLineBox()->logicalHeight() - firstLineBox()->y();
if (yPos >= paintInfo.rect.bottom() || yPos + h <= paintInfo.rect.y())
return;
@@ -2427,7 +2428,7 @@ void RenderBlock::paintEllipsisBoxes(PaintInfo& paintInfo, int tx, int ty)
// based off positions of our first line box or our last line box.
for (RootInlineBox* curr = firstRootBox(); curr; curr = curr->nextRootBox()) {
yPos = ty + curr->y();
- h = curr->height();
+ h = curr->logicalHeight();
if (curr->ellipsisBox() && yPos < paintInfo.rect.bottom() && yPos + h > paintInfo.rect.y())
curr->paintEllipsisBox(paintInfo, tx, ty);
}
@@ -2825,7 +2826,7 @@ void RenderBlock::getHorizontalSelectionGapInfo(SelectionState state, bool& left
int RenderBlock::leftSelectionOffset(RenderBlock* rootBlock, int yPos)
{
- int left = leftOffset(yPos, false);
+ int left = logicalLeftOffsetForLine(yPos, false);
if (left == borderLeft() + paddingLeft()) {
if (rootBlock != this)
// The border can potentially be further extended by our containingBlock().
@@ -2845,7 +2846,7 @@ int RenderBlock::leftSelectionOffset(RenderBlock* rootBlock, int yPos)
int RenderBlock::rightSelectionOffset(RenderBlock* rootBlock, int yPos)
{
- int right = rightOffset(yPos, false);
+ int right = logicalRightOffsetForLine(yPos, false);
if (right == (contentWidth() + (borderLeft() + paddingLeft()))) {
if (rootBlock != this)
// The border can potentially be further extended by our containingBlock().
@@ -2942,8 +2943,8 @@ RenderBlock::FloatingObject* RenderBlock::insertFloatingObject(RenderBox* o)
if (!affectedByPagination)
o->layoutIfNeeded();
else {
- o->calcWidth();
- o->calcVerticalMargins();
+ o->computeLogicalWidth();
+ o->computeBlockDirectionMargins(this);
}
newObj->m_width = o->width() + o->marginLeft() + o->marginRight();
@@ -3026,8 +3027,8 @@ bool RenderBlock::positionNewFloats()
RenderBox* o = f->m_renderer;
- int ro = rightOffset(); // Constant part of right offset.
- int lo = leftOffset(); // Constant part of left offset.
+ int ro = logicalRightOffsetForContent(); // Constant part of right offset.
+ int lo = logicalLeftOffsetForContent(); // Constant part of left offset.
int fwidth = f->m_width; // The width we look for.
if (ro - lo < fwidth)
fwidth = ro - lo; // Never look for more than what will be available.
@@ -3042,10 +3043,10 @@ bool RenderBlock::positionNewFloats()
if (o->style()->floating() == FLEFT) {
int heightRemainingLeft = 1;
int heightRemainingRight = 1;
- int fx = leftRelOffset(y, lo, false, &heightRemainingLeft);
- while (rightRelOffset(y, ro, false, &heightRemainingRight)-fx < fwidth) {
+ int fx = logicalLeftOffsetForLine(y, lo, false, &heightRemainingLeft);
+ while (logicalRightOffsetForLine(y, ro, false, &heightRemainingRight)-fx < fwidth) {
y += min(heightRemainingLeft, heightRemainingRight);
- fx = leftRelOffset(y, lo, false, &heightRemainingLeft);
+ fx = logicalLeftOffsetForLine(y, lo, false, &heightRemainingLeft);
}
fx = max(0, fx);
f->m_left = fx;
@@ -3053,10 +3054,10 @@ bool RenderBlock::positionNewFloats()
} else {
int heightRemainingLeft = 1;
int heightRemainingRight = 1;
- int fx = rightRelOffset(y, ro, false, &heightRemainingRight);
- while (fx - leftRelOffset(y, lo, false, &heightRemainingLeft) < fwidth) {
+ int fx = logicalRightOffsetForLine(y, ro, false, &heightRemainingRight);
+ while (fx - logicalLeftOffsetForLine(y, lo, false, &heightRemainingLeft) < fwidth) {
y += min(heightRemainingLeft, heightRemainingRight);
- fx = rightRelOffset(y, ro, false, &heightRemainingRight);
+ fx = logicalRightOffsetForLine(y, ro, false, &heightRemainingRight);
}
f->m_left = fx - f->m_width;
o->setLocation(fx - o->marginRight() - o->width(), y + o->marginTop());
@@ -3132,7 +3133,7 @@ bool RenderBlock::positionNewFloatOnLine(FloatingObject* newFloat, FloatingObjec
}
}
- setHeight(height() + paginationStrut);
+ setLogicalHeight(height() + paginationStrut);
return didPosition;
}
@@ -3156,7 +3157,7 @@ void RenderBlock::newLine(EClear clear)
break;
}
if (height() < newY)
- setHeight(newY);
+ setLogicalHeight(newY);
}
void RenderBlock::addPercentHeightDescendant(RenderBox* descendant)
@@ -3219,12 +3220,12 @@ HashSet<RenderBox*>* RenderBlock::percentHeightDescendants() const
return gPercentHeightDescendantsMap ? gPercentHeightDescendantsMap->get(this) : 0;
}
-int RenderBlock::leftOffset() const
+int RenderBlock::logicalLeftOffsetForContent() const
{
return borderLeft() + paddingLeft();
}
-int RenderBlock::leftRelOffset(int y, int fixedOffset, bool applyTextIndent, int* heightRemaining) const
+int RenderBlock::logicalLeftOffsetForLine(int y, int fixedOffset, bool applyTextIndent, int* heightRemaining) const
{
int left = fixedOffset;
if (m_floatingObjects) {
@@ -3245,19 +3246,19 @@ int RenderBlock::leftRelOffset(int y, int fixedOffset, bool applyTextIndent, int
if (applyTextIndent && style()->direction() == LTR) {
int cw = 0;
if (style()->textIndent().isPercent())
- cw = containingBlock()->availableWidth();
+ cw = containingBlock()->availableLogicalWidth();
left += style()->textIndent().calcMinValue(cw);
}
return left;
}
-int RenderBlock::rightOffset() const
+int RenderBlock::logicalRightOffsetForContent() const
{
- return borderLeft() + paddingLeft() + availableWidth();
+ return borderLeft() + paddingLeft() + availableLogicalWidth();
}
-int RenderBlock::rightRelOffset(int y, int fixedOffset, bool applyTextIndent, int* heightRemaining) const
+int RenderBlock::logicalRightOffsetForLine(int y, int fixedOffset, bool applyTextIndent, int* heightRemaining) const
{
int right = fixedOffset;
@@ -3279,7 +3280,7 @@ int RenderBlock::rightRelOffset(int y, int fixedOffset, bool applyTextIndent, in
if (applyTextIndent && style()->direction() == RTL) {
int cw = 0;
if (style()->textIndent().isPercent())
- cw = containingBlock()->availableWidth();
+ cw = containingBlock()->availableLogicalWidth();
right -= style()->textIndent().calcMinValue(cw);
}
@@ -3287,9 +3288,9 @@ int RenderBlock::rightRelOffset(int y, int fixedOffset, bool applyTextIndent, in
}
int
-RenderBlock::lineWidth(int y, bool firstLine) const
+RenderBlock::availableLogicalWidthForLine(int position, bool firstLine) const
{
- int result = rightOffset(y, firstLine) - leftOffset(y, firstLine);
+ int result = logicalRightOffsetForLine(position, firstLine) - logicalLeftOffsetForLine(position, firstLine);
return (result < 0) ? 0 : result;
}
@@ -3407,7 +3408,7 @@ int RenderBlock::lowestPosition(bool includeOverflowInterior, bool includeSelf)
while (currBox && currBox->isFloatingOrPositioned())
currBox = currBox->previousSiblingBox();
if (currBox) {
- int childBottomEdge = currBox->y() + currBox->height() + currBox->collapsedMarginBottom();
+ int childBottomEdge = currBox->y() + currBox->height() + currBox->collapsedMarginAfter(); // FIXME: "after" is wrong here for lowestPosition.
bottom = max(bottom, childBottomEdge + paddingBottom() + relativeOffset);
}
}
@@ -3495,7 +3496,7 @@ int RenderBlock::rightmostPosition(bool includeOverflowInterior, bool includeSel
right = max(right, borderLeft() + paddingLeft() + paddingRight() + relativeOffset);
if (childrenInline()) {
for (InlineFlowBox* currBox = firstLineBox(); currBox; currBox = currBox->nextLineBox()) {
- int childRightEdge = currBox->x() + currBox->width();
+ int childRightEdge = currBox->x() + currBox->logicalWidth();
// If this node is a root editable element, then the rightmostPosition should account for a caret at the end.
// FIXME: Need to find another way to do this, since scrollbars could show when we don't want them to.
@@ -3748,7 +3749,7 @@ void RenderBlock::clearFloats()
int RenderBlock::addOverhangingFloats(RenderBlock* child, int xoff, int yoff, bool makeChildPaintOtherFloats)
{
// Prevent floats from being added to the canvas by the root element, e.g., <html>.
- if (child->hasOverflowClip() || !child->containsFloats() || child->isRoot() || child->hasColumns())
+ if (child->hasOverflowClip() || !child->containsFloats() || child->isRoot() || child->hasColumns() || child->isBlockFlowRoot())
return 0;
int lowestFloatBottom = 0;
@@ -3950,20 +3951,20 @@ int RenderBlock::getClearDelta(RenderBox* child, int yPos)
// 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).
int result = clearSet ? max(0, bottom - yPos) : 0;
if (!result && child->avoidsFloats()) {
- int availableWidth = this->availableWidth();
- if (child->minPrefWidth() > availableWidth)
+ int availableWidth = availableLogicalWidth();
+ if (child->minPreferredLogicalWidth() > availableWidth)
return 0;
int y = yPos;
while (true) {
- int widthAtY = lineWidth(y, false);
+ int widthAtY = availableLogicalWidthForLine(y, false);
if (widthAtY == availableWidth)
return y - yPos;
int oldChildY = child->y();
int oldChildWidth = child->width();
child->setY(y);
- child->calcWidth();
+ child->computeLogicalWidth();
int childWidthAtY = child->width();
child->setY(oldChildY);
child->setWidth(oldChildWidth);
@@ -4315,14 +4316,6 @@ void RenderBlock::offsetForContents(int& tx, int& ty) const
ty = contentsPoint.y();
}
-int RenderBlock::availableWidth() const
-{
- // If we have multiple columns, then the available width is reduced to our column width.
- if (hasColumns())
- return desiredColumnWidth();
- return RenderBox::availableWidth();
-}
-
int RenderBlock::availableLogicalWidth() const
{
// If we have multiple columns, then the available logical width is reduced to our column width.
@@ -4496,7 +4489,7 @@ bool RenderBlock::layoutColumns(bool hasSpecifiedPageHeight, int pageHeight, Lay
int overflowRight = style()->direction() == LTR ? max(width(), lastRect.x() + lastRect.width()) : 0;
int overflowHeight = borderTop() + paddingTop() + colInfo->columnHeight();
- setHeight(overflowHeight + borderBottom() + paddingBottom() + horizontalScrollbarHeight());
+ setLogicalHeight(overflowHeight + borderBottom() + paddingBottom() + horizontalScrollbarHeight());
m_overflow.clear();
addLayoutOverflow(IntRect(overflowLeft, 0, overflowRight - overflowLeft, overflowHeight));
@@ -4608,48 +4601,48 @@ void RenderBlock::adjustForColumns(IntSize& offset, const IntPoint& point) const
}
}
-void RenderBlock::calcPrefWidths()
+void RenderBlock::computePreferredLogicalWidths()
{
- ASSERT(prefWidthsDirty());
+ ASSERT(preferredLogicalWidthsDirty());
updateFirstLetter();
if (!isTableCell() && style()->width().isFixed() && style()->width().value() > 0)
- m_minPrefWidth = m_maxPrefWidth = calcContentBoxWidth(style()->width().value());
+ m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = computeContentBoxLogicalWidth(style()->width().value());
else {
- m_minPrefWidth = 0;
- m_maxPrefWidth = 0;
+ m_minPreferredLogicalWidth = 0;
+ m_maxPreferredLogicalWidth = 0;
if (childrenInline())
- calcInlinePrefWidths();
+ computeInlinePreferredLogicalWidths();
else
- calcBlockPrefWidths();
+ computeBlockPreferredLogicalWidths();
- m_maxPrefWidth = max(m_minPrefWidth, m_maxPrefWidth);
+ m_maxPreferredLogicalWidth = max(m_minPreferredLogicalWidth, m_maxPreferredLogicalWidth);
if (!style()->autoWrap() && childrenInline()) {
- m_minPrefWidth = m_maxPrefWidth;
+ m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth;
// A horizontal marquee with inline children has no minimum width.
if (layer() && layer()->marquee() && layer()->marquee()->isHorizontal())
- m_minPrefWidth = 0;
+ m_minPreferredLogicalWidth = 0;
}
if (isTableCell()) {
Length w = toRenderTableCell(this)->styleOrColWidth();
if (w.isFixed() && w.value() > 0)
- m_maxPrefWidth = max(m_minPrefWidth, calcContentBoxWidth(w.value()));
+ m_maxPreferredLogicalWidth = max(m_minPreferredLogicalWidth, computeContentBoxLogicalWidth(w.value()));
}
}
if (style()->minWidth().isFixed() && style()->minWidth().value() > 0) {
- m_maxPrefWidth = max(m_maxPrefWidth, calcContentBoxWidth(style()->minWidth().value()));
- m_minPrefWidth = max(m_minPrefWidth, calcContentBoxWidth(style()->minWidth().value()));
+ m_maxPreferredLogicalWidth = max(m_maxPreferredLogicalWidth, computeContentBoxLogicalWidth(style()->minWidth().value()));
+ m_minPreferredLogicalWidth = max(m_minPreferredLogicalWidth, computeContentBoxLogicalWidth(style()->minWidth().value()));
}
if (style()->maxWidth().isFixed() && style()->maxWidth().value() != undefinedLength) {
- m_maxPrefWidth = min(m_maxPrefWidth, calcContentBoxWidth(style()->maxWidth().value()));
- m_minPrefWidth = min(m_minPrefWidth, calcContentBoxWidth(style()->maxWidth().value()));
+ m_maxPreferredLogicalWidth = min(m_maxPreferredLogicalWidth, computeContentBoxLogicalWidth(style()->maxWidth().value()));
+ m_minPreferredLogicalWidth = min(m_minPreferredLogicalWidth, computeContentBoxLogicalWidth(style()->maxWidth().value()));
}
int toAdd = 0;
@@ -4658,10 +4651,10 @@ void RenderBlock::calcPrefWidths()
if (hasOverflowClip() && style()->overflowY() == OSCROLL)
toAdd += verticalScrollbarWidth();
- m_minPrefWidth += toAdd;
- m_maxPrefWidth += toAdd;
+ m_minPreferredLogicalWidth += toAdd;
+ m_maxPreferredLogicalWidth += toAdd;
- setPrefWidthsDirty(false);
+ setPreferredLogicalWidthsDirty(false);
}
struct InlineMinMaxIterator {
@@ -4765,7 +4758,7 @@ static inline void stripTrailingSpace(int& inlineMax, int& inlineMin,
}
}
-void RenderBlock::calcInlinePrefWidths()
+void RenderBlock::computeInlinePreferredLogicalWidths()
{
int inlineMax = 0;
int inlineMin = 0;
@@ -4844,7 +4837,7 @@ void RenderBlock::calcInlinePrefWidths()
inlineMin += childMin;
inlineMax += childMax;
- child->setPrefWidthsDirty(false);
+ child->setPreferredLogicalWidthsDirty(false);
} else {
// Inline replaced elts add in their margins to their min/max values.
int margins = 0;
@@ -4863,8 +4856,8 @@ void RenderBlock::calcInlinePrefWidths()
// Case (2). Inline replaced elements and floats.
// Go ahead and terminate the current line as far as
// minwidth is concerned.
- childMin += child->minPrefWidth();
- childMax += child->maxPrefWidth();
+ childMin += child->minPreferredLogicalWidth();
+ childMax += child->maxPreferredLogicalWidth();
bool clearPreviousFloat;
if (child->isFloating()) {
@@ -4877,13 +4870,13 @@ void RenderBlock::calcInlinePrefWidths()
bool canBreakReplacedElement = !child->isImage() || allowImagesToBreak;
if ((canBreakReplacedElement && (autoWrap || oldAutoWrap)) || clearPreviousFloat) {
- m_minPrefWidth = max(inlineMin, m_minPrefWidth);
+ m_minPreferredLogicalWidth = max(inlineMin, m_minPreferredLogicalWidth);
inlineMin = 0;
}
// If we're supposed to clear the previous float, then terminate maxwidth as well.
if (clearPreviousFloat) {
- m_maxPrefWidth = max(inlineMax, m_maxPrefWidth);
+ m_maxPreferredLogicalWidth = max(inlineMax, m_maxPreferredLogicalWidth);
inlineMax = 0;
}
@@ -4901,12 +4894,12 @@ void RenderBlock::calcInlinePrefWidths()
if (!autoWrap || !canBreakReplacedElement) {
if (child->isFloating())
- m_minPrefWidth = max(childMin, m_minPrefWidth);
+ m_minPreferredLogicalWidth = max(childMin, m_minPreferredLogicalWidth);
else
inlineMin += childMin;
} else {
// Now check our line.
- m_minPrefWidth = max(childMin, m_minPrefWidth);
+ m_minPreferredLogicalWidth = max(childMin, m_minPreferredLogicalWidth);
// Now start a new line.
inlineMin = 0;
@@ -4923,7 +4916,7 @@ void RenderBlock::calcInlinePrefWidths()
RenderText* t = toRenderText(child);
if (t->isWordBreak()) {
- m_minPrefWidth = max(inlineMin, m_minPrefWidth);
+ m_minPreferredLogicalWidth = max(inlineMin, m_minPreferredLogicalWidth);
inlineMin = 0;
continue;
}
@@ -4944,7 +4937,7 @@ void RenderBlock::calcInlinePrefWidths()
// This text object will not be rendered, but it may still provide a breaking opportunity.
if (!hasBreak && childMax == 0) {
if (autoWrap && (beginWS || endWS)) {
- m_minPrefWidth = max(inlineMin, m_minPrefWidth);
+ m_minPreferredLogicalWidth = max(inlineMin, m_minPreferredLogicalWidth);
inlineMin = 0;
}
continue;
@@ -4974,10 +4967,10 @@ void RenderBlock::calcInlinePrefWidths()
// we start and end with whitespace.
if (beginWS)
// Go ahead and end the current line.
- m_minPrefWidth = max(inlineMin, m_minPrefWidth);
+ m_minPreferredLogicalWidth = max(inlineMin, m_minPreferredLogicalWidth);
else {
inlineMin += beginMin;
- m_minPrefWidth = max(inlineMin, m_minPrefWidth);
+ m_minPreferredLogicalWidth = max(inlineMin, m_minPreferredLogicalWidth);
childMin -= ti;
}
@@ -4986,18 +4979,18 @@ void RenderBlock::calcInlinePrefWidths()
if (endWS) {
// We end in whitespace, which means we can go ahead
// and end our current line.
- m_minPrefWidth = max(inlineMin, m_minPrefWidth);
+ m_minPreferredLogicalWidth = max(inlineMin, m_minPreferredLogicalWidth);
inlineMin = 0;
} else {
- m_minPrefWidth = max(inlineMin, m_minPrefWidth);
+ m_minPreferredLogicalWidth = max(inlineMin, m_minPreferredLogicalWidth);
inlineMin = endMin;
}
}
if (hasBreak) {
inlineMax += beginMax;
- m_maxPrefWidth = max(inlineMax, m_maxPrefWidth);
- m_maxPrefWidth = max(childMax, m_maxPrefWidth);
+ m_maxPreferredLogicalWidth = max(inlineMax, m_maxPreferredLogicalWidth);
+ m_maxPreferredLogicalWidth = max(childMax, m_maxPreferredLogicalWidth);
inlineMax = endMax;
} else
inlineMax += childMax;
@@ -5007,8 +5000,8 @@ void RenderBlock::calcInlinePrefWidths()
if (child->isListMarker())
stripFrontSpaces = true;
} else {
- m_minPrefWidth = max(inlineMin, m_minPrefWidth);
- m_maxPrefWidth = max(inlineMax, m_maxPrefWidth);
+ m_minPreferredLogicalWidth = max(inlineMin, m_minPreferredLogicalWidth);
+ m_maxPreferredLogicalWidth = max(inlineMax, m_maxPreferredLogicalWidth);
inlineMin = inlineMax = 0;
stripFrontSpaces = true;
trailingSpaceChild = 0;
@@ -5020,14 +5013,14 @@ void RenderBlock::calcInlinePrefWidths()
if (style()->collapseWhiteSpace())
stripTrailingSpace(inlineMax, inlineMin, trailingSpaceChild);
- m_minPrefWidth = max(inlineMin, m_minPrefWidth);
- m_maxPrefWidth = max(inlineMax, m_maxPrefWidth);
+ m_minPreferredLogicalWidth = max(inlineMin, m_minPreferredLogicalWidth);
+ m_maxPreferredLogicalWidth = max(inlineMax, m_maxPreferredLogicalWidth);
}
// Use a very large value (in effect infinite).
#define BLOCK_MAX_WIDTH 15000
-void RenderBlock::calcBlockPrefWidths()
+void RenderBlock::computeBlockPreferredLogicalWidths()
{
bool nowrap = style()->whiteSpace() == NOWRAP;
@@ -5043,11 +5036,11 @@ void RenderBlock::calcBlockPrefWidths()
if (child->isFloating() || (child->isBox() && toRenderBox(child)->avoidsFloats())) {
int floatTotalWidth = floatLeftWidth + floatRightWidth;
if (child->style()->clear() & CLEFT) {
- m_maxPrefWidth = max(floatTotalWidth, m_maxPrefWidth);
+ m_maxPreferredLogicalWidth = max(floatTotalWidth, m_maxPreferredLogicalWidth);
floatLeftWidth = 0;
}
if (child->style()->clear() & CRIGHT) {
- m_maxPrefWidth = max(floatTotalWidth, m_maxPrefWidth);
+ m_maxPreferredLogicalWidth = max(floatTotalWidth, m_maxPreferredLogicalWidth);
floatRightWidth = 0;
}
}
@@ -5064,14 +5057,14 @@ void RenderBlock::calcBlockPrefWidths()
marginRight += mr.value();
margin = marginLeft + marginRight;
- int w = child->minPrefWidth() + margin;
- m_minPrefWidth = max(w, m_minPrefWidth);
+ int w = child->minPreferredLogicalWidth() + margin;
+ m_minPreferredLogicalWidth = max(w, m_minPreferredLogicalWidth);
// IE ignores tables for calculation of nowrap. Makes some sense.
if (nowrap && !child->isTable())
- m_maxPrefWidth = max(w, m_maxPrefWidth);
+ m_maxPreferredLogicalWidth = max(w, m_maxPreferredLogicalWidth);
- w = child->maxPrefWidth() + margin;
+ w = child->maxPreferredLogicalWidth() + margin;
if (!child->isFloating()) {
if (child->isBox() && toRenderBox(child)->avoidsFloats()) {
@@ -5080,11 +5073,11 @@ void RenderBlock::calcBlockPrefWidths()
// is smaller than the float width.
int maxLeft = marginLeft > 0 ? max(floatLeftWidth, marginLeft) : floatLeftWidth + marginLeft;
int maxRight = marginRight > 0 ? max(floatRightWidth, marginRight) : floatRightWidth + marginRight;
- w = child->maxPrefWidth() + maxLeft + maxRight;
+ w = child->maxPreferredLogicalWidth() + maxLeft + maxRight;
w = max(w, floatLeftWidth + floatRightWidth);
}
else
- m_maxPrefWidth = max(floatLeftWidth + floatRightWidth, m_maxPrefWidth);
+ m_maxPreferredLogicalWidth = max(floatLeftWidth + floatRightWidth, m_maxPreferredLogicalWidth);
floatLeftWidth = floatRightWidth = 0;
}
@@ -5094,7 +5087,7 @@ void RenderBlock::calcBlockPrefWidths()
else
floatRightWidth += w;
} else
- m_maxPrefWidth = max(w, m_maxPrefWidth);
+ m_maxPreferredLogicalWidth = max(w, m_maxPreferredLogicalWidth);
// A very specific WinIE quirk.
// Example:
@@ -5110,22 +5103,22 @@ void RenderBlock::calcBlockPrefWidths()
// We can achieve this effect by making the maxwidth of blocks that contain tables
// with percentage widths be infinite (as long as they are not inside a table cell).
if (document()->inQuirksMode() && child->style()->width().isPercent() &&
- !isTableCell() && child->isTable() && m_maxPrefWidth < BLOCK_MAX_WIDTH) {
+ !isTableCell() && child->isTable() && m_maxPreferredLogicalWidth < BLOCK_MAX_WIDTH) {
RenderBlock* cb = containingBlock();
while (!cb->isRenderView() && !cb->isTableCell())
cb = cb->containingBlock();
if (!cb->isTableCell())
- m_maxPrefWidth = BLOCK_MAX_WIDTH;
+ m_maxPreferredLogicalWidth = BLOCK_MAX_WIDTH;
}
child = child->nextSibling();
}
// Always make sure these values are non-negative.
- m_minPrefWidth = max(0, m_minPrefWidth);
- m_maxPrefWidth = max(0, m_maxPrefWidth);
+ m_minPreferredLogicalWidth = max(0, m_minPreferredLogicalWidth);
+ m_maxPreferredLogicalWidth = max(0, m_maxPreferredLogicalWidth);
- m_maxPrefWidth = max(floatLeftWidth + floatRightWidth, m_maxPrefWidth);
+ m_maxPreferredLogicalWidth = max(floatLeftWidth + floatRightWidth, m_maxPreferredLogicalWidth);
}
bool RenderBlock::hasLineIfEmpty() const
@@ -5537,7 +5530,7 @@ void RenderBlock::adjustForBorderFit(int x, int& left, int& right) const
if (box->firstChild())
left = min(left, x + box->firstChild()->x());
if (box->lastChild())
- right = max(right, x + box->lastChild()->x() + box->lastChild()->width());
+ right = max(right, x + box->lastChild()->x() + box->lastChild()->logicalWidth());
}
}
else {
@@ -5609,26 +5602,26 @@ void RenderBlock::clearTruncation()
}
}
-void RenderBlock::setMaxTopMargins(int pos, int neg)
+void RenderBlock::setMaxMarginBeforeValues(int pos, int neg)
{
if (!m_rareData) {
- if (pos == RenderBlockRareData::topPosDefault(this) && neg == RenderBlockRareData::topNegDefault(this))
+ if (pos == RenderBlockRareData::beforePosDefault(this) && neg == RenderBlockRareData::beforeNegDefault(this))
return;
m_rareData = new RenderBlockRareData(this);
}
- m_rareData->m_topPos = pos;
- m_rareData->m_topNeg = neg;
+ m_rareData->m_beforePos = pos;
+ m_rareData->m_beforeNeg = neg;
}
-void RenderBlock::setMaxBottomMargins(int pos, int neg)
+void RenderBlock::setMaxMarginAfterValues(int pos, int neg)
{
if (!m_rareData) {
- if (pos == RenderBlockRareData::bottomPosDefault(this) && neg == RenderBlockRareData::bottomNegDefault(this))
+ if (pos == RenderBlockRareData::afterPosDefault(this) && neg == RenderBlockRareData::afterNegDefault(this))
return;
m_rareData = new RenderBlockRareData(this);
}
- m_rareData->m_bottomPos = pos;
- m_rareData->m_bottomNeg = neg;
+ m_rareData->m_afterPos = pos;
+ m_rareData->m_afterNeg = neg;
}
void RenderBlock::setPaginationStrut(int strut)
@@ -5657,8 +5650,10 @@ void RenderBlock::absoluteRects(Vector<IntRect>& rects, int tx, int ty)
// inline boxes above and below us (thus getting merged with them to form a single irregular
// shape).
if (isAnonymousBlockContinuation()) {
- rects.append(IntRect(tx, ty - collapsedMarginTop(),
- width(), height() + collapsedMarginTop() + collapsedMarginBottom()));
+ // FIXME: This is wrong for block-flows that are horizontal.
+ // https://bugs.webkit.org/show_bug.cgi?id=46781
+ rects.append(IntRect(tx, ty - collapsedMarginBefore(),
+ width(), height() + collapsedMarginBefore() + collapsedMarginAfter()));
continuation()->absoluteRects(rects,
tx - x() + inlineElementContinuation()->containingBlock()->x(),
ty - y() + inlineElementContinuation()->containingBlock()->y());
@@ -5672,8 +5667,10 @@ void RenderBlock::absoluteQuads(Vector<FloatQuad>& quads)
// inline boxes above and below us (thus getting merged with them to form a single irregular
// shape).
if (isAnonymousBlockContinuation()) {
- FloatRect localRect(0, -collapsedMarginTop(),
- width(), height() + collapsedMarginTop() + collapsedMarginBottom());
+ // FIXME: This is wrong for block-flows that are horizontal.
+ // https://bugs.webkit.org/show_bug.cgi?id=46781
+ FloatRect localRect(0, -collapsedMarginBefore(),
+ width(), height() + collapsedMarginBefore() + collapsedMarginAfter());
quads.append(localToAbsoluteQuad(localRect));
continuation()->absoluteQuads(quads);
} else
@@ -5684,7 +5681,7 @@ IntRect RenderBlock::rectWithOutlineForRepaint(RenderBoxModelObject* repaintCont
{
IntRect r(RenderBox::rectWithOutlineForRepaint(repaintContainer, outlineWidth));
if (isAnonymousBlockContinuation())
- r.inflateY(collapsedMarginTop());
+ r.inflateY(collapsedMarginBefore()); // FIXME: This is wrong for block-flows that are horizontal.
return r;
}
@@ -5799,7 +5796,7 @@ IntRect RenderBlock::localCaretRect(InlineBox* inlineBox, int caretOffset, int*
// FIXME: why call localToAbsoluteForContent() twice here, too?
FloatPoint absRightPoint = localToAbsolute(FloatPoint(myRight, 0));
- int containerRight = containingBlock()->x() + containingBlockWidthForContent();
+ int containerRight = containingBlock()->x() + containingBlockLogicalWidthForContent();
FloatPoint absContainerPoint = localToAbsolute(FloatPoint(containerRight, 0));
*extraWidthToEndOfLine = absContainerPoint.x() - absRightPoint.x();
@@ -5820,9 +5817,11 @@ void RenderBlock::addFocusRingRects(Vector<IntRect>& rects, int tx, int ty)
// FIXME: This check really isn't accurate.
bool nextInlineHasLineBox = inlineElementContinuation()->firstLineBox();
// FIXME: This is wrong. The principal renderer may not be the continuation preceding this block.
+ // 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();
- int topMargin = prevInlineHasLineBox ? collapsedMarginTop() : 0;
- int bottomMargin = nextInlineHasLineBox ? collapsedMarginBottom() : 0;
+ int topMargin = prevInlineHasLineBox ? collapsedMarginBefore() : 0;
+ int bottomMargin = nextInlineHasLineBox ? collapsedMarginAfter() : 0;
IntRect rect(tx, ty - topMargin, width(), height() + topMargin + bottomMargin);
if (!rect.isEmpty())
rects.append(rect);
@@ -5832,8 +5831,8 @@ void RenderBlock::addFocusRingRects(Vector<IntRect>& rects, int tx, int ty)
if (!hasOverflowClip() && !hasControlClip()) {
for (RootInlineBox* curr = firstRootBox(); curr; curr = curr->nextRootBox()) {
int top = max(curr->lineTop(), curr->y());
- int bottom = min(curr->lineBottom(), curr->y() + curr->height());
- IntRect rect(tx + curr->x(), ty + top, curr->width(), bottom - top);
+ int bottom = min(curr->lineBottom(), curr->y() + curr->logicalHeight());
+ IntRect rect(tx + curr->x(), ty + top, curr->logicalWidth(), bottom - top);
if (!rect.isEmpty())
rects.append(rect);
}
@@ -5956,7 +5955,7 @@ int RenderBlock::applyAfterBreak(RenderBox* child, int yPos, MarginInfo& marginI
bool checkPageBreaks = !checkColumnBreaks && view()->layoutState()->m_pageHeight; // FIXME: Once columns can print we have to check this.
bool checkAfterAlways = (checkColumnBreaks && child->style()->columnBreakAfter() == PBALWAYS) || (checkPageBreaks && child->style()->pageBreakAfter() == PBALWAYS);
if (checkAfterAlways && inNormalFlow(child)) {
- marginInfo.setBottomQuirk(true); // Cause margins to be discarded for any following content.
+ marginInfo.setMarginAfterQuirk(true); // Cause margins to be discarded for any following content.
if (checkColumnBreaks)
view()->layoutState()->addForcedColumnBreak(yPos);
return nextPageTop(yPos);
diff --git a/WebCore/rendering/RenderBlock.h b/WebCore/rendering/RenderBlock.h
index b26c28c..0682039 100644
--- a/WebCore/rendering/RenderBlock.h
+++ b/WebCore/rendering/RenderBlock.h
@@ -102,19 +102,17 @@ public:
bool containsFloats() { return m_floatingObjects && !m_floatingObjects->isEmpty(); }
bool containsFloat(RenderObject*);
- int lineWidth(int y, bool firstLine) const;
+ int availableLogicalWidthForLine(int position, bool firstLine) const;
+ int logicalRightOffsetForLine(int position, bool firstLine) const { return logicalRightOffsetForLine(position, logicalRightOffsetForContent(), firstLine); }
+ int logicalLeftOffsetForLine(int position, bool firstLine) const { return logicalLeftOffsetForLine(position, logicalLeftOffsetForContent(), firstLine); }
virtual int lowestPosition(bool includeOverflowInterior = true, bool includeSelf = true) const;
virtual int rightmostPosition(bool includeOverflowInterior = true, bool includeSelf = true) const;
virtual int leftmostPosition(bool includeOverflowInterior = true, bool includeSelf = true) const;
-
- int rightOffset(int y, bool firstLine) const { return rightRelOffset(y, rightOffset(), firstLine); }
- int leftOffset(int y, bool firstLine) const { return leftRelOffset(y, leftOffset(), firstLine); }
-
+
virtual VisiblePosition positionForPoint(const IntPoint&);
// Block flows subclass availableWidth to handle multi column layout (shrinking the width available to children when laying out.)
- virtual int availableWidth() const; // FIXME: Should be possible to remove this. See https://bugs.webkit.org/show_bug.cgi?id=46127
virtual int availableLogicalWidth() const;
RootInlineBox* firstRootBox() const { return static_cast<RootInlineBox*>(firstLineBox()); }
@@ -196,21 +194,21 @@ protected:
}
void moveChildrenTo(RenderBlock* to, RenderObject* startChild, RenderObject* endChild, RenderObject* beforeChild, bool fullRemoveInsert = false);
- int maxTopPosMargin() const { return m_rareData ? m_rareData->m_topPos : RenderBlockRareData::topPosDefault(this); }
- int maxTopNegMargin() const { return m_rareData ? m_rareData->m_topNeg : RenderBlockRareData::topNegDefault(this); }
- int maxBottomPosMargin() const { return m_rareData ? m_rareData->m_bottomPos : RenderBlockRareData::bottomPosDefault(this); }
- int maxBottomNegMargin() const { return m_rareData ? m_rareData->m_bottomNeg : RenderBlockRareData::bottomNegDefault(this); }
+ int maxPosMarginBefore() const { return m_rareData ? m_rareData->m_beforePos : RenderBlockRareData::beforePosDefault(this); }
+ int maxNegMarginBefore() const { return m_rareData ? m_rareData->m_beforeNeg : RenderBlockRareData::beforeNegDefault(this); }
+ int maxPosMarginAfter() const { return m_rareData ? m_rareData->m_afterPos : RenderBlockRareData::afterPosDefault(this); }
+ int maxNegMarginAfter() const { return m_rareData ? m_rareData->m_afterNeg : RenderBlockRareData::afterNegDefault(this); }
- void setMaxTopMargins(int pos, int neg);
- void setMaxBottomMargins(int pos, int neg);
+ void setMaxMarginBeforeValues(int pos, int neg);
+ void setMaxMarginAfterValues(int pos, int neg);
void initMaxMarginValues()
{
if (m_rareData) {
- m_rareData->m_topPos = RenderBlockRareData::topPosDefault(this);
- m_rareData->m_topNeg = RenderBlockRareData::topNegDefault(this);
- m_rareData->m_bottomPos = RenderBlockRareData::bottomPosDefault(this);
- m_rareData->m_bottomNeg = RenderBlockRareData::bottomNegDefault(this);
+ m_rareData->m_beforePos = RenderBlockRareData::beforePosDefault(this);
+ m_rareData->m_beforeNeg = RenderBlockRareData::beforeNegDefault(this);
+ m_rareData->m_afterPos = RenderBlockRareData::afterPosDefault(this);
+ m_rareData->m_afterNeg = RenderBlockRareData::afterNegDefault(this);
m_rareData->m_paginationStrut = 0;
}
}
@@ -222,12 +220,14 @@ protected:
virtual void paint(PaintInfo&, int tx, int ty);
virtual void paintObject(PaintInfo&, int tx, int ty);
- int rightRelOffset(int y, int fixedOffset, bool applyTextIndent = true, int* heightRemaining = 0) const;
- int leftRelOffset(int y, int fixedOffset, bool applyTextIndent = true, int* heightRemaining = 0) const;
+ int logicalRightOffsetForContent() const;
+ int logicalLeftOffsetForContent() const;
+ int logicalRightOffsetForLine(int position, int fixedOffset, bool applyTextIndent = true, int* logicalHeightRemaining = 0) const;
+ int logicalLeftOffsetForLine(int position, int fixedOffset, bool applyTextIndent = true, int* logicalHeightRemaining = 0) const;
virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int x, int y, int tx, int ty, HitTestAction);
- virtual void calcPrefWidths();
+ virtual void computePreferredLogicalWidths();
virtual int firstLineBoxBaseline() const;
virtual int lastLineBoxBaseline() const;
@@ -284,8 +284,14 @@ private:
virtual bool isSelfCollapsingBlock() const;
- virtual int maxTopMargin(bool positive) const { return positive ? maxTopPosMargin() : maxTopNegMargin(); }
- virtual int maxBottomMargin(bool positive) const { return positive ? maxBottomPosMargin() : maxBottomNegMargin(); }
+ virtual int maxMarginBefore(MarginSign sign) const
+ {
+ return (sign == PositiveMargin) ? maxPosMarginBefore() : maxNegMarginBefore();
+ }
+ virtual int maxMarginAfter(MarginSign sign) const
+ {
+ return (sign == PositiveMargin) ? maxPosMarginAfter() : maxNegMarginAfter();
+ }
virtual void repaintOverhangingFloats(bool paintAllDescendants);
@@ -364,8 +370,8 @@ private:
InlineIterator findNextLineBreak(InlineBidiResolver&, bool firstLine, bool& isLineEmpty, bool& previousLineBrokeCleanly, bool& hyphenated, EClear*, FloatingObject* lastFloatFromPreviousLine);
RootInlineBox* constructLine(unsigned runCount, BidiRun* firstRun, BidiRun* lastRun, bool firstLine, bool lastLine, RenderObject* endObject);
InlineFlowBox* createLineBoxes(RenderObject*, bool firstLine);
- void computeHorizontalPositionsForLine(RootInlineBox*, bool firstLine, BidiRun* firstRun, BidiRun* trailingSpaceRun, bool reachedEnd, GlyphOverflowAndFallbackFontsMap&);
- void computeVerticalPositionsForLine(RootInlineBox*, BidiRun*, GlyphOverflowAndFallbackFontsMap&);
+ void computeInlineDirectionPositionsForLine(RootInlineBox*, bool firstLine, BidiRun* firstRun, BidiRun* trailingSpaceRun, bool reachedEnd, GlyphOverflowAndFallbackFontsMap&);
+ void computeBlockDirectionPositionsForLine(RootInlineBox*, BidiRun*, GlyphOverflowAndFallbackFontsMap&);
void deleteEllipsisLineBoxes();
void checkLinesForTextOverflow();
void addOverflowFromInlineChildren();
@@ -409,16 +415,14 @@ private:
inline int leftBottom();
inline int rightBottom();
- int rightOffset() const;
- int leftOffset() const;
virtual bool hitTestColumns(const HitTestRequest&, HitTestResult&, int x, int y, int tx, int ty, HitTestAction);
virtual bool hitTestContents(const HitTestRequest&, HitTestResult&, int x, int y, int tx, int ty, HitTestAction);
bool hitTestFloats(const HitTestRequest&, HitTestResult&, int x, int y, int tx, int ty);
virtual bool isPointInOverflowControl(HitTestResult&, int x, int y, int tx, int ty);
- void calcInlinePrefWidths();
- void calcBlockPrefWidths();
+ void computeInlinePreferredLogicalWidths();
+ void computeBlockPreferredLogicalWidths();
// Obtains the nearest enclosing block (including this block) that contributes a first-line style to our inline
// children.
@@ -496,8 +500,8 @@ private:
class MarginInfo {
// Collapsing flags for whether we can collapse our margins with our children's margins.
bool m_canCollapseWithChildren : 1;
- bool m_canCollapseTopWithChildren : 1;
- bool m_canCollapseBottomWithChildren : 1;
+ bool m_canCollapseMarginBeforeWithChildren : 1;
+ bool m_canCollapseMarginAfterWithChildren : 1;
// Whether or not we are a quirky container, i.e., do we collapse away top and bottom
// margins in our container. Table cells and the body are the common examples. We
@@ -508,30 +512,30 @@ private:
// They may or may not collapse with the top margin of the block (|m_canCollapseTopWithChildren| tells us that), but they will
// always be collapsing with one another. This variable can remain set to true through multiple iterations
// as long as we keep encountering self-collapsing blocks.
- bool m_atTopOfBlock : 1;
+ bool m_atBeforeSideOfBlock : 1;
// This flag is set when we know we're examining bottom margins and we know we're at the bottom of the block.
- bool m_atBottomOfBlock : 1;
+ bool m_atAfterSideOfBlock : 1;
// These variables are used to detect quirky margins that we need to collapse away (in table cells
// and in the body element).
- bool m_topQuirk : 1;
- bool m_bottomQuirk : 1;
- bool m_determinedTopQuirk : 1;
+ bool m_marginBeforeQuirk : 1;
+ bool m_marginAfterQuirk : 1;
+ bool m_determinedMarginBeforeQuirk : 1;
// These flags track the previous maximal positive and negative margins.
int m_posMargin;
int m_negMargin;
public:
- MarginInfo(RenderBlock* b, int top, int bottom);
+ MarginInfo(RenderBlock* b, int beforeBorderPadding, int afterBorderPadding);
- void setAtTopOfBlock(bool b) { m_atTopOfBlock = b; }
- void setAtBottomOfBlock(bool b) { m_atBottomOfBlock = b; }
+ void setAtBeforeSideOfBlock(bool b) { m_atBeforeSideOfBlock = b; }
+ void setAtAfterSideOfBlock(bool b) { m_atAfterSideOfBlock = b; }
void clearMargin() { m_posMargin = m_negMargin = 0; }
- void setTopQuirk(bool b) { m_topQuirk = b; }
- void setBottomQuirk(bool b) { m_bottomQuirk = b; }
- void setDeterminedTopQuirk(bool b) { m_determinedTopQuirk = b; }
+ void setMarginBeforeQuirk(bool b) { m_marginBeforeQuirk = b; }
+ void setMarginAfterQuirk(bool b) { m_marginAfterQuirk = b; }
+ void setDeterminedMarginBeforeQuirk(bool b) { m_determinedMarginBeforeQuirk = b; }
void setPosMargin(int p) { m_posMargin = p; }
void setNegMargin(int n) { m_negMargin = n; }
void setPosMarginIfLarger(int p) { if (p > m_posMargin) m_posMargin = p; }
@@ -539,15 +543,15 @@ private:
void setMargin(int p, int n) { m_posMargin = p; m_negMargin = n; }
- bool atTopOfBlock() const { return m_atTopOfBlock; }
- bool canCollapseWithTop() const { return m_atTopOfBlock && m_canCollapseTopWithChildren; }
- bool canCollapseWithBottom() const { return m_atBottomOfBlock && m_canCollapseBottomWithChildren; }
- bool canCollapseTopWithChildren() const { return m_canCollapseTopWithChildren; }
- bool canCollapseBottomWithChildren() const { return m_canCollapseBottomWithChildren; }
+ bool atBeforeSideOfBlock() const { return m_atBeforeSideOfBlock; }
+ bool canCollapseWithMarginBefore() const { return m_atBeforeSideOfBlock && m_canCollapseMarginBeforeWithChildren; }
+ bool canCollapseWithMarginAfter() const { return m_atAfterSideOfBlock && m_canCollapseMarginAfterWithChildren; }
+ bool canCollapseMarginBeforeWithChildren() const { return m_canCollapseMarginBeforeWithChildren; }
+ bool canCollapseMarginAfterWithChildren() const { return m_canCollapseMarginAfterWithChildren; }
bool quirkContainer() const { return m_quirkContainer; }
- bool determinedTopQuirk() const { return m_determinedTopQuirk; }
- bool topQuirk() const { return m_topQuirk; }
- bool bottomQuirk() const { return m_bottomQuirk; }
+ bool determinedMarginBeforeQuirk() const { return m_determinedMarginBeforeQuirk; }
+ bool marginBeforeQuirk() const { return m_marginBeforeQuirk; }
+ bool marginAfterQuirk() const { return m_marginAfterQuirk; }
int posMargin() const { return m_posMargin; }
int negMargin() const { return m_negMargin; }
int margin() const { return m_posMargin - m_negMargin; }
@@ -588,25 +592,38 @@ private:
// Allocated only when some of these fields have non-default values
struct RenderBlockRareData : Noncopyable {
- RenderBlockRareData(const RenderBlock* o)
- : m_topPos(topPosDefault(o))
- , m_topNeg(topNegDefault(o))
- , m_bottomPos(bottomPosDefault(o))
- , m_bottomNeg(bottomNegDefault(o))
+ RenderBlockRareData(const RenderBlock* block)
+ : m_beforePos(beforePosDefault(block))
+ , m_beforeNeg(beforeNegDefault(block))
+ , m_afterPos(afterPosDefault(block))
+ , m_afterNeg(afterNegDefault(block))
, m_paginationStrut(0)
, m_pageY(0)
{
}
- static int topPosDefault(const RenderBlock* o) { return o->marginTop() > 0 ? o->marginTop() : 0; }
- static int topNegDefault(const RenderBlock* o) { return o->marginTop() < 0 ? -o->marginTop() : 0; }
- static int bottomPosDefault(const RenderBlock* o) { return o->marginBottom() > 0 ? o->marginBottom() : 0; }
- static int bottomNegDefault(const RenderBlock* o) { return o->marginBottom() < 0 ? -o->marginBottom() : 0; }
+ static int beforePosDefault(const RenderBlock* block)
+ {
+ return std::max(block->marginBefore(), 0);
+ }
+
+ static int beforeNegDefault(const RenderBlock* block)
+ {
+ return std::max(-block->marginBefore(), 0);
+ }
+ static int afterPosDefault(const RenderBlock* block)
+ {
+ return std::max(block->marginAfter(), 0);
+ }
+ static int afterNegDefault(const RenderBlock* block)
+ {
+ return std::max(-block->marginAfter(), 0);
+ }
- int m_topPos;
- int m_topNeg;
- int m_bottomPos;
- int m_bottomNeg;
+ int m_beforePos;
+ int m_beforeNeg;
+ int m_afterPos;
+ int m_afterNeg;
int m_paginationStrut;
int m_pageY;
};
diff --git a/WebCore/rendering/RenderBlockLineLayout.cpp b/WebCore/rendering/RenderBlockLineLayout.cpp
index c43f2a8..5076450 100644
--- a/WebCore/rendering/RenderBlockLineLayout.cpp
+++ b/WebCore/rendering/RenderBlockLineLayout.cpp
@@ -86,20 +86,6 @@ static int inlineWidth(RenderObject* child, bool start = true, bool end = true)
return extraWidth;
}
-static void chopMidpointsAt(LineMidpointState& lineMidpointState, RenderObject* obj, unsigned pos)
-{
- if (!lineMidpointState.numMidpoints)
- return;
- InlineIterator* midpoints = lineMidpointState.midpoints.data();
- for (int i = lineMidpointState.numMidpoints - 1; i >= 0; i--) {
- const InlineIterator& point = midpoints[i];
- if (point.obj == obj && point.pos == pos) {
- lineMidpointState.numMidpoints = i;
- break;
- }
- }
-}
-
static void checkMidpoints(LineMidpointState& lineMidpointState, InlineIterator& lBreak)
{
// Check to see if our last midpoint is a start point beyond the line break. If so,
@@ -115,21 +101,8 @@ static void checkMidpoints(LineMidpointState& lineMidpointState, InlineIterator&
if (currpoint == lBreak) {
// We hit the line break before the start point. Shave off the start point.
lineMidpointState.numMidpoints--;
- if (endpoint.obj->style()->collapseWhiteSpace()) {
- if (endpoint.obj->isText()) {
- // Don't shave a character off the endpoint if it was from a soft hyphen.
- RenderText* textObj = toRenderText(endpoint.obj);
- if (endpoint.pos + 1 < textObj->textLength()) {
- if (textObj->characters()[endpoint.pos+1] == softHyphen)
- return;
- } else if (startpoint.obj->isText()) {
- RenderText *startText = toRenderText(startpoint.obj);
- if (startText->textLength() && startText->characters()[0] == softHyphen)
- return;
- }
- }
+ if (endpoint.obj->style()->collapseWhiteSpace())
endpoint.pos--;
- }
}
}
}
@@ -209,8 +182,8 @@ static inline InlineBox* createInlineBoxForRenderer(RenderObject* obj, bool isRo
static inline void dirtyLineBoxesForRenderer(RenderObject* o, bool fullLayout)
{
if (o->isText()) {
- if (o->prefWidthsDirty() && o->isCounter())
- toRenderText(o)->calcPrefWidths(0); // FIXME: Counters depend on this hack. No clue why. Should be investigated and removed.
+ if (o->preferredLogicalWidthsDirty() && o->isCounter())
+ toRenderText(o)->computePreferredLogicalWidths(0); // FIXME: Counters depend on this hack. No clue why. Should be investigated and removed.
toRenderText(o)->dirtyLineBoxes(fullLayout);
} else
toRenderInline(o)->dirtyLineBoxes(fullLayout);
@@ -327,11 +300,11 @@ RootInlineBox* RenderBlock::constructLine(unsigned runCount, BidiRun* firstRun,
return lastRootBox();
}
-void RenderBlock::computeHorizontalPositionsForLine(RootInlineBox* lineBox, bool firstLine, BidiRun* firstRun, BidiRun* trailingSpaceRun, bool reachedEnd, GlyphOverflowAndFallbackFontsMap& textBoxDataMap)
+void RenderBlock::computeInlineDirectionPositionsForLine(RootInlineBox* lineBox, bool firstLine, BidiRun* firstRun, BidiRun* trailingSpaceRun, bool reachedEnd, GlyphOverflowAndFallbackFontsMap& textBoxDataMap)
{
// First determine our total width.
- int availableWidth = lineWidth(height(), firstLine);
- int totWidth = lineBox->getFlowSpacingWidth();
+ int availableWidth = availableLogicalWidthForLine(height(), firstLine);
+ int totWidth = lineBox->getFlowSpacingLogicalWidth();
bool needsWordSpacing = false;
unsigned numSpaces = 0;
ETextAlign textAlign = style()->textAlign();
@@ -365,7 +338,7 @@ void RenderBlock::computeHorizontalPositionsForLine(RootInlineBox* lineBox, bool
const AtomicString& hyphenString = rt->style()->hyphenString();
hyphenWidth = rt->style(firstLine)->font().width(TextRun(hyphenString.characters(), hyphenString.length()));
}
- r->m_box->setWidth(rt->width(r->m_start, r->m_stop - r->m_start, totWidth, firstLine, &fallbackFonts, &glyphOverflow) + hyphenWidth);
+ r->m_box->setLogicalWidth(rt->width(r->m_start, r->m_stop - r->m_start, totWidth, firstLine, &fallbackFonts, &glyphOverflow) + hyphenWidth);
if (!fallbackFonts.isEmpty()) {
ASSERT(r->m_box->isText());
GlyphOverflowAndFallbackFontsMap::iterator it = textBoxDataMap.add(static_cast<InlineTextBox*>(r->m_box), make_pair(Vector<const SimpleFontData*>(), GlyphOverflow())).first;
@@ -379,19 +352,19 @@ void RenderBlock::computeHorizontalPositionsForLine(RootInlineBox* lineBox, bool
}
} else if (!r->m_object->isRenderInline()) {
RenderBox* renderBox = toRenderBox(r->m_object);
- renderBox->calcWidth();
- r->m_box->setWidth(renderBox->width());
+ renderBox->computeLogicalWidth();
+ r->m_box->setLogicalWidth(renderBox->width());
totWidth += renderBox->marginLeft() + renderBox->marginRight();
}
- totWidth += r->m_box->width();
+ totWidth += r->m_box->logicalWidth();
}
// Armed with the total width of the line (without justification),
// we now examine our text-align property in order to determine where to position the
// objects horizontally. The total width of the line can be increased if we end up
// justifying text.
- int x = leftOffset(height(), firstLine);
+ int x = logicalLeftOffsetForLine(height(), firstLine);
switch (textAlign) {
case LEFT:
case WEBKIT_LEFT:
@@ -399,10 +372,10 @@ void RenderBlock::computeHorizontalPositionsForLine(RootInlineBox* lineBox, bool
// particular with RTL blocks, wide lines should still spill out to the left.
if (style()->direction() == LTR) {
if (totWidth > availableWidth && trailingSpaceRun)
- trailingSpaceRun->m_box->setWidth(max(0, trailingSpaceRun->m_box->width() - totWidth + availableWidth));
+ trailingSpaceRun->m_box->setLogicalWidth(max(0, trailingSpaceRun->m_box->logicalWidth() - totWidth + availableWidth));
} else {
if (trailingSpaceRun)
- trailingSpaceRun->m_box->setWidth(0);
+ trailingSpaceRun->m_box->setLogicalWidth(0);
else if (totWidth > availableWidth)
x -= (totWidth - availableWidth);
}
@@ -410,8 +383,8 @@ void RenderBlock::computeHorizontalPositionsForLine(RootInlineBox* lineBox, bool
case JUSTIFY:
if (numSpaces && !reachedEnd && !lineBox->endsWithBreak()) {
if (trailingSpaceRun) {
- totWidth -= trailingSpaceRun->m_box->width();
- trailingSpaceRun->m_box->setWidth(0);
+ totWidth -= trailingSpaceRun->m_box->logicalWidth();
+ trailingSpaceRun->m_box->setLogicalWidth(0);
}
break;
}
@@ -421,7 +394,7 @@ void RenderBlock::computeHorizontalPositionsForLine(RootInlineBox* lineBox, bool
// for right to left fall through to right aligned
if (style()->direction() == LTR) {
if (totWidth > availableWidth && trailingSpaceRun)
- trailingSpaceRun->m_box->setWidth(max(0, trailingSpaceRun->m_box->width() - totWidth + availableWidth));
+ trailingSpaceRun->m_box->setLogicalWidth(max(0, trailingSpaceRun->m_box->logicalWidth() - totWidth + availableWidth));
break;
}
case RIGHT:
@@ -431,15 +404,15 @@ void RenderBlock::computeHorizontalPositionsForLine(RootInlineBox* lineBox, bool
// side of the block.
if (style()->direction() == LTR) {
if (trailingSpaceRun) {
- totWidth -= trailingSpaceRun->m_box->width();
- trailingSpaceRun->m_box->setWidth(0);
+ totWidth -= trailingSpaceRun->m_box->logicalWidth();
+ trailingSpaceRun->m_box->setLogicalWidth(0);
}
if (totWidth < availableWidth)
x += availableWidth - totWidth;
} else {
if (totWidth > availableWidth && trailingSpaceRun) {
- trailingSpaceRun->m_box->setWidth(max(0, trailingSpaceRun->m_box->width() - totWidth + availableWidth));
- totWidth -= trailingSpaceRun->m_box->width();
+ trailingSpaceRun->m_box->setLogicalWidth(max(0, trailingSpaceRun->m_box->logicalWidth() - totWidth + availableWidth));
+ totWidth -= trailingSpaceRun->m_box->logicalWidth();
} else
x += availableWidth - totWidth;
}
@@ -448,9 +421,9 @@ void RenderBlock::computeHorizontalPositionsForLine(RootInlineBox* lineBox, bool
case WEBKIT_CENTER:
int trailingSpaceWidth = 0;
if (trailingSpaceRun) {
- totWidth -= trailingSpaceRun->m_box->width();
- trailingSpaceWidth = min(trailingSpaceRun->m_box->width(), (availableWidth - totWidth + 1) / 2);
- trailingSpaceRun->m_box->setWidth(max(0, trailingSpaceWidth));
+ totWidth -= trailingSpaceRun->m_box->logicalWidth();
+ trailingSpaceWidth = min(trailingSpaceRun->m_box->logicalWidth(), (availableWidth - totWidth + 1) / 2);
+ trailingSpaceRun->m_box->setLogicalWidth(max(0, trailingSpaceWidth));
}
if (style()->direction() == LTR)
x += max((availableWidth - totWidth) / 2, 0);
@@ -492,12 +465,12 @@ void RenderBlock::computeHorizontalPositionsForLine(RootInlineBox* lineBox, bool
// The widths of all runs are now known. We can now place every inline box (and
// compute accurate widths for the inline flow boxes).
needsWordSpacing = false;
- lineBox->placeBoxesHorizontally(x, needsWordSpacing, textBoxDataMap);
+ lineBox->placeBoxesInInlineDirection(x, needsWordSpacing, textBoxDataMap);
}
-void RenderBlock::computeVerticalPositionsForLine(RootInlineBox* lineBox, BidiRun* firstRun, GlyphOverflowAndFallbackFontsMap& textBoxDataMap)
+void RenderBlock::computeBlockDirectionPositionsForLine(RootInlineBox* lineBox, BidiRun* firstRun, GlyphOverflowAndFallbackFontsMap& textBoxDataMap)
{
- setHeight(lineBox->verticallyAlignBoxes(height(), textBoxDataMap));
+ setLogicalHeight(lineBox->alignBoxesInBlockDirection(height(), textBoxDataMap));
lineBox->setBlockHeight(height());
// Now make sure we place replaced render objects correctly.
@@ -540,7 +513,7 @@ void RenderBlock::layoutInlineChildren(bool relayoutChildren, int& repaintTop, i
m_overflow.clear();
- setHeight(borderTop() + paddingTop());
+ setLogicalHeight(borderTop() + paddingTop());
int toAdd = borderBottom() + paddingBottom() + horizontalScrollbarHeight();
// Figure out if we should clear out our line boxes.
@@ -610,7 +583,7 @@ void RenderBlock::layoutInlineChildren(bool relayoutChildren, int& repaintTop, i
// If relayoutChildren is set and we have percentage padding, we also need to invalidate the child's pref widths.
if (relayoutChildren && (o->style()->paddingLeft().isPercent() || o->style()->paddingRight().isPercent()))
- o->setPrefWidthsDirty(true, false);
+ o->setPreferredLogicalWidthsDirty(true, false);
if (o->isPositioned())
o->containingBlock()->insertPositionedObject(box);
@@ -899,10 +872,10 @@ void RenderBlock::layoutInlineChildren(bool relayoutChildren, int& repaintTop, i
// Now we position all of our text runs horizontally.
if (!isSVGRootInlineBox)
- computeHorizontalPositionsForLine(lineBox, firstLine, resolver.firstRun(), trailingSpaceRun, end.atEnd(), textBoxDataMap);
+ computeInlineDirectionPositionsForLine(lineBox, firstLine, resolver.firstRun(), trailingSpaceRun, end.atEnd(), textBoxDataMap);
// Now position our text runs vertically.
- computeVerticalPositionsForLine(lineBox, resolver.firstRun(), textBoxDataMap);
+ computeBlockDirectionPositionsForLine(lineBox, resolver.firstRun(), textBoxDataMap);
#if ENABLE(SVG)
// SVG text layout code computes vertical & horizontal positions on its own.
@@ -937,22 +910,22 @@ void RenderBlock::layoutInlineChildren(bool relayoutChildren, int& repaintTop, i
int adjustment = 0;
adjustLinePositionForPagination(lineBox, adjustment);
if (adjustment) {
- int oldLineWidth = lineWidth(oldHeight, firstLine);
+ int oldLineWidth = availableLogicalWidthForLine(oldHeight, firstLine);
lineBox->adjustPosition(0, adjustment);
if (useRepaintBounds) // This can only be a positive adjustment, so no need to update repaintTop.
repaintBottom = max(repaintBottom, lineBox->bottomVisibleOverflow());
- if (lineWidth(oldHeight + adjustment, firstLine) != oldLineWidth) {
+ if (availableLogicalWidthForLine(oldHeight + adjustment, firstLine) != oldLineWidth) {
// We have to delete this line, remove all floats that got added, and let line layout re-run.
lineBox->deleteLine(renderArena());
removeFloatingObjectsBelow(lastFloatFromPreviousLine, oldHeight);
- setHeight(oldHeight + adjustment);
+ setLogicalHeight(oldHeight + adjustment);
resolver.setPosition(oldEnd);
end = oldEnd;
continue;
}
- setHeight(lineBox->blockHeight());
+ setLogicalHeight(lineBox->blockHeight());
}
}
}
@@ -1003,12 +976,12 @@ void RenderBlock::layoutInlineChildren(bool relayoutChildren, int& repaintTop, i
for (Vector<RenderBox*>::iterator f = cleanLineFloats->begin(); f != end; ++f) {
int floatTop = (*f)->y() - (*f)->marginTop();
insertFloatingObject(*f);
- setHeight(floatTop + delta);
+ setLogicalHeight(floatTop + delta);
positionNewFloats();
}
}
}
- setHeight(lastRootBox()->blockHeight());
+ setLogicalHeight(lastRootBox()->blockHeight());
} else {
// Delete all the remaining lines.
RootInlineBox* line = endLine;
@@ -1033,8 +1006,8 @@ void RenderBlock::layoutInlineChildren(bool relayoutChildren, int& repaintTop, i
m_lineBoxes.appendLineBox(trailingFloatsLineBox);
trailingFloatsLineBox->setConstructed();
GlyphOverflowAndFallbackFontsMap textBoxDataMap;
- trailingFloatsLineBox->verticallyAlignBoxes(height(), textBoxDataMap);
- trailingFloatsLineBox->setVerticalOverflowPositions(height(), bottomLayoutOverflow, height(), bottomVisualOverflow, 0);
+ trailingFloatsLineBox->alignBoxesInBlockDirection(height(), textBoxDataMap);
+ trailingFloatsLineBox->setBlockDirectionOverflowPositions(height(), bottomLayoutOverflow, height(), bottomVisualOverflow, 0);
trailingFloatsLineBox->setBlockHeight(height());
}
if (lastFloat) {
@@ -1061,10 +1034,10 @@ void RenderBlock::layoutInlineChildren(bool relayoutChildren, int& repaintTop, i
}
// Now add in the bottom border/padding.
- setHeight(height() + toAdd);
+ setLogicalHeight(height() + toAdd);
if (!firstLineBox() && hasLineIfEmpty())
- setHeight(height() + lineHeight(true, true));
+ setLogicalHeight(height() + lineHeight(true, true));
// See if we have any lines that spill out of our block. If we do, then we will possibly need to
// truncate text.
@@ -1179,7 +1152,7 @@ RootInlineBox* RenderBlock::determineStartPosition(bool& firstLine, bool& fullLa
Vector<RenderBox*>::iterator end = cleanLineFloats->end();
for (Vector<RenderBox*>::iterator f = cleanLineFloats->begin(); f != end; ++f) {
insertFloatingObject(*f);
- setHeight((*f)->y() - (*f)->marginTop());
+ setLogicalHeight((*f)->y() - (*f)->marginTop());
positionNewFloats();
ASSERT(floats[numCleanFloats].object == *f);
numCleanFloats++;
@@ -1187,7 +1160,7 @@ RootInlineBox* RenderBlock::determineStartPosition(bool& firstLine, bool& fullLa
}
line = line->nextRootBox();
}
- setHeight(savedHeight);
+ setLogicalHeight(savedHeight);
}
firstLine = !last;
@@ -1196,7 +1169,7 @@ RootInlineBox* RenderBlock::determineStartPosition(bool& firstLine, bool& fullLa
RenderObject* startObj;
int pos = 0;
if (last) {
- setHeight(last->blockHeight());
+ setLogicalHeight(last->blockHeight());
startObj = last->lineBreakObj();
pos = last->lineBreakPos();
resolver.setStatus(last->lineBreakBidiStatus());
@@ -1414,14 +1387,14 @@ void RenderBlock::skipTrailingWhitespace(InlineIterator& iterator, bool isLineEm
// A relative positioned inline encloses us. In this case, we also have to determine our
// position as though we were an inline. Set |staticX| and |staticY| on the relative positioned
// inline so that we can obtain the value later.
- toRenderInline(c)->layer()->setStaticX(style()->direction() == LTR ? leftOffset(height(), false) : rightOffset(height(), false));
+ toRenderInline(c)->layer()->setStaticX(style()->direction() == LTR ? logicalLeftOffsetForLine(height(), false) : logicalRightOffsetForLine(height(), false));
toRenderInline(c)->layer()->setStaticY(height());
}
RenderBox* box = toRenderBox(object);
if (box->style()->hasStaticX()) {
if (box->style()->isOriginalDisplayInlineType())
- box->layer()->setStaticX(style()->direction() == LTR ? leftOffset(height(), false) : width() - rightOffset(height(), false));
+ box->layer()->setStaticX(style()->direction() == LTR ? logicalLeftOffsetForLine(height(), false) : width() - logicalRightOffsetForLine(height(), false));
else
box->layer()->setStaticX(style()->direction() == LTR ? borderLeft() + paddingLeft() : borderRight() + paddingRight());
}
@@ -1436,12 +1409,12 @@ void RenderBlock::skipTrailingWhitespace(InlineIterator& iterator, bool isLineEm
int RenderBlock::skipLeadingWhitespace(InlineBidiResolver& resolver, bool firstLine, bool isLineEmpty, bool previousLineBrokeCleanly,
FloatingObject* lastFloatFromPreviousLine)
{
- int availableWidth = lineWidth(height(), firstLine);
+ int availableWidth = availableLogicalWidthForLine(height(), firstLine);
while (!resolver.position().atEnd() && !requiresLineBox(resolver.position(), isLineEmpty, previousLineBrokeCleanly)) {
RenderObject* object = resolver.position().obj;
if (object->isFloating()) {
positionNewFloatOnLine(insertFloatingObject(toRenderBox(object)), lastFloatFromPreviousLine);
- availableWidth = lineWidth(height(), firstLine);
+ availableWidth = availableLogicalWidthForLine(height(), firstLine);
} else if (object->isPositioned()) {
// FIXME: The math here is actually not really right. It's a best-guess approximation that
// will work for the common cases
@@ -1450,14 +1423,14 @@ int RenderBlock::skipLeadingWhitespace(InlineBidiResolver& resolver, bool firstL
// A relative positioned inline encloses us. In this case, we also have to determine our
// position as though we were an inline. Set |staticX| and |staticY| on the relative positioned
// inline so that we can obtain the value later.
- toRenderInline(c)->layer()->setStaticX(style()->direction() == LTR ? leftOffset(height(), firstLine) : rightOffset(height(), firstLine));
+ toRenderInline(c)->layer()->setStaticX(style()->direction() == LTR ? logicalLeftOffsetForLine(height(), firstLine) : logicalRightOffsetForLine(height(), firstLine));
toRenderInline(c)->layer()->setStaticY(height());
}
RenderBox* box = toRenderBox(object);
if (box->style()->hasStaticX()) {
if (box->style()->isOriginalDisplayInlineType())
- box->layer()->setStaticX(style()->direction() == LTR ? leftOffset(height(), firstLine) : width() - rightOffset(height(), firstLine));
+ box->layer()->setStaticX(style()->direction() == LTR ? logicalLeftOffsetForLine(height(), firstLine) : width() - logicalRightOffsetForLine(height(), firstLine));
else
box->layer()->setStaticX(style()->direction() == LTR ? borderLeft() + paddingLeft() : borderRight() + paddingRight());
}
@@ -1500,14 +1473,14 @@ void RenderBlock::fitBelowFloats(int widthToFit, bool firstLine, int& availableW
if (!floatBottom)
break;
- newLineWidth = lineWidth(floatBottom, firstLine);
+ newLineWidth = availableLogicalWidthForLine(floatBottom, firstLine);
lastFloatBottom = floatBottom;
if (newLineWidth >= widthToFit)
break;
}
if (newLineWidth > availableWidth) {
- setHeight(lastFloatBottom);
+ setLogicalHeight(lastFloatBottom);
availableWidth = newLineWidth;
}
}
@@ -1650,7 +1623,7 @@ InlineIterator RenderBlock::findNextLineBreak(InlineBidiResolver& resolver, bool
// it after moving to next line (in newLine() func)
if (floatsFitOnLine && floatBox->width() + floatBox->marginLeft() + floatBox->marginRight() + w + tmpW <= width) {
positionNewFloatOnLine(f, lastFloatFromPreviousLine);
- width = lineWidth(height(), firstLine);
+ width = availableLogicalWidthForLine(height(), firstLine);
} else
floatsFitOnLine = false;
} else if (o->isPositioned()) {
@@ -1790,6 +1763,7 @@ InlineIterator RenderBlock::findNextLineBreak(InlineBidiResolver& resolver, bool
bool breakWords = o->style()->breakWords() && ((autoWrap && !w) || currWS == PRE);
bool midWordBreak = false;
bool breakAll = o->style()->wordBreak() == BreakAllWordBreak && autoWrap;
+ int hyphenWidth = 0;
if (t->isWordBreak()) {
w += tmpW;
@@ -1808,48 +1782,13 @@ InlineIterator RenderBlock::findNextLineBreak(InlineBidiResolver& resolver, bool
if (!collapseWhiteSpace || !currentCharacterIsSpace)
isLineEmpty = false;
-
- // Check for soft hyphens. Go ahead and ignore them.
- if (c == softHyphen) {
- if (!ignoringSpaces) {
- // Ignore soft hyphens
- InlineIterator beforeSoftHyphen;
- if (pos)
- beforeSoftHyphen = InlineIterator(0, o, pos - 1);
- else
- beforeSoftHyphen = InlineIterator(0, last, last->isText() ? toRenderText(last)->textLength() - 1 : 0);
- // Two consecutive soft hyphens. Avoid overlapping midpoints.
- if (lineMidpointState.numMidpoints && lineMidpointState.midpoints[lineMidpointState.numMidpoints - 1].obj == o &&
- lineMidpointState.midpoints[lineMidpointState.numMidpoints - 1].pos == pos)
- lineMidpointState.numMidpoints--;
- else
- addMidpoint(lineMidpointState, beforeSoftHyphen);
-
- // Add the width up to but not including the hyphen.
- tmpW += textWidth(t, lastSpace, pos - lastSpace, f, w + tmpW, isFixedPitch, collapseWhiteSpace) + lastSpaceWordSpacing;
-
- // For wrapping text only, include the hyphen. We need to ensure it will fit
- // on the line if it shows when we break.
- if (autoWrap)
- tmpW += textWidth(t, pos, 1, f, w + tmpW, isFixedPitch, collapseWhiteSpace);
-
- InlineIterator afterSoftHyphen(0, o, pos);
- afterSoftHyphen.increment();
- addMidpoint(lineMidpointState, afterSoftHyphen);
- }
- pos++;
- len--;
- lastSpaceWordSpacing = 0;
- lastSpace = pos; // Cheesy hack to prevent adding in widths of the run twice.
- if (style->hyphens() == HyphensNone) {
- // Prevent a line break at the soft hyphen by ensuring that betweenWords is false
- // in the next iteration.
- atStart = true;
- }
- continue;
+ if (c == softHyphen && autoWrap && !hyphenWidth && style->hyphens() != HyphensNone) {
+ const AtomicString& hyphenString = style->hyphenString();
+ hyphenWidth = f.width(TextRun(hyphenString.characters(), hyphenString.length()));
+ tmpW += hyphenWidth;
}
-
+
#if ENABLE(SVG)
if (isSVGText) {
RenderSVGInlineText* svgInlineText = static_cast<RenderSVGInlineText*>(t);
@@ -1872,8 +1811,8 @@ InlineIterator RenderBlock::findNextLineBreak(InlineBidiResolver& resolver, bool
midWordBreak = w + wrapW + charWidth > width;
}
- bool betweenWords = c == '\n' || (currWS != PRE && !atStart && isBreakable(str, pos, strlen, nextBreakable, breakNBSP));
-
+ bool betweenWords = c == '\n' || (currWS != PRE && !atStart && isBreakable(str, pos, strlen, nextBreakable, breakNBSP) && (style->hyphens() != HyphensNone || (pos && str[pos - 1] != softHyphen)));
+
if (betweenWords || midWordBreak) {
bool stoppedIgnoringSpaces = false;
if (ignoringSpaces) {
@@ -1943,13 +1882,17 @@ InlineIterator RenderBlock::findNextLineBreak(InlineBidiResolver& resolver, bool
lBreak.increment();
previousLineBrokeCleanly = true;
}
+ if (lBreak.obj && lBreak.pos && lBreak.obj->isText() && toRenderText(lBreak.obj)->textLength() && toRenderText(lBreak.obj)->characters()[lBreak.pos - 1] == softHyphen && style->hyphens() != HyphensNone)
+ hyphenated = true;
goto end; // Didn't fit. Jump to the end.
} else {
if (!betweenWords || (midWordBreak && !autoWrap))
tmpW -= additionalTmpW;
- if (pos > 0 && str[pos-1] == softHyphen)
+ if (hyphenWidth) {
// Subtract the width of the soft hyphen out since we fit on a line.
- tmpW -= textWidth(t, pos - 1, 1, f, w + tmpW, isFixedPitch, collapseWhiteSpace);
+ tmpW -= hyphenWidth;
+ hyphenWidth = 0;
+ }
}
}
@@ -2194,14 +2137,6 @@ InlineIterator RenderBlock::findNextLineBreak(InlineBidiResolver& resolver, bool
lBreak.increment();
}
- if (lBreak.obj && lBreak.pos >= 2 && lBreak.obj->isText()) {
- // For soft hyphens on line breaks, we have to chop out the midpoints that made us
- // ignore the hyphen so that it will render at the end of the line.
- UChar c = toRenderText(lBreak.obj)->characters()[lBreak.pos - 1];
- if (c == softHyphen)
- chopMidpointsAt(lineMidpointState, lBreak.obj, lBreak.pos - 2);
- }
-
return lBreak;
}
@@ -2237,9 +2172,9 @@ void RenderBlock::checkLinesForTextOverflow()
// Include the scrollbar for overflow blocks, which means we want to use "contentWidth()"
bool ltr = style()->direction() == LTR;
for (RootInlineBox* curr = firstRootBox(); curr; curr = curr->nextRootBox()) {
- int blockRightEdge = rightOffset(curr->y(), curr == firstRootBox());
- int blockLeftEdge = leftOffset(curr->y(), curr == firstRootBox());
- int lineBoxEdge = ltr ? curr->x() + curr->width() : curr->x();
+ int blockRightEdge = logicalRightOffsetForLine(curr->y(), curr == firstRootBox());
+ int blockLeftEdge = logicalLeftOffsetForLine(curr->y(), curr == firstRootBox());
+ int lineBoxEdge = ltr ? curr->x() + curr->logicalWidth() : curr->x();
if ((ltr && lineBoxEdge > blockRightEdge) || (!ltr && lineBoxEdge < blockLeftEdge)) {
// This line spills out of our box in the appropriate direction. Now we need to see if the line
// can be truncated. In order for truncation to be possible, the line must have sufficient space to
diff --git a/WebCore/rendering/RenderBox.cpp b/WebCore/rendering/RenderBox.cpp
index 33772a3..553be53 100644
--- a/WebCore/rendering/RenderBox.cpp
+++ b/WebCore/rendering/RenderBox.cpp
@@ -75,8 +75,8 @@ RenderBox::RenderBox(Node* node)
, m_marginRight(0)
, m_marginTop(0)
, m_marginBottom(0)
- , m_minPrefWidth(-1)
- , m_maxPrefWidth(-1)
+ , m_minPreferredLogicalWidth(-1)
+ , m_maxPreferredLogicalWidth(-1)
, m_inlineBoxWrapper(0)
#ifdef ANDROID_LAYOUT
, m_visibleWidth(0)
@@ -90,6 +90,158 @@ RenderBox::~RenderBox()
{
}
+int RenderBox::marginBefore() const
+{
+ return marginBeforeUsing(style());
+}
+
+int RenderBox::marginBeforeUsing(const RenderStyle* s) const
+{
+ switch (s->blockFlow()) {
+ case TopToBottomBlockFlow:
+ return m_marginTop;
+ case BottomToTopBlockFlow:
+ return m_marginBottom;
+ case LeftToRightBlockFlow:
+ return m_marginLeft;
+ case RightToLeftBlockFlow:
+ return m_marginRight;
+ }
+ ASSERT_NOT_REACHED();
+ return m_marginTop;
+}
+
+int RenderBox::marginAfter() const
+{
+ return marginAfterUsing(style());
+}
+
+int RenderBox::marginAfterUsing(const RenderStyle* s) const
+{
+ switch (s->blockFlow()) {
+ case TopToBottomBlockFlow:
+ return m_marginBottom;
+ case BottomToTopBlockFlow:
+ return m_marginTop;
+ case LeftToRightBlockFlow:
+ return m_marginRight;
+ case RightToLeftBlockFlow:
+ return m_marginLeft;
+ }
+ ASSERT_NOT_REACHED();
+ return m_marginBottom;
+}
+
+int RenderBox::marginStart() const
+{
+ return marginStartUsing(style());
+}
+
+int RenderBox::marginStartUsing(const RenderStyle* s) const
+{
+ if (s->isVerticalBlockFlow())
+ return s->direction() == LTR ? m_marginLeft : m_marginRight;
+ return s->direction() == LTR ? m_marginTop : m_marginBottom;
+}
+
+int RenderBox::marginEnd() const
+{
+ return marginEndUsing(style());
+}
+
+int RenderBox::marginEndUsing(const RenderStyle* s) const
+{
+ if (s->isVerticalBlockFlow())
+ return s->direction() == LTR ? m_marginRight : m_marginLeft;
+ return s->direction() == LTR ? m_marginBottom : m_marginTop;
+}
+
+void RenderBox::setMarginStart(int margin)
+{
+ setMarginStartUsing(style(), margin);
+}
+
+void RenderBox::setMarginEnd(int margin)
+{
+ setMarginEndUsing(style(), margin);
+}
+
+void RenderBox::setMarginStartUsing(const RenderStyle* s, int margin)
+{
+ if (s->isVerticalBlockFlow()) {
+ if (s->direction() == LTR)
+ m_marginLeft = margin;
+ else
+ m_marginRight = margin;
+ } else {
+ if (s->direction() == LTR)
+ m_marginTop = margin;
+ else
+ m_marginBottom = margin;
+ }
+}
+
+void RenderBox::setMarginEndUsing(const RenderStyle* s, int margin)
+{
+ if (s->isVerticalBlockFlow()) {
+ if (s->direction() == LTR)
+ m_marginRight = margin;
+ else
+ m_marginLeft = margin;
+ } else {
+ if (s->direction() == LTR)
+ m_marginBottom = margin;
+ else
+ m_marginTop = margin;
+ }
+}
+
+void RenderBox::setMarginBefore(int margin)
+{
+ setMarginBeforeUsing(style(), margin);
+}
+
+void RenderBox::setMarginAfter(int margin)
+{
+ setMarginAfterUsing(style(), margin);
+}
+
+void RenderBox::setMarginBeforeUsing(const RenderStyle* s, int margin)
+{
+ switch (s->blockFlow()) {
+ case TopToBottomBlockFlow:
+ m_marginTop = margin;
+ break;
+ case BottomToTopBlockFlow:
+ m_marginBottom = margin;
+ break;
+ case LeftToRightBlockFlow:
+ m_marginLeft = margin;
+ break;
+ case RightToLeftBlockFlow:
+ m_marginRight = margin;
+ break;
+ }
+}
+
+void RenderBox::setMarginAfterUsing(const RenderStyle* s, int margin)
+{
+ switch (s->blockFlow()) {
+ case TopToBottomBlockFlow:
+ m_marginBottom = margin;
+ break;
+ case BottomToTopBlockFlow:
+ m_marginTop = margin;
+ break;
+ case LeftToRightBlockFlow:
+ m_marginRight = margin;
+ break;
+ case RightToLeftBlockFlow:
+ m_marginLeft = margin;
+ break;
+ }
+}
+
void RenderBox::destroy()
{
// A lot of the code in this function is just pasted into
@@ -195,6 +347,12 @@ void RenderBox::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle
// Set the text color if we're the body.
if (isBody())
document()->setTextColor(style()->visitedDependentColor(CSSPropertyColor));
+ else if (oldStyle && isRoot() && oldStyle->blockFlow() != style()->blockFlow()) {
+ // Propagate the new block flow up to the RenderView.
+ RenderView* viewRenderer = view();
+ viewRenderer->style()->setBlockFlow(style()->blockFlow());
+ viewRenderer->setNeedsLayoutAndPrefWidthsRecalc();
+ }
}
void RenderBox::updateBoxModelInfoFromStyle()
@@ -468,20 +626,20 @@ void RenderBox::panScroll(const IntPoint& source)
layer()->panScrollFromPoint(source);
}
-int RenderBox::minPrefWidth() const
+int RenderBox::minPreferredLogicalWidth() const
{
- if (prefWidthsDirty())
- const_cast<RenderBox*>(this)->calcPrefWidths();
+ if (preferredLogicalWidthsDirty())
+ const_cast<RenderBox*>(this)->computePreferredLogicalWidths();
- return m_minPrefWidth;
+ return m_minPreferredLogicalWidth;
}
-int RenderBox::maxPrefWidth() const
+int RenderBox::maxPreferredLogicalWidth() const
{
- if (prefWidthsDirty())
- const_cast<RenderBox*>(this)->calcPrefWidths();
+ if (preferredLogicalWidthsDirty())
+ const_cast<RenderBox*>(this)->computePreferredLogicalWidths();
- return m_maxPrefWidth;
+ return m_maxPreferredLogicalWidth;
}
int RenderBox::overrideSize() const
@@ -516,33 +674,33 @@ int RenderBox::overrideHeight() const
return hasOverrideSize() ? overrideSize() : height();
}
-int RenderBox::calcBorderBoxWidth(int width) const
+int RenderBox::computeBorderBoxLogicalWidth(int width) const
{
- int bordersPlusPadding = borderAndPaddingWidth();
+ int bordersPlusPadding = borderAndPaddingLogicalWidth();
if (style()->boxSizing() == CONTENT_BOX)
return width + bordersPlusPadding;
return max(width, bordersPlusPadding);
}
-int RenderBox::calcBorderBoxHeight(int height) const
+int RenderBox::computeBorderBoxLogicalHeight(int height) const
{
- int bordersPlusPadding = borderAndPaddingHeight();
+ int bordersPlusPadding = borderAndPaddingLogicalHeight();
if (style()->boxSizing() == CONTENT_BOX)
return height + bordersPlusPadding;
return max(height, bordersPlusPadding);
}
-int RenderBox::calcContentBoxWidth(int width) const
+int RenderBox::computeContentBoxLogicalWidth(int width) const
{
if (style()->boxSizing() == BORDER_BOX)
- width -= borderAndPaddingWidth();
+ width -= borderAndPaddingLogicalWidth();
return max(0, width);
}
-int RenderBox::calcContentBoxHeight(int height) const
+int RenderBox::computeContentBoxLogicalHeight(int height) const
{
if (style()->boxSizing() == BORDER_BOX)
- height -= borderAndPaddingHeight();
+ height -= borderAndPaddingLogicalHeight();
return max(0, height);
}
@@ -858,7 +1016,7 @@ void RenderBox::paintCustomHighlight(int tx, int ty, const AtomicString& type, b
InlineBox* boxWrap = inlineBoxWrapper();
RootInlineBox* r = boxWrap ? boxWrap->root() : 0;
if (r) {
- FloatRect rootRect(tx + r->x(), ty + r->selectionTop(), r->width(), r->selectionHeight());
+ FloatRect rootRect(tx + r->x(), ty + r->selectionTop(), r->logicalWidth(), r->selectionHeight());
FloatRect imageRect(tx + x(), rootRect.y(), width(), rootRect.height());
page->chrome()->client()->paintCustomHighlight(node(), type, imageRect, rootRect, behindText, false);
} else {
@@ -964,12 +1122,30 @@ IntRect RenderBox::clipRect(int tx, int ty)
return IntRect(clipX, clipY, clipWidth, clipHeight);
}
-int RenderBox::containingBlockWidthForContent() const
+int RenderBox::containingBlockLogicalWidthForContent() const
{
RenderBlock* cb = containingBlock();
if (shrinkToAvoidFloats())
- return cb->lineWidth(y(), false);
- return cb->availableWidth();
+ return cb->availableLogicalWidthForLine(y(), false);
+ return cb->availableLogicalWidth();
+}
+
+int RenderBox::perpendicularContainingBlockLogicalHeight() const
+{
+ RenderBlock* cb = containingBlock();
+ RenderStyle* containingBlockStyle = cb->style();
+ Length logicalHeightLength = containingBlockStyle->logicalHeight();
+
+ // FIXME: For now just support fixed heights. Eventually should support percentage heights as well.
+ if (!logicalHeightLength.isFixed()) {
+ // Rather than making the child be completely unconstrained, WinIE uses the viewport width and height
+ // as a constraint. We do that for now as well even though it's likely being unconstrained is what the spec
+ // will decide.
+ return containingBlockStyle->isVerticalBlockFlow() ? view()->frameView()->visibleHeight() : view()->frameView()->visibleWidth();
+ }
+
+ // Use the content box logical height as specified by the style.
+ return cb->computeContentBoxLogicalHeight(logicalHeightLength.value());
}
void RenderBox::mapLocalToContainer(RenderBoxModelObject* repaintContainer, bool fixed, bool useTransforms, TransformState& transformState) const
@@ -1276,6 +1452,7 @@ void RenderBox::repaintDuringLayoutIfMoved(const IntRect& rect)
}
}
+<<<<<<< HEAD
#ifdef ANDROID_LAYOUT
void RenderBox::setVisibleWidth(int newWidth) {
const Settings* settings = document()->settings();
@@ -1298,6 +1475,9 @@ bool RenderBox::checkAndSetRelayoutChildren(bool* relayoutChildren) {
#endif
void RenderBox::calcWidth()
+=======
+void RenderBox::computeLogicalWidth()
+>>>>>>> webkit.org at r68651
{
#ifdef ANDROID_LAYOUT
if (view()->frameView())
@@ -1305,36 +1485,44 @@ void RenderBox::calcWidth()
#endif
if (isPositioned()) {
- calcAbsoluteHorizontal();
+ // FIXME: This calculation is not patched for block-flow yet.
+ // https://bugs.webkit.org/show_bug.cgi?id=46500
+ computePositionedLogicalWidth();
return;
}
- // If layout is limited to a subtree, the subtree root's width does not change.
+ // If layout is limited to a subtree, the subtree root's logical width does not change.
if (node() && view()->frameView() && view()->frameView()->layoutRoot(true) == this)
return;
// The parent box is flexing us, so it has increased or decreased our
// width. Use the width from the style context.
+ // FIXME: Account for block-flow in flexible boxes.
+ // https://bugs.webkit.org/show_bug.cgi?id=46418
if (hasOverrideSize() && parent()->style()->boxOrient() == HORIZONTAL
&& parent()->isFlexibleBox() && parent()->isFlexingChildren()) {
- setWidth(overrideSize());
+ setLogicalWidth(overrideSize());
return;
}
+ // FIXME: Account for block-flow in flexible boxes.
+ // https://bugs.webkit.org/show_bug.cgi?id=46418
bool inVerticalBox = parent()->isFlexibleBox() && (parent()->style()->boxOrient() == VERTICAL);
bool stretching = (parent()->style()->boxAlign() == BSTRETCH);
- bool treatAsReplaced = shouldCalculateSizeAsReplaced() && (!inVerticalBox || !stretching);
+ bool treatAsReplaced = shouldComputeSizeAsReplaced() && (!inVerticalBox || !stretching);
- Length w = (treatAsReplaced) ? Length(calcReplacedWidth(), Fixed) : style()->width();
+ Length logicalWidthLength = (treatAsReplaced) ? Length(computeReplacedWidth(), Fixed) : style()->logicalWidth();
RenderBlock* cb = containingBlock();
- int containerWidth = max(0, containingBlockWidthForContent());
-
- Length marginLeft = style()->marginLeft();
- Length marginRight = style()->marginRight();
-
+ int containerLogicalWidth = max(0, containingBlockLogicalWidthForContent());
+ bool hasPerpendicularContainingBlock = cb->style()->isVerticalBlockFlow() != style()->isVerticalBlockFlow();
+ int containerWidthInInlineDirection = containerLogicalWidth;
+ if (hasPerpendicularContainingBlock)
+ containerWidthInInlineDirection = perpendicularContainingBlockLogicalHeight();
+
if (isInline() && !isInlineBlockOrInlineTable()) {
// just calculate margins
+<<<<<<< HEAD
m_marginLeft = marginLeft.calcMinValue(containerWidth);
m_marginRight = marginRight.calcMinValue(containerWidth);
#ifdef ANDROID_LAYOUT
@@ -1355,38 +1543,46 @@ void RenderBox::calcWidth()
}
}
#endif
+=======
+ setMarginStart(style()->marginStart().calcMinValue(containerLogicalWidth));
+ setMarginEnd(style()->marginEnd().calcMinValue(containerLogicalWidth));
+ if (treatAsReplaced)
+ setLogicalWidth(max(logicalWidthLength.value() + borderAndPaddingLogicalWidth(), minPreferredLogicalWidth()));
+>>>>>>> webkit.org at r68651
return;
}
// Width calculations
if (treatAsReplaced)
- setWidth(w.value() + borderAndPaddingWidth());
+ setLogicalWidth(logicalWidthLength.value() + borderAndPaddingLogicalWidth());
else {
- // Calculate Width
- setWidth(calcWidthUsing(Width, containerWidth));
-
- // Calculate MaxWidth
- if (!style()->maxWidth().isUndefined()) {
- int maxW = calcWidthUsing(MaxWidth, containerWidth);
- if (width() > maxW) {
- setWidth(maxW);
- w = style()->maxWidth();
+ // Calculate LogicalWidth
+ setLogicalWidth(computeLogicalWidthUsing(LogicalWidth, containerWidthInInlineDirection));
+
+ // Calculate MaxLogicalWidth
+ if (!style()->logicalMaxWidth().isUndefined()) {
+ int maxLogicalWidth = computeLogicalWidthUsing(MaxLogicalWidth, containerWidthInInlineDirection);
+ if (logicalWidth() > maxLogicalWidth) {
+ setLogicalWidth(maxLogicalWidth);
+ logicalWidthLength = style()->logicalMaxWidth();
}
}
- // Calculate MinWidth
- int minW = calcWidthUsing(MinWidth, containerWidth);
- if (width() < minW) {
- setWidth(minW);
- w = style()->minWidth();
+ // Calculate MinLogicalWidth
+ int minLogicalWidth = computeLogicalWidthUsing(MinLogicalWidth, containerWidthInInlineDirection);
+ if (logicalWidth() < minLogicalWidth) {
+ setLogicalWidth(minLogicalWidth);
+ logicalWidthLength = style()->logicalMinWidth();
}
}
- if (stretchesToMinIntrinsicWidth()) {
- setWidth(max(width(), minPrefWidth()));
- w = Length(width(), Fixed);
+ // Fieldsets are currently the only objects that stretch to their minimum width.
+ if (stretchesToMinIntrinsicLogicalWidth()) {
+ setLogicalWidth(max(logicalWidth(), minPreferredLogicalWidth()));
+ logicalWidthLength = Length(logicalWidth(), Fixed);
}
+<<<<<<< HEAD
// Margin calculations
if (w.isAuto()) {
m_marginLeft = marginLeft.calcMinValue(containerWidth);
@@ -1411,44 +1607,48 @@ void RenderBox::calcWidth()
setWidth(width() -(m_marginLeft + m_marginRight));
}
#endif
+=======
+ // Margin calculations.
+ if (logicalWidthLength.isAuto() || hasPerpendicularContainingBlock || isFloating() || isInline()) {
+ setMarginStart(style()->marginStart().calcMinValue(containerLogicalWidth));
+ setMarginEnd(style()->marginEnd().calcMinValue(containerLogicalWidth));
+ } else
+ computeInlineDirectionMargins(cb, containerLogicalWidth, logicalWidth());
+>>>>>>> webkit.org at r68651
- if (containerWidth && containerWidth != (width() + m_marginLeft + m_marginRight)
- && !isFloating() && !isInline() && !cb->isFlexibleBox()) {
- if (cb->style()->direction() == LTR)
- m_marginRight = containerWidth - width() - m_marginLeft;
- else
- m_marginLeft = containerWidth - width() - m_marginRight;
- }
+ if (!hasPerpendicularContainingBlock && containerLogicalWidth && containerLogicalWidth != (logicalWidth() + marginStart() + marginEnd())
+ && !isFloating() && !isInline() && !cb->isFlexibleBox())
+ setMarginEndUsing(cb->style(), containerLogicalWidth - logicalWidth() - marginStartUsing(cb->style()));
}
-int RenderBox::calcWidthUsing(WidthType widthType, int cw)
+int RenderBox::computeLogicalWidthUsing(LogicalWidthType widthType, int availableLogicalWidth)
{
- int widthResult = width();
- Length w;
- if (widthType == Width)
- w = style()->width();
- else if (widthType == MinWidth)
- w = style()->minWidth();
+ int logicalWidthResult = logicalWidth();
+ Length logicalWidth;
+ if (widthType == LogicalWidth)
+ logicalWidth = style()->logicalWidth();
+ else if (widthType == MinLogicalWidth)
+ logicalWidth = style()->logicalMinWidth();
else
- w = style()->maxWidth();
+ logicalWidth = style()->logicalMaxWidth();
- if (w.isIntrinsicOrAuto()) {
- int marginLeft = style()->marginLeft().calcMinValue(cw);
- int marginRight = style()->marginRight().calcMinValue(cw);
- if (cw)
- widthResult = cw - marginLeft - marginRight;
+ if (logicalWidth.isIntrinsicOrAuto()) {
+ int marginStart = style()->marginStart().calcMinValue(availableLogicalWidth);
+ int marginEnd = style()->marginEnd().calcMinValue(availableLogicalWidth);
+ if (availableLogicalWidth)
+ logicalWidthResult = availableLogicalWidth - marginStart - marginEnd;
- if (sizesToIntrinsicWidth(widthType)) {
- widthResult = max(widthResult, minPrefWidth());
- widthResult = min(widthResult, maxPrefWidth());
+ if (sizesToIntrinsicLogicalWidth(widthType)) {
+ logicalWidthResult = max(logicalWidthResult, minPreferredLogicalWidth());
+ logicalWidthResult = min(logicalWidthResult, maxPreferredLogicalWidth());
}
- } else
- widthResult = calcBorderBoxWidth(w.calcValue(cw));
+ } else // FIXME: If the containing block flow is perpendicular to our direction we need to use the available logical height instead.
+ logicalWidthResult = computeBorderBoxLogicalWidth(logicalWidth.calcValue(availableLogicalWidth));
- return widthResult;
+ return logicalWidthResult;
}
-bool RenderBox::sizesToIntrinsicWidth(WidthType widthType) const
+bool RenderBox::sizesToIntrinsicLogicalWidth(LogicalWidthType widthType) const
{
// Marquees in WinIE are like a mixture of blocks and inline-blocks. They size as though they're blocks,
// but they allow text to sit on the same line as the marquee.
@@ -1457,12 +1657,15 @@ bool RenderBox::sizesToIntrinsicWidth(WidthType widthType) const
// This code may look a bit strange. Basically width:intrinsic should clamp the size when testing both
// min-width and width. max-width is only clamped if it is also intrinsic.
- Length width = (widthType == MaxWidth) ? style()->maxWidth() : style()->width();
- if (width.type() == Intrinsic)
+ Length logicalWidth = (widthType == MaxLogicalWidth) ? style()->logicalMaxWidth() : style()->logicalWidth();
+ if (logicalWidth.type() == Intrinsic)
return true;
// Children of a horizontal marquee do not fill the container by default.
// FIXME: Need to deal with MAUTO value properly. It could be vertical.
+ // FIXME: Think about block-flow here. Need to find out how marquee direction relates to
+ // block-flow (as well as how marquee overflow should relate to block flow).
+ // https://bugs.webkit.org/show_bug.cgi?id=46472
if (parent()->style()->overflowX() == OMARQUEE) {
EMarqueeDirection dir = parent()->style()->marqueeDirection();
if (dir == MAUTO || dir == MFORWARD || dir == MBACKWARD || dir == MLEFT || dir == MRIGHT)
@@ -1471,6 +1674,8 @@ bool RenderBox::sizesToIntrinsicWidth(WidthType widthType) const
// Flexible horizontal boxes lay out children at their intrinsic widths. Also vertical boxes
// that don't stretch their kids lay out their children at their intrinsic widths.
+ // FIXME: Think about block-flow here.
+ // https://bugs.webkit.org/show_bug.cgi?id=46473
if (parent()->isFlexibleBox()
&& (parent()->style()->boxOrient() == HORIZONTAL || parent()->style()->boxAlign() != BSTRETCH))
return true;
@@ -1478,82 +1683,108 @@ bool RenderBox::sizesToIntrinsicWidth(WidthType widthType) const
// Button, input, select, textarea, legend and datagrid treat
// width value of 'auto' as 'intrinsic' unless it's in a
// stretching vertical flexbox.
- if (width.type() == Auto && !(parent()->isFlexibleBox() && parent()->style()->boxOrient() == VERTICAL && parent()->style()->boxAlign() == BSTRETCH) && node() && (node()->hasTagName(inputTag) || node()->hasTagName(selectTag) || node()->hasTagName(buttonTag) || node()->hasTagName(textareaTag) || node()->hasTagName(legendTag) || node()->hasTagName(datagridTag)))
+ // FIXME: Think about block-flow here.
+ // https://bugs.webkit.org/show_bug.cgi?id=46473
+ if (logicalWidth.type() == Auto && !(parent()->isFlexibleBox() && parent()->style()->boxOrient() == VERTICAL && parent()->style()->boxAlign() == BSTRETCH) && node() && (node()->hasTagName(inputTag) || node()->hasTagName(selectTag) || node()->hasTagName(buttonTag) || node()->hasTagName(textareaTag) || node()->hasTagName(legendTag) || node()->hasTagName(datagridTag)))
return true;
return false;
}
-void RenderBox::calcHorizontalMargins(const Length& marginLeft, const Length& marginRight, int containerWidth)
+void RenderBox::computeInlineDirectionMargins(RenderBlock* containingBlock, int containerWidth, int childWidth)
{
- if (isFloating() || isInline()) {
- // Inline blocks/tables and floats don't have their margins increased.
- m_marginLeft = marginLeft.calcMinValue(containerWidth);
- m_marginRight = marginRight.calcMinValue(containerWidth);
+ const RenderStyle* containingBlockStyle = containingBlock->style();
+ Length marginStartLength = style()->marginStartUsing(containingBlockStyle);
+ Length marginEndLength = style()->marginEndUsing(containingBlockStyle);
+
+ // Case One: The object is being centered in the containing block's available logical width.
+ if ((marginStartLength.isAuto() && marginEndLength.isAuto() && childWidth < containerWidth)
+ || (!marginStartLength.isAuto() && !marginEndLength.isAuto() && containingBlock->style()->textAlign() == WEBKIT_CENTER)) {
+ setMarginStartUsing(containingBlockStyle, max(0, (containerWidth - childWidth) / 2));
+ setMarginEndUsing(containingBlockStyle, containerWidth - childWidth - marginStartUsing(containingBlockStyle));
return;
- }
-
- if ((marginLeft.isAuto() && marginRight.isAuto() && width() < containerWidth)
- || (!marginLeft.isAuto() && !marginRight.isAuto() && containingBlock()->style()->textAlign() == WEBKIT_CENTER)) {
- m_marginLeft = max(0, (containerWidth - width()) / 2);
- m_marginRight = containerWidth - width() - m_marginLeft;
- } else if ((marginRight.isAuto() && width() < containerWidth)
- || (!marginLeft.isAuto() && containingBlock()->style()->direction() == RTL && containingBlock()->style()->textAlign() == WEBKIT_LEFT)) {
- m_marginLeft = marginLeft.calcValue(containerWidth);
- m_marginRight = containerWidth - width() - m_marginLeft;
- } else if ((marginLeft.isAuto() && width() < containerWidth)
- || (!marginRight.isAuto() && containingBlock()->style()->direction() == LTR && containingBlock()->style()->textAlign() == WEBKIT_RIGHT)) {
- m_marginRight = marginRight.calcValue(containerWidth);
- m_marginLeft = containerWidth - width() - m_marginRight;
- } else {
- // This makes auto margins 0 if we failed a width() < containerWidth test above (css2.1, 10.3.3).
- m_marginLeft = marginLeft.calcMinValue(containerWidth);
- m_marginRight = marginRight.calcMinValue(containerWidth);
- }
+ }
+
+ // Case Two: The object is being pushed to the start of the containing block's available logical width.
+ if (marginEndLength.isAuto() && childWidth < containerWidth) {
+ setMarginStartUsing(containingBlockStyle, marginStartLength.calcValue(containerWidth));
+ setMarginEndUsing(containingBlockStyle, containerWidth - childWidth - marginStartUsing(containingBlockStyle));
+ return;
+ }
+
+ // Case Three: The object is being pushed to the end of the containing block's available logical width.
+ bool pushToEndFromTextAlign = !marginEndLength.isAuto() && ((containingBlockStyle->direction() == RTL && containingBlockStyle->textAlign() == WEBKIT_LEFT)
+ || (containingBlockStyle->direction() == LTR && containingBlockStyle->textAlign() == WEBKIT_RIGHT));
+ if ((marginStartLength.isAuto() && childWidth < containerWidth) || pushToEndFromTextAlign) {
+ setMarginEndUsing(containingBlockStyle, marginEndLength.calcValue(containerWidth));
+ setMarginStartUsing(containingBlockStyle, containerWidth - childWidth - marginEndUsing(containingBlockStyle));
+ return;
+ }
+
+ // Case Four: Either no auto margins, or our width is >= the container width (css2.1, 10.3.3). In that case
+ // auto margins will just turn into 0.
+ setMarginStartUsing(containingBlockStyle, marginStartLength.calcMinValue(containerWidth));
+ setMarginEndUsing(containingBlockStyle, marginEndLength.calcMinValue(containerWidth));
}
-void RenderBox::calcHeight()
+void RenderBox::computeLogicalHeight()
{
// Cell height is managed by the table and inline non-replaced elements do not support a height property.
if (isTableCell() || (isInline() && !isReplaced()))
return;
Length h;
- if (isPositioned())
- calcAbsoluteVertical();
- else {
- calcVerticalMargins();
+ if (isPositioned()) {
+ // FIXME: This calculation is not patched for block-flow yet.
+ // https://bugs.webkit.org/show_bug.cgi?id=46500
+ computePositionedLogicalHeight();
+ } else {
+ RenderBlock* cb = containingBlock();
+ bool hasPerpendicularContainingBlock = cb->style()->isVerticalBlockFlow() != style()->isVerticalBlockFlow();
+
+ if (!hasPerpendicularContainingBlock)
+ computeBlockDirectionMargins(cb);
// For tables, calculate margins only.
- if (isTable())
+ if (isTable()) {
+ if (hasPerpendicularContainingBlock)
+ computeInlineDirectionMargins(cb, containingBlockLogicalWidthForContent(), logicalHeight());
return;
+ }
+ // FIXME: Account for block-flow in flexible boxes.
+ // https://bugs.webkit.org/show_bug.cgi?id=46418
bool inHorizontalBox = parent()->isFlexibleBox() && parent()->style()->boxOrient() == HORIZONTAL;
bool stretching = parent()->style()->boxAlign() == BSTRETCH;
- bool treatAsReplaced = shouldCalculateSizeAsReplaced() && (!inHorizontalBox || !stretching);
+ bool treatAsReplaced = shouldComputeSizeAsReplaced() && (!inHorizontalBox || !stretching);
bool checkMinMaxHeight = false;
// The parent box is flexing us, so it has increased or decreased our height. We have to
// grab our cached flexible height.
+ // FIXME: Account for block-flow in flexible boxes.
+ // https://bugs.webkit.org/show_bug.cgi?id=46418
if (hasOverrideSize() && parent()->isFlexibleBox() && parent()->style()->boxOrient() == VERTICAL
&& parent()->isFlexingChildren())
- h = Length(overrideSize() - borderAndPaddingHeight(), Fixed);
+ h = Length(overrideSize() - borderAndPaddingLogicalHeight(), Fixed);
else if (treatAsReplaced)
- h = Length(calcReplacedHeight(), Fixed);
+ h = Length(computeReplacedHeight(), Fixed);
else {
- h = style()->height();
+ h = style()->logicalHeight();
checkMinMaxHeight = true;
}
// Block children of horizontal flexible boxes fill the height of the box.
+ // FIXME: Account for block-flow in flexible boxes.
+ // https://bugs.webkit.org/show_bug.cgi?id=46418
if (h.isAuto() && parent()->isFlexibleBox() && parent()->style()->boxOrient() == HORIZONTAL
&& parent()->isStretchingChildren()) {
- h = Length(parentBox()->contentHeight() - marginTop() - marginBottom() - borderAndPaddingHeight(), Fixed);
+ h = Length(parentBox()->contentLogicalHeight() - marginBefore() - marginAfter() - borderAndPaddingLogicalHeight(), Fixed);
checkMinMaxHeight = false;
}
int heightResult;
if (checkMinMaxHeight) {
+<<<<<<< HEAD
#ifdef ANDROID_LAYOUT
// in SSR mode, ignore CSS height as layout is so different
if (document()->settings()->layoutAlgorithm() == Settings::kLayoutSSR)
@@ -1561,10 +1792,13 @@ void RenderBox::calcHeight()
else
#endif
heightResult = calcHeightUsing(style()->height());
+=======
+ heightResult = computeLogicalHeightUsing(style()->logicalHeight());
+>>>>>>> webkit.org at r68651
if (heightResult == -1)
- heightResult = height();
- int minH = calcHeightUsing(style()->minHeight()); // Leave as -1 if unset.
- int maxH = style()->maxHeight().isUndefined() ? heightResult : calcHeightUsing(style()->maxHeight());
+ heightResult = logicalHeight();
+ int minH = computeLogicalHeightUsing(style()->logicalMinHeight()); // Leave as -1 if unset.
+ int maxH = style()->logicalMaxHeight().isUndefined() ? heightResult : computeLogicalHeightUsing(style()->logicalMaxHeight());
if (maxH == -1)
maxH = heightResult;
heightResult = min(maxH, heightResult);
@@ -1573,10 +1807,13 @@ void RenderBox::calcHeight()
// The only times we don't check min/max height are when a fixed length has
// been given as an override. Just use that. The value has already been adjusted
// for box-sizing.
- heightResult = h.value() + borderAndPaddingHeight();
+ heightResult = h.value() + borderAndPaddingLogicalHeight();
}
- setHeight(heightResult);
+ setLogicalHeight(heightResult);
+
+ if (hasPerpendicularContainingBlock)
+ computeInlineDirectionMargins(cb, containingBlockLogicalWidthForContent(), heightResult);
}
// WinIE quirk: The <html> block always fills the entire canvas in quirks mode. The <body> always fills the
@@ -1585,36 +1822,46 @@ void RenderBox::calcHeight()
// height since we don't set a height in RenderView when we're printing. So without this quirk, the
// height has nothing to be a percentage of, and it ends up being 0. That is bad.
bool paginatedContentNeedsBaseHeight = document()->printing() && h.isPercent()
- && (isRoot() || (isBody() && document()->documentElement()->renderer()->style()->height().isPercent()));
+ && (isRoot() || (isBody() && document()->documentElement()->renderer()->style()->logicalHeight().isPercent()));
if (stretchesToViewHeight() || paginatedContentNeedsBaseHeight) {
- int margins = collapsedMarginTop() + collapsedMarginBottom();
- int visHeight = document()->printing() ? view()->pageHeight() : view()->viewHeight();
+ // FIXME: Finish accounting for block flow here.
+ // https://bugs.webkit.org/show_bug.cgi?id=46603
+ int margins = collapsedMarginBefore() + collapsedMarginAfter();
+ int visHeight;
+ if (document()->printing())
+ visHeight = static_cast<int>(view()->pageHeight());
+ else {
+ if (style()->isVerticalBlockFlow())
+ visHeight = view()->viewHeight();
+ else
+ visHeight = view()->viewWidth();
+ }
if (isRoot())
- setHeight(max(height(), visHeight - margins));
+ setLogicalHeight(max(logicalHeight(), visHeight - margins));
else {
- int marginsBordersPadding = margins + parentBox()->marginTop() + parentBox()->marginBottom() + parentBox()->borderAndPaddingHeight();
- setHeight(max(height(), visHeight - marginsBordersPadding));
+ int marginsBordersPadding = margins + parentBox()->marginBefore() + parentBox()->marginAfter() + parentBox()->borderAndPaddingLogicalHeight();
+ setLogicalHeight(max(logicalHeight(), visHeight - marginsBordersPadding));
}
}
}
-int RenderBox::calcHeightUsing(const Length& h)
+int RenderBox::computeLogicalHeightUsing(const Length& h)
{
- int height = -1;
+ int logicalHeight = -1;
if (!h.isAuto()) {
if (h.isFixed())
- height = h.value();
+ logicalHeight = h.value();
else if (h.isPercent())
- height = calcPercentageHeight(h);
- if (height != -1) {
- height = calcBorderBoxHeight(height);
- return height;
+ logicalHeight = computePercentageLogicalHeight(h);
+ if (logicalHeight != -1) {
+ logicalHeight = computeBorderBoxLogicalHeight(logicalHeight);
+ return logicalHeight;
}
}
- return height;
+ return logicalHeight;
}
-int RenderBox::calcPercentageHeight(const Length& height)
+int RenderBox::computePercentageLogicalHeight(const Length& height)
{
int result = -1;
bool skippedAutoHeightContainingBlock = false;
@@ -1624,7 +1871,7 @@ int RenderBox::calcPercentageHeight(const Length& height)
// block that may have a specified height and then use it. In strict mode, this violates the
// specification, which states that percentage heights just revert to auto if the containing
// block has an auto height.
- while (!cb->isRenderView() && !cb->isBody() && !cb->isTableCell() && !cb->isPositioned() && cb->style()->height().isAuto()) {
+ while (!cb->isRenderView() && !cb->isBody() && !cb->isTableCell() && !cb->isPositioned() && cb->style()->logicalHeight().isAuto()) {
skippedAutoHeightContainingBlock = true;
cb = cb->containingBlock();
cb->addPercentHeightDescendant(this);
@@ -1633,7 +1880,9 @@ int RenderBox::calcPercentageHeight(const Length& height)
// A positioned element that specified both top/bottom or that specifies height should be treated as though it has a height
// explicitly specified that can be used for any percentage computations.
- bool isPositionedWithSpecifiedHeight = cb->isPositioned() && (!cb->style()->height().isAuto() || (!cb->style()->top().isAuto() && !cb->style()->bottom().isAuto()));
+ // FIXME: We can't just check top/bottom here.
+ // https://bugs.webkit.org/show_bug.cgi?id=46500
+ bool isPositionedWithSpecifiedHeight = cb->isPositioned() && (!cb->style()->logicalHeight().isAuto() || (!cb->style()->top().isAuto() && !cb->style()->bottom().isAuto()));
bool includeBorderPadding = isTable();
@@ -1652,7 +1901,7 @@ int RenderBox::calcPercentageHeight(const Length& height)
// to grow to fill the space. This could end up being wrong in some cases, but it is
// preferable to the alternative (sizing intrinsically and making the row end up too big).
RenderTableCell* cell = toRenderTableCell(cb);
- if (scrollsOverflowY() && (!cell->style()->height().isAuto() || !cell->table()->style()->height().isAuto()))
+ if (scrollsOverflowY() && (!cell->style()->logicalHeight().isAuto() || !cell->table()->style()->logicalHeight().isAuto()))
return 0;
return -1;
}
@@ -1661,24 +1910,24 @@ int RenderBox::calcPercentageHeight(const Length& height)
}
// Otherwise we only use our percentage height if our containing block had a specified
// height.
- else if (cb->style()->height().isFixed())
- result = cb->calcContentBoxHeight(cb->style()->height().value());
- else if (cb->style()->height().isPercent() && !isPositionedWithSpecifiedHeight) {
+ else if (cb->style()->logicalHeight().isFixed())
+ result = cb->computeContentBoxLogicalHeight(cb->style()->logicalHeight().value());
+ else if (cb->style()->logicalHeight().isPercent() && !isPositionedWithSpecifiedHeight) {
// We need to recur and compute the percentage height for our containing block.
- result = cb->calcPercentageHeight(cb->style()->height());
+ result = cb->computePercentageLogicalHeight(cb->style()->logicalHeight());
if (result != -1)
- result = cb->calcContentBoxHeight(result);
+ result = cb->computeContentBoxLogicalHeight(result);
} else if (cb->isRenderView() || (cb->isBody() && document()->inQuirksMode()) || isPositionedWithSpecifiedHeight) {
// Don't allow this to affect the block' height() member variable, since this
// can get called while the block is still laying out its kids.
- int oldHeight = cb->height();
- cb->calcHeight();
- result = cb->contentHeight();
- cb->setHeight(oldHeight);
+ int oldHeight = cb->logicalHeight();
+ cb->computeLogicalHeight();
+ result = cb->contentLogicalHeight();
+ cb->setLogicalHeight(oldHeight);
} else if (cb->isRoot() && isPositioned())
// Match the positioned objects behavior, which is that positioned objects will fill their viewport
- // always. Note we could only hit this case by recurring into calcPercentageHeight on a positioned containing block.
- result = cb->calcContentBoxHeight(cb->availableHeight());
+ // always. Note we could only hit this case by recurring into computePercentageLogicalHeight on a positioned containing block.
+ result = cb->computeContentBoxLogicalHeight(cb->availableLogicalHeight());
if (result != -1) {
result = height.calcValue(result);
@@ -1686,31 +1935,34 @@ int RenderBox::calcPercentageHeight(const Length& height)
// It is necessary to use the border-box to match WinIE's broken
// box model. This is essential for sizing inside
// table cells using percentage heights.
- result -= borderAndPaddingHeight();
+ result -= borderAndPaddingLogicalHeight();
result = max(0, result);
}
}
return result;
}
-int RenderBox::calcReplacedWidth(bool includeMaxWidth) const
+int RenderBox::computeReplacedWidth(bool includeMaxWidth) const
{
- int width = calcReplacedWidthUsing(style()->width());
- int minW = calcReplacedWidthUsing(style()->minWidth());
- int maxW = !includeMaxWidth || style()->maxWidth().isUndefined() ? width : calcReplacedWidthUsing(style()->maxWidth());
+ int width = computeReplacedWidthUsing(style()->width());
+ int minW = computeReplacedWidthUsing(style()->minWidth());
+ int maxW = !includeMaxWidth || style()->maxWidth().isUndefined() ? width : computeReplacedWidthUsing(style()->maxWidth());
return max(minW, min(width, maxW));
}
-int RenderBox::calcReplacedWidthUsing(Length width) const
+int RenderBox::computeReplacedWidthUsing(Length width) const
{
switch (width.type()) {
case Fixed:
- return calcContentBoxWidth(width.value());
+ return computeContentBoxLogicalWidth(width.value());
case Percent: {
- const int cw = isPositioned() ? containingBlockWidthForPositioned(toRenderBoxModelObject(container())) : containingBlockWidthForContent();
+ // FIXME: containingBlockLogicalWidthForContent() is wrong if the replaced element's block-flow is perpendicular to the
+ // containing block's block-flow.
+ // https://bugs.webkit.org/show_bug.cgi?id=46496
+ const int cw = isPositioned() ? containingBlockWidthForPositioned(toRenderBoxModelObject(container())) : containingBlockLogicalWidthForContent();
if (cw > 0)
- return calcContentBoxWidth(width.calcMinValue(cw));
+ return computeContentBoxLogicalWidth(width.calcMinValue(cw));
}
// fall through
default:
@@ -1718,20 +1970,20 @@ int RenderBox::calcReplacedWidthUsing(Length width) const
}
}
-int RenderBox::calcReplacedHeight() const
+int RenderBox::computeReplacedHeight() const
{
- int height = calcReplacedHeightUsing(style()->height());
- int minH = calcReplacedHeightUsing(style()->minHeight());
- int maxH = style()->maxHeight().isUndefined() ? height : calcReplacedHeightUsing(style()->maxHeight());
+ int height = computeReplacedHeightUsing(style()->height());
+ int minH = computeReplacedHeightUsing(style()->minHeight());
+ int maxH = style()->maxHeight().isUndefined() ? height : computeReplacedHeightUsing(style()->maxHeight());
return max(minH, min(height, maxH));
}
-int RenderBox::calcReplacedHeightUsing(Length height) const
+int RenderBox::computeReplacedHeightUsing(Length height) const
{
switch (height.type()) {
case Fixed:
- return calcContentBoxHeight(height.value());
+ return computeContentBoxLogicalHeight(height.value());
case Percent:
{
RenderObject* cb = isPositioned() ? container() : containingBlock();
@@ -1744,13 +1996,13 @@ int RenderBox::calcReplacedHeightUsing(Length height) const
ASSERT(cb->isRenderBlock());
RenderBlock* block = toRenderBlock(cb);
int oldHeight = block->height();
- block->calcHeight();
- int newHeight = block->calcContentBoxHeight(block->contentHeight());
+ block->computeLogicalHeight();
+ int newHeight = block->computeContentBoxLogicalHeight(block->contentHeight());
block->setHeight(oldHeight);
- return calcContentBoxHeight(height.calcValue(newHeight));
+ return computeContentBoxLogicalHeight(height.calcValue(newHeight));
}
- int availableHeight = isPositioned() ? containingBlockHeightForPositioned(toRenderBoxModelObject(cb)) : toRenderBox(cb)->availableHeight();
+ int availableHeight = isPositioned() ? containingBlockHeightForPositioned(toRenderBoxModelObject(cb)) : toRenderBox(cb)->availableLogicalHeight();
// It is necessary to use the border-box to match WinIE's broken
// box model. This is essential for sizing inside
@@ -1762,68 +2014,66 @@ int RenderBox::calcReplacedHeightUsing(Length height) const
return height.calcValue(availableHeight - borderAndPaddingHeight());
}
- return calcContentBoxHeight(height.calcValue(availableHeight));
+ return computeContentBoxLogicalHeight(height.calcValue(availableHeight));
}
default:
return intrinsicSize().height();
}
}
-int RenderBox::availableHeight() const
+int RenderBox::availableLogicalHeight() const
{
- return availableHeightUsing(style()->height());
+ return availableLogicalHeightUsing(style()->logicalHeight());
}
-int RenderBox::availableHeightUsing(const Length& h) const
+int RenderBox::availableLogicalHeightUsing(const Length& h) const
{
if (h.isFixed())
- return calcContentBoxHeight(h.value());
+ return computeContentBoxLogicalHeight(h.value());
if (isRenderView())
- return toRenderView(this)->frameView()->visibleHeight();
+ return style()->isVerticalBlockFlow() ? toRenderView(this)->frameView()->visibleHeight() : toRenderView(this)->frameView()->visibleWidth();
// We need to stop here, since we don't want to increase the height of the table
// artificially. We're going to rely on this cell getting expanded to some new
// height, and then when we lay out again we'll use the calculation below.
if (isTableCell() && (h.isAuto() || h.isPercent()))
- return overrideSize() - borderAndPaddingWidth();
+ return overrideSize() - borderAndPaddingLogicalWidth();
if (h.isPercent())
- return calcContentBoxHeight(h.calcValue(containingBlock()->availableHeight()));
+ return computeContentBoxLogicalHeight(h.calcValue(containingBlock()->availableLogicalHeight()));
+ // FIXME: We can't just check top/bottom here.
+ // https://bugs.webkit.org/show_bug.cgi?id=46500
if (isRenderBlock() && isPositioned() && style()->height().isAuto() && !(style()->top().isAuto() || style()->bottom().isAuto())) {
RenderBlock* block = const_cast<RenderBlock*>(toRenderBlock(this));
- int oldHeight = block->height();
- block->calcHeight();
- int newHeight = block->calcContentBoxHeight(block->contentHeight());
- block->setHeight(oldHeight);
- return calcContentBoxHeight(newHeight);
+ int oldHeight = block->logicalHeight();
+ block->computeLogicalHeight();
+ int newHeight = block->computeContentBoxLogicalHeight(block->contentLogicalHeight());
+ block->setLogicalHeight(oldHeight);
+ return computeContentBoxLogicalHeight(newHeight);
}
- return containingBlock()->availableHeight();
-}
-
-int RenderBox::availableLogicalWidth() const
-{
- if (style()->isVerticalBlockFlow())
- return contentWidth();
- return contentHeight();
+ return containingBlock()->availableLogicalHeight();
}
-void RenderBox::calcVerticalMargins()
+void RenderBox::computeBlockDirectionMargins(RenderBlock* containingBlock)
{
if (isTableCell()) {
- m_marginTop = 0;
- m_marginBottom = 0;
+ // FIXME: Not right if we allow cells to have different directionality than the table. If we do allow this, though,
+ // we may just do it with an extra anonymous block inside the cell.
+ setMarginBefore(0);
+ setMarginAfter(0);
return;
}
- // margins are calculated with respect to the _width_ of
+ // Margins are calculated with respect to the logical width of
// the containing block (8.3)
- int cw = containingBlock()->contentWidth();
+ int cw = containingBlockLogicalWidthForContent();
- m_marginTop = style()->marginTop().calcMinValue(cw);
- m_marginBottom = style()->marginBottom().calcMinValue(cw);
+ RenderStyle* containingBlockStyle = containingBlock->style();
+ setMarginBeforeUsing(containingBlockStyle, style()->marginBeforeUsing(containingBlockStyle).calcMinValue(cw));
+ setMarginAfterUsing(containingBlockStyle, style()->marginAfterUsing(containingBlockStyle).calcMinValue(cw));
}
int RenderBox::containingBlockWidthForPositioned(const RenderBoxModelObject* containingBlock) const
@@ -1846,11 +2096,11 @@ int RenderBox::containingBlockWidthForPositioned(const RenderBoxModelObject* con
int fromLeft;
int fromRight;
if (containingBlock->style()->direction() == LTR) {
- fromLeft = first->x() + first->borderLeft();
- fromRight = last->x() + last->width() - last->borderRight();
+ fromLeft = first->logicalLeft() + first->borderLogicalLeft();
+ fromRight = last->logicalLeft() + last->logicalWidth() - last->borderLogicalRight();
} else {
- fromRight = first->x() + first->width() - first->borderRight();
- fromLeft = last->x() + last->borderLeft();
+ fromRight = first->logicalLeft() + first->logicalWidth() - first->borderLogicalRight();
+ fromLeft = last->logicalLeft() + last->borderLogicalLeft();
}
return max(0, (fromRight - fromLeft));
@@ -1868,10 +2118,10 @@ int RenderBox::containingBlockHeightForPositioned(const RenderBoxModelObject* co
return heightResult - containingBlock->borderTop() - containingBlock->borderBottom();
}
-void RenderBox::calcAbsoluteHorizontal()
+void RenderBox::computePositionedLogicalWidth()
{
if (isReplaced()) {
- calcAbsoluteHorizontalReplaced();
+ computePositionedLogicalWidthReplaced();
return;
}
@@ -1881,8 +2131,8 @@ void RenderBox::calcAbsoluteHorizontal()
// was previously done in calculating the static distances, or ourself, which
// was also previously done for deciding what to override when you had
// over-constrained margins? Also note that the container block is used
- // in similar situations in other parts of the RenderBox class (see calcWidth()
- // and calcHorizontalMargins()). For now we are using the parent for quirks
+ // in similar situations in other parts of the RenderBox class (see computeLogicalWidth()
+ // and computeMarginsInContainingBlockInlineDirection()). For now we are using the parent for quirks
// mode and the containing block for strict mode.
// FIXME 2: Should we still deal with these the cases of 'left' or 'right' having
@@ -1896,7 +2146,7 @@ void RenderBox::calcAbsoluteHorizontal()
// The following is based off of the W3C Working Draft from April 11, 2006 of
// CSS 2.1: Section 10.3.7 "Absolutely positioned, non-replaced elements"
// <http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-width>
- // (block-style-comments in this function and in calcAbsoluteHorizontalValues()
+ // (block-style-comments in this function and in computePositionedLogicalWidthUsing()
// correspond to text from the spec)
@@ -1968,7 +2218,7 @@ void RenderBox::calcAbsoluteHorizontal()
// Calculate constraint equation values for 'width' case.
int widthResult;
int xResult;
- calcAbsoluteHorizontalValues(style()->width(), containerBlock, containerDirection,
+ computePositionedLogicalWidthUsing(style()->width(), containerBlock, containerDirection,
containerWidth, bordersPlusPadding,
left, right, marginLeft, marginRight,
widthResult, m_marginLeft, m_marginRight, xResult);
@@ -1982,7 +2232,7 @@ void RenderBox::calcAbsoluteHorizontal()
int maxMarginRight;
int maxXPos;
- calcAbsoluteHorizontalValues(style()->maxWidth(), containerBlock, containerDirection,
+ computePositionedLogicalWidthUsing(style()->maxWidth(), containerBlock, containerDirection,
containerWidth, bordersPlusPadding,
left, right, marginLeft, marginRight,
maxWidth, maxMarginLeft, maxMarginRight, maxXPos);
@@ -2002,7 +2252,7 @@ void RenderBox::calcAbsoluteHorizontal()
int minMarginRight;
int minXPos;
- calcAbsoluteHorizontalValues(style()->minWidth(), containerBlock, containerDirection,
+ computePositionedLogicalWidthUsing(style()->minWidth(), containerBlock, containerDirection,
containerWidth, bordersPlusPadding,
left, right, marginLeft, marginRight,
minWidth, minMarginLeft, minMarginRight, minXPos);
@@ -2015,8 +2265,8 @@ void RenderBox::calcAbsoluteHorizontal()
}
}
- if (stretchesToMinIntrinsicWidth() && width() < minPrefWidth() - bordersPlusPadding) {
- calcAbsoluteHorizontalValues(Length(minPrefWidth() - bordersPlusPadding, Fixed), containerBlock, containerDirection,
+ if (stretchesToMinIntrinsicLogicalWidth() && width() < minPreferredLogicalWidth() - bordersPlusPadding) {
+ computePositionedLogicalWidthUsing(Length(minPreferredLogicalWidth() - bordersPlusPadding, Fixed), containerBlock, containerDirection,
containerWidth, bordersPlusPadding,
left, right, marginLeft, marginRight,
widthResult, m_marginLeft, m_marginRight, xResult);
@@ -2028,7 +2278,7 @@ void RenderBox::calcAbsoluteHorizontal()
setWidth(width() + bordersPlusPadding);
}
-void RenderBox::calcAbsoluteHorizontalValues(Length width, const RenderBoxModelObject* containerBlock, TextDirection containerDirection,
+void RenderBox::computePositionedLogicalWidthUsing(Length width, const RenderBoxModelObject* containerBlock, TextDirection containerDirection,
const int containerWidth, const int bordersPlusPadding,
const Length left, const Length right, const Length marginLeft, const Length marginRight,
int& widthValue, int& marginLeftValue, int& marginRightValue, int& xPos)
@@ -2060,7 +2310,7 @@ void RenderBox::calcAbsoluteHorizontalValues(Length width, const RenderBoxModelO
// case because the value is not used for any further calculations.
leftValue = left.calcValue(containerWidth);
- widthValue = calcContentBoxWidth(width.calcValue(containerWidth));
+ widthValue = computeContentBoxLogicalWidth(width.calcValue(containerWidth));
const int availableSpace = containerWidth - (leftValue + widthValue + right.calcValue(containerWidth) + bordersPlusPadding);
@@ -2152,8 +2402,8 @@ void RenderBox::calcAbsoluteHorizontalValues(Length width, const RenderBoxModelO
int rightValue = right.calcValue(containerWidth);
// FIXME: would it be better to have shrink-to-fit in one step?
- int preferredWidth = maxPrefWidth() - bordersPlusPadding;
- int preferredMinWidth = minPrefWidth() - bordersPlusPadding;
+ int preferredWidth = maxPreferredLogicalWidth() - bordersPlusPadding;
+ int preferredMinWidth = minPreferredLogicalWidth() - bordersPlusPadding;
int availableWidth = availableSpace - rightValue;
widthValue = min(max(preferredMinWidth, availableWidth), preferredWidth);
leftValue = availableSpace - (widthValue + rightValue);
@@ -2162,13 +2412,13 @@ void RenderBox::calcAbsoluteHorizontalValues(Length width, const RenderBoxModelO
leftValue = left.calcValue(containerWidth);
// FIXME: would it be better to have shrink-to-fit in one step?
- int preferredWidth = maxPrefWidth() - bordersPlusPadding;
- int preferredMinWidth = minPrefWidth() - bordersPlusPadding;
+ int preferredWidth = maxPreferredLogicalWidth() - bordersPlusPadding;
+ int preferredMinWidth = minPreferredLogicalWidth() - bordersPlusPadding;
int availableWidth = availableSpace - leftValue;
widthValue = min(max(preferredMinWidth, availableWidth), preferredWidth);
} else if (leftIsAuto && !width.isAuto() && !rightIsAuto) {
// RULE 4: (solve for left)
- widthValue = calcContentBoxWidth(width.calcValue(containerWidth));
+ widthValue = computeContentBoxLogicalWidth(width.calcValue(containerWidth));
leftValue = availableSpace - (widthValue + right.calcValue(containerWidth));
} else if (!leftIsAuto && widthIsAuto && !rightIsAuto) {
// RULE 5: (solve for width)
@@ -2177,7 +2427,7 @@ void RenderBox::calcAbsoluteHorizontalValues(Length width, const RenderBoxModelO
} else if (!leftIsAuto&& !widthIsAuto && rightIsAuto) {
// RULE 6: (no need solve for right)
leftValue = left.calcValue(containerWidth);
- widthValue = calcContentBoxWidth(width.calcValue(containerWidth));
+ widthValue = computeContentBoxLogicalWidth(width.calcValue(containerWidth));
}
}
@@ -2192,7 +2442,7 @@ void RenderBox::calcAbsoluteHorizontalValues(Length width, const RenderBoxModelO
InlineFlowBox* firstLine = flow->firstLineBox();
InlineFlowBox* lastLine = flow->lastLineBox();
if (firstLine && lastLine && firstLine != lastLine) {
- xPos = leftValue + marginLeftValue + lastLine->borderLeft() + (lastLine->x() - firstLine->x());
+ xPos = leftValue + marginLeftValue + lastLine->borderLogicalLeft() + (lastLine->x() - firstLine->x());
return;
}
}
@@ -2200,17 +2450,17 @@ void RenderBox::calcAbsoluteHorizontalValues(Length width, const RenderBoxModelO
xPos = leftValue + marginLeftValue + containerBlock->borderLeft();
}
-void RenderBox::calcAbsoluteVertical()
+void RenderBox::computePositionedLogicalHeight()
{
if (isReplaced()) {
- calcAbsoluteVerticalReplaced();
+ computePositionedLogicalHeightReplaced();
return;
}
// The following is based off of the W3C Working Draft from April 11, 2006 of
// CSS 2.1: Section 10.6.4 "Absolutely positioned, non-replaced elements"
// <http://www.w3.org/TR/2005/WD-CSS21-20050613/visudet.html#abs-non-replaced-height>
- // (block-style-comments in this function and in calcAbsoluteVerticalValues()
+ // (block-style-comments in this function and in computePositionedLogicalHeightUsing()
// correspond to text from the spec)
@@ -2259,7 +2509,7 @@ void RenderBox::calcAbsoluteVertical()
int y;
// Calculate constraint equation values for 'height' case.
- calcAbsoluteVerticalValues(style()->height(), containerBlock, containerHeight, bordersPlusPadding,
+ computePositionedLogicalHeightUsing(style()->height(), containerBlock, containerHeight, bordersPlusPadding,
top, bottom, marginTop, marginBottom,
h, m_marginTop, m_marginBottom, y);
setY(y);
@@ -2274,7 +2524,7 @@ void RenderBox::calcAbsoluteVertical()
int maxMarginBottom;
int maxYPos;
- calcAbsoluteVerticalValues(style()->maxHeight(), containerBlock, containerHeight, bordersPlusPadding,
+ computePositionedLogicalHeightUsing(style()->maxHeight(), containerBlock, containerHeight, bordersPlusPadding,
top, bottom, marginTop, marginBottom,
maxHeight, maxMarginTop, maxMarginBottom, maxYPos);
@@ -2293,7 +2543,7 @@ void RenderBox::calcAbsoluteVertical()
int minMarginBottom;
int minYPos;
- calcAbsoluteVerticalValues(style()->minHeight(), containerBlock, containerHeight, bordersPlusPadding,
+ computePositionedLogicalHeightUsing(style()->minHeight(), containerBlock, containerHeight, bordersPlusPadding,
top, bottom, marginTop, marginBottom,
minHeight, minMarginTop, minMarginBottom, minYPos);
@@ -2309,13 +2559,13 @@ void RenderBox::calcAbsoluteVertical()
setHeight(h + bordersPlusPadding);
}
-void RenderBox::calcAbsoluteVerticalValues(Length h, const RenderBoxModelObject* containerBlock,
+void RenderBox::computePositionedLogicalHeightUsing(Length h, const RenderBoxModelObject* containerBlock,
const int containerHeight, const int bordersPlusPadding,
const Length top, const Length bottom, const Length marginTop, const Length marginBottom,
int& heightValue, int& marginTopValue, int& marginBottomValue, int& yPos)
{
// 'top' and 'bottom' cannot both be 'auto' because 'top would of been
- // converted to the static position in calcAbsoluteVertical()
+ // converted to the static position in computePositionedLogicalHeight()
ASSERT(!(top.isAuto() && bottom.isAuto()));
int contentHeight = height() - bordersPlusPadding;
@@ -2344,7 +2594,7 @@ void RenderBox::calcAbsoluteVerticalValues(Length h, const RenderBoxModelObject*
// NOTE: It is not necessary to solve for 'bottom' in the over constrained
// case because the value is not used for any further calculations.
- heightValue = calcContentBoxHeight(h.calcValue(containerHeight));
+ heightValue = computeContentBoxLogicalHeight(h.calcValue(containerHeight));
topValue = top.calcValue(containerHeight);
const int availableSpace = containerHeight - (topValue + heightValue + bottom.calcValue(containerHeight) + bordersPlusPadding);
@@ -2411,7 +2661,7 @@ void RenderBox::calcAbsoluteVerticalValues(Length h, const RenderBoxModelObject*
heightValue = contentHeight;
} else if (topIsAuto && !heightIsAuto && !bottomIsAuto) {
// RULE 4: (solve of top)
- heightValue = calcContentBoxHeight(h.calcValue(containerHeight));
+ heightValue = computeContentBoxLogicalHeight(h.calcValue(containerHeight));
topValue = availableSpace - (heightValue + bottom.calcValue(containerHeight));
} else if (!topIsAuto && heightIsAuto && !bottomIsAuto) {
// RULE 5: (solve of height)
@@ -2419,7 +2669,7 @@ void RenderBox::calcAbsoluteVerticalValues(Length h, const RenderBoxModelObject*
heightValue = max(0, availableSpace - (topValue + bottom.calcValue(containerHeight)));
} else if (!topIsAuto && !heightIsAuto && bottomIsAuto) {
// RULE 6: (no need solve of bottom)
- heightValue = calcContentBoxHeight(h.calcValue(containerHeight));
+ heightValue = computeContentBoxLogicalHeight(h.calcValue(containerHeight));
topValue = top.calcValue(containerHeight);
}
}
@@ -2428,7 +2678,7 @@ void RenderBox::calcAbsoluteVerticalValues(Length h, const RenderBoxModelObject*
yPos = topValue + marginTopValue + containerBlock->borderTop();
}
-void RenderBox::calcAbsoluteHorizontalReplaced()
+void RenderBox::computePositionedLogicalWidthReplaced()
{
// The following is based off of the W3C Working Draft from April 11, 2006 of
// CSS 2.1: Section 10.3.8 "Absolutely positioned, replaced elements"
@@ -2458,9 +2708,9 @@ void RenderBox::calcAbsoluteHorizontalReplaced()
* elements.
\*-----------------------------------------------------------------------*/
// NOTE: This value of width is FINAL in that the min/max width calculations
- // are dealt with in calcReplacedWidth(). This means that the steps to produce
+ // are dealt with in computeReplacedWidth(). This means that the steps to produce
// correct max/min in the non-replaced version, are not necessary.
- setWidth(calcReplacedWidth() + borderAndPaddingWidth());
+ setWidth(computeReplacedWidth() + borderAndPaddingWidth());
const int availableSpace = containerWidth - width();
/*-----------------------------------------------------------------------*\
@@ -2598,7 +2848,7 @@ void RenderBox::calcAbsoluteHorizontalReplaced()
InlineFlowBox* firstLine = flow->firstLineBox();
InlineFlowBox* lastLine = flow->lastLineBox();
if (firstLine && lastLine && firstLine != lastLine) {
- m_frameRect.setX(leftValue + m_marginLeft + lastLine->borderLeft() + (lastLine->x() - firstLine->x()));
+ m_frameRect.setX(leftValue + m_marginLeft + lastLine->borderLogicalLeft() + (lastLine->x() - firstLine->x()));
return;
}
}
@@ -2606,7 +2856,7 @@ void RenderBox::calcAbsoluteHorizontalReplaced()
m_frameRect.setX(leftValue + m_marginLeft + containerBlock->borderLeft());
}
-void RenderBox::calcAbsoluteVerticalReplaced()
+void RenderBox::computePositionedLogicalHeightReplaced()
{
// The following is based off of the W3C Working Draft from April 11, 2006 of
// CSS 2.1: Section 10.6.5 "Absolutely positioned, replaced elements"
@@ -2631,9 +2881,9 @@ void RenderBox::calcAbsoluteVerticalReplaced()
* elements.
\*-----------------------------------------------------------------------*/
// NOTE: This value of height is FINAL in that the min/max height calculations
- // are dealt with in calcReplacedHeight(). This means that the steps to produce
+ // are dealt with in computeReplacedHeight(). This means that the steps to produce
// correct max/min in the non-replaced version, are not necessary.
- setHeight(calcReplacedHeight() + borderAndPaddingHeight());
+ setHeight(computeReplacedHeight() + borderAndPaddingHeight());
const int availableSpace = containerHeight - height();
/*-----------------------------------------------------------------------*\
@@ -2913,7 +3163,7 @@ bool RenderBox::shrinkToAvoidFloats() const
bool RenderBox::avoidsFloats() const
{
- return isReplaced() || hasOverflowClip() || isHR();
+ return isReplaced() || hasOverflowClip() || isHR() || isBlockFlowRoot();
}
void RenderBox::addShadowOverflow()
diff --git a/WebCore/rendering/RenderBox.h b/WebCore/rendering/RenderBox.h
index b008c09..445c7bb 100644
--- a/WebCore/rendering/RenderBox.h
+++ b/WebCore/rendering/RenderBox.h
@@ -29,7 +29,7 @@
namespace WebCore {
-enum WidthType { Width, MinWidth, MaxWidth };
+enum LogicalWidthType { LogicalWidth, MinLogicalWidth, MaxLogicalWidth };
class RenderBox : public RenderBoxModelObject {
public:
@@ -44,12 +44,52 @@ public:
int y() const { return m_frameRect.y(); }
int width() const { return m_frameRect.width(); }
int height() const { return m_frameRect.height(); }
-
+
void setX(int x) { m_frameRect.setX(x); }
void setY(int y) { m_frameRect.setY(y); }
void setWidth(int width) { m_frameRect.setWidth(width); }
void setHeight(int height) { m_frameRect.setHeight(height); }
-
+
+ int logicalLeft() const { return style()->isVerticalBlockFlow() ? x() : y(); }
+ int logicalTop() const { return style()->isVerticalBlockFlow() ? y() : x(); }
+ int logicalWidth() const { return style()->isVerticalBlockFlow() ? width() : height(); }
+ int logicalHeight() const { return style()->isVerticalBlockFlow() ? height() : width(); }
+ void setLogicalLeft(int left)
+ {
+ if (style()->isVerticalBlockFlow())
+ setX(left);
+ else
+ setY(left);
+ }
+ void setLogicalTop(int top)
+ {
+ if (style()->isVerticalBlockFlow())
+ setY(top);
+ else
+ setX(top);
+ }
+ void setLogicalWidth(int size)
+ {
+ if (style()->isVerticalBlockFlow())
+ setWidth(size);
+ else
+ setHeight(size);
+ }
+ void setLogicalHeight(int size)
+ {
+ if (style()->isVerticalBlockFlow())
+ setHeight(size);
+ else
+ setWidth(size);
+ }
+ void setLogicalLocation(int left, int top)
+ {
+ if (style()->isVerticalBlockFlow())
+ setLocation(left, top);
+ else
+ setLocation(top, left);
+ }
+
IntPoint location() const { return m_frameRect.location(); }
IntSize locationOffset() const { return IntSize(x(), y()); }
IntSize size() const { return m_frameRect.size(); }
@@ -110,6 +150,8 @@ public:
int contentWidth() const { return clientWidth() - paddingLeft() - paddingRight(); }
int contentHeight() const { return clientHeight() - paddingTop() - paddingBottom(); }
+ int contentLogicalWidth() const { return style()->isVerticalBlockFlow() ? contentWidth() : contentHeight(); }
+ int contentLogicalHeight() const { return style()->isVerticalBlockFlow() ? contentHeight() : contentWidth(); }
// IE extensions. Used to calculate offsetWidth/Height. Overridden by inlines (RenderFlow)
// to return the remaining width on a given line (and the height of a single line).
@@ -139,18 +181,41 @@ public:
virtual int marginBottom() const { return m_marginBottom; }
virtual int marginLeft() const { return m_marginLeft; }
virtual int marginRight() const { return m_marginRight; }
-
+ virtual int marginBefore() const;
+ virtual int marginAfter() const;
+ virtual int marginStart() const;
+ virtual int marginEnd() const;
+ void setMarginStart(int);
+ void setMarginEnd(int);
+ void setMarginBefore(int);
+ void setMarginAfter(int);
+
// The following five functions are used to implement collapsing margins.
// All objects know their maximal positive and negative margins. The
// formula for computing a collapsed margin is |maxPosMargin| - |maxNegmargin|.
// For a non-collapsing box, such as a leaf element, this formula will simply return
- // the margin of the element. Blocks override the maxTopMargin and maxBottomMargin
+ // the margin of the element. Blocks override the maxMarginBefore and maxMarginAfter
// methods.
+ enum MarginSign { PositiveMargin, NegativeMargin };
virtual bool isSelfCollapsingBlock() const { return false; }
- int collapsedMarginTop() const { return maxTopMargin(true) - maxTopMargin(false); }
- int collapsedMarginBottom() const { return maxBottomMargin(true) - maxBottomMargin(false); }
- virtual int maxTopMargin(bool positive) const { return positive ? std::max(0, marginTop()) : -std::min(0, marginTop()); }
- virtual int maxBottomMargin(bool positive) const { return positive ? std::max(0, marginBottom()) : -std::min(0, marginBottom()); }
+ int collapsedMarginBefore() const
+ {
+ return maxMarginBefore(PositiveMargin) - maxMarginBefore(NegativeMargin);
+ }
+ int collapsedMarginAfter() const
+ {
+ return maxMarginAfter(PositiveMargin) - maxMarginAfter(NegativeMargin);
+}
+ virtual int maxMarginBefore(MarginSign sign) const
+ {
+ int beforeMargin = marginBefore();
+ return (sign == PositiveMargin) ? std::max(0, beforeMargin) : -std::min(0, beforeMargin);
+ }
+ virtual int maxMarginAfter(MarginSign sign) const
+ {
+ int afterMargin = marginAfter();
+ return (sign == PositiveMargin) ? std::max(0, afterMargin) : -std::min(0, afterMargin);
+ }
virtual void absoluteRects(Vector<IntRect>&, int tx, int ty);
virtual void absoluteQuads(Vector<FloatQuad>&);
@@ -166,8 +231,8 @@ public:
virtual void destroy();
- virtual int minPrefWidth() const;
- virtual int maxPrefWidth() const;
+ virtual int minPreferredLogicalWidth() const;
+ virtual int maxPreferredLogicalWidth() const;
int overrideSize() const;
int overrideWidth() const;
@@ -176,18 +241,19 @@ public:
virtual IntSize offsetFromContainer(RenderObject*, const IntPoint&) const;
- int calcBorderBoxWidth(int width) const;
- int calcBorderBoxHeight(int height) const;
- int calcContentBoxWidth(int width) const;
- int calcContentBoxHeight(int height) const;
+ int computeBorderBoxLogicalWidth(int width) const;
+ int computeBorderBoxLogicalHeight(int height) const;
+ int computeContentBoxLogicalWidth(int width) const;
+ int computeContentBoxLogicalHeight(int height) const;
virtual void borderFitAdjust(int& /*x*/, int& /*w*/) const { } // Shrink the box in which the border paints if border-fit is set.
- // This method is now public so that centered objects like tables that are
- // shifted right by left-aligned floats can recompute their left and
- // right margins (so that they can remain centered after being
- // shifted. -dwh
- void calcHorizontalMargins(const Length& marginLeft, const Length& marginRight, int containerWidth);
+ // Resolve auto margins in the inline direction of the containing block so that objects can be pushed to the start, middle or end
+ // of the containing block.
+ void computeInlineDirectionMargins(RenderBlock* containingBlock, int containerWidth, int childWidth);
+
+ // Used to resolve margins in the containing block's block-flow direction.
+ void computeBlockDirectionMargins(RenderBlock* containingBlock);
void positionLineBox(InlineBox*);
@@ -210,40 +276,43 @@ public:
virtual void repaintDuringLayoutIfMoved(const IntRect&);
- virtual int containingBlockWidthForContent() const;
-
- virtual void calcWidth();
- virtual void calcHeight();
+ virtual int containingBlockLogicalWidthForContent() const;
+ int perpendicularContainingBlockLogicalHeight() const;
+
+ virtual void computeLogicalWidth();
+ virtual void computeLogicalHeight();
bool stretchesToViewHeight() const
{
- return document()->inQuirksMode() && style()->height().isAuto() && !isFloatingOrPositioned() && (isRoot() || isBody());
+ return document()->inQuirksMode() && style()->height().isAuto() && !isFloatingOrPositioned() && (isRoot() || isBody()) && !isBlockFlowRoot();
}
virtual IntSize intrinsicSize() const { return IntSize(); }
// Whether or not the element shrinks to its intrinsic width (rather than filling the width
// of a containing block). HTML4 buttons, <select>s, <input>s, legends, and floating/compact elements do this.
- bool sizesToIntrinsicWidth(WidthType) const;
- virtual bool stretchesToMinIntrinsicWidth() const { return false; }
+ bool sizesToIntrinsicLogicalWidth(LogicalWidthType) const;
+ virtual bool stretchesToMinIntrinsicLogicalWidth() const { return false; }
- int calcWidthUsing(WidthType, int containerWidth);
- int calcHeightUsing(const Length& height);
- int calcReplacedWidthUsing(Length width) const;
- int calcReplacedHeightUsing(Length height) const;
+ int computeLogicalWidthUsing(LogicalWidthType, int availableLogicalWidth);
+ int computeLogicalHeightUsing(const Length& height);
+ int computeReplacedWidthUsing(Length width) const;
+ int computeReplacedHeightUsing(Length height) const;
- virtual int calcReplacedWidth(bool includeMaxWidth = true) const;
- virtual int calcReplacedHeight() const;
+ virtual int computeReplacedWidth(bool includeMaxWidth = true) const;
+ virtual int computeReplacedHeight() const;
- int calcPercentageHeight(const Length& height);
+ int computePercentageLogicalHeight(const Length& height);
// Block flows subclass availableWidth to handle multi column layout (shrinking the width available to children when laying out.)
- virtual int availableWidth() const { return contentWidth(); } // FIXME: Investigate removing eventually. https://bugs.webkit.org/show_bug.cgi?id=46127
- virtual int availableHeight() const;
- int availableHeightUsing(const Length&) const;
- virtual int availableLogicalWidth() const;
-
- void calcVerticalMargins();
+ virtual int availableLogicalWidth() const { return contentLogicalWidth(); }
+ int availableLogicalHeight() const;
+ int availableLogicalHeightUsing(const Length&) const;
+
+ // There are a few cases where we need to refer specifically to the available physical width and available physical height.
+ // Relative positioning is one of those cases, since left/top offsets are physical.
+ int availableWidth() const { return style()->isVerticalBlockFlow() ? availableLogicalWidth() : availableLogicalHeight(); }
+ int availableHeight() const { return style()->isVerticalBlockFlow() ? availableLogicalHeight() : availableLogicalWidth(); }
virtual int verticalScrollbarWidth() const;
int horizontalScrollbarHeight() const;
@@ -278,11 +347,11 @@ public:
void tryLayoutDoingPositionedMovementOnly()
{
int oldWidth = width();
- calcWidth();
+ computeLogicalWidth();
// If we shrink to fit our width may have changed, so we still need full layout.
if (oldWidth != width())
return;
- calcHeight();
+ computeLogicalHeight();
setNeedsLayout(false);
}
@@ -300,9 +369,13 @@ public:
virtual void markDescendantBlocksAndLinesForLayout(bool inLayout = true);
+<<<<<<< HEAD
#ifdef ANDROID_LAYOUT
int getVisibleWidth() const { return m_visibleWidth; }
#endif
+=======
+ bool isBlockFlowRoot() const { return !parent() || parent()->style()->blockFlow() != style()->blockFlow(); }
+>>>>>>> webkit.org at r68651
protected:
virtual void styleWillChange(StyleDifference, const RenderStyle* newStyle);
@@ -319,9 +392,9 @@ protected:
void paintCustomHighlight(int tx, int ty, const AtomicString& type, bool behindText);
#endif
- void calcAbsoluteHorizontal();
+ void computePositionedLogicalWidth();
- virtual bool shouldCalculateSizeAsReplaced() const { return isReplaced() && !isInlineBlockOrInlineTable(); }
+ virtual bool shouldComputeSizeAsReplaced() const { return isReplaced() && !isInlineBlockOrInlineTable(); }
virtual void mapLocalToContainer(RenderBoxModelObject* repaintContainer, bool fixed, bool useTransforms, TransformState&) const;
virtual void mapAbsoluteToLocalPoint(bool fixed, bool useTransforms, TransformState&) const;
@@ -337,23 +410,33 @@ private:
int containingBlockWidthForPositioned(const RenderBoxModelObject* containingBlock) const;
int containingBlockHeightForPositioned(const RenderBoxModelObject* containingBlock) const;
- void calcAbsoluteVertical();
- void calcAbsoluteHorizontalValues(Length width, const RenderBoxModelObject* cb, TextDirection containerDirection,
+ void computePositionedLogicalHeight();
+ void computePositionedLogicalWidthUsing(Length width, const RenderBoxModelObject* cb, TextDirection containerDirection,
int containerWidth, int bordersPlusPadding,
Length left, Length right, Length marginLeft, Length marginRight,
int& widthValue, int& marginLeftValue, int& marginRightValue, int& xPos);
- void calcAbsoluteVerticalValues(Length height, const RenderBoxModelObject* cb,
+ void computePositionedLogicalHeightUsing(Length height, const RenderBoxModelObject* cb,
int containerHeight, int bordersPlusPadding,
Length top, Length bottom, Length marginTop, Length marginBottom,
int& heightValue, int& marginTopValue, int& marginBottomValue, int& yPos);
- void calcAbsoluteVerticalReplaced();
- void calcAbsoluteHorizontalReplaced();
+ void computePositionedLogicalHeightReplaced();
+ void computePositionedLogicalWidthReplaced();
// This function calculates the minimum and maximum preferred widths for an object.
// These values are used in shrink-to-fit layout systems.
// These include tables, positioned objects, floats and flexible boxes.
- virtual void calcPrefWidths() { setPrefWidthsDirty(false); }
+ virtual void computePreferredLogicalWidths() { setPreferredLogicalWidthsDirty(false); }
+
+ void setMarginStartUsing(const RenderStyle*, int);
+ void setMarginEndUsing(const RenderStyle*, int);
+ void setMarginBeforeUsing(const RenderStyle*, int);
+ void setMarginAfterUsing(const RenderStyle*, int);
+
+ int marginStartUsing(const RenderStyle*) const;
+ int marginEndUsing(const RenderStyle*) const;
+ int marginBeforeUsing(const RenderStyle*) const;
+ int marginAfterUsing(const RenderStyle*) const;
private:
// The width/height of the contents + borders + padding. The x/y location is relative to our container (which is not always our parent).
@@ -371,11 +454,11 @@ protected:
int m_marginTop;
int m_marginBottom;
- // The preferred width of the element if it were to break its lines at every possible opportunity.
- int m_minPrefWidth;
+ // The preferred logical width of the element if it were to break its lines at every possible opportunity.
+ int m_minPreferredLogicalWidth;
- // The preferred width of the element if it never breaks any lines at all.
- int m_maxPrefWidth;
+ // The preferred logical width of the element if it never breaks any lines at all.
+ int m_maxPreferredLogicalWidth;
// For inline replaced elements, the inline box that owns us.
InlineBox* m_inlineBoxWrapper;
diff --git a/WebCore/rendering/RenderBoxModelObject.cpp b/WebCore/rendering/RenderBoxModelObject.cpp
index f4c2d2a..bbb9c2c 100644
--- a/WebCore/rendering/RenderBoxModelObject.cpp
+++ b/WebCore/rendering/RenderBoxModelObject.cpp
@@ -320,7 +320,7 @@ int RenderBoxModelObject::relativePositionOffsetX() const
{
// Objects that shrink to avoid floats normally use available line width when computing containing block width. However
// in the case of relative positioning using percentages, we can't do this. The offset should always be resolved using the
- // available width of the containing block. Therefore we don't use containingBlockWidthForContent() here, but instead explicitly
+ // available width of the containing block. Therefore we don't use containingBlockLogicalWidthForContent() here, but instead explicitly
// call availableWidth on our containing block.
if (!style()->left().isAuto()) {
RenderBlock* cb = containingBlock();
@@ -505,8 +505,8 @@ void RenderBoxModelObject::paintFillLayerExtended(const PaintInfo& paintInfo, co
if (context->paintingDisabled())
return;
- bool includeLeftEdge = box ? box->includeLeftEdge() : true;
- bool includeRightEdge = box ? box->includeRightEdge() : true;
+ bool includeLeftEdge = box ? box->includeLogicalLeftEdge() : true;
+ bool includeRightEdge = box ? box->includeLogicalRightEdge() : true;
int bLeft = includeLeftEdge ? borderLeft() : 0;
int bRight = includeRightEdge ? borderRight() : 0;
int pLeft = includeLeftEdge ? paddingLeft() : 0;
@@ -624,6 +624,12 @@ void RenderBoxModelObject::paintFillLayerExtended(const PaintInfo& paintInfo, co
// Can't scroll a frameset document anyway.
isOpaqueRoot = body->hasLocalName(framesetTag);
}
+#if ENABLE(SVG)
+ else {
+ // SVG documents and XML documents with SVG root nodes are transparent.
+ isOpaqueRoot = !document()->hasSVGRootNode();
+ }
+#endif
}
} else
isOpaqueRoot = !view()->frameView()->isTransparent();
@@ -1590,6 +1596,18 @@ void RenderBoxModelObject::clipBorderSidePolygon(GraphicsContext* graphicsContex
graphicsContext->clipConvexPolygon(4, secondQuad, !secondEdgeMatches);
}
+static inline void uniformlyExpandBorderRadii(int delta, IntSize& topLeft, IntSize& topRight, IntSize& bottomLeft, IntSize& bottomRight)
+{
+ topLeft.expand(delta, delta);
+ topLeft.clampNegativeToZero();
+ topRight.expand(delta, delta);
+ topRight.clampNegativeToZero();
+ bottomLeft.expand(delta, delta);
+ bottomLeft.clampNegativeToZero();
+ bottomRight.expand(delta, delta);
+ bottomRight.clampNegativeToZero();
+}
+
void RenderBoxModelObject::paintBoxShadow(GraphicsContext* context, int tx, int ty, int w, int h, const RenderStyle* s, ShadowStyle shadowStyle, bool begin, bool end)
{
// FIXME: Deal with border-image. Would be great to use border-image as a mask.
@@ -1673,37 +1691,15 @@ void RenderBoxModelObject::paintBoxShadow(GraphicsContext* context, int tx, int
IntSize bottomLeftToClipOut = bottomLeft;
IntSize bottomRightToClipOut = bottomRight;
- if (shadowSpread < 0) {
- topLeft.expand(shadowSpread, shadowSpread);
- topLeft.clampNegativeToZero();
-
- topRight.expand(shadowSpread, shadowSpread);
- topRight.clampNegativeToZero();
-
- bottomLeft.expand(shadowSpread, shadowSpread);
- bottomLeft.clampNegativeToZero();
-
- bottomRight.expand(shadowSpread, shadowSpread);
- bottomRight.clampNegativeToZero();
- }
+ if (shadowSpread < 0)
+ uniformlyExpandBorderRadii(shadowSpread, topLeft, topRight, bottomLeft, bottomRight);
// If the box is opaque, it is unnecessary to clip it out. However, doing so saves time
// when painting the shadow. On the other hand, it introduces subpixel gaps along the
// corners. Those are avoided by insetting the clipping path by one pixel.
if (hasOpaqueBackground) {
rectToClipOut.inflate(-1);
-
- topLeftToClipOut.expand(-1, -1);
- topLeftToClipOut.clampNegativeToZero();
-
- topRightToClipOut.expand(-1, -1);
- topRightToClipOut.clampNegativeToZero();
-
- bottomLeftToClipOut.expand(-1, -1);
- bottomLeftToClipOut.clampNegativeToZero();
-
- bottomRightToClipOut.expand(-1, -1);
- bottomRightToClipOut.clampNegativeToZero();
+ uniformlyExpandBorderRadii(-1, topLeftToClipOut, topRightToClipOut, bottomLeftToClipOut, bottomRightToClipOut);
}
if (!rectToClipOut.isEmpty())
@@ -1769,19 +1765,8 @@ void RenderBoxModelObject::paintBoxShadow(GraphicsContext* context, int tx, int
context->addPath(Path::createRectangle(outerRect));
if (hasBorderRadius) {
- if (shadowSpread > 0) {
- topLeft.expand(-shadowSpread, -shadowSpread);
- topLeft.clampNegativeToZero();
-
- topRight.expand(-shadowSpread, -shadowSpread);
- topRight.clampNegativeToZero();
-
- bottomLeft.expand(-shadowSpread, -shadowSpread);
- bottomLeft.clampNegativeToZero();
-
- bottomRight.expand(-shadowSpread, -shadowSpread);
- bottomRight.clampNegativeToZero();
- }
+ if (shadowSpread > 0)
+ uniformlyExpandBorderRadii(-shadowSpread, topLeft, topRight, bottomLeft, bottomRight);
context->addPath(Path::createRoundedRectangle(holeRect, topLeft, topRight, bottomLeft, bottomRight));
} else
context->addPath(Path::createRectangle(holeRect));
@@ -1796,9 +1781,9 @@ void RenderBoxModelObject::paintBoxShadow(GraphicsContext* context, int tx, int
}
}
-int RenderBoxModelObject::containingBlockWidthForContent() const
+int RenderBoxModelObject::containingBlockLogicalWidthForContent() const
{
- return containingBlock()->availableWidth();
+ return containingBlock()->availableLogicalWidth();
}
} // namespace WebCore
diff --git a/WebCore/rendering/RenderBoxModelObject.h b/WebCore/rendering/RenderBoxModelObject.h
index e91e799..83c9367 100644
--- a/WebCore/rendering/RenderBoxModelObject.h
+++ b/WebCore/rendering/RenderBoxModelObject.h
@@ -79,19 +79,29 @@ public:
virtual int borderBottom() const { return style()->borderBottomWidth(); }
virtual int borderLeft() const { return style()->borderLeftWidth(); }
virtual int borderRight() const { return style()->borderRightWidth(); }
+ virtual int borderBefore() const { return style()->borderBeforeWidth(); }
+ virtual int borderAfter() const { return style()->borderAfterWidth(); }
+ virtual int borderStart() const { return style()->borderStartWidth(); }
+ virtual int borderEnd() const { return style()->borderEndWidth(); }
int borderAndPaddingHeight() const { return borderTop() + borderBottom() + paddingTop() + paddingBottom(); }
int borderAndPaddingWidth() const { return borderLeft() + borderRight() + paddingLeft() + paddingRight(); }
+ int borderAndPaddingLogicalHeight() const { return borderBefore() + borderAfter() + paddingBefore() + paddingAfter(); }
+ int borderAndPaddingLogicalWidth() const { return borderStart() + borderEnd() + paddingStart() + paddingEnd(); }
virtual int marginTop() const = 0;
virtual int marginBottom() const = 0;
virtual int marginLeft() const = 0;
virtual int marginRight() const = 0;
+ virtual int marginBefore() const = 0;
+ virtual int marginAfter() const = 0;
+ virtual int marginStart() const = 0;
+ virtual int marginEnd() const = 0;
bool hasHorizontalBordersPaddingOrMargin() const { return hasHorizontalBordersOrPadding() || marginLeft() != 0 || marginRight() != 0; }
bool hasHorizontalBordersOrPadding() const { return borderLeft() != 0 || borderRight() != 0 || paddingLeft() != 0 || paddingRight() != 0; }
- virtual int containingBlockWidthForContent() const;
+ virtual int containingBlockLogicalWidthForContent() const;
virtual void childBecameNonInline(RenderObject* /*child*/) { }
diff --git a/WebCore/rendering/RenderCounter.cpp b/WebCore/rendering/RenderCounter.cpp
index 6e678e8..639221d 100644
--- a/WebCore/rendering/RenderCounter.cpp
+++ b/WebCore/rendering/RenderCounter.cpp
@@ -328,10 +328,10 @@ PassRefPtr<StringImpl> RenderCounter::originalText() const
return text.impl();
}
-void RenderCounter::calcPrefWidths(int lead)
+void RenderCounter::computePreferredLogicalWidths(int lead)
{
setTextInternal(originalText());
- RenderText::calcPrefWidths(lead);
+ RenderText::computePreferredLogicalWidths(lead);
}
void RenderCounter::invalidate(const AtomicString& identifier)
diff --git a/WebCore/rendering/RenderCounter.h b/WebCore/rendering/RenderCounter.h
index 10ba1dc..8d981df 100644
--- a/WebCore/rendering/RenderCounter.h
+++ b/WebCore/rendering/RenderCounter.h
@@ -49,7 +49,7 @@ private:
virtual bool isCounter() const;
virtual PassRefPtr<StringImpl> originalText() const;
- virtual void calcPrefWidths(int leadWidth);
+ virtual void computePreferredLogicalWidths(int leadWidth);
CounterContent m_counter;
mutable CounterNode* m_counterNode;
diff --git a/WebCore/rendering/RenderDataGrid.cpp b/WebCore/rendering/RenderDataGrid.cpp
index 63a21cd..c322389 100644
--- a/WebCore/rendering/RenderDataGrid.cpp
+++ b/WebCore/rendering/RenderDataGrid.cpp
@@ -88,34 +88,34 @@ RenderStyle* RenderDataGrid::headerStyle(DataGridColumn* column)
return column->headerStyle();
}
-void RenderDataGrid::calcPrefWidths()
+void RenderDataGrid::computePreferredLogicalWidths()
{
- m_minPrefWidth = 0;
- m_maxPrefWidth = 0;
+ m_minPreferredLogicalWidth = 0;
+ m_maxPreferredLogicalWidth = 0;
if (style()->width().isFixed() && style()->width().value() > 0)
- m_minPrefWidth = m_maxPrefWidth = calcContentBoxWidth(style()->width().value());
+ m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = computeContentBoxLogicalWidth(style()->width().value());
else
- m_maxPrefWidth = calcContentBoxWidth(cDefaultWidth);
+ m_maxPreferredLogicalWidth = computeContentBoxLogicalWidth(cDefaultWidth);
if (style()->minWidth().isFixed() && style()->minWidth().value() > 0) {
- m_maxPrefWidth = max(m_maxPrefWidth, calcContentBoxWidth(style()->minWidth().value()));
- m_minPrefWidth = max(m_minPrefWidth, calcContentBoxWidth(style()->minWidth().value()));
+ m_maxPreferredLogicalWidth = max(m_maxPreferredLogicalWidth, computeContentBoxLogicalWidth(style()->minWidth().value()));
+ m_minPreferredLogicalWidth = max(m_minPreferredLogicalWidth, computeContentBoxLogicalWidth(style()->minWidth().value()));
} else if (style()->width().isPercent() || (style()->width().isAuto() && style()->height().isPercent()))
- m_minPrefWidth = 0;
+ m_minPreferredLogicalWidth = 0;
else
- m_minPrefWidth = m_maxPrefWidth;
+ m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth;
if (style()->maxWidth().isFixed() && style()->maxWidth().value() != undefinedLength) {
- m_maxPrefWidth = min(m_maxPrefWidth, calcContentBoxWidth(style()->maxWidth().value()));
- m_minPrefWidth = min(m_minPrefWidth, calcContentBoxWidth(style()->maxWidth().value()));
+ m_maxPreferredLogicalWidth = min(m_maxPreferredLogicalWidth, computeContentBoxLogicalWidth(style()->maxWidth().value()));
+ m_minPreferredLogicalWidth = min(m_minPreferredLogicalWidth, computeContentBoxLogicalWidth(style()->maxWidth().value()));
}
int toAdd = borderAndPaddingWidth();
- m_minPrefWidth += toAdd;
- m_maxPrefWidth += toAdd;
+ m_minPreferredLogicalWidth += toAdd;
+ m_maxPreferredLogicalWidth += toAdd;
- setPrefWidthsDirty(false);
+ setPreferredLogicalWidthsDirty(false);
}
void RenderDataGrid::layout()
diff --git a/WebCore/rendering/RenderDataGrid.h b/WebCore/rendering/RenderDataGrid.h
index c4b54df..1492d26 100644
--- a/WebCore/rendering/RenderDataGrid.h
+++ b/WebCore/rendering/RenderDataGrid.h
@@ -44,7 +44,7 @@ public:
virtual const char* renderName() const { return "RenderDataGrid"; }
virtual bool canHaveChildren() const { return false; }
- virtual void calcPrefWidths();
+ virtual void computePreferredLogicalWidths();
virtual void layout();
virtual void paintObject(PaintInfo&, int tx, int ty);
diff --git a/WebCore/rendering/RenderEmbeddedObject.cpp b/WebCore/rendering/RenderEmbeddedObject.cpp
index 4179af3..aa301e2 100644
--- a/WebCore/rendering/RenderEmbeddedObject.cpp
+++ b/WebCore/rendering/RenderEmbeddedObject.cpp
@@ -215,8 +215,8 @@ void RenderEmbeddedObject::layout()
{
ASSERT(needsLayout());
- calcWidth();
- calcHeight();
+ computeLogicalWidth();
+ computeLogicalHeight();
RenderPart::layout();
diff --git a/WebCore/rendering/RenderFieldset.cpp b/WebCore/rendering/RenderFieldset.cpp
index bd245c7..d3b88c1 100644
--- a/WebCore/rendering/RenderFieldset.cpp
+++ b/WebCore/rendering/RenderFieldset.cpp
@@ -44,11 +44,11 @@ RenderFieldset::RenderFieldset(Node* element)
{
}
-void RenderFieldset::calcPrefWidths()
+void RenderFieldset::computePreferredLogicalWidths()
{
- RenderBlock::calcPrefWidths();
+ RenderBlock::computePreferredLogicalWidths();
if (RenderBox* legend = findLegend()) {
- int legendMinWidth = legend->minPrefWidth();
+ int legendMinWidth = legend->minPreferredLogicalWidth();
Length legendMarginLeft = legend->style()->marginLeft();
Length legendMarginRight = legend->style()->marginLeft();
@@ -59,7 +59,7 @@ void RenderFieldset::calcPrefWidths()
if (legendMarginRight.isFixed())
legendMinWidth += legendMarginRight.value();
- m_minPrefWidth = max(m_minPrefWidth, legendMinWidth + borderAndPaddingWidth());
+ m_minPreferredLogicalWidth = max(m_minPreferredLogicalWidth, legendMinWidth + borderAndPaddingWidth());
}
}
diff --git a/WebCore/rendering/RenderFieldset.h b/WebCore/rendering/RenderFieldset.h
index df6a1da..bc8e8ae 100644
--- a/WebCore/rendering/RenderFieldset.h
+++ b/WebCore/rendering/RenderFieldset.h
@@ -40,9 +40,9 @@ private:
virtual RenderObject* layoutLegend(bool relayoutChildren);
- virtual void calcPrefWidths();
+ virtual void computePreferredLogicalWidths();
virtual bool avoidsFloats() const { return true; }
- virtual bool stretchesToMinIntrinsicWidth() const { return true; }
+ virtual bool stretchesToMinIntrinsicLogicalWidth() const { return true; }
virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle);
diff --git a/WebCore/rendering/RenderFileUploadControl.cpp b/WebCore/rendering/RenderFileUploadControl.cpp
index 20ebe4d..cdb0470 100644
--- a/WebCore/rendering/RenderFileUploadControl.cpp
+++ b/WebCore/rendering/RenderFileUploadControl.cpp
@@ -257,41 +257,41 @@ void RenderFileUploadControl::paintObject(PaintInfo& paintInfo, int tx, int ty)
paintInfo.context->restore();
}
-void RenderFileUploadControl::calcPrefWidths()
+void RenderFileUploadControl::computePreferredLogicalWidths()
{
- ASSERT(prefWidthsDirty());
+ ASSERT(preferredLogicalWidthsDirty());
- m_minPrefWidth = 0;
- m_maxPrefWidth = 0;
+ m_minPreferredLogicalWidth = 0;
+ m_maxPreferredLogicalWidth = 0;
if (style()->width().isFixed() && style()->width().value() > 0)
- m_minPrefWidth = m_maxPrefWidth = calcContentBoxWidth(style()->width().value());
+ m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = computeContentBoxLogicalWidth(style()->width().value());
else {
// Figure out how big the filename space needs to be for a given number of characters
// (using "0" as the nominal character).
const UChar ch = '0';
float charWidth = style()->font().floatWidth(TextRun(&ch, 1, false, 0, 0, false, false, false));
- m_maxPrefWidth = (int)ceilf(charWidth * defaultWidthNumChars);
+ m_maxPreferredLogicalWidth = (int)ceilf(charWidth * defaultWidthNumChars);
}
if (style()->minWidth().isFixed() && style()->minWidth().value() > 0) {
- m_maxPrefWidth = max(m_maxPrefWidth, calcContentBoxWidth(style()->minWidth().value()));
- m_minPrefWidth = max(m_minPrefWidth, calcContentBoxWidth(style()->minWidth().value()));
+ m_maxPreferredLogicalWidth = max(m_maxPreferredLogicalWidth, computeContentBoxLogicalWidth(style()->minWidth().value()));
+ m_minPreferredLogicalWidth = max(m_minPreferredLogicalWidth, computeContentBoxLogicalWidth(style()->minWidth().value()));
} else if (style()->width().isPercent() || (style()->width().isAuto() && style()->height().isPercent()))
- m_minPrefWidth = 0;
+ m_minPreferredLogicalWidth = 0;
else
- m_minPrefWidth = m_maxPrefWidth;
+ m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth;
if (style()->maxWidth().isFixed() && style()->maxWidth().value() != undefinedLength) {
- m_maxPrefWidth = min(m_maxPrefWidth, calcContentBoxWidth(style()->maxWidth().value()));
- m_minPrefWidth = min(m_minPrefWidth, calcContentBoxWidth(style()->maxWidth().value()));
+ m_maxPreferredLogicalWidth = min(m_maxPreferredLogicalWidth, computeContentBoxLogicalWidth(style()->maxWidth().value()));
+ m_minPreferredLogicalWidth = min(m_minPreferredLogicalWidth, computeContentBoxLogicalWidth(style()->maxWidth().value()));
}
int toAdd = borderAndPaddingWidth();
- m_minPrefWidth += toAdd;
- m_maxPrefWidth += toAdd;
+ m_minPreferredLogicalWidth += toAdd;
+ m_maxPreferredLogicalWidth += toAdd;
- setPrefWidthsDirty(false);
+ setPreferredLogicalWidthsDirty(false);
}
void RenderFileUploadControl::receiveDroppedFiles(const Vector<String>& paths)
diff --git a/WebCore/rendering/RenderFileUploadControl.h b/WebCore/rendering/RenderFileUploadControl.h
index 205ba47..c96800c 100644
--- a/WebCore/rendering/RenderFileUploadControl.h
+++ b/WebCore/rendering/RenderFileUploadControl.h
@@ -51,7 +51,7 @@ private:
virtual const char* renderName() const { return "RenderFileUploadControl"; }
virtual void updateFromElement();
- virtual void calcPrefWidths();
+ virtual void computePreferredLogicalWidths();
virtual void paintObject(PaintInfo&, int tx, int ty);
virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle);
diff --git a/WebCore/rendering/RenderFlexibleBox.cpp b/WebCore/rendering/RenderFlexibleBox.cpp
index 659df8d..636c873 100644
--- a/WebCore/rendering/RenderFlexibleBox.cpp
+++ b/WebCore/rendering/RenderFlexibleBox.cpp
@@ -137,8 +137,8 @@ void RenderFlexibleBox::calcHorizontalPrefWidths()
marginRight += mr.value();
margin = marginLeft + marginRight;
- m_minPrefWidth += child->minPrefWidth() + margin;
- m_maxPrefWidth += child->maxPrefWidth() + margin;
+ m_minPreferredLogicalWidth += child->minPreferredLogicalWidth() + margin;
+ m_maxPreferredLogicalWidth += child->maxPreferredLogicalWidth() + margin;
}
}
@@ -160,39 +160,39 @@ void RenderFlexibleBox::calcVerticalPrefWidths()
if (mr.isFixed())
margin += mr.value();
- int w = child->minPrefWidth() + margin;
- m_minPrefWidth = max(w, m_minPrefWidth);
+ int w = child->minPreferredLogicalWidth() + margin;
+ m_minPreferredLogicalWidth = max(w, m_minPreferredLogicalWidth);
- w = child->maxPrefWidth() + margin;
- m_maxPrefWidth = max(w, m_maxPrefWidth);
+ w = child->maxPreferredLogicalWidth() + margin;
+ m_maxPreferredLogicalWidth = max(w, m_maxPreferredLogicalWidth);
}
}
-void RenderFlexibleBox::calcPrefWidths()
+void RenderFlexibleBox::computePreferredLogicalWidths()
{
- ASSERT(prefWidthsDirty());
+ ASSERT(preferredLogicalWidthsDirty());
if (style()->width().isFixed() && style()->width().value() > 0)
- m_minPrefWidth = m_maxPrefWidth = calcContentBoxWidth(style()->width().value());
+ m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = computeContentBoxLogicalWidth(style()->width().value());
else {
- m_minPrefWidth = m_maxPrefWidth = 0;
+ m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = 0;
if (hasMultipleLines() || isVertical())
calcVerticalPrefWidths();
else
calcHorizontalPrefWidths();
- m_maxPrefWidth = max(m_minPrefWidth, m_maxPrefWidth);
+ m_maxPreferredLogicalWidth = max(m_minPreferredLogicalWidth, m_maxPreferredLogicalWidth);
}
if (style()->minWidth().isFixed() && style()->minWidth().value() > 0) {
- m_maxPrefWidth = max(m_maxPrefWidth, calcContentBoxWidth(style()->minWidth().value()));
- m_minPrefWidth = max(m_minPrefWidth, calcContentBoxWidth(style()->minWidth().value()));
+ m_maxPreferredLogicalWidth = max(m_maxPreferredLogicalWidth, computeContentBoxLogicalWidth(style()->minWidth().value()));
+ m_minPreferredLogicalWidth = max(m_minPreferredLogicalWidth, computeContentBoxLogicalWidth(style()->minWidth().value()));
}
if (style()->maxWidth().isFixed() && style()->maxWidth().value() != undefinedLength) {
- m_maxPrefWidth = min(m_maxPrefWidth, calcContentBoxWidth(style()->maxWidth().value()));
- m_minPrefWidth = min(m_minPrefWidth, calcContentBoxWidth(style()->maxWidth().value()));
+ m_maxPreferredLogicalWidth = min(m_maxPreferredLogicalWidth, computeContentBoxLogicalWidth(style()->maxWidth().value()));
+ m_minPreferredLogicalWidth = min(m_minPreferredLogicalWidth, computeContentBoxLogicalWidth(style()->maxWidth().value()));
}
int toAdd = borderAndPaddingWidth();
@@ -200,10 +200,10 @@ void RenderFlexibleBox::calcPrefWidths()
if (hasOverflowClip() && style()->overflowY() == OSCROLL)
toAdd += verticalScrollbarWidth();
- m_minPrefWidth += toAdd;
- m_maxPrefWidth += toAdd;
+ m_minPreferredLogicalWidth += toAdd;
+ m_maxPreferredLogicalWidth += toAdd;
- setPrefWidthsDirty(false);
+ setPreferredLogicalWidthsDirty(false);
}
void RenderFlexibleBox::layoutBlock(bool relayoutChildren, int /*pageHeight FIXME: Implement */)
@@ -219,8 +219,8 @@ void RenderFlexibleBox::layoutBlock(bool relayoutChildren, int /*pageHeight FIXM
int previousWidth = width();
int previousHeight = height();
- calcWidth();
- calcHeight();
+ computeLogicalWidth();
+ computeLogicalHeight();
m_overflow.clear();
@@ -251,7 +251,7 @@ void RenderFlexibleBox::layoutBlock(bool relayoutChildren, int /*pageHeight FIXM
else
layoutVerticalBox(relayoutChildren);
- calcHeight();
+ computeLogicalHeight();
if (previousHeight != height())
relayoutChildren = true;
@@ -266,14 +266,14 @@ void RenderFlexibleBox::layoutBlock(bool relayoutChildren, int /*pageHeight FIXM
// bottom margin max values to 0. This way we don't factor in the values
// twice when we collapse with our previous vertically adjacent and
// following vertically adjacent blocks.
- int pos = maxTopPosMargin();
- int neg = maxTopNegMargin();
- if (maxBottomPosMargin() > pos)
- pos = maxBottomPosMargin();
- if (maxBottomNegMargin() > neg)
- neg = maxBottomNegMargin();
- setMaxTopMargins(pos, neg);
- setMaxBottomMargins(0, 0);
+ int pos = maxPosMarginBefore();
+ int neg = maxNegMarginBefore();
+ if (maxPosMarginAfter() > pos)
+ pos = maxPosMarginAfter();
+ if (maxNegMarginAfter() > neg)
+ neg = maxNegMarginAfter();
+ setMaxMarginBeforeValues(pos, neg);
+ setMaxMarginAfterValues(0, 0);
}
// Add in the overflow from children.
@@ -372,7 +372,7 @@ void RenderFlexibleBox::layoutHorizontalBox(bool relayoutChildren)
}
// Compute the child's vertical margins.
- child->calcVerticalMargins();
+ child->computeBlockDirectionMargins(this);
if (!child->needsLayout() && paginated && view()->layoutState()->m_pageHeight) {
RenderBlock* childRenderBlock = child->isRenderBlock() ? toRenderBlock(child) : 0;
@@ -412,7 +412,7 @@ void RenderFlexibleBox::layoutHorizontalBox(bool relayoutChildren)
setHeight(height() + toAdd);
oldHeight = height();
- calcHeight();
+ computeLogicalHeight();
relayoutChildren = false;
if (oldHeight != height())
@@ -444,7 +444,7 @@ void RenderFlexibleBox::layoutHorizontalBox(bool relayoutChildren)
// fill the height of a containing box by default.
// Now do a layout.
int oldChildHeight = child->height();
- child->calcHeight();
+ child->computeLogicalHeight();
if (oldChildHeight != child->height())
child->setChildNeedsLayout(true, false);
@@ -643,7 +643,7 @@ void RenderFlexibleBox::layoutHorizontalBox(bool relayoutChildren)
}
}
- // So that the calcHeight in layoutBlock() knows to relayout positioned objects because of
+ // So that the computeLogicalHeight in layoutBlock() knows to relayout positioned objects because of
// a height change, we revert our height back to the intrinsic height before returning.
if (heightSpecified)
setHeight(oldHeight);
@@ -713,7 +713,7 @@ void RenderFlexibleBox::layoutVerticalBox(bool relayoutChildren)
}
// Compute the child's vertical margins.
- child->calcVerticalMargins();
+ child->computeBlockDirectionMargins(this);
// Add in the child's marginTop to our height.
setHeight(height() + child->marginTop());
@@ -769,7 +769,7 @@ void RenderFlexibleBox::layoutVerticalBox(bool relayoutChildren)
// Now we have to calc our height, so we know how much space we have remaining.
oldHeight = height();
- calcHeight();
+ computeLogicalHeight();
if (oldHeight != height())
heightSpecified = true;
@@ -925,7 +925,7 @@ void RenderFlexibleBox::layoutVerticalBox(bool relayoutChildren)
}
}
- // So that the calcHeight in layoutBlock() knows to relayout positioned objects because of
+ // So that the computeLogicalHeight in layoutBlock() knows to relayout positioned objects because of
// a height change, we revert our height back to the intrinsic height before returning.
if (heightSpecified)
setHeight(oldHeight);
@@ -1001,7 +1001,7 @@ void RenderFlexibleBox::applyLineClamp(FlexBoxIterator& iterator, bool relayoutC
int totalWidth;
InlineBox* anchorBox = lastLine->lastChild();
if (anchorBox && anchorBox->renderer()->node() && anchorBox->renderer()->node()->isLink())
- totalWidth = anchorBox->width() + font.width(TextRun(ellipsisAndSpace, 2));
+ totalWidth = anchorBox->logicalWidth() + font.width(TextRun(ellipsisAndSpace, 2));
else {
anchorBox = 0;
totalWidth = font.width(TextRun(&horizontalEllipsis, 1));
@@ -1018,12 +1018,12 @@ void RenderFlexibleBox::applyLineClamp(FlexBoxIterator& iterator, bool relayoutC
continue;
int ltr = true;
- int blockRightEdge = destBlock->rightOffset(lastVisibleLine->y(), false);
- int blockLeftEdge = destBlock->leftOffset(lastVisibleLine->y(), false);
+ int blockRightEdge = destBlock->logicalRightOffsetForLine(lastVisibleLine->y(), false);
+ int blockLeftEdge = destBlock->logicalLeftOffsetForLine(lastVisibleLine->y(), false);
int blockEdge = ltr ? blockRightEdge : blockLeftEdge;
if (!lastVisibleLine->canAccommodateEllipsis(ltr, blockEdge,
- lastVisibleLine->x() + lastVisibleLine->width(),
+ lastVisibleLine->x() + lastVisibleLine->logicalWidth(),
totalWidth))
continue;
@@ -1062,9 +1062,9 @@ int RenderFlexibleBox::allowedChildFlex(RenderBox* child, bool expanding, unsign
child->style()->maxWidth().isFixed())
maxW = child->style()->maxWidth().value();
else if (child->style()->maxWidth().type() == Intrinsic)
- maxW = child->maxPrefWidth();
+ maxW = child->maxPreferredLogicalWidth();
else if (child->style()->maxWidth().type() == MinIntrinsic)
- maxW = child->minPrefWidth();
+ maxW = child->minPreferredLogicalWidth();
if (maxW == INT_MAX)
return maxW;
return max(0, maxW - w);
@@ -1083,14 +1083,14 @@ int RenderFlexibleBox::allowedChildFlex(RenderBox* child, bool expanding, unsign
// FIXME: For now just handle fixed values.
if (isHorizontal()) {
- int minW = child->minPrefWidth();
+ int minW = child->minPreferredLogicalWidth();
int w = child->overrideWidth() - child->borderAndPaddingWidth();
if (child->style()->minWidth().isFixed())
minW = child->style()->minWidth().value();
else if (child->style()->minWidth().type() == Intrinsic)
- minW = child->maxPrefWidth();
+ minW = child->maxPreferredLogicalWidth();
else if (child->style()->minWidth().type() == MinIntrinsic)
- minW = child->minPrefWidth();
+ minW = child->minPreferredLogicalWidth();
int allowedShrinkage = min(0, minW - w);
return allowedShrinkage;
diff --git a/WebCore/rendering/RenderFlexibleBox.h b/WebCore/rendering/RenderFlexibleBox.h
index 2aa20b5..8525c29 100644
--- a/WebCore/rendering/RenderFlexibleBox.h
+++ b/WebCore/rendering/RenderFlexibleBox.h
@@ -36,7 +36,7 @@ public:
virtual const char* renderName() const;
- virtual void calcPrefWidths();
+ virtual void computePreferredLogicalWidths();
void calcHorizontalPrefWidths();
void calcVerticalPrefWidths();
diff --git a/WebCore/rendering/RenderForeignObject.cpp b/WebCore/rendering/RenderForeignObject.cpp
index bfcb940..839e963 100644
--- a/WebCore/rendering/RenderForeignObject.cpp
+++ b/WebCore/rendering/RenderForeignObject.cpp
@@ -82,13 +82,13 @@ const AffineTransform& RenderForeignObject::localToParentTransform() const
return m_localToParentTransform;
}
-void RenderForeignObject::calcWidth()
+void RenderForeignObject::computeLogicalWidth()
{
// FIXME: Investigate in size rounding issues
setWidth(static_cast<int>(roundf(m_viewport.width())));
}
-void RenderForeignObject::calcHeight()
+void RenderForeignObject::computeLogicalHeight()
{
// FIXME: Investigate in size rounding issues
setHeight(static_cast<int>(roundf(m_viewport.height())));
@@ -99,7 +99,7 @@ void RenderForeignObject::layout()
ASSERT(needsLayout());
ASSERT(!view()->layoutStateEnabled()); // RenderSVGRoot disables layoutState for the SVG rendering tree.
- LayoutRepainter repainter(*this, m_everHadLayout && checkForRepaintDuringLayout());
+ LayoutRepainter repainter(*this, checkForRepaintDuringLayout());
SVGForeignObjectElement* foreign = static_cast<SVGForeignObjectElement*>(node());
bool updateCachedBoundariesInParents = false;
diff --git a/WebCore/rendering/RenderForeignObject.h b/WebCore/rendering/RenderForeignObject.h
index d8c1f68..87423e6 100644
--- a/WebCore/rendering/RenderForeignObject.h
+++ b/WebCore/rendering/RenderForeignObject.h
@@ -57,8 +57,8 @@ public:
virtual void setNeedsTransformUpdate() { m_needsTransformUpdate = true; }
private:
- virtual void calcWidth();
- virtual void calcHeight();
+ virtual void computeLogicalWidth();
+ virtual void computeLogicalHeight();
virtual const AffineTransform& localToParentTransform() const;
virtual AffineTransform localTransform() const { return m_localTransform; }
diff --git a/WebCore/rendering/RenderFrameBase.cpp b/WebCore/rendering/RenderFrameBase.cpp
index 4a62f8a..b36ad3a 100644
--- a/WebCore/rendering/RenderFrameBase.cpp
+++ b/WebCore/rendering/RenderFrameBase.cpp
@@ -53,8 +53,8 @@ void RenderFrameBase::layoutWithFlattening(bool fixedWidth, bool fixedHeight)
// need to update to calculate min/max correctly
updateWidgetPosition();
- if (childRoot->prefWidthsDirty())
- childRoot->calcPrefWidths();
+ if (childRoot->preferredLogicalWidthsDirty())
+ childRoot->computePreferredLogicalWidths();
// if scrollbars are off, and the width or height are fixed
// we obey them and do not expand. With frame flattening
@@ -69,7 +69,7 @@ void RenderFrameBase::layoutWithFlattening(bool fixedWidth, bool fixedHeight)
// make sure minimum preferred width is enforced
if (isScrollable || !fixedWidth) {
- setWidth(max(width(), childRoot->minPrefWidth() + hBorder));
+ setWidth(max(width(), childRoot->minPreferredLogicalWidth() + hBorder));
// update again to pass the new width to the child frame
updateWidgetPosition();
childFrameView->layout();
diff --git a/WebCore/rendering/RenderHTMLCanvas.cpp b/WebCore/rendering/RenderHTMLCanvas.cpp
index c89495b..68bb536 100644
--- a/WebCore/rendering/RenderHTMLCanvas.cpp
+++ b/WebCore/rendering/RenderHTMLCanvas.cpp
@@ -73,12 +73,12 @@ void RenderHTMLCanvas::canvasSizeChanged()
if (!parent())
return;
- if (!prefWidthsDirty())
- setPrefWidthsDirty(true);
+ if (!preferredLogicalWidthsDirty())
+ setPreferredLogicalWidthsDirty(true);
IntSize oldSize = size();
- calcWidth();
- calcHeight();
+ computeLogicalWidth();
+ computeLogicalHeight();
if (oldSize == size())
return;
diff --git a/WebCore/rendering/RenderIFrame.cpp b/WebCore/rendering/RenderIFrame.cpp
index 8421c9e..cbe4c70 100644
--- a/WebCore/rendering/RenderIFrame.cpp
+++ b/WebCore/rendering/RenderIFrame.cpp
@@ -41,8 +41,9 @@ RenderIFrame::RenderIFrame(Element* element)
{
}
-void RenderIFrame::calcHeight()
+void RenderIFrame::computeLogicalHeight()
{
+<<<<<<< HEAD
RenderPart::calcHeight();
#ifdef ANDROID_FLATTEN_IFRAME
if (!node()->hasTagName(iframeTag) || !widget() || !widget()->isFrameView())
@@ -68,6 +69,9 @@ void RenderIFrame::calcHeight()
updateWidgetPosition();
return;
#endif
+=======
+ RenderPart::computeLogicalHeight();
+>>>>>>> webkit.org at r68651
if (!flattenFrame())
return;
@@ -83,8 +87,9 @@ void RenderIFrame::calcHeight()
}
}
-void RenderIFrame::calcWidth()
+void RenderIFrame::computeLogicalWidth()
{
+<<<<<<< HEAD
RenderPart::calcWidth();
#ifdef ANDROID_FLATTEN_IFRAME
if (!node()->hasTagName(iframeTag) || !widget() || !widget()->isFrameView())
@@ -117,6 +122,9 @@ void RenderIFrame::calcWidth()
updateWidgetPosition();
return;
#endif
+=======
+ RenderPart::computeLogicalWidth();
+>>>>>>> webkit.org at r68651
if (!flattenFrame())
return;
@@ -162,8 +170,8 @@ void RenderIFrame::layout()
{
ASSERT(needsLayout());
- RenderPart::calcWidth();
- RenderPart::calcHeight();
+ RenderPart::computeLogicalWidth();
+ RenderPart::computeLogicalHeight();
#ifdef ANDROID_FLATTEN_IFRAME
// Calculate the styled dimensions by subtracting the border and padding.
diff --git a/WebCore/rendering/RenderIFrame.h b/WebCore/rendering/RenderIFrame.h
index ab659a4..325e2b3 100644
--- a/WebCore/rendering/RenderIFrame.h
+++ b/WebCore/rendering/RenderIFrame.h
@@ -39,8 +39,8 @@ public:
#endif
private:
- virtual void calcHeight();
- virtual void calcWidth();
+ virtual void computeLogicalHeight();
+ virtual void computeLogicalWidth();
virtual void layout();
diff --git a/WebCore/rendering/RenderImage.cpp b/WebCore/rendering/RenderImage.cpp
index d5d52f6..dd01861 100644
--- a/WebCore/rendering/RenderImage.cpp
+++ b/WebCore/rendering/RenderImage.cpp
@@ -155,10 +155,10 @@ void RenderImage::imageChanged(WrappedImagePtr newImage, const IntRect* rect)
// lets see if we need to relayout at all..
int oldwidth = width();
int oldheight = height();
- if (!prefWidthsDirty())
- setPrefWidthsDirty(true);
- calcWidth();
- calcHeight();
+ if (!preferredLogicalWidthsDirty())
+ setPreferredLogicalWidthsDirty(true);
+ computeLogicalWidth();
+ computeLogicalHeight();
if (imageSizeChanged || width() != oldwidth || height() != oldheight) {
shouldRepaint = false;
@@ -369,7 +369,7 @@ HTMLMapElement* RenderImage::imageMap() const
bool RenderImage::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, int x, int y, int tx, int ty, HitTestAction hitTestAction)
{
- HitTestResult tempResult(result.point(), result.padding());
+ HitTestResult tempResult(result.point(), result.topPadding(), result.rightPadding(), result.bottomPadding(), result.leftPadding());
bool inside = RenderReplaced::nodeAtPoint(request, tempResult, x, y, tx, ty, hitTestAction);
if (tempResult.innerNode() && node()) {
@@ -439,7 +439,7 @@ bool RenderImage::isHeightSpecified() const
return false;
}
-int RenderImage::calcReplacedWidth(bool includeMaxWidth) const
+int RenderImage::computeReplacedWidth(bool includeMaxWidth) const
{
if (m_imageResource->imageHasRelativeWidth())
if (RenderObject* cb = isPositioned() ? container() : containingBlock()) {
@@ -449,7 +449,7 @@ int RenderImage::calcReplacedWidth(bool includeMaxWidth) const
int width;
if (isWidthSpecified())
- width = calcReplacedWidthUsing(style()->width());
+ width = computeReplacedWidthUsing(style()->width());
else if (m_imageResource->usesImageContainerSize())
width = m_imageResource->imageSize(style()->effectiveZoom()).width();
else if (m_imageResource->imageHasRelativeWidth())
@@ -457,8 +457,8 @@ int RenderImage::calcReplacedWidth(bool includeMaxWidth) const
else
width = calcAspectRatioWidth();
- int minW = calcReplacedWidthUsing(style()->minWidth());
- int maxW = !includeMaxWidth || style()->maxWidth().isUndefined() ? width : calcReplacedWidthUsing(style()->maxWidth());
+ int minW = computeReplacedWidthUsing(style()->minWidth());
+ int maxW = !includeMaxWidth || style()->maxWidth().isUndefined() ? width : computeReplacedWidthUsing(style()->maxWidth());
#ifdef ANDROID_LAYOUT
width = max(minW, min(width, maxW));
@@ -474,11 +474,11 @@ int RenderImage::calcReplacedWidth(bool includeMaxWidth) const
#endif
}
-int RenderImage::calcReplacedHeight() const
+int RenderImage::computeReplacedHeight() const
{
int height;
if (isHeightSpecified())
- height = calcReplacedHeightUsing(style()->height());
+ height = computeReplacedHeightUsing(style()->height());
else if (m_imageResource->usesImageContainerSize())
height = m_imageResource->imageSize(style()->effectiveZoom()).height();
else if (m_imageResource->imageHasRelativeHeight())
@@ -486,8 +486,8 @@ int RenderImage::calcReplacedHeight() const
else
height = calcAspectRatioHeight();
- int minH = calcReplacedHeightUsing(style()->minHeight());
- int maxH = style()->maxHeight().isUndefined() ? height : calcReplacedHeightUsing(style()->maxHeight());
+ int minH = computeReplacedHeightUsing(style()->minHeight());
+ int maxH = style()->maxHeight().isUndefined() ? height : computeReplacedHeightUsing(style()->maxHeight());
#ifdef ANDROID_LAYOUT
height = max(minH, min(height, maxH));
@@ -520,7 +520,7 @@ int RenderImage::calcAspectRatioWidth() const
return 0;
if (!m_imageResource->hasImage() || m_imageResource->errorOccurred())
return size.width(); // Don't bother scaling.
- return RenderBox::calcReplacedHeight() * size.width() / size.height();
+ return RenderBox::computeReplacedHeight() * size.width() / size.height();
}
int RenderImage::calcAspectRatioHeight() const
@@ -530,7 +530,7 @@ int RenderImage::calcAspectRatioHeight() const
return 0;
if (!m_imageResource->hasImage() || m_imageResource->errorOccurred())
return size.height(); // Don't bother scaling.
- return RenderBox::calcReplacedWidth() * size.height() / size.width();
+ return RenderBox::computeReplacedWidth() * size.height() / size.width();
}
} // namespace WebCore
diff --git a/WebCore/rendering/RenderImage.h b/WebCore/rendering/RenderImage.h
index f9acba8..022d792 100644
--- a/WebCore/rendering/RenderImage.h
+++ b/WebCore/rendering/RenderImage.h
@@ -61,7 +61,11 @@ protected:
bool isWidthSpecified() const;
bool isHeightSpecified() const;
- virtual void intrinsicSizeChanged() { imageChanged(m_imageResource->imagePtr()); }
+ virtual void intrinsicSizeChanged()
+ {
+ if (m_imageResource)
+ imageChanged(m_imageResource->imagePtr());
+ }
private:
virtual const char* renderName() const { return "RenderImage"; }
@@ -76,8 +80,8 @@ private:
virtual void notifyFinished(CachedResource*);
virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int x, int y, int tx, int ty, HitTestAction);
- virtual int calcReplacedWidth(bool includeMaxWidth = true) const;
- virtual int calcReplacedHeight() const;
+ virtual int computeReplacedWidth(bool includeMaxWidth = true) const;
+ virtual int computeReplacedHeight() const;
int calcAspectRatioWidth() const;
int calcAspectRatioHeight() const;
diff --git a/WebCore/rendering/RenderIndicator.cpp b/WebCore/rendering/RenderIndicator.cpp
index 32ef916..cd7be36 100644
--- a/WebCore/rendering/RenderIndicator.cpp
+++ b/WebCore/rendering/RenderIndicator.cpp
@@ -44,8 +44,8 @@ void RenderIndicator::layout()
ASSERT(needsLayout());
LayoutRepainter repainter(*this, checkForRepaintDuringLayout());
- calcWidth();
- calcHeight();
+ computeLogicalWidth();
+ computeLogicalHeight();
layoutParts();
repainter.repaintAfterLayout();
setNeedsLayout(false);
diff --git a/WebCore/rendering/RenderInline.cpp b/WebCore/rendering/RenderInline.cpp
index c985b92..b4bfe2f 100644
--- a/WebCore/rendering/RenderInline.cpp
+++ b/WebCore/rendering/RenderInline.cpp
@@ -413,7 +413,7 @@ void RenderInline::absoluteRects(Vector<IntRect>& rects, int tx, int ty)
{
if (InlineFlowBox* curr = firstLineBox()) {
for (; curr; curr = curr->nextLineBox())
- rects.append(IntRect(tx + curr->x(), ty + curr->y(), curr->width(), curr->height()));
+ rects.append(IntRect(tx + curr->x(), ty + curr->y(), curr->logicalWidth(), curr->logicalHeight()));
} else
rects.append(IntRect(tx, ty, 0, 0));
@@ -432,7 +432,7 @@ void RenderInline::absoluteQuads(Vector<FloatQuad>& quads)
{
if (InlineFlowBox* curr = firstLineBox()) {
for (; curr; curr = curr->nextLineBox()) {
- FloatRect localRect(curr->x(), curr->y(), curr->width(), curr->height());
+ FloatRect localRect(curr->x(), curr->y(), curr->logicalWidth(), curr->logicalHeight());
quads.append(localToAbsoluteQuad(localRect));
}
} else
@@ -458,28 +458,53 @@ int RenderInline::offsetTop() const
return y;
}
-int RenderInline::marginLeft() const
+static int computeMargin(const RenderInline* renderer, const Length& margin)
{
- Length margin = style()->marginLeft();
if (margin.isAuto())
return 0;
if (margin.isFixed())
return margin.value();
if (margin.isPercent())
- return margin.calcMinValue(max(0, containingBlock()->availableWidth()));
+ return margin.calcMinValue(max(0, renderer->containingBlock()->availableLogicalWidth()));
return 0;
}
+int RenderInline::marginLeft() const
+{
+ if (!style()->isVerticalBlockFlow())
+ return 0;
+ return computeMargin(this, style()->marginLeft());
+}
+
int RenderInline::marginRight() const
{
- Length margin = style()->marginRight();
- if (margin.isAuto())
+ if (!style()->isVerticalBlockFlow())
return 0;
- if (margin.isFixed())
- return margin.value();
- if (margin.isPercent())
- return margin.calcMinValue(max(0, containingBlock()->availableWidth()));
- return 0;
+ return computeMargin(this, style()->marginRight());
+}
+
+int RenderInline::marginTop() const
+{
+ if (style()->isVerticalBlockFlow())
+ return 0;
+ return computeMargin(this, style()->marginTop());
+}
+
+int RenderInline::marginBottom() const
+{
+ if (style()->isVerticalBlockFlow())
+ return 0;
+ return computeMargin(this, style()->marginBottom());
+}
+
+int RenderInline::marginStart() const
+{
+ return computeMargin(this, style()->marginStart());
+}
+
+int RenderInline::marginEnd() const
+{
+ return computeMargin(this, style()->marginEnd());
}
const char* RenderInline::renderName() const
@@ -538,12 +563,12 @@ IntRect RenderInline::linesBoundingBox() const
for (InlineFlowBox* curr = firstLineBox(); curr; curr = curr->nextLineBox()) {
if (curr == firstLineBox() || curr->x() < leftSide)
leftSide = curr->x();
- if (curr == firstLineBox() || curr->x() + curr->width() > rightSide)
- rightSide = curr->x() + curr->width();
+ if (curr == firstLineBox() || curr->x() + curr->logicalWidth() > rightSide)
+ rightSide = curr->x() + curr->logicalWidth();
}
result.setWidth(rightSide - leftSide);
result.setX(leftSide);
- result.setHeight(lastLineBox()->y() + lastLineBox()->height() - firstLineBox()->y());
+ result.setHeight(lastLineBox()->y() + lastLineBox()->logicalHeight() - firstLineBox()->y());
result.setY(firstLineBox()->y());
}
@@ -931,8 +956,8 @@ void RenderInline::addFocusRingRects(Vector<IntRect>& rects, int tx, int ty)
for (InlineFlowBox* curr = firstLineBox(); curr; curr = curr->nextLineBox()) {
RootInlineBox* root = curr->root();
int top = max(root->lineTop(), curr->y());
- int bottom = min(root->lineBottom(), curr->y() + curr->height());
- IntRect rect(tx + curr->x(), ty + top, curr->width(), bottom - top);
+ int bottom = min(root->lineBottom(), curr->y() + curr->logicalHeight());
+ IntRect rect(tx + curr->x(), ty + top, curr->logicalWidth(), bottom - top);
if (!rect.isEmpty())
rects.append(rect);
}
@@ -988,8 +1013,8 @@ void RenderInline::paintOutline(GraphicsContext* graphicsContext, int tx, int ty
for (InlineFlowBox* curr = firstLineBox(); curr; curr = curr->nextLineBox()) {
RootInlineBox* root = curr->root();
int top = max(root->lineTop(), curr->y());
- int bottom = min(root->lineBottom(), curr->y() + curr->height());
- rects.append(IntRect(curr->x(), top, curr->width(), bottom - top));
+ int bottom = min(root->lineBottom(), curr->y() + curr->logicalHeight());
+ rects.append(IntRect(curr->x(), top, curr->logicalWidth(), bottom - top));
}
rects.append(IntRect());
diff --git a/WebCore/rendering/RenderInline.h b/WebCore/rendering/RenderInline.h
index 71a8a89..feb8b8f 100644
--- a/WebCore/rendering/RenderInline.h
+++ b/WebCore/rendering/RenderInline.h
@@ -40,7 +40,13 @@ public:
virtual int marginLeft() const;
virtual int marginRight() const;
-
+ virtual int marginTop() const;
+ virtual int marginBottom() const;
+ virtual int marginBefore() const { return 0; }
+ virtual int marginAfter() const { return 0; }
+ virtual int marginStart() const;
+ virtual int marginEnd() const;
+
virtual void absoluteRects(Vector<IntRect>&, int tx, int ty);
virtual void absoluteQuads(Vector<FloatQuad>&);
@@ -108,9 +114,6 @@ private:
virtual int offsetWidth() const { return linesBoundingBox().width(); }
virtual int offsetHeight() const { return linesBoundingBox().height(); }
- // Just ignore top/bottom margins on RenderInlines.
- virtual int marginTop() const { return 0; }
- virtual int marginBottom() const { return 0; }
virtual IntRect clippedOverflowRectForRepaint(RenderBoxModelObject* repaintContainer);
virtual IntRect rectWithOutlineForRepaint(RenderBoxModelObject* repaintContainer, int outlineWidth);
virtual void computeRectForRepaint(RenderBoxModelObject* repaintContainer, IntRect& rect, bool fixed);
diff --git a/WebCore/rendering/RenderLayer.cpp b/WebCore/rendering/RenderLayer.cpp
index da6fad1..63233e5 100644
--- a/WebCore/rendering/RenderLayer.cpp
+++ b/WebCore/rendering/RenderLayer.cpp
@@ -468,6 +468,28 @@ TransformationMatrix RenderLayer::renderableTransform(PaintBehavior paintBehavio
return *m_transform;
}
+static bool checkContainingBlockChainForPagination(RenderBoxModelObject* renderer, RenderBox* ancestorColumnsRenderer)
+{
+ RenderView* view = renderer->view();
+ RenderBoxModelObject* prevBlock = renderer;
+ RenderBlock* containingBlock;
+ for (containingBlock = renderer->containingBlock();
+ containingBlock && containingBlock != view && containingBlock != ancestorColumnsRenderer;
+ containingBlock = containingBlock->containingBlock())
+ prevBlock = containingBlock;
+
+ // If the columns block wasn't in our containing block chain, then we aren't paginated by it.
+ if (containingBlock != ancestorColumnsRenderer)
+ return false;
+
+ // If the previous block is absolutely positioned, then we can't be paginated by the columns block.
+ if (prevBlock->isPositioned())
+ return false;
+
+ // Otherwise we are paginated by the columns block.
+ return true;
+}
+
void RenderLayer::updatePagination()
{
m_isPaginated = false;
@@ -484,10 +506,10 @@ void RenderLayer::updatePagination()
RenderLayer* ancestorStackingContext = stackingContext();
for (RenderLayer* curr = parent(); curr; curr = curr->parent()) {
if (curr->renderer()->hasColumns()) {
- m_isPaginated = true;
+ m_isPaginated = checkContainingBlockChainForPagination(renderer(), curr->renderBox());
return;
}
- if (curr == ancestorStackingContext || (curr->parent() && curr->parent()->renderer()->isPositioned()))
+ if (curr == ancestorStackingContext)
return;
}
}
@@ -2912,7 +2934,7 @@ RenderLayer* RenderLayer::hitTestLayer(RenderLayer* rootLayer, RenderLayer* cont
// Next we want to see if the mouse pos is inside the child RenderObjects of the layer.
if (fgRect.intersects(hitTestArea) && isSelfPaintingLayer()) {
// Hit test with a temporary HitTestResult, because we only want to commit to 'result' if we know we're frontmost.
- HitTestResult tempResult(result.point(), result.padding());
+ HitTestResult tempResult(result.point(), result.topPadding(), result.rightPadding(), result.bottomPadding(), result.leftPadding());
if (hitTestContents(request, tempResult, layerBounds, hitTestPoint, HitTestDescendants) &&
isHitCandidate(this, false, zOffsetForContentsPtr, unflattenedTransformState.get())) {
if (result.isRectBasedTest())
@@ -2941,7 +2963,7 @@ RenderLayer* RenderLayer::hitTestLayer(RenderLayer* rootLayer, RenderLayer* cont
return candidateLayer;
if (bgRect.intersects(hitTestArea) && isSelfPaintingLayer()) {
- HitTestResult tempResult(result.point(), result.padding());
+ HitTestResult tempResult(result.point(), result.topPadding(), result.rightPadding(), result.bottomPadding(), result.leftPadding());
if (hitTestContents(request, tempResult, layerBounds, hitTestPoint, HitTestSelf) &&
isHitCandidate(this, false, zOffsetForContentsPtr, unflattenedTransformState.get())) {
if (result.isRectBasedTest())
@@ -2998,7 +3020,7 @@ RenderLayer* RenderLayer::hitTestList(Vector<RenderLayer*>* list, RenderLayer* r
for (int i = list->size() - 1; i >= 0; --i) {
RenderLayer* childLayer = list->at(i);
RenderLayer* hitLayer = 0;
- HitTestResult tempResult(result.point(), result.padding());
+ HitTestResult tempResult(result.point(), result.topPadding(), result.rightPadding(), result.bottomPadding(), result.leftPadding());
if (childLayer->isPaginated())
hitLayer = hitTestPaginatedChildLayer(childLayer, rootLayer, request, tempResult, hitTestRect, hitTestPoint, transformState, zOffsetForDescendants);
else
diff --git a/WebCore/rendering/RenderLayerBacking.cpp b/WebCore/rendering/RenderLayerBacking.cpp
index dbd61e1..68086ca 100644
--- a/WebCore/rendering/RenderLayerBacking.cpp
+++ b/WebCore/rendering/RenderLayerBacking.cpp
@@ -1209,6 +1209,16 @@ bool RenderLayerBacking::startAnimation(double timeOffset, const Animation* anim
return runningAcceleratedAnimation;
}
+void RenderLayerBacking::animationPaused(double timeOffset, const String& animationName)
+{
+ m_graphicsLayer->pauseAnimation(animationName, timeOffset);
+}
+
+void RenderLayerBacking::animationFinished(const String& animationName)
+{
+ m_graphicsLayer->removeAnimation(animationName);
+}
+
bool RenderLayerBacking::startTransition(double timeOffset, int property, const RenderStyle* fromStyle, const RenderStyle* toStyle)
{
bool didAnimate = false;
@@ -1221,7 +1231,7 @@ bool RenderLayerBacking::startTransition(double timeOffset, int property, const
opacityVector.insert(new FloatAnimationValue(0, compositingOpacity(fromStyle->opacity())));
opacityVector.insert(new FloatAnimationValue(1, compositingOpacity(toStyle->opacity())));
// The boxSize param is only used for transform animations (which can only run on RenderBoxes), so we pass an empty size here.
- if (m_graphicsLayer->addAnimation(opacityVector, IntSize(), opacityAnim, String(), timeOffset)) {
+ if (m_graphicsLayer->addAnimation(opacityVector, IntSize(), opacityAnim, GraphicsLayer::animationNameForTransition(AnimatedPropertyOpacity), timeOffset)) {
// To ensure that the correct opacity is visible when the animation ends, also set the final opacity.
updateLayerOpacity(toStyle);
didAnimate = true;
@@ -1235,7 +1245,7 @@ bool RenderLayerBacking::startTransition(double timeOffset, int property, const
KeyframeValueList transformVector(AnimatedPropertyWebkitTransform);
transformVector.insert(new TransformAnimationValue(0, &fromStyle->transform()));
transformVector.insert(new TransformAnimationValue(1, &toStyle->transform()));
- if (m_graphicsLayer->addAnimation(transformVector, toRenderBox(renderer())->borderBoxRect().size(), transformAnim, String(), timeOffset)) {
+ if (m_graphicsLayer->addAnimation(transformVector, toRenderBox(renderer())->borderBoxRect().size(), transformAnim, GraphicsLayer::animationNameForTransition(AnimatedPropertyWebkitTransform), timeOffset)) {
// To ensure that the correct transform is visible when the animation ends, also set the final opacity.
updateLayerTransform(toStyle);
didAnimate = true;
@@ -1249,34 +1259,32 @@ bool RenderLayerBacking::startTransition(double timeOffset, int property, const
return didAnimate;
}
-void RenderLayerBacking::notifyAnimationStarted(const GraphicsLayer*, double time)
-{
- renderer()->animation()->notifyAnimationStarted(renderer(), time);
-}
-
-void RenderLayerBacking::notifySyncRequired(const GraphicsLayer*)
+void RenderLayerBacking::transitionPaused(double timeOffset, int property)
{
- if (!renderer()->documentBeingDestroyed())
- compositor()->scheduleSync();
+ AnimatedPropertyID animatedProperty = cssToGraphicsLayerProperty(property);
+ if (animatedProperty != AnimatedPropertyInvalid)
+ m_graphicsLayer->pauseAnimation(GraphicsLayer::animationNameForTransition(animatedProperty), timeOffset);
}
-void RenderLayerBacking::animationFinished(const String& animationName)
+void RenderLayerBacking::transitionFinished(int property)
{
- m_graphicsLayer->removeAnimationsForKeyframes(animationName);
+ AnimatedPropertyID animatedProperty = cssToGraphicsLayerProperty(property);
+ if (animatedProperty != AnimatedPropertyInvalid)
+ m_graphicsLayer->removeAnimation(GraphicsLayer::animationNameForTransition(animatedProperty));
}
-void RenderLayerBacking::animationPaused(double timeOffset, const String& animationName)
+void RenderLayerBacking::notifyAnimationStarted(const GraphicsLayer*, double time)
{
- m_graphicsLayer->pauseAnimation(animationName, timeOffset);
+ renderer()->animation()->notifyAnimationStarted(renderer(), time);
}
-void RenderLayerBacking::transitionFinished(int property)
+void RenderLayerBacking::notifySyncRequired(const GraphicsLayer*)
{
- AnimatedPropertyID animatedProperty = cssToGraphicsLayerProperty(property);
- if (animatedProperty != AnimatedPropertyInvalid)
- m_graphicsLayer->removeAnimationsForProperty(animatedProperty);
+ if (!renderer()->documentBeingDestroyed())
+ compositor()->scheduleSync();
}
+// This is used for the 'freeze' API, for testing only.
void RenderLayerBacking::suspendAnimations(double time)
{
m_graphicsLayer->suspendAnimations(time);
diff --git a/WebCore/rendering/RenderLayerBacking.h b/WebCore/rendering/RenderLayerBacking.h
index 808000b..fb3ab67 100644
--- a/WebCore/rendering/RenderLayerBacking.h
+++ b/WebCore/rendering/RenderLayerBacking.h
@@ -105,12 +105,14 @@ public:
void rendererContentChanged();
// Interface to start, finish, suspend and resume animations and transitions
- bool startAnimation(double timeOffset, const Animation* anim, const KeyframeList& keyframes);
bool startTransition(double timeOffset, int property, const RenderStyle* fromStyle, const RenderStyle* toStyle);
- void animationFinished(const String& name);
- void animationPaused(double timeOffset, const String& name);
+ void transitionPaused(double timeOffset, int property);
void transitionFinished(int property);
+ bool startAnimation(double timeOffset, const Animation* anim, const KeyframeList& keyframes);
+ void animationPaused(double timeOffset, const String& name);
+ void animationFinished(const String& name);
+
void suspendAnimations(double time = 0);
void resumeAnimations();
diff --git a/WebCore/rendering/RenderLineBoxList.cpp b/WebCore/rendering/RenderLineBoxList.cpp
index 45e66eb..760d2ea 100644
--- a/WebCore/rendering/RenderLineBoxList.cpp
+++ b/WebCore/rendering/RenderLineBoxList.cpp
@@ -246,16 +246,16 @@ bool RenderLineBoxList::hitTest(RenderBoxModelObject* renderer, const HitTestReq
// contain the point. This is a quick short-circuit that we can take to avoid walking any lines.
// FIXME: This check is flawed in the following extremely obscure way:
// if some line in the middle has a huge overflow, it might actually extend below the last line.
- if (y - result.paddingHeight() >= ty + lastLineBox()->root()->bottomVisibleOverflow()
- || y + result.paddingHeight() < ty + firstLineBox()->root()->topVisibleOverflow())
+ if (y - result.topPadding() >= ty + lastLineBox()->root()->bottomVisibleOverflow()
+ || y + result.bottomPadding() < ty + firstLineBox()->root()->topVisibleOverflow())
return false;
// See if our root lines contain the point. If so, then we hit test
// them further. Note that boxes can easily overlap, so we can't make any assumptions
// based off positions of our first line box or our last line box.
for (InlineFlowBox* curr = lastLineBox(); curr; curr = curr->prevLineBox()) {
- if (y + result.paddingHeight() >= ty + curr->root()->topVisibleOverflow()
- && y - result.paddingHeight() < ty + curr->root()->bottomVisibleOverflow()) {
+ if (y + result.bottomPadding() >= ty + curr->root()->topVisibleOverflow()
+ && y - result.topPadding() < ty + curr->root()->bottomVisibleOverflow()) {
bool inside = curr->nodeAtPoint(request, result, x, y, tx, ty);
if (inside) {
renderer->updateHitTestResult(result, IntPoint(x - tx, y - ty));
diff --git a/WebCore/rendering/RenderListBox.cpp b/WebCore/rendering/RenderListBox.cpp
index aa31b6c..39442e1 100644
--- a/WebCore/rendering/RenderListBox.cpp
+++ b/WebCore/rendering/RenderListBox.cpp
@@ -160,39 +160,39 @@ void RenderListBox::scrollToRevealSelection()
scrollToRevealElementAtListIndex(firstIndex);
}
-void RenderListBox::calcPrefWidths()
+void RenderListBox::computePreferredLogicalWidths()
{
ASSERT(!m_optionsChanged);
- m_minPrefWidth = 0;
- m_maxPrefWidth = 0;
+ m_minPreferredLogicalWidth = 0;
+ m_maxPreferredLogicalWidth = 0;
if (style()->width().isFixed() && style()->width().value() > 0)
- m_minPrefWidth = m_maxPrefWidth = calcContentBoxWidth(style()->width().value());
+ m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = computeContentBoxLogicalWidth(style()->width().value());
else {
- m_maxPrefWidth = m_optionsWidth + 2 * optionsSpacingHorizontal;
+ m_maxPreferredLogicalWidth = m_optionsWidth + 2 * optionsSpacingHorizontal;
if (m_vBar)
- m_maxPrefWidth += m_vBar->width();
+ m_maxPreferredLogicalWidth += m_vBar->width();
}
if (style()->minWidth().isFixed() && style()->minWidth().value() > 0) {
- m_maxPrefWidth = max(m_maxPrefWidth, calcContentBoxWidth(style()->minWidth().value()));
- m_minPrefWidth = max(m_minPrefWidth, calcContentBoxWidth(style()->minWidth().value()));
+ m_maxPreferredLogicalWidth = max(m_maxPreferredLogicalWidth, computeContentBoxLogicalWidth(style()->minWidth().value()));
+ m_minPreferredLogicalWidth = max(m_minPreferredLogicalWidth, computeContentBoxLogicalWidth(style()->minWidth().value()));
} else if (style()->width().isPercent() || (style()->width().isAuto() && style()->height().isPercent()))
- m_minPrefWidth = 0;
+ m_minPreferredLogicalWidth = 0;
else
- m_minPrefWidth = m_maxPrefWidth;
+ m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth;
if (style()->maxWidth().isFixed() && style()->maxWidth().value() != undefinedLength) {
- m_maxPrefWidth = min(m_maxPrefWidth, calcContentBoxWidth(style()->maxWidth().value()));
- m_minPrefWidth = min(m_minPrefWidth, calcContentBoxWidth(style()->maxWidth().value()));
+ m_maxPreferredLogicalWidth = min(m_maxPreferredLogicalWidth, computeContentBoxLogicalWidth(style()->maxWidth().value()));
+ m_minPreferredLogicalWidth = min(m_minPreferredLogicalWidth, computeContentBoxLogicalWidth(style()->maxWidth().value()));
}
int toAdd = borderAndPaddingWidth();
- m_minPrefWidth += toAdd;
- m_maxPrefWidth += toAdd;
+ m_minPreferredLogicalWidth += toAdd;
+ m_maxPreferredLogicalWidth += toAdd;
- setPrefWidthsDirty(false);
+ setPreferredLogicalWidthsDirty(false);
}
int RenderListBox::size() const
@@ -219,14 +219,14 @@ int RenderListBox::listHeight() const
return itemHeight() * numItems() - rowSpacing;
}
-void RenderListBox::calcHeight()
+void RenderListBox::computeLogicalHeight()
{
int toAdd = borderAndPaddingHeight();
int itemHeight = RenderListBox::itemHeight();
setHeight(itemHeight * size() - rowSpacing + toAdd);
- RenderBlock::calcHeight();
+ RenderBlock::computeLogicalHeight();
if (m_vBar) {
bool enabled = numVisibleItems() < numItems();
diff --git a/WebCore/rendering/RenderListBox.h b/WebCore/rendering/RenderListBox.h
index dcee739..c69f205 100644
--- a/WebCore/rendering/RenderListBox.h
+++ b/WebCore/rendering/RenderListBox.h
@@ -70,9 +70,9 @@ private:
virtual bool scroll(ScrollDirection, ScrollGranularity, float multiplier = 1, Node** stopNode = 0);
- virtual void calcPrefWidths();
+ virtual void computePreferredLogicalWidths();
virtual int baselinePosition(bool firstLine, bool isRootLineBox) const;
- virtual void calcHeight();
+ virtual void computeLogicalHeight();
virtual void layout();
diff --git a/WebCore/rendering/RenderListItem.cpp b/WebCore/rendering/RenderListItem.cpp
index 2366a34..b414f38 100644
--- a/WebCore/rendering/RenderListItem.cpp
+++ b/WebCore/rendering/RenderListItem.cpp
@@ -210,7 +210,7 @@ void RenderListItem::updateMarkerLocation()
lineBoxParent = this;
}
- if (markerPar != lineBoxParent || m_marker->prefWidthsDirty()) {
+ if (markerPar != lineBoxParent || m_marker->preferredLogicalWidthsDirty()) {
// Removing and adding the marker can trigger repainting in
// containers other than ourselves, so we need to disable LayoutState.
view()->disableLayoutState();
@@ -219,20 +219,20 @@ void RenderListItem::updateMarkerLocation()
if (!lineBoxParent)
lineBoxParent = this;
lineBoxParent->addChild(m_marker, firstNonMarkerChild(lineBoxParent));
- if (m_marker->prefWidthsDirty())
- m_marker->calcPrefWidths();
+ if (m_marker->preferredLogicalWidthsDirty())
+ m_marker->computePreferredLogicalWidths();
view()->enableLayoutState();
}
}
}
-void RenderListItem::calcPrefWidths()
+void RenderListItem::computePreferredLogicalWidths()
{
- ASSERT(prefWidthsDirty());
+ ASSERT(preferredLogicalWidthsDirty());
updateMarkerLocation();
- RenderBlock::calcPrefWidths();
+ RenderBlock::computePreferredLogicalWidths();
}
void RenderListItem::layout()
@@ -245,7 +245,7 @@ void RenderListItem::layout()
void RenderListItem::positionListMarker()
{
- if (m_marker && !m_marker->isInside() && m_marker->inlineBoxWrapper()) {
+ if (m_marker && m_marker->parent()->isBox() && !m_marker->isInside() && m_marker->inlineBoxWrapper()) {
int markerOldX = m_marker->x();
int yOffset = 0;
int xOffset = 0;
@@ -262,23 +262,23 @@ void RenderListItem::positionListMarker()
// and really shouldn't keep propagating overflow up. This won't really break anything other than repainting
// not being as tight as it could be though.
if (style()->direction() == LTR) {
- int leftLineOffset = leftRelOffset(yOffset, leftOffset(yOffset, false), false);
+ int leftLineOffset = logicalLeftOffsetForLine(yOffset, logicalLeftOffsetForLine(yOffset, false), false);
markerXPos = leftLineOffset - xOffset - paddingLeft() - borderLeft() + m_marker->marginLeft();
m_marker->inlineBoxWrapper()->adjustPosition(markerXPos - markerOldX, 0);
for (InlineFlowBox* box = m_marker->inlineBoxWrapper()->parent(); box; box = box->parent()) {
if (markerXPos < box->leftLayoutOverflow()) {
- box->setHorizontalOverflowPositions(markerXPos, box->rightLayoutOverflow(), box->leftVisualOverflow(), box->rightVisualOverflow());
+ box->setInlineDirectionOverflowPositions(markerXPos, box->rightLayoutOverflow(), box->leftVisualOverflow(), box->rightVisualOverflow());
if (box == root)
adjustOverflow = true;
}
}
} else {
- int rightLineOffset = rightRelOffset(yOffset, rightOffset(yOffset, false), false);
+ int rightLineOffset = logicalRightOffsetForLine(yOffset, logicalRightOffsetForLine(yOffset, false), false);
markerXPos = rightLineOffset - xOffset + paddingRight() + borderRight() + m_marker->marginLeft();
m_marker->inlineBoxWrapper()->adjustPosition(markerXPos - markerOldX, 0);
for (InlineFlowBox* box = m_marker->inlineBoxWrapper()->parent(); box; box = box->parent()) {
if (markerXPos + m_marker->width() > box->rightLayoutOverflow()) {
- box->setHorizontalOverflowPositions(box->leftLayoutOverflow(), markerXPos + m_marker->width(), box->leftVisualOverflow(), box->rightVisualOverflow());
+ box->setInlineDirectionOverflowPositions(box->leftLayoutOverflow(), markerXPos + m_marker->width(), box->leftVisualOverflow(), box->rightVisualOverflow());
if (box == root)
adjustOverflow = true;
}
@@ -314,6 +314,29 @@ const String& RenderListItem::markerText() const
return staticNullString;
}
+String RenderListItem::markerTextWithSuffix() const
+{
+ if (!m_marker)
+ return String();
+
+ // Append the suffix for the marker in the right place depending
+ // on the direction of the text (right-to-left or left-to-right).
+
+ const String& markerText = m_marker->text();
+ const String markerSuffix = m_marker->suffix();
+ Vector<UChar> resultVector;
+
+ if (m_marker->style()->direction() == RTL)
+ resultVector.append(markerSuffix.characters(), markerSuffix.length());
+
+ resultVector.append(markerText.characters(), markerText.length());
+
+ if (m_marker->style()->direction() == LTR)
+ resultVector.append(markerSuffix.characters(), markerSuffix.length());
+
+ return String::adopt(resultVector);
+}
+
void RenderListItem::explicitValueChanged()
{
if (m_marker)
diff --git a/WebCore/rendering/RenderListItem.h b/WebCore/rendering/RenderListItem.h
index 13d81f2..f7bd661 100644
--- a/WebCore/rendering/RenderListItem.h
+++ b/WebCore/rendering/RenderListItem.h
@@ -45,6 +45,7 @@ public:
bool notInList() const { return m_notInList; }
const String& markerText() const;
+ String markerTextWithSuffix() const;
void updateListMarkerNumbers();
@@ -59,7 +60,7 @@ private:
virtual void paint(PaintInfo&, int tx, int ty);
virtual void layout();
- virtual void calcPrefWidths();
+ virtual void computePreferredLogicalWidths();
virtual void positionListMarker();
diff --git a/WebCore/rendering/RenderListMarker.cpp b/WebCore/rendering/RenderListMarker.cpp
index 7b33c3d..18811df 100644
--- a/WebCore/rendering/RenderListMarker.cpp
+++ b/WebCore/rendering/RenderListMarker.cpp
@@ -1274,13 +1274,12 @@ void RenderListMarker::paint(PaintInfo& paintInfo, int tx, int ty)
void RenderListMarker::layout()
{
ASSERT(needsLayout());
- ASSERT(!prefWidthsDirty());
-
+
if (isImage()) {
setWidth(m_image->imageSize(this, style()->effectiveZoom()).width());
setHeight(m_image->imageSize(this, style()->effectiveZoom()).height());
} else {
- setWidth(minPrefWidth());
+ setWidth(minPreferredLogicalWidth());
setHeight(style()->font().height());
}
@@ -1308,9 +1307,9 @@ void RenderListMarker::imageChanged(WrappedImagePtr o, const IntRect*)
repaint();
}
-void RenderListMarker::calcPrefWidths()
+void RenderListMarker::computePreferredLogicalWidths()
{
- ASSERT(prefWidthsDirty());
+ ASSERT(preferredLogicalWidthsDirty());
m_text = "";
@@ -1321,8 +1320,8 @@ void RenderListMarker::calcPrefWidths()
// until we support the CSS3 marker pseudoclass to allow control over the width and height of the marker box.
int bulletWidth = font.ascent() / 2;
m_image->setImageContainerSize(IntSize(bulletWidth, bulletWidth));
- m_minPrefWidth = m_maxPrefWidth = m_image->imageSize(this, style()->effectiveZoom()).width();
- setPrefWidthsDirty(false);
+ m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = m_image->imageSize(this, style()->effectiveZoom()).width();
+ setPreferredLogicalWidthsDirty(false);
updateMargins();
return;
}
@@ -1428,10 +1427,10 @@ void RenderListMarker::calcPrefWidths()
break;
}
- m_minPrefWidth = width;
- m_maxPrefWidth = width;
+ m_minPreferredLogicalWidth = width;
+ m_maxPreferredLogicalWidth = width;
- setPrefWidthsDirty(false);
+ setPreferredLogicalWidthsDirty(false);
updateMargins();
}
@@ -1455,9 +1454,9 @@ void RenderListMarker::updateMargins()
case Square:
if (style()->direction() == LTR) {
marginLeft = -1;
- marginRight = font.ascent() - minPrefWidth() + 1;
+ marginRight = font.ascent() - minPreferredLogicalWidth() + 1;
} else {
- marginLeft = font.ascent() - minPrefWidth() + 1;
+ marginLeft = font.ascent() - minPreferredLogicalWidth() + 1;
marginRight = -1;
}
break;
@@ -1467,7 +1466,7 @@ void RenderListMarker::updateMargins()
} else {
if (style()->direction() == LTR) {
if (isImage())
- marginLeft = -minPrefWidth() - cMarkerPadding;
+ marginLeft = -minPreferredLogicalWidth() - cMarkerPadding;
else {
int offset = font.ascent() * 2 / 3;
switch (style()->listStyleType()) {
@@ -1479,7 +1478,7 @@ void RenderListMarker::updateMargins()
case NoneListStyle:
break;
default:
- marginLeft = m_text.isEmpty() ? 0 : -minPrefWidth() - offset / 2;
+ marginLeft = m_text.isEmpty() ? 0 : -minPreferredLogicalWidth() - offset / 2;
}
}
} else {
@@ -1491,7 +1490,7 @@ void RenderListMarker::updateMargins()
case Disc:
case Circle:
case Square:
- marginLeft = offset + cMarkerPadding + 1 - minPrefWidth();
+ marginLeft = offset + cMarkerPadding + 1 - minPreferredLogicalWidth();
break;
case NoneListStyle:
break;
@@ -1500,7 +1499,7 @@ void RenderListMarker::updateMargins()
}
}
}
- marginRight = -marginLeft - minPrefWidth();
+ marginRight = -marginLeft - minPreferredLogicalWidth();
}
style()->setMarginLeft(Length(marginLeft, Fixed));
@@ -1523,6 +1522,25 @@ int RenderListMarker::baselinePosition(bool, bool) const
return height();
}
+String RenderListMarker::suffix() const
+{
+ EListStyleType type = style()->listStyleType();
+ const UChar suffix = listMarkerSuffix(type, m_listItem->value());
+
+ Vector<UChar> resultVector;
+ resultVector.append(suffix);
+
+ // If the suffix is not ' ', an extra space is needed
+ if (suffix != ' ') {
+ if (style()->direction() == LTR)
+ resultVector.append(' ');
+ else
+ resultVector.prepend(' ');
+ }
+
+ return String::adopt(resultVector);
+}
+
bool RenderListMarker::isInside() const
{
return m_listItem->notInList() || style()->listStylePosition() == INSIDE;
diff --git a/WebCore/rendering/RenderListMarker.h b/WebCore/rendering/RenderListMarker.h
index 971877b..1e55898 100644
--- a/WebCore/rendering/RenderListMarker.h
+++ b/WebCore/rendering/RenderListMarker.h
@@ -38,9 +38,10 @@ public:
RenderListMarker(RenderListItem*);
virtual ~RenderListMarker();
- virtual void calcPrefWidths();
+ virtual void computePreferredLogicalWidths();
const String& text() const { return m_text; }
+ String suffix() const;
bool isInside() const;
diff --git a/WebCore/rendering/RenderMenuList.cpp b/WebCore/rendering/RenderMenuList.cpp
index b6a97a9..a88903f 100644
--- a/WebCore/rendering/RenderMenuList.cpp
+++ b/WebCore/rendering/RenderMenuList.cpp
@@ -239,34 +239,34 @@ IntRect RenderMenuList::controlClipRect(int tx, int ty) const
return intersection(outerBox, innerBox);
}
-void RenderMenuList::calcPrefWidths()
+void RenderMenuList::computePreferredLogicalWidths()
{
- m_minPrefWidth = 0;
- m_maxPrefWidth = 0;
+ m_minPreferredLogicalWidth = 0;
+ m_maxPreferredLogicalWidth = 0;
if (style()->width().isFixed() && style()->width().value() > 0)
- m_minPrefWidth = m_maxPrefWidth = calcContentBoxWidth(style()->width().value());
+ m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = computeContentBoxLogicalWidth(style()->width().value());
else
- m_maxPrefWidth = max(m_optionsWidth, theme()->minimumMenuListSize(style())) + m_innerBlock->paddingLeft() + m_innerBlock->paddingRight();
+ m_maxPreferredLogicalWidth = max(m_optionsWidth, theme()->minimumMenuListSize(style())) + m_innerBlock->paddingLeft() + m_innerBlock->paddingRight();
if (style()->minWidth().isFixed() && style()->minWidth().value() > 0) {
- m_maxPrefWidth = max(m_maxPrefWidth, calcContentBoxWidth(style()->minWidth().value()));
- m_minPrefWidth = max(m_minPrefWidth, calcContentBoxWidth(style()->minWidth().value()));
+ m_maxPreferredLogicalWidth = max(m_maxPreferredLogicalWidth, computeContentBoxLogicalWidth(style()->minWidth().value()));
+ m_minPreferredLogicalWidth = max(m_minPreferredLogicalWidth, computeContentBoxLogicalWidth(style()->minWidth().value()));
} else if (style()->width().isPercent() || (style()->width().isAuto() && style()->height().isPercent()))
- m_minPrefWidth = 0;
+ m_minPreferredLogicalWidth = 0;
else
- m_minPrefWidth = m_maxPrefWidth;
+ m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth;
if (style()->maxWidth().isFixed() && style()->maxWidth().value() != undefinedLength) {
- m_maxPrefWidth = min(m_maxPrefWidth, calcContentBoxWidth(style()->maxWidth().value()));
- m_minPrefWidth = min(m_minPrefWidth, calcContentBoxWidth(style()->maxWidth().value()));
+ m_maxPreferredLogicalWidth = min(m_maxPreferredLogicalWidth, computeContentBoxLogicalWidth(style()->maxWidth().value()));
+ m_minPreferredLogicalWidth = min(m_minPreferredLogicalWidth, computeContentBoxLogicalWidth(style()->maxWidth().value()));
}
int toAdd = borderAndPaddingWidth();
- m_minPrefWidth += toAdd;
- m_maxPrefWidth += toAdd;
+ m_minPreferredLogicalWidth += toAdd;
+ m_maxPreferredLogicalWidth += toAdd;
- setPrefWidthsDirty(false);
+ setPreferredLogicalWidthsDirty(false);
}
void RenderMenuList::showPopup()
diff --git a/WebCore/rendering/RenderMenuList.h b/WebCore/rendering/RenderMenuList.h
index 512fa9b..7faa372 100644
--- a/WebCore/rendering/RenderMenuList.h
+++ b/WebCore/rendering/RenderMenuList.h
@@ -74,7 +74,7 @@ private:
virtual const char* renderName() const { return "RenderMenuList"; }
- virtual void calcPrefWidths();
+ virtual void computePreferredLogicalWidths();
virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle);
diff --git a/WebCore/rendering/RenderMeter.cpp b/WebCore/rendering/RenderMeter.cpp
index 1a99976..226d605 100644
--- a/WebCore/rendering/RenderMeter.cpp
+++ b/WebCore/rendering/RenderMeter.cpp
@@ -48,15 +48,15 @@ RenderMeter::~RenderMeter()
m_barPart->detach();
}
-void RenderMeter::calcWidth()
+void RenderMeter::computeLogicalWidth()
{
- RenderBox::calcWidth();
+ RenderBox::computeLogicalWidth();
setWidth(theme()->meterSizeForBounds(this, frameRect()).width());
}
-void RenderMeter::calcHeight()
+void RenderMeter::computeLogicalHeight()
{
- RenderBox::calcHeight();
+ RenderBox::computeLogicalHeight();
setHeight(theme()->meterSizeForBounds(this, frameRect()).height());
}
diff --git a/WebCore/rendering/RenderMeter.h b/WebCore/rendering/RenderMeter.h
index 0e73e40..6d4c53b 100644
--- a/WebCore/rendering/RenderMeter.h
+++ b/WebCore/rendering/RenderMeter.h
@@ -40,8 +40,8 @@ public:
private:
virtual const char* renderName() const { return "RenderMeter"; }
virtual bool isMeter() const { return true; }
- virtual void calcWidth();
- virtual void calcHeight();
+ virtual void computeLogicalWidth();
+ virtual void computeLogicalHeight();
virtual void layoutParts();
virtual bool shouldHaveParts() const;
diff --git a/WebCore/rendering/RenderObject.cpp b/WebCore/rendering/RenderObject.cpp
index 9ee97b4..eb75ce2 100644
--- a/WebCore/rendering/RenderObject.cpp
+++ b/WebCore/rendering/RenderObject.cpp
@@ -193,7 +193,7 @@ RenderObject::RenderObject(Node* node)
, m_needsPositionedMovementLayout(false)
, m_normalChildNeedsLayout(false)
, m_posChildNeedsLayout(false)
- , m_prefWidthsDirty(false)
+ , m_preferredLogicalWidthsDirty(false)
, m_floating(false)
, m_positioned(false)
, m_relPositioned(false)
@@ -212,8 +212,8 @@ RenderObject::RenderObject(Node* node)
, m_hasCounterNodeMap(false)
, m_everHadLayout(false)
, m_childrenInline(false)
- , m_topMarginQuirk(false)
- , m_bottomMarginQuirk(false)
+ , m_marginBeforeQuirk(false)
+ , m_marginAfterQuirk(false)
, m_hasMarkupTruncation(false)
, m_selectionState(SelectionNone)
, m_hasColumns(false)
@@ -576,27 +576,27 @@ RenderBlock* RenderObject::firstLineBlock() const
return 0;
}
-void RenderObject::setPrefWidthsDirty(bool b, bool markParents)
+void RenderObject::setPreferredLogicalWidthsDirty(bool b, bool markParents)
{
- bool alreadyDirty = m_prefWidthsDirty;
- m_prefWidthsDirty = b;
+ bool alreadyDirty = m_preferredLogicalWidthsDirty;
+ m_preferredLogicalWidthsDirty = b;
if (b && !alreadyDirty && markParents && (isText() || (style()->position() != FixedPosition && style()->position() != AbsolutePosition)))
- invalidateContainerPrefWidths();
+ invalidateContainerPreferredLogicalWidths();
}
-void RenderObject::invalidateContainerPrefWidths()
+void RenderObject::invalidateContainerPreferredLogicalWidths()
{
// In order to avoid pathological behavior when inlines are deeply nested, we do include them
// in the chain that we mark dirty (even though they're kind of irrelevant).
RenderObject* o = isTableCell() ? containingBlock() : container();
- while (o && !o->m_prefWidthsDirty) {
+ while (o && !o->m_preferredLogicalWidthsDirty) {
// Don't invalidate the outermost object of an unrooted subtree. That object will be
// invalidated when the subtree is added to the document.
RenderObject* container = o->isTableCell() ? o->containingBlock() : o->container();
if (!container && !o->isRenderView())
break;
- o->m_prefWidthsDirty = true;
+ o->m_preferredLogicalWidthsDirty = true;
if (o->style()->position() == FixedPosition || o->style()->position() == AbsolutePosition)
// A positioned object has no effect on the min/max width of its containing block ever.
// We can optimize this case and not go up any further.
@@ -1994,7 +1994,7 @@ void RenderObject::getTransformFromContainer(const RenderObject* containerObject
if (containerObject && containerObject->hasLayer() && containerObject->style()->hasPerspective()) {
// Perpsective on the container affects us, so we have to factor it in here.
ASSERT(containerObject->hasLayer());
- FloatPoint perspectiveOrigin = toRenderBox(containerObject)->layer()->perspectiveOrigin();
+ FloatPoint perspectiveOrigin = toRenderBoxModelObject(containerObject)->layer()->perspectiveOrigin();
TransformationMatrix perspectiveMatrix;
perspectiveMatrix.applyPerspective(containerObject->style()->perspective());
@@ -2098,8 +2098,8 @@ RenderObject* RenderObject::container(RenderBoxModelObject* repaintContainer, bo
// (2) For normal flow elements, it just returns the parent.
// (3) For absolute positioned elements, it will return a relative positioned inline.
// containingBlock() simply skips relpositioned inlines and lets an enclosing block handle
- // the layout of the positioned object. This does mean that calcAbsoluteHorizontal and
- // calcAbsoluteVertical have to use container().
+ // the layout of the positioned object. This does mean that computePositionedLogicalWidth and
+ // computePositionedLogicalHeight have to use container().
RenderObject* o = parent();
if (isText())
@@ -2345,7 +2345,7 @@ RenderStyle* RenderObject::firstLineStyleSlowCase() const
RenderStyle* parentStyle = renderer->parent()->firstLineStyle();
if (parentStyle != renderer->parent()->style()) {
// A first-line style is in effect. Cache a first-line style for ourselves.
- style->setHasPseudoStyle(FIRST_LINE_INHERITED);
+ renderer->style()->setHasPseudoStyle(FIRST_LINE_INHERITED);
style = renderer->getCachedPseudoStyle(FIRST_LINE_INHERITED, parentStyle);
}
}
diff --git a/WebCore/rendering/RenderObject.h b/WebCore/rendering/RenderObject.h
index f2ca471..70b0da5 100644
--- a/WebCore/rendering/RenderObject.h
+++ b/WebCore/rendering/RenderObject.h
@@ -394,7 +394,7 @@ public:
bool posChildNeedsLayout() const { return m_posChildNeedsLayout; }
bool normalChildNeedsLayout() const { return m_normalChildNeedsLayout; }
- bool prefWidthsDirty() const { return m_prefWidthsDirty; }
+ bool preferredLogicalWidthsDirty() const { return m_preferredLogicalWidthsDirty; }
bool isSelectionBorder() const;
@@ -455,13 +455,13 @@ public:
void setNeedsLayout(bool b, bool markParents = true);
void setChildNeedsLayout(bool b, bool markParents = true);
void setNeedsPositionedMovementLayout();
- void setPrefWidthsDirty(bool, bool markParents = true);
- void invalidateContainerPrefWidths();
+ void setPreferredLogicalWidthsDirty(bool, bool markParents = true);
+ void invalidateContainerPreferredLogicalWidths();
void setNeedsLayoutAndPrefWidthsRecalc()
{
setNeedsLayout(true);
- setPrefWidthsDirty(true);
+ setPreferredLogicalWidthsDirty(true);
}
void setPositioned(bool b = true) { m_positioned = b; }
@@ -561,8 +561,8 @@ public:
// the rect that will be painted if this object is passed as the paintingRoot
IntRect paintingRootRect(IntRect& topLevelRect);
- virtual int minPrefWidth() const { return 0; }
- virtual int maxPrefWidth() const { return 0; }
+ virtual int minPreferredLogicalWidth() const { return 0; }
+ virtual int maxPreferredLogicalWidth() const { return 0; }
RenderStyle* style() const { return m_style.get(); }
RenderStyle* firstLineStyle() const { return document()->usesFirstLineRules() ? firstLineStyleSlowCase() : style(); }
@@ -688,11 +688,10 @@ public:
*/
virtual IntRect localCaretRect(InlineBox*, int caretOffset, int* extraWidthToEndOfLine = 0);
- virtual void calcVerticalMargins() { }
- bool isTopMarginQuirk() const { return m_topMarginQuirk; }
- bool isBottomMarginQuirk() const { return m_bottomMarginQuirk; }
- void setTopMarginQuirk(bool b = true) { m_topMarginQuirk = b; }
- void setBottomMarginQuirk(bool b = true) { m_bottomMarginQuirk = b; }
+ bool isMarginBeforeQuirk() const { return m_marginBeforeQuirk; }
+ bool isMarginAfterQuirk() const { return m_marginAfterQuirk; }
+ void setMarginBeforeQuirk(bool b = true) { m_marginBeforeQuirk = b; }
+ void setMarginAfterQuirk(bool b = true) { m_marginAfterQuirk = b; }
// When performing a global document tear-down, the renderer of the document is cleared. We use this
// as a hook to detect the case of document destruction and don't waste time doing unnecessary work.
@@ -812,7 +811,7 @@ private:
bool m_needsPositionedMovementLayout :1;
bool m_normalChildNeedsLayout : 1;
bool m_posChildNeedsLayout : 1;
- bool m_prefWidthsDirty : 1;
+ bool m_preferredLogicalWidthsDirty : 1;
bool m_floating : 1;
bool m_positioned : 1;
@@ -842,8 +841,8 @@ private:
// These bitfields are moved here from subclasses to pack them together
// from RenderBlock
bool m_childrenInline : 1;
- bool m_topMarginQuirk : 1;
- bool m_bottomMarginQuirk : 1;
+ bool m_marginBeforeQuirk : 1;
+ bool m_marginAfterQuirk : 1;
bool m_hasMarkupTruncation : 1;
unsigned m_selectionState : 3; // SelectionState
bool m_hasColumns : 1;
diff --git a/WebCore/rendering/RenderPath.cpp b/WebCore/rendering/RenderPath.cpp
index 0f31df1..cbe1900 100644
--- a/WebCore/rendering/RenderPath.cpp
+++ b/WebCore/rendering/RenderPath.cpp
@@ -98,7 +98,7 @@ bool RenderPath::strokeContains(const FloatPoint& point, bool requiresStroke)
void RenderPath::layout()
{
- LayoutRepainter repainter(*this, m_everHadLayout && checkForRepaintDuringLayout());
+ LayoutRepainter repainter(*this, checkForRepaintDuringLayout() && selfNeedsLayout());
SVGStyledTransformableElement* element = static_cast<SVGStyledTransformableElement*>(node());
bool updateCachedBoundariesInParents = false;
diff --git a/WebCore/rendering/RenderReplaced.cpp b/WebCore/rendering/RenderReplaced.cpp
index b54a228..d3b449c 100644
--- a/WebCore/rendering/RenderReplaced.cpp
+++ b/WebCore/rendering/RenderReplaced.cpp
@@ -57,6 +57,13 @@ RenderReplaced::~RenderReplaced()
{
}
+void RenderReplaced::setStyle(PassRefPtr<RenderStyle> newStyle)
+{
+ if (newStyle->blockFlow() != TopToBottomBlockFlow)
+ newStyle->setBlockFlow(TopToBottomBlockFlow);
+ RenderBox::setStyle(newStyle);
+}
+
void RenderReplaced::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle)
{
RenderBox::styleDidChange(diff, oldStyle);
@@ -75,8 +82,8 @@ void RenderReplaced::layout()
setHeight(minimumReplacedHeight());
- calcWidth();
- calcHeight();
+ computeLogicalWidth();
+ computeLogicalHeight();
m_overflow.clear();
addShadowOverflow();
@@ -200,34 +207,34 @@ static inline bool lengthIsSpecified(Length length)
return lengthType == Fixed || lengthType == Percent;
}
-int RenderReplaced::calcReplacedWidth(bool includeMaxWidth) const
+int RenderReplaced::computeReplacedWidth(bool includeMaxWidth) const
{
int width;
if (lengthIsSpecified(style()->width()))
- width = calcReplacedWidthUsing(style()->width());
+ width = computeReplacedWidthUsing(style()->width());
else if (m_hasIntrinsicSize)
width = calcAspectRatioWidth();
else
width = intrinsicSize().width();
- int minW = calcReplacedWidthUsing(style()->minWidth());
- int maxW = !includeMaxWidth || style()->maxWidth().isUndefined() ? width : calcReplacedWidthUsing(style()->maxWidth());
+ int minW = computeReplacedWidthUsing(style()->minWidth());
+ int maxW = !includeMaxWidth || style()->maxWidth().isUndefined() ? width : computeReplacedWidthUsing(style()->maxWidth());
return max(minW, min(width, maxW));
}
-int RenderReplaced::calcReplacedHeight() const
+int RenderReplaced::computeReplacedHeight() const
{
int height;
if (lengthIsSpecified(style()->height()))
- height = calcReplacedHeightUsing(style()->height());
+ height = computeReplacedHeightUsing(style()->height());
else if (m_hasIntrinsicSize)
height = calcAspectRatioHeight();
else
height = intrinsicSize().height();
- int minH = calcReplacedHeightUsing(style()->minHeight());
- int maxH = style()->maxHeight().isUndefined() ? height : calcReplacedHeightUsing(style()->maxHeight());
+ int minH = computeReplacedHeightUsing(style()->minHeight());
+ int maxH = style()->maxHeight().isUndefined() ? height : computeReplacedHeightUsing(style()->maxHeight());
return max(minH, min(height, maxH));
}
@@ -238,7 +245,7 @@ int RenderReplaced::calcAspectRatioWidth() const
int intrinsicHeight = intrinsicSize().height();
if (!intrinsicHeight)
return 0;
- return RenderBox::calcReplacedHeight() * intrinsicWidth / intrinsicHeight;
+ return RenderBox::computeReplacedHeight() * intrinsicWidth / intrinsicHeight;
}
int RenderReplaced::calcAspectRatioHeight() const
@@ -247,27 +254,27 @@ int RenderReplaced::calcAspectRatioHeight() const
int intrinsicHeight = intrinsicSize().height();
if (!intrinsicWidth)
return 0;
- return RenderBox::calcReplacedWidth() * intrinsicHeight / intrinsicWidth;
+ return RenderBox::computeReplacedWidth() * intrinsicHeight / intrinsicWidth;
}
-void RenderReplaced::calcPrefWidths()
+void RenderReplaced::computePreferredLogicalWidths()
{
- ASSERT(prefWidthsDirty());
+ ASSERT(preferredLogicalWidthsDirty());
int borderAndPadding = borderAndPaddingWidth();
- m_maxPrefWidth = calcReplacedWidth(false) + borderAndPadding;
+ m_maxPreferredLogicalWidth = computeReplacedWidth(false) + borderAndPadding;
if (style()->maxWidth().isFixed() && style()->maxWidth().value() != undefinedLength)
- m_maxPrefWidth = min(m_maxPrefWidth, style()->maxWidth().value() + (style()->boxSizing() == CONTENT_BOX ? borderAndPadding : 0));
+ m_maxPreferredLogicalWidth = min(m_maxPreferredLogicalWidth, style()->maxWidth().value() + (style()->boxSizing() == CONTENT_BOX ? borderAndPadding : 0));
if (style()->width().isPercent() || style()->height().isPercent()
|| style()->maxWidth().isPercent() || style()->maxHeight().isPercent()
|| style()->minWidth().isPercent() || style()->minHeight().isPercent())
- m_minPrefWidth = 0;
+ m_minPreferredLogicalWidth = 0;
else
- m_minPrefWidth = m_maxPrefWidth;
+ m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth;
- setPrefWidthsDirty(false);
+ setPreferredLogicalWidthsDirty(false);
}
int RenderReplaced::lineHeight(bool, bool) const
diff --git a/WebCore/rendering/RenderReplaced.h b/WebCore/rendering/RenderReplaced.h
index 8a0543c..872f6d0 100644
--- a/WebCore/rendering/RenderReplaced.h
+++ b/WebCore/rendering/RenderReplaced.h
@@ -32,13 +32,15 @@ public:
RenderReplaced(Node*, const IntSize& intrinsicSize);
virtual ~RenderReplaced();
+ virtual void setStyle(PassRefPtr<RenderStyle>);
+
protected:
virtual void layout();
virtual IntSize intrinsicSize() const;
- virtual int calcReplacedWidth(bool includeMaxWidth = true) const;
- virtual int calcReplacedHeight() const;
+ virtual int computeReplacedWidth(bool includeMaxWidth = true) const;
+ virtual int computeReplacedHeight() const;
virtual int minimumReplacedHeight() const { return 0; }
virtual void setSelectionState(SelectionState);
@@ -63,7 +65,7 @@ private:
virtual int lineHeight(bool firstLine, bool isRootLineBox = false) const;
virtual int baselinePosition(bool firstLine, bool isRootLineBox = false) const;
- virtual void calcPrefWidths();
+ virtual void computePreferredLogicalWidths();
int calcAspectRatioWidth() const;
int calcAspectRatioHeight() const;
diff --git a/WebCore/rendering/RenderReplica.cpp b/WebCore/rendering/RenderReplica.cpp
index 1d589ae..4b11f40 100644
--- a/WebCore/rendering/RenderReplica.cpp
+++ b/WebCore/rendering/RenderReplica.cpp
@@ -52,11 +52,11 @@ void RenderReplica::layout()
setNeedsLayout(false);
}
-void RenderReplica::calcPrefWidths()
+void RenderReplica::computePreferredLogicalWidths()
{
- m_minPrefWidth = parentBox()->width();
- m_maxPrefWidth = m_minPrefWidth;
- setPrefWidthsDirty(false);
+ m_minPreferredLogicalWidth = parentBox()->width();
+ m_maxPreferredLogicalWidth = m_minPreferredLogicalWidth;
+ setPreferredLogicalWidthsDirty(false);
}
void RenderReplica::paint(PaintInfo& paintInfo, int tx, int ty)
diff --git a/WebCore/rendering/RenderReplica.h b/WebCore/rendering/RenderReplica.h
index 48c64e4..a7b03f6 100644
--- a/WebCore/rendering/RenderReplica.h
+++ b/WebCore/rendering/RenderReplica.h
@@ -43,7 +43,7 @@ public:
virtual bool requiresLayer() const { return true; }
virtual void layout();
- virtual void calcPrefWidths();
+ virtual void computePreferredLogicalWidths();
virtual void paint(PaintInfo&, int tx, int ty);
diff --git a/WebCore/rendering/RenderSVGContainer.cpp b/WebCore/rendering/RenderSVGContainer.cpp
index 8c99270..b5974ca 100644
--- a/WebCore/rendering/RenderSVGContainer.cpp
+++ b/WebCore/rendering/RenderSVGContainer.cpp
@@ -53,7 +53,7 @@ void RenderSVGContainer::layout()
// Allow RenderSVGViewportContainer to update its viewport.
calcViewport();
- LayoutRepainter repainter(*this, m_everHadLayout && checkForRepaintDuringLayout());
+ LayoutRepainter repainter(*this, checkForRepaintDuringLayout() || selfWillPaint());
// Allow RenderSVGTransformableContainer to update its transform.
bool updatedTransform = calculateLocalTransform();
diff --git a/WebCore/rendering/RenderSVGImage.cpp b/WebCore/rendering/RenderSVGImage.cpp
index 0056fa3..a89a738 100644
--- a/WebCore/rendering/RenderSVGImage.cpp
+++ b/WebCore/rendering/RenderSVGImage.cpp
@@ -62,7 +62,7 @@ void RenderSVGImage::layout()
{
ASSERT(needsLayout());
- LayoutRepainter repainter(*this, m_everHadLayout && checkForRepaintDuringLayout());
+ LayoutRepainter repainter(*this, checkForRepaintDuringLayout());
SVGImageElement* image = static_cast<SVGImageElement*>(node());
bool updateCachedBoundariesInParents = false;
diff --git a/WebCore/rendering/RenderSVGInline.cpp b/WebCore/rendering/RenderSVGInline.cpp
index bc6bc12..5d12a61 100644
--- a/WebCore/rendering/RenderSVGInline.cpp
+++ b/WebCore/rendering/RenderSVGInline.cpp
@@ -39,7 +39,7 @@ RenderSVGInline::RenderSVGInline(Node* n)
InlineFlowBox* RenderSVGInline::createInlineFlowBox()
{
InlineFlowBox* box = new (renderArena()) SVGInlineFlowBox(this);
- box->setHasVirtualHeight();
+ box->setHasVirtualLogicalHeight();
return box;
}
@@ -90,7 +90,7 @@ void RenderSVGInline::absoluteQuads(Vector<FloatQuad>& quads)
FloatRect textBoundingBox = object->strokeBoundingBox();
for (InlineFlowBox* box = firstLineBox(); box; box = box->nextLineBox())
- quads.append(localToAbsoluteQuad(FloatRect(textBoundingBox.x() + box->x(), textBoundingBox.y() + box->y(), box->width(), box->height())));
+ quads.append(localToAbsoluteQuad(FloatRect(textBoundingBox.x() + box->x(), textBoundingBox.y() + box->y(), box->logicalWidth(), box->logicalHeight())));
}
void RenderSVGInline::destroy()
diff --git a/WebCore/rendering/RenderSVGInlineText.cpp b/WebCore/rendering/RenderSVGInlineText.cpp
index 0539d27..f5ea5fc 100644
--- a/WebCore/rendering/RenderSVGInlineText.cpp
+++ b/WebCore/rendering/RenderSVGInlineText.cpp
@@ -56,7 +56,7 @@ void RenderSVGInlineText::styleDidChange(StyleDifference diff, const RenderStyle
InlineTextBox* RenderSVGInlineText::createTextBox()
{
InlineTextBox* box = new (renderArena()) SVGInlineTextBox(this);
- box->setHasVirtualHeight();
+ box->setHasVirtualLogicalHeight();
return box;
}
diff --git a/WebCore/rendering/RenderSVGResourceFilter.cpp b/WebCore/rendering/RenderSVGResourceFilter.cpp
index 698033e..4dccad6 100644
--- a/WebCore/rendering/RenderSVGResourceFilter.cpp
+++ b/WebCore/rendering/RenderSVGResourceFilter.cpp
@@ -93,7 +93,6 @@ PassRefPtr<SVGFilterBuilder> RenderSVGResourceFilter::buildPrimitives()
// Add effects to the builder
RefPtr<SVGFilterBuilder> builder = SVGFilterBuilder::create();
- builder->clearEffects();
for (Node* node = filterElement->firstChild(); node; node = node->nextSibling()) {
if (!node->isSVGElement())
continue;
@@ -108,6 +107,7 @@ PassRefPtr<SVGFilterBuilder> RenderSVGResourceFilter::buildPrimitives()
builder->clearEffects();
return 0;
}
+ builder->appendEffectToEffectReferences(effect);
effectElement->setStandardAttributes(primitiveBoundingBoxMode, effect.get());
builder->add(effectElement->result(), effect);
}
diff --git a/WebCore/rendering/RenderSVGResourceFilterPrimitive.h b/WebCore/rendering/RenderSVGResourceFilterPrimitive.h
index 96e2c5e..4b23737 100644
--- a/WebCore/rendering/RenderSVGResourceFilterPrimitive.h
+++ b/WebCore/rendering/RenderSVGResourceFilterPrimitive.h
@@ -36,10 +36,11 @@ namespace WebCore {
class RenderSVGResourceFilterPrimitive : public RenderSVGHiddenContainer {
public:
- RenderSVGResourceFilterPrimitive(SVGFilterPrimitiveStandardAttributes* filterPrimitiveElement);
+ RenderSVGResourceFilterPrimitive(SVGFilterPrimitiveStandardAttributes* filterPrimitiveElement);
private:
- virtual bool isSVGResourceFilterPrimitive() const { return true; }
+ virtual const char* renderName() const { return "RenderSVGResourceFilterPrimitive"; }
+ virtual bool isSVGResourceFilterPrimitive() const { return true; }
};
} // namespace WebCore
diff --git a/WebCore/rendering/RenderSVGRoot.cpp b/WebCore/rendering/RenderSVGRoot.cpp
index 4e23c42..82b10d5 100644
--- a/WebCore/rendering/RenderSVGRoot.cpp
+++ b/WebCore/rendering/RenderSVGRoot.cpp
@@ -63,28 +63,28 @@ int RenderSVGRoot::baselinePosition(bool, bool) const
return height() + marginTop() + marginBottom();
}
-void RenderSVGRoot::calcPrefWidths()
+void RenderSVGRoot::computePreferredLogicalWidths()
{
- ASSERT(prefWidthsDirty());
+ ASSERT(preferredLogicalWidthsDirty());
int borderAndPadding = borderAndPaddingWidth();
- int width = calcReplacedWidth(false) + borderAndPadding;
+ int width = computeReplacedWidth(false) + borderAndPadding;
if (style()->maxWidth().isFixed() && style()->maxWidth().value() != undefinedLength)
width = min(width, style()->maxWidth().value() + (style()->boxSizing() == CONTENT_BOX ? borderAndPadding : 0));
if (style()->width().isPercent() || (style()->width().isAuto() && style()->height().isPercent())) {
- m_minPrefWidth = 0;
- m_maxPrefWidth = width;
+ m_minPreferredLogicalWidth = 0;
+ m_maxPreferredLogicalWidth = width;
} else
- m_minPrefWidth = m_maxPrefWidth = width;
+ m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = width;
- setPrefWidthsDirty(false);
+ setPreferredLogicalWidthsDirty(false);
}
-int RenderSVGRoot::calcReplacedWidth(bool includeMaxWidth) const
+int RenderSVGRoot::computeReplacedWidth(bool includeMaxWidth) const
{
- int replacedWidth = RenderBox::calcReplacedWidth(includeMaxWidth);
+ int replacedWidth = RenderBox::computeReplacedWidth(includeMaxWidth);
if (!style()->width().isPercent())
return replacedWidth;
@@ -93,9 +93,9 @@ int RenderSVGRoot::calcReplacedWidth(bool includeMaxWidth) const
return static_cast<int>(roundf(replacedWidth * svg->currentScale()));
}
-int RenderSVGRoot::calcReplacedHeight() const
+int RenderSVGRoot::computeReplacedHeight() const
{
- int replacedHeight = RenderBox::calcReplacedHeight();
+ int replacedHeight = RenderBox::computeReplacedHeight();
if (!style()->height().isPercent())
return replacedHeight;
@@ -112,11 +112,11 @@ void RenderSVGRoot::layout()
view()->disableLayoutState();
bool needsLayout = selfNeedsLayout();
- LayoutRepainter repainter(*this, needsLayout && m_everHadLayout && checkForRepaintDuringLayout());
+ LayoutRepainter repainter(*this, checkForRepaintDuringLayout() && needsLayout);
IntSize oldSize(width(), height());
- calcWidth();
- calcHeight();
+ computeLogicalWidth();
+ computeLogicalHeight();
calcViewport();
SVGSVGElement* svg = static_cast<SVGSVGElement*>(node());
diff --git a/WebCore/rendering/RenderSVGRoot.h b/WebCore/rendering/RenderSVGRoot.h
index 63a7b3f..3c29b87 100644
--- a/WebCore/rendering/RenderSVGRoot.h
+++ b/WebCore/rendering/RenderSVGRoot.h
@@ -53,9 +53,9 @@ private:
virtual int lineHeight(bool b, bool isRootLineBox = false) const;
virtual int baselinePosition(bool b, bool isRootLineBox = false) const;
- virtual void calcPrefWidths();
- virtual int calcReplacedWidth(bool includeMaxWidth = true) const;
- virtual int calcReplacedHeight() const;
+ virtual void computePreferredLogicalWidths();
+ virtual int computeReplacedWidth(bool includeMaxWidth = true) const;
+ virtual int computeReplacedHeight() const;
virtual void layout();
virtual void paint(PaintInfo&, int parentX, int parentY);
diff --git a/WebCore/rendering/RenderSVGText.cpp b/WebCore/rendering/RenderSVGText.cpp
index c20a509..92091af 100644
--- a/WebCore/rendering/RenderSVGText.cpp
+++ b/WebCore/rendering/RenderSVGText.cpp
@@ -74,7 +74,7 @@ void RenderSVGText::mapLocalToContainer(RenderBoxModelObject* repaintContainer,
void RenderSVGText::layout()
{
ASSERT(needsLayout());
- LayoutRepainter repainter(*this, m_everHadLayout && checkForRepaintDuringLayout());
+ LayoutRepainter repainter(*this, checkForRepaintDuringLayout());
bool updateCachedBoundariesInParents = false;
if (m_needsTransformUpdate) {
@@ -124,7 +124,7 @@ void RenderSVGText::layout()
RootInlineBox* RenderSVGText::createRootInlineBox()
{
RootInlineBox* box = new (renderArena()) SVGRootInlineBox(this);
- box->setHasVirtualHeight();
+ box->setHasVirtualLogicalHeight();
return box;
}
diff --git a/WebCore/rendering/RenderScrollbarPart.cpp b/WebCore/rendering/RenderScrollbarPart.cpp
index ea61e24..16cc204 100644
--- a/WebCore/rendering/RenderScrollbarPart.cpp
+++ b/WebCore/rendering/RenderScrollbarPart.cpp
@@ -114,14 +114,14 @@ void RenderScrollbarPart::computeScrollbarHeight()
m_marginBottom = style()->marginBottom().calcMinValue(visibleSize);
}
-void RenderScrollbarPart::calcPrefWidths()
+void RenderScrollbarPart::computePreferredLogicalWidths()
{
- if (!prefWidthsDirty())
+ if (!preferredLogicalWidthsDirty())
return;
- m_minPrefWidth = m_maxPrefWidth = 0;
+ m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = 0;
- setPrefWidthsDirty(false);
+ setPreferredLogicalWidthsDirty(false);
}
void RenderScrollbarPart::styleWillChange(StyleDifference diff, const RenderStyle* newStyle)
diff --git a/WebCore/rendering/RenderScrollbarPart.h b/WebCore/rendering/RenderScrollbarPart.h
index 114bbff..24485d0 100644
--- a/WebCore/rendering/RenderScrollbarPart.h
+++ b/WebCore/rendering/RenderScrollbarPart.h
@@ -43,7 +43,7 @@ public:
virtual bool requiresLayer() const { return false; }
virtual void layout();
- virtual void calcPrefWidths();
+ virtual void computePreferredLogicalWidths();
void paintIntoRect(GraphicsContext*, int tx, int ty, const IntRect&);
diff --git a/WebCore/rendering/RenderSlider.cpp b/WebCore/rendering/RenderSlider.cpp
index 39ac2e5..33df244 100644
--- a/WebCore/rendering/RenderSlider.cpp
+++ b/WebCore/rendering/RenderSlider.cpp
@@ -164,34 +164,34 @@ int RenderSlider::baselinePosition(bool, bool) const
return height() + marginTop();
}
-void RenderSlider::calcPrefWidths()
+void RenderSlider::computePreferredLogicalWidths()
{
- m_minPrefWidth = 0;
- m_maxPrefWidth = 0;
+ m_minPreferredLogicalWidth = 0;
+ m_maxPreferredLogicalWidth = 0;
if (style()->width().isFixed() && style()->width().value() > 0)
- m_minPrefWidth = m_maxPrefWidth = calcContentBoxWidth(style()->width().value());
+ m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = computeContentBoxLogicalWidth(style()->width().value());
else
- m_maxPrefWidth = defaultTrackLength * style()->effectiveZoom();
+ m_maxPreferredLogicalWidth = defaultTrackLength * style()->effectiveZoom();
if (style()->minWidth().isFixed() && style()->minWidth().value() > 0) {
- m_maxPrefWidth = max(m_maxPrefWidth, calcContentBoxWidth(style()->minWidth().value()));
- m_minPrefWidth = max(m_minPrefWidth, calcContentBoxWidth(style()->minWidth().value()));
+ m_maxPreferredLogicalWidth = max(m_maxPreferredLogicalWidth, computeContentBoxLogicalWidth(style()->minWidth().value()));
+ m_minPreferredLogicalWidth = max(m_minPreferredLogicalWidth, computeContentBoxLogicalWidth(style()->minWidth().value()));
} else if (style()->width().isPercent() || (style()->width().isAuto() && style()->height().isPercent()))
- m_minPrefWidth = 0;
+ m_minPreferredLogicalWidth = 0;
else
- m_minPrefWidth = m_maxPrefWidth;
+ m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth;
if (style()->maxWidth().isFixed() && style()->maxWidth().value() != undefinedLength) {
- m_maxPrefWidth = min(m_maxPrefWidth, calcContentBoxWidth(style()->maxWidth().value()));
- m_minPrefWidth = min(m_minPrefWidth, calcContentBoxWidth(style()->maxWidth().value()));
+ m_maxPreferredLogicalWidth = min(m_maxPreferredLogicalWidth, computeContentBoxLogicalWidth(style()->maxWidth().value()));
+ m_minPreferredLogicalWidth = min(m_minPreferredLogicalWidth, computeContentBoxLogicalWidth(style()->maxWidth().value()));
}
int toAdd = borderAndPaddingWidth();
- m_minPrefWidth += toAdd;
- m_maxPrefWidth += toAdd;
+ m_minPreferredLogicalWidth += toAdd;
+ m_maxPreferredLogicalWidth += toAdd;
- setPrefWidthsDirty(false);
+ setPreferredLogicalWidthsDirty(false);
}
void RenderSlider::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle)
@@ -278,8 +278,8 @@ void RenderSlider::layout()
IntSize oldSize = size();
setSize(baseSize);
- calcWidth();
- calcHeight();
+ computeLogicalWidth();
+ computeLogicalHeight();
if (thumb) {
if (oldSize != size())
diff --git a/WebCore/rendering/RenderSlider.h b/WebCore/rendering/RenderSlider.h
index fc8ce24..d214e41 100644
--- a/WebCore/rendering/RenderSlider.h
+++ b/WebCore/rendering/RenderSlider.h
@@ -43,7 +43,7 @@ namespace WebCore {
virtual bool isSlider() const { return true; }
virtual int baselinePosition(bool, bool) const;
- virtual void calcPrefWidths();
+ virtual void computePreferredLogicalWidths();
virtual void layout();
virtual void updateFromElement();
diff --git a/WebCore/rendering/RenderTable.cpp b/WebCore/rendering/RenderTable.cpp
index 931cf45..c2835d6 100644
--- a/WebCore/rendering/RenderTable.cpp
+++ b/WebCore/rendering/RenderTable.cpp
@@ -200,7 +200,7 @@ void RenderTable::removeChild(RenderObject* oldChild)
setNeedsSectionRecalc();
}
-void RenderTable::calcWidth()
+void RenderTable::computeLogicalWidth()
{
#ifdef ANDROID_LAYOUT
if (view()->frameView())
@@ -208,20 +208,20 @@ void RenderTable::calcWidth()
#endif
if (isPositioned())
- calcAbsoluteHorizontal();
+ computePositionedLogicalWidth();
RenderBlock* cb = containingBlock();
- int availableWidth = cb->availableWidth();
+ int availableWidth = cb->availableLogicalWidth();
LengthType widthType = style()->width().type();
if (widthType > Relative && style()->width().isPositive()) {
// Percent or fixed table
setWidth(style()->width().calcMinValue(availableWidth));
- setWidth(max(minPrefWidth(), width()));
+ setWidth(max(minPreferredLogicalWidth(), width()));
} else {
// An auto width table should shrink to fit within the line width if necessary in order to
// avoid overlapping floats.
- availableWidth = cb->lineWidth(y(), false);
+ availableWidth = cb->availableLogicalWidthForLine(y(), false);
// Subtract out any fixed margins from our available width for auto width tables.
int marginTotal = 0;
@@ -234,20 +234,24 @@ void RenderTable::calcWidth()
int availContentWidth = max(0, availableWidth - marginTotal);
// Ensure we aren't bigger than our max width or smaller than our min width.
- setWidth(min(availContentWidth, maxPrefWidth()));
+ setWidth(min(availContentWidth, maxPreferredLogicalWidth()));
}
- setWidth(max(width(), minPrefWidth()));
+ setWidth(max(width(), minPreferredLogicalWidth()));
// Finally, with our true width determined, compute our margins for real.
m_marginRight = 0;
m_marginLeft = 0;
+<<<<<<< HEAD
#ifdef ANDROID_LAYOUT
// in SSR mode, we ignore left/right margin for table
if (document()->settings()->layoutAlgorithm() == Settings::kLayoutSSR)
return;
#endif
calcHorizontalMargins(style()->marginLeft(), style()->marginRight(), availableWidth);
+=======
+ computeInlineDirectionMargins(cb, availableWidth, width());
+>>>>>>> webkit.org at r68651
}
void RenderTable::layout()
@@ -272,7 +276,7 @@ void RenderTable::layout()
#endif
int oldWidth = width();
- calcWidth();
+ computeLogicalWidth();
#ifdef ANDROID_LAYOUT
if (!checkAndSetRelayoutChildren(&relayoutChildren)
@@ -377,7 +381,7 @@ void RenderTable::layout()
setHeight(height() + bpTop);
if (!isPositioned())
- calcHeight();
+ computeLogicalHeight();
Length h = style()->height();
int th = 0;
@@ -385,7 +389,7 @@ void RenderTable::layout()
// Tables size as though CSS height includes border/padding.
th = h.value() - (bpTop + bpBottom);
else if (h.isPercent())
- th = calcPercentageHeight(h);
+ th = computePercentageLogicalHeight(h);
th = max(0, th);
for (RenderObject* child = firstChild(); child; child = child->nextSibling()) {
@@ -430,7 +434,7 @@ void RenderTable::layout()
}
if (isPositioned())
- calcHeight();
+ computeLogicalHeight();
// table can be containing block of positioned elements.
// FIXME: Only pass true if width or height changed.
@@ -592,19 +596,19 @@ void RenderTable::paintMask(PaintInfo& paintInfo, int tx, int ty)
paintMaskImages(paintInfo, tx, ty, w, h);
}
-void RenderTable::calcPrefWidths()
+void RenderTable::computePreferredLogicalWidths()
{
- ASSERT(prefWidthsDirty());
+ ASSERT(preferredLogicalWidthsDirty());
recalcSectionsIfNeeded();
recalcHorizontalBorders();
- m_tableLayout->calcPrefWidths(m_minPrefWidth, m_maxPrefWidth);
+ m_tableLayout->computePreferredLogicalWidths(m_minPreferredLogicalWidth, m_maxPreferredLogicalWidth);
if (m_caption)
- m_minPrefWidth = max(m_minPrefWidth, m_caption->minPrefWidth());
+ m_minPreferredLogicalWidth = max(m_minPreferredLogicalWidth, m_caption->minPreferredLogicalWidth());
- setPrefWidthsDirty(false);
+ setPreferredLogicalWidthsDirty(false);
}
void RenderTable::splitColumn(int pos, int firstSpan)
diff --git a/WebCore/rendering/RenderTable.h b/WebCore/rendering/RenderTable.h
index dace8ba..58d4915 100644
--- a/WebCore/rendering/RenderTable.h
+++ b/WebCore/rendering/RenderTable.h
@@ -165,7 +165,7 @@ private:
virtual void paintBoxDecorations(PaintInfo&, int tx, int ty);
virtual void paintMask(PaintInfo&, int tx, int ty);
virtual void layout();
- virtual void calcPrefWidths();
+ virtual void computePreferredLogicalWidths();
virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int xPos, int yPos, int tx, int ty, HitTestAction);
virtual int firstLineBoxBaseline() const;
@@ -175,7 +175,7 @@ private:
virtual void setCellWidths();
- virtual void calcWidth();
+ virtual void computeLogicalWidth();
virtual IntRect overflowClipRect(int tx, int ty);
diff --git a/WebCore/rendering/RenderTableCell.cpp b/WebCore/rendering/RenderTableCell.cpp
index 66d1d7b..06f4726 100644
--- a/WebCore/rendering/RenderTableCell.cpp
+++ b/WebCore/rendering/RenderTableCell.cpp
@@ -50,8 +50,8 @@ RenderTableCell::RenderTableCell(Node* node)
, m_column(-1)
, m_rowSpan(1)
, m_columnSpan(1)
- , m_intrinsicPaddingTop(0)
- , m_intrinsicPaddingBottom(0)
+ , m_intrinsicPaddingBefore(0)
+ , m_intrinsicPaddingAfter(0)
, m_percentageHeight(0)
{
updateFromElement();
@@ -127,14 +127,14 @@ Length RenderTableCell::styleOrColWidth() const
return w;
}
-void RenderTableCell::calcPrefWidths()
+void RenderTableCell::computePreferredLogicalWidths()
{
- // The child cells rely on the grids up in the sections to do their calcPrefWidths work. Normally the sections are set up early, as table
+ // The child cells rely on the grids up in the sections to do their computePreferredLogicalWidths work. Normally the sections are set up early, as table
// cells are added, but relayout can cause the cells to be freed, leaving stale pointers in the sections'
// grids. We must refresh those grids before the child cells try to use them.
table()->recalcSectionsIfNeeded();
- RenderBlock::calcPrefWidths();
+ RenderBlock::computePreferredLogicalWidths();
if (node() && style()->autoWrap()) {
// See if nowrap was set.
Length w = styleOrColWidth();
@@ -145,11 +145,11 @@ void RenderTableCell::calcPrefWidths()
// to make the minwidth of the cell into the fixed width. They do this
// even in strict mode, so do not make this a quirk. Affected the top
// of hiptop.com.
- m_minPrefWidth = max(w.value(), m_minPrefWidth);
+ m_minPreferredLogicalWidth = max(w.value(), m_minPreferredLogicalWidth);
}
}
-void RenderTableCell::calcWidth()
+void RenderTableCell::computeLogicalWidth()
{
#ifdef ANDROID_LAYOUT
if (view()->frameView())
@@ -173,12 +173,51 @@ void RenderTableCell::layout()
int RenderTableCell::paddingTop(bool includeIntrinsicPadding) const
{
- return RenderBlock::paddingTop() + (includeIntrinsicPadding ? intrinsicPaddingTop() : 0);
+ int result = RenderBlock::paddingTop();
+ if (!includeIntrinsicPadding || !style()->isVerticalBlockFlow())
+ return result;
+ return result + (style()->blockFlow() == TopToBottomBlockFlow ? intrinsicPaddingBefore() : intrinsicPaddingAfter());
}
int RenderTableCell::paddingBottom(bool includeIntrinsicPadding) const
{
- return RenderBlock::paddingBottom() + (includeIntrinsicPadding ? intrinsicPaddingBottom() : 0);
+ int result = RenderBlock::paddingBottom();
+ if (!includeIntrinsicPadding || !style()->isVerticalBlockFlow())
+ return result;
+ return result + (style()->blockFlow() == TopToBottomBlockFlow ? intrinsicPaddingAfter() : intrinsicPaddingBefore());
+}
+
+int RenderTableCell::paddingLeft(bool includeIntrinsicPadding) const
+{
+ int result = RenderBlock::paddingLeft();
+ if (!includeIntrinsicPadding || style()->isVerticalBlockFlow())
+ return result;
+ return result + (style()->blockFlow() == LeftToRightBlockFlow ? intrinsicPaddingBefore() : intrinsicPaddingAfter());
+
+}
+
+int RenderTableCell::paddingRight(bool includeIntrinsicPadding) const
+{
+ int result = RenderBlock::paddingRight();
+ if (!includeIntrinsicPadding || style()->isVerticalBlockFlow())
+ return result;
+ return result + (style()->blockFlow() == LeftToRightBlockFlow ? intrinsicPaddingAfter() : intrinsicPaddingBefore());
+}
+
+int RenderTableCell::paddingBefore(bool includeIntrinsicPadding) const
+{
+ int result = RenderBlock::paddingBefore();
+ if (!includeIntrinsicPadding)
+ return result;
+ return result + intrinsicPaddingBefore();
+}
+
+int RenderTableCell::paddingAfter(bool includeIntrinsicPadding) const
+{
+ int result = RenderBlock::paddingAfter();
+ if (!includeIntrinsicPadding)
+ return result;
+ return result + intrinsicPaddingAfter();
}
void RenderTableCell::setOverrideSize(int size)
@@ -660,6 +699,28 @@ int RenderTableCell::borderBottom() const
return table()->collapseBorders() ? borderHalfBottom(false) : RenderBlock::borderBottom();
}
+// FIXME: https://bugs.webkit.org/show_bug.cgi?id=46191, make the collapsed border drawing
+// work with different block flow values instead of being hard-coded to top-to-bottom.
+int RenderTableCell::borderStart() const
+{
+ return table()->collapseBorders() ? borderHalfLeft(false) : RenderBlock::borderStart();
+}
+
+int RenderTableCell::borderEnd() const
+{
+ return table()->collapseBorders() ? borderHalfRight(false) : RenderBlock::borderEnd();
+}
+
+int RenderTableCell::borderBefore() const
+{
+ return table()->collapseBorders() ? borderHalfTop(false) : RenderBlock::borderBefore();
+}
+
+int RenderTableCell::borderAfter() const
+{
+ return table()->collapseBorders() ? borderHalfBottom(false) : RenderBlock::borderAfter();
+}
+
int RenderTableCell::borderHalfLeft(bool outer) const
{
CollapsedBorderValue border = collapsedLeftBorder(table()->style()->direction() == RTL);
diff --git a/WebCore/rendering/RenderTableCell.h b/WebCore/rendering/RenderTableCell.h
index b6622f4..79376e9 100644
--- a/WebCore/rendering/RenderTableCell.h
+++ b/WebCore/rendering/RenderTableCell.h
@@ -53,14 +53,18 @@ public:
Length styleOrColWidth() const;
- virtual void calcPrefWidths();
+ virtual void computePreferredLogicalWidths();
void updateWidth(int);
- int borderLeft() const;
- int borderRight() const;
- int borderTop() const;
- int borderBottom() const;
+ virtual int borderLeft() const;
+ virtual int borderRight() const;
+ virtual int borderTop() const;
+ virtual int borderBottom() const;
+ virtual int borderStart() const;
+ virtual int borderEnd() const;
+ virtual int borderBefore() const;
+ virtual int borderAfter() const;
int borderHalfLeft(bool outer) const;
int borderHalfRight(bool outer) const;
@@ -86,16 +90,24 @@ public:
virtual int baselinePosition(bool firstLine = false, bool isRootLineBox = false) const;
- void setIntrinsicPaddingTop(int p) { m_intrinsicPaddingTop = p; }
- void setIntrinsicPaddingBottom(int p) { m_intrinsicPaddingBottom = p; }
- void setIntrinsicPadding(int top, int bottom) { setIntrinsicPaddingTop(top); setIntrinsicPaddingBottom(bottom); }
+ void setIntrinsicPaddingBefore(int p) { m_intrinsicPaddingBefore = p; }
+ void setIntrinsicPaddingAfter(int p) { m_intrinsicPaddingAfter = p; }
+ void setIntrinsicPadding(int before, int after) { setIntrinsicPaddingBefore(before); setIntrinsicPaddingAfter(after); }
void clearIntrinsicPadding() { setIntrinsicPadding(0, 0); }
- int intrinsicPaddingTop() const { return m_intrinsicPaddingTop; }
- int intrinsicPaddingBottom() const { return m_intrinsicPaddingBottom; }
+ int intrinsicPaddingBefore() const { return m_intrinsicPaddingBefore; }
+ int intrinsicPaddingAfter() const { return m_intrinsicPaddingAfter; }
virtual int paddingTop(bool includeIntrinsicPadding = true) const;
virtual int paddingBottom(bool includeIntrinsicPadding = true) const;
+ virtual int paddingLeft(bool includeIntrinsicPadding = true) const;
+ virtual int paddingRight(bool includeIntrinsicPadding = true) const;
+
+ // FIXME: For now we just assume the cell has the same block flow direction as the table. It's likely we'll
+ // create an extra anonymous RenderBlock to handle mixing directionality anyway, in which case we can lock
+ // the block flow directionality of the cells to the table's directionality.
+ virtual int paddingBefore(bool includeIntrinsicPadding = true) const;
+ virtual int paddingAfter(bool includeIntrinsicPadding = true) const;
virtual void setOverrideSize(int);
@@ -114,7 +126,7 @@ private:
virtual bool requiresLayer() const { return isPositioned() || isTransparent() || hasOverflowClip() || hasTransform() || hasMask() || hasReflection(); }
- virtual void calcWidth();
+ virtual void computeLogicalWidth();
virtual void paintBoxDecorations(PaintInfo&, int tx, int ty);
virtual void paintMask(PaintInfo&, int tx, int ty);
@@ -129,8 +141,8 @@ private:
int m_column;
int m_rowSpan;
int m_columnSpan;
- int m_intrinsicPaddingTop;
- int m_intrinsicPaddingBottom;
+ int m_intrinsicPaddingBefore;
+ int m_intrinsicPaddingAfter;
int m_percentageHeight;
};
diff --git a/WebCore/rendering/RenderTableCol.cpp b/WebCore/rendering/RenderTableCol.cpp
index 80e74e1..66d060b 100644
--- a/WebCore/rendering/RenderTableCol.cpp
+++ b/WebCore/rendering/RenderTableCol.cpp
@@ -88,12 +88,12 @@ void RenderTableCol::imageChanged(WrappedImagePtr, const IntRect*)
repaint();
}
-void RenderTableCol::calcPrefWidths()
+void RenderTableCol::computePreferredLogicalWidths()
{
- setPrefWidthsDirty(false);
+ setPreferredLogicalWidthsDirty(false);
for (RenderObject* child = firstChild(); child; child = child->nextSibling())
- child->setPrefWidthsDirty(false);
+ child->setPreferredLogicalWidthsDirty(false);
}
RenderTable* RenderTableCol::table() const
diff --git a/WebCore/rendering/RenderTableCol.h b/WebCore/rendering/RenderTableCol.h
index 87209a1..c5f9afc 100644
--- a/WebCore/rendering/RenderTableCol.h
+++ b/WebCore/rendering/RenderTableCol.h
@@ -39,7 +39,7 @@ public:
const RenderObjectChildList* children() const { return &m_children; }
RenderObjectChildList* children() { return &m_children; }
- virtual void calcPrefWidths();
+ virtual void computePreferredLogicalWidths();
int span() const { return m_span; }
void setSpan(int span) { m_span = span; }
diff --git a/WebCore/rendering/RenderTableRow.cpp b/WebCore/rendering/RenderTableRow.cpp
index 0a8bfde..d0bd511 100644
--- a/WebCore/rendering/RenderTableRow.cpp
+++ b/WebCore/rendering/RenderTableRow.cpp
@@ -126,7 +126,7 @@ void RenderTableRow::layout()
cell->setChildNeedsLayout(true, false);
if (child->needsLayout()) {
- cell->calcVerticalMargins();
+ cell->computeBlockDirectionMargins(table());
cell->layout();
}
}
diff --git a/WebCore/rendering/RenderTableSection.cpp b/WebCore/rendering/RenderTableSection.cpp
index 9e59109..37f2025 100644
--- a/WebCore/rendering/RenderTableSection.cpp
+++ b/WebCore/rendering/RenderTableSection.cpp
@@ -379,9 +379,9 @@ int RenderTableSection::calcRowHeight()
cell->layoutIfNeeded();
}
- int adjustedPaddingTop = cell->paddingTop() - cell->intrinsicPaddingTop();
- int adjustedPaddingBottom = cell->paddingBottom() - cell->intrinsicPaddingBottom();
- int adjustedHeight = cell->height() - (cell->intrinsicPaddingTop() + cell->intrinsicPaddingBottom());
+ int adjustedPaddingTop = cell->paddingTop() - cell->intrinsicPaddingBefore();
+ int adjustedPaddingBottom = cell->paddingBottom() - cell->intrinsicPaddingAfter();
+ int adjustedHeight = cell->height() - (cell->intrinsicPaddingBefore() + cell->intrinsicPaddingAfter());
// Explicit heights use the border box in quirks mode. In strict mode do the right
// thing and actually add in the border and padding.
@@ -399,8 +399,8 @@ int RenderTableSection::calcRowHeight()
if (va == BASELINE || va == TEXT_BOTTOM || va == TEXT_TOP || va == SUPER || va == SUB) {
int b = cell->baselinePosition();
if (b > cell->borderTop() + cell->paddingTop()) {
- baseline = max(baseline, b - cell->intrinsicPaddingTop());
- bdesc = max(bdesc, m_rowPos[indx] + ch - (b - cell->intrinsicPaddingTop()));
+ baseline = max(baseline, b - cell->intrinsicPaddingBefore());
+ bdesc = max(bdesc, m_rowPos[indx] + ch - (b - cell->intrinsicPaddingBefore()));
}
}
}
@@ -657,8 +657,8 @@ int RenderTableSection::layoutRows(int toAdd)
}
}
- int oldTe = cell->intrinsicPaddingTop();
- int oldBe = cell->intrinsicPaddingBottom();
+ int oldTe = cell->intrinsicPaddingBefore();
+ int oldBe = cell->intrinsicPaddingAfter();
int heightWithoutIntrinsicPadding = cell->height() - oldTe - oldBe;
int te = 0;
@@ -687,8 +687,8 @@ int RenderTableSection::layoutRows(int toAdd)
}
int be = rHeight - heightWithoutIntrinsicPadding - te;
- cell->setIntrinsicPaddingTop(te);
- cell->setIntrinsicPaddingBottom(be);
+ cell->setIntrinsicPaddingBefore(te);
+ cell->setIntrinsicPaddingAfter(be);
IntRect oldCellRect(cell->x(), cell->y() , cell->width(), cell->height());
diff --git a/WebCore/rendering/RenderText.cpp b/WebCore/rendering/RenderText.cpp
index d786e6a..fada8b4 100644
--- a/WebCore/rendering/RenderText.cpp
+++ b/WebCore/rendering/RenderText.cpp
@@ -263,7 +263,7 @@ PassRefPtr<StringImpl> RenderText::originalText() const
void RenderText::absoluteRects(Vector<IntRect>& rects, int tx, int ty)
{
for (InlineTextBox* box = firstTextBox(); box; box = box->nextTextBox())
- rects.append(IntRect(tx + box->x(), ty + box->y(), box->width(), box->height()));
+ rects.append(IntRect(tx + box->x(), ty + box->y(), box->logicalWidth(), box->logicalHeight()));
}
void RenderText::absoluteRectsForRange(Vector<IntRect>& rects, unsigned start, unsigned end, bool useSelectionHeight)
@@ -281,7 +281,7 @@ void RenderText::absoluteRectsForRange(Vector<IntRect>& rects, unsigned start, u
for (InlineTextBox* box = firstTextBox(); box; box = box->nextTextBox()) {
// Note: box->end() returns the index of the last character, not the index past it
if (start <= box->start() && box->end() < end) {
- IntRect r = IntRect(box->x(), box->y(), box->width(), box->height());
+ IntRect r = IntRect(box->x(), box->y(), box->logicalWidth(), box->logicalHeight());
if (useSelectionHeight) {
IntRect selectionRect = box->selectionRect(0, 0, start, end);
r.setHeight(selectionRect.height());
@@ -297,7 +297,7 @@ void RenderText::absoluteRectsForRange(Vector<IntRect>& rects, unsigned start, u
if (!r.isEmpty()) {
if (!useSelectionHeight) {
// change the height and y position because selectionRect uses selection-specific values
- r.setHeight(box->height());
+ r.setHeight(box->logicalHeight());
r.setY(box->y());
}
FloatPoint origin = localToAbsolute(r.location());
@@ -380,7 +380,7 @@ void RenderText::absoluteQuadsForRange(Vector<FloatQuad>& quads, unsigned start,
if (r.height()) {
if (!useSelectionHeight) {
// change the height and y position because selectionRect uses selection-specific values
- r.setHeight(box->height());
+ r.setHeight(box->logicalHeight());
r.setY(box->y());
}
quads.append(localToAbsoluteQuad(FloatRect(r)));
@@ -425,7 +425,7 @@ VisiblePosition RenderText::positionForPoint(const IntPoint& point)
offset = firstTextBox()->offsetForPosition(point.x());
return createVisiblePosition(offset + firstTextBox()->start(), DOWNSTREAM);
}
- if (lastTextBox() && point.y() >= lastTextBox()->root()->lineTop() && point.x() >= lastTextBox()->m_x + lastTextBox()->m_width) {
+ if (lastTextBox() && point.y() >= lastTextBox()->root()->lineTop() && point.x() >= lastTextBox()->m_x + lastTextBox()->logicalWidth()) {
// at the y coordinate of the last line or below
// and the x coordinate is to the right of the last text box right edge
offset = lastTextBox()->offsetForPosition(point.x());
@@ -444,7 +444,7 @@ VisiblePosition RenderText::positionForPoint(const IntPoint& point)
// the affinity must be downstream so the position doesn't jump back to the previous line
return createVisiblePosition(offset + box->start(), DOWNSTREAM);
- if (point.x() < box->m_x + box->m_width)
+ if (point.x() < box->m_x + box->logicalWidth())
// and the x coordinate is to the left of the right edge of this box
// check to see if position goes in this box
return createVisiblePosition(offset + box->start(), offset > 0 ? VP_UPSTREAM_IF_POSSIBLE : DOWNSTREAM);
@@ -489,11 +489,11 @@ IntRect RenderText::localCaretRect(InlineBox* inlineBox, int caretOffset, int* e
int caretWidthRightOfOffset = caretWidth - caretWidthLeftOfOffset;
int rootLeft = box->root()->x();
- int rootRight = rootLeft + box->root()->width();
+ int rootRight = rootLeft + box->root()->logicalWidth();
// FIXME: should we use the width of the root inline box or the
// width of the containing block for this?
if (extraWidthToEndOfLine)
- *extraWidthToEndOfLine = (box->root()->width() + rootLeft) - (left + 1);
+ *extraWidthToEndOfLine = (box->root()->logicalWidth() + rootLeft) - (left + 1);
RenderBlock* cb = containingBlock();
RenderStyle* cbStyle = cb->style();
@@ -581,8 +581,8 @@ void RenderText::trimmedPrefWidths(int leadWidth,
if (!collapseWhiteSpace)
stripFrontSpaces = false;
- if (m_hasTab || prefWidthsDirty())
- calcPrefWidths(leadWidth);
+ if (m_hasTab || preferredLogicalWidthsDirty())
+ computePreferredLogicalWidths(leadWidth);
beginWS = !stripFrontSpaces && m_hasBeginWS;
endWS = m_hasEndWS;
@@ -664,34 +664,34 @@ static inline bool isSpaceAccordingToStyle(UChar c, RenderStyle* style)
return c == ' ' || (c == noBreakSpace && style->nbspMode() == SPACE);
}
-int RenderText::minPrefWidth() const
+int RenderText::minPreferredLogicalWidth() const
{
- if (prefWidthsDirty())
- const_cast<RenderText*>(this)->calcPrefWidths(0);
+ if (preferredLogicalWidthsDirty())
+ const_cast<RenderText*>(this)->computePreferredLogicalWidths(0);
return m_minWidth;
}
-int RenderText::maxPrefWidth() const
+int RenderText::maxPreferredLogicalWidth() const
{
- if (prefWidthsDirty())
- const_cast<RenderText*>(this)->calcPrefWidths(0);
+ if (preferredLogicalWidthsDirty())
+ const_cast<RenderText*>(this)->computePreferredLogicalWidths(0);
return m_maxWidth;
}
-void RenderText::calcPrefWidths(int leadWidth)
+void RenderText::computePreferredLogicalWidths(int leadWidth)
{
HashSet<const SimpleFontData*> fallbackFonts;
GlyphOverflow glyphOverflow;
- calcPrefWidths(leadWidth, fallbackFonts, glyphOverflow);
+ computePreferredLogicalWidths(leadWidth, fallbackFonts, glyphOverflow);
if (fallbackFonts.isEmpty() && !glyphOverflow.left && !glyphOverflow.right && !glyphOverflow.top && !glyphOverflow.bottom)
m_knownToHaveNoOverflowAndNoFallbackFonts = true;
}
-void RenderText::calcPrefWidths(int leadWidth, HashSet<const SimpleFontData*>& fallbackFonts, GlyphOverflow& glyphOverflow)
+void RenderText::computePreferredLogicalWidths(int leadWidth, HashSet<const SimpleFontData*>& fallbackFonts, GlyphOverflow& glyphOverflow)
{
- ASSERT(m_hasTab || prefWidthsDirty() || !m_knownToHaveNoOverflowAndNoFallbackFonts);
+ ASSERT(m_hasTab || preferredLogicalWidthsDirty() || !m_knownToHaveNoOverflowAndNoFallbackFonts);
m_minWidth = 0;
m_beginMinWidth = 0;
@@ -877,7 +877,7 @@ void RenderText::calcPrefWidths(int leadWidth, HashSet<const SimpleFontData*>& f
m_endMinWidth = currMaxWidth;
}
- setPrefWidthsDirty(false);
+ setPreferredLogicalWidthsDirty(false);
}
bool RenderText::isAllCollapsibleWhitespace()
@@ -1249,14 +1249,14 @@ unsigned RenderText::width(unsigned from, unsigned len, const Font& f, int xPos,
if (!style()->preserveNewline() && !from && len == textLength()) {
if (fallbackFonts) {
ASSERT(glyphOverflow);
- if (prefWidthsDirty() || !m_knownToHaveNoOverflowAndNoFallbackFonts) {
- const_cast<RenderText*>(this)->calcPrefWidths(0, *fallbackFonts, *glyphOverflow);
+ if (preferredLogicalWidthsDirty() || !m_knownToHaveNoOverflowAndNoFallbackFonts) {
+ const_cast<RenderText*>(this)->computePreferredLogicalWidths(0, *fallbackFonts, *glyphOverflow);
if (fallbackFonts->isEmpty() && !glyphOverflow->left && !glyphOverflow->right && !glyphOverflow->top && !glyphOverflow->bottom)
m_knownToHaveNoOverflowAndNoFallbackFonts = true;
}
w = m_maxWidth;
} else
- w = maxPrefWidth();
+ w = maxPreferredLogicalWidth();
} else
w = widthFromCache(f, from, len, xPos, fallbackFonts, glyphOverflow);
} else
@@ -1277,12 +1277,12 @@ IntRect RenderText::linesBoundingBox() const
for (InlineTextBox* curr = firstTextBox(); curr; curr = curr->nextTextBox()) {
if (curr == firstTextBox() || curr->x() < leftSide)
leftSide = curr->x();
- if (curr == firstTextBox() || curr->x() + curr->width() > rightSide)
- rightSide = curr->x() + curr->width();
+ if (curr == firstTextBox() || curr->x() + curr->logicalWidth() > rightSide)
+ rightSide = curr->x() + curr->logicalWidth();
}
result.setWidth(rightSide - leftSide);
result.setX(leftSide);
- result.setHeight(lastTextBox()->y() + lastTextBox()->height() - firstTextBox()->y());
+ result.setHeight(lastTextBox()->y() + lastTextBox()->logicalHeight() - firstTextBox()->y());
result.setY(firstTextBox()->y());
}
diff --git a/WebCore/rendering/RenderText.h b/WebCore/rendering/RenderText.h
index 6ab73f6..e3a6997 100644
--- a/WebCore/rendering/RenderText.h
+++ b/WebCore/rendering/RenderText.h
@@ -76,8 +76,8 @@ public:
virtual int lineHeight(bool firstLine, bool isRootLineBox = false) const;
- virtual int minPrefWidth() const;
- virtual int maxPrefWidth() const;
+ virtual int minPreferredLogicalWidth() const;
+ virtual int maxPreferredLogicalWidth() const;
void trimmedPrefWidths(int leadWidth,
int& beginMinW, bool& beginWS,
@@ -124,7 +124,7 @@ public:
void checkConsistency() const;
- virtual void calcPrefWidths(int leadWidth);
+ virtual void computePreferredLogicalWidths(int leadWidth);
bool isAllCollapsibleWhitespace();
protected:
@@ -137,7 +137,7 @@ protected:
virtual InlineTextBox* createTextBox(); // Subclassed by SVG.
private:
- void calcPrefWidths(int leadWidth, HashSet<const SimpleFontData*>& fallbackFonts, GlyphOverflow&);
+ void computePreferredLogicalWidths(int leadWidth, HashSet<const SimpleFontData*>& fallbackFonts, GlyphOverflow&);
// Make length() private so that callers that have a RenderText*
// will use the more efficient textLength() instead, while
diff --git a/WebCore/rendering/RenderTextControl.cpp b/WebCore/rendering/RenderTextControl.cpp
index e66e4ed..f48081b 100644
--- a/WebCore/rendering/RenderTextControl.cpp
+++ b/WebCore/rendering/RenderTextControl.cpp
@@ -401,7 +401,7 @@ int RenderTextControl::scrollbarThickness() const
return ScrollbarTheme::nativeTheme()->scrollbarThickness();
}
-void RenderTextControl::calcHeight()
+void RenderTextControl::computeLogicalHeight()
{
setHeight(m_innerText->renderBox()->borderTop() + m_innerText->renderBox()->borderBottom() +
m_innerText->renderBox()->paddingTop() + m_innerText->renderBox()->paddingBottom() +
@@ -414,7 +414,7 @@ void RenderTextControl::calcHeight()
if (style()->overflowX() == OSCROLL || (style()->overflowX() == OAUTO && m_innerText->renderer()->style()->wordWrap() == NormalWordWrap))
setHeight(height() + scrollbarThickness());
- RenderBlock::calcHeight();
+ RenderBlock::computeLogicalHeight();
}
void RenderTextControl::hitInnerTextElement(HitTestResult& result, int xPos, int yPos, int tx, int ty)
@@ -504,40 +504,40 @@ float RenderTextControl::scaleEmToUnits(int x) const
return roundf(style()->font().size() * x / unitsPerEm);
}
-void RenderTextControl::calcPrefWidths()
+void RenderTextControl::computePreferredLogicalWidths()
{
- ASSERT(prefWidthsDirty());
+ ASSERT(preferredLogicalWidthsDirty());
- m_minPrefWidth = 0;
- m_maxPrefWidth = 0;
+ m_minPreferredLogicalWidth = 0;
+ m_maxPreferredLogicalWidth = 0;
if (style()->width().isFixed() && style()->width().value() > 0)
- m_minPrefWidth = m_maxPrefWidth = calcContentBoxWidth(style()->width().value());
+ m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = computeContentBoxLogicalWidth(style()->width().value());
else {
// Use average character width. Matches IE.
AtomicString family = style()->font().family().family();
- m_maxPrefWidth = preferredContentWidth(getAvgCharWidth(family)) + m_innerText->renderBox()->paddingLeft() + m_innerText->renderBox()->paddingRight();
+ m_maxPreferredLogicalWidth = preferredContentWidth(getAvgCharWidth(family)) + m_innerText->renderBox()->paddingLeft() + m_innerText->renderBox()->paddingRight();
}
if (style()->minWidth().isFixed() && style()->minWidth().value() > 0) {
- m_maxPrefWidth = max(m_maxPrefWidth, calcContentBoxWidth(style()->minWidth().value()));
- m_minPrefWidth = max(m_minPrefWidth, calcContentBoxWidth(style()->minWidth().value()));
+ m_maxPreferredLogicalWidth = max(m_maxPreferredLogicalWidth, computeContentBoxLogicalWidth(style()->minWidth().value()));
+ m_minPreferredLogicalWidth = max(m_minPreferredLogicalWidth, computeContentBoxLogicalWidth(style()->minWidth().value()));
} else if (style()->width().isPercent() || (style()->width().isAuto() && style()->height().isPercent()))
- m_minPrefWidth = 0;
+ m_minPreferredLogicalWidth = 0;
else
- m_minPrefWidth = m_maxPrefWidth;
+ m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth;
if (style()->maxWidth().isFixed() && style()->maxWidth().value() != undefinedLength) {
- m_maxPrefWidth = min(m_maxPrefWidth, calcContentBoxWidth(style()->maxWidth().value()));
- m_minPrefWidth = min(m_minPrefWidth, calcContentBoxWidth(style()->maxWidth().value()));
+ m_maxPreferredLogicalWidth = min(m_maxPreferredLogicalWidth, computeContentBoxLogicalWidth(style()->maxWidth().value()));
+ m_minPreferredLogicalWidth = min(m_minPreferredLogicalWidth, computeContentBoxLogicalWidth(style()->maxWidth().value()));
}
int toAdd = borderAndPaddingWidth();
- m_minPrefWidth += toAdd;
- m_maxPrefWidth += toAdd;
+ m_minPreferredLogicalWidth += toAdd;
+ m_maxPreferredLogicalWidth += toAdd;
- setPrefWidthsDirty(false);
+ setPreferredLogicalWidthsDirty(false);
}
void RenderTextControl::selectionChanged(bool userTriggered)
diff --git a/WebCore/rendering/RenderTextControl.h b/WebCore/rendering/RenderTextControl.h
index de0b21b..a33f11d 100644
--- a/WebCore/rendering/RenderTextControl.h
+++ b/WebCore/rendering/RenderTextControl.h
@@ -85,7 +85,7 @@ protected:
virtual RenderStyle* textBaseStyle() const = 0;
virtual void updateFromElement();
- virtual void calcHeight();
+ virtual void computeLogicalHeight();
friend class TextIterator;
HTMLElement* innerTextElement() const;
@@ -95,7 +95,7 @@ protected:
private:
virtual const char* renderName() const { return "RenderTextControl"; }
virtual bool isTextControl() const { return true; }
- virtual void calcPrefWidths();
+ virtual void computePreferredLogicalWidths();
virtual void removeLeftoverAnonymousBlock(RenderBlock*) { }
virtual bool canHaveChildren() const { return false; }
virtual bool avoidsFloats() const { return true; }
diff --git a/WebCore/rendering/RenderTextControlSingleLine.cpp b/WebCore/rendering/RenderTextControlSingleLine.cpp
index e49fa4c..7edbe7f 100644
--- a/WebCore/rendering/RenderTextControlSingleLine.cpp
+++ b/WebCore/rendering/RenderTextControlSingleLine.cpp
@@ -227,10 +227,10 @@ void RenderTextControlSingleLine::addFocusRingRects(Vector<IntRect>& rects, int
void RenderTextControlSingleLine::layout()
{
int oldHeight = height();
- calcHeight();
+ computeLogicalHeight();
int oldWidth = width();
- calcWidth();
+ computeLogicalWidth();
bool relayoutChildren = oldHeight != height() || oldWidth != width();
@@ -483,23 +483,23 @@ int RenderTextControlSingleLine::textBlockWidth() const
int width = RenderTextControl::textBlockWidth();
if (RenderBox* resultsRenderer = m_resultsButton ? m_resultsButton->renderBox() : 0) {
- resultsRenderer->calcWidth();
+ resultsRenderer->computeLogicalWidth();
width -= resultsRenderer->width() + resultsRenderer->marginLeft() + resultsRenderer->marginRight();
}
if (RenderBox* cancelRenderer = m_cancelButton ? m_cancelButton->renderBox() : 0) {
- cancelRenderer->calcWidth();
+ cancelRenderer->computeLogicalWidth();
width -= cancelRenderer->width() + cancelRenderer->marginLeft() + cancelRenderer->marginRight();
}
if (RenderBox* spinRenderer = m_innerSpinButton ? m_innerSpinButton->renderBox() : 0) {
- spinRenderer->calcWidth();
+ spinRenderer->computeLogicalWidth();
width -= spinRenderer->width() + spinRenderer->marginLeft() + spinRenderer->marginRight();
}
#if ENABLE(INPUT_SPEECH)
if (RenderBox* speechRenderer = m_speechButton ? m_speechButton->renderBox() : 0) {
- speechRenderer->calcWidth();
+ speechRenderer->computeLogicalWidth();
width -= speechRenderer->width() + speechRenderer->marginLeft() + speechRenderer->marginRight();
}
#endif
@@ -511,7 +511,7 @@ int RenderTextControlSingleLine::decorationWidthRight() const
{
int width = 0;
if (RenderBox* spinRenderer = m_outerSpinButton ? m_outerSpinButton->renderBox() : 0) {
- spinRenderer->calcWidth();
+ spinRenderer->computeLogicalWidth();
width += spinRenderer->width() + spinRenderer->marginLeft() + spinRenderer->marginRight();
}
if (width > 0)
@@ -563,7 +563,7 @@ int RenderTextControlSingleLine::preferredContentWidth(float charWidth) const
cancelRenderer->paddingLeft() + cancelRenderer->paddingRight();
if (RenderBox* spinRenderer = m_innerSpinButton ? m_innerSpinButton->renderBox() : 0)
- result += spinRenderer->minPrefWidth();
+ result += spinRenderer->minPreferredLogicalWidth();
#if ENABLE(INPUT_SPEECH)
if (RenderBox* speechRenderer = m_speechButton ? m_speechButton->renderBox() : 0) {
@@ -578,8 +578,8 @@ int RenderTextControlSingleLine::preferredDecorationWidthRight() const
{
int width = 0;
if (RenderBox* spinRenderer = m_outerSpinButton ? m_outerSpinButton->renderBox() : 0) {
- spinRenderer->calcWidth();
- width += spinRenderer->minPrefWidth() + spinRenderer->marginLeft() + spinRenderer->marginRight();
+ spinRenderer->computeLogicalWidth();
+ width += spinRenderer->minPreferredLogicalWidth() + spinRenderer->marginLeft() + spinRenderer->marginRight();
}
if (width > 0)
width += paddingRight() + borderRight();
@@ -589,7 +589,7 @@ int RenderTextControlSingleLine::preferredDecorationWidthRight() const
void RenderTextControlSingleLine::adjustControlHeightBasedOnLineHeight(int lineHeight)
{
if (RenderBox* resultsRenderer = m_resultsButton ? m_resultsButton->renderBox() : 0) {
- toRenderBlock(resultsRenderer)->calcHeight();
+ toRenderBlock(resultsRenderer)->computeLogicalHeight();
setHeight(max(height(),
resultsRenderer->borderTop() + resultsRenderer->borderBottom() +
resultsRenderer->paddingTop() + resultsRenderer->paddingBottom() +
@@ -598,7 +598,7 @@ void RenderTextControlSingleLine::adjustControlHeightBasedOnLineHeight(int lineH
}
if (RenderBox* cancelRenderer = m_cancelButton ? m_cancelButton->renderBox() : 0) {
- toRenderBlock(cancelRenderer)->calcHeight();
+ toRenderBlock(cancelRenderer)->computeLogicalHeight();
setHeight(max(height(),
cancelRenderer->borderTop() + cancelRenderer->borderBottom() +
cancelRenderer->paddingTop() + cancelRenderer->paddingBottom() +
diff --git a/WebCore/rendering/RenderTreeAsText.cpp b/WebCore/rendering/RenderTreeAsText.cpp
index e10c2f1..ab6247b 100644
--- a/WebCore/rendering/RenderTreeAsText.cpp
+++ b/WebCore/rendering/RenderTreeAsText.cpp
@@ -46,7 +46,6 @@
#include "RenderView.h"
#include "RenderWidget.h"
#include "SelectionController.h"
-#include "TextStream.h"
#include <wtf/UnusedParam.h>
#include <wtf/Vector.h>
@@ -75,12 +74,53 @@ using namespace HTMLNames;
static void writeLayers(TextStream&, const RenderLayer* rootLayer, RenderLayer*, const IntRect& paintDirtyRect, int indent = 0, RenderAsTextBehavior behavior = RenderAsTextBehaviorNormal);
-#if !ENABLE(SVG)
-static TextStream &operator<<(TextStream& ts, const IntRect& r)
+bool hasFractions(double val)
+{
+ static const double s_epsilon = 0.0001;
+ int ival = static_cast<int>(val);
+ double dval = static_cast<double>(ival);
+ return fabs(val - dval) > s_epsilon;
+}
+
+TextStream& operator<<(TextStream& ts, const IntRect& r)
{
return ts << "at (" << r.x() << "," << r.y() << ") size " << r.width() << "x" << r.height();
}
-#endif
+
+TextStream& operator<<(TextStream& ts, const IntPoint& p)
+{
+ return ts << "(" << p.x() << "," << p.y() << ")";
+}
+
+TextStream& operator<<(TextStream& ts, const FloatPoint& p)
+{
+ ts << "(";
+ if (hasFractions(p.x()))
+ ts << p.x();
+ else
+ ts << int(p.x());
+ ts << ",";
+ if (hasFractions(p.y()))
+ ts << p.y();
+ else
+ ts << int(p.y());
+ return ts << ")";
+}
+
+TextStream& operator<<(TextStream& ts, const FloatSize& s)
+{
+ ts << "width=";
+ if (hasFractions(s.width()))
+ ts << s.width();
+ else
+ ts << int(s.width());
+ ts << " height=";
+ if (hasFractions(s.height()))
+ ts << s.height();
+ else
+ ts << int(s.height());
+ return ts;
+}
void writeIndent(TextStream& ts, int indent)
{
@@ -223,13 +263,13 @@ void RenderTreeAsText::writeRenderObject(TextStream& ts, const RenderObject& o,
// to clean up the results to dump both the outer box and the intrinsic padding so that both bits of information are
// captured by the results.
const RenderTableCell& cell = *toRenderTableCell(&o);
- r = IntRect(cell.x(), cell.y() + cell.intrinsicPaddingTop(), cell.width(), cell.height() - cell.intrinsicPaddingTop() - cell.intrinsicPaddingBottom());
+ r = IntRect(cell.x(), cell.y() + cell.intrinsicPaddingBefore(), cell.width(), cell.height() - cell.intrinsicPaddingBefore() - cell.intrinsicPaddingAfter());
} else if (o.isBox())
r = toRenderBox(&o)->frameRect();
// FIXME: Temporary in order to ensure compatibility with existing layout test results.
if (adjustForTableCells)
- r.move(0, -toRenderTableCell(o.containingBlock())->intrinsicPaddingTop());
+ r.move(0, -toRenderTableCell(o.containingBlock())->intrinsicPaddingBefore());
ts << " " << r;
@@ -398,8 +438,8 @@ static void writeTextRun(TextStream& ts, const RenderText& o, const InlineTextBo
// FIXME: Table cell adjustment is temporary until results can be updated.
int y = run.m_y;
if (o.containingBlock()->isTableCell())
- y -= toRenderTableCell(o.containingBlock())->intrinsicPaddingTop();
- ts << "text run at (" << run.m_x << "," << y << ") width " << run.m_width;
+ y -= toRenderTableCell(o.containingBlock())->intrinsicPaddingBefore();
+ ts << "text run at (" << run.m_x << "," << y << ") width " << run.m_logicalWidth;
if (run.direction() == RTL || run.m_dirOverride) {
ts << (run.direction() == RTL ? " RTL" : " LTR");
if (run.m_dirOverride)
diff --git a/WebCore/rendering/RenderTreeAsText.h b/WebCore/rendering/RenderTreeAsText.h
index 722736b..59a0abb 100644
--- a/WebCore/rendering/RenderTreeAsText.h
+++ b/WebCore/rendering/RenderTreeAsText.h
@@ -25,13 +25,19 @@
#ifndef RenderTreeAsText_h
#define RenderTreeAsText_h
+#include "TextStream.h"
#include <wtf/Forward.h>
+#include <wtf/MathExtras.h>
namespace WebCore {
class Element;
+class FloatPoint;
+class FloatSize;
class Frame;
+class IntPoint;
+class IntRect;
class RenderObject;
class TextStream;
@@ -59,6 +65,27 @@ public:
static void writeRenderObject(TextStream& ts, const RenderObject& o, RenderAsTextBehavior behavior);
};
+TextStream& operator<<(TextStream&, const IntPoint&);
+TextStream& operator<<(TextStream&, const IntRect&);
+TextStream& operator<<(TextStream&, const FloatPoint&);
+TextStream& operator<<(TextStream&, const FloatSize&);
+
+template<typename Item>
+TextStream& operator<<(TextStream& ts, const Vector<Item>& vector)
+{
+ ts << "[";
+
+ unsigned size = vector.size();
+ for (unsigned i = 0; i < size; ++i) {
+ ts << vector[i];
+ if (i < size - 1)
+ ts << ", ";
+ }
+
+ ts << "]";
+ return ts;
+}
+
// Helper function shared with SVGRenderTreeAsText
String quoteAndEscapeNonPrintables(const String&);
@@ -66,6 +93,8 @@ String counterValueForElement(Element*);
String markerTextForListItem(Element*);
+bool hasFractions(double val);
+
} // namespace WebCore
#endif // RenderTreeAsText_h
diff --git a/WebCore/rendering/RenderVideo.cpp b/WebCore/rendering/RenderVideo.cpp
index 3dfee7b..470499a 100644
--- a/WebCore/rendering/RenderVideo.cpp
+++ b/WebCore/rendering/RenderVideo.cpp
@@ -90,7 +90,7 @@ void RenderVideo::updateIntrinsicSize()
return;
setIntrinsicSize(size);
- setPrefWidthsDirty(true);
+ setPreferredLogicalWidthsDirty(true);
setNeedsLayout(true);
}
@@ -246,14 +246,14 @@ void RenderVideo::updatePlayer()
mediaPlayer->setVisible(true);
}
-int RenderVideo::calcReplacedWidth(bool includeMaxWidth) const
+int RenderVideo::computeReplacedWidth(bool includeMaxWidth) const
{
- return RenderReplaced::calcReplacedWidth(includeMaxWidth);
+ return RenderReplaced::computeReplacedWidth(includeMaxWidth);
}
-int RenderVideo::calcReplacedHeight() const
+int RenderVideo::computeReplacedHeight() const
{
- return RenderReplaced::calcReplacedHeight();
+ return RenderReplaced::computeReplacedHeight();
}
int RenderVideo::minimumReplacedHeight() const
diff --git a/WebCore/rendering/RenderVideo.h b/WebCore/rendering/RenderVideo.h
index 2c47471..24f473d 100644
--- a/WebCore/rendering/RenderVideo.h
+++ b/WebCore/rendering/RenderVideo.h
@@ -70,8 +70,8 @@ private:
virtual void layout();
- virtual int calcReplacedWidth(bool includeMaxWidth = true) const;
- virtual int calcReplacedHeight() const;
+ virtual int computeReplacedWidth(bool includeMaxWidth = true) const;
+ virtual int computeReplacedHeight() const;
virtual int minimumReplacedHeight() const;
void updatePlayer();
diff --git a/WebCore/rendering/RenderView.cpp b/WebCore/rendering/RenderView.cpp
index edee4f6..439ed76 100644
--- a/WebCore/rendering/RenderView.cpp
+++ b/WebCore/rendering/RenderView.cpp
@@ -64,10 +64,10 @@ RenderView::RenderView(Node* node, FrameView* view)
// init RenderObject attributes
setInline(false);
- m_minPrefWidth = 0;
- m_maxPrefWidth = 0;
+ m_minPreferredLogicalWidth = 0;
+ m_maxPreferredLogicalWidth = 0;
- setPrefWidthsDirty(true, false);
+ setPreferredLogicalWidthsDirty(true, false);
setPositioned(true); // to 0,0 :)
}
@@ -76,15 +76,16 @@ RenderView::~RenderView()
{
}
-void RenderView::calcHeight()
+void RenderView::computeLogicalHeight()
{
if (!printing() && m_frameView)
- setHeight(viewHeight());
+ setLogicalHeight(viewLogicalHeight());
}
-void RenderView::calcWidth()
+void RenderView::computeLogicalWidth()
{
if (!printing() && m_frameView)
+<<<<<<< HEAD
setWidth(viewWidth());
#ifdef ANDROID_LAYOUT
setVisibleWidth(m_frameView->textWrapWidth());
@@ -95,15 +96,18 @@ void RenderView::calcWidth()
#endif
m_marginLeft = 0;
m_marginRight = 0;
+=======
+ setLogicalWidth(viewLogicalWidth());
+>>>>>>> webkit.org at r68651
}
-void RenderView::calcPrefWidths()
+void RenderView::computePreferredLogicalWidths()
{
- ASSERT(prefWidthsDirty());
+ ASSERT(preferredLogicalWidthsDirty());
- RenderBlock::calcPrefWidths();
+ RenderBlock::computePreferredLogicalWidths();
- m_maxPrefWidth = m_minPrefWidth;
+ m_maxPreferredLogicalWidth = m_minPreferredLogicalWidth;
}
void RenderView::layout()
@@ -112,14 +116,14 @@ void RenderView::layout()
setPageHeight(0);
if (printing())
- m_minPrefWidth = m_maxPrefWidth = width();
+ m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = width();
// Use calcWidth/Height to get the new width/height, since this will take the full page zoom factor into account.
bool relayoutChildren = !printing() && (!m_frameView || width() != viewWidth() || height() != viewHeight());
if (relayoutChildren) {
setChildNeedsLayout(true, false);
for (RenderObject* child = firstChild(); child; child = child->nextSibling()) {
- if (child->style()->height().isPercent() || child->style()->minHeight().isPercent() || child->style()->maxHeight().isPercent())
+ if (child->style()->logicalHeight().isPercent() || child->style()->logicalMinHeight().isPercent() || child->style()->logicalMaxHeight().isPercent())
child->setChildNeedsLayout(true, false);
}
}
diff --git a/WebCore/rendering/RenderView.h b/WebCore/rendering/RenderView.h
index 55aa3b4..b03312f 100644
--- a/WebCore/rendering/RenderView.h
+++ b/WebCore/rendering/RenderView.h
@@ -47,13 +47,15 @@ public:
virtual bool requiresLayer() const { return true; }
virtual void layout();
- virtual void calcWidth();
- virtual void calcHeight();
- virtual void calcPrefWidths();
+ virtual void computeLogicalWidth();
+ virtual void computeLogicalHeight();
+ virtual void computePreferredLogicalWidths();
// The same as the FrameView's layoutHeight/layoutWidth but with null check guards.
int viewHeight() const;
int viewWidth() const;
+ int viewLogicalWidth() const { return style()->isVerticalBlockFlow() ? viewWidth() : viewHeight(); }
+ int viewLogicalHeight() const { return style()->isVerticalBlockFlow() ? viewHeight() : viewWidth(); }
float zoomFactor() const;
diff --git a/WebCore/rendering/RootInlineBox.cpp b/WebCore/rendering/RootInlineBox.cpp
index e8f24b5..52586c5 100644
--- a/WebCore/rendering/RootInlineBox.cpp
+++ b/WebCore/rendering/RootInlineBox.cpp
@@ -39,6 +39,18 @@ namespace WebCore {
typedef WTF::HashMap<const RootInlineBox*, EllipsisBox*> EllipsisBoxMap;
static EllipsisBoxMap* gEllipsisBoxMap = 0;
+RootInlineBox::RootInlineBox(RenderBlock* block)
+ : InlineFlowBox(block)
+ , m_lineBreakObj(0)
+ , m_lineBreakPos(0)
+ , m_lineTop(0)
+ , m_lineBottom(0)
+ , m_paginationStrut(0)
+{
+ setIsVertical(!block->style()->isVerticalBlockFlow());
+}
+
+
void RootInlineBox::destroy(RenderArena* arena)
{
detachEllipsisBox(arena);
@@ -72,7 +84,7 @@ bool RootInlineBox::canAccommodateEllipsis(bool ltr, int blockEdge, int lineBoxE
{
// First sanity-check the unoverflowed width of the whole line to see if there is sufficient room.
int delta = ltr ? lineBoxEdge - blockEdge : blockEdge - lineBoxEdge;
- if (width() - delta < ellipsisWidth)
+ if (logicalWidth() - delta < ellipsisWidth)
return false;
// Next iterate over all the line boxes on the line. If we find a replaced element that intersects
@@ -85,9 +97,8 @@ void RootInlineBox::placeEllipsis(const AtomicString& ellipsisStr, bool ltr, in
{
// Create an ellipsis box.
EllipsisBox* ellipsisBox = new (renderer()->renderArena()) EllipsisBox(renderer(), ellipsisStr, this,
- ellipsisWidth - (markupBox ? markupBox->width() : 0), height(),
- y(), !prevRootBox(),
- markupBox);
+ ellipsisWidth - (markupBox ? markupBox->logicalWidth() : 0), logicalHeight(),
+ y(), !prevRootBox(), isVertical(), markupBox);
if (!gEllipsisBoxMap)
gEllipsisBoxMap = new EllipsisBoxMap();
@@ -95,8 +106,8 @@ void RootInlineBox::placeEllipsis(const AtomicString& ellipsisStr, bool ltr, in
setHasEllipsisBox(true);
// FIXME: Do we need an RTL version of this?
- if (ltr && (x() + width() + ellipsisWidth) <= blockRightEdge) {
- ellipsisBox->m_x = x() + width();
+ if (ltr && (x() + logicalWidth() + ellipsisWidth) <= blockRightEdge) {
+ ellipsisBox->m_x = x() + logicalWidth();
return;
}
@@ -134,10 +145,10 @@ void RootInlineBox::addHighlightOverflow()
return;
// Highlight acts as a selection inflation.
- FloatRect rootRect(0, selectionTop(), width(), selectionHeight());
+ FloatRect rootRect(0, selectionTop(), logicalWidth(), selectionHeight());
IntRect inflatedRect = enclosingIntRect(page->chrome()->client()->customHighlightRect(renderer()->node(), renderer()->style()->highlight(), rootRect));
- setHorizontalOverflowPositions(leftLayoutOverflow(), rightLayoutOverflow(), min(leftVisualOverflow(), inflatedRect.x()), max(rightVisualOverflow(), inflatedRect.right()));
- setVerticalOverflowPositions(topLayoutOverflow(), bottomLayoutOverflow(), min(topVisualOverflow(), inflatedRect.y()), max(bottomVisualOverflow(), inflatedRect.bottom()), height());
+ setInlineDirectionOverflowPositions(leftLayoutOverflow(), rightLayoutOverflow(), min(leftVisualOverflow(), inflatedRect.x()), max(rightVisualOverflow(), inflatedRect.right()));
+ setBlockDirectionOverflowPositions(topLayoutOverflow(), bottomLayoutOverflow(), min(topVisualOverflow(), inflatedRect.y()), max(bottomVisualOverflow(), inflatedRect.bottom()), logicalHeight());
}
void RootInlineBox::paintCustomHighlight(PaintInfo& paintInfo, int tx, int ty, const AtomicString& highlightType)
@@ -153,7 +164,7 @@ void RootInlineBox::paintCustomHighlight(PaintInfo& paintInfo, int tx, int ty, c
return;
// Get the inflated rect so that we can properly hit test.
- FloatRect rootRect(tx + x(), ty + selectionTop(), width(), selectionHeight());
+ FloatRect rootRect(tx + x(), ty + selectionTop(), logicalWidth(), selectionHeight());
FloatRect inflatedRect = page->chrome()->client()->customHighlightRect(renderer()->node(), highlightType, rootRect);
if (inflatedRect.intersects(paintInfo.rect))
page->chrome()->client()->paintCustomHighlight(renderer()->node(), highlightType, rootRect, rootRect, false, true);
@@ -202,7 +213,7 @@ void RootInlineBox::childRemoved(InlineBox* box)
}
}
-int RootInlineBox::verticallyAlignBoxes(int heightOfBlock, GlyphOverflowAndFallbackFontsMap& textBoxDataMap)
+int RootInlineBox::alignBoxesInBlockDirection(int heightOfBlock, GlyphOverflowAndFallbackFontsMap& textBoxDataMap)
{
#if ENABLE(SVG)
// SVG will handle vertical alignment on its own.
@@ -226,8 +237,8 @@ int RootInlineBox::verticallyAlignBoxes(int heightOfBlock, GlyphOverflowAndFallb
int maxHeight = maxAscent + maxDescent;
int lineTop = heightOfBlock;
int lineBottom = heightOfBlock;
- placeBoxesVertically(heightOfBlock, maxHeight, maxAscent, noQuirksMode, lineTop, lineBottom);
- computeVerticalOverflow(lineTop, lineBottom, noQuirksMode, textBoxDataMap);
+ placeBoxesInBlockDirection(heightOfBlock, maxHeight, maxAscent, noQuirksMode, lineTop, lineBottom);
+ computeBlockDirectionOverflow(lineTop, lineBottom, noQuirksMode, textBoxDataMap);
setLineTopBottomPositions(lineTop, lineBottom);
heightOfBlock += maxHeight;
@@ -253,7 +264,7 @@ GapRects RootInlineBox::fillLineSelectionGap(int selTop, int selHeight, RenderBl
rootBlock, blockX, blockY, tx, ty, paintInfo));
if (rightGap)
result.uniteRight(block()->fillRightSelectionGap(lastBox->parent()->renderer(),
- lastBox->x() + lastBox->width(), selTop, selHeight,
+ lastBox->x() + lastBox->logicalWidth(), selTop, selHeight,
rootBlock, blockX, blockY, tx, ty, paintInfo));
// When dealing with bidi text, a non-contiguous selection region is possible.
@@ -265,7 +276,7 @@ GapRects RootInlineBox::fillLineSelectionGap(int selTop, int selHeight, RenderBl
// We can see that the |bbb| run is not part of the selection while the runs around it are.
if (firstBox && firstBox != lastBox) {
// Now fill in any gaps on the line that occurred between two selected elements.
- int lastX = firstBox->x() + firstBox->width();
+ int lastX = firstBox->x() + firstBox->logicalWidth();
bool isPreviousBoxSelected = firstBox->selectionState() != RenderObject::SelectionNone;
for (InlineBox* box = firstBox->nextLeafChild(); box; box = box->nextLeafChild()) {
if (box->selectionState() != RenderObject::SelectionNone) {
@@ -273,7 +284,7 @@ GapRects RootInlineBox::fillLineSelectionGap(int selTop, int selHeight, RenderBl
result.uniteCenter(block()->fillHorizontalSelectionGap(box->parent()->renderer(),
lastX + tx, selTop + ty,
box->x() - lastX, selHeight, paintInfo));
- lastX = box->x() + box->width();
+ lastX = box->x() + box->logicalWidth();
}
if (box == lastBox)
break;
@@ -342,10 +353,10 @@ int RootInlineBox::selectionTop() const
// This line has actually been moved further down, probably from a large line-height, but possibly because the
// line was forced to clear floats. If so, let's check the offsets, and only be willing to use the previous
// line's bottom overflow if the offsets are greater on both sides.
- int prevLeft = block()->leftOffset(prevBottom, !prevRootBox());
- int prevRight = block()->rightOffset(prevBottom, !prevRootBox());
- int newLeft = block()->leftOffset(selectionTop, !prevRootBox());
- int newRight = block()->rightOffset(selectionTop, !prevRootBox());
+ int prevLeft = block()->logicalLeftOffsetForLine(prevBottom, !prevRootBox());
+ int prevRight = block()->logicalRightOffsetForLine(prevBottom, !prevRootBox());
+ int newLeft = block()->logicalLeftOffsetForLine(selectionTop, !prevRootBox());
+ int newRight = block()->logicalRightOffsetForLine(selectionTop, !prevRootBox());
if (prevLeft > newLeft || prevRight < newRight)
return selectionTop;
}
@@ -376,7 +387,7 @@ InlineBox* RootInlineBox::closestLeafChildForXPos(int x, bool onlyEditableLeaves
// Return it.
return firstLeaf;
- if (x >= lastLeaf->m_x + lastLeaf->m_width && !lastLeaf->renderer()->isListMarker() && (!onlyEditableLeaves || isEditableLeaf(lastLeaf)))
+ if (x >= lastLeaf->m_x + lastLeaf->m_logicalWidth && !lastLeaf->renderer()->isListMarker() && (!onlyEditableLeaves || isEditableLeaf(lastLeaf)))
// The x coordinate is greater or equal to right edge of the lastLeaf.
// Return it.
return lastLeaf;
@@ -385,7 +396,7 @@ InlineBox* RootInlineBox::closestLeafChildForXPos(int x, bool onlyEditableLeaves
for (InlineBox* leaf = firstLeaf; leaf; leaf = leaf->nextLeafChild()) {
if (!leaf->renderer()->isListMarker() && (!onlyEditableLeaves || isEditableLeaf(leaf))) {
closestLeaf = leaf;
- if (x < leaf->m_x + leaf->m_width)
+ if (x < leaf->m_x + leaf->m_logicalWidth)
// The x coordinate is less than the right edge of the box.
// Return it.
return leaf;
diff --git a/WebCore/rendering/RootInlineBox.h b/WebCore/rendering/RootInlineBox.h
index d97d0b1..8c75072 100644
--- a/WebCore/rendering/RootInlineBox.h
+++ b/WebCore/rendering/RootInlineBox.h
@@ -34,15 +34,7 @@ struct GapRects;
class RootInlineBox : public InlineFlowBox {
public:
- RootInlineBox(RenderObject* obj)
- : InlineFlowBox(obj)
- , m_lineBreakObj(0)
- , m_lineBreakPos(0)
- , m_lineTop(0)
- , m_lineBottom(0)
- , m_paginationStrut(0)
- {
- }
+ RootInlineBox(RenderBlock* block);
virtual void destroy(RenderArena*);
@@ -65,7 +57,7 @@ public:
int selectionBottom() const { return lineBottom(); }
int selectionHeight() const { return max(0, selectionBottom() - selectionTop()); }
- int verticallyAlignBoxes(int heightOfBlock, GlyphOverflowAndFallbackFontsMap&);
+ int alignBoxesInBlockDirection(int heightOfBlock, GlyphOverflowAndFallbackFontsMap&);
void setLineTopBottomPositions(int top, int bottom);
virtual RenderLineBoxList* rendererLineBoxes() const;
diff --git a/WebCore/rendering/SVGInlineFlowBox.h b/WebCore/rendering/SVGInlineFlowBox.h
index ab26297..80600f7 100644
--- a/WebCore/rendering/SVGInlineFlowBox.h
+++ b/WebCore/rendering/SVGInlineFlowBox.h
@@ -33,12 +33,12 @@ class SVGInlineFlowBox : public InlineFlowBox {
public:
SVGInlineFlowBox(RenderObject* obj)
: InlineFlowBox(obj)
- , m_height(0)
+ , m_logicalHeight(0)
{
}
- virtual int virtualHeight() const { return m_height; }
- void setHeight(int h) { m_height = h; }
+ virtual int virtualLogicalHeight() const { return m_logicalHeight; }
+ void setLogicalHeight(int h) { m_logicalHeight = h; }
virtual void paint(PaintInfo&, int tx, int ty);
@@ -46,7 +46,7 @@ public:
void layoutFlowBox();
private:
- int m_height;
+ int m_logicalHeight;
};
} // namespace WebCore
diff --git a/WebCore/rendering/SVGInlineTextBox.cpp b/WebCore/rendering/SVGInlineTextBox.cpp
index ccba5b4..c367598 100644
--- a/WebCore/rendering/SVGInlineTextBox.cpp
+++ b/WebCore/rendering/SVGInlineTextBox.cpp
@@ -40,7 +40,7 @@ namespace WebCore {
SVGInlineTextBox::SVGInlineTextBox(RenderObject* object)
: InlineTextBox(object)
- , m_height(0)
+ , m_logicalHeight(0)
, m_paintingResource(0)
, m_paintingResourceMode(ApplyToDefaultMode)
{
diff --git a/WebCore/rendering/SVGInlineTextBox.h b/WebCore/rendering/SVGInlineTextBox.h
index 7711db4..24957cf 100644
--- a/WebCore/rendering/SVGInlineTextBox.h
+++ b/WebCore/rendering/SVGInlineTextBox.h
@@ -42,11 +42,11 @@ public:
virtual bool isSVGInlineTextBox() const { return true; }
- virtual int virtualHeight() const { return m_height; }
- void setHeight(int height) { m_height = height; }
+ virtual int virtualLogicalHeight() const { return m_logicalHeight; }
+ void setLogicalHeight(int height) { m_logicalHeight = height; }
virtual int selectionTop() { return m_y; }
- virtual int selectionHeight() { return m_height; }
+ virtual int selectionHeight() { return m_logicalHeight; }
virtual int offsetForPosition(int x, bool includePartialGlyphs = true) const;
virtual int positionForOffset(int offset) const;
@@ -91,7 +91,7 @@ private:
FloatRect selectionRectForTextChunkPart(const SVGTextChunkPart&, int partStartPos, int partEndPos, RenderStyle*);
private:
- int m_height;
+ int m_logicalHeight;
AffineTransform m_chunkTransformation;
Vector<SVGTextChunkPart> m_svgTextChunkParts;
mutable SVGTextChunkPart m_currentChunkPart;
diff --git a/WebCore/rendering/SVGRenderTreeAsText.cpp b/WebCore/rendering/SVGRenderTreeAsText.cpp
index 20d7220..4e26f52 100644
--- a/WebCore/rendering/SVGRenderTreeAsText.cpp
+++ b/WebCore/rendering/SVGRenderTreeAsText.cpp
@@ -124,24 +124,6 @@ static void writeIfNotDefault(TextStream& ts, const char* name, ValueType value,
writeNameValuePair(ts, name, value);
}
-TextStream& operator<<(TextStream& ts, const IntPoint& p)
-{
- return ts << "(" << p.x() << "," << p.y() << ")";
-}
-
-TextStream& operator<<(TextStream& ts, const IntRect& r)
-{
- return ts << "at (" << r.x() << "," << r.y() << ") size " << r.width() << "x" << r.height();
-}
-
-static bool hasFractions(double val)
-{
- double epsilon = 0.0001;
- int ival = static_cast<int>(val);
- double dval = static_cast<double>(ival);
- return fabs(val - dval) > epsilon;
-}
-
TextStream& operator<<(TextStream& ts, const FloatRect &r)
{
ts << "at (";
@@ -167,36 +149,6 @@ TextStream& operator<<(TextStream& ts, const FloatRect &r)
return ts;
}
-TextStream& operator<<(TextStream& ts, const FloatPoint& p)
-{
- ts << "(";
- if (hasFractions(p.x()))
- ts << p.x();
- else
- ts << int(p.x());
- ts << ",";
- if (hasFractions(p.y()))
- ts << p.y();
- else
- ts << int(p.y());
- return ts << ")";
-}
-
-TextStream& operator<<(TextStream& ts, const FloatSize& s)
-{
- ts << "width=";
- if (hasFractions(s.width()))
- ts << s.width();
- else
- ts << int(s.width());
- ts << " height=";
- if (hasFractions(s.height()))
- ts << s.height();
- else
- ts << int(s.height());
- return ts;
-}
-
TextStream& operator<<(TextStream& ts, const AffineTransform& transform)
{
if (transform.isIdentity())
@@ -440,7 +392,7 @@ static void writeRenderSVGTextBox(TextStream& ts, const RenderBlock& text)
return;
Vector<SVGTextChunk>& chunks = const_cast<Vector<SVGTextChunk>& >(box->svgTextChunks());
- ts << " at (" << text.x() << "," << text.y() << ") size " << box->width() << "x" << box->height() << " contains " << chunks.size() << " chunk(s)";
+ ts << " at (" << text.x() << "," << text.y() << ") size " << box->logicalWidth() << "x" << box->logicalHeight() << " contains " << chunks.size() << " chunk(s)";
if (text.parent() && (text.parent()->style()->visitedDependentColor(CSSPropertyColor) != text.style()->visitedDependentColor(CSSPropertyColor)))
writeNameValuePair(ts, "color", text.style()->visitedDependentColor(CSSPropertyColor).name());
diff --git a/WebCore/rendering/SVGRenderTreeAsText.h b/WebCore/rendering/SVGRenderTreeAsText.h
index d4aeaac..e279cfe 100644
--- a/WebCore/rendering/SVGRenderTreeAsText.h
+++ b/WebCore/rendering/SVGRenderTreeAsText.h
@@ -33,11 +33,8 @@
namespace WebCore {
class Color;
- class FloatPoint;
class FloatRect;
class FloatSize;
- class IntPoint;
- class IntRect;
class Node;
class RenderBlock;
class RenderImage;
@@ -63,12 +60,8 @@ void writeResources(TextStream&, const RenderObject&, int indent);
// helper operators defined used in various classes to dump the render tree.
TextStream& operator<<(TextStream&, const AffineTransform&);
-TextStream& operator<<(TextStream&, const IntRect&);
TextStream& operator<<(TextStream&, const Color&);
-TextStream& operator<<(TextStream&, const IntPoint&);
-TextStream& operator<<(TextStream&, const FloatSize&);
TextStream& operator<<(TextStream&, const FloatRect&);
-TextStream& operator<<(TextStream&, const FloatPoint&);
// helper operators specific to dumping the render tree. these are used in various classes to dump the render tree
// these could be defined in separate namespace to avoid matching these generic signatures unintentionally.
@@ -88,21 +81,6 @@ TextStream& operator<<(TextStream& ts, const Vector<Item*>& v)
return ts;
}
-template<typename Item>
-TextStream& operator<<(TextStream& ts, const Vector<Item>& v)
-{
- ts << "[";
-
- for (unsigned i = 0; i < v.size(); i++) {
- ts << v[i];
- if (i < v.size() - 1)
- ts << ", ";
- }
-
- ts << "]";
- return ts;
-}
-
template<typename Pointer>
TextStream& operator<<(TextStream& ts, Pointer* t)
{
diff --git a/WebCore/rendering/SVGRootInlineBox.cpp b/WebCore/rendering/SVGRootInlineBox.cpp
index 6afdd99..715003f 100644
--- a/WebCore/rendering/SVGRootInlineBox.cpp
+++ b/WebCore/rendering/SVGRootInlineBox.cpp
@@ -196,8 +196,8 @@ void SVGRootInlineBox::layoutChildBoxes(InlineFlowBox* start)
IntRect boxRect = textBox->calculateBoundaries();
textBox->setX(boxRect.x());
textBox->setY(boxRect.y());
- textBox->setWidth(boxRect.width());
- textBox->setHeight(boxRect.height());
+ textBox->setLogicalWidth(boxRect.width());
+ textBox->setLogicalHeight(boxRect.height());
} else {
ASSERT(child->isInlineFlowBox());
@@ -211,8 +211,8 @@ void SVGRootInlineBox::layoutChildBoxes(InlineFlowBox* start)
IntRect boxRect = flowBox->calculateBoundaries();
flowBox->setX(boxRect.x());
flowBox->setY(boxRect.y());
- flowBox->setWidth(boxRect.width());
- flowBox->setHeight(boxRect.height());
+ flowBox->setLogicalWidth(boxRect.width());
+ flowBox->setLogicalHeight(boxRect.height());
}
}
}
@@ -251,8 +251,8 @@ void SVGRootInlineBox::layoutRootBox()
// Position ourselves.
setX(0);
setY(0);
- setWidth(widthBlock);
- setHeight(heightBlock);
+ setLogicalWidth(widthBlock);
+ setLogicalHeight(heightBlock);
setBlockHeight(heightBlock);
setLineTopBottomPositions(0, heightBlock);
}
diff --git a/WebCore/rendering/SVGRootInlineBox.h b/WebCore/rendering/SVGRootInlineBox.h
index 4e61190..77e7fcb 100644
--- a/WebCore/rendering/SVGRootInlineBox.h
+++ b/WebCore/rendering/SVGRootInlineBox.h
@@ -37,16 +37,16 @@ class SVGInlineTextBox;
class SVGRootInlineBox : public RootInlineBox {
public:
- SVGRootInlineBox(RenderObject* obj)
- : RootInlineBox(obj)
- , m_height(0)
+ SVGRootInlineBox(RenderBlock* block)
+ : RootInlineBox(block)
+ , m_logicalHeight(0)
{
}
virtual bool isSVGRootInlineBox() const { return true; }
- virtual int virtualHeight() const { return m_height; }
- void setHeight(int height) { m_height = height; }
+ virtual int virtualLogicalHeight() const { return m_logicalHeight; }
+ void setLogicalHeight(int height) { m_logicalHeight = height; }
virtual void paint(PaintInfo&, int tx, int ty);
@@ -66,7 +66,7 @@ private:
void layoutChildBoxes(InlineFlowBox* start);
private:
- int m_height;
+ int m_logicalHeight;
Vector<SVGChar> m_svgChars;
Vector<SVGTextChunk> m_svgTextChunks;
};
diff --git a/WebCore/rendering/TableLayout.h b/WebCore/rendering/TableLayout.h
index 10d6e26..e0fa8ee 100644
--- a/WebCore/rendering/TableLayout.h
+++ b/WebCore/rendering/TableLayout.h
@@ -36,7 +36,7 @@ public:
virtual ~TableLayout() { }
- virtual void calcPrefWidths(int& minWidth, int& maxWidth) = 0;
+ virtual void computePreferredLogicalWidths(int& minWidth, int& maxWidth) = 0;
virtual void layout() = 0;
protected:
diff --git a/WebCore/rendering/TrailingFloatsRootInlineBox.h b/WebCore/rendering/TrailingFloatsRootInlineBox.h
index 68bf637..6629857 100644
--- a/WebCore/rendering/TrailingFloatsRootInlineBox.h
+++ b/WebCore/rendering/TrailingFloatsRootInlineBox.h
@@ -32,15 +32,14 @@ namespace WebCore {
class TrailingFloatsRootInlineBox : public RootInlineBox {
public:
- TrailingFloatsRootInlineBox(RenderObject* object) : RootInlineBox(object)
+ TrailingFloatsRootInlineBox(RenderBlock* block)
+ : RootInlineBox(block)
{
-#if ENABLE(SVG)
- setHasVirtualHeight();
-#endif
+ setHasVirtualLogicalHeight();
}
private:
- virtual int virtualHeight() const { return 0; }
+ virtual int virtualLogicalHeight() const { return 0; }
};
} // namespace WebCore
diff --git a/WebCore/rendering/style/RenderStyle.cpp b/WebCore/rendering/style/RenderStyle.cpp
index 4b77d6b..623a298 100644
--- a/WebCore/rendering/style/RenderStyle.cpp
+++ b/WebCore/rendering/style/RenderStyle.cpp
@@ -323,8 +323,8 @@ StyleDifference RenderStyle::diff(const RenderStyle* other, unsigned& changedCon
if (rareNonInheritedData.get() != other->rareNonInheritedData.get()) {
if (rareNonInheritedData->m_appearance != other->rareNonInheritedData->m_appearance ||
- rareNonInheritedData->marginTopCollapse != other->rareNonInheritedData->marginTopCollapse ||
- rareNonInheritedData->marginBottomCollapse != other->rareNonInheritedData->marginBottomCollapse ||
+ rareNonInheritedData->marginBeforeCollapse != other->rareNonInheritedData->marginBeforeCollapse ||
+ rareNonInheritedData->marginAfterCollapse != other->rareNonInheritedData->marginAfterCollapse ||
rareNonInheritedData->lineClamp != other->rareNonInheritedData->lineClamp ||
rareNonInheritedData->textOverflow != other->rareNonInheritedData->textOverflow)
return StyleDifferenceLayout;
@@ -789,7 +789,7 @@ CounterDirectiveMap& RenderStyle::accessCounterDirectives()
const AtomicString& RenderStyle::hyphenString() const
{
- ASSERT(hyphens() == HyphensAuto);
+ ASSERT(hyphens() != HyphensNone);
const AtomicString& hyphenationString = rareInheritedData.get()->hyphenationString;
if (!hyphenationString.isNull())
@@ -1184,6 +1184,38 @@ Length RenderStyle::marginAfter() const
return marginBottom();
}
+Length RenderStyle::marginBeforeUsing(const RenderStyle* otherStyle) const
+{
+ switch (otherStyle->blockFlow()) {
+ case TopToBottomBlockFlow:
+ return marginTop();
+ case BottomToTopBlockFlow:
+ return marginBottom();
+ case LeftToRightBlockFlow:
+ return marginLeft();
+ case RightToLeftBlockFlow:
+ return marginRight();
+ }
+ ASSERT_NOT_REACHED();
+ return marginTop();
+}
+
+Length RenderStyle::marginAfterUsing(const RenderStyle* otherStyle) const
+{
+ switch (otherStyle->blockFlow()) {
+ case TopToBottomBlockFlow:
+ return marginBottom();
+ case BottomToTopBlockFlow:
+ return marginTop();
+ case LeftToRightBlockFlow:
+ return marginRight();
+ case RightToLeftBlockFlow:
+ return marginLeft();
+ }
+ ASSERT_NOT_REACHED();
+ return marginBottom();
+}
+
Length RenderStyle::marginStart() const
{
if (isVerticalBlockFlow())
@@ -1198,6 +1230,20 @@ Length RenderStyle::marginEnd() const
return direction() == LTR ? marginBottom() : marginTop();
}
+Length RenderStyle::marginStartUsing(const RenderStyle* otherStyle) const
+{
+ if (otherStyle->isVerticalBlockFlow())
+ return otherStyle->direction() == LTR ? marginLeft() : marginRight();
+ return otherStyle->direction() == LTR ? marginTop() : marginBottom();
+}
+
+Length RenderStyle::marginEndUsing(const RenderStyle* otherStyle) const
+{
+ if (otherStyle->isVerticalBlockFlow())
+ return otherStyle->direction() == LTR ? marginRight() : marginLeft();
+ return otherStyle->direction() == LTR ? marginBottom() : marginTop();
+}
+
Length RenderStyle::paddingBefore() const
{
switch (blockFlow()) {
diff --git a/WebCore/rendering/style/RenderStyle.h b/WebCore/rendering/style/RenderStyle.h
index e6e6318..6ecbd56 100644
--- a/WebCore/rendering/style/RenderStyle.h
+++ b/WebCore/rendering/style/RenderStyle.h
@@ -598,6 +598,10 @@ public:
Length marginAfter() const;
Length marginStart() const;
Length marginEnd() const;
+ Length marginStartUsing(const RenderStyle* otherStyle) const;
+ Length marginEndUsing(const RenderStyle* otherStyle) const;
+ Length marginBeforeUsing(const RenderStyle* otherStyle) const;
+ Length marginAfterUsing(const RenderStyle* otherStyle) const;
LengthBox paddingBox() const { return surround->padding; }
Length paddingTop() const { return surround->padding.top(); }
@@ -661,8 +665,8 @@ public:
EUserDrag userDrag() const { return static_cast<EUserDrag>(rareNonInheritedData->userDrag); }
EUserSelect userSelect() const { return static_cast<EUserSelect>(rareInheritedData->userSelect); }
bool textOverflow() const { return rareNonInheritedData->textOverflow; }
- EMarginCollapse marginTopCollapse() const { return static_cast<EMarginCollapse>(rareNonInheritedData->marginTopCollapse); }
- EMarginCollapse marginBottomCollapse() const { return static_cast<EMarginCollapse>(rareNonInheritedData->marginBottomCollapse); }
+ EMarginCollapse marginBeforeCollapse() const { return static_cast<EMarginCollapse>(rareNonInheritedData->marginBeforeCollapse); }
+ EMarginCollapse marginAfterCollapse() const { return static_cast<EMarginCollapse>(rareNonInheritedData->marginAfterCollapse); }
EWordBreak wordBreak() const { return static_cast<EWordBreak>(rareInheritedData->wordBreak); }
EWordWrap wordWrap() const { return static_cast<EWordWrap>(rareInheritedData->wordWrap); }
ENBSPMode nbspMode() const { return static_cast<ENBSPMode>(rareInheritedData->nbspMode); }
@@ -1018,8 +1022,8 @@ public:
void setUserDrag(EUserDrag d) { SET_VAR(rareNonInheritedData, userDrag, d); }
void setUserSelect(EUserSelect s) { SET_VAR(rareInheritedData, userSelect, s); }
void setTextOverflow(bool b) { SET_VAR(rareNonInheritedData, textOverflow, b); }
- void setMarginTopCollapse(EMarginCollapse c) { SET_VAR(rareNonInheritedData, marginTopCollapse, c); }
- void setMarginBottomCollapse(EMarginCollapse c) { SET_VAR(rareNonInheritedData, marginBottomCollapse, c); }
+ void setMarginBeforeCollapse(EMarginCollapse c) { SET_VAR(rareNonInheritedData, marginBeforeCollapse, c); }
+ void setMarginAfterCollapse(EMarginCollapse c) { SET_VAR(rareNonInheritedData, marginAfterCollapse, c); }
void setWordBreak(EWordBreak b) { SET_VAR(rareInheritedData, wordBreak, b); }
void setWordWrap(EWordWrap b) { SET_VAR(rareInheritedData, wordWrap, b); }
void setNBSPMode(ENBSPMode b) { SET_VAR(rareInheritedData, nbspMode, b); }
@@ -1250,8 +1254,8 @@ public:
static EUserDrag initialUserDrag() { return DRAG_AUTO; }
static EUserSelect initialUserSelect() { return SELECT_TEXT; }
static bool initialTextOverflow() { return false; }
- static EMarginCollapse initialMarginTopCollapse() { return MCOLLAPSE; }
- static EMarginCollapse initialMarginBottomCollapse() { return MCOLLAPSE; }
+ static EMarginCollapse initialMarginBeforeCollapse() { return MCOLLAPSE; }
+ static EMarginCollapse initialMarginAfterCollapse() { return MCOLLAPSE; }
static EWordBreak initialWordBreak() { return NormalWordBreak; }
static EWordWrap initialWordWrap() { return NormalWordWrap; }
static ENBSPMode initialNBSPMode() { return NBNORMAL; }
diff --git a/WebCore/rendering/style/StyleRareNonInheritedData.cpp b/WebCore/rendering/style/StyleRareNonInheritedData.cpp
index e293984..e0f7f7a 100644
--- a/WebCore/rendering/style/StyleRareNonInheritedData.cpp
+++ b/WebCore/rendering/style/StyleRareNonInheritedData.cpp
@@ -37,8 +37,8 @@ StyleRareNonInheritedData::StyleRareNonInheritedData()
, m_counterDirectives(0)
, userDrag(RenderStyle::initialUserDrag())
, textOverflow(RenderStyle::initialTextOverflow())
- , marginTopCollapse(MCOLLAPSE)
- , marginBottomCollapse(MCOLLAPSE)
+ , marginBeforeCollapse(MCOLLAPSE)
+ , marginAfterCollapse(MCOLLAPSE)
, matchNearestMailBlockquoteColor(RenderStyle::initialMatchNearestMailBlockquoteColor())
, m_appearance(RenderStyle::initialAppearance())
, m_borderFit(RenderStyle::initialBorderFit())
@@ -73,8 +73,8 @@ StyleRareNonInheritedData::StyleRareNonInheritedData(const StyleRareNonInherited
, m_counterDirectives(0)
, userDrag(o.userDrag)
, textOverflow(o.textOverflow)
- , marginTopCollapse(o.marginTopCollapse)
- , marginBottomCollapse(o.marginBottomCollapse)
+ , marginBeforeCollapse(o.marginBeforeCollapse)
+ , marginAfterCollapse(o.marginAfterCollapse)
, matchNearestMailBlockquoteColor(o.matchNearestMailBlockquoteColor)
, m_appearance(o.m_appearance)
, m_borderFit(o.m_borderFit)
@@ -118,8 +118,8 @@ bool StyleRareNonInheritedData::operator==(const StyleRareNonInheritedData& o) c
&& m_counterDirectives == o.m_counterDirectives
&& userDrag == o.userDrag
&& textOverflow == o.textOverflow
- && marginTopCollapse == o.marginTopCollapse
- && marginBottomCollapse == o.marginBottomCollapse
+ && marginBeforeCollapse == o.marginBeforeCollapse
+ && marginAfterCollapse == o.marginAfterCollapse
&& matchNearestMailBlockquoteColor == o.matchNearestMailBlockquoteColor
&& m_appearance == o.m_appearance
&& m_borderFit == o.m_borderFit
diff --git a/WebCore/rendering/style/StyleRareNonInheritedData.h b/WebCore/rendering/style/StyleRareNonInheritedData.h
index 6003ea4..3f693f9 100644
--- a/WebCore/rendering/style/StyleRareNonInheritedData.h
+++ b/WebCore/rendering/style/StyleRareNonInheritedData.h
@@ -98,8 +98,8 @@ public:
unsigned userDrag : 2; // EUserDrag
bool textOverflow : 1; // Whether or not lines that spill out should be truncated with "..."
- unsigned marginTopCollapse : 2; // EMarginCollapse
- unsigned marginBottomCollapse : 2; // EMarginCollapse
+ unsigned marginBeforeCollapse : 2; // EMarginCollapse
+ unsigned marginAfterCollapse : 2; // EMarginCollapse
unsigned matchNearestMailBlockquoteColor : 1; // EMatchNearestMailBlockquoteColor, FIXME: This property needs to be eliminated. It should never have been added.
unsigned m_appearance : 6; // EAppearance
unsigned m_borderFit : 1; // EBorderFit
diff --git a/WebCore/storage/IDBCursorBackendImpl.cpp b/WebCore/storage/IDBCursorBackendImpl.cpp
index 3a4dd67..13df5f0 100644
--- a/WebCore/storage/IDBCursorBackendImpl.cpp
+++ b/WebCore/storage/IDBCursorBackendImpl.cpp
@@ -36,6 +36,7 @@
#include "IDBKeyRange.h"
#include "IDBObjectStoreBackendImpl.h"
#include "IDBRequest.h"
+#include "IDBTransactionBackendInterface.h"
#include "SQLiteDatabase.h"
#include "SQLiteStatement.h"
#include "SerializedScriptValue.h"
diff --git a/WebCore/storage/IDBDatabase.cpp b/WebCore/storage/IDBDatabase.cpp
index 81950d6..0ea7ac2 100644
--- a/WebCore/storage/IDBDatabase.cpp
+++ b/WebCore/storage/IDBDatabase.cpp
@@ -55,11 +55,12 @@ PassRefPtr<IDBRequest> IDBDatabase::createObjectStore(ScriptExecutionContext* co
return request;
}
+// FIXME: remove this method.
PassRefPtr<IDBObjectStore> IDBDatabase::objectStore(const String& name, unsigned short mode)
{
RefPtr<IDBObjectStoreBackendInterface> objectStore = m_backend->objectStore(name, mode);
ASSERT(objectStore); // FIXME: If this is null, we should raise a NOT_FOUND_ERR.
- return IDBObjectStore::create(objectStore.release());
+ return IDBObjectStore::create(objectStore.release(), 0);
}
PassRefPtr<IDBRequest> IDBDatabase::removeObjectStore(ScriptExecutionContext* context, const String& name)
diff --git a/WebCore/storage/IDBDatabaseBackendImpl.cpp b/WebCore/storage/IDBDatabaseBackendImpl.cpp
index 021f70a..b8fe9b5 100644
--- a/WebCore/storage/IDBDatabaseBackendImpl.cpp
+++ b/WebCore/storage/IDBDatabaseBackendImpl.cpp
@@ -148,11 +148,12 @@ void IDBDatabaseBackendImpl::createObjectStore(const String& name, const String&
callbacks->onSuccess(objectStore.get());
}
+// FIXME: Do not expose this method via IDL.
PassRefPtr<IDBObjectStoreBackendInterface> IDBDatabaseBackendImpl::objectStore(const String& name, unsigned short mode)
{
- // FIXME: If no transaction is running, this should implicitly start one.
- ASSERT_UNUSED(mode, !mode); // FIXME: Handle non-standard modes.
- return m_objectStores.get(name);
+ ASSERT_UNUSED(mode, !mode); // FIXME: Remove the mode parameter. Transactions have modes, not object stores.
+ RefPtr<IDBObjectStoreBackendInterface> objectStore = m_objectStores.get(name);
+ return objectStore.release();
}
static void doDelete(SQLiteDatabase& db, const char* sql, int64_t id)
diff --git a/WebCore/storage/IDBDatabaseBackendImpl.h b/WebCore/storage/IDBDatabaseBackendImpl.h
index ab055f8..7e08ad6 100644
--- a/WebCore/storage/IDBDatabaseBackendImpl.h
+++ b/WebCore/storage/IDBDatabaseBackendImpl.h
@@ -62,6 +62,8 @@ public:
virtual void setVersion(const String& version, PassRefPtr<IDBCallbacks>);
virtual PassRefPtr<IDBTransactionBackendInterface> transaction(DOMStringList* storeNames, unsigned short mode, unsigned long timeout);
+ IDBTransactionCoordinator* transactionCoordinator() const { return m_transactionCoordinator.get(); }
+
private:
IDBDatabaseBackendImpl(const String& name, const String& description, PassOwnPtr<SQLiteDatabase> database, IDBTransactionCoordinator*);
diff --git a/WebCore/storage/IDBFactoryBackendImpl.cpp b/WebCore/storage/IDBFactoryBackendImpl.cpp
index d819c92..6219c2d 100644
--- a/WebCore/storage/IDBFactoryBackendImpl.cpp
+++ b/WebCore/storage/IDBFactoryBackendImpl.cpp
@@ -62,9 +62,7 @@ static PassOwnPtr<SQLiteDatabase> openSQLiteDatabase(SecurityOrigin* securityOri
return 0;
}
- String databaseIdentifier = securityOrigin->databaseIdentifier();
- String santizedName = encodeForFileName(name);
- path = pathByAppendingComponent(pathBase, databaseIdentifier + "_" + santizedName + ".indexeddb");
+ path = pathByAppendingComponent(pathBase, IDBFactoryBackendImpl::databaseFileName(name, securityOrigin));
}
OwnPtr<SQLiteDatabase> sqliteDatabase = adoptPtr(new SQLiteDatabase());
@@ -142,10 +140,11 @@ void IDBFactoryBackendImpl::open(const String& name, const String& description,
m_databaseBackendMap.set(name, databaseBackend.release());
}
-void IDBFactoryBackendImpl::abortPendingTransactions(const Vector<int>& pendingIDs)
+String IDBFactoryBackendImpl::databaseFileName(const String& name, SecurityOrigin* securityOrigin)
{
- for (size_t i = 0; i < pendingIDs.size(); ++i)
- m_transactionCoordinator->abort(pendingIDs.at(i));
+ String databaseIdentifier = securityOrigin->databaseIdentifier();
+ String santizedName = encodeForFileName(name);
+ return databaseIdentifier + "@" + santizedName + ".indexeddb";
}
} // namespace WebCore
diff --git a/WebCore/storage/IDBFactoryBackendImpl.h b/WebCore/storage/IDBFactoryBackendImpl.h
index f2e1af8..76e545e 100644
--- a/WebCore/storage/IDBFactoryBackendImpl.h
+++ b/WebCore/storage/IDBFactoryBackendImpl.h
@@ -50,7 +50,8 @@ public:
virtual ~IDBFactoryBackendImpl();
virtual void open(const String& name, const String& description, PassRefPtr<IDBCallbacks>, PassRefPtr<SecurityOrigin>, Frame*, const String& dataDir);
- virtual void abortPendingTransactions(const Vector<int>& pendingIDs);
+
+ static String databaseFileName(const String& name, SecurityOrigin*);
private:
IDBFactoryBackendImpl();
diff --git a/WebCore/storage/IDBFactoryBackendInterface.h b/WebCore/storage/IDBFactoryBackendInterface.h
index e591271..4914024 100644
--- a/WebCore/storage/IDBFactoryBackendInterface.h
+++ b/WebCore/storage/IDBFactoryBackendInterface.h
@@ -52,7 +52,6 @@ public:
virtual ~IDBFactoryBackendInterface() { }
virtual void open(const String& name, const String& description, PassRefPtr<IDBCallbacks>, PassRefPtr<SecurityOrigin>, Frame*, const String& dataDir) = 0;
- virtual void abortPendingTransactions(const Vector<int>& ids) = 0;
};
} // namespace WebCore
diff --git a/WebCore/storage/IDBObjectStore.cpp b/WebCore/storage/IDBObjectStore.cpp
index b457cd1..4c5cf34 100644
--- a/WebCore/storage/IDBObjectStore.cpp
+++ b/WebCore/storage/IDBObjectStore.cpp
@@ -31,6 +31,7 @@
#include "IDBIndex.h"
#include "IDBKey.h"
#include "IDBKeyRange.h"
+#include "IDBTransactionBackendInterface.h"
#include "SerializedScriptValue.h"
#include <wtf/UnusedParam.h>
@@ -38,8 +39,9 @@
namespace WebCore {
-IDBObjectStore::IDBObjectStore(PassRefPtr<IDBObjectStoreBackendInterface> idbObjectStore)
+IDBObjectStore::IDBObjectStore(PassRefPtr<IDBObjectStoreBackendInterface> idbObjectStore, IDBTransactionBackendInterface* transaction)
: m_objectStore(idbObjectStore)
+ , m_transaction(transaction)
{
// We pass a reference to this object before it can be adopted.
relaxAdoptionRequirement();
@@ -62,9 +64,9 @@ PassRefPtr<DOMStringList> IDBObjectStore::indexNames() const
PassRefPtr<IDBRequest> IDBObjectStore::get(ScriptExecutionContext* context, PassRefPtr<IDBKey> key)
{
- RefPtr<IDBRequest> request = IDBRequest::create(context, IDBAny::create(this));
- m_objectStore->get(key, request);
- return request;
+ RefPtr<IDBRequest> request = IDBRequest::create(context, IDBAny::create(this), m_transaction.get());
+ m_objectStore->get(key, request, m_transaction.get());
+ return request.release();
}
PassRefPtr<IDBRequest> IDBObjectStore::add(ScriptExecutionContext* context, PassRefPtr<SerializedScriptValue> value, PassRefPtr<IDBKey> key)
@@ -97,8 +99,10 @@ PassRefPtr<IDBRequest> IDBObjectStore::createIndex(ScriptExecutionContext* conte
PassRefPtr<IDBIndex> IDBObjectStore::index(const String& name)
{
+ // FIXME: If this is null, we should raise a NOT_FOUND_ERR.
RefPtr<IDBIndexBackendInterface> index = m_objectStore->index(name);
- ASSERT(index); // FIXME: If this is null, we should raise a NOT_FOUND_ERR.
+ if (!index)
+ return 0;
return IDBIndex::create(index.release());
}
diff --git a/WebCore/storage/IDBObjectStore.h b/WebCore/storage/IDBObjectStore.h
index 035f5d8..df5b3f7 100644
--- a/WebCore/storage/IDBObjectStore.h
+++ b/WebCore/storage/IDBObjectStore.h
@@ -43,13 +43,14 @@ class DOMStringList;
class IDBAny;
class IDBIndexRequest;
class IDBKey;
+class IDBTransactionBackendInterface;
class SerializedScriptValue;
class IDBObjectStore : public RefCounted<IDBObjectStore> {
public:
- static PassRefPtr<IDBObjectStore> create(PassRefPtr<IDBObjectStoreBackendInterface> idbObjectStore)
+ static PassRefPtr<IDBObjectStore> create(PassRefPtr<IDBObjectStoreBackendInterface> idbObjectStore, IDBTransactionBackendInterface* transaction)
{
- return adoptRef(new IDBObjectStore(idbObjectStore));
+ return adoptRef(new IDBObjectStore(idbObjectStore, transaction));
}
~IDBObjectStore() { }
@@ -69,9 +70,11 @@ public:
PassRefPtr<IDBRequest> openCursor(ScriptExecutionContext*, PassRefPtr<IDBKeyRange> = 0, unsigned short direction = IDBCursor::NEXT);
private:
- IDBObjectStore(PassRefPtr<IDBObjectStoreBackendInterface>);
+ IDBObjectStore(PassRefPtr<IDBObjectStoreBackendInterface>, IDBTransactionBackendInterface* transaction);
+ void removeTransactionFromPendingList();
RefPtr<IDBObjectStoreBackendInterface> m_objectStore;
+ RefPtr<IDBTransactionBackendInterface> m_transaction;
};
} // namespace WebCore
diff --git a/WebCore/storage/IDBObjectStoreBackendImpl.cpp b/WebCore/storage/IDBObjectStoreBackendImpl.cpp
index e5f81ab..18d6b0c 100644
--- a/WebCore/storage/IDBObjectStoreBackendImpl.cpp
+++ b/WebCore/storage/IDBObjectStoreBackendImpl.cpp
@@ -36,6 +36,8 @@
#include "IDBKeyPath.h"
#include "IDBKeyPathBackendImpl.h"
#include "IDBKeyRange.h"
+#include "IDBTransactionBackendInterface.h"
+#include "ScriptExecutionContext.h"
#include "SQLiteDatabase.h"
#include "SQLiteStatement.h"
#include "SQLiteTransaction.h"
@@ -44,6 +46,33 @@
namespace WebCore {
+template <class T, class Method, class Param1, class Param2>
+class IDBTask : public ScriptExecutionContext::Task {
+public:
+ IDBTask(T* obj, Method method, const Param1& param1, const Param2& param2)
+ : m_obj(obj), m_method(method), m_param1(param1), m_param2(param2)
+ {
+ }
+
+ virtual void performTask(ScriptExecutionContext*)
+ {
+ if (m_obj)
+ (m_obj->*m_method)(m_param1, m_param2);
+ }
+
+private:
+ T* m_obj;
+ Method m_method;
+ Param1 m_param1;
+ Param2 m_param2;
+};
+
+template <class T, class Method, class Param1, class Param2>
+PassOwnPtr<ScriptExecutionContext::Task> createTask(T* object, Method method, const Param1& param1, const Param2& param2)
+{
+ return adoptPtr(new IDBTask<T, Method, Param1, Param2>(object, method, param1, param2));
+}
+
IDBObjectStoreBackendImpl::~IDBObjectStoreBackendImpl()
{
}
@@ -77,7 +106,13 @@ static void bindWhereClause(SQLiteStatement& query, int64_t id, IDBKey* key)
key->bind(query, 2);
}
-void IDBObjectStoreBackendImpl::get(PassRefPtr<IDBKey> key, PassRefPtr<IDBCallbacks> callbacks)
+void IDBObjectStoreBackendImpl::get(PassRefPtr<IDBKey> key, PassRefPtr<IDBCallbacks> callbacks, IDBTransactionBackendInterface* transaction)
+{
+ if (!transaction->scheduleTask(createTask(this, &IDBObjectStoreBackendImpl::getInternal, key, callbacks)))
+ callbacks->onError(IDBDatabaseError::create(IDBDatabaseException::NOT_ALLOWED_ERR, "Get must be called in the context of a transaction."));
+}
+
+void IDBObjectStoreBackendImpl::getInternal(PassRefPtr<IDBKey> key, PassRefPtr<IDBCallbacks> callbacks)
{
SQLiteStatement query(sqliteDatabase(), "SELECT keyString, keyDate, keyNumber, value FROM ObjectStoreData " + whereClause(key.get()));
bool ok = query.prepare() == SQLResultOk;
diff --git a/WebCore/storage/IDBObjectStoreBackendImpl.h b/WebCore/storage/IDBObjectStoreBackendImpl.h
index 32ef920..36c0014 100644
--- a/WebCore/storage/IDBObjectStoreBackendImpl.h
+++ b/WebCore/storage/IDBObjectStoreBackendImpl.h
@@ -36,6 +36,7 @@ namespace WebCore {
class IDBDatabaseBackendImpl;
class IDBIndexBackendImpl;
+class IDBTransactionBackendInterface;
class SQLiteDatabase;
class IDBObjectStoreBackendImpl : public IDBObjectStoreBackendInterface {
@@ -51,7 +52,7 @@ public:
String keyPath() const { return m_keyPath; }
PassRefPtr<DOMStringList> indexNames() const;
- void get(PassRefPtr<IDBKey> key, PassRefPtr<IDBCallbacks>);
+ void get(PassRefPtr<IDBKey> key, PassRefPtr<IDBCallbacks>, IDBTransactionBackendInterface* transaction);
void put(PassRefPtr<SerializedScriptValue> value, PassRefPtr<IDBKey> key, bool addOnly, PassRefPtr<IDBCallbacks>);
void remove(PassRefPtr<IDBKey> key, PassRefPtr<IDBCallbacks>);
@@ -69,6 +70,8 @@ private:
void loadIndexes();
SQLiteDatabase& sqliteDatabase() const;
+ void getInternal(PassRefPtr<IDBKey> key, PassRefPtr<IDBCallbacks>);
+
RefPtr<IDBDatabaseBackendImpl> m_database;
int64_t m_id;
diff --git a/WebCore/storage/IDBObjectStoreBackendInterface.h b/WebCore/storage/IDBObjectStoreBackendInterface.h
index 200ac29..c19855c 100644
--- a/WebCore/storage/IDBObjectStoreBackendInterface.h
+++ b/WebCore/storage/IDBObjectStoreBackendInterface.h
@@ -38,6 +38,7 @@ class IDBCallbacks;
class IDBIndexBackendInterface;
class IDBKey;
class IDBKeyRange;
+class IDBTransactionBackendInterface;
class SerializedScriptValue;
class IDBObjectStoreBackendInterface : public ThreadSafeShared<IDBObjectStoreBackendInterface> {
@@ -48,7 +49,7 @@ public:
virtual String keyPath() const = 0;
virtual PassRefPtr<DOMStringList> indexNames() const = 0;
- virtual void get(PassRefPtr<IDBKey> key, PassRefPtr<IDBCallbacks>) = 0;
+ virtual void get(PassRefPtr<IDBKey> key, PassRefPtr<IDBCallbacks>, IDBTransactionBackendInterface* transaction) = 0;
virtual void put(PassRefPtr<SerializedScriptValue> value, PassRefPtr<IDBKey> key, bool addOnly, PassRefPtr<IDBCallbacks>) = 0;
virtual void remove(PassRefPtr<IDBKey> key, PassRefPtr<IDBCallbacks>) = 0;
diff --git a/WebCore/storage/IDBPendingTransactionMonitor.cpp b/WebCore/storage/IDBPendingTransactionMonitor.cpp
index d026099..799200d 100644
--- a/WebCore/storage/IDBPendingTransactionMonitor.cpp
+++ b/WebCore/storage/IDBPendingTransactionMonitor.cpp
@@ -25,47 +25,48 @@
#include "config.h"
#include "IDBPendingTransactionMonitor.h"
+#include "IDBTransactionBackendInterface.h"
#if ENABLE(INDEXED_DATABASE)
namespace WebCore {
-Vector<int>* IDBPendingTransactionMonitor::m_ids = 0;
+Vector<IDBTransactionBackendInterface*>* IDBPendingTransactionMonitor::m_transactions = 0;
-bool IDBPendingTransactionMonitor::hasPendingTransactions()
+void IDBPendingTransactionMonitor::addPendingTransaction(IDBTransactionBackendInterface* transaction)
{
- return m_ids && m_ids->size();
+ if (!m_transactions)
+ m_transactions = new Vector<IDBTransactionBackendInterface*>();
+ m_transactions->append(transaction);
}
-void IDBPendingTransactionMonitor::addPendingTransaction(int id)
+void IDBPendingTransactionMonitor::removePendingTransaction(IDBTransactionBackendInterface* transaction)
{
- if (!m_ids)
- m_ids = new Vector<int>();
- m_ids->append(id);
-}
+ if (!m_transactions)
+ return;
-void IDBPendingTransactionMonitor::removePendingTransaction(int id)
-{
- m_ids->remove(id);
- if (!m_ids->size()) {
- delete m_ids;
- m_ids = 0;
+ size_t pos = m_transactions->find(transaction);
+ if (pos == notFound)
+ return;
+
+ m_transactions->remove(pos);
+
+ if (!m_transactions->size()) {
+ delete m_transactions;
+ m_transactions = 0;
}
}
-void IDBPendingTransactionMonitor::clearPendingTransactions()
+void IDBPendingTransactionMonitor::abortPendingTransactions()
{
- if (!m_ids)
+ if (!m_transactions)
return;
- m_ids->clear();
- delete m_ids;
- m_ids = 0;
-}
+ for (size_t i = 0; i < m_transactions->size(); ++i)
+ m_transactions->at(i)->abort();
-const Vector<int>& IDBPendingTransactionMonitor::pendingTransactions()
-{
- return *m_ids;
+ delete m_transactions;
+ m_transactions = 0;
}
};
diff --git a/WebCore/storage/IDBPendingTransactionMonitor.h b/WebCore/storage/IDBPendingTransactionMonitor.h
index 00e833a..783a731 100644
--- a/WebCore/storage/IDBPendingTransactionMonitor.h
+++ b/WebCore/storage/IDBPendingTransactionMonitor.h
@@ -33,27 +33,27 @@
namespace WebCore {
+class IDBTransactionBackendInterface;
+
// This class keeps track of the transactions created during the current
// Javascript execution context. A transaction is 'pending' if no asynchronous
// operation is currently queued for it (e.g. an IDBObjectStore::put() or similar).
// All pending transactions are aborted as soon as execution returns from
// the script engine.
//
-// FIXME: move the vector of transaction IDs to TLS. Keeping it static
+// FIXME: move the vector of transactions to TLS. Keeping it static
// will not work once we add support for workers. Another possible
// solution is to keep the vector in the ScriptExecutionContext.
class IDBPendingTransactionMonitor : public Noncopyable {
public:
- static bool hasPendingTransactions();
- static void addPendingTransaction(int id);
- static void removePendingTransaction(int id);
- static void clearPendingTransactions();
- static const Vector<int>& pendingTransactions();
+ static void addPendingTransaction(IDBTransactionBackendInterface*);
+ static void removePendingTransaction(IDBTransactionBackendInterface*);
+ static void abortPendingTransactions();
private:
IDBPendingTransactionMonitor();
- static Vector<int>* m_ids;
+ static Vector<IDBTransactionBackendInterface*>* m_transactions;
};
} // namespace WebCore
diff --git a/WebCore/storage/IDBRequest.cpp b/WebCore/storage/IDBRequest.cpp
index 6fbda0e..c672642 100644
--- a/WebCore/storage/IDBRequest.cpp
+++ b/WebCore/storage/IDBRequest.cpp
@@ -40,29 +40,38 @@
#include "IDBIndex.h"
#include "IDBErrorEvent.h"
#include "IDBObjectStore.h"
+#include "IDBPendingTransactionMonitor.h"
#include "IDBSuccessEvent.h"
#include "ScriptExecutionContext.h"
namespace WebCore {
-IDBRequest::IDBRequest(ScriptExecutionContext* context, PassRefPtr<IDBAny> source)
+IDBRequest::IDBRequest(ScriptExecutionContext* context, PassRefPtr<IDBAny> source, IDBTransactionBackendInterface* transaction)
: ActiveDOMObject(context, this)
, m_source(source)
+ , m_transaction(transaction)
, m_timer(this, &IDBRequest::timerFired)
- , m_aborted(false)
, m_readyState(LOADING)
{
+ if (transaction)
+ IDBPendingTransactionMonitor::removePendingTransaction(transaction);
}
IDBRequest::~IDBRequest()
{
- abort();
+ // The transaction pointer is used to notify the transaction once the JS events were
+ // dispatched by this request object. If no new tasks were added by the event JS callbacks,
+ // the transaction can commit. Otherwise, it can continue executing the new tasks.
+ // It is important to guarantee that the transaction is notified after the events are
+ // dispatched, as the transaction cannot commit or execute new tasks in the absence
+ // of these notifications. We clear the transaction pointer once the events have dispatched,
+ // so having a non-zero pointer at IDBRequest destruction time shows that the events have not
+ // yet fired and there is a transaction waiting to be notified. This is an error.
+ ASSERT(!m_transaction);
}
bool IDBRequest::resetReadyState()
{
- if (m_aborted)
- return false;
ASSERT(m_readyState == DONE);
m_readyState = LOADING;
return true;
@@ -100,7 +109,9 @@ void IDBRequest::onSuccess(PassRefPtr<IDBKey> idbKey)
void IDBRequest::onSuccess(PassRefPtr<IDBObjectStoreBackendInterface> backend)
{
- scheduleEvent(IDBAny::create(IDBObjectStore::create(backend)), 0);
+ // FIXME: the transaction pointer should be the one of the setVersion transaction. This is because
+ // this callback is only executed for operations that neen to run in a setVersion transaction.
+ scheduleEvent(IDBAny::create(IDBObjectStore::create(backend, 0)), 0);
}
void IDBRequest::onSuccess(PassRefPtr<SerializedScriptValue> serializedScriptValue)
@@ -108,15 +119,6 @@ void IDBRequest::onSuccess(PassRefPtr<SerializedScriptValue> serializedScriptVal
scheduleEvent(IDBAny::create(serializedScriptValue), 0);
}
-void IDBRequest::abort()
-{
- m_timer.stop();
- m_aborted = true;
- m_pendingEvents.clear();
-
- // FIXME: This should cancel any pending work being done in the backend.
-}
-
ScriptExecutionContext* IDBRequest::scriptExecutionContext() const
{
return ActiveDOMObject::scriptExecutionContext();
@@ -142,7 +144,6 @@ EventTargetData* IDBRequest::ensureEventTargetData()
void IDBRequest::timerFired(Timer<IDBRequest>*)
{
ASSERT(m_selfRef);
- ASSERT(!m_aborted);
ASSERT(m_pendingEvents.size());
// We need to keep self-referencing ourself, otherwise it's possible we'll be deleted.
@@ -161,6 +162,13 @@ void IDBRequest::timerFired(Timer<IDBRequest>*)
dispatchEvent(IDBSuccessEvent::create(m_source, pendingEvents[i].m_result));
}
}
+ if (m_transaction) {
+ // Now that we processed all pending events, let the transaction monitor check if
+ // it can commit the current transaction or if there's anything new pending.
+ // FIXME: Handle the workers case.
+ m_transaction->didCompleteTaskEvents();
+ m_transaction.clear();
+ }
}
void IDBRequest::scheduleEvent(PassRefPtr<IDBAny> result, PassRefPtr<IDBDatabaseError> error)
@@ -168,9 +176,6 @@ void IDBRequest::scheduleEvent(PassRefPtr<IDBAny> result, PassRefPtr<IDBDatabase
ASSERT(m_readyState < DONE);
ASSERT(!!m_selfRef == m_timer.isActive());
- if (m_aborted)
- return;
-
PendingEvent pendingEvent;
pendingEvent.m_result = result;
pendingEvent.m_error = error;
diff --git a/WebCore/storage/IDBRequest.h b/WebCore/storage/IDBRequest.h
index 9b0ea7e..75cd9a8 100644
--- a/WebCore/storage/IDBRequest.h
+++ b/WebCore/storage/IDBRequest.h
@@ -42,13 +42,14 @@
namespace WebCore {
+class IDBTransactionBackendInterface;
+
class IDBRequest : public IDBCallbacks, public EventTarget, public ActiveDOMObject {
public:
- static PassRefPtr<IDBRequest> create(ScriptExecutionContext* context, PassRefPtr<IDBAny> source) { return adoptRef(new IDBRequest(context, source)); }
+ static PassRefPtr<IDBRequest> create(ScriptExecutionContext* context, PassRefPtr<IDBAny> source, IDBTransactionBackendInterface* transaction = 0) { return adoptRef(new IDBRequest(context, source, transaction)); }
virtual ~IDBRequest();
// Defined in the IDL
- void abort();
enum ReadyState {
LOADING = 1,
DONE = 2
@@ -80,7 +81,7 @@ public:
using RefCounted<IDBCallbacks>::deref;
private:
- IDBRequest(ScriptExecutionContext*, PassRefPtr<IDBAny> source);
+ IDBRequest(ScriptExecutionContext*, PassRefPtr<IDBAny> source, IDBTransactionBackendInterface* transaction);
void timerFired(Timer<IDBRequest>*);
void scheduleEvent(PassRefPtr<IDBAny> result, PassRefPtr<IDBDatabaseError>);
@@ -92,6 +93,7 @@ private:
virtual EventTargetData* ensureEventTargetData();
RefPtr<IDBAny> m_source;
+ RefPtr<IDBTransactionBackendInterface> m_transaction;
struct PendingEvent {
RefPtr<IDBAny> m_result;
@@ -103,7 +105,6 @@ private:
Timer<IDBRequest> m_timer;
RefPtr<IDBRequest> m_selfRef; // This is set to us iff there's an event pending.
- bool m_aborted;
ReadyState m_readyState;
EventTargetData m_eventTargetData;
};
diff --git a/WebCore/storage/IDBRequest.idl b/WebCore/storage/IDBRequest.idl
index 3036b6b..58872f0 100644
--- a/WebCore/storage/IDBRequest.idl
+++ b/WebCore/storage/IDBRequest.idl
@@ -32,7 +32,6 @@ module storage {
Conditional=INDEXED_DATABASE,
EventTarget
] IDBRequest {
- void abort();
// States
const unsigned short LOADING = 1;
diff --git a/WebCore/storage/IDBTransaction.cpp b/WebCore/storage/IDBTransaction.cpp
index 4e93378..a223b7f 100644
--- a/WebCore/storage/IDBTransaction.cpp
+++ b/WebCore/storage/IDBTransaction.cpp
@@ -32,6 +32,7 @@
#include "EventException.h"
#include "IDBAbortEvent.h"
#include "IDBDatabase.h"
+#include "IDBDatabaseException.h"
#include "IDBObjectStore.h"
#include "IDBObjectStoreBackendInterface.h"
#include "IDBPendingTransactionMonitor.h"
@@ -46,7 +47,7 @@ IDBTransaction::IDBTransaction(ScriptExecutionContext* context, PassRefPtr<IDBTr
, m_stopped(false)
, m_timer(this, &IDBTransaction::timerFired)
{
- IDBPendingTransactionMonitor::addPendingTransaction(m_backend->id());
+ IDBPendingTransactionMonitor::addPendingTransaction(m_backend.get());
}
IDBTransaction::~IDBTransaction()
@@ -66,7 +67,11 @@ IDBDatabase* IDBTransaction::db()
PassRefPtr<IDBObjectStore> IDBTransaction::objectStore(const String& name, const ExceptionCode&)
{
RefPtr<IDBObjectStoreBackendInterface> objectStoreBackend = m_backend->objectStore(name);
- RefPtr<IDBObjectStore> objectStore = IDBObjectStore::create(objectStoreBackend);
+ if (!objectStoreBackend) {
+ // FIXME: throw IDBDatabaseException::NOT_ALLOWED_ERR.
+ return 0;
+ }
+ RefPtr<IDBObjectStore> objectStore = IDBObjectStore::create(objectStoreBackend, m_backend.get());
return objectStore.release();
}
diff --git a/WebCore/storage/IDBTransactionBackendImpl.cpp b/WebCore/storage/IDBTransactionBackendImpl.cpp
index 51b33b2..4f18437 100644
--- a/WebCore/storage/IDBTransactionBackendImpl.cpp
+++ b/WebCore/storage/IDBTransactionBackendImpl.cpp
@@ -29,11 +29,12 @@
#if ENABLE(INDEXED_DATABASE)
#include "IDBDatabaseBackendImpl.h"
+#include "IDBTransactionCoordinator.h"
#include "SQLiteDatabase.h"
namespace WebCore {
-PassRefPtr<IDBTransactionBackendInterface> IDBTransactionBackendImpl::create(DOMStringList* objectStores, unsigned short mode, unsigned long timeout, int id, IDBDatabaseBackendImpl* database)
+PassRefPtr<IDBTransactionBackendImpl> IDBTransactionBackendImpl::create(DOMStringList* objectStores, unsigned short mode, unsigned long timeout, int id, IDBDatabaseBackendImpl* database)
{
return adoptRef(new IDBTransactionBackendImpl(objectStores, mode, timeout, id, database));
}
@@ -43,26 +44,104 @@ IDBTransactionBackendImpl::IDBTransactionBackendImpl(DOMStringList* objectStores
, m_mode(mode)
, m_timeout(timeout)
, m_id(id)
- , m_aborted(false)
+ , m_state(NotStarted)
, m_database(database)
+ , m_transaction(new SQLiteTransaction(database->sqliteDatabase()))
+ , m_timer(this, &IDBTransactionBackendImpl::timerFired)
+ , m_pendingEvents(0)
{
}
PassRefPtr<IDBObjectStoreBackendInterface> IDBTransactionBackendImpl::objectStore(const String& name)
{
+ if (isFinished())
+ return 0;
return m_database->objectStore(name, 0); // FIXME: remove mode param.
}
-void IDBTransactionBackendImpl::scheduleTask(PassOwnPtr<ScriptExecutionContext::Task>)
+bool IDBTransactionBackendImpl::scheduleTask(PassOwnPtr<ScriptExecutionContext::Task> task)
{
- // FIXME: implement.
- ASSERT_NOT_REACHED();
+ if (isFinished())
+ return false;
+
+ m_taskQueue.append(task);
+ if (m_state == NotStarted)
+ start();
+
+ return true;
}
void IDBTransactionBackendImpl::abort()
{
- m_aborted = true;
+ if (isFinished())
+ return;
+
+ m_state = Finished;
+ m_transaction->rollback();
m_callbacks->onAbort();
+ m_database->transactionCoordinator()->didFinishTransaction(this);
+}
+
+void IDBTransactionBackendImpl::didCompleteTaskEvents()
+{
+ ASSERT(m_state == Started);
+ ASSERT(m_pendingEvents);
+
+ m_pendingEvents--;
+
+ if (!m_pendingEvents && m_taskQueue.isEmpty()) {
+ // The last task event has completed and the task
+ // queue is empty. Commit the transaction.
+ commit();
+ return;
+ }
+
+ // We are still waiting for other events to complete. However,
+ // the task queue is non-empty and the timer is inactive.
+ // We can therfore schedule the timer again.
+ if (!m_taskQueue.isEmpty() && !m_timer.isActive())
+ m_timer.startOneShot(0);
+}
+
+void IDBTransactionBackendImpl::run()
+{
+ ASSERT(m_state == Started);
+ ASSERT(!m_timer.isActive());
+
+ m_timer.startOneShot(0);
+}
+
+void IDBTransactionBackendImpl::start()
+{
+ ASSERT(m_state == NotStarted);
+
+ m_state = Started;
+ m_transaction->begin();
+ m_database->transactionCoordinator()->didStartTransaction(this);
+}
+
+void IDBTransactionBackendImpl::commit()
+{
+ ASSERT(m_state == Started);
+
+ m_state = Finished;
+ m_transaction->commit();
+ m_database->transactionCoordinator()->didFinishTransaction(this);
+}
+
+void IDBTransactionBackendImpl::timerFired(Timer<IDBTransactionBackendImpl>*)
+{
+ ASSERT(!m_taskQueue.isEmpty());
+ ASSERT(m_state == Started);
+
+ TaskQueue queue;
+ queue.swap(m_taskQueue);
+ while (!queue.isEmpty()) {
+ OwnPtr<ScriptExecutionContext::Task> task(queue.first().release());
+ queue.removeFirst();
+ m_pendingEvents++;
+ task->performTask(0);
+ }
}
};
diff --git a/WebCore/storage/IDBTransactionBackendImpl.h b/WebCore/storage/IDBTransactionBackendImpl.h
index fb57401..c037a11 100644
--- a/WebCore/storage/IDBTransactionBackendImpl.h
+++ b/WebCore/storage/IDBTransactionBackendImpl.h
@@ -31,6 +31,9 @@
#include "DOMStringList.h"
#include "IDBTransactionBackendInterface.h"
#include "IDBTransactionCallbacks.h"
+#include "SQLiteTransaction.h"
+#include "Timer.h"
+#include <wtf/Deque.h>
#include <wtf/RefPtr.h>
namespace WebCore {
@@ -39,26 +42,51 @@ class IDBDatabaseBackendImpl;
class IDBTransactionBackendImpl : public IDBTransactionBackendInterface {
public:
- static PassRefPtr<IDBTransactionBackendInterface> create(DOMStringList* objectStores, unsigned short mode, unsigned long timeout, int id, IDBDatabaseBackendImpl*);
- virtual ~IDBTransactionBackendImpl() { }
+ static PassRefPtr<IDBTransactionBackendImpl> create(DOMStringList* objectStores, unsigned short mode, unsigned long timeout, int id, IDBDatabaseBackendImpl*);
+ virtual ~IDBTransactionBackendImpl() { abort(); }
virtual PassRefPtr<IDBObjectStoreBackendInterface> objectStore(const String& name);
virtual unsigned short mode() const { return m_mode; }
- virtual void scheduleTask(PassOwnPtr<ScriptExecutionContext::Task>);
+ virtual bool scheduleTask(PassOwnPtr<ScriptExecutionContext::Task>);
+ virtual void didCompleteTaskEvents();
virtual void abort();
virtual int id() const { return m_id; }
virtual void setCallbacks(IDBTransactionCallbacks* callbacks) { m_callbacks = callbacks; }
+ void run();
+ bool isFinished() const { return m_state == Finished; }
+
private:
IDBTransactionBackendImpl(DOMStringList* objectStores, unsigned short mode, unsigned long timeout, int id, IDBDatabaseBackendImpl*);
+ enum State {
+ NotStarted,
+ Started,
+ Finished,
+ };
+
+ void start();
+ void commit();
+
+ void timerFired(Timer<IDBTransactionBackendImpl>*);
+
RefPtr<DOMStringList> m_objectStoreNames;
unsigned short m_mode;
unsigned long m_timeout;
int m_id;
- bool m_aborted;
+
+ State m_state;
RefPtr<IDBTransactionCallbacks> m_callbacks;
RefPtr<IDBDatabaseBackendImpl> m_database;
+
+ typedef Deque<OwnPtr<ScriptExecutionContext::Task> > TaskQueue;
+ TaskQueue m_taskQueue;
+
+ OwnPtr<SQLiteTransaction> m_transaction;
+
+ // FIXME: delete the timer once we have threads instead.
+ Timer<IDBTransactionBackendImpl> m_timer;
+ int m_pendingEvents;
};
} // namespace WebCore
diff --git a/WebCore/storage/IDBTransactionBackendInterface.h b/WebCore/storage/IDBTransactionBackendInterface.h
index 39651f1..db95d03 100644
--- a/WebCore/storage/IDBTransactionBackendInterface.h
+++ b/WebCore/storage/IDBTransactionBackendInterface.h
@@ -50,7 +50,8 @@ public:
virtual PassRefPtr<IDBObjectStoreBackendInterface> objectStore(const String& name) = 0;
virtual unsigned short mode() const = 0;
- virtual void scheduleTask(PassOwnPtr<ScriptExecutionContext::Task>) = 0;
+ virtual bool scheduleTask(PassOwnPtr<ScriptExecutionContext::Task>) = 0;
+ virtual void didCompleteTaskEvents() = 0;
virtual void abort() = 0;
virtual int id() const = 0;
virtual void setCallbacks(IDBTransactionCallbacks*) = 0;
diff --git a/WebCore/storage/IDBTransactionCoordinator.cpp b/WebCore/storage/IDBTransactionCoordinator.cpp
index 9790c1f..0ece309 100644
--- a/WebCore/storage/IDBTransactionCoordinator.cpp
+++ b/WebCore/storage/IDBTransactionCoordinator.cpp
@@ -47,21 +47,45 @@ IDBTransactionCoordinator::~IDBTransactionCoordinator()
PassRefPtr<IDBTransactionBackendInterface> IDBTransactionCoordinator::createTransaction(DOMStringList* objectStores, unsigned short mode, unsigned long timeout, IDBDatabaseBackendImpl* database)
{
- RefPtr<IDBTransactionBackendInterface> transaction = IDBTransactionBackendImpl::create(objectStores, mode, timeout, ++m_nextID, database);
- m_transactionQueue.add(transaction.get());
- m_idMap.add(m_nextID, transaction);
+ RefPtr<IDBTransactionBackendImpl> transaction = IDBTransactionBackendImpl::create(objectStores, mode, timeout, ++m_nextID, database);
+ m_transactions.add(m_nextID, transaction);
return transaction.release();
}
-void IDBTransactionCoordinator::abort(int id)
+void IDBTransactionCoordinator::didStartTransaction(IDBTransactionBackendImpl* transaction)
{
- ASSERT(m_idMap.contains(id));
- RefPtr<IDBTransactionBackendInterface> transaction = m_idMap.get(id);
- ASSERT(transaction);
- m_transactionQueue.remove(transaction.get());
- m_idMap.remove(id);
- transaction->abort();
- // FIXME: this will change once we have transactions actually running.
+ ASSERT(m_transactions.contains(transaction->id()));
+
+ m_startedTransactions.add(transaction);
+ processStartedTransactions();
+}
+
+void IDBTransactionCoordinator::didFinishTransaction(IDBTransactionBackendImpl* transaction)
+{
+ ASSERT(m_transactions.contains(transaction->id()));
+
+ if (m_startedTransactions.contains(transaction)) {
+ ASSERT(!m_runningTransactions.contains(transaction));
+ m_startedTransactions.remove(transaction);
+ } else if (m_runningTransactions.contains(transaction))
+ m_runningTransactions.remove(transaction);
+
+ m_transactions.remove(transaction->id());
+
+ processStartedTransactions();
+}
+
+void IDBTransactionCoordinator::processStartedTransactions()
+{
+ // FIXME: This should allocate a thread to the next transaction that's
+ // ready to run. For now we only have a single running transaction.
+ if (m_startedTransactions.isEmpty() || !m_runningTransactions.isEmpty())
+ return;
+
+ IDBTransactionBackendImpl* transaction = *m_startedTransactions.begin();
+ m_startedTransactions.remove(transaction);
+ m_runningTransactions.add(transaction);
+ transaction->run();
}
};
diff --git a/WebCore/storage/IDBTransactionCoordinator.h b/WebCore/storage/IDBTransactionCoordinator.h
index 104a956..5e54ab4 100644
--- a/WebCore/storage/IDBTransactionCoordinator.h
+++ b/WebCore/storage/IDBTransactionCoordinator.h
@@ -35,6 +35,7 @@
namespace WebCore {
+class IDBTransactionBackendImpl;
class IDBTransactionCallbacks;
class IDBDatabaseBackendImpl;
@@ -55,14 +56,21 @@ public:
virtual ~IDBTransactionCoordinator();
PassRefPtr<IDBTransactionBackendInterface> createTransaction(DOMStringList* objectStores, unsigned short mode, unsigned long timeout, IDBDatabaseBackendImpl*);
- void abort(int transactionId);
+
+ // Called by transactions as they start and finish.
+ void didStartTransaction(IDBTransactionBackendImpl*);
+ void didFinishTransaction(IDBTransactionBackendImpl*);
private:
IDBTransactionCoordinator();
- ListHashSet<IDBTransactionBackendInterface*> m_transactionQueue;
- typedef HashMap<int, RefPtr<IDBTransactionBackendInterface> > IdToTransactionMap;
- IdToTransactionMap m_idMap;
+ void processStartedTransactions();
+
+ // This map owns all transactions known to the coordinator.
+ HashMap<int, RefPtr<IDBTransactionBackendImpl> > m_transactions;
+ // Transactions in different states are grouped below.
+ ListHashSet<IDBTransactionBackendImpl* > m_startedTransactions;
+ HashSet<IDBTransactionBackendImpl* > m_runningTransactions;
int m_nextID;
};
diff --git a/WebCore/svg/SVGFEBlendElement.cpp b/WebCore/svg/SVGFEBlendElement.cpp
index c4d816b..6c5952f 100644
--- a/WebCore/svg/SVGFEBlendElement.cpp
+++ b/WebCore/svg/SVGFEBlendElement.cpp
@@ -60,6 +60,16 @@ void SVGFEBlendElement::parseMappedAttribute(Attribute* attr)
SVGFilterPrimitiveStandardAttributes::parseMappedAttribute(attr);
}
+void SVGFEBlendElement::svgAttributeChanged(const QualifiedName& attrName)
+{
+ SVGFilterPrimitiveStandardAttributes::svgAttributeChanged(attrName);
+
+ if (attrName == SVGNames::modeAttr
+ || attrName == SVGNames::inAttr
+ || attrName == SVGNames::in2Attr)
+ invalidate();
+}
+
void SVGFEBlendElement::synchronizeProperty(const QualifiedName& attrName)
{
SVGFilterPrimitiveStandardAttributes::synchronizeProperty(attrName);
diff --git a/WebCore/svg/SVGFEBlendElement.h b/WebCore/svg/SVGFEBlendElement.h
index 41c8307..c8c5deb 100644
--- a/WebCore/svg/SVGFEBlendElement.h
+++ b/WebCore/svg/SVGFEBlendElement.h
@@ -34,6 +34,7 @@ private:
SVGFEBlendElement(const QualifiedName&, Document*);
virtual void parseMappedAttribute(Attribute*);
+ virtual void svgAttributeChanged(const QualifiedName&);
virtual void synchronizeProperty(const QualifiedName&);
virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*);
diff --git a/WebCore/svg/SVGFEConvolveMatrixElement.h b/WebCore/svg/SVGFEConvolveMatrixElement.h
index e70b768..b1fe7e2 100644
--- a/WebCore/svg/SVGFEConvolveMatrixElement.h
+++ b/WebCore/svg/SVGFEConvolveMatrixElement.h
@@ -21,7 +21,7 @@
#define SVGFEConvolveMatrixElement_h
#if ENABLE(SVG) && ENABLE(FILTERS)
-#include "SVGFEConvolveMatrix.h"
+#include "FEConvolveMatrix.h"
#include "SVGFilterPrimitiveStandardAttributes.h"
#include "SVGNumberList.h"
diff --git a/WebCore/svg/SVGFEDiffuseLightingElement.cpp b/WebCore/svg/SVGFEDiffuseLightingElement.cpp
index 4bc1bdb..d2e15f8 100644
--- a/WebCore/svg/SVGFEDiffuseLightingElement.cpp
+++ b/WebCore/svg/SVGFEDiffuseLightingElement.cpp
@@ -23,8 +23,8 @@
#include "SVGFEDiffuseLightingElement.h"
#include "Attr.h"
+#include "FEDiffuseLighting.h"
#include "SVGColor.h"
-#include "SVGFEDiffuseLighting.h"
#include "SVGFELightElement.h"
#include "SVGNames.h"
#include "SVGParserUtilities.h"
diff --git a/WebCore/svg/SVGFEDisplacementMapElement.h b/WebCore/svg/SVGFEDisplacementMapElement.h
index 239c2c7..21fd83f 100644
--- a/WebCore/svg/SVGFEDisplacementMapElement.h
+++ b/WebCore/svg/SVGFEDisplacementMapElement.h
@@ -21,7 +21,7 @@
#define SVGFEDisplacementMapElement_h
#if ENABLE(SVG) && ENABLE(FILTERS)
-#include "SVGFEDisplacementMap.h"
+#include "FEDisplacementMap.h"
#include "SVGFilterPrimitiveStandardAttributes.h"
namespace WebCore {
diff --git a/WebCore/svg/SVGFEDistantLightElement.cpp b/WebCore/svg/SVGFEDistantLightElement.cpp
index 59394d8..43a2868 100644
--- a/WebCore/svg/SVGFEDistantLightElement.cpp
+++ b/WebCore/svg/SVGFEDistantLightElement.cpp
@@ -21,7 +21,8 @@
#if ENABLE(SVG) && ENABLE(FILTERS)
#include "SVGFEDistantLightElement.h"
-#include "SVGDistantLightSource.h"
+
+#include "DistantLightSource.h"
namespace WebCore {
diff --git a/WebCore/svg/SVGFEFloodElement.h b/WebCore/svg/SVGFEFloodElement.h
index 2f7d94d..10a418f 100644
--- a/WebCore/svg/SVGFEFloodElement.h
+++ b/WebCore/svg/SVGFEFloodElement.h
@@ -22,7 +22,7 @@
#define SVGFEFloodElement_h
#if ENABLE(SVG) && ENABLE(FILTERS)
-#include "SVGFEFlood.h"
+#include "FEFlood.h"
#include "SVGFilterPrimitiveStandardAttributes.h"
namespace WebCore {
diff --git a/WebCore/svg/SVGFELightElement.h b/WebCore/svg/SVGFELightElement.h
index b86204d..d594475 100644
--- a/WebCore/svg/SVGFELightElement.h
+++ b/WebCore/svg/SVGFELightElement.h
@@ -23,8 +23,8 @@
#define SVGFELightElement_h
#if ENABLE(SVG) && ENABLE(FILTERS)
+#include "LightSource.h"
#include "SVGElement.h"
-#include "SVGLightSource.h"
#include "SVGNames.h"
namespace WebCore {
diff --git a/WebCore/svg/SVGFEMergeElement.h b/WebCore/svg/SVGFEMergeElement.h
index c07be4c..da94ac7 100644
--- a/WebCore/svg/SVGFEMergeElement.h
+++ b/WebCore/svg/SVGFEMergeElement.h
@@ -22,7 +22,7 @@
#define SVGFEMergeElement_h
#if ENABLE(SVG) && ENABLE(FILTERS)
-#include "SVGFEMerge.h"
+#include "FEMerge.h"
#include "SVGFilterPrimitiveStandardAttributes.h"
namespace WebCore {
diff --git a/WebCore/svg/SVGFEMorphologyElement.cpp b/WebCore/svg/SVGFEMorphologyElement.cpp
index b45c6f9..bfd0c0f 100644
--- a/WebCore/svg/SVGFEMorphologyElement.cpp
+++ b/WebCore/svg/SVGFEMorphologyElement.cpp
@@ -42,9 +42,11 @@ PassRefPtr<SVGFEMorphologyElement> SVGFEMorphologyElement::create(const Qualifie
return adoptRef(new SVGFEMorphologyElement(tagName, document));
}
-void SVGFEMorphologyElement::setRadius(float, float)
+void SVGFEMorphologyElement::setRadius(float x, float y)
{
- // FIXME: Needs an implementation.
+ setRadiusXBaseValue(x);
+ setRadiusYBaseValue(y);
+ invalidate();
}
void SVGFEMorphologyElement::parseMappedAttribute(Attribute* attr)
@@ -67,6 +69,16 @@ void SVGFEMorphologyElement::parseMappedAttribute(Attribute* attr)
SVGFilterPrimitiveStandardAttributes::parseMappedAttribute(attr);
}
+void SVGFEMorphologyElement::svgAttributeChanged(const QualifiedName& attrName)
+{
+ SVGFilterPrimitiveStandardAttributes::svgAttributeChanged(attrName);
+
+ if (attrName == SVGNames::inAttr
+ || attrName == SVGNames::operatorAttr
+ || attrName == SVGNames::radiusAttr)
+ invalidate();
+}
+
void SVGFEMorphologyElement::synchronizeProperty(const QualifiedName& attrName)
{
SVGFilterPrimitiveStandardAttributes::synchronizeProperty(attrName);
diff --git a/WebCore/svg/SVGFEMorphologyElement.h b/WebCore/svg/SVGFEMorphologyElement.h
index 9bf26ee..6bbc20c 100644
--- a/WebCore/svg/SVGFEMorphologyElement.h
+++ b/WebCore/svg/SVGFEMorphologyElement.h
@@ -21,7 +21,7 @@
#define SVGFEMorphologyElement_h
#if ENABLE(SVG) && ENABLE(FILTERS)
-#include "SVGFEMorphology.h"
+#include "FEMorphology.h"
#include "SVGFilterPrimitiveStandardAttributes.h"
namespace WebCore {
@@ -39,6 +39,7 @@ private:
SVGFEMorphologyElement(const QualifiedName&, Document*);
virtual void parseMappedAttribute(Attribute*);
+ virtual void svgAttributeChanged(const QualifiedName&);
virtual void synchronizeProperty(const QualifiedName&);
virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*);
diff --git a/WebCore/svg/SVGFEOffsetElement.h b/WebCore/svg/SVGFEOffsetElement.h
index e522ce2..2d522a2 100644
--- a/WebCore/svg/SVGFEOffsetElement.h
+++ b/WebCore/svg/SVGFEOffsetElement.h
@@ -22,8 +22,8 @@
#define SVGFEOffsetElement_h
#if ENABLE(SVG) && ENABLE(FILTERS)
+#include "FEOffset.h"
#include "SVGFilterPrimitiveStandardAttributes.h"
-#include "SVGFEOffset.h"
namespace WebCore {
diff --git a/WebCore/svg/SVGFEPointLightElement.cpp b/WebCore/svg/SVGFEPointLightElement.cpp
index 4436ab9..666b744 100644
--- a/WebCore/svg/SVGFEPointLightElement.cpp
+++ b/WebCore/svg/SVGFEPointLightElement.cpp
@@ -21,7 +21,8 @@
#if ENABLE(SVG) && ENABLE(FILTERS)
#include "SVGFEPointLightElement.h"
-#include "SVGPointLightSource.h"
+
+#include "PointLightSource.h"
namespace WebCore {
diff --git a/WebCore/svg/SVGFESpecularLightingElement.h b/WebCore/svg/SVGFESpecularLightingElement.h
index 1fed36f..378bc49 100644
--- a/WebCore/svg/SVGFESpecularLightingElement.h
+++ b/WebCore/svg/SVGFESpecularLightingElement.h
@@ -23,7 +23,7 @@
#define SVGFESpecularLightingElement_h
#if ENABLE(SVG) && ENABLE(FILTERS)
-#include "SVGFESpecularLighting.h"
+#include "FESpecularLighting.h"
#include "SVGFilterPrimitiveStandardAttributes.h"
namespace WebCore {
diff --git a/WebCore/svg/SVGFESpotLightElement.cpp b/WebCore/svg/SVGFESpotLightElement.cpp
index 04731f0..528cb5c 100644
--- a/WebCore/svg/SVGFESpotLightElement.cpp
+++ b/WebCore/svg/SVGFESpotLightElement.cpp
@@ -21,7 +21,8 @@
#if ENABLE(SVG) && ENABLE(FILTERS)
#include "SVGFESpotLightElement.h"
-#include "SVGSpotLightSource.h"
+
+#include "SpotLightSource.h"
namespace WebCore {
diff --git a/WebCore/svg/SVGFETileElement.h b/WebCore/svg/SVGFETileElement.h
index 03dc08d..b943c55 100644
--- a/WebCore/svg/SVGFETileElement.h
+++ b/WebCore/svg/SVGFETileElement.h
@@ -22,8 +22,8 @@
#define SVGFETileElement_h
#if ENABLE(SVG) && ENABLE(FILTERS)
+#include "FETile.h"
#include "SVGFilterPrimitiveStandardAttributes.h"
-#include "SVGFETile.h"
namespace WebCore {
diff --git a/WebCore/svg/SVGFETurbulenceElement.h b/WebCore/svg/SVGFETurbulenceElement.h
index 887aacf..20e9ed6 100644
--- a/WebCore/svg/SVGFETurbulenceElement.h
+++ b/WebCore/svg/SVGFETurbulenceElement.h
@@ -22,7 +22,7 @@
#define SVGFETurbulenceElement_h
#if ENABLE(SVG) && ENABLE(FILTERS)
-#include "SVGFETurbulence.h"
+#include "FETurbulence.h"
#include "SVGFilterPrimitiveStandardAttributes.h"
namespace WebCore {
diff --git a/WebCore/svg/SVGLength.cpp b/WebCore/svg/SVGLength.cpp
index bdd5b27..a8cfb4e 100644
--- a/WebCore/svg/SVGLength.cpp
+++ b/WebCore/svg/SVGLength.cpp
@@ -86,28 +86,41 @@ static inline String lengthTypeToString(SVGLengthType type)
return String();
}
-inline SVGLengthType stringToLengthType(const String& string)
+inline SVGLengthType stringToLengthType(const UChar*& ptr, const UChar* end)
{
- if (string.endsWith("%"))
- return LengthTypePercentage;
- else if (string.endsWith("em"))
+ if (ptr == end)
+ return LengthTypeNumber;
+
+ const UChar firstChar = *ptr;
+ ++ptr;
+
+ if (firstChar == '%') {
+ if (ptr == end)
+ return LengthTypePercentage;
+ return LengthTypeUnknown;
+ }
+
+ const UChar secondChar = *ptr;
+
+ if (++ptr != end)
+ return LengthTypeUnknown;
+
+ if (firstChar == 'e' && secondChar == 'm')
return LengthTypeEMS;
- else if (string.endsWith("ex"))
+ if (firstChar == 'e' && secondChar == 'x')
return LengthTypeEXS;
- else if (string.endsWith("px"))
+ if (firstChar == 'p' && secondChar == 'x')
return LengthTypePX;
- else if (string.endsWith("cm"))
+ if (firstChar == 'c' && secondChar == 'm')
return LengthTypeCM;
- else if (string.endsWith("mm"))
+ if (firstChar == 'm' && secondChar == 'm')
return LengthTypeMM;
- else if (string.endsWith("in"))
+ if (firstChar == 'i' && secondChar == 'n')
return LengthTypeIN;
- else if (string.endsWith("pt"))
+ if (firstChar == 'p' && secondChar == 't')
return LengthTypePT;
- else if (string.endsWith("pc"))
+ if (firstChar == 'p' && secondChar == 'c')
return LengthTypePC;
- else if (!string.isEmpty())
- return LengthTypeNumber;
return LengthTypeUnknown;
}
@@ -260,8 +273,8 @@ bool SVGLength::setValueAsString(const String& s)
if (!parseNumber(ptr, end, convertedNumber, false))
return false;
- SVGLengthType type = stringToLengthType(s);
- if (ptr != end && type == LengthTypeNumber)
+ SVGLengthType type = stringToLengthType(ptr, end);
+ if (type == LengthTypeUnknown)
return false;
m_unit = storeUnit(extractMode(m_unit), type);
diff --git a/WebCore/svg/SVGParserUtilities.cpp b/WebCore/svg/SVGParserUtilities.cpp
index b8b6d85..c37d207 100644
--- a/WebCore/svg/SVGParserUtilities.cpp
+++ b/WebCore/svg/SVGParserUtilities.cpp
@@ -113,7 +113,10 @@ template <typename FloatType> static bool genericParseNumber(const UChar*& ptr,
}
number = integer + decimal;
- number *= sign * static_cast<FloatType>(pow(10.0, expsign * exponent));
+ number *= sign;
+
+ if (exponent)
+ number *= static_cast<FloatType>(pow(10.0, expsign * exponent));
if (start == ptr)
return false;
diff --git a/WebCore/svg/SVGSVGElement.cpp b/WebCore/svg/SVGSVGElement.cpp
index a461ec4..7de880c 100644
--- a/WebCore/svg/SVGSVGElement.cpp
+++ b/WebCore/svg/SVGSVGElement.cpp
@@ -299,7 +299,7 @@ void SVGSVGElement::svgAttributeChanged(const QualifiedName& attrName)
// FIXME: Ugly, ugly hack to around that parseMappedAttribute is not called
// when svg.width.baseValue = 100 is evaluated.
- // Thus the CSS length value for width is not updated, and width() calcWidth()
+ // Thus the CSS length value for width is not updated, and width() computeLogicalWidth()
// calculations on RenderSVGRoot will be wrong.
// https://bugs.webkit.org/show_bug.cgi?id=25387
bool updateRelativeLengths = false;
diff --git a/WebCore/svg/graphics/filters/SVGFEDisplacementMap.h b/WebCore/svg/graphics/filters/SVGFEDisplacementMap.h
deleted file mode 100644
index 9e17da4..0000000
--- a/WebCore/svg/graphics/filters/SVGFEDisplacementMap.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
- * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
- * Copyright (C) 2005 Eric Seidel <eric@webkit.org>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB. If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#ifndef SVGFEDisplacementMap_h
-#define SVGFEDisplacementMap_h
-
-#if ENABLE(SVG) && ENABLE(FILTERS)
-#include "PlatformString.h"
-#include "FilterEffect.h"
-#include "Filter.h"
-
-namespace WebCore {
-
- enum ChannelSelectorType {
- CHANNEL_UNKNOWN = 0,
- CHANNEL_R = 1,
- CHANNEL_G = 2,
- CHANNEL_B = 3,
- CHANNEL_A = 4
- };
-
- class FEDisplacementMap : public FilterEffect {
- public:
- static PassRefPtr<FEDisplacementMap> create(ChannelSelectorType, ChannelSelectorType, float);
-
- ChannelSelectorType xChannelSelector() const;
- void setXChannelSelector(const ChannelSelectorType);
-
- ChannelSelectorType yChannelSelector() const;
- void setYChannelSelector(const ChannelSelectorType);
-
- float scale() const;
- void setScale(float scale);
-
- void apply(Filter*);
- void dump();
- TextStream& externalRepresentation(TextStream&, int indent) const;
-
- private:
- FEDisplacementMap(ChannelSelectorType, ChannelSelectorType, float);
-
- ChannelSelectorType m_xChannelSelector;
- ChannelSelectorType m_yChannelSelector;
- float m_scale;
- };
-
-} // namespace WebCore
-
-#endif // ENABLE(SVG) && ENABLE(FILTERS)
-
-#endif // SVGFEDisplacementMap_h
diff --git a/WebCore/svg/graphics/filters/SVGFEImage.cpp b/WebCore/svg/graphics/filters/SVGFEImage.cpp
index a3ac882..c94547b 100644
--- a/WebCore/svg/graphics/filters/SVGFEImage.cpp
+++ b/WebCore/svg/graphics/filters/SVGFEImage.cpp
@@ -29,18 +29,17 @@
#include "Filter.h"
#include "GraphicsContext.h"
#include "SVGPreserveAspectRatio.h"
-#include "SVGRenderTreeAsText.h"
namespace WebCore {
-FEImage::FEImage(RefPtr<Image> image, SVGPreserveAspectRatio preserveAspectRatio)
+FEImage::FEImage(RefPtr<Image> image, const SVGPreserveAspectRatio& preserveAspectRatio)
: FilterEffect()
, m_image(image)
, m_preserveAspectRatio(preserveAspectRatio)
{
}
-PassRefPtr<FEImage> FEImage::create(RefPtr<Image> image, SVGPreserveAspectRatio preserveAspectRatio)
+PassRefPtr<FEImage> FEImage::create(RefPtr<Image> image, const SVGPreserveAspectRatio& preserveAspectRatio)
{
return adoptRef(new FEImage(image, preserveAspectRatio));
}
@@ -50,7 +49,7 @@ void FEImage::apply(Filter*)
if (!m_image.get())
return;
- GraphicsContext* filterContext = getEffectContext();
+ GraphicsContext* filterContext = effectContext();
if (!filterContext)
return;
diff --git a/WebCore/svg/graphics/filters/SVGFEImage.h b/WebCore/svg/graphics/filters/SVGFEImage.h
index 97a9cda..fe2d8c4 100644
--- a/WebCore/svg/graphics/filters/SVGFEImage.h
+++ b/WebCore/svg/graphics/filters/SVGFEImage.h
@@ -29,20 +29,21 @@
namespace WebCore {
- class FEImage : public FilterEffect {
- public:
- static PassRefPtr<FEImage> create(RefPtr<Image>, SVGPreserveAspectRatio);
-
- void apply(Filter*);
- void dump();
- TextStream& externalRepresentation(TextStream&, int indent) const;
-
- private:
- FEImage(RefPtr<Image>, SVGPreserveAspectRatio);
-
- RefPtr<Image> m_image;
- SVGPreserveAspectRatio m_preserveAspectRatio;
- };
+class FEImage : public FilterEffect {
+public:
+ static PassRefPtr<FEImage> create(RefPtr<Image>, const SVGPreserveAspectRatio&);
+
+ virtual void apply(Filter*);
+ virtual void dump();
+
+ virtual TextStream& externalRepresentation(TextStream&, int indention) const;
+
+private:
+ FEImage(RefPtr<Image>, const SVGPreserveAspectRatio&);
+
+ RefPtr<Image> m_image;
+ SVGPreserveAspectRatio m_preserveAspectRatio;
+};
} // namespace WebCore
diff --git a/WebCore/svg/graphics/filters/SVGFEMorphology.h b/WebCore/svg/graphics/filters/SVGFEMorphology.h
deleted file mode 100644
index 9743d2b..0000000
--- a/WebCore/svg/graphics/filters/SVGFEMorphology.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
- * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
- * Copyright (C) 2005 Eric Seidel <eric@webkit.org>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB. If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#ifndef SVGFEMorphology_h
-#define SVGFEMorphology_h
-
-#if ENABLE(SVG) && ENABLE(FILTERS)
-#include "FilterEffect.h"
-#include "Filter.h"
-
-namespace WebCore {
-
- enum MorphologyOperatorType {
- FEMORPHOLOGY_OPERATOR_UNKNOWN = 0,
- FEMORPHOLOGY_OPERATOR_ERODE = 1,
- FEMORPHOLOGY_OPERATOR_DILATE = 2
- };
-
- class FEMorphology : public FilterEffect {
- public:
- static PassRefPtr<FEMorphology> create(MorphologyOperatorType, float radiusX, float radiusY);
- MorphologyOperatorType morphologyOperator() const;
- void setMorphologyOperator(MorphologyOperatorType);
-
- float radiusX() const;
- void setRadiusX(float);
-
- float radiusY() const;
- void setRadiusY(float);
-
- void apply(Filter*);
- void dump();
- TextStream& externalRepresentation(TextStream&, int indent) const;
-
- private:
- FEMorphology(MorphologyOperatorType, float radiusX, float radiusY);
-
- MorphologyOperatorType m_type;
- float m_radiusX;
- float m_radiusY;
- };
-
-} // namespace WebCore
-
-#endif // ENABLE(SVG) && ENABLE(FILTERS)
-
-#endif // SVGFEMorphology_h
diff --git a/WebCore/svg/graphics/filters/SVGFilterBuilder.cpp b/WebCore/svg/graphics/filters/SVGFilterBuilder.cpp
index 5a6d0b9..091379e 100644
--- a/WebCore/svg/graphics/filters/SVGFilterBuilder.cpp
+++ b/WebCore/svg/graphics/filters/SVGFilterBuilder.cpp
@@ -27,15 +27,16 @@
#include "SourceAlpha.h"
#include "SourceGraphic.h"
-#include <wtf/HashMap.h>
#include <wtf/PassRefPtr.h>
namespace WebCore {
SVGFilterBuilder::SVGFilterBuilder()
+ : m_lastEffect(0)
{
m_builtinEffects.add(SourceGraphic::effectName(), SourceGraphic::create());
m_builtinEffects.add(SourceAlpha::effectName(), SourceAlpha::create());
+ addBuiltinEffects();
}
void SVGFilterBuilder::add(const AtomicString& id, RefPtr<FilterEffect> effect)
@@ -67,10 +68,26 @@ FilterEffect* SVGFilterBuilder::getEffectById(const AtomicString& id) const
return m_namedEffects.get(id).get();
}
+void SVGFilterBuilder::appendEffectToEffectReferences(RefPtr<FilterEffect> effectReference)
+{
+ // The effect must be a newly created filter effect.
+ ASSERT(!m_effectReferences.contains(effectReference));
+ m_effectReferences.add(effectReference, FilterEffectSet());
+
+ FilterEffect* effect = effectReference.get();
+ unsigned numberOfInputEffects = effect->inputEffects().size();
+
+ // It is not possible to add the same value to a set twice.
+ for (unsigned i = 0; i < numberOfInputEffects; ++i)
+ getEffectReferences(effect->inputEffect(i)).add(effect);
+}
+
void SVGFilterBuilder::clearEffects()
{
m_lastEffect = 0;
m_namedEffects.clear();
+ m_effectReferences.clear();
+ addBuiltinEffects();
}
} // namespace WebCore
diff --git a/WebCore/svg/graphics/filters/SVGFilterBuilder.h b/WebCore/svg/graphics/filters/SVGFilterBuilder.h
index 4ef6ffe..320088d 100644
--- a/WebCore/svg/graphics/filters/SVGFilterBuilder.h
+++ b/WebCore/svg/graphics/filters/SVGFilterBuilder.h
@@ -27,6 +27,7 @@
#include "PlatformString.h"
#include <wtf/HashMap.h>
+#include <wtf/HashSet.h>
#include <wtf/PassRefPtr.h>
#include <wtf/text/AtomicStringHash.h>
@@ -34,6 +35,8 @@ namespace WebCore {
class SVGFilterBuilder : public RefCounted<SVGFilterBuilder> {
public:
+ typedef HashSet<FilterEffect*> FilterEffectSet;
+
static PassRefPtr<SVGFilterBuilder> create() { return adoptRef(new SVGFilterBuilder); }
void add(const AtomicString& id, RefPtr<FilterEffect> effect);
@@ -41,15 +44,32 @@ namespace WebCore {
FilterEffect* getEffectById(const AtomicString& id) const;
FilterEffect* lastEffect() const { return m_lastEffect.get(); }
- const HashMap<AtomicString, RefPtr<FilterEffect> >& namedEffects() { return m_namedEffects; }
+ void appendEffectToEffectReferences(RefPtr<FilterEffect>);
+
+ inline FilterEffectSet& getEffectReferences(FilterEffect* effect)
+ {
+ // Only allowed for effects belongs to this builder.
+ ASSERT(m_effectReferences.contains(effect));
+ return m_effectReferences.find(effect)->second;
+ }
void clearEffects();
private:
SVGFilterBuilder();
+ inline void addBuiltinEffects()
+ {
+ HashMap<AtomicString, RefPtr<FilterEffect> >::iterator end = m_builtinEffects.end();
+ for (HashMap<AtomicString, RefPtr<FilterEffect> >::iterator iterator = m_builtinEffects.begin(); iterator != end; ++iterator)
+ m_effectReferences.add(iterator->second, FilterEffectSet());
+ }
+
HashMap<AtomicString, RefPtr<FilterEffect> > m_builtinEffects;
HashMap<AtomicString, RefPtr<FilterEffect> > m_namedEffects;
+ // The value is a list, which contains those filter effects,
+ // which depends on the key filter effect.
+ HashMap<RefPtr<FilterEffect>, FilterEffectSet> m_effectReferences;
RefPtr<FilterEffect> m_lastEffect;
};
diff --git a/WebCore/webaudio/AudioContext.cpp b/WebCore/webaudio/AudioContext.cpp
new file mode 100644
index 0000000..6ca8ee1
--- /dev/null
+++ b/WebCore/webaudio/AudioContext.cpp
@@ -0,0 +1,467 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#if ENABLE(WEB_AUDIO)
+
+#include "AudioContext.h"
+
+#include "AudioBuffer.h"
+#include "AudioBufferSourceNode.h"
+#include "AudioChannelMerger.h"
+#include "AudioChannelSplitter.h"
+#include "AudioGainNode.h"
+#include "AudioListener.h"
+#include "AudioPannerNode.h"
+#include "CachedAudio.h"
+#include "ConvolverNode.h"
+#include "DelayNode.h"
+#include "Document.h"
+#include "HRTFDatabaseLoader.h"
+#include "HRTFPanner.h"
+#include "HTMLNames.h"
+#include "HighPass2FilterNode.h"
+#include "JavaScriptAudioNode.h"
+#include "LowPass2FilterNode.h"
+#include "PlatformString.h"
+#include "RealtimeAnalyserNode.h"
+
+#include <wtf/OwnPtr.h>
+#include <wtf/PassOwnPtr.h>
+#include <wtf/RefCounted.h>
+
+// FIXME: check the proper way to reference an undefined thread ID
+const int UndefinedThreadIdentifier = 0xffffffff;
+
+namespace WebCore {
+
+PassRefPtr<CachedAudio> AudioContext::createAudioRequest(const String &url, bool mixToMono)
+{
+ lazyInitialize();
+
+ // Convert relative URL to absolute
+ KURL completedURL = document()->completeURL(url);
+ String completedURLString = completedURL.string();
+
+ RefPtr<CachedAudio> cachedAudio = CachedAudio::create(completedURLString, this, document(), sampleRate(), mixToMono);
+ CachedAudio* c = cachedAudio.get();
+
+ m_cachedAudioReferences.append(c);
+
+ return cachedAudio;
+}
+
+PassRefPtr<AudioContext> AudioContext::create(Document* document)
+{
+ return adoptRef(new AudioContext(document));
+}
+
+AudioContext::AudioContext(Document* document)
+ : ActiveDOMObject(document, this)
+ , m_isInitialized(false)
+ , m_isAudioThreadFinished(false)
+ , m_document(document)
+ , m_destinationNode(0)
+ , m_connectionCount(0)
+ , m_audioThread(0)
+ , m_graphOwnerThread(UndefinedThreadIdentifier)
+{
+ // Note: because adoptRef() won't be called until we leave this constructor, but code in this constructor needs to reference this context,
+ // relax the check.
+ relaxAdoptionRequirement();
+
+ m_destinationNode = AudioDestinationNode::create(this);
+ m_listener = AudioListener::create();
+ m_temporaryMonoBus = adoptPtr(new AudioBus(1, AudioNode::ProcessingSizeInFrames));
+ m_temporaryStereoBus = adoptPtr(new AudioBus(2, AudioNode::ProcessingSizeInFrames));
+
+ // This sets in motion an asynchronous loading mechanism on another thread.
+ // We can check hrtfDatabaseLoader()->isLoaded() to find out whether or not it has been fully loaded.
+ // It's not that useful to have a callback function for this since the audio thread automatically starts rendering on the graph
+ // when this has finished (see AudioDestinationNode).
+ hrtfDatabaseLoader()->loadAsynchronously(sampleRate());
+}
+
+AudioContext::~AudioContext()
+{
+#if DEBUG_AUDIONODE_REFERENCES
+ printf("%p: AudioContext::~AudioContext()\n", this);
+#endif
+ // AudioNodes keep a reference to their context, so there should be no way to be in the destructor if there are still AudioNodes around.
+ ASSERT(!m_nodesToDelete.size());
+ ASSERT(!m_referencedNodes.size());
+ ASSERT(!m_finishedNodes.size());
+}
+
+void AudioContext::lazyInitialize()
+{
+ if (!m_isInitialized) {
+ // Don't allow the context to initialize a second time after it's already been explicitly uninitialized.
+ ASSERT(!m_isAudioThreadFinished);
+ if (!m_isAudioThreadFinished) {
+ if (m_destinationNode.get()) {
+ // This starts the audio thread. The destination node's provideInput() method will now be called repeatedly to render audio.
+ // Each time provideInput() is called, a portion of the audio stream is rendered. Let's call this time period a "render quantum".
+ m_destinationNode->initialize();
+ }
+ m_isInitialized = true;
+ }
+ }
+}
+
+void AudioContext::uninitialize()
+{
+ if (m_isInitialized) {
+ // This stops the audio thread and all audio rendering.
+ m_destinationNode->uninitialize();
+
+ // Don't allow the context to initialize a second time after it's already been explicitly uninitialized.
+ m_isAudioThreadFinished = true;
+
+ // We have to release our reference to the destination node before the context will ever be deleted since the destination node holds a reference to the context.
+ m_destinationNode.clear();
+
+ // Get rid of the sources which may still be playing.
+ derefUnfinishedSourceNodes();
+
+ // Because the AudioBuffers are garbage collected, we can't delete them here.
+ // Instead, at least release the potentially large amount of allocated memory for the audio data.
+ // Note that we do this *after* the context is uninitialized and stops processing audio.
+ for (unsigned i = 0; i < m_allocatedBuffers.size(); ++i)
+ m_allocatedBuffers[i]->releaseMemory();
+ m_allocatedBuffers.clear();
+
+ m_isInitialized = false;
+ }
+}
+
+bool AudioContext::isInitialized() const
+{
+ return m_isInitialized;
+}
+
+bool AudioContext::isRunnable() const
+{
+ if (!isInitialized())
+ return false;
+
+ // Check with the HRTF spatialization system to see if it's finished loading.
+ return hrtfDatabaseLoader()->isLoaded();
+}
+
+void AudioContext::stop()
+{
+ m_document = 0; // document is going away
+ uninitialize();
+}
+
+Document* AudioContext::document()
+{
+ ASSERT(m_document);
+ return m_document;
+}
+
+bool AudioContext::hasDocument()
+{
+ return m_document;
+}
+
+void AudioContext::refBuffer(PassRefPtr<AudioBuffer> buffer)
+{
+ m_allocatedBuffers.append(buffer);
+}
+
+PassRefPtr<AudioBuffer> AudioContext::createBuffer(unsigned numberOfChannels, size_t numberOfFrames, double sampleRate)
+{
+ return AudioBuffer::create(numberOfChannels, numberOfFrames, sampleRate);
+}
+
+PassRefPtr<AudioBufferSourceNode> AudioContext::createBufferSource()
+{
+ ASSERT(isMainThread());
+ lazyInitialize();
+ RefPtr<AudioBufferSourceNode> node = AudioBufferSourceNode::create(this, m_destinationNode->sampleRate());
+
+ refNode(node.get()); // context keeps reference until source has finished playing
+ return node;
+}
+
+PassRefPtr<JavaScriptAudioNode> AudioContext::createJavaScriptNode(size_t bufferSize)
+{
+ ASSERT(isMainThread());
+ lazyInitialize();
+ RefPtr<JavaScriptAudioNode> node = JavaScriptAudioNode::create(this, m_destinationNode->sampleRate(), bufferSize);
+
+ refNode(node.get()); // context keeps reference until we stop making javascript rendering callbacks
+ return node;
+}
+
+PassRefPtr<LowPass2FilterNode> AudioContext::createLowPass2Filter()
+{
+ ASSERT(isMainThread());
+ lazyInitialize();
+ return LowPass2FilterNode::create(this, m_destinationNode->sampleRate());
+}
+
+PassRefPtr<HighPass2FilterNode> AudioContext::createHighPass2Filter()
+{
+ ASSERT(isMainThread());
+ lazyInitialize();
+ return HighPass2FilterNode::create(this, m_destinationNode->sampleRate());
+}
+
+PassRefPtr<AudioPannerNode> AudioContext::createPanner()
+{
+ ASSERT(isMainThread());
+ lazyInitialize();
+ return AudioPannerNode::create(this, m_destinationNode->sampleRate());
+}
+
+PassRefPtr<ConvolverNode> AudioContext::createConvolver()
+{
+ ASSERT(isMainThread());
+ lazyInitialize();
+ return ConvolverNode::create(this, m_destinationNode->sampleRate());
+}
+
+PassRefPtr<RealtimeAnalyserNode> AudioContext::createAnalyser()
+{
+ ASSERT(isMainThread());
+ lazyInitialize();
+ return RealtimeAnalyserNode::create(this, m_destinationNode->sampleRate());
+}
+
+PassRefPtr<AudioGainNode> AudioContext::createGainNode()
+{
+ ASSERT(isMainThread());
+ lazyInitialize();
+ return AudioGainNode::create(this, m_destinationNode->sampleRate());
+}
+
+PassRefPtr<DelayNode> AudioContext::createDelayNode()
+{
+ ASSERT(isMainThread());
+ lazyInitialize();
+ return DelayNode::create(this, m_destinationNode->sampleRate());
+}
+
+PassRefPtr<AudioChannelSplitter> AudioContext::createChannelSplitter()
+{
+ ASSERT(isMainThread());
+ lazyInitialize();
+ return AudioChannelSplitter::create(this, m_destinationNode->sampleRate());
+}
+
+PassRefPtr<AudioChannelMerger> AudioContext::createChannelMerger()
+{
+ ASSERT(isMainThread());
+ lazyInitialize();
+ return AudioChannelMerger::create(this, m_destinationNode->sampleRate());
+}
+
+void AudioContext::notifyNodeFinishedProcessing(AudioNode* node)
+{
+ ASSERT(isAudioThread());
+ m_finishedNodes.append(node);
+}
+
+void AudioContext::derefFinishedSourceNodes()
+{
+ ASSERT(isGraphOwner());
+ ASSERT(isAudioThread() || isAudioThreadFinished());
+ for (unsigned i = 0; i < m_finishedNodes.size(); i++)
+ derefNode(m_finishedNodes[i]);
+
+ m_finishedNodes.clear();
+}
+
+void AudioContext::refNode(AudioNode* node)
+{
+ ASSERT(isMainThread());
+ AutoLocker locker(this);
+
+ node->ref(AudioNode::RefTypeConnection);
+ m_referencedNodes.append(node);
+}
+
+void AudioContext::derefNode(AudioNode* node)
+{
+ ASSERT(isGraphOwner());
+
+ node->deref(AudioNode::RefTypeConnection);
+
+ for (unsigned i = 0; i < m_referencedNodes.size(); ++i) {
+ if (node == m_referencedNodes[i]) {
+ m_referencedNodes.remove(i);
+ break;
+ }
+ }
+}
+
+void AudioContext::derefUnfinishedSourceNodes()
+{
+ ASSERT(isMainThread() && isAudioThreadFinished());
+ for (unsigned i = 0; i < m_referencedNodes.size(); ++i)
+ m_referencedNodes[i]->deref(AudioNode::RefTypeConnection);
+
+ m_referencedNodes.clear();
+}
+
+void AudioContext::lock(bool& mustReleaseLock)
+{
+ // Don't allow regular lock in real-time audio thread.
+ ASSERT(isMainThread());
+
+ ThreadIdentifier thisThread = currentThread();
+
+ if (thisThread == m_graphOwnerThread) {
+ // We already have the lock.
+ mustReleaseLock = false;
+ } else {
+ // Acquire the lock.
+ m_contextGraphMutex.lock();
+ mustReleaseLock = true;
+ }
+
+ m_graphOwnerThread = thisThread;
+}
+
+bool AudioContext::tryLock(bool& mustReleaseLock)
+{
+ ThreadIdentifier thisThread = currentThread();
+ bool isAudioThread = thisThread == audioThread();
+
+ // Try to catch cases of using try lock on main thread - it should use regular lock.
+ ASSERT(isAudioThread || isAudioThreadFinished());
+
+ if (!isAudioThread) {
+ // In release build treat tryLock() as lock() (since above ASSERT(isAudioThread) never fires) - this is the best we can do.
+ lock(mustReleaseLock);
+ return true;
+ }
+
+ bool hasLock;
+
+ if (thisThread == m_graphOwnerThread) {
+ // Thread already has the lock.
+ hasLock = true;
+ mustReleaseLock = false;
+ } else {
+ // Don't already have the lock - try to acquire it.
+ hasLock = m_contextGraphMutex.tryLock();
+
+ if (hasLock)
+ m_graphOwnerThread = thisThread;
+
+ mustReleaseLock = hasLock;
+ }
+
+ return hasLock;
+}
+
+void AudioContext::unlock()
+{
+ ASSERT(currentThread() == m_graphOwnerThread);
+
+ m_graphOwnerThread = UndefinedThreadIdentifier;
+ m_contextGraphMutex.unlock();
+}
+
+bool AudioContext::isAudioThread()
+{
+ return currentThread() == m_audioThread;
+}
+
+bool AudioContext::isGraphOwner()
+{
+ return currentThread() == m_graphOwnerThread;
+}
+
+void AudioContext::addDeferredFinishDeref(AudioNode* node, AudioNode::RefType refType)
+{
+ ASSERT(isAudioThread());
+ m_deferredFinishDerefList.append(AudioContext::RefInfo(node, refType));
+}
+
+void AudioContext::handlePostRenderTasks()
+{
+ ASSERT(isAudioThread());
+
+ // Must use a tryLock() here too. Don't worry, the lock will very rarely be contended and this method is called frequently.
+ // The worst that can happen is that there will be some nodes which will take slightly longer than usual to be deleted or removed
+ // from the render graph (in which case they'll render silence).
+ bool mustReleaseLock;
+ if (tryLock(mustReleaseLock)) {
+ // Take care of finishing any derefs where the tryLock() failed previously.
+ handleDeferredFinishDerefs();
+
+ // Dynamically clean up nodes which are no longer needed.
+ derefFinishedSourceNodes();
+
+ // Finally actually delete.
+ deleteMarkedNodes();
+
+ if (mustReleaseLock)
+ unlock();
+ }
+}
+
+void AudioContext::handleDeferredFinishDerefs()
+{
+ ASSERT(isAudioThread());
+ for (unsigned i = 0; i < m_deferredFinishDerefList.size(); ++i) {
+ AudioNode* node = m_deferredFinishDerefList[i].m_node;
+ AudioNode::RefType refType = m_deferredFinishDerefList[i].m_refType;
+ node->finishDeref(refType);
+ }
+
+ m_deferredFinishDerefList.clear();
+}
+
+void AudioContext::markForDeletion(AudioNode* node)
+{
+ ASSERT(isGraphOwner());
+ m_nodesToDelete.append(node);
+}
+
+void AudioContext::deleteMarkedNodes()
+{
+ ASSERT(isGraphOwner() || isAudioThreadFinished());
+
+ // Note: deleting an AudioNode can cause m_nodesToDelete to grow.
+ while (size_t n = m_nodesToDelete.size()) {
+ AudioNode* node = m_nodesToDelete[n - 1];
+ m_nodesToDelete.removeLast();
+ delete node;
+ }
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(WEB_AUDIO)
diff --git a/WebCore/webaudio/AudioContext.h b/WebCore/webaudio/AudioContext.h
new file mode 100644
index 0000000..f175bfe
--- /dev/null
+++ b/WebCore/webaudio/AudioContext.h
@@ -0,0 +1,248 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef AudioContext_h
+#define AudioContext_h
+
+#include "ActiveDOMObject.h"
+#include "AudioBus.h"
+#include "AudioDestinationNode.h"
+#include <wtf/OwnPtr.h>
+#include <wtf/PassRefPtr.h>
+#include <wtf/RefCounted.h>
+#include <wtf/RefPtr.h>
+#include <wtf/Threading.h>
+#include <wtf/Vector.h>
+#include <wtf/text/AtomicStringHash.h>
+
+namespace WebCore {
+
+class AudioBuffer;
+class AudioBufferSourceNode;
+class AudioChannelMerger;
+class AudioChannelSplitter;
+class AudioGainNode;
+class AudioPannerNode;
+class AudioListener;
+class CachedAudio;
+class DelayNode;
+class Document;
+class LowPass2FilterNode;
+class HighPass2FilterNode;
+class ConvolverNode;
+class RealtimeAnalyserNode;
+class JavaScriptAudioNode;
+
+// AudioContext is the cornerstone of the web audio API and all AudioNodes are created from it.
+// For thread safety between the audio thread and the main thread, it has a rendering graph locking mechanism.
+
+class AudioContext : public ActiveDOMObject, public RefCounted<AudioContext> {
+public:
+ static PassRefPtr<AudioContext> create(Document*);
+
+ virtual ~AudioContext();
+
+ bool isInitialized() const;
+
+ // Returns true when initialize() was called AND all asynchronous initialization has completed.
+ bool isRunnable() const;
+
+ // Document notification
+ virtual void stop();
+
+ Document* document(); // ASSERTs if document no longer exists.
+ bool hasDocument();
+
+ AudioDestinationNode* destination() { return m_destinationNode.get(); }
+ double currentTime() { return m_destinationNode->currentTime(); }
+ double sampleRate() { return m_destinationNode->sampleRate(); }
+
+ PassRefPtr<AudioBuffer> createBuffer(unsigned numberOfChannels, size_t numberOfFrames, double sampleRate);
+
+ PassRefPtr<CachedAudio> createAudioRequest(const String &url, bool mixToMono);
+
+ // Keep track of this buffer so we can release memory after the context is shut down...
+ void refBuffer(PassRefPtr<AudioBuffer> buffer);
+
+ AudioListener* listener() { return m_listener.get(); }
+
+ // The AudioNode create methods are called on the main thread (from JavaScript).
+ PassRefPtr<AudioBufferSourceNode> createBufferSource();
+ PassRefPtr<AudioGainNode> createGainNode();
+ PassRefPtr<DelayNode> createDelayNode();
+ PassRefPtr<LowPass2FilterNode> createLowPass2Filter();
+ PassRefPtr<HighPass2FilterNode> createHighPass2Filter();
+ PassRefPtr<AudioPannerNode> createPanner();
+ PassRefPtr<ConvolverNode> createConvolver();
+ PassRefPtr<RealtimeAnalyserNode> createAnalyser();
+ PassRefPtr<JavaScriptAudioNode> createJavaScriptNode(size_t bufferSize);
+ PassRefPtr<AudioChannelSplitter> createChannelSplitter();
+ PassRefPtr<AudioChannelMerger> createChannelMerger();
+
+ AudioBus* temporaryMonoBus() { return m_temporaryMonoBus.get(); }
+ AudioBus* temporaryStereoBus() { return m_temporaryStereoBus.get(); }
+
+ // When a source node has no more processing to do (has finished playing), then it tells the context to dereference it.
+ void notifyNodeFinishedProcessing(AudioNode*);
+
+ // Called at the end of each render quantum.
+ void handlePostRenderTasks();
+
+ // Called periodically at the end of each render quantum to dereference finished source nodes.
+ void derefFinishedSourceNodes();
+
+ // We reap all marked nodes at the end of each realtime render quantum in deleteMarkedNodes().
+ void markForDeletion(AudioNode*);
+ void deleteMarkedNodes();
+
+ // Keeps track of the number of connections made.
+ void incrementConnectionCount()
+ {
+ ASSERT(isMainThread());
+ m_connectionCount++;
+ }
+
+ unsigned connectionCount() const { return m_connectionCount; }
+
+ //
+ // Thread Safety and Graph Locking:
+ //
+
+ void setAudioThread(ThreadIdentifier thread) { m_audioThread = thread; } // FIXME: check either not initialized or the same
+ ThreadIdentifier audioThread() const { return m_audioThread; }
+ bool isAudioThread();
+
+ // Returns true only after the audio thread has been started and then shutdown.
+ bool isAudioThreadFinished() { return m_isAudioThreadFinished; }
+
+ // mustReleaseLock is set to true if we acquired the lock in this method call and caller must unlock(), false if it was previously acquired.
+ void lock(bool& mustReleaseLock);
+
+ // Returns true if we own the lock.
+ // mustReleaseLock is set to true if we acquired the lock in this method call and caller must unlock(), false if it was previously acquired.
+ bool tryLock(bool& mustReleaseLock);
+
+ void unlock();
+
+ // Returns true if this thread owns the context's lock.
+ bool isGraphOwner();
+
+ class AutoLocker {
+ public:
+ AutoLocker(AudioContext* context)
+ : m_context(context)
+ {
+ ASSERT(context);
+ context->lock(m_mustReleaseLock);
+ }
+
+ ~AutoLocker()
+ {
+ if (m_mustReleaseLock)
+ m_context->unlock();
+ }
+ private:
+ AudioContext* m_context;
+ bool m_mustReleaseLock;
+ };
+
+ // In AudioNode::deref() a tryLock() is used for calling finishDeref(), but if it fails keep track here.
+ void addDeferredFinishDeref(AudioNode*, AudioNode::RefType);
+
+ // In the audio thread at the start of each render cycle, we'll call handleDeferredFinishDerefs().
+ void handleDeferredFinishDerefs();
+
+private:
+ AudioContext(Document*);
+ void lazyInitialize();
+ void uninitialize();
+
+ bool m_isInitialized;
+ bool m_isAudioThreadFinished;
+ bool m_isAudioThreadShutdown;
+
+ Document* m_document;
+
+ // The context itself keeps a reference to all source nodes. The source nodes, then reference all nodes they're connected to.
+ // In turn, these nodes reference all nodes they're connected to. All nodes are ultimately connected to the AudioDestinationNode.
+ // When the context dereferences a source node, it will be deactivated from the rendering graph along with all other nodes it is
+ // uniquely connected to. See the AudioNode::ref() and AudioNode::deref() methods for more details.
+ void refNode(AudioNode*);
+ void derefNode(AudioNode*);
+
+ // When the context goes away, there might still be some sources which haven't finished playing.
+ // Make sure to dereference them here.
+ void derefUnfinishedSourceNodes();
+
+ RefPtr<AudioDestinationNode> m_destinationNode;
+ RefPtr<AudioListener> m_listener;
+
+ // Only accessed in the main thread.
+ Vector<RefPtr<AudioBuffer> > m_allocatedBuffers;
+
+ // Only accessed in the audio thread.
+ Vector<AudioNode*> m_finishedNodes;
+
+ // We don't use RefPtr<AudioNode> here because AudioNode has a more complex ref() / deref() implementation
+ // with an optional argument for refType. We need to use the special refType: RefTypeConnection
+ // Either accessed when the graph lock is held, or on the main thread when the audio thread has finished.
+ Vector<AudioNode*> m_referencedNodes;
+
+ // Accumulate nodes which need to be deleted at the end of a render cycle (in realtime thread) here.
+ Vector<AudioNode*> m_nodesToDelete;
+
+ Vector<RefPtr<CachedAudio> > m_cachedAudioReferences;
+
+ OwnPtr<AudioBus> m_temporaryMonoBus;
+ OwnPtr<AudioBus> m_temporaryStereoBus;
+
+ unsigned m_connectionCount;
+
+ // Graph locking.
+ Mutex m_contextGraphMutex;
+ volatile ThreadIdentifier m_audioThread;
+ volatile ThreadIdentifier m_graphOwnerThread; // if the lock is held then this is the thread which owns it, otherwise == UndefinedThreadIdentifier
+
+ // Deferred de-referencing.
+ struct RefInfo {
+ RefInfo(AudioNode* node, AudioNode::RefType refType)
+ : m_node(node)
+ , m_refType(refType)
+ {
+ }
+ AudioNode* m_node;
+ AudioNode::RefType m_refType;
+ };
+
+ // Only accessed in the audio thread.
+ Vector<RefInfo> m_deferredFinishDerefList;
+};
+
+} // WebCore
+
+#endif // AudioContext_h
diff --git a/WebCore/webaudio/AudioContext.idl b/WebCore/webaudio/AudioContext.idl
new file mode 100644
index 0000000..8951121
--- /dev/null
+++ b/WebCore/webaudio/AudioContext.idl
@@ -0,0 +1,70 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+module webaudio {
+ interface [
+ Conditional=WEB_AUDIO,
+ CanBeConstructed,
+ CustomConstructFunction,
+ V8CustomConstructor
+ ] AudioContext {
+ // All rendered audio ultimately connects to destination, which represents the audio hardware.
+ readonly attribute AudioDestinationNode destination;
+
+ // All scheduled times are relative to this time in seconds.
+ readonly attribute float currentTime;
+
+ // All AudioNodes in the context run at this sample-rate (in sample-frames per second).
+ readonly attribute float sampleRate;
+
+ // All panning is relative to this listener.
+ readonly attribute AudioListener listener;
+
+ AudioBuffer createBuffer(in unsigned long numberOfChannels, in unsigned long numberOfFrames, in float sampleRate);
+
+ // Source
+ AudioBufferSourceNode createBufferSource();
+
+ // Processing nodes
+ AudioGainNode createGainNode();
+ DelayNode createDelayNode();
+ LowPass2FilterNode createLowPass2Filter();
+ HighPass2FilterNode createHighPass2Filter();
+ AudioPannerNode createPanner();
+ ConvolverNode createConvolver();
+ RealtimeAnalyserNode createAnalyser();
+ JavaScriptAudioNode createJavaScriptNode(in unsigned long bufferSize);
+
+ // Channel splitting and merging
+ AudioChannelSplitter createChannelSplitter();
+ AudioChannelMerger createChannelMerger();
+
+ // FIXME: Temporary - to be replaced with XHR.
+ CachedAudio createAudioRequest(in DOMString url, in boolean mixToMono);
+ };
+}
diff --git a/WebCore/webaudio/AudioDestinationNode.cpp b/WebCore/webaudio/AudioDestinationNode.cpp
new file mode 100644
index 0000000..82f5145
--- /dev/null
+++ b/WebCore/webaudio/AudioDestinationNode.cpp
@@ -0,0 +1,115 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#if ENABLE(WEB_AUDIO)
+
+#include "AudioDestinationNode.h"
+
+#include "AudioBus.h"
+#include "AudioContext.h"
+#include "AudioNodeInput.h"
+#include "AudioNodeOutput.h"
+#include <wtf/Threading.h>
+
+namespace WebCore {
+
+AudioDestinationNode::AudioDestinationNode(AudioContext* context)
+ : AudioNode(context, AudioDestination::hardwareSampleRate())
+ , m_currentTime(0.0)
+{
+ addInput(adoptPtr(new AudioNodeInput(this)));
+
+ setType(NodeTypeDestination);
+
+ initialize();
+}
+
+AudioDestinationNode::~AudioDestinationNode()
+{
+ uninitialize();
+}
+
+void AudioDestinationNode::initialize()
+{
+ if (isInitialized())
+ return;
+
+ double hardwareSampleRate = AudioDestination::hardwareSampleRate();
+#ifndef NDEBUG
+ fprintf(stderr, ">>>> hardwareSampleRate = %f\n", hardwareSampleRate);
+#endif
+
+ m_destination = AudioDestination::create(*this, hardwareSampleRate);
+ m_destination->start();
+
+ m_isInitialized = true;
+}
+
+void AudioDestinationNode::uninitialize()
+{
+ if (!isInitialized())
+ return;
+
+ m_destination->stop();
+
+ m_isInitialized = false;
+}
+
+// The audio hardware calls us back here to gets its input stream.
+void AudioDestinationNode::provideInput(AudioBus* destinationBus, size_t numberOfFrames)
+{
+ context()->setAudioThread(currentThread());
+
+ if (!context()->isRunnable()) {
+ destinationBus->zero();
+ return;
+ }
+
+ // This will cause the node(s) connected to us to process, which in turn will pull on their input(s),
+ // all the way backwards through the rendering graph.
+ AudioBus* renderedBus = input(0)->pull(destinationBus, numberOfFrames);
+
+ if (!renderedBus)
+ destinationBus->zero();
+ else if (renderedBus != destinationBus) {
+ // in-place processing was not possible - so copy
+ destinationBus->copyFrom(*renderedBus);
+ }
+
+ // Let the context take care of any business at the end of each render quantum.
+ context()->handlePostRenderTasks();
+
+ // Advance current time.
+ m_currentTime += numberOfFrames / sampleRate();
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(WEB_AUDIO)
diff --git a/WebCore/webaudio/AudioDestinationNode.h b/WebCore/webaudio/AudioDestinationNode.h
new file mode 100644
index 0000000..b130518
--- /dev/null
+++ b/WebCore/webaudio/AudioDestinationNode.h
@@ -0,0 +1,76 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef AudioDestinationNode_h
+#define AudioDestinationNode_h
+
+#include "AudioDestination.h"
+#include "AudioNode.h"
+#include "AudioSourceProvider.h"
+#include <wtf/OwnPtr.h>
+#include <wtf/PassRefPtr.h>
+
+namespace WebCore {
+
+class AudioBus;
+class AudioContext;
+
+class AudioDestinationNode : public AudioNode, public AudioSourceProvider {
+public:
+ static PassRefPtr<AudioDestinationNode> create(AudioContext* context)
+ {
+ return adoptRef(new AudioDestinationNode(context));
+ }
+
+ virtual ~AudioDestinationNode();
+
+ // AudioNode
+ virtual void process(size_t) { }; // we're pulled by hardware so this is never called
+ virtual void reset() { m_currentTime = 0.0; };
+ virtual void initialize();
+ virtual void uninitialize();
+
+ // The audio hardware calls here periodically to gets its input stream.
+ virtual void provideInput(AudioBus*, size_t numberOfFrames);
+
+ double currentTime() { return m_currentTime; }
+
+ double sampleRate() const { return m_destination->sampleRate(); }
+
+ unsigned numberOfChannels() const { return 2; } // FIXME: update when multi-channel (more than stereo) is supported
+
+private:
+ AudioDestinationNode(AudioContext*);
+
+ OwnPtr<AudioDestination> m_destination;
+ double m_currentTime;
+};
+
+} // namespace WebCore
+
+#endif // AudioDestinationNode_h
diff --git a/WebCore/webaudio/AudioDestinationNode.idl b/WebCore/webaudio/AudioDestinationNode.idl
new file mode 100644
index 0000000..1d2a235
--- /dev/null
+++ b/WebCore/webaudio/AudioDestinationNode.idl
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+module audio {
+ interface [
+ Conditional=WEB_AUDIO,
+ GenerateToJS
+ ] AudioDestinationNode : AudioNode {
+ readonly attribute long numberOfChannels;
+ };
+}
diff --git a/WebCore/webaudio/AudioGain.h b/WebCore/webaudio/AudioGain.h
new file mode 100644
index 0000000..eb3c52d
--- /dev/null
+++ b/WebCore/webaudio/AudioGain.h
@@ -0,0 +1,53 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef AudioGain_h
+#define AudioGain_h
+
+#include "AudioParam.h"
+#include <wtf/PassRefPtr.h>
+
+namespace WebCore {
+
+class AudioGain : public AudioParam {
+public:
+ static PassRefPtr<AudioGain> create(const char* name, double defaultValue, double minValue, double maxValue)
+ {
+ return adoptRef(new AudioGain(name, defaultValue, minValue, maxValue));
+ }
+
+private:
+ AudioGain(const char* name, double defaultValue, double minValue, double maxValue)
+ : AudioParam(name, defaultValue, minValue, maxValue)
+ {
+ }
+};
+
+} // namespace WebCore
+
+#endif // AudioParam_h
diff --git a/WebCore/webaudio/AudioGain.idl b/WebCore/webaudio/AudioGain.idl
new file mode 100644
index 0000000..ead7c9a
--- /dev/null
+++ b/WebCore/webaudio/AudioGain.idl
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+module audio {
+ interface [
+ Conditional=WEB_AUDIO,
+ GenerateToJS
+ ] AudioGain : AudioParam {
+ };
+}
diff --git a/WebCore/webaudio/AudioNode.cpp b/WebCore/webaudio/AudioNode.cpp
new file mode 100644
index 0000000..497ac95
--- /dev/null
+++ b/WebCore/webaudio/AudioNode.cpp
@@ -0,0 +1,311 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#if ENABLE(WEB_AUDIO)
+
+#include "AudioNode.h"
+
+#include "AudioContext.h"
+#include "AudioNodeInput.h"
+#include "AudioNodeOutput.h"
+#include <wtf/Atomics.h>
+
+namespace WebCore {
+
+AudioNode::AudioNode(AudioContext* context, double sampleRate)
+ : m_isInitialized(false)
+ , m_type(NodeTypeUnknown)
+ , m_context(context)
+ , m_sampleRate(sampleRate)
+ , m_lastProcessingTime(-1.0)
+ , m_normalRefCount(1) // start out with normal refCount == 1 (like WTF::RefCounted class)
+ , m_connectionRefCount(0)
+ , m_disabledRefCount(0)
+ , m_isMarkedForDeletion(false)
+ , m_isDisabled(false)
+{
+#if DEBUG_AUDIONODE_REFERENCES
+ if (!s_isNodeCountInitialized) {
+ s_isNodeCountInitialized = true;
+ atexit(AudioNode::printNodeCounts);
+ }
+#endif
+}
+
+AudioNode::~AudioNode()
+{
+#if DEBUG_AUDIONODE_REFERENCES
+ --s_nodeCount[type()];
+ printf("%p: %d: AudioNode::~AudioNode() %d %d %d\n", this, type(), m_normalRefCount, m_connectionRefCount, m_disabledRefCount);
+#endif
+}
+
+void AudioNode::setType(NodeType type)
+{
+ m_type = type;
+
+#if DEBUG_AUDIONODE_REFERENCES
+ ++s_nodeCount[type];
+#endif
+}
+
+void AudioNode::lazyInitialize()
+{
+ if (!isInitialized())
+ initialize();
+}
+
+void AudioNode::addInput(PassOwnPtr<AudioNodeInput> input)
+{
+ m_inputs.append(input);
+}
+
+void AudioNode::addOutput(PassOwnPtr<AudioNodeOutput> output)
+{
+ m_outputs.append(output);
+}
+
+AudioNodeInput* AudioNode::input(unsigned i)
+{
+ return m_inputs[i].get();
+}
+
+AudioNodeOutput* AudioNode::output(unsigned i)
+{
+ return m_outputs[i].get();
+}
+
+bool AudioNode::connect(AudioNode* destination, unsigned outputIndex, unsigned inputIndex)
+{
+ ASSERT(isMainThread());
+ AudioContext::AutoLocker locker(context());
+
+ // Sanity check input and output indices.
+ if (outputIndex >= numberOfOutputs())
+ return false;
+ if (destination && inputIndex >= destination->numberOfInputs())
+ return false;
+
+ AudioNodeOutput* output = this->output(outputIndex);
+ if (!destination) {
+ // Disconnect output from any inputs it may be currently connected to.
+ output->disconnectAllInputs();
+ return true;
+ }
+
+ AudioNodeInput* input = destination->input(inputIndex);
+ input->connect(output);
+
+ // Let context know that a connection has been made.
+ context()->incrementConnectionCount();
+
+ return true;
+}
+
+bool AudioNode::disconnect(unsigned outputIndex)
+{
+ ASSERT(isMainThread());
+ AudioContext::AutoLocker locker(context());
+
+ return connect(0, outputIndex);
+}
+
+void AudioNode::processIfNecessary(size_t framesToProcess)
+{
+ ASSERT(context()->isAudioThread());
+
+ if (!isInitialized())
+ return;
+
+ // Ensure that we only process once per rendering quantum.
+ // This handles the "fanout" problem where an output is connected to multiple inputs.
+ // The first time we're called during this time slice we process, but after that we don't want to re-process,
+ // instead our output(s) will already have the results cached in their bus;
+ double currentTime = context()->currentTime();
+ if (m_lastProcessingTime != currentTime) {
+ m_lastProcessingTime = currentTime; // important to first update this time because of feedback loops in the rendering graph
+ pullInputs(framesToProcess);
+ process(framesToProcess);
+ }
+}
+
+void AudioNode::pullInputs(size_t framesToProcess)
+{
+ ASSERT(context()->isAudioThread());
+
+ // Process all of the AudioNodes connected to our inputs.
+ for (unsigned i = 0; i < m_inputs.size(); ++i)
+ input(i)->pull(0, framesToProcess);
+}
+
+void AudioNode::ref(RefType refType)
+{
+ switch (refType) {
+ case RefTypeNormal:
+ atomicIncrement(&m_normalRefCount);
+ break;
+ case RefTypeConnection:
+ atomicIncrement(&m_connectionRefCount);
+ break;
+ case RefTypeDisabled:
+ atomicIncrement(&m_disabledRefCount);
+ break;
+ default:
+ ASSERT_NOT_REACHED();
+ }
+
+#if DEBUG_AUDIONODE_REFERENCES
+ printf("%p: %d: AudioNode::ref(%d) %d %d %d\n", this, type(), refType, m_normalRefCount, m_connectionRefCount, m_disabledRefCount);
+#endif
+
+ if (m_connectionRefCount == 1 && refType == RefTypeConnection) {
+ // FIXME: implement wake-up - this is an advanced feature and is not necessary in a simple implementation.
+ // We should not be "actively" connected to anything, but now we're "waking up"
+ // For example, a note which has finished playing, but is now being played again.
+ // Note that if this is considered a worthwhile feature to add, then an evaluation of the locking considerations must be made.
+ }
+}
+
+void AudioNode::deref(RefType refType)
+{
+ // The actually work for deref happens completely within the audio context's graph lock.
+ // In the case of the audio thread, we must use a tryLock to avoid glitches.
+ bool hasLock = false;
+ bool mustReleaseLock = false;
+
+ if (context()->isAudioThread()) {
+ // Real-time audio thread must not contend lock (to avoid glitches).
+ hasLock = context()->tryLock(mustReleaseLock);
+ } else {
+ context()->lock(mustReleaseLock);
+ hasLock = true;
+ }
+
+ if (hasLock) {
+ // This is where the real deref work happens.
+ finishDeref(refType);
+
+ if (mustReleaseLock)
+ context()->unlock();
+ } else {
+ // We were unable to get the lock, so put this in a list to finish up later.
+ ASSERT(context()->isAudioThread());
+ context()->addDeferredFinishDeref(this, refType);
+ }
+
+ // Once AudioContext::uninitialize() is called there's no more chances for deleteMarkedNodes() to get called, so we call here.
+ // We can't call in AudioContext::~AudioContext() since it will never be called as long as any AudioNode is alive
+ // because AudioNodes keep a reference to the context.
+ if (context()->isAudioThreadFinished())
+ context()->deleteMarkedNodes();
+}
+
+void AudioNode::finishDeref(RefType refType)
+{
+ ASSERT(context()->isGraphOwner());
+
+ switch (refType) {
+ case RefTypeNormal:
+ ASSERT(m_normalRefCount > 0);
+ atomicDecrement(&m_normalRefCount);
+ break;
+ case RefTypeConnection:
+ ASSERT(m_connectionRefCount > 0);
+ atomicDecrement(&m_connectionRefCount);
+ break;
+ case RefTypeDisabled:
+ ASSERT(m_disabledRefCount > 0);
+ atomicDecrement(&m_disabledRefCount);
+ break;
+ default:
+ ASSERT_NOT_REACHED();
+ }
+
+#if DEBUG_AUDIONODE_REFERENCES
+ printf("%p: %d: AudioNode::deref(%d) %d %d %d\n", this, type(), refType, m_normalRefCount, m_connectionRefCount, m_disabledRefCount);
+#endif
+
+ if (!m_connectionRefCount) {
+ if (!m_normalRefCount && !m_disabledRefCount) {
+ if (!m_isMarkedForDeletion) {
+ // All references are gone - we need to go away.
+ for (unsigned i = 0; i < m_outputs.size(); ++i)
+ output(i)->disconnectAllInputs(); // this will deref() nodes we're connected to...
+
+ // Mark for deletion at end of each render quantum or when context shuts down.
+ context()->markForDeletion(this);
+ m_isMarkedForDeletion = true;
+ }
+ } else if (refType == RefTypeConnection) {
+ if (!m_isDisabled) {
+ // Still may have JavaScript references, but no more "active" connection references, so put all of our outputs in a "dormant" disabled state.
+ // Garbage collection may take a very long time after this time, so the "dormant" disabled nodes should not bog down the rendering...
+
+ // As far as JavaScript is concerned, our outputs must still appear to be connected.
+ // But internally our outputs should be disabled from the inputs they're connected to.
+ // disable() can recursively deref connections (and call disable()) down a whole chain of connected nodes.
+
+ // FIXME: we special case the convolver and delay since they have a significant tail-time and shouldn't be disconnected simply
+ // because they no longer have any input connections. This needs to be handled more generally where AudioNodes have
+ // a tailTime attribute. Then the AudioNode only needs to remain "active" for tailTime seconds after there are no
+ // longer any active connections.
+ if (type() != NodeTypeConvolver && type() != NodeTypeDelay) {
+ m_isDisabled = true;
+ for (unsigned i = 0; i < m_outputs.size(); ++i)
+ output(i)->disable();
+ }
+ }
+ }
+ }
+}
+
+#if DEBUG_AUDIONODE_REFERENCES
+
+bool AudioNode::s_isNodeCountInitialized = false;
+int AudioNode::s_nodeCount[NodeTypeEnd];
+
+void AudioNode::printNodeCounts()
+{
+ printf("\n\n");
+ printf("===========================\n");
+ printf("AudioNode: reference counts\n");
+ printf("===========================\n");
+
+ for (unsigned i = 0; i < NodeTypeEnd; ++i)
+ printf("%d: %d\n", i, s_nodeCount[i]);
+
+ printf("===========================\n\n\n");
+}
+
+#endif // DEBUG_AUDIONODE_REFERENCES
+
+} // namespace WebCore
+
+#endif // ENABLE(WEB_AUDIO)
diff --git a/WebCore/webaudio/AudioNode.h b/WebCore/webaudio/AudioNode.h
new file mode 100644
index 0000000..b697457
--- /dev/null
+++ b/WebCore/webaudio/AudioNode.h
@@ -0,0 +1,174 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef AudioNode_h
+#define AudioNode_h
+
+#include <wtf/OwnPtr.h>
+#include <wtf/PassOwnPtr.h>
+#include <wtf/RefPtr.h>
+#include <wtf/Vector.h>
+
+#define DEBUG_AUDIONODE_REFERENCES 0
+
+namespace WebCore {
+
+class AudioContext;
+class AudioNodeInput;
+class AudioNodeOutput;
+
+// An AudioNode is the basic building block for handling audio within an AudioContext.
+// It may be an audio source, an intermediate processing module, or an audio destination.
+// Each AudioNode can have inputs and/or outputs. An AudioSourceNode has no inputs and a single output.
+// An AudioDestinationNode has one input and no outputs and represents the final destination to the audio hardware.
+// Most processing nodes such as filters will have one input and one output, although multiple inputs and outputs are possible.
+
+class AudioNode {
+public:
+ enum { ProcessingSizeInFrames = 128 };
+
+ AudioNode(AudioContext*, double sampleRate);
+ virtual ~AudioNode();
+
+ AudioContext* context() { return m_context.get(); }
+
+ enum NodeType {
+ NodeTypeUnknown,
+ NodeTypeDestination,
+ NodeTypeAudioBufferSource,
+ NodeTypeJavaScript,
+ NodeTypeLowPass2Filter,
+ NodeTypeHighPass2Filter,
+ NodeTypePanner,
+ NodeTypeConvolver,
+ NodeTypeDelay,
+ NodeTypeGain,
+ NodeTypeChannelSplitter,
+ NodeTypeChannelMerger,
+ NodeTypeAnalyser,
+ NodeTypeEnd
+ };
+
+ NodeType type() const { return m_type; }
+ void setType(NodeType);
+
+ // We handle our own ref-counting because of the threading issues and subtle nature of
+ // how AudioNodes can continue processing (playing one-shot sound) after there are no more
+ // JavaScript references to the object.
+ enum RefType { RefTypeNormal, RefTypeConnection, RefTypeDisabled };
+
+ // Can be called from main thread or context's audio thread.
+ void ref(RefType refType = RefTypeNormal);
+ void deref(RefType refType = RefTypeNormal);
+
+ // Can be called from main thread or context's audio thread. It must be called while the context's graph lock is held.
+ void finishDeref(RefType refType);
+
+ // The AudioNodeInput(s) (if any) will already have their input data available when process() is called.
+ // Subclasses will take this input data and put the results in the AudioBus(s) of its AudioNodeOutput(s) (if any).
+ // Called from context's audio thread.
+ virtual void process(size_t framesToProcess) = 0;
+
+ // Resets DSP processing state (clears delay lines, filter memory, etc.)
+ // Called from context's audio thread.
+ virtual void reset() = 0;
+
+ // No significant resources should be allocated until initialize() is called.
+ // Processing may not occur until a node is initialized.
+ virtual void initialize() = 0;
+ virtual void uninitialize() = 0;
+
+ bool isInitialized() const { return m_isInitialized; }
+ void lazyInitialize();
+
+ unsigned numberOfInputs() const { return m_inputs.size(); }
+ unsigned numberOfOutputs() const { return m_outputs.size(); }
+
+ AudioNodeInput* input(unsigned);
+ AudioNodeOutput* output(unsigned);
+
+ // connect() / disconnect() return true on success.
+ // Called from main thread by corresponding JavaScript methods.
+ bool connect(AudioNode* destination, unsigned outputIndex = 0, unsigned inputIndex = 0);
+ bool disconnect(unsigned outputIndex = 0);
+
+ double sampleRate() const { return m_sampleRate; }
+
+ // processIfNecessary() is called by our output(s) when the rendering graph needs this AudioNode to process.
+ // This method ensures that the AudioNode will only process once per rendering time quantum even if it's called repeatedly.
+ // This handles the case of "fanout" where an output is connected to multiple AudioNode inputs.
+ // Called from context's audio thread.
+ void processIfNecessary(size_t framesToProcess);
+
+ // Called when a new connection has been made to one of our inputs or the connection number of channels has changed.
+ // This potentially gives us enough information to perform a lazy initialization or, if necessary, a re-initialization.
+ // Called from main thread.
+ virtual void checkNumberOfChannelsForInput(AudioNodeInput*) { }
+
+#if DEBUG_AUDIONODE_REFERENCES
+ static void printNodeCounts();
+#endif
+
+protected:
+ // Inputs and outputs must be created before the AudioNode is initialized.
+ void addInput(PassOwnPtr<AudioNodeInput>);
+ void addOutput(PassOwnPtr<AudioNodeOutput>);
+
+ // Called by processIfNecessary() to cause all parts of the rendering graph connected to us to process.
+ // Each rendering quantum, the audio data for each of the AudioNode's inputs will be available after this method is called.
+ // Called from context's audio thread.
+ virtual void pullInputs(size_t framesToProcess);
+
+ bool m_isInitialized;
+
+private:
+ NodeType m_type;
+ RefPtr<AudioContext> m_context;
+ double m_sampleRate;
+ Vector<OwnPtr<AudioNodeInput> > m_inputs;
+ Vector<OwnPtr<AudioNodeOutput> > m_outputs;
+
+ double m_lastProcessingTime;
+
+ // Ref-counting
+ volatile int m_normalRefCount;
+ volatile int m_connectionRefCount;
+ volatile int m_disabledRefCount;
+
+ bool m_isMarkedForDeletion;
+ bool m_isDisabled;
+
+#if DEBUG_AUDIONODE_REFERENCES
+ static bool s_isNodeCountInitialized;
+ static int s_nodeCount[NodeTypeEnd];
+#endif
+};
+
+} // namespace WebCore
+
+#endif // AudioNode_h
diff --git a/WebCore/webaudio/AudioNode.idl b/WebCore/webaudio/AudioNode.idl
new file mode 100644
index 0000000..5ed47cb
--- /dev/null
+++ b/WebCore/webaudio/AudioNode.idl
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+module audio {
+ interface [
+ Conditional=WEB_AUDIO
+ ] AudioNode {
+ readonly attribute AudioContext context;
+ readonly attribute unsigned long numberOfInputs;
+ readonly attribute unsigned long numberOfOutputs;
+
+ [Custom] void connect(in AudioNode destination, in unsigned long output, in unsigned long input);
+ [Custom] void disconnect(in unsigned long output);
+ };
+}
diff --git a/WebCore/webaudio/AudioParam.h b/WebCore/webaudio/AudioParam.h
index 2fbd805..7643cf3 100644
--- a/WebCore/webaudio/AudioParam.h
+++ b/WebCore/webaudio/AudioParam.h
@@ -60,7 +60,14 @@ public:
}
float value() const { return static_cast<float>(m_value); }
- void setValue(float value) { m_value = value; }
+
+ void setValue(float value)
+ {
+ // Check against JavaScript giving us bogus floating-point values.
+ // Don't ASSERT, since this can happen if somebody writes bad JS.
+ if (!isnan(value) && !isinf(value))
+ m_value = value;
+ }
String name() const { return m_name; }
diff --git a/WebCore/wml/WMLElement.cpp b/WebCore/wml/WMLElement.cpp
index 5c8a94c..9b0be47 100644
--- a/WebCore/wml/WMLElement.cpp
+++ b/WebCore/wml/WMLElement.cpp
@@ -26,6 +26,7 @@
#include "Attribute.h"
#include "CSSPropertyNames.h"
#include "HTMLNames.h"
+#include "HTMLParserIdioms.h"
#include "RenderObject.h"
#include "WMLErrorHandling.h"
#include "WMLNames.h"
@@ -73,7 +74,7 @@ void WMLElement::parseMappedAttribute(Attribute* attr)
} else if (attr->name() == HTMLNames::tabindexAttr) {
String indexstring = attr->value();
int tabindex = 0;
- if (parseHTMLInteger(tabindex)) {
+ if (parseHTMLInteger(indexstring, tabindex)) {
// Clamp tabindex to the range of 'short' to match Firefox's behavior.
setTabIndexExplicitly(max(static_cast<int>(std::numeric_limits<short>::min()), min(tabindex, static_cast<int>(std::numeric_limits<short>::max()))));
}
diff --git a/WebCore/workers/WorkerContext.cpp b/WebCore/workers/WorkerContext.cpp
index b52b285..6cee246 100644
--- a/WebCore/workers/WorkerContext.cpp
+++ b/WebCore/workers/WorkerContext.cpp
@@ -63,6 +63,16 @@
#include "NotificationCenter.h"
#endif
+#if ENABLE(FILE_SYSTEM)
+#include "AsyncFileSystem.h"
+#include "DOMFileSystem.h"
+#include "ErrorCallback.h"
+#include "FileError.h"
+#include "FileSystemCallback.h"
+#include "FileSystemCallbacks.h"
+#include "LocalFileSystem.h"
+#endif
+
namespace WebCore {
class CloseWorkerContextTask : public ScriptExecutionContext::Task {
@@ -100,6 +110,10 @@ WorkerContext::~WorkerContext()
#if ENABLE(NOTIFICATIONS)
m_notifications.clear();
#endif
+
+ // Make sure we have no observers.
+ notifyObserversOfStop();
+
// Notify proxy that we are going away. This can free the WorkerThread object, so do not access it after this.
thread()->workerReportingProxy().workerContextDestroyed();
}
@@ -335,6 +349,74 @@ void WorkerContext::revokeBlobURL(const String& blobURLString)
}
#endif
+#if ENABLE(FILE_SYSTEM)
+void WorkerContext::requestFileSystem(int type, long long size, PassRefPtr<FileSystemCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback)
+{
+ if (!AsyncFileSystem::isAvailable() || !securityOrigin()->canAccessFileSystem()) {
+ DOMFileSystem::scheduleCallback(this, errorCallback, FileError::create(SECURITY_ERR));
+ return;
+ }
+
+ AsyncFileSystem::Type fileSystemType = static_cast<AsyncFileSystem::Type>(type);
+ if (fileSystemType != AsyncFileSystem::Temporary && fileSystemType != AsyncFileSystem::Persistent) {
+ DOMFileSystem::scheduleCallback(this, errorCallback, FileError::create(INVALID_MODIFICATION_ERR));
+ return;
+ }
+
+ LocalFileSystem::localFileSystem().requestFileSystem(this, fileSystemType, size, FileSystemCallbacks::create(successCallback, errorCallback, this));
+}
+
+COMPILE_ASSERT(static_cast<int>(WorkerContext::TEMPORARY) == static_cast<int>(AsyncFileSystem::Temporary), enum_mismatch);
+COMPILE_ASSERT(static_cast<int>(WorkerContext::PERSISTENT) == static_cast<int>(AsyncFileSystem::Persistent), enum_mismatch);
+#endif
+
+WorkerContext::Observer::Observer(WorkerContext* context)
+ : m_context(context)
+{
+ ASSERT(m_context && m_context->isContextThread());
+ m_context->registerObserver(this);
+}
+
+WorkerContext::Observer::~Observer()
+{
+ if (!m_context)
+ return;
+ ASSERT(m_context->isContextThread());
+ m_context->unregisterObserver(this);
+}
+
+void WorkerContext::Observer::stopObserving()
+{
+ if (!m_context)
+ return;
+ ASSERT(m_context->isContextThread());
+ m_context->unregisterObserver(this);
+ m_context = 0;
+}
+
+void WorkerContext::registerObserver(Observer* observer)
+{
+ ASSERT(observer);
+ m_workerObservers.add(observer);
+}
+
+void WorkerContext::unregisterObserver(Observer* observer)
+{
+ ASSERT(observer);
+ m_workerObservers.remove(observer);
+}
+
+void WorkerContext::notifyObserversOfStop()
+{
+ HashSet<Observer*>::iterator iter = m_workerObservers.begin();
+ while (iter != m_workerObservers.end()) {
+ WorkerContext::Observer* observer = *iter;
+ observer->stopObserving();
+ observer->notifyStop();
+ iter = m_workerObservers.begin();
+ }
+}
+
} // namespace WebCore
#endif // ENABLE(WORKERS)
diff --git a/WebCore/workers/WorkerContext.h b/WebCore/workers/WorkerContext.h
index 7fb8b46..4128a56 100644
--- a/WebCore/workers/WorkerContext.h
+++ b/WebCore/workers/WorkerContext.h
@@ -35,6 +35,7 @@
#include "ScriptExecutionContext.h"
#include "WorkerScriptController.h"
#include <wtf/Assertions.h>
+#include <wtf/HashMap.h>
#include <wtf/OwnPtr.h>
#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
@@ -47,6 +48,8 @@ namespace WebCore {
class Database;
class DatabaseCallback;
class DatabaseSync;
+ class ErrorCallback;
+ class FileSystemCallback;
class NotificationCenter;
class ScheduledAction;
class WorkerLocation;
@@ -121,6 +124,14 @@ namespace WebCore {
void revokeBlobURL(const String&);
#endif
+#if ENABLE(FILE_SYSTEM)
+ enum FileSystemType {
+ TEMPORARY,
+ PERSISTENT,
+ };
+ void requestFileSystem(int type, long long size, PassRefPtr<FileSystemCallback>, PassRefPtr<ErrorCallback>);
+#endif
+
// These methods are used for GC marking. See JSWorkerContext::markChildren(MarkStack&) in
// JSWorkerContextCustom.cpp.
WorkerNavigator* optionalNavigator() const { return m_navigator.get(); }
@@ -131,6 +142,21 @@ namespace WebCore {
bool isClosing() { return m_closing; }
+ // An observer interface to be notified when the worker thread is getting stopped.
+ class Observer : public Noncopyable {
+ public:
+ Observer(WorkerContext*);
+ virtual ~Observer();
+ virtual void notifyStop() = 0;
+ void stopObserving();
+ private:
+ WorkerContext* m_context;
+ };
+ friend class Observer;
+ void registerObserver(Observer*);
+ void unregisterObserver(Observer*);
+ void notifyObserversOfStop();
+
protected:
WorkerContext(const KURL&, const String&, WorkerThread*);
@@ -161,6 +187,8 @@ namespace WebCore {
bool m_closing;
bool m_reportingException;
EventTargetData m_eventTargetData;
+
+ HashSet<Observer*> m_workerObservers;
};
} // namespace WebCore
diff --git a/WebCore/workers/WorkerContext.idl b/WebCore/workers/WorkerContext.idl
index 02aa4ad..3e185c0 100644
--- a/WebCore/workers/WorkerContext.idl
+++ b/WebCore/workers/WorkerContext.idl
@@ -104,6 +104,14 @@ module threads {
DOMString createBlobURL(in Blob blob);
void revokeBlobURL(in DOMString blobURL);
#endif
+
+#if defined(ENABLE_FILE_SYSTEM) && ENABLE_FILE_SYSTEM
+ const unsigned short TEMPORARY = 0;
+ const unsigned short PERSISTENT = 1;
+ [EnabledAtRuntime] void requestFileSystem(in unsigned short type, in long long size, in [Callback, Optional] FileSystemCallback successCallback, in [Callback, Optional] ErrorCallback errorCallback);
+
+ attribute [EnabledAtRuntime=FileSystem] FlagsConstructor Flags;
+#endif
};
}
diff --git a/WebCore/workers/WorkerThread.cpp b/WebCore/workers/WorkerThread.cpp
index d6a1e05..f61120e 100644
--- a/WebCore/workers/WorkerThread.cpp
+++ b/WebCore/workers/WorkerThread.cpp
@@ -202,6 +202,8 @@ public:
workerContext->stopActiveDOMObjects();
+ workerContext->notifyObserversOfStop();
+
// Event listeners would keep DOMWrapperWorld objects alive for too long. Also, they have references to JS objects,
// which become dangling once Heap is destroyed.
workerContext->removeAllEventListeners();
diff --git a/WebCore/xml/XMLHttpRequest.cpp b/WebCore/xml/XMLHttpRequest.cpp
index 9c7d076..07a816d 100644
--- a/WebCore/xml/XMLHttpRequest.cpp
+++ b/WebCore/xml/XMLHttpRequest.cpp
@@ -115,7 +115,7 @@ static bool isValidToken(const String& name)
return false;
}
- return true;
+ return length > 0;
}
static bool isValidHeaderValue(const String& name)
diff --git a/WebCore/xml/XMLHttpRequest.h b/WebCore/xml/XMLHttpRequest.h
index ac18828..481b51f 100644
--- a/WebCore/xml/XMLHttpRequest.h
+++ b/WebCore/xml/XMLHttpRequest.h
@@ -65,6 +65,7 @@ public:
virtual ScriptExecutionContext* scriptExecutionContext() const;
+ const KURL& url() const { return m_url; }
String statusText(ExceptionCode&) const;
int status(ExceptionCode&) const;
State readyState() const;
diff --git a/WebKit/CMakeLists.txt b/WebKit/CMakeLists.txt
index 6bc5100..7de8686 100644
--- a/WebKit/CMakeLists.txt
+++ b/WebKit/CMakeLists.txt
@@ -1,6 +1,7 @@
SET(WebKit_INCLUDE_DIRECTORIES
"${WEBKIT_DIR}"
"${WEBCORE_DIR}"
+ "${WEBCORE_DIR}/accessibility"
"${WEBCORE_DIR}/bindings/js"
"${WEBCORE_DIR}/bindings"
"${WEBCORE_DIR}/bridge"
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index c6da648..0126336 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,20 @@
+2010-09-22 Lucas De Marchi <lucas.demarchi@profusion.mobi>
+
+ Unreviewed, EFL build fix.
+
+ * CMakeLists.txt:
+
+2010-09-20 Philippe Normand <pnormand@igalia.com>
+
+ Reviewed by Eric Carlson.
+
+ [GTK] enhanced context menu for media elements
+ https://bugs.webkit.org/show_bug.cgi?id=45021
+
+ Updated localizable strings.
+
+ * English.lproj/Localizable.strings:
+
2010-09-17 David Kilzer <ddkilzer@apple.com>
<http://webkit.org/b/45989> Add WebArchiveInternal.h to Xcode project
diff --git a/WebKit/English.lproj/Localizable.strings b/WebKit/English.lproj/Localizable.strings
index 615dc9a..3d09f86 100644
--- a/WebKit/English.lproj/Localizable.strings
+++ b/WebKit/English.lproj/Localizable.strings
Binary files differ
diff --git a/WebKit/chromium/ChangeLog b/WebKit/chromium/ChangeLog
index dd23f6f..a28517a 100644
--- a/WebKit/chromium/ChangeLog
+++ b/WebKit/chromium/ChangeLog
@@ -1,3 +1,820 @@
+2010-09-28 Vangelis Kokkevis <vangelis@chromium.org>
+
+ Reviewed by Kenneth Russell.
+
+ [chromium] Keep the accelerated compositor around even after a page is
+ done using it to avoid startup costs in pages that frequently switch
+ the compositor on and off.
+ https://bugs.webkit.org/show_bug.cgi?id=45845
+
+ * src/WebViewImpl.cpp:
+ (WebKit::WebViewImpl::setIsAcceleratedCompositingActive):
+
+2010-09-28 Nat Duca <nduca@chromium.org>
+
+ Reviewed by James Robinson.
+
+ [chromium] invalidateRootLayerRect needs to schedule compositor
+ https://bugs.webkit.org/show_bug.cgi?id=46219
+
+ Make sure setRootLayerNedsDisplay is called by root invalidation.
+ To avoid confusion about root-layer versus non-root-layer
+ behavior, move the root layer damage state to the WebView.
+
+ * src/WebViewImpl.cpp:
+ (WebKit::WebViewImpl::setRootLayerNeedsDisplay):
+ (WebKit::WebViewImpl::scrollRootLayerRect):
+ (WebKit::WebViewImpl::invalidateRootLayerRect):
+ (WebKit::WebViewImpl::doComposite):
+ * src/WebViewImpl.h:
+
+2010-09-28 Jenn Braithwaite <jennb@chromium.org>
+
+ Reviewed by Dmitry Titov.
+
+ Added oldPage param to FrameLoaderClient::didTransferChildFrameToNewDocument.
+ https://bugs.webkit.org/show_bug.cgi?id=46663
+
+ * src/FrameLoaderClientImpl.cpp:
+ (WebKit::FrameLoaderClientImpl::didTransferChildFrameToNewDocument):
+ * src/FrameLoaderClientImpl.h:
+
+2010-09-28 Andrei Popescu <andreip@google.com>
+
+ Reviewed by Jeremy Orlow.
+
+ [Chromium] Linking error due to wrong guard in WebIDBTransaction.h
+ https://bugs.webkit.org/show_bug.cgi?id=46710
+
+ Remove the wrong guard.
+
+ * public/WebIDBTransaction.h:
+ (WebKit::WebIDBTransaction::getIDBTransactionBackendInterface):
+
+2010-09-27 Alpha Lam <hclam@chromium.org>
+
+ Build fix. Not reviewed.
+
+ Use if instead of switch to avoid compilation error.
+
+ * src/VideoFrameChromiumImpl.cpp:
+ (WebKit::VideoFrameChromiumImpl::requiredTextureSize):
+
+2010-09-27 Alpha Lam <hclam@chromium.org>
+
+ Build fix. Not reviewed.
+
+ Remove constant definitions from this file.
+
+ * src/VideoFrameChromiumImpl.cpp:
+
+2010-09-27 Alpha Lam <hclam@chromium.org>
+
+ Build fix. Not reviewed.
+
+ Fix warnings again.
+
+ * src/VideoFrameChromiumImpl.cpp:
+ (WebKit::VideoFrameChromiumImpl::requiredTextureSize):
+
+2010-09-27 Alpha Lam <hclam@chromium.org>
+
+ Build fix. Not reviewed.
+
+ Add a default for unhandled cases for switch statement.
+
+ * src/VideoFrameChromiumImpl.cpp:
+ (WebKit::VideoFrameChromiumImpl::requiredTextureSize):
+
+2010-09-27 Victoria Kirst <vrk@google.com>
+
+ Reviewed by James Robinson.
+
+ Fixing constants in VideoFrameChromiumImpl so that it overloads the
+ VideoFrameChromium const declarations. Also adding logic such that a
+ VideoFrameChromium understands what size its texture should be based
+ on frame format.
+ https://bugs.webkit.org/show_bug.cgi?id=45069
+
+ * src/VideoFrameChromiumImpl.cpp:
+
+2010-09-27 Vangelis Kokkevis <vangelis@chromium.org>
+
+ Reviewed by James Robinson.
+
+ [chromium] WebViewImpl now holds a ref counted pointer to the LayerRendererChromium
+ to ensure that the compositor does not get destroyed before the layers used
+ by it do. This was done to ensure that layers properly clean up their texture
+ resources on destruction.
+ https://bugs.webkit.org/show_bug.cgi?id=46139
+
+ * src/WebViewImpl.cpp:
+ (WebKit::WebViewImpl::setIsAcceleratedCompositingActive):
+ * src/WebViewImpl.h:
+
+2010-09-24 Zhenyao Mo <zmo@google.com>
+
+ Reviewed by Kenneth Russell.
+
+ Hook up ANGLE with chromium --in-process-webgl port
+ https://bugs.webkit.org/show_bug.cgi?id=44309
+
+ * WebKit.gyp: Add angle dependency.
+ * src/WebGraphicsContext3DDefaultImpl.cpp: Using angle for shader validation and translation.
+ (WebKit::WebGraphicsContext3DDefaultImpl::WebGraphicsContext3DDefaultImpl):
+ (WebKit::WebGraphicsContext3DDefaultImpl::~WebGraphicsContext3DDefaultImpl):
+ (WebKit::WebGraphicsContext3DDefaultImpl::initialize):
+ (WebKit::WebGraphicsContext3DDefaultImpl::compileShader):
+ (WebKit::WebGraphicsContext3DDefaultImpl::getIntegerv): Using defined const instead.
+ (WebKit::WebGraphicsContext3DDefaultImpl::getShaderiv):
+ (WebKit::WebGraphicsContext3DDefaultImpl::getShaderInfoLog):
+ (WebKit::WebGraphicsContext3DDefaultImpl::getShaderSource):
+ (WebKit::WebGraphicsContext3DDefaultImpl::shaderSource):
+ (WebKit::WebGraphicsContext3DDefaultImpl::createShader):
+ (WebKit::WebGraphicsContext3DDefaultImpl::deleteShader):
+ (WebKit::WebGraphicsContext3DDefaultImpl::angleCreateCompilers):
+ (WebKit::WebGraphicsContext3DDefaultImpl::angleDestroyCompilers):
+ (WebKit::WebGraphicsContext3DDefaultImpl::angleValidateShaderSource):
+ * src/WebGraphicsContext3DDefaultImpl.h: Add necessary data and functions for angle stuff.
+ (WebKit::WebGraphicsContext3DDefaultImpl::ShaderSourceEntry::ShaderSourceEntry):
+ (WebKit::WebGraphicsContext3DDefaultImpl::ShaderSourceEntry::~ShaderSourceEntry):
+
+2010-09-27 Kinuko Yasuda <kinuko@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ [Cleanup] Add create method to FileSystemCallbacks to get rid of naked new's
+ https://bugs.webkit.org/show_bug.cgi?id=46561
+
+ Also cleanup the callbacks layering to pass AsyncFileSystemCallbacks
+ object to LocalFileSystem::requestFileSystem (rather than
+ FileSystemCallback and ErrorCallback) so that all the callbacks class
+ we pass from WebCore to WebKit/chromium/src will be
+ AsyncFileSystemCallbacks.
+
+ * src/LocalFileSystemChromium.cpp:
+ (WebCore::LocalFileSystem::requestFileSystem): Changed to take
+ AsyncFileSystemCallbacks as (a) callback argument(s).
+
+2010-09-24 Tony Chang <tony@chromium.org>
+
+ Reviewed by Kent Tamura.
+
+ [chromium] remove unused gtk WebScreenInfoFactory
+ https://bugs.webkit.org/show_bug.cgi?id=46526
+
+ AFAICT these files aren't referenced in code or by gyp.
+
+ * WebKit.gyp: Remove duplicate filename.
+ * public/gtk/WebScreenInfoFactory.h: Removed.
+ * src/gtk/WebScreenInfoFactory.cpp: Removed.
+
+2010-09-26 Mihai Parparita <mihaip@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ [Chromium] Remove no longer used WebView member functions
+ https://bugs.webkit.org/show_bug.cgi?id=46515
+
+ With http://crrev.com/60526 there's no longer any Chromium code calling
+ the non-static versions of addUserScript and addUserStyleSheet.
+
+ * public/WebView.h:
+
+2010-09-25 Nicolas Weber <thakis@chromium.org>
+
+ Reviewed by James Robinson.
+
+ [chromium] Fix clang warning/error.
+ https://bugs.webkit.org/show_bug.cgi?id=46552
+
+ * src/WorkerFileSystemCallbacksBridge.h:
+
+2010-09-24 Mihai Parparita <mihaip@chromium.org>
+
+ Reviewed by Darin Fisher.
+
+ [Chromium] Unnecessary blob dependency in WebKit.gyp
+ https://bugs.webkit.org/show_bug.cgi?id=46488
+
+ r66322 shouldn't have added a blob dependency by hand to targets in
+ WebKit.gyp, instead blob should be a dependency of webkit_support.
+ http://crrev.com/59406 did that, so we can now remove these deps.
+
+ * WebKit.gyp:
+
+2010-09-24 Ryosuke Niwa <rniwa@webkit.org>
+
+ Reviewed by Tony Chang.
+
+ [chromium] Implement TextInputController::firstRectForCharacterRange
+ https://bugs.webkit.org/show_bug.cgi?id=38100
+
+ Implemented TextInputController::firstRectForCharacterRange for chromium platform.
+ Because the function needs to return an array of integers, added makeIntArray to WebBindings.
+ makeIntArray does not take Vector because WebBindings.h is included in plugin glue code
+ where it cannot find wtf/Vector.h.
+
+ No new tests are added since we need to implement the same feature in chromium side
+ in order to enable any tests that uses this function.
+
+ * public/WebBindings.h:
+ * public/WebFrame.h:
+ * src/WebBindings.cpp:
+ (WebKit::makeIntArrayImpl): Added.
+ (WebKit::WebBindings::makeIntArray): Added.
+ * src/WebFrameImpl.cpp:
+ (WebKit::WebFrameImpl::firstRectForCharacterRange): Added.
+ * src/WebFrameImpl.h:
+
+2010-09-24 Tony Chang <tony@chromium.org>
+
+ Unreviewed, fix chromium compile after r68276 which renamed
+ Render*::minPrefWidth to minPreferredLogicalWidth.
+
+ * src/WebFrameImpl.cpp:
+ (WebKit::WebFrameImpl::contentsPreferredWidth):
+
+2010-09-24 Eric Uhrhane <ericu@chromium.org>
+
+ Reviewed by David Levin.
+
+ Remove unnecessary parameter from AsyncFileWriterClient::didTruncate
+ https://bugs.webkit.org/show_bug.cgi?id=46390
+
+ * public/WebFileWriterClient.h:
+ * src/AsyncFileWriterChromium.cpp:
+ * src/AsyncFileWriterChromium.h:
+
+2010-09-24 Chris Guillory <chris.guillory@google.com>
+
+ Reviewed by Chris Fleizach.
+
+ Send webkit accessibility notifications to Chromium.
+ https://bugs.webkit.org/show_bug.cgi?id=45156
+
+ * public/WebAccessibilityCache.h:
+ * public/WebViewClient.h:
+ * src/ChromeClientImpl.cpp:
+ (WebKit::ChromeClientImpl::focusedNodeChanged):
+ (WebKit::ChromeClientImpl::getPopupMenuInfo):
+ * src/ChromeClientImpl.h:
+ * src/WebAccessibilityCache.cpp:
+ (WebKit::WebAccessibilityCache::accessibilityEnabled):
+
+2010-09-23 Kent Tamura <tkent@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ [Chromium] Fix some IndexedDB tests for DRT
+ https://bugs.webkit.org/show_bug.cgi?id=46444
+
+ * DEPS: Roll Chromium revision to 60394, which added
+ WebKitClient::createIDBKeysFromSerializedValuesAndKeyPath() implementation.
+
+2010-09-23 Kinuko Yasuda <kinuko@chromium.org>
+
+ Unreviewed, another attempt to fix build. The code didn't have proper if-defs.
+
+ * src/WebWorkerBase.cpp:
+ (WebKit::WebWorkerBase::openFileSystem):
+ * src/WebWorkerBase.h:
+ * src/WorkerFileSystemCallbacksBridge.h:
+
+2010-09-23 Kinuko Yasuda <kinuko@chromium.org>
+
+ Unreviewed; build fix attempt.
+
+ * src/WebWorkerBase.cpp:
+ (WebKit::WebWorkerBase::openFileSystem):
+ * src/WorkerFileSystemCallbacksBridge.h:
+
+2010-09-23 Kinuko Yasuda <kinuko@chromium.org>
+
+ Reviewed by David Levin.
+
+ Add Worker support for FileSystem API
+ https://bugs.webkit.org/show_bug.cgi?id=45808
+
+ Added WebWorkerBase::openFileSystem and WebCommonWorkerClient::
+ openFileSystem to call in to the browser via Worker stub/proxy
+ in the chromium.
+
+ Also added WorkerFileSystemCallbacksBridge class that proxies
+ requests and callbacks between from/to worker thread to/from the
+ main thread.
+
+ * public/WebCommonWorkerClient.h:
+ (WebKit::WebCommonWorkerClient::openFileSystem): Added.
+ * src/LocalFileSystemChromium.cpp:
+ (WebCore::LocalFileSystem::localFileSystem): Added.
+ (WebCore::LocalFileSystem::requestFileSystem): Added implementation
+ for workers. In worker case this calls WebWorkerBase::openFileSystem.
+ * src/WebWorkerBase.cpp:
+ (WebKit::WebWorkerBase::openFileSystem): Added. This is called from
+ LocalFileSystem::requestFileSystem on the worker thread and creates
+ a bridge to call WebCommonWorkerClient::openFileSystem on the main
+ thread.
+ * src/WebWorkerBase.h:
+ * src/WebWorkerClientImpl.h:
+ (WebKit::WebWorkerClientImpl::openFileSystem): Added.
+ * src/WorkerFileSystemCallbacksBridge.cpp: Added.
+ * src/WorkerFileSystemCallbacksBridge.h: Added.
+
+2010-09-23 Tony Chang <tony@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ [chromium] implement layoutTestController.sampleSVGAnimationForElementAtTime
+ https://bugs.webkit.org/show_bug.cgi?id=46426
+
+ * public/WebFrame.h:
+ * src/WebFrameImpl.cpp:
+ (WebKit::WebFrameImpl::pauseSVGAnimation):
+ * src/WebFrameImpl.h:
+
+2010-09-23 Tony Chang <tony@chromium.org>
+
+ Reviewed by David Levin.
+
+ [chromium] add caretBrowsingEnabled to WebSettings and DRT
+ https://bugs.webkit.org/show_bug.cgi?id=46388
+
+ * public/WebSettings.h:
+ * src/WebSettingsImpl.cpp:
+ (WebKit::WebSettingsImpl::setCaretBrowsingEnabled):
+ * src/WebSettingsImpl.h:
+
+2010-09-23 Eric Uhrhane <ericu@chromium.org>
+
+ Reviewed by David Levin.
+
+ Rename FileWriterClient to AsyncFileWriterClient.
+ https://bugs.webkit.org/show_bug.cgi?id=46325
+
+ * src/AsyncFileSystemChromium.cpp:
+ * src/AsyncFileSystemChromium.h:
+ * src/AsyncFileWriterChromium.cpp:
+ * src/AsyncFileWriterChromium.h:
+
+2010-09-23 Nate Chapin <japhet@chromium.org>
+
+ Reviewed by Darin Fisher.
+
+ Add hyperlink auditing settings (i.e., <a ping>).
+ https://bugs.webkit.org/show_bug.cgi?id=30458
+
+ * public/WebSettings.h:
+ * src/WebSettingsImpl.cpp:
+ (WebKit::WebSettingsImpl::setHyperlinkAuditingEnabled):
+ * src/WebSettingsImpl.h:
+
+2010-09-23 Andrey Kosyakov <caseq@chromium.org>
+
+ Unreviewed build fix ("WTF/" -> "wtf/" in include, broke Arm build)
+
+ * src/AsyncFileWriterChromium.h:
+
+2010-09-08 Tony Gentilcore <tonyg@chromium.org>
+
+ Reviewed by Darin Fisher.
+
+ [chromium] Add chromium port API for accessing Web Timing information
+ https://bugs.webkit.org/show_bug.cgi?id=45428
+
+ * WebKit.gyp:
+ * public/WebFrame.h:
+ * public/WebPerformance.h: Added.
+ (WebKit::WebPerformance::WebPerformance):
+ * src/WebFrameImpl.cpp:
+ (WebKit::WebFrameImpl::performance):
+ * src/WebFrameImpl.h:
+ * src/WebPerformance.cpp: Added.
+ (WebKit::WebPerformance::WebPerformance):
+ (WebKit::WebPerformance::~WebPerformance):
+ (WebKit::WebPerformance::operator=):
+ (WebKit::WebPerformance::navigationType):
+ (WebKit::WebPerformance::navigationStart):
+ (WebKit::WebPerformance::unloadEventEnd):
+ (WebKit::WebPerformance::redirectStart):
+ (WebKit::WebPerformance::redirectEnd):
+ (WebKit::WebPerformance::redirectCount):
+ (WebKit::WebPerformance::fetchStart):
+ (WebKit::WebPerformance::domainLookupStart):
+ (WebKit::WebPerformance::domainLookupEnd):
+ (WebKit::WebPerformance::connectStart):
+ (WebKit::WebPerformance::connectEnd):
+ (WebKit::WebPerformance::requestStart):
+ (WebKit::WebPerformance::requestEnd):
+ (WebKit::WebPerformance::responseStart):
+ (WebKit::WebPerformance::responseEnd):
+ (WebKit::WebPerformance::loadEventStart):
+ (WebKit::WebPerformance::loadEventEnd):
+ (WebKit::WebPerformance::operator PassRefPtr<Performance>):
+
+2010-09-23 Andrei Popescu <andreip@google.com>
+
+ Reviewed by Jeremy Orlow.
+
+ IDBObjectStore::get should run in a transaction.
+ https://bugs.webkit.org/show_bug.cgi?id=44700
+
+ * public/WebIDBFactory.h:
+ * public/WebIDBObjectStore.h:
+ * public/WebIDBTransaction.h:
+ (WebKit::WebIDBTransaction::didCompleteTaskEvents):
+ (WebKit::WebIDBTransaction::getIDBTransactionBackendInterface):
+ * src/IDBDatabaseProxy.h:
+ * src/IDBFactoryBackendProxy.cpp:
+ * src/IDBFactoryBackendProxy.h:
+ * src/IDBObjectStoreProxy.cpp:
+ (WebCore::IDBObjectStoreProxy::get):
+ * src/IDBObjectStoreProxy.h:
+ * src/IDBTransactionBackendProxy.cpp:
+ (WebCore::IDBTransactionBackendProxy::scheduleTask):
+ (WebCore::IDBTransactionBackendProxy::didCompleteTaskEvents):
+ * src/IDBTransactionBackendProxy.h:
+ (WebCore::IDBTransactionBackendProxy::getWebIDBTransaction):
+ * src/WebIDBFactoryImpl.cpp:
+ * src/WebIDBFactoryImpl.h:
+ * src/WebIDBObjectStoreImpl.cpp:
+ (WebKit::WebIDBObjectStoreImpl::get):
+ * src/WebIDBObjectStoreImpl.h:
+ * src/WebIDBTransactionImpl.cpp:
+ (WebKit::WebIDBTransactionImpl::didCompleteTaskEvents):
+ (WebKit::WebIDBTransactionImpl::getIDBTransactionBackendInterface):
+ * src/WebIDBTransactionImpl.h:
+
+2010-09-23 Jeremy Orlow <jorlow@chromium.org>
+
+ Unreviewed small fix for my last patch.
+
+ * public/WebIDBTransaction.h:
+ (WebKit::WebIDBTransaction::id):
+
+2010-09-22 Mihai Parparita <mihaip@chromium.org>
+
+ Reviewed by Darin Fisher.
+
+ [Chromium] User style layout tests don't pass on Chromium
+ https://bugs.webkit.org/show_bug.cgi?id=46069
+
+ Expose UserStyleInjectionTime in WebView.
+
+ * public/WebView.h:
+ * src/WebViewImpl.cpp:
+ (WebKit::WebView::addUserStyleSheet):
+
+2010-09-22 James Robinson <jamesr@chromium.org>
+
+ [chromium] Re-synchronizes features.gypi with upstream feature_overrides.gypi.
+
+ * features.gypi:
+
+2010-09-22 Ruben <chromium@hybridsource.org>
+
+ Reviewed by Tony Chang.
+
+ [chromium] added ifdefs for FreeBSD support
+ https://bugs.webkit.org/show_bug.cgi?id=46316
+
+ * WebKit.gyp:
+ * features.gypi:
+ * src/ChromiumBridge.cpp:
+ * src/WebFrameImpl.cpp:
+ (WebKit::ChromePrintContext::spoolPage):
+ * src/WebViewImpl.cpp:
+ (WebKit::WebViewImpl::mouseDown):
+ (WebKit::WebViewImpl::mouseUp):
+ (WebKit::WebViewImpl::keyEvent):
+ (WebKit::WebViewImpl::setScrollbarColors):
+ (WebKit::WebViewImpl::setSelectionColors):
+
+2010-09-22 Eric Uhrhane <ericu@chromium.org>
+
+ Reviewed by Dumitru Daniliuc.
+
+ Add Chromium implementation for FileWriter
+ https://bugs.webkit.org/show_bug.cgi?id=44361
+
+ No new tests; the implementation's not yet far enough along for that.
+
+ This makes a chain of construction-and-linking-up for various sorts of
+ FileWriter interfaces to call through to Chromium, and for various
+ sorts of FileWriterClients to call back, with object ownership always
+ pointing towards the Chromium API. That is, the DOM object owns an
+ AsyncFileWriter, which owns its implementation object, and the reverse
+ (client) direction is raw pointers.
+
+ File metadata is looked up before the FileWriter is returned, so that
+ we know the file exists and can cache its length.
+
+ The WebKit/chromium interface here is modeled after that of the
+ FileSystem.
+
+ * public/WebFileInfo.h:
+ (WebKit::WebFileInfo::WebFileInfo):
+ * src/AsyncFileSystemChromium.cpp:
+ (WebCore::FileWriterHelperCallbacks::FileWriterHelperCallbacks):
+ (WebCore::FileWriterHelperCallbacks::didSucceed):
+ (WebCore::FileWriterHelperCallbacks::didReadMetadata):
+ (WebCore::FileWriterHelperCallbacks::didReadDirectory):
+ (WebCore::FileWriterHelperCallbacks::didOpenFileSystem):
+ (WebCore::FileWriterHelperCallbacks::didCreateFileWriter):
+ (WebCore::FileWriterHelperCallbacks::didFail):
+ (WebCore::AsyncFileSystemChromium::createWriter):
+ * src/AsyncFileSystemChromium.h:
+ * src/AsyncFileWriterChromium.cpp:
+ (WebCore::AsyncFileWriterChromium::setWebFileWriter):
+ (WebCore::AsyncFileWriterChromium::write):
+ (WebCore::AsyncFileWriterChromium::didFail):
+ * src/AsyncFileWriterChromium.h:
+ * src/WebFileSystemCallbacksImpl.h:
+
+2010-09-22 Kenneth Russell <kbr@google.com>
+
+ Unreviewed, Chromium build fix. Fix build when accelerated
+ compositing is not enabled at compile time.
+
+ * src/WebViewImpl.cpp:
+ (WebKit::WebViewImpl::resize):
+
+2010-09-22 Matt Perry <mpcomplete@chromium.org>
+
+ Reviewed by Darin Fisher.
+
+ Trying to reland a version of r67749:
+ Have V8DOMWindowShell ask the embedder whether to run a V8 extension
+ in a particular script context.
+ https://bugs.webkit.org/show_bug.cgi?id=45721
+
+ * public/WebFrameClient.h:
+ (WebKit::WebFrameClient::allowScriptExtension):
+ * public/WebScriptController.h:
+ * src/FrameLoaderClientImpl.cpp:
+ (WebKit::FrameLoaderClientImpl::allowScriptExtension):
+ * src/FrameLoaderClientImpl.h:
+ * src/WebScriptController.cpp:
+ (WebKit::WebScriptController::registerExtension):
+
+2010-09-22 Jeremy Orlow <jorlow@chromium.org>
+
+ Reviewed by Darin Fisher.
+
+ [Chromium] Change WebKit API for IDBTransaciton to new style
+ https://bugs.webkit.org/show_bug.cgi?id=46263
+
+ * public/WebIDBIndex.h:
+ (WebKit::WebIDBIndex::openObjectCursor):
+ (WebKit::WebIDBIndex::openCursor):
+ (WebKit::WebIDBIndex::getObject):
+ (WebKit::WebIDBIndex::get):
+ * public/WebIDBObjectStore.h:
+ (WebKit::WebIDBObjectStore::get):
+ (WebKit::WebIDBObjectStore::put):
+ (WebKit::WebIDBObjectStore::remove):
+ (WebKit::WebIDBObjectStore::openCursor):
+ * src/WebIDBIndexImpl.cpp:
+ (WebKit::WebIDBIndexImpl::openCursor):
+ (WebKit::WebIDBIndexImpl::openObjectCursor):
+ (WebKit::WebIDBIndexImpl::getObject):
+ (WebKit::WebIDBIndexImpl::get):
+ * src/WebIDBIndexImpl.h:
+ * src/WebIDBObjectStoreImpl.cpp:
+ (WebKit::WebIDBObjectStoreImpl::get):
+ (WebKit::WebIDBObjectStoreImpl::put):
+ (WebKit::WebIDBObjectStoreImpl::remove):
+ (WebKit::WebIDBObjectStoreImpl::openCursor):
+ * src/WebIDBObjectStoreImpl.h:
+
+2010-09-22 Pavel Podivilov <podivilov@chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ Web Inspector: implement pausing on XHR
+ https://bugs.webkit.org/show_bug.cgi?id=46086
+
+ * src/js/DevTools.js:
+ ():
+
+2010-09-21 Brett Wilson <brettw@chromium.org>
+
+ Reviewed by Darin Fisher.
+
+ Add caps log and num lock toggle state to WebInputEvent.
+ https://bugs.webkit.org/show_bug.cgi?id=46229
+
+ * public/WebInputEvent.h:
+ * src/WebViewImpl.cpp:
+ (WebKit::WebViewImpl::handleInputEvent):
+ * src/WebViewImpl.h:
+ * src/gtk/WebInputEventFactory.cpp:
+ (WebKit::gdkStateToWebEventModifiers):
+ * src/win/WebInputEventFactory.cpp:
+ (WebKit::SetToggleKeyState):
+ (WebKit::WebInputEventFactory::keyboardEvent):
+ (WebKit::WebInputEventFactory::mouseEvent):
+ (WebKit::WebInputEventFactory::mouseWheelEvent):
+
+2010-09-21 James Robinson <jamesr@chromium.org>
+
+ Reviewed by Kenneth Russell.
+
+ [chromium] Check if the acceleratedCompositingEnabled setting is active in WebViewImpl::graphicsContext3D()
+ https://bugs.webkit.org/show_bug.cgi?id=46239
+
+ This adds a check for whether acceleratedCompositingEnabled is true on the Page's Settings
+ object before creating and vending a GraphicsContext3D object. This is needed because when
+ an offscreen WebGraphicsContext3DCommandBufferImpl is initialized it first asks the WebViewImpl
+ for the compositor context. WebGraphicsContext3DCommandBufferImpl::initialize checks if the
+ disable accelerated compositing command line switch is set, but this is insufficient as sometimes
+ the Setting object does not agree exactly with the command line switches. For example,
+ we explicitly toggle accelerated compositing for some chrome UI URLs regardless of what the
+ flag says.
+
+ * src/WebViewImpl.cpp:
+ (WebKit::WebViewImpl::graphicsContext3D):
+
+2010-09-21 Kent Tamura <tkent@chromium.org>
+
+ Reviewed by David Levin.
+
+ [Chromium] Remove WebInputElement::InputType and inputType()
+ https://bugs.webkit.org/show_bug.cgi?id=46238
+
+ * DEPS: Roll Chromium revision to 60132, which removed all usage of inputType().
+ * public/WebInputElement.h: Remove InputType and inputType().
+ * src/AssertMatchingEnums.cpp: Remove WebInputElement::InputType -
+ HTMLInputElement::InputType matching tests.
+ * src/WebInputElement.cpp: Remove inputType().
+
+2010-09-21 Andrew Wilson <atwilson@chromium.org>
+
+ Unreviewed, rolling out r67982.
+ http://trac.webkit.org/changeset/67982
+ https://bugs.webkit.org/show_bug.cgi?id=45156
+
+ Causes crashes on chromium testshell
+
+ * public/WebAccessibilityCache.h:
+ * public/WebViewClient.h:
+ (WebKit::WebViewClient::didChangeAccessibilityObjectState):
+ (WebKit::WebViewClient::didChangeAccessibilityObjectChildren):
+ * src/ChromeClientImpl.cpp:
+ (WebKit::ChromeClientImpl::focusedNodeChanged):
+ (WebKit::ChromeClientImpl::didChangeAccessibilityObjectState):
+ (WebKit::ChromeClientImpl::didChangeAccessibilityObjectChildren):
+ * src/ChromeClientImpl.h:
+ * src/WebAccessibilityCache.cpp:
+
+2010-09-21 Kenneth Russell <kbr@google.com>
+
+ Reviewed by James Robinson.
+
+ [chromium] Remove GLES2Context and WebGLES2Context
+ https://bugs.webkit.org/show_bug.cgi?id=46131
+
+ Removed now-obsolete GLES2Context and WebGLES2Context classes, and
+ dependency on command buffer client code from WebCore. Built and
+ tested 3D CSS and WebGL content on Mac OS X to test.
+
+ * WebKit.gyp:
+ * public/WebGLES2Context.h: Removed.
+ * public/WebGraphicsContext3D.h:
+ * public/WebKitClient.h:
+ * public/WebView.h:
+ * src/ChromeClientImpl.cpp:
+ * src/GLES2Context.cpp: Removed.
+ * src/GLES2ContextInternal.cpp: Removed.
+ * src/GLES2ContextInternal.h: Removed.
+ * src/WebGraphicsContext3DDefaultImpl.cpp:
+ * src/WebGraphicsContext3DDefaultImpl.h:
+ * src/WebViewImpl.cpp:
+ * src/WebViewImpl.h:
+
+2010-09-21 Kenneth Russell <kbr@google.com>
+
+ Reviewed by James Robinson.
+
+ [chromium] Roll forward Chromium DEPS to pick up removal of WebGLES2Context dependencies
+ https://bugs.webkit.org/show_bug.cgi?id=46231
+
+ Ran build-webkit --chromium --debug on Mac OS X to test the roll-forward.
+
+ * DEPS:
+
+2010-09-21 Jeremy Orlow <jorlow@chromium.org>
+
+ Reviewed by Nate Chapin.
+
+ [Chromium] Plumb the IDBTransansaction's id
+ https://bugs.webkit.org/show_bug.cgi?id=46197
+
+ Next step, add the plumbing to Chromium. Then we add code to WebKit
+ that uses it (and take out the default IDBTransaction param).
+
+ * public/WebIDBCursor.h:
+ (WebKit::WebIDBCursor::key):
+ (WebKit::WebIDBCursor::value):
+ * public/WebIDBFactory.h:
+ (WebKit::WebIDBFactory::open):
+ * public/WebIDBIndex.h:
+ (WebKit::WebIDBIndex::openObjectCursor):
+ (WebKit::WebIDBIndex::openCursor):
+ (WebKit::WebIDBIndex::getObject):
+ (WebKit::WebIDBIndex::get):
+ * public/WebIDBObjectStore.h:
+ (WebKit::WebIDBObjectStore::get):
+ (WebKit::WebIDBObjectStore::put):
+ (WebKit::WebIDBObjectStore::remove):
+ (WebKit::WebIDBObjectStore::createIndex):
+ (WebKit::WebIDBObjectStore::removeIndex):
+ (WebKit::WebIDBObjectStore::openCursor):
+ * src/WebIDBIndexImpl.cpp:
+ (WebKit::WebIDBIndexImpl::openCursor):
+ (WebKit::WebIDBIndexImpl::openObjectCursor):
+ (WebKit::WebIDBIndexImpl::getObject):
+ (WebKit::WebIDBIndexImpl::get):
+ * src/WebIDBIndexImpl.h:
+ * src/WebIDBObjectStoreImpl.cpp:
+ (WebKit::WebIDBObjectStoreImpl::get):
+ (WebKit::WebIDBObjectStoreImpl::put):
+ (WebKit::WebIDBObjectStoreImpl::remove):
+ (WebKit::WebIDBObjectStoreImpl::openCursor):
+ * src/WebIDBObjectStoreImpl.h:
+
+2010-09-21 Chris Guillory <chris.guillory@google.com>
+
+ Reviewed by Chris Fleizach.
+
+ Send webkit accessibility notifications to Chromium.
+ https://bugs.webkit.org/show_bug.cgi?id=45156
+
+ * public/WebAccessibilityCache.h:
+ * public/WebViewClient.h:
+ * src/ChromeClientImpl.cpp:
+ (WebKit::ChromeClientImpl::focusedNodeChanged):
+ (WebKit::ChromeClientImpl::getPopupMenuInfo):
+ * src/ChromeClientImpl.h:
+ * src/WebAccessibilityCache.cpp:
+ (WebKit::WebAccessibilityCache::accessibilityEnabled):
+
+2010-09-21 Steve Block <steveblock@google.com>
+
+ Reviewed by Jeremy Orlow.
+
+ DeviceOrientationClient and DeviceMotionClient should have controllerDestroyed() methods
+ https://bugs.webkit.org/show_bug.cgi?id=45891
+
+ Implements DeviceOrientationClientProxy::deviceOrientationControllerDestroyed() as a no-op,
+ as the client's lifetime is determined by the WebViewImpl.
+
+ * src/DeviceOrientationClientProxy.cpp:
+ (WebKit::DeviceOrientationClientProxy::deviceOrientationControllerDestroyed):
+ * src/DeviceOrientationClientProxy.h:
+
+2010-09-21 Jochen Eisinger <jochen@chromium.org>
+
+ Reviewed by Jeremy Orlow.
+
+ [chromium] expose the filename used for a given indexed DB
+ https://bugs.webkit.org/show_bug.cgi?id=46090
+
+ * WebKit.gyp:
+ * public/WebIDBFactory.h:
+ * src/WebIDBFactory.cpp:
+ (WebKit::WebIDBFactory::databaseFileName):
+
+2010-09-20 Philippe Normand <pnormand@igalia.com>
+
+ Reviewed by Eric Carlson.
+
+ [GTK] enhanced context menu for media elements
+ https://bugs.webkit.org/show_bug.cgi?id=45021
+
+ New localized strings for the media element context-menu.
+
+ * src/LocalizedStrings.cpp:
+ (WebCore::contextMenuItemTagOpenVideoInNewWindow):
+ (WebCore::contextMenuItemTagOpenAudioInNewWindow):
+ (WebCore::contextMenuItemTagCopyVideoLinkToClipboard):
+ (WebCore::contextMenuItemTagCopyAudioLinkToClipboard):
+ (WebCore::contextMenuItemTagToggleMediaControls):
+ (WebCore::contextMenuItemTagToggleMediaLoop):
+ (WebCore::contextMenuItemTagEnterVideoFullscreen):
+ (WebCore::contextMenuItemTagMediaPlay):
+ (WebCore::contextMenuItemTagMediaPause):
+ (WebCore::contextMenuItemTagMediaMute):
+
+2010-09-20 Nico Weber <thakis@chromium.org>
+
+ Reviewed by James Robinson.
+
+ [chromium] Trivial clang warning fix
+ https://bugs.webkit.org/show_bug.cgi?id=46143
+
+ * src/WebFileSystemCallbacksImpl.h:
+
2010-09-20 Darin Adler <darin@apple.com>
Reviewed by James Robinson.
diff --git a/WebKit/chromium/DEPS b/WebKit/chromium/DEPS
index 17cf7b5..722dd94 100644
--- a/WebKit/chromium/DEPS
+++ b/WebKit/chromium/DEPS
@@ -32,7 +32,7 @@
vars = {
'chromium_svn': 'http://src.chromium.org/svn/trunk/src',
- 'chromium_rev': '59961',
+ 'chromium_rev': '60394',
}
deps = {
diff --git a/WebKit/chromium/WebKit.gyp b/WebKit/chromium/WebKit.gyp
index 3523f21..5b953e3 100644
--- a/WebKit/chromium/WebKit.gyp
+++ b/WebKit/chromium/WebKit.gyp
@@ -76,6 +76,7 @@
'<(chromium_src_dir)/app/app.gyp:app_base', # For GLContext
'<(chromium_src_dir)/skia/skia.gyp:skia',
'<(chromium_src_dir)/third_party/npapi/npapi.gyp:npapi',
+ '<(chromium_src_dir)/third_party/angle/src/build_angle.gyp:translator_glsl',
],
'export_dependent_settings': [
'<(chromium_src_dir)/skia/skia.gyp:skia',
@@ -84,6 +85,7 @@
'include_dirs': [
'public',
'src',
+ '<(chromium_src_dir)/third_party/angle/include',
],
'defines': [
'WEBKIT_IMPLEMENTATION=1',
@@ -170,7 +172,6 @@
'public/WebGeolocationServiceBridge.h',
'public/WebGeolocationServiceMock.h',
'public/WebGlyphCache.h',
- 'public/WebGLES2Context.h',
'public/WebGraphicsContext3D.h',
'public/WebHistoryItem.h',
'public/WebHTTPBody.h',
@@ -216,6 +217,7 @@
'public/WebPageSerializerClient.h',
'public/WebPasswordAutocompleteListener.h',
'public/WebPasswordFormData.h',
+ 'public/WebPerformance.h',
'public/WebPlugin.h',
'public/WebPluginContainer.h',
'public/WebPluginDocument.h',
@@ -277,7 +279,6 @@
'public/win/WebInputEventFactory.h',
'public/win/WebSandboxSupport.h',
'public/win/WebScreenInfoFactory.h',
- 'public/win/WebScreenInfoFactory.h',
'src/ApplicationCacheHost.cpp',
'src/ApplicationCacheHostInternal.h',
'src/AssertMatchingEnums.cpp',
@@ -323,9 +324,6 @@
'src/FrameLoaderClientImpl.cpp',
'src/FrameLoaderClientImpl.h',
'src/FrameNetworkingContextImpl.h',
- 'src/GLES2Context.cpp',
- 'src/GLES2ContextInternal.cpp',
- 'src/GLES2ContextInternal.h',
'src/GraphicsContext3D.cpp',
'src/GraphicsContext3DInternal.h',
'src/gtk/WebFontInfo.cpp',
@@ -447,6 +445,7 @@
'src/WebIDBDatabaseError.cpp',
'src/WebIDBDatabaseImpl.cpp',
'src/WebIDBDatabaseImpl.h',
+ 'src/WebIDBFactory.cpp',
'src/WebIDBFactoryImpl.cpp',
'src/WebIDBFactoryImpl.h',
'src/WebIDBIndexImpl.cpp',
@@ -484,6 +483,7 @@
'src/WebPasswordFormData.cpp',
'src/WebPasswordFormUtils.cpp',
'src/WebPasswordFormUtils.h',
+ 'src/WebPerformance.cpp',
'src/WebPluginContainerImpl.h',
'src/WebPluginContainerImpl.cpp',
'src/WebPluginDocument.cpp',
@@ -533,6 +533,8 @@
'src/WebWorkerClientImpl.h',
'src/WebWorkerImpl.cpp',
'src/WebWorkerImpl.h',
+ 'src/WorkerFileSystemCallbacksBridge.cpp',
+ 'src/WorkerFileSystemCallbacksBridge.h',
'src/WrappedResourceRequest.h',
'src/WrappedResourceResponse.h',
'src/win/WebInputEventFactory.cpp',
@@ -550,7 +552,6 @@
'dependencies': [
'../../WebCore/WebCore.gyp/WebCore.gyp:webcore_bindings',
'<(chromium_src_dir)/build/temp_gyp/googleurl.gyp:googleurl',
- '<(chromium_src_dir)/gpu/gpu.gyp:gles2_c_lib',
'<(chromium_src_dir)/third_party/icu/icu.gyp:*',
'<(chromium_src_dir)/third_party/libjpeg/libjpeg.gyp:libjpeg',
'<(chromium_src_dir)/third_party/libpng/libpng.gyp:libpng',
@@ -730,8 +731,6 @@
'<(chromium_src_dir)/base/base.gyp:base',
'<(chromium_src_dir)/base/base.gyp:base_i18n',
'<(chromium_src_dir)/base/base.gyp:test_support_base',
- '<(chromium_src_dir)/gpu/gpu.gyp:gles2_c_lib',
- '<(chromium_src_dir)/webkit/support/webkit_support.gyp:blob',
'<(chromium_src_dir)/webkit/support/webkit_support.gyp:webkit_support',
],
'include_dirs': [
@@ -769,7 +768,7 @@
'tests/DragImageTest.cpp',
],
}],
- ['OS=="linux"', {
+ ['OS=="linux" or OS=="freebsd"', {
'sources': [
'tests/WebInputEventFactoryTestGtk.cpp',
],
@@ -787,7 +786,6 @@
'dependencies': [
'webkit',
'../../JavaScriptCore/JavaScriptCore.gyp/JavaScriptCore.gyp:wtf',
- '<(chromium_src_dir)/webkit/support/webkit_support.gyp:blob',
'<(chromium_src_dir)/webkit/support/webkit_support.gyp:webkit_support',
],
'include_dirs': [
@@ -812,7 +810,6 @@
'<(chromium_src_dir)/webkit/support/webkit_support.gyp:blob',
'<(chromium_src_dir)/webkit/support/webkit_support.gyp:copy_npapi_layout_test_plugin',
'<(chromium_src_dir)/webkit/support/webkit_support.gyp:webkit_support',
- '<(chromium_src_dir)/gpu/gpu.gyp:gles2_c_lib'
],
'include_dirs': [
'.',
diff --git a/WebKit/chromium/features.gypi b/WebKit/chromium/features.gypi
index df277d6..900bb7a 100644
--- a/WebKit/chromium/features.gypi
+++ b/WebKit/chromium/features.gypi
@@ -40,6 +40,8 @@
# features_override.gypi inline documentation for more details.
'feature_defines': [
'ENABLE_3D_CANVAS=1',
+ 'ENABLE_3D_RENDERING=1',
+ 'ENABLE_ACCELERATED_2D_CANVAS=1',
'ENABLE_BLOB=1',
'ENABLE_BLOB_SLICE=1',
'ENABLE_CHANNEL_MESSAGING=1',
@@ -84,15 +86,7 @@
'ENABLE_XHR_RESPONSE_BLOB=1',
'ENABLE_XPATH=1',
'ENABLE_XSLT=1',
- ],
-
- 'conditions': [
- ['OS=="win" or OS=="linux" or OS=="mac"', {
- 'feature_defines': [
- 'WTF_USE_ACCELERATED_COMPOSITING=1',
- 'ENABLE_3D_RENDERING=1',
- ],
- }],
+ 'WTF_USE_ACCELERATED_COMPOSITING=1',
],
'use_accelerated_compositing%': 1,
diff --git a/WebKit/chromium/public/WebAccessibilityCache.h b/WebKit/chromium/public/WebAccessibilityCache.h
index 52e438c..c9aec1f 100644
--- a/WebKit/chromium/public/WebAccessibilityCache.h
+++ b/WebKit/chromium/public/WebAccessibilityCache.h
@@ -45,6 +45,7 @@ public:
WEBKIT_API static WebAccessibilityCache* create();
WEBKIT_API static void enableAccessibility();
+ WEBKIT_API static bool accessibilityEnabled();
virtual void initialize(WebView* view) = 0;
virtual bool isInitialized() const = 0;
diff --git a/WebKit/chromium/public/WebBindings.h b/WebKit/chromium/public/WebBindings.h
index bca4095..147ce45 100644
--- a/WebKit/chromium/public/WebBindings.h
+++ b/WebKit/chromium/public/WebBindings.h
@@ -32,6 +32,7 @@
#define WebBindings_h
#include "WebCommon.h"
+#include "WebVector.h"
#include <bindings/npruntime.h>
namespace WebKit {
@@ -144,6 +145,8 @@ public:
// If so, return that element as a WebElement object.
WEBKIT_API static bool getElement(NPObject* element, WebElement*);
+ WEBKIT_API static NPObject* makeIntArray(const WebVector<int>&);
+
// Exceptions -------------------------------------------------------------
typedef void (ExceptionHandler)(void* data, const NPUTF8* message);
diff --git a/WebKit/chromium/public/WebCommonWorkerClient.h b/WebKit/chromium/public/WebCommonWorkerClient.h
index cea6471..39d8aa9 100644
--- a/WebKit/chromium/public/WebCommonWorkerClient.h
+++ b/WebKit/chromium/public/WebCommonWorkerClient.h
@@ -31,6 +31,9 @@
#ifndef WebCommonWorkerClient_h
#define WebCommonWorkerClient_h
+#include "WebCommon.h"
+#include "WebFileSystem.h"
+
namespace WebKit {
class WebApplicationCacheHost;
@@ -83,6 +86,12 @@ public:
// Called on the main webkit thread before opening a web database.
virtual bool allowDatabase(WebFrame*, const WebString& name, const WebString& displayName, unsigned long estimatedSize) = 0;
+ // Called on the main webkit thread before opening a file system.
+ virtual void openFileSystem(WebFileSystem::Type, long long size, WebFileSystemCallbacks*)
+ {
+ WEBKIT_ASSERT_NOT_REACHED();
+ }
+
protected:
~WebCommonWorkerClient() { }
};
diff --git a/WebKit/chromium/public/WebFileInfo.h b/WebKit/chromium/public/WebFileInfo.h
index 4590a30..be0b3e4 100644
--- a/WebKit/chromium/public/WebFileInfo.h
+++ b/WebKit/chromium/public/WebFileInfo.h
@@ -38,7 +38,19 @@ struct WebFileInfo {
// The value 0.0 means that the time is not set.
double modificationTime;
- WebFileInfo() : modificationTime(0.0) { }
+ // The length of the file in bytes.
+ // The value -1 means that the length is not set.
+ long long length;
+
+ enum Type {
+ TypeUnknown = 0,
+ TypeFile,
+ TypeDirectory
+ };
+
+ Type type;
+
+ WebFileInfo() : modificationTime(0.0), length(-1), type(TypeUnknown) { }
};
} // namespace WebKit
diff --git a/WebKit/chromium/public/WebFileWriterClient.h b/WebKit/chromium/public/WebFileWriterClient.h
index d371582..46ff153 100644
--- a/WebKit/chromium/public/WebFileWriterClient.h
+++ b/WebKit/chromium/public/WebFileWriterClient.h
@@ -43,7 +43,7 @@ public:
virtual void didWrite(long long bytes, bool complete) = 0;
// Called once when the truncate completes successfully.
- virtual void didTruncate(long long length) = 0;
+ virtual void didTruncate() = 0;
// Called if the write or truncate fails, or if it is cancelled before the write or truncate completes. Completion of an operation will be signalled exactly once, either by didFail, didTruncate, or didWrite(..., true).
virtual void didFail(WebFileError) = 0;
diff --git a/WebKit/chromium/public/WebFrame.h b/WebKit/chromium/public/WebFrame.h
index 6725f58..5d41d10 100644
--- a/WebKit/chromium/public/WebFrame.h
+++ b/WebKit/chromium/public/WebFrame.h
@@ -56,6 +56,7 @@ class WebFormElement;
class WebHistoryItem;
class WebInputElement;
class WebPasswordAutocompleteListener;
+class WebPerformance;
class WebRange;
class WebSecurityOrigin;
class WebString;
@@ -193,6 +194,8 @@ public:
virtual WebAnimationController* animationController() = 0;
+ virtual WebPerformance performance() const = 0;
+
// Scripting ----------------------------------------------------------
@@ -352,6 +355,8 @@ public:
virtual WebRange markedRange() const = 0;
+ virtual bool firstRectForCharacterRange(unsigned location, unsigned length, WebRect&) const = 0;
+
// Supports commands like Undo, Redo, Cut, Copy, Paste, SelectAll,
// Unselect, etc. See EditorCommand.cpp for the full list of supported
// commands.
@@ -536,6 +541,12 @@ public:
// Only for testing purpose:
// Returns true if selection.anchorNode has a marker on range from |from| with |length|.
virtual bool selectionStartHasSpellingMarkerFor(int from, int length) const = 0;
+
+ // Pauses and samples an SVG animation. Returns false if there's no svg
+ // animation to pause. This is only for testing.
+ virtual bool pauseSVGAnimation(const WebString& animationId,
+ double time,
+ const WebString& elementId) = 0;
protected:
~WebFrame() { }
};
diff --git a/WebKit/chromium/public/WebFrameClient.h b/WebKit/chromium/public/WebFrameClient.h
index 699325d..a72e2fd 100644
--- a/WebKit/chromium/public/WebFrameClient.h
+++ b/WebKit/chromium/public/WebFrameClient.h
@@ -301,6 +301,13 @@ public:
// scripts.
virtual void didCreateIsolatedScriptContext(WebFrame*) { }
+ // Controls whether the given script extension should run in a new script
+ // context in this frame. If extensionGroup is 0, the script context is the
+ // frame's main context. Otherwise, it is a context created by
+ // WebFrame::executeScriptInIsolatedWorld with that same extensionGroup
+ // value.
+ virtual bool allowScriptExtension(WebFrame*, const WebString& extensionName, int extensionGroup) { return true; }
+
// Geometry notifications ----------------------------------------------
diff --git a/WebKit/chromium/public/WebGLES2Context.h b/WebKit/chromium/public/WebGLES2Context.h
deleted file mode 100644
index 45184aa..0000000
--- a/WebKit/chromium/public/WebGLES2Context.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef WebGLES2Context_h
-#define WebGLES2Context_h
-
-#include "WebCommon.h"
-#include "WebNonCopyable.h"
-
-namespace WebKit {
-
-struct WebSize;
-class WebView;
-
-// This interface abstracts the creation and management of an
-// OpenGL ES 2.0 context.
-
-class WebGLES2Context : public WebNonCopyable {
-public:
- virtual ~WebGLES2Context() {}
-
- virtual bool initialize(WebView*, WebGLES2Context* parent) = 0;
- virtual bool makeCurrent() = 0;
- virtual bool destroy() = 0;
- virtual bool swapBuffers() = 0;
-
- // The follow two functions are for managing a context that renders offscreen.
-
- // Resizes the backing store used for offscreen rendering.
- virtual void resizeOffscreenContent(const WebSize&) = 0;
-
- // Returns the ID of the texture used for offscreen rendering in the context of the parent.
- virtual unsigned getOffscreenContentParentTextureId() = 0;
-
- // The following function is used only on Mac OS X and is needed
- // in order to report window size changes.
-#if defined(__APPLE__)
- virtual void resizeOnscreenContent(const WebSize&) = 0;
-#endif
-};
-
-} // namespace WebKit
-
-#endif
diff --git a/WebKit/chromium/public/WebGraphicsContext3D.h b/WebKit/chromium/public/WebGraphicsContext3D.h
index 9857174..15e6365 100644
--- a/WebKit/chromium/public/WebGraphicsContext3D.h
+++ b/WebKit/chromium/public/WebGraphicsContext3D.h
@@ -85,11 +85,6 @@ public:
// on newly-constructed instances. Returns true on success.
virtual bool initialize(Attributes, WebView*, bool renderDirectlyToWebView) = 0;
- // Initializes the graphics context; should be the first operation performed
- // on newly-constructed instances. Returns true on success.
- // FIXME: remove this entry point once the compositor is switched to use GraphicsContext3D.
- virtual bool initialize(Attributes, WebView*) = 0;
-
// Makes the OpenGL context current on the current thread. Returns true on
// success.
virtual bool makeContextCurrent() = 0;
diff --git a/WebKit/chromium/public/WebIDBCursor.h b/WebKit/chromium/public/WebIDBCursor.h
index f47a44c..05bd51a 100644
--- a/WebKit/chromium/public/WebIDBCursor.h
+++ b/WebKit/chromium/public/WebIDBCursor.h
@@ -49,21 +49,8 @@ public:
WEBKIT_ASSERT_NOT_REACHED();
return WebIDBKey::createInvalid();
}
- // FIXME: Remove the legacy version of value() (the first version) as soon as a WebKit roll happens.
- virtual WebSerializedScriptValue value() const
- {
- WebSerializedScriptValue serializedScriptValue;
- WebIDBKey idbKey;
- value(serializedScriptValue, idbKey);
- WEBKIT_ASSERT(!serializedScriptValue.isNull());
- WEBKIT_ASSERT(idbKey.type() == WebIDBKey::InvalidType);
- return serializedScriptValue;
- }
// One or the other will set, depending on what type of cursor this is.
- virtual void value(WebSerializedScriptValue& serializedScriptValue, WebIDBKey& idbKey) const
- {
- serializedScriptValue = value();
- }
+ virtual void value(WebSerializedScriptValue& serializedScriptValue, WebIDBKey& idbKey) const { WEBKIT_ASSERT_NOT_REACHED(); }
virtual void update(const WebSerializedScriptValue&, WebIDBCallbacks*) { WEBKIT_ASSERT_NOT_REACHED(); }
virtual void continueFunction(const WebIDBKey&, WebIDBCallbacks*) { WEBKIT_ASSERT_NOT_REACHED(); }
diff --git a/WebKit/chromium/public/WebIDBFactory.h b/WebKit/chromium/public/WebIDBFactory.h
index ab05b06..cb5d369 100755
--- a/WebKit/chromium/public/WebIDBFactory.h
+++ b/WebKit/chromium/public/WebIDBFactory.h
@@ -52,17 +52,10 @@ public:
virtual ~WebIDBFactory() { }
// The WebKit implementation of open ignores the WebFrame* parameter.
- virtual void open(const WebString& name, const WebString& description, WebIDBCallbacks* callbacks, const WebSecurityOrigin& origin, WebFrame* webFrame, const WebString& dataDir)
- {
- open(name, description, callbacks, origin, webFrame);
- }
- // FIXME: Delete soon. Compatability hack.
- virtual void open(const WebString& name, const WebString& description, WebIDBCallbacks* callbacks, const WebSecurityOrigin& origin, WebFrame* webFrame)
- {
- open(name, description, callbacks, origin, webFrame, "/tmp/temporary-indexed-db-files");
- }
+ virtual void open(const WebString& name, const WebString& description, WebIDBCallbacks* callbacks, const WebSecurityOrigin& origin, WebFrame* webFrame, const WebString& dataDir) { WEBKIT_ASSERT_NOT_REACHED(); }
- virtual void abortPendingTransactions(const WebVector<int>& pendingIDs) { WEBKIT_ASSERT_NOT_REACHED(); }
+ // The file name that would be used for persisting a given indexed database on the file system.
+ WEBKIT_API static WebString databaseFileName(const WebString& name, const WebSecurityOrigin&);
};
} // namespace WebKit
diff --git a/WebKit/chromium/public/WebIDBIndex.h b/WebKit/chromium/public/WebIDBIndex.h
index e03fc58..b4ba1f4 100644
--- a/WebKit/chromium/public/WebIDBIndex.h
+++ b/WebKit/chromium/public/WebIDBIndex.h
@@ -26,6 +26,7 @@
#ifndef WebIDBIndex_h
#define WebIDBIndex_h
+#include "WebIDBTransaction.h"
#include "WebString.h"
namespace WebKit {
@@ -60,10 +61,43 @@ public:
return false;
}
- virtual void openObjectCursor(const WebIDBKeyRange&, unsigned short direction, WebIDBCallbacks*) { WEBKIT_ASSERT_NOT_REACHED(); }
- virtual void openCursor(const WebIDBKeyRange&, unsigned short direction, WebIDBCallbacks*) { WEBKIT_ASSERT_NOT_REACHED(); }
- virtual void getObject(const WebIDBKey&, WebIDBCallbacks*) { WEBKIT_ASSERT_NOT_REACHED(); }
- virtual void get(const WebIDBKey&, WebIDBCallbacks*) { WEBKIT_ASSERT_NOT_REACHED(); }
+ // FIXME: Remove the versions without transaction parameters.
+ virtual void openObjectCursor(const WebIDBKeyRange& range, unsigned short direction, WebIDBCallbacks* callbacks, const WebIDBTransaction&)
+ {
+ openObjectCursor(range, direction, callbacks);
+ }
+ virtual void openObjectCursor(const WebIDBKeyRange& range, unsigned short direction, WebIDBCallbacks* callbacks)
+ {
+ WebIDBTransaction transaction;
+ openObjectCursor(range, direction, callbacks, transaction);
+ }
+ virtual void openCursor(const WebIDBKeyRange& range, unsigned short direction, WebIDBCallbacks* callbacks, const WebIDBTransaction&)
+ {
+ openCursor(range, direction, callbacks);
+ }
+ virtual void openCursor(const WebIDBKeyRange& range, unsigned short direction, WebIDBCallbacks* callbacks)
+ {
+ WebIDBTransaction transaction;
+ openCursor(range, direction, callbacks, transaction);
+ }
+ virtual void getObject(const WebIDBKey& key, WebIDBCallbacks* callbacks, const WebIDBTransaction&)
+ {
+ getObject(key, callbacks);
+ }
+ virtual void getObject(const WebIDBKey& key, WebIDBCallbacks* callbacks)
+ {
+ WebIDBTransaction transaction;
+ getObject(key, callbacks, transaction);
+ }
+ virtual void get(const WebIDBKey& key, WebIDBCallbacks* callbacks, const WebIDBTransaction&)
+ {
+ get(key, callbacks);
+ }
+ virtual void get(const WebIDBKey& key, WebIDBCallbacks* callbacks)
+ {
+ WebIDBTransaction transaction;
+ get(key, callbacks, transaction);
+ }
};
} // namespace WebKit
diff --git a/WebKit/chromium/public/WebIDBObjectStore.h b/WebKit/chromium/public/WebIDBObjectStore.h
index 7452be9..19efd48 100755
--- a/WebKit/chromium/public/WebIDBObjectStore.h
+++ b/WebKit/chromium/public/WebIDBObjectStore.h
@@ -29,11 +29,13 @@
#include "WebCommon.h"
#include "WebDOMStringList.h"
#include "WebIDBCallbacks.h"
+#include "WebIDBTransaction.h"
#include "WebString.h"
namespace WebKit {
class WebIDBKeyRange;
+class WebIDBTransaction;
// See comment in WebIndexedDatabase for a high level overview these classes.
class WebIDBObjectStore {
@@ -55,35 +57,51 @@ public:
WEBKIT_ASSERT_NOT_REACHED();
return WebDOMStringList();
}
- virtual void get(const WebIDBKey& key, WebIDBCallbacks*)
+
+ // FIXME: Remove the default parameters for transactionIds.
+ virtual void get(const WebIDBKey& key, WebIDBCallbacks* callbacks, const WebIDBTransaction&)
{
- WEBKIT_ASSERT_NOT_REACHED();
+ get(key, callbacks);
}
- virtual void put(const WebSerializedScriptValue& value, const WebIDBKey& key, bool addOnly, WebIDBCallbacks*)
+ virtual void get(const WebIDBKey& key, WebIDBCallbacks* callbacks)
{
- WEBKIT_ASSERT_NOT_REACHED();
+ WebIDBTransaction transaction;
+ get(key, callbacks, transaction);
}
- virtual void remove(const WebIDBKey& key, WebIDBCallbacks*)
+ virtual void put(const WebSerializedScriptValue& value, const WebIDBKey& key, bool addOnly, WebIDBCallbacks* callbacks, const WebIDBTransaction&)
{
- WEBKIT_ASSERT_NOT_REACHED();
+ put(value, key, addOnly, callbacks);
}
- virtual void createIndex(const WebString& name, const WebString& keyPath, bool unique, WebIDBCallbacks*)
+ virtual void put(const WebSerializedScriptValue& value, const WebIDBKey& key, bool addOnly, WebIDBCallbacks* callbacks)
{
- WEBKIT_ASSERT_NOT_REACHED();
+ WebIDBTransaction transaction;
+ put(value, key, addOnly, callbacks, transaction);
}
+ virtual void remove(const WebIDBKey& key, WebIDBCallbacks* callbacks, const WebIDBTransaction&)
+ {
+ remove(key, callbacks);
+ }
+ virtual void remove(const WebIDBKey& key, WebIDBCallbacks* callbacks)
+ {
+ WebIDBTransaction transaction;
+ remove(key, callbacks, transaction);
+ }
+ virtual void createIndex(const WebString& name, const WebString& keyPath, bool unique, WebIDBCallbacks*) { WEBKIT_ASSERT_NOT_REACHED(); }
// Transfers ownership of the WebIDBIndex to the caller.
virtual WebIDBIndex* index(const WebString& name)
{
WEBKIT_ASSERT_NOT_REACHED();
return 0;
}
- virtual void removeIndex(const WebString& name, WebIDBCallbacks*)
+ virtual void removeIndex(const WebString& name, WebIDBCallbacks*) { WEBKIT_ASSERT_NOT_REACHED(); }
+ virtual void openCursor(const WebIDBKeyRange& range, unsigned short direction, WebIDBCallbacks* callbacks, const WebIDBTransaction&)
{
- WEBKIT_ASSERT_NOT_REACHED();
+ openCursor(range, direction, callbacks);
}
- virtual void openCursor(const WebIDBKeyRange&, unsigned short direction, WebIDBCallbacks*)
+ virtual void openCursor(const WebIDBKeyRange& range, unsigned short direction, WebIDBCallbacks* callbacks)
{
- WEBKIT_ASSERT_NOT_REACHED();
+ WebIDBTransaction transaction;
+ openCursor(range, direction, callbacks, transaction);
}
// FIXME: finish.
};
diff --git a/WebKit/chromium/public/WebIDBTransaction.h b/WebKit/chromium/public/WebIDBTransaction.h
index 0369b89..7b51b97 100644
--- a/WebKit/chromium/public/WebIDBTransaction.h
+++ b/WebKit/chromium/public/WebIDBTransaction.h
@@ -28,6 +28,8 @@
#include "WebString.h"
+namespace WebCore { class IDBTransactionBackendInterface; }
+
namespace WebKit {
class WebIDBObjectStore;
@@ -49,12 +51,22 @@ public:
return 0;
}
virtual void abort() { WEBKIT_ASSERT_NOT_REACHED(); }
+ virtual void didCompleteTaskEvents() { WEBKIT_ASSERT_NOT_REACHED(); }
virtual int id() const
{
- WEBKIT_ASSERT_NOT_REACHED();
+ // FIXME: Uncomment this after the next Chromium WebKit roll.
+ //WEBKIT_ASSERT_NOT_REACHED();
return 0;
}
virtual void setCallbacks(WebIDBTransactionCallbacks*) { WEBKIT_ASSERT_NOT_REACHED(); }
+
+ // FIXME: this is never called from WebCore. Find a cleaner solution.
+ virtual WebCore::IDBTransactionBackendInterface* getIDBTransactionBackendInterface() const
+ {
+ WEBKIT_ASSERT_NOT_REACHED();
+ return 0;
+ }
+
};
} // namespace WebKit
diff --git a/WebKit/chromium/public/WebInputElement.h b/WebKit/chromium/public/WebInputElement.h
index 3ef92de..8fea4fa 100644
--- a/WebKit/chromium/public/WebInputElement.h
+++ b/WebKit/chromium/public/WebInputElement.h
@@ -52,33 +52,6 @@ namespace WebKit {
}
WEBKIT_API void assign(const WebInputElement& e) { WebFormControlElement::assign(e); }
- enum InputType {
- Text = 0,
- Password,
- IsIndex,
- CheckBox,
- Radio,
- Submit,
- Reset,
- File,
- Hidden,
- Image,
- Button,
- Search,
- Range,
- Email,
- Number,
- Telephone,
- URL,
- Color,
- Date,
- DateTime,
- DateTimeLocal,
- Month,
- Time,
- Week
- };
-
// This returns true for all of textfield-looking types such as text,
// password, search, email, url, and number.
WEBKIT_API bool isTextField() const;
@@ -89,8 +62,6 @@ namespace WebKit {
WEBKIT_API bool autoComplete() const;
WEBKIT_API bool isReadOnly() const;
WEBKIT_API bool isEnabledFormControl() const;
- // Deperated.
- WEBKIT_API InputType inputType() const;
WEBKIT_API int maxLength() const;
WEBKIT_API bool isActivatedSubmit() const;
WEBKIT_API void setActivatedSubmit(bool);
diff --git a/WebKit/chromium/public/WebInputEvent.h b/WebKit/chromium/public/WebInputEvent.h
index f8b057b..26e41a4 100644
--- a/WebKit/chromium/public/WebInputEvent.h
+++ b/WebKit/chromium/public/WebInputEvent.h
@@ -122,6 +122,12 @@ public:
LeftButtonDown = 1 << 6,
MiddleButtonDown = 1 << 7,
RightButtonDown = 1 << 8,
+
+ // Toggle modifiers for all events. Danger: these are not reflected
+ // into WebCore, so round-tripping from WebInputEvent to a WebCore
+ // event and back will not preserve these flags.
+ CapsLockOn = 1 << 9,
+ NumLockOn = 1 << 10,
};
unsigned size; // The size of this structure, for serialization.
diff --git a/WebKit/chromium/public/WebKitClient.h b/WebKit/chromium/public/WebKitClient.h
index 0f282e0..09c79c5 100644
--- a/WebKit/chromium/public/WebKitClient.h
+++ b/WebKit/chromium/public/WebKitClient.h
@@ -53,7 +53,6 @@ class WebClipboard;
class WebCookieJar;
class WebFileSystem;
class WebFileUtilities;
-class WebGLES2Context;
class WebGraphicsContext3D;
class WebIDBFactory;
class WebIDBKey;
@@ -270,12 +269,6 @@ public:
// Returns newly allocated WebGraphicsContext3D instance.
virtual WebGraphicsContext3D* createGraphicsContext3D() { return 0; }
- // GLES2 --------------------------------------------------------------
-
- // Returns newly allocated WebGLES2Context instance.
- // May return null if it fails to create the context.
- virtual WebGLES2Context* createGLES2Context() { return 0; }
-
// FileSystem ----------------------------------------------------------
// Must return non-null.
diff --git a/WebKit/chromium/public/WebPerformance.h b/WebKit/chromium/public/WebPerformance.h
new file mode 100644
index 0000000..012f2fd
--- /dev/null
+++ b/WebKit/chromium/public/WebPerformance.h
@@ -0,0 +1,92 @@
+/*
+ * 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 WebPerformance_h
+#define WebPerformance_h
+
+#include "WebCommon.h"
+#include "WebNavigationType.h"
+#include "WebPrivatePtr.h"
+
+namespace WebCore { class Performance; }
+
+namespace WebKit {
+
+class WebPerformance {
+public:
+ ~WebPerformance() { reset(); }
+
+ WebPerformance() { }
+
+ WebPerformance(const WebPerformance& p) { assign(p); }
+
+ WebPerformance& operator=(const WebPerformance& p)
+ {
+ assign(p);
+ return *this;
+ }
+
+ WEBKIT_API void reset();
+ WEBKIT_API void assign(const WebPerformance&);
+
+ // This only returns one of {Other|Reload|BackForward}.
+ // Form submits and link clicks all fall under other.
+ WEBKIT_API WebNavigationType navigationType() const;
+
+ WEBKIT_API double navigationStart() const;
+ WEBKIT_API double unloadEventEnd() const;
+ WEBKIT_API double redirectStart() const;
+ WEBKIT_API double redirectEnd() const;
+ WEBKIT_API unsigned short redirectCount() const;
+ WEBKIT_API double fetchStart() const;
+ WEBKIT_API double domainLookupStart() const;
+ WEBKIT_API double domainLookupEnd() const;
+ WEBKIT_API double connectStart() const;
+ WEBKIT_API double connectEnd() const;
+ WEBKIT_API double requestStart() const;
+ WEBKIT_API double requestEnd() const;
+ WEBKIT_API double responseStart() const;
+ WEBKIT_API double responseEnd() const;
+ WEBKIT_API double loadEventStart() const;
+ WEBKIT_API double loadEventEnd() const;
+
+#if WEBKIT_IMPLEMENTATION
+ WebPerformance(const WTF::PassRefPtr<WebCore::Performance>&);
+ WebPerformance& operator=(const WTF::PassRefPtr<WebCore::Performance>&);
+ operator WTF::PassRefPtr<WebCore::Performance>() const;
+#endif
+
+private:
+ WebPrivatePtr<WebCore::Performance> m_private;
+};
+
+} // namespace WebKit
+
+#endif
diff --git a/WebKit/chromium/public/WebScriptController.h b/WebKit/chromium/public/WebScriptController.h
index 54bb08a..5c360b2 100644
--- a/WebKit/chromium/public/WebScriptController.h
+++ b/WebKit/chromium/public/WebScriptController.h
@@ -51,6 +51,8 @@ public:
// matching group.
// Will only affect v8 contexts initialized after this call. Takes ownership
// of the v8::Extension object passed.
+ // FIXME: remove the latter 2 versions in phase 3 of multipart checkin:
+ // https://bugs.webkit.org/show_bug.cgi?id=45721
WEBKIT_API static void registerExtension(v8::Extension*);
WEBKIT_API static void registerExtension(v8::Extension*,
const WebString& schemeRestriction);
diff --git a/WebKit/chromium/public/WebSettings.h b/WebKit/chromium/public/WebSettings.h
index 0bef045..6a37e08 100644
--- a/WebKit/chromium/public/WebSettings.h
+++ b/WebKit/chromium/public/WebSettings.h
@@ -93,6 +93,8 @@ public:
virtual void setAcceleratedCompositingEnabled(bool) = 0;
virtual void setAccelerated2dCanvasEnabled(bool) = 0;
virtual void setMemoryInfoEnabled(bool) = 0;
+ virtual void setHyperlinkAuditingEnabled(bool) = 0;
+ virtual void setCaretBrowsingEnabled(bool) = 0;
protected:
~WebSettings() { }
diff --git a/WebKit/chromium/public/WebView.h b/WebKit/chromium/public/WebView.h
index d162f26..7a8a4af 100644
--- a/WebKit/chromium/public/WebView.h
+++ b/WebKit/chromium/public/WebView.h
@@ -44,7 +44,6 @@ class WebDevToolsAgentClient;
class WebDragData;
class WebFrame;
class WebFrameClient;
-class WebGLES2Context;
class WebGraphicsContext3D;
class WebNode;
class WebSettings;
@@ -66,6 +65,13 @@ public:
UserContentInjectInAllFrames,
UserContentInjectInTopFrameOnly
};
+
+ // Controls which documents user styles are injected into.
+ enum UserStyleInjectionTime {
+ UserStyleInjectInExistingDocuments,
+ UserStyleInjectInSubsequentDocuments
+ };
+
// Initialization ------------------------------------------------------
@@ -311,25 +317,14 @@ public:
unsigned inactiveForegroundColor) = 0;
// User scripts --------------------------------------------------------
- // FIXME: These two methods are DEPRECATED. Remove once Chromium has been rolled.
- virtual void addUserScript(const WebString& sourceCode, bool runAtStart)
- {
- addUserScript(sourceCode, WebVector<WebString>(),
- runAtStart ? UserScriptInjectAtDocumentStart : UserScriptInjectAtDocumentEnd,
- UserContentInjectInAllFrames);
- }
- virtual void addUserStyleSheet(const WebString& sourceCode)
- {
- addUserStyleSheet(sourceCode, WebVector<WebString>(), UserContentInjectInAllFrames);
- }
-
WEBKIT_API static void addUserScript(const WebString& sourceCode,
const WebVector<WebString>& patterns,
UserScriptInjectAt injectAt,
UserContentInjectIn injectIn);
WEBKIT_API static void addUserStyleSheet(const WebString& sourceCode,
const WebVector<WebString>& patterns,
- UserContentInjectIn injectIn);
+ UserContentInjectIn injectIn,
+ UserStyleInjectionTime injectionTime = UserStyleInjectInSubsequentDocuments);
WEBKIT_API static void removeAllUserContent();
// Modal dialog support ------------------------------------------------
@@ -341,12 +336,6 @@ public:
// GPU acceleration support --------------------------------------------
- // Returns the GLES2Context associated with this WebView. One will be
- // created if it doesn't already exist.
- // FIXME: remove this method once the compositor is fully switched
- // over to GraphicsContext3D.
- virtual WebGLES2Context* gles2Context() = 0;
-
// Returns the (on-screen) WebGraphicsContext3D associated with
// this WebView. One will be created if it doesn't already exist.
// This is used to set up sharing between this context (which is
diff --git a/WebKit/chromium/public/WebViewClient.h b/WebKit/chromium/public/WebViewClient.h
index f686419..3b0e47a 100644
--- a/WebKit/chromium/public/WebViewClient.h
+++ b/WebKit/chromium/public/WebViewClient.h
@@ -276,12 +276,6 @@ public:
// accessibility object.
virtual void focusAccessibilityObject(const WebAccessibilityObject&) { }
- // Notifies embedder that the state of an accessibility object has changed.
- virtual void didChangeAccessibilityObjectState(const WebAccessibilityObject&) { }
-
- // Notifies embedder that the children of an accessibility object has changed.
- virtual void didChangeAccessibilityObjectChildren(const WebAccessibilityObject&) { }
-
// Notifies embedder about an accessibility notification.
virtual void postAccessibilityNotification(const WebAccessibilityObject&, WebAccessibilityNotification) { }
diff --git a/WebKit/chromium/src/AssertMatchingEnums.cpp b/WebKit/chromium/src/AssertMatchingEnums.cpp
index ac3aad3..f3b8f5a 100644
--- a/WebKit/chromium/src/AssertMatchingEnums.cpp
+++ b/WebKit/chromium/src/AssertMatchingEnums.cpp
@@ -49,6 +49,7 @@
#include "TextAffinity.h"
#include "UserContentTypes.h"
#include "UserScriptTypes.h"
+#include "UserStyleSheetTypes.h"
#include "VideoFrameChromium.h"
#include "WebAccessibilityObject.h"
#include "WebApplicationCacheHost.h"
@@ -273,31 +274,6 @@ COMPILE_ASSERT_MATCHING_ENUM(WebFontDescription::Weight900, FontWeight900);
COMPILE_ASSERT_MATCHING_ENUM(WebFontDescription::WeightNormal, FontWeightNormal);
COMPILE_ASSERT_MATCHING_ENUM(WebFontDescription::WeightBold, FontWeightBold);
-COMPILE_ASSERT_MATCHING_ENUM(WebInputElement::Text, HTMLInputElement::TEXT);
-COMPILE_ASSERT_MATCHING_ENUM(WebInputElement::Password, HTMLInputElement::PASSWORD);
-COMPILE_ASSERT_MATCHING_ENUM(WebInputElement::IsIndex, HTMLInputElement::ISINDEX);
-COMPILE_ASSERT_MATCHING_ENUM(WebInputElement::CheckBox, HTMLInputElement::CHECKBOX);
-COMPILE_ASSERT_MATCHING_ENUM(WebInputElement::Radio, HTMLInputElement::RADIO);
-COMPILE_ASSERT_MATCHING_ENUM(WebInputElement::Submit, HTMLInputElement::SUBMIT);
-COMPILE_ASSERT_MATCHING_ENUM(WebInputElement::Reset, HTMLInputElement::RESET);
-COMPILE_ASSERT_MATCHING_ENUM(WebInputElement::File, HTMLInputElement::FILE);
-COMPILE_ASSERT_MATCHING_ENUM(WebInputElement::Hidden, HTMLInputElement::HIDDEN);
-COMPILE_ASSERT_MATCHING_ENUM(WebInputElement::Image, HTMLInputElement::IMAGE);
-COMPILE_ASSERT_MATCHING_ENUM(WebInputElement::Button, HTMLInputElement::BUTTON);
-COMPILE_ASSERT_MATCHING_ENUM(WebInputElement::Search, HTMLInputElement::SEARCH);
-COMPILE_ASSERT_MATCHING_ENUM(WebInputElement::Range, HTMLInputElement::RANGE);
-COMPILE_ASSERT_MATCHING_ENUM(WebInputElement::Email, HTMLInputElement::EMAIL);
-COMPILE_ASSERT_MATCHING_ENUM(WebInputElement::Number, HTMLInputElement::NUMBER);
-COMPILE_ASSERT_MATCHING_ENUM(WebInputElement::Telephone, HTMLInputElement::TELEPHONE);
-COMPILE_ASSERT_MATCHING_ENUM(WebInputElement::URL, HTMLInputElement::URL);
-COMPILE_ASSERT_MATCHING_ENUM(WebInputElement::Color, HTMLInputElement::COLOR);
-COMPILE_ASSERT_MATCHING_ENUM(WebInputElement::Date, HTMLInputElement::DATE);
-COMPILE_ASSERT_MATCHING_ENUM(WebInputElement::DateTime, HTMLInputElement::DATETIME);
-COMPILE_ASSERT_MATCHING_ENUM(WebInputElement::DateTimeLocal, HTMLInputElement::DATETIMELOCAL);
-COMPILE_ASSERT_MATCHING_ENUM(WebInputElement::Month, HTMLInputElement::MONTH);
-COMPILE_ASSERT_MATCHING_ENUM(WebInputElement::Time, HTMLInputElement::TIME);
-COMPILE_ASSERT_MATCHING_ENUM(WebInputElement::Week, HTMLInputElement::WEEK);
-
COMPILE_ASSERT_MATCHING_ENUM(WebNode::ElementNode, Node::ELEMENT_NODE);
COMPILE_ASSERT_MATCHING_ENUM(WebNode::AttributeNode, Node::ATTRIBUTE_NODE);
COMPILE_ASSERT_MATCHING_ENUM(WebNode::TextNode, Node::TEXT_NODE);
@@ -378,6 +354,8 @@ COMPILE_ASSERT_MATCHING_ENUM(WebView::UserScriptInjectAtDocumentStart, InjectAtD
COMPILE_ASSERT_MATCHING_ENUM(WebView::UserScriptInjectAtDocumentEnd, InjectAtDocumentEnd);
COMPILE_ASSERT_MATCHING_ENUM(WebView::UserContentInjectInAllFrames, InjectInAllFrames);
COMPILE_ASSERT_MATCHING_ENUM(WebView::UserContentInjectInTopFrameOnly, InjectInTopFrameOnly);
+COMPILE_ASSERT_MATCHING_ENUM(WebView::UserStyleInjectInExistingDocuments, InjectInExistingDocuments);
+COMPILE_ASSERT_MATCHING_ENUM(WebView::UserStyleInjectInSubsequentDocuments, InjectInSubsequentDocuments);
COMPILE_ASSERT_MATCHING_ENUM(WebIDBKey::NullType, IDBKey::NullType);
COMPILE_ASSERT_MATCHING_ENUM(WebIDBKey::StringType, IDBKey::StringType);
diff --git a/WebKit/chromium/src/AsyncFileSystemChromium.cpp b/WebKit/chromium/src/AsyncFileSystemChromium.cpp
index 08fcea6..db65bbd 100644
--- a/WebKit/chromium/src/AsyncFileSystemChromium.cpp
+++ b/WebKit/chromium/src/AsyncFileSystemChromium.cpp
@@ -33,9 +33,11 @@
#if ENABLE(FILE_SYSTEM)
#include "AsyncFileSystemCallbacks.h"
-#include "FileSystem.h"
+#include "AsyncFileWriterChromium.h"
+#include "WebFileInfo.h"
#include "WebFileSystem.h"
#include "WebFileSystemCallbacksImpl.h"
+#include "WebFileWriter.h"
#include "WebKit.h"
#include "WebKitClient.h"
@@ -43,6 +45,11 @@
namespace WebCore {
+bool AsyncFileSystem::isAvailable()
+{
+ return true;
+}
+
AsyncFileSystemChromium::AsyncFileSystemChromium(const String& rootPath)
: AsyncFileSystem(rootPath)
, m_webFileSystem(WebKit::webKitClient()->fileSystem())
@@ -99,6 +106,65 @@ void AsyncFileSystemChromium::readDirectory(const String& path, PassOwnPtr<Async
m_webFileSystem->readDirectory(path, new WebKit::WebFileSystemCallbacksImpl(callbacks));
}
+class FileWriterHelperCallbacks : public WebKit::WebFileSystemCallbacks {
+public:
+ FileWriterHelperCallbacks(AsyncFileWriterClient* client, const String& path, WebKit::WebFileSystem* webFileSystem, PassOwnPtr<WebCore::AsyncFileSystemCallbacks> callbacks)
+ : m_client(client)
+ , m_path(path)
+ , m_webFileSystem(webFileSystem)
+ , m_callbacks(callbacks)
+ {
+ }
+
+ virtual void didSucceed()
+ {
+ ASSERT_NOT_REACHED();
+ delete this;
+ }
+ virtual void didReadMetadata(const WebKit::WebFileInfo& info)
+ {
+ ASSERT(m_callbacks);
+ if (info.type != WebKit::WebFileInfo::TypeFile || info.length < 0)
+ m_callbacks->didFail(WebKit::WebFileErrorInvalidState);
+ else {
+ OwnPtr<AsyncFileWriterChromium> asyncFileWriterChromium = adoptPtr(new AsyncFileWriterChromium(m_client));
+ OwnPtr<WebKit::WebFileWriter> webFileWriter = adoptPtr(m_webFileSystem->createFileWriter(m_path, asyncFileWriterChromium.get()));
+ asyncFileWriterChromium->setWebFileWriter(webFileWriter.release());
+ m_callbacks->didCreateFileWriter(asyncFileWriterChromium.release(), info.length);
+ }
+ delete this;
+ }
+
+ virtual void didReadDirectory(const WebKit::WebVector<WebKit::WebFileSystemEntry>& entries, bool hasMore)
+ {
+ ASSERT_NOT_REACHED();
+ delete this;
+ }
+ virtual void didOpenFileSystem(const WebKit::WebString& name, const WebKit::WebString& rootPath)
+ {
+ ASSERT_NOT_REACHED();
+ delete this;
+ }
+
+ virtual void didFail(WebKit::WebFileError error)
+ {
+ ASSERT(m_callbacks);
+ m_callbacks->didFail(error);
+ delete this;
+ }
+
+private:
+ AsyncFileWriterClient* m_client;
+ String m_path;
+ WebKit::WebFileSystem* m_webFileSystem;
+ OwnPtr<WebCore::AsyncFileSystemCallbacks> m_callbacks;
+};
+
+void AsyncFileSystemChromium::createWriter(AsyncFileWriterClient* client, const String& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
+{
+ m_webFileSystem->readMetadata(path, new FileWriterHelperCallbacks(client, path, m_webFileSystem, callbacks));
+}
+
} // namespace WebCore
#endif
diff --git a/WebKit/chromium/src/AsyncFileSystemChromium.h b/WebKit/chromium/src/AsyncFileSystemChromium.h
index f46f78c..d8698d5 100644
--- a/WebKit/chromium/src/AsyncFileSystemChromium.h
+++ b/WebKit/chromium/src/AsyncFileSystemChromium.h
@@ -58,6 +58,7 @@ public:
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>);
private:
WebKit::WebFileSystem* m_webFileSystem;
diff --git a/WebKit/chromium/src/AsyncFileWriterChromium.cpp b/WebKit/chromium/src/AsyncFileWriterChromium.cpp
index 4bfc988..8969094 100644
--- a/WebKit/chromium/src/AsyncFileWriterChromium.cpp
+++ b/WebKit/chromium/src/AsyncFileWriterChromium.cpp
@@ -33,30 +33,31 @@
#if ENABLE(FILE_SYSTEM)
+#include "AsyncFileWriterClient.h"
#include "Blob.h"
-#include "FileWriterClient.h"
#include "WebFileWriter.h"
#include "WebURL.h"
-using namespace WebCore;
+namespace WebCore {
-namespace WebKit {
-
-AsyncFileWriterChromium::AsyncFileWriterChromium(FileWriterClient* client)
+AsyncFileWriterChromium::AsyncFileWriterChromium(AsyncFileWriterClient* client)
: m_client(client)
{
}
-void AsyncFileWriterChromium::setWebFileWriter(WebFileWriter* writer)
+AsyncFileWriterChromium::~AsyncFileWriterChromium()
+{
+}
+
+void AsyncFileWriterChromium::setWebFileWriter(PassOwnPtr<WebKit::WebFileWriter> writer)
{
- ASSERT(!m_writer);
m_writer = writer;
}
void AsyncFileWriterChromium::write(long long position, Blob* data)
{
ASSERT(m_writer);
- m_writer->write(position, WebURL(data->url()));
+ m_writer->write(position, WebKit::WebURL(data->url()));
}
void AsyncFileWriterChromium::truncate(long long length)
@@ -77,12 +78,12 @@ void AsyncFileWriterChromium::didWrite(long long bytes, bool complete)
m_client->didWrite(bytes, complete);
}
-void AsyncFileWriterChromium::didTruncate(long long length)
+void AsyncFileWriterChromium::didTruncate()
{
- m_client->didTruncate(length);
+ m_client->didTruncate();
}
-void AsyncFileWriterChromium::didFail(WebFileError error)
+void AsyncFileWriterChromium::didFail(WebKit::WebFileError error)
{
m_client->didFail(error);
}
diff --git a/WebKit/chromium/src/AsyncFileWriterChromium.h b/WebKit/chromium/src/AsyncFileWriterChromium.h
index 92743ca..71a2f18 100644
--- a/WebKit/chromium/src/AsyncFileWriterChromium.h
+++ b/WebKit/chromium/src/AsyncFileWriterChromium.h
@@ -36,35 +36,37 @@
#include "AsyncFileWriter.h"
#include "WebFileError.h"
#include "WebFileWriterClient.h"
+#include <wtf/PassOwnPtr.h>
-namespace WebCore {
-class Blob;
-class FileWriterClient;
+namespace WebKit {
+class WebFileWriter;
}
-namespace WebKit {
+namespace WebCore {
-class WebFileWriter;
+class Blob;
+class AsyncFileWriterClient;
-class AsyncFileWriterChromium : public WebCore::AsyncFileWriter, public WebFileWriterClient {
+class AsyncFileWriterChromium : public AsyncFileWriter, public WebKit::WebFileWriterClient {
public:
- AsyncFileWriterChromium(WebCore::FileWriterClient* client);
-
- void setWebFileWriter(WebFileWriter* writer);
+ AsyncFileWriterChromium(AsyncFileWriterClient* client);
+ ~AsyncFileWriterChromium();
+
+ void setWebFileWriter(PassOwnPtr<WebKit::WebFileWriter> writer);
// FileWriter
- virtual void write(long long position, WebCore::Blob* data);
+ virtual void write(long long position, Blob* data);
virtual void truncate(long long length);
virtual void abort();
// WebFileWriterClient
virtual void didWrite(long long bytes, bool complete);
- virtual void didTruncate(long long length);
- virtual void didFail(WebFileError);
+ virtual void didTruncate();
+ virtual void didFail(WebKit::WebFileError);
private:
- OwnPtr<WebFileWriter> m_writer;
- WebCore::FileWriterClient* m_client;
+ OwnPtr<WebKit::WebFileWriter> m_writer;
+ AsyncFileWriterClient* m_client;
};
} // namespace
diff --git a/WebKit/chromium/src/ChromeClientImpl.cpp b/WebKit/chromium/src/ChromeClientImpl.cpp
index 8c13cbb..5f702e0 100644
--- a/WebKit/chromium/src/ChromeClientImpl.cpp
+++ b/WebKit/chromium/src/ChromeClientImpl.cpp
@@ -44,7 +44,6 @@
#include "FloatRect.h"
#include "FrameLoadRequest.h"
#include "FrameView.h"
-#include "GLES2Context.h"
#include "Geolocation.h"
#include "GeolocationService.h"
#include "GeolocationServiceChromium.h"
@@ -257,7 +256,9 @@ void ChromeClientImpl::focusedNodeChanged(Node* node)
if (!document) {
ASSERT_NOT_REACHED();
return;
- }
+ }
+
+ // TODO: Remove once the FocusedUIElementChanged notification is handled downstream.
if (document && document->axObjectCache()->accessibilityEnabled()) {
// Retrieve the focused AccessibilityObject.
AccessibilityObject* focusedAccObj =
@@ -760,20 +761,6 @@ void ChromeClientImpl::getPopupMenuInfo(PopupContainer* popupContainer,
info->rightAligned = popupContainer->menuStyle().textDirection() == RTL;
}
-void ChromeClientImpl::didChangeAccessibilityObjectState(AccessibilityObject* obj)
-{
- // Alert assistive technology about the accessibility object state change
- if (obj)
- m_webView->client()->didChangeAccessibilityObjectState(WebAccessibilityObject(obj));
-}
-
-void ChromeClientImpl::didChangeAccessibilityObjectChildren(WebCore::AccessibilityObject* obj)
-{
- // Alert assistive technology about the accessibility object children change
- if (obj)
- m_webView->client()->didChangeAccessibilityObjectChildren(WebAccessibilityObject(obj));
-}
-
void ChromeClientImpl::postAccessibilityNotification(AccessibilityObject* obj, AXObjectCache::AXNotification notification)
{
// Alert assistive technology about the accessibility object notification.
diff --git a/WebKit/chromium/src/ChromeClientImpl.h b/WebKit/chromium/src/ChromeClientImpl.h
index fbaac87..02f1de6 100644
--- a/WebKit/chromium/src/ChromeClientImpl.h
+++ b/WebKit/chromium/src/ChromeClientImpl.h
@@ -166,8 +166,6 @@ public:
const WebCore::IntRect& bounds,
bool handleExternally);
virtual void popupClosed(WebCore::PopupContainer* popupContainer);
- virtual void didChangeAccessibilityObjectState(WebCore::AccessibilityObject*);
- virtual void didChangeAccessibilityObjectChildren(WebCore::AccessibilityObject*);
virtual void postAccessibilityNotification(WebCore::AccessibilityObject*, WebCore::AXObjectCache::AXNotification);
// ChromeClientImpl:
diff --git a/WebKit/chromium/src/ChromiumBridge.cpp b/WebKit/chromium/src/ChromiumBridge.cpp
index 3ced7b8..b906575 100644
--- a/WebKit/chromium/src/ChromiumBridge.cpp
+++ b/WebKit/chromium/src/ChromiumBridge.cpp
@@ -66,7 +66,7 @@
#include "WebThemeEngine.h"
#endif
-#if OS(LINUX)
+#if OS(LINUX) || OS(FREEBSD)
#include "WebFontInfo.h"
#include "WebFontRenderStyle.h"
#endif
@@ -422,7 +422,7 @@ bool ChromiumBridge::ensureFontLoaded(HFONT font)
}
#endif
-#if OS(LINUX)
+#if OS(LINUX) || OS(FREEBSD)
String ChromiumBridge::getFontFamilyForCharacters(const UChar* characters, size_t numCharacters)
{
if (webKitClient()->sandboxSupport())
diff --git a/WebKit/chromium/src/DeviceOrientationClientProxy.cpp b/WebKit/chromium/src/DeviceOrientationClientProxy.cpp
index f4a0dd9..29b43ba 100644
--- a/WebKit/chromium/src/DeviceOrientationClientProxy.cpp
+++ b/WebKit/chromium/src/DeviceOrientationClientProxy.cpp
@@ -71,4 +71,9 @@ WebCore::DeviceOrientation* DeviceOrientationClientProxy::lastOrientation() cons
return m_lastOrientation.get();
}
+void DeviceOrientationClientProxy::deviceOrientationControllerDestroyed()
+{
+ // Our lifetime is bound to the WebViewImpl.
+}
+
} // namespace WebKit
diff --git a/WebKit/chromium/src/DeviceOrientationClientProxy.h b/WebKit/chromium/src/DeviceOrientationClientProxy.h
index 2d3a7dc..e90d77f 100644
--- a/WebKit/chromium/src/DeviceOrientationClientProxy.h
+++ b/WebKit/chromium/src/DeviceOrientationClientProxy.h
@@ -48,6 +48,7 @@ public:
void startUpdating();
void stopUpdating();
WebCore::DeviceOrientation* lastOrientation() const;
+ virtual void deviceOrientationControllerDestroyed();
private:
WebDeviceOrientationClient* m_client;
diff --git a/WebKit/chromium/src/FrameLoaderClientImpl.cpp b/WebKit/chromium/src/FrameLoaderClientImpl.cpp
index 61d43df..ba9c8fd 100644
--- a/WebKit/chromium/src/FrameLoaderClientImpl.cpp
+++ b/WebKit/chromium/src/FrameLoaderClientImpl.cpp
@@ -147,6 +147,14 @@ void FrameLoaderClientImpl::didCreateIsolatedScriptContext()
m_webFrame->client()->didCreateIsolatedScriptContext(m_webFrame);
}
+bool FrameLoaderClientImpl::allowScriptExtension(const String& extensionName,
+ int extensionGroup)
+{
+ if (m_webFrame->client())
+ return m_webFrame->client()->allowScriptExtension(m_webFrame, extensionName, extensionGroup);
+ return false;
+}
+
void FrameLoaderClientImpl::didPerformFirstNavigation() const
{
}
@@ -1360,7 +1368,7 @@ PassRefPtr<Frame> FrameLoaderClientImpl::createFrame(
return m_webFrame->createChildFrame(frameRequest, ownerElement);
}
-void FrameLoaderClientImpl::didTransferChildFrameToNewDocument()
+void FrameLoaderClientImpl::didTransferChildFrameToNewDocument(Page*)
{
ASSERT(m_webFrame->frame()->ownerElement());
diff --git a/WebKit/chromium/src/FrameLoaderClientImpl.h b/WebKit/chromium/src/FrameLoaderClientImpl.h
index 57105de..0b15db6 100644
--- a/WebKit/chromium/src/FrameLoaderClientImpl.h
+++ b/WebKit/chromium/src/FrameLoaderClientImpl.h
@@ -69,6 +69,10 @@ public:
// in garbage collection.
virtual void didCreateIsolatedScriptContext();
+ // Returns true if we should allow the given V8 extension to be added to
+ // the script context at the currently loading page and given extension group.
+ virtual bool allowScriptExtension(const String& extensionName, int extensionGroup);
+
virtual bool hasWebView() const;
virtual bool hasFrameView() const;
virtual void makeRepresentation(WebCore::DocumentLoader*);
@@ -175,7 +179,7 @@ public:
WebCore::HTMLFrameOwnerElement* ownerElement,
const WTF::String& referrer, bool allowsScrolling,
int marginWidth, int marginHeight);
- virtual void didTransferChildFrameToNewDocument();
+ virtual void didTransferChildFrameToNewDocument(WebCore::Page*);
virtual PassRefPtr<WebCore::Widget> createPlugin(
const WebCore::IntSize&, WebCore::HTMLPlugInElement*, const WebCore::KURL&,
const Vector<WTF::String>&, const Vector<WTF::String>&,
diff --git a/WebKit/chromium/src/GLES2Context.cpp b/WebKit/chromium/src/GLES2Context.cpp
deleted file mode 100644
index b4b4bb2..0000000
--- a/WebKit/chromium/src/GLES2Context.cpp
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-
-#include "GLES2Context.h"
-#include "GLES2ContextInternal.h"
-#include "IntSize.h"
-#include "WebGLES2Context.h"
-#include "WebKit.h"
-#include "WebKitClient.h"
-#include "WebViewImpl.h"
-#include <wtf/OwnPtr.h>
-
-// There are two levels of delegation in this file:
-//
-// 1. GLES2Context delegates to GLES2ContextInternal. This is done
-// so that we have some place to store data members common among
-// implementations.
-//
-// 2. GLES2ContextInternal delegates to an implementation of
-// WebGLES2Context. This is done so we have a place to inject an
-// implementation which creates the GL ES context.
-
-using namespace WebKit;
-
-namespace WebCore {
-
-PassOwnPtr<GLES2ContextInternal> GLES2ContextInternal::create(WebGLES2Context* impl, bool owns)
-{
- PassOwnPtr<GLES2ContextInternal> result = new GLES2ContextInternal(impl, owns);
- return result;
-}
-
-PassOwnPtr<GLES2Context> GLES2Context::create(PassOwnPtr<GLES2ContextInternal> internal)
-{
- PassOwnPtr<GLES2Context> result = new GLES2Context();
- result->m_internal = internal;
- return result;
-}
-
-GLES2Context::GLES2Context()
-{
-}
-
-GLES2Context::~GLES2Context()
-{
-}
-
-bool GLES2Context::makeCurrent()
-{
- WebGLES2Context* webContext = m_internal->getWebGLES2Context();
- if (!webContext)
- return false;
- return webContext->makeCurrent();
-}
-
-bool GLES2Context::destroy()
-{
- WebGLES2Context* webContext = m_internal->getWebGLES2Context();
- if (!webContext)
- return false;
- return webContext->destroy();
-}
-
-bool GLES2Context::swapBuffers()
-{
- WebGLES2Context* webContext = m_internal->getWebGLES2Context();
- if (!webContext)
- return false;
- return webContext->swapBuffers();
-}
-
-void GLES2Context::resizeOffscreenContent(const IntSize& size)
-{
- WebGLES2Context* webContext = m_internal->getWebGLES2Context();
- ASSERT(webContext);
- webContext->resizeOffscreenContent(size);
-}
-
-unsigned GLES2Context::getOffscreenContentParentTextureId()
-{
- WebGLES2Context* webContext = m_internal->getWebGLES2Context();
- ASSERT(webContext);
- return webContext->getOffscreenContentParentTextureId();
-}
-
-} // namespace WebCore
diff --git a/WebKit/chromium/src/IDBDatabaseProxy.h b/WebKit/chromium/src/IDBDatabaseProxy.h
index 42a7d7e..fffd23e 100644
--- a/WebKit/chromium/src/IDBDatabaseProxy.h
+++ b/WebKit/chromium/src/IDBDatabaseProxy.h
@@ -47,7 +47,7 @@ public:
virtual String version() const;
virtual PassRefPtr<DOMStringList> objectStores() const;
- // FIXME: Add transaction and setVersion.
+ // FIXME: Add setVersion.
virtual void createObjectStore(const String& name, const String& keyPath, bool autoIncrement, PassRefPtr<IDBCallbacks>);
virtual PassRefPtr<IDBObjectStoreBackendInterface> objectStore(const String& name, unsigned short mode);
diff --git a/WebKit/chromium/src/IDBFactoryBackendProxy.cpp b/WebKit/chromium/src/IDBFactoryBackendProxy.cpp
index 18101e4..d43e787 100755
--- a/WebKit/chromium/src/IDBFactoryBackendProxy.cpp
+++ b/WebKit/chromium/src/IDBFactoryBackendProxy.cpp
@@ -65,14 +65,6 @@ void IDBFactoryBackendProxy::open(const String& name, const String& description,
m_webIDBFactory->open(name, description, new WebIDBCallbacksImpl(callbacks), origin, webFrame, dataDir);
}
-void IDBFactoryBackendProxy::abortPendingTransactions(const Vector<int>& pendingIDs)
-{
- ASSERT(pendingIDs.size());
- WebKit::WebVector<int> ids = pendingIDs;
-
- m_webIDBFactory->abortPendingTransactions(ids);
-}
-
} // namespace WebCore
#endif // ENABLE(INDEXED_DATABASE)
diff --git a/WebKit/chromium/src/IDBFactoryBackendProxy.h b/WebKit/chromium/src/IDBFactoryBackendProxy.h
index ac30cf2..6371686 100755
--- a/WebKit/chromium/src/IDBFactoryBackendProxy.h
+++ b/WebKit/chromium/src/IDBFactoryBackendProxy.h
@@ -46,7 +46,6 @@ public:
PassRefPtr<DOMStringList> databases(void) const;
virtual void open(const String& name, const String& description, PassRefPtr<IDBCallbacks>, PassRefPtr<SecurityOrigin>, Frame*, const String& dataDir);
- virtual void abortPendingTransactions(const Vector<int>& pendingIDs);
private:
IDBFactoryBackendProxy();
diff --git a/WebKit/chromium/src/IDBObjectStoreProxy.cpp b/WebKit/chromium/src/IDBObjectStoreProxy.cpp
index ad27fa3..82ca5f6 100755
--- a/WebKit/chromium/src/IDBObjectStoreProxy.cpp
+++ b/WebKit/chromium/src/IDBObjectStoreProxy.cpp
@@ -30,11 +30,13 @@
#include "IDBCallbacks.h"
#include "IDBIndexBackendProxy.h"
#include "IDBKeyRange.h"
+#include "IDBTransactionBackendProxy.h"
#include "WebIDBCallbacksImpl.h"
#include "WebIDBKeyRange.h"
#include "WebIDBIndex.h"
#include "WebIDBKey.h"
#include "WebIDBObjectStore.h"
+#include "WebIDBTransactionImpl.h"
#include "WebSerializedScriptValue.h"
#if ENABLE(INDEXED_DATABASE)
@@ -70,9 +72,12 @@ PassRefPtr<DOMStringList> IDBObjectStoreProxy::indexNames() const
return m_webIDBObjectStore->indexNames();
}
-void IDBObjectStoreProxy::get(PassRefPtr<IDBKey> key, PassRefPtr<IDBCallbacks> callbacks)
+void IDBObjectStoreProxy::get(PassRefPtr<IDBKey> key, PassRefPtr<IDBCallbacks> callbacks, IDBTransactionBackendInterface* transaction)
{
- m_webIDBObjectStore->get(key, new WebIDBCallbacksImpl(callbacks));
+ // The transaction pointer is guaranteed to be a pointer to a proxy object as, in the renderer,
+ // all implementations of IDB interfaces are proxy objects.
+ IDBTransactionBackendProxy* transactionProxy = static_cast<IDBTransactionBackendProxy*>(transaction);
+ m_webIDBObjectStore->get(key, new WebIDBCallbacksImpl(callbacks), *transactionProxy->getWebIDBTransaction());
}
void IDBObjectStoreProxy::put(PassRefPtr<SerializedScriptValue> value, PassRefPtr<IDBKey> key, bool addOnly, PassRefPtr<IDBCallbacks> callbacks)
diff --git a/WebKit/chromium/src/IDBObjectStoreProxy.h b/WebKit/chromium/src/IDBObjectStoreProxy.h
index a334572..13dfe23 100755
--- a/WebKit/chromium/src/IDBObjectStoreProxy.h
+++ b/WebKit/chromium/src/IDBObjectStoreProxy.h
@@ -46,7 +46,7 @@ public:
String keyPath() const;
PassRefPtr<DOMStringList> indexNames() const;
- void get(PassRefPtr<IDBKey> key, PassRefPtr<IDBCallbacks>);
+ void get(PassRefPtr<IDBKey> key, PassRefPtr<IDBCallbacks>, IDBTransactionBackendInterface*);
void put(PassRefPtr<SerializedScriptValue> value, PassRefPtr<IDBKey> key, bool addOnly, PassRefPtr<IDBCallbacks>);
void remove(PassRefPtr<IDBKey> key, PassRefPtr<IDBCallbacks>);
diff --git a/WebKit/chromium/src/IDBTransactionBackendProxy.cpp b/WebKit/chromium/src/IDBTransactionBackendProxy.cpp
index be6b058..59e88d8 100644
--- a/WebKit/chromium/src/IDBTransactionBackendProxy.cpp
+++ b/WebKit/chromium/src/IDBTransactionBackendProxy.cpp
@@ -69,11 +69,17 @@ void IDBTransactionBackendProxy::abort()
m_webIDBTransaction->abort();
}
-void IDBTransactionBackendProxy::scheduleTask(PassOwnPtr<ScriptExecutionContext::Task>)
+bool IDBTransactionBackendProxy::scheduleTask(PassOwnPtr<ScriptExecutionContext::Task>)
{
// This should never be reached as it's the impl objects who get to
// execute tasks in the browser process.
ASSERT_NOT_REACHED();
+ return false;
+}
+
+void IDBTransactionBackendProxy::didCompleteTaskEvents()
+{
+ m_webIDBTransaction->didCompleteTaskEvents();
}
int IDBTransactionBackendProxy::id() const
diff --git a/WebKit/chromium/src/IDBTransactionBackendProxy.h b/WebKit/chromium/src/IDBTransactionBackendProxy.h
index d62b8ff..3daf73e 100644
--- a/WebKit/chromium/src/IDBTransactionBackendProxy.h
+++ b/WebKit/chromium/src/IDBTransactionBackendProxy.h
@@ -45,10 +45,13 @@ public:
virtual PassRefPtr<IDBObjectStoreBackendInterface> objectStore(const String& name);
virtual unsigned short mode() const;
virtual void abort();
- virtual void scheduleTask(PassOwnPtr<ScriptExecutionContext::Task>);
+ virtual bool scheduleTask(PassOwnPtr<ScriptExecutionContext::Task>);
+ virtual void didCompleteTaskEvents();
virtual int id() const;
virtual void setCallbacks(IDBTransactionCallbacks*);
+ WebKit::WebIDBTransaction* getWebIDBTransaction() const { return m_webIDBTransaction.get(); }
+
private:
IDBTransactionBackendProxy(PassOwnPtr<WebKit::WebIDBTransaction>);
diff --git a/WebKit/chromium/src/LocalFileSystemChromium.cpp b/WebKit/chromium/src/LocalFileSystemChromium.cpp
index 45365ef..7bf4335 100644
--- a/WebKit/chromium/src/LocalFileSystemChromium.cpp
+++ b/WebKit/chromium/src/LocalFileSystemChromium.cpp
@@ -42,25 +42,33 @@
#include "WebFileSystemCallbacksImpl.h"
#include "WebFrameClient.h"
#include "WebFrameImpl.h"
+#include "WebWorkerImpl.h"
+#include "WorkerContext.h"
+#include "WorkerThread.h"
+#include <wtf/Threading.h>
using namespace WebKit;
namespace WebCore {
-PassRefPtr<LocalFileSystem> LocalFileSystem::create(const String& path)
+LocalFileSystem& LocalFileSystem::localFileSystem()
{
- return adoptRef(new LocalFileSystem(path));
+ AtomicallyInitializedStatic(LocalFileSystem*, localFileSystem = new LocalFileSystem(""));
+ return *localFileSystem;
}
-void LocalFileSystem::requestFileSystem(ScriptExecutionContext* context, AsyncFileSystem::Type type, long long size, PassRefPtr<FileSystemCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback)
+void LocalFileSystem::requestFileSystem(ScriptExecutionContext* context, AsyncFileSystem::Type type, long long size, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
{
ASSERT(context);
if (context->isDocument()) {
Document* document = static_cast<Document*>(context);
WebFrameImpl* webFrame = WebFrameImpl::fromFrame(document->frame());
- webFrame->client()->openFileSystem(webFrame, static_cast<WebFileSystem::Type>(type), size, new WebFileSystemCallbacksImpl(new FileSystemCallbacks(successCallback, errorCallback, context)));
+ webFrame->client()->openFileSystem(webFrame, static_cast<WebFileSystem::Type>(type), size, new WebFileSystemCallbacksImpl(callbacks));
} else {
- // FIXME: Add implementation for workers.
+ WorkerContext* workerContext = static_cast<WorkerContext*>(context);
+ WorkerLoaderProxy* workerLoaderProxy = &workerContext->thread()->workerLoaderProxy();
+ WebWorkerBase* webWorker = static_cast<WebWorkerBase*>(workerLoaderProxy);
+ webWorker->openFileSystem(static_cast<WebFileSystem::Type>(type), size, new WebFileSystemCallbacksImpl(callbacks));
}
}
diff --git a/WebKit/chromium/src/LocalizedStrings.cpp b/WebKit/chromium/src/LocalizedStrings.cpp
index 74ff699..3354c30 100644
--- a/WebKit/chromium/src/LocalizedStrings.cpp
+++ b/WebKit/chromium/src/LocalizedStrings.cpp
@@ -265,6 +265,16 @@ String contextMenuItemTagInspectElement() { return String(); }
String contextMenuItemTagShowSpellingPanel(bool show) { return String(); }
String mediaElementLiveBroadcastStateText() { return String(); }
String mediaElementLoadingStateText() { return String(); }
+String contextMenuItemTagOpenVideoInNewWindow() { return String(); }
+String contextMenuItemTagOpenAudioInNewWindow() { return String(); }
+String contextMenuItemTagCopyVideoLinkToClipboard() { return String(); }
+String contextMenuItemTagCopyAudioLinkToClipboard() { return String(); }
+String contextMenuItemTagToggleMediaControls() { return String(); }
+String contextMenuItemTagToggleMediaLoop() { return String(); }
+String contextMenuItemTagEnterVideoFullscreen() { return String(); }
+String contextMenuItemTagMediaPlay() { return String(); }
+String contextMenuItemTagMediaPause() { return String(); }
+String contextMenuItemTagMediaMute() { return String(); }
String localizedMediaControlElementString(const String& /*name*/)
{
diff --git a/WebKit/chromium/src/VideoFrameChromiumImpl.cpp b/WebKit/chromium/src/VideoFrameChromiumImpl.cpp
index 2b98320..a60fe28 100644
--- a/WebKit/chromium/src/VideoFrameChromiumImpl.cpp
+++ b/WebKit/chromium/src/VideoFrameChromiumImpl.cpp
@@ -38,14 +38,6 @@ using namespace WebCore;
namespace WebKit {
-const unsigned cMaxPlanes = 3;
-const unsigned cNumRGBPlanes = 1;
-const unsigned cRGBPlane = 0;
-const unsigned cNumYUVPlanes = 3;
-const unsigned cYPlane = 0;
-const unsigned cUPlane = 1;
-const unsigned cVPlane = 2;
-
WebVideoFrame* VideoFrameChromiumImpl::toWebVideoFrame(VideoFrameChromium* videoFrame)
{
VideoFrameChromiumImpl* wrappedFrame = static_cast<VideoFrameChromiumImpl*>(videoFrame);
@@ -108,4 +100,22 @@ const void* VideoFrameChromiumImpl::data(unsigned plane) const
return 0;
}
+const IntSize VideoFrameChromiumImpl::requiredTextureSize(unsigned plane) const
+{
+ switch (format()) {
+ case RGBA:
+ return IntSize(stride(plane), height());
+ case YV12:
+ if (plane == static_cast<unsigned>(yPlane))
+ return IntSize(stride(plane), height());
+ else if (plane == static_cast<unsigned>(uPlane))
+ return IntSize(stride(plane), height() / 2);
+ else if (plane == static_cast<unsigned>(vPlane))
+ return IntSize(stride(plane), height() / 2);
+ default:
+ break;
+ }
+ return IntSize();
+}
+
} // namespace WebKit
diff --git a/WebKit/chromium/src/VideoFrameChromiumImpl.h b/WebKit/chromium/src/VideoFrameChromiumImpl.h
index 3ad424c..042cd7e 100644
--- a/WebKit/chromium/src/VideoFrameChromiumImpl.h
+++ b/WebKit/chromium/src/VideoFrameChromiumImpl.h
@@ -56,6 +56,7 @@ public:
virtual unsigned planes() const;
virtual int stride(unsigned plane) const;
virtual const void* data(unsigned plane) const;
+ virtual const IntSize requiredTextureSize(unsigned plane) const;
private:
WebVideoFrame* m_webVideoFrame;
diff --git a/WebKit/chromium/src/WebAccessibilityCache.cpp b/WebKit/chromium/src/WebAccessibilityCache.cpp
index 8a3f697..ab8f814 100644
--- a/WebKit/chromium/src/WebAccessibilityCache.cpp
+++ b/WebKit/chromium/src/WebAccessibilityCache.cpp
@@ -42,4 +42,9 @@ void WebAccessibilityCache::enableAccessibility()
AXObjectCache::enableAccessibility();
}
+bool WebAccessibilityCache::accessibilityEnabled()
+{
+ return AXObjectCache::accessibilityEnabled();
+}
+
}
diff --git a/WebKit/chromium/src/WebBindings.cpp b/WebKit/chromium/src/WebBindings.cpp
index 4bb9022..c25c31b 100644
--- a/WebKit/chromium/src/WebBindings.cpp
+++ b/WebKit/chromium/src/WebBindings.cpp
@@ -312,6 +312,17 @@ static bool getElementImpl(NPObject* npObj, WebElement* webElement)
return true;
}
+static NPObject* makeIntArrayImpl(const WebVector<int>& data)
+{
+ v8::HandleScope handleScope;
+ v8::Handle<v8::Array> result = v8::Array::New(data.size());
+ for (size_t i = 0; i < data.size(); i++)
+ result->Set(i, v8::Number::New(data[i]));
+
+ WebCore::DOMWindow* window = WebCore::V8Proxy::retrieveWindow(WebCore::V8Proxy::currentContext());
+ return npCreateV8ScriptObject(0, result, window);
+}
+
#endif
bool WebBindings::getDragData(NPObject* event, int* eventId, WebDragData* data)
@@ -350,6 +361,16 @@ bool WebBindings::getElement(NPObject* element, WebElement* webElement)
#endif
}
+NPObject* WebBindings::makeIntArray(const WebVector<int> & data)
+{
+#if USE(V8)
+ return makeIntArrayImpl(data);
+#else
+ // Not supported on other ports (JSC, etc.).
+ return 0;
+#endif
+}
+
void WebBindings::pushExceptionHandler(ExceptionHandler handler, void* data)
{
WebCore::pushExceptionHandler(handler, data);
diff --git a/WebKit/chromium/src/WebFileSystemCallbacksImpl.h b/WebKit/chromium/src/WebFileSystemCallbacksImpl.h
index b9c825b..36ab9ff 100644
--- a/WebKit/chromium/src/WebFileSystemCallbacksImpl.h
+++ b/WebKit/chromium/src/WebFileSystemCallbacksImpl.h
@@ -43,7 +43,7 @@ class AsyncFileSystemCallbacks;
namespace WebKit {
struct WebFileInfo;
-class WebFileSystemEntry;
+struct WebFileSystemEntry;
class WebString;
class WebFileSystemCallbacksImpl : public WebFileSystemCallbacks {
diff --git a/WebKit/chromium/src/WebFrameImpl.cpp b/WebKit/chromium/src/WebFrameImpl.cpp
index 2d42f4b..1b64e5a 100644
--- a/WebKit/chromium/src/WebFrameImpl.cpp
+++ b/WebKit/chromium/src/WebFrameImpl.cpp
@@ -99,6 +99,7 @@
#include "HistoryItem.h"
#include "InspectorController.h"
#include "Page.h"
+#include "Performance.h"
#include "PlatformContextSkia.h"
#include "PluginDocument.h"
#include "PrintContext.h"
@@ -109,6 +110,7 @@
#include "ReplaceSelectionCommand.h"
#include "ResourceHandle.h"
#include "ResourceRequest.h"
+#include "SVGSMILElement.h"
#include "ScriptController.h"
#include "ScriptSourceCode.h"
#include "ScriptValue.h"
@@ -130,6 +132,7 @@
#include "WebHistoryItem.h"
#include "WebInputElement.h"
#include "WebPasswordAutocompleteListener.h"
+#include "WebPerformance.h"
#include "WebPlugin.h"
#include "WebPluginContainerImpl.h"
#include "WebRange.h"
@@ -151,7 +154,7 @@
#include "LocalCurrentGraphicsContext.h"
#endif
-#if OS(LINUX)
+#if OS(LINUX) || OS(FREEBSD)
#include <gdk/gdk.h>
#endif
@@ -307,7 +310,7 @@ public:
float scale = m_printedPageWidth / pageRect.width();
ctx.save();
-#if OS(LINUX)
+#if OS(LINUX) || OS(FREEBSD)
ctx.scale(WebCore::FloatSize(scale, scale));
#endif
ctx.translate(static_cast<float>(-pageRect.x()),
@@ -550,7 +553,7 @@ WebSize WebFrameImpl::contentsSize() const
int WebFrameImpl::contentsPreferredWidth() const
{
if (m_frame->document() && m_frame->document()->renderView())
- return m_frame->document()->renderView()->minPrefWidth();
+ return m_frame->document()->renderView()->minPreferredLogicalWidth();
return 0;
}
@@ -692,6 +695,14 @@ WebAnimationController* WebFrameImpl::animationController()
return &m_animationController;
}
+WebPerformance WebFrameImpl::performance() const
+{
+ if (!m_frame || !m_frame->domWindow())
+ return WebPerformance();
+
+ return WebPerformance(m_frame->domWindow()->webkitPerformance());
+}
+
WebSecurityOrigin WebFrameImpl::securityOrigin() const
{
if (!m_frame || !m_frame->document())
@@ -1071,6 +1082,22 @@ WebRange WebFrameImpl::markedRange() const
return frame()->editor()->compositionRange();
}
+bool WebFrameImpl::firstRectForCharacterRange(unsigned location, unsigned length, WebRect& rect) const
+{
+ if ((location + length < location) && (location + length))
+ length = 0;
+
+ Element* selectionRoot = frame()->selection()->rootEditableElement();
+ Element* scope = selectionRoot ? selectionRoot : frame()->document()->documentElement();
+ RefPtr<Range> range = TextIterator::rangeFromLocationAndLength(scope, location, length);
+ if (!range)
+ return false;
+ IntRect intRect = frame()->editor()->firstRectForRange(range.get());
+ rect = WebRect(intRect.x(), intRect.y(), intRect.width(), intRect.height());
+
+ return true;
+}
+
bool WebFrameImpl::executeCommand(const WebString& name)
{
ASSERT(frame());
@@ -1712,6 +1739,26 @@ bool WebFrameImpl::selectionStartHasSpellingMarkerFor(int from, int length) cons
return m_frame->editor()->selectionStartHasSpellingMarkerFor(from, length);
}
+bool WebFrameImpl::pauseSVGAnimation(const WebString& animationId, double time, const WebString& elementId)
+{
+#if !ENABLE(SVG)
+ return false;
+#else
+ if (!m_frame)
+ return false;
+
+ Document* document = m_frame->document();
+ if (!document || !document->svgExtensions())
+ return false;
+
+ Node* coreNode = document->getElementById(animationId);
+ if (!coreNode || !SVGSMILElement::isSMILElement(coreNode))
+ return false;
+
+ return document->accessSVGExtensions()->sampleAnimationAtTime(elementId, static_cast<SVGSMILElement*>(coreNode), time);
+#endif
+}
+
// WebFrameImpl public ---------------------------------------------------------
PassRefPtr<WebFrameImpl> WebFrameImpl::create(WebFrameClient* client)
diff --git a/WebKit/chromium/src/WebFrameImpl.h b/WebKit/chromium/src/WebFrameImpl.h
index 25e7004..d93254b 100644
--- a/WebKit/chromium/src/WebFrameImpl.h
+++ b/WebKit/chromium/src/WebFrameImpl.h
@@ -56,6 +56,7 @@ class WebDataSourceImpl;
class WebInputElement;
class WebFrameClient;
class WebPasswordAutocompleteListener;
+class WebPerformance;
class WebPluginContainerImpl;
class WebView;
class WebViewImpl;
@@ -90,6 +91,7 @@ public:
virtual WebDocument document() const;
virtual void forms(WebVector<WebFormElement>&) const;
virtual WebAnimationController* animationController();
+ virtual WebPerformance performance() const;
virtual WebSecurityOrigin securityOrigin() const;
virtual void grantUniversalAccess();
virtual NPObject* windowObject() const;
@@ -135,6 +137,7 @@ public:
virtual void unmarkText();
virtual bool hasMarkedText() const;
virtual WebRange markedRange() const;
+ virtual bool firstRectForCharacterRange(unsigned location, unsigned length, WebRect&) const;
virtual bool executeCommand(const WebString&);
virtual bool executeCommand(const WebString&, const WebString& value);
virtual bool isCommandEnabled(const WebString&) const;
@@ -183,6 +186,9 @@ public:
virtual WebRect selectionBoundsRect() const;
virtual bool selectionStartHasSpellingMarkerFor(int from, int length) const;
+ virtual bool pauseSVGAnimation(const WebString& animationId,
+ double time,
+ const WebString& elementId);
static PassRefPtr<WebFrameImpl> create(WebFrameClient* client);
~WebFrameImpl();
diff --git a/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.cpp b/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.cpp
index 24dcf9a..45bc2ee 100644
--- a/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.cpp
+++ b/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.cpp
@@ -38,12 +38,21 @@
#include "app/gfx/gl/gl_context.h"
#include "NotImplemented.h"
#include <wtf/PassOwnPtr.h>
+#include <wtf/text/CString.h>
#include <stdio.h>
#include <string.h>
namespace WebKit {
+enum {
+ IMPLEMENTATION_COLOR_READ_FORMAT = 0x8B9B,
+ IMPLEMENTATION_COLOR_READ_TYPE = 0x8B9A,
+ MAX_VERTEX_UNIFORM_VECTORS = 0x8DFB,
+ MAX_VARYING_VECTORS = 0x8DFC,
+ MAX_FRAGMENT_UNIFORM_VECTORS = 0x8DFD
+};
+
WebGraphicsContext3DDefaultImpl::VertexAttribPointerState::VertexAttribPointerState()
: enabled(false)
, buffer(0)
@@ -69,6 +78,8 @@ WebGraphicsContext3DDefaultImpl::WebGraphicsContext3DDefaultImpl()
, m_scanline(0)
#endif
, m_boundArrayBuffer(0)
+ , m_fragmentCompiler(0)
+ , m_vertexCompiler(0)
{
}
@@ -94,6 +105,8 @@ WebGraphicsContext3DDefaultImpl::~WebGraphicsContext3DDefaultImpl()
glDeleteFramebuffersEXT(1, &m_fbo);
m_glContext->Destroy();
+
+ angleDestroyCompilers();
}
}
@@ -115,15 +128,16 @@ bool WebGraphicsContext3DDefaultImpl::initialize(WebGraphicsContext3D::Attribute
validateAttributes();
glEnable(GL_VERTEX_PROGRAM_POINT_SIZE);
+
+ if (!angleCreateCompilers()) {
+ angleDestroyCompilers();
+ return false;
+ }
+
m_initialized = true;
return true;
}
-bool WebGraphicsContext3DDefaultImpl::initialize(WebGraphicsContext3D::Attributes attributes, WebView* webView)
-{
- return initialize(attributes, webView, false);
-}
-
void WebGraphicsContext3DDefaultImpl::validateAttributes()
{
const char* extensions = reinterpret_cast<const char*>(glGetString(GL_EXTENSIONS));
@@ -657,7 +671,33 @@ DELEGATE_TO_GL_1(clearStencil, ClearStencil, long)
DELEGATE_TO_GL_4(colorMask, ColorMask, bool, bool, bool, bool)
-DELEGATE_TO_GL_1(compileShader, CompileShader, WebGLId)
+void WebGraphicsContext3DDefaultImpl::compileShader(WebGLId shader)
+{
+ makeContextCurrent();
+
+ ShaderSourceMap::iterator result = m_shaderSourceMap.find(shader);
+ if (result == m_shaderSourceMap.end()) {
+ // Passing down to gl driver to generate the correct error; or the case
+ // where the shader deletion is delayed when it's attached to a program.
+ glCompileShader(shader);
+ return;
+ }
+ ShaderSourceEntry& entry = result->second;
+
+ if (!angleValidateShaderSource(entry))
+ return; // Shader didn't validate, don't move forward with compiling translated source
+
+ int shaderLength = entry.translatedSource ? strlen(entry.translatedSource) : 0;
+ glShaderSource(shader, 1, const_cast<const char**>(&entry.translatedSource), &shaderLength);
+ glCompileShader(shader);
+
+#ifndef NDEBUG
+ int compileStatus;
+ glGetShaderiv(shader, GL_COMPILE_STATUS, &compileStatus);
+ // ASSERT that ANGLE generated GLSL will be accepted by OpenGL
+ ASSERT(compileStatus == GL_TRUE);
+#endif
+}
void WebGraphicsContext3DDefaultImpl::copyTexImage2D(unsigned long target, long level, unsigned long internalformat,
long x, long y, unsigned long width, unsigned long height, long border)
@@ -871,21 +911,21 @@ void WebGraphicsContext3DDefaultImpl::getIntegerv(unsigned long pname, int* valu
// Therefore, the value returned by desktop GL needs to be divided by 4.
makeContextCurrent();
switch (pname) {
- case 0x8B9B: // IMPLEMENTATION_COLOR_READ_FORMAT
+ case IMPLEMENTATION_COLOR_READ_FORMAT:
*value = GL_RGB;
break;
- case 0x8B9A: // IMPLEMENTATION_COLOR_READ_TYPE
+ case IMPLEMENTATION_COLOR_READ_TYPE:
*value = GL_UNSIGNED_BYTE;
break;
- case 0x8DFD: // MAX_FRAGMENT_UNIFORM_VECTORS
+ case MAX_FRAGMENT_UNIFORM_VECTORS:
glGetIntegerv(GL_MAX_FRAGMENT_UNIFORM_COMPONENTS, value);
*value /= 4;
break;
- case 0x8DFB: // MAX_VERTEX_UNIFORM_VECTORS
+ case MAX_VERTEX_UNIFORM_VECTORS:
glGetIntegerv(GL_MAX_VERTEX_UNIFORM_COMPONENTS, value);
*value /= 4;
break;
- case 0x8DFC: // MAX_VARYING_VECTORS
+ case MAX_VARYING_VECTORS:
glGetIntegerv(GL_MAX_VARYING_FLOATS, value);
*value /= 4;
break;
@@ -916,14 +956,57 @@ WebString WebGraphicsContext3DDefaultImpl::getProgramInfoLog(WebGLId program)
DELEGATE_TO_GL_3(getRenderbufferParameteriv, GetRenderbufferParameterivEXT, unsigned long, unsigned long, int*)
-DELEGATE_TO_GL_3(getShaderiv, GetShaderiv, WebGLId, unsigned long, int*)
+void WebGraphicsContext3DDefaultImpl::getShaderiv(WebGLId shader, unsigned long pname, int* value)
+{
+ makeContextCurrent();
+
+ ShaderSourceMap::iterator result = m_shaderSourceMap.find(shader);
+ if (result != m_shaderSourceMap.end()) {
+ ShaderSourceEntry& entry = result->second;
+ switch (pname) {
+ case GL_COMPILE_STATUS:
+ if (!entry.isValid) {
+ *value = 0;
+ return;
+ }
+ break;
+ case GL_INFO_LOG_LENGTH:
+ if (!entry.isValid) {
+ *value = entry.log ? strlen(entry.log) : 0;
+ if (*value)
+ (*value)++;
+ return;
+ }
+ break;
+ case GL_SHADER_SOURCE_LENGTH:
+ *value = entry.source ? strlen(entry.source) : 0;
+ if (*value)
+ (*value)++;
+ return;
+ }
+ }
+
+ glGetShaderiv(shader, pname, value);
+}
WebString WebGraphicsContext3DDefaultImpl::getShaderInfoLog(WebGLId shader)
{
makeContextCurrent();
- GLint logLength;
+
+ ShaderSourceMap::iterator result = m_shaderSourceMap.find(shader);
+ if (result != m_shaderSourceMap.end()) {
+ ShaderSourceEntry& entry = result->second;
+ if (!entry.isValid) {
+ if (!entry.log)
+ return WebString();
+ WebString res = WebString::fromUTF8(entry.log, strlen(entry.log));
+ return res;
+ }
+ }
+
+ GLint logLength = 0;
glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &logLength);
- if (!logLength)
+ if (logLength <= 1)
return WebString();
GLchar* log = 0;
if (!tryFastMalloc(logLength * sizeof(GLchar)).getValue(log))
@@ -939,9 +1022,19 @@ WebString WebGraphicsContext3DDefaultImpl::getShaderInfoLog(WebGLId shader)
WebString WebGraphicsContext3DDefaultImpl::getShaderSource(WebGLId shader)
{
makeContextCurrent();
- GLint logLength;
+
+ ShaderSourceMap::iterator result = m_shaderSourceMap.find(shader);
+ if (result != m_shaderSourceMap.end()) {
+ ShaderSourceEntry& entry = result->second;
+ if (!entry.source)
+ return WebString();
+ WebString res = WebString::fromUTF8(entry.source, strlen(entry.source));
+ return res;
+ }
+
+ GLint logLength = 0;
glGetShaderiv(shader, GL_SHADER_SOURCE_LENGTH, &logLength);
- if (!logLength)
+ if (logLength <= 1)
return WebString();
GLchar* log = 0;
if (!tryFastMalloc(logLength * sizeof(GLchar)).getValue(log))
@@ -1061,8 +1154,19 @@ DELEGATE_TO_GL_4(scissor, Scissor, long, long, unsigned long, unsigned long)
void WebGraphicsContext3DDefaultImpl::shaderSource(WebGLId shader, const char* string)
{
makeContextCurrent();
- GLint length = strlen(string);
- glShaderSource(shader, 1, &string, &length);
+ GLint length = string ? strlen(string) : 0;
+ ShaderSourceMap::iterator result = m_shaderSourceMap.find(shader);
+ if (result != m_shaderSourceMap.end()) {
+ ShaderSourceEntry& entry = result->second;
+ if (entry.source) {
+ fastFree(entry.source);
+ entry.source = 0;
+ }
+ if (!tryFastMalloc((length + 1) * sizeof(char)).getValue(entry.source))
+ return; // FIXME: generate an error?
+ memcpy(entry.source, string, (length + 1) * sizeof(char));
+ } else
+ glShaderSource(shader, 1, &string, &length);
}
DELEGATE_TO_GL_3(stencilFunc, StencilFunc, unsigned long, long, unsigned long)
@@ -1201,7 +1305,18 @@ unsigned WebGraphicsContext3DDefaultImpl::createRenderbuffer()
return o;
}
-DELEGATE_TO_GL_1R(createShader, CreateShader, unsigned long, unsigned);
+unsigned WebGraphicsContext3DDefaultImpl::createShader(unsigned long shaderType)
+{
+ makeContextCurrent();
+ ASSERT(shaderType == GL_VERTEX_SHADER || shaderType == GL_FRAGMENT_SHADER);
+ unsigned shader = glCreateShader(shaderType);
+ if (shader) {
+ ShaderSourceEntry entry;
+ entry.type = shaderType;
+ m_shaderSourceMap.set(shader, entry);
+ }
+ return shader;
+}
unsigned WebGraphicsContext3DDefaultImpl::createTexture()
{
@@ -1239,6 +1354,7 @@ void WebGraphicsContext3DDefaultImpl::deleteShader(unsigned shader)
{
makeContextCurrent();
glDeleteShader(shader);
+ m_shaderSourceMap.remove(shader);
}
void WebGraphicsContext3DDefaultImpl::deleteTexture(unsigned texture)
@@ -1247,6 +1363,92 @@ void WebGraphicsContext3DDefaultImpl::deleteTexture(unsigned texture)
glDeleteTextures(1, &texture);
}
+bool WebGraphicsContext3DDefaultImpl::angleCreateCompilers()
+{
+ if (!ShInitialize())
+ return false;
+
+ TBuiltInResource resource;
+ resource.MaxVertexAttribs = 0;
+ getIntegerv(GL_MAX_VERTEX_ATTRIBS, &resource.MaxVertexAttribs);
+ resource.MaxVertexUniformVectors = 0;
+ getIntegerv(MAX_VERTEX_UNIFORM_VECTORS,
+ &resource.MaxVertexUniformVectors);
+ resource.MaxVaryingVectors = 0;
+ getIntegerv(MAX_VARYING_VECTORS,
+ &resource.MaxVaryingVectors);
+ resource.MaxVertexTextureImageUnits = 0;
+ getIntegerv(GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS, &resource.MaxVertexTextureImageUnits);
+ resource.MaxCombinedTextureImageUnits = 0;
+ getIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, &resource.MaxCombinedTextureImageUnits);
+ resource.MaxTextureImageUnits = 0;
+ getIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS, &resource.MaxTextureImageUnits);
+ resource.MaxFragmentUniformVectors = 0;
+ getIntegerv(MAX_FRAGMENT_UNIFORM_VECTORS,
+ &resource.MaxFragmentUniformVectors);
+ // Always set to 1 for OpenGL ES.
+ resource.MaxDrawBuffers = 1;
+
+ m_fragmentCompiler = ShConstructCompiler(EShLangFragment, EShSpecWebGL, &resource);
+ m_vertexCompiler = ShConstructCompiler(EShLangVertex, EShSpecWebGL, &resource);
+ return (m_fragmentCompiler && m_vertexCompiler);
+}
+
+void WebGraphicsContext3DDefaultImpl::angleDestroyCompilers()
+{
+ if (m_fragmentCompiler) {
+ ShDestruct(m_fragmentCompiler);
+ m_fragmentCompiler = 0;
+ }
+ if (m_vertexCompiler) {
+ ShDestruct(m_vertexCompiler);
+ m_vertexCompiler = 0;
+ }
+}
+
+bool WebGraphicsContext3DDefaultImpl::angleValidateShaderSource(ShaderSourceEntry& entry)
+{
+ entry.isValid = false;
+ if (entry.translatedSource) {
+ fastFree(entry.translatedSource);
+ entry.translatedSource = 0;
+ }
+ if (entry.log) {
+ fastFree(entry.log);
+ entry.log = 0;
+ }
+
+ ShHandle compiler = 0;
+ switch (entry.type) {
+ case GL_FRAGMENT_SHADER:
+ compiler = m_fragmentCompiler;
+ break;
+ case GL_VERTEX_SHADER:
+ compiler = m_vertexCompiler;
+ break;
+ }
+ if (!compiler)
+ return false;
+
+ if (!ShCompile(compiler, &entry.source, 1, EShOptObjectCode)) {
+ int logSize = 0;
+ ShGetInfo(compiler, SH_INFO_LOG_LENGTH, &logSize);
+ if (logSize > 1 && tryFastMalloc(logSize * sizeof(char)).getValue(entry.log))
+ ShGetInfoLog(compiler, entry.log);
+ return false;
+ }
+
+ int length = 0;
+ ShGetInfo(compiler, SH_OBJECT_CODE_LENGTH, &length);
+ if (length > 1) {
+ if (!tryFastMalloc(length * sizeof(char)).getValue(entry.translatedSource))
+ return false;
+ ShGetObjectCode(compiler, entry.translatedSource);
+ }
+ entry.isValid = true;
+ return true;
+}
+
} // namespace WebKit
#endif // ENABLE(3D_CANVAS)
diff --git a/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.h b/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.h
index 5bf439a..319d9d8 100644
--- a/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.h
+++ b/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.h
@@ -33,8 +33,10 @@
#if ENABLE(3D_CANVAS)
+#include "GLSLANG/ShaderLang.h"
#include "WebGraphicsContext3D.h"
+#include <wtf/HashMap.h>
#include <wtf/ListHashSet.h>
#include <wtf/OwnPtr.h>
@@ -60,8 +62,6 @@ public:
//----------------------------------------------------------------------
// WebGraphicsContext3D methods
virtual bool initialize(WebGraphicsContext3D::Attributes attributes, WebView*, bool);
- // FIXME: remove once compositor is switched over to GraphicsContext3D.
- virtual bool initialize(WebGraphicsContext3D::Attributes attributes, WebView*);
virtual bool makeContextCurrent();
virtual int width();
@@ -302,8 +302,7 @@ private:
// need to in order to verify that all enabled vertex arrays have
// a valid buffer bound -- to avoid crashes on certain cards.
unsigned int m_boundArrayBuffer;
- class VertexAttribPointerState {
- public:
+ struct VertexAttribPointerState {
VertexAttribPointerState();
bool enabled;
@@ -325,6 +324,44 @@ private:
ListHashSet<unsigned long> m_syntheticErrors;
OwnPtr<gfx::GLContext> m_glContext;
+
+ // ANGLE related.
+ struct ShaderSourceEntry {
+ ShaderSourceEntry()
+ : type(0)
+ , source(0)
+ , log(0)
+ , translatedSource(0)
+ , isValid(false)
+ {
+ }
+
+ ~ShaderSourceEntry()
+ {
+ if (source)
+ fastFree(source);
+ if (log)
+ fastFree(log);
+ if (translatedSource)
+ fastFree(translatedSource);
+ }
+
+ unsigned long type;
+ char* source;
+ char* log;
+ char* translatedSource;
+ bool isValid;
+ };
+
+ bool angleCreateCompilers();
+ void angleDestroyCompilers();
+ bool angleValidateShaderSource(ShaderSourceEntry& entry);
+
+ typedef HashMap<WebGLId, ShaderSourceEntry> ShaderSourceMap;
+ ShaderSourceMap m_shaderSourceMap;
+
+ ShHandle m_fragmentCompiler;
+ ShHandle m_vertexCompiler;
};
} // namespace WebKit
diff --git a/WebKit/chromium/src/WebIDBFactory.cpp b/WebKit/chromium/src/WebIDBFactory.cpp
new file mode 100755
index 0000000..b186b68
--- /dev/null
+++ b/WebKit/chromium/src/WebIDBFactory.cpp
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "WebIDBFactory.h"
+
+#if ENABLE(INDEXED_DATABASE)
+
+#include "IDBFactoryBackendImpl.h"
+#include "SecurityOrigin.h"
+
+using namespace WebCore;
+
+namespace WebKit {
+
+WebString WebIDBFactory::databaseFileName(const WebString& name, const WebSecurityOrigin& origin)
+{
+ RefPtr<SecurityOrigin> securityOrigin;
+ securityOrigin = origin;
+ return IDBFactoryBackendImpl::databaseFileName(name, securityOrigin.get());
+}
+
+}
+
+#endif // ENABLE(INDEXED_DATABASE)
diff --git a/WebKit/chromium/src/WebIDBFactoryImpl.cpp b/WebKit/chromium/src/WebIDBFactoryImpl.cpp
index 3c8d459..7147cf0 100755
--- a/WebKit/chromium/src/WebIDBFactoryImpl.cpp
+++ b/WebKit/chromium/src/WebIDBFactoryImpl.cpp
@@ -63,15 +63,6 @@ void WebIDBFactoryImpl::open(const WebString& name, const WebString& description
m_idbFactoryBackend->open(name, description, IDBCallbacksProxy::create(callbacks), origin, 0, dataDir);
}
-void WebIDBFactoryImpl::abortPendingTransactions(const WebVector<int>& pendingIDs)
-{
- WTF::Vector<int> ids(pendingIDs.size());
- for (size_t i = 0; i < pendingIDs.size(); ++i)
- ids[i] = pendingIDs[i];
-
- m_idbFactoryBackend->abortPendingTransactions(ids);
-}
-
} // namespace WebKit
#endif // ENABLE(INDEXED_DATABASE)
diff --git a/WebKit/chromium/src/WebIDBFactoryImpl.h b/WebKit/chromium/src/WebIDBFactoryImpl.h
index 4dc0a10..a0a4d7d 100755
--- a/WebKit/chromium/src/WebIDBFactoryImpl.h
+++ b/WebKit/chromium/src/WebIDBFactoryImpl.h
@@ -43,7 +43,6 @@ public:
virtual ~WebIDBFactoryImpl();
virtual void open(const WebString& name, const WebString& description, WebIDBCallbacks*, const WebSecurityOrigin&, WebFrame*, const WebString& dataDir);
- virtual void abortPendingTransactions(const WebVector<int>& pendingIDs);
private:
WTF::RefPtr<WebCore::IDBFactoryBackendInterface> m_idbFactoryBackend;
diff --git a/WebKit/chromium/src/WebIDBObjectStoreImpl.cpp b/WebKit/chromium/src/WebIDBObjectStoreImpl.cpp
index 1ad1d9f..36d8ace 100755
--- a/WebKit/chromium/src/WebIDBObjectStoreImpl.cpp
+++ b/WebKit/chromium/src/WebIDBObjectStoreImpl.cpp
@@ -33,6 +33,7 @@
#include "WebIDBIndexImpl.h"
#include "WebIDBKey.h"
#include "WebIDBKeyRange.h"
+#include "WebIDBTransaction.h"
#include "WebSerializedScriptValue.h"
#if ENABLE(INDEXED_DATABASE)
@@ -65,9 +66,9 @@ WebDOMStringList WebIDBObjectStoreImpl::indexNames() const
return m_objectStore->indexNames();
}
-void WebIDBObjectStoreImpl::get(const WebIDBKey& key, WebIDBCallbacks* callbacks)
+void WebIDBObjectStoreImpl::get(const WebIDBKey& key, WebIDBCallbacks* callbacks, const WebIDBTransaction& transaction)
{
- m_objectStore->get(key, IDBCallbacksProxy::create(callbacks));
+ m_objectStore->get(key, IDBCallbacksProxy::create(callbacks), transaction.getIDBTransactionBackendInterface());
}
void WebIDBObjectStoreImpl::put(const WebSerializedScriptValue& value, const WebIDBKey& key, bool addOnly, WebIDBCallbacks* callbacks)
diff --git a/WebKit/chromium/src/WebIDBObjectStoreImpl.h b/WebKit/chromium/src/WebIDBObjectStoreImpl.h
index 9f31369..a9f1200 100755
--- a/WebKit/chromium/src/WebIDBObjectStoreImpl.h
+++ b/WebKit/chromium/src/WebIDBObjectStoreImpl.h
@@ -47,7 +47,7 @@ public:
WebString keyPath() const;
WebDOMStringList indexNames() const;
- void get(const WebIDBKey& key, WebIDBCallbacks*);
+ void get(const WebIDBKey& key, WebIDBCallbacks*, const WebIDBTransaction&);
void put(const WebSerializedScriptValue& value, const WebIDBKey& key, bool addOnly, WebIDBCallbacks*);
void remove(const WebIDBKey& key, WebIDBCallbacks*);
diff --git a/WebKit/chromium/src/WebIDBTransactionImpl.cpp b/WebKit/chromium/src/WebIDBTransactionImpl.cpp
index 0dc9702..f5d8748 100644
--- a/WebKit/chromium/src/WebIDBTransactionImpl.cpp
+++ b/WebKit/chromium/src/WebIDBTransactionImpl.cpp
@@ -64,6 +64,11 @@ void WebIDBTransactionImpl::abort()
m_backend->abort();
}
+void WebIDBTransactionImpl::didCompleteTaskEvents()
+{
+ m_backend->didCompleteTaskEvents();
+}
+
int WebIDBTransactionImpl::id() const
{
return m_backend->id();
@@ -75,6 +80,11 @@ void WebIDBTransactionImpl::setCallbacks(WebIDBTransactionCallbacks* callbacks)
m_backend->setCallbacks(idbCallbacks.get());
}
+IDBTransactionBackendInterface* WebIDBTransactionImpl::getIDBTransactionBackendInterface() const
+{
+ return m_backend.get();
+}
+
} // namespace WebKit
#endif // ENABLE(INDEXED_DATABASE)
diff --git a/WebKit/chromium/src/WebIDBTransactionImpl.h b/WebKit/chromium/src/WebIDBTransactionImpl.h
index a9bde68..24bab91 100644
--- a/WebKit/chromium/src/WebIDBTransactionImpl.h
+++ b/WebKit/chromium/src/WebIDBTransactionImpl.h
@@ -33,8 +33,6 @@
#include <wtf/PassRefPtr.h>
#include <wtf/RefPtr.h>
-namespace WebCore { class IDBTransactionBackendInterface; }
-
namespace WebKit {
// See comment in WebIndexedDatabase for a high level overview these classes.
@@ -46,9 +44,12 @@ public:
virtual int mode() const;
virtual WebIDBObjectStore* objectStore(const WebString& name);
virtual void abort();
+ virtual void didCompleteTaskEvents();
virtual int id() const;
virtual void setCallbacks(WebIDBTransactionCallbacks*);
+ virtual WebCore::IDBTransactionBackendInterface* getIDBTransactionBackendInterface() const;
+
private:
WTF::RefPtr<WebCore::IDBTransactionBackendInterface> m_backend;
};
diff --git a/WebKit/chromium/src/WebInputElement.cpp b/WebKit/chromium/src/WebInputElement.cpp
index 25d484c..7779dbc 100644
--- a/WebKit/chromium/src/WebInputElement.cpp
+++ b/WebKit/chromium/src/WebInputElement.cpp
@@ -75,11 +75,6 @@ bool WebInputElement::isEnabledFormControl() const
return constUnwrap<HTMLInputElement>()->isEnabledFormControl();
}
-WebInputElement::InputType WebInputElement::inputType() const
-{
- return static_cast<InputType>(constUnwrap<HTMLInputElement>()->deprecatedInputType());
-}
-
int WebInputElement::maxLength() const
{
return constUnwrap<HTMLInputElement>()->maxLength();
diff --git a/WebKit/chromium/src/WebPerformance.cpp b/WebKit/chromium/src/WebPerformance.cpp
new file mode 100644
index 0000000..f019793
--- /dev/null
+++ b/WebKit/chromium/src/WebPerformance.cpp
@@ -0,0 +1,160 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "WebPerformance.h"
+
+#include "Performance.h"
+
+using namespace WebCore;
+
+namespace WebKit {
+
+void WebPerformance::reset()
+{
+ m_private.reset();
+}
+
+void WebPerformance::assign(const WebPerformance& other)
+{
+ m_private = other.m_private;
+}
+
+WebNavigationType WebPerformance::navigationType() const
+{
+ switch (m_private->navigation()->type()) {
+ case Navigation::NAVIGATE:
+ return WebNavigationTypeOther;
+ case Navigation::RELOAD:
+ return WebNavigationTypeReload;
+ case Navigation::BACK_FORWARD:
+ return WebNavigationTypeBackForward;
+ }
+ ASSERT_NOT_REACHED();
+ return WebNavigationTypeOther;
+}
+
+double WebPerformance::navigationStart() const
+{
+ return static_cast<double>(m_private->timing()->navigationStart());
+}
+
+double WebPerformance::unloadEventEnd() const
+{
+ return static_cast<double>(m_private->timing()->unloadEventEnd());
+}
+
+double WebPerformance::redirectStart() const
+{
+ return static_cast<double>(m_private->timing()->redirectStart());
+}
+
+double WebPerformance::redirectEnd() const
+{
+ return static_cast<double>(m_private->timing()->redirectEnd());
+}
+
+unsigned short WebPerformance::redirectCount() const
+{
+ return m_private->navigation()->redirectCount();
+}
+
+double WebPerformance::fetchStart() const
+{
+ return static_cast<double>(m_private->timing()->fetchStart());
+}
+
+double WebPerformance::domainLookupStart() const
+{
+ return static_cast<double>(m_private->timing()->domainLookupStart());
+}
+
+double WebPerformance::domainLookupEnd() const
+{
+ return static_cast<double>(m_private->timing()->domainLookupEnd());
+}
+
+double WebPerformance::connectStart() const
+{
+ return static_cast<double>(m_private->timing()->connectStart());
+}
+
+double WebPerformance::connectEnd() const
+{
+ return static_cast<double>(m_private->timing()->connectEnd());
+}
+
+double WebPerformance::requestStart() const
+{
+ return static_cast<double>(m_private->timing()->requestStart());
+}
+
+double WebPerformance::requestEnd() const
+{
+ return static_cast<double>(m_private->timing()->requestEnd());
+}
+
+double WebPerformance::responseStart() const
+{
+ return static_cast<double>(m_private->timing()->responseStart());
+}
+
+double WebPerformance::responseEnd() const
+{
+ return static_cast<double>(m_private->timing()->responseEnd());
+}
+
+double WebPerformance::loadEventStart() const
+{
+ return static_cast<double>(m_private->timing()->loadEventStart());
+}
+
+double WebPerformance::loadEventEnd() const
+{
+ return static_cast<double>(m_private->timing()->loadEventEnd());
+}
+
+WebPerformance::WebPerformance(const PassRefPtr<Performance>& performance)
+ : m_private(performance)
+{
+}
+
+WebPerformance& WebPerformance::operator=(const PassRefPtr<Performance>& performance)
+{
+ m_private = performance;
+ return *this;
+}
+
+WebPerformance::operator PassRefPtr<Performance>() const
+{
+ return m_private.get();
+}
+
+} // namespace WebKit
diff --git a/WebKit/chromium/src/WebScriptController.cpp b/WebKit/chromium/src/WebScriptController.cpp
index d2c168d..8877ba0 100644
--- a/WebKit/chromium/src/WebScriptController.cpp
+++ b/WebKit/chromium/src/WebScriptController.cpp
@@ -43,7 +43,7 @@ namespace WebKit {
void WebScriptController::registerExtension(v8::Extension* extension)
{
- V8Proxy::registerExtension(extension, WebString());
+ V8Proxy::registerExtension(extension);
}
void WebScriptController::registerExtension(v8::Extension* extension,
diff --git a/WebKit/chromium/src/WebSettingsImpl.cpp b/WebKit/chromium/src/WebSettingsImpl.cpp
index 329027c..9953b5c 100644
--- a/WebKit/chromium/src/WebSettingsImpl.cpp
+++ b/WebKit/chromium/src/WebSettingsImpl.cpp
@@ -289,4 +289,14 @@ void WebSettingsImpl::setMemoryInfoEnabled(bool enabled)
m_settings->setMemoryInfoEnabled(enabled);
}
+void WebSettingsImpl::setHyperlinkAuditingEnabled(bool enabled)
+{
+ m_settings->setHyperlinkAuditingEnabled(enabled);
+}
+
+void WebSettingsImpl::setCaretBrowsingEnabled(bool enabled)
+{
+ m_settings->setCaretBrowsingEnabled(enabled);
+}
+
} // namespace WebKit
diff --git a/WebKit/chromium/src/WebSettingsImpl.h b/WebKit/chromium/src/WebSettingsImpl.h
index 0120dbc..6d40b4f 100644
--- a/WebKit/chromium/src/WebSettingsImpl.h
+++ b/WebKit/chromium/src/WebSettingsImpl.h
@@ -89,6 +89,8 @@ public:
virtual void setAcceleratedCompositingEnabled(bool);
virtual void setAccelerated2dCanvasEnabled(bool);
virtual void setMemoryInfoEnabled(bool);
+ virtual void setHyperlinkAuditingEnabled(bool);
+ virtual void setCaretBrowsingEnabled(bool);
private:
WebCore::Settings* m_settings;
diff --git a/WebKit/chromium/src/WebViewImpl.cpp b/WebKit/chromium/src/WebViewImpl.cpp
index a1c6578..c3df0c7 100644
--- a/WebKit/chromium/src/WebViewImpl.cpp
+++ b/WebKit/chromium/src/WebViewImpl.cpp
@@ -125,7 +125,7 @@
#if OS(WINDOWS)
#include "RenderThemeChromiumWin.h"
#else
-#if OS(LINUX)
+#if OS(LINUX) || OS(FREEBSD)
#include "RenderThemeChromiumLinux.h"
#endif
#include "RenderTheme.h"
@@ -429,7 +429,7 @@ void WebViewImpl::mouseDown(const WebMouseEvent& event)
|| (event.button == WebMouseEvent::ButtonLeft
&& event.modifiers & WebMouseEvent::ControlKey))
mouseContextMenu(event);
-#elif OS(LINUX)
+#elif OS(LINUX) || OS(FREEBSD)
if (event.button == WebMouseEvent::ButtonRight)
mouseContextMenu(event);
#endif
@@ -468,7 +468,7 @@ void WebViewImpl::mouseUp(const WebMouseEvent& event)
if (!mainFrameImpl() || !mainFrameImpl()->frameView())
return;
-#if OS(LINUX)
+#if OS(LINUX) || OS(FREEBSD)
// If the event was a middle click, attempt to copy text into the focused
// frame. We execute this before we let the page have a go at the event
// because the page may change what is focused during in its event handler.
@@ -552,11 +552,11 @@ bool WebViewImpl::keyEvent(const WebKeyboardEvent& event)
if (!handler)
return keyEventDefault(event);
-#if OS(WINDOWS) || OS(LINUX)
+#if OS(WINDOWS) || OS(LINUX) || OS(FREEBSD)
const WebInputEvent::Type contextMenuTriggeringEventType =
#if OS(WINDOWS)
WebInputEvent::KeyUp;
-#elif OS(LINUX)
+#elif OS(LINUX) || OS(FREEBSD)
WebInputEvent::RawKeyDown;
#endif
@@ -700,7 +700,7 @@ bool WebViewImpl::touchEvent(const WebTouchEvent& event)
}
#endif
-#if OS(WINDOWS) || OS(LINUX)
+#if OS(WINDOWS) || OS(LINUX) || OS(FREEBSD)
// Mac has no way to open a context menu based on a keyboard event.
bool WebViewImpl::sendContextMenuEvent(const WebKeyboardEvent& event)
{
@@ -925,7 +925,7 @@ void WebViewImpl::resize(const WebSize& newSize)
m_client->didInvalidateRect(damagedRect);
}
-#if OS(DARWIN)
+#if USE(ACCELERATED_COMPOSITING) && OS(DARWIN)
if (m_layerRenderer) {
m_layerRenderer->resizeOnscreenContent(WebCore::IntSize(std::max(1, m_size.width),
std::max(1, m_size.height)));
@@ -1041,8 +1041,6 @@ void WebViewImpl::composite(bool finish)
#endif
}
-// FIXME: m_currentInputEvent should be removed once ChromeClient::show() can
-// get the current-event information from WebCore.
const WebInputEvent* WebViewImpl::m_currentInputEvent = 0;
bool WebViewImpl::handleInputEvent(const WebInputEvent& inputEvent)
@@ -1057,6 +1055,8 @@ bool WebViewImpl::handleInputEvent(const WebInputEvent& inputEvent)
if (m_ignoreInputEvents)
return true;
+ m_currentInputEvent = &inputEvent;
+
if (m_mouseCaptureNode.get() && WebInputEvent::isMouseEventType(inputEvent.type)) {
// Save m_mouseCaptureNode since mouseCaptureLost() will clear it.
RefPtr<Node> node = m_mouseCaptureNode;
@@ -1086,17 +1086,10 @@ bool WebViewImpl::handleInputEvent(const WebInputEvent& inputEvent)
node->dispatchMouseEvent(
PlatformMouseEventBuilder(mainFrameImpl()->frameView(), *static_cast<const WebMouseEvent*>(&inputEvent)),
eventType);
+ m_currentInputEvent = 0;
return true;
}
- // FIXME: Remove m_currentInputEvent.
- // This only exists to allow ChromeClient::show() to know which mouse button
- // triggered a window.open event.
- // Safari must perform a similar hack, ours is in our WebKit glue layer
- // theirs is in the application. This should go when WebCore can be fixed
- // to pass more event information to ChromeClient::show()
- m_currentInputEvent = &inputEvent;
-
bool handled = true;
// FIXME: WebKit seems to always return false on mouse events processing
@@ -1984,7 +1977,7 @@ void WebViewImpl::setDomainRelaxationForbidden(bool forbidden, const WebString&
void WebViewImpl::setScrollbarColors(unsigned inactiveColor,
unsigned activeColor,
unsigned trackColor) {
-#if OS(LINUX)
+#if OS(LINUX) || OS(FREEBSD)
PlatformThemeChromiumGtk::setScrollbarColors(inactiveColor,
activeColor,
trackColor);
@@ -1995,7 +1988,7 @@ void WebViewImpl::setSelectionColors(unsigned activeBackgroundColor,
unsigned activeForegroundColor,
unsigned inactiveBackgroundColor,
unsigned inactiveForegroundColor) {
-#if OS(LINUX)
+#if OS(LINUX) || OS(FREEBSD)
RenderThemeChromiumLinux::setSelectionColors(activeBackgroundColor,
activeForegroundColor,
inactiveBackgroundColor,
@@ -2022,7 +2015,8 @@ void WebView::addUserScript(const WebString& sourceCode,
void WebView::addUserStyleSheet(const WebString& sourceCode,
const WebVector<WebString>& patternsIn,
- WebView::UserContentInjectIn injectIn)
+ WebView::UserContentInjectIn injectIn,
+ WebView::UserStyleInjectionTime injectionTime)
{
OwnPtr<Vector<String> > patterns(new Vector<String>);
for (size_t i = 0; i < patternsIn.size(); ++i)
@@ -2037,7 +2031,8 @@ void WebView::addUserStyleSheet(const WebString& sourceCode,
// FIXME: It would be nice to populate the URL correctly, instead of passing an empty URL.
pageGroup->addUserStyleSheetToWorld(world.get(), sourceCode, WebURL(), patterns.release(), 0,
static_cast<UserContentInjectedFrames>(injectIn),
- UserStyleSheet::AuthorLevel);
+ UserStyleAuthorLevel,
+ static_cast<WebCore::UserStyleInjectionTime>(injectionTime));
}
void WebView::removeAllUserContent()
@@ -2206,8 +2201,6 @@ void WebViewImpl::setRootGraphicsLayer(WebCore::PlatformLayer* layer)
void WebViewImpl::setRootLayerNeedsDisplay()
{
- if (m_layerRenderer)
- m_layerRenderer->setNeedsDisplay();
m_client->scheduleComposite();
// FIXME: To avoid breaking the downstream Chrome render_widget while downstream
// changes land, we also have to pass a 1x1 invalidate up to the client
@@ -2247,7 +2240,7 @@ void WebViewImpl::scrollRootLayerRect(const IntSize& scrollDelta, const IntRect&
// rects allows us to intermix invalidates with scrolls.
IntRect damagedContentsRect;
if (scrollDelta.width()) {
- float dx = static_cast<float>(scrollDelta.width());
+ int dx = scrollDelta.width();
damagedContentsRect.setY(contentRect.y());
damagedContentsRect.setHeight(contentRect.height());
if (dx > 0) {
@@ -2258,7 +2251,7 @@ void WebViewImpl::scrollRootLayerRect(const IntSize& scrollDelta, const IntRect&
damagedContentsRect.setWidth(-dx);
}
} else {
- float dy = static_cast<float>(scrollDelta.height());
+ int dy = scrollDelta.height();
damagedContentsRect.setX(contentRect.x());
damagedContentsRect.setWidth(contentRect.width());
if (dy > 0) {
@@ -2270,7 +2263,7 @@ void WebViewImpl::scrollRootLayerRect(const IntSize& scrollDelta, const IntRect&
}
}
- m_scrollDamage.unite(damagedContentsRect);
+ m_rootLayerScrollDamage.unite(damagedContentsRect);
setRootLayerNeedsDisplay();
}
@@ -2289,10 +2282,12 @@ void WebViewImpl::invalidateRootLayerRect(const IntRect& rect)
// rect is in viewport space. Convert to content space
// so that invalidations and scroll invalidations play well with one-another.
- FloatRect contentRect = view->windowToContents(rect);
+ IntRect contentRect = view->windowToContents(rect);
- // FIXME: add a smarter damage aggregation logic? Right now, LayerChromium does simple union-ing.
- m_layerRenderer->rootLayer()->setNeedsDisplay(contentRect);
+ // FIXME: add a smarter damage aggregation logic and/or unify with
+ // LayerChromium's damage logic
+ m_rootLayerDirtyRect.unite(contentRect);
+ setRootLayerNeedsDisplay();
}
@@ -2301,23 +2296,29 @@ void WebViewImpl::setIsAcceleratedCompositingActive(bool active)
if (m_isAcceleratedCompositingActive == active)
return;
- if (active) {
- OwnPtr<GraphicsContext3D> context = m_temporaryOnscreenGraphicsContext3D.release();
- if (!context) {
- context = GraphicsContext3D::create(GraphicsContext3D::Attributes(), m_page->chrome(), GraphicsContext3D::RenderDirectlyToHostWindow);
- if (context)
- context->reshape(std::max(1, m_size.width), std::max(1, m_size.height));
- }
- m_layerRenderer = LayerRendererChromium::create(context.release());
- if (m_layerRenderer) {
- m_isAcceleratedCompositingActive = true;
- } else {
- m_isAcceleratedCompositingActive = false;
- m_compositorCreationFailed = true;
- }
+ if (!active) {
+ m_isAcceleratedCompositingActive = false;
+ return;
+ }
+
+ if (m_layerRenderer) {
+ m_isAcceleratedCompositingActive = true;
+ return;
+ }
+
+ OwnPtr<GraphicsContext3D> context = m_temporaryOnscreenGraphicsContext3D.release();
+ if (!context) {
+ context = GraphicsContext3D::create(GraphicsContext3D::Attributes(), m_page->chrome(), GraphicsContext3D::RenderDirectlyToHostWindow);
+ if (context)
+ context->reshape(std::max(1, m_size.width), std::max(1, m_size.height));
+ }
+ m_layerRenderer = LayerRendererChromium::create(context.release());
+ if (m_layerRenderer) {
+ m_isAcceleratedCompositingActive = true;
+ m_compositorCreationFailed = false;
} else {
- m_layerRenderer = 0;
m_isAcceleratedCompositingActive = false;
+ m_compositorCreationFailed = true;
}
}
@@ -2391,14 +2392,14 @@ void WebViewImpl::doComposite()
m_layerRenderer->prepareToDrawLayers(visibleRect, contentRect, IntPoint(view->scrollX(), view->scrollY()));
// Draw the contents of the root layer.
- Vector<FloatRect> damageRects;
- damageRects.append(m_scrollDamage);
- damageRects.append(m_layerRenderer->rootLayer()->dirtyRect());
+ Vector<IntRect> damageRects;
+ damageRects.append(m_rootLayerScrollDamage);
+ damageRects.append(m_rootLayerDirtyRect);
for (size_t i = 0; i < damageRects.size(); ++i) {
// The damage rect for the root layer is in content space [e.g. unscrolled].
// Convert from content space to viewPort space.
- const FloatRect damagedContentRect = damageRects[i];
- IntRect damagedRect = view->contentsToWindow(IntRect(damagedContentRect));
+ const IntRect damagedContentRect = damageRects[i];
+ IntRect damagedRect = view->contentsToWindow(damagedContentRect);
// Intersect this rectangle with the viewPort.
damagedRect.intersect(viewPort);
@@ -2409,8 +2410,8 @@ void WebViewImpl::doComposite()
m_layerRenderer->updateRootLayerTextureRect(damagedRect);
}
}
- m_layerRenderer->rootLayer()->resetNeedsDisplay();
- m_scrollDamage = WebRect();
+ m_rootLayerDirtyRect = IntRect();
+ m_rootLayerScrollDamage = IntRect();
// Draw the actual layers...
m_layerRenderer->drawLayers(visibleRect, contentRect);
@@ -2431,32 +2432,28 @@ SharedGraphicsContext3D* WebViewImpl::getSharedGraphicsContext3D()
return m_sharedContext3D.get();
}
-WebGLES2Context* WebViewImpl::gles2Context()
-{
- return 0;
-}
-
WebGraphicsContext3D* WebViewImpl::graphicsContext3D()
{
#if USE(ACCELERATED_COMPOSITING)
- GraphicsContext3D* context = 0;
- if (m_layerRenderer)
- context = m_layerRenderer->context();
- else if (m_temporaryOnscreenGraphicsContext3D)
- context = m_temporaryOnscreenGraphicsContext3D.get();
- else {
- GraphicsContext3D::Attributes attributes;
- m_temporaryOnscreenGraphicsContext3D = GraphicsContext3D::create(GraphicsContext3D::Attributes(), m_page->chrome(), GraphicsContext3D::RenderDirectlyToHostWindow);
+ if (m_page->settings()->acceleratedCompositingEnabled() && allowsAcceleratedCompositing()) {
+ GraphicsContext3D* context = 0;
+ if (m_layerRenderer)
+ context = m_layerRenderer->context();
+ else if (m_temporaryOnscreenGraphicsContext3D)
+ context = m_temporaryOnscreenGraphicsContext3D.get();
+ else {
+ GraphicsContext3D::Attributes attributes;
+ m_temporaryOnscreenGraphicsContext3D = GraphicsContext3D::create(GraphicsContext3D::Attributes(), m_page->chrome(), GraphicsContext3D::RenderDirectlyToHostWindow);
#if OS(DARWIN)
- if (m_temporaryOnscreenGraphicsContext3D)
- m_temporaryOnscreenGraphicsContext3D->reshape(std::max(1, m_size.width), std::max(1, m_size.height));
+ if (m_temporaryOnscreenGraphicsContext3D)
+ m_temporaryOnscreenGraphicsContext3D->reshape(std::max(1, m_size.width), std::max(1, m_size.height));
#endif
- context = m_temporaryOnscreenGraphicsContext3D.get();
+ context = m_temporaryOnscreenGraphicsContext3D.get();
+ }
+ return GraphicsContext3DInternal::extractWebGraphicsContext3D(context);
}
- return GraphicsContext3DInternal::extractWebGraphicsContext3D(context);
-#else
- return 0;
#endif
+ return 0;
}
} // namespace WebKit
diff --git a/WebKit/chromium/src/WebViewImpl.h b/WebKit/chromium/src/WebViewImpl.h
index bbd25a2..9db914d 100644
--- a/WebKit/chromium/src/WebViewImpl.h
+++ b/WebKit/chromium/src/WebViewImpl.h
@@ -317,9 +317,8 @@ public:
void hideAutoFillPopup();
- // HACK: currentInputEvent() is for ChromeClientImpl::show(), until we can
- // fix WebKit to pass enough information up into ChromeClient::show() so we
- // can decide if the window.open event was caused by a middle-mouse click
+ // Returns the input event we're currently processing. This is used in some
+ // cases where the WebCore DOM event doesn't have the information we need.
static const WebInputEvent* currentInputEvent()
{
return m_currentInputEvent;
@@ -332,9 +331,6 @@ public:
void scrollRootLayerRect(const WebCore::IntSize& scrollDelta, const WebCore::IntRect& clipRect);
void invalidateRootLayerRect(const WebCore::IntRect&);
#endif
- // FIXME: remove this method once the compositor is fully switched
- // over to GraphicsContext3D.
- virtual WebGLES2Context* gles2Context();
// Returns the onscreen 3D context used by the compositor. This is
// used by the renderer's code to set up resource sharing between
@@ -526,8 +522,9 @@ private:
RefPtr<WebCore::Node> m_mouseCaptureNode;
#if USE(ACCELERATED_COMPOSITING)
- WebCore::IntRect m_scrollDamage;
- OwnPtr<WebCore::LayerRendererChromium> m_layerRenderer;
+ WebCore::IntRect m_rootLayerDirtyRect;
+ WebCore::IntRect m_rootLayerScrollDamage;
+ RefPtr<WebCore::LayerRendererChromium> m_layerRenderer;
bool m_isAcceleratedCompositingActive;
bool m_compositorCreationFailed;
#endif
diff --git a/WebKit/chromium/src/WebWorkerBase.cpp b/WebKit/chromium/src/WebWorkerBase.cpp
index 42f41d2..622f5c2 100644
--- a/WebKit/chromium/src/WebWorkerBase.cpp
+++ b/WebKit/chromium/src/WebWorkerBase.cpp
@@ -37,6 +37,7 @@
#include "PlatformMessagePortChannel.h"
#include "WebDataSourceImpl.h"
+#include "WebFileError.h"
#include "WebFrameClient.h"
#include "WebFrameImpl.h"
#include "WebMessagePortChannel.h"
@@ -45,6 +46,8 @@
#include "WebView.h"
#include "WebWorkerClient.h"
+#include "WorkerContext.h"
+#include "WorkerFileSystemCallbacksBridge.h"
#include "WorkerScriptController.h"
#include "WorkerThread.h"
#include <wtf/MainThread.h>
@@ -56,6 +59,7 @@ namespace WebKit {
#if ENABLE(WORKERS)
static const char allowDatabaseMode[] = "allowDatabaseMode";
+static const char openFileSystemMode[] = "openFileSystemMode";
namespace {
@@ -114,6 +118,7 @@ private:
WebWorkerBase* m_worker;
WTF::String m_mode;
};
+
}
// This function is called on the main thread to force to initialize some static
@@ -231,6 +236,17 @@ bool WebWorkerBase::allowDatabase(WebFrame*, const WebString& name, const WebStr
return bridge->result();
}
+#if ENABLE(FILE_SYSTEM)
+void WebWorkerBase::openFileSystem(WebFileSystem::Type type, long long size, WebFileSystemCallbacks* callbacks)
+{
+ WorkerScriptController* controller = WorkerScriptController::controllerForContext();
+ WorkerContext* workerContext = controller->workerContext();
+
+ RefPtr<WorkerFileSystemCallbacksBridge> bridge = WorkerFileSystemCallbacksBridge::create(this, workerContext, callbacks);
+ bridge->postOpenFileSystemToMainThread(commonClient(), type, size, openFileSystemMode);
+}
+#endif
+
// WorkerObjectProxy -----------------------------------------------------------
void WebWorkerBase::postMessageToWorkerObject(PassRefPtr<SerializedScriptValue> message,
diff --git a/WebKit/chromium/src/WebWorkerBase.h b/WebKit/chromium/src/WebWorkerBase.h
index 22711f9..1f4bc03 100644
--- a/WebKit/chromium/src/WebWorkerBase.h
+++ b/WebKit/chromium/src/WebWorkerBase.h
@@ -91,6 +91,11 @@ public:
// Controls whether access to Web Databases is allowed for this worker.
virtual bool allowDatabase(WebFrame*, const WebString& name, const WebString& displayName, unsigned long estimatedSize);
+#if ENABLE(FILE_SYSTEM)
+ // Requests to open a file system for this worker. (Note that this is not the implementation for WebFrameClient::openFileSystem.)
+ void openFileSystem(WebFileSystem::Type, long long size, WebFileSystemCallbacks*);
+#endif
+
// Executes the given task on the main thread.
static void dispatchTaskToMainThread(PassOwnPtr<WebCore::ScriptExecutionContext::Task>);
diff --git a/WebKit/chromium/src/WebWorkerClientImpl.h b/WebKit/chromium/src/WebWorkerClientImpl.h
index 741d606..0604823 100644
--- a/WebKit/chromium/src/WebWorkerClientImpl.h
+++ b/WebKit/chromium/src/WebWorkerClientImpl.h
@@ -33,8 +33,8 @@
#if ENABLE(WORKERS)
+#include "WebFileSystem.h"
#include "WebWorkerClient.h"
-
#include "WorkerContextProxy.h"
#include <wtf/PassOwnPtr.h>
#include <wtf/RefPtr.h>
@@ -99,6 +99,10 @@ public:
ASSERT_NOT_REACHED();
return true;
}
+ virtual void openFileSystem(WebFrame*, WebFileSystem::Type, long long size, WebFileSystemCallbacks*)
+ {
+ ASSERT_NOT_REACHED();
+ }
private:
virtual ~WebWorkerClientImpl();
diff --git a/WebKit/chromium/src/WorkerFileSystemCallbacksBridge.cpp b/WebKit/chromium/src/WorkerFileSystemCallbacksBridge.cpp
new file mode 100644
index 0000000..d112886
--- /dev/null
+++ b/WebKit/chromium/src/WorkerFileSystemCallbacksBridge.cpp
@@ -0,0 +1,190 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "WorkerFileSystemCallbacksBridge.h"
+
+#if ENABLE(FILE_SYSTEM)
+
+#include "CrossThreadTask.h"
+#include "WebCommonWorkerClient.h"
+#include "WebFileSystemCallbacks.h"
+#include "WebString.h"
+#include "WebWorkerBase.h"
+#include "WorkerContext.h"
+#include "WorkerScriptController.h"
+#include "WorkerThread.h"
+#include <wtf/MainThread.h>
+#include <wtf/Threading.h>
+
+using namespace WebCore;
+
+namespace WebKit {
+
+// FileSystemCallbacks that are to be dispatched on the main thread.
+class MainThreadFileSystemCallbacks : public WebFileSystemCallbacks {
+public:
+ static PassOwnPtr<MainThreadFileSystemCallbacks> create(PassRefPtr<WorkerFileSystemCallbacksBridge> bridge, const String& mode)
+ {
+ return adoptPtr(new MainThreadFileSystemCallbacks(bridge, mode));
+ }
+
+ virtual ~MainThreadFileSystemCallbacks()
+ {
+ }
+
+ virtual void didOpenFileSystem(const WebString& name, const WebString& path)
+ {
+ m_bridge->didOpenFileSystemOnMainThread(name, path, m_mode);
+ delete this;
+ }
+
+ virtual void didFail(WebFileError error)
+ {
+ m_bridge->didFailOnMainThread(error, m_mode);
+ delete this;
+ }
+
+ virtual void didSucceed()
+ {
+ WEBKIT_ASSERT_NOT_REACHED();
+ }
+
+ virtual void didReadMetadata(const WebFileInfo& info)
+ {
+ WEBKIT_ASSERT_NOT_REACHED();
+ }
+
+ virtual void didReadDirectory(const WebVector<WebFileSystemEntry>& entries, bool hasMore)
+ {
+ WEBKIT_ASSERT_NOT_REACHED();
+ }
+
+private:
+ MainThreadFileSystemCallbacks(PassRefPtr<WorkerFileSystemCallbacksBridge> bridge, const String& mode)
+ : m_bridge(bridge)
+ , m_mode(mode)
+ {
+ ASSERT(m_bridge.get());
+ }
+
+ friend class WorkerFileSystemCallbacksBridge;
+ RefPtr<WorkerFileSystemCallbacksBridge> m_bridge;
+ const String m_mode;
+};
+
+void WorkerFileSystemCallbacksBridge::stop()
+{
+ ASSERT(m_workerContext->isContextThread());
+ MutexLocker locker(m_mutex);
+ m_worker = 0;
+
+ if (m_callbacksOnWorkerThread) {
+ m_callbacksOnWorkerThread->didFail(WebFileErrorAbort);
+ m_callbacksOnWorkerThread = 0;
+ }
+}
+
+void WorkerFileSystemCallbacksBridge::postOpenFileSystemToMainThread(WebCommonWorkerClient* commonClient, WebFileSystem::Type type, long long size, const String& mode)
+{
+ m_selfRef = this;
+ ASSERT(m_workerContext->isContextThread());
+ ASSERT(m_worker);
+ m_worker->dispatchTaskToMainThread(createCallbackTask(&openFileSystemOnMainThread, commonClient, type, size, this, mode));
+}
+
+void WorkerFileSystemCallbacksBridge::openFileSystemOnMainThread(ScriptExecutionContext*, WebCommonWorkerClient* commonClient, WebFileSystem::Type type, long long size, WorkerFileSystemCallbacksBridge* bridge, const String& mode)
+{
+ ASSERT(isMainThread());
+ if (!commonClient)
+ bridge->didFailOnMainThread(WebFileErrorAbort, mode);
+ else {
+ // MainThreadFileSystemCallbacks is self-destructed, so we leak ptr here.
+ commonClient->openFileSystem(type, size, MainThreadFileSystemCallbacks::create(bridge, mode).leakPtr());
+ }
+}
+
+void WorkerFileSystemCallbacksBridge::didFailOnMainThread(WebFileError error, const String& mode)
+{
+ ASSERT(isMainThread());
+ mayPostTaskToWorker(createCallbackTask(&didFailOnWorkerThread, m_selfRef, error), mode);
+}
+
+void WorkerFileSystemCallbacksBridge::didOpenFileSystemOnMainThread(const String& name, const String& rootPath, const String& mode)
+{
+ ASSERT(isMainThread());
+ mayPostTaskToWorker(createCallbackTask(&didOpenFileSystemOnWorkerThread, m_selfRef, name, rootPath), mode);
+}
+
+WorkerFileSystemCallbacksBridge::WorkerFileSystemCallbacksBridge(WebWorkerBase* worker, ScriptExecutionContext* scriptExecutionContext, WebFileSystemCallbacks* callbacks)
+ : WorkerContext::Observer(static_cast<WorkerContext*>(scriptExecutionContext))
+ , m_worker(worker)
+ , m_workerContext(scriptExecutionContext)
+ , m_callbacksOnWorkerThread(callbacks)
+{
+ ASSERT(m_workerContext->isContextThread());
+}
+
+WorkerFileSystemCallbacksBridge::~WorkerFileSystemCallbacksBridge()
+{
+ ASSERT(!m_callbacksOnWorkerThread);
+}
+
+void WorkerFileSystemCallbacksBridge::didFailOnWorkerThread(ScriptExecutionContext*, PassRefPtr<WorkerFileSystemCallbacksBridge> bridge, WebFileError error)
+{
+ if (bridge->m_callbacksOnWorkerThread) {
+ ASSERT(bridge->m_workerContext->isContextThread());
+ bridge->m_callbacksOnWorkerThread->didFail(error);
+ bridge->m_callbacksOnWorkerThread = 0;
+ }
+}
+
+void WorkerFileSystemCallbacksBridge::didOpenFileSystemOnWorkerThread(ScriptExecutionContext*, PassRefPtr<WorkerFileSystemCallbacksBridge> bridge, const String& name, const String& rootPath)
+{
+ if (bridge->m_callbacksOnWorkerThread) {
+ ASSERT(bridge->m_workerContext->isContextThread());
+ bridge->m_callbacksOnWorkerThread->didOpenFileSystem(name, rootPath);
+ bridge->m_callbacksOnWorkerThread = 0;
+ }
+}
+
+void WorkerFileSystemCallbacksBridge::mayPostTaskToWorker(PassOwnPtr<ScriptExecutionContext::Task> task, const String& mode)
+{
+ { // Let go of the mutex before possibly deleting this due to m_selfRef.clear().
+ MutexLocker locker(m_mutex);
+ if (m_worker)
+ m_worker->postTaskForModeToWorkerContext(task, mode);
+ }
+ m_selfRef.clear();
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(FILE_SYSTEM)
diff --git a/WebKit/chromium/src/WorkerFileSystemCallbacksBridge.h b/WebKit/chromium/src/WorkerFileSystemCallbacksBridge.h
new file mode 100644
index 0000000..899127e
--- /dev/null
+++ b/WebKit/chromium/src/WorkerFileSystemCallbacksBridge.h
@@ -0,0 +1,122 @@
+/*
+ * 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 WorkerFileSystemCallbacksBridge_h
+#define WorkerFileSystemCallbacksBridge_h
+
+#if ENABLE(FILE_SYSTEM)
+
+#include "PlatformString.h"
+#include "ScriptExecutionContext.h"
+#include "WebFileError.h"
+#include "WebFileSystem.h"
+#include "WebVector.h"
+#include "WorkerContext.h"
+#include <wtf/PassOwnPtr.h>
+#include <wtf/PassRefPtr.h>
+#include <wtf/Threading.h>
+
+namespace WebKit {
+
+class AsyncFileSystem;
+class MainThreadFileSystemCallbacks;
+class ThreadableCallbacksBridgeWrapper;
+class WebCommonWorkerClient;
+class WebFileSystemCallbacks;
+class WebWorkerBase;
+struct WebFileInfo;
+struct WebFileSystemEntry;
+
+// This class is used to post a openFileSystem request to the main thread and get called back for the request. This must be destructed on the worker thread.
+//
+// A typical flow for openFileSystem would look like this:
+// Bridge::postOpenFileSystemToMainThread() on WorkerThread
+// --> Bridge::openFileSystemOnMainThread() is called on MainThread
+// This makes an IPC with a MainThreadFileSystemCallbacks instance
+// [actual operation is down in the browser]
+// --> MainThreadFileSystemCallbacks::didXxx is called on MainThread
+// --> Bridge::didXxxOnMainThread is called on MainThread
+// --> Bridge::didXxxOnWorkerThread is called on WorkerThread
+// This calls the original callbacks (m_callbacksOnWorkerThread) and
+// releases a self-reference to the bridge.
+class WorkerFileSystemCallbacksBridge : public ThreadSafeShared<WorkerFileSystemCallbacksBridge>, public WebCore::WorkerContext::Observer {
+public:
+ static PassRefPtr<WorkerFileSystemCallbacksBridge> create(WebWorkerBase* worker, WebCore::ScriptExecutionContext* workerContext, WebFileSystemCallbacks* callbacks)
+ {
+ return WTF::adoptRef(new WorkerFileSystemCallbacksBridge(worker, workerContext, callbacks));
+ }
+ ~WorkerFileSystemCallbacksBridge();
+
+ // WorkerContext::Observer method.
+ virtual void notifyStop()
+ {
+ stop();
+ }
+
+ void stop();
+
+ // Posts an initial request task to the main thread. It is supposed to be called immediately after the bridge is constructed. (It doesn't check if the context has been stopped or not.)
+ void postOpenFileSystemToMainThread(WebCommonWorkerClient*, WebFileSystem::Type, long long size, const String& mode);
+
+ // Callback methods that are called on the main thread.
+ void didFailOnMainThread(WebFileError, const String& mode);
+ void didOpenFileSystemOnMainThread(const String& name, const String& rootPath, const String& mode);
+
+private:
+ WorkerFileSystemCallbacksBridge(WebWorkerBase*, WebCore::ScriptExecutionContext*, WebFileSystemCallbacks*);
+
+ // Method that is to be called on the main thread.
+ static void openFileSystemOnMainThread(WebCore::ScriptExecutionContext*, WebCommonWorkerClient*, WebFileSystem::Type, long long size, WorkerFileSystemCallbacksBridge*, const String& mode);
+
+ friend class MainThreadFileSystemCallbacks;
+
+ // Methods that dispatch WebFileSystemCallbacks on the worker threads.
+ // They release a selfRef of the WorkerFileSystemCallbacksBridge.
+ static void didFailOnWorkerThread(WebCore::ScriptExecutionContext*, PassRefPtr<WorkerFileSystemCallbacksBridge>, WebFileError);
+ static void didOpenFileSystemOnWorkerThread(WebCore::ScriptExecutionContext*, PassRefPtr<WorkerFileSystemCallbacksBridge>, const String& name, const String& rootPath);
+
+ void mayPostTaskToWorker(PassOwnPtr<WebCore::ScriptExecutionContext::Task>, const String& mode);
+
+ // m_selfRef keeps a reference to itself until a task is created for the worker thread (at which point the task holds the reference).
+ RefPtr<WorkerFileSystemCallbacksBridge> m_selfRef;
+
+ Mutex m_mutex;
+ WebWorkerBase* m_worker;
+ WebCore::ScriptExecutionContext* m_workerContext;
+
+ // This is self-destructed and must be fired on the worker thread.
+ WebFileSystemCallbacks* m_callbacksOnWorkerThread;
+};
+
+} // namespace WebCore
+
+#endif
+
+#endif // WorkerFileSystemCallbacksBridge_h
diff --git a/WebKit/chromium/src/gtk/WebInputEventFactory.cpp b/WebKit/chromium/src/gtk/WebInputEventFactory.cpp
index f8a1386..0d55c43 100644
--- a/WebKit/chromium/src/gtk/WebInputEventFactory.cpp
+++ b/WebKit/chromium/src/gtk/WebInputEventFactory.cpp
@@ -85,6 +85,10 @@ static int gdkStateToWebEventModifiers(guint state)
modifiers |= WebInputEvent::MiddleButtonDown;
if (state & GDK_BUTTON3_MASK)
modifiers |= WebInputEvent::RightButtonDown;
+ if (state & GDK_LOCK_MASK)
+ modifiers |= WebInputEvent::CapsLockOn;
+ if (state & GDK_MOD2_MASK)
+ modifiers |= WebInputEvent::NumLockOn;
return modifiers;
}
diff --git a/WebKit/chromium/src/gtk/WebScreenInfoFactory.cpp b/WebKit/chromium/src/gtk/WebScreenInfoFactory.cpp
deleted file mode 100644
index 081daa2..0000000
--- a/WebKit/chromium/src/gtk/WebScreenInfoFactory.cpp
+++ /dev/null
@@ -1,62 +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 "WebScreenInfoFactory.h"
-
-#include "WebScreenInfo.h"
-#include <gtk/gtk.h>
-
-namespace WebKit {
-
-WebScreenInfo WebScreenInfoFactory::screenInfo(GtkWidget* widget)
-{
- WebScreenInfo results;
- results.depth = 32;
- results.depthPerComponent = 8;
- results.isMonochrome = false;
-
- if (!widget)
- return results;
-
- GdkScreen* screen = gtk_widget_get_screen(widget);
-
- results.rect = WebRect(
- 0, 0, gdk_screen_get_width(screen), gdk_screen_get_height(screen));
-
- // I don't know of a way to query the "maximize" size of the window (e.g.
- // screen size less sidebars etc) since this is something which only the
- // window manager knows.
- results.availableRect = results.rect;
-
- return results;
-}
-
-} // namespace WebKit
diff --git a/WebKit/chromium/src/js/DevTools.js b/WebKit/chromium/src/js/DevTools.js
index 0c7241d..a66e174 100644
--- a/WebKit/chromium/src/js/DevTools.js
+++ b/WebKit/chromium/src/js/DevTools.js
@@ -45,7 +45,7 @@ var context = {}; // Used by WebCore's inspector routines.
Preferences.profilerAlwaysEnabled = true;
Preferences.canEditScriptSource = true;
Preferences.onlineDetectionEnabled = false;
- Preferences.domBreakpointsEnabled = true;
+ Preferences.nativeInstrumentationEnabled = true;
})();
var devtools = devtools || {};
diff --git a/WebKit/chromium/src/win/WebInputEventFactory.cpp b/WebKit/chromium/src/win/WebInputEventFactory.cpp
index d1d5869..c71a3b6 100644
--- a/WebKit/chromium/src/win/WebInputEventFactory.cpp
+++ b/WebKit/chromium/src/win/WebInputEventFactory.cpp
@@ -86,6 +86,16 @@ static bool isKeyPad(WPARAM wparam, LPARAM lparam)
return keypad;
}
+// Loads the state for toggle keys into the event.
+static void SetToggleKeyState(WebInputEvent* event)
+{
+ // Low bit set from GetKeyState indicates "toggled".
+ if (::GetKeyState(VK_NUMLOCK) & 1)
+ event->modifiers |= WebInputEvent::NumLockOn;
+ if (::GetKeyState(VK_CAPITAL) & 1)
+ event->modifiers |= WebInputEvent::CapsLockOn;
+}
+
WebKeyboardEvent WebInputEventFactory::keyboardEvent(HWND hwnd, UINT message,
WPARAM wparam, LPARAM lparam)
{
@@ -144,6 +154,7 @@ WebKeyboardEvent WebInputEventFactory::keyboardEvent(HWND hwnd, UINT message,
if (isKeyPad(wparam, lparam))
result.modifiers |= WebInputEvent::IsKeyPad;
+ SetToggleKeyState(&result);
return result;
}
@@ -289,6 +300,7 @@ WebMouseEvent WebInputEventFactory::mouseEvent(HWND hwnd, UINT message,
if (wparam & MK_RBUTTON)
result.modifiers |= WebInputEvent::RightButtonDown;
+ SetToggleKeyState(&result);
return result;
}
@@ -386,6 +398,8 @@ WebMouseWheelEvent WebInputEventFactory::mouseWheelEvent(HWND hwnd, UINT message
if (keyState & MK_RBUTTON)
result.modifiers |= WebInputEvent::RightButtonDown;
+ SetToggleKeyState(&result);
+
// Set coordinates by translating event coordinates from screen to client.
POINT clientPoint = { result.globalX, result.globalY };
MapWindowPoints(0, hwnd, &clientPoint, 1);
diff --git a/WebKit/efl/CMakeListsEfl.txt b/WebKit/efl/CMakeListsEfl.txt
index 8b77260..c154b66 100644
--- a/WebKit/efl/CMakeListsEfl.txt
+++ b/WebKit/efl/CMakeListsEfl.txt
@@ -88,8 +88,11 @@ IF (WTF_USE_CURL)
LIST(APPEND WebKit_LIBRARIES ${CURL_LIBRARIES})
ENDIF ()
-FILE(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/WebKit/efl/DefaultTheme)
-SET(WebKit_THEME ${CMAKE_BINARY_DIR}/WebKit/efl/DefaultTheme/default.edj)
+SET(BUILD_DATA_DIR ${CMAKE_BINARY_DIR}/WebKit/efl/DefaultTheme)
+SET(BUILD_DATA_DIR ${BUILD_DATA_DIR} PARENT_SCOPE)
+FILE(MAKE_DIRECTORY ${BUILD_DATA_DIR})
+
+SET(WebKit_THEME ${BUILD_DATA_DIR}/default.edj)
ADD_CUSTOM_COMMAND(
OUTPUT ${WebKit_THEME}
COMMAND ${EDJE_CC_EXECUTABLE} -v -id ${WEBKIT_DIR}/efl/DefaultTheme ${WEBKIT_DIR}/efl/DefaultTheme/default.edc ${WebKit_THEME}
diff --git a/WebKit/efl/ChangeLog b/WebKit/efl/ChangeLog
index 879a1af..7c6afe9 100644
--- a/WebKit/efl/ChangeLog
+++ b/WebKit/efl/ChangeLog
@@ -1,3 +1,66 @@
+2010-09-28 Jenn Braithwaite <jennb@chromium.org>
+
+ Reviewed by Dmitry Titov.
+
+ Added oldPage param to FrameLoaderClient::didTransferChildFrameToNewDocument.
+ https://bugs.webkit.org/show_bug.cgi?id=46663
+
+ * WebCoreSupport/FrameLoaderClientEfl.cpp:
+ (WebCore::FrameLoaderClientEfl::didTransferChildFrameToNewDocument):
+ * WebCoreSupport/FrameLoaderClientEfl.h:
+
+2010-09-26 Gyuyoung Kim <gyuyoung.kim@samsung.com>
+
+ Reviewed by Antonio Gomes.
+
+ [EFL] Add setting API to set a local storage database path.
+ https://bugs.webkit.org/show_bug.cgi?id=45446
+
+ Add a setting API to set local storage database path.
+
+ * ewk/ewk_view.cpp:
+ (_ewk_view_priv_new):
+ (_ewk_view_priv_del):
+ (ewk_view_setting_local_storage_database_path_get): Added.
+ (ewk_view_setting_local_storage_database_path_set): Added.
+ * ewk/ewk_view.h:
+
+2010-09-23 Lucas De Marchi <lucas.demarchi@profusion.mobi>
+
+ Reviewed by Csaba Osztrogonác.
+
+ [EFL] Fix warnings during build
+ https://bugs.webkit.org/show_bug.cgi?id=46354
+
+ * ewk/ewk_frame.cpp:
+ (ewk_frame_text_matches_nth_pos_get): Change argument type because
+ it's meant to be always positive.
+ * ewk/ewk_frame.h: Ditto.
+ * ewk/ewk_view.cpp:
+ (ewk_view_exceeded_database_quota): Add missing "%" causing warning about number of
+ arguments to printf-like function.
+ * ewk/ewk_view.h: Add missing initialization.
+
+2010-09-21 Lucas De Marchi <lucas.demarchi@profusion.mobi>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [EFL] Get fresh theme when running EWebLauncher
+ https://bugs.webkit.org/show_bug.cgi?id=46210
+
+ If user tried to run EWebLauncher outside of the build tree, it would
+ not find the theme and fallback to the installed one. However, since
+ EWebLauncher is not installed, we always want to take the theme from
+ the just compiled source code. If user had never installed WebKit's
+ EFL port it could even receive a segv since no theme would be found.
+
+ Now EWebLauncher does not fallback to the installed theme and CMake
+ gives as DATA_DIR the directory of the theme it has just built.
+
+
+ * CMakeListsEfl.txt: export DATA_DIR to parent CMakeLists.txt in order
+ to be used by EWebLauncher.
+
2010-09-17 Darin Adler <darin@apple.com>
Reviewed by Sam Weinig.
diff --git a/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp b/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp
index 056687c..2d452d8 100644
--- a/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp
+++ b/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp
@@ -46,6 +46,7 @@
#include "Language.h"
#include "MIMETypeRegistry.h"
#include "NotImplemented.h"
+#include "Page.h"
#include "PluginDatabase.h"
#include "ProgressTracker.h"
#include "RenderPart.h"
@@ -379,7 +380,7 @@ PassRefPtr<Frame> FrameLoaderClientEfl::createFrame(const KURL& url, const Strin
return ewk_view_frame_create(m_view, m_frame, name, ownerElement, url, referrer);
}
-void FrameLoaderClientEfl::didTransferChildFrameToNewDocument()
+void FrameLoaderClientEfl::didTransferChildFrameToNewDocument(Page*)
{
}
diff --git a/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.h b/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.h
index 68f145d..2b4414a 100644
--- a/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.h
+++ b/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.h
@@ -137,7 +137,7 @@ class FrameLoaderClientEfl : public FrameLoaderClient {
virtual PassRefPtr<Frame> createFrame(const KURL& url, const String& name, HTMLFrameOwnerElement* ownerElement,
const String& referrer, bool allowsScrolling, int marginWidth, int marginHeight);
- virtual void didTransferChildFrameToNewDocument();
+ virtual void didTransferChildFrameToNewDocument(Page*);
virtual PassRefPtr<Widget> createPlugin(const IntSize&, HTMLPlugInElement*, const KURL&, const WTF::Vector<String>&, const WTF::Vector<String>&, const String&, bool);
virtual void redirectDataToPlugin(Widget* pluginWidget);
diff --git a/WebKit/efl/ewk/ewk_frame.cpp b/WebKit/efl/ewk/ewk_frame.cpp
index 038e105..1395fa5 100644
--- a/WebKit/efl/ewk/ewk_frame.cpp
+++ b/WebKit/efl/ewk/ewk_frame.cpp
@@ -847,7 +847,7 @@ static bool _ewk_frame_rect_is_negative_value(const WebCore::IntRect& i)
* @return @c EINA_TRUE on success, @c EINA_FALSE for failure - when no matches found or
* n bigger than search results.
*/
-Eina_Bool ewk_frame_text_matches_nth_pos_get(Evas_Object* o, int n, int* x, int* y)
+Eina_Bool ewk_frame_text_matches_nth_pos_get(Evas_Object* o, size_t n, int* x, int* y)
{
EWK_FRAME_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE);
diff --git a/WebKit/efl/ewk/ewk_frame.h b/WebKit/efl/ewk/ewk_frame.h
index 9394446..156bd82 100644
--- a/WebKit/efl/ewk/ewk_frame.h
+++ b/WebKit/efl/ewk/ewk_frame.h
@@ -160,7 +160,7 @@ EAPI unsigned int ewk_frame_text_matches_mark(Evas_Object *o, const char *string
EAPI Eina_Bool ewk_frame_text_matches_unmark_all(Evas_Object *o);
EAPI Eina_Bool ewk_frame_text_matches_highlight_set(Evas_Object *o, Eina_Bool highlight);
EAPI Eina_Bool ewk_frame_text_matches_highlight_get(const Evas_Object *o);
-EAPI Eina_Bool ewk_frame_text_matches_nth_pos_get(Evas_Object *o, int n, int *x, int *y);
+EAPI Eina_Bool ewk_frame_text_matches_nth_pos_get(Evas_Object *o, size_t n, int *x, int *y);
EAPI Eina_Bool ewk_frame_stop(Evas_Object *o);
EAPI Eina_Bool ewk_frame_reload(Evas_Object *o);
diff --git a/WebKit/efl/ewk/ewk_view.cpp b/WebKit/efl/ewk/ewk_view.cpp
index 76e4bf5..19efbfa 100644
--- a/WebKit/efl/ewk/ewk_view.cpp
+++ b/WebKit/efl/ewk/ewk_view.cpp
@@ -91,6 +91,7 @@ struct _Ewk_View_Private_Data {
const char* encoding_custom;
const char* cache_directory;
const char* theme;
+ const char* local_storage_database_path;
int font_minimum_size;
int font_minimum_logical_size;
int font_default_size;
@@ -579,6 +580,9 @@ static Ewk_View_Private_Data* _ewk_view_priv_new(Ewk_View_Smart_Data* sd)
priv->settings.cache_directory = eina_stringshare_add
(WebCore::cacheStorage().cacheDirectory().utf8().data());
+ s = priv->page_settings->localStorageDatabasePath();
+ priv->settings.local_storage_database_path = eina_stringshare_add(s.string().utf8().data());
+
priv->settings.font_minimum_size = priv->page_settings->minimumFontSize();
priv->settings.font_minimum_logical_size = priv->page_settings->minimumLogicalFontSize();
priv->settings.font_default_size = priv->page_settings->defaultFontSize();
@@ -662,6 +666,7 @@ static void _ewk_view_priv_del(Ewk_View_Private_Data* priv)
eina_stringshare_del(priv->settings.font_fantasy);
eina_stringshare_del(priv->settings.font_serif);
eina_stringshare_del(priv->settings.font_sans_serif);
+ eina_stringshare_del(priv->settings.local_storage_database_path);
if (priv->animated_zoom.animator)
ecore_animator_del(priv->animated_zoom.animator);
@@ -2784,6 +2789,36 @@ Eina_Bool ewk_view_setting_page_cache_set(Evas_Object* o, Eina_Bool enable)
return EINA_TRUE;
}
+/*
+ * Gets the local storage database path.
+ *
+ * @param o view object to get the local storage database path.
+ * @return the local storage database path.
+ */
+const char* ewk_view_setting_local_storage_database_path_get(const Evas_Object* o)
+{
+ EWK_VIEW_SD_GET_OR_RETURN(o, sd, 0);
+ EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, 0);
+ return priv->settings.local_storage_database_path;
+}
+
+/**
+ * Sets the local storage database path.
+ *
+ * @param o view object to set the local storage database path.
+ * @return @c EINA_TRUE on success and @c EINA_FALSE on failure
+ */
+Eina_Bool ewk_view_setting_local_storage_database_path_set(Evas_Object* o, const char* path)
+{
+ EWK_VIEW_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+ EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE);
+ if (eina_stringshare_replace(&priv->settings.local_storage_database_path, path)) {
+ WTF::AtomicString s = WTF::String::fromUTF8(path);
+ priv->page_settings->setLocalStorageDatabasePath(s);
+ }
+ return EINA_TRUE;
+}
+
/**
* Similar to evas_object_smart_data_get(), but does type checking.
*
@@ -3769,7 +3804,7 @@ uint64_t ewk_view_exceeded_database_quota(Evas_Object* o, Evas_Object* frame, co
if (!sd->api->exceeded_database_quota)
return 0;
- INF("current_size=%"PRIu64" expected_size="PRIu64, current_size, expected_size);
+ INF("current_size=%"PRIu64" expected_size=%"PRIu64, current_size, expected_size);
return sd->api->exceeded_database_quota(sd, frame, databaseName, current_size, expected_size);
}
diff --git a/WebKit/efl/ewk/ewk_view.h b/WebKit/efl/ewk/ewk_view.h
index be27f68..26bf97c 100644
--- a/WebKit/efl/ewk/ewk_view.h
+++ b/WebKit/efl/ewk/ewk_view.h
@@ -151,7 +151,7 @@ struct _Ewk_View_Smart_Class {
* @see EWK_VIEW_SMART_CLASS_INIT_VERSION
* @see EWK_VIEW_SMART_CLASS_INIT_NAME_VERSION
*/
-#define EWK_VIEW_SMART_CLASS_INIT(smart_class_init) {smart_class_init, EWK_VIEW_SMART_CLASS_VERSION, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
+#define EWK_VIEW_SMART_CLASS_INIT(smart_class_init) {smart_class_init, EWK_VIEW_SMART_CLASS_VERSION, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
/**
* Initializer to zero a whole Ewk_View_Smart_Class structure.
@@ -449,6 +449,8 @@ EAPI Eina_Bool ewk_view_setting_spatial_navigation_set(Evas_Object* o, Eina_B
EAPI Eina_Bool ewk_view_setting_local_storage_get(Evas_Object* o);
EAPI Eina_Bool ewk_view_setting_local_storage_set(Evas_Object* o, Eina_Bool enable);
+EAPI const char *ewk_view_setting_local_storage_database_path_get(const Evas_Object *o);
+EAPI Eina_Bool ewk_view_setting_local_storage_database_path_set(Evas_Object *o, const char *path);
EAPI Eina_Bool ewk_view_setting_page_cache_get(Evas_Object* o);
EAPI Eina_Bool ewk_view_setting_page_cache_set(Evas_Object* o, Eina_Bool enable);
diff --git a/WebKit/gtk/ChangeLog b/WebKit/gtk/ChangeLog
index 16f4063..c602ac1 100644
--- a/WebKit/gtk/ChangeLog
+++ b/WebKit/gtk/ChangeLog
@@ -1,3 +1,192 @@
+2010-09-28 Jenn Braithwaite <jennb@chromium.org>
+
+ Reviewed by Dmitry Titov.
+
+ Added oldPage param to FrameLoaderClient::didTransferChildFrameToNewDocument.
+ https://bugs.webkit.org/show_bug.cgi?id=46663
+
+ * WebCoreSupport/FrameLoaderClientGtk.cpp:
+ (WebKit::FrameLoaderClient::didTransferChildFrameToNewDocument):
+ * WebCoreSupport/FrameLoaderClientGtk.h:
+
+2010-09-27 Mario Sanchez Prada <msanchez@igalia.com>
+
+ Reviewed by Chris Fleizach.
+
+ [Gtk] Adjust atk_text_get_text_at_offset to account for bullets/numbers in list items
+ https://bugs.webkit.org/show_bug.cgi?id=45381
+
+ Updated test to match the new exposure of list item markers.
+
+ Also, added some extra assertions in that test to make sure the
+ accessible objects associated to the items implement AtkText.
+
+ * tests/testatk.c:
+ (testWebkitAtkListsOfItems):
+ (main):
+
+2010-09-27 Philippe Normand <pnormand@igalia.com>
+
+ Reviewed by Martin Robinson.
+
+ [GTK] Doesn't build with gtk+ 2.14
+ https://bugs.webkit.org/show_bug.cgi?id=46565
+
+ Fixed the build for GTK+ 2.14. Don't use gdk_window_get_cursor()
+ for that GTK+ version as I found no acceptable way to work-around
+ its absence.
+
+ * WebCoreSupport/FullscreenVideoController.cpp:
+ (FullscreenVideoController::showHud):
+ (FullscreenVideoController::hideHud):
+ (FullscreenVideoController::enterFullscreen):
+
+2010-09-26 Jenn Braithwaite <jennb@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ GTK client needs updating when live iframe element is moved
+ between pages.
+ https://bugs.webkit.org/show_bug.cgi?id=46300
+
+ Test: fast/frames/iframe-reparenting-adopt-node.html
+
+ * WebCoreSupport/FrameLoaderClientGtk.cpp:
+ (WebKit::FrameLoaderClient::didTransferChildFrameToNewDocument):
+ Update the webView for the frame to match the parent frame's
+ webView.
+
+2010-09-24 Martin Robinson <mrobinson@igalia.com>
+
+ Reviewed by Gustavo Noronha Silva.
+
+ [GTK] opening local files on win32
+ https://bugs.webkit.org/show_bug.cgi?id=31066
+
+ Add tests that check the mime type returned by local files loaded via file URLs.
+
+ * tests/testmimehandling.c:
+ (testRemoteMimeType): Added.
+ (testLocalMimeType): Added.
+ (main): Run tests by using g_test_add_data_func with either
+ testRemoteMimeType or testLocalMimeType.
+
+2010-09-23 Martin Robinson <mrobinson@igalia.com>
+
+ Reviewed by Nate Chapin.
+
+ [GTK] Some tests from r68174 fail on the GTK+ bots
+ https://bugs.webkit.org/show_bug.cgi?id=46396
+
+ Fix since version number in this new WebKitWebSettings property.
+
+ * webkit/webkitwebsettings.cpp:
+ (webkit_web_settings_class_init): Fix the since version number.
+
+2010-09-23 Nate Chapin <japhet@chromium.org>
+
+ Unreviewed, build fix.
+
+ Add a missing comma in webkitwebsettings.cpp.
+
+ * webkit/webkitwebsettings.cpp:
+
+2010-09-23 Nate Chapin <japhet@chromium.org>
+
+ Reviewed by Darin Fisher.
+
+ Add hyperlink auditing settings (i.e., <a ping>).
+ https://bugs.webkit.org/show_bug.cgi?id=30458
+
+ * webkit/webkitwebsettings.cpp:
+ (webkit_web_settings_class_init):
+ (webkit_web_settings_set_property):
+ (webkit_web_settings_get_property):
+ (webkit_web_settings_copy):
+ * webkit/webkitwebview.cpp:
+ (webkit_web_view_update_settings):
+ (webkit_web_view_settings_notify):
+
+2010-09-22 Mario Sanchez Prada <msanchez@igalia.com>
+
+ Reviewed by Martin Robinson.
+
+ [GTK] Replace instances of g_timeout_add() with g_idle_add() in testatk.c
+ https://bugs.webkit.org/show_bug.cgi?id=46284
+
+ Use g_idle_add() whenever g_timeout_add() was being used.
+
+ This is desired because it's better to rely on the main loop to
+ decide when it's a good moment to execute the task (when idle)
+ than manually setting a timeout, which also sets a minimum amount
+ of time needed to get the function executed.
+
+ * tests/testatk.c:
+ (testWekitAtkTextSelections):
+ (testWebkitAtkGetExtents):
+ (testWebkitAtkListsOfItems):
+ (main):
+
+2010-09-22 Mario Sanchez Prada <msanchez@igalia.com>
+
+ Reviewed by Martin Robinson.
+
+ [Gtk] object:text-changed events should be emitted for entries and password text
+ https://bugs.webkit.org/show_bug.cgi?id=25898
+
+ New unit test to make sure text-changed signals are emitted
+
+ * tests/testatk.c:
+ (textChangedCb): New. Signal handler for the
+ text-changed::insert and text-changed::delete signals.
+ (checkTextChangesAndBailOut): New. Source function to check
+ the global result of the test and quit from the main loop.
+ (testWebkitAtkTextChangedNotifications): New test.
+ (main):
+
+2010-09-22 Martin Robinson <mrobinson@igalia.com>
+
+ Reviewed by Xan Lopez.
+
+ Added information about drop shadow improvements to the NEWS file.
+
+ * NEWS: Added information about drop shadow improvements.
+
+2010-09-21 Xan Lopez <xlopez@igalia.com>
+
+ Reviewed by Martin Robinson.
+
+ [GTK] Fix transfer annotations for WebKitGTK+ static API
+ https://bugs.webkit.org/show_bug.cgi?id=46244
+
+ Deal with all the warnings related to transfer issues. Mostly the
+ problem was the transfer being missing, but there were also typos
+ in the function name or missing ':' at the end of the function
+ name in the gtk-doc.
+
+ * webkit/webkitdownload.cpp:
+ * webkit/webkitnetworkrequest.cpp:
+ * webkit/webkitnetworkresponse.cpp:
+ * webkit/webkitsecurityorigin.cpp:
+ * webkit/webkitwebdatabase.cpp:
+ * webkit/webkitwebdatasource.cpp:
+ * webkit/webkitwebframe.cpp:
+ * webkit/webkitwebhistoryitem.cpp:
+ * webkit/webkitwebinspector.cpp:
+ * webkit/webkitwebresource.cpp:
+ * webkit/webkitwebsettings.cpp:
+ * webkit/webkitwebview.cpp:
+ (webkit_web_view_class_init):
+ (webkit_web_view_get_main_frame):
+
+2010-09-21 Xan Lopez <xlopez@igalia.com>
+
+ Reviewed by Gustavo Noronha.
+
+ Update for 1.3.4 release.
+
+ * NEWS:
+
2010-09-17 Darin Adler <darin@apple.com>
Reviewed by Sam Weinig.
diff --git a/WebKit/gtk/NEWS b/WebKit/gtk/NEWS
index 402c07c..ebeb699 100644
--- a/WebKit/gtk/NEWS
+++ b/WebKit/gtk/NEWS
@@ -4,13 +4,31 @@ WebKitGTK+ 1.3.4
What's new in WebKitGTK+ 1.3.4?
- - Fixes to compile with latest GTK+ changes.
- File reader/writer APIs are now enabled.
- The javascript JIT is now enabled by default on ARM.
- Clipboard data is no longer lost when the process exists.
- Image DnD support.
- GSettings support to save/restore Web Inspector settings.
+ - Add WebSocket support, now enabled by default.
+ - Added WebKitWebView::frame-created signal, emitted when a frame
+ other than the main frame is created in a view.
+ - Added WebKitWebView::view-mode, holding information about how the
+ view is being presented. See the property documentation and
+ http://www.w3.org/TR/view-mode/ for details.
- Fullscreen support for HTML5 media player.
+ - Identify as WebKit/Safari in Google domains when
+ enable-site-specific-quirks is activated. Otherwise we'll get a
+ degraded user experience due to their poor UA detection
+ algorihtms.
+ - Added simple media playback options in the context menu for the
+ media elements.
+ - Update (and require) to work with gobjet-introspection 0.9.5.
+ - Updated to work with GTK+ 3.x 2.90.7 when in GTK+ 3.x mode.
+ - Make --disable-jit actually work.
+ - Add --enable-opcode-stats configure flag. When enabled, statistics
+ about opcode generation will be printed by JSC.
+ - Many a11y fixes, particularly in the AtkText interface.
+ - CSS box shadows render much faster in many cases.
- Many other bugfixes.
================
diff --git a/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp b/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp
index 93b4cc2..13401f5 100644
--- a/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp
+++ b/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp
@@ -601,8 +601,21 @@ PassRefPtr<Frame> FrameLoaderClient::createFrame(const KURL& url, const String&
return childFrame.release();
}
-void FrameLoaderClient::didTransferChildFrameToNewDocument()
+void FrameLoaderClient::didTransferChildFrameToNewDocument(WebCore::Page*)
{
+ ASSERT(m_frame);
+
+ // Update the frame's webview to the new parent's webview.
+ Frame* coreFrame = core(m_frame);
+ WebKitWebView* webView = getViewFromFrame(m_frame);
+
+ Frame* parentCoreFrame = coreFrame->tree()->parent();
+ WebKitWebFrame* parentKitFrame = kit(parentCoreFrame);
+ WebKitWebView* parentWebView = getViewFromFrame(parentKitFrame);
+ if (webView != parentWebView)
+ m_frame->priv->webView = parentWebView;
+
+ ASSERT(core(getViewFromFrame(m_frame)) == coreFrame->page());
}
void FrameLoaderClient::redirectDataToPlugin(Widget* pluginWidget)
diff --git a/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.h b/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.h
index c5ffc6a..206e780 100644
--- a/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.h
+++ b/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.h
@@ -114,7 +114,7 @@ namespace WebKit {
virtual PassRefPtr<WebCore::Frame> createFrame(const WebCore::KURL& url, const WTF::String& name, WebCore::HTMLFrameOwnerElement* ownerElement,
const WTF::String& referrer, bool allowsScrolling, int marginWidth, int marginHeight);
- virtual void didTransferChildFrameToNewDocument();
+ virtual void didTransferChildFrameToNewDocument(WebCore::Page*);
virtual PassRefPtr<WebCore::Widget> createPlugin(const WebCore::IntSize&, WebCore::HTMLPlugInElement*, const WebCore::KURL&, const WTF::Vector<WTF::String>&, const WTF::Vector<WTF::String>&, const WTF::String&, bool);
virtual void redirectDataToPlugin(WebCore::Widget* pluginWidget);
virtual PassRefPtr<WebCore::Widget> createJavaAppletWidget(const WebCore::IntSize&, WebCore::HTMLAppletElement*, const WebCore::KURL& baseURL, const WTF::Vector<WTF::String>& paramNames, const WTF::Vector<WTF::String>& paramValues);
diff --git a/WebKit/gtk/WebCoreSupport/FullscreenVideoController.cpp b/WebKit/gtk/WebCoreSupport/FullscreenVideoController.cpp
index cf9a548..01bc03a 100644
--- a/WebKit/gtk/WebCoreSupport/FullscreenVideoController.cpp
+++ b/WebKit/gtk/WebCoreSupport/FullscreenVideoController.cpp
@@ -175,7 +175,7 @@ void FullscreenVideoController::showHud(bool autoHide)
// Show the cursor.
GdkWindow* window = gtk_widget_get_window(m_window);
- gdk_window_set_cursor(window, m_cursor.get());
+ gdk_window_set_cursor(window, 0);
// Update the progress bar immediately before showing the window.
updateHudProgressBar();
@@ -210,7 +210,7 @@ void FullscreenVideoController::hideHud()
}
GdkWindow* window = gtk_widget_get_window(m_window);
- GdkCursor* cursor = gdk_cursor_new(GDK_BLANK_CURSOR);
+ GdkCursor* cursor = blankCursor();
gdk_window_set_cursor(window, cursor);
gtk_widget_hide_all(m_hudWindow);
@@ -283,8 +283,7 @@ void FullscreenVideoController::enterFullscreen()
gtk_widget_show_all(m_window);
GdkWindow* window = gtk_widget_get_window(m_window);
- GdkCursor* cursor = gdk_cursor_new(GDK_BLANK_CURSOR);
- m_cursor = gdk_window_get_cursor(window);
+ GdkCursor* cursor = blankCursor();
gdk_window_set_cursor(window, cursor);
gdk_cursor_unref(cursor);
diff --git a/WebKit/gtk/WebCoreSupport/FullscreenVideoController.h b/WebKit/gtk/WebCoreSupport/FullscreenVideoController.h
index 9ff1e6a..d4bbea2 100644
--- a/WebKit/gtk/WebCoreSupport/FullscreenVideoController.h
+++ b/WebKit/gtk/WebCoreSupport/FullscreenVideoController.h
@@ -82,7 +82,6 @@ private:
guint m_volumeUpdateId;
bool m_seekLock;
GtkWidget* m_window;
- PlatformRefPtr<GdkCursor> m_cursor;
GtkWidget* m_hudWindow;
GtkAction* m_playPauseAction;
GtkAction* m_exitFullscreenAction;
diff --git a/WebKit/gtk/po/ChangeLog b/WebKit/gtk/po/ChangeLog
index 3665005..19e86ae 100644
--- a/WebKit/gtk/po/ChangeLog
+++ b/WebKit/gtk/po/ChangeLog
@@ -1,3 +1,12 @@
+2010-09-29 Reinout van Schouwen <reinouts@gnome.org>
+
+ Reviewed by Gustavo Noronha.
+
+ [GTK] Updated Dutch translation
+ https://bugs.webkit.org/show_bug.cgi?id=46050
+
+ * nl.po:
+
2010-08-31 Sheriff Bot <webkit.review.bot@gmail.com>
Unreviewed, rolling out r66519.
diff --git a/WebKit/gtk/po/nl.po b/WebKit/gtk/po/nl.po
index aa2da82..e33e284 100644
--- a/WebKit/gtk/po/nl.po
+++ b/WebKit/gtk/po/nl.po
@@ -1,1074 +1,1355 @@
# Dutch translation of webkit-gtk
# Released under the same license as webkit-gtk
-# Reinout van Schouwen <reinouts@gnome.org>, 2009
+# Reinout van Schouwen <reinouts@gnome.org>, 2009, 2010
#
msgid ""
msgstr ""
"Project-Id-Version: webkit 1.1.10\n"
-"Report-Msgid-Bugs-To: http://bugs.webkit.org/\n"
-"POT-Creation-Date: 2010-02-16 15:01-0200\n"
-"PO-Revision-Date: 2010-03-22 00:27+0100\n"
+"Report-Msgid-Bugs-To: http://bugs.webkit.org\n"
+"POT-Creation-Date: 2010-09-08 03:26+0000\n"
+"PO-Revision-Date: 2010-09-19 17:01+0100\n"
"Last-Translator: Reinout van Schouwen <reinouts@gnome.org>\n"
"Language-Team: Dutch <vertaling@vrijschrift.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-#: WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp:535
+#: ../WebCoreSupport/ChromeClientGtk.cpp:569
msgid "Upload File"
msgstr "Bestand uploaden"
-#: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:61
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:143
+#: ../WebCoreSupport/ContextMenuClientGtk.cpp:61
+#: ../../../WebCore/platform/gtk/LocalizedStringsGtk.cpp:143
msgid "Input _Methods"
msgstr "Invoer_methoden"
-#: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:78
+#: ../WebCoreSupport/ContextMenuClientGtk.cpp:78
msgid "LRM _Left-to-right mark"
msgstr "LRM _Links-naar-rechts markering"
-#: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:79
+#: ../WebCoreSupport/ContextMenuClientGtk.cpp:79
msgid "RLM _Right-to-left mark"
msgstr "RLM _Rechts-naar-links markering"
-#: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:80
+#: ../WebCoreSupport/ContextMenuClientGtk.cpp:80
msgid "LRE Left-to-right _embedding"
msgstr "LRE Links-naar-rechts _inbedding"
-#: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:81
+#: ../WebCoreSupport/ContextMenuClientGtk.cpp:81
msgid "RLE Right-to-left e_mbedding"
msgstr "RLE Rechts-naar-links i_nbedding"
-#: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:82
+#: ../WebCoreSupport/ContextMenuClientGtk.cpp:82
msgid "LRO Left-to-right _override"
msgstr "LRO Links-naar-rechts _tenietdoen"
-#: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:83
+#: ../WebCoreSupport/ContextMenuClientGtk.cpp:83
msgid "RLO Right-to-left o_verride"
msgstr "RLO Rechts-naar-links t_enietdoen"
-#: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:84
+#: ../WebCoreSupport/ContextMenuClientGtk.cpp:84
msgid "PDF _Pop directional formatting"
msgstr "PDF _Pop richtingsformattering"
-#: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:85
+#: ../WebCoreSupport/ContextMenuClientGtk.cpp:85
msgid "ZWS _Zero width space"
msgstr "ZWS Spatie _zonder breedte"
-#: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:86
+#: ../WebCoreSupport/ContextMenuClientGtk.cpp:86
msgid "ZWJ Zero width _joiner"
msgstr "ZWJ _koppelaar zonder breedte"
-#: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:87
+#: ../WebCoreSupport/ContextMenuClientGtk.cpp:87
msgid "ZWNJ Zero width _non-joiner"
msgstr "ZWNJ Niet-k_oppelaar zonder breedte"
-#: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:109
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:138
+#: ../WebCoreSupport/ContextMenuClientGtk.cpp:109
+#: ../../../WebCore/platform/gtk/LocalizedStringsGtk.cpp:138
msgid "_Insert Unicode Control Character"
msgstr "_Unicode controleteken invoegen "
-#: WebKit/gtk/webkit/webkitdownload.cpp:262
+#: ../WebCoreSupport/FrameLoaderClientGtk.cpp:1038
+msgid "Load request cancelled"
+msgstr "Laadaanvraag geannuleerd"
+
+#: ../WebCoreSupport/FrameLoaderClientGtk.cpp:1044
+msgid "Not allowed to use restricted network port"
+msgstr "Gebruik van beperkte netwerkpoort niet toegestaan"
+
+#: ../WebCoreSupport/FrameLoaderClientGtk.cpp:1050
+msgid "URL cannot be shown"
+msgstr "Kan URL niet tonen"
+
+#: ../WebCoreSupport/FrameLoaderClientGtk.cpp:1056
+msgid "Frame load was interrupted"
+msgstr "Laden van het frame onderbroken"
+
+#: ../WebCoreSupport/FrameLoaderClientGtk.cpp:1062
+msgid "Content with the specified MIME type cannot be shown"
+msgstr "Kan inhoud met het aangegeven MIME-type niet tonen"
+
+#: ../WebCoreSupport/FrameLoaderClientGtk.cpp:1068
+msgid "File does not exist"
+msgstr "Bestand bestaat niet"
+
+#: ../WebCoreSupport/FrameLoaderClientGtk.cpp:1074
+msgid "Plugin will handle load"
+msgstr "Plug-in handelt het laden af"
+
+#: ../WebCoreSupport/FullscreenVideoController.cpp:385
+#| msgid "play"
+msgid "Play"
+msgstr "Afspelen"
+
+#: ../WebCoreSupport/FullscreenVideoController.cpp:387
+#| msgid "pause"
+msgid "Pause"
+msgstr "Pauzeren"
+
+#: ../WebCoreSupport/FullscreenVideoController.cpp:533
+msgid "Play / Pause"
+msgstr "Afspelen / pauzeren"
+
+#: ../WebCoreSupport/FullscreenVideoController.cpp:533
+msgid "Play or pause the media"
+msgstr "De media afspelen of pauzeren"
+
+#: ../WebCoreSupport/FullscreenVideoController.cpp:541
+msgid "Time:"
+msgstr "Tijd:"
+
+#: ../WebCoreSupport/FullscreenVideoController.cpp:565
+msgid "Exit Fullscreen"
+msgstr "Volledig scherm verlaten"
+
+#: ../WebCoreSupport/FullscreenVideoController.cpp:565
+msgid "Exit from fullscreen mode"
+msgstr "Volledig scherm verlaten"
+
+#: ../webkit/webkitdownload.cpp:272
msgid "Network Request"
msgstr "Netwerkaanvraag"
-#: WebKit/gtk/webkit/webkitdownload.cpp:263
+#: ../webkit/webkitdownload.cpp:273
msgid "The network request for the URI that should be downloaded"
msgstr "De netwerkaanvraag voor de te downloaden URI"
-#: WebKit/gtk/webkit/webkitdownload.cpp:277
+#: ../webkit/webkitdownload.cpp:287
msgid "Network Response"
msgstr "Netwerkantwoord"
-#: WebKit/gtk/webkit/webkitdownload.cpp:278
+#: ../webkit/webkitdownload.cpp:288
msgid "The network response for the URI that should be downloaded"
msgstr "Het netwerkantwoord voor de te downloaden URI"
-#: WebKit/gtk/webkit/webkitdownload.cpp:292
+#: ../webkit/webkitdownload.cpp:302
msgid "Destination URI"
msgstr "Bestemmings-URI"
-#: WebKit/gtk/webkit/webkitdownload.cpp:293
+#: ../webkit/webkitdownload.cpp:303
msgid "The destination URI where to save the file"
msgstr "De bestemmings-URI waar dit bestand opgeslagen moet worden"
-#: WebKit/gtk/webkit/webkitdownload.cpp:307
+#: ../webkit/webkitdownload.cpp:317
msgid "Suggested Filename"
msgstr "Gesuggereerde bestandsnaam"
-#: WebKit/gtk/webkit/webkitdownload.cpp:308
+#: ../webkit/webkitdownload.cpp:318
msgid "The filename suggested as default when saving"
msgstr "De standaard gesuggereerde bestandsnaam bij het opslaan"
-#: WebKit/gtk/webkit/webkitdownload.cpp:325
+#: ../webkit/webkitdownload.cpp:335
msgid "Progress"
msgstr "Voortgang"
-#: WebKit/gtk/webkit/webkitdownload.cpp:326
+#: ../webkit/webkitdownload.cpp:336
msgid "Determines the current progress of the download"
msgstr "Bepaalt de huidige voortgang van de download"
-#: WebKit/gtk/webkit/webkitdownload.cpp:339
+#: ../webkit/webkitdownload.cpp:349
msgid "Status"
msgstr "Status"
-#: WebKit/gtk/webkit/webkitdownload.cpp:340
+#: ../webkit/webkitdownload.cpp:350
msgid "Determines the current status of the download"
msgstr "Bepaalt de huidige status van de download"
-#: WebKit/gtk/webkit/webkitdownload.cpp:355
+#: ../webkit/webkitdownload.cpp:365
msgid "Current Size"
msgstr "Huidige grootte"
-#: WebKit/gtk/webkit/webkitdownload.cpp:356
+#: ../webkit/webkitdownload.cpp:366
msgid "The length of the data already downloaded"
msgstr "De hoeveelheid reeds gedownloade data"
-#: WebKit/gtk/webkit/webkitdownload.cpp:370
+#: ../webkit/webkitdownload.cpp:380
msgid "Total Size"
msgstr "Totale grootte"
-#: WebKit/gtk/webkit/webkitdownload.cpp:371
+#: ../webkit/webkitdownload.cpp:381
msgid "The total size of the file"
msgstr "De totale grootte van het bestand"
-#: WebKit/gtk/webkit/webkitdownload.cpp:522
+#: ../webkit/webkitdownload.cpp:532
msgid "User cancelled the download"
msgstr "Downloaden door gebruiker gestopt"
-#: WebKit/gtk/webkit/webkitsoupauthdialog.c:244
+#: ../webkit/webkithittestresult.cpp:148
+msgid "Context"
+msgstr "Context"
+
+#: ../webkit/webkithittestresult.cpp:149
+msgid "Flags indicating the kind of target that received the event."
+msgstr "Markeringen die het soort doel beschrijven voor ontvangst van de gebeurtenis."
+
+#: ../webkit/webkithittestresult.cpp:163
+msgid "Link URI"
+msgstr "Verwijzings-URI"
+
+#: ../webkit/webkithittestresult.cpp:164
+msgid "The URI to which the target that received the event points, if any."
+msgstr "De URI waarnaar het doel wijst dat de gebeurtenispunten ontvangen heeft, indien aanwezig."
+
+#: ../webkit/webkithittestresult.cpp:177
+msgid "Image URI"
+msgstr "Afbeeldings-URI"
+
+#: ../webkit/webkithittestresult.cpp:178
+msgid ""
+"The URI of the image that is part of the target that received the event, if "
+"any."
+msgstr ""
+"De URI van de afbeelding die onderdeel is van het doel voor gebeurtenisontvangst, indien aanwezig."
+
+#: ../webkit/webkithittestresult.cpp:191
+msgid "Media URI"
+msgstr "Media-URI"
+
+#: ../webkit/webkithittestresult.cpp:192
+msgid ""
+"The URI of the media that is part of the target that received the event, if "
+"any."
+msgstr ""
+"De URI van de media die onderdeel zijn van het doel voor gebeurtenisontvangst, indien aanwezig."
+
+#: ../webkit/webkithittestresult.cpp:213
+msgid "Inner node"
+msgstr "Ingesloten node"
+
+#: ../webkit/webkithittestresult.cpp:214
+msgid "The inner DOM node associated with the hit test result."
+msgstr "De ingesloten DOM-node die geassocieerd is met het hittestresultaat."
+
+#: ../webkit/webkitnetworkrequest.cpp:136
+#: ../webkit/webkitnetworkresponse.cpp:134 ../webkit/webkitwebframe.cpp:315
+#: ../webkit/webkitwebhistoryitem.cpp:178 ../webkit/webkitwebresource.cpp:126
+#: ../webkit/webkitwebview.cpp:2653
+msgid "URI"
+msgstr "URI"
+
+#: ../webkit/webkitnetworkrequest.cpp:137
+msgid "The URI to which the request will be made."
+msgstr "De URI waarnaar de aanvraag gestuurd wordt."
+
+#: ../webkit/webkitnetworkrequest.cpp:150
+#: ../webkit/webkitnetworkresponse.cpp:148
+msgid "Message"
+msgstr "Bericht"
+
+#: ../webkit/webkitnetworkrequest.cpp:151
+msgid "The SoupMessage that backs the request."
+msgstr "De SoupMessage die achter de aanvraag zit."
+
+#: ../webkit/webkitnetworkresponse.cpp:135
+msgid "The URI to which the response will be made."
+msgstr "De URI waarnaar het antwoord verstuurd wordt."
+
+#: ../webkit/webkitnetworkresponse.cpp:149
+msgid "The SoupMessage that backs the response."
+msgstr "De SoupMessage die achter het antwoord zit."
+
+#: ../webkit/webkitsecurityorigin.cpp:151
+msgid "Protocol"
+msgstr "Protocol"
+
+#: ../webkit/webkitsecurityorigin.cpp:152
+msgid "The protocol of the security origin"
+msgstr "Het protocol van de beveiligingsbron"
+
+#: ../webkit/webkitsecurityorigin.cpp:165
+msgid "Host"
+msgstr "Hostcomputer"
+
+#: ../webkit/webkitsecurityorigin.cpp:166
+msgid "The host of the security origin"
+msgstr "De hostcomputer van de beveiligingsbron"
+
+#: ../webkit/webkitsecurityorigin.cpp:179
+msgid "Port"
+msgstr "Poort"
+
+#: ../webkit/webkitsecurityorigin.cpp:180
+msgid "The port of the security origin"
+msgstr "De poort van de beveiligingsbron"
+
+#: ../webkit/webkitsecurityorigin.cpp:193
+msgid "Web Database Usage"
+msgstr "Web-databasegebruik"
+
+#: ../webkit/webkitsecurityorigin.cpp:194
+msgid "The cumulative size of all web databases in the security origin"
+msgstr "De opgetelde grootte van alle webdatabases in de beveiligingsbron"
+
+#: ../webkit/webkitsecurityorigin.cpp:206
+msgid "Web Database Quota"
+msgstr "Webdatabase-quota"
+
+#: ../webkit/webkitsecurityorigin.cpp:207
+msgid "The web database quota of the security origin in bytes"
+msgstr "De webdatabase-quota voor de beveiligingsbron in bytes"
+
+#: ../webkit/webkitsoupauthdialog.c:251
#, c-format
msgid "A username and password are being requested by the site %s"
msgstr "De site %s vraagt een gebruikersnaam en wachtwoord"
-#: WebKit/gtk/webkit/webkitsoupauthdialog.c:269
+#: ../webkit/webkitsoupauthdialog.c:281
+msgid "Server message:"
+msgstr "Serverbericht:"
+
+#: ../webkit/webkitsoupauthdialog.c:294
msgid "Username:"
msgstr "Gebruikersnaam:"
-#: WebKit/gtk/webkit/webkitsoupauthdialog.c:271
+#: ../webkit/webkitsoupauthdialog.c:296
msgid "Password:"
msgstr "Wachtwoord:"
-#: WebKit/gtk/webkit/webkitsoupauthdialog.c:280
+#: ../webkit/webkitsoupauthdialog.c:305
msgid "_Remember password"
msgstr "_Wachtwoord onthouden"
-#: WebKit/gtk/webkit/webkitwebframe.cpp:298
+#: ../webkit/webkitwebdatabase.cpp:176
+msgid "Security Origin"
+msgstr "Beveiligingsbron"
+
+#: ../webkit/webkitwebdatabase.cpp:177
+msgid "The security origin of the database"
+msgstr "De beveiligingsbron van de database"
+
+#: ../webkit/webkitwebdatabase.cpp:190 ../webkit/webkitwebframe.cpp:301
msgid "Name"
msgstr "Naam"
-#: WebKit/gtk/webkit/webkitwebframe.cpp:299
+#: ../webkit/webkitwebdatabase.cpp:191
+msgid "The name of the Web Database database"
+msgstr "De naam van de Web Database-database"
+
+#: ../webkit/webkitwebdatabase.cpp:204
+msgid "Display Name"
+msgstr "Weergavenaam"
+
+#: ../webkit/webkitwebdatabase.cpp:205
+msgid "The display name of the Web Storage database"
+msgstr "De weergavenaam van de Web Storage-database"
+
+#: ../webkit/webkitwebdatabase.cpp:218
+msgid "Expected Size"
+msgstr "Verwachte grootte"
+
+#: ../webkit/webkitwebdatabase.cpp:219
+msgid "The expected size of the Web Database database"
+msgstr "De verwachte grootte van de Web Database-database"
+
+#: ../webkit/webkitwebdatabase.cpp:231
+msgid "Size"
+msgstr "Grootte"
+
+#: ../webkit/webkitwebdatabase.cpp:232
+msgid "The current size of the Web Database database"
+msgstr "De huidige grootte van de Web Database-database"
+
+#: ../webkit/webkitwebdatabase.cpp:244
+msgid "Filename"
+msgstr "Bestandsnaam"
+
+#: ../webkit/webkitwebdatabase.cpp:245
+msgid "The absolute filename of the Web Storage database"
+msgstr "De absolute bestandsnaam van de Web Storage-database"
+
+#: ../webkit/webkitwebframe.cpp:302
msgid "The name of the frame"
msgstr "Naam van het frame"
-#: WebKit/gtk/webkit/webkitwebframe.cpp:305
-#: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:146
-#: WebKit/gtk/webkit/webkitwebview.cpp:2315
+#: ../webkit/webkitwebframe.cpp:308 ../webkit/webkitwebhistoryitem.cpp:146
+#: ../webkit/webkitwebview.cpp:2639
msgid "Title"
msgstr "Titel"
-#: WebKit/gtk/webkit/webkitwebframe.cpp:306
+#: ../webkit/webkitwebframe.cpp:309
msgid "The document title of the frame"
msgstr "De titel van het huidige frame"
-#: WebKit/gtk/webkit/webkitwebframe.cpp:312
-#: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:178
-#: WebKit/gtk/webkit/webkitwebview.cpp:2329
-msgid "URI"
-msgstr "URI"
-
-#: WebKit/gtk/webkit/webkitwebframe.cpp:313
+#: ../webkit/webkitwebframe.cpp:316
msgid "The current URI of the contents displayed by the frame"
msgstr "De huidige URI van de in het frame weergegeven inhoud"
-#: WebKit/gtk/webkit/webkitwebframe.cpp:344
+#: ../webkit/webkitwebframe.cpp:347
msgid "Horizontal Scrollbar Policy"
msgstr "Beleid voor horizontale schuifbalk"
-#: WebKit/gtk/webkit/webkitwebframe.cpp:345
+#: ../webkit/webkitwebframe.cpp:348
msgid ""
"Determines the current policy for the horizontal scrollbar of the frame."
-msgstr ""
-"Bepaalt het beleid voor de horizontale schuifbalk van het frame"
+msgstr "Bepaalt het beleid voor de horizontale schuifbalk van het frame"
-#: WebKit/gtk/webkit/webkitwebframe.cpp:362
+#: ../webkit/webkitwebframe.cpp:365
msgid "Vertical Scrollbar Policy"
msgstr "Beleid voor verticale schuifbalk"
-#: WebKit/gtk/webkit/webkitwebframe.cpp:363
+#: ../webkit/webkitwebframe.cpp:366
msgid "Determines the current policy for the vertical scrollbar of the frame."
msgstr "Bepaalt het huidige beleid voor de verticale schuifbalk van het frame."
-#: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:147
+#: ../webkit/webkitwebhistoryitem.cpp:147
msgid "The title of the history item"
msgstr "De titel van het geschiedenis-item"
-#: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:162
+#: ../webkit/webkitwebhistoryitem.cpp:162
msgid "Alternate Title"
msgstr "Alternatieve titel"
-#: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:163
+#: ../webkit/webkitwebhistoryitem.cpp:163
msgid "The alternate title of the history item"
msgstr "De alternatieve titel van het geschiedenis-item"
-#: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:179
+#: ../webkit/webkitwebhistoryitem.cpp:179
msgid "The URI of the history item"
msgstr "De URI van het geschiedenis-item"
-#: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:194
-#: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:173
+#: ../webkit/webkitwebhistoryitem.cpp:194
+#: ../webkit/webkitwebnavigationaction.cpp:173
msgid "Original URI"
msgstr "Originele URI"
-#: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:195
+#: ../webkit/webkitwebhistoryitem.cpp:195
msgid "The original URI of the history item"
msgstr "De originele URI van het geschiedenis-item"
-#: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:210
+#: ../webkit/webkitwebhistoryitem.cpp:210
msgid "Last visited Time"
msgstr "Laatst bezocht op"
-#: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:211
+#: ../webkit/webkitwebhistoryitem.cpp:211
msgid "The time at which the history item was last visited"
msgstr "De tijd waarop het geschiedenis-item het laatst is bezocht"
-#: WebKit/gtk/webkit/webkitwebinspector.cpp:268
+#: ../webkit/webkitwebinspector.cpp:269
msgid "Web View"
msgstr "Webweergave"
-#: WebKit/gtk/webkit/webkitwebinspector.cpp:269
+#: ../webkit/webkitwebinspector.cpp:270
msgid "The Web View that renders the Web Inspector itself"
msgstr "De webweergave die die Webinspector zelf weergeeft"
-#: WebKit/gtk/webkit/webkitwebinspector.cpp:282
+#: ../webkit/webkitwebinspector.cpp:283
msgid "Inspected URI"
msgstr "Geïnspecteerde URI"
-#: WebKit/gtk/webkit/webkitwebinspector.cpp:283
+#: ../webkit/webkitwebinspector.cpp:284
msgid "The URI that is currently being inspected"
msgstr "De URI die momenteel geïnspecteerd wordt"
-#: WebKit/gtk/webkit/webkitwebinspector.cpp:299
+#: ../webkit/webkitwebinspector.cpp:300
msgid "Enable JavaScript profiling"
msgstr "JavaScript-profilering inschakelen"
-#: WebKit/gtk/webkit/webkitwebinspector.cpp:300
+#: ../webkit/webkitwebinspector.cpp:301
msgid "Profile the executed JavaScript."
msgstr "De uitgevoerde JavaScript profileren."
-#: WebKit/gtk/webkit/webkitwebinspector.cpp:315
+#: ../webkit/webkitwebinspector.cpp:316
msgid "Enable Timeline profiling"
msgstr "Tijdslijn-profilering inschakelen"
-#: WebKit/gtk/webkit/webkitwebinspector.cpp:316
+#: ../webkit/webkitwebinspector.cpp:317
msgid "Profile the WebCore instrumentation."
msgstr "De instrumentering van WebCore profileren."
-#: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:158
+#: ../webkit/webkitwebnavigationaction.cpp:158
msgid "Reason"
msgstr "Reden"
-#: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:159
+#: ../webkit/webkitwebnavigationaction.cpp:159
msgid "The reason why this navigation is occurring"
msgstr "De reden waarom deze navigatie optreedt"
-#: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:174
+#: ../webkit/webkitwebnavigationaction.cpp:174
msgid "The URI that was requested as the target for the navigation"
msgstr "De URI die werd aangevraagd als bestemming voor de navigatie"
-#: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:188
+#: ../webkit/webkitwebnavigationaction.cpp:188
msgid "Button"
msgstr "Knop"
-#: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:189
+#: ../webkit/webkitwebnavigationaction.cpp:189
msgid "The button used to click"
msgstr "De knop voor het klikken"
-#: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:204
+#: ../webkit/webkitwebnavigationaction.cpp:204
msgid "Modifier state"
msgstr "Staat van de optietoets"
-#: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:205
+#: ../webkit/webkitwebnavigationaction.cpp:205
msgid "A bitmask representing the state of the modifier keys"
msgstr "Een bitmask dat de staat van de optietoets representeert"
-#: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:220
+#: ../webkit/webkitwebnavigationaction.cpp:220
msgid "Target frame"
msgstr "Doelframe"
-#: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:221
+#: ../webkit/webkitwebnavigationaction.cpp:221
msgid "The target frame for the navigation"
msgstr "Het doelframe voor de navigatie"
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:233
+#: ../webkit/webkitwebresource.cpp:127
+msgid "The uri of the resource"
+msgstr "De URI van de bron"
+
+#: ../webkit/webkitwebresource.cpp:141
+msgid "MIME Type"
+msgstr "MIME-type"
+
+#: ../webkit/webkitwebresource.cpp:142
+msgid "The MIME type of the resource"
+msgstr "De MIME-type van de bron"
+
+#: ../webkit/webkitwebresource.cpp:156 ../webkit/webkitwebview.cpp:2774
+msgid "Encoding"
+msgstr "Codering"
+
+#: ../webkit/webkitwebresource.cpp:157
+msgid "The text encoding name of the resource"
+msgstr "De tekstcoderingsnaam van de bron"
+
+#: ../webkit/webkitwebresource.cpp:172
+msgid "Frame Name"
+msgstr "Framenaam"
+
+#: ../webkit/webkitwebresource.cpp:173
+msgid "The frame name of the resource"
+msgstr "Naam van het frame van de bron"
+
+#: ../webkit/webkitwebsettings.cpp:241
msgid "Default Encoding"
msgstr "Standaardcodering"
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:234
+#: ../webkit/webkitwebsettings.cpp:242
msgid "The default encoding used to display text."
msgstr "De standaardcodering om tekst weer te geven."
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:242
+#: ../webkit/webkitwebsettings.cpp:250
msgid "Cursive Font Family"
msgstr "Cursive-lettertypefamilie"
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:243
+#: ../webkit/webkitwebsettings.cpp:251
msgid "The default Cursive font family used to display text."
msgstr "De standaard Cursive-lettertypefamilie om tekst weer te geven."
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:251
+#: ../webkit/webkitwebsettings.cpp:259
msgid "Default Font Family"
msgstr "Standaard lettertypefamilie"
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:252
+#: ../webkit/webkitwebsettings.cpp:260
msgid "The default font family used to display text."
msgstr "De standaard lettertypefamilie om tekst weer te geven."
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:260
+#: ../webkit/webkitwebsettings.cpp:268
msgid "Fantasy Font Family"
msgstr "Fantasy-lettertypefamilie"
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:261
+#: ../webkit/webkitwebsettings.cpp:269
msgid "The default Fantasy font family used to display text."
msgstr "De standaard Fantasy-lettertypefamilie om tekst weer te geven."
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:269
+#: ../webkit/webkitwebsettings.cpp:277
msgid "Monospace Font Family"
msgstr "Monospace-lettertypefamilie"
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:270
+#: ../webkit/webkitwebsettings.cpp:278
msgid "The default font family used to display monospace text."
msgstr "De standaard lettertypefamilie om vaste-breedte-tekst weer te geven."
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:278
+#: ../webkit/webkitwebsettings.cpp:286
msgid "Sans Serif Font Family"
msgstr "Sans Serif-lettertypefamilie"
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:279
+#: ../webkit/webkitwebsettings.cpp:287
msgid "The default Sans Serif font family used to display text."
msgstr "De standaard Sans Serif-lettertypefamilie om tekst weer te geven."
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:287
+#: ../webkit/webkitwebsettings.cpp:295
msgid "Serif Font Family"
msgstr "Serif-lettertypefamilie"
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:288
+#: ../webkit/webkitwebsettings.cpp:296
msgid "The default Serif font family used to display text."
msgstr "De standaard Serif-lettertypefamilie om tekst weer te geven."
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:296
+#: ../webkit/webkitwebsettings.cpp:304
msgid "Default Font Size"
msgstr "Standaard korpsgrootte"
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:297
+#: ../webkit/webkitwebsettings.cpp:305
msgid "The default font size used to display text."
msgstr "De standaard korpsgrootte om tekst weer te geven."
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:305
+#: ../webkit/webkitwebsettings.cpp:313
msgid "Default Monospace Font Size"
msgstr "Standaard Monospace-lettergrootte"
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:306
+#: ../webkit/webkitwebsettings.cpp:314
msgid "The default font size used to display monospace text."
msgstr "De standaard lettergrootte om vaste-breedte-tekst weer te geven."
# Korpsgrootte/lettergrootte?
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:314
+#: ../webkit/webkitwebsettings.cpp:322
msgid "Minimum Font Size"
msgstr "Minimum korpsgrootte"
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:315
+#: ../webkit/webkitwebsettings.cpp:323
msgid "The minimum font size used to display text."
msgstr "De minimum lettergrootte om tekst weer te geven."
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:323
+#: ../webkit/webkitwebsettings.cpp:331
msgid "Minimum Logical Font Size"
msgstr "Minimum logische korpsgrootte"
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:324
+#: ../webkit/webkitwebsettings.cpp:332
msgid "The minimum logical font size used to display text."
msgstr "De minimum logische korpsgrootte om tekst weer te geven."
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:343
+#: ../webkit/webkitwebsettings.cpp:351
msgid "Enforce 96 DPI"
msgstr "96 DPI afdwingen"
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:344
+#: ../webkit/webkitwebsettings.cpp:352
msgid "Enforce a resolution of 96 DPI"
msgstr "Een resolutie van 96 DPI afdwingen"
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:352
+#: ../webkit/webkitwebsettings.cpp:360
msgid "Auto Load Images"
msgstr "Afbeeldingen automatisch laden"
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:353
+#: ../webkit/webkitwebsettings.cpp:361
msgid "Load images automatically."
msgstr "Automatisch afbeeldingen laden."
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:361
+#: ../webkit/webkitwebsettings.cpp:369
msgid "Auto Shrink Images"
msgstr "Afbeeldingen automatisch verkleinen"
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:362
+#: ../webkit/webkitwebsettings.cpp:370
msgid "Automatically shrink standalone images to fit."
msgstr "Automatisch losstaande afbeeldingen passend maken."
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:370
+#: ../webkit/webkitwebsettings.cpp:378
msgid "Print Backgrounds"
msgstr "Achtergronden afdrukken"
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:371
+#: ../webkit/webkitwebsettings.cpp:379
msgid "Whether background images should be printed."
msgstr "Of achtergrondafbeeldingen afgedrukt moeten worden."
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:379
+#: ../webkit/webkitwebsettings.cpp:387
msgid "Enable Scripts"
msgstr "Scripts inschakelen"
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:380
+#: ../webkit/webkitwebsettings.cpp:388
msgid "Enable embedded scripting languages."
msgstr "Ingebedde scripttalen inschakelen."
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:388
+#: ../webkit/webkitwebsettings.cpp:396
msgid "Enable Plugins"
msgstr "Plugins inschakelen"
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:389
+#: ../webkit/webkitwebsettings.cpp:397
msgid "Enable embedded plugin objects."
msgstr "Ingebedde plugin-objecten inschakelen."
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:397
+#: ../webkit/webkitwebsettings.cpp:405
msgid "Resizable Text Areas"
msgstr "Tekstgebieden van grootte veranderbaar"
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:398
+#: ../webkit/webkitwebsettings.cpp:406
msgid "Whether text areas are resizable."
msgstr "Of de grootte van tekstgebieden gewijzigd kan worden."
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:405
+#: ../webkit/webkitwebsettings.cpp:413
msgid "User Stylesheet URI"
msgstr "URI van gebruikersstijlblad"
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:406
+#: ../webkit/webkitwebsettings.cpp:414
msgid "The URI of a stylesheet that is applied to every page."
msgstr "De URI van een stijlblad dat wordt toegepast op elke pagina."
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:421
+#: ../webkit/webkitwebsettings.cpp:429
msgid "Zoom Stepping Value"
msgstr "Stapgrootte voor in- en uitzoomen"
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:422
+#: ../webkit/webkitwebsettings.cpp:430
msgid "The value by which the zoom level is changed when zooming in or out."
msgstr ""
"De hoeveelheid waarmee het zoomniveau verandert bij het in- en uitzoomen."
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:440
+#: ../webkit/webkitwebsettings.cpp:448
msgid "Enable Developer Extras"
msgstr "Extraatjes voor ontwikkelaars"
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:441
+#: ../webkit/webkitwebsettings.cpp:449
msgid "Enables special extensions that help developers"
msgstr "Schakelt speciale uitbreidingen in die ontwikkelaars helpen"
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:461
+#: ../webkit/webkitwebsettings.cpp:469
msgid "Enable Private Browsing"
msgstr "Privé-browsen inschakelen"
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:462
+#: ../webkit/webkitwebsettings.cpp:470
msgid "Enables private browsing mode"
msgstr "Schakelt de stand voor privé-browsen in"
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:477
+#: ../webkit/webkitwebsettings.cpp:485
msgid "Enable Spell Checking"
msgstr "Spellingcontrole inschakelen"
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:478
+#: ../webkit/webkitwebsettings.cpp:486
msgid "Enables spell checking while typing"
msgstr "Schakelt spellingcontrole tijdens het typen in"
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:501
+#: ../webkit/webkitwebsettings.cpp:509
msgid "Languages to use for spell checking"
msgstr "Te gebruiken talen bij spellingcontrole"
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:502
+#: ../webkit/webkitwebsettings.cpp:510
msgid "Comma separated list of languages to use for spell checking"
msgstr "Kommagescheiden lijst van talen voor spellingcontrole"
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:516
+#: ../webkit/webkitwebsettings.cpp:524
msgid "Enable Caret Browsing"
msgstr "Cursor-browsen inschakelen"
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:517
+#: ../webkit/webkitwebsettings.cpp:525
msgid "Whether to enable accesibility enhanced keyboard navigation"
-msgstr "Of toegankelijkheidsgeoptimaliseerde toetsenbordnavigatie is ingeschakeld"
+msgstr ""
+"Of toegankelijkheidsgeoptimaliseerde toetsenbordnavigatie is ingeschakeld"
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:532
+#: ../webkit/webkitwebsettings.cpp:540
msgid "Enable HTML5 Database"
msgstr "HTML5-database inschakelen"
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:533
+#: ../webkit/webkitwebsettings.cpp:541
msgid "Whether to enable HTML5 database support"
msgstr "Of HTML5-databaseondersteuning is ingeschakeld"
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:548
+#: ../webkit/webkitwebsettings.cpp:556
msgid "Enable HTML5 Local Storage"
msgstr "HTML5-lokale opslag inschakelen"
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:549
+#: ../webkit/webkitwebsettings.cpp:557
msgid "Whether to enable HTML5 Local Storage support"
msgstr "Of HTML5-lokale opslag ingeschakeld moet zijn"
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:563
+#: ../webkit/webkitwebsettings.cpp:571
msgid "Enable XSS Auditor"
msgstr "XSS-auditor inschakelen"
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:564
-msgid "Whether to enable teh XSS auditor"
+#: ../webkit/webkitwebsettings.cpp:572
+msgid "Whether to enable the XSS auditor"
msgstr "Of de XSS-auditor is ingeschakeld"
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:582
+#: ../webkit/webkitwebsettings.cpp:590
+msgid "Enable Spatial Navigation"
+msgstr "Ruimtelijke navigatie inschakelen"
+
+#: ../webkit/webkitwebsettings.cpp:591
+msgid "Whether to enable Spatial Navigation"
+msgstr "Of ruimtelijke navigatie is ingeschakeld"
+
+#: ../webkit/webkitwebsettings.cpp:608
msgid "User Agent"
msgstr "User-agent"
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:583
+#: ../webkit/webkitwebsettings.cpp:609
msgid "The User-Agent string used by WebKitGtk"
msgstr "De User-Agent-tekenreeks die WebKitGtk gebruikt"
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:598
+#: ../webkit/webkitwebsettings.cpp:624
msgid "JavaScript can open windows automatically"
msgstr "JavaScript kan automatisch vensters openen"
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:599
+#: ../webkit/webkitwebsettings.cpp:625
msgid "Whether JavaScript can open windows automatically"
msgstr "Of JavaScript automatisch vensters kan openen"
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:614
+#: ../webkit/webkitwebsettings.cpp:639
+msgid "JavaScript can access Clipboard"
+msgstr "JavaScript heeft toegang tot klembord"
+
+#: ../webkit/webkitwebsettings.cpp:640
+msgid "Whether JavaScript can access Clipboard"
+msgstr "Of JavaScript het klembord kan benaderen"
+
+#: ../webkit/webkitwebsettings.cpp:656
msgid "Enable offline web application cache"
msgstr "Offline webapplicatiebuffer inschakelen"
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:615
+#: ../webkit/webkitwebsettings.cpp:657
msgid "Whether to enable offline web application cache"
msgstr "Of de offline webapplicatiebuffer is ingeschakeld"
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:642
+#: ../webkit/webkitwebsettings.cpp:684
msgid "Editing behavior"
msgstr "Gedrag bij bewerken"
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:643
+#: ../webkit/webkitwebsettings.cpp:685
msgid "The behavior mode to use in editing mode"
msgstr "De gedragsmodus in de bewerkingsstand"
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:659
+#: ../webkit/webkitwebsettings.cpp:701
msgid "Enable universal access from file URIs"
msgstr "Universele toegang vanaf bestands-URI's inschakelen"
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:660
+#: ../webkit/webkitwebsettings.cpp:702
msgid "Whether to allow universal access from file URIs"
msgstr "Of universele toegang vanaf bestands-URI's is ingeschakeld"
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:675
+#: ../webkit/webkitwebsettings.cpp:717
msgid "Enable DOM paste"
msgstr "DOM-plakken inschakelen"
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:676
+#: ../webkit/webkitwebsettings.cpp:718
msgid "Whether to enable DOM paste"
msgstr "Of plakken vanuit het DOM is ingeschakeld"
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:694
+#: ../webkit/webkitwebsettings.cpp:736
msgid "Tab key cycles through elements"
msgstr "Tab-toets wandelt door elementen"
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:695
+#: ../webkit/webkitwebsettings.cpp:737
msgid "Whether the tab key cycles through elements on the page."
msgstr "Of de tab-toets door de elementen op de pagina wandelt."
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:715
+#: ../webkit/webkitwebsettings.cpp:757
msgid "Enable Default Context Menu"
msgstr "Standaard-contextmenu inschakelen"
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:716
+#: ../webkit/webkitwebsettings.cpp:758
msgid ""
"Enables the handling of right-clicks for the creation of the default context "
"menu"
msgstr ""
-"Schakelt het afhandelen van klikken met de tweede muisknop in voor het creëren "
-"van het standaard contextmenu"
+"Schakelt het afhandelen van klikken met de tweede muisknop in voor het "
+"creëren van het standaard contextmenu"
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:736
+#: ../webkit/webkitwebsettings.cpp:778
msgid "Enable Site Specific Quirks"
msgstr "Site-specifieke eigenaardigheden inschakelen"
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:737
+#: ../webkit/webkitwebsettings.cpp:779
msgid "Enables the site-specific compatibility workarounds"
msgstr "Schakelt omzeilingen in voor compatibiliteit met specifieke websites"
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:759
+#: ../webkit/webkitwebsettings.cpp:801
msgid "Enable page cache"
msgstr "Paginabuffer inschakelen"
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:760
+#: ../webkit/webkitwebsettings.cpp:802
msgid "Whether the page cache should be used"
msgstr "Of de paginabuffer gebruikt moet worden"
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:780
+#: ../webkit/webkitwebsettings.cpp:822
msgid "Auto Resize Window"
msgstr "Venstergrootte automatisch aanpassen"
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:781
+#: ../webkit/webkitwebsettings.cpp:823
msgid "Automatically resize the toplevel window when a page requests it"
-msgstr "Grootte van topniveauvenster automatisch aanpassen wanneer pagina hierom vraagt"
+msgstr ""
+"Grootte van topniveauvenster automatisch aanpassen wanneer pagina hierom "
+"vraagt"
+
+#: ../webkit/webkitwebsettings.cpp:855
+msgid "Enable Java Applet"
+msgstr "Java-applet inschakelen"
+
+#: ../webkit/webkitwebsettings.cpp:856
+msgid "Whether Java Applet support through <applet> should be enabled"
+msgstr "Of ondersteuning voor Java-applets via <applet> ingeschakeld is"
-#: WebKit/gtk/webkit/webkitwebview.cpp:2316
+#: ../webkit/webkitwebview.cpp:2640
msgid "Returns the @web_view's document title"
msgstr "Geeft de documenttitel van de @web_view terug"
-#: WebKit/gtk/webkit/webkitwebview.cpp:2330
+#: ../webkit/webkitwebview.cpp:2654
msgid "Returns the current URI of the contents displayed by the @web_view"
msgstr "Geeft de huidige URI terug van de inhoud die de @web_view weergeeft"
-#: WebKit/gtk/webkit/webkitwebview.cpp:2343
+#: ../webkit/webkitwebview.cpp:2667
msgid "Copy target list"
msgstr "Kopieerdoellijst"
-#: WebKit/gtk/webkit/webkitwebview.cpp:2344
+#: ../webkit/webkitwebview.cpp:2668
msgid "The list of targets this web view supports for clipboard copying"
msgstr ""
"De lijst met targets die deze webweergave ondersteunt voor het kopiëren van "
"het klembord"
-#: WebKit/gtk/webkit/webkitwebview.cpp:2357
+#: ../webkit/webkitwebview.cpp:2681
msgid "Paste target list"
msgstr "Plakdoellijst"
-#: WebKit/gtk/webkit/webkitwebview.cpp:2358
+#: ../webkit/webkitwebview.cpp:2682
msgid "The list of targets this web view supports for clipboard pasting"
msgstr ""
"De lijst met targets die deze webview ondersteunt voor het plakken van het "
"klembord"
-#: WebKit/gtk/webkit/webkitwebview.cpp:2364
+#: ../webkit/webkitwebview.cpp:2688
msgid "Settings"
msgstr "Instellingen"
-#: WebKit/gtk/webkit/webkitwebview.cpp:2365
+#: ../webkit/webkitwebview.cpp:2689
msgid "An associated WebKitWebSettings instance"
msgstr "Een geassocieerde instantie van WebKitWebSettings"
-#: WebKit/gtk/webkit/webkitwebview.cpp:2378
+#: ../webkit/webkitwebview.cpp:2702
msgid "Web Inspector"
msgstr "Web-inspector"
-#: WebKit/gtk/webkit/webkitwebview.cpp:2379
+#: ../webkit/webkitwebview.cpp:2703
msgid "The associated WebKitWebInspector instance"
msgstr "De geassocieerde instantie van WebKitWebInspector"
-#: WebKit/gtk/webkit/webkitwebview.cpp:2399
+#: ../webkit/webkitwebview.cpp:2723
msgid "Editable"
msgstr "Bewerkbaar"
-#: WebKit/gtk/webkit/webkitwebview.cpp:2400
+#: ../webkit/webkitwebview.cpp:2724
msgid "Whether content can be modified by the user"
msgstr "Of de tekst gewijzigd kan worden door de gebruiker"
-#: WebKit/gtk/webkit/webkitwebview.cpp:2406
+#: ../webkit/webkitwebview.cpp:2730
msgid "Transparent"
msgstr "Transparant"
-#: WebKit/gtk/webkit/webkitwebview.cpp:2407
+#: ../webkit/webkitwebview.cpp:2731
msgid "Whether content has a transparent background"
msgstr "Of de inhoud een transparante achtergrond heeft"
-#: WebKit/gtk/webkit/webkitwebview.cpp:2420
+#: ../webkit/webkitwebview.cpp:2744
msgid "Zoom level"
msgstr "Zoomniveau"
-#: WebKit/gtk/webkit/webkitwebview.cpp:2421
+#: ../webkit/webkitwebview.cpp:2745
msgid "The level of zoom of the content"
msgstr "Zoomfactor van de inhoud"
-#: WebKit/gtk/webkit/webkitwebview.cpp:2436
+#: ../webkit/webkitwebview.cpp:2760
msgid "Full content zoom"
msgstr "Zoomen op volledige inhoud"
-#: WebKit/gtk/webkit/webkitwebview.cpp:2437
+#: ../webkit/webkitwebview.cpp:2761
msgid "Whether the full content is scaled when zooming"
msgstr "Of de volledige inhoud op schaal wordt gebracht bij het zoomen"
-#: WebKit/gtk/webkit/webkitwebview.cpp:2450
-msgid "Encoding"
-msgstr "Codering"
-
-#: WebKit/gtk/webkit/webkitwebview.cpp:2451
+#: ../webkit/webkitwebview.cpp:2775
msgid "The default encoding of the web view"
msgstr "Standaard codering van de webweergave"
-#: WebKit/gtk/webkit/webkitwebview.cpp:2464
+#: ../webkit/webkitwebview.cpp:2788
msgid "Custom Encoding"
msgstr "Aangepaste codering"
-#: WebKit/gtk/webkit/webkitwebview.cpp:2465
+#: ../webkit/webkitwebview.cpp:2789
msgid "The custom encoding of the web view"
msgstr "De aangepaste codering van de webweergave"
-#: WebKit/gtk/webkit/webkitwebview.cpp:2517
+#: ../webkit/webkitwebview.cpp:2841
msgid "Icon URI"
msgstr "Pictogram-URI"
-#: WebKit/gtk/webkit/webkitwebview.cpp:2518
+#: ../webkit/webkitwebview.cpp:2842
msgid "The URI for the favicon for the #WebKitWebView."
msgstr "De URI voor het favicon van de #WebKitWebView."
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:55
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:60
+#: ../../../WebCore/platform/gtk/LocalizedStringsGtk.cpp:55
+#: ../../../WebCore/platform/gtk/LocalizedStringsGtk.cpp:60
msgid "Submit"
msgstr "Indienen"
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:65
+#: ../../../WebCore/platform/gtk/LocalizedStringsGtk.cpp:65
msgid "Reset"
msgstr "Herinitialiseren"
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:70
-msgid "_Searchable Index"
-msgstr "Door_zoekbare index"
+#: ../../../WebCore/platform/gtk/LocalizedStringsGtk.cpp:70
+msgid "This is a searchable index. Enter search keywords: "
+msgstr "Dit is een doorzoekbare index. Voer zoekwoorden in: "
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:75
+#: ../../../WebCore/platform/gtk/LocalizedStringsGtk.cpp:75
msgid "Choose File"
msgstr "Kies een bestand"
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:80
+#: ../../../WebCore/platform/gtk/LocalizedStringsGtk.cpp:80
msgid "(None)"
msgstr "(Geen)"
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:85
+#: ../../../WebCore/platform/gtk/LocalizedStringsGtk.cpp:85
msgid "Open Link in New _Window"
msgstr "Verwijzing openen in _nieuw venster"
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:90
+#: ../../../WebCore/platform/gtk/LocalizedStringsGtk.cpp:90
msgid "_Download Linked File"
msgstr "Bestand _downloaden"
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:95
+#: ../../../WebCore/platform/gtk/LocalizedStringsGtk.cpp:95
msgid "Copy Link Loc_ation"
msgstr "Verwijzings_adres kopiëren"
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:100
+#: ../../../WebCore/platform/gtk/LocalizedStringsGtk.cpp:100
msgid "Open _Image in New Window"
msgstr "Af_beelding openen in nieuw venster"
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:105
+#: ../../../WebCore/platform/gtk/LocalizedStringsGtk.cpp:105
msgid "Sa_ve Image As"
msgstr "Afbeelding opslaan _als…"
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:110
+#: ../../../WebCore/platform/gtk/LocalizedStringsGtk.cpp:110
msgid "Cop_y Image"
msgstr "Afbeelding _kopiëren"
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:115
+#: ../../../WebCore/platform/gtk/LocalizedStringsGtk.cpp:115
msgid "Open _Frame in New Window"
msgstr "_Deelvenster openen in nieuw venster"
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:166
+#: ../../../WebCore/platform/gtk/LocalizedStringsGtk.cpp:166
msgid "_Reload"
msgstr "Ve_rversen"
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:183
+#: ../../../WebCore/platform/gtk/LocalizedStringsGtk.cpp:183
msgid "No Guesses Found"
msgstr "Geen suggesties gevonden"
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:188
+#: ../../../WebCore/platform/gtk/LocalizedStringsGtk.cpp:188
msgid "_Ignore Spelling"
msgstr "Spelling _negeren"
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:193
+#: ../../../WebCore/platform/gtk/LocalizedStringsGtk.cpp:193
msgid "_Learn Spelling"
msgstr "_Spelling leren"
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:198
+#: ../../../WebCore/platform/gtk/LocalizedStringsGtk.cpp:198
msgid "_Search the Web"
msgstr "Het web door_zoeken"
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:203
+#: ../../../WebCore/platform/gtk/LocalizedStringsGtk.cpp:203
msgid "_Look Up in Dictionary"
msgstr "O_pzoeken in woordenboek"
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:208
+#: ../../../WebCore/platform/gtk/LocalizedStringsGtk.cpp:208
msgid "_Open Link"
msgstr "Koppeling _openen"
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:213
+#: ../../../WebCore/platform/gtk/LocalizedStringsGtk.cpp:213
msgid "Ignore _Grammar"
msgstr "_Grammatica negeren"
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:218
+#: ../../../WebCore/platform/gtk/LocalizedStringsGtk.cpp:218
msgid "Spelling and _Grammar"
msgstr "Spelling en _grammatica"
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:223
+#: ../../../WebCore/platform/gtk/LocalizedStringsGtk.cpp:223
msgid "_Show Spelling and Grammar"
msgstr "Spelling en grammatica _tonen"
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:223
+#: ../../../WebCore/platform/gtk/LocalizedStringsGtk.cpp:223
msgid "_Hide Spelling and Grammar"
msgstr "Spelling en grammatica ver_bergen"
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:228
+#: ../../../WebCore/platform/gtk/LocalizedStringsGtk.cpp:228
msgid "_Check Document Now"
msgstr "Het document nu _controleren"
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:233
+#: ../../../WebCore/platform/gtk/LocalizedStringsGtk.cpp:233
msgid "Check Spelling While _Typing"
msgstr "_Spelling controleren tijdens het typen"
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:238
+#: ../../../WebCore/platform/gtk/LocalizedStringsGtk.cpp:238
msgid "Check _Grammar With Spelling"
msgstr "_Grammatica controleren naast spelling"
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:243
+#: ../../../WebCore/platform/gtk/LocalizedStringsGtk.cpp:243
msgid "_Font"
msgstr "_Lettertype"
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:266
+#: ../../../WebCore/platform/gtk/LocalizedStringsGtk.cpp:266
msgid "_Outline"
msgstr "_Omtrek"
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:271
+#: ../../../WebCore/platform/gtk/LocalizedStringsGtk.cpp:271
msgid "Inspect _Element"
msgstr "_Element inspecteren"
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:276
+#: ../../../WebCore/platform/gtk/LocalizedStringsGtk.cpp:276
msgid "No recent searches"
msgstr "Geen recente zoekopdrachten"
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:281
+#: ../../../WebCore/platform/gtk/LocalizedStringsGtk.cpp:281
msgid "Recent searches"
msgstr "Recente zoekopdrachten"
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:286
+#: ../../../WebCore/platform/gtk/LocalizedStringsGtk.cpp:286
msgid "_Clear recent searches"
msgstr "Recente zoekopdrachten _wissen"
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:291
+#: ../../../WebCore/platform/gtk/LocalizedStringsGtk.cpp:291
msgid "term"
msgstr "term"
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:296
+#: ../../../WebCore/platform/gtk/LocalizedStringsGtk.cpp:296
msgid "definition"
msgstr "definitie"
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:301
+#: ../../../WebCore/platform/gtk/LocalizedStringsGtk.cpp:301
msgid "press"
msgstr "druk"
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:306
+#: ../../../WebCore/platform/gtk/LocalizedStringsGtk.cpp:306
msgid "select"
msgstr "selecteren"
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:311
+#: ../../../WebCore/platform/gtk/LocalizedStringsGtk.cpp:311
msgid "activate"
msgstr "activeren"
# check / uncheck is aankruisen / deselecteren?
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:316
+#: ../../../WebCore/platform/gtk/LocalizedStringsGtk.cpp:316
msgid "uncheck"
msgstr "deselecteren"
# check / uncheck is aankruisen / deselecteren?
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:321
+#: ../../../WebCore/platform/gtk/LocalizedStringsGtk.cpp:321
msgid "check"
msgstr "aankruisen"
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:326
+#: ../../../WebCore/platform/gtk/LocalizedStringsGtk.cpp:326
msgid "jump"
msgstr "springen"
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:342
+#: ../../../WebCore/platform/gtk/LocalizedStringsGtk.cpp:341
+msgid "Missing Plug-in"
+msgstr "Ontbrekende plug-in"
+
+#: ../../../WebCore/platform/gtk/LocalizedStringsGtk.cpp:347
+msgid "Plug-in Failure"
+msgstr "Fout in plug-in"
+
+#. FIXME: If this file gets localized, this should really be localized as one string with a wildcard for the number.
+#: ../../../WebCore/platform/gtk/LocalizedStringsGtk.cpp:353
msgid " files"
msgstr " bestanden"
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:347
+#: ../../../WebCore/platform/gtk/LocalizedStringsGtk.cpp:358
msgid "Unknown"
msgstr "Onbekend"
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:364
+#: ../../../WebCore/platform/gtk/LocalizedStringsGtk.cpp:363
+#, c-format
+msgctxt "Title string for images"
+msgid "%s (%dx%d pixels)"
+msgstr "%s (%d×%d pixels)"
+
+#: ../../../WebCore/platform/gtk/LocalizedStringsGtk.cpp:375
msgid "Loading..."
msgstr "Laden…"
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:369
+#: ../../../WebCore/platform/gtk/LocalizedStringsGtk.cpp:380
msgid "Live Broadcast"
msgstr "Live-uitzending"
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:375
+#: ../../../WebCore/platform/gtk/LocalizedStringsGtk.cpp:386
msgid "audio element controller"
msgstr "besturing audio-element"
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:377
+#: ../../../WebCore/platform/gtk/LocalizedStringsGtk.cpp:388
msgid "video element controller"
msgstr "besturing video-element"
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:379
+#: ../../../WebCore/platform/gtk/LocalizedStringsGtk.cpp:390
msgid "mute"
msgstr "dempen"
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:381
+#: ../../../WebCore/platform/gtk/LocalizedStringsGtk.cpp:392
msgid "unmute"
msgstr "geluid aan"
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:383
+#: ../../../WebCore/platform/gtk/LocalizedStringsGtk.cpp:394
msgid "play"
msgstr "afspelen"
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:385
+#: ../../../WebCore/platform/gtk/LocalizedStringsGtk.cpp:396
msgid "pause"
msgstr "pauze"
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:387
+#: ../../../WebCore/platform/gtk/LocalizedStringsGtk.cpp:398
msgid "movie time"
msgstr "afspeelduur"
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:389
+#: ../../../WebCore/platform/gtk/LocalizedStringsGtk.cpp:400
msgid "timeline slider thumb"
-msgstr ""
+msgstr "tijdschuifbalk-miniatuur"
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:391
+#: ../../../WebCore/platform/gtk/LocalizedStringsGtk.cpp:402
msgid "back 30 seconds"
msgstr "30 seconden terug"
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:393
+#: ../../../WebCore/platform/gtk/LocalizedStringsGtk.cpp:404
msgid "return to realtime"
msgstr "terug naar realtime"
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:395
+#: ../../../WebCore/platform/gtk/LocalizedStringsGtk.cpp:406
msgid "elapsed time"
msgstr "verstreken tijd"
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:397
+#: ../../../WebCore/platform/gtk/LocalizedStringsGtk.cpp:408
msgid "remaining time"
msgstr "tijd te gaan"
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:399
+#: ../../../WebCore/platform/gtk/LocalizedStringsGtk.cpp:410
msgid "status"
msgstr "status"
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:401
+#: ../../../WebCore/platform/gtk/LocalizedStringsGtk.cpp:412
msgid "fullscreen"
msgstr "volledig scherm"
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:403
+#: ../../../WebCore/platform/gtk/LocalizedStringsGtk.cpp:414
msgid "fast forward"
msgstr "snel vooruit"
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:405
+#: ../../../WebCore/platform/gtk/LocalizedStringsGtk.cpp:416
msgid "fast reverse"
msgstr "snel achteruit"
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:407
+#: ../../../WebCore/platform/gtk/LocalizedStringsGtk.cpp:418
msgid "show closed captions"
msgstr "ondertiteling tonen"
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:409
+#: ../../../WebCore/platform/gtk/LocalizedStringsGtk.cpp:420
msgid "hide closed captions"
msgstr "ondertiteling verbergen"
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:418
+#: ../../../WebCore/platform/gtk/LocalizedStringsGtk.cpp:429
msgid "audio element playback controls and status display"
msgstr "afspeelbesturing en statusweergave audio-element"
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:420
+#: ../../../WebCore/platform/gtk/LocalizedStringsGtk.cpp:431
msgid "video element playback controls and status display"
msgstr "afspeelbesturing en statusweergave video-element"
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:422
+#: ../../../WebCore/platform/gtk/LocalizedStringsGtk.cpp:433
msgid "mute audio tracks"
msgstr "audiosporen dempen"
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:424
+#: ../../../WebCore/platform/gtk/LocalizedStringsGtk.cpp:435
msgid "unmute audio tracks"
msgstr "audiosporen laten horen"
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:426
+#: ../../../WebCore/platform/gtk/LocalizedStringsGtk.cpp:437
msgid "begin playback"
msgstr "afspelen beginnen"
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:428
+#: ../../../WebCore/platform/gtk/LocalizedStringsGtk.cpp:439
msgid "pause playback"
msgstr "afspelen pauzeren"
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:430
+#: ../../../WebCore/platform/gtk/LocalizedStringsGtk.cpp:441
msgid "movie time scrubber"
-msgstr ""
+msgstr "filmtijdscrubber"
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:432
+#: ../../../WebCore/platform/gtk/LocalizedStringsGtk.cpp:443
msgid "movie time scrubber thumb"
-msgstr ""
+msgstr "filmtijdscrubber-miniatuur"
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:434
+#: ../../../WebCore/platform/gtk/LocalizedStringsGtk.cpp:445
msgid "seek movie back 30 seconds"
msgstr "30 seconden terugzoeken in film"
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:436
+#: ../../../WebCore/platform/gtk/LocalizedStringsGtk.cpp:447
msgid "return streaming movie to real time"
msgstr "terugkeren naar realtime in streamende film"
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:438
+#: ../../../WebCore/platform/gtk/LocalizedStringsGtk.cpp:449
msgid "current movie time in seconds"
msgstr "huidige filmtijd in seconden"
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:440
+#: ../../../WebCore/platform/gtk/LocalizedStringsGtk.cpp:451
msgid "number of seconds of movie remaining"
msgstr "aantal seconden film te gaan"
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:442
+#: ../../../WebCore/platform/gtk/LocalizedStringsGtk.cpp:453
msgid "current movie status"
msgstr "huidige filmstatus"
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:444
+#: ../../../WebCore/platform/gtk/LocalizedStringsGtk.cpp:455
msgid "seek quickly back"
msgstr "snel achteruit zoeken"
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:446
+#: ../../../WebCore/platform/gtk/LocalizedStringsGtk.cpp:457
msgid "seek quickly forward"
msgstr "snel vooruit zoeken"
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:448
+#: ../../../WebCore/platform/gtk/LocalizedStringsGtk.cpp:459
msgid "Play movie in fullscreen mode"
msgstr "Film afspelen in volledig scherm"
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:450
+#: ../../../WebCore/platform/gtk/LocalizedStringsGtk.cpp:461
msgid "start displaying closed captions"
msgstr "beginnen met tonen van ondertiteling"
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:452
+#: ../../../WebCore/platform/gtk/LocalizedStringsGtk.cpp:463
msgid "stop displaying closed captions"
msgstr "stoppen met tonen van ondertiteling"
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:461
+#: ../../../WebCore/platform/gtk/LocalizedStringsGtk.cpp:472
msgid "indefinite time"
msgstr "onbepaalde tijd"
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:491
+#: ../../../WebCore/platform/gtk/LocalizedStringsGtk.cpp:502
msgid "value missing"
msgstr "waarde ontbreekt"
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:497
+#: ../../../WebCore/platform/gtk/LocalizedStringsGtk.cpp:508
msgid "type mismatch"
msgstr "type komt niet overeen"
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:502
+#: ../../../WebCore/platform/gtk/LocalizedStringsGtk.cpp:513
msgid "pattern mismatch"
msgstr "patroon komt niet overeen"
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:507
+#: ../../../WebCore/platform/gtk/LocalizedStringsGtk.cpp:518
msgid "too long"
msgstr "te lang"
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:512
+#: ../../../WebCore/platform/gtk/LocalizedStringsGtk.cpp:523
msgid "range underflow"
msgstr "onder bereik"
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:517
+#: ../../../WebCore/platform/gtk/LocalizedStringsGtk.cpp:528
msgid "range overflow"
msgstr "over bereik"
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:522
+#: ../../../WebCore/platform/gtk/LocalizedStringsGtk.cpp:533
msgid "step mismatch"
msgstr "stap komt niet overeen"
+
+#~ msgid "_Searchable Index"
+#~ msgstr "Door_zoekbare index"
diff --git a/WebKit/gtk/tests/testatk.c b/WebKit/gtk/tests/testatk.c
index 9ca7c05..c8df4ef 100644
--- a/WebKit/gtk/tests/testatk.c
+++ b/WebKit/gtk/tests/testatk.c
@@ -44,6 +44,8 @@ static const char* contentsInTable = "<html><body><table><tr><td>foo</td><td>bar
static const char* contentsInTableWithHeaders = "<html><body><table><tr><th>foo</th><th>bar</th><th colspan='2'>baz</th></tr><tr><th>qux</th><td>1</td><td>2</td><td>3</td></tr><tr><th rowspan='2'>quux</th><td>4</td><td>5</td><td>6</td></tr><tr><td>6</td><td>7</td><td>8</td></tr><tr><th>corge</th><td>9</td><td>10</td><td>11</td></tr></table><table><tr><td>1</td><td>2</td></tr><tr><td>3</td><td>4</td></tr></table></body></html>";
+static const char* formWithTextInputs = "<html><body><form><input type='text' name='entry' /></form></body></html>";
+
static const char* listsOfItems = "<html><body><ul><li>text only</li><li><a href='foo'>link only</a></li><li>text and a <a href='bar'>link</a></li></ul><ol><li>text only</li><li><a href='foo'>link only</a></li><li>text and a <a href='bar'>link</a></li></ol></body></html>";
static const char* textForSelections = "<html><body><p>A paragraph with plain text</p><p>A paragraph with <a href='http://webkit.org'>a link</a> in the middle</p></body></html>";
@@ -761,7 +763,7 @@ static void testWekitAtkTextSelections(void)
webkit_web_view_load_string(webView, textForSelections, NULL, NULL, NULL);
loop = g_main_loop_new(NULL, TRUE);
- g_timeout_add(100, (GSourceFunc)bail_out, loop);
+ g_idle_add((GSourceFunc)bail_out, loop);
g_main_loop_run(loop);
obj = gtk_widget_get_accessible(GTK_WIDGET(webView));
@@ -859,7 +861,7 @@ static void testWekitAtkTextSelections(void)
g_object_unref(webView);
}
-static void test_webkit_atk_get_extents(void)
+static void testWebkitAtkGetExtents(void)
{
WebKitWebView* webView;
AtkObject* obj;
@@ -872,7 +874,7 @@ static void test_webkit_atk_get_extents(void)
webkit_web_view_load_string(webView, centeredContents, NULL, NULL, NULL);
loop = g_main_loop_new(NULL, TRUE);
- g_timeout_add(100, (GSourceFunc)bail_out, loop);
+ g_idle_add((GSourceFunc)bail_out, loop);
g_main_loop_run(loop);
obj = gtk_widget_get_accessible(GTK_WIDGET(webView));
@@ -964,38 +966,32 @@ static void test_webkit_atk_get_extents(void)
static void testWebkitAtkListsOfItems(void)
{
- WebKitWebView* webView;
- AtkObject* obj;
- AtkObject* uList;
- AtkObject* oList;
- AtkObject* item1;
- AtkObject* item2;
- AtkObject* item3;
- GMainLoop* loop;
-
- webView = WEBKIT_WEB_VIEW(webkit_web_view_new());
+ WebKitWebView* webView = WEBKIT_WEB_VIEW(webkit_web_view_new());
g_object_ref_sink(webView);
GtkAllocation alloc = { 0, 0, 800, 600 };
gtk_widget_size_allocate(GTK_WIDGET(webView), &alloc);
webkit_web_view_load_string(webView, listsOfItems, NULL, NULL, NULL);
- loop = g_main_loop_new(NULL, TRUE);
+ GMainLoop* loop = g_main_loop_new(NULL, TRUE);
- g_timeout_add(100, (GSourceFunc)bail_out, loop);
+ g_idle_add((GSourceFunc)bail_out, loop);
g_main_loop_run(loop);
- obj = gtk_widget_get_accessible(GTK_WIDGET(webView));
+ AtkObject* obj = gtk_widget_get_accessible(GTK_WIDGET(webView));
g_assert(obj);
// Unordered list
- uList = atk_object_ref_accessible_child(obj, 0);
+ AtkObject* uList = atk_object_ref_accessible_child(obj, 0);
g_assert(ATK_OBJECT(uList));
g_assert(atk_object_get_role(uList) == ATK_ROLE_LIST);
g_assert_cmpint(atk_object_get_n_accessible_children(uList), ==, 3);
- item1 = atk_object_ref_accessible_child(uList, 0);
- item2 = atk_object_ref_accessible_child(uList, 1);
- item3 = atk_object_ref_accessible_child(uList, 2);
+ AtkObject* item1 = atk_object_ref_accessible_child(uList, 0);
+ g_assert(ATK_IS_TEXT(item1));
+ AtkObject* item2 = atk_object_ref_accessible_child(uList, 1);
+ g_assert(ATK_IS_TEXT(item2));
+ AtkObject* item3 = atk_object_ref_accessible_child(uList, 2);
+ g_assert(ATK_IS_TEXT(item3));
g_assert_cmpint(atk_object_get_n_accessible_children(item1), ==, 0);
g_assert_cmpint(atk_object_get_n_accessible_children(item2), ==, 1);
@@ -1011,18 +1007,21 @@ static void testWebkitAtkListsOfItems(void)
// Ordered list
- oList = atk_object_ref_accessible_child(obj, 1);
+ AtkObject* oList = atk_object_ref_accessible_child(obj, 1);
g_assert(ATK_OBJECT(oList));
g_assert(atk_object_get_role(oList) == ATK_ROLE_LIST);
g_assert_cmpint(atk_object_get_n_accessible_children(oList), ==, 3);
item1 = atk_object_ref_accessible_child(oList, 0);
+ g_assert(ATK_IS_TEXT(item1));
item2 = atk_object_ref_accessible_child(oList, 1);
+ g_assert(ATK_IS_TEXT(item2));
item3 = atk_object_ref_accessible_child(oList, 2);
+ g_assert(ATK_IS_TEXT(item3));
- g_assert_cmpstr(atk_text_get_text(ATK_TEXT(item1), 0, -1), ==, "1 text only");
- g_assert_cmpstr(atk_text_get_text(ATK_TEXT(item2), 0, -1), ==, "2 link only");
- g_assert_cmpstr(atk_text_get_text(ATK_TEXT(item3), 0, -1), ==, "3 text and a link");
+ g_assert_cmpstr(atk_text_get_text(ATK_TEXT(item1), 0, -1), ==, "1. text only");
+ g_assert_cmpstr(atk_text_get_text(ATK_TEXT(item2), 0, -1), ==, "2. link only");
+ g_assert_cmpstr(atk_text_get_text(ATK_TEXT(item3), 0, -1), ==, "3. text and a link");
g_assert_cmpint(atk_object_get_n_accessible_children(item1), ==, 0);
g_assert_cmpint(atk_object_get_n_accessible_children(item2), ==, 1);
@@ -1037,6 +1036,68 @@ static void testWebkitAtkListsOfItems(void)
g_object_unref(webView);
}
+static gboolean textInserted = FALSE;
+static gboolean textDeleted = FALSE;
+
+static void textChangedCb(AtkText* text, gint pos, gint len, const gchar* detail)
+{
+ g_assert(text && ATK_IS_OBJECT(text));
+
+ if (!g_strcmp0(detail, "insert"))
+ textInserted = TRUE;
+ else if (!g_strcmp0(detail, "delete"))
+ textDeleted = TRUE;
+}
+
+static gboolean checkTextChanges(gpointer unused)
+{
+ g_assert_cmpint(textInserted, ==, TRUE);
+ g_assert_cmpint(textDeleted, ==, TRUE);
+ return FALSE;
+}
+
+static void testWebkitAtkTextChangedNotifications(void)
+{
+ WebKitWebView* webView = WEBKIT_WEB_VIEW(webkit_web_view_new());
+ g_object_ref_sink(webView);
+ GtkAllocation alloc = { 0, 0, 800, 600 };
+ gtk_widget_size_allocate(GTK_WIDGET(webView), &alloc);
+ webkit_web_view_load_string(webView, formWithTextInputs, 0, 0, 0);
+
+ // Manually spin the main context to get the accessible objects
+ while (g_main_context_pending(0))
+ g_main_context_iteration(0, TRUE);
+
+ AtkObject* obj = gtk_widget_get_accessible(GTK_WIDGET(webView));
+ g_assert(obj);
+
+ AtkObject* form = atk_object_ref_accessible_child(obj, 0);
+ g_assert(ATK_IS_OBJECT(form));
+
+ AtkObject* textEntry = atk_object_ref_accessible_child(form, 0);
+ g_assert(ATK_IS_EDITABLE_TEXT(textEntry));
+ g_assert(atk_object_get_role(ATK_OBJECT(textEntry)) == ATK_ROLE_ENTRY);
+
+ g_signal_connect(textEntry, "text-changed::insert",
+ G_CALLBACK(textChangedCb),
+ (gpointer)"insert");
+ g_signal_connect(textEntry, "text-changed::delete",
+ G_CALLBACK(textChangedCb),
+ (gpointer)"delete");
+
+ gint pos = 0;
+ atk_editable_text_insert_text(ATK_EDITABLE_TEXT(textEntry), "foo bar baz", 11, &pos);
+ atk_editable_text_delete_text(ATK_EDITABLE_TEXT(textEntry), 4, 7);
+ textInserted = FALSE;
+ textDeleted = FALSE;
+
+ g_idle_add((GSourceFunc)checkTextChanges, 0);
+
+ g_object_unref(form);
+ g_object_unref(textEntry);
+ g_object_unref(webView);
+}
+
int main(int argc, char** argv)
{
g_thread_init(NULL);
@@ -1054,8 +1115,9 @@ int main(int argc, char** argv)
g_test_add_func("/webkit/atk/getHeadersInTable", testWebkitAtkGetHeadersInTable);
g_test_add_func("/webkit/atk/textAttributes", testWebkitAtkTextAttributes);
g_test_add_func("/webkit/atk/textSelections", testWekitAtkTextSelections);
- g_test_add_func("/webkit/atk/get_extents", test_webkit_atk_get_extents);
+ g_test_add_func("/webkit/atk/getExtents", testWebkitAtkGetExtents);
g_test_add_func("/webkit/atk/listsOfItems", testWebkitAtkListsOfItems);
+ g_test_add_func("/webkit/atk/textChangedNotifications", testWebkitAtkTextChangedNotifications);
return g_test_run ();
}
diff --git a/WebKit/gtk/tests/testmimehandling.c b/WebKit/gtk/tests/testmimehandling.c
index 3a0eded..2d6c623 100644
--- a/WebKit/gtk/tests/testmimehandling.c
+++ b/WebKit/gtk/tests/testmimehandling.c
@@ -134,8 +134,9 @@ static gboolean mime_type_policy_decision_requested_cb(WebKitWebView* view, WebK
return FALSE;
}
-static void test_mime_type(const char* name)
+static void testRemoteMimeType(const void* data)
{
+ const char* name = (const char*) data;
WebKitWebView* view = WEBKIT_WEB_VIEW(webkit_web_view_new());
g_object_ref_sink(G_OBJECT(view));
@@ -155,24 +156,31 @@ static void test_mime_type(const char* name)
g_object_unref(view);
}
-static void test_mime_pdf()
+static void testLocalMimeType(const void* data)
{
- test_mime_type("pdf");
-}
+ const char* typeName = (const char*) data;
+ WebKitWebView* view = WEBKIT_WEB_VIEW(webkit_web_view_new());
+ g_object_ref_sink(G_OBJECT(view));
-static void test_mime_html()
-{
- test_mime_type("html");
-}
+ loop = g_main_loop_new(NULL, TRUE);
-static void test_mime_text()
-{
- test_mime_type("text");
-}
+ g_object_connect(G_OBJECT(view),
+ "signal::notify::load-status", idle_quit_loop_cb, NULL,
+ "signal::mime-type-policy-decision-requested", mime_type_policy_decision_requested_cb, g_strdup(typeName),
+ NULL);
-static void test_mime_ogg()
-{
- test_mime_type("ogg");
+ gchar* filename = g_strdup_printf("test.%s", typeName);
+ GFile* file = g_file_new_for_path(filename);
+ g_free(filename);
+
+ gchar* fileURI = g_file_get_uri(file);
+ g_object_unref(file);
+
+ webkit_web_view_load_uri(view, fileURI);
+ g_free(fileURI);
+
+ g_main_loop_run(loop);
+ g_object_unref(view);
}
int main(int argc, char** argv)
@@ -198,10 +206,14 @@ int main(int argc, char** argv)
soup_uri_free(soup_uri);
g_test_bug_base("https://bugs.webkit.org/");
- g_test_add_func("/webkit/mime/PDF", test_mime_pdf);
- g_test_add_func("/webkit/mime/HTML", test_mime_html);
- g_test_add_func("/webkit/mime/TEXT", test_mime_text);
- g_test_add_func("/webkit/mime/OGG", test_mime_ogg);
+ g_test_add_data_func("/webkit/mime/remote-PDF", "pdf", testRemoteMimeType);
+ g_test_add_data_func("/webkit/mime/remote-HTML", "html", testRemoteMimeType);
+ g_test_add_data_func("/webkit/mime/remote-TEXT", "text", testRemoteMimeType);
+ g_test_add_data_func("/webkit/mime/remote-OGG", "ogg", testRemoteMimeType);
+ g_test_add_data_func("/webkit/mime/local-PDF", "pdf", testLocalMimeType);
+ g_test_add_data_func("/webkit/mime/local-HTML", "html", testLocalMimeType);
+ g_test_add_data_func("/webkit/mime/local-TEXT", "text", testLocalMimeType);
+ g_test_add_data_func("/webkit/mime/local-OGG", "ogg", testLocalMimeType);
return g_test_run();
}
diff --git a/WebKit/gtk/webkit/webkitdownload.cpp b/WebKit/gtk/webkit/webkitdownload.cpp
index 1e45250..1472cb5 100644
--- a/WebKit/gtk/webkit/webkitdownload.cpp
+++ b/WebKit/gtk/webkit/webkitdownload.cpp
@@ -559,7 +559,7 @@ const gchar* webkit_download_get_uri(WebKitDownload* download)
* Retrieves the #WebKitNetworkRequest object that backs the download
* process.
*
- * Returns: the #WebKitNetworkRequest instance
+ * Returns: (transfer none): the #WebKitNetworkRequest instance
*
* Since: 1.1.2
*/
@@ -578,7 +578,7 @@ WebKitNetworkRequest* webkit_download_get_network_request(WebKitDownload* downlo
* Retrieves the #WebKitNetworkResponse object that backs the download
* process.
*
- * Returns: the #WebKitNetworkResponse instance
+ * Returns: (transfer none): the #WebKitNetworkResponse instance
*
* Since: 1.1.16
*/
diff --git a/WebKit/gtk/webkit/webkitnetworkrequest.cpp b/WebKit/gtk/webkit/webkitnetworkrequest.cpp
index 8b50948..6180efa 100644
--- a/WebKit/gtk/webkit/webkitnetworkrequest.cpp
+++ b/WebKit/gtk/webkit/webkitnetworkrequest.cpp
@@ -241,7 +241,7 @@ G_CONST_RETURN gchar* webkit_network_request_get_uri(WebKitNetworkRequest* reque
}
/**
- * webkit_network_request_get_soup_message:
+ * webkit_network_request_get_message:
* @request: a #WebKitNetworkRequest
*
* Obtains the #SoupMessage held and used by the given request. Notice
@@ -249,7 +249,7 @@ G_CONST_RETURN gchar* webkit_network_request_get_uri(WebKitNetworkRequest* reque
* handlers is only supported (as in, will only affect what is
* actually sent to the server) where explicitly documented.
*
- * Returns: the #SoupMessage
+ * Returns: (transfer none): the #SoupMessage
* Since: 1.1.9
*/
SoupMessage* webkit_network_request_get_message(WebKitNetworkRequest* request)
diff --git a/WebKit/gtk/webkit/webkitnetworkresponse.cpp b/WebKit/gtk/webkit/webkitnetworkresponse.cpp
index d4dd562..0aca6d8 100644
--- a/WebKit/gtk/webkit/webkitnetworkresponse.cpp
+++ b/WebKit/gtk/webkit/webkitnetworkresponse.cpp
@@ -241,14 +241,14 @@ G_CONST_RETURN gchar* webkit_network_response_get_uri(WebKitNetworkResponse* res
}
/**
- * webkit_network_response_get_soup_message:
+ * webkit_network_response_get_message:
* @response: a #WebKitNetworkResponse
*
* Obtains the #SoupMessage that represents the given response. Notice
* that only the response side of the HTTP conversation is
* represented.
*
- * Returns: the #SoupMessage
+ * Returns: (transfer none): the #SoupMessage
* Since: 1.1.14
*/
SoupMessage* webkit_network_response_get_message(WebKitNetworkResponse* response)
diff --git a/WebKit/gtk/webkit/webkitsecurityorigin.cpp b/WebKit/gtk/webkit/webkitsecurityorigin.cpp
index de074ae..67ad0cf 100644
--- a/WebKit/gtk/webkit/webkitsecurityorigin.cpp
+++ b/WebKit/gtk/webkit/webkitsecurityorigin.cpp
@@ -353,7 +353,8 @@ void webkit_security_origin_set_web_database_quota(WebKitSecurityOrigin* securit
*
* Returns a list of all Web Databases in the security origin.
*
- * Returns: a #GList of databases in the security origin.
+ * Returns: (transfer container) (element-type WebKitWebDatabase): a
+ * #GList of databases in the security origin.
*
* Since: 1.1.14
**/
diff --git a/WebKit/gtk/webkit/webkitwebdatabase.cpp b/WebKit/gtk/webkit/webkitwebdatabase.cpp
index d4f6198..cd85e73 100644
--- a/WebKit/gtk/webkit/webkitwebdatabase.cpp
+++ b/WebKit/gtk/webkit/webkitwebdatabase.cpp
@@ -284,7 +284,7 @@ static void webkit_web_database_set_name(WebKitWebDatabase* webDatabase, const g
*
* Returns the security origin of the #WebKitWebDatabase.
*
- * Returns: the security origin of the database
+ * Returns: (transfer none): the security origin of the database
*
* Since: 1.1.14
**/
diff --git a/WebKit/gtk/webkit/webkitwebdatasource.cpp b/WebKit/gtk/webkit/webkitwebdatasource.cpp
index 9b755ad..38c9c48 100644
--- a/WebKit/gtk/webkit/webkitwebdatasource.cpp
+++ b/WebKit/gtk/webkit/webkitwebdatasource.cpp
@@ -194,14 +194,15 @@ WebKitWebDataSource* webkit_web_data_source_new_with_request(WebKitNetworkReques
}
/**
- * webkit_web_data_source_get_web_frame
+ * webkit_web_data_source_get_web_frame:
* @data_source: a #WebKitWebDataSource
*
* Returns the #WebKitWebFrame that represents this data source
*
- * Return value: the #WebKitWebFrame that represents the @data_source. The
- * #WebKitWebFrame is owned by WebKit and should not be freed or destroyed.
- * This will return %NULL of the @data_source is not attached to a frame.
+ * Return value: (transfer none): the #WebKitWebFrame that represents
+ * the @data_source. The #WebKitWebFrame is owned by WebKit and should
+ * not be freed or destroyed. This will return %NULL if the
+ * @data_source is not attached to a frame.
*
* Since: 1.1.14
*/
@@ -227,7 +228,7 @@ WebKitWebFrame* webkit_web_data_source_get_web_frame(WebKitWebDataSource* webDat
* prior to the "committed" load state. See webkit_web_data_source_get_request
* for getting the "committed" request.
*
- * Return value: the original #WebKitNetworkRequest
+ * Return value: (transfer none): the original #WebKitNetworkRequest
*
* Since: 1.1.14
*/
@@ -254,9 +255,9 @@ WebKitNetworkRequest* webkit_web_data_source_get_initial_request(WebKitWebDataSo
* the request that was "committed", and hence, different from the request you
* get from the webkit_web_data_source_get_initial_request method.
*
- * Return value: the #WebKitNetworkRequest that created the @data_source or
- * %NULL if the @data_source is not attached to the frame or the frame hasn't
- * been loaded.
+ * Return value: (transfer none): the #WebKitNetworkRequest that
+ * created the @data_source or %NULL if the @data_source is not
+ * attached to the frame or the frame hasn't been loaded.
*
* Since: 1.1.14
*/
@@ -333,8 +334,9 @@ gboolean webkit_web_data_source_is_loading(WebKitWebDataSource* webDataSource)
* frame hasn't loaded any data. Use webkit_web_data_source_is_loading to test
* if data source is in the process of loading.
*
- * Return value: a #GString which contains the raw data that represents the @data_source or %NULL if the
- * @data_source hasn't loaded any data.
+ * Return value: (transfer none): a #GString which contains the raw
+ * data that represents the @data_source or %NULL if the @data_source
+ * hasn't loaded any data.
*
* Since: 1.1.14
*/
@@ -364,8 +366,8 @@ GString* webkit_web_data_source_get_data(WebKitWebDataSource* webDataSource)
*
* Returns the main resource of the @data_source
*
- * Return value: a new #WebKitWebResource representing the main resource of
- * the @data_source.
+ * Return value: (transfer none): a new #WebKitWebResource
+ * representing the main resource of the @data_source.
*
* Since: 1.1.14
*/
@@ -414,14 +416,15 @@ G_CONST_RETURN gchar* webkit_web_data_source_get_unreachable_uri(WebKitWebDataSo
}
/**
- * webkit_web_data_source_get_subresources
+ * webkit_web_data_source_get_subresources:
* @data_source: a #WebKitWebDataSource
*
* Gives you a #GList of #WebKitWebResource objects that compose the
* #WebKitWebView to which this #WebKitWebDataSource is attached.
*
- * Return value: a #GList of #WebKitWebResource objects; the objects are
- * owned by WebKit, but the GList must be freed.
+ * Return value: (element-type WebKitWebResource) (transfer container):
+ * a #GList of #WebKitWebResource objects; the objects are owned by
+ * WebKit, but the GList must be freed.
*
* Since: 1.1.15
*/
diff --git a/WebKit/gtk/webkit/webkitwebframe.cpp b/WebKit/gtk/webkit/webkitwebframe.cpp
index 88f0bb7..c581ce6 100644
--- a/WebKit/gtk/webkit/webkitwebframe.cpp
+++ b/WebKit/gtk/webkit/webkitwebframe.cpp
@@ -449,7 +449,7 @@ G_CONST_RETURN gchar* webkit_web_frame_get_uri(WebKitWebFrame* frame)
* The #WebKitWebView returned manages the entire hierarchy of #WebKitWebFrame
* objects that contains @frame.
*
- * Return value: the #WebKitWebView that manages @frame
+ * Return value: (transfer none): the #WebKitWebView that manages @frame
*/
WebKitWebView* webkit_web_frame_get_web_view(WebKitWebFrame* frame)
{
@@ -491,7 +491,7 @@ G_CONST_RETURN gchar* webkit_web_frame_get_name(WebKitWebFrame* frame)
*
* Returns the @frame's parent frame, or %NULL if it has none.
*
- * Return value: the parent #WebKitWebFrame or %NULL in case there is none
+ * Return value: (transfer none): the parent #WebKitWebFrame or %NULL in case there is none
*/
WebKitWebFrame* webkit_web_frame_get_parent(WebKitWebFrame* frame)
{
@@ -662,7 +662,7 @@ void webkit_web_frame_reload(WebKitWebFrame* frame)
* hierarchy, this function will search for a matching frame in other main
* frame hierarchies. Returns %NULL if no match is found.
*
- * Return value: the found #WebKitWebFrame or %NULL in case none is found
+ * Return value: (transfer none): the found #WebKitWebFrame or %NULL in case none is found
*/
WebKitWebFrame* webkit_web_frame_find_frame(WebKitWebFrame* frame, const gchar* name)
{
@@ -684,7 +684,7 @@ WebKitWebFrame* webkit_web_frame_find_frame(WebKitWebFrame* frame, const gchar*
* Gets the global JavaScript execution context. Use this function to bridge
* between the WebKit and JavaScriptCore APIs.
*
- * Return value: the global JavaScript context
+ * Return value: (transfer none): the global JavaScript context
*/
JSGlobalContextRef webkit_web_frame_get_global_context(WebKitWebFrame* frame)
{
@@ -703,7 +703,7 @@ JSGlobalContextRef webkit_web_frame_get_global_context(WebKitWebFrame* frame)
*
* Returns the committed data source.
*
- * Return value: the committed #WebKitWebDataSource.
+ * Return value: (transfer none): the committed #WebKitWebDataSource.
*
* Since: 1.1.14
*/
@@ -724,7 +724,7 @@ WebKitWebDataSource* webkit_web_frame_get_data_source(WebKitWebFrame* frame)
* transition to a committed data source once any data has been received. Use
* webkit_web_frame_get_data_source to get the committed data source.
*
- * Return value: the provisional #WebKitWebDataSource or %NULL if a load
+ * Return value: (transfer none): the provisional #WebKitWebDataSource or %NULL if a load
* request is not in progress.
*
* Since: 1.1.14
@@ -1199,7 +1199,7 @@ GtkPolicyType webkit_web_frame_get_vertical_scrollbar_policy(WebKitWebFrame* fra
*
* Returns the @frame's security origin.
*
- * Return value: the security origin of @frame
+ * Return value: (transfer none): the security origin of @frame
*
* Since: 1.1.14
*/
@@ -1241,7 +1241,7 @@ void webkit_web_frame_layout(WebKitWebFrame* frame)
* frame was not created by a load. You must unref the object when you
* are done with it.
*
- * Return value: a #WebKitNetworkResponse object
+ * Return value: (transfer full): a #WebKitNetworkResponse object
*
* Since: 1.1.18
*/
diff --git a/WebKit/gtk/webkit/webkitwebhistoryitem.cpp b/WebKit/gtk/webkit/webkitwebhistoryitem.cpp
index 8a9153c..ce30704 100644
--- a/WebKit/gtk/webkit/webkitwebhistoryitem.cpp
+++ b/WebKit/gtk/webkit/webkitwebhistoryitem.cpp
@@ -433,14 +433,14 @@ gdouble webkit_web_history_item_get_last_visited_time(WebKitWebHistoryItem* webH
}
/**
- * webkit_web_history_item_copy :
+ * webkit_web_history_item_copy:
* @web_history_item: a #WebKitWebHistoryItem
*
* Makes a copy of the item for use with other WebView objects.
*
* Since: 1.1.18
*
- * Return value: the new #WebKitWebHistoryItem.
+ * Return value: (transfer full): the new #WebKitWebHistoryItem.
*/
WebKitWebHistoryItem* webkit_web_history_item_copy(WebKitWebHistoryItem* self)
{
diff --git a/WebKit/gtk/webkit/webkitwebinspector.cpp b/WebKit/gtk/webkit/webkitwebinspector.cpp
index 2dc9315..ee3c8cd 100644
--- a/WebKit/gtk/webkit/webkitwebinspector.cpp
+++ b/WebKit/gtk/webkit/webkitwebinspector.cpp
@@ -426,8 +426,8 @@ void webkit_web_inspector_set_web_view(WebKitWebInspector *web_inspector, WebKit
* that this method may return %NULL if the user hasn't inspected
* anything.
*
- * Returns: the #WebKitWebView instance that is used to render the
- * inspector or %NULL if it is not yet created.
+ * Returns: (transfer none): the #WebKitWebView instance that is used
+ * to render the inspector or %NULL if it is not yet created.
*
* Since: 1.0.3
**/
diff --git a/WebKit/gtk/webkit/webkitwebresource.cpp b/WebKit/gtk/webkit/webkitwebresource.cpp
index ba9c3af..fb0acfc 100644
--- a/WebKit/gtk/webkit/webkitwebresource.cpp
+++ b/WebKit/gtk/webkit/webkitwebresource.cpp
@@ -285,8 +285,9 @@ WebKitWebResource* webkit_web_resource_new(const gchar* data,
*
* Returns the data of the @webResource.
*
- * Return value: a #GString containing the character data of the @webResource.
- * The string is owned by WebKit and should not be freed or destroyed.
+ * Return value: (transfer none): a #GString containing the character
+ * data of the @webResource. The string is owned by WebKit and should
+ * not be freed or destroyed.
*
* Since: 1.1.14
*/
diff --git a/WebKit/gtk/webkit/webkitwebsettings.cpp b/WebKit/gtk/webkit/webkitwebsettings.cpp
index 767fce1..8a207d9 100644
--- a/WebKit/gtk/webkit/webkitwebsettings.cpp
+++ b/WebKit/gtk/webkit/webkitwebsettings.cpp
@@ -108,6 +108,7 @@ struct _WebKitWebSettingsPrivate {
gboolean enable_page_cache;
gboolean auto_resize_window;
gboolean enable_java_applet;
+ gboolean enable_hyperlink_auditing;
};
#define WEBKIT_WEB_SETTINGS_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), WEBKIT_TYPE_WEB_SETTINGS, WebKitWebSettingsPrivate))
@@ -157,7 +158,8 @@ enum {
PROP_ENABLE_SITE_SPECIFIC_QUIRKS,
PROP_ENABLE_PAGE_CACHE,
PROP_AUTO_RESIZE_WINDOW,
- PROP_ENABLE_JAVA_APPLET
+ PROP_ENABLE_JAVA_APPLET,
+ PROP_ENABLE_HYPERLINK_AUDITING
};
// Create a default user agent string
@@ -863,6 +865,21 @@ static void webkit_web_settings_class_init(WebKitWebSettingsClass* klass)
TRUE,
flags));
+ /**
+ * WebKitWebSettings:enable-hyperlink-auditing:
+ *
+ * Enable or disable support for <a ping>.
+ *
+ * Since: 1.2.5
+ */
+ g_object_class_install_property(gobject_class,
+ PROP_ENABLE_HYPERLINK_AUDITING,
+ g_param_spec_boolean("enable-hyperlink-auditing",
+ _("Enable Hyperlink Auditing"),
+ _("Whether <a ping> should be able to send pings"),
+ FALSE,
+ flags));
+
g_type_class_add_private(klass, sizeof(WebKitWebSettingsPrivate));
}
@@ -1083,6 +1100,9 @@ static void webkit_web_settings_set_property(GObject* object, guint prop_id, con
case PROP_ENABLE_JAVA_APPLET:
priv->enable_java_applet = g_value_get_boolean(value);
break;
+ case PROP_ENABLE_HYPERLINK_AUDITING:
+ priv->enable_hyperlink_auditing = g_value_get_boolean(value);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
break;
@@ -1224,6 +1244,9 @@ static void webkit_web_settings_get_property(GObject* object, guint prop_id, GVa
case PROP_ENABLE_JAVA_APPLET:
g_value_set_boolean(value, priv->enable_java_applet);
break;
+ case PROP_ENABLE_HYPERLINK_AUDITING:
+ g_value_set_boolean(value, priv->enable_hyperlink_auditing);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
break;
@@ -1248,7 +1271,7 @@ WebKitWebSettings* webkit_web_settings_new()
*
* Copies an existing #WebKitWebSettings instance.
*
- * Returns: a new #WebKitWebSettings instance
+ * Returns: (transfer full): a new #WebKitWebSettings instance
**/
WebKitWebSettings* webkit_web_settings_copy(WebKitWebSettings* web_settings)
{
@@ -1297,6 +1320,7 @@ WebKitWebSettings* webkit_web_settings_copy(WebKitWebSettings* web_settings)
"enable-page-cache", priv->enable_page_cache,
"auto-resize-window", priv->auto_resize_window,
"enable-java-applet", priv->enable_java_applet,
+ "enable-hyperlink-auditing", priv->enable_hyperlink_auditing,
NULL));
return copy;
diff --git a/WebKit/gtk/webkit/webkitwebview.cpp b/WebKit/gtk/webkit/webkitwebview.cpp
index 3212450..762888a 100644
--- a/WebKit/gtk/webkit/webkitwebview.cpp
+++ b/WebKit/gtk/webkit/webkitwebview.cpp
@@ -1503,7 +1503,7 @@ static void webkit_web_view_class_init(WebKitWebViewClass* webViewClass)
* the new #WebKitWebView. The widget to which the widget is added will
* handle that.
*
- * Return value: a newly allocated #WebKitWebView, or %NULL
+ * Return value: (transfer full): a newly allocated #WebKitWebView, or %NULL
*
* Since: 1.0.3
*/
@@ -2264,7 +2264,7 @@ static void webkit_web_view_class_init(WebKitWebViewClass* webViewClass)
* to set the property value of "webkit-widget-is-selected". This can
* be used to draw a visual indicator of the selection.
*
- * Return value: a new #GtkWidget, or %NULL
+ * Return value: (transfer full): a new #GtkWidget, or %NULL
*
* Since: 1.1.8
*/
@@ -2853,7 +2853,7 @@ static void webkit_web_view_update_settings(WebKitWebView* webView)
javaScriptCanAccessClipboard, enableOfflineWebAppCache,
enableUniversalAccessFromFileURI, enableFileAccessFromFileURI,
enableDOMPaste, tabKeyCyclesThroughElements,
- enableSiteSpecificQuirks, usePageCache, enableJavaApplet;
+ enableSiteSpecificQuirks, usePageCache, enableJavaApplet, enableHyperlinkAuditing;
WebKitEditingBehavior editingBehavior;
@@ -2890,6 +2890,7 @@ static void webkit_web_view_update_settings(WebKitWebView* webView)
"enable-site-specific-quirks", &enableSiteSpecificQuirks,
"enable-page-cache", &usePageCache,
"enable-java-applet", &enableJavaApplet,
+ "enable-hyperlink-auditing", &enableHyperlinkAuditing,
NULL);
settings->setDefaultTextEncodingName(defaultEncoding);
@@ -2925,6 +2926,7 @@ static void webkit_web_view_update_settings(WebKitWebView* webView)
settings->setNeedsSiteSpecificQuirks(enableSiteSpecificQuirks);
settings->setUsesPageCache(usePageCache);
settings->setJavaEnabled(enableJavaApplet);
+ settings->setHyperlinkAuditingEnabled(enableHyperlinkAuditing);
Page* page = core(webView);
if (page)
@@ -3036,6 +3038,8 @@ static void webkit_web_view_settings_notify(WebKitWebSettings* webSettings, GPar
settings->setUsesPageCache(g_value_get_boolean(&value));
else if (name == g_intern_string("enable-java-applet"))
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 (!g_object_class_find_property(G_OBJECT_GET_CLASS(webSettings), name))
g_warning("Unexpected setting '%s'", name);
g_value_unset(&value);
@@ -3217,7 +3221,7 @@ static void webkit_web_view_set_window_features(WebKitWebView* webView, WebKitWe
}
/**
- * webkit_web_view_get_window_features
+ * webkit_web_view_get_window_features:
* @web_view: a #WebKitWebView
*
* Returns the instance of #WebKitWebWindowFeatures held by the given
@@ -3642,12 +3646,19 @@ void webkit_web_view_unmark_text_matches(WebKitWebView* webView)
return core(webView)->unmarkAllTextMatches();
}
+/**
+ * webkit_web_view_get_main_frame:
+ * @webView: a #WebKitWebView
+ *
+ * Returns the main frame for the @webView.
+ *
+ * Return value: (transfer none): the main #WebKitWebFrame for @webView
+ */
WebKitWebFrame* webkit_web_view_get_main_frame(WebKitWebView* webView)
{
g_return_val_if_fail(WEBKIT_IS_WEB_VIEW(webView), NULL);
- WebKitWebViewPrivate* priv = webView->priv;
- return priv->mainFrame;
+ return webView->priv->mainFrame;
}
/**
@@ -3656,7 +3667,7 @@ WebKitWebFrame* webkit_web_view_get_main_frame(WebKitWebView* webView)
*
* Returns the frame that has focus or an active text selection.
*
- * Return value: The focused #WebKitWebFrame or %NULL if no frame is focused
+ * Return value: (transfer none): The focused #WebKitWebFrame or %NULL if no frame is focused
*/
WebKitWebFrame* webkit_web_view_get_focused_frame(WebKitWebView* webView)
{
@@ -4532,7 +4543,7 @@ void webkit_web_view_set_tooltip_text(WebKitWebView* webView, const char* toolti
* Does a 'hit test' in the coordinates specified by @event to figure
* out context information about that position in the @webView.
*
- * Returns: a newly created #WebKitHitTestResult with the context of the
+ * Returns: (transfer none): a newly created #WebKitHitTestResult with the context of the
* specified position.
*
* Since: 1.1.15
@@ -4574,7 +4585,7 @@ G_CONST_RETURN gchar* webkit_web_view_get_icon_uri(WebKitWebView* webView)
* webkit_web_view_get_dom_document:
* @webView: a #WebKitWebView
*
- * Returns: the #WebKitDOMDocument currently loaded in the @webView
+ * Returns: (transfer none): the #WebKitDOMDocument currently loaded in the @webView
*
* Since: 1.3.1
**/
diff --git a/WebKit/haiku/ChangeLog b/WebKit/haiku/ChangeLog
index 718c4c3..d55ce71 100644
--- a/WebKit/haiku/ChangeLog
+++ b/WebKit/haiku/ChangeLog
@@ -1,3 +1,14 @@
+2010-09-28 Jenn Braithwaite <jennb@chromium.org>
+
+ Reviewed by Dmitry Titov.
+
+ Added oldPage param to FrameLoaderClient::didTransferChildFrameToNewDocument.
+ https://bugs.webkit.org/show_bug.cgi?id=46663
+
+ * WebCoreSupport/FrameLoaderClientHaiku.cpp:
+ (WebCore::FrameLoaderClientHaiku::didTransferChildFrameToNewDocument):
+ * WebCoreSupport/FrameLoaderClientHaiku.h:
+
2010-09-13 Enrica Casucci <enrica@apple.com>
Reviewed by Sam Weinig.
diff --git a/WebKit/haiku/WebCoreSupport/FrameLoaderClientHaiku.cpp b/WebKit/haiku/WebCoreSupport/FrameLoaderClientHaiku.cpp
index 705a333..cae0ed1 100644
--- a/WebKit/haiku/WebCoreSupport/FrameLoaderClientHaiku.cpp
+++ b/WebKit/haiku/WebCoreSupport/FrameLoaderClientHaiku.cpp
@@ -741,7 +741,7 @@ PassRefPtr<Frame> FrameLoaderClientHaiku::createFrame(const KURL& url, const Str
return 0;
}
-void FrameLoaderClientHaiku::didTransferChildFrameToNewDocument()
+void FrameLoaderClientHaiku::didTransferChildFrameToNewDocument(Page*)
{
}
@@ -854,4 +854,3 @@ void FrameLoaderClientHaiku::transitionToCommittedForNewPage()
}
} // namespace WebCore
-
diff --git a/WebKit/haiku/WebCoreSupport/FrameLoaderClientHaiku.h b/WebKit/haiku/WebCoreSupport/FrameLoaderClientHaiku.h
index eafbfc3..1701cb0 100644
--- a/WebKit/haiku/WebCoreSupport/FrameLoaderClientHaiku.h
+++ b/WebKit/haiku/WebCoreSupport/FrameLoaderClientHaiku.h
@@ -221,7 +221,7 @@ namespace WebCore {
virtual PassRefPtr<Frame> createFrame(const KURL& url, const String& name,
HTMLFrameOwnerElement*, const String& referrer,
bool allowsScrolling, int marginWidth, int marginHeight);
- virtual void didTransferChildFrameToNewDocument();
+ virtual void didTransferChildFrameToNewDocument(WebCore::Page*);
virtual PassRefPtr<Widget> createPlugin(const IntSize&, HTMLPlugInElement*, const KURL&,
const Vector<String>&, const Vector<String>&, const String&,
bool loadManually);
@@ -252,4 +252,3 @@ namespace WebCore {
} // namespace WebCore
#endif // FrameLoaderClientHaiku_h
-
diff --git a/WebKit/mac/ChangeLog b/WebKit/mac/ChangeLog
index a43b4c5..d707720 100644
--- a/WebKit/mac/ChangeLog
+++ b/WebKit/mac/ChangeLog
@@ -1,3 +1,261 @@
+2010-09-28 Johnny Ding <jnd@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ https://bugs.webkit.org/show_bug.cgi?id=41292
+ Some windowed plugins did not handle events through EventHandler, so we
+ never set right gesture state for those events.
+ This change is to set right allowPopupsFromPlugin flag to current
+ execution frame, so WeKit can always get right gesture state on Mac.
+ From Mac Snow Leopard, the plugin is run under "WebKitPluginHost,app"
+ process, that process passes the allowPopupsFromPlugin flag to
+ WKPCEvaluate(in NetscapePluginHostProxy.mm), then flag is set in
+ NetscapePluginInstanceProxy::evaluate.
+
+ * Plugins/WebNetscapePluginView.mm:
+ (-[WebNetscapePluginView sendEvent:isDrawRect:]):
+
+2010-09-28 Jenn Braithwaite <jennb@chromium.org>
+
+ Reviewed by Dmitry Titov.
+
+ Added oldPage param to FrameLoaderClient::didTransferChildFrameToNewDocument.
+ https://bugs.webkit.org/show_bug.cgi?id=46663
+
+ * WebCoreSupport/WebFrameLoaderClient.h:
+ * WebCoreSupport/WebFrameLoaderClient.mm:
+ (WebFrameLoaderClient::didTransferChildFrameToNewDocument):
+
+2010-09-26 Antonio Gomes <agomes@rim.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ DRT/Mac nodesFromRect support
+
+ [Mac][DRT] Implement LayoutTestController::nodesFromRect
+ https://bugs.webkit.org/show_bug.cgi?id=46580
+
+ Implement nodesFromRect as a private method to access non-exposed Document
+ methods, similarly to computedStyleIncludingVisitedInfo.
+
+ * WebView/WebView.mm: Added JSDocument.h and JSNodeList.h to the include list.
+ These headers makes it possible to:
+ 1) Get a Document off of a JSDocument;
+ 2) Call toJS function, defined in JSNodeList.cpp|h so we can convert RefPtr<NodeList>
+ gotten from Document::nodesFromRect to JS bindings.
+ (-[WebView _nodesFromRect:forDocument:x:y:hPadding:vPadding:ignoreClipping:]):
+ * WebView/WebViewPrivate.h: Added nodesFromRect method to access methods of the
+ Document class not exposed to JavaScript. It works similarly to computedStyleIncludingVisitedInfo.
+
+2010-09-24 Jia Pu <jpu@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ automaticSpellingCorrectionEnabled isn't updated.
+ https://bugs.webkit.org/show_bug.cgi?id=46486
+ <rdar://problem/8475212>
+
+ * WebView/WebView.mm:
+ (+[WebView initialize]): Should update "automaticSpellingCorrectionEnabled"
+ instead of "automaticTextReplacementEnabled".
+
+2010-09-23 Alexey Proskuryakov <ap@apple.com>
+
+ Reviewed by Darin Adler.
+
+ https://bugs.webkit.org/show_bug.cgi?id=46380
+ REGRESSION: Crash when downloading a file
+
+ Downloading cannot be tested in DRT.
+
+ * Misc/WebNSFileManagerExtras.m: (-[NSFileManager _webkit_setMetadataURL:referrer:atPath:]):
+ Don't copy null strings.
+
+2010-09-24 Ilya Tikhonovsky <loislo@chromium.org>
+
+ Reviewed by Yury Semikhatsky.
+
+ Web Inspector: CRASH at node highlight on MAC Safari.
+ 1) run-safari --debug
+ 2) open inspector
+ 3) open elements panel
+ 4) hover mouse over elements panel items multiple times
+ 5) CRASH
+ Looks like it is a race condition. WebNodeHighlightView doesn't check
+ the pointer to WebNodeHighligh object and it can be nil.
+
+ https://bugs.webkit.org/show_bug.cgi?id=46261
+
+ * WebInspector/WebNodeHighlightView.mm:
+ (-[WebNodeHighlightView drawRect:]):
+
+2010-09-23 Andy Estes <aestes@apple.com>
+
+ Reviewed by Darin Adler.
+
+ REGRESSION (r61285): some Dashboard widgets are always invisible due to
+ HTML parser changes.
+ https://bugs.webkit.org/show_bug.cgi?id=46435
+
+ Enable pre-HTML5 parser quirks if Dashboard is in backward compatibility
+ mode.
+
+ * WebView/WebView.mm:
+ (-[WebView _needsPreHTML5ParserQuirks]): Renamed from
+ shouldUsePreHTML5ParserQuirks(). Return true if
+ WebCore::Settings::usesDashboardCompatibilityMode() is true.
+ (-[WebView _preferencesChangedNotification:]):
+ (-[WebView _setDashboardBehavior:to:]): Enable pre-HTML5 parser quirks
+ if Dashboard behavior is set to backward compatibility mode.
+
+2010-09-23 Matthew Delaney <mdelaney@apple.com>
+
+ Reviewed by Simon Fraser.
+
+ Reduce minimum DOMTimer interval
+ https://bugs.webkit.org/show_bug.cgi?id=45362
+
+ * WebView/WebView.mm:
+ Updating set interval call to use Settings' static version inside
+ one time init block.
+
+2010-09-22 Andy Estes <aestes@apple.com>
+
+ Reviewed by Darin Adler.
+
+ REGRESSION (r61285): Microsoft Entourage 2008 does not invoke My Day window
+ https://bugs.webkit.org/show_bug.cgi?id=46334
+
+ Microsoft My Day loads scripts using self-closing script tags, markup
+ which is incompatible with the HTML5 parser. Enable parser quirks for
+ this application.
+
+ * WebView/WebView.mm:
+ (shouldUsePreHTML5ParserQuirks): Return true if the application is
+ Microsoft My Day and was linked against a version of WebKit prior to the
+ introduction of the HTML5 parser.
+
+2010-09-23 Nate Chapin <japhet@chromium.org>
+
+ Reviewed by Darin Fisher.
+
+ Add hyperlink auditing settings (i.e., <a ping>).
+ https://bugs.webkit.org/show_bug.cgi?id=30458
+
+ * WebView/WebPreferenceKeysPrivate.h:
+ * WebView/WebPreferences.mm:
+ (+[WebPreferences initialize]):
+ (-[WebPreferences setMemoryInfoEnabled:]):
+ (-[WebPreferences hyperlinkAuditingEnabled]):
+ (-[WebPreferences setHyperlinkAuditingEnabled:]):
+ * WebView/WebPreferencesPrivate.h:
+ * WebView/WebView.mm:
+ (-[WebView _preferencesChangedNotification:]):
+
+2010-09-22 Alexey Proskuryakov <ap@apple.com>
+
+ Reviewed by Anders Carlsson.
+
+ https://bugs.webkit.org/show_bug.cgi?id=43667
+ ASSERT failure in NetscapePluginInstanceProxy::disconnectStream
+
+ Test: plugins/get-javascript-url.html
+
+ * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
+ (WebKit::NetscapePluginInstanceProxy::evaluateJavaScript): Add the stream to m_streams, just
+ like any other one.
+
+2010-09-21 Darin Adler <darin@apple.com>
+
+ Reviewed by Anders Carlsson.
+
+ Fix some Objective-C GC problems and use RetainPtr instead of HardRetain/Release
+ https://bugs.webkit.org/show_bug.cgi?id=46220
+
+ * Misc/WebNSFileManagerExtras.m:
+ (setMetaData): Use CFRelease instead of HardRelease.
+ (-[NSFileManager _webkit_setMetadataURL:referrer:atPath:]): Use CFStringCreateCopy
+ instead of -[NSObject copy] combined with HardRetainWithNSRelease.
+
+2010-09-22 Balazs Kelemen <kb@inf.u-szeged.hu>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ PluginStrategy should satisfy the needs of Qt
+ https://bugs.webkit.org/show_bug.cgi?id=45857
+ No new functionality so no new tests.
+
+ * WebCoreSupport/WebPlatformStrategies.h:
+ * WebCoreSupport/WebPlatformStrategies.mm:
+ (WebPlatformStrategies::getPluginInfo):
+
+2010-09-22 Paul Knight <pknight@apple.com>
+
+ Reviewed by Simon Fraser.
+
+ -[WebView _scheduleCompositingLayerSync] should wake the run loop
+ https://bugs.webkit.org/show_bug.cgi?id=46226
+
+ Call CFRunLoopWakeUp to make sure the run loop is not sleeping, which could delay layer painting.
+
+ * WebView/WebView.mm:
+ (-[WebView _scheduleCompositingLayerSync]):
+
+2010-09-21 Andy Estes <aestes@apple.com>
+
+ Reviewed by Darin Adler.
+
+ REGRESSION (r61285): AIM 2.1.296: Code rendered as text in Welcome screen
+ https://bugs.webkit.org/show_bug.cgi?id=46134
+
+ AIM clients linked against versions of WebKit prior to the introduction
+ of the HTML5 parser contain markup incompatible with the new parser.
+ Enable parser quirks in this case to remain compatible with these
+ clients.
+
+ * WebView/WebView.mm:
+ (shouldUsePreHTML5ParserQuirks): Returns true if the embedding
+ application is AIM and was linked against a version of WebKit prior to
+ the introduction of the HTML5 parser, or if the
+ WebKitPreHTML5ParserQuirks WebPreference is enabled.
+ (-[WebView _preferencesChangedNotification:]): Call
+ WebCore::Settings::setUsePreHTML5ParserQuirks().
+
+2010-09-21 Steve Block <steveblock@google.com>
+
+ Reviewed by Jeremy Orlow.
+
+ DeviceOrientationClient and DeviceMotionClient should have controllerDestroyed() methods
+ https://bugs.webkit.org/show_bug.cgi?id=45891
+
+ Implements WebDeviceOrientationClient::deviceOrientationControllerDestroyed to delete the client.
+
+ * WebCoreSupport/WebDeviceOrientationClient.h:
+ * WebCoreSupport/WebDeviceOrientationClient.mm:
+ (WebDeviceOrientationClient::deviceOrientationControllerDestroyed):
+
+2010-09-20 Philippe Normand <pnormand@igalia.com>
+
+ Reviewed by Eric Carlson.
+
+ [GTK] enhanced context menu for media elements
+ https://bugs.webkit.org/show_bug.cgi?id=45021
+
+ New localized strings for the media element context-menu.
+
+ * WebCoreSupport/WebPlatformStrategies.h:
+ * WebCoreSupport/WebPlatformStrategies.mm:
+ (WebPlatformStrategies::contextMenuItemTagOpenVideoInNewWindow):
+ (WebPlatformStrategies::contextMenuItemTagOpenAudioInNewWindow):
+ (WebPlatformStrategies::contextMenuItemTagCopyVideoLinkToClipboard):
+ (WebPlatformStrategies::contextMenuItemTagCopyAudioLinkToClipboard):
+ (WebPlatformStrategies::contextMenuItemTagToggleMediaControls):
+ (WebPlatformStrategies::contextMenuItemTagToggleMediaLoop):
+ (WebPlatformStrategies::contextMenuItemTagEnterVideoFullscreen):
+ (WebPlatformStrategies::contextMenuItemTagMediaPlay):
+ (WebPlatformStrategies::contextMenuItemTagMediaPause):
+ (WebPlatformStrategies::contextMenuItemTagMediaMute):
+
2010-09-20 Andy Estes <aestes@apple.com>
Reviewed by Adam Barth.
diff --git a/WebKit/mac/Configurations/Version.xcconfig b/WebKit/mac/Configurations/Version.xcconfig
index 67bf769..13dd8c0 100644
--- a/WebKit/mac/Configurations/Version.xcconfig
+++ b/WebKit/mac/Configurations/Version.xcconfig
@@ -22,7 +22,7 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
MAJOR_VERSION = 534;
-MINOR_VERSION = 9;
+MINOR_VERSION = 10;
TINY_VERSION = 0;
FULL_VERSION = $(MAJOR_VERSION).$(MINOR_VERSION);
diff --git a/WebKit/mac/Misc/WebKitVersionChecks.h b/WebKit/mac/Misc/WebKitVersionChecks.h
index 94286d6..4bf2c83 100644
--- a/WebKit/mac/Misc/WebKitVersionChecks.h
+++ b/WebKit/mac/Misc/WebKitVersionChecks.h
@@ -54,6 +54,7 @@
#define WEBKIT_FIRST_VERSION_WITHOUT_BUMPERCAR_BACK_FORWARD_QUIRK 0x02120700 // 530.7.0
#define WEBKIT_FIRST_VERSION_WITHOUT_CONTENT_SNIFFING_FOR_FILE_URLS 0x02120A00 // 530.10.0
#define WEBKIT_FIRST_VERSION_WITHOUT_LINK_ELEMENT_TEXT_CSS_QUIRK 0x02130200 // 531.2.0
+#define WEBKIT_FIRST_VERSION_WITH_HTML5_PARSER 0x02160900 // 534.9.0
#ifdef __cplusplus
extern "C" {
diff --git a/WebKit/mac/Misc/WebNSFileManagerExtras.m b/WebKit/mac/Misc/WebNSFileManagerExtras.m
index f10781b..ad48fb8 100644
--- a/WebKit/mac/Misc/WebNSFileManagerExtras.m
+++ b/WebKit/mac/Misc/WebNSFileManagerExtras.m
@@ -31,7 +31,6 @@
#import "WebKitNSStringExtras.h"
#import "WebNSURLExtras.h"
#import <JavaScriptCore/Assertions.h>
-#import <WebCore/FoundationExtras.h>
#import <WebKitSystemInterface.h>
#import <sys/stat.h>
@@ -87,19 +86,22 @@
typedef struct MetaDataInfo
{
- NSString *URLString;
- NSString *referrer;
- NSString *path;
+ CFStringRef URLString;
+ CFStringRef referrer;
+ CFStringRef path;
} MetaDataInfo;
static void *setMetaData(void* context)
{
MetaDataInfo *info = (MetaDataInfo *)context;
- WKSetMetadataURL(info->URLString, info->referrer, info->path);
-
- HardRelease(info->URLString);
- HardRelease(info->referrer);
- HardRelease(info->path);
+ WKSetMetadataURL((NSString *)info->URLString, (NSString *)info->referrer, (NSString *)info->path);
+
+ if (info->URLString)
+ CFRelease(info->URLString);
+ if (info->referrer)
+ CFRelease(info->referrer);
+ if (info->path)
+ CFRelease(info->path);
free(info);
return 0;
@@ -124,9 +126,9 @@ static void *setMetaData(void* context)
MetaDataInfo *info = malloc(sizeof(MetaDataInfo));
- info->URLString = HardRetainWithNSRelease([URLString copy]);
- info->referrer = HardRetainWithNSRelease([referrer copy]);
- info->path = HardRetainWithNSRelease([path copy]);
+ info->URLString = URLString ? CFStringCreateCopy(0, (CFStringRef)URLString) : 0;
+ info->referrer = referrer ? CFStringCreateCopy(0, (CFStringRef)referrer) : 0;
+ info->path = path ? CFStringCreateCopy(0, (CFStringRef)path) : 0;
pthread_create(&tid, &attr, setMetaData, info);
pthread_attr_destroy(&attr);
diff --git a/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm b/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm
index c0c480b..e03bc27 100644
--- a/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm
+++ b/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm
@@ -704,6 +704,7 @@ void NetscapePluginInstanceProxy::evaluateJavaScript(PluginRequest* pluginReques
NSData *JSData = [result dataUsingEncoding:NSUTF8StringEncoding];
RefPtr<HostedNetscapePluginStream> stream = HostedNetscapePluginStream::create(this, pluginRequest->requestID(), pluginRequest->request());
+ m_streams.add(stream->streamID(), stream);
RetainPtr<NSURLResponse> response(AdoptNS, [[NSURLResponse alloc] initWithURL:URL
MIMEType:@"text/plain"
diff --git a/WebKit/mac/Plugins/WebNetscapePluginView.mm b/WebKit/mac/Plugins/WebNetscapePluginView.mm
index 3d5d7a1..ff0ca77 100644
--- a/WebKit/mac/Plugins/WebNetscapePluginView.mm
+++ b/WebKit/mac/Plugins/WebNetscapePluginView.mm
@@ -661,13 +661,19 @@ static inline void getNPRect(const NSRect& nr, NPRect& npr)
// Temporarily retain self in case the plug-in view is released while sending an event.
[[self retain] autorelease];
-
+
BOOL acceptedEvent;
[self willCallPlugInFunction];
+ // Set the pluginAllowPopup flag.
+ ASSERT(_eventHandler);
+ bool oldAllowPopups = frame->script()->allowPopupsFromPlugin();
+ frame->script()->setAllowPopupsFromPlugin(_eventHandler->currentEventIsUserGesture());
{
JSC::JSLock::DropAllLocks dropAllLocks(JSC::SilenceAssertionsOnly);
acceptedEvent = [_pluginPackage.get() pluginFuncs]->event(plugin, event);
}
+ // Restore the old pluginAllowPopup flag.
+ frame->script()->setAllowPopupsFromPlugin(oldAllowPopups);
[self didCallPlugInFunction];
if (portState) {
diff --git a/WebKit/mac/WebCoreSupport/WebDeviceOrientationClient.h b/WebKit/mac/WebCoreSupport/WebDeviceOrientationClient.h
index 1cbc8e2..8e1c274 100644
--- a/WebKit/mac/WebCoreSupport/WebDeviceOrientationClient.h
+++ b/WebKit/mac/WebCoreSupport/WebDeviceOrientationClient.h
@@ -47,6 +47,7 @@ public:
virtual void startUpdating();
virtual void stopUpdating();
virtual WebCore::DeviceOrientation* lastOrientation() const;
+ virtual void deviceOrientationControllerDestroyed();
private:
id<WebDeviceOrientationProvider> getProvider() const;
diff --git a/WebKit/mac/WebCoreSupport/WebDeviceOrientationClient.mm b/WebKit/mac/WebCoreSupport/WebDeviceOrientationClient.mm
index 278e835..f0c624d 100644
--- a/WebKit/mac/WebCoreSupport/WebDeviceOrientationClient.mm
+++ b/WebKit/mac/WebCoreSupport/WebDeviceOrientationClient.mm
@@ -60,6 +60,11 @@ DeviceOrientation* WebDeviceOrientationClient::lastOrientation() const
return core([getProvider() lastOrientation]);
}
+void WebDeviceOrientationClient::deviceOrientationControllerDestroyed()
+{
+ delete this;
+}
+
id<WebDeviceOrientationProvider> WebDeviceOrientationClient::getProvider() const
{
if (!m_provider) {
diff --git a/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.h b/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.h
index 447c515..0baa55c 100644
--- a/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.h
+++ b/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.h
@@ -193,7 +193,7 @@ private:
virtual PassRefPtr<WebCore::Frame> createFrame(const WebCore::KURL& url, const WTF::String& name, WebCore::HTMLFrameOwnerElement*,
const WTF::String& referrer, bool allowsScrolling, int marginWidth, int marginHeight);
- virtual void didTransferChildFrameToNewDocument();
+ virtual void didTransferChildFrameToNewDocument(WebCore::Page* oldPage);
virtual PassRefPtr<WebCore::Widget> createPlugin(const WebCore::IntSize&, WebCore::HTMLPlugInElement*, const WebCore::KURL&, const Vector<WTF::String>&,
const Vector<WTF::String>&, const WTF::String&, bool);
virtual void redirectDataToPlugin(WebCore::Widget* pluginWidget);
diff --git a/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm b/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm
index a398ef7..cef552b 100644
--- a/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm
+++ b/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm
@@ -1382,8 +1382,13 @@ PassRefPtr<Frame> WebFrameLoaderClient::createFrame(const KURL& url, const Strin
return 0;
}
-void WebFrameLoaderClient::didTransferChildFrameToNewDocument()
+void WebFrameLoaderClient::didTransferChildFrameToNewDocument(Page* oldPage)
{
+ if (oldPage == core(m_webFrame.get())->page())
+ return;
+
+ // Update resource tracking now that frame is in a different page.
+ // TODO(jennb): update resource tracking [bug 44713]
}
ObjectContentType WebFrameLoaderClient::objectContentType(const KURL& url, const String& mimeType)
diff --git a/WebKit/mac/WebCoreSupport/WebPlatformStrategies.h b/WebKit/mac/WebCoreSupport/WebPlatformStrategies.h
index 53f39f8..fab7eee 100644
--- a/WebKit/mac/WebCoreSupport/WebPlatformStrategies.h
+++ b/WebKit/mac/WebCoreSupport/WebPlatformStrategies.h
@@ -45,7 +45,7 @@ private:
// WebCore::PluginStrategy
virtual void refreshPlugins();
- virtual void getPluginInfo(Vector<WebCore::PluginInfo>&);
+ virtual void getPluginInfo(const WebCore::Page*, Vector<WebCore::PluginInfo>&);
// WebCore::LocalizationStrategy
virtual WTF::String inputElementAltText();
@@ -113,6 +113,16 @@ private:
virtual WTF::String contextMenuItemTagCapitalize();
virtual WTF::String contextMenuItemTagChangeBack(const WTF::String& replacedString);
virtual WTF::String contextMenuItemTagInspectElement();
+ virtual WTF::String contextMenuItemTagOpenVideoInNewWindow();
+ virtual WTF::String contextMenuItemTagOpenAudioInNewWindow();
+ virtual WTF::String contextMenuItemTagCopyVideoLinkToClipboard();
+ virtual WTF::String contextMenuItemTagCopyAudioLinkToClipboard();
+ virtual WTF::String contextMenuItemTagToggleMediaControls();
+ virtual WTF::String contextMenuItemTagToggleMediaLoop();
+ virtual WTF::String contextMenuItemTagEnterVideoFullscreen();
+ virtual WTF::String contextMenuItemTagMediaPlay();
+ virtual WTF::String contextMenuItemTagMediaPause();
+ virtual WTF::String contextMenuItemTagMediaMute();
#endif // ENABLE(CONTEXT_MENUS)
virtual WTF::String searchMenuNoRecentSearchesText();
virtual WTF::String searchMenuRecentSearchesText();
diff --git a/WebKit/mac/WebCoreSupport/WebPlatformStrategies.mm b/WebKit/mac/WebCoreSupport/WebPlatformStrategies.mm
index 2900ccf..9d8fd11 100644
--- a/WebKit/mac/WebCoreSupport/WebPlatformStrategies.mm
+++ b/WebKit/mac/WebCoreSupport/WebPlatformStrategies.mm
@@ -72,7 +72,7 @@ void WebPlatformStrategies::refreshPlugins()
[[WebPluginDatabase sharedDatabase] refresh];
}
-void WebPlatformStrategies::getPluginInfo(Vector<WebCore::PluginInfo>& plugins)
+void WebPlatformStrategies::getPluginInfo(const WebCore::Page*, Vector<WebCore::PluginInfo>& plugins)
{
BEGIN_BLOCK_OBJC_EXCEPTIONS;
@@ -156,6 +156,56 @@ String WebPlatformStrategies::contextMenuItemTagCopyImageToClipboard()
return UI_STRING("Copy Image", "Copy Image context menu item");
}
+String WebPlatformStrategies::contextMenuItemTagOpenVideoInNewWindow()
+{
+ return UI_STRING("Open Video in New Window", "Open Video in New Window context menu item");
+}
+
+String WebPlatformStrategies::contextMenuItemTagOpenAudioInNewWindow()
+{
+ return UI_STRING("Open Audio in New Window", "Open Audio in New Window context menu item");
+}
+
+String WebPlatformStrategies::contextMenuItemTagCopyVideoLinkToClipboard()
+{
+ return UI_STRING("Copy Video Address", "Copy Video Address Location context menu item");
+}
+
+String WebPlatformStrategies::contextMenuItemTagCopyAudioLinkToClipboard()
+{
+ return UI_STRING("Copy Audio Address", "Copy Audio Address Location context menu item");
+}
+
+String WebPlatformStrategies::contextMenuItemTagToggleMediaControls()
+{
+ return UI_STRING("Controls", "Media Controls context menu item");
+}
+
+String WebPlatformStrategies::contextMenuItemTagToggleMediaLoop()
+{
+ return UI_STRING("Loop", "Media Loop context menu item");
+}
+
+String WebPlatformStrategies::contextMenuItemTagEnterVideoFullscreen()
+{
+ return UI_STRING("Enter Fullscreen", "Video Enter Fullscreen context menu item");
+}
+
+String WebPlatformStrategies::contextMenuItemTagMediaPlay()
+{
+ return UI_STRING("Play", "Media Play context menu item");
+}
+
+String WebPlatformStrategies::contextMenuItemTagMediaPause()
+{
+ return UI_STRING("Pause", "Media Pause context menu item");
+}
+
+String WebPlatformStrategies::contextMenuItemTagMediaMute()
+{
+ return UI_STRING("Mute", "Media Mute context menu item");
+}
+
String WebPlatformStrategies::contextMenuItemTagOpenFrameInNewWindow()
{
return UI_STRING("Open Frame in New Window", "Open Frame in New Window context menu item");
diff --git a/WebKit/mac/WebInspector/WebNodeHighlightView.mm b/WebKit/mac/WebInspector/WebNodeHighlightView.mm
index b3cd69e..7fc3cf4 100644
--- a/WebKit/mac/WebInspector/WebNodeHighlightView.mm
+++ b/WebKit/mac/WebInspector/WebNodeHighlightView.mm
@@ -67,14 +67,15 @@ using namespace WebCore;
- (void)drawRect:(NSRect)rect
{
- [NSGraphicsContext saveGraphicsState];
+ if (_webNodeHighlight) {
+ [NSGraphicsContext saveGraphicsState];
- ASSERT([[NSGraphicsContext currentContext] isFlipped]);
+ ASSERT([[NSGraphicsContext currentContext] isFlipped]);
- GraphicsContext context((PlatformGraphicsContext*)[[NSGraphicsContext currentContext] graphicsPort]);
- [_webNodeHighlight inspectorController]->drawNodeHighlight(context);
-
- [NSGraphicsContext restoreGraphicsState];
+ GraphicsContext context((PlatformGraphicsContext*)[[NSGraphicsContext currentContext] graphicsPort]);
+ [_webNodeHighlight inspectorController]->drawNodeHighlight(context);
+ [NSGraphicsContext restoreGraphicsState];
+ }
}
- (WebNodeHighlight *)webNodeHighlight
diff --git a/WebKit/mac/WebView/WebPreferenceKeysPrivate.h b/WebKit/mac/WebView/WebPreferenceKeysPrivate.h
index 17c8e4d..8119649 100644
--- a/WebKit/mac/WebView/WebPreferenceKeysPrivate.h
+++ b/WebKit/mac/WebView/WebPreferenceKeysPrivate.h
@@ -100,6 +100,7 @@
#define WebKitDNSPrefetchingEnabledPreferenceKey @"WebKitDNSPrefetchingEnabled"
#define WebKitFullScreenEnabledPreferenceKey @"WebKitFullScreenEnabled"
#define WebKitMemoryInfoEnabledPreferenceKey @"WebKitMemoryInfoEnabled"
+#define WebKitHyperlinkAuditingEnabledPreferenceKey @"WebKitHyperlinkAuditingEnabled"
// These are private both because callers should be using the cover methods and because the
// cover methods themselves are private.
diff --git a/WebKit/mac/WebView/WebPreferences.mm b/WebKit/mac/WebView/WebPreferences.mm
index 87284bb..2ddd8b3 100644
--- a/WebKit/mac/WebView/WebPreferences.mm
+++ b/WebKit/mac/WebView/WebPreferences.mm
@@ -368,6 +368,7 @@ static WebCacheModel cacheModelForMainBundle(void)
[NSNumber numberWithBool:YES], WebKitDNSPrefetchingEnabledPreferenceKey,
[NSNumber numberWithBool:NO], WebKitFullScreenEnabledPreferenceKey,
[NSNumber numberWithBool:NO], WebKitMemoryInfoEnabledPreferenceKey,
+ [NSNumber numberWithBool:NO], WebKitHyperlinkAuditingEnabledPreferenceKey,
[NSNumber numberWithBool:NO], WebKitUsePreHTML5ParserQuirksKey,
[NSNumber numberWithLongLong:WebCore::ApplicationCacheStorage::noQuota()], WebKitApplicationCacheTotalQuota,
[NSNumber numberWithLongLong:WebCore::ApplicationCacheStorage::noQuota()], WebKitApplicationCacheDefaultOriginQuota,
@@ -1332,6 +1333,16 @@ static NSString *classIBCreatorID = nil;
[self _setBoolValue:flag forKey:WebKitMemoryInfoEnabledPreferenceKey];
}
+- (BOOL)hyperlinkAuditingEnabled
+{
+ return [self _boolValueForKey:WebKitHyperlinkAuditingEnabledPreferenceKey];
+}
+
+- (void)setHyperlinkAuditingEnabled:(BOOL)flag
+{
+ [self _setBoolValue:flag forKey:WebKitHyperlinkAuditingEnabledPreferenceKey];
+}
+
- (WebKitEditingBehavior)editingBehavior
{
return static_cast<WebKitEditingBehavior>([self _integerValueForKey:WebKitEditingBehaviorPreferenceKey]);
diff --git a/WebKit/mac/WebView/WebPreferencesPrivate.h b/WebKit/mac/WebView/WebPreferencesPrivate.h
index 3bd5e24..bb525cd 100644
--- a/WebKit/mac/WebView/WebPreferencesPrivate.h
+++ b/WebKit/mac/WebView/WebPreferencesPrivate.h
@@ -196,6 +196,9 @@ extern NSString *WebPreferencesRemovedNotification;
- (BOOL)memoryInfoEnabled;
- (void)setMemoryInfoEnabled:(BOOL)enabled;
+- (BOOL)hyperlinkAuditingEnabled;
+- (void)setHyperlinkAuditingEnabled:(BOOL)enabled;
+
// Other private methods
- (void)_postPreferencesChangesNotification;
+ (WebPreferences *)_getInstanceForIdentifier:(NSString *)identifier;
diff --git a/WebKit/mac/WebView/WebView.mm b/WebKit/mac/WebView/WebView.mm
index 20f6e24..1fca8d1 100644
--- a/WebKit/mac/WebView/WebView.mm
+++ b/WebKit/mac/WebView/WebView.mm
@@ -133,9 +133,12 @@
#import <WebCore/HistoryItem.h>
#import <WebCore/IconDatabase.h>
#import <WebCore/JSCSSStyleDeclaration.h>
+#import <WebCore/JSDocument.h>
#import <WebCore/JSElement.h>
+#import <WebCore/JSNodeList.h>
#import <WebCore/Logging.h>
#import <WebCore/MIMETypeRegistry.h>
+#import <WebCore/NodeList.h>
#import <WebCore/Page.h>
#import <WebCore/PageCache.h>
#import <WebCore/PageGroup.h>
@@ -675,6 +678,7 @@ static bool shouldEnableLoadDeferring()
// Initialize our platform strategies.
WebPlatformStrategies::initialize();
+ Settings::setMinDOMTimerInterval(0.004);
didOneTimeInitialization = true;
}
@@ -696,7 +700,6 @@ static bool shouldEnableLoadDeferring()
_private->page->setCanStartMedia([self window]);
_private->page->settings()->setLocalStorageDatabasePath([[self preferences] _localStorageDatabasePath]);
- _private->page->settings()->setMinDOMTimerInterval(0.004);
[WebFrame _createMainFrameWithPage:_private->page frameName:frameName frameView:frameView];
@@ -1358,6 +1361,27 @@ static bool fastDocumentTeardownEnabled()
return needsQuirk;
}
+
+- (BOOL)_needsPreHTML5ParserQuirks
+{
+ // AOL Instant Messenger and Microsoft My Day contain markup incompatible
+ // with the new HTML5 parser. If these applications were linked against a
+ // version of WebKit prior to the introduction of the HTML5 parser, enable
+ // parser quirks to maintain compatibility. For details, see
+ // <https://bugs.webkit.org/show_bug.cgi?id=46134> and
+ // <https://bugs.webkit.org/show_bug.cgi?id=46334>.
+ static bool isApplicationNeedingParserQuirks = !WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITH_HTML5_PARSER)
+ && (applicationIsAOLInstantMessenger() || applicationIsMicrosoftMyDay());
+
+ return isApplicationNeedingParserQuirks
+#if ENABLE(DASHBOARD_SUPPORT)
+ // Pre-HTML5 parser quirks are required to remain compatible with many
+ // Dashboard widgets. See <rdar://problem/8175982>.
+ || (_private->page && _private->page->settings()->usesDashboardBackwardCompatibilityMode())
+#endif
+ || [[self preferences] usePreHTML5ParserQuirks];
+}
+
- (void)_preferencesChangedNotification:(NSNotification *)notification
{
WebPreferences *preferences = (WebPreferences *)[notification object];
@@ -1453,7 +1477,8 @@ static bool fastDocumentTeardownEnabled()
settings->setFullScreenEnabled([preferences fullScreenEnabled]);
#endif
settings->setMemoryInfoEnabled([preferences memoryInfoEnabled]);
- settings->setUsePreHTML5ParserQuirks([preferences usePreHTML5ParserQuirks]);
+ settings->setHyperlinkAuditingEnabled([preferences hyperlinkAuditingEnabled]);
+ settings->setUsePreHTML5ParserQuirks([self _needsPreHTML5ParserQuirks]);
// Application Cache Preferences are stored on the global cache storage manager, not in Settings.
[WebApplicationCache setDefaultOriginQuota:[preferences applicationCacheDefaultOriginQuota]];
@@ -1983,6 +2008,11 @@ static inline IMP getMethod(id o, SEL s)
break;
}
}
+
+ // Pre-HTML5 parser quirks should be enabled if Dashboard is in backward
+ // compatibility mode. See <rdar://problem/8175982>.
+ if (_private->page)
+ _private->page->settings()->setUsePreHTML5ParserQuirks([self _needsPreHTML5ParserQuirks]);
}
- (BOOL)_dashboardBehavior:(WebDashboardBehavior)behavior
@@ -2649,7 +2679,7 @@ static PassOwnPtr<Vector<String> > toStringVector(NSArray* patterns)
if (![[NSUserDefaults standardUserDefaults] objectForKey:WebAutomaticTextReplacementEnabled])
automaticTextReplacementEnabled = [NSSpellChecker isAutomaticTextReplacementEnabled];
if (![[NSUserDefaults standardUserDefaults] objectForKey:WebAutomaticSpellingCorrectionEnabled])
- automaticTextReplacementEnabled = [NSSpellChecker isAutomaticSpellingCorrectionEnabled];
+ automaticSpellingCorrectionEnabled = [NSSpellChecker isAutomaticSpellingCorrectionEnabled];
#endif
}
@@ -5859,6 +5889,11 @@ static void layerSyncRunLoopObserverCallBack(CFRunLoopObserverRef, CFRunLoopActi
- (void)_scheduleCompositingLayerSync
{
+ CFRunLoopRef currentRunLoop = CFRunLoopGetCurrent();
+
+ // Make sure we wake up the loop or the observer could be delayed until some other source fires.
+ CFRunLoopWakeUp(currentRunLoop);
+
if (_private->layerSyncRunLoopObserver)
return;
@@ -5874,7 +5909,7 @@ static void layerSyncRunLoopObserverCallBack(CFRunLoopObserverRef, CFRunLoopActi
kCFRunLoopBeforeWaiting | kCFRunLoopExit, true /* repeats */,
runLoopOrder, layerSyncRunLoopObserverCallBack, &context);
- CFRunLoopAddObserver(CFRunLoopGetCurrent(), _private->layerSyncRunLoopObserver, kCFRunLoopCommonModes);
+ CFRunLoopAddObserver(currentRunLoop, _private->layerSyncRunLoopObserver, kCFRunLoopCommonModes);
}
#endif
@@ -6020,6 +6055,25 @@ static void glibContextIterationCallback(CFRunLoopObserverRef, CFRunLoopActivity
@end
+@implementation WebView (WebViewPrivateNodesFromRect)
+
+- (JSValueRef)_nodesFromRect:(JSContextRef)context forDocument:(JSValueRef)value x:(int)x y:(int)y top:(unsigned)top right:(unsigned)right bottom:(unsigned)bottom left:(unsigned)left ignoreClipping:(BOOL)ignoreClipping
+{
+ JSLock lock(SilenceAssertionsOnly);
+ ExecState* exec = toJS(context);
+ if (!value)
+ return JSValueMakeUndefined(context);
+ JSValue jsValue = toJS(exec, value);
+ if (!jsValue.inherits(&JSDocument::s_info))
+ return JSValueMakeUndefined(context);
+ JSDocument* jsDocument = static_cast<JSDocument*>(asObject(jsValue));
+ Document* document = jsDocument->impl();
+ RefPtr<NodeList> nodes = document->nodesFromRect(x, y, top, right, bottom, left, ignoreClipping);
+ return toRef(exec, toJS(exec, jsDocument->globalObject(), nodes.get()));
+}
+
+@end
+
#ifdef BUILDING_ON_LEOPARD
static IMP originalRecursivelyRemoveMailAttributesImp;
diff --git a/WebKit/mac/WebView/WebViewPrivate.h b/WebKit/mac/WebView/WebViewPrivate.h
index aeb36c7..749eeb3 100644
--- a/WebKit/mac/WebView/WebViewPrivate.h
+++ b/WebKit/mac/WebView/WebViewPrivate.h
@@ -630,6 +630,10 @@ Could be worth adding to the API.
- (JSValueRef)_computedStyleIncludingVisitedInfo:(JSContextRef)context forElement:(JSValueRef)value;
@end
+@interface WebView (WebViewPrivateNodesFromRect)
+- (JSValueRef)_nodesFromRect:(JSContextRef)context forDocument:(JSValueRef)value x:(int)x y:(int)y top:(unsigned)top right:(unsigned)right bottom:(unsigned)bottom left:(unsigned)left ignoreClipping:(BOOL)ignoreClipping;
+@end
+
@interface NSObject (WebFrameLoadDelegatePrivate)
- (void)webView:(WebView *)sender didFirstLayoutInFrame:(WebFrame *)frame;
diff --git a/WebKit/qt/Api/DerivedSources.pro b/WebKit/qt/Api/DerivedSources.pro
index 6fb52f2..d8bd1db 100644
--- a/WebKit/qt/Api/DerivedSources.pro
+++ b/WebKit/qt/Api/DerivedSources.pro
@@ -10,7 +10,7 @@ DESTDIR = ../../../include/QtWebKit
QUOTE = ""
DOUBLE_ESCAPED_QUOTE = ""
ESCAPE = ""
-win32-msvc* | (contains(QMAKE_HOST.os, "Windows"):isEmpty(QMAKE_SH)) {
+win32-msvc* | wince* | contains(QMAKE_HOST.os, "Windows"):isEmpty(QMAKE_SH) {
# MinGW's make will run makefile commands using sh, even if make
# was run from the Windows shell, if it finds sh in the path.
ESCAPE = "^"
diff --git a/WebKit/qt/Api/qgraphicswebview.cpp b/WebKit/qt/Api/qgraphicswebview.cpp
index 7f66d98..36d4326 100644
--- a/WebKit/qt/Api/qgraphicswebview.cpp
+++ b/WebKit/qt/Api/qgraphicswebview.cpp
@@ -75,7 +75,6 @@ public:
QGraphicsWebView* q;
QWebPage* page;
bool resizesToContents;
- QSize deviceSize;
// Just a convenience to avoid using page->client->overlay always
QSharedPointer<QGraphicsItemOverlay> overlay;
@@ -131,13 +130,8 @@ void QGraphicsWebViewPrivate::updateResizesToContentsForPage()
if (!page->preferredContentsSize().isValid())
page->setPreferredContentsSize(QSize(960, 800));
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
QObject::connect(page->mainFrame(), SIGNAL(contentsSizeChanged(QSize)),
q, SLOT(_q_contentsSizeChanged(const QSize&)), Qt::UniqueConnection);
-#else
- QObject::connect(page->mainFrame(), SIGNAL(contentsSizeChanged(QSize)),
- q, SLOT(_q_contentsSizeChanged(const QSize&)));
-#endif
} else {
QObject::disconnect(page->mainFrame(), SIGNAL(contentsSizeChanged(QSize)),
q, SLOT(_q_contentsSizeChanged(const QSize&)));
@@ -243,14 +237,10 @@ QGraphicsWebView::QGraphicsWebView(QGraphicsItem* parent)
: QGraphicsWidget(parent)
, d(new QGraphicsWebViewPrivate(this))
{
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
setFlag(QGraphicsItem::ItemUsesExtendedStyleOption, true);
-#endif
setAcceptDrops(true);
setAcceptHoverEvents(true);
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
setAcceptTouchEvents(true);
-#endif
setFocusPolicy(Qt::StrongFocus);
setFlag(QGraphicsItem::ItemClipsChildrenToShape, true);
#if ENABLE(TILED_BACKING_STORE)
@@ -316,7 +306,6 @@ bool QGraphicsWebView::sceneEvent(QEvent* event)
{
// Re-implemented in order to allows fixing event-related bugs in patch releases.
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
if (d->page && (event->type() == QEvent::TouchBegin
|| event->type() == QEvent::TouchEnd
|| event->type() == QEvent::TouchUpdate)) {
@@ -325,7 +314,6 @@ bool QGraphicsWebView::sceneEvent(QEvent* event)
// Always return true so that we'll receive also TouchUpdate and TouchEnd events
return true;
}
-#endif
return QGraphicsWidget::sceneEvent(event);
}
@@ -419,11 +407,7 @@ void QGraphicsWebViewPrivate::detachCurrentPage()
if (!page)
return;
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
page->d->view.clear();
-#else
- page->d->view = 0;
-#endif
// The client has always to be deleted.
delete page->d->client;
@@ -555,24 +539,6 @@ QIcon QGraphicsWebView::icon() const
}
/*!
- \property QGraphicsWebView::deviceSize
- \brief the size of the device using the web view
-
- The device size is used by the DOM window object methods
- otherHeight(), otherWidth() as well as a page for the viewport
- meta tag attributes device-width and device-height.
-*/
-void QGraphicsWebView::setDeviceSize(const QSize& size)
-{
- d->deviceSize = size;
-}
-
-QSize QGraphicsWebView::deviceSize() const
-{
- return d->deviceSize;
-}
-
-/*!
\property QGraphicsWebView::zoomFactor
\brief the zoom factor for the view
*/
diff --git a/WebKit/qt/Api/qgraphicswebview.h b/WebKit/qt/Api/qgraphicswebview.h
index 77f0359..8620ac5 100644
--- a/WebKit/qt/Api/qgraphicswebview.h
+++ b/WebKit/qt/Api/qgraphicswebview.h
@@ -41,7 +41,6 @@ class QWEBKIT_EXPORT QGraphicsWebView : public QGraphicsWidget {
Q_PROPERTY(QString title READ title NOTIFY titleChanged)
Q_PROPERTY(QIcon icon READ icon NOTIFY iconChanged)
Q_PROPERTY(qreal zoomFactor READ zoomFactor WRITE setZoomFactor)
- Q_PROPERTY(QSize deviceSize READ deviceSize WRITE setDeviceSize)
Q_PROPERTY(QUrl url READ url WRITE setUrl NOTIFY urlChanged)
@@ -65,9 +64,6 @@ public:
qreal zoomFactor() const;
void setZoomFactor(qreal);
- QSize deviceSize() const;
- void setDeviceSize(const QSize&);
-
bool isModified() const;
void load(const QUrl& url);
diff --git a/WebKit/qt/Api/qwebframe.cpp b/WebKit/qt/Api/qwebframe.cpp
index 46580bb..1791096 100644
--- a/WebKit/qt/Api/qwebframe.cpp
+++ b/WebKit/qt/Api/qwebframe.cpp
@@ -230,6 +230,14 @@ void QWebFramePrivate::init(QWebFrame *qframe, QWebFrameData *frameData)
frame->init();
}
+WebCore::ViewportArguments QWebFramePrivate::viewportArguments()
+{
+ if (!frame || !frame->document())
+ return WebCore::ViewportArguments();
+
+ return frame->document()->viewportArguments();
+}
+
void QWebFramePrivate::setPage(QWebPage* newPage)
{
if (page == newPage)
@@ -781,11 +789,9 @@ void QWebFrame::load(const QNetworkRequest &req,
case QNetworkAccessManager::PostOperation:
request.setHTTPMethod("POST");
break;
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
case QNetworkAccessManager::DeleteOperation:
request.setHTTPMethod("DELETE");
break;
-#endif
case QNetworkAccessManager::UnknownOperation:
// eh?
break;
diff --git a/WebKit/qt/Api/qwebframe_p.h b/WebKit/qt/Api/qwebframe_p.h
index 6d6eca1..5ba3f52 100644
--- a/WebKit/qt/Api/qwebframe_p.h
+++ b/WebKit/qt/Api/qwebframe_p.h
@@ -90,6 +90,8 @@ public:
void renderFromTiledBackingStore(WebCore::GraphicsContext*, const QRegion& clip);
#endif
+ WebCore::ViewportArguments viewportArguments();
+
QWebFrame *q;
Qt::ScrollBarPolicy horizontalScrollBarPolicy;
Qt::ScrollBarPolicy verticalScrollBarPolicy;
@@ -101,7 +103,6 @@ public:
int marginWidth;
int marginHeight;
bool zoomTextOnly;
- WebCore::ViewportArguments viewportArguments;
};
class QWebHitTestResultPrivate {
diff --git a/WebKit/qt/Api/qwebinspector.cpp b/WebKit/qt/Api/qwebinspector.cpp
index 802ea98..27148f7 100644
--- a/WebKit/qt/Api/qwebinspector.cpp
+++ b/WebKit/qt/Api/qwebinspector.cpp
@@ -196,6 +196,31 @@ void QWebInspectorPrivate::setFrontend(QWidget* newFrontend)
}
}
+/*!
+ * \internal
+ */
+void QWebInspectorPrivate::attachAndReplaceRemoteFrontend(QObject* newRemoteFrontend)
+{
+ if (remoteFrontend)
+ remoteFrontend->setParent(0);
+
+ remoteFrontend = newRemoteFrontend;
+
+ if (remoteFrontend)
+ remoteFrontend->setParent(q);
+}
+
+/*!
+ * \internal
+ */
+void QWebInspectorPrivate::detachRemoteFrontend()
+{
+ if (remoteFrontend) {
+ remoteFrontend->deleteLater();
+ remoteFrontend = 0;
+ }
+}
+
void QWebInspectorPrivate::adjustFrontendSize(const QSize& size)
{
if (frontend)
diff --git a/WebKit/qt/Api/qwebinspector_p.h b/WebKit/qt/Api/qwebinspector_p.h
index 4d327cc..3099eb1 100644
--- a/WebKit/qt/Api/qwebinspector_p.h
+++ b/WebKit/qt/Api/qwebinspector_p.h
@@ -33,14 +33,18 @@ public:
: q(qq)
, page(0)
, frontend(0)
+ , remoteFrontend(0)
{}
void setFrontend(QWidget* newFrontend);
+ void attachAndReplaceRemoteFrontend(QObject* newRemoteFrontend);
+ void detachRemoteFrontend();
void adjustFrontendSize(const QSize& size);
QWebInspector* q;
QWebPage* page;
QWidget* frontend;
+ QObject* remoteFrontend;
};
#endif
diff --git a/WebKit/qt/Api/qwebkitplatformplugin.h b/WebKit/qt/Api/qwebkitplatformplugin.h
index 76496c5..a851d56 100644
--- a/WebKit/qt/Api/qwebkitplatformplugin.h
+++ b/WebKit/qt/Api/qwebkitplatformplugin.h
@@ -84,9 +84,13 @@ Q_SIGNALS:
void notificationClicked();
};
-class QWebHapticFeedbackPlayer
+class QWebHapticFeedbackPlayer: public QObject
{
+ Q_OBJECT
public:
+ QWebHapticFeedbackPlayer() {}
+ virtual ~QWebHapticFeedbackPlayer() {}
+
enum HapticStrength {
None, Weak, Medium, Strong
};
@@ -110,12 +114,9 @@ public:
};
virtual bool supportsExtension(Extension extension) const = 0;
- virtual QWebSelectMethod* createSelectInputMethod() const = 0;
- virtual QWebNotificationPresenter* createNotificationPresenter() const = 0;
- virtual QWebHapticFeedbackPlayer* createHapticFeedbackPlayer() const = 0;
-
+ virtual QObject* createExtension(Extension extension) const = 0;
};
-Q_DECLARE_INTERFACE(QWebKitPlatformPlugin, "com.nokia.Qt.WebKit.PlatformPlugin/1.4");
+Q_DECLARE_INTERFACE(QWebKitPlatformPlugin, "com.nokia.Qt.WebKit.PlatformPlugin/1.5");
#endif // QWEBKITPLATFORMPLUGIN_H
diff --git a/WebKit/qt/Api/qwebpage.cpp b/WebKit/qt/Api/qwebpage.cpp
index 181b3a6..932103d 100644
--- a/WebKit/qt/Api/qwebpage.cpp
+++ b/WebKit/qt/Api/qwebpage.cpp
@@ -21,6 +21,7 @@
#include "config.h"
#include "qwebpage.h"
+
#include "qwebview.h"
#include "qwebframe.h"
#include "qwebpage_p.h"
@@ -77,6 +78,7 @@
#include "HTMLInputElement.h"
#include "HTMLNames.h"
#include "HitTestResult.h"
+#include "InspectorServerQt.h"
#include "WindowFeatures.h"
#include "WebPlatformStrategies.h"
#include "LocalizedStrings.h"
@@ -86,6 +88,7 @@
#include "GeolocationPermissionClientQt.h"
#include "NotificationPresenterClientQt.h"
#include "PageClientQt.h"
+#include "PlatformTouchEvent.h"
#include "WorkerThread.h"
#include "wtf/Threading.h"
@@ -93,6 +96,7 @@
#include <QBasicTimer>
#include <QBitArray>
#include <QDebug>
+#include <QDesktopWidget>
#include <QDragEnterEvent>
#include <QDragLeaveEvent>
#include <QDragMoveEvent>
@@ -112,16 +116,13 @@
#include <QSysInfo>
#include <QTextCharFormat>
#include <QTextDocument>
+#include <QTouchEvent>
#include <QNetworkAccessManager>
#include <QNetworkRequest>
#if defined(Q_WS_X11)
#include <QX11Info>
#endif
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
-#include <QTouchEvent>
-#include "PlatformTouchEvent.h"
-#endif
using namespace WebCore;
@@ -254,12 +255,29 @@ static inline Qt::DropAction dragOpToDropAction(unsigned actions)
QWebPagePrivate::QWebPagePrivate(QWebPage *qq)
: q(qq)
+ , page(0)
, client(0)
-#if QT_VERSION < QT_VERSION_CHECK(4, 6, 0)
- , view(0)
+ , mainFrame(0)
+#ifndef QT_NO_UNDOSTACK
+ , undoStack(0)
#endif
+ , insideOpenCall(false)
+ , m_totalBytes(0)
+ , m_bytesReceived()
, clickCausedFocus(false)
+ , networkManager(0)
+ , forwardUnsupportedContent(false)
+ , smartInsertDeleteEnabled(true)
+ , selectTrailingWhitespaceEnabled(false)
+ , linkPolicy(QWebPage::DontDelegateLinks)
, viewportSize(QSize(0, 0))
+#ifndef QT_NO_CONTEXTMENU
+ , currentContextMenu(0)
+#endif
+ , settings(0)
+ , editable(false)
+ , useFixedLayout(false)
+ , pluginFactory(0)
, inspectorFrontend(0)
, inspector(0)
, inspectorIsInternalOnly(false)
@@ -272,7 +290,7 @@ QWebPagePrivate::QWebPagePrivate(QWebPage *qq)
WebCore::Font::setCodePath(WebCore::Font::Complex);
#endif
- WebPlatformStrategies::initialize(qq);
+ WebPlatformStrategies::initialize();
Page::PageClients pageClients;
pageClients.chromeClient = new ChromeClientQt(q);
@@ -284,23 +302,6 @@ QWebPagePrivate::QWebPagePrivate(QWebPage *qq)
settings = new QWebSettings(page->settings());
-#ifndef QT_NO_UNDOSTACK
- undoStack = 0;
-#endif
- mainFrame = 0;
- networkManager = 0;
- pluginFactory = 0;
- insideOpenCall = false;
- forwardUnsupportedContent = false;
- editable = false;
- useFixedLayout = false;
- linkPolicy = QWebPage::DontDelegateLinks;
-#ifndef QT_NO_CONTEXTMENU
- currentContextMenu = 0;
-#endif
- smartInsertDeleteEnabled = true;
- selectTrailingWhitespaceEnabled = false;
-
history.d = new QWebHistoryPrivate(page->backForwardList());
memset(actions, 0, sizeof(actions));
@@ -793,7 +794,6 @@ void QWebPagePrivate::mouseReleaseEvent(QGraphicsSceneMouseEvent* ev)
void QWebPagePrivate::handleSoftwareInputPanel(Qt::MouseButton button)
{
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
Frame* frame = page->focusController()->focusedFrame();
if (!frame)
return;
@@ -810,7 +810,6 @@ void QWebPagePrivate::handleSoftwareInputPanel(Qt::MouseButton button)
}
clickCausedFocus = false;
-#endif
}
void QWebPagePrivate::mouseReleaseEvent(QMouseEvent *ev)
@@ -1136,9 +1135,7 @@ void QWebPagePrivate::inputMethodEvent(QInputMethodEvent *ev)
{
WebCore::Frame *frame = page->focusController()->focusedOrMainFrame();
WebCore::Editor *editor = frame->editor();
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
QInputMethodEvent::Attribute selection(QInputMethodEvent::Selection, 0, 0, QVariant());
-#endif
if (!editor->canEdit()) {
ev->ignore();
@@ -1177,13 +1174,11 @@ void QWebPagePrivate::inputMethodEvent(QInputMethodEvent *ev)
}
break;
}
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
case QInputMethodEvent::Selection: {
selection = a;
hasSelection = true;
break;
}
-#endif
}
}
@@ -1195,7 +1190,6 @@ void QWebPagePrivate::inputMethodEvent(QInputMethodEvent *ev)
// 3. populated preedit with a selection attribute, and start/end of 0 or non-0 updates selection of supplied preedit text
// 4. otherwise event is updating supplied pre-edit text
QString preedit = ev->preeditString();
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
if (hasSelection) {
QString text = (renderTextControl) ? QString(renderTextControl->text()) : QString();
if (preedit.isEmpty() && selection.start + selection.length > 0)
@@ -1203,10 +1197,8 @@ void QWebPagePrivate::inputMethodEvent(QInputMethodEvent *ev)
editor->setComposition(preedit, underlines,
(selection.length < 0) ? selection.start + selection.length : selection.start,
(selection.length < 0) ? selection.start : selection.start + selection.length);
- } else
-#endif
- if (!preedit.isEmpty())
- editor->setComposition(preedit, underlines, preedit.length(), 0);
+ } else if (!preedit.isEmpty())
+ editor->setComposition(preedit, underlines, preedit.length(), 0);
}
ev->accept();
@@ -1302,6 +1294,10 @@ void QWebPagePrivate::dynamicPropertyChangeEvent(QDynamicPropertyChangeEvent* ev
frame->tiledBackingStore()->setKeepAndCoverAreaMultipliers(keepMultiplier, coverMultiplier);
}
#endif
+ else if (event->propertyName() == "_q_webInspectorServerPort") {
+ InspectorServerQt* inspectorServer = InspectorServerQt::server();
+ inspectorServer->listen(inspectorServerPort());
+ }
}
#endif
@@ -1391,7 +1387,6 @@ bool QWebPagePrivate::handleScrolling(QKeyEvent *ev, Frame *frame)
return frame->eventHandler()->scrollRecursively(direction, granularity);
}
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
bool QWebPagePrivate::touchEvent(QTouchEvent* event)
{
WebCore::Frame* frame = QWebFramePrivate::core(mainFrame);
@@ -1404,7 +1399,6 @@ bool QWebPagePrivate::touchEvent(QTouchEvent* event)
// Return whether the default action was cancelled in the JS event handler
return frame->eventHandler()->handleTouchEvent(PlatformTouchEvent(event));
}
-#endif
/*!
This method is used by the input method to query a set of properties of the page
@@ -1479,7 +1473,6 @@ QVariant QWebPage::inputMethodQuery(Qt::InputMethodQuery property) const
return QVariant();
}
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
case Qt::ImAnchorPosition: {
if (renderTextControl) {
if (editor->hasComposition()) {
@@ -1502,7 +1495,6 @@ QVariant QWebPage::inputMethodQuery(Qt::InputMethodQuery property) const
}
return QVariant(0);
}
-#endif
default:
return QVariant();
}
@@ -1559,6 +1551,14 @@ InspectorController* QWebPagePrivate::inspectorController()
#endif
}
+quint16 QWebPagePrivate::inspectorServerPort()
+{
+#if ENABLE(INSPECTOR) && !defined(QT_NO_PROPERTIES)
+ if (q && q->property("_q_webInspectorServerPort").isValid())
+ return q->property("_q_webInspectorServerPort").toInt();
+#endif
+ return 0;
+}
/*!
\enum QWebPage::FindFlag
@@ -1987,11 +1987,7 @@ void QWebPage::setView(QWidget* view)
*/
QWidget *QWebPage::view() const
{
-#if QT_VERSION < QT_VERSION_CHECK(4, 6, 0)
- return d->view;
-#else
return d->view.data();
-#endif
}
/*!
@@ -2325,19 +2321,67 @@ void QWebPage::setViewportSize(const QSize &size) const
}
}
-QWebPage::ViewportConfiguration QWebPage::viewportConfigurationForSize(QSize availableSize) const
+static int getintenv(const char* variable)
+{
+ bool ok;
+ int value = qgetenv(variable).toInt(&ok);
+ return (ok) ? value : -1;
+}
+
+static QSize queryDeviceSizeForScreenContainingWidget(const QWidget* widget)
+{
+ QDesktopWidget* desktop = QApplication::desktop();
+ if (!desktop)
+ return QSize();
+
+ QSize size;
+
+ if (widget) {
+ // Returns the available geometry of the screen which contains widget.
+ // NOTE: this must be the the full screen size including any fixed status areas etc.
+ size = desktop->availableGeometry(widget).size();
+ } else
+ size = desktop->availableGeometry().size();
+
+ // This must be in portrait mode, adjust if not.
+ if (size.width() > size.height()) {
+ int width = size.width();
+ size.setWidth(size.height());
+ size.setHeight(width);
+ }
+
+ return size;
+}
+
+/*!
+ Computes the optimal viewport configuration given the \a availableSize, when
+ user interface components are disregarded.
+
+ The configuration is also dependent on the device screen size which is obtained
+ automatically. For testing purposes the size can be overridden by setting two
+ environment variables QTWEBKIT_DEVICE_WIDTH and QTWEBKIT_DEVICE_HEIGHT, which
+ both needs to be set.
+*/
+
+QWebPage::ViewportConfiguration QWebPage::viewportConfigurationForSize(const QSize& availableSize) const
{
static int desktopWidth = 980;
static int deviceDPI = 160;
- FloatRect rect = d->page->chrome()->windowRect();
+ ViewportConfiguration result;
- int deviceWidth = rect.width();
- int deviceHeight = rect.height();
+ int deviceWidth = getintenv("QTWEBKIT_DEVICE_WIDTH");
+ int deviceHeight = getintenv("QTWEBKIT_DEVICE_HEIGHT");
- WebCore::ViewportConfiguration conf = WebCore::findConfigurationForViewportData(mainFrame()->d->viewportArguments, desktopWidth, deviceWidth, deviceHeight, deviceDPI, availableSize);
+ // Both environment variables need to be set - or they will be ignored.
+ if (deviceWidth < 0 && deviceHeight < 0) {
+ QSize size = queryDeviceSizeForScreenContainingWidget((d->client) ? d->client->ownerWidget() : 0);
+ deviceWidth = size.width();
+ deviceHeight = size.height();
+ }
- ViewportConfiguration result;
+ WebCore::ViewportConfiguration conf = WebCore::findConfigurationForViewportData(mainFrame()->d->viewportArguments(),
+ desktopWidth, deviceWidth, deviceHeight, deviceDPI, availableSize);
result.m_isValid = true;
result.m_size = conf.layoutViewport;
@@ -2854,13 +2898,11 @@ bool QWebPage::event(QEvent *ev)
case QEvent::Leave:
d->leaveEvent(ev);
break;
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
case QEvent::TouchBegin:
case QEvent::TouchUpdate:
case QEvent::TouchEnd:
// Return whether the default action was cancelled in the JS event handler
return d->touchEvent(static_cast<QTouchEvent*>(ev));
-#endif
#ifndef QT_NO_PROPERTIES
case QEvent::DynamicPropertyChange:
d->dynamicPropertyChangeEvent(static_cast<QDynamicPropertyChangeEvent*>(ev));
diff --git a/WebKit/qt/Api/qwebpage.h b/WebKit/qt/Api/qwebpage.h
index b1441ff..e71e3da 100644
--- a/WebKit/qt/Api/qwebpage.h
+++ b/WebKit/qt/Api/qwebpage.h
@@ -55,6 +55,7 @@ namespace WebCore {
class EditorClientQt;
class FrameLoaderClientQt;
class InspectorClientQt;
+ class InspectorServerRequestHandlerQt;
class InspectorFrontendClientQt;
class NotificationPresenterClientQt;
class GeolocationPermissionClientQt;
@@ -216,13 +217,13 @@ public:
QWebPage::ViewportConfiguration& operator=(const QWebPage::ViewportConfiguration& other);
- inline qreal initialScaleFactor() const { return m_initialScaleFactor; };
- inline qreal minimumScaleFactor() const { return m_minimumScaleFactor; };
- inline qreal maximumScaleFactor() const { return m_maximumScaleFactor; };
- inline qreal devicePixelRatio() const { return m_devicePixelRatio; };
- inline bool isUserScalable() const { return m_isUserScalable; };
- inline bool isValid() const { return m_isValid; };
- inline QSize size() const { return m_size; };
+ inline qreal initialScaleFactor() const { return m_initialScaleFactor; }
+ inline qreal minimumScaleFactor() const { return m_minimumScaleFactor; }
+ inline qreal maximumScaleFactor() const { return m_maximumScaleFactor; }
+ inline qreal devicePixelRatio() const { return m_devicePixelRatio; }
+ inline bool isUserScalable() const { return m_isUserScalable; }
+ inline bool isValid() const { return m_isValid; }
+ inline QSize size() const { return m_size; }
private:
QSharedDataPointer<QtViewportConfigurationPrivate> d;
@@ -275,7 +276,7 @@ public:
QSize viewportSize() const;
void setViewportSize(const QSize &size) const;
- ViewportConfiguration viewportConfigurationForSize(QSize availableSize) const;
+ ViewportConfiguration viewportConfigurationForSize(const QSize& availableSize) const;
QSize preferredContentsSize() const;
void setPreferredContentsSize(const QSize &size) const;
@@ -425,6 +426,7 @@ private:
friend class WebCore::EditorClientQt;
friend class WebCore::FrameLoaderClientQt;
friend class WebCore::InspectorClientQt;
+ friend class WebCore::InspectorServerRequestHandlerQt;
friend class WebCore::InspectorFrontendClientQt;
friend class WebCore::NotificationPresenterClientQt;
friend class WebCore::GeolocationPermissionClientQt;
diff --git a/WebKit/qt/Api/qwebpage_p.h b/WebKit/qt/Api/qwebpage_p.h
index 82f5365..12716f9 100644
--- a/WebKit/qt/Api/qwebpage_p.h
+++ b/WebKit/qt/Api/qwebpage_p.h
@@ -131,38 +131,29 @@ public:
void handleSoftwareInputPanel(Qt::MouseButton);
bool handleScrolling(QKeyEvent*, WebCore::Frame*);
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
// Returns whether the default action was cancelled in the JS event handler
bool touchEvent(QTouchEvent*);
-#endif
void setInspector(QWebInspector*);
QWebInspector* getOrCreateInspector();
WebCore::InspectorController* inspectorController();
+ quint16 inspectorServerPort();
#ifndef QT_NO_SHORTCUT
static QWebPage::WebAction editorActionForKeyEvent(QKeyEvent* event);
#endif
static const char* editorCommandForWebActions(QWebPage::WebAction action);
- WebCore::ChromeClientQt *chromeClient;
- WebCore::ContextMenuClientQt *contextMenuClient;
- WebCore::EditorClientQt *editorClient;
+ QWebPage *q;
WebCore::Page *page;
-
+ QWebPageClient* client;
QPointer<QWebFrame> mainFrame;
- QWebPage *q;
- QWebPageClient* client;
#ifndef QT_NO_UNDOSTACK
QUndoStack *undoStack;
#endif
-#if QT_VERSION >= 0x040600
QWeakPointer<QWidget> view;
-#else
- QWidget* view;
-#endif
bool insideOpenCall;
quint64 m_totalBytes;
diff --git a/WebKit/qt/Api/qwebsettings.cpp b/WebKit/qt/Api/qwebsettings.cpp
index b71de25..6b36522 100644
--- a/WebKit/qt/Api/qwebsettings.cpp
+++ b/WebKit/qt/Api/qwebsettings.cpp
@@ -174,6 +174,11 @@ void QWebSettingsPrivate::apply()
settings->setWebGLEnabled(value);
#endif
+
+ value = attributes.value(QWebSettings::HyperlinkAuditingEnabled,
+ global->attributes.value(QWebSettings::HyperlinkAuditingEnabled));
+
+ settings->setHyperlinkAuditingEnabled(value);
value = attributes.value(QWebSettings::JavascriptCanOpenWindows,
global->attributes.value(QWebSettings::JavascriptCanOpenWindows));
@@ -495,6 +500,7 @@ QWebSettings::QWebSettings()
d->attributes.insert(QWebSettings::LocalContentCanAccessFileUrls, true);
d->attributes.insert(QWebSettings::AcceleratedCompositingEnabled, true);
d->attributes.insert(QWebSettings::WebGLEnabled, false);
+ d->attributes.insert(QWebSettings::HyperlinkAuditingEnabled, false);
d->attributes.insert(QWebSettings::TiledBackingStoreEnabled, false);
d->attributes.insert(QWebSettings::FrameFlatteningEnabled, false);
d->attributes.insert(QWebSettings::SiteSpecificQuirksEnabled, true);
diff --git a/WebKit/qt/Api/qwebsettings.h b/WebKit/qt/Api/qwebsettings.h
index 8967e7c..d5e0ef6 100644
--- a/WebKit/qt/Api/qwebsettings.h
+++ b/WebKit/qt/Api/qwebsettings.h
@@ -75,7 +75,8 @@ public:
TiledBackingStoreEnabled,
FrameFlatteningEnabled,
SiteSpecificQuirksEnabled,
- WebGLEnabled
+ WebGLEnabled,
+ HyperlinkAuditingEnabled
};
enum WebGraphic {
MissingImageGraphic,
diff --git a/WebKit/qt/Api/qwebview.cpp b/WebKit/qt/Api/qwebview.cpp
index 1f400cb..64b7a90 100644
--- a/WebKit/qt/Api/qwebview.cpp
+++ b/WebKit/qt/Api/qwebview.cpp
@@ -307,9 +307,7 @@ QWebView::QWebView(QWidget *parent)
setAttribute(Qt::WA_InputMethodEnabled);
#endif
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
setAttribute(Qt::WA_AcceptTouchEvents);
-#endif
#if defined(Q_WS_MAEMO_5)
QAbstractKineticScroller* scroller = new QWebViewKineticScroller();
static_cast<QWebViewKineticScroller*>(scroller)->setWidget(this);
@@ -348,13 +346,7 @@ void QWebViewPrivate::detachCurrentPage()
if (!page)
return;
- if (page) {
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
- page->d->view.clear();
-#else
- page->d->view = 0;
-#endif
- }
+ page->d->view.clear();
// if the page client is the special client constructed for
// delegating the responsibilities to a QWidget, we need
@@ -828,7 +820,6 @@ bool QWebView::event(QEvent *e)
if (cursor().shape() == Qt::ArrowCursor)
d->page->d->client->resetCursor();
#endif
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
} else if (e->type() == QEvent::TouchBegin
|| e->type() == QEvent::TouchEnd
|| e->type() == QEvent::TouchUpdate) {
@@ -836,7 +827,6 @@ bool QWebView::event(QEvent *e)
// Always return true so that we'll receive also TouchUpdate and TouchEnd events
return true;
-#endif
} else if (e->type() == QEvent::Leave)
d->page->event(e);
}
diff --git a/WebKit/qt/ChangeLog b/WebKit/qt/ChangeLog
index 34edbd7..7a2c064 100644
--- a/WebKit/qt/ChangeLog
+++ b/WebKit/qt/ChangeLog
@@ -1,3 +1,354 @@
+2010-09-28 Jenn Braithwaite <jennb@chromium.org>
+
+ Reviewed by Dmitry Titov.
+
+ Added oldPage param to FrameLoaderClient::didTransferChildFrameToNewDocument.
+ https://bugs.webkit.org/show_bug.cgi?id=46663
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::didTransferChildFrameToNewDocument):
+ * WebCoreSupport/FrameLoaderClientQt.h:
+
+2010-09-28 Andreas Kling <andreas.kling@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Clean up QWebPage::ViewportConfiguration API
+ https://bugs.webkit.org/show_bug.cgi?id=46730
+
+ - Pass QSize parameter as const-reference
+ - Style fixes
+
+ * Api/qwebpage.cpp:
+ (QWebPage::viewportConfigurationForSize):
+ * Api/qwebpage.h:
+
+2010-09-28 Andras Becsi <abecsi@webkit.org>
+
+ Reviewed by Csaba Osztrogonác.
+
+ Undefined reference errors when linking due to gperf and inlining.
+ webkit.org/b/29244
+
+ EFL CMake changes by Leandro Pereira <leandro@profusion.mobi>
+
+ Refactor gperf code generation and usage to fix the debug build with gcc>4.4.
+ Hitherto gperf generated C code, these files were included in multiple C++ files across WebCore
+ to access the functionality provided. This resulted in debug build failure with newer gcc versions
+ because of a behaviour change of gcc, which disables C style inlining in debug mode.
+ The make-hash-tools.pl script lets gperf generate C++ code for all gperf files now, which are compiled
+ in their own compilation unit.
+ The functionality provided by the generated code is wrapped behind HashTools.h, so there is no need
+ for multiple inclusions of generated C files to access these functions.
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::createPlugin):
+
+2010-09-28 Benjamin Poulain <benjamin.poulain@nokia.com>
+
+ Reviewed by Andreas Kling.
+
+ [Qt] Remove support for Qt 4.5
+ https://bugs.webkit.org/show_bug.cgi?id=46718
+
+ Remove the code for versions of Qt prior to 4.6.
+
+ * Api/qgraphicswebview.cpp:
+ (QGraphicsWebViewPrivate::updateResizesToContentsForPage):
+ (QGraphicsWebView::QGraphicsWebView):
+ (QGraphicsWebView::sceneEvent):
+ (QGraphicsWebViewPrivate::detachCurrentPage):
+ * Api/qwebframe.cpp:
+ (QWebFrame::load):
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::QWebPagePrivate):
+ (QWebPagePrivate::handleSoftwareInputPanel):
+ (QWebPagePrivate::inputMethodEvent):
+ (QWebPagePrivate::touchEvent):
+ (QWebPage::inputMethodQuery):
+ (QWebPage::view):
+ (QWebPage::event):
+ * Api/qwebpage_p.h:
+ * Api/qwebview.cpp:
+ (QWebView::QWebView):
+ (QWebViewPrivate::detachCurrentPage):
+ (QWebView::event):
+ * WebCoreSupport/EditorClientQt.cpp:
+ (WebCore::EditorClientQt::setInputMethodState):
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::createPlugin):
+ * WebCoreSupport/PageClientQt.cpp:
+ (WebCore::PageClientQWidget::setInputMethodHints):
+ (WebCore::PageClientQGraphicsWidget::setInputMethodEnabled):
+ (WebCore::PageClientQGraphicsWidget::inputMethodEnabled):
+ (WebCore::PageClientQGraphicsWidget::setInputMethodHints):
+ * WebCoreSupport/PageClientQt.h:
+ (WebCore::QGraphicsItemOverlay::page):
+ * tests/qwebframe/tst_qwebframe.cpp:
+ * tests/qwebpage/tst_qwebpage.cpp:
+ (tst_QWebPage::inputMethods_data):
+ (inputMethodHints):
+ (inputMethodEnabled):
+ (tst_QWebPage::inputMethods):
+ (tst_QWebPage::originatingObjectInNetworkRequests):
+ * tests/qwebview/tst_qwebview.cpp:
+ (tst_QWebView::reusePage):
+
+2010-09-28 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ Clean up QWebPage initialization
+
+ * Api/qwebpage.cpp:
+ * Api/qwebpage_p.h:
+
+2010-09-28 Benjamin Poulain <benjamin.poulain@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] tst_QWebPage::testStopScheduledPageRefresh() fails on MeeGo handset
+ https://bugs.webkit.org/show_bug.cgi?id=46706
+
+ The test require the network to succeed or fail in order to work.
+ On MeeGo, the network can simply timeout the because of the netword access
+ management. This patch makes the test use local URLs to avoid the
+ problem.
+
+ * tests/qwebpage/tst_qwebpage.cpp:
+ (TestNetworkManager::TestNetworkManager):
+
+2010-09-27 Kenneth Rohde Christiansen <kenneth.christiansen@openbossa.org>
+
+ Reviewed by Antonio Gomes.
+
+ [Qt] Remove setDeviceSize methods
+ https://bugs.webkit.org/show_bug.cgi?id=46347
+
+ Remove our setDeviceHeight() API and obtain it automatically from the
+ system. Also for testing purposes, make it possible to override the
+ values via two newly introduced environment variables.
+
+ * Api/qgraphicswebview.cpp:
+ * Api/qgraphicswebview.h:
+ * Api/qwebpage.cpp:
+ (getintenv):
+ (queryDeviceSizeForScreenContainingWidget):
+ (QWebPage::viewportConfigurationForSize):
+ * WebCoreSupport/PageClientQt.cpp:
+ (WebCore::PageClientQGraphicsWidget::windowRect):
+ * symbian/eabi/QtWebKitu.def:
+
+2010-09-27 Girish Ramakrishnan <girish@forwardbias.in>
+
+ Reviewed by Antonio Gomes.
+
+ Enable local rendering of NPAPI plugins on Maemo6.
+
+ https://bugs.webkit.org/show_bug.cgi?id=46618
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::createPlugin):
+
+2010-09-27 Benjamin Poulain <benjamin.poulain@nokia.com>
+
+ Reviewed by Andreas Kling.
+
+ [Qt] tst_QWebFrame::popupFocus() randomly fail on MeeGo handset because the focus is not set on the window
+ https://bugs.webkit.org/show_bug.cgi?id=46617
+
+ This patch avoid the race condition by waiting for the window
+ to be mapped on screen before attempting any actions.
+
+ * tests/qwebframe/tst_qwebframe.cpp:
+
+2010-09-24 Luiz Agostini <luiz.agostini@openbossa.org>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Keep viewport information in Document
+ https://bugs.webkit.org/show_bug.cgi?id=46385
+
+ The viewport meta data (layout viewport, scale) needs to be set again when bringing
+ back a page from the page cache. As the viewport metadata is only retrieved while parsing
+ the document, we need to store it in the Document class.
+
+ * Api/qwebframe.cpp:
+ (QWebFramePrivate::viewportArguments):
+ * Api/qwebframe_p.h:
+ * Api/qwebpage.cpp:
+ (QWebPage::viewportConfigurationForSize):
+ * WebCoreSupport/ChromeClientQt.cpp:
+ (WebCore::ChromeClientQt::didReceiveViewportArguments):
+ * WebCoreSupport/DumpRenderTreeSupportQt.cpp:
+ (DumpRenderTreeSupportQt::viewportAsText):
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::dispatchDidCommitLoad):
+
+2010-09-23 Ademar de Souza Reis Jr <ademar.reis@openbossa.org>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Fix QWebHapticFeedbackPlayer exposure via QWebKitPlatformPlugin
+
+ [Qt] QWebHapticFeedbackPlayer needs correct exposure through QWebKitPlatformPlugin
+ https://bugs.webkit.org/show_bug.cgi?id=46402
+
+ QWebHapticFeedbackPlayer is exported through
+ QWebKitPlatformPlugin::createExtension(), but
+ createHapticFeedbackPlayer() and the correct
+ inheritage are missing.
+
+ * Api/qwebkitplatformplugin.h:
+ * WebCoreSupport/QtPlatformPlugin.cpp:
+ (WebCore::QtPlatformPlugin::createHapticFeedbackPlayer):
+ * WebCoreSupport/QtPlatformPlugin.h:
+
+2010-09-23 Nate Chapin <japhet@chromium.org>
+
+ Reviewed by Darin Fisher.
+
+ Add hyperlink auditing settings (i.e., <a ping>).
+ https://bugs.webkit.org/show_bug.cgi?id=30458
+
+ * Api/qwebsettings.cpp:
+ (QWebSettingsPrivate::apply):
+ (QWebSettings::QWebSettings):
+ * Api/qwebsettings.h:
+
+
+2010-09-23 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Refactor QtWebKitPlatformPlugin interface
+
+ Make it easier to keep source-compability for the
+ QtWebKitPlatformPlugin interface, and run qmake
+ on the example (but not build) for convenience.
+
+ https://bugs.webkit.org/show_bug.cgi?id=46345
+
+ * Api/qwebkitplatformplugin.h:
+ * WebCoreSupport/QtPlatformPlugin.cpp:
+ * examples/platformplugin/README:
+ * examples/platformplugin/WebPlugin.cpp:
+ * examples/platformplugin/WebPlugin.h:
+ * examples/platformplugin/qwebkitplatformplugin.h:
+
+2010-09-22 Andras Becsi <abecsi@webkit.org>
+
+ Speculative build fix for the Qt Windows bots.
+
+ * Api/DerivedSources.pro:
+
+2010-09-22 Jamey Hicks <jamey.hicks@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Web Inspector: Remote Web Inspector support for QtWebKit
+ https://bugs.webkit.org/show_bug.cgi?id=43988
+
+ Runs a web debug server on port specified by QtTestBrowser
+ argument -remote-inspector-port. Property
+ _q_webInspectorServerPort of the QWebPage instance will be set
+ according to the argument. All pages with that property set will
+ be remotely inspectable.
+
+ URL for remote inspection of first QWebPage is
+ http://localhost:9222/webkit/inspector/inspector.html?page=1
+ where 1 is the number of the QWebPage instance.
+
+ The base URL yields an index page with links to the individual inspectors:
+ http://localhost:9222/
+
+ * Api/qwebinspector.cpp:
+ (QWebInspectorPrivate::attachAndReplaceRemoteFrontend):
+ (QWebInspectorPrivate::detachRemoteFrontend):
+ * Api/qwebinspector_p.h:
+ (QWebInspectorPrivate::QWebInspectorPrivate):
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::dynamicPropertyChangeEvent):
+ (QWebPagePrivate::inspectorServerPort):
+ * Api/qwebpage.h:
+ * Api/qwebpage_p.h:
+ * WebCoreSupport/InspectorClientQt.cpp:
+ (WebCore::InspectorClientQt::InspectorClientQt):
+ (WebCore::InspectorClientQt::inspectorDestroyed):
+ (WebCore::InspectorClientQt::openInspectorFrontend):
+ (WebCore::InspectorClientQt::attachAndReplaceRemoteFrontend):
+ (WebCore::InspectorClientQt::detachRemoteFrontend):
+ (WebCore::InspectorClientQt::sendMessageToFrontend):
+ * WebCoreSupport/InspectorClientQt.h:
+ * WebCoreSupport/InspectorServerQt.cpp: Added.
+ (WebCore::generateWebSocketChallengeResponse):
+ (WebCore::parseWebSocketChallengeNumber):
+ (WebCore::InspectorServerQt::server):
+ (WebCore::InspectorServerQt::InspectorServerQt):
+ (WebCore::InspectorServerQt::~InspectorServerQt):
+ (WebCore::InspectorServerQt::listen):
+ (WebCore::InspectorServerQt::close):
+ (WebCore::InspectorServerQt::inspectorClientForPage):
+ (WebCore::InspectorServerQt::registerClient):
+ (WebCore::InspectorServerQt::unregisterClient):
+ (WebCore::InspectorServerQt::newConnection):
+ (WebCore::InspectorServerRequestHandlerQt::InspectorServerRequestHandlerQt):
+ (WebCore::InspectorServerRequestHandlerQt::~InspectorServerRequestHandlerQt):
+ (WebCore::InspectorServerRequestHandlerQt::tcpReadyRead):
+ (WebCore::InspectorServerRequestHandlerQt::tcpConnectionDisconnected):
+ (WebCore::InspectorServerRequestHandlerQt::webSocketSend):
+ (WebCore::InspectorServerRequestHandlerQt::webSocketReadyRead):
+ (WebCore::RemoteFrontendChannel::RemoteFrontendChannel):
+ (WebCore::RemoteFrontendChannel::sendMessageToFrontend):
+ * WebCoreSupport/InspectorServerQt.h: Added.
+
+2010-09-22 Balazs Kelemen <kb@inf.u-szeged.hu>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] PluginStrategy implementation is broken
+ https://bugs.webkit.org/show_bug.cgi?id=46078
+
+ Remove the QWebPage* member from WebPlatformStrategies.
+ Get the originator QWebPage of the getPluginInfo call via
+ the Page* argument.
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::QWebPagePrivate):
+ * WebCoreSupport/WebPlatformStrategies.cpp:
+ (WebPlatformStrategies::initialize):
+ (WebPlatformStrategies::WebPlatformStrategies):
+ (WebPlatformStrategies::getPluginInfo):
+ Use the ChromeClient for accessing the originator QWebPage.
+ * WebCoreSupport/WebPlatformStrategies.h:
+
+2010-09-22 İsmail Dönmez <ismail@namtrac.org>
+
+ Reviewed by Andreas Kling.
+
+ [Qt] Buildfix for WinCE
+
+ * Api/DerivedSources.pro:
+
+2010-09-20 Philippe Normand <pnormand@igalia.com>
+
+ Reviewed by Eric Carlson.
+
+ [GTK] enhanced context menu for media elements
+ https://bugs.webkit.org/show_bug.cgi?id=45021
+
+ * WebCoreSupport/WebPlatformStrategies.cpp:
+ * WebCoreSupport/WebPlatformStrategies.h:
+ (WebPlatformStrategies::contextMenuItemTagOpenVideoInNewWindow):
+ (WebPlatformStrategies::contextMenuItemTagOpenAudioInNewWindow):
+ (WebPlatformStrategies::contextMenuItemTagCopyVideoLinkToClipboard):
+ (WebPlatformStrategies::contextMenuItemTagCopyAudioLinkToClipboard):
+ (WebPlatformStrategies::contextMenuItemTagToggleMediaControls)
+ (WebPlatformStrategies::contextMenuItemTagToggleMediaLoop)
+ (WebPlatformStrategies::contextMenuItemTagEnterVideoFullscreen)
+ (WebPlatformStrategies::contextMenuItemTagMediaPlay)
+ (WebPlatformStrategies::contextMenuItemTagMediaPause)
+ (WebPlatformStrategies::contextMenuItemTagMediaMute)
+
2010-09-20 Jacob Dinu <dinu.jacob@nokia.com>
Reviewed by Adam Barth.
diff --git a/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp b/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp
index a5dfdc7..9fbc5e5 100644
--- a/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp
+++ b/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp
@@ -644,8 +644,6 @@ QWebSelectMethod* ChromeClientQt::createSelectPopup() const
void ChromeClientQt::didReceiveViewportArguments(Frame* frame, const ViewportArguments& arguments) const
{
- m_webPage->mainFrame()->d->viewportArguments = arguments;
-
emit m_webPage->viewportChangeRequested();
}
diff --git a/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp b/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp
index ed7ac32..836df49 100644
--- a/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp
+++ b/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp
@@ -631,7 +631,7 @@ void DumpRenderTreeSupportQt::dumpNotification(bool b)
QString DumpRenderTreeSupportQt::viewportAsText(QWebPage* page, const QSize& availableSize)
{
- WebCore::ViewportArguments args = page->mainFrame()->d->viewportArguments;
+ WebCore::ViewportArguments args = page->mainFrame()->d->viewportArguments();
WebCore::ViewportConfiguration conf = WebCore::findConfigurationForViewportData(args,
/* desktop-width */ 980,
/* device-width */ 320,
diff --git a/WebKit/qt/WebCoreSupport/EditorClientQt.cpp b/WebKit/qt/WebCoreSupport/EditorClientQt.cpp
index 080c459..9db4333 100644
--- a/WebKit/qt/WebCoreSupport/EditorClientQt.cpp
+++ b/WebKit/qt/WebCoreSupport/EditorClientQt.cpp
@@ -595,7 +595,6 @@ void EditorClientQt::setInputMethodState(bool active)
{
QWebPageClient* webPageClient = m_page->d->client;
if (webPageClient) {
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
Qt::InputMethodHints hints;
HTMLInputElement* inputElement = 0;
@@ -628,8 +627,7 @@ void EditorClientQt::setInputMethodState(bool active)
hints |= Qt::ImhNoAutoUppercase;
hints |= Qt::ImhNoPredictiveText;
#endif // Q_WS_MAEMO_5 || Q_WS_MAEMO_6 || Q_OS_SYMBIAN
- webPageClient->setInputMethodHints(hints);
-#endif // QT_VERSION check
+ webPageClient->setInputMethodHints(hints);
webPageClient->setInputMethodEnabled(active);
}
emit m_page->microFocusChanged();
diff --git a/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp b/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
index 4aadeb0..41bcb3c 100644
--- a/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
+++ b/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
@@ -442,9 +442,6 @@ void FrameLoaderClientQt::dispatchDidCommitLoad()
if (m_frame->tree()->parent() || !m_webFrame)
return;
- // Clear the viewport arguments.
- m_webFrame->d->viewportArguments = WebCore::ViewportArguments();
-
emit m_webFrame->urlChanged(m_webFrame->url());
m_webFrame->page()->d->updateNavigationActions();
@@ -1248,7 +1245,7 @@ PassRefPtr<Frame> FrameLoaderClientQt::createFrame(const KURL& url, const String
return frameData.frame.release();
}
-void FrameLoaderClientQt::didTransferChildFrameToNewDocument()
+void FrameLoaderClientQt::didTransferChildFrameToNewDocument(Page*)
{
ASSERT(m_frame->ownerElement());
@@ -1370,7 +1367,6 @@ private:
}
};
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
class QtPluginGraphicsWidget: public Widget
{
public:
@@ -1415,7 +1411,6 @@ private:
QGraphicsWidget* graphicsWidget;
};
-#endif
PassRefPtr<Widget> FrameLoaderClientQt::createPlugin(const IntSize& pluginSize, HTMLPlugInElement* element, const KURL& url, const Vector<String>& paramNames,
const Vector<String>& paramValues, const String& mimeType, bool loadManually)
@@ -1456,7 +1451,7 @@ PassRefPtr<Widget> FrameLoaderClientQt::createPlugin(const IntSize& pluginSize,
for (unsigned i = 0; i < numqStyleSheetProperties; ++i) {
CSSPropertyID property = qstyleSheetProperties[i];
- styleSheet += QString::fromLatin1(::getPropertyName(property));
+ styleSheet += QString::fromLatin1(getPropertyName(property));
styleSheet += QLatin1Char(':');
styleSheet += computedStyle(element)->getPropertyValue(property);
styleSheet += QLatin1Char(';');
@@ -1488,7 +1483,7 @@ PassRefPtr<Widget> FrameLoaderClientQt::createPlugin(const IntSize& pluginSize,
w->setFrameRect(IntRect(0, 0, 0, 0));
return w;
}
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
+
QGraphicsWidget* graphicsWidget = qobject_cast<QGraphicsWidget*>(object);
if (graphicsWidget) {
QGraphicsObject* parentWidget = 0;
@@ -1502,7 +1497,7 @@ PassRefPtr<Widget> FrameLoaderClientQt::createPlugin(const IntSize& pluginSize,
w->setFrameRect(IntRect(0, 0, 0, 0));
return w;
}
-#endif
+
// FIXME: make things work for widgetless plugins as well
delete object;
}
@@ -1513,7 +1508,7 @@ PassRefPtr<Widget> FrameLoaderClientQt::createPlugin(const IntSize& pluginSize,
if (mimeType == "application/x-shockwave-flash") {
QWebPageClient* client = m_webFrame->page()->d->client;
const bool isQWebView = client && qobject_cast<QWidget*>(client->pluginParent());
-#if defined(MOZ_PLATFORM_MAEMO) && (MOZ_PLATFORM_MAEMO == 5)
+#if defined(MOZ_PLATFORM_MAEMO) && (MOZ_PLATFORM_MAEMO >= 5)
size_t wmodeIndex = params.find("wmode");
if (wmodeIndex == -1) {
// Disable XEmbed mode and force it to opaque mode
diff --git a/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h b/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h
index fffda58..ec6a3b6 100644
--- a/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h
+++ b/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h
@@ -198,7 +198,7 @@ public:
virtual PassRefPtr<Frame> createFrame(const KURL& url, const String& name, HTMLFrameOwnerElement* ownerElement,
const String& referrer, bool allowsScrolling, int marginWidth, int marginHeight);
- virtual void didTransferChildFrameToNewDocument();
+ virtual void didTransferChildFrameToNewDocument(WebCore::Page*);
virtual PassRefPtr<Widget> createPlugin(const IntSize&, HTMLPlugInElement*, const KURL&, const Vector<String>&, const Vector<String>&, const String&, bool);
virtual void redirectDataToPlugin(Widget* pluginWidget);
diff --git a/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp b/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp
index e6e6fde..b6673e6 100644
--- a/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp
+++ b/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp
@@ -32,7 +32,10 @@
#include "InspectorClientQt.h"
#include "Frame.h"
+#include "InspectorBackendDispatcher.h"
#include "InspectorController.h"
+#include "InspectorFrontend.h"
+#include "InspectorServerQt.h"
#include "NotImplemented.h"
#include "Page.h"
#include "PlatformString.h"
@@ -115,17 +118,26 @@ InspectorClientQt::InspectorClientQt(QWebPage* page)
: m_inspectedWebPage(page)
, m_frontendWebPage(0)
, m_frontendClient(0)
-{}
+{
+ InspectorServerQt* webInspectorServer = InspectorServerQt::server();
+ if (webInspectorServer)
+ webInspectorServer->registerClient(this);
+}
void InspectorClientQt::inspectorDestroyed()
{
if (m_frontendClient)
m_frontendClient->inspectorClientDestroyed();
+
+ InspectorServerQt* webInspectorServer = InspectorServerQt::server();
+ if (webInspectorServer)
+ webInspectorServer->unregisterClient(this);
+
delete this;
}
-void InspectorClientQt::openInspectorFrontend(WebCore::InspectorController*)
+void InspectorClientQt::openInspectorFrontend(WebCore::InspectorController* inspectorController)
{
#if USE(V8)
ensureDebuggerScriptLoaded();
@@ -136,6 +148,10 @@ void InspectorClientQt::openInspectorFrontend(WebCore::InspectorController*)
inspectorView->setPage(inspectorPage);
QWebInspector* inspector = m_inspectedWebPage->d->getOrCreateInspector();
+ // Remote frontend was attached.
+ if (m_inspectedWebPage->d->inspector->d->remoteFrontend)
+ return;
+
// This is a known hook that allows changing the default URL for the
// Web inspector. This is used for SDK purposes. Please keep this hook
// around and don't remove it.
@@ -167,6 +183,23 @@ void InspectorClientQt::releaseFrontendPage()
m_frontendClient = 0;
}
+void InspectorClientQt::attachAndReplaceRemoteFrontend(RemoteFrontendChannel* channel)
+{
+#if ENABLE(INSPECTOR)
+ // Channel was allocated by InspectorServerQt. Here we transfer ownership to inspector.
+ m_inspectedWebPage->d->inspector->d->attachAndReplaceRemoteFrontend(channel);
+ m_inspectedWebPage->d->inspectorController()->connectFrontend();
+#endif
+}
+
+void InspectorClientQt::detachRemoteFrontend()
+{
+#if ENABLE(INSPECTOR)
+ m_inspectedWebPage->d->inspector->d->detachRemoteFrontend();
+ m_inspectedWebPage->d->inspectorController()->disconnectFrontend();
+#endif
+}
+
void InspectorClientQt::highlight(Node*)
{
notImplemented();
@@ -223,6 +256,12 @@ void InspectorClientQt::storeSetting(const String& key, const String& setting)
bool InspectorClientQt::sendMessageToFrontend(const String& message)
{
+ if (m_inspectedWebPage->d->inspector->d->remoteFrontend) {
+ RemoteFrontendChannel* session = qobject_cast<RemoteFrontendChannel*>(m_inspectedWebPage->d->inspector->d->remoteFrontend);
+ if (session)
+ session->sendMessageToFrontend(message);
+ return true;
+ }
if (!m_frontendWebPage)
return false;
diff --git a/WebKit/qt/WebCoreSupport/InspectorClientQt.h b/WebKit/qt/WebCoreSupport/InspectorClientQt.h
index 0074159..64a2d0c 100644
--- a/WebKit/qt/WebCoreSupport/InspectorClientQt.h
+++ b/WebKit/qt/WebCoreSupport/InspectorClientQt.h
@@ -42,8 +42,10 @@ class QWebView;
namespace WebCore {
class InspectorFrontendClientQt;
+class InspectorServerRequestHandlerQt;
class Node;
class Page;
+class RemoteFrontendChannel;
class InspectorClientQt : public InspectorClient {
public:
@@ -63,10 +65,16 @@ public:
void releaseFrontendPage();
+ void attachAndReplaceRemoteFrontend(RemoteFrontendChannel *channel);
+ void detachRemoteFrontend();
+
private:
QWebPage* m_inspectedWebPage;
QWebPage* m_frontendWebPage;
InspectorFrontendClientQt* m_frontendClient;
+ bool m_remoteInspector;
+
+ friend class InspectorServerRequestHandlerQt;
};
class InspectorFrontendClientQt : public InspectorFrontendClientLocal {
diff --git a/WebKit/qt/WebCoreSupport/InspectorServerQt.cpp b/WebKit/qt/WebCoreSupport/InspectorServerQt.cpp
new file mode 100644
index 0000000..fad7247
--- /dev/null
+++ b/WebKit/qt/WebCoreSupport/InspectorServerQt.cpp
@@ -0,0 +1,386 @@
+/*
+ Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "config.h"
+#include "InspectorServerQt.h"
+
+#include "InspectorBackendDispatcher.h"
+#include "InspectorClientQt.h"
+#include "MD5.h"
+#include "Page.h"
+#include "qwebpage.h"
+#include "qwebpage_p.h"
+#include <QFile>
+#include <QHttpHeader>
+#include <QHttpRequestHeader>
+#include <QHttpResponseHeader>
+#include <QString>
+#include <QStringList>
+#include <QTcpServer>
+#include <QTcpSocket>
+#include <QUrl>
+#include <QWidget>
+#include <qendian.h>
+
+namespace WebCore {
+
+/*!
+ Computes the WebSocket handshake response given the two challenge numbers and key3.
+ */
+static void generateWebSocketChallengeResponse(uint32_t number1, uint32_t number2, const unsigned char key3[8], unsigned char response[16])
+{
+ uint8_t challenge[16];
+ qToBigEndian<qint32>(number1, &challenge[0]);
+ qToBigEndian<qint32>(number2, &challenge[4]);
+ memcpy(&challenge[8], key3, 8);
+ MD5 md5;
+ md5.addBytes(challenge, sizeof(challenge));
+ Vector<uint8_t, 16> digest;
+ md5.checksum(digest);
+ memcpy(response, digest.data(), 16);
+}
+
+/*!
+ Parses and returns a WebSocket challenge number according to the
+ method specified in the WebSocket protocol.
+
+ The field contains numeric digits interspersed with spaces and
+ non-numeric digits. The protocol ignores the characters that are
+ neither digits nor spaces. The digits are concatenated and
+ interpreted as a long int. The result is this number divided by
+ the number of spaces.
+ */
+static quint32 parseWebSocketChallengeNumber(QString field)
+{
+ QString nString;
+ int numSpaces = 0;
+ for (int i = 0; i < field.size(); i++) {
+ QChar c = field[i];
+ if (c == (QChar)' ') {
+ numSpaces++;
+ } else if ((c >= (QChar)'0') && (c <= (QChar)'9')) {
+ nString.append((QChar)c);
+ }
+ }
+ quint32 num = nString.toLong();
+ quint32 result = (numSpaces ? (num / numSpaces) : num);
+ return result;
+}
+
+static InspectorServerQt* s_inspectorServer;
+
+InspectorServerQt* InspectorServerQt::server()
+{
+ // s_inspectorServer is deleted in unregisterClient() when the last client is unregistered.
+ if (!s_inspectorServer)
+ s_inspectorServer = new InspectorServerQt();
+
+ return s_inspectorServer;
+}
+
+InspectorServerQt::InspectorServerQt()
+ : QObject()
+ , m_tcpServer(0)
+ , m_pageNumber(1)
+{
+}
+
+InspectorServerQt::~InspectorServerQt()
+{
+ close();
+}
+
+void InspectorServerQt::listen(quint16 port)
+{
+ if (m_tcpServer)
+ return;
+
+ m_tcpServer = new QTcpServer();
+ m_tcpServer->listen(QHostAddress::Any, port);
+ connect(m_tcpServer, SIGNAL(newConnection()), SLOT(newConnection()));
+}
+
+void InspectorServerQt::close()
+{
+ if (m_tcpServer) {
+ m_tcpServer->close();
+ delete m_tcpServer;
+ }
+ m_tcpServer = 0;
+}
+
+InspectorClientQt* InspectorServerQt::inspectorClientForPage(int pageNum)
+{
+ InspectorClientQt* client = m_inspectorClients.value(pageNum);
+ return client;
+}
+
+void InspectorServerQt::registerClient(InspectorClientQt* client)
+{
+ if (!m_inspectorClients.key(client))
+ m_inspectorClients.insert(m_pageNumber++, client);
+}
+
+void InspectorServerQt::unregisterClient(InspectorClientQt* client)
+{
+ int pageNum = m_inspectorClients.key(client, -1);
+ if (pageNum >= 0)
+ m_inspectorClients.remove(pageNum);
+ if (!m_inspectorClients.size()) {
+ // s_inspectorServer points to this.
+ s_inspectorServer = 0;
+ close();
+ deleteLater();
+ }
+}
+
+void InspectorServerQt::newConnection()
+{
+ QTcpSocket* tcpConnection = m_tcpServer->nextPendingConnection();
+ InspectorServerRequestHandlerQt* handler = new InspectorServerRequestHandlerQt(tcpConnection, this);
+ handler->setParent(this);
+}
+
+InspectorServerRequestHandlerQt::InspectorServerRequestHandlerQt(QTcpSocket* tcpConnection, InspectorServerQt* server)
+ : QObject(server)
+ , m_tcpConnection(tcpConnection)
+ , m_server(server)
+ , m_inspectorClient(0)
+{
+ m_endOfHeaders = false;
+ m_contentLength = 0;
+
+ connect(m_tcpConnection, SIGNAL(readyRead()), SLOT(tcpReadyRead()));
+ connect(m_tcpConnection, SIGNAL(disconnected()), SLOT(tcpConnectionDisconnected()));
+}
+
+InspectorServerRequestHandlerQt::~InspectorServerRequestHandlerQt()
+{
+}
+
+void InspectorServerRequestHandlerQt::tcpReadyRead()
+{
+ QHttpRequestHeader header;
+ bool isWebSocket = false;
+ if (!m_tcpConnection)
+ return;
+
+ if (!m_endOfHeaders) {
+ while (m_tcpConnection->bytesAvailable() && !m_endOfHeaders) {
+ QByteArray line = m_tcpConnection->readLine();
+ m_data.append(line);
+ if (line == "\r\n")
+ m_endOfHeaders = true;
+ }
+ if (m_endOfHeaders) {
+ header = QHttpRequestHeader(QString::fromLatin1(m_data));
+ if (header.isValid()) {
+ m_path = header.path();
+ m_contentType = header.contentType().toLatin1();
+ m_contentLength = header.contentLength();
+ if (header.hasKey("Upgrade") && (header.value("Upgrade") == QLatin1String("WebSocket")))
+ isWebSocket = true;
+
+ m_data.clear();
+ }
+ }
+ }
+
+ if (m_endOfHeaders) {
+ QStringList pathAndQuery = m_path.split("?");
+ m_path = pathAndQuery[0];
+ QStringList words = m_path.split(QString::fromLatin1("/"));
+
+ if (isWebSocket) {
+ // switch to websocket-style WebSocketService messaging
+ if (m_tcpConnection) {
+ m_tcpConnection->disconnect(SIGNAL(readyRead()));
+ connect(m_tcpConnection, SIGNAL(readyRead()), SLOT(webSocketReadyRead()));
+
+ QByteArray key3 = m_tcpConnection->read(8);
+
+ quint32 number1 = parseWebSocketChallengeNumber(header.value("Sec-WebSocket-Key1"));
+ quint32 number2 = parseWebSocketChallengeNumber(header.value("Sec-WebSocket-Key2"));
+
+ char responseData[16];
+ generateWebSocketChallengeResponse(number1, number2, (unsigned char*)key3.data(), (unsigned char*)responseData);
+ QByteArray response(responseData, sizeof(responseData));
+
+ QHttpResponseHeader responseHeader(101, "WebSocket Protocol Handshake", 1, 1);
+ responseHeader.setValue("Upgrade", header.value("Upgrade"));
+ responseHeader.setValue("Connection", header.value("Connection"));
+ responseHeader.setValue("Sec-WebSocket-Origin", header.value("Origin"));
+ responseHeader.setValue("Sec-WebSocket-Location", ("ws://" + header.value("Host") + m_path));
+ responseHeader.setContentLength(response.size());
+ m_tcpConnection->write(responseHeader.toString().toLatin1());
+ m_tcpConnection->write(response);
+ m_tcpConnection->flush();
+
+ if ((words.size() == 4)
+ && (words[1] == QString::fromLatin1("devtools"))
+ && (words[2] == QString::fromLatin1("page"))) {
+ int pageNum = words[3].toInt();
+
+ m_inspectorClient = m_server->inspectorClientForPage(pageNum);
+ // Attach remoteFrontendChannel to inspector, also transferring ownership.
+ if (m_inspectorClient)
+ m_inspectorClient->attachAndReplaceRemoteFrontend(new RemoteFrontendChannel(this));
+ }
+
+ }
+
+ return;
+ }
+ if (m_contentLength && (m_tcpConnection->bytesAvailable() < m_contentLength))
+ return;
+
+ QByteArray content = m_tcpConnection->read(m_contentLength);
+ m_endOfHeaders = false;
+
+ QByteArray response;
+ int code = 200;
+ QString text = QString::fromLatin1("OK");
+
+ // If no path is specified, generate an index page.
+ if ((m_path == "") || (m_path == "/")) {
+ QString indexHtml = "<html><head><title>Remote Web Inspector</title></head><body><ul>\n";
+ for (QMap<int, InspectorClientQt* >::const_iterator it = m_server->m_inspectorClients.begin();
+ it != m_server->m_inspectorClients.end();
+ ++it) {
+ indexHtml.append(QString("<li><a href=\"/webkit/inspector/inspector.html?page=%1\">%2</li>\n")
+ .arg(it.key())
+ .arg(it.value()->m_inspectedWebPage->mainFrame()->url().toString()));
+ }
+ indexHtml.append("</ul></body></html>");
+ response = indexHtml.toLatin1();
+ } else {
+ QString path = QString(":%1").arg(m_path);
+ QFile file(path);
+ // It seems that there should be an enum or define for these status codes somewhere in Qt or WebKit,
+ // but grep fails to turn one up.
+ // QNetwork uses the numeric values directly.
+ if (file.exists()) {
+ file.open(QIODevice::ReadOnly);
+ response = file.readAll();
+ } else {
+ code = 404;
+ text = QString::fromLatin1("Not OK");
+ }
+ }
+
+ QHttpResponseHeader responseHeader(code, text, 1, 0);
+ responseHeader.setContentLength(response.size());
+ if (!m_contentType.isEmpty())
+ responseHeader.setContentType(QString::fromLatin1(m_contentType));
+
+ QByteArray asciiHeader = responseHeader.toString().toAscii();
+ m_tcpConnection->write(asciiHeader);
+
+ m_tcpConnection->write(response);
+ m_tcpConnection->flush();
+ m_tcpConnection->close();
+
+ return;
+ }
+}
+
+void InspectorServerRequestHandlerQt::tcpConnectionDisconnected()
+{
+ if (m_inspectorClient)
+ m_inspectorClient->detachRemoteFrontend();
+ m_tcpConnection->deleteLater();
+ m_tcpConnection = 0;
+}
+
+int InspectorServerRequestHandlerQt::webSocketSend(QByteArray payload)
+{
+ Q_ASSERT(m_tcpConnection);
+ m_tcpConnection->putChar(0x00);
+ int nBytes = m_tcpConnection->write(payload);
+ m_tcpConnection->putChar(0xFF);
+ m_tcpConnection->flush();
+ return nBytes;
+}
+
+int InspectorServerRequestHandlerQt::webSocketSend(const char* data, size_t length)
+{
+ Q_ASSERT(m_tcpConnection);
+ m_tcpConnection->putChar(0x00);
+ int nBytes = m_tcpConnection->write(data, length);
+ m_tcpConnection->putChar(0xFF);
+ m_tcpConnection->flush();
+ return nBytes;
+}
+
+void InspectorServerRequestHandlerQt::webSocketReadyRead()
+{
+ Q_ASSERT(m_tcpConnection);
+ if (!m_tcpConnection->bytesAvailable())
+ return;
+ QByteArray content = m_tcpConnection->read(m_tcpConnection->bytesAvailable());
+ m_data.append(content);
+ while (m_data.size() > 0) {
+ // first byte in websocket frame should be 0
+ Q_ASSERT(!m_data[0]);
+
+ // Start of WebSocket frame is indicated by 0
+ if (m_data[0]) {
+ qCritical() << "webSocketReadyRead: unknown frame type" << m_data[0];
+ m_data.clear();
+ m_tcpConnection->close();
+ return;
+ }
+
+ // End of WebSocket frame indicated by 0xff.
+ int pos = m_data.indexOf(0xff, 1);
+ if (pos < 1)
+ return;
+
+ // After above checks, length will be >= 0.
+ size_t length = pos - 1;
+ if (length <= 0)
+ return;
+
+ QByteArray payload = m_data.mid(1, length);
+
+ if (m_inspectorClient) {
+ InspectorController* inspectorController = m_inspectorClient->m_inspectedWebPage->d->page->inspectorController();
+ inspectorController->inspectorBackendDispatcher()->dispatch(QString::fromUtf8(payload));
+ }
+
+ // Remove this WebSocket message from m_data (payload, start-of-frame byte, end-of-frame byte).
+ m_data = m_data.mid(length + 2);
+ }
+}
+
+RemoteFrontendChannel::RemoteFrontendChannel(InspectorServerRequestHandlerQt* requestHandler)
+ : QObject(requestHandler)
+ , m_requestHandler(requestHandler)
+{
+}
+
+bool RemoteFrontendChannel::sendMessageToFrontend(const String& message)
+{
+ if (!m_requestHandler)
+ return false;
+ CString cstr = message.utf8();
+ return m_requestHandler->webSocketSend(cstr.data(), cstr.length());
+}
+
+}
diff --git a/WebKit/qt/WebCoreSupport/InspectorServerQt.h b/WebKit/qt/WebCoreSupport/InspectorServerQt.h
new file mode 100644
index 0000000..74e8c2f
--- /dev/null
+++ b/WebKit/qt/WebCoreSupport/InspectorServerQt.h
@@ -0,0 +1,110 @@
+/*
+ Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef InspectorServerQt_h
+#define InspectorServerQt_h
+
+#include <QList>
+#include <QMap>
+#include <QObject>
+#include <QPair>
+#include <QString>
+#include <wtf/Forward.h>
+
+class QTcpServer;
+class QTcpSocket;
+class QWebPage;
+
+namespace WebCore {
+class InspectorServerRequestHandlerQt;
+class InspectorClientQt;
+
+class InspectorServerQt : public QObject {
+ Q_OBJECT
+public:
+
+ static InspectorServerQt* server();
+
+ void listen(quint16 port);
+
+ void registerClient(InspectorClientQt* client);
+ void unregisterClient(InspectorClientQt* client);
+
+ void close();
+ InspectorClientQt* inspectorClientForPage(int pageNum);
+
+protected:
+ InspectorServerQt();
+ virtual ~InspectorServerQt();
+
+private slots:
+ void newConnection();
+
+private:
+ QTcpServer* m_tcpServer;
+ QMap<int, InspectorClientQt*> m_inspectorClients;
+ int m_pageNumber;
+
+ friend class InspectorServerRequestHandlerQt;
+};
+
+class RemoteFrontendChannel : public QObject {
+ Q_OBJECT
+public:
+
+ RemoteFrontendChannel(InspectorServerRequestHandlerQt* requestHandler);
+ bool sendMessageToFrontend(const String& message);
+
+private:
+ InspectorServerRequestHandlerQt* m_requestHandler;
+};
+
+class InspectorServerRequestHandlerQt : public QObject {
+ Q_OBJECT
+public:
+
+ InspectorServerRequestHandlerQt(QTcpSocket *tcpConnection, InspectorServerQt *server);
+ virtual ~InspectorServerRequestHandlerQt();
+ virtual int webSocketSend(QByteArray payload);
+ virtual int webSocketSend(const char *payload, size_t length);
+
+private slots:
+ void tcpReadyRead();
+ void tcpConnectionDisconnected();
+ void webSocketReadyRead();
+
+private:
+ QTcpSocket* m_tcpConnection;
+ InspectorServerQt* m_server;
+
+ QString m_path;
+ QByteArray m_contentType;
+ int m_contentLength;
+ bool m_endOfHeaders;
+ QByteArray m_data;
+ InspectorClientQt* m_inspectorClient;
+
+ void handleInspectorRequest(QStringList words);
+ void handleFromFrontendRequest();
+ void handleResourceRequest(QStringList words);
+
+};
+
+}
+#endif
diff --git a/WebKit/qt/WebCoreSupport/PageClientQt.cpp b/WebKit/qt/WebCoreSupport/PageClientQt.cpp
index 62f48ff..ea209d9 100644
--- a/WebKit/qt/WebCoreSupport/PageClientQt.cpp
+++ b/WebKit/qt/WebCoreSupport/PageClientQt.cpp
@@ -48,12 +48,10 @@ bool PageClientQWidget::inputMethodEnabled() const
return view->testAttribute(Qt::WA_InputMethodEnabled);
}
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
void PageClientQWidget::setInputMethodHints(Qt::InputMethodHints hints)
{
view->setInputMethodHints(hints);
}
-#endif
#ifndef QT_NO_CURSOR
QCursor PageClientQWidget::cursor() const
@@ -215,26 +213,18 @@ void PageClientQGraphicsWidget::updateTiledBackingStoreScale()
void PageClientQGraphicsWidget::setInputMethodEnabled(bool enable)
{
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
view->setFlag(QGraphicsItem::ItemAcceptsInputMethod, enable);
-#endif
}
bool PageClientQGraphicsWidget::inputMethodEnabled() const
{
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
return view->flags() & QGraphicsItem::ItemAcceptsInputMethod;
-#else
- return false;
-#endif
}
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
void PageClientQGraphicsWidget::setInputMethodHints(Qt::InputMethodHints hints)
{
view->setInputMethodHints(hints);
}
-#endif
#ifndef QT_NO_CURSOR
QCursor PageClientQGraphicsWidget::cursor() const
@@ -318,9 +308,6 @@ QStyle* PageClientQGraphicsWidget::style() const
QRectF PageClientQGraphicsWidget::windowRect() const
{
- if (!view->deviceSize().isEmpty())
- return QRectF(QRect(QPoint(0, 0), view->deviceSize()));
-
if (!view->scene())
return QRectF();
diff --git a/WebKit/qt/WebCoreSupport/PageClientQt.h b/WebKit/qt/WebCoreSupport/PageClientQt.h
index 65ee849..eea7f40 100644
--- a/WebKit/qt/WebCoreSupport/PageClientQt.h
+++ b/WebKit/qt/WebCoreSupport/PageClientQt.h
@@ -58,9 +58,7 @@ public:
virtual void update(const QRect& dirtyRect);
virtual void setInputMethodEnabled(bool enable);
virtual bool inputMethodEnabled() const;
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
virtual void setInputMethodHints(Qt::InputMethodHints hints);
-#endif
#ifndef QT_NO_CURSOR
virtual QCursor cursor() const;
@@ -93,9 +91,7 @@ class QGraphicsItemOverlay : public QGraphicsItem {
, page(p)
{
setPos(0, 0);
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
setFlag(QGraphicsItem::ItemUsesExtendedStyleOption, true);
-#endif
setCacheMode(QGraphicsItem::DeviceCoordinateCache);
}
@@ -146,9 +142,7 @@ public:
virtual void update(const QRect& dirtyRect);
virtual void setInputMethodEnabled(bool enable);
virtual bool inputMethodEnabled() const;
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
virtual void setInputMethodHints(Qt::InputMethodHints hints);
-#endif
#ifndef QT_NO_CURSOR
virtual QCursor cursor() const;
diff --git a/WebKit/qt/WebCoreSupport/QtPlatformPlugin.cpp b/WebKit/qt/WebCoreSupport/QtPlatformPlugin.cpp
index fd86e91..1f91d8c 100644
--- a/WebKit/qt/WebCoreSupport/QtPlatformPlugin.cpp
+++ b/WebKit/qt/WebCoreSupport/QtPlatformPlugin.cpp
@@ -91,16 +91,20 @@ QWebKitPlatformPlugin* QtPlatformPlugin::plugin()
QWebSelectMethod* QtPlatformPlugin::createSelectInputMethod()
{
QWebKitPlatformPlugin* p = plugin();
- return p ? p->createSelectInputMethod() : 0;
+ return p ? qobject_cast<QWebSelectMethod*>(p->createExtension(QWebKitPlatformPlugin::MultipleSelections)) : 0;
}
QWebNotificationPresenter* QtPlatformPlugin::createNotificationPresenter()
{
QWebKitPlatformPlugin* p = plugin();
- if (!p)
- return 0;
- return p->createNotificationPresenter();
+ return p ? qobject_cast<QWebNotificationPresenter*>(p->createExtension(QWebKitPlatformPlugin::Notifications)) : 0;
+}
+
+QWebHapticFeedbackPlayer* QtPlatformPlugin::createHapticFeedbackPlayer()
+{
+ QWebKitPlatformPlugin* p = plugin();
+ return p ? qobject_cast<QWebHapticFeedbackPlayer*>(p->createExtension(QWebKitPlatformPlugin::Haptics)) : 0;
}
}
diff --git a/WebKit/qt/WebCoreSupport/QtPlatformPlugin.h b/WebKit/qt/WebCoreSupport/QtPlatformPlugin.h
index 9bdab75..a3e50c2 100644
--- a/WebKit/qt/WebCoreSupport/QtPlatformPlugin.h
+++ b/WebKit/qt/WebCoreSupport/QtPlatformPlugin.h
@@ -26,6 +26,7 @@
class QWebSelectMethod;
class QWebKitPlatformPlugin;
class QWebNotificationPresenter;
+class QWebHapticFeedbackPlayer;
class QWebSelectData;
namespace WebCore {
@@ -37,6 +38,7 @@ public:
QWebSelectMethod* createSelectInputMethod();
QWebNotificationPresenter* createNotificationPresenter();
+ QWebHapticFeedbackPlayer* createHapticFeedbackPlayer();
QWebKitPlatformPlugin* plugin();
diff --git a/WebKit/qt/WebCoreSupport/WebPlatformStrategies.cpp b/WebKit/qt/WebCoreSupport/WebPlatformStrategies.cpp
index 948e0cd..7cd255f 100644
--- a/WebKit/qt/WebCoreSupport/WebPlatformStrategies.cpp
+++ b/WebKit/qt/WebCoreSupport/WebPlatformStrategies.cpp
@@ -30,8 +30,10 @@
#include "config.h"
#include "WebPlatformStrategies.h"
-#include "NotImplemented.h"
+#include "Chrome.h"
+#include "ChromeClientQt.h"
#include <IntSize.h>
+#include "NotImplemented.h"
#include <Page.h>
#include <PageGroup.h>
#include <PluginDatabase.h>
@@ -43,14 +45,13 @@
using namespace WebCore;
-void WebPlatformStrategies::initialize(QWebPage* webPage)
+void WebPlatformStrategies::initialize()
{
- DEFINE_STATIC_LOCAL(WebPlatformStrategies, platformStrategies, (webPage));
+ DEFINE_STATIC_LOCAL(WebPlatformStrategies, platformStrategies, ());
Q_UNUSED(platformStrategies);
}
-WebPlatformStrategies::WebPlatformStrategies(QWebPage* webPage)
- : m_page(webPage)
+WebPlatformStrategies::WebPlatformStrategies()
{
setPlatformStrategies(this);
}
@@ -78,10 +79,11 @@ void WebPlatformStrategies::refreshPlugins()
PluginDatabase::installedPlugins()->refresh();
}
-void WebPlatformStrategies::getPluginInfo(Vector<WebCore::PluginInfo>& outPlugins)
+void WebPlatformStrategies::getPluginInfo(const WebCore::Page* page, Vector<WebCore::PluginInfo>& outPlugins)
{
- QWebPluginFactory* factory = m_page->pluginFactory();
- if (factory) {
+ QWebPage* qPage = static_cast<ChromeClientQt*>(page->chrome()->client())->m_webPage;
+ QWebPluginFactory* factory;
+ if (qPage && (factory = qPage->pluginFactory())) {
QList<QWebPluginFactory::Plugin> qplugins = factory->plugins();
for (int i = 0; i < qplugins.count(); ++i) {
@@ -198,6 +200,56 @@ String WebPlatformStrategies::contextMenuItemTagCopyImageToClipboard()
return QCoreApplication::translate("QWebPage", "Copy Image", "Copy Link context menu item");
}
+String WebPlatformStrategies::contextMenuItemTagOpenVideoInNewWindow()
+{
+ return QCoreApplication::translate("QWebPage", "Open Video", "Open Video in New Window");
+}
+
+String WebPlatformStrategies::contextMenuItemTagOpenAudioInNewWindow()
+{
+ return QCoreApplication::translate("QWebPage", "Open Audio", "Open Audio in New Window");
+}
+
+String WebPlatformStrategies::contextMenuItemTagCopyVideoLinkToClipboard()
+{
+ return QCoreApplication::translate("QWebPage", "Copy Video", "Copy Video Link Location");
+}
+
+String WebPlatformStrategies::contextMenuItemTagCopyAudioLinkToClipboard()
+{
+ return QCoreApplication::translate("QWebPage", "Copy Audio", "Copy Audio Link Location");
+}
+
+String WebPlatformStrategies::contextMenuItemTagToggleMediaControls()
+{
+ return QCoreApplication::translate("QWebPage", "Toggle Controls", "Toggle Media Controls");
+}
+
+String WebPlatformStrategies::contextMenuItemTagToggleMediaLoop()
+{
+ return QCoreApplication::translate("QWebPage", "Toggle Loop", "Toggle Media Loop Playback");
+}
+
+String WebPlatformStrategies::contextMenuItemTagEnterVideoFullscreen()
+{
+ return QCoreApplication::translate("QWebPage", "Enter Fullscreen", "Switch Video to Fullscreen");
+}
+
+String WebPlatformStrategies::contextMenuItemTagMediaPlay()
+{
+ return QCoreApplication::translate("QWebPage", "Play", "Play");
+}
+
+String WebPlatformStrategies::contextMenuItemTagMediaPause()
+{
+ return QCoreApplication::translate("QWebPage", "Pause", "Pause");
+}
+
+String WebPlatformStrategies::contextMenuItemTagMediaMute()
+{
+ return QCoreApplication::translate("QWebPage", "Mute", "Mute");
+}
+
String WebPlatformStrategies::contextMenuItemTagOpenFrameInNewWindow()
{
return QCoreApplication::translate("QWebPage", "Open Frame", "Open Frame in New Window context menu item");
diff --git a/WebKit/qt/WebCoreSupport/WebPlatformStrategies.h b/WebKit/qt/WebCoreSupport/WebPlatformStrategies.h
index 8ea60d9..ea366e0 100644
--- a/WebKit/qt/WebCoreSupport/WebPlatformStrategies.h
+++ b/WebKit/qt/WebCoreSupport/WebPlatformStrategies.h
@@ -33,14 +33,16 @@
#include <PluginStrategy.h>
#include <VisitedLinkStrategy.h>
-class QWebPage;
+namespace WebCore {
+class Page;
+}
class WebPlatformStrategies : public WebCore::PlatformStrategies, private WebCore::PluginStrategy, private WebCore::LocalizationStrategy, private WebCore::VisitedLinkStrategy {
public:
- static void initialize(QWebPage* webPage);
+ static void initialize();
private:
- WebPlatformStrategies(QWebPage* webPage);
+ WebPlatformStrategies();
// WebCore::PlatformStrategies
virtual WebCore::PluginStrategy* createPluginStrategy();
@@ -49,7 +51,7 @@ private:
// WebCore::PluginStrategy
virtual void refreshPlugins();
- virtual void getPluginInfo(Vector<WebCore::PluginInfo>&);
+ virtual void getPluginInfo(const WebCore::Page*, Vector<WebCore::PluginInfo>&);
// WebCore::LocalizationStrategy
virtual WTF::String inputElementAltText();
@@ -95,6 +97,16 @@ private:
virtual WTF::String contextMenuItemTagLeftToRight();
virtual WTF::String contextMenuItemTagRightToLeft();
virtual WTF::String contextMenuItemTagInspectElement();
+ virtual WTF::String contextMenuItemTagOpenVideoInNewWindow();
+ virtual WTF::String contextMenuItemTagOpenAudioInNewWindow();
+ virtual WTF::String contextMenuItemTagCopyVideoLinkToClipboard();
+ virtual WTF::String contextMenuItemTagCopyAudioLinkToClipboard();
+ virtual WTF::String contextMenuItemTagToggleMediaControls();
+ virtual WTF::String contextMenuItemTagToggleMediaLoop();
+ virtual WTF::String contextMenuItemTagEnterVideoFullscreen();
+ virtual WTF::String contextMenuItemTagMediaPlay();
+ virtual WTF::String contextMenuItemTagMediaPause();
+ virtual WTF::String contextMenuItemTagMediaMute();
virtual WTF::String searchMenuNoRecentSearchesText();
virtual WTF::String searchMenuRecentSearchesText();
virtual WTF::String searchMenuClearRecentSearchesText();
@@ -134,8 +146,6 @@ private:
// WebCore::VisitedLinkStrategy
virtual bool isLinkVisited(WebCore::Page*, WebCore::LinkHash);
virtual void addVisitedLink(WebCore::Page*, WebCore::LinkHash);
-
- QWebPage* m_page;
};
#endif // WebPlatformStrategies_h
diff --git a/WebKit/qt/examples/examples.pro b/WebKit/qt/examples/examples.pro
new file mode 100644
index 0000000..f8dc589
--- /dev/null
+++ b/WebKit/qt/examples/examples.pro
@@ -0,0 +1,2 @@
+TEMPLATE = subdirs
+SUBDIRS = platformplugin \ No newline at end of file
diff --git a/WebKit/qt/examples/platformplugin/README b/WebKit/qt/examples/platformplugin/README
index 47ef797..e220d04 100644
--- a/WebKit/qt/examples/platformplugin/README
+++ b/WebKit/qt/examples/platformplugin/README
@@ -6,6 +6,9 @@ that will provide combo boxes popups to QtWebKit.
QtWebKit will look for the plugins automatically so there is no need to make any other configuration to
put the plugin into use. To stop using the plugin just remove the directory $$[QT_INSTALL_PLUGINS]/webkit.
+A copy of qwebkitplatformplugin.h is provided with the example, as platform plugins should not depend
+on the precense of QtWebKit to build.
+
This plugin can provide popups for <select multiple> elements but to use this feature QtWebKit must be
compiled with NO_LISTBOX_RENDERING enabled.
diff --git a/WebKit/qt/examples/platformplugin/WebPlugin.cpp b/WebKit/qt/examples/platformplugin/WebPlugin.cpp
index c3efb80..23b938e 100644
--- a/WebKit/qt/examples/platformplugin/WebPlugin.cpp
+++ b/WebKit/qt/examples/platformplugin/WebPlugin.cpp
@@ -210,15 +210,30 @@ MultipleSelectionPopup::MultipleSelectionPopup(const QWebSelectData& data)
bool WebPlugin::supportsExtension(Extension extension) const
{
- if (extension == MultipleSelections)
+ switch (extension) {
+ case MultipleSelections:
return true;
- if (extension == Notifications)
#if ENABLE_NOTIFICATIONS
+ case Notifications:
return true;
-#else
+#endif
+ default:
return false;
+ }
+}
+
+QObject* WebPlugin::createExtension(Extension extension) const
+{
+ switch (extension) {
+ case MultipleSelections:
+ return new WebPopup();
+#if ENABLE_NOTIFICATIONS
+ case Notifications:
+ return new WebNotificationPresenter();
#endif
- return false;
+ default:
+ return 0;
+ }
}
Q_EXPORT_PLUGIN2(platformplugin, WebPlugin)
diff --git a/WebKit/qt/examples/platformplugin/WebPlugin.h b/WebKit/qt/examples/platformplugin/WebPlugin.h
index 4af19f9..3df345f 100644
--- a/WebKit/qt/examples/platformplugin/WebPlugin.h
+++ b/WebKit/qt/examples/platformplugin/WebPlugin.h
@@ -87,14 +87,8 @@ class WebPlugin : public QObject, public QWebKitPlatformPlugin
Q_OBJECT
Q_INTERFACES(QWebKitPlatformPlugin)
public:
- virtual QWebSelectMethod* createSelectInputMethod() const { return new WebPopup(); }
virtual bool supportsExtension(Extension extension) const;
- virtual QWebNotificationPresenter* createNotificationPresenter() const {
- return new WebNotificationPresenter();
- }
- virtual QWebHapticFeedbackPlayer* createHapticFeedbackPlayer() const {
- return 0;
- }
+ virtual QObject* createExtension(Extension extension) const;
};
#endif // WEBPLUGIN_H
diff --git a/WebKit/qt/examples/platformplugin/qwebkitplatformplugin.h b/WebKit/qt/examples/platformplugin/qwebkitplatformplugin.h
index 76496c5..faa6989 100644
--- a/WebKit/qt/examples/platformplugin/qwebkitplatformplugin.h
+++ b/WebKit/qt/examples/platformplugin/qwebkitplatformplugin.h
@@ -110,12 +110,9 @@ public:
};
virtual bool supportsExtension(Extension extension) const = 0;
- virtual QWebSelectMethod* createSelectInputMethod() const = 0;
- virtual QWebNotificationPresenter* createNotificationPresenter() const = 0;
- virtual QWebHapticFeedbackPlayer* createHapticFeedbackPlayer() const = 0;
-
+ virtual QObject* createExtension(Extension extension) const = 0;
};
-Q_DECLARE_INTERFACE(QWebKitPlatformPlugin, "com.nokia.Qt.WebKit.PlatformPlugin/1.4");
+Q_DECLARE_INTERFACE(QWebKitPlatformPlugin, "com.nokia.Qt.WebKit.PlatformPlugin/1.5");
#endif // QWEBKITPLATFORMPLUGIN_H
diff --git a/WebKit/qt/symbian/eabi/QtWebKitu.def b/WebKit/qt/symbian/eabi/QtWebKitu.def
index 8291197..2b917e1 100644
--- a/WebKit/qt/symbian/eabi/QtWebKitu.def
+++ b/WebKit/qt/symbian/eabi/QtWebKitu.def
@@ -799,7 +799,6 @@ EXPORTS
_ZN8QWebPage23allowGeolocationRequestEP9QWebFrame @ 798 NONAME
_ZN8QWebPage23viewportChangeRequestedERKNS_13ViewportHintsE @ 799 NONAME ABSENT
_ZNK15QWebScriptWorld5worldEv @ 800 NONAME
- _ZN16QGraphicsWebView13setDeviceSizeERK5QSize @ 801 NONAME
_ZN23DumpRenderTreeSupportQt12pagePropertyEP9QWebFrameRK7QStringi @ 802 NONAME
_ZN23DumpRenderTreeSupportQt16isPageBoxVisibleEP9QWebFramei @ 803 NONAME
_ZN23DumpRenderTreeSupportQt16resumeAnimationsEP9QWebFrame @ 804 NONAME
@@ -811,7 +810,6 @@ EXPORTS
_ZN8QWebPage23checkPermissionFromUserEP9QWebFrameNS_16PermissionDomainERNS_16PermissionPolicyE @ 810 NONAME
_ZN8QWebPage25requestPermissionFromUserEP9QWebFrameNS_16PermissionDomainE @ 811 NONAME
_ZN8QWebPage27cancelRequestsForPermissionEP9QWebFrameNS_16PermissionDomainE @ 812 NONAME
- _ZNK16QGraphicsWebView10deviceSizeEv @ 813 NONAME
_ZN23DumpRenderTreeSupportQt14viewportAsTextEP8QWebPageRK5QSize @ 814 NONAME
_ZN23DumpRenderTreeSupportQt32simulateDesktopNotificationClickERK7QString @ 815 NONAME
_ZN8QWebPage23viewportChangeRequestedEv @ 816 NONAME
diff --git a/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp b/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp
index 2c63739..ec8a39e 100644
--- a/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp
+++ b/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp
@@ -2604,6 +2604,7 @@ void tst_QWebFrame::popupFocus()
"</html>");
view.resize(400, 100);
view.show();
+ QTest::qWaitForWindowShown(&view);
view.setFocus();
QTRY_VERIFY(view.hasFocus());
@@ -2946,12 +2947,7 @@ void tst_QWebFrame::evaluateWillCauseRepaint()
view.setHtml(html);
view.show();
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
QTest::qWaitForWindowShown(&view);
-#else
- QTest::qWait(2000);
-#endif
-
view.page()->mainFrame()->evaluateJavaScript(
"document.getElementById('junk').style.display = 'none';");
diff --git a/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp b/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
index 10af94c..36fa050 100644
--- a/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
+++ b/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
@@ -1368,12 +1368,9 @@ void tst_QWebPage::inputMethods_data()
{
QTest::addColumn<QString>("viewType");
QTest::newRow("QWebView") << "QWebView";
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
QTest::newRow("QGraphicsWebView") << "QGraphicsWebView";
-#endif
}
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
static Qt::InputMethodHints inputMethodHints(QObject* object)
{
if (QGraphicsObject* o = qobject_cast<QGraphicsObject*>(object))
@@ -1382,14 +1379,11 @@ static Qt::InputMethodHints inputMethodHints(QObject* object)
return w->inputMethodHints();
return Qt::InputMethodHints();
}
-#endif
static bool inputMethodEnabled(QObject* object)
{
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
if (QGraphicsObject* o = qobject_cast<QGraphicsObject*>(object))
return o->flags() & QGraphicsItem::ItemAcceptsInputMethod;
-#endif
if (QWidget* w = qobject_cast<QWidget*>(object))
return w->testAttribute(Qt::WA_InputMethodEnabled);
return false;
@@ -1406,9 +1400,7 @@ void tst_QWebPage::inputMethods()
wv->setPage(page);
view = wv;
container = view;
- }
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
- else if (viewType == "QGraphicsWebView") {
+ } else if (viewType == "QGraphicsWebView") {
QGraphicsWebView* wv = new QGraphicsWebView;
wv->setPage(page);
view = wv;
@@ -1420,9 +1412,7 @@ void tst_QWebPage::inputMethods()
wv->setGeometry(QRect(0, 0, 500, 500));
container = gv;
- }
-#endif
- else
+ } else
QVERIFY2(false, "Unknown view type");
page->settings()->setFontFamily(QWebSettings::SerifFont, "FooSerifFont");
@@ -1441,7 +1431,6 @@ void tst_QWebPage::inputMethods()
QMouseEvent evrel(QEvent::MouseButtonRelease, inputs.at(0).geometry().center(), Qt::LeftButton, Qt::NoButton, Qt::NoModifier);
page->event(&evrel);
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
// This part of the test checks if the SIP (Software Input Panel) is triggered,
// which normally happens on mobile platforms, when a user input form receives
// a mouse click.
@@ -1463,15 +1452,11 @@ void tst_QWebPage::inputMethods()
QVERIFY(viewEventSpy.contains(QEvent::RequestSoftwareInputPanel));
else
QVERIFY(!viewEventSpy.contains(QEvent::RequestSoftwareInputPanel));
-#endif
viewEventSpy.clear();
page->event(&evpres);
page->event(&evrel);
-
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
QVERIFY(viewEventSpy.contains(QEvent::RequestSoftwareInputPanel));
-#endif
//ImMicroFocus
QVariant variant = page->inputMethodQuery(Qt::ImMicroFocus);
@@ -1499,7 +1484,6 @@ void tst_QWebPage::inputMethods()
page->event(&eventText);
}
-#if QT_VERSION >= 0x040600
//ImMaximumTextLength
variant = page->inputMethodQuery(Qt::ImMaximumTextLength);
QCOMPARE(20, variant.toInt());
@@ -1548,14 +1532,12 @@ void tst_QWebPage::inputMethods()
variant = page->inputMethodQuery(Qt::ImCurrentSelection);
selectionValue = variant.value<QString>();
QCOMPARE(selectionValue, QString("tWebK"));
-#endif
//ImSurroundingText
variant = page->inputMethodQuery(Qt::ImSurroundingText);
QString value = variant.value<QString>();
QCOMPARE(value, QString("QtWebKit"));
-#if QT_VERSION >= 0x040600
{
QList<QInputMethodEvent::Attribute> attributes;
// Clear the selection, so the next test does not clear any contents.
@@ -1569,7 +1551,6 @@ void tst_QWebPage::inputMethods()
variant = page->inputMethodQuery(Qt::ImSurroundingText);
value = variant.value<QString>();
QCOMPARE(value, QString("QtWebKit"));
-#endif
// Cancel current composition first
inputAttributes << QInputMethodEvent::Attribute(QInputMethodEvent::Selection, 0, 0, QVariant());
@@ -1670,13 +1651,11 @@ void tst_QWebPage::inputMethods()
page->event(&evrelPassword);
QVERIFY(inputMethodEnabled(view));
-#if QT_VERSION >= 0x040600
QVERIFY(inputMethodHints(view) & Qt::ImhHiddenText);
page->event(&evpres);
page->event(&evrel);
QVERIFY(!(inputMethodHints(view) & Qt::ImhHiddenText));
-#endif
page->mainFrame()->setHtml("<html><body><p>nothing to input here");
viewEventSpy.clear();
@@ -1689,11 +1668,8 @@ void tst_QWebPage::inputMethods()
page->event(&evrel);
}
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
QVERIFY(!viewEventSpy.contains(QEvent::RequestSoftwareInputPanel));
-#endif
-#if QT_VERSION >= 0x040600
//START - Test for sending empty QInputMethodEvent
page->mainFrame()->setHtml("<html><body>" \
"<input type='text' id='input3' value='QtWebKit2'/>" \
@@ -1707,7 +1683,6 @@ void tst_QWebPage::inputMethods()
QString inputValue = page->mainFrame()->evaluateJavaScript("document.getElementById('input3').value").toString();
QCOMPARE(inputValue, QString("QtWebKit2"));
//END - Test for sending empty QInputMethodEvent
-#endif
delete container;
}
@@ -2089,10 +2064,8 @@ void tst_QWebPage::originatingObjectInNetworkRequests()
QList<QWebFrame*> childFrames = m_page->mainFrame()->childFrames();
QCOMPARE(childFrames.count(), 2);
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
for (int i = 0; i < 2; ++i)
QVERIFY(qobject_cast<QWebFrame*>(networkManager->requests.at(i).originatingObject()) == childFrames.at(i));
-#endif
}
/**
@@ -2189,23 +2162,23 @@ void tst_QWebPage::testStopScheduledPageRefresh()
QWebPage page1;
page1.setNetworkAccessManager(new TestNetworkManager(&page1));
page1.mainFrame()->setHtml("<html><head>"
- "<meta http-equiv=\"refresh\"content=\"0;URL=http://qt.nokia.com/favicon.ico\">"
+ "<meta http-equiv=\"refresh\"content=\"0;URL=qrc:///resources/index.html\">"
"</head><body><h1>Page redirects immediately...</h1>"
"</body></html>");
QVERIFY(::waitForSignal(&page1, SIGNAL(loadFinished(bool))));
QTest::qWait(500);
- QCOMPARE(page1.mainFrame()->url().toString(), QString("http://qt.nokia.com/favicon.ico"));
+ QCOMPARE(page1.mainFrame()->url(), QUrl(QLatin1String("qrc:///resources/index.html")));
// With QWebPage::StopScheduledPageRefresh
QWebPage page2;
page2.setNetworkAccessManager(new TestNetworkManager(&page2));
page2.mainFrame()->setHtml("<html><head>"
- "<meta http-equiv=\"refresh\"content=\"1;URL=http://qt.nokia.com/favicon.ico\">"
+ "<meta http-equiv=\"refresh\"content=\"1;URL=qrc:///resources/index.html\">"
"</head><body><h1>Page redirect test with 1 sec timeout...</h1>"
"</body></html>");
page2.triggerAction(QWebPage::StopScheduledPageRefresh);
QTest::qWait(1500);
- QCOMPARE(page2.mainFrame()->url().toString(), QString("about:blank"));
+ QCOMPARE(page2.mainFrame()->url().toString(), QLatin1String("about:blank"));
}
void tst_QWebPage::findText()
diff --git a/WebKit/qt/tests/qwebview/tst_qwebview.cpp b/WebKit/qt/tests/qwebview/tst_qwebview.cpp
index fd4978d..8cd2f3f 100644
--- a/WebKit/qt/tests/qwebview/tst_qwebview.cpp
+++ b/WebKit/qt/tests/qwebview/tst_qwebview.cpp
@@ -142,22 +142,14 @@ void tst_QWebView::reusePage()
}
view1->show();
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
QTest::qWaitForWindowShown(view1);
-#else
- QTest::qWait(2000);
-#endif
delete view1;
QVERIFY(page != 0); // deleting view must not have deleted the page, since it's not a child of view
QWebView *view2 = new QWebView;
view2->setPage(page);
view2->show(); // in Windowless mode, you should still be able to see the plugin here
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
QTest::qWaitForWindowShown(view2);
-#else
- QTest::qWait(2000);
-#endif
delete view2;
delete page; // must not crash
diff --git a/WebKit/win/ChangeLog b/WebKit/win/ChangeLog
index 251bf91..4933b24 100644
--- a/WebKit/win/ChangeLog
+++ b/WebKit/win/ChangeLog
@@ -1,3 +1,137 @@
+2010-09-28 Jenn Braithwaite <jennb@chromium.org>
+
+ Reviewed by Dmitry Titov.
+
+ Added oldPage param to FrameLoaderClient::didTransferChildFrameToNewDocument.
+ https://bugs.webkit.org/show_bug.cgi?id=46663
+
+ * WebCoreSupport/WebFrameLoaderClient.cpp:
+ (WebFrameLoaderClient::didTransferChildFrameToNewDocument):
+ * WebCoreSupport/WebFrameLoaderClient.h:
+
+2010-09-27 Andrey Kosyakov <caseq@chromium.org>
+
+ Unreviewed build fix (win; broken in r68371)
+
+ * WebFrame.cpp: remove include <WebCore/ResourceHandleWin.h>
+
+2010-09-23 Matthew Delaney <mdelaney@apple.com>
+
+ Reviewed by Simon Fraser.
+
+ Reduce minimum DOMTimer interval
+ https://bugs.webkit.org/show_bug.cgi?id=45362
+
+ * WebView.cpp:
+ Updating set interval call to use Settings' static version inside
+ one time init block.
+
+2010-09-23 Nate Chapin <japhet@chromium.org>
+
+ Unreviewed, build fix.
+
+ Move hyperlinkAuditingEnabled to IWebPreferencesPrivate.idl
+ and touch WebKit.idl
+
+ * Interfaces/IWebPreferences.idl:
+ * Interfaces/IWebPreferencesPrivate.idl:
+ * Interfaces/WebKit.idl:
+ * WebView.cpp:
+ (WebView::notifyPreferencesChanged):
+
+2010-09-23 Nate Chapin <japhet@chromium.org>
+
+ Unreviewed, build fix.
+
+ Look for hyperlinkAuditingEnabled in the right set of preferences.
+
+ * WebView.cpp:
+ (WebView::notifyPreferencesChanged):
+
+2010-09-23 Nate Chapin <japhet@chromium.org>
+
+ Reviewed by Darin Fisher.
+
+ Add hyperlink auditing settings (i.e., <a ping>).
+ https://bugs.webkit.org/show_bug.cgi?id=30458
+
+ * Interfaces/IWebPreferences.idl:
+ * WebPreferenceKeysPrivate.h:
+ * WebPreferences.cpp:
+ (WebPreferences::initializeDefaultSettings):
+ (WebPreferences::hyperlinkAuditingEnabled):
+ (WebPreferences::setHyperlinkAuditingEnabled):
+ * WebPreferences.h:
+ * WebView.cpp:
+ (WebView::notifyPreferencesChanged):
+
+2010-09-23 Matthew Delaney <mdelaney@apple.com>
+
+ Reviewed by Adam Roben.
+
+ Create one time initialization block for WebView's initWithFrame
+ https://bugs.webkit.org/show_bug.cgi?id=46307
+
+ * WebView.cpp: Added one time initialization block for webview code
+ that needs only be run once and not for each webview. This is just as
+ the mac version WebView.mm does.
+
+2010-09-22 Brent Fulgham <bfulgham@webkit.org>
+
+ Reviewed by Martin Robinson.
+
+ [WinCairo] Part 2: Update WebKitTestRunner and DumpRenderTree Build.
+ https://bugs.webkit.org/show_bug.cgi?id=46303.
+
+ * WebKit.vcproj/WebKit.sln: Update overall Debug_Cairo and
+ Release_Cairo configurations to select appropriate build
+ targets for WebKitTestRunner and MiniBrowser.
+
+2010-09-22 Brent Fulgham <bfulgham@webkit.org>
+
+ Reviewed by Martin Robinson.
+
+ [WinCairo] Update WebKitTestRunner and DumpRenderTree Build.rt
+ https://bugs.webkit.org/show_bug.cgi?id=46303.
+
+ * WebKit.vcproj/WebKit.sln: Update overall Debug_Cairo and
+ Release_Cairo configurations to select appropriate build
+ targets for InjectionBundle.
+
+2010-09-22 Balazs Kelemen <kb@inf.u-szeged.hu>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ PluginStrategy should satisfy the needs of Qt
+ https://bugs.webkit.org/show_bug.cgi?id=45857
+ No new functionality so no new tests.
+
+ * WebCoreSupport/WebPlatformStrategies.cpp:
+ (WebPlatformStrategies::getPluginInfo):
+ * WebCoreSupport/WebPlatformStrategies.h:
+
+2010-09-20 Philippe Normand <pnormand@igalia.com>
+
+ Reviewed by Eric Carlson.
+
+ [GTK] enhanced context menu for media elements
+ https://bugs.webkit.org/show_bug.cgi?id=45021
+
+ New localized strings for the media element context-menu.
+
+ * WebCoreSupport/WebPlatformStrategies.cpp:
+ (WebPlatformStrategies::contextMenuItemTagOpenVideoInNewWindow):
+ (WebPlatformStrategies::contextMenuItemTagOpenAudioInNewWindow):
+ (WebPlatformStrategies::contextMenuItemTagCopyVideoLinkToClipboard):
+ (WebPlatformStrategies::contextMenuItemTagCopyAudioLinkToClipboard):
+ (WebPlatformStrategies::contextMenuItemTagToggleMediaControls):
+ (WebPlatformStrategies::contextMenuItemTagToggleMediaLoop):
+ (WebPlatformStrategies::contextMenuItemTagEnterVideoFullscreen):
+ (WebPlatformStrategies::contextMenuItemTagMediaPlay):
+ (WebPlatformStrategies::contextMenuItemTagMediaPause):
+ (WebPlatformStrategies::contextMenuItemTagMediaMute):
+ * WebCoreSupport/WebPlatformStrategies.h:
+
2010-09-17 Darin Adler <darin@apple.com>
Reviewed by Sam Weinig.
diff --git a/WebKit/win/Interfaces/IWebPreferencesPrivate.idl b/WebKit/win/Interfaces/IWebPreferencesPrivate.idl
index bca8d6f..68cbcf3 100644
--- a/WebKit/win/Interfaces/IWebPreferencesPrivate.idl
+++ b/WebKit/win/Interfaces/IWebPreferencesPrivate.idl
@@ -118,4 +118,7 @@ interface IWebPreferencesPrivate : IUnknown
HRESULT memoryInfoEnabled([out, retval] BOOL *enabled);
HRESULT setMemoryInfoEnabled([in] BOOL enabled);
+
+ HRESULT hyperlinkAuditingEnabled(BOOL *hyperlinkAuditingEnabled);
+ HRESULT setHyperlinkAuditingEnabled(BOOL hyperlinkAuditingEnabled);
}
diff --git a/WebKit/win/Interfaces/WebKit.idl b/WebKit/win/Interfaces/WebKit.idl
index d25cdfe..8938501 100644
--- a/WebKit/win/Interfaces/WebKit.idl
+++ b/WebKit/win/Interfaces/WebKit.idl
@@ -20,7 +20,7 @@
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
cpp_quote("/*")
diff --git a/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp b/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp
index 1fb827d..4b05338 100644
--- a/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp
+++ b/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp
@@ -728,7 +728,7 @@ PassRefPtr<Frame> WebFrameLoaderClient::createFrame(const KURL& url, const Strin
return result.release();
}
-void WebFrameLoaderClient::didTransferChildFrameToNewDocument()
+void WebFrameLoaderClient::didTransferChildFrameToNewDocument(Page*)
{
}
diff --git a/WebKit/win/WebCoreSupport/WebFrameLoaderClient.h b/WebKit/win/WebCoreSupport/WebFrameLoaderClient.h
index 6e8e354..7ec344c 100644
--- a/WebKit/win/WebCoreSupport/WebFrameLoaderClient.h
+++ b/WebKit/win/WebCoreSupport/WebFrameLoaderClient.h
@@ -112,7 +112,7 @@ public:
virtual PassRefPtr<WebCore::Frame> createFrame(const WebCore::KURL& url, const WTF::String& name, WebCore::HTMLFrameOwnerElement* ownerElement,
const WTF::String& referrer, bool allowsScrolling, int marginWidth, int marginHeight);
- virtual void didTransferChildFrameToNewDocument();
+ virtual void didTransferChildFrameToNewDocument(WebCore::Page*);
virtual PassRefPtr<WebCore::Widget> createPlugin(const WebCore::IntSize&, WebCore::HTMLPlugInElement*, const WebCore::KURL&, const Vector<WTF::String>&, const Vector<WTF::String>&, const WTF::String&, bool loadManually);
virtual void redirectDataToPlugin(WebCore::Widget* pluginWidget);
diff --git a/WebKit/win/WebCoreSupport/WebPlatformStrategies.cpp b/WebKit/win/WebCoreSupport/WebPlatformStrategies.cpp
index 00a2eab..fe35877 100644
--- a/WebKit/win/WebCoreSupport/WebPlatformStrategies.cpp
+++ b/WebKit/win/WebCoreSupport/WebPlatformStrategies.cpp
@@ -68,7 +68,7 @@ void WebPlatformStrategies::refreshPlugins()
PluginDatabase::installedPlugins()->refresh();
}
-void WebPlatformStrategies::getPluginInfo(Vector<WebCore::PluginInfo>& outPlugins)
+void WebPlatformStrategies::getPluginInfo(const WebCore::Page*, Vector<WebCore::PluginInfo>& outPlugins)
{
const Vector<PluginPackage*>& plugins = PluginDatabase::installedPlugins()->plugins();
@@ -163,6 +163,56 @@ String WebPlatformStrategies::contextMenuItemTagCopyImageToClipboard()
return UI_STRING("Copy Image", "Copy Image context menu item");
}
+String WebPlatformStrategies::contextMenuItemTagOpenVideoInNewWindow()
+{
+ return UI_STRING("Open Video in New Window", "Open Video in New Window context menu item");
+}
+
+String WebPlatformStrategies::contextMenuItemTagOpenAudioInNewWindow()
+{
+ return UI_STRING("Open Audio in New Window", "Open Audio in New Window context menu item");
+}
+
+String WebPlatformStrategies::contextMenuItemTagCopyVideoLinkToClipboard()
+{
+ return UI_STRING("Copy Video Address", "Copy Video Address Location context menu item");
+}
+
+String WebPlatformStrategies::contextMenuItemTagCopyAudioLinkToClipboard()
+{
+ return UI_STRING("Copy Audio Address", "Copy Audio Address Location context menu item");
+}
+
+String WebPlatformStrategies::contextMenuItemTagToggleMediaControls()
+{
+ return UI_STRING("Controls", "Media Controls context menu item");
+}
+
+String WebPlatformStrategies::contextMenuItemTagToggleMediaLoop()
+{
+ return UI_STRING("Loop", "Media Loop context menu item");
+}
+
+String WebPlatformStrategies::contextMenuItemTagEnterVideoFullscreen()
+{
+ return UI_STRING("Enter Fullscreen", "Video Enter Fullscreen context menu item");
+}
+
+String WebPlatformStrategies::contextMenuItemTagMediaPlay()
+{
+ return UI_STRING("Play", "Media Play context menu item");
+}
+
+String WebPlatformStrategies::contextMenuItemTagMediaPause()
+{
+ return UI_STRING("Pause", "Media Pause context menu item");
+}
+
+String WebPlatformStrategies::contextMenuItemTagMediaMute()
+{
+ return UI_STRING("Mute", "Media Mute context menu item");
+}
+
String WebPlatformStrategies::contextMenuItemTagOpenFrameInNewWindow()
{
return UI_STRING("Open Frame in New Window", "Open Frame in New Window context menu item");
diff --git a/WebKit/win/WebCoreSupport/WebPlatformStrategies.h b/WebKit/win/WebCoreSupport/WebPlatformStrategies.h
index c3cfbb4..48c2b46 100644
--- a/WebKit/win/WebCoreSupport/WebPlatformStrategies.h
+++ b/WebKit/win/WebCoreSupport/WebPlatformStrategies.h
@@ -45,7 +45,7 @@ private:
// WebCore::PluginStrategy
virtual void refreshPlugins();
- virtual void getPluginInfo(Vector<WebCore::PluginInfo>&);
+ virtual void getPluginInfo(const WebCore::Page*, Vector<WebCore::PluginInfo>&);
// WebCore::LocalizationStrategy
virtual WTF::String inputElementAltText();
@@ -92,6 +92,16 @@ private:
virtual WTF::String contextMenuItemTagLeftToRight();
virtual WTF::String contextMenuItemTagRightToLeft();
virtual WTF::String contextMenuItemTagInspectElement();
+ virtual WTF::String contextMenuItemTagOpenVideoInNewWindow();
+ virtual WTF::String contextMenuItemTagOpenAudioInNewWindow();
+ virtual WTF::String contextMenuItemTagCopyVideoLinkToClipboard();
+ virtual WTF::String contextMenuItemTagCopyAudioLinkToClipboard();
+ virtual WTF::String contextMenuItemTagToggleMediaControls();
+ virtual WTF::String contextMenuItemTagToggleMediaLoop();
+ virtual WTF::String contextMenuItemTagEnterVideoFullscreen();
+ virtual WTF::String contextMenuItemTagMediaPlay();
+ virtual WTF::String contextMenuItemTagMediaPause();
+ virtual WTF::String contextMenuItemTagMediaMute();
#endif // ENABLE(CONTEXT_MENUS)
virtual WTF::String searchMenuNoRecentSearchesText();
virtual WTF::String searchMenuRecentSearchesText();
diff --git a/WebKit/win/WebFrame.cpp b/WebKit/win/WebFrame.cpp
index 843f33a..27da1f4 100644
--- a/WebKit/win/WebFrame.cpp
+++ b/WebKit/win/WebFrame.cpp
@@ -89,7 +89,6 @@
#include <WebCore/PluginView.h>
#include <WebCore/PrintContext.h>
#include <WebCore/ResourceHandle.h>
-#include <WebCore/ResourceHandleWin.h>
#include <WebCore/ResourceRequest.h>
#include <WebCore/RenderView.h>
#include <WebCore/RenderTreeAsText.h>
diff --git a/WebKit/win/WebKit.vcproj/WebKit.sln b/WebKit/win/WebKit.vcproj/WebKit.sln
index 251fa5f..504bae3 100644
--- a/WebKit/win/WebKit.vcproj/WebKit.sln
+++ b/WebKit/win/WebKit.vcproj/WebKit.sln
@@ -413,14 +413,14 @@ Global
{114FCA11-216B-4C8C-957E-30A75AE80443}.Release|Win32.Build.0 = Release|Win32
{CBC3391C-F060-4BF5-A66E-81404168816B}.Debug_All|Win32.ActiveCfg = Debug_All|Win32
{CBC3391C-F060-4BF5-A66E-81404168816B}.Debug_All|Win32.Build.0 = Debug_All|Win32
- {CBC3391C-F060-4BF5-A66E-81404168816B}.Debug_Cairo|Win32.ActiveCfg = Debug|Win32
- {CBC3391C-F060-4BF5-A66E-81404168816B}.Debug_Cairo|Win32.Build.0 = Debug|Win32
+ {CBC3391C-F060-4BF5-A66E-81404168816B}.Debug_Cairo|Win32.ActiveCfg = Debug_CFLite|Win32
+ {CBC3391C-F060-4BF5-A66E-81404168816B}.Debug_Cairo|Win32.Build.0 = Debug_CFLite|Win32
{CBC3391C-F060-4BF5-A66E-81404168816B}.Debug_Internal|Win32.ActiveCfg = Debug_Internal|Win32
{CBC3391C-F060-4BF5-A66E-81404168816B}.Debug_Internal|Win32.Build.0 = Debug_Internal|Win32
{CBC3391C-F060-4BF5-A66E-81404168816B}.Debug|Win32.ActiveCfg = Debug|Win32
{CBC3391C-F060-4BF5-A66E-81404168816B}.Debug|Win32.Build.0 = Debug|Win32
- {CBC3391C-F060-4BF5-A66E-81404168816B}.Release_Cairo|Win32.ActiveCfg = Release|Win32
- {CBC3391C-F060-4BF5-A66E-81404168816B}.Release_Cairo|Win32.Build.0 = Release|Win32
+ {CBC3391C-F060-4BF5-A66E-81404168816B}.Release_Cairo|Win32.ActiveCfg = Release_CFLite|Win32
+ {CBC3391C-F060-4BF5-A66E-81404168816B}.Release_Cairo|Win32.Build.0 = Release_CFLite|Win32
{CBC3391C-F060-4BF5-A66E-81404168816B}.Release|Win32.ActiveCfg = Release|Win32
{CBC3391C-F060-4BF5-A66E-81404168816B}.Release|Win32.Build.0 = Release|Win32
{4343BC0B-A2E0-4B48-8277-F33CFBFA83CD}.Debug_All|Win32.ActiveCfg = all|Win32
@@ -437,26 +437,26 @@ Global
{4343BC0B-A2E0-4B48-8277-F33CFBFA83CD}.Release|Win32.Build.0 = all|Win32
{3B99669B-1817-443B-BCBE-835580146668}.Debug_All|Win32.ActiveCfg = Debug_All|Win32
{3B99669B-1817-443B-BCBE-835580146668}.Debug_All|Win32.Build.0 = Debug_All|Win32
- {3B99669B-1817-443B-BCBE-835580146668}.Debug_Cairo|Win32.ActiveCfg = Debug|Win32
- {3B99669B-1817-443B-BCBE-835580146668}.Debug_Cairo|Win32.Build.0 = Debug|Win32
+ {3B99669B-1817-443B-BCBE-835580146668}.Debug_Cairo|Win32.ActiveCfg = Debug_CFLite|Win32
+ {3B99669B-1817-443B-BCBE-835580146668}.Debug_Cairo|Win32.Build.0 = Debug_CFLite|Win32
{3B99669B-1817-443B-BCBE-835580146668}.Debug_Internal|Win32.ActiveCfg = Debug_Internal|Win32
{3B99669B-1817-443B-BCBE-835580146668}.Debug_Internal|Win32.Build.0 = Debug_Internal|Win32
{3B99669B-1817-443B-BCBE-835580146668}.Debug|Win32.ActiveCfg = Debug|Win32
{3B99669B-1817-443B-BCBE-835580146668}.Debug|Win32.Build.0 = Debug|Win32
- {3B99669B-1817-443B-BCBE-835580146668}.Release_Cairo|Win32.ActiveCfg = Release|Win32
- {3B99669B-1817-443B-BCBE-835580146668}.Release_Cairo|Win32.Build.0 = Release|Win32
+ {3B99669B-1817-443B-BCBE-835580146668}.Release_Cairo|Win32.ActiveCfg = Release_CFLite|Win32
+ {3B99669B-1817-443B-BCBE-835580146668}.Release_Cairo|Win32.Build.0 = Release_CFLite|Win32
{3B99669B-1817-443B-BCBE-835580146668}.Release|Win32.ActiveCfg = Release|Win32
{3B99669B-1817-443B-BCBE-835580146668}.Release|Win32.Build.0 = Release|Win32
{1480CF5F-4160-47B5-A0E6-96AEC8258FB5}.Debug_All|Win32.ActiveCfg = Debug_All|Win32
{1480CF5F-4160-47B5-A0E6-96AEC8258FB5}.Debug_All|Win32.Build.0 = Debug_All|Win32
- {1480CF5F-4160-47B5-A0E6-96AEC8258FB5}.Debug_Cairo|Win32.ActiveCfg = Debug|Win32
- {1480CF5F-4160-47B5-A0E6-96AEC8258FB5}.Debug_Cairo|Win32.Build.0 = Debug|Win32
+ {1480CF5F-4160-47B5-A0E6-96AEC8258FB5}.Debug_Cairo|Win32.ActiveCfg = Debug_CFLite|Win32
+ {1480CF5F-4160-47B5-A0E6-96AEC8258FB5}.Debug_Cairo|Win32.Build.0 = Debug_CFLite|Win32
{1480CF5F-4160-47B5-A0E6-96AEC8258FB5}.Debug_Internal|Win32.ActiveCfg = Debug_Internal|Win32
{1480CF5F-4160-47B5-A0E6-96AEC8258FB5}.Debug_Internal|Win32.Build.0 = Debug_Internal|Win32
{1480CF5F-4160-47B5-A0E6-96AEC8258FB5}.Debug|Win32.ActiveCfg = Debug|Win32
{1480CF5F-4160-47B5-A0E6-96AEC8258FB5}.Debug|Win32.Build.0 = Debug|Win32
- {1480CF5F-4160-47B5-A0E6-96AEC8258FB5}.Release_Cairo|Win32.ActiveCfg = Release|Win32
- {1480CF5F-4160-47B5-A0E6-96AEC8258FB5}.Release_Cairo|Win32.Build.0 = Release|Win32
+ {1480CF5F-4160-47B5-A0E6-96AEC8258FB5}.Release_Cairo|Win32.ActiveCfg = Release_CFLite|Win32
+ {1480CF5F-4160-47B5-A0E6-96AEC8258FB5}.Release_Cairo|Win32.Build.0 = Release_CFLite|Win32
{1480CF5F-4160-47B5-A0E6-96AEC8258FB5}.Release|Win32.ActiveCfg = Release|Win32
{1480CF5F-4160-47B5-A0E6-96AEC8258FB5}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
diff --git a/WebKit/win/WebPreferenceKeysPrivate.h b/WebKit/win/WebPreferenceKeysPrivate.h
index f62905c..0b781d8 100644
--- a/WebKit/win/WebPreferenceKeysPrivate.h
+++ b/WebKit/win/WebPreferenceKeysPrivate.h
@@ -66,6 +66,7 @@
#define WebKitUsesPageCachePreferenceKey "WebKitUsesPageCachePreferenceKey"
#define WebKitCacheModelPreferenceKey "WebKitCacheModelPreferenceKey"
#define WebKitLocalStorageDatabasePathPreferenceKey "WebKitLocalStorageDatabasePath"
+#define WebKitHyperlinkAuditingEnabledPreferenceKey "WebKitHyperlinkAuditingEnabled"
// These are private both because callers should be using the cover methods and because the
// cover methods themselves are private.
diff --git a/WebKit/win/WebPreferences.cpp b/WebKit/win/WebPreferences.cpp
index 255b68e..d4bfd3e 100644
--- a/WebKit/win/WebPreferences.cpp
+++ b/WebKit/win/WebPreferences.cpp
@@ -264,6 +264,7 @@ void WebPreferences::initializeDefaultSettings()
CFDictionaryAddValue(defaults, CFSTR(WebKitDNSPrefetchingEnabledPreferenceKey), kCFBooleanTrue);
CFDictionaryAddValue(defaults, CFSTR(WebKitMemoryInfoEnabledPreferenceKey), kCFBooleanFalse);
+ CFDictionaryAddValue(defaults, CFSTR(WebKitHyperlinkAuditingEnabledPreferenceKey), kCFBooleanFalse);
defaultSettings = defaults;
}
@@ -1148,6 +1149,19 @@ HRESULT STDMETHODCALLTYPE WebPreferences::setEditingBehavior(
return S_OK;
}
+HRESULT STDMETHODCALLTYPE WebPreferences::hyperlinkAuditingEnabled(
+ /* [in] */ BOOL* enabled)
+{
+ *enabled = boolValueForKey(CFSTR(WebKitHyperlinkAuditingEnabledPreferenceKey));
+ return S_OK;
+}
+
+HRESULT STDMETHODCALLTYPE WebPreferences::setHyperlinkAuditingEnabled(
+ /* [retval][out] */ BOOL enabled)
+{
+ setBoolValue(CFSTR(WebKitHyperlinkAuditingEnabledPreferenceKey), enabled);
+ return S_OK;
+}
HRESULT STDMETHODCALLTYPE WebPreferences::cookieStorageAcceptPolicy(
/* [retval][out] */ WebKitCookieStorageAcceptPolicy *acceptPolicy )
diff --git a/WebKit/win/WebPreferences.h b/WebKit/win/WebPreferences.h
index 463e1b3..d09945a 100644
--- a/WebKit/win/WebPreferences.h
+++ b/WebKit/win/WebPreferences.h
@@ -426,6 +426,9 @@ public:
virtual HRESULT STDMETHODCALLTYPE setMemoryInfoEnabled(BOOL);
virtual HRESULT STDMETHODCALLTYPE memoryInfoEnabled(BOOL*);
+ virtual HRESULT STDMETHODCALLTYPE hyperlinkAuditingEnabled(BOOL*);
+ virtual HRESULT STDMETHODCALLTYPE setHyperlinkAuditingEnabled(BOOL);
+
// WebPreferences
// This method accesses a different preference key than developerExtrasEnabled.
diff --git a/WebKit/win/WebView.cpp b/WebKit/win/WebView.cpp
index 04794c9..547daf8 100755
--- a/WebKit/win/WebView.cpp
+++ b/WebKit/win/WebView.cpp
@@ -2561,12 +2561,18 @@ HRESULT STDMETHODCALLTYPE WebView::initWithFrame(
sharedPreferences->willAddToWebView();
m_preferences = sharedPreferences;
- InitializeLoggingChannelsIfNecessary();
+ static bool didOneTimeInitialization;
+ if (!didOneTimeInitialization) {
+ InitializeLoggingChannelsIfNecessary();
#if ENABLE(DATABASE)
- WebKitInitializeWebDatabasesIfNecessary();
+ WebKitInitializeWebDatabasesIfNecessary();
#endif
- WebKitSetApplicationCachePathIfNecessary();
- WebPlatformStrategies::initialize();
+ WebKitSetApplicationCachePathIfNecessary();
+ WebPlatformStrategies::initialize();
+ Settings::setMinDOMTimerInterval(0.004);
+
+ didOneTimeInitialization = true;
+ }
#if USE(SAFARI_THEME)
BOOL shouldPaintNativeControls;
@@ -2589,7 +2595,6 @@ HRESULT STDMETHODCALLTYPE WebView::initWithFrame(
pageClients.geolocationControllerClient = new WebGeolocationControllerClient(this);
#endif
m_page = new Page(pageClients);
- m_page->settings()->setMinDOMTimerInterval(0.004);
BSTR localStoragePath;
if (SUCCEEDED(m_preferences->localStorageDatabasePath(&localStoragePath))) {
@@ -4772,6 +4777,11 @@ HRESULT WebView::notifyPreferencesChanged(IWebNotification* notification)
if (FAILED(hr))
return hr;
settings->setMemoryInfoEnabled(enabled);
+
+ hr = prefsPrivate->hyperlinkAuditingEnabled(&enabled);
+ if (FAILED(hr))
+ return hr;
+ settings->setHyperlinkAuditingEnabled(enabled);
if (!m_closeWindowTimer)
m_mainFrame->invalidate(); // FIXME
diff --git a/WebKit/wince/ChangeLog b/WebKit/wince/ChangeLog
index fba4def..c85f902 100644
--- a/WebKit/wince/ChangeLog
+++ b/WebKit/wince/ChangeLog
@@ -1,3 +1,60 @@
+2010-09-28 Jenn Braithwaite <jennb@chromium.org>
+
+ Reviewed by Dmitry Titov.
+
+ Added oldPage param to FrameLoaderClient::didTransferChildFrameToNewDocument.
+ https://bugs.webkit.org/show_bug.cgi?id=46663
+
+ * WebCoreSupport/FrameLoaderClientWinCE.cpp:
+ (WebKit::FrameLoaderClientWinCE::didTransferChildFrameToNewDocument):
+ * WebCoreSupport/FrameLoaderClientWinCE.h:
+
+2010-09-23 Patrick Gansterer <paroga@webkit.org>
+
+ Reviewed by Adam Roben.
+
+ Add PlatformStrategiesWinCE
+ https://bugs.webkit.org/show_bug.cgi?id=46371
+
+ * WebCoreSupport/PlatformStrategiesWinCE.cpp: Copied from WebKit/win/WebCoreSupport/WebPlatformStrategies.cpp.
+ * WebCoreSupport/PlatformStrategiesWinCE.h: Copied from WebKit/win/WebCoreSupport/WebPlatformStrategies.h.
+
+2010-09-23 Patrick Gansterer <paroga@webkit.org>
+
+ Reviewed by Adam Roben.
+
+ Add ChromeClientWinCE
+ https://bugs.webkit.org/show_bug.cgi?id=46294
+
+ * WebCoreSupport/ChromeClientWinCE.cpp: Added.
+ * WebCoreSupport/ChromeClientWinCE.h: Added.
+
+2010-09-23 Patrick Gansterer <paroga@webkit.org>
+
+ Unreviewed.
+
+ Build fix for FrameLoaderClientWinCE.
+
+ * WebCoreSupport/FrameLoaderClientWinCE.cpp:
+ (WebKit::FrameLoaderClientWinCE::canShowMIMETypeAsHTML): Add missing method.
+ * WebCoreSupport/FrameLoaderClientWinCE.h:
+
+2010-09-21 Patrick Gansterer <paroga@webkit.org>
+
+ Reviewed by Adam Roben.
+
+ Add "WinCE" to classname for all WebCoreSupport classes to match filename.
+ https://bugs.webkit.org/show_bug.cgi?id=46175
+
+ * WebCoreSupport/ContextMenuClientWinCE.cpp: Rename ContextMenuClient to ContextMenuClientWinCE.
+ * WebCoreSupport/ContextMenuClientWinCE.h: Ditto.
+ * WebCoreSupport/DragClientWinCE.cpp: Rename DragClient to DragClientWinCE.
+ * WebCoreSupport/DragClientWinCE.h: Ditto.
+ * WebCoreSupport/EditorClientWinCE.cpp: Rename EditorClient to EditorClientWinCE.
+ * WebCoreSupport/EditorClientWinCE.h: Ditto.
+ * WebCoreSupport/InspectorClientWinCE.cpp: Rename InspectorClient to InspectorClientWinCE.
+ * WebCoreSupport/InspectorClientWinCE.h: Ditto.
+
2010-09-20 Patrick Gansterer <paroga@paroga.com>
Reviewed by Adam Roben.
diff --git a/WebKit/wince/WebCoreSupport/ChromeClientWinCE.cpp b/WebKit/wince/WebCoreSupport/ChromeClientWinCE.cpp
new file mode 100644
index 0000000..468d86c
--- /dev/null
+++ b/WebKit/wince/WebCoreSupport/ChromeClientWinCE.cpp
@@ -0,0 +1,393 @@
+/*
+ * Copyright (C) 2010 Patrick Gansterer <paroga@paroga.com>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * 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 "ChromeClientWinCE.h"
+
+#include "FileChooser.h"
+#include "Icon.h"
+#include "NotImplemented.h"
+#include "PopupMenuWin.h"
+#include "SearchPopupMenuWin.h"
+#include "WebView.h"
+#include <wtf/text/CString.h>
+
+using namespace WebCore;
+
+namespace WebKit {
+
+ChromeClientWinCE::ChromeClientWinCE(WebView* webView)
+ : m_webView(webView)
+{
+ ASSERT(m_webView);
+}
+
+void ChromeClientWinCE::chromeDestroyed()
+{
+ delete this;
+}
+
+FloatRect ChromeClientWinCE::windowRect()
+{
+ if (!m_webView)
+ return FloatRect();
+
+ RECT rect;
+ m_webView->frameRect(&rect);
+ return rect;
+}
+
+void ChromeClientWinCE::setWindowRect(const FloatRect&)
+{
+ notImplemented();
+}
+
+FloatRect ChromeClientWinCE::pageRect()
+{
+ return windowRect();
+}
+
+float ChromeClientWinCE::scaleFactor()
+{
+ return 1.0;
+}
+
+void ChromeClientWinCE::focus()
+{
+ notImplemented();
+}
+
+void ChromeClientWinCE::unfocus()
+{
+ notImplemented();
+}
+
+Page* ChromeClientWinCE::createWindow(Frame*, const FrameLoadRequest&, const WindowFeatures&)
+{
+ notImplemented();
+ return 0;
+}
+
+void ChromeClientWinCE::show()
+{
+ notImplemented();
+}
+
+bool ChromeClientWinCE::canRunModal()
+{
+ notImplemented();
+ return false;
+}
+
+void ChromeClientWinCE::runModal()
+{
+ notImplemented();
+}
+
+void ChromeClientWinCE::setToolbarsVisible(bool)
+{
+ notImplemented();
+}
+
+bool ChromeClientWinCE::toolbarsVisible()
+{
+ return false;
+}
+
+void ChromeClientWinCE::setStatusbarVisible(bool)
+{
+ notImplemented();
+}
+
+bool ChromeClientWinCE::statusbarVisible()
+{
+ notImplemented();
+ return false;
+}
+
+void ChromeClientWinCE::setScrollbarsVisible(bool)
+{
+ notImplemented();
+}
+
+bool ChromeClientWinCE::scrollbarsVisible()
+{
+ notImplemented();
+ return false;
+}
+
+void ChromeClientWinCE::setMenubarVisible(bool)
+{
+ notImplemented();
+}
+
+bool ChromeClientWinCE::menubarVisible()
+{
+ notImplemented();
+ return false;
+}
+
+void ChromeClientWinCE::setResizable(bool)
+{
+ notImplemented();
+}
+
+void ChromeClientWinCE::closeWindowSoon()
+{
+ PostMessageW(m_webView->windowHandle(), WM_CLOSE, 0, 0);
+}
+
+bool ChromeClientWinCE::canTakeFocus(FocusDirection)
+{
+ return true;
+}
+
+void ChromeClientWinCE::takeFocus(FocusDirection)
+{
+ unfocus();
+}
+
+void ChromeClientWinCE::focusedNodeChanged(Node*)
+{
+ notImplemented();
+}
+
+bool ChromeClientWinCE::canRunBeforeUnloadConfirmPanel()
+{
+ return true;
+}
+
+bool ChromeClientWinCE::runBeforeUnloadConfirmPanel(const String& message, Frame* frame)
+{
+ return runJavaScriptConfirm(frame, message);
+}
+
+void ChromeClientWinCE::addMessageToConsole(MessageSource, MessageType, MessageLevel, const String&, unsigned int, const String&)
+{
+ notImplemented();
+}
+
+void ChromeClientWinCE::runJavaScriptAlert(Frame*, const String& message)
+{
+ m_webView->runJavaScriptAlert(message);
+}
+
+bool ChromeClientWinCE::runJavaScriptConfirm(Frame*, const String& message)
+{
+ return m_webView->runJavaScriptConfirm(message);
+}
+
+bool ChromeClientWinCE::runJavaScriptPrompt(Frame*, const String& message, const String& defaultValue, String& result)
+{
+ return m_webView->runJavaScriptPrompt(message, defaultValue, result);
+}
+
+void ChromeClientWinCE::setStatusbarText(const String&)
+{
+ notImplemented();
+}
+
+bool ChromeClientWinCE::shouldInterruptJavaScript()
+{
+ notImplemented();
+ return false;
+}
+
+bool ChromeClientWinCE::tabsToLinks() const
+{
+ return true;
+}
+
+IntRect ChromeClientWinCE::windowResizerRect() const
+{
+ notImplemented();
+ return IntRect();
+}
+
+void ChromeClientWinCE::invalidateWindow(const IntRect&, bool)
+{
+ notImplemented();
+}
+
+void ChromeClientWinCE::invalidateContentsAndWindow(const IntRect& updateRect, bool immediate)
+{
+ RECT rect = updateRect;
+ InvalidateRect(m_webView->windowHandle(), &rect, FALSE);
+
+ if (immediate)
+ UpdateWindow(m_webView->windowHandle());
+}
+
+void ChromeClientWinCE::invalidateContentsForSlowScroll(const IntRect& updateRect, bool immediate)
+{
+ invalidateContentsAndWindow(updateRect, immediate);
+}
+
+void ChromeClientWinCE::scroll(const IntSize&, const IntRect& rectToScroll, const IntRect&)
+{
+ invalidateContentsAndWindow(rectToScroll, false);
+}
+
+IntRect ChromeClientWinCE::windowToScreen(const IntRect& rect) const
+{
+ notImplemented();
+ return rect;
+}
+
+IntPoint ChromeClientWinCE::screenToWindow(const IntPoint& point) const
+{
+ notImplemented();
+ return point;
+}
+
+PlatformPageClient ChromeClientWinCE::platformPageClient() const
+{
+ notImplemented();
+ return 0;
+}
+
+void ChromeClientWinCE::contentsSizeChanged(Frame*, const IntSize&) const
+{
+ notImplemented();
+}
+
+void ChromeClientWinCE::scrollRectIntoView(const IntRect&, const ScrollView*) const
+{
+ notImplemented();
+}
+
+void ChromeClientWinCE::scrollbarsModeDidChange() const
+{
+ notImplemented();
+}
+
+void ChromeClientWinCE::mouseDidMoveOverElement(const HitTestResult&, unsigned)
+{
+ notImplemented();
+}
+
+void ChromeClientWinCE::setToolTip(const String&, TextDirection)
+{
+ notImplemented();
+}
+
+void ChromeClientWinCE::print(Frame*)
+{
+ notImplemented();
+}
+
+#if ENABLE(DATABASE)
+void ChromeClientWinCE::exceededDatabaseQuota(Frame*, const String&)
+{
+ notImplemented()
+}
+#endif
+
+#if ENABLE(OFFLINE_WEB_APPLICATIONS)
+void ChromeClientWinCE::reachedMaxAppCacheSize(int64_t)
+{
+ notImplemented();
+}
+#endif
+
+#if ENABLE(TOUCH_EVENTS)
+void ChromeClientWinCE::needTouchEvents(bool)
+{
+ notImplemented();
+}
+#endif
+
+#if USE(ACCELERATED_COMPOSITING)
+void ChromeClientWinCE::attachRootGraphicsLayer(Frame*, GraphicsLayer*)
+{
+ notImplemented();
+}
+
+void ChromeClientWinCE::setNeedsOneShotDrawingSynchronization()
+{
+ notImplemented();
+}
+
+void ChromeClientWinCE::scheduleCompositingLayerSync()
+{
+ notImplemented();
+}
+#endif
+
+void ChromeClientWinCE::runOpenPanel(Frame*, PassRefPtr<FileChooser> prpFileChooser)
+{
+ notImplemented();
+}
+
+void ChromeClientWinCE::chooseIconForFiles(const Vector<String>& filenames, FileChooser* chooser)
+{
+ chooser->iconLoaded(Icon::createIconForFiles(filenames));
+}
+
+void ChromeClientWinCE::setCursor(const Cursor&)
+{
+ notImplemented();
+}
+
+void ChromeClientWinCE::setLastSetCursorToCurrentCursor()
+{
+ notImplemented();
+}
+
+void ChromeClientWinCE::formStateDidChange(const Node*)
+{
+ notImplemented();
+}
+
+PassOwnPtr<HTMLParserQuirks> ChromeClientWinCE::createHTMLParserQuirks()
+{
+ return 0;
+}
+
+void ChromeClientWinCE::requestGeolocationPermissionForFrame(Frame*, Geolocation*)
+{
+ notImplemented();
+}
+
+void ChromeClientWinCE::cancelGeolocationPermissionRequestForFrame(Frame*, Geolocation*)
+{
+ notImplemented();
+}
+
+bool ChromeClientWinCE::selectItemWritingDirectionIsNatural()
+{
+ return false;
+}
+
+PassRefPtr<PopupMenu> ChromeClientWinCE::createPopupMenu(PopupMenuClient* client) const
+{
+ return adoptRef(new PopupMenuWin(client));
+}
+
+PassRefPtr<SearchPopupMenu> ChromeClientWinCE::createSearchPopupMenu(PopupMenuClient* client) const
+{
+ return adoptRef(new SearchPopupMenuWin(client));
+}
+
+} // namespace WebKit
diff --git a/WebKit/wince/WebCoreSupport/ChromeClientWinCE.h b/WebKit/wince/WebCoreSupport/ChromeClientWinCE.h
new file mode 100644
index 0000000..be9f643
--- /dev/null
+++ b/WebKit/wince/WebCoreSupport/ChromeClientWinCE.h
@@ -0,0 +1,174 @@
+/*
+ * Copyright (C) 2010 Patrick Gansterer <paroga@paroga.com>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * 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 ChromeClientWinCE_h
+#define ChromeClientWinCE_h
+
+#include "ChromeClient.h"
+
+class WebView;
+
+namespace WebKit {
+
+class ChromeClientWinCE : public WebCore::ChromeClient {
+public:
+ ChromeClientWinCE(WebView* webView);
+
+ virtual void chromeDestroyed();
+
+ virtual void setWindowRect(const WebCore::FloatRect&);
+ virtual WebCore::FloatRect windowRect();
+
+ virtual WebCore::FloatRect pageRect();
+
+ virtual float scaleFactor();
+
+ virtual void focus();
+ virtual void unfocus();
+
+ virtual bool canTakeFocus(WebCore::FocusDirection);
+ virtual void takeFocus(WebCore::FocusDirection);
+
+ virtual void focusedNodeChanged(WebCore::Node*);
+
+ // The Frame pointer provides the ChromeClient with context about which
+ // Frame wants to create the new Page. Also, the newly created window
+ // should not be shown to the user until the ChromeClient of the newly
+ // created Page has its show method called.
+ virtual WebCore::Page* createWindow(WebCore::Frame*, const WebCore::FrameLoadRequest&, const WebCore::WindowFeatures&);
+ virtual void show();
+
+ virtual bool canRunModal();
+ virtual void runModal();
+
+ virtual void setToolbarsVisible(bool);
+ virtual bool toolbarsVisible();
+
+ virtual void setStatusbarVisible(bool);
+ virtual bool statusbarVisible();
+
+ virtual void setScrollbarsVisible(bool);
+ virtual bool scrollbarsVisible();
+
+ virtual void setMenubarVisible(bool);
+ virtual bool menubarVisible();
+
+ virtual void setResizable(bool);
+
+ virtual void addMessageToConsole(WebCore::MessageSource, WebCore::MessageType, WebCore::MessageLevel, const WTF::String& message, unsigned int lineNumber, const WTF::String& sourceID);
+
+ virtual bool canRunBeforeUnloadConfirmPanel();
+ virtual bool runBeforeUnloadConfirmPanel(const WTF::String& message, WebCore::Frame* frame);
+
+ virtual void closeWindowSoon();
+
+ virtual void runJavaScriptAlert(WebCore::Frame*, const WTF::String&);
+ virtual bool runJavaScriptConfirm(WebCore::Frame*, const WTF::String&);
+ virtual bool runJavaScriptPrompt(WebCore::Frame*, const WTF::String& message, const WTF::String& defaultValue, WTF::String& result);
+ virtual void setStatusbarText(const WTF::String&);
+ virtual bool shouldInterruptJavaScript();
+ virtual bool tabsToLinks() const;
+
+ virtual WebCore::IntRect windowResizerRect() const;
+
+ // Methods used by HostWindow.
+ virtual void invalidateWindow(const WebCore::IntRect&, bool);
+ virtual void invalidateContentsAndWindow(const WebCore::IntRect&, bool);
+ virtual void invalidateContentsForSlowScroll(const WebCore::IntRect&, bool);
+ virtual void scroll(const WebCore::IntSize&, const WebCore::IntRect&, const WebCore::IntRect&);
+ virtual WebCore::IntPoint screenToWindow(const WebCore::IntPoint&) const;
+ virtual WebCore::IntRect windowToScreen(const WebCore::IntRect&) const;
+ virtual PlatformPageClient platformPageClient() const;
+ virtual void contentsSizeChanged(WebCore::Frame*, const WebCore::IntSize&) const;
+ virtual void scrollRectIntoView(const WebCore::IntRect&, const WebCore::ScrollView*) const; // Currently only Mac has a non empty implementation.
+ virtual void scrollbarsModeDidChange() const;
+ virtual void setCursor(const WebCore::Cursor&);
+ // End methods used by HostWindow.
+
+ virtual void mouseDidMoveOverElement(const WebCore::HitTestResult&, unsigned modifierFlags);
+
+ virtual void setToolTip(const WTF::String&, WebCore::TextDirection);
+
+ virtual void print(WebCore::Frame*);
+
+#if ENABLE(DATABASE)
+ virtual void exceededDatabaseQuota(WebCore::Frame*, const WTF::String& databaseName) = 0;
+#endif
+
+#if ENABLE(OFFLINE_WEB_APPLICATIONS)
+ // Callback invoked when the application cache fails to save a cache object
+ // because storing it would grow the database file past its defined maximum
+ // size or past the amount of free space on the device.
+ // The chrome client would need to take some action such as evicting some
+ // old caches.
+ virtual void reachedMaxAppCacheSize(int64_t spaceNeeded) = 0;
+#endif
+
+#if ENABLE(NOTIFICATIONS)
+ virtual WebCore::NotificationPresenter* notificationPresenter() const = 0;
+#endif
+
+ // This can be either a synchronous or asynchronous call. The ChromeClient can display UI asking the user for permission
+ // to use Geolocation.
+ virtual void requestGeolocationPermissionForFrame(WebCore::Frame*, WebCore::Geolocation*);
+ virtual void cancelGeolocationPermissionRequestForFrame(WebCore::Frame*, WebCore::Geolocation*);
+
+ virtual void runOpenPanel(WebCore::Frame*, PassRefPtr<WebCore::FileChooser>);
+ // Asynchronous request to load an icon for specified filenames.
+ virtual void chooseIconForFiles(const Vector<WTF::String>&, WebCore::FileChooser*);
+
+ // Notification that the given form element has changed. This function
+ // will be called frequently, so handling should be very fast.
+ virtual void formStateDidChange(const WebCore::Node*);
+
+ virtual PassOwnPtr<WebCore::HTMLParserQuirks> createHTMLParserQuirks();
+
+#if USE(ACCELERATED_COMPOSITING)
+ // Pass 0 as the GraphicsLayer to detatch the root layer.
+ virtual void attachRootGraphicsLayer(WebCore::Frame*, WebCore::GraphicsLayer*);
+ // Sets a flag to specify that the next time content is drawn to the window,
+ // the changes appear on the screen in synchrony with updates to GraphicsLayers.
+ virtual void setNeedsOneShotDrawingSynchronization();
+ // Sets a flag to specify that the view needs to be updated, so we need
+ // to do an eager layout before the drawing.
+ virtual void scheduleCompositingLayerSync();
+#endif
+
+ virtual void setLastSetCursorToCurrentCursor();
+
+#if ENABLE(TOUCH_EVENTS)
+ virtual void needTouchEvents(bool);
+#endif
+
+ virtual bool selectItemWritingDirectionIsNatural();
+ virtual PassRefPtr<WebCore::PopupMenu> createPopupMenu(WebCore::PopupMenuClient*) const;
+ virtual PassRefPtr<WebCore::SearchPopupMenu> createSearchPopupMenu(WebCore::PopupMenuClient*) const;
+
+private:
+ WebView* m_webView;
+};
+
+} // namespace WebKit
+
+#endif // ChromeClientWinCE_h
diff --git a/WebKit/wince/WebCoreSupport/ContextMenuClientWinCE.cpp b/WebKit/wince/WebCoreSupport/ContextMenuClientWinCE.cpp
index 011c2ea..7358f2a 100644
--- a/WebKit/wince/WebCoreSupport/ContextMenuClientWinCE.cpp
+++ b/WebKit/wince/WebCoreSupport/ContextMenuClientWinCE.cpp
@@ -32,57 +32,57 @@ using namespace WebCore;
namespace WebKit {
-ContextMenuClient::ContextMenuClient(WebView *webView)
+ContextMenuClientWinCE::ContextMenuClientWinCE(WebView *webView)
: m_webView(webView)
{
}
-void ContextMenuClient::contextMenuDestroyed()
+void ContextMenuClientWinCE::contextMenuDestroyed()
{
delete this;
}
-PlatformMenuDescription ContextMenuClient::getCustomMenuFromDefaultItems(ContextMenu* menu)
+PlatformMenuDescription ContextMenuClientWinCE::getCustomMenuFromDefaultItems(ContextMenu* menu)
{
return menu->releasePlatformDescription();
}
-void ContextMenuClient::contextMenuItemSelected(ContextMenuItem*, const ContextMenu*)
+void ContextMenuClientWinCE::contextMenuItemSelected(ContextMenuItem*, const ContextMenu*)
{
notImplemented();
}
-void ContextMenuClient::downloadURL(const KURL& url)
+void ContextMenuClientWinCE::downloadURL(const KURL& url)
{
notImplemented();
}
-void ContextMenuClient::copyImageToClipboard(const HitTestResult&)
+void ContextMenuClientWinCE::copyImageToClipboard(const HitTestResult&)
{
notImplemented();
}
-void ContextMenuClient::searchWithGoogle(const Frame*)
+void ContextMenuClientWinCE::searchWithGoogle(const Frame*)
{
notImplemented();
}
-void ContextMenuClient::lookUpInDictionary(Frame*)
+void ContextMenuClientWinCE::lookUpInDictionary(Frame*)
{
notImplemented();
}
-void ContextMenuClient::speak(const String&)
+void ContextMenuClientWinCE::speak(const String&)
{
notImplemented();
}
-void ContextMenuClient::stopSpeaking()
+void ContextMenuClientWinCE::stopSpeaking()
{
notImplemented();
}
-bool ContextMenuClient::isSpeaking()
+bool ContextMenuClientWinCE::isSpeaking()
{
notImplemented();
return false;
diff --git a/WebKit/wince/WebCoreSupport/ContextMenuClientWinCE.h b/WebKit/wince/WebCoreSupport/ContextMenuClientWinCE.h
index 3d51f3c..13d91d1 100644
--- a/WebKit/wince/WebCoreSupport/ContextMenuClientWinCE.h
+++ b/WebKit/wince/WebCoreSupport/ContextMenuClientWinCE.h
@@ -31,9 +31,9 @@ class WebView;
namespace WebKit {
-class ContextMenuClient : public WebCore::ContextMenuClient {
+class ContextMenuClientWinCE : public WebCore::ContextMenuClient {
public:
- ContextMenuClient(WebView*);
+ ContextMenuClientWinCE(WebView*);
virtual void contextMenuDestroyed();
diff --git a/WebKit/wince/WebCoreSupport/DragClientWinCE.cpp b/WebKit/wince/WebCoreSupport/DragClientWinCE.cpp
index cd94547..1fc4379 100644
--- a/WebKit/wince/WebCoreSupport/DragClientWinCE.cpp
+++ b/WebKit/wince/WebCoreSupport/DragClientWinCE.cpp
@@ -31,40 +31,40 @@ using namespace WebCore;
namespace WebKit {
-void DragClient::willPerformDragDestinationAction(DragDestinationAction, DragData*)
+void DragClientWinCE::willPerformDragDestinationAction(DragDestinationAction, DragData*)
{
notImplemented();
}
-void DragClient::willPerformDragSourceAction(DragSourceAction, const IntPoint&, Clipboard*)
+void DragClientWinCE::willPerformDragSourceAction(DragSourceAction, const IntPoint&, Clipboard*)
{
notImplemented();
}
-DragDestinationAction DragClient::actionMaskForDrag(DragData*)
+DragDestinationAction DragClientWinCE::actionMaskForDrag(DragData*)
{
notImplemented();
return DragDestinationActionAny;
}
-DragSourceAction DragClient::dragSourceActionMaskForPoint(const IntPoint&)
+DragSourceAction DragClientWinCE::dragSourceActionMaskForPoint(const IntPoint&)
{
notImplemented();
return DragSourceActionAny;
}
-void DragClient::startDrag(DragImageRef, const IntPoint&, const IntPoint&, Clipboard*, Frame*, bool)
+void DragClientWinCE::startDrag(DragImageRef, const IntPoint&, const IntPoint&, Clipboard*, Frame*, bool)
{
notImplemented();
}
-DragImageRef DragClient::createDragImageForLink(KURL&, const String& label, Frame*)
+DragImageRef DragClientWinCE::createDragImageForLink(KURL&, const String& label, Frame*)
{
notImplemented();
return 0;
}
-void DragClient::dragControllerDestroyed()
+void DragClientWinCE::dragControllerDestroyed()
{
delete this;
}
diff --git a/WebKit/wince/WebCoreSupport/DragClientWinCE.h b/WebKit/wince/WebCoreSupport/DragClientWinCE.h
index 01dba3c..dc5168c 100644
--- a/WebKit/wince/WebCoreSupport/DragClientWinCE.h
+++ b/WebKit/wince/WebCoreSupport/DragClientWinCE.h
@@ -29,7 +29,7 @@
namespace WebKit {
-class DragClient : public WebCore::DragClient {
+class DragClientWinCE : public WebCore::DragClient {
public:
virtual void willPerformDragDestinationAction(WebCore::DragDestinationAction, WebCore::DragData*);
virtual void willPerformDragSourceAction(WebCore::DragSourceAction, const WebCore::IntPoint&, WebCore::Clipboard*);
diff --git a/WebKit/wince/WebCoreSupport/EditorClientWinCE.cpp b/WebKit/wince/WebCoreSupport/EditorClientWinCE.cpp
index d81fc02..a806cf9 100644
--- a/WebKit/wince/WebCoreSupport/EditorClientWinCE.cpp
+++ b/WebKit/wince/WebCoreSupport/EditorClientWinCE.cpp
@@ -32,282 +32,282 @@ using namespace WebCore;
namespace WebKit {
-EditorClient::EditorClient(WebView* webView)
+EditorClientWinCE::EditorClientWinCE(WebView* webView)
: m_webView(webView)
{
}
-EditorClient::~EditorClient()
+EditorClientWinCE::~EditorClientWinCE()
{
}
-void EditorClient::setInputMethodState(bool active)
+void EditorClientWinCE::setInputMethodState(bool active)
{
notImplemented();
}
-bool EditorClient::shouldDeleteRange(Range*)
+bool EditorClientWinCE::shouldDeleteRange(Range*)
{
notImplemented();
return true;
}
-bool EditorClient::shouldShowDeleteInterface(HTMLElement*)
+bool EditorClientWinCE::shouldShowDeleteInterface(HTMLElement*)
{
return false;
}
-bool EditorClient::isContinuousSpellCheckingEnabled()
+bool EditorClientWinCE::isContinuousSpellCheckingEnabled()
{
notImplemented();
return false;
}
-bool EditorClient::isGrammarCheckingEnabled()
+bool EditorClientWinCE::isGrammarCheckingEnabled()
{
notImplemented();
return false;
}
-int EditorClient::spellCheckerDocumentTag()
+int EditorClientWinCE::spellCheckerDocumentTag()
{
notImplemented();
return 0;
}
-bool EditorClient::shouldBeginEditing(WebCore::Range*)
+bool EditorClientWinCE::shouldBeginEditing(WebCore::Range*)
{
notImplemented();
return true;
}
-bool EditorClient::shouldEndEditing(WebCore::Range*)
+bool EditorClientWinCE::shouldEndEditing(WebCore::Range*)
{
notImplemented();
return true;
}
-bool EditorClient::shouldInsertText(const String&, Range*, EditorInsertAction)
+bool EditorClientWinCE::shouldInsertText(const String&, Range*, EditorInsertAction)
{
notImplemented();
return true;
}
-bool EditorClient::shouldChangeSelectedRange(Range*, Range*, EAffinity, bool)
+bool EditorClientWinCE::shouldChangeSelectedRange(Range*, Range*, EAffinity, bool)
{
notImplemented();
return true;
}
-bool EditorClient::shouldApplyStyle(WebCore::CSSStyleDeclaration*, WebCore::Range*)
+bool EditorClientWinCE::shouldApplyStyle(WebCore::CSSStyleDeclaration*, WebCore::Range*)
{
notImplemented();
return true;
}
-bool EditorClient::shouldMoveRangeAfterDelete(WebCore::Range*, WebCore::Range*)
+bool EditorClientWinCE::shouldMoveRangeAfterDelete(WebCore::Range*, WebCore::Range*)
{
notImplemented();
return true;
}
-void EditorClient::didBeginEditing()
+void EditorClientWinCE::didBeginEditing()
{
notImplemented();
}
-void EditorClient::respondToChangedContents()
+void EditorClientWinCE::respondToChangedContents()
{
notImplemented();
}
-void EditorClient::respondToChangedSelection()
+void EditorClientWinCE::respondToChangedSelection()
{
notImplemented();
}
-void EditorClient::didEndEditing()
+void EditorClientWinCE::didEndEditing()
{
notImplemented();
}
-void EditorClient::didWriteSelectionToPasteboard()
+void EditorClientWinCE::didWriteSelectionToPasteboard()
{
notImplemented();
}
-void EditorClient::didSetSelectionTypesForPasteboard()
+void EditorClientWinCE::didSetSelectionTypesForPasteboard()
{
notImplemented();
}
-bool EditorClient::isEditable()
+bool EditorClientWinCE::isEditable()
{
notImplemented();
return false;
}
-void EditorClient::registerCommandForUndo(WTF::PassRefPtr<WebCore::EditCommand> command)
+void EditorClientWinCE::registerCommandForUndo(WTF::PassRefPtr<WebCore::EditCommand> command)
{
notImplemented();
}
-void EditorClient::registerCommandForRedo(WTF::PassRefPtr<WebCore::EditCommand> command)
+void EditorClientWinCE::registerCommandForRedo(WTF::PassRefPtr<WebCore::EditCommand> command)
{
notImplemented();
}
-void EditorClient::clearUndoRedoOperations()
+void EditorClientWinCE::clearUndoRedoOperations()
{
notImplemented();
}
-bool EditorClient::canUndo() const
+bool EditorClientWinCE::canUndo() const
{
notImplemented();
return false;
}
-bool EditorClient::canRedo() const
+bool EditorClientWinCE::canRedo() const
{
notImplemented();
return false;
}
-void EditorClient::undo()
+void EditorClientWinCE::undo()
{
notImplemented();
}
-void EditorClient::redo()
+void EditorClientWinCE::redo()
{
notImplemented();
}
-bool EditorClient::shouldInsertNode(Node*, Range*, EditorInsertAction)
+bool EditorClientWinCE::shouldInsertNode(Node*, Range*, EditorInsertAction)
{
notImplemented();
return true;
}
-void EditorClient::pageDestroyed()
+void EditorClientWinCE::pageDestroyed()
{
delete this;
}
-bool EditorClient::smartInsertDeleteEnabled()
+bool EditorClientWinCE::smartInsertDeleteEnabled()
{
notImplemented();
return false;
}
-bool EditorClient::isSelectTrailingWhitespaceEnabled()
+bool EditorClientWinCE::isSelectTrailingWhitespaceEnabled()
{
notImplemented();
return false;
}
-void EditorClient::toggleContinuousSpellChecking()
+void EditorClientWinCE::toggleContinuousSpellChecking()
{
notImplemented();
}
-void EditorClient::toggleGrammarChecking()
+void EditorClientWinCE::toggleGrammarChecking()
{
notImplemented();
}
-void EditorClient::handleKeyboardEvent(KeyboardEvent* event)
+void EditorClientWinCE::handleKeyboardEvent(KeyboardEvent* event)
{
notImplemented();
}
-void EditorClient::handleInputMethodKeydown(KeyboardEvent* event)
+void EditorClientWinCE::handleInputMethodKeydown(KeyboardEvent* event)
{
notImplemented();
}
-void EditorClient::textFieldDidBeginEditing(Element*)
+void EditorClientWinCE::textFieldDidBeginEditing(Element*)
{
}
-void EditorClient::textFieldDidEndEditing(Element*)
+void EditorClientWinCE::textFieldDidEndEditing(Element*)
{
}
-void EditorClient::textDidChangeInTextField(Element*)
+void EditorClientWinCE::textDidChangeInTextField(Element*)
{
}
-bool EditorClient::doTextFieldCommandFromEvent(Element*, KeyboardEvent*)
+bool EditorClientWinCE::doTextFieldCommandFromEvent(Element*, KeyboardEvent*)
{
return false;
}
-void EditorClient::textWillBeDeletedInTextField(Element*)
+void EditorClientWinCE::textWillBeDeletedInTextField(Element*)
{
notImplemented();
}
-void EditorClient::textDidChangeInTextArea(Element*)
+void EditorClientWinCE::textDidChangeInTextArea(Element*)
{
notImplemented();
}
-void EditorClient::ignoreWordInSpellDocument(const String& text)
+void EditorClientWinCE::ignoreWordInSpellDocument(const String& text)
{
notImplemented();
}
-void EditorClient::learnWord(const String& text)
+void EditorClientWinCE::learnWord(const String& text)
{
notImplemented();
}
-void EditorClient::checkSpellingOfString(const UChar* text, int length, int* misspellingLocation, int* misspellingLength)
+void EditorClientWinCE::checkSpellingOfString(const UChar* text, int length, int* misspellingLocation, int* misspellingLength)
{
notImplemented();
}
-String EditorClient::getAutoCorrectSuggestionForMisspelledWord(const String& inputWord)
+String EditorClientWinCE::getAutoCorrectSuggestionForMisspelledWord(const String& inputWord)
{
// This method can be implemented using customized algorithms for the particular browser.
// Currently, it computes an empty string.
return String();
}
-void EditorClient::checkGrammarOfString(const UChar*, int, Vector<GrammarDetail>&, int*, int*)
+void EditorClientWinCE::checkGrammarOfString(const UChar*, int, Vector<GrammarDetail>&, int*, int*)
{
notImplemented();
}
-void EditorClient::updateSpellingUIWithGrammarString(const String&, const GrammarDetail&)
+void EditorClientWinCE::updateSpellingUIWithGrammarString(const String&, const GrammarDetail&)
{
notImplemented();
}
-void EditorClient::updateSpellingUIWithMisspelledWord(const String&)
+void EditorClientWinCE::updateSpellingUIWithMisspelledWord(const String&)
{
notImplemented();
}
-void EditorClient::showSpellingUI(bool)
+void EditorClientWinCE::showSpellingUI(bool)
{
notImplemented();
}
-bool EditorClient::spellingUIIsShowing()
+bool EditorClientWinCE::spellingUIIsShowing()
{
notImplemented();
return false;
}
-void EditorClient::getGuessesForWord(const String& word, WTF::Vector<String>& guesses)
+void EditorClientWinCE::getGuessesForWord(const String& word, WTF::Vector<String>& guesses)
{
notImplemented();
}
-void EditorClient::willSetInputMethodState()
+void EditorClientWinCE::willSetInputMethodState()
{
notImplemented();
}
diff --git a/WebKit/wince/WebCoreSupport/EditorClientWinCE.h b/WebKit/wince/WebCoreSupport/EditorClientWinCE.h
index 943f591..0ad0a19 100644
--- a/WebKit/wince/WebCoreSupport/EditorClientWinCE.h
+++ b/WebKit/wince/WebCoreSupport/EditorClientWinCE.h
@@ -31,10 +31,10 @@ class WebView;
namespace WebKit {
-class EditorClient : public WebCore::EditorClient {
+class EditorClientWinCE : public WebCore::EditorClient {
public:
- EditorClient(WebView*);
- ~EditorClient();
+ EditorClientWinCE(WebView*);
+ ~EditorClientWinCE();
virtual void pageDestroyed();
diff --git a/WebKit/wince/WebCoreSupport/FrameLoaderClientWinCE.cpp b/WebKit/wince/WebCoreSupport/FrameLoaderClientWinCE.cpp
index b11df84..e841ab9 100644
--- a/WebKit/wince/WebCoreSupport/FrameLoaderClientWinCE.cpp
+++ b/WebKit/wince/WebCoreSupport/FrameLoaderClientWinCE.cpp
@@ -32,6 +32,7 @@
#include "HTMLFormElement.h"
#include "MIMETypeRegistry.h"
#include "NotImplemented.h"
+#include "Page.h"
#include "PluginDatabase.h"
#include "RenderPart.h"
#include "WebView.h"
@@ -160,7 +161,7 @@ PassRefPtr<Frame> FrameLoaderClientWinCE::createFrame(const KURL& url, const Str
return m_webView->createFrame(url, name, ownerElement, referrer, allowsScrolling, marginWidth, marginHeight);
}
-void FrameLoaderClientWinCE::didTransferChildFrameToNewDocument()
+void FrameLoaderClientWinCE::didTransferChildFrameToNewDocument(Page*)
{
}
@@ -424,6 +425,12 @@ bool FrameLoaderClientWinCE::canShowMIMEType(const String& type) const
|| PluginDatabase::installedPlugins()->isMIMETypeRegistered(type));
}
+bool FrameLoaderClientWinCE::canShowMIMETypeAsHTML(const String&) const
+{
+ notImplemented();
+ return false;
+}
+
bool FrameLoaderClientWinCE::representationExistsForURLScheme(const String&) const
{
notImplemented();
diff --git a/WebKit/wince/WebCoreSupport/FrameLoaderClientWinCE.h b/WebKit/wince/WebCoreSupport/FrameLoaderClientWinCE.h
index 94810bc..b64efed 100644
--- a/WebKit/wince/WebCoreSupport/FrameLoaderClientWinCE.h
+++ b/WebKit/wince/WebCoreSupport/FrameLoaderClientWinCE.h
@@ -108,7 +108,7 @@ public:
virtual PassRefPtr<WebCore::Frame> createFrame(const WebCore::KURL& url, const WTF::String& name, WebCore::HTMLFrameOwnerElement* ownerElement,
const WTF::String& referrer, bool allowsScrolling, int marginWidth, int marginHeight);
- virtual void didTransferChildFrameToNewDocument();
+ virtual void didTransferChildFrameToNewDocument(WebCore::Page*);
virtual PassRefPtr<WebCore::Widget> createPlugin(const WebCore::IntSize&, WebCore::HTMLPlugInElement*, const WebCore::KURL&, const WTF::Vector<WTF::String>&, const WTF::Vector<WTF::String>&, const WTF::String&, bool);
virtual void redirectDataToPlugin(WebCore::Widget* pluginWidget);
virtual PassRefPtr<WebCore::Widget> createJavaAppletWidget(const WebCore::IntSize&, WebCore::HTMLAppletElement*, const WebCore::KURL& baseURL, const WTF::Vector<WTF::String>& paramNames, const WTF::Vector<WTF::String>& paramValues);
@@ -154,6 +154,7 @@ public:
virtual bool canHandleRequest(const WebCore::ResourceRequest&) const;
virtual bool canShowMIMEType(const WTF::String&) const;
+ virtual bool canShowMIMETypeAsHTML(const WTF::String&) const;
virtual bool representationExistsForURLScheme(const WTF::String&) const;
virtual WTF::String generatedMIMETypeForURLScheme(const WTF::String&) const;
diff --git a/WebKit/wince/WebCoreSupport/InspectorClientWinCE.cpp b/WebKit/wince/WebCoreSupport/InspectorClientWinCE.cpp
index debc611..5168885 100644
--- a/WebKit/wince/WebCoreSupport/InspectorClientWinCE.cpp
+++ b/WebKit/wince/WebCoreSupport/InspectorClientWinCE.cpp
@@ -31,51 +31,51 @@ using namespace WebCore;
namespace WebKit {
-InspectorClient::InspectorClient(WebView* webView)
+InspectorClientWinCE::InspectorClientWinCE(WebView* webView)
: m_inspectedWebView(webView)
{
}
-InspectorClient::~InspectorClient()
+InspectorClientWinCE::~InspectorClientWinCE()
{
}
-void InspectorClient::inspectorDestroyed()
+void InspectorClientWinCE::inspectorDestroyed()
{
delete this;
}
-void InspectorClient::openInspectorFrontend(InspectorController* controller)
+void InspectorClientWinCE::openInspectorFrontend(InspectorController* controller)
{
notImplemented();
}
-void InspectorClient::releaseFrontendPage()
+void InspectorClientWinCE::releaseFrontendPage()
{
notImplemented();
}
-void InspectorClient::highlight(Node* node)
+void InspectorClientWinCE::highlight(Node* node)
{
notImplemented();
}
-void InspectorClient::hideHighlight()
+void InspectorClientWinCE::hideHighlight()
{
notImplemented();
}
-void InspectorClient::populateSetting(const String& key, String* value)
+void InspectorClientWinCE::populateSetting(const String& key, String* value)
{
notImplemented();
}
-void InspectorClient::storeSetting(const String& key, const String& value)
+void InspectorClientWinCE::storeSetting(const String& key, const String& value)
{
notImplemented();
}
-bool InspectorClient::sendMessageToFrontend(const String& message)
+bool InspectorClientWinCE::sendMessageToFrontend(const String& message)
{
notImplemented();
return false;
diff --git a/WebKit/wince/WebCoreSupport/InspectorClientWinCE.h b/WebKit/wince/WebCoreSupport/InspectorClientWinCE.h
index 45fcc5b..37d7577 100644
--- a/WebKit/wince/WebCoreSupport/InspectorClientWinCE.h
+++ b/WebKit/wince/WebCoreSupport/InspectorClientWinCE.h
@@ -31,10 +31,10 @@ class WebView;
namespace WebKit {
-class InspectorClient : public WebCore::InspectorClient {
+class InspectorClientWinCE : public WebCore::InspectorClient {
public:
- InspectorClient(WebView* webView);
- ~InspectorClient();
+ InspectorClientWinCE(WebView* webView);
+ ~InspectorClientWinCE();
virtual void inspectorDestroyed();
diff --git a/WebKit/wince/WebCoreSupport/PlatformStrategiesWinCE.cpp b/WebKit/wince/WebCoreSupport/PlatformStrategiesWinCE.cpp
new file mode 100644
index 0000000..514fdf4
--- /dev/null
+++ b/WebKit/wince/WebCoreSupport/PlatformStrategiesWinCE.cpp
@@ -0,0 +1,663 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ * Copyright (C) 2010 Patrick Gansterer <paroga@paroga.com>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * 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 "PlatformStrategiesWinCE.h"
+
+#include "IntSize.h"
+#include "MathExtras.h"
+#include "Page.h"
+#include "PageGroup.h"
+#include "PluginDatabase.h"
+#include <wtf/text/CString.h>
+
+#define UI_STRING(text, desciprion) text
+#define UI_STRING_KEY(text, key, desciprion) text
+
+using namespace WebCore;
+
+void PlatformStrategiesWinCE::initialize()
+{
+ DEFINE_STATIC_LOCAL(PlatformStrategiesWinCE, platformStrategies, ());
+}
+
+PlatformStrategiesWinCE::PlatformStrategiesWinCE()
+{
+ setPlatformStrategies(this);
+}
+
+// PluginStrategy
+
+PluginStrategy* PlatformStrategiesWinCE::createPluginStrategy()
+{
+ return this;
+}
+
+LocalizationStrategy* PlatformStrategiesWinCE::createLocalizationStrategy()
+{
+ return this;
+}
+
+VisitedLinkStrategy* PlatformStrategiesWinCE::createVisitedLinkStrategy()
+{
+ return this;
+}
+
+void PlatformStrategiesWinCE::refreshPlugins()
+{
+ PluginDatabase::installedPlugins()->refresh();
+}
+
+void PlatformStrategiesWinCE::getPluginInfo(const Page*, Vector<PluginInfo>& outPlugins)
+{
+ const Vector<PluginPackage*>& plugins = PluginDatabase::installedPlugins()->plugins();
+
+ outPlugins.resize(plugins.size());
+
+ for (size_t i = 0; i < plugins.size(); ++i) {
+ PluginPackage* package = plugins[i];
+
+ PluginInfo info;
+ info.name = package->name();
+ info.file = package->fileName();
+ info.desc = package->description();
+
+ const MIMEToDescriptionsMap& mimeToDescriptions = package->mimeToDescriptions();
+
+ info.mimes.reserveCapacity(mimeToDescriptions.size());
+
+ MIMEToDescriptionsMap::const_iterator end = mimeToDescriptions.end();
+ for (MIMEToDescriptionsMap::const_iterator it = mimeToDescriptions.begin(); it != end; ++it) {
+ MimeClassInfo mime;
+
+ mime.type = it->first;
+ mime.desc = it->second;
+ mime.extensions = package->mimeToExtensions().get(mime.type);
+
+ info.mimes.append(mime);
+ }
+
+ outPlugins[i] = info;
+ }
+}
+
+// LocalizationStrategy
+
+String PlatformStrategiesWinCE::searchableIndexIntroduction()
+{
+ return UI_STRING("This is a searchable index. Enter search keywords: ", "text that appears at the start of nearly-obsolete web pages in the form of a 'searchable index'");
+}
+
+String PlatformStrategiesWinCE::submitButtonDefaultLabel()
+{
+ return UI_STRING("Submit", "default label for Submit buttons in forms on web pages");
+}
+
+String PlatformStrategiesWinCE::inputElementAltText()
+{
+ return UI_STRING_KEY("Submit", "Submit (input element)", "alt text for <input> elements with no alt, title, or value");
+}
+
+String PlatformStrategiesWinCE::resetButtonDefaultLabel()
+{
+ return UI_STRING("Reset", "default label for Reset buttons in forms on web pages");
+}
+
+String PlatformStrategiesWinCE::fileButtonChooseFileLabel()
+{
+ return UI_STRING("Choose File", "title for file button used in HTML forms");
+}
+
+String PlatformStrategiesWinCE::fileButtonNoFileSelectedLabel()
+{
+ return UI_STRING("no file selected", "text to display in file button used in HTML forms when no file is selected");
+}
+
+String PlatformStrategiesWinCE::contextMenuItemTagOpenLinkInNewWindow()
+{
+ return UI_STRING("Open Link in New Window", "Open in New Window context menu item");
+}
+
+String PlatformStrategiesWinCE::contextMenuItemTagDownloadLinkToDisk()
+{
+ return UI_STRING("Download Linked File", "Download Linked File context menu item");
+}
+
+String PlatformStrategiesWinCE::contextMenuItemTagCopyLinkToClipboard()
+{
+ return UI_STRING("Copy Link", "Copy Link context menu item");
+}
+
+String PlatformStrategiesWinCE::contextMenuItemTagOpenImageInNewWindow()
+{
+ return UI_STRING("Open Image in New Window", "Open Image in New Window context menu item");
+}
+
+String PlatformStrategiesWinCE::contextMenuItemTagDownloadImageToDisk()
+{
+ return UI_STRING("Download Image", "Download Image context menu item");
+}
+
+String PlatformStrategiesWinCE::contextMenuItemTagCopyImageToClipboard()
+{
+ return UI_STRING("Copy Image", "Copy Image context menu item");
+}
+
+String PlatformStrategiesWinCE::contextMenuItemTagOpenVideoInNewWindow()
+{
+ return UI_STRING("Open Video in New Window", "Open Video in New Window context menu item");
+}
+
+String PlatformStrategiesWinCE::contextMenuItemTagOpenAudioInNewWindow()
+{
+ return UI_STRING("Open Audio in New Window", "Open Audio in New Window context menu item");
+}
+
+String PlatformStrategiesWinCE::contextMenuItemTagCopyVideoLinkToClipboard()
+{
+ return UI_STRING("Copy Video Address", "Copy Video Address Location context menu item");
+}
+
+String PlatformStrategiesWinCE::contextMenuItemTagCopyAudioLinkToClipboard()
+{
+ return UI_STRING("Copy Audio Address", "Copy Audio Address Location context menu item");
+}
+
+String PlatformStrategiesWinCE::contextMenuItemTagToggleMediaControls()
+{
+ return UI_STRING("Controls", "Media Controls context menu item");
+}
+
+String PlatformStrategiesWinCE::contextMenuItemTagToggleMediaLoop()
+{
+ return UI_STRING("Loop", "Media Loop context menu item");
+}
+
+String PlatformStrategiesWinCE::contextMenuItemTagEnterVideoFullscreen()
+{
+ return UI_STRING("Enter Fullscreen", "Video Enter Fullscreen context menu item");
+}
+
+String PlatformStrategiesWinCE::contextMenuItemTagMediaPlay()
+{
+ return UI_STRING("Play", "Media Play context menu item");
+}
+
+String PlatformStrategiesWinCE::contextMenuItemTagMediaPause()
+{
+ return UI_STRING("Pause", "Media Pause context menu item");
+}
+
+String PlatformStrategiesWinCE::contextMenuItemTagMediaMute()
+{
+ return UI_STRING("Mute", "Media Mute context menu item");
+}
+
+String PlatformStrategiesWinCE::contextMenuItemTagOpenFrameInNewWindow()
+{
+ return UI_STRING("Open Frame in New Window", "Open Frame in New Window context menu item");
+}
+
+String PlatformStrategiesWinCE::contextMenuItemTagCopy()
+{
+ return UI_STRING("Copy", "Copy context menu item");
+}
+
+String PlatformStrategiesWinCE::contextMenuItemTagGoBack()
+{
+ return UI_STRING("Back", "Back context menu item");
+}
+
+String PlatformStrategiesWinCE::contextMenuItemTagGoForward()
+{
+ return UI_STRING("Forward", "Forward context menu item");
+}
+
+String PlatformStrategiesWinCE::contextMenuItemTagStop()
+{
+ return UI_STRING("Stop", "Stop context menu item");
+}
+
+String PlatformStrategiesWinCE::contextMenuItemTagReload()
+{
+ return UI_STRING("Reload", "Reload context menu item");
+}
+
+String PlatformStrategiesWinCE::contextMenuItemTagCut()
+{
+ return UI_STRING("Cut", "Cut context menu item");
+}
+
+String PlatformStrategiesWinCE::contextMenuItemTagPaste()
+{
+ return UI_STRING("Paste", "Paste context menu item");
+}
+
+String PlatformStrategiesWinCE::contextMenuItemTagNoGuessesFound()
+{
+ return UI_STRING("No Guesses Found", "No Guesses Found context menu item");
+}
+
+String PlatformStrategiesWinCE::contextMenuItemTagIgnoreSpelling()
+{
+ return UI_STRING("Ignore Spelling", "Ignore Spelling context menu item");
+}
+
+String PlatformStrategiesWinCE::contextMenuItemTagLearnSpelling()
+{
+ return UI_STRING("Learn Spelling", "Learn Spelling context menu item");
+}
+
+String PlatformStrategiesWinCE::contextMenuItemTagSearchWeb()
+{
+ return UI_STRING("Search with Google", "Search in Google context menu item");
+}
+
+String PlatformStrategiesWinCE::contextMenuItemTagLookUpInDictionary()
+{
+ return UI_STRING("Look Up in Dictionary", "Look Up in Dictionary context menu item");
+}
+
+String PlatformStrategiesWinCE::contextMenuItemTagOpenLink()
+{
+ return UI_STRING("Open Link", "Open Link context menu item");
+}
+
+String PlatformStrategiesWinCE::contextMenuItemTagIgnoreGrammar()
+{
+ return UI_STRING("Ignore Grammar", "Ignore Grammar context menu item");
+}
+
+String PlatformStrategiesWinCE::contextMenuItemTagSpellingMenu()
+{
+ return UI_STRING("Spelling and Grammar", "Spelling and Grammar context sub-menu item");
+}
+
+String PlatformStrategiesWinCE::contextMenuItemTagCheckSpelling()
+{
+ return UI_STRING("Check Document Now", "Check spelling context menu item");
+}
+
+String PlatformStrategiesWinCE::contextMenuItemTagCheckSpellingWhileTyping()
+{
+ return UI_STRING("Check Spelling While Typing", "Check spelling while typing context menu item");
+}
+
+String PlatformStrategiesWinCE::contextMenuItemTagCheckGrammarWithSpelling()
+{
+ return UI_STRING("Check Grammar With Spelling", "Check grammar with spelling context menu item");
+}
+
+String PlatformStrategiesWinCE::contextMenuItemTagFontMenu()
+{
+ return UI_STRING("Font", "Font context sub-menu item");
+}
+
+String PlatformStrategiesWinCE::contextMenuItemTagBold()
+{
+ return UI_STRING("Bold", "Bold context menu item");
+}
+
+String PlatformStrategiesWinCE::contextMenuItemTagItalic()
+{
+ return UI_STRING("Italic", "Italic context menu item");
+}
+
+String PlatformStrategiesWinCE::contextMenuItemTagUnderline()
+{
+ return UI_STRING("Underline", "Underline context menu item");
+}
+
+String PlatformStrategiesWinCE::contextMenuItemTagOutline()
+{
+ return UI_STRING("Outline", "Outline context menu item");
+}
+
+String PlatformStrategiesWinCE::contextMenuItemTagWritingDirectionMenu()
+{
+ return UI_STRING("Paragraph Direction", "Paragraph direction context sub-menu item");
+}
+
+String PlatformStrategiesWinCE::contextMenuItemTagTextDirectionMenu()
+{
+ return UI_STRING("Selection Direction", "Selection direction context sub-menu item");
+}
+
+String PlatformStrategiesWinCE::contextMenuItemTagDefaultDirection()
+{
+ return UI_STRING("Default", "Default writing direction context menu item");
+}
+
+String PlatformStrategiesWinCE::contextMenuItemTagLeftToRight()
+{
+ return UI_STRING("Left to Right", "Left to Right context menu item");
+}
+
+String PlatformStrategiesWinCE::contextMenuItemTagRightToLeft()
+{
+ return UI_STRING("Right to Left", "Right to Left context menu item");
+}
+
+String PlatformStrategiesWinCE::contextMenuItemTagShowSpellingPanel(bool show)
+{
+ if (show)
+ return UI_STRING("Show Spelling and Grammar", "menu item title");
+ return UI_STRING("Hide Spelling and Grammar", "menu item title");
+}
+
+String PlatformStrategiesWinCE::contextMenuItemTagInspectElement()
+{
+ return UI_STRING("Inspect Element", "Inspect Element context menu item");
+}
+
+String PlatformStrategiesWinCE::searchMenuNoRecentSearchesText()
+{
+ return UI_STRING("No recent searches", "Label for only item in menu that appears when clicking on the search field image, when no searches have been performed");
+}
+
+String PlatformStrategiesWinCE::searchMenuRecentSearchesText()
+{
+ return UI_STRING("Recent Searches", "label for first item in the menu that appears when clicking on the search field image, used as embedded menu title");
+}
+
+String PlatformStrategiesWinCE::searchMenuClearRecentSearchesText()
+{
+ return UI_STRING("Clear Recent Searches", "menu item in Recent Searches menu that empties menu's contents");
+}
+
+String PlatformStrategiesWinCE::AXWebAreaText()
+{
+ return UI_STRING("web area", "accessibility role description for web area");
+}
+
+String PlatformStrategiesWinCE::AXLinkText()
+{
+ return UI_STRING("link", "accessibility role description for link");
+}
+
+String PlatformStrategiesWinCE::AXListMarkerText()
+{
+ return UI_STRING("list marker", "accessibility role description for list marker");
+}
+
+String PlatformStrategiesWinCE::AXImageMapText()
+{
+ return UI_STRING("image map", "accessibility role description for image map");
+}
+
+String PlatformStrategiesWinCE::AXHeadingText()
+{
+ return UI_STRING("heading", "accessibility role description for headings");
+}
+
+String PlatformStrategiesWinCE::AXDefinitionListTermText()
+{
+ return UI_STRING("term", "term word of a definition");
+}
+
+String PlatformStrategiesWinCE::AXDefinitionListDefinitionText()
+{
+ return UI_STRING("definition", "definition phrase");
+}
+
+String PlatformStrategiesWinCE::AXButtonActionVerb()
+{
+ return UI_STRING("press", "Verb stating the action that will occur when a button is pressed, as used by accessibility");
+}
+
+String PlatformStrategiesWinCE::AXRadioButtonActionVerb()
+{
+ return UI_STRING("select", "Verb stating the action that will occur when a radio button is clicked, as used by accessibility");
+}
+
+String PlatformStrategiesWinCE::AXTextFieldActionVerb()
+{
+ return UI_STRING("activate", "Verb stating the action that will occur when a text field is selected, as used by accessibility");
+}
+
+String PlatformStrategiesWinCE::AXCheckedCheckBoxActionVerb()
+{
+ return UI_STRING("uncheck", "Verb stating the action that will occur when a checked checkbox is clicked, as used by accessibility");
+}
+
+String PlatformStrategiesWinCE::AXUncheckedCheckBoxActionVerb()
+{
+ return UI_STRING("check", "Verb stating the action that will occur when an unchecked checkbox is clicked, as used by accessibility");
+}
+
+String PlatformStrategiesWinCE::AXLinkActionVerb()
+{
+ return UI_STRING("jump", "Verb stating the action that will occur when a link is clicked, as used by accessibility");
+}
+
+String PlatformStrategiesWinCE::AXMenuListActionVerb()
+{
+ return UI_STRING("open", "Verb stating the action that will occur when a select element is clicked, as used by accessibility");
+}
+
+String PlatformStrategiesWinCE::AXMenuListPopupActionVerb()
+{
+ return UI_STRING_KEY("press", "press (select element)", "Verb stating the action that will occur when a select element's popup list is clicked, as used by accessibility");
+}
+
+String PlatformStrategiesWinCE::unknownFileSizeText()
+{
+ return UI_STRING("Unknown", "Unknown filesize FTP directory listing item");
+}
+
+String PlatformStrategiesWinCE::uploadFileText()
+{
+ return UI_STRING("Upload file", "(Windows) Form submit file upload dialog title");
+}
+
+String PlatformStrategiesWinCE::allFilesText()
+{
+ return UI_STRING("All Files", "(Windows) Form submit file upload all files pop-up");
+}
+
+String PlatformStrategiesWinCE::missingPluginText()
+{
+ return UI_STRING("Missing Plug-in", "Label text to be used when a plugin is missing");
+}
+
+String PlatformStrategiesWinCE::crashedPluginText()
+{
+ return UI_STRING("Plug-in Failure", "Label text to be used if plugin host process has crashed");
+}
+
+String PlatformStrategiesWinCE::imageTitle(const String& filename, const IntSize& size)
+{
+ CString filenameCString = filename.utf8();
+ return String::format(UI_STRING("%s %d\xC3\x97%d pixels", "window title for a standalone image (uses multiplication symbol, not x)"), filenameCString.data(), size.width(), size.height());
+}
+
+String PlatformStrategiesWinCE::multipleFileUploadText(unsigned numberOfFiles)
+{
+ return String::format(UI_STRING("%d files", "Label to describe the number of files selected in a file upload control that allows multiple files"), numberOfFiles);
+}
+
+String PlatformStrategiesWinCE::mediaElementLoadingStateText()
+{
+ return UI_STRING("Loading...", "Media controller status message when the media is loading");
+}
+
+String PlatformStrategiesWinCE::mediaElementLiveBroadcastStateText()
+{
+ return UI_STRING("Live Broadcast", "Media controller status message when watching a live broadcast");
+}
+
+String PlatformStrategiesWinCE::localizedMediaControlElementString(const String& name)
+{
+ if (name == "AudioElement")
+ return UI_STRING("audio element controller", "accessibility role description for audio element controller");
+ if (name == "VideoElement")
+ return UI_STRING("video element controller", "accessibility role description for video element controller");
+ if (name == "MuteButton")
+ return UI_STRING("mute", "accessibility role description for mute button");
+ if (name == "UnMuteButton")
+ return UI_STRING("unmute", "accessibility role description for turn mute off button");
+ if (name == "PlayButton")
+ return UI_STRING("play", "accessibility role description for play button");
+ if (name == "PauseButton")
+ return UI_STRING("pause", "accessibility role description for pause button");
+ if (name == "Slider")
+ return UI_STRING("movie time", "accessibility role description for timeline slider");
+ if (name == "SliderThumb")
+ return UI_STRING("timeline slider thumb", "accessibility role description for timeline thumb");
+ if (name == "RewindButton")
+ return UI_STRING("back 30 seconds", "accessibility role description for seek back 30 seconds button");
+ if (name == "ReturnToRealtimeButton")
+ return UI_STRING("return to realtime", "accessibility role description for return to real time button");
+ if (name == "CurrentTimeDisplay")
+ return UI_STRING("elapsed time", "accessibility role description for elapsed time display");
+ if (name == "TimeRemainingDisplay")
+ return UI_STRING("remaining time", "accessibility role description for time remaining display");
+ if (name == "StatusDisplay")
+ return UI_STRING("status", "accessibility role description for movie status");
+ if (name == "FullscreenButton")
+ return UI_STRING("fullscreen", "accessibility role description for enter fullscreen button");
+ if (name == "SeekForwardButton")
+ return UI_STRING("fast forward", "accessibility role description for fast forward button");
+ if (name == "SeekBackButton")
+ return UI_STRING("fast reverse", "accessibility role description for fast reverse button");
+ if (name == "ShowClosedCaptionsButton")
+ return UI_STRING("show closed captions", "accessibility role description for show closed captions button");
+ if (name == "HideClosedCaptionsButton")
+ return UI_STRING("hide closed captions", "accessibility role description for hide closed captions button");
+
+ ASSERT_NOT_REACHED();
+ return String();
+}
+
+String PlatformStrategiesWinCE::localizedMediaControlElementHelpText(const String& name)
+{
+ if (name == "AudioElement")
+ return UI_STRING("audio element playback controls and status display", "accessibility role description for audio element controller");
+ if (name == "VideoElement")
+ return UI_STRING("video element playback controls and status display", "accessibility role description for video element controller");
+ if (name == "MuteButton")
+ return UI_STRING("mute audio tracks", "accessibility help text for mute button");
+ if (name == "UnMuteButton")
+ return UI_STRING("unmute audio tracks", "accessibility help text for un mute button");
+ if (name == "PlayButton")
+ return UI_STRING("begin playback", "accessibility help text for play button");
+ if (name == "PauseButton")
+ return UI_STRING("pause playback", "accessibility help text for pause button");
+ if (name == "Slider")
+ return UI_STRING("movie time scrubber", "accessibility help text for timeline slider");
+ if (name == "SliderThumb")
+ return UI_STRING("movie time scrubber thumb", "accessibility help text for timeline slider thumb");
+ if (name == "RewindButton")
+ return UI_STRING("seek movie back 30 seconds", "accessibility help text for jump back 30 seconds button");
+ if (name == "ReturnToRealtimeButton")
+ return UI_STRING("return streaming movie to real time", "accessibility help text for return streaming movie to real time button");
+ if (name == "CurrentTimeDisplay")
+ return UI_STRING("current movie time in seconds", "accessibility help text for elapsed time display");
+ if (name == "TimeRemainingDisplay")
+ return UI_STRING("number of seconds of movie remaining", "accessibility help text for remaining time display");
+ if (name == "StatusDisplay")
+ return UI_STRING("current movie status", "accessibility help text for movie status display");
+ if (name == "SeekBackButton")
+ return UI_STRING("seek quickly back", "accessibility help text for fast rewind button");
+ if (name == "SeekForwardButton")
+ return UI_STRING("seek quickly forward", "accessibility help text for fast forward button");
+ if (name == "FullscreenButton")
+ return UI_STRING("Play movie in fullscreen mode", "accessibility help text for enter fullscreen button");
+ if (name == "ShowClosedCaptionsButton")
+ return UI_STRING("start displaying closed captions", "accessibility help text for show closed captions button");
+ if (name == "HideClosedCaptionsButton")
+ return UI_STRING("stop displaying closed captions", "accessibility help text for hide closed captions button");
+
+ ASSERT_NOT_REACHED();
+ return String();
+}
+
+String PlatformStrategiesWinCE::localizedMediaTimeDescription(float time)
+{
+ if (!isfinite(time))
+ return UI_STRING("indefinite time", "accessibility help text for an indefinite media controller time value");
+
+ int seconds = (int)fabsf(time);
+ int days = seconds / (60 * 60 * 24);
+ int hours = seconds / (60 * 60);
+ int minutes = (seconds / 60) % 60;
+ seconds %= 60;
+
+ if (days)
+ return String::format(UI_STRING("%1$d days %2$d hours %3$d minutes %4$d seconds", "accessibility help text for media controller time value >= 1 day"), days, hours, minutes, seconds);
+
+ if (hours)
+ return String::format(UI_STRING("%1$d hours %2$d minutes %3$d seconds", "accessibility help text for media controller time value >= 60 minutes"), hours, minutes, seconds);
+
+ if (minutes)
+ return String::format(UI_STRING("%1$d minutes %2$d seconds", "accessibility help text for media controller time value >= 60 seconds"), minutes, seconds);
+
+ return String::format(UI_STRING("%1$d seconds", "accessibility help text for media controller time value < 60 seconds"), seconds);
+}
+
+String PlatformStrategiesWinCE::validationMessageValueMissingText()
+{
+ return UI_STRING("value missing", "Validation message for required form control elements that have no value");
+}
+
+String PlatformStrategiesWinCE::validationMessageTypeMismatchText()
+{
+ return UI_STRING("type mismatch", "Validation message for input form controls with a value not matching type");
+}
+
+String PlatformStrategiesWinCE::validationMessagePatternMismatchText()
+{
+ return UI_STRING("pattern mismatch", "Validation message for input form controls requiring a constrained value according to pattern");
+}
+
+String PlatformStrategiesWinCE::validationMessageTooLongText()
+{
+ return UI_STRING("too long", "Validation message for form control elements with a value longer than maximum allowed length");
+}
+
+String PlatformStrategiesWinCE::validationMessageRangeUnderflowText()
+{
+ return UI_STRING("range underflow", "Validation message for input form controls with value lower than allowed minimum");
+}
+
+String PlatformStrategiesWinCE::validationMessageRangeOverflowText()
+{
+ return UI_STRING("range overflow", "Validation message for input form controls with value higher than allowed maximum");
+}
+
+String PlatformStrategiesWinCE::validationMessageStepMismatchText()
+{
+ return UI_STRING("step mismatch", "Validation message for input form controls with value not respecting the step attribute");
+}
+
+bool PlatformStrategiesWinCE::isLinkVisited(Page* page, LinkHash hash)
+{
+ return page->group().isLinkVisited(hash);
+}
+
+void PlatformStrategiesWinCE::addVisitedLink(Page* page, LinkHash hash)
+{
+ page->group().addVisitedLinkHash(hash);
+}
diff --git a/WebKit/wince/WebCoreSupport/PlatformStrategiesWinCE.h b/WebKit/wince/WebCoreSupport/PlatformStrategiesWinCE.h
new file mode 100644
index 0000000..02d87d3
--- /dev/null
+++ b/WebKit/wince/WebCoreSupport/PlatformStrategiesWinCE.h
@@ -0,0 +1,148 @@
+/*
+ * Copyright (C) 2010 Patrick Gansterer <paroga@paroga.com>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * 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 PlatformStrategiesWinCE_h
+#define PlatformStrategiesWinCE_h
+
+#include "LocalizationStrategy.h"
+#include "PlatformStrategies.h"
+#include "PluginStrategy.h"
+#include "VisitedLinkStrategy.h"
+
+class PlatformStrategiesWinCE : public WebCore::PlatformStrategies, private WebCore::PluginStrategy, private WebCore::LocalizationStrategy, private WebCore::VisitedLinkStrategy {
+public:
+ static void initialize();
+
+private:
+ PlatformStrategiesWinCE();
+
+ // WebCore::PlatformStrategies
+ virtual WebCore::PluginStrategy* createPluginStrategy();
+ virtual WebCore::LocalizationStrategy* createLocalizationStrategy();
+ virtual WebCore::VisitedLinkStrategy* createVisitedLinkStrategy();
+
+ // WebCore::PluginStrategy
+ virtual void refreshPlugins();
+ virtual void getPluginInfo(const WebCore::Page*, Vector<WebCore::PluginInfo>&);
+
+ // WebCore::LocalizationStrategy
+ virtual WTF::String inputElementAltText();
+ virtual WTF::String resetButtonDefaultLabel();
+ virtual WTF::String searchableIndexIntroduction();
+ virtual WTF::String submitButtonDefaultLabel();
+ virtual WTF::String fileButtonChooseFileLabel();
+ virtual WTF::String fileButtonNoFileSelectedLabel();
+#if ENABLE(CONTEXT_MENUS)
+ virtual WTF::String contextMenuItemTagOpenLinkInNewWindow();
+ virtual WTF::String contextMenuItemTagDownloadLinkToDisk();
+ virtual WTF::String contextMenuItemTagCopyLinkToClipboard();
+ virtual WTF::String contextMenuItemTagOpenImageInNewWindow();
+ virtual WTF::String contextMenuItemTagDownloadImageToDisk();
+ virtual WTF::String contextMenuItemTagCopyImageToClipboard();
+ virtual WTF::String contextMenuItemTagOpenFrameInNewWindow();
+ virtual WTF::String contextMenuItemTagCopy();
+ virtual WTF::String contextMenuItemTagGoBack();
+ virtual WTF::String contextMenuItemTagGoForward();
+ virtual WTF::String contextMenuItemTagStop();
+ virtual WTF::String contextMenuItemTagReload();
+ virtual WTF::String contextMenuItemTagCut();
+ virtual WTF::String contextMenuItemTagPaste();
+ virtual WTF::String contextMenuItemTagNoGuessesFound();
+ virtual WTF::String contextMenuItemTagIgnoreSpelling();
+ virtual WTF::String contextMenuItemTagLearnSpelling();
+ virtual WTF::String contextMenuItemTagSearchWeb();
+ virtual WTF::String contextMenuItemTagLookUpInDictionary();
+ virtual WTF::String contextMenuItemTagOpenLink();
+ virtual WTF::String contextMenuItemTagIgnoreGrammar();
+ virtual WTF::String contextMenuItemTagSpellingMenu();
+ virtual WTF::String contextMenuItemTagShowSpellingPanel(bool show);
+ virtual WTF::String contextMenuItemTagCheckSpelling();
+ virtual WTF::String contextMenuItemTagCheckSpellingWhileTyping();
+ virtual WTF::String contextMenuItemTagCheckGrammarWithSpelling();
+ virtual WTF::String contextMenuItemTagFontMenu();
+ virtual WTF::String contextMenuItemTagBold();
+ virtual WTF::String contextMenuItemTagItalic();
+ virtual WTF::String contextMenuItemTagUnderline();
+ virtual WTF::String contextMenuItemTagOutline();
+ virtual WTF::String contextMenuItemTagWritingDirectionMenu();
+ virtual WTF::String contextMenuItemTagTextDirectionMenu();
+ virtual WTF::String contextMenuItemTagDefaultDirection();
+ virtual WTF::String contextMenuItemTagLeftToRight();
+ virtual WTF::String contextMenuItemTagRightToLeft();
+ virtual WTF::String contextMenuItemTagInspectElement();
+ virtual WTF::String contextMenuItemTagOpenVideoInNewWindow();
+ virtual WTF::String contextMenuItemTagOpenAudioInNewWindow();
+ virtual WTF::String contextMenuItemTagCopyVideoLinkToClipboard();
+ virtual WTF::String contextMenuItemTagCopyAudioLinkToClipboard();
+ virtual WTF::String contextMenuItemTagToggleMediaControls();
+ virtual WTF::String contextMenuItemTagToggleMediaLoop();
+ virtual WTF::String contextMenuItemTagEnterVideoFullscreen();
+ virtual WTF::String contextMenuItemTagMediaPlay();
+ virtual WTF::String contextMenuItemTagMediaPause();
+ virtual WTF::String contextMenuItemTagMediaMute();
+#endif // ENABLE(CONTEXT_MENUS)
+ virtual WTF::String searchMenuNoRecentSearchesText();
+ virtual WTF::String searchMenuRecentSearchesText();
+ virtual WTF::String searchMenuClearRecentSearchesText();
+ virtual WTF::String AXWebAreaText();
+ virtual WTF::String AXLinkText();
+ virtual WTF::String AXListMarkerText();
+ virtual WTF::String AXImageMapText();
+ virtual WTF::String AXHeadingText();
+ virtual WTF::String AXDefinitionListTermText();
+ virtual WTF::String AXDefinitionListDefinitionText();
+ virtual WTF::String AXButtonActionVerb();
+ virtual WTF::String AXRadioButtonActionVerb();
+ virtual WTF::String AXTextFieldActionVerb();
+ virtual WTF::String AXCheckedCheckBoxActionVerb();
+ virtual WTF::String AXUncheckedCheckBoxActionVerb();
+ virtual WTF::String AXMenuListActionVerb();
+ virtual WTF::String AXMenuListPopupActionVerb();
+ virtual WTF::String AXLinkActionVerb();
+ virtual WTF::String missingPluginText();
+ virtual WTF::String crashedPluginText();
+ virtual WTF::String multipleFileUploadText(unsigned numberOfFiles);
+ virtual WTF::String unknownFileSizeText();
+ virtual WTF::String uploadFileText();
+ virtual WTF::String allFilesText();
+ virtual WTF::String imageTitle(const WTF::String& filename, const WebCore::IntSize&);
+ virtual WTF::String mediaElementLoadingStateText();
+ virtual WTF::String mediaElementLiveBroadcastStateText();
+ virtual WTF::String localizedMediaControlElementString(const WTF::String&);
+ virtual WTF::String localizedMediaControlElementHelpText(const WTF::String&);
+ virtual WTF::String localizedMediaTimeDescription(float);
+ virtual WTF::String validationMessageValueMissingText();
+ virtual WTF::String validationMessageTypeMismatchText();
+ virtual WTF::String validationMessagePatternMismatchText();
+ virtual WTF::String validationMessageTooLongText();
+ virtual WTF::String validationMessageRangeUnderflowText();
+ virtual WTF::String validationMessageRangeOverflowText();
+ virtual WTF::String validationMessageStepMismatchText();
+
+ // WebCore::VisitedLinkStrategy
+ virtual bool isLinkVisited(WebCore::Page*, WebCore::LinkHash);
+ virtual void addVisitedLink(WebCore::Page*, WebCore::LinkHash);
+};
+
+#endif // PlatformStrategiesWinCE_h
diff --git a/WebKit/wx/ChangeLog b/WebKit/wx/ChangeLog
index 7aedbac..abbc87b 100644
--- a/WebKit/wx/ChangeLog
+++ b/WebKit/wx/ChangeLog
@@ -1,3 +1,27 @@
+2010-09-28 Jenn Braithwaite <jennb@chromium.org>
+
+ Reviewed by Dmitry Titov.
+
+ Added oldPage param to FrameLoaderClient::didTransferChildFrameToNewDocument.
+ https://bugs.webkit.org/show_bug.cgi?id=46663
+
+ * WebKitSupport/FrameLoaderClientWx.cpp:
+ (WebCore::FrameLoaderClientWx::didTransferChildFrameToNewDocument):
+ * WebKitSupport/FrameLoaderClientWx.h:
+
+2010-09-24 Kwang Yul Seo <skyul@company100.net>
+
+ Reviewed by Andreas Kling.
+
+ [wx] ChromeClientWx::scaleFactor must return 1.0
+ https://bugs.webkit.org/show_bug.cgi?id=46542
+
+ The default value of ChromeClientWx::scaleFactor must be 1.0.
+ Otherwise, canvas element won't be painted.
+
+ * WebKitSupport/ChromeClientWx.cpp:
+ (WebCore::ChromeClientWx::scaleFactor):
+
2010-09-17 Darin Adler <darin@apple.com>
Reviewed by Sam Weinig.
diff --git a/WebKit/wx/WebKitSupport/ChromeClientWx.cpp b/WebKit/wx/WebKitSupport/ChromeClientWx.cpp
index 9c90596..11c5643 100644
--- a/WebKit/wx/WebKitSupport/ChromeClientWx.cpp
+++ b/WebKit/wx/WebKitSupport/ChromeClientWx.cpp
@@ -108,7 +108,7 @@ FloatRect ChromeClientWx::pageRect()
float ChromeClientWx::scaleFactor()
{
notImplemented();
- return 0.0;
+ return 1.0;
}
void ChromeClientWx::focus()
diff --git a/WebKit/wx/WebKitSupport/FrameLoaderClientWx.cpp b/WebKit/wx/WebKitSupport/FrameLoaderClientWx.cpp
index facb387..93a62ca 100644
--- a/WebKit/wx/WebKitSupport/FrameLoaderClientWx.cpp
+++ b/WebKit/wx/WebKitSupport/FrameLoaderClientWx.cpp
@@ -860,7 +860,7 @@ PassRefPtr<Frame> FrameLoaderClientWx::createFrame(const KURL& url, const String
return childFrame.release();
}
-void FrameLoaderClientWx::didTransferChildFrameToNewDocument()
+void FrameLoaderClientWx::didTransferChildFrameToNewDocument(Page*)
{
}
diff --git a/WebKit/wx/WebKitSupport/FrameLoaderClientWx.h b/WebKit/wx/WebKitSupport/FrameLoaderClientWx.h
index 20b50d3..9c260fe 100644
--- a/WebKit/wx/WebKitSupport/FrameLoaderClientWx.h
+++ b/WebKit/wx/WebKitSupport/FrameLoaderClientWx.h
@@ -203,7 +203,7 @@ namespace WebCore {
virtual PassRefPtr<Frame> createFrame(const KURL& url, const String& name, HTMLFrameOwnerElement* ownerElement,
const String& referrer, bool allowsScrolling, int marginWidth, int marginHeight);
- virtual void didTransferChildFrameToNewDocument();
+ virtual void didTransferChildFrameToNewDocument(Page*);
virtual PassRefPtr<Widget> createPlugin(const IntSize&, HTMLPlugInElement*, const KURL&, const Vector<String>&, const Vector<String>&, const String&, bool loadManually) ;
virtual void redirectDataToPlugin(Widget* pluginWidget);
virtual ResourceError pluginWillHandleLoadError(const ResourceResponse&);
diff --git a/WebKitTools/BuildSlaveSupport/build.webkit.org-config/config.json b/WebKitTools/BuildSlaveSupport/build.webkit.org-config/config.json
index 54a0dfe..2a4a351 100644
--- a/WebKitTools/BuildSlaveSupport/build.webkit.org-config/config.json
+++ b/WebKitTools/BuildSlaveSupport/build.webkit.org-config/config.json
@@ -16,6 +16,7 @@
{ "name": "apple-macpro-2", "platform": "mac-snowleopard" },
{ "name": "apple-macpro-3", "platform": "mac-snowleopard" },
{ "name": "apple-macpro-4", "platform": "mac-leopard" },
+ { "name": "apple-macpro-5", "platform": "mac-leopard" },
{ "name": "apple-windows-1", "platform": "win"},
{ "name": "apple-windows-2", "platform": "win"},
@@ -64,7 +65,7 @@
},
{ "name": "Leopard Intel Debug (Tests)", "type": "Test", "builddir": "leopard-intel-debug-tests",
"platform": "mac-leopard", "configuration": "debug", "architectures": ["i386"],
- "slavenames": ["apple-xserve-3", "test-slave"]
+ "slavenames": ["apple-xserve-3", "test-slave", "apple-macpro-5"]
},
{ "name": "SnowLeopard Intel Release (Build)", "type": "Build", "builddir": "snowleopard-intel-release",
"platform": "mac-snowleopard", "configuration": "release", "architectures": ["x86_64"],
diff --git a/WebKitTools/BuildSlaveSupport/build.webkit.org-config/master.cfg b/WebKitTools/BuildSlaveSupport/build.webkit.org-config/master.cfg
index aca3c65..d5cd6fb 100644
--- a/WebKitTools/BuildSlaveSupport/build.webkit.org-config/master.cfg
+++ b/WebKitTools/BuildSlaveSupport/build.webkit.org-config/master.cfg
@@ -317,6 +317,14 @@ class RunWebKit2Tests(RunWebKitTests):
return RunWebKitTests.start(self)
+class RunChromiumWebKitUnitTests(shell.Test):
+ name = "webkit-unit-tests"
+ description = ["webkit-unit-tests running"]
+ descriptionDone = ["webkit-unit-tests"]
+ command = ["perl", "./WebKitTools/Scripts/run-chromium-webkit-unit-tests",
+ WithProperties("--%(configuration)s")]
+
+
class ArchiveTestResults(shell.ShellCommand):
command = ["python", "./WebKitTools/BuildSlaveSupport/test-result-archive",
WithProperties("--platform=%(platform)s"), WithProperties("--%(configuration)s"), "archive"]
@@ -399,6 +407,8 @@ class BuildAndTestFactory(Factory):
self.addStep(CompileWebKit)
if not platform.startswith("chromium"):
self.addStep(RunJavaScriptCoreTests)
+ if platform.startswith("chromium"):
+ self.addStep(RunChromiumWebKitUnitTests)
self.addStep(self.TestClass)
# Tiger's Python 2.3 is too old. WebKit Python requires 2.5+.
# Sadly we have no way to detect the version on the slave from here.
diff --git a/WebKitTools/CMakeListsEfl.txt b/WebKitTools/CMakeListsEfl.txt
index b9086ac..732b4b3 100644
--- a/WebKitTools/CMakeListsEfl.txt
+++ b/WebKitTools/CMakeListsEfl.txt
@@ -1,5 +1,4 @@
SET(EWebLauncher_SOURCES
- ${WebKit_THEME}
${WEBKITTOOLS_DIR}/EWebLauncher/main.c
)
@@ -50,6 +49,10 @@ IF (WTF_USE_CURL)
LIST(APPEND EWebLauncher_LINK_FLAGS ${CURL_LDFLAGS})
ENDIF ()
+# Override data directory. We always want to get a fresh theme.
+REMOVE_DEFINITIONS(-DDATA_DIR=\"${DATA_DIR}\")
+ADD_DEFINITIONS(-DDATA_DIR=\"${BUILD_DATA_DIR}\")
+
INCLUDE_DIRECTORIES(${EWebLauncher_INCLUDE_DIRECTORIES})
ADD_EXECUTABLE(Programs/EWebLauncher ${EWebLauncher_SOURCES})
TARGET_LINK_LIBRARIES(Programs/EWebLauncher ${EWebLauncher_LIBRARIES})
diff --git a/WebKitTools/CSSTestSuiteHarness/harness/harness.css b/WebKitTools/CSSTestSuiteHarness/harness/harness.css
new file mode 100644
index 0000000..8c0e7d1
--- /dev/null
+++ b/WebKitTools/CSSTestSuiteHarness/harness/harness.css
@@ -0,0 +1,220 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+body {
+ font-family: Helvetica, sans-serif;
+ background-color: #DDD;
+}
+
+.controls {
+ border: 1px solid black;
+ width: 300px;
+ height: 660px;
+ float: left;
+ font-size: smaller;
+ padding: 4px;
+}
+
+.controls div {
+ margin: 4px;
+}
+
+.controls select {
+ width: 100%;
+}
+
+.details > div {
+ margin: 4px 0;
+}
+
+.actions {
+ margin-left: 320px;
+ border: 1px solid black;
+ font-size: smaller;
+ height: 30px;
+ padding: 4px;
+ margin-bottom: 8px;
+}
+
+.actions button {
+ font-size: 13px;
+ width: 5em;
+}
+
+.note {
+ font-size: 10px;
+ color: gray;
+}
+.action-buttons {
+ float: right;
+}
+
+#test-content {
+ margin-left: 320px;
+ height: 612px;
+ border: 1px solid black;
+ padding: 4px;
+ background-color: white;
+}
+
+.info > div {
+ margin: 6px 0;
+}
+
+.info .title {
+ font-size: larger;
+ font-weight: bold;
+}
+
+.info .url {
+ font-family: monospace;
+}
+
+.info .assertion, .info .flags {
+ font-size: smaller;
+}
+
+#test-content iframe {
+ border: 1px solid gray;
+ margin: 2px;
+}
+
+#test-content h2 {
+ font-size: 11pt;
+ margin: 2px 0 2px 0;
+ color: darkgray;
+}
+
+#test-list > option.untested {
+
+}
+
+#test-list > option.completed {
+ color: gray;
+}
+
+#test-content.with-ref {
+}
+
+.frame-wrapper {
+
+}
+
+.frame-wrapper iframe {
+ width: 98%;
+ height: 460px;
+}
+
+.frame-wrapper {
+ height: 500px;
+ width: 99%;
+ display: inline-block;
+}
+
+.with-ref > .frame-wrapper {
+ width: 49%;
+}
+
+#ref-wrapper {
+ height: 500px;
+ width: 49%;
+ display: none;
+}
+
+.with-ref > #ref-wrapper {
+ display: inline-block;
+}
+
+.results {
+ border: 1px solid black;
+ padding: 4px;
+ margin-top: 6px;
+}
+
+#output {
+ border: 1px solid black;
+ font-size: smaller;
+ height: 220px;
+ margin: 4px;
+ padding: 4px;
+ overflow-y: auto;
+ background-color: white;
+}
+
+#output > p {
+ margin: 0;
+}
+#output .pass {
+ color: green;
+}
+
+#output .fail {
+ color: red;
+}
+
+#output .skipped {
+ color: orange;
+}
+
+#output .invalid {
+ background: red;
+}
+
+.output-options {
+ float: right;
+ border: 1px solid black;
+ width: 200px;
+ height: 220px;
+ margin: 4px;
+ padding: 4px;
+ font-size: smaller;
+}
+
+.output-options select {
+ width: 90%;
+}
+
+.summary {
+ font-size: smaller;
+ margin: 4px;
+}
+
+.summary .label {
+ display: inline-block;
+ min-width: 5em;
+ margin: 0;
+}
+
+.summary span {
+ display: inline-block;
+ min-width: 3em;
+ text-align: right;
+ margin: 0;
+}
+
+.summary td {
+ text-align: right;
+ padding: 4px;
+}
diff --git a/WebKitTools/CSSTestSuiteHarness/harness/harness.html b/WebKitTools/CSSTestSuiteHarness/harness/harness.html
new file mode 100644
index 0000000..6bd47e5
--- /dev/null
+++ b/WebKitTools/CSSTestSuiteHarness/harness/harness.html
@@ -0,0 +1,206 @@
+<!--
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+-->
+
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
+ <title>CSS 2.1 Test Harness</title>
+ <link rel="stylesheet" href="harness.css" type="text/css" media="screen" charset="utf-8">
+
+ <script src="http://code.jquery.com/jquery-1.4.2.min.js" type="text/javascript" charset="utf-8"></script>
+ <script src="harness.js" type="text/javascript" charset="utf-8"></script>
+
+ <script type="text/javascript" charset="utf-8">
+ var gTestSuite;
+ function setupTests()
+ {
+ gTestSuite = new TestSuite();
+ }
+
+ window.addEventListener('load', setupTests, false);
+
+ function skipTest()
+ {
+ gTestSuite.skipTest(document.getElementById('skip-reason').value);
+ }
+
+ function invalidTest()
+ {
+ gTestSuite.invalidTest();
+ }
+
+ function failTest()
+ {
+ gTestSuite.failTest();
+ }
+
+ function passTest()
+ {
+ gTestSuite.passTest();
+ }
+
+ function formatChanged()
+ {
+ var newFormat;
+ if (document.harness.format.html4.checked)
+ newFormat = 'html4';
+ else
+ newFormat = 'xhtml1';
+ gTestSuite.formatChanged(newFormat);
+ }
+
+ function testSelected()
+ {
+ var list = document.getElementById('test-list')
+ if (list.selectedIndex >= 0)
+ gTestSuite.goToTestIndex(list.selectedIndex);
+ else
+ gTestSuite.clearTest();
+ }
+
+ function resultsPopupChanged(popup)
+ {
+ gTestSuite.resultsPopupChanged(popup.selectedIndex);
+ }
+
+ function doExport()
+ {
+ gTestSuite.exportResults(document.getElementById('results-popup').selectedIndex);
+ }
+
+ /*
+ This conflicts badly with key handling in selects.
+ function keyHandler(event)
+ {
+ var charCode = String.fromCharCode(event.keyCode);
+ window.console.log('keyHandler')
+ switch (charCode) {
+ case 'P':
+ passTest();
+ break;
+
+ case 'F':
+ failTest();
+ break;
+
+ case 'I':
+ invalidTest();
+ break;
+
+ case 'S':
+ skipTest();
+ break;
+ }
+
+ event.stopPropagation();
+ event.preventDefault();
+ }
+
+ document.addEventListener('keyup', keyHandler, false);
+ */
+ </script>
+
+</head>
+<body>
+
+ <div class="controls">
+ <form name="harness" onsubmit="return false;">
+ <select id="chapters">
+ <option>Test category</option>
+ </select>
+ <div class="progress">
+ <div><span id="test-index">1</span> of <span id="chapter-test-count">200</span> unique tests</div>
+ </div>
+ <div class="details">
+ <div class="name">
+ <div class="test-type">
+ <input type="radio" name="format" id="html4" onchange="formatChanged()" checked><label for="html4">HTML4</label><br>
+ <input type="radio" name="format" id="xhtml1" onchange="formatChanged()"><label for="xhtml1">XHTML1</label>
+ </div>
+ </div>
+ </div>
+
+ <div>
+ <select id="test-list" size="40" onchange="testSelected()"></select>
+ </div>
+ </form>
+ </div>
+
+ <div class="actions">
+ <span>Skip reason:</span> <input type="text" id="skip-reason" size="50">
+ <button onclick="skipTest()" accesskey="s">Skip</button>
+ <span class="note">Use <i>Control-Option-letter</i> to trigger buttons via the keyboard.</span>
+ <div class="action-buttons">
+ <button onclick="invalidTest()" accesskey="i">Invalid</button>
+ <button onclick="failTest()" accesskey="f">Fail</button>
+ <button onclick="passTest()" accesskey="p">Pass</button>
+ </div>
+ </div>
+ <div id="test-content">
+ <div class="info">
+ <div class="title">Title: <span id="test-title"></span></div>
+ <div class="url">URL: <span id="test-url"></span></div>
+ <div class="assertion">Assertion: <span id="test-assertion"></span></div>
+ <div class="flags">Flags: <span id="test-flags"></span></div>
+ </div>
+
+ <div id="test-wrapper" class="frame-wrapper">
+ <h2>Test</h2>
+ <iframe id="test-frame"></iframe>
+ </div>
+ <div id="ref-wrapper" class="frame-wrapper">
+ <h2>Reference</h2>
+ <iframe id="ref-frame"></iframe>
+ </div>
+ </div>
+
+ <div class="results">
+ <div class="output-options">
+ <p>Show results for:</p>
+ <select id="results-popup" onchange="resultsPopupChanged(this)">
+ </select>
+ <button id="export-button" onclick="doExport()">Export...</button>
+ </div>
+ <div id="output"></div>
+ <div class="summary">
+ <table>
+ <tr>
+ <th></th><th>Passed</th><th>Failed</th><th>Skipped</th><th>Invalid</th><th>Tested</th><th>Total</th><th>% done</th>
+ </tr>
+ <tr>
+ <td class="label">HTML4:</td><td id="h-passed"></td><td id="h-failed"></td><td id="h-skipped"></td><td id="h-invalid"></td><td id="h-tested"></td><td id="h-total"></td><td id="h-percent"></td>
+ </tr>
+ <tr>
+ <td class="label">XHTML1:</td><td id="x-passed"></td><td id="x-failed"></td><td id="x-skipped"></td><td id="x-invalid"></td><td id="x-tested"></td><td id="x-total"></td><td id="x-percent"></td>
+ </tr>
+ </table>
+ </div>
+ </div>
+
+</body>
+</html> \ No newline at end of file
diff --git a/WebKitTools/CSSTestSuiteHarness/harness/harness.js b/WebKitTools/CSSTestSuiteHarness/harness/harness.js
new file mode 100644
index 0000000..95262af
--- /dev/null
+++ b/WebKitTools/CSSTestSuiteHarness/harness/harness.js
@@ -0,0 +1,1314 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// requires jQuery
+
+const kTestSuiteVersion = '20100917';
+const kTestSuiteHome = '../' + kTestSuiteVersion + '/';
+const kTestInfoDataFile = 'testinfo.data';
+
+const kChapterData = [
+ {
+ 'file' : 'about.html',
+ 'title' : 'About the CSS 2.1 Specification',
+ },
+ {
+ 'file' : 'intro.html',
+ 'title' : 'Introduction to CSS 2.1',
+ },
+ {
+ 'file' : 'conform.html',
+ 'title' : 'Conformance: Requirements and Recommendations',
+ },
+ {
+ 'file' : "syndata.html",
+ 'title' : 'Syntax and basic data types',
+ },
+ {
+ 'file' : 'selector.html' ,
+ 'title' : 'Selectors',
+ },
+ {
+ 'file' : 'cascade.html',
+ 'title' : 'Assigning property values, Cascading, and Inheritance',
+ },
+ {
+ 'file' : 'media.html',
+ 'title' : 'Media types',
+ },
+ {
+ 'file' : 'box.html' ,
+ 'title' : 'Box model',
+ },
+ {
+ 'file' : 'visuren.html',
+ 'title' : 'Visual formatting model',
+ },
+ {
+ 'file' :'visudet.html',
+ 'title' : 'Visual formatting model details',
+ },
+ {
+ 'file' : 'visufx.html',
+ 'title' : 'Visual effects',
+ },
+ {
+ 'file' : 'generate.html',
+ 'title' : 'Generated content, automatic numbering, and lists',
+ },
+ {
+ 'file' : 'page.html',
+ 'title' : 'Paged media',
+ },
+ {
+ 'file' : 'colors.html',
+ 'title' : 'Colors and Backgrounds',
+ },
+ {
+ 'file' : 'fonts.html',
+ 'title' : 'Fonts',
+ },
+ {
+ 'file' : 'text.html',
+ 'title' : 'Text',
+ },
+ {
+ 'file' : 'tables.html',
+ 'title' : 'Tables',
+ },
+ {
+ 'file' : 'ui.html',
+ 'title' : 'User interface',
+ },
+ {
+ 'file' : 'aural.html',
+ 'title' : 'Appendix A. Aural style sheets',
+ },
+ {
+ 'file' : 'refs.html',
+ 'title' : 'Appendix B. Bibliography',
+ },
+ {
+ 'file' : 'changes.html',
+ 'title' : 'Appendix C. Changes',
+ },
+ {
+ 'file' : 'sample.html',
+ 'title' : 'Appendix D. Default style sheet for HTML 4',
+ },
+ {
+ 'file' : 'zindex.html',
+ 'title' : 'Appendix E. Elaborate description of Stacking Contexts',
+ },
+ {
+ 'file' : 'propidx.html',
+ 'title' : 'Appendix F. Full property table',
+ },
+ {
+ 'file' : 'grammar.html',
+ 'title' : 'Appendix G. Grammar of CSS',
+ },
+ {
+ 'file' : 'other.html',
+ 'title' : 'Other',
+ },
+];
+
+
+const kHTML4Data = {
+ 'path' : 'html4',
+ 'suffix' : '.htm'
+};
+
+const kXHTML1Data = {
+ 'path' : 'xhtml1',
+ 'suffix' : '.xht'
+};
+
+// Results popup
+const kResultsSelector = [
+ {
+ 'name': 'All Tests',
+ 'handler' : function(self) { self.showResultsForAllTests(); },
+ 'exporter' : function(self) { self.exportResultsForAllTests(); }
+ },
+ {
+ 'name': 'Completed Tests',
+ 'handler' : function(self) { self.showResultsForCompletedTests(); },
+ 'exporter' : function(self) { self.exportResultsForCompletedTests(); }
+ },
+ {
+ 'name': 'Passing Tests',
+ 'handler' : function(self) { self.showResultsForTestsWithStatus('pass'); },
+ 'exporter' : function(self) { self.exportResultsForTestsWithStatus('pass'); }
+ },
+ {
+ 'name': 'Failing Tests',
+ 'handler' : function(self) { self.showResultsForTestsWithStatus('fail'); },
+ 'exporter' : function(self) { self.exportResultsForTestsWithStatus('fail'); }
+ },
+ {
+ 'name': 'Skipped Tests',
+ 'handler' : function(self) { self.showResultsForTestsWithStatus('skipped'); },
+ 'exporter' : function(self) { self.exportResultsForTestsWithStatus('skipped'); }
+ },
+ {
+ 'name': 'Invalid Tests',
+ 'handler' : function(self) { self.showResultsForTestsWithStatus('invalid'); },
+ 'exporter' : function(self) { self.exportResultsForTestsWithStatus('invalid'); }
+ },
+ {
+ 'name': 'Tests where HTML4 and XHTML1 results differ',
+ 'handler' : function(self) { self.showResultsForTestsWithMismatchedResults(); },
+ 'exporter' : function(self) { self.exportResultsForTestsWithMismatchedResults(); }
+ },
+ {
+ 'name': 'Tests Not Run',
+ 'handler' : function(self) { self.showResultsForTestsNotRun(); },
+ 'exporter' : function(self) { self.exportResultsForTestsNotRun(); }
+ }
+];
+
+function Test(testInfoLine)
+{
+ var fields = testInfoLine.split('\t');
+
+ this.id = fields[0];
+ this.reference = fields[1];
+ this.title = fields[2];
+ this.flags = fields[3];
+ this.links = fields[4];
+ this.assertion = fields[5];
+
+ this.completed = false; // true if this test has a result (pass, fail or skip)
+
+ if (!this.links)
+ this.links = "other.html"
+}
+
+function ChapterSection(link)
+{
+ var result= link.match(/^([.\w]+)(#.+)?$/);
+ if (result != null) {
+ this.file = result[1];
+ this.anchor = result[2];
+ }
+
+ this.tests = [];
+}
+
+function Chapter(chapterInfo)
+{
+ this.file = chapterInfo.file;
+ this.title = chapterInfo.title;
+ this.testCount = 0;
+ this.sections = []; // array of ChapterSection
+}
+
+Chapter.prototype.description = function()
+{
+ return this.title + ' (' + this.testCount + ' tests)';
+}
+
+// Utils
+String.prototype.trim = function() { return this.replace(/^\s+|\s+$/g, ''); }
+
+function TestSuite()
+{
+ this.chapterSections = {}; // map of links to ChapterSections
+ this.tests = {}; // map of test id to test info
+
+ this.chapters = {}; // map of file name to chapter
+ this.currentChapter = null;
+
+ this.currentChapterTests = []; // array of tests for the current chapter.
+ this.currChapterTestIndex = -1; // index of test in the current chapter
+
+ this.format = '';
+ this.formatChanged('html4');
+
+ this.testInfoLoaded = false;
+
+ this.populatingDatabase = false;
+
+ var testInfoPath = kTestSuiteHome + kTestInfoDataFile;
+ this.loadTestInfo(testInfoPath);
+}
+
+TestSuite.prototype.loadTestInfo = function(testInfoPath)
+{
+ var _self = this;
+ this.asyncLoad(testInfoPath, 'data', function(data, status) {
+ _self.testInfoDataLoaded(data, status);
+ });
+}
+
+TestSuite.prototype.testInfoDataLoaded = function(data, status)
+{
+ if (status != 'success') {
+ alert("Failed to load testinfo.data. Database of tests will not be initialized.");
+ return;
+ }
+
+ this.parseTests(data);
+ this.buildChapters();
+
+ this.testInfoLoaded = true;
+
+ this.fillChapterPopup(document.getElementById('chapters'));
+
+ this.initializeControls();
+
+ this.openDatabase();
+}
+
+TestSuite.prototype.parseTests = function(data)
+{
+ var lines = data.split('\n');
+
+ // First line is column labels
+ for (var i = 1; i < lines.length; ++i) {
+ var test = new Test(lines[i]);
+ if (test.id.length > 0)
+ this.tests[test.id] = test;
+ }
+}
+
+TestSuite.prototype.buildChapters = function()
+{
+ for (var testID in this.tests) {
+ var currTest = this.tests[testID];
+
+ // FIXME: tests with more than one link will be presented to the user
+ // twice. Be smarter about avoiding this.
+ var testLinks = currTest.links.split(',');
+ for (var i = 0; i < testLinks.length; ++i) {
+ var link = testLinks[i];
+ var section = this.chapterSections[link];
+ if (!section) {
+ section = new ChapterSection(link);
+ this.chapterSections[link] = section;
+ }
+
+ section.tests.push(currTest);
+ }
+ }
+
+ for (var i = 0; i < kChapterData.length; ++i) {
+ var chapter = new Chapter(kChapterData[i]);
+ chapter.index = i;
+ this.chapters[chapter.file] = chapter;
+ }
+
+ for (var sectionName in this.chapterSections) {
+ var section = this.chapterSections[sectionName];
+
+ var file = section.file;
+ var chapter = this.chapters[file];
+ if (!chapter)
+ window.console.log('failed to find chapter ' + file + ' in chapter data.');
+ chapter.sections.push(section);
+ }
+
+ for (var chapterName in this.chapters) {
+ var currChapter = this.chapters[chapterName];
+ currChapter.sections.sort();
+
+ var testCount = 0;
+ for (var s = 0; s < currChapter.sections.length; ++s)
+ testCount += currChapter.sections[s].tests.length;
+
+ currChapter.testCount = testCount;
+ }
+}
+
+TestSuite.prototype.indexOfChapter = function(chapter)
+{
+ for (var i = 0; i < kChapterData.length; ++i) {
+ if (kChapterData[i].file == chapter.file)
+ return i;
+ }
+
+ window.console.log('indexOfChapter for ' + chapter.file + ' failed');
+ return -1;
+}
+
+TestSuite.prototype.chapterAtIndex = function(index)
+{
+ if (index < 0 || index >= kChapterData.length)
+ return null;
+
+ return this.chapters[kChapterData[index].file];
+}
+
+TestSuite.prototype.fillChapterPopup = function(select)
+{
+ select.innerHTML = ''; // Remove all children.
+
+ for (var i = 0; i < kChapterData.length; ++i) {
+ var chapterData = kChapterData[i];
+ var chapter = this.chapters[chapterData.file];
+
+ var option = document.createElement('option');
+ option.innerText = chapter.description();
+ option._chapter = chapter;
+
+ select.appendChild(option);
+ }
+}
+
+TestSuite.prototype.buildTestListForChapter = function(chapter)
+{
+ this.currentChapterTests = [];
+
+ for (var i in chapter.sections) {
+ var currSection = chapter.sections[i];
+ // FIXME: why do I need the assignment?
+ this.currentChapterTests = this.currentChapterTests.concat(currSection.tests);
+ }
+
+ // FIXME: test may occur more than once.
+ this.currentChapterTests.sort(function(a, b) {
+ return a.id.localeCompare(b.id);
+ });
+}
+
+TestSuite.prototype.initializeControls = function()
+{
+ var chaptersPopup = document.getElementById('chapters');
+
+ var _self = this;
+ chaptersPopup.addEventListener('change', function() {
+ _self.chapterPopupChanged();
+ }, false);
+
+ this.chapterPopupChanged();
+
+ // Results popup
+ var resultsPopup = document.getElementById('results-popup');
+ resultsPopup.innerHTML = '';
+
+ for (var i = 0; i < kResultsSelector.length; ++i) {
+ var option = document.createElement('option');
+ option.innerText = kResultsSelector[i].name;
+
+ resultsPopup.appendChild(option);
+ }
+}
+
+TestSuite.prototype.chapterPopupChanged = function()
+{
+ var chaptersPopup = document.getElementById('chapters');
+ var selectedChapter = chaptersPopup.options[chaptersPopup.selectedIndex]._chapter;
+
+ this.setSelectedChapter(selectedChapter);
+}
+
+TestSuite.prototype.fillTestList = function()
+{
+ var testList = document.getElementById('test-list');
+ testList.innerHTML = '';
+
+ for (var i = 0; i < this.currentChapterTests.length; ++i) {
+ var currTest = this.currentChapterTests[i];
+
+ var option = document.createElement('option');
+ option.innerText = currTest.id;
+ option.className = currTest.completed ? 'completed' : 'untested';
+ option._test = currTest;
+ testList.appendChild(option);
+ }
+}
+
+TestSuite.prototype.updateTestList = function()
+{
+ var testList = document.getElementById('test-list');
+
+ var options = testList.getElementsByTagName('option');
+ for (var i = 0; i < options.length; ++i) {
+ var currOption = options[i];
+ currOption.className = currOption._test.completed ? 'completed' : 'untested';
+ }
+}
+
+TestSuite.prototype.setSelectedChapter = function(chapter)
+{
+ this.currentChapter = chapter;
+ this.buildTestListForChapter(this.currentChapter);
+ this.currChapterTestIndex = -1;
+
+ this.fillTestList();
+ this.goToTestIndex(0);
+
+ var chaptersPopup = document.getElementById('chapters');
+ chaptersPopup.selectedIndex = this.indexOfChapter(chapter);
+}
+
+/* ------------------------------------------------------- */
+
+TestSuite.prototype.passTest = function()
+{
+ this.recordResult(this.currentTestName(), 'pass');
+ this.nextTest();
+}
+
+TestSuite.prototype.failTest = function()
+{
+ this.recordResult(this.currentTestName(), 'fail');
+ this.nextTest();
+}
+
+TestSuite.prototype.invalidTest = function()
+{
+ this.recordResult(this.currentTestName(), 'invalid');
+ this.nextTest();
+}
+
+TestSuite.prototype.skipTest = function(reason)
+{
+ this.recordResult(this.currentTestName(), 'skipped', reason);
+ this.nextTest();
+}
+
+TestSuite.prototype.nextTest = function()
+{
+ if (this.currChapterTestIndex < this.currentChapterTests.length - 1)
+ this.goToTestIndex(this.currChapterTestIndex + 1);
+ else {
+ var currChapterIndex = this.indexOfChapter(this.currentChapter);
+ this.goToChapterIndex(currChapterIndex + 1);
+ }
+}
+
+TestSuite.prototype.previousTest = function()
+{
+ if (this.currChapterTestIndex > 0)
+ this.goToTestIndex(this.currChapterTestIndex - 1);
+ else {
+ var currChapterIndex = this.indexOfChapter(this.currentChapter);
+ if (currChapterIndex > 0)
+ this.goToChapterIndex(currChapterIndex - 1);
+ }
+}
+
+/* ------------------------------------------------------- */
+
+TestSuite.prototype.goToTestIndex = function(index)
+{
+ if (index >= 0 && index < this.currentChapterTests.length) {
+ this.currChapterTestIndex = index;
+ this.loadCurrentTest();
+ }
+}
+
+TestSuite.prototype.goToChapterIndex = function(chapterIndex)
+{
+ if (chapterIndex >= 0 && chapterIndex < kChapterData.length) {
+ var chapterFile = kChapterData[chapterIndex].file;
+ this.setSelectedChapter(this.chapters[chapterFile]);
+ }
+}
+
+TestSuite.prototype.currentTestName = function()
+{
+ if (this.currChapterTestIndex < 0 || this.currChapterTestIndex >= this.currentChapterTests.length)
+ return undefined;
+
+ return this.currentChapterTests[this.currChapterTestIndex].id;
+}
+
+TestSuite.prototype.loadCurrentTest = function()
+{
+ var theTest = this.currentChapterTests[this.currChapterTestIndex];
+ if (!theTest) {
+ this.configureForManualTest();
+ this.clearTest();
+ return;
+ }
+
+ if (theTest.reference) {
+ this.configureForRefTest();
+ this.loadRef(theTest);
+ } else {
+ this.configureForManualTest();
+ }
+
+ this.loadTest(theTest);
+
+ document.getElementById('test-index').innerText = this.currChapterTestIndex + 1;
+ document.getElementById('chapter-test-count').innerText = this.currentChapterTests.length;
+
+ document.getElementById('test-list').selectedIndex = this.currChapterTestIndex;
+}
+
+TestSuite.prototype.configureForRefTest = function()
+{
+ $('#test-content').addClass('with-ref');
+}
+
+TestSuite.prototype.configureForManualTest = function()
+{
+ $('#test-content').removeClass('with-ref');
+}
+
+TestSuite.prototype.loadTest = function(test)
+{
+ var iframe = document.getElementById('test-frame');
+ iframe.src = this.urlForTest(test.id);
+
+ document.getElementById('test-title').innerText = test.title;
+ document.getElementById('test-url').innerText = this.pathForTest(test.id);
+ document.getElementById('test-assertion').innerText = test.assertion;
+ document.getElementById('test-flags').innerText = test.flags;
+}
+
+TestSuite.prototype.clearTest = function()
+{
+ var iframe = document.getElementById('test-frame');
+ iframe.src = 'about:blank';
+
+ document.getElementById('test-title').innerText = '';
+ document.getElementById('test-url').innerText = '';
+ document.getElementById('test-assertion').innerText = '';
+ document.getElementById('test-flags').innerText = '';
+}
+
+TestSuite.prototype.loadRef = function(test)
+{
+ var iframe = document.getElementById('ref-frame');
+ iframe.src = this.urlForTest(testInfo.reference);
+}
+
+TestSuite.prototype.loadTestByName = function(testName)
+{
+ var currChapterInfo = this.chapterInfoMap[this.currChapterName];
+
+ var testIndex = currChapterInfo.testNames.indexOf(testName);
+ if (testIndex >= 0 && testIndex < currChapterInfo.testNames.length)
+ this.goToTestIndex(testIndex);
+}
+
+TestSuite.prototype.pathForTest = function(testName)
+{
+ var prefix = this.formatInfo.path;
+ var suffix = this.formatInfo.suffix;
+
+ return prefix + '/' + testName + suffix;
+}
+
+TestSuite.prototype.urlForTest = function(testName)
+{
+ return kTestSuiteHome + this.pathForTest(testName);
+}
+
+/* ------------------------------------------------------- */
+
+TestSuite.prototype.recordResult = function(testName, resolution, comment)
+{
+ if (!testName)
+ return;
+
+ this.beginAppendingOutput();
+ this.appendResultToOutput(this.formatInfo, testName, resolution, comment);
+ this.endAppendingOutput();
+
+ if (comment == undefined)
+ comment = '';
+
+ this.storeTestResult(testName, this.format, resolution, comment, navigator.userAgent);
+ this.markTestCompleted(testName);
+ this.updateTestList();
+
+ this.updateSummaryData();
+}
+
+TestSuite.prototype.beginAppendingOutput = function()
+{
+}
+
+TestSuite.prototype.endAppendingOutput = function()
+{
+ var output = document.getElementById('output');
+ output.scrollTop = output.scrollHeight;
+}
+
+TestSuite.prototype.appendResultToOutput = function(formatData, testName, resolution, comment)
+{
+ var output = document.getElementById('output');
+
+ var result = formatData.path + '/' + testName + formatData.suffix + '\t' + resolution;
+ if (comment)
+ result += '\t(' + comment + ')';
+
+ var line = document.createElement('p');
+ line.className = resolution;
+ line.appendChild(document.createTextNode(result));
+ output.appendChild(line);
+}
+
+TestSuite.prototype.clearOutput = function()
+{
+ document.getElementById('output').innerHTML = '';
+}
+
+/* ------------------------------------------------------- */
+
+TestSuite.prototype.formatChanged = function(formatString)
+{
+ if (this.format == formatString)
+ return;
+
+ this.format = formatString;
+
+ if (formatString == 'html4')
+ this.formatInfo = kHTML4Data;
+ else
+ this.formatInfo = kXHTML1Data;
+
+ this.loadCurrentTest();
+}
+
+/* ------------------------------------------------------- */
+
+TestSuite.prototype.asyncLoad = function(url, type, handler)
+{
+ $.get(url, handler, type);
+}
+
+/* ------------------------------------------------------- */
+
+TestSuite.prototype.exportResults = function(resultTypeIndex)
+{
+ var resultInfo = kResultsSelector[resultTypeIndex];
+ if (!resultInfo)
+ return;
+
+ resultInfo.exporter(this);
+}
+
+TestSuite.prototype.exportHeader = function()
+{
+ var result = '# Safari 5.0.2' + ' ' + navigator.platform + '\n';
+ result += '# ' + navigator.userAgent + '\n';
+ result += '# http://test.csswg.org/suites/css2.1/' + kTestSuiteVersion + '/\n';
+ result += 'testname\tresult\n';
+
+ return result;
+}
+
+TestSuite.prototype.createExportLine = function(formatData, testName, resolution, comment)
+{
+ var result = formatData.path + '/' + testName + '\t' + resolution;
+ if (comment)
+ result += '\t(' + comment + ')';
+ return result;
+}
+
+TestSuite.prototype.exportQueryComplete = function(data)
+{
+ window.open("data:text/plain," + escape(data))
+}
+
+TestSuite.prototype.resultsPopupChanged = function(index)
+{
+ var resultInfo = kResultsSelector[index];
+ if (!resultInfo)
+ return;
+
+ this.clearOutput();
+ resultInfo.handler(this);
+
+ var enableExport = resultInfo.exporter != undefined;
+ document.getElementById('export-button').disabled = !enableExport;
+}
+
+/* -------------------------------------------------------- */
+
+TestSuite.prototype.exportResultsCompletion = function(exportTests)
+{
+ window.console.log('exportResultsCompletion')
+ // Lame workaround for ORDER BY not working
+ exportTests.sort(function(a, b) {
+ return a.test.localeCompare(b.test);
+ });
+
+ var exportLines = [];
+ for (var i = 0; i < exportTests.length; ++i) {
+ var currTest = exportTests[i];
+ if (currTest.html4 != '')
+ exportLines.push(currTest.html4);
+ if (currTest.xhtml1 != '')
+ exportLines.push(currTest.xhtml1);
+ }
+
+ var exportString = this.exportHeader() + exportLines.join('\n');
+ this.exportQueryComplete(exportString);
+}
+
+/* -------------------------------------------------------- */
+
+TestSuite.prototype.showResultsForCompletedTests = function()
+{
+ this.beginAppendingOutput();
+
+ var _self = this;
+ this.queryDatabaseForCompletedTests(
+ function(item) {
+ if (item.hstatus)
+ _self.appendResultToOutput(kHTML4Data, item.test, item.hstatus, item.hcomment);
+
+ if (item.xstatus)
+ _self.appendResultToOutput(kXHTML1Data, item.test, item.xstatus, item.xcomment);
+ },
+ function() {
+ _self.endAppendingOutput();
+ }
+ );
+}
+
+TestSuite.prototype.exportResultsForCompletedTests = function()
+{
+ var exportTests = []; // each test will have html and xhtml items on it
+
+ var _self = this;
+ this.queryDatabaseForCompletedTests(
+ function(item) {
+ var htmlLine = '';
+ if (item.hstatus)
+ htmlLine= _self.createExportLine(kHTML4Data, item.test, item.hstatus, item.hcomment);
+
+ var xhtmlLine = '';
+ if (item.xstatus)
+ xhtmlLine = _self.createExportLine(kXHTML1Data, item.test, item.xstatus, item.xcomment);
+
+ exportTests.push({
+ 'test' : item.test,
+ 'html4' : htmlLine,
+ 'xhtml1' : xhtmlLine });
+ },
+ function() {
+ _self.exportResultsCompletion(exportTests);
+ }
+ );
+}
+
+
+/* -------------------------------------------------------- */
+
+TestSuite.prototype.showResultsForAllTests = function()
+{
+ this.beginAppendingOutput();
+
+ var _self = this;
+ this.queryDatabaseForAllTests('test',
+ function(item) {
+ _self.appendResultToOutput(kHTML4Data, item.test, item.hstatus, item.hcomment);
+ _self.appendResultToOutput(kXHTML1Data, item.test, item.xstatus, item.xcomment);
+ },
+ function() {
+ _self.endAppendingOutput();
+ });
+}
+
+TestSuite.prototype.exportResultsForAllTests = function()
+{
+ var exportTests = [];
+
+ var _self = this;
+ this.queryDatabaseForAllTests('test',
+ function(item) {
+ var htmlLine= _self.createExportLine(kHTML4Data, item.test, item.hstatus, item.hcomment);
+ var xhtmlLine = _self.createExportLine(kXHTML1Data, item.test, item.xstatus, item.xcomment);
+ exportTests.push({
+ 'test' : item.test,
+ 'html4' : htmlLine,
+ 'xhtml1' : xhtmlLine });
+ },
+ function() {
+ _self.exportResultsCompletion(exportTests);
+ }
+ );
+}
+
+/* -------------------------------------------------------- */
+
+TestSuite.prototype.showResultsForTestsNotRun = function()
+{
+ this.beginAppendingOutput();
+
+ var _self = this;
+ this.queryDatabaseForTestsNotRun(
+ function(item) {
+ if (!item.hstatus)
+ _self.appendResultToOutput(kHTML4Data, item.test, '?', item.hcomment);
+ if (!item.xstatus)
+ _self.appendResultToOutput(kXHTML1Data, item.test, '?', item.xcomment);
+ },
+ function() {
+ _self.endAppendingOutput();
+ }
+ );
+}
+
+TestSuite.prototype.exportResultsForTestsNotRun = function()
+{
+ var exportTests = [];
+
+ var _self = this;
+ this.queryDatabaseForTestsNotRun(
+ function(item) {
+ var htmlLine = '';
+ if (!item.hstatus)
+ htmlLine= _self.createExportLine(kHTML4Data, item.test, '?', item.hcomment);
+
+ var xhtmlLine = '';
+ if (!item.xstatus)
+ xhtmlLine = _self.createExportLine(kXHTML1Data, item.test, '?', item.xcomment);
+
+ exportTests.push({
+ 'test' : item.test,
+ 'html4' : htmlLine,
+ 'xhtml1' : xhtmlLine });
+ },
+ function() {
+ _self.exportResultsCompletion(exportTests);
+ }
+ );
+}
+
+/* -------------------------------------------------------- */
+
+TestSuite.prototype.showResultsForTestsWithStatus = function(status)
+{
+ this.beginAppendingOutput();
+
+ var _self = this;
+ this.queryDatabaseForTestsWithStatus(status,
+ function(item) {
+ if (item.hstatus == status)
+ _self.appendResultToOutput(kHTML4Data, item.test, item.hstatus, item.hcomment);
+ if (item.xstatus == status)
+ _self.appendResultToOutput(kXHTML1Data, item.test, item.xstatus, item.xcomment);
+ },
+ function() {
+ _self.endAppendingOutput();
+ }
+ );
+}
+
+TestSuite.prototype.exportResultsForTestsWithStatus = function(status)
+{
+ var exportTests = [];
+
+ var _self = this;
+ this.queryDatabaseForTestsWithStatus(status,
+ function(item) {
+ var htmlLine = '';
+ if (item.hstatus == status)
+ htmlLine= _self.createExportLine(kHTML4Data, item.test, item.hstatus, item.hcomment);
+
+ var xhtmlLine = '';
+ if (item.xstatus == status)
+ xhtmlLine = _self.createExportLine(kXHTML1Data, item.test, item.xstatus, item.xcomment);
+
+ exportTests.push({
+ 'test' : item.test,
+ 'html4' : htmlLine,
+ 'xhtml1' : xhtmlLine });
+ },
+ function() {
+ _self.exportResultsCompletion(exportTests);
+ }
+ );
+}
+
+/* -------------------------------------------------------- */
+
+TestSuite.prototype.showResultsForTestsWithMismatchedResults = function()
+{
+ this.beginAppendingOutput();
+
+ var _self = this;
+ this.queryDatabaseForTestsWithMixedStatus(
+ function(item) {
+ _self.appendResultToOutput(kHTML4Data, item.test, item.hstatus, item.hcomment);
+ _self.appendResultToOutput(kXHTML1Data, item.test, item.xstatus, item.xcomment);
+ },
+ function() {
+ _self.endAppendingOutput();
+ }
+ );
+}
+
+TestSuite.prototype.exportResultsForTestsWithMismatchedResults = function()
+{
+ var exportTests = [];
+
+ var _self = this;
+ this.queryDatabaseForTestsWithMixedStatus(
+ function(item) {
+ var htmlLine= _self.createExportLine(kHTML4Data, item.test, item.hstatus, item.hcomment);
+ var xhtmlLine = _self.createExportLine(kXHTML1Data, item.test, item.xstatus, item.xcomment);
+ exportTests.push({
+ 'test' : item.test,
+ 'html4' : htmlLine,
+ 'xhtml1' : xhtmlLine });
+ },
+ function() {
+ _self.exportResultsCompletion(exportTests);
+ }
+ );
+}
+
+/* -------------------------------------------------------- */
+
+TestSuite.prototype.markTestCompleted = function(testID)
+{
+ var test = this.tests[testID];
+ if (!test) {
+ window.console.log('markTestCompleted to find test ' + testID);
+ return;
+ }
+
+ test.completed = true;
+}
+
+TestSuite.prototype.testCompletionStateChanged = function()
+{
+ // update the test list
+ this.updateTestList();
+}
+
+TestSuite.prototype.loadTestStatus = function()
+{
+ var _self = this;
+ this.queryDatabaseForCompletedTests(
+ function(item) {
+ _self.markTestCompleted(item.test);
+ },
+ function() {
+ _self.testCompletionStateChanged();
+ }
+ );
+}
+
+/* -------------------------------------------------------- */
+
+TestSuite.prototype.updateSummaryData = function()
+{
+ this.queryDatabaseForSummary(
+ function(results) {
+
+ var hTotal, xTotal;
+ var hDone, xDone;
+
+ for (var i = 0; i < results.length; ++i) {
+ var result = results[i];
+
+ switch (result.name) {
+ case 'h-total': hTotal = result.count; break;
+ case 'x-total': xTotal = result.count; break;
+ case 'h-tested': hDone = result.count; break;
+ case 'x-tested': xDone = result.count; break;
+ }
+
+ document.getElementById(result.name).innerText = result.count;
+ }
+
+ // We should get these all together.
+ if (hTotal) {
+ document.getElementById('h-percent').innerText = Math.round(100.0 * hDone / hTotal);
+ document.getElementById('x-percent').innerText = Math.round(100.0 * xDone / xTotal);
+ }
+ }
+ );
+}
+
+/* ------------------------------------------------------- */
+// Database stuff
+
+function errorHandler(transaction, error)
+{
+ alert('Database error: ' + error.message);
+ window.console.log('Database error: ' + error.message);
+}
+
+TestSuite.prototype.openDatabase = function()
+{
+ if (!'openDatabase' in window) {
+ alert('Your browser does not support client-side SQL databases, so results will not be stored.');
+ return;
+ }
+
+ var _self = this;
+ this.db = window.openDatabase('css21testsuite', '1.0', 'CSS 2.1 test suite results', 10 * 1024 * 1024, function() {
+ _self.databaseCreated();
+ }, errorHandler);
+
+ this.updateSummaryData();
+ this.loadTestStatus();
+}
+
+TestSuite.prototype.databaseCreated = function(db)
+{
+ this.populatingDatabase = true;
+
+ var _self = this;
+ this.db.transaction(function (tx) {
+ // hstatus: HTML4 result
+ // xstatus: XHTML1 result
+ tx.executeSql('CREATE TABLE tests (test PRIMARY KEY UNIQUE, ref, title, flags, links, assertion, hstatus, hcomment, xstatus, xcomment)', null,
+ function(tx, results) {
+ _self.populateDatabaseFromTestInfoData();
+ }, errorHandler);
+ });
+}
+
+TestSuite.prototype.storeTestResult = function(test, format, result, comment, useragent)
+{
+ if (!this.db)
+ return;
+
+ this.db.transaction(function (tx) {
+ if (format == 'html4')
+ tx.executeSql('UPDATE tests SET hstatus=?, hcomment=? WHERE test=?\n', [result, comment, test], null, errorHandler);
+ else if (format == 'xhtml1')
+ tx.executeSql('UPDATE tests SET xstatus=?, xcomment=? WHERE test=?\n', [result, comment, test], null, errorHandler);
+ });
+}
+
+TestSuite.prototype.populateDatabaseFromTestInfoData = function(testInfoURL)
+{
+ if (!this.testInfoLoaded) {
+ window.console.log('Tring to populate database before testinfo.data has been loaded');
+ return;
+ }
+
+ var _self = this;
+ this.db.transaction(function (tx) {
+ for (var testID in _self.tests) {
+ var currTest = _self.tests[testID];
+ tx.executeSql('INSERT INTO tests (test, ref, title, flags, links, assertion) VALUES (?, ?, ?, ?, ?, ?)', [currTest.id, currTest.reference, currTest.title, currTest.flags, currTest.links, currTest.assertion], null, errorHandler);
+ }
+
+ _self.populatingDatabase = false;
+ });
+
+}
+
+TestSuite.prototype.queryDatabaseForAllTests = function(sortKey, perRowHandler, completionHandler)
+{
+ if (this.populatingDatabase)
+ return;
+
+ var _self = this;
+ this.db.transaction(function (tx) {
+ if (_self.populatingDatabase)
+ return;
+ var query;
+ var args = [];
+ if (sortKey != '') {
+ query = 'SELECT * FROM tests ORDER BY ? ASC'; // ORDER BY doesn't seem to work
+ args.push(sortKey);
+ }
+ else
+ query = 'SELECT * FROM tests';
+
+ tx.executeSql(query, args, function(tx, results) {
+
+ var len = results.rows.length;
+ for (var i = 0; i < len; ++i)
+ perRowHandler(results.rows.item(i));
+
+ completionHandler();
+ }, errorHandler);
+ });
+}
+
+TestSuite.prototype.queryDatabaseForTestsWithStatus = function(status, perRowHandler, completionHandler)
+{
+ if (this.populatingDatabase)
+ return;
+
+ var _self = this;
+ this.db.transaction(function (tx) {
+ if (_self.populatingDatabase)
+ return;
+ tx.executeSql('SELECT * FROM tests WHERE hstatus=? OR xstatus=?', [status, status], function(tx, results) {
+
+ var len = results.rows.length;
+ for (var i = 0; i < len; ++i)
+ perRowHandler(results.rows.item(i));
+
+ completionHandler();
+ }, errorHandler);
+ });
+}
+
+TestSuite.prototype.queryDatabaseForTestsWithMixedStatus = function(perRowHandler, completionHandler)
+{
+ if (this.populatingDatabase)
+ return;
+
+ var _self = this;
+ this.db.transaction(function (tx) {
+ if (_self.populatingDatabase)
+ return;
+ tx.executeSql('SELECT * FROM tests WHERE hstatus IS NOT NULL AND xstatus IS NOT NULL AND hstatus <> xstatus', [], function(tx, results) {
+
+ var len = results.rows.length;
+ for (var i = 0; i < len; ++i)
+ perRowHandler(results.rows.item(i));
+
+ completionHandler();
+ }, errorHandler);
+ });
+}
+
+TestSuite.prototype.queryDatabaseForCompletedTests = function(perRowHandler, completionHandler)
+{
+ if (this.populatingDatabase)
+ return;
+
+ var _self = this;
+ this.db.transaction(function (tx) {
+
+ if (_self.populatingDatabase)
+ return;
+
+ tx.executeSql('SELECT * FROM tests WHERE hstatus IS NOT NULL OR xstatus IS NOT NULL', [], function(tx, results) {
+ var len = results.rows.length;
+ for (var i = 0; i < len; ++i)
+ perRowHandler(results.rows.item(i));
+
+ completionHandler();
+ }, errorHandler);
+ });
+}
+
+TestSuite.prototype.queryDatabaseForTestsNotRun = function(perRowHandler, completionHandler)
+{
+ if (this.populatingDatabase)
+ return;
+
+ var _self = this;
+ this.db.transaction(function (tx) {
+ if (_self.populatingDatabase)
+ return;
+
+ tx.executeSql('SELECT * FROM tests WHERE hstatus IS NULL OR xstatus IS NULL', [], function(tx, results) {
+
+ var len = results.rows.length;
+ for (var i = 0; i < len; ++i)
+ perRowHandler(results.rows.item(i));
+
+ completionHandler();
+ }, errorHandler);
+ });
+}
+
+/*
+
+ completionHandler gets called an array of results,
+ which may be some or all of:
+
+ data = [
+ { 'name' : ,
+ 'count' :
+ },
+ ]
+
+ where name is one of:
+
+ 'h-total'
+ 'h-tested'
+ 'h-passed'
+ 'h-failed'
+ 'h-skipped'
+
+ 'x-total'
+ 'x-tested'
+ 'x-passed'
+ 'x-failed'
+ 'x-skipped'
+
+ */
+
+
+TestSuite.prototype.countTestsWithColumnValue = function(tx, completionHandler, column, value, label)
+{
+ var allRowsCount = 'COUNT(*)';
+
+ tx.executeSql('SELECT COUNT(*) FROM tests WHERE ' + column + '=?', [value], function(tx, results) {
+ var data = [];
+ if (results.rows.length > 0)
+ data.push({ 'name' : label, 'count' : results.rows.item(0)[allRowsCount] })
+ completionHandler(data);
+ }, errorHandler);
+}
+
+TestSuite.prototype.queryDatabaseForSummary = function(completionHandler)
+{
+ if (!this.db || this.populatingDatabase)
+ return;
+
+ var _self = this;
+ this.db.transaction(function (tx) {
+
+ if (_self.populatingDatabase)
+ return;
+
+ var allRowsCount = 'COUNT(*)';
+ var html4RowsCount = 'COUNT(hstatus)';
+ var xhtml1RowsCount = 'COUNT(xstatus)';
+
+ tx.executeSql('SELECT COUNT(*), COUNT(hstatus), COUNT(xstatus) FROM tests', [], function(tx, results) {
+
+ var data = [];
+ if (results.rows.length > 0) {
+ var rowItem = results.rows.item(0);
+ data.push({ 'name' : 'h-total' , 'count' : rowItem[allRowsCount] })
+ data.push({ 'name' : 'x-total' , 'count' : rowItem[allRowsCount] })
+ data.push({ 'name' : 'h-tested', 'count' : rowItem[html4RowsCount] })
+ data.push({ 'name' : 'x-tested', 'count' : rowItem[xhtml1RowsCount] })
+ }
+ completionHandler(data);
+
+ }, errorHandler);
+
+ _self.countTestsWithColumnValue(tx, completionHandler, 'hstatus', 'pass', 'h-passed');
+ _self.countTestsWithColumnValue(tx, completionHandler, 'xstatus', 'pass', 'x-passed');
+
+ _self.countTestsWithColumnValue(tx, completionHandler, 'hstatus', 'fail', 'h-failed');
+ _self.countTestsWithColumnValue(tx, completionHandler, 'xstatus', 'fail', 'x-failed');
+
+ _self.countTestsWithColumnValue(tx, completionHandler, 'hstatus', 'skipped', 'h-skipped');
+ _self.countTestsWithColumnValue(tx, completionHandler, 'xstatus', 'skipped', 'x-skipped');
+
+ _self.countTestsWithColumnValue(tx, completionHandler, 'hstatus', 'invalid', 'h-invalid');
+ _self.countTestsWithColumnValue(tx, completionHandler, 'xstatus', 'invalid', 'x-invalid');
+ });
+}
+
diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index eace217..b2a3791 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,1500 @@
+2010-09-28 Johnny Ding <jnd@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ https://bugs.webkit.org/show_bug.cgi?id=41292
+ Add a new parameter to the test plugin to allow specifying a script
+ and a mouse/keyboard event. The specified script will be evaluated
+ in the browser when the specified event is received by the plugin.
+
+ * DumpRenderTree/TestNetscapePlugIn/PluginObject.cpp:
+ (pluginAllocate):
+ * DumpRenderTree/TestNetscapePlugIn/PluginObject.h:
+ * DumpRenderTree/TestNetscapePlugIn/main.cpp:
+ (NPP_New):
+ (handleEventCarbon):
+ (handleEventCocoa):
+
+2010-09-28 Simon Fraser <simon.fraser@apple.com>
+
+ Fix export by adding missing argument.
+
+ * CSSTestSuiteHarness/harness/harness.js:
+ (TestSuite.prototype.showResultsForAllTests):
+
+2010-09-28 Kevin Ollivier <kevino@theolliviers.com>
+
+ [wx] Build fix, add missing import.
+
+ * wx/packaging/build-win-installer.py:
+
+2010-09-28 Simon Fraser <simon.fraser@apple.com>
+
+ No review
+
+ Show which tests have been run by dimming them out in the test list.
+
+ Adjust some element sizes.
+
+ * CSSTestSuiteHarness/harness/harness.css:
+ (#test-list > option.untested):
+ (#test-list > option.completed):
+ (#output):
+ (.output-options):
+ * CSSTestSuiteHarness/harness/harness.js:
+ (Test):
+ (TestSuite.prototype.fillTestList):
+ (TestSuite.prototype.updateTestList):
+ (TestSuite.prototype.setSelectedChapter):
+ (TestSuite.prototype.recordResult):
+ (TestSuite.prototype.markTestCompleted):
+ (TestSuite.prototype.testCompletionStateChanged):
+ (TestSuite.prototype.loadTestStatus):
+
+2010-09-28 Simon Fraser <simon.fraser@apple.com>
+
+ No review.
+
+ Implement export of various queries on the test database, sharing
+ code with that which displays results inline.
+
+ * CSSTestSuiteHarness/harness/harness.js:
+ ():
+ (TestSuite.prototype.exportResultsCompletion.var):
+ (TestSuite.prototype.exportResultsCompletion):
+ (TestSuite.prototype.showResultsForCompletedTests):
+ (TestSuite.prototype.exportResultsForCompletedTests):
+ (TestSuite.prototype.showResultsForAllTests):
+ (TestSuite.prototype.exportResultsForAllTests):
+ (TestSuite.prototype.exportResultsForTestsNotRun):
+ (TestSuite.prototype.exportResultsForTestsWithStatus):
+ (TestSuite.prototype.exportResultsForTestsWithMismatchedResults):
+
+2010-09-28 Simon Fraser <simon.fraser@apple.com>
+
+ No review.
+
+ Work around uncertainty about the order of database
+ transactions when creating the database, so that we don't
+ try to query the table before it has been created.
+
+ * CSSTestSuiteHarness/harness/harness.js:
+ (TestSuite):
+ (TestSuite.prototype.databaseCreated):
+ (TestSuite.prototype.storeTestResult):
+ (TestSuite.prototype.populateDatabaseFromTestInfoData):
+ (TestSuite.prototype.queryDatabaseForTestsWithStatus):
+ (TestSuite.prototype.queryDatabaseForTestsWithMixedStatus):
+ (TestSuite.prototype.queryDatabaseForCompletedTests):
+ (TestSuite.prototype.queryDatabaseForTestsNotRun):
+
+2010-09-28 Tony Chang <tony@chromium.org>
+
+ Reviewed by Eric Seidel.
+
+ add python keyring support to webkit-patch
+ https://bugs.webkit.org/show_bug.cgi?id=41269
+
+ * Scripts/webkitpy/common/net/credentials.py: Add the ability to read passwords using
+ the python keyring module
+ * Scripts/webkitpy/common/net/credentials_unittest.py:
+ * Scripts/webkitpy/common/system/user.py: Allow confirm() to default to no and add testing params.
+ * Scripts/webkitpy/common/system/user_unittest.py:
+ * Scripts/webkitpy/tool/mocktool.py:
+
+2010-09-28 Martin Robinson <mrobinson@igalia.com>
+
+ Reviewed by Gustavo Noronha Silva.
+
+ [Cairo] FreeType fonts should obey FontConfig hinting/anti-aliasing settings
+ https://bugs.webkit.org/show_bug.cgi?id=46740
+
+ * DumpRenderTree/gtk/fonts/fonts.conf: Add specialized variants of common
+ fonts which can be used to fully test FontConfig rendering settings.
+
+2010-09-28 Martin Robinson <mrobinson@igalia.com>
+
+ Reviewed by Gustavo Noronha Silva.
+
+ [gtk] Fedora has a different path for the liberation fonts
+ https://bugs.webkit.org/show_bug.cgi?id=46709
+
+ When searching for DRT fonts, also look in the path where those fonts
+ are commonly found on Fedora systems.
+
+ * DumpRenderTree/gtk/DumpRenderTree.cpp:
+ (initializeFonts): Include logic for looking for Fedora-style font paths.
+
+2010-09-28 Martin Robinson <mrobinson@igalia.com>
+
+ Reviewed by Andreas Kling.
+
+ run-webkit-tests needs an updated list of directories with webgl tests
+ https://bugs.webkit.org/show_bug.cgi?id=46747
+
+ Update the list of directories containing WebGL tests and a unit test
+ which depends on this list.
+
+ * Scripts/old-run-webkit-tests: Update the list of directories.
+ * Scripts/webkitpy/layout_tests/port/webkit.py: Ditto.
+ * Scripts/webkitpy/layout_tests/port/webkit_unittest.py: Update the expected result.
+
+2010-09-28 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Introduce FailureMap to summaries the failures status of all the bots
+ https://bugs.webkit.org/show_bug.cgi?id=46700
+
+ This patch gives the SheriffBot a handle on the list of failing tests.
+
+ * Scripts/webkitpy/common/net/buildbot.py:
+ * Scripts/webkitpy/common/net/failuremap.py: Added.
+ * Scripts/webkitpy/tool/commands/queries.py:
+ * Scripts/webkitpy/tool/commands/sheriffbot.py:
+ * Scripts/webkitpy/tool/mocktool.py:
+
+2010-09-28 Adam Roben <aroben@apple.com>
+
+ Update for the addition of WKPageUIClient::didNotHandleKeyEvent
+
+ Fixes <http://webkit.org/b/46660> <rdar://problem/8483465> Need API to
+ tell a WebKit2 client application that a key event was not handled
+
+ Reviewed by Kenneth Rohde Christiansen and Sam Weinig.
+
+ * MiniBrowser/mac/BrowserWindowController.m:
+ (-[BrowserWindowController awakeFromNib]):
+ * MiniBrowser/win/BrowserView.cpp:
+ (BrowserView::create):
+ * WebKitTestRunner/TestController.cpp:
+ (WTR::createOtherPage):
+ (WTR::TestController::initialize):
+
+2010-09-28 Simon Fraser <simon.fraser@apple.com>
+
+ Unreviewed.
+
+ Update the CSSTestSuiteHarness to not scrape the XHTML chapter files
+ for the test order, but instead use information from testinfo.data.
+
+ * CSSTestSuiteHarness/harness/harness.html:
+ * CSSTestSuiteHarness/harness/harness.js:
+
+2010-09-28 Kevin Ollivier <kevino@theolliviers.com>
+
+ [wx] Build fix, don't try to get the svn revision from the git repo when packaging,
+ it causes the process to hang on the gitorious repo.
+
+ * wx/packaging/build-mac-installer.py:
+ * wx/packaging/build-win-installer.py:
+
+2010-09-28 Adam Roben <aroben@apple.com>
+
+ Test that a plugin's HWND is sized/positioned before NPP_SetWindow is
+ called
+
+ Reviewed by Anders Carlsson.
+
+ Test for <http://webkit.org/b/46716> <rdar://problem/8482014>
+ Full-page Adobe Reader does not paint until window is resized
+
+ * DumpRenderTree/TestNetscapePlugIn/PluginTest.cpp:
+ (PluginTest::NPP_SetWindow): Added. Just returns NPERR_NO_ERROR at
+ this level.
+
+ * DumpRenderTree/TestNetscapePlugIn/PluginTest.h: Declared
+ NPP_SetWindow.
+
+ * DumpRenderTree/TestNetscapePlugIn/Tests/win/WindowGeometryInitializedBeforeSetWindow.cpp: Added.
+ (WindowGeometryInitializedBeforeSetWindow::NPP_SetWindow): Checks that
+ the plugin's HWND has a non-zero size and that its size/position
+ matches that specified in the NPWindow.
+
+ * DumpRenderTree/TestNetscapePlugIn/main.cpp:
+ (NPP_SetWindow): Call through to the PluginTest.
+
+ * DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.vcproj:
+ Added WindowGeometryInitializedBeforeSetWindow.cpp, and let VS reorder
+ the files as it saw fit.
+
+2010-09-28 Benjamin Poulain <benjamin.poulain@nokia.com>
+
+ Reviewed by Andreas Kling.
+
+ [Qt] Remove support for Qt 4.5
+ https://bugs.webkit.org/show_bug.cgi?id=46718
+
+ Remove the code for versions of Qt prior to 4.6.
+
+ * DumpRenderTree/qt/EventSenderQt.cpp:
+ (EventSender::addTouchPoint):
+ (EventSender::updateTouchPoint):
+ (EventSender::setTouchModifier):
+ (EventSender::touchStart):
+ (EventSender::touchMove):
+ (EventSender::touchEnd):
+ (EventSender::clearTouchPoints):
+ (EventSender::releaseTouchPoint):
+ (EventSender::sendTouchEvent):
+ * DumpRenderTree/qt/EventSenderQt.h:
+ * DumpRenderTree/qt/TextInputControllerQt.cpp:
+ (TextInputController::setMarkedText):
+ * QtTestBrowser/launcherwindow.cpp:
+ (LauncherWindow::LauncherWindow):
+ (LauncherWindow::initializeView):
+ (LauncherWindow::createChrome):
+ (LauncherWindow::sendTouchEvent):
+ (LauncherWindow::eventFilter):
+ (LauncherWindow::applyZoom):
+ (LauncherWindow::setTouchMocking):
+ * QtTestBrowser/launcherwindow.h:
+ * QtTestBrowser/utils.cpp:
+ (urlFromUserInput):
+ * QtTestBrowser/webview.cpp:
+ (WebViewGraphicsBased::animatedFlip):
+ (WebViewGraphicsBased::animatedYFlip):
+ * QtTestBrowser/webview.h:
+ (WebViewGraphicsBased::setYRotation):
+
+2010-09-28 İsmail Dönmez <ismail@namtrac.org>
+
+ Reviewed by Andreas Kling.
+
+ Fix DRT compilation on WinCE. Introduce a WCECOMPAT variable
+ which should point to wcecompat installation. Needs wcecompat
+ library from http://github.com/mauricek/wcecompat .
+
+ * DumpRenderTree/qt/DumpRenderTree.pro:
+ * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
+ (WebCore::DumpRenderTree::resetToConsistentStateBeforeTesting):
+
+2010-09-28 Daniel Bates <dbates@rim.com>
+
+ Rollout changeset 68493 <http://trac.webkit.org/changeset/68493>
+ <https://bugs.webkit.org/show_bug.cgi?id=39136>
+
+ Rollout changeset 68493 because it broke Sheriffbot's rollout feature.
+ In particular, this change caused Sheriffbot to raise an exception when
+ trying to parse the bug id on a bug page. We need to look into this
+ some more.
+
+ * Scripts/webkitpy/common/net/bugzilla.py:
+ * Scripts/webkitpy/common/net/bugzilla_unittest.py:
+ * Scripts/webkitpy/tool/bot/sheriff.py:
+ * Scripts/webkitpy/tool/commands/download.py:
+ * Scripts/webkitpy/tool/commands/queues.py:
+ * Scripts/webkitpy/tool/commands/upload.py:
+ * Scripts/webkitpy/tool/steps/closebug.py:
+ * Scripts/webkitpy/tool/steps/obsoletepatches.py:
+ * Scripts/webkitpy/tool/steps/preparechangelog.py:
+ * Scripts/webkitpy/tool/steps/updatechangelogswithreviewer.py:
+
+2010-09-28 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Move RegressionWindow further up the dependency chain
+ https://bugs.webkit.org/show_bug.cgi?id=46698
+
+ Baby steps towards pushing this information into bug posts.
+
+ * Scripts/webkitpy/common/net/buildbot.py:
+ * Scripts/webkitpy/common/net/buildbot_unittest.py:
+ * Scripts/webkitpy/common/net/regressionwindow.py:
+ * Scripts/webkitpy/tool/commands/queries.py:
+
+2010-09-27 Daniel Bates <dbates@rim.com>
+
+ Reviewed by Adam Barth.
+
+ sheriffbot can't roll out security patches
+ https://bugs.webkit.org/show_bug.cgi?id=39136
+
+ Make SheriffBot determine if it's authorized to view a bug
+ whose change it wants to rollout before it tries to rollout
+ the change.
+
+ Moreover, make both webkit-patch and Sheriffbot provide human-
+ readable error messages when they are not authorized to view
+ a bug and when a bug number is invalid.
+
+ Currently, Sheriffbot does not parse Bugzilla bugs for
+ <bug error="...">, which indicates an error when retrieving
+ a bug. In particular, error="NotPermitted" if a person (or bot)
+ is not authorized to view a bug. For such error="NotPermitted" bugs,
+ Sheriffbot raises an exception when parsing the bug report and
+ this exception does not explicitly indicate Sheriffbot's lack
+ of authorization. Instead, Sheriffbot should explicitly check
+ for the presence <bug error="..."> before operating on a bug
+ and error with a human-readable message if it's not permitted
+ to view it.
+
+ * Scripts/webkitpy/common/net/bugzilla.py: Added BugzillaError class.
+ * Scripts/webkitpy/common/net/bugzilla_unittest.py:
+ - Added unit test test_bug_parsing_for_bugzilla_not_permitted_error().
+ - Added unit test test_bug_parsing_for_bugzilla_not_found_error().
+ - Added unit test test_bug_parsing_for_bugzilla_invalid_bug_id_error().
+ * Scripts/webkitpy/tool/bot/sheriff.py: Modified to catch BugzillaError.
+ * Scripts/webkitpy/tool/commands/download.py: Ditto.
+ * Scripts/webkitpy/tool/commands/queues.py: Ditto.
+ * Scripts/webkitpy/tool/commands/upload.py: Ditto.
+ * Scripts/webkitpy/tool/steps/closebug.py: Ditto.
+ * Scripts/webkitpy/tool/steps/obsoletepatches.py: Ditto.
+ * Scripts/webkitpy/tool/steps/preparechangelog.py: Ditto.
+ * Scripts/webkitpy/tool/steps/updatechangelogswithreviewer.py: Ditto.
+
+2010-09-27 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Expose more more failure information from Buildbot to SheriffBot
+ https://bugs.webkit.org/show_bug.cgi?id=46697
+
+ This patch moves the information about what tests failured closer to
+ SheriffBot. There are still a couple more patches to go before
+ SheriffBot can post this information to bugs, but this is a step in
+ that direction. Yay for unit tests, which caught some bugs in earlier
+ versions of this patch.
+
+ * Scripts/webkitpy/common/net/buildbot.py:
+ * Scripts/webkitpy/common/net/buildbot_unittest.py:
+ * Scripts/webkitpy/common/net/regressionwindow.py: Added.
+ * Scripts/webkitpy/tool/commands/queries.py:
+
+2010-09-27 Eric Seidel <eric@webkit.org>
+
+ Unreviewed. Fixing 500 error seen in the status server.
+
+ It turns out that a = b = []; b.append(1); then a[0] will be 1!
+ This should have been obvious to me, I guess, but it was not what I was expecting.
+
+ * QueueStatusServer/model/activeworkitems.py:
+
+2010-09-27 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ commit-queue should reject patches that fail to land
+ https://bugs.webkit.org/show_bug.cgi?id=46694
+
+ This can happen, for example, if there's no reviewer. Without this
+ patch, we'll keep retrying the patch.
+
+ * Scripts/webkitpy/tool/bot/commitqueuetask.py:
+ * Scripts/webkitpy/tool/bot/commitqueuetask_unittest.py:
+
+2010-09-27 Simon Fraser <simon.fraser@apple.com>
+
+ Rubber-stamped by Adele Peterson.
+
+ Add a harness for running the CSS 2.1 test suite.
+
+ This harness assumes that you've got a local a copy of the suite
+ adjacent to the 'harness' directory.
+
+ The harness lets you go through the tests in chapter order,
+ denoting pass/fail/skipped for each test.
+
+ It uses a client-side database to store the results of testing.
+
+ * CSSTestSuiteHarness/harness/harness.css: Added.
+ * CSSTestSuiteHarness/harness/harness.html: Added.
+ * CSSTestSuiteHarness/harness/harness.js: Added.
+
+2010-09-27 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Patch locks should expire if a patch is marked for retry
+ https://bugs.webkit.org/show_bug.cgi?id=46682
+
+ This was part Adam's original CommitQueueTask design,
+ but support for it was missing from the server.
+ I added the support, but triggering lock-release based on this
+ special "retry" status feels a bit strange so I added a FIXME.
+
+ I also changed the text in queuestatus.html to say "Lock Acquired"
+ since "Last Activity" isn't really true. We only update the lock
+ date when the patch is started, not on every status update.
+
+ I also noticed an exception in next-patch, which I fixed by re-writing
+ the unzip logic in activeworkitems.py again.
+
+ * QueueStatusServer/handlers/updatestatus.py:
+ * QueueStatusServer/model/activeworkitems.py:
+ * QueueStatusServer/templates/queuestatus.html:
+
+2010-09-27 Tony Chang <tony@chromium.org>
+
+ Reviewed by David Levin.
+
+ [chromium] fix a warning when compiling DRT on 32-bit linux
+ https://bugs.webkit.org/show_bug.cgi?id=46641
+
+ * DumpRenderTree/chromium/TestEventPrinter.cpp:
+ (DRTPrinter::handleImage):
+
+2010-09-27 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ queue-status should report when the patch was last locked to a queue
+ https://bugs.webkit.org/show_bug.cgi?id=46674
+
+ This isn't necessarily the best way to expose this information
+ but having this accessible via the web interface is very
+ useful until we come up with a nicer way to display this.
+
+ I also cleaned up the code in activeworkitems.py a little
+ to use list comprehensions and to have the code work with
+ pairs instead of two lists at once. Eventually I think those
+ item/time pairs need to be their own little helper class.
+
+ * QueueStatusServer/handlers/queuestatus.py:
+ * QueueStatusServer/model/activeworkitems.py:
+ * QueueStatusServer/templates/queuestatus.html:
+
+2010-09-27 Tony Chang <tony@chromium.org>
+
+ Reviewed by David Levin.
+
+ [chromium] fix detection of missing fonts on DRT
+ https://bugs.webkit.org/show_bug.cgi?id=46651
+
+ * DumpRenderTree/chromium/TestShellGtk.cpp:
+ (setupFontconfig): Only print an error message if lohit isn't found in both locations.
+
+2010-09-27 Tony Chang <tony@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ add webkit unit tests to the chromium testers
+ https://bugs.webkit.org/show_bug.cgi?id=46669
+
+ * BuildSlaveSupport/build.webkit.org-config/master.cfg:
+ * Scripts/run-chromium-webkit-unit-tests: Fix a bug where we weren't using the right configuration.
+
+2010-09-27 Kwang Yul Seo <skyul@company100.net>
+
+ Unreviewed.
+
+ Adding myself to the committers list.
+
+ * Scripts/webkitpy/common/config/committers.py:
+
+2010-09-27 Mihai Parparita <mihaip@chromium.org>
+
+ Reviewed by Eric Seidel.
+
+ webkitpy.common.system.user_unittest.UserTest.test_prompt_with_list spams the console
+ https://bugs.webkit.org/show_bug.cgi?id=46634
+
+ Use OutputCapture to prevent console spam (and also check for expected
+ output).
+
+ * Scripts/webkitpy/common/system/user_unittest.py:
+
+2010-09-27 Eric Seidel <eric@webkit.org>
+
+ Reviewed by James Robinson.
+
+ start-commit-queue should abort any rebases in progress
+ https://bugs.webkit.org/show_bug.cgi?id=46640
+
+ webkit-patch commit-queue would do this itself, but this just
+ helps ensure that the commit-queue script is properly updated
+ before we run it (in the case where a previous rebase is in
+ progress the git svn rebase would not work before we run the
+ commit-queue).
+
+ * EWSTools/start-commit-queue.sh:
+
+2010-09-18 Martin Robinson <mrobinson@igalia.com>
+
+ Reviewed by Gustavo Noronha Silva.
+
+ [GTK] Clean up the DRT fonts.conf and switch to Liberation
+ https://bugs.webkit.org/show_bug.cgi?id=46038
+
+ Switch to Liberation fonts for GTK+ layout tests. This will make our
+ test results metric-compatible with many Windows/Chromium results. It
+ also simplifies the fonts.conf that we load and prepares the way for
+ fixing many font bugs.
+
+ * DumpRenderTree/gtk/DumpRenderTree.cpp:
+ (initializeFonts): Initialize a known list of fonts instead of loading
+ every font in the WEBKIT_TESTFONTS directory.
+ * DumpRenderTree/gtk/fonts.conf: Removed.
+ * DumpRenderTree/gtk/fonts/AHEM____.TTF: Copied from WebKitTools/DumpRenderTree/qt/fonts/AHEM____.TTF.
+ * DumpRenderTree/gtk/fonts/fonts.conf: Added.
+ * GNUmakefile.am: Modify FONTS_CONF_FILE to be FONTS_CONF_DIR, so that
+ we can load both fonts.conf and AHEM____.TTF from this location.
+ * Scripts/old-run-webkit-tests: Remove the check for WEBKIT_TESTFONTS, since
+ it is no longer used.
+
+2010-09-26 Mihai Parparita <mihaip@chromium.org>
+
+ Reviewed by Ojan Vafai.
+
+ new-run-webkit-httpd fails if Perl is not installed
+ https://bugs.webkit.org/show_bug.cgi?id=46602
+
+ Make Port._read_configuration catch all exceptions, since trying to run
+ perl (because of _webkit_build_directory) when it's not installed throws
+ a WindowsError or OSError, not an IOError (this became an issue after
+ r68268, since ChromiumPort ends up calling Port.default_configuration in
+ its constructor, which means that we're ending up on this codepath in
+ non-NRWT cases too, e.g. for the Chromium NaCl tests, which use
+ new-run-webkit-httpd).
+
+ * Scripts/webkitpy/layout_tests/port/base.py:
+ * Scripts/webkitpy/layout_tests/port/base_unittest.py:
+
+2010-09-26 Gyuyoung Kim <gyuyoung.kim@samsung.com>
+
+ Reviewed by Antonio Gomes.
+
+ [EFL] Add setting API to set a local storage database path.
+ https://bugs.webkit.org/show_bug.cgi?id=45446
+
+ Add a setting API to set local storage database path.
+
+ * EWebLauncher/main.c:
+ (on_key_down):
+ (browserCreate):
+ (main):
+
+2010-09-26 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Anders Carlsson.
+
+ Move shared WebKit2 API (used by both bundle and main API) to WebKit2/Shared/API
+ https://bugs.webkit.org/show_bug.cgi?id=46587
+
+ * WebKitTestRunner/InjectedBundle/InjectedBundle.h:
+
+2010-09-26 Antonio Gomes <agomes@rim.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ DRT/Mac nodesFromRect support
+
+ [Mac][DRT] Implement LayoutTestController::nodesFromRect
+ https://bugs.webkit.org/show_bug.cgi?id=46580
+
+ Implements LayoutTestController::nodesFromRect for Mac DRT, and
+ adding stubs for GTK+ and Windows.
+
+ * DumpRenderTree/LayoutTestController.cpp:
+ (nodesFromRectCallback):
+ (LayoutTestController::staticFunctions):
+ * DumpRenderTree/LayoutTestController.h:
+ (LayoutTestController::LayoutTestController::nodesFromRect):
+ * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+ (LayoutTestController::nodesFromRect):
+
+2010-09-25 Nicolas Weber <thakis@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ https://bugs.webkit.org/show_bug.cgi?id=46555
+ Fix typo in prepare-ChangeLog's help output.
+
+ * Scripts/prepare-ChangeLog:
+
+2010-09-24 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Darin Adler.
+
+ Implement WebKit2 callback equivalent to -[WebUIDelegate mouseDidMoveOverElement:modifierFlags:]
+ <rdar://problem/8359279>
+ https://bugs.webkit.org/show_bug.cgi?id=46546
+
+ * MiniBrowser/mac/BrowserWindowController.m:
+ (mouseDidMoveOverElement):
+ (-[BrowserWindowController awakeFromNib]):
+ * MiniBrowser/win/BrowserView.cpp:
+ (mouseDidMoveOverElement):
+ (BrowserView::create):
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
+ (WTR::InjectedBundlePage::InjectedBundlePage):
+ * WebKitTestRunner/TestController.cpp:
+ (WTR::createOtherPage):
+ (WTR::TestController::initialize):
+
+2010-09-24 Mihai Parparita <mihaip@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ Allow rebaselines for webkit-patch rebaseline to be chosen
+ https://bugs.webkit.org/show_bug.cgi?id=46407
+
+ Instead of always rebaselining all failing tests, allow a subset to be
+ chosen.
+
+ * Scripts/webkitpy/common/system/user.py:
+ * Scripts/webkitpy/tool/commands/rebaseline.py:
+
+2010-09-24 Ryosuke Niwa <rniwa@webkit.org>
+
+ Reviewed by Tony Chang.
+
+ [chromium] Implement TextInputController::firstRectForCharacterRange
+ https://bugs.webkit.org/show_bug.cgi?id=38100
+
+ Implemented TextInputController::firstRectForCharacterRange for chromium platform.
+ No new tests are added since we need to implement the same feature in chromium side
+ in order to enable any tests that uses this function.
+
+ * DumpRenderTree/chromium/TextInputController.cpp:
+ (TextInputController::firstRectForCharacterRange): Added.
+
+2010-09-24 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ commit-queue reports land failures as "PASS"
+ https://bugs.webkit.org/show_bug.cgi?id=46530
+
+ We were ignoring the return value of land instead of passing it back to
+ CommitQueue. Of course, this was the one case I forgot to test!
+
+ * Scripts/webkitpy/tool/bot/commitqueuetask.py:
+ * Scripts/webkitpy/tool/bot/commitqueuetask_unittest.py:
+
+2010-09-24 Kenichi Ishibashi <bashi@google.com>
+
+ Reviewed by Eric Seidel.
+
+ new-run-webkit-tests prints out nothing when build-dumprendertree fails
+ https://bugs.webkit.org/show_bug.cgi?id=37563
+
+ Print error message when build-dumprendertree fails.
+
+ * Scripts/webkitpy/layout_tests/port/webkit.py:
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+
+2010-09-24 Mihai Parparita <mihaip@chromium.org>
+
+ Reviewed by Tony Chang.
+
+ NRWT doesn't respect config set with set-webkit-configuration
+ https://bugs.webkit.org/show_bug.cgi?id=46278
+
+ Use Port.default_configuration() instead of hardcoding Release in
+ ChromiumPort configuration initialization, so that we still inherit the
+ configuration set by set-webkit-configuration.
+
+ * Scripts/webkitpy/layout_tests/port/chromium.py:
+ * Scripts/webkitpy/layout_tests/port/chromium_unittest.py:
+
+2010-09-24 Chang Shu <chang.shu@nokia.com>
+
+ Reviewed by Csaba Osztrogonác.
+
+ [Qt] Fix the code to check file existence.
+ https://bugs.webkit.org/show_bug.cgi?id=46465
+
+ * QtTestBrowser/main.cpp:
+ (main):
+
+2010-09-23 Tony Chang <tony@chromium.org>
+
+ Unreviewed, rolling out r68232.
+ http://trac.webkit.org/changeset/68232
+
+ Broken NRWT on the canary bots.
+
+ * Scripts/webkitpy/layout_tests/port/chromium.py:
+
+2010-09-23 Dirk Pranke <dpranke@chromium.org>
+
+ Unreviewed, build fix.
+
+ r68008 broke new-run-webkit-tests in that the chromium ports no
+ longer respect set-webkit-configuration. The correct fix for this
+ is being pursued in bug 46278 (along with a bunch of unit tests),
+ but in the meantime I'm reverting the particular lines that broke
+ things. This was tested by hand.
+
+ * Scripts/webkitpy/layout_tests/port/chromium.py:
+
+2010-09-23 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Anders Carlsson.
+
+ WebKit2 API: Need way to know when a frame is removed from the hierarchy
+ <rdar://problem/8414062>
+ https://bugs.webkit.org/show_bug.cgi?id=46432
+
+ * MiniBrowser/mac/BrowserWindowController.m:
+ (didRemoveFrameFromHierarchy):
+ (-[BrowserWindowController awakeFromNib]):
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
+ (WTR::InjectedBundlePage::InjectedBundlePage):
+ * WebKitTestRunner/TestController.cpp:
+ (WTR::TestController::initialize):
+
+2010-09-23 Tony Chang <tony@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ [chromium] implement layoutTestController.sampleSVGAnimationForElementAtTime
+ https://bugs.webkit.org/show_bug.cgi?id=46426
+
+ * DumpRenderTree/chromium/LayoutTestController.cpp:
+ (LayoutTestController::LayoutTestController):
+ (LayoutTestController::sampleSVGAnimationForElementAtTime):
+ * DumpRenderTree/chromium/LayoutTestController.h:
+
+2010-09-23 Martin Robinson <mrobinson@igalia.com>
+
+ Reviewed by Nate Chapin.
+
+ [GTK] r68199 introduced two test failures
+ https://bugs.webkit.org/show_bug.cgi?id=46424
+
+ Fix a regression handling preference overrides that are attached to boolean properties.
+
+ * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+ (LayoutTestController::overridePreference): g_strcasecmp returns 0 when strings match
+ so we must check for that when converting a string to a boolean.
+
+2010-09-23 Dimitri Glazkov <dglazkov@chromium.org>
+
+ Reviewed by David Levin.
+
+ Fix a condition check in ServerProcess, which becomes relevant when reading binary data.
+ https://bugs.webkit.org/show_bug.cgi?id=46406
+
+ This breaks when the method is called with specified size of data (image data), and the
+ buffer hasn't yet reached this size.
+
+ * Scripts/webkitpy/layout_tests/port/server_process.py: Changed to check for values of
+ index larger than 0.
+
+2010-09-23 Martin Robinson <mrobinson@igalia.com>
+
+ Reviewed by Nate Chapin.
+
+ [GTK] Some tests from r68174 fail on the GTK+ bots
+ https://bugs.webkit.org/show_bug.cgi?id=46396
+
+ Simplify LayoutTestController::overridePreference to make it easier for
+ people unfamiliar with the code to keep the list of preferences up to date.
+ Add the conversion for enable-hyperlink-auditing.
+
+ * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+ (LayoutTestController::overridePreference): Use a simple if-else block to determine
+ out the property name for overrridePreference. Also simplify the logic for setting
+ string properties. Add the conversion for enable-hyperlink-auditing.
+
+2010-09-23 Tony Chang <tony@chromium.org>
+
+ Reviewed by David Levin.
+
+ [chromium] add caretBrowsingEnabled to WebSettings and DRT
+ https://bugs.webkit.org/show_bug.cgi?id=46388
+
+ * DumpRenderTree/chromium/LayoutTestController.cpp:
+ (LayoutTestController::overridePreference):
+ * DumpRenderTree/chromium/WebPreferences.cpp:
+ (WebPreferences::reset):
+ (WebPreferences::applyTo):
+ * DumpRenderTree/chromium/WebPreferences.h:
+
+2010-09-23 Nate Chapin <japhet@chromium.org>
+
+ Reviewed by Darin Fisher.
+
+ Allow DRT to toggle hyperlink auditing (i.e., <a ping>).
+ https://bugs.webkit.org/show_bug.cgi?id=30458
+
+ * DumpRenderTree/chromium/LayoutTestController.cpp:
+ (LayoutTestController::overridePreference):
+ * DumpRenderTree/chromium/WebPreferences.cpp:
+ (WebPreferences::reset):
+ (WebPreferences::applyTo):
+ * DumpRenderTree/chromium/WebPreferences.h:
+ * DumpRenderTree/gtk/DumpRenderTree.cpp:
+ (resetDefaultsToConsistentValues):
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::overridePreference):
+
+2010-09-21 Stephen White <senorblanco@chromium.org>
+
+ Reviewed by David Levin.
+
+ Implement --enable-accelerated-2d-canvas flag in DumpRenderTree.
+ https://bugs.webkit.org/show_bug.cgi?id=46208
+
+ This flag allows the layout tests to be run with or without accelerated
+ 2D canvas rendering.
+
+ * DumpRenderTree/chromium/DumpRenderTree.cpp:
+ (main):
+ Declare the new flag string, and check for it on startup.
+ * DumpRenderTree/chromium/TestShell.cpp:
+ (TestShell::TestShell):
+ Add a boolean for the new flag, in order to preserve its value over
+ preferences reset.
+ (TestShell::resetWebSettings):
+ Set the new flag to the stored value on reset.
+ * DumpRenderTree/chromium/TestShell.h:
+ (TestShell::setAccelerated2dCanvasEnabled):
+ Add an accessor for the new flag.
+ * DumpRenderTree/chromium/WebPreferences.cpp:
+ (WebPreferences::reset):
+ Initialize the new flag to false.
+ (WebPreferences::applyTo):
+ Copy the flag's value to the WebSettings.
+ * DumpRenderTree/chromium/WebPreferences.h:
+ Add the new flag.
+
+2010-09-23 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Refactor QtWebKitPlatformPlugin interface
+
+ Make it easier to keep source-compability for the
+ QtWebKitPlatformPlugin interface, and run qmake
+ on the example (but not build) for convenience.
+
+ https://bugs.webkit.org/show_bug.cgi?id=46345
+
+ * Scripts/webkitdirs.pm:
+
+2010-09-23 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Tweak some status messages that Eric thought were confusing
+ https://bugs.webkit.org/show_bug.cgi?id=46342
+
+ * Scripts/webkitpy/tool/commands/queues.py:
+ * Scripts/webkitpy/tool/commands/queues_unittest.py:
+
+2010-09-22 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Fix comm-queue typo
+ https://bugs.webkit.org/show_bug.cgi?id=46339
+
+ We were missing a "self". The real problem is that we didn't have an
+ integration test for the failure case.
+
+ * Scripts/webkitpy/tool/commands/queues.py:
+ * Scripts/webkitpy/tool/commands/queues_unittest.py:
+
+2010-09-22 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ commit-queue should log more detailed messages to the QueueStatusServer
+ https://bugs.webkit.org/show_bug.cgi?id=46333
+
+ When I created CommitQueueTask, I removed most of the previous logging.
+ This patch adds back more detailed logging so folks can see their patch
+ progress through the queue.
+
+ * Scripts/webkitpy/tool/bot/commitqueuetask.py:
+ * Scripts/webkitpy/tool/bot/commitqueuetask_unittest.py:
+ * Scripts/webkitpy/tool/commands/queues.py:
+ * Scripts/webkitpy/tool/commands/queues_unittest.py:
+
+2010-09-22 Mihai Parparita <mihaip@chromium.org>
+
+ Reviewed by Darin Fisher.
+
+ [Chromium] User style layout tests don't pass on Chromium
+ https://bugs.webkit.org/show_bug.cgi?id=46069
+
+ Fix a typo in LayoutTestController::addUserStyleSheet that was causing a
+ crash the Chromium DRT. Pass InjectInExistingDocuments to mimic DRT
+ behavior from other ports.
+
+ * DumpRenderTree/chromium/LayoutTestController.cpp:
+ (LayoutTestController::addUserStyleSheet):
+
+2010-09-22 Brent Fulgham <bfulgham@webkit.org>
+
+ Reviewed by Martin Robinson.
+
+ [WinCairo] Part 2: Update WebKitTestRunner and DumpRenderTree Build.
+ https://bugs.webkit.org/show_bug.cgi?id=46303.
+
+ * MiniBrowser/Configurations/MiniBrowserCFLite.vsprops: Added.
+ * MiniBrowser/Configurations/MiniBrowserCommon.vsprops: Moved
+ CoreFoundation-specific stuff to new MiniBrowserCoreFoundation
+ property sheet.
+ * MiniBrowser/Configurations/MiniBrowserCoreFoundation.vsprops: Added.
+ * MiniBrowser/MiniBrowser.vcproj: Updated configuration to use
+ appropriate property sheet for the build types.
+ * WebKitTestRunner/win/WebKitTestRunner.vcproj: Updated the
+ configuration to use appropriate property sheet for CoreFoundation
+ and CFLite-style builds.
+
+2010-09-22 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Optimize commit-queue performance for green trees
+ https://bugs.webkit.org/show_bug.cgi?id=46254
+
+ This patch redesigns the controller logic for the commit-queue. In the
+ new design, the controller exercises much finer-grained control over
+ the landing process. In particular:
+
+ - Patches that fail to apply now get rejected almost immediately.
+ - Patches that fail to build get rejects after two builds (instead of
+ three builds and one test run).
+ - Patches that run into a flaky test now get accepted after one build
+ and two test runs instead of three full build-and-test runs.
+
+ The main cost of these optimizations is that we don't find out the tree
+ has a failing test until the very end of the process, but if the tree
+ has a busted test, there's not much we can do anyway. We might as well
+ burn commit-queue resources spinning optimisticly.
+
+ * Scripts/webkitpy/tool/bot/commitqueuetask.py: Added.
+ * Scripts/webkitpy/tool/bot/commitqueuetask_unittest.py: Added.
+ * Scripts/webkitpy/tool/commands/queues.py:
+
+2010-09-22 Brent Fulgham <bfulgham@webkit.org>
+
+ Reviewed by Martin Robinson.
+
+ [WinCairo] Update WebKitTestRunner and DumpRenderTree Build.
+ https://bugs.webkit.org/show_bug.cgi?id=46303.
+
+ * DumpRenderTree/win/DumpRenderTree.vcproj: Disable local MD5 sources
+ for Cairo build. Copy wtf MD5 header to ForwardingHeaders for the
+ WinCairo build.
+ * WebKitTestRunner/Configurations/InjectedBundleCFLite.vsprops: Added.
+ * WebKitTestRunner/win/InjectedBundle.vcproj: Update win new *_Cairo
+ build targets that use the new InjectedBundleCFLite.vsprops file.
+
+2010-09-22 Dirk Pranke <dpranke@chromium.org>
+
+ Unreviewed, build fix.
+
+ Fix bustage of rebaseline-chromium-webkit-tests resulting from
+ r67974. Really need better unit tests for this tool :(
+
+ * Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests.py:
+
+2010-09-22 Adam Roben <aroben@apple.com>
+
+ Unbreak test-webkitpy
+
+ * Scripts/webkitpy/test/main.py:
+ (Tester.run_tests): Add a line that mysteriously got deleted.
+
+2010-09-22 Adam Roben <aroben@apple.com>
+
+ Make test-webkitpy test WebKit2's scripts
+
+ These scripts can't be in WebKitTools due to limitations of Apple's
+ build process. But that doesn't mean we can't test them!
+
+ Fixes <http://webkit.org/b/46297> test-webkitpy should test code in
+ WebKit2/Scripts
+
+ Reviewed by Adam Barth.
+
+ * Scripts/test-webkitpy:
+ (_clean_packages_with_test): Renamed from _clean_webkitpy_with_test.
+ Now takes an external_package_paths parameter and cleans both webkitpy
+ and any external packages.
+ (init): Added an external_package_paths parameter which we pass along
+ to _clean_packages_with_test.
+ (top level): Add WebKit2/Scripts/webkit2 as our only external package
+ and pass it along to init and Tester.run_tests.
+
+ * Scripts/webkitpy/test/main.py:
+ (Tester.run_tests): Added an optional external_package_paths
+ parameter. We modify sys.path so that the external packages can be
+ imported, and search for unittest files inside all external packages
+ in addition to inside webkitpy.
+
+2010-09-22 Dirk Pranke <dpranke@chromium.org>
+
+ Reviewed by Tony Chang.
+
+ new-run-webkit-tests: r68063 broke linux python tests
+
+ Add a missing "from __future__ import with_statement" to this
+ new file; the perils of testing only on the Mac and by review :(
+
+ https://bugs.webkit.org/show_bug.cgi?id=46293
+
+ * Scripts/webkitpy/layout_tests/port/chromium_gpu.py:
+
+2010-09-22 Dirk Pranke <dpranke@chromium.org>
+
+ Reviewed by Tony Chang.
+
+ Add a 'chromium-gpu' set of ports that will test the accelerated
+ GPU paths. This patch adds:
+
+ - support for the '--accelerated-compositing' and
+ 'accelerated-2d-canvas' flags to new-run-webkit-tests (and the
+ 'no-' flags)
+ - adds a new set of Ports that will look under
+ platform/chromium-gpu-$OS/ for baselines before looking in the
+ regular chromium search path
+ - adds a new test_expectations.txt file in platform/chromium-gpu
+ that skips all but the tests we actually want to run with
+ acceleration.
+
+ This patch will allow us to run both with and without acceleration
+ and to change the defaults for both the regular and -gpu options
+ as the code evolves.
+
+ We plan to add both --chromium-$OS and --chromium-gpu-$OS runs to
+ each test bot.
+
+ https://bugs.webkit.org/show_bug.cgi?id=46225
+
+ * Scripts/webkitpy/layout_tests/port/chromium.py:
+ * Scripts/webkitpy/layout_tests/port/chromium_gpu.py:
+ * Scripts/webkitpy/layout_tests/port/factory.py:
+ * Scripts/webkitpy/layout_tests/port/webkit.py:
+
+2010-09-22 Jamey Hicks <jamey.hicks@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Web Inspector: Remote Web Inspector support for QtWebKit
+ https://bugs.webkit.org/show_bug.cgi?id=43988
+
+ Runs a web debug server on port specified by QtTestBrowser
+ argument -remote-inspector-port. Property
+ _q_webInspectorServerPort of the QWebPage instance will be set
+ according to the argument. All pages with that property set will
+ be remotely inspectable.
+
+ URL for remote inspection of first QWebPage is
+ http://localhost:9222/webkit/inspector/inspector.html?page=1
+ where 1 is the number of the QWebPage instance.
+
+ The base URL yields an index page with links to the individual inspectors:
+ http://localhost:9222/
+
+ * QtTestBrowser/launcherwindow.cpp:
+ (LauncherWindow::init):
+ * QtTestBrowser/launcherwindow.h:
+ * QtTestBrowser/main.cpp:
+ (LauncherApplication::handleUserOptions):
+
+2010-09-22 Adam Roben <aroben@apple.com>
+
+ Fix webkit-patch failure-reason now that build.webkit.org has been
+ updated
+
+ Fixes <http://webkit.org/b/46273> webkit-patch failure-reason crashes
+ every time
+
+ Reviewed by Eric Seidel.
+
+ * Scripts/webkitpy/common/net/buildbot.py:
+ (BuildBot._file_cell_text): Added. Travels down the firstChild chain
+ looking for an element that contains text, then returns it.
+ (BuildBot._parse_twisted_file_row): Use _file_cell_text to get the
+ text out of the cells. This way it doesn't matter whether the cells
+ have <b> children (as for cells in directory rows) or not (as for
+ cells in file rows)
+ (BuildBot._parse_twisted_directory_listing): Look for rows that have
+ the "directory" or "file" class, rather than rows with any class,
+ since header rows now have a class attribute.
+
+ * Scripts/webkitpy/common/net/buildbot_unittest.py:
+ (BuildBotTest._example_directory_listing): Updated to more closely
+ match the markup that build.webkit.org is producing now.
+
+2010-09-21 Dirk Pranke <dpranke@chromium.org>
+
+ Unreviewed, build fix.
+
+ new-run-webkit-tests: fix bug introduced in r68008 where if you
+ specify --chromium and no --platform, and you're running on
+ windows, you use the 'chromium-win' port by default instead of the
+ version-specific port. This breaks the buildbots.
+
+ It will be good for this refactoring to settle down so I can
+ rewrite the logic for default ports and the unit tests to be
+ clearer (and the testing more comprehensive).
+
+ * Scripts/webkitpy/layout_tests/port/chromium_win.py:
+
+2010-09-21 Dirk Pranke <dpranke@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ Modify the Port interface to take only a series of keyword arguments
+ in the constructor, and modify Port/factory.get() to accomodate that,
+ and to accept user=XXX as an argument so we can pass
+ webkitpy.common.system.user.User objects in.
+
+ Then, modify new-run-webkit-tests and rebaseline-chromium-webkit-tests
+ to use the common routine in webkitpy.common.system.user.open_url()
+ to display HTML files.
+
+ There was a routine in the Port interface to do the same thing,
+ but I see no need for a port-specific hook for this, since it is
+ something that will always be executed by the host environment
+ and displaying web pages has nothing to do with running layout tests.
+
+ Note that new-run-webkit-tests used to use test_shell to display
+ the page; this is potentially useful so that you can actually click
+ from a result to the broken page; however, since DumpRenderTree
+ doesn't support this functionality, it will be going away eventually.
+
+ https://bugs.webkit.org/show_bug.cgi?id=46128
+
+ * Scripts/webkitpy/layout_tests/port/base.py:
+ * Scripts/webkitpy/layout_tests/port/base_unittest.py:
+ * Scripts/webkitpy/layout_tests/port/chromium.py:
+ * Scripts/webkitpy/layout_tests/port/chromium_linux.py:
+ * Scripts/webkitpy/layout_tests/port/chromium_mac.py:
+ * Scripts/webkitpy/layout_tests/port/chromium_unittest.py:
+ * Scripts/webkitpy/layout_tests/port/chromium_win.py:
+ * Scripts/webkitpy/layout_tests/port/dryrun.py:
+ * Scripts/webkitpy/layout_tests/port/factory.py:
+ * Scripts/webkitpy/layout_tests/port/google_chrome.py:
+ * Scripts/webkitpy/layout_tests/port/google_chrome_unittest.py:
+ * Scripts/webkitpy/layout_tests/port/gtk.py:
+ * Scripts/webkitpy/layout_tests/port/mac.py:
+ * Scripts/webkitpy/layout_tests/port/qt.py:
+ * Scripts/webkitpy/layout_tests/port/test.py:
+ * Scripts/webkitpy/layout_tests/port/webkit.py:
+ * Scripts/webkitpy/layout_tests/port/win.py:
+ * Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests.py:
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+ * Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py:
+
+2010-09-21 Lucas De Marchi <lucas.demarchi@profusion.mobi>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [EFL] Get fresh theme when running EWebLauncher
+ https://bugs.webkit.org/show_bug.cgi?id=46210
+
+ If user tried to run EWebLauncher outside of the build tree, it would
+ not find the theme and fallback to the installed one. However, since
+ EWebLauncher is not installed, we always want to take the theme from
+ the just compiled source code. If user had never installed WebKit's
+ EFL port it could even receive a segv since no theme would be found.
+
+ Now EWebLauncher does not fallback to the installed theme and CMake
+ gives as DATA_DIR the directory of the theme it has just built.
+
+ * CMakeListsEfl.txt: Pass the build directory as DATA_DIR to
+ EWebLauncher.
+ * EWebLauncher/main.c: Use only the theme from build director. Do not
+ fallback to others as this could hide real bugs.
+ (quit):
+ (browserCreate):
+ (findThemePath):
+ (main):
+
+2010-09-21 Dirk Pranke <dpranke@chromium.org>
+
+ Unreviewed, build fix.
+
+ Don't pass the --test-shell arg to the Chromium Mac port of DRT;
+ it just confuses it.
+
+ https://bugs.webkit.org/show_bug.cgi?id=46230
+
+ * Scripts/webkitpy/layout_tests/port/webkit.py:
+
+2010-09-21 Lucas Forschler <lforschler@apple.com>
+
+ Reviewed by Stephanie Lewis.
+
+ Make a new buildbot for Leopard Debug Test
+
+ * BuildSlaveSupport/build.webkit.org-config/config.json:
+
+2010-09-21 Dirk Pranke <dpranke@chromium.org>
+
+ Unreviewed, build fix.
+
+ Fix breakage of Chromium Mac DRT port caused by r67905.
+
+ https://bugs.webkit.org/show_bug.cgi?id=46230
+
+ * Scripts/webkitpy/layout_tests/port/webkit.py:
+
+2010-09-21 Dirk Pranke <dpranke@chromium.org>
+
+ Unreviewed, build fix.
+
+ Add missing import of 'tempfile'.
+
+ * Scripts/webkitpy/layout_tests/port/chromium.py:
+
+2010-09-17 Dirk Pranke <dpranke@chromium.org>
+
+ Reviewed by Ojan Vafai.
+
+ new-run-webkit-tests: pull the list of tests from the Port, and
+ make it possible to run with no actual test files in the filesystem.
+
+ This set of changes allows us to delete the special
+ webkitpy/layout_tests/data directory and test the generic code without
+ touching the filesystem (except to write results). This speeds up
+ test-webkitpy substantially.
+
+ This also cleans up and removes several code paths in the generic
+ code and fixes some minor bugs, notably in the test_expectations
+ parsing, which was previously fragile if the tests weren't present.
+
+ We also change the way we diff image results to be able to do so
+ in memory, without relying on files. This slows down chromium
+ test_shell, which always writes images to files, but should speed
+ up DRT and ImageDiff-based implementations slightly.
+
+ Note that pulling the list of tests to run from the Port will allow
+ ports to specify what tests to run as an inclusive list; previously
+ you could only do this as an exclusive list by using a
+ test_expectations file or Skipped files; nothing actually uses this
+ feature yet and it's unclear if it should be used.
+
+ Note that there are no functional changes -- apart from now
+ always printing out the location of the checksum file when we are
+ tracing test runs -- and the total number of lines of non-test code
+ actually drops by two.
+
+ There is some more cleanup that can be done in the Port/Driver
+ interface and in some handling of filenames, but I'll save that
+ for another change.
+
+ https://bugs.webkit.org/show_bug.cgi?id=45801
+
+ * Scripts/webkitpy/layout_tests/data/*: Removed.
+ - no longer need special mock layout_tests_directory in the
+ repository.
+ * Scripts/webkitpy/layout_tests/layout_package/printing.py:
+ - add code to display missing text files, checksums when tracing
+ - update to not look at the filesystem directly.
+ * Scripts/webkitpy/layout_tests/layout_package/printing_unittest.py:
+ - add more unit tests
+ * Scripts/webkitpy/layout_tests/layout_package/test_expectations.py:
+ - remove tests_are_present flag
+ - update with changes in Port interface - no longer access
+ the filesystem directly, although we still use os.path for
+ filename manipulation.
+ * Scripts/webkitpy/layout_tests/layout_package/test_expectations_unittest.py:
+ - add more unit tests
+ * Scripts/webkitpy/layout_tests/layout_package/test_files.py: Removed.
+ - renamed to port/test_files.py
+ * Scripts/webkitpy/layout_tests/port/base.py:
+ - change diff_image() to expect actual image data, not filenames
+ - add expected_checksum(), expected_image(), expected_text() to
+ return the content of the files so that we don't need a filesystem
+ - add path_exists(), path_isdir() for filesystem-like access.
+ - add test_dirs() to keep clobber-test-results from needing to
+ actually look at a real layout tests dir
+ - add tests() to return the list of tests to run on the port
+ (calls port/test_files to do the work).
+ - add update_baseline() to be able to save new baselines
+ - add uri_to_test_name() from port/dryrun.py so we can easily check
+ filename_to_uri()
+ * Scripts/webkitpy/layout_tests/port/base_unittest.py:
+ - add more unit tests
+ * Scripts/webkitpy/layout_tests/port/chromium.py:
+ - change diff_image() to accept image content, not filenames.
+ This will be slower for test_shell/image_diff, but faster
+ for DRT/ImageDiff.
+ * Scripts/webkitpy/layout_tests/port/chromium_unittest.py:
+ - add more unit tests
+ * Scripts/webkitpy/layout_tests/port/dryrun.py:
+ - simplify greatly
+ * Scripts/webkitpy/layout_tests/port/port_testcase.py:
+ - add more unit tests
+ * Scripts/webkitpy/layout_tests/port/test.py:
+ - massive rewrite to use in-script list of tests and expectations
+ * Scripts/webkitpy/layout_tests/port/test_files.py:
+ - rename from layout_package/test_files.
+ * Scripts/webkitpy/layout_tests/port/test_files_unittest.py:
+ - add unit tests
+ * Scripts/webkitpy/layout_tests/port/webkit.py:
+ - update diff_image() to take image contents, not files. Should
+ make things slightly faster.
+ * Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests.py:
+ - update with changes to diff_image()
+ * Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests_unittest.py:
+ - update with changes to diff_image()
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+ - remove tests_are_present from test_expectations
+ - pull the list of tests from port.tests() instead
+ of calling test_files.py directly.
+ * Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py:
+ - update unit tests
+ * Scripts/webkitpy/layout_tests/test_types/image_diff.py:
+ - update with changes to
+ * Scripts/webkitpy/layout_tests/test_types/test_type_base.py:
+ - update with change in Port interface
+ * Scripts/webkitpy/layout_tests/test_types/text_diff.py:
+ - update with change in Port interface
+ * Scripts/webkitpy/style/checkers/test_expectations.py:
+ - remove the tests_are_present flag
+
+2010-09-21 Anders Carlsson <andersca@apple.com>
+
+ Disable logging.
+
+ * MiniBrowser/mac/MiniBrowser_Prefix.pch:
+
+2010-09-21 Tony Chang <tony@chromium.org>
+
+ Reviewed by Kent Tamura.
+
+ add a script for running webkit_unit_tests
+ https://bugs.webkit.org/show_bug.cgi?id=46014
+
+ * Scripts/run-chromium-webkit-unit-tests: Added.
+
+2010-09-21 Fridrich Strba <fridrich.strba@bluewin.ch>
+
+ Reviewed by Martin Robinson.
+
+ Fix linking problems on Windows.
+ https://bugs.webkit.org/show_bug.cgi?id=45844
+
+ * GNUmakefile.am: link the executables with winmm.dll
+
+2010-09-21 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ feeder-queue svn updates more often than needed
+ https://bugs.webkit.org/show_bug.cgi?id=46171
+
+ We don't need to poll SVN every time we feed the feeders. Rather, we
+ can count on the wrapper shell script to auto-update the queue.
+
+ * Scripts/webkitpy/tool/commands/queues.py:
+ * Scripts/webkitpy/tool/commands/queues_unittest.py:
+
+2010-09-21 Jocelyn Turcotte <jocelyn.turcotte@nokia.com>
+
+ Reviewed by Andreas Kling.
+
+ [Qt] Add robot loader timeout and extra time options.
+ https://bugs.webkit.org/show_bug.cgi?id=46172
+
+ [-robot-timeout <s>]: Load the next page after s seconds if the current
+ page didn't finish loading.
+ [-robot-extra-time <s>]: Wait s seconds after the current page finished
+ loading before loading the next one. This should allow some time for the
+ page's JavaScript to execute.
+
+ * QtTestBrowser/launcherwindow.cpp:
+ (LauncherWindow::applyPrefs):
+ * QtTestBrowser/main.cpp:
+ (LauncherApplication::robotTimeout):
+ (LauncherApplication::robotExtraTime):
+ (LauncherApplication::LauncherApplication):
+ (LauncherApplication::handleUserOptions):
+ (main):
+ * QtTestBrowser/urlloader.cpp:
+ (UrlLoader::UrlLoader):
+ (UrlLoader::loadNext):
+ (UrlLoader::loadUrlList):
+ * QtTestBrowser/urlloader.h:
+
+2010-09-21 Pavel Podivilov <podivilov@chromium.org>
+
+ Unreviewed.
+
+ Adding myself to the committers list.
+
+ * Scripts/webkitpy/common/config/committers.py:
+
+2010-09-20 Philippe Normand <pnormand@igalia.com>
+
+ Reviewed by Eric Carlson.
+
+ [GTK] enhanced context menu for media elements
+ https://bugs.webkit.org/show_bug.cgi?id=45021
+
+ EventSender::contextClick() now returns an array of js
+ objects. Each object has a title property and a click() method.
+
+ * DumpRenderTree/gtk/EventSender.cpp:
+ (getMenuItemTitleCallback):
+ (setMenuItemTitleCallback):
+ (menuItemClickCallback):
+ (getMenuItemClass):
+ (contextClickCallback):
+
+2010-09-20 Hayato Ito <hayato@chromium.org>
+
+ Unreviewed.
+ Adding myself to the committers list.
+
+ * Scripts/webkitpy/common/config/committers.py:
+
+2010-09-20 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ The tool member variable should be called _tool
+ https://bugs.webkit.org/show_bug.cgi?id=46160
+
+ Created by find-and-replace.
+
+ * Scripts/webkitpy/tool/commands/download.py:
+ * Scripts/webkitpy/tool/commands/openbugs.py:
+ * Scripts/webkitpy/tool/commands/queries.py:
+ * Scripts/webkitpy/tool/commands/queues.py:
+ * Scripts/webkitpy/tool/commands/queues_unittest.py:
+ * Scripts/webkitpy/tool/commands/rebaseline.py:
+ * Scripts/webkitpy/tool/commands/sheriffbot.py:
+ * Scripts/webkitpy/tool/commands/upload.py:
+ * Scripts/webkitpy/tool/multicommandtool.py:
+
+2010-09-20 Adam Barth <abarth@webkit.org>
+
+ I ran the tests before landing but ignored the fact that they failed. :(
+
+ * Scripts/webkitpy/tool/commands/queues.py:
+
+2010-09-20 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Add a feeder queue that polls bugs.webkit.org for the commit-cluster
+ https://bugs.webkit.org/show_bug.cgi?id=46141
+
+ The feeder-queue polls bugs.webkit.org every 30 seconds and updates the
+ list of work items on the status server. The individual commit-cluster
+ nodes then grab the patches from the server and process them.
+
+ * Scripts/webkitpy/tool/bot/feeders.py: Added.
+ * Scripts/webkitpy/tool/bot/feeders_unittest.py: Added.
+ * Scripts/webkitpy/tool/commands/queues.py:
+ * Scripts/webkitpy/tool/commands/queues_unittest.py:
+ * Scripts/webkitpy/tool/commands/queuestest.py:
+
+2010-09-20 Leandro Pereira <leandro@profusion.mobi>
+
+ Reviewed by Darin Adler.
+
+ build-webkit: Add support for CMake build system
+ https://bugs.webkit.org/show_bug.cgi?id=44979
+
+ * Scripts/build-webkit: Add "--efl" command-line option to build the
+ EFL port of WebKit.
+ * Scripts/webkitdirs.pm: Define buildCMakeProject() and
+ buildEflCMakeProject() subroutines.
+
2010-09-20 Dirk Pranke <dpranke@chromium.org>
Reviewed by Ojan Vafai.
diff --git a/WebKitTools/DumpRenderTree/LayoutTestController.cpp b/WebKitTools/DumpRenderTree/LayoutTestController.cpp
index 1643ba6..ee44325 100644
--- a/WebKitTools/DumpRenderTree/LayoutTestController.cpp
+++ b/WebKitTools/DumpRenderTree/LayoutTestController.cpp
@@ -513,6 +513,24 @@ static JSValueRef computedStyleIncludingVisitedInfoCallback(JSContextRef context
return controller->computedStyleIncludingVisitedInfo(context, arguments[0]);
}
+static JSValueRef nodesFromRectCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+ if (argumentCount != 8)
+ return JSValueMakeUndefined(context);
+
+ int x = JSValueToNumber(context, arguments[1], NULL);
+ int y = JSValueToNumber(context, arguments[2], NULL);
+ int top = static_cast<unsigned>(JSValueToNumber(context, arguments[3], NULL));
+ int right = static_cast<unsigned>(JSValueToNumber(context, arguments[4], NULL));
+ int bottom = static_cast<unsigned>(JSValueToNumber(context, arguments[5], NULL));
+ int left = static_cast<unsigned>(JSValueToNumber(context, arguments[6], NULL));
+ bool ignoreClipping = JSValueToBoolean(context, arguments[7]);
+
+ // Has mac implementation.
+ LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ return controller->nodesFromRect(context, arguments[0], x, y, top, right, bottom, left, ignoreClipping);
+}
+
static JSValueRef layerTreeAsTextCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
// Has mac & windows implementation
@@ -1843,6 +1861,7 @@ JSStaticFunction* LayoutTestController::staticFunctions()
{ "clearPersistentUserStyleSheet", clearPersistentUserStyleSheetCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "closeWebInspector", closeWebInspectorCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "computedStyleIncludingVisitedInfo", computedStyleIncludingVisitedInfoCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+ { "nodesFromRect", nodesFromRectCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "decodeHostName", decodeHostNameCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "disableImageLoading", disableImageLoadingCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "dispatchPendingLoadRequests", dispatchPendingLoadRequestsCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
diff --git a/WebKitTools/DumpRenderTree/LayoutTestController.h b/WebKitTools/DumpRenderTree/LayoutTestController.h
index 2bf7a75..755a2b2 100644
--- a/WebKitTools/DumpRenderTree/LayoutTestController.h
+++ b/WebKitTools/DumpRenderTree/LayoutTestController.h
@@ -60,6 +60,7 @@ public:
bool isCommandEnabled(JSStringRef name);
void keepWebHistory();
JSValueRef computedStyleIncludingVisitedInfo(JSContextRef, JSValueRef);
+ JSValueRef nodesFromRect(JSContextRef, JSValueRef, int x, int y, unsigned top, unsigned right, unsigned bottom, unsigned left, bool ignoreClipping);
void notifyDone();
int numberOfPages(float pageWidthInPixels, float pageHeightInPixels);
void overridePreference(JSStringRef key, JSStringRef value);
diff --git a/WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginObject.cpp b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginObject.cpp
index 5002400..1df1c76 100644
--- a/WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginObject.cpp
+++ b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginObject.cpp
@@ -971,15 +971,18 @@ static NPObject *pluginAllocate(NPP npp, NPClass *theClass)
newInstance->returnNegativeOneFromWrite = FALSE;
newInstance->stream = 0;
- newInstance->firstUrl = NULL;
- newInstance->firstHeaders = NULL;
- newInstance->lastUrl = NULL;
- newInstance->lastHeaders = NULL;
+ newInstance->firstUrl = 0;
+ newInstance->firstHeaders = 0;
+ newInstance->lastUrl = 0;
+ newInstance->lastHeaders = 0;
newInstance->testGetURLOnDestroy = FALSE;
newInstance->testWindowOpen = FALSE;
newInstance->testKeyboardFocusForPlugins = FALSE;
+ newInstance->mouseDownForEvaluateScript = FALSE;
+ newInstance->evaluateScriptOnMouseDownOrKeyDown = 0;
+
return (NPObject*)newInstance;
}
diff --git a/WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginObject.h b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginObject.h
index 2c1d325..6c30578 100644
--- a/WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginObject.h
+++ b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginObject.h
@@ -57,6 +57,7 @@ typedef struct {
NPBool testGetURLOnDestroy;
NPBool testWindowOpen;
NPBool testKeyboardFocusForPlugins;
+ NPBool mouseDownForEvaluateScript;
char* onStreamLoad;
char* onStreamDestroy;
char* onDestroy;
@@ -66,6 +67,7 @@ typedef struct {
char* firstHeaders;
char* lastUrl;
char* lastHeaders;
+ char* evaluateScriptOnMouseDownOrKeyDown;
#ifdef XP_MACOSX
NPEventModel eventModel;
#endif
diff --git a/WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginTest.cpp b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginTest.cpp
index 0ff7029..83eda3a 100644
--- a/WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginTest.cpp
+++ b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginTest.cpp
@@ -60,6 +60,11 @@ NPError PluginTest::NPP_GetValue(NPPVariable variable, void *value)
return NPERR_GENERIC_ERROR;
}
+NPError PluginTest::NPP_SetWindow(NPP, NPWindow*)
+{
+ return NPERR_NO_ERROR;
+}
+
NPIdentifier PluginTest::NPN_GetStringIdentifier(const NPUTF8 *name)
{
return browser->getstringidentifier(name);
diff --git a/WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginTest.h b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginTest.h
index ecc0185..2e896a6 100644
--- a/WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginTest.h
+++ b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginTest.h
@@ -57,6 +57,7 @@ public:
// NPP functions.
virtual NPError NPP_DestroyStream(NPStream* stream, NPReason reason);
virtual NPError NPP_GetValue(NPPVariable, void* value);
+ virtual NPError NPP_SetWindow(NPP, NPWindow*);
// NPN functions.
NPIdentifier NPN_GetStringIdentifier(const NPUTF8* name);
diff --git a/WebKitTools/DumpRenderTree/TestNetscapePlugIn/Tests/win/WindowGeometryInitializedBeforeSetWindow.cpp b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/Tests/win/WindowGeometryInitializedBeforeSetWindow.cpp
new file mode 100644
index 0000000..40bceb9
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/Tests/win/WindowGeometryInitializedBeforeSetWindow.cpp
@@ -0,0 +1,83 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "PluginTest.h"
+
+#include "PluginObject.h"
+
+using namespace std;
+
+// Plugin's HWND should be sized/positioned before NPP_SetWindow is called.
+
+class WindowGeometryInitializedBeforeSetWindow : public PluginTest {
+public:
+ WindowGeometryInitializedBeforeSetWindow(NPP npp, const string& identifier)
+ : PluginTest(npp, identifier)
+ {
+ }
+
+private:
+ virtual NPError NPP_SetWindow(NPP instance, NPWindow* window)
+ {
+ if (window->type != NPWindowTypeWindow) {
+ pluginLog(instance, "window->type should be NPWindowTypeWindow but was %d", window->type);
+ return NPERR_GENERIC_ERROR;
+ }
+
+ HWND hwnd = reinterpret_cast<HWND>(window->window);
+ RECT rect;
+ if (!::GetClientRect(hwnd, &rect)) {
+ pluginLog(instance, "::GetClientRect failed");
+ return NPERR_GENERIC_ERROR;
+ }
+
+ if (::IsRectEmpty(&rect)) {
+ pluginLog(instance, "Plugin's HWND has not been sized when NPP_SetWindow is called");
+ return NPERR_GENERIC_ERROR;
+ }
+
+ HWND parent = ::GetParent(hwnd);
+ if (!parent) {
+ pluginLog(instance, "::GetParent failed");
+ return NPERR_GENERIC_ERROR;
+ }
+
+ // MSDN says that calling ::MapWindowPoints this way will tell it we're passing a RECT rather than two POINTs.
+ if (!::MapWindowPoints(hwnd, parent, reinterpret_cast<POINT*>(&rect), 2)) {
+ pluginLog(instance, "::MapWindowPoints failed");
+ return NPERR_GENERIC_ERROR;
+ }
+
+ if (rect.left != window->x || rect.top != window->y || (rect.right - rect.left) != window->width || (rect.bottom - rect.top) != window->height) {
+ pluginLog(instance, "HWND's rect and NPWindow's rect are not equal");
+ return NPERR_GENERIC_ERROR;
+ }
+
+ pluginLog(instance, "Plugin's HWND has been sized and positioned before NPP_SetWindow was called");
+ return NPERR_NO_ERROR;
+ }
+};
+
+static PluginTest::Register<WindowGeometryInitializedBeforeSetWindow> windowGeometryInitializedBeforeSetWindow("window-geometry-initialized-before-set-window");
diff --git a/WebKitTools/DumpRenderTree/TestNetscapePlugIn/main.cpp b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/main.cpp
index c02e918..dd894f4 100644
--- a/WebKitTools/DumpRenderTree/TestNetscapePlugIn/main.cpp
+++ b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/main.cpp
@@ -218,8 +218,20 @@ NPError NPP_New(NPMIMEType pluginType, NPP instance, uint16_t mode, int16_t argc
// FIXME: When https://bugs.webkit.org/show_bug.cgi?id=41831 is fixed, this #ifdef can be removed.
obj->testGetURLOnDestroy = TRUE;
#endif
- } else if (strcasecmp(argn[i], "src") == 0 && strstr(argv[i], "plugin-document-has-focus.pl"))
+ } else if (!strcasecmp(argn[i], "src") && strstr(argv[i], "plugin-document-has-focus.pl"))
obj->testKeyboardFocusForPlugins = TRUE;
+ else if (!strcasecmp(argn[i], "evaluatescript")) {
+ char* script = argv[i];
+ if (script == strstr(script, "mouse::")) {
+ obj->mouseDownForEvaluateScript = true;
+ obj->evaluateScriptOnMouseDownOrKeyDown = strdup(script + sizeof("mouse::") - 1);
+ } else if (script == strstr(script, "key::")) {
+ obj->evaluateScriptOnMouseDownOrKeyDown = strdup(script + sizeof("key::") - 1);
+ }
+ // When testing evaluate script on mouse-down or key-down, allow event logging to handle events.
+ if (obj->evaluateScriptOnMouseDownOrKeyDown)
+ obj->eventLogging = true;
+ }
}
#if XP_MACOSX
@@ -300,7 +312,7 @@ NPError NPP_SetWindow(NPP instance, NPWindow *window)
}
}
- return NPERR_NO_ERROR;
+ return obj->pluginTest->NPP_SetWindow(instance, window);
}
static void executeScript(const PluginObject* obj, const char* script)
@@ -401,6 +413,8 @@ static int16_t handleEventCarbon(NPP instance, PluginObject* obj, EventRecord* e
case mouseDown:
GlobalToLocal(&pt);
pluginLog(instance, "mouseDown at (%d, %d)", pt.h, pt.v);
+ if (obj->evaluateScriptOnMouseDownOrKeyDown && obj->mouseDownForEvaluateScript)
+ executeScript(obj, obj->evaluateScriptOnMouseDownOrKeyDown);
break;
case mouseUp:
GlobalToLocal(&pt);
@@ -408,6 +422,8 @@ static int16_t handleEventCarbon(NPP instance, PluginObject* obj, EventRecord* e
break;
case keyDown:
pluginLog(instance, "keyDown '%c'", (char)(event->message & 0xFF));
+ if (obj->evaluateScriptOnMouseDownOrKeyDown && !obj->mouseDownForEvaluateScript)
+ executeScript(obj, obj->evaluateScriptOnMouseDownOrKeyDown);
break;
case keyUp:
pluginLog(instance, "keyUp '%c'", (char)(event->message & 0xFF));
@@ -481,6 +497,8 @@ static int16_t handleEventCocoa(NPP instance, PluginObject* obj, NPCocoaEvent* e
case NPCocoaEventKeyDown:
if (event->data.key.characters)
pluginLog(instance, "keyDown '%c'", CFStringGetCharacterAtIndex(reinterpret_cast<CFStringRef>(event->data.key.characters), 0));
+ if (obj->evaluateScriptOnMouseDownOrKeyDown && !obj->mouseDownForEvaluateScript)
+ executeScript(obj, obj->evaluateScriptOnMouseDownOrKeyDown);
return 1;
case NPCocoaEventKeyUp:
@@ -501,6 +519,8 @@ static int16_t handleEventCocoa(NPP instance, PluginObject* obj, NPCocoaEvent* e
pluginLog(instance, "mouseDown at (%d, %d)",
(int)event->data.mouse.pluginX,
(int)event->data.mouse.pluginY);
+ if (obj->evaluateScriptOnMouseDownOrKeyDown && obj->mouseDownForEvaluateScript)
+ executeScript(obj, obj->evaluateScriptOnMouseDownOrKeyDown);
return 1;
case NPCocoaEventMouseUp:
pluginLog(instance, "mouseUp at (%d, %d)",
diff --git a/WebKitTools/DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.vcproj b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.vcproj
index c36666f..5ffb832 100644
--- a/WebKitTools/DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.vcproj
+++ b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.vcproj
@@ -367,6 +367,34 @@
<References>
</References>
<Files>
+ <Filter
+ Name="Tests"
+ >
+ <File
+ RelativePath="..\Tests\DocumentOpenInDestroyStream.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\Tests\NPRuntimeObjectFromDestroyedPlugin.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\Tests\NPRuntimeRemoveProperty.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\Tests\PluginScriptableNPObjectInvokeDefault.cpp"
+ >
+ </File>
+ <Filter
+ Name="win"
+ >
+ <File
+ RelativePath="..\Tests\win\WindowGeometryInitializedBeforeSetWindow.cpp"
+ >
+ </File>
+ </Filter>
+ </Filter>
<File
RelativePath="..\main.cpp"
>
@@ -456,26 +484,6 @@
RelativePath="..\TestObject.h"
>
</File>
- <Filter
- Name="Tests"
- >
- <File
- RelativePath="..\Tests\DocumentOpenInDestroyStream.cpp"
- >
- </File>
- <File
- RelativePath="..\Tests\NPRuntimeObjectFromDestroyedPlugin.cpp"
- >
- </File>
- <File
- RelativePath="..\Tests\NPRuntimeRemoveProperty.cpp"
- >
- </File>
- <File
- RelativePath="..\Tests\PluginScriptableNPObjectInvokeDefault.cpp"
- >
- </File>
- </Filter>
</Files>
<Globals>
</Globals>
diff --git a/WebKitTools/DumpRenderTree/chromium/DumpRenderTree.cpp b/WebKitTools/DumpRenderTree/chromium/DumpRenderTree.cpp
index 6e180d0..b2e50f7 100644
--- a/WebKitTools/DumpRenderTree/chromium/DumpRenderTree.cpp
+++ b/WebKitTools/DumpRenderTree/chromium/DumpRenderTree.cpp
@@ -48,6 +48,7 @@ static const char optionTestShell[] = "--test-shell";
static const char optionAllowExternalPages[] = "--allow-external-pages";
static const char optionStartupDialog[] = "--testshell-startup-dialog";
static const char optionCheckLayoutTestSystemDeps[] = "--check-layout-test-sys-deps";
+static const char optionEnableAccelerated2DCanvas[] = "--enable-accelerated-2d-canvas";
static void runTest(TestShell& shell, TestParams& params, const string& testName, bool testShellMode)
{
@@ -92,6 +93,7 @@ int main(int argc, char* argv[])
bool testShellMode = false;
bool allowExternalPages = false;
bool startupDialog = false;
+ bool accelerated2DCanvasEnabled = false;
for (int i = 1; i < argc; ++i) {
string argument(argv[i]);
if (argument == "-")
@@ -112,6 +114,8 @@ int main(int argc, char* argv[])
startupDialog = true;
else if (argument == optionCheckLayoutTestSystemDeps)
exit(checkLayoutTestSystemDependencies() ? EXIT_SUCCESS : EXIT_FAILURE);
+ else if (argument == optionEnableAccelerated2DCanvas)
+ accelerated2DCanvasEnabled = true;
else if (argument.size() && argument[0] == '-')
fprintf(stderr, "Unknown option: %s\n", argv[i]);
else
@@ -128,6 +132,7 @@ int main(int argc, char* argv[])
{ // Explicit scope for the TestShell instance.
TestShell shell(testShellMode);
shell.setAllowExternalPages(allowExternalPages);
+ shell.setAccelerated2dCanvasEnabled(accelerated2DCanvasEnabled);
if (serverMode && !tests.size()) {
params.printSeparators = true;
char testString[2048]; // 2048 is the same as the sizes of other platforms.
diff --git a/WebKitTools/DumpRenderTree/chromium/LayoutTestController.cpp b/WebKitTools/DumpRenderTree/chromium/LayoutTestController.cpp
index 2c6c600..3d3c204 100644
--- a/WebKitTools/DumpRenderTree/chromium/LayoutTestController.cpp
+++ b/WebKitTools/DumpRenderTree/chromium/LayoutTestController.cpp
@@ -126,6 +126,7 @@ LayoutTestController::LayoutTestController(TestShell* shell)
bindMethod("removeOriginAccessWhitelistEntry", &LayoutTestController::removeOriginAccessWhitelistEntry);
bindMethod("repaintSweepHorizontally", &LayoutTestController::repaintSweepHorizontally);
bindMethod("resumeAnimations", &LayoutTestController::resumeAnimations);
+ bindMethod("sampleSVGAnimationForElementAtTime", &LayoutTestController::sampleSVGAnimationForElementAtTime);
bindMethod("setAcceptsEditing", &LayoutTestController::setAcceptsEditing);
bindMethod("setAllowFileAccessFromFileURLs", &LayoutTestController::setAllowFileAccessFromFileURLs);
bindMethod("setAllowUniversalAccessFromFileURLs", &LayoutTestController::setAllowUniversalAccessFromFileURLs);
@@ -959,6 +960,19 @@ void LayoutTestController::resumeAnimations(const CppArgumentList&, CppVariant*
result->setNull();
}
+void LayoutTestController::sampleSVGAnimationForElementAtTime(const CppArgumentList& arguments, CppVariant* result)
+{
+ if (arguments.size() != 3) {
+ result->setNull();
+ return;
+ }
+ WebString animationId = cppVariantToWebString(arguments[0]);
+ double time = arguments[1].toDouble();
+ WebString elementId = cppVariantToWebString(arguments[2]);
+ bool success = m_shell->webView()->mainFrame()->pauseSVGAnimation(animationId, time, elementId);
+ result->set(success);
+}
+
void LayoutTestController::disableImageLoading(const CppArgumentList&, CppVariant* result)
{
m_shell->preferences()->loadsImagesAutomatically = false;
@@ -1251,6 +1265,10 @@ void LayoutTestController::overridePreference(const CppArgumentList& arguments,
prefs->tabsToLinks = cppVariantToBool(value);
else if (key == "WebKitWebGLEnabled")
prefs->experimentalWebGLEnabled = cppVariantToBool(value);
+ else if (key == "WebKitHyperlinkAuditingEnabled")
+ prefs->hyperlinkAuditingEnabled = cppVariantToBool(value);
+ else if (key == "WebKitEnableCaretBrowsing")
+ prefs->caretBrowsingEnabled = cppVariantToBool(value);
else {
string message("Invalid name for preference: ");
message.append(key);
@@ -1443,7 +1461,10 @@ void LayoutTestController::addUserStyleSheet(const CppArgumentList& arguments, C
return;
WebView::addUserStyleSheet(
cppVariantToWebString(arguments[0]), WebVector<WebString>(),
- arguments[2].toBoolean() ? WebView::UserContentInjectInAllFrames : WebView::UserContentInjectInTopFrameOnly);
+ arguments[1].toBoolean() ? WebView::UserContentInjectInAllFrames : WebView::UserContentInjectInTopFrameOnly,
+ // Chromium defaults to InjectInSubsequentDocuments, but for compatibility
+ // with the other ports' DRTs, we use UserStyleInjectInExistingDocuments.
+ WebView::UserStyleInjectInExistingDocuments);
}
void LayoutTestController::setEditingBehavior(const CppArgumentList& arguments, CppVariant* results)
diff --git a/WebKitTools/DumpRenderTree/chromium/LayoutTestController.h b/WebKitTools/DumpRenderTree/chromium/LayoutTestController.h
index ec2503f..8467097 100644
--- a/WebKitTools/DumpRenderTree/chromium/LayoutTestController.h
+++ b/WebKitTools/DumpRenderTree/chromium/LayoutTestController.h
@@ -223,6 +223,7 @@ public:
void numberOfActiveAnimations(const CppArgumentList&, CppVariant*);
void suspendAnimations(const CppArgumentList&, CppVariant*);
void resumeAnimations(const CppArgumentList&, CppVariant*);
+ void sampleSVGAnimationForElementAtTime(const CppArgumentList&, CppVariant*);
void disableImageLoading(const CppArgumentList&, CppVariant*);
void setIconDatabaseEnabled(const CppArgumentList&, CppVariant*);
void dumpSelectionRect(const CppArgumentList&, CppVariant*);
diff --git a/WebKitTools/DumpRenderTree/chromium/TestEventPrinter.cpp b/WebKitTools/DumpRenderTree/chromium/TestEventPrinter.cpp
index d9e79a0..2130534 100644
--- a/WebKitTools/DumpRenderTree/chromium/TestEventPrinter.cpp
+++ b/WebKitTools/DumpRenderTree/chromium/TestEventPrinter.cpp
@@ -99,7 +99,8 @@ void DRTPrinter::handleImage(const char* actualHash, const char* expectedHash, c
printf("\nExpectedHash: %s\n", expectedHash);
if (imageData && imageSize) {
printf("Content-Type: image/png\n");
- printf("Content-Length: %lu\n", imageSize);
+ // Printf formatting for size_t on 32-bit, 64-bit, and on Windows is hard so just cast to an int.
+ printf("Content-Length: %d\n", static_cast<int>(imageSize));
if (fwrite(imageData, 1, imageSize, stdout) != imageSize) {
fprintf(stderr, "Short write to stdout.\n");
exit(1);
diff --git a/WebKitTools/DumpRenderTree/chromium/TestShell.cpp b/WebKitTools/DumpRenderTree/chromium/TestShell.cpp
index 15d6dee..1a99b7d 100644
--- a/WebKitTools/DumpRenderTree/chromium/TestShell.cpp
+++ b/WebKitTools/DumpRenderTree/chromium/TestShell.cpp
@@ -83,6 +83,7 @@ TestShell::TestShell(bool testShellMode)
, m_focusedWidget(0)
, m_testShellMode(testShellMode)
, m_allowExternalPages(false)
+ , m_accelerated2dCanvasEnabled(false)
, m_devTools(0)
{
WebRuntimeFeatures::enableGeolocation(true);
@@ -155,6 +156,7 @@ void TestShell::closeDevTools()
void TestShell::resetWebSettings(WebView& webView)
{
m_prefs.reset();
+ m_prefs.accelerated2dCanvasEnabled = m_accelerated2dCanvasEnabled;
m_prefs.applyTo(&webView);
}
diff --git a/WebKitTools/DumpRenderTree/chromium/TestShell.h b/WebKitTools/DumpRenderTree/chromium/TestShell.h
index 6d93d4a..4d022dc 100644
--- a/WebKitTools/DumpRenderTree/chromium/TestShell.h
+++ b/WebKitTools/DumpRenderTree/chromium/TestShell.h
@@ -123,6 +123,8 @@ public:
bool allowExternalPages() const { return m_allowExternalPages; }
void setAllowExternalPages(bool allowExternalPages) { m_allowExternalPages = allowExternalPages; }
+ void setAccelerated2dCanvasEnabled(bool enabled) { m_accelerated2dCanvasEnabled = enabled; }
+
#if defined(OS_WIN)
// Access to the finished event. Used by the static WatchDog thread.
HANDLE finishedEvent() { return m_finishedEvent; }
@@ -176,6 +178,7 @@ private:
TestParams m_params;
int m_timeout; // timeout value in millisecond
bool m_allowExternalPages;
+ bool m_accelerated2dCanvasEnabled;
WebPreferences m_prefs;
// List of all windows in this process.
diff --git a/WebKitTools/DumpRenderTree/chromium/TestShellGtk.cpp b/WebKitTools/DumpRenderTree/chromium/TestShellGtk.cpp
index 60408b9..1cf7c56 100644
--- a/WebKitTools/DumpRenderTree/chromium/TestShellGtk.cpp
+++ b/WebKitTools/DumpRenderTree/chromium/TestShellGtk.cpp
@@ -134,22 +134,23 @@ static void setupFontconfig()
// few layout tests.
static const char* const optionalFonts[] = {
"/usr/share/fonts/truetype/ttf-lucida/LucidaSansRegular.ttf",
-
- // This font changed paths across Ubuntu releases.
"/usr/share/fonts/truetype/ttf-indic-fonts-core/lohit_pa.ttf",
- "/usr/share/fonts/truetype/ttf-punjabi-fonts/lohit_pa.ttf",
};
for (size_t i = 0; i < arraysize(optionalFonts); ++i) {
const char* font = optionalFonts[i];
+
+ // This font changed paths across Ubuntu releases, so try checking in both locations.
+ if (!strcmp(font, "/usr/share/fonts/truetype/ttf-indic-fonts-core/lohit_pa.ttf")
+ && access(font, R_OK) < 0)
+ font = "/usr/share/fonts/truetype/ttf-punjabi-fonts/lohit_pa.ttf";
+
if (access(font, R_OK) < 0) {
fprintf(stderr, "You are missing %s. Without this, some layout tests may fail. "
"See http://code.google.com/p/chromium/wiki/LinuxBuildInstructionsPrerequisites "
"for more.\n", font);
- } else {
- if (!FcConfigAppFontAddFile(fontcfg, (FcChar8 *) font)) {
- fprintf(stderr, "Failed to load font %s\n", font);
- exit(1);
- }
+ } else if (!FcConfigAppFontAddFile(fontcfg, (FcChar8 *) font)) {
+ fprintf(stderr, "Failed to load font %s\n", font);
+ exit(1);
}
}
diff --git a/WebKitTools/DumpRenderTree/chromium/TextInputController.cpp b/WebKitTools/DumpRenderTree/chromium/TextInputController.cpp
index 16f1575..4f06874 100644
--- a/WebKitTools/DumpRenderTree/chromium/TextInputController.cpp
+++ b/WebKitTools/DumpRenderTree/chromium/TextInputController.cpp
@@ -32,6 +32,7 @@
#include "TextInputController.h"
#include "TestShell.h"
+#include "public/WebBindings.h"
#include "public/WebFrame.h"
#include "public/WebRange.h"
#include "public/WebString.h"
@@ -186,10 +187,27 @@ void TextInputController::selectedRange(const CppArgumentList&, CppVariant* resu
result->set(string(buffer));
}
-void TextInputController::firstRectForCharacterRange(const CppArgumentList&, CppVariant* result)
+void TextInputController::firstRectForCharacterRange(const CppArgumentList& arguments, CppVariant* result)
{
- // FIXME: Implement this.
result->setNull();
+
+ WebFrame* mainFrame = getMainFrame();
+ if (!mainFrame)
+ return;
+
+ if (arguments.size() < 2 || !arguments[0].isNumber() || !arguments[1].isNumber())
+ return;
+
+ WebRect rect;
+ if (!mainFrame->firstRectForCharacterRange(arguments[0].toInt32(), arguments[1].toInt32(), rect))
+ return;
+
+ Vector<int> intArray(4);
+ intArray[0] = rect.x;
+ intArray[1] = rect.y;
+ intArray[2] = rect.width;
+ intArray[3] = rect.height;
+ result->set(WebBindings::makeIntArray(intArray));
}
void TextInputController::characterIndexForPoint(const CppArgumentList&, CppVariant* result)
diff --git a/WebKitTools/DumpRenderTree/chromium/WebPreferences.cpp b/WebKitTools/DumpRenderTree/chromium/WebPreferences.cpp
index 004865a..35247ef 100644
--- a/WebKitTools/DumpRenderTree/chromium/WebPreferences.cpp
+++ b/WebKitTools/DumpRenderTree/chromium/WebPreferences.cpp
@@ -88,6 +88,7 @@ void WebPreferences::reset()
userStyleSheetLocation = WebURL();
usesPageCache = false;
webSecurityEnabled = true;
+ caretBrowsingEnabled = false;
// Allow those layout tests running as local files, i.e. under
// LayoutTests/http/tests/local, to access http server.
@@ -100,6 +101,8 @@ void WebPreferences::reset()
#endif
tabsToLinks = false;
+ hyperlinkAuditingEnabled = false;
+ accelerated2dCanvasEnabled = false;
}
void WebPreferences::applyTo(WebView* webView)
@@ -139,9 +142,11 @@ void WebPreferences::applyTo(WebView* webView)
settings->setWebSecurityEnabled(webSecurityEnabled);
settings->setAllowUniversalAccessFromFileURLs(allowUniversalAccessFromFileURLs);
settings->setEditingBehavior(editingBehavior);
+ settings->setHyperlinkAuditingEnabled(hyperlinkAuditingEnabled);
// LayoutTests were written with Safari Mac in mind which does not allow
// tabbing to links by default.
webView->setTabsToLinks(tabsToLinks);
+ settings->setCaretBrowsingEnabled(caretBrowsingEnabled);
// Fixed values.
settings->setShouldPaintCustomScrollbars(true);
@@ -157,5 +162,7 @@ void WebPreferences::applyTo(WebView* webView)
// FIXME: crbug.com/51879
settings->setAcceleratedCompositingEnabled(false);
+
+ settings->setAccelerated2dCanvasEnabled(accelerated2dCanvasEnabled);
}
diff --git a/WebKitTools/DumpRenderTree/chromium/WebPreferences.h b/WebKitTools/DumpRenderTree/chromium/WebPreferences.h
index f197c16..c0ea70f 100644
--- a/WebKitTools/DumpRenderTree/chromium/WebPreferences.h
+++ b/WebKitTools/DumpRenderTree/chromium/WebPreferences.h
@@ -75,6 +75,9 @@ struct WebPreferences {
bool allowUniversalAccessFromFileURLs;
WebKit::WebSettings::EditingBehavior editingBehavior;
bool tabsToLinks;
+ bool hyperlinkAuditingEnabled;
+ bool caretBrowsingEnabled;
+ bool accelerated2dCanvasEnabled;
WebPreferences() { reset(); }
void reset();
diff --git a/WebKitTools/DumpRenderTree/gtk/DumpRenderTree.cpp b/WebKitTools/DumpRenderTree/gtk/DumpRenderTree.cpp
index af2e403..521a0e1 100644
--- a/WebKitTools/DumpRenderTree/gtk/DumpRenderTree.cpp
+++ b/WebKitTools/DumpRenderTree/gtk/DumpRenderTree.cpp
@@ -35,6 +35,7 @@
#include "AccessibilityController.h"
#include "EventSender.h"
#include "GCController.h"
+#include "GOwnPtr.h"
#include "LayoutTestController.h"
#include "PixelDumpSupport.h"
#include "WorkQueue.h"
@@ -133,37 +134,81 @@ static void appendString(gchar*& target, gchar* string)
static void initializeFonts()
{
#if PLATFORM(X11)
- static int numFonts = -1;
-
FcInit();
- // Some tests may add or remove fonts via the @font-face rule.
- // If that happens, font config should be re-created to suppress any unwanted change.
+ // If a test resulted a font being added or removed via the @font-face rule, then
+ // we want to reset the FontConfig configuration to prevent it from affecting other tests.
+ static int numFonts = 0;
FcFontSet* appFontSet = FcConfigGetFonts(0, FcSetApplication);
- if (appFontSet && numFonts >= 0 && appFontSet->nfont == numFonts)
+ if (appFontSet && numFonts && appFontSet->nfont == numFonts)
return;
- const char* fontDirEnv = g_getenv("WEBKIT_TESTFONTS");
- if (!fontDirEnv)
- g_error("WEBKIT_TESTFONTS environment variable is not set, but it should point to the directory "
- "containing the fonts you can clone from git://gitorious.org/qtwebkit/testfonts.git\n");
+ // Load our configuration file, which sets up proper aliases for family
+ // names like sans, serif and monospace.
+ FcConfig* config = FcConfigCreate();
+ GOwnPtr<gchar> fontConfigFilename(g_build_filename(FONTS_CONF_DIR, "fonts.conf", NULL));
+ if (!FcConfigParseAndLoad(config, reinterpret_cast<FcChar8*>(fontConfigFilename.get()), true))
+ g_error("Couldn't load font configuration file from: %s", fontConfigFilename.get());
+
+ static const char *const fontPaths[][2] = {
+ { "/usr/share/fonts/truetype/ttf-liberation/LiberationMono-BoldItalic.ttf",
+ "/usr/share/fonts/liberation/LiberationMono-BoldItalic.ttf", },
+ { "/usr/share/fonts/truetype/ttf-liberation/LiberationMono-Bold.ttf",
+ "/usr/share/fonts/liberation/LiberationMono-Bold.ttf", },
+ { "/usr/share/fonts/truetype/ttf-liberation/LiberationMono-Italic.ttf",
+ "/usr/share/fonts/liberation/LiberationMono-Italic.ttf", },
+ { "/usr/share/fonts/truetype/ttf-liberation/LiberationMono-Regular.ttf",
+ "/usr/share/fonts/liberation/LiberationMono-Regular.ttf", },
+ { "/usr/share/fonts/truetype/ttf-liberation/LiberationSans-BoldItalic.ttf",
+ "/usr/share/fonts/liberation/LiberationSans-BoldItalic.ttf", },
+ { "/usr/share/fonts/truetype/ttf-liberation/LiberationSans-Bold.ttf",
+ "/usr/share/fonts/liberation/LiberationSans-Bold.ttf", },
+ { "/usr/share/fonts/truetype/ttf-liberation/LiberationSans-Italic.ttf",
+ "/usr/share/fonts/liberation/LiberationSans-Italic.ttf", },
+ { "/usr/share/fonts/truetype/ttf-liberation/LiberationSans-Regular.ttf",
+ "/usr/share/fonts/liberation/LiberationSans-Regular.ttf", },
+ { "/usr/share/fonts/truetype/ttf-liberation/LiberationSerif-BoldItalic.ttf",
+ "/usr/share/fonts/liberation/LiberationSerif-BoldItalic.ttf", },
+ { "/usr/share/fonts/truetype/ttf-liberation/LiberationSerif-Bold.ttf",
+ "/usr/share/fonts/liberation/LiberationSerif-Bold.ttf", },
+ { "/usr/share/fonts/truetype/ttf-liberation/LiberationSerif-Italic.ttf",
+ "/usr/share/fonts/liberation/LiberationSerif-Italic.ttf", },
+ { "/usr/share/fonts/truetype/ttf-liberation/LiberationSerif-Regular.ttf",
+ "/usr/share/fonts/liberation/LiberationSerif-Regular.ttf", },
+ { "/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf",
+ "/usr/share/fonts/dejavu/DejaVuSans.ttf", },
+ };
- GFile* fontDir = g_file_new_for_path(fontDirEnv);
- if (!fontDir || !g_file_query_exists(fontDir, NULL))
- g_error("WEBKIT_TESTFONTS environment variable is not set correctly - it should point to the directory "
- "containing the fonts you can clone from git://gitorious.org/qtwebkit/testfonts.git\n");
+ // TODO: Some tests use Lucida. We should load these as well, once it becomes
+ // clear how to install these fonts easily on Fedora.
+ for (size_t font = 0; font < G_N_ELEMENTS(fontPaths); font++) {
+ bool found = false;
+ for (size_t path = 0; path < 2; path++) {
+
+ if (g_file_test(fontPaths[font][path], G_FILE_TEST_EXISTS)) {
+ found = true;
+ if (!FcConfigAppFontAddFile(config, reinterpret_cast<const FcChar8*>(fontPaths[font][path])))
+ g_error("Could not load font at %s!", fontPaths[font][path]);
+ else
+ break;
+ }
+ }
+
+ if (!found)
+ g_error("Could not find font at %s. Either install this font or file a bug "
+ "at http://bugs.webkit.org if it is installed in another location.",
+ fontPaths[font][0]);
+ }
- FcConfig *config = FcConfigCreate();
- if (!FcConfigParseAndLoad (config, (FcChar8*) FONTS_CONF_FILE, true))
- g_error("Couldn't load font configuration file");
- if (!FcConfigAppFontAddDir (config, (FcChar8*) g_file_get_path(fontDir)))
- g_error("Couldn't add font dir!");
- FcConfigSetCurrent(config);
+ // Ahem is used by many layout tests.
+ GOwnPtr<gchar> ahemFontFilename(g_build_filename(FONTS_CONF_DIR, "AHEM____.TTF", NULL));
+ if (!FcConfigAppFontAddFile(config, reinterpret_cast<FcChar8*>(ahemFontFilename.get())))
+ g_error("Could not load font at %s!", ahemFontFilename.get());
- g_object_unref(fontDir);
+ if (!FcConfigSetCurrent(config))
+ g_error("Could not set the current font configuration!");
- appFontSet = FcConfigGetFonts(config, FcSetApplication);
- numFonts = appFontSet->nfont;
+ numFonts = FcConfigGetFonts(config, FcSetApplication)->nfont;
#endif
}
@@ -336,6 +381,7 @@ static void resetDefaultsToConsistentValues()
"auto-resize-window", TRUE,
"enable-java-applet", FALSE,
"enable-plugins", TRUE,
+ "enable-hyperlink-auditing", FALSE,
"editing-behavior", WEBKIT_EDITING_BEHAVIOR_MAC,
NULL);
diff --git a/WebKitTools/DumpRenderTree/gtk/EventSender.cpp b/WebKitTools/DumpRenderTree/gtk/EventSender.cpp
index d1529db..6e5fa5f 100644
--- a/WebKitTools/DumpRenderTree/gtk/EventSender.cpp
+++ b/WebKitTools/DumpRenderTree/gtk/EventSender.cpp
@@ -147,6 +147,58 @@ bool prepareMouseButtonEvent(GdkEvent* event, int eventSenderButtonNumber, guint
return true;
}
+static JSValueRef getMenuItemTitleCallback(JSContextRef context, JSObjectRef object, JSStringRef propertyName, JSValueRef* exception)
+{
+ GtkWidget* widget = GTK_WIDGET(JSObjectGetPrivate(object));
+ CString label;
+ if (GTK_IS_SEPARATOR_MENU_ITEM(widget))
+ label = "<separator>";
+ else
+ label = gtk_menu_item_get_label(GTK_MENU_ITEM(widget));
+
+ return JSValueMakeString(context, JSStringCreateWithUTF8CString(label.data()));
+}
+
+static bool setMenuItemTitleCallback(JSContextRef context, JSObjectRef object, JSStringRef propertyName, JSValueRef value, JSValueRef* exception)
+{
+ return true;
+}
+
+static JSValueRef menuItemClickCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+ GtkMenuItem* item = GTK_MENU_ITEM(JSObjectGetPrivate(thisObject));
+ gtk_menu_item_activate(item);
+ return JSValueMakeUndefined(context);
+}
+
+static JSStaticFunction staticMenuItemFunctions[] = {
+ { "click", menuItemClickCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+ { 0, 0, 0 }
+};
+
+static JSStaticValue staticMenuItemValues[] = {
+ { "title", getMenuItemTitleCallback, setMenuItemTitleCallback, kJSPropertyAttributeNone },
+ { 0, 0, 0, 0 }
+};
+
+static JSClassRef getMenuItemClass()
+{
+ static JSClassRef menuItemClass = 0;
+
+ if (!menuItemClass) {
+ JSClassDefinition classDefinition = {
+ 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
+ classDefinition.staticFunctions = staticMenuItemFunctions;
+ classDefinition.staticValues = staticMenuItemValues;
+
+ menuItemClass = JSClassCreate(&classDefinition);
+ }
+
+ return menuItemClass;
+}
+
+
static JSValueRef contextClickCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
GdkEvent* pressEvent = gdk_event_new(GDK_BUTTON_PRESS);
@@ -165,13 +217,7 @@ static JSValueRef contextClickCallback(JSContextRef context, JSObjectRef functio
JSValueRef arrayValues[g_list_length(items)];
int index = 0;
for (GList* item = g_list_first(items); item; item = g_list_next(item)) {
- CString label;
- if (GTK_IS_SEPARATOR_MENU_ITEM(item->data))
- label = "<separator>";
- else
- label = gtk_menu_item_get_label(GTK_MENU_ITEM(item->data));
-
- arrayValues[index] = JSValueMakeString(context, JSStringCreateWithUTF8CString(label.data()));
+ arrayValues[index] = JSObjectMake(context, getMenuItemClass(), item->data);
index++;
}
if (index)
diff --git a/WebKitTools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp b/WebKitTools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp
index 32be43d..d831076 100644
--- a/WebKitTools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp
+++ b/WebKitTools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp
@@ -38,7 +38,6 @@
#include "WorkQueueItem.h"
#include <JavaScriptCore/JSRetainPtr.h>
#include <JavaScriptCore/JSStringRef.h>
-
#include <cstring>
#include <iostream>
#include <sstream>
@@ -46,6 +45,7 @@
#include <glib.h>
#include <libsoup/soup.h>
#include <webkit/webkit.h>
+#include <wtf/gobject/GOwnPtr.h>
extern "C" {
bool webkit_web_frame_pause_animation(WebKitWebFrame* frame, const gchar* name, double time, const gchar* element);
@@ -66,24 +66,6 @@ void webkit_web_view_execute_core_command_by_name(WebKitWebView* webView, const
gboolean webkit_web_view_is_command_enabled(WebKitWebView* webView, const gchar* name);
}
-static gchar* copyWebSettingKey(gchar* preferenceKey)
-{
- static GHashTable* keyTable;
-
- if (!keyTable) {
- // If you add a pref here, make sure you reset the value in
- // DumpRenderTree::resetDefaultsToConsistentValues.
- keyTable = g_hash_table_new(g_str_hash, g_str_equal);
- g_hash_table_insert(keyTable, g_strdup("WebKitJavaScriptEnabled"), g_strdup("enable-scripts"));
- g_hash_table_insert(keyTable, g_strdup("WebKitDefaultFontSize"), g_strdup("default-font-size"));
- g_hash_table_insert(keyTable, g_strdup("WebKitEnableCaretBrowsing"), g_strdup("enable-caret-browsing"));
- g_hash_table_insert(keyTable, g_strdup("WebKitUsesPageCachePreferenceKey"), g_strdup("enable-page-cache"));
- g_hash_table_insert(keyTable, g_strdup("WebKitPluginsEnabled"), g_strdup("enable-plugins"));
- }
-
- return g_strdup(static_cast<gchar*>(g_hash_table_lookup(keyTable, preferenceKey)));
-}
-
LayoutTestController::~LayoutTestController()
{
// FIXME: implement
@@ -155,6 +137,12 @@ JSValueRef LayoutTestController::computedStyleIncludingVisitedInfo(JSContextRef
return JSValueMakeUndefined(context);
}
+JSValueRef LayoutTestController::nodesFromRect(JSContextRef context, JSValueRef value, int x, int y, unsigned top, unsigned right, unsigned bottom, unsigned left, bool ignoreClipping)
+{
+ // FIXME: Implement this.
+ return JSValueMakeUndefined(context);
+}
+
JSRetainPtr<JSStringRef> LayoutTestController::layerTreeAsText() const
{
// FIXME: implement
@@ -664,48 +652,53 @@ void LayoutTestController::resumeAnimations() const
void LayoutTestController::overridePreference(JSStringRef key, JSStringRef value)
{
- gchar* name = JSStringCopyUTF8CString(key);
- gchar* strValue = JSStringCopyUTF8CString(value);
+ GOwnPtr<gchar> originalName(JSStringCopyUTF8CString(key));
+ GOwnPtr<gchar> valueAsString(JSStringCopyUTF8CString(value));
WebKitWebView* view = webkit_web_frame_get_web_view(mainFrame);
ASSERT(view);
- WebKitWebSettings* settings = webkit_web_view_get_settings(view);
- gchar* webSettingKey = copyWebSettingKey(name);
-
- if (webSettingKey) {
- GValue stringValue = { 0, { { 0 } } };
- g_value_init(&stringValue, G_TYPE_STRING);
- g_value_set_string(&stringValue, const_cast<gchar*>(strValue));
-
- WebKitWebSettingsClass* klass = WEBKIT_WEB_SETTINGS_GET_CLASS(settings);
- GParamSpec* pspec = g_object_class_find_property(G_OBJECT_CLASS(klass), webSettingKey);
- GValue propValue = { 0, { { 0 } } };
- g_value_init(&propValue, pspec->value_type);
-
- if (g_value_type_transformable(G_TYPE_STRING, pspec->value_type)) {
- g_value_transform(const_cast<GValue*>(&stringValue), &propValue);
- g_object_set_property(G_OBJECT(settings), webSettingKey, const_cast<GValue*>(&propValue));
- } else if (G_VALUE_HOLDS_BOOLEAN(&propValue)) {
- char* lowered = g_utf8_strdown(strValue, -1);
- g_object_set(G_OBJECT(settings), webSettingKey,
- g_str_equal(lowered, "true")
- || g_str_equal(strValue, "1"),
- NULL);
- g_free(lowered);
- } else if (G_VALUE_HOLDS_INT(&propValue)) {
- std::string str(strValue);
- std::stringstream ss(str);
- int val = 0;
- if (!(ss >> val).fail())
- g_object_set(G_OBJECT(settings), webSettingKey, val, NULL);
- } else
- printf("LayoutTestController::overridePreference failed to override preference '%s'.\n", name);
+ // This transformation could be handled by a hash table (and it once was), but
+ // having it prominent, makes it easier for people from other ports to keep the
+ // list up to date.
+ const gchar* propertyName = 0;
+ if (g_str_equal(originalName.get(), "WebKitJavaScriptEnabled"))
+ propertyName = "enable-scripts";
+ else if (g_str_equal(originalName.get(), "WebKitDefaultFontSize"))
+ propertyName = "default-font-size";
+ else if (g_str_equal(originalName.get(), "WebKitEnableCaretBrowsing"))
+ propertyName = "enable-caret-browsing";
+ else if (g_str_equal(originalName.get(), "WebKitUsesPageCachePreferenceKey"))
+ propertyName = "enable-page-cache";
+ else if (g_str_equal(originalName.get(), "WebKitPluginsEnabled"))
+ propertyName = "enable-plugins";
+ else if (g_str_equal(originalName.get(), "WebKitHyperlinkAuditingEnabled"))
+ propertyName = "enable-hyperlink-auditing";
+ else {
+ fprintf(stderr, "LayoutTestController::overridePreference tried to override "
+ "unknown preference '%s'.\n", originalName.get());
+ return;
}
- g_free(webSettingKey);
- g_free(name);
- g_free(strValue);
+ WebKitWebSettings* settings = webkit_web_view_get_settings(view);
+ GParamSpec* pspec = g_object_class_find_property(G_OBJECT_CLASS(
+ WEBKIT_WEB_SETTINGS_GET_CLASS(settings)), propertyName);
+ GValue currentPropertyValue = { 0, { { 0 } } };
+ g_value_init(&currentPropertyValue, pspec->value_type);
+
+ if (G_VALUE_HOLDS_STRING(&currentPropertyValue))
+ g_object_set(settings, propertyName, valueAsString.get(), NULL);
+ else if (G_VALUE_HOLDS_BOOLEAN(&currentPropertyValue))
+ g_object_set(G_OBJECT(settings), propertyName, !g_ascii_strcasecmp(valueAsString.get(), "true")
+ || !g_ascii_strcasecmp(valueAsString.get(), "1"), NULL);
+ else if (G_VALUE_HOLDS_INT(&currentPropertyValue))
+ g_object_set(G_OBJECT(settings), propertyName, atoi(valueAsString.get()), NULL);
+ else if (G_VALUE_HOLDS_FLOAT(&currentPropertyValue)) {
+ gfloat newValue = g_ascii_strtod(valueAsString.get(), 0);
+ g_object_set(G_OBJECT(settings), propertyName, newValue, NULL);
+ } else
+ fprintf(stderr, "LayoutTestController::overridePreference failed to override "
+ "preference '%s'.\n", originalName.get());
}
void LayoutTestController::addUserScript(JSStringRef source, bool runAtStart, bool allFrames)
diff --git a/WebKitTools/DumpRenderTree/gtk/fonts.conf b/WebKitTools/DumpRenderTree/gtk/fonts.conf
deleted file mode 100644
index 3540c47..0000000
--- a/WebKitTools/DumpRenderTree/gtk/fonts.conf
+++ /dev/null
@@ -1,258 +0,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
-<fontconfig>
-
-<!--
- Accept deprecated 'mono' alias, replacing it with 'monospace'
--->
- <match target="pattern">
- <test qual="any" name="family">
- <string>mono</string>
- </test>
- <edit name="family" mode="assign">
- <string>monospace</string>
- </edit>
- </match>
-
-<!--
- Accept alternate 'sans serif' spelling, replacing it with 'sans-serif'
--->
- <match target="pattern">
- <test qual="any" name="family">
- <string>sans serif</string>
- </test>
- <edit name="family" mode="assign">
- <string>sans-serif</string>
- </edit>
- </match>
-
-<!--
- Accept deprecated 'sans' alias, replacing it with 'sans-serif'
--->
- <match target="pattern">
- <test qual="any" name="family">
- <string>sans</string>
- </test>
- <edit name="family" mode="assign">
- <string>sans-serif</string>
- </edit>
- </match>
-
-
- <config>
-<!--
- These are the default Unicode chars that are expected to be blank
- in fonts. All other blank chars are assumed to be broken and
- won't appear in the resulting charsets
- -->
- <blank>
- <int>0x0020</int> <!-- SPACE -->
- <int>0x00A0</int> <!-- NO-BREAK SPACE -->
- <int>0x00AD</int> <!-- SOFT HYPHEN -->
- <int>0x034F</int> <!-- COMBINING GRAPHEME JOINER -->
- <int>0x0600</int> <!-- ARABIC NUMBER SIGN -->
- <int>0x0601</int> <!-- ARABIC SIGN SANAH -->
- <int>0x0602</int> <!-- ARABIC FOOTNOTE MARKER -->
- <int>0x0603</int> <!-- ARABIC SIGN SAFHA -->
- <int>0x06DD</int> <!-- ARABIC END OF AYAH -->
- <int>0x070F</int> <!-- SYRIAC ABBREVIATION MARK -->
- <int>0x115F</int> <!-- HANGUL CHOSEONG FILLER -->
- <int>0x1160</int> <!-- HANGUL JUNGSEONG FILLER -->
- <int>0x1680</int> <!-- OGHAM SPACE MARK -->
- <int>0x17B4</int> <!-- KHMER VOWEL INHERENT AQ -->
- <int>0x17B5</int> <!-- KHMER VOWEL INHERENT AA -->
- <int>0x180E</int> <!-- MONGOLIAN VOWEL SEPARATOR -->
- <int>0x2000</int> <!-- EN QUAD -->
- <int>0x2001</int> <!-- EM QUAD -->
- <int>0x2002</int> <!-- EN SPACE -->
- <int>0x2003</int> <!-- EM SPACE -->
- <int>0x2004</int> <!-- THREE-PER-EM SPACE -->
- <int>0x2005</int> <!-- FOUR-PER-EM SPACE -->
- <int>0x2006</int> <!-- SIX-PER-EM SPACE -->
- <int>0x2007</int> <!-- FIGURE SPACE -->
- <int>0x2008</int> <!-- PUNCTUATION SPACE -->
- <int>0x2009</int> <!-- THIN SPACE -->
- <int>0x200A</int> <!-- HAIR SPACE -->
- <int>0x200B</int> <!-- ZERO WIDTH SPACE -->
- <int>0x200C</int> <!-- ZERO WIDTH NON-JOINER -->
- <int>0x200D</int> <!-- ZERO WIDTH JOINER -->
- <int>0x200E</int> <!-- LEFT-TO-RIGHT MARK -->
- <int>0x200F</int> <!-- RIGHT-TO-LEFT MARK -->
- <int>0x2028</int> <!-- LINE SEPARATOR -->
- <int>0x2029</int> <!-- PARAGRAPH SEPARATOR -->
- <int>0x202A</int> <!-- LEFT-TO-RIGHT EMBEDDING -->
- <int>0x202B</int> <!-- RIGHT-TO-LEFT EMBEDDING -->
- <int>0x202C</int> <!-- POP DIRECTIONAL FORMATTING -->
- <int>0x202D</int> <!-- LEFT-TO-RIGHT OVERRIDE -->
- <int>0x202E</int> <!-- RIGHT-TO-LEFT OVERRIDE -->
- <int>0x202F</int> <!-- NARROW NO-BREAK SPACE -->
- <int>0x205F</int> <!-- MEDIUM MATHEMATICAL SPACE -->
- <int>0x2060</int> <!-- WORD JOINER -->
- <int>0x2061</int> <!-- FUNCTION APPLICATION -->
- <int>0x2062</int> <!-- INVISIBLE TIMES -->
- <int>0x2063</int> <!-- INVISIBLE SEPARATOR -->
- <int>0x206A</int> <!-- INHIBIT SYMMETRIC SWAPPING -->
- <int>0x206B</int> <!-- ACTIVATE SYMMETRIC SWAPPING -->
- <int>0x206C</int> <!-- INHIBIT ARABIC FORM SHAPING -->
- <int>0x206D</int> <!-- ACTIVATE ARABIC FORM SHAPING -->
- <int>0x206E</int> <!-- NATIONAL DIGIT SHAPES -->
- <int>0x206F</int> <!-- NOMINAL DIGIT SHAPES -->
- <int>0x3000</int> <!-- IDEOGRAPHIC SPACE -->
- <int>0x3164</int> <!-- HANGUL FILLER -->
- <int>0xFEFF</int> <!-- ZERO WIDTH NO-BREAK SPACE -->
- <int>0xFFA0</int> <!-- HALFWIDTH HANGUL FILLER -->
- <int>0xFFF9</int> <!-- INTERLINEAR ANNOTATION ANCHOR -->
- <int>0xFFFA</int> <!-- INTERLINEAR ANNOTATION SEPARATOR -->
- <int>0xFFFB</int> <!-- INTERLINEAR ANNOTATION TERMINATOR -->
- </blank>
-<!--
- Rescan configuration every 30 seconds when FcFontSetList is called
- -->
- <rescan>
- <int>30</int>
- </rescan>
- </config>
-
-<!--
- URW provides metric and shape compatible fonts for these 10 Adobe families.
-
- However, these fonts are quite ugly and do not render well on-screen,
- so we avoid matching them if the application said `anymetrics'; in that
- case, a more generic font with different metrics but better appearance
- will be used.
- -->
- <match target="pattern">
- <test name="family">
- <string>Avant Garde</string>
- </test>
- <test name="anymetrics" qual="all" compare="not_eq">
- <bool>true</bool>
- </test>
- <edit name="family" mode="append">
- <string>URW Gothic L</string>
- </edit>
- </match>
- <match target="pattern">
- <test name="family">
- <string>Bookman</string>
- </test>
- <test name="anymetrics" qual="all" compare="not_eq">
- <bool>true</bool>
- </test>
- <edit name="family" mode="append">
- <string>URW Bookman L</string>
- </edit>
- </match>
- <match target="pattern">
- <test name="family">
- <string>Courier</string>
- </test>
- <test name="anymetrics" qual="all" compare="not_eq">
- <bool>true</bool>
- </test>
- <edit name="family" mode="append">
- <string>Nimbus Mono L</string>
- </edit>
- </match>
- <match target="pattern">
- <test name="family">
- <string>Helvetica</string>
- </test>
- <test name="anymetrics" qual="all" compare="not_eq">
- <bool>true</bool>
- </test>
- <edit name="family" mode="append">
- <string>Nimbus Sans L</string>
- </edit>
- </match>
- <match target="pattern">
- <test name="family">
- <string>New Century Schoolbook</string>
- </test>
- <test name="anymetrics" qual="all" compare="not_eq">
- <bool>true</bool>
- </test>
- <edit name="family" mode="append">
- <string>Century Schoolbook L</string>
- </edit>
- </match>
- <match target="pattern">
- <test name="family">
- <string>Palatino</string>
- </test>
- <test name="anymetrics" qual="all" compare="not_eq">
- <bool>true</bool>
- </test>
- <edit name="family" mode="append">
- <string>URW Palladio L</string>
- </edit>
- </match>
- <match target="pattern">
- <test name="family">
- <string>Times</string>
- </test>
- <test name="anymetrics" qual="all" compare="not_eq">
- <bool>true</bool>
- </test>
- <edit name="family" mode="append">
- <string>Nimbus Roman No9 L</string>
- </edit>
- </match>
- <match target="pattern">
- <test name="family">
- <string>Zapf Chancery</string>
- </test>
- <test name="anymetrics" qual="all" compare="not_eq">
- <bool>true</bool>
- </test>
- <edit name="family" mode="append">
- <string>URW Chancery L</string>
- </edit>
- </match>
- <match target="pattern">
- <test name="family">
- <string>Zapf Dingbats</string>
- </test>
- <test name="anymetrics" qual="all" compare="not_eq">
- <bool>true</bool>
- </test>
- <edit name="family" mode="append">
- <string>Dingbats</string>
- </edit>
- </match>
- <match target="pattern">
- <test name="family">
- <string>Symbol</string>
- </test>
- <test name="anymetrics" qual="all" compare="not_eq">
- <bool>true</bool>
- </test>
- <edit name="family" mode="append" binding="same">
- <string>Standard Symbols L</string>
- </edit>
- </match>
-
-<!--
- Serif faces
- -->
- <alias>
- <family>Nimbus Roman No9 L</family>
- <default><family>serif</family></default>
- </alias>
-<!--
- Sans-serif faces
- -->
- <alias>
- <family>Nimbus Sans L</family>
- <default><family>sans-serif</family></default>
- </alias>
-<!--
- Monospace faces
- -->
- <alias>
- <family>Nimbus Mono L</family>
- <default><family>monospace</family></default>
- </alias>
-
-
-</fontconfig>
diff --git a/WebKitTools/DumpRenderTree/gtk/fonts/AHEM____.TTF b/WebKitTools/DumpRenderTree/gtk/fonts/AHEM____.TTF
new file mode 100644
index 0000000..ac81cb0
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/gtk/fonts/AHEM____.TTF
Binary files differ
diff --git a/WebKitTools/DumpRenderTree/gtk/fonts/fonts.conf b/WebKitTools/DumpRenderTree/gtk/fonts/fonts.conf
new file mode 100644
index 0000000..520f96e
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/gtk/fonts/fonts.conf
@@ -0,0 +1,282 @@
+<?xml version="1.0"?>
+<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
+<fontconfig>
+
+ <!-- The sans-serif font should be Liberation Serif -->
+ <match target="pattern">
+ <test qual="any" name="family">
+ <string>serif</string>
+ </test>
+ <edit name="family" mode="assign">
+ <string>Liberation Serif</string>
+ </edit>
+ </match>
+ <match target="pattern">
+ <test qual="any" name="family">
+ <string>Times</string>
+ </test>
+ <edit name="family" mode="assign">
+ <string>Liberation Serif</string>
+ </edit>
+ </match>
+ <match target="pattern">
+ <test qual="any" name="family">
+ <string>Times New Roman</string>
+ </test>
+ <edit name="family" mode="assign">
+ <string>Liberation Serif</string>
+ </edit>
+ </match>
+
+ <!-- The sans-serif font should be Liberation Sans -->
+ <match target="pattern">
+ <test qual="any" name="family">
+ <string>sans serif</string>
+ </test>
+ <edit name="family" mode="assign">
+ <string>Liberation Sans</string>
+ </edit>
+ </match>
+ <match target="pattern">
+ <test qual="any" name="family">
+ <string>sans</string>
+ </test>
+ <edit name="family" mode="assign">
+ <string>Liberation Sans</string>
+ </edit>
+ </match>
+ <!-- We need to ensure that layout tests that use "Helvetica" don't
+ fall back to the default serif font -->
+ <match target="pattern">
+ <test qual="any" name="family">
+ <string>Helvetica</string>
+ </test>
+ <edit name="family" mode="assign">
+ <string>Liberation Sans</string>
+ </edit>
+ </match>
+
+ <!-- The Monospace font should be Liberation Mono -->
+ <match target="pattern">
+ <test qual="any" name="family">
+ <string>monospace</string>
+ </test>
+ <edit name="family" mode="assign">
+ <string>Liberation Mono</string>
+ </edit>
+ </match>
+ <match target="pattern">
+ <test qual="any" name="family">
+ <string>mono</string>
+ </test>
+ <edit name="family" mode="assign">
+ <string>Liberation Mono</string>
+ </edit>
+ </match>
+ <!-- We need to ensure that layout tests that use "Courier", "Courier New",
+ and "Monaco" (all monospace fonts) don't fall back to the default
+ serif font -->
+ <match target="pattern">
+ <test qual="any" name="family">
+ <string>Courier</string>
+ </test>
+ <edit name="family" mode="assign">
+ <string>Liberation Mono</string>
+ </edit>
+ </match>
+ <match target="pattern">
+ <test qual="any" name="family">
+ <string>Courier New</string>
+ </test>
+ <edit name="family" mode="assign">
+ <string>Liberation Mono</string>
+ </edit>
+ </match>
+ <match target="pattern">
+ <test qual="any" name="family">
+ <string>Monaco</string>
+ </test>
+ <edit name="family" mode="assign">
+ <string>Liberation Mono</string>
+ </edit>
+ </match>
+
+ <!-- The following hinting specializations are adapted from those in the
+ Chromium test_shell. We try to duplicate their incredibly thorough
+ testing here -->
+ <match target="pattern">
+ <test name="family" compare="eq">
+ <string>NonAntiAliasedSans</string>
+ </test>
+ <edit name="family" mode="assign">
+ <string>Liberation Sans</string>
+ </edit>
+ <edit name="antialias" mode="assign">
+ <bool>false</bool>
+ </edit>
+ </match>
+
+ <match target="pattern">
+ <test name="family" compare="eq">
+ <string>SlightHintedSerif</string>
+ </test>
+ <edit name="family" mode="assign">
+ <string>Liberation Serif</string>
+ </edit>
+ <edit name="hintstyle" mode="assign">
+ <const>hintslight</const>
+ </edit>
+ </match>
+
+ <match target="pattern">
+ <test name="family" compare="eq">
+ <string>NonHintedSans</string>
+ </test>
+ <edit name="family" mode="assign">
+ <string>Liberation Sans</string>
+ </edit>
+ <!-- These deliberately contradict each other. The 'hinting' preference
+ should take priority -->
+ <edit name="hintstyle" mode="assign">
+ <const>hintfull</const>
+ </edit>
+ <edit name="hinting" mode="assign">
+ <bool>false</bool>
+ </edit>
+ </match>
+
+ <match target="pattern">
+ <test name="family" compare="eq">
+ <string>AutohintedSerif</string>
+ </test>
+ <edit name="family" mode="assign">
+ <string>Liberation Serif</string>
+ </edit>
+ <edit name="autohint" mode="assign">
+ <bool>true</bool>
+ </edit>
+ <edit name="hintstyle" mode="assign">
+ <const>hintmedium</const>
+ </edit>
+ </match>
+
+ <match target="pattern">
+ <test name="family" compare="eq">
+ <string>HintedSerif</string>
+ </test>
+ <edit name="family" mode="assign">
+ <string>Liberation Serif</string>
+ </edit>
+ <edit name="autohint" mode="assign">
+ <bool>false</bool>
+ </edit>
+ <edit name="hintstyle" mode="assign">
+ <const>hintmedium</const>
+ </edit>
+ </match>
+
+ <match target="pattern">
+ <test name="family" compare="eq">
+ <string>FullAndAutoHintedSerif</string>
+ </test>
+ <edit name="family" mode="assign">
+ <string>Liberation Serif</string>
+ </edit>
+ <edit name="autohint" mode="assign">
+ <bool>true</bool>
+ </edit>
+ <edit name="hintstyle" mode="assign">
+ <const>hintfull</const>
+ </edit>
+ </match>
+
+ <match target="pattern">
+ <test name="family" compare="eq">
+ <string>SubpixelEnabledSans</string>
+ </test>
+ <edit name="family" mode="assign">
+ <string>Liberation Sans</string>
+ </edit>
+ <edit name="rgba" mode="assign">
+ <const>rgb</const>
+ </edit>
+ </match>
+
+ <match target="pattern">
+ <test name="family" compare="eq">
+ <string>SubpixelDisabledSans</string>
+ </test>
+ <edit name="family" mode="assign">
+ <string>Liberation Sans</string>
+ </edit>
+ <edit name="rgba" mode="assign">
+ <const>none</const>
+ </edit>
+ </match>
+
+ <config>
+ <!-- These are the default Unicode chars that are expected to be blank
+ in fonts. All other blank chars are assumed to be broken and won't
+ appear in the resulting charsets -->
+ <blank>
+ <int>0x0020</int> <!-- SPACE -->
+ <int>0x00A0</int> <!-- NO-BREAK SPACE -->
+ <int>0x00AD</int> <!-- SOFT HYPHEN -->
+ <int>0x034F</int> <!-- COMBINING GRAPHEME JOINER -->
+ <int>0x0600</int> <!-- ARABIC NUMBER SIGN -->
+ <int>0x0601</int> <!-- ARABIC SIGN SANAH -->
+ <int>0x0602</int> <!-- ARABIC FOOTNOTE MARKER -->
+ <int>0x0603</int> <!-- ARABIC SIGN SAFHA -->
+ <int>0x06DD</int> <!-- ARABIC END OF AYAH -->
+ <int>0x070F</int> <!-- SYRIAC ABBREVIATION MARK -->
+ <int>0x115F</int> <!-- HANGUL CHOSEONG FILLER -->
+ <int>0x1160</int> <!-- HANGUL JUNGSEONG FILLER -->
+ <int>0x1680</int> <!-- OGHAM SPACE MARK -->
+ <int>0x17B4</int> <!-- KHMER VOWEL INHERENT AQ -->
+ <int>0x17B5</int> <!-- KHMER VOWEL INHERENT AA -->
+ <int>0x180E</int> <!-- MONGOLIAN VOWEL SEPARATOR -->
+ <int>0x2000</int> <!-- EN QUAD -->
+ <int>0x2001</int> <!-- EM QUAD -->
+ <int>0x2002</int> <!-- EN SPACE -->
+ <int>0x2003</int> <!-- EM SPACE -->
+ <int>0x2004</int> <!-- THREE-PER-EM SPACE -->
+ <int>0x2005</int> <!-- FOUR-PER-EM SPACE -->
+ <int>0x2006</int> <!-- SIX-PER-EM SPACE -->
+ <int>0x2007</int> <!-- FIGURE SPACE -->
+ <int>0x2008</int> <!-- PUNCTUATION SPACE -->
+ <int>0x2009</int> <!-- THIN SPACE -->
+ <int>0x200A</int> <!-- HAIR SPACE -->
+ <int>0x200B</int> <!-- ZERO WIDTH SPACE -->
+ <int>0x200C</int> <!-- ZERO WIDTH NON-JOINER -->
+ <int>0x200D</int> <!-- ZERO WIDTH JOINER -->
+ <int>0x200E</int> <!-- LEFT-TO-RIGHT MARK -->
+ <int>0x200F</int> <!-- RIGHT-TO-LEFT MARK -->
+ <int>0x2028</int> <!-- LINE SEPARATOR -->
+ <int>0x2029</int> <!-- PARAGRAPH SEPARATOR -->
+ <int>0x202A</int> <!-- LEFT-TO-RIGHT EMBEDDING -->
+ <int>0x202B</int> <!-- RIGHT-TO-LEFT EMBEDDING -->
+ <int>0x202C</int> <!-- POP DIRECTIONAL FORMATTING -->
+ <int>0x202D</int> <!-- LEFT-TO-RIGHT OVERRIDE -->
+ <int>0x202E</int> <!-- RIGHT-TO-LEFT OVERRIDE -->
+ <int>0x202F</int> <!-- NARROW NO-BREAK SPACE -->
+ <int>0x205F</int> <!-- MEDIUM MATHEMATICAL SPACE -->
+ <int>0x2060</int> <!-- WORD JOINER -->
+ <int>0x2061</int> <!-- FUNCTION APPLICATION -->
+ <int>0x2062</int> <!-- INVISIBLE TIMES -->
+ <int>0x2063</int> <!-- INVISIBLE SEPARATOR -->
+ <int>0x206A</int> <!-- INHIBIT SYMMETRIC SWAPPING -->
+ <int>0x206B</int> <!-- ACTIVATE SYMMETRIC SWAPPING -->
+ <int>0x206C</int> <!-- INHIBIT ARABIC FORM SHAPING -->
+ <int>0x206D</int> <!-- ACTIVATE ARABIC FORM SHAPING -->
+ <int>0x206E</int> <!-- NATIONAL DIGIT SHAPES -->
+ <int>0x206F</int> <!-- NOMINAL DIGIT SHAPES -->
+ <int>0x3000</int> <!-- IDEOGRAPHIC SPACE -->
+ <int>0x3164</int> <!-- HANGUL FILLER -->
+ <int>0xFEFF</int> <!-- ZERO WIDTH NO-BREAK SPACE -->
+ <int>0xFFA0</int> <!-- HALFWIDTH HANGUL FILLER -->
+ <int>0xFFF9</int> <!-- INTERLINEAR ANNOTATION ANCHOR -->
+ <int>0xFFFA</int> <!-- INTERLINEAR ANNOTATION SEPARATOR -->
+ <int>0xFFFB</int> <!-- INTERLINEAR ANNOTATION TERMINATOR -->
+ </blank>
+ </config>
+</fontconfig>
diff --git a/WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm b/WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm
index f55093e..d2a6f79 100644
--- a/WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm
+++ b/WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm
@@ -198,6 +198,11 @@ JSValueRef LayoutTestController::computedStyleIncludingVisitedInfo(JSContextRef
return [[mainFrame webView] _computedStyleIncludingVisitedInfo:context forElement:value];
}
+JSValueRef LayoutTestController::nodesFromRect(JSContextRef context, JSValueRef value, int x, int y, unsigned top, unsigned right, unsigned bottom, unsigned left, bool ignoreClipping)
+{
+ return [[mainFrame webView] _nodesFromRect:context forDocument:value x:x y:y top:top right:right bottom:bottom left:left ignoreClipping:ignoreClipping];
+}
+
JSRetainPtr<JSStringRef> LayoutTestController::layerTreeAsText() const
{
JSRetainPtr<JSStringRef> string(Adopt, JSStringCreateWithCFString((CFStringRef)[mainFrame _layerTreeAsText]));
diff --git a/WebKitTools/DumpRenderTree/qt/DumpRenderTree.pro b/WebKitTools/DumpRenderTree/qt/DumpRenderTree.pro
index 5b81901..801251d 100644
--- a/WebKitTools/DumpRenderTree/qt/DumpRenderTree.pro
+++ b/WebKitTools/DumpRenderTree/qt/DumpRenderTree.pro
@@ -43,4 +43,9 @@ unix:!mac {
QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR
}
+wince*: {
+ INCLUDEPATH += $$QT_SOURCE_TREE/src/3rdparty/ce-compat $$WCECOMPAT/include
+ LIBS += $$WCECOMPAT/lib/wcecompat.lib
+}
+
DEFINES+=USE_SYSTEM_MALLOC
diff --git a/WebKitTools/DumpRenderTree/qt/DumpRenderTreeQt.cpp b/WebKitTools/DumpRenderTree/qt/DumpRenderTreeQt.cpp
index 4e6f049..80fa441 100644
--- a/WebKitTools/DumpRenderTree/qt/DumpRenderTreeQt.cpp
+++ b/WebKitTools/DumpRenderTree/qt/DumpRenderTreeQt.cpp
@@ -564,7 +564,10 @@ void DumpRenderTree::resetToConsistentStateBeforeTesting()
DumpRenderTreeSupportQt::setEditingBehavior(m_page, "win");
QLocale::setDefault(QLocale::c());
+
+#ifndef Q_OS_WINCE
setlocale(LC_ALL, "");
+#endif
}
static bool isGlobalHistoryTest(const QUrl& url)
diff --git a/WebKitTools/DumpRenderTree/qt/EventSenderQt.cpp b/WebKitTools/DumpRenderTree/qt/EventSenderQt.cpp
index 63dbd2a..fd7c925 100644
--- a/WebKitTools/DumpRenderTree/qt/EventSenderQt.cpp
+++ b/WebKitTools/DumpRenderTree/qt/EventSenderQt.cpp
@@ -381,7 +381,6 @@ void EventSender::scheduleAsynchronousClick()
void EventSender::addTouchPoint(int x, int y)
{
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
// Use index to refer to the position in the vector that this touch
// is stored. We then create a unique id for the touch that will be
// passed into WebCore.
@@ -391,24 +390,20 @@ void EventSender::addTouchPoint(int x, int y)
m_touchPoints.append(point);
updateTouchPoint(index, x, y);
m_touchPoints[index].setState(Qt::TouchPointPressed);
-#endif
}
void EventSender::updateTouchPoint(int index, int x, int y)
{
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
if (index < 0 || index >= m_touchPoints.count())
return;
QTouchEvent::TouchPoint &p = m_touchPoints[index];
p.setPos(QPointF(x, y));
p.setState(Qt::TouchPointMoved);
-#endif
}
void EventSender::setTouchModifier(const QString &modifier, bool enable)
{
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
Qt::KeyboardModifier mod = Qt::NoModifier;
if (!modifier.compare(QLatin1String("shift"), Qt::CaseInsensitive))
mod = Qt::ShiftModifier;
@@ -423,30 +418,24 @@ void EventSender::setTouchModifier(const QString &modifier, bool enable)
m_touchModifiers |= mod;
else
m_touchModifiers &= ~mod;
-#endif
}
void EventSender::touchStart()
{
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
if (!m_touchActive) {
sendTouchEvent(QEvent::TouchBegin);
m_touchActive = true;
} else
sendTouchEvent(QEvent::TouchUpdate);
-#endif
}
void EventSender::touchMove()
{
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
sendTouchEvent(QEvent::TouchUpdate);
-#endif
}
void EventSender::touchEnd()
{
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
for (int i = 0; i < m_touchPoints.count(); ++i)
if (m_touchPoints[i].state() != Qt::TouchPointReleased) {
sendTouchEvent(QEvent::TouchUpdate);
@@ -454,31 +443,25 @@ void EventSender::touchEnd()
}
sendTouchEvent(QEvent::TouchEnd);
m_touchActive = false;
-#endif
}
void EventSender::clearTouchPoints()
{
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
m_touchPoints.clear();
m_touchModifiers = Qt::KeyboardModifiers();
m_touchActive = false;
-#endif
}
void EventSender::releaseTouchPoint(int index)
{
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
if (index < 0 || index >= m_touchPoints.count())
return;
m_touchPoints[index].setState(Qt::TouchPointReleased);
-#endif
}
void EventSender::sendTouchEvent(QEvent::Type type)
{
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
QTouchEvent event(type, QTouchEvent::TouchScreen, m_touchModifiers);
event.setTouchPoints(m_touchPoints);
sendEvent(m_page, &event);
@@ -491,7 +474,6 @@ void EventSender::sendTouchEvent(QEvent::Type type)
++it;
}
}
-#endif
}
void EventSender::zoomPageIn()
diff --git a/WebKitTools/DumpRenderTree/qt/EventSenderQt.h b/WebKitTools/DumpRenderTree/qt/EventSenderQt.h
index a17e938..4ba8382 100644
--- a/WebKitTools/DumpRenderTree/qt/EventSenderQt.h
+++ b/WebKitTools/DumpRenderTree/qt/EventSenderQt.h
@@ -41,13 +41,11 @@
#include <QPoint>
#include <QString>
#include <QStringList>
+#include <QTouchEvent>
#include <qwebpage.h>
#include <qwebframe.h>
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
-#include <QTouchEvent>
-#endif
class EventSender : public QObject {
Q_OBJECT
@@ -107,10 +105,8 @@ private:
QEventLoop* m_eventLoop;
QWebFrame* frameUnderMouse() const;
QBasicTimer m_clickTimer;
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
QList<QTouchEvent::TouchPoint> m_touchPoints;
Qt::KeyboardModifiers m_touchModifiers;
bool m_touchActive;
-#endif
};
#endif // EventSenderQt_h
diff --git a/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp b/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp
index b2ef716..90a04c4 100644
--- a/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp
+++ b/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp
@@ -591,6 +591,8 @@ void LayoutTestController::overridePreference(const QString& name, const QVarian
settings->setAttribute(QWebSettings::PluginsEnabled, value.toBool());
else if (name == "WebKitWebGLEnabled")
settings->setAttribute(QWebSettings::WebGLEnabled, value.toBool());
+ else if (name == "WebKitHyperlinkAuditingEnabled")
+ settings->setAttribute(QWebSettings::HyperlinkAuditingEnabled, value.toBool());
else
printf("ERROR: LayoutTestController::overridePreference() does not support the '%s' preference\n",
name.toLatin1().data());
diff --git a/WebKitTools/DumpRenderTree/qt/TextInputControllerQt.cpp b/WebKitTools/DumpRenderTree/qt/TextInputControllerQt.cpp
index e0c9b61..08d8850 100644
--- a/WebKitTools/DumpRenderTree/qt/TextInputControllerQt.cpp
+++ b/WebKitTools/DumpRenderTree/qt/TextInputControllerQt.cpp
@@ -133,10 +133,8 @@ void TextInputController::doCommand(const QString& command)
void TextInputController::setMarkedText(const QString& string, int start, int end)
{
QList<QInputMethodEvent::Attribute> attributes;
-#if QT_VERSION >= 0x040600
QInputMethodEvent::Attribute selection(QInputMethodEvent::Selection, start, end, QVariant());
attributes << selection;
-#endif
QInputMethodEvent event(string, attributes);
QApplication::sendEvent(parent(), &event);
}
diff --git a/WebKitTools/DumpRenderTree/win/DumpRenderTree.vcproj b/WebKitTools/DumpRenderTree/win/DumpRenderTree.vcproj
index 1e765c6..1cba86a 100644
--- a/WebKitTools/DumpRenderTree/win/DumpRenderTree.vcproj
+++ b/WebKitTools/DumpRenderTree/win/DumpRenderTree.vcproj
@@ -242,7 +242,7 @@
>
<Tool
Name="VCPreBuildEventTool"
- CommandLine="%SystemDrive%\cygwin\bin\which.exe bash&#x0D;&#x0A;if errorlevel 1 set PATH=%SystemDrive%\cygwin\bin;%PATH%&#x0D;&#x0A;cmd /c&#x0D;&#x0A;if exist &quot;$(WebKitOutputDir)\buildfailed&quot; grep XX$(ProjectName)XX &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;if errorlevel 1 exit 1&#x0D;&#x0A;echo XX$(ProjectName)XX &gt; &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\DumpRenderTree&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\DumpRenderTree\ForwardingHeaders&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\DumpRenderTree\ForwardingHeaders\wtf&quot;&#x0D;&#x0A;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wtf\*.h&quot; &quot;$(WebKitOutputDir)\include\DumpRenderTree\ForwardingHeaders\wtf&quot;&#x0D;&#x0A;"
+ CommandLine="%SystemDrive%\cygwin\bin\which.exe bash&#x0D;&#x0A;if errorlevel 1 set PATH=%SystemDrive%\cygwin\bin;%PATH%&#x0D;&#x0A;cmd /c&#x0D;&#x0A;if exist &quot;$(WebKitOutputDir)\buildfailed&quot; grep XX$(ProjectName)XX &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;if errorlevel 1 exit 1&#x0D;&#x0A;echo XX$(ProjectName)XX &gt; &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\DumpRenderTree&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\DumpRenderTree\ForwardingHeaders&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\DumpRenderTree\ForwardingHeaders\wtf&quot;&#x0D;&#x0A;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wtf\*.h&quot; &quot;$(WebKitOutputDir)\include\DumpRenderTree\ForwardingHeaders\wtf&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(TargetDir)\..\include\WebCore\ForwardingHeaders\wtf\MD5.h&quot; &quot;$(WebKitOutputDir)\include\DumpRenderTree\ForwardingHeaders\wtf&quot;&#x0D;&#x0A;"
/>
<Tool
Name="VCCustomBuildTool"
@@ -316,7 +316,7 @@
>
<Tool
Name="VCPreBuildEventTool"
- CommandLine="%SystemDrive%\cygwin\bin\which.exe bash&#x0D;&#x0A;if errorlevel 1 set PATH=%SystemDrive%\cygwin\bin;%PATH%&#x0D;&#x0A;cmd /c&#x0D;&#x0A;if exist &quot;$(WebKitOutputDir)\buildfailed&quot; grep XX$(ProjectName)XX &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;if errorlevel 1 exit 1&#x0D;&#x0A;echo XX$(ProjectName)XX &gt; &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\DumpRenderTree&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\DumpRenderTree\ForwardingHeaders&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\DumpRenderTree\ForwardingHeaders\wtf&quot;&#x0D;&#x0A;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wtf\*.h&quot; &quot;$(WebKitOutputDir)\include\DumpRenderTree\ForwardingHeaders\wtf&quot;&#x0D;&#x0A;"
+ CommandLine="%SystemDrive%\cygwin\bin\which.exe bash&#x0D;&#x0A;if errorlevel 1 set PATH=%SystemDrive%\cygwin\bin;%PATH%&#x0D;&#x0A;cmd /c&#x0D;&#x0A;if exist &quot;$(WebKitOutputDir)\buildfailed&quot; grep XX$(ProjectName)XX &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;if errorlevel 1 exit 1&#x0D;&#x0A;echo XX$(ProjectName)XX &gt; &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\DumpRenderTree&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\DumpRenderTree\ForwardingHeaders&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\DumpRenderTree\ForwardingHeaders\wtf&quot;&#x0D;&#x0A;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wtf\*.h&quot; &quot;$(WebKitOutputDir)\include\DumpRenderTree\ForwardingHeaders\wtf&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(TargetDir)\..\include\WebCore\ForwardingHeaders\wtf\MD5.h&quot; &quot;$(WebKitOutputDir)\include\DumpRenderTree\ForwardingHeaders\wtf&quot;&#x0D;&#x0A;"
/>
<Tool
Name="VCCustomBuildTool"
@@ -566,23 +566,23 @@
</File>
</Filter>
<File
- RelativePath="..\AccessibilityUIElement.cpp"
+ RelativePath="..\AccessibilityTextMarker.cpp"
>
</File>
<File
- RelativePath="..\AccessibilityUIElement.h"
+ RelativePath="..\AccessibilityTextMarker.h"
>
</File>
<File
- RelativePath=".\AccessibilityUIElementWin.cpp"
+ RelativePath="..\AccessibilityUIElement.cpp"
>
</File>
<File
- RelativePath="..\AccessibilityTextMarker.cpp"
+ RelativePath="..\AccessibilityUIElement.h"
>
</File>
<File
- RelativePath="..\AccessibilityTextMarker.h"
+ RelativePath=".\AccessibilityUIElementWin.cpp"
>
</File>
<File
@@ -608,10 +608,42 @@
<File
RelativePath=".\MD5.cpp"
>
+ <FileConfiguration
+ Name="Debug_Cairo|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release_Cairo|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
</File>
<File
RelativePath=".\MD5.h"
>
+ <FileConfiguration
+ Name="Debug_Cairo|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release_Cairo|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ </FileConfiguration>
</File>
<File
RelativePath="..\PixelDumpSupport.cpp"
diff --git a/WebKitTools/DumpRenderTree/win/LayoutTestControllerWin.cpp b/WebKitTools/DumpRenderTree/win/LayoutTestControllerWin.cpp
index 68f4a6a..6dd609c 100644
--- a/WebKitTools/DumpRenderTree/win/LayoutTestControllerWin.cpp
+++ b/WebKitTools/DumpRenderTree/win/LayoutTestControllerWin.cpp
@@ -179,6 +179,12 @@ JSValueRef LayoutTestController::computedStyleIncludingVisitedInfo(JSContextRef
return JSValueMakeUndefined(context);
}
+JSValueRef LayoutTestController::nodesFromRect(JSContextRef context, JSValueRef value, int x, int y, unsigned top, unsigned right, unsigned bottom, unsigned left, bool ignoreClipping)
+{
+ // FIXME: Implement this.
+ return JSValueMakeUndefined(context);
+}
+
JSRetainPtr<JSStringRef> LayoutTestController::layerTreeAsText() const
{
COMPtr<IWebFramePrivate> framePrivate(Query, frame);
diff --git a/WebKitTools/DumpRenderTree/wx/LayoutTestControllerWx.cpp b/WebKitTools/DumpRenderTree/wx/LayoutTestControllerWx.cpp
index f36c290..5fba1cf 100644
--- a/WebKitTools/DumpRenderTree/wx/LayoutTestControllerWx.cpp
+++ b/WebKitTools/DumpRenderTree/wx/LayoutTestControllerWx.cpp
@@ -486,6 +486,12 @@ JSValueRef LayoutTestController::computedStyleIncludingVisitedInfo(JSContextRef,
return 0;
}
+JSValueRef LayoutTestController::nodesFromRect(JSContextRef context, JSValueRef value, int x, int y, unsigned top, unsigned right, unsigned bottom, unsigned left, bool ignoreClipping)
+{
+ // FIXME: Implement this.
+ return 0;
+}
+
void LayoutTestController::authenticateSession(JSStringRef, JSStringRef, JSStringRef)
{
}
diff --git a/WebKitTools/EWSTools/start-commit-queue.sh b/WebKitTools/EWSTools/start-commit-queue.sh
index 998300e..c55029a 100755
--- a/WebKitTools/EWSTools/start-commit-queue.sh
+++ b/WebKitTools/EWSTools/start-commit-queue.sh
@@ -30,8 +30,9 @@
cd "$HOME/Projects/CommitQueue"
while :
do
- git reset --hard
+ git reset --hard trunk
git clean -f
+ git rebase --abort
git svn rebase
./WebKitTools/Scripts/webkit-patch commit-queue --no-confirm --exit-after-iteration 10
done
diff --git a/WebKitTools/EWebLauncher/main.c b/WebKitTools/EWebLauncher/main.c
index c1956a2..8965c42 100644
--- a/WebKitTools/EWebLauncher/main.c
+++ b/WebKitTools/EWebLauncher/main.c
@@ -147,7 +147,7 @@ typedef struct _ELauncher {
static void browserDestroy(Ecore_Evas *ee);
static void closeWindow(Ecore_Evas *ee);
-static int browserCreate(const char *url, const char *theme, const char *userAgent, Eina_Rectangle geometry, const char *engine, unsigned char isFullscreen);
+static int browserCreate(const char *url, const char *theme, const char *userAgent, Eina_Rectangle geometry, const char *engine, unsigned char isFullscreen, const char *databasePath);
static void
print_history(Eina_List *list)
@@ -562,7 +562,7 @@ on_key_down(void *data, Evas *e, Evas_Object *obj, void *event_info)
info("Create new window (F9) was pressed.\n");
Eina_Rectangle geometry = {0, 0, 0, 0};
browserCreate("http://www.google.com",
- app->theme, app->userAgent, geometry, NULL, 0);
+ app->theme, app->userAgent, geometry, NULL, 0, NULL);
} else if (!strcmp(ev->key, "F10")) {
Evas_Coord x, y, w, h;
Evas_Object *frame = ewk_view_frame_main_get(obj);
@@ -605,7 +605,10 @@ quit(Eina_Bool success, const char *msg)
if (msg)
fputs(msg, (success) ? stdout : stderr);
- free(themePath);
+ if (themePath) {
+ free(themePath);
+ themePath = NULL;
+ }
if (!success)
return EXIT_FAILURE;
@@ -614,7 +617,7 @@ quit(Eina_Bool success, const char *msg)
}
static int
-browserCreate(const char *url, const char *theme, const char *userAgent, Eina_Rectangle geometry, const char *engine, unsigned char isFullscreen)
+browserCreate(const char *url, const char *theme, const char *userAgent, Eina_Rectangle geometry, const char *engine, unsigned char isFullscreen, const char *databasePath)
{
if ((geometry.w <= 0) && (geometry.h <= 0)) {
geometry.w = DEFAULT_WIDTH;
@@ -642,9 +645,6 @@ browserCreate(const char *url, const char *theme, const char *userAgent, Eina_Re
if (!app->evas)
return quit(EINA_FALSE, "ERROR: could not get evas from evas-ecore\n");
- if (!theme)
- theme = themePath;
-
app->theme = theme;
app->userAgent = userAgent;
@@ -660,6 +660,8 @@ browserCreate(const char *url, const char *theme, const char *userAgent, Eina_Re
ewk_view_theme_set(app->browser, theme);
if (userAgent)
ewk_view_setting_user_agent_set(app->browser, userAgent);
+ ewk_view_setting_local_storage_database_path_set(app->browser, databasePath);
+
evas_object_name_set(app->browser, "browser");
evas_object_smart_callback_add(app->browser, "title,changed", on_title_changed, app);
@@ -741,26 +743,25 @@ main_signal_exit(void *data, int ev_type, void *ev)
}
static char *
-findThemePath(void)
+findThemePath(const char *theme)
{
- const char **itr, *locations[] = {
- "./default.edj",
- "./WebKit/efl/DefaultTheme/default.edj",
- "../WebKit/efl/DefaultTheme/default.edj",
- DATA_DIR"/themes/default.edj",
- NULL
- };
+ const char *defaultTheme = DATA_DIR"/default.edj";
+ char *rpath;
+ struct stat st;
- for (itr = locations; *itr; itr++) {
- struct stat st;
- if (!stat(*itr, &st)) {
- char path[PATH_MAX];
- if (realpath(*itr, path))
- return strdup(path);
- }
+ if (!theme)
+ theme = defaultTheme;
+
+ rpath = realpath(theme, NULL);
+ if (!rpath)
+ return NULL;
+
+ if (stat(rpath, &st)) {
+ free(rpath);
+ return NULL;
}
- return NULL;
+ return rpath;
}
int
@@ -824,7 +825,9 @@ main(int argc, char *argv[])
if (sudoWorkaround)
strcat(getenv("HOME"), "blah");
- themePath = findThemePath();
+ themePath = findThemePath(theme);
+ if (!themePath)
+ return quit(EINA_FALSE, "ERROR: could not find theme.\n");
ewk_init();
tmp = getenv("TMPDIR");
@@ -839,7 +842,7 @@ main(int argc, char *argv[])
if (proxyUri)
ewk_settings_proxy_uri_set(proxyUri);
- browserCreate(url, theme, userAgent, geometry, engine, isFullscreen);
+ browserCreate(url, themePath, userAgent, geometry, engine, isFullscreen, path);
ecore_event_handler_add(ECORE_EVENT_SIGNAL_EXIT, main_signal_exit, &windows);
ecore_main_loop_begin();
diff --git a/WebKitTools/GNUmakefile.am b/WebKitTools/GNUmakefile.am
index 292ca7e..1599e89 100644
--- a/WebKitTools/GNUmakefile.am
+++ b/WebKitTools/GNUmakefile.am
@@ -24,7 +24,8 @@ Programs_GtkLauncher_CFLAGS = \
Programs_GtkLauncher_LDADD = \
libwebkitgtk-@WEBKITGTK_API_MAJOR_VERSION@.@WEBKITGTK_API_MINOR_VERSION@.la \
$(GTK_LIBS) \
- $(GLIB_LIBS)
+ $(GLIB_LIBS) \
+ $(WINMM_LIBS)
Programs_GtkLauncher_LDFLAGS = \
-no-fast-install \
@@ -100,7 +101,8 @@ Programs_DumpRenderTree_LDADD = \
$(GTK_LIBS) \
$(GLIB_LIBS) \
$(LIBSOUP_LIBS) \
- $(FREETYPE_LIBS)
+ $(FREETYPE_LIBS) \
+ $(WINMM_LIBS)
Programs_DumpRenderTree_LDFLAGS = \
-no-fast-install \
@@ -145,7 +147,7 @@ noinst_LTLIBRARIES += \
dumprendertree_cppflags += \
-DTEST_PLUGIN_DIR=\"${shell pwd}/${top_builddir}/TestNetscapePlugin/.libs\" \
- -DFONTS_CONF_FILE=\"${shell pwd}/${srcdir}/WebKitTools/DumpRenderTree/gtk/fonts.conf\"
+ -DFONTS_CONF_DIR=\"${shell pwd}/${srcdir}/WebKitTools/DumpRenderTree/gtk/fonts\"
TestNetscapePlugin_libtestnetscapeplugin_la_CPPFLAGS = \
-I$(srcdir)/WebKitTools/DumpRenderTree \
diff --git a/WebKitTools/MiniBrowser/Configurations/MiniBrowserCFLite.vsprops b/WebKitTools/MiniBrowser/Configurations/MiniBrowserCFLite.vsprops
new file mode 100644
index 0000000..4e1e538
--- /dev/null
+++ b/WebKitTools/MiniBrowser/Configurations/MiniBrowserCFLite.vsprops
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioPropertySheet
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="MiniBrowserCFLite"
+ >
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="shlwapi.lib WebKit$(WebKitDLLConfigSuffix).lib CFLite$(LibraryConfigSuffix).lib"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ CommandLine="mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CFNetwork$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CFNetwork$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d /e /i &quot;$(WebKitLibrariesDir)\bin\CFNetwork.resources&quot; &quot;$(WebKitOutputDir)\bin\CFNetwork.resources&quot;&#x0D;&#x0A;xcopy /y /d /e /i &quot;$(WebKitLibrariesDir)\bin\CoreFoundation.resources&quot; &quot;$(WebKitOutputDir)\bin\CoreFoundation.resources&quot;&#x0D;&#x0A;xcopy /y /d /e /i &quot;$(WebKitLibrariesDir)\bin\CharacterSets&quot; &quot;$(WebKitOutputDir)\bin\CharacterSets&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreGraphics$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreGraphics$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\dnssd.dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icudt40.dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icudt40$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\libxml2$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\libxslt$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\pthreadVC2$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\pthreadVC2$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\SQLite3$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\SQLite3$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\zlib1$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\zlib1$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\objc$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\objc$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\QuartzCore$(LibraryConfigSuffix).dll&quot; xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\QuartzCore$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\QuartzCore$(LibraryConfigSuffix).pdb&quot; xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\QuartzCore$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;&#x0D;&#x0A;if exist &quot;$(WebKitOutputDir)\buildfailed&quot; del &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;"
+ />
+</VisualStudioPropertySheet>
diff --git a/WebKitTools/MiniBrowser/Configurations/MiniBrowserCommon.vsprops b/WebKitTools/MiniBrowser/Configurations/MiniBrowserCommon.vsprops
index 0031e14..f64d6ca 100644
--- a/WebKitTools/MiniBrowser/Configurations/MiniBrowserCommon.vsprops
+++ b/WebKitTools/MiniBrowser/Configurations/MiniBrowserCommon.vsprops
@@ -10,14 +10,6 @@
UsePrecompiledHeader="2"
/>
<Tool
- Name="VCLinkerTool"
- AdditionalDependencies="shlwapi.lib WebKit$(WebKitDLLConfigSuffix).lib CoreFoundation$(LibraryConfigSuffix).lib CFNetwork$(LibraryConfigSuffix).lib"
- />
- <Tool
- Name="VCPostBuildEventTool"
- CommandLine="mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CFNetwork$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CFNetwork$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d /e /i &quot;$(WebKitLibrariesDir)\bin\CFNetwork.resources&quot; &quot;$(WebKitOutputDir)\bin\CFNetwork.resources&quot;&#x0D;&#x0A;xcopy /y /d /e /i &quot;$(WebKitLibrariesDir)\bin\CoreFoundation.resources&quot; &quot;$(WebKitOutputDir)\bin\CoreFoundation.resources&quot;&#x0D;&#x0A;xcopy /y /d /e /i &quot;$(WebKitLibrariesDir)\bin\CharacterSets&quot; &quot;$(WebKitOutputDir)\bin\CharacterSets&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreGraphics$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreGraphics$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\dnssd.dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icudt40.dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icudt40$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\libxml2$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\libxslt$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\pthreadVC2$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\pthreadVC2$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\SQLite3$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\SQLite3$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\zlib1$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\zlib1$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\objc$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\objc$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\QuartzCore$(LibraryConfigSuffix).dll&quot; xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\QuartzCore$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\QuartzCore$(LibraryConfigSuffix).pdb&quot; xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\QuartzCore$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;&#x0D;&#x0A;if exist &quot;$(WebKitOutputDir)\buildfailed&quot; del &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;"
- />
- <Tool
Name="VCPreBuildEventTool"
CommandLine="set PATH=%SystemDrive%\cygwin\bin;%PATH%&#x0D;&#x0A;&#x0D;&#x0A;if exist &quot;$(WebKitOutputDir)\buildfailed&quot; grep XX$(ProjectName)XX &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;if errorlevel 1 exit 1&#x0D;&#x0A;echo XX$(ProjectName)XX &gt; &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;"
/>
diff --git a/WebKitTools/MiniBrowser/Configurations/MiniBrowserCoreFoundation.vsprops b/WebKitTools/MiniBrowser/Configurations/MiniBrowserCoreFoundation.vsprops
new file mode 100644
index 0000000..a34efd2
--- /dev/null
+++ b/WebKitTools/MiniBrowser/Configurations/MiniBrowserCoreFoundation.vsprops
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioPropertySheet
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="MiniBrowserCoreFoundation"
+ >
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="shlwapi.lib WebKit$(WebKitDLLConfigSuffix).lib CoreFoundation$(LibraryConfigSuffix).lib CFNetwork$(LibraryConfigSuffix).lib"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ CommandLine="mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CFNetwork$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CFNetwork$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d /e /i &quot;$(WebKitLibrariesDir)\bin\CFNetwork.resources&quot; &quot;$(WebKitOutputDir)\bin\CFNetwork.resources&quot;&#x0D;&#x0A;xcopy /y /d /e /i &quot;$(WebKitLibrariesDir)\bin\CoreFoundation.resources&quot; &quot;$(WebKitOutputDir)\bin\CoreFoundation.resources&quot;&#x0D;&#x0A;xcopy /y /d /e /i &quot;$(WebKitLibrariesDir)\bin\CharacterSets&quot; &quot;$(WebKitOutputDir)\bin\CharacterSets&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreGraphics$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreGraphics$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\dnssd.dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icudt40.dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icudt40$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\libxml2$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\libxslt$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\pthreadVC2$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\pthreadVC2$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\SQLite3$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\SQLite3$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\zlib1$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\zlib1$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\objc$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\objc$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\QuartzCore$(LibraryConfigSuffix).dll&quot; xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\QuartzCore$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\QuartzCore$(LibraryConfigSuffix).pdb&quot; xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\QuartzCore$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;&#x0D;&#x0A;if exist &quot;$(WebKitOutputDir)\buildfailed&quot; del &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;"
+ />
+</VisualStudioPropertySheet>
diff --git a/WebKitTools/MiniBrowser/MiniBrowser.vcproj b/WebKitTools/MiniBrowser/MiniBrowser.vcproj
index 3ae3f60..7af24ec 100644
--- a/WebKitTools/MiniBrowser/MiniBrowser.vcproj
+++ b/WebKitTools/MiniBrowser/MiniBrowser.vcproj
@@ -18,7 +18,7 @@
<Configuration
Name="Debug|Win32"
ConfigurationType="1"
- InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug.vsprops;.\Configurations\MiniBrowserCommon.vsprops"
+ InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug.vsprops;.\Configurations\MiniBrowserCoreFoundation.vsprops;.\Configurations\MiniBrowserCommon.vsprops"
UseOfATL="1"
CharacterSet="1"
>
@@ -80,7 +80,7 @@
<Configuration
Name="Release|Win32"
ConfigurationType="1"
- InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\release.vsprops;.\Configurations\MiniBrowserCommon.vsprops"
+ InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\release.vsprops;.\Configurations\MiniBrowserCoreFoundation.vsprops;.\Configurations\MiniBrowserCommon.vsprops"
UseOfATL="1"
CharacterSet="1"
WholeProgramOptimization="1"
@@ -143,7 +143,7 @@
<Configuration
Name="Debug_Internal|Win32"
ConfigurationType="1"
- InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug_internal.vsprops;.\Configurations\MiniBrowserCommon.vsprops"
+ InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug_internal.vsprops;.\Configurations\MiniBrowserCoreFoundation.vsprops;.\Configurations\MiniBrowserCommon.vsprops"
UseOfATL="1"
CharacterSet="1"
>
@@ -205,7 +205,7 @@
<Configuration
Name="Debug_All|Win32"
ConfigurationType="1"
- InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug_internal.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug_all.vsprops;.\Configurations\MiniBrowserCommon.vsprops"
+ InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug_internal.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug_all.vsprops;.\Configurations\MiniBrowserCoreFoundation.vsprops;.\Configurations\MiniBrowserCommon.vsprops"
UseOfATL="1"
CharacterSet="1"
>
@@ -264,6 +264,135 @@
Name="VCPostBuildEventTool"
/>
</Configuration>
+ <Configuration
+ Name="Debug_CFLite|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug_wincairo.vsprops;.\Configurations\MiniBrowserCFLite.vsprops;.\Configurations\MiniBrowserCommon.vsprops"
+ UseOfATL="1"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release_CFLite|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\release.vsprops;.\Configurations\MiniBrowserCFLite.vsprops;.\Configurations\MiniBrowserCommon.vsprops"
+ UseOfATL="1"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
</Configurations>
<References>
</References>
@@ -324,6 +453,22 @@
UsePrecompiledHeader="1"
/>
</FileConfiguration>
+ <FileConfiguration
+ Name="Debug_CFLite|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="1"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release_CFLite|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="1"
+ />
+ </FileConfiguration>
</File>
</Filter>
<Filter
diff --git a/WebKitTools/MiniBrowser/mac/BrowserWindowController.m b/WebKitTools/MiniBrowser/mac/BrowserWindowController.m
index 9398e56..cb4c56a 100644
--- a/WebKitTools/MiniBrowser/mac/BrowserWindowController.m
+++ b/WebKitTools/MiniBrowser/mac/BrowserWindowController.m
@@ -300,6 +300,11 @@ static void didFirstVisuallyNonEmptyLayoutForFrame(WKPageRef page, WKFrameRef fr
LOG(@"didFirstVisuallyNonEmptyLayoutForFrame");
}
+static void didRemoveFrameFromHierarchy(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void *clientInfo)
+{
+ LOG(@"didRemoveFrameFromHierarchy");
+}
+
static void didStartProgress(WKPageRef page, const void *clientInfo)
{
[(BrowserWindowController *)clientInfo didStartProgress];
@@ -469,6 +474,11 @@ static void setStatusText(WKPageRef page, WKStringRef text, const void* clientIn
LOG(@"setStatusText");
}
+static void mouseDidMoveOverElement(WKPageRef page, WKEventModifiers modifiers, WKTypeRef userData, const void *clientInfo)
+{
+ LOG(@"mouseDidMoveOverElement");
+}
+
static void contentsSizeChanged(WKPageRef page, int width, int height, WKFrameRef frame, const void *clientInfo)
{
LOG(@"contentsSizeChanged");
@@ -496,6 +506,7 @@ static void contentsSizeChanged(WKPageRef page, int width, int height, WKFrameRe
didReceiveTitleForFrame,
didFirstLayoutForFrame,
didFirstVisuallyNonEmptyLayoutForFrame,
+ didRemoveFrameFromHierarchy,
didStartProgress,
didChangeProgress,
didFinishProgress,
@@ -525,7 +536,9 @@ static void contentsSizeChanged(WKPageRef page, int width, int height, WKFrameRe
runJavaScriptConfirm,
runJavaScriptPrompt,
setStatusText,
- contentsSizeChanged
+ mouseDidMoveOverElement,
+ contentsSizeChanged,
+ 0 /* didNotHandleKeyEvent */
};
WKPageSetPageUIClient(_webView.pageRef, &uiClient);
}
diff --git a/WebKitTools/MiniBrowser/mac/MiniBrowser_Prefix.pch b/WebKitTools/MiniBrowser/mac/MiniBrowser_Prefix.pch
index 0670cf4..a4e648e 100644
--- a/WebKitTools/MiniBrowser/mac/MiniBrowser_Prefix.pch
+++ b/WebKitTools/MiniBrowser/mac/MiniBrowser_Prefix.pch
@@ -29,7 +29,7 @@
#import <WebKit2/WebKit2.h>
-#define ENABLE_LOGGING 1
+#define ENABLE_LOGGING 0
#if ENABLE_LOGGING
#define LOG NSLog
diff --git a/WebKitTools/MiniBrowser/win/BrowserView.cpp b/WebKitTools/MiniBrowser/win/BrowserView.cpp
index 5e90fe2..76848fa 100644
--- a/WebKitTools/MiniBrowser/win/BrowserView.cpp
+++ b/WebKitTools/MiniBrowser/win/BrowserView.cpp
@@ -74,6 +74,10 @@ static void setStatusText(WKPageRef page, WKStringRef text, const void* clientIn
{
}
+static void mouseDidMoveOverElement(WKPageRef page, WKEventModifiers modifiers, WKTypeRef userData, const void *clientInfo)
+{
+}
+
static void contentsSizeChanged(WKPageRef page, int width, int height, WKFrameRef frame, const void *clientInfo)
{
}
@@ -104,7 +108,9 @@ void BrowserView::create(RECT webViewRect, BrowserWindow* parentWindow)
runJavaScriptConfirm,
runJavaScriptPrompt,
setStatusText,
- contentsSizeChanged
+ mouseDidMoveOverElement,
+ contentsSizeChanged,
+ 0 /* didNotHandleKeyEvent */
};
WKPageSetPageUIClient(WKViewGetPage(m_webView), &uiClient);
diff --git a/WebKitTools/QtTestBrowser/launcherwindow.cpp b/WebKitTools/QtTestBrowser/launcherwindow.cpp
index 65bcee7..df29f11 100644
--- a/WebKitTools/QtTestBrowser/launcherwindow.cpp
+++ b/WebKitTools/QtTestBrowser/launcherwindow.cpp
@@ -41,9 +41,7 @@ LauncherWindow::LauncherWindow(WindowOptions* data, QGraphicsScene* sharedScene)
, m_view(0)
, m_inspector(0)
, m_formatMenuAction(0)
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
, m_zoomAnimation(0)
-#endif
{
if (data)
m_windowOptions = *data;
@@ -91,6 +89,9 @@ void LauncherWindow::init()
m_inspector->hide();
connect(this, SIGNAL(destroyed()), m_inspector, SLOT(deleteLater()));
+ if (m_windowOptions.remoteInspectorPort)
+ page()->setProperty("_q_webInspectorServerPort", m_windowOptions.remoteInspectorPort);
+
// the zoom values are chosen to be like in Mozilla Firefox 3
if (!m_zoomLevels.count()) {
m_zoomLevels << 30 << 50 << 67 << 80 << 90;
@@ -134,9 +135,7 @@ void LauncherWindow::initializeView()
if (url.isValid())
page()->mainFrame()->load(url);
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
m_touchMocking = false;
-#endif
}
void LauncherWindow::applyPrefs()
@@ -240,11 +239,9 @@ void LauncherWindow::createChrome()
toggleFrameFlattening->setCheckable(true);
toggleFrameFlattening->setChecked(settings->testAttribute(QWebSettings::FrameFlatteningEnabled));
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
QAction* touchMockAction = toolsMenu->addAction("Toggle touch mocking", this, SLOT(setTouchMocking(bool)));
touchMockAction->setCheckable(true);
touchMockAction->setShortcut(QKeySequence(Qt::CTRL | Qt::ALT | Qt::Key_T));
-#endif
toolsMenu->addSeparator();
@@ -406,7 +403,6 @@ void LauncherWindow::grabZoomKeys(bool grab)
#endif
}
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
void LauncherWindow::sendTouchEvent()
{
if (m_touchPoints.isEmpty())
@@ -430,7 +426,6 @@ void LauncherWindow::sendTouchEvent()
if (m_touchPoints.size() > 1 && m_touchPoints[1].state() == Qt::TouchPointReleased)
m_touchPoints.removeAt(1);
}
-#endif // QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
bool LauncherWindow::eventFilter(QObject* obj, QEvent* event)
{
@@ -446,7 +441,6 @@ bool LauncherWindow::eventFilter(QObject* obj, QEvent* event)
}
}
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
if (!m_touchMocking)
return QObject::eventFilter(obj, event);
@@ -508,7 +502,6 @@ bool LauncherWindow::eventFilter(QObject* obj, QEvent* event)
m_touchPoints.last().setState(Qt::TouchPointStationary);
}
}
-#endif // QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
return false;
}
@@ -546,7 +539,6 @@ void LauncherWindow::zoomAnimationFinished()
void LauncherWindow::applyZoom()
{
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
if (isGraphicsBased() && page()->settings()->testAttribute(QWebSettings::TiledBackingStoreEnabled)) {
QGraphicsWebView* view = static_cast<WebViewGraphicsBased*>(m_view)->graphicsWebView();
view->setTiledBackingStoreFrozen(true);
@@ -564,7 +556,6 @@ void LauncherWindow::applyZoom()
m_zoomAnimation->start();
return;
}
-#endif
page()->mainFrame()->setZoomFactor(qreal(m_currentZoom) / 100.0);
}
@@ -674,9 +665,7 @@ void LauncherWindow::selectElements()
void LauncherWindow::setTouchMocking(bool on)
{
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
m_touchMocking = on;
-#endif
}
void LauncherWindow::toggleWebView(bool graphicsBased)
diff --git a/WebKitTools/QtTestBrowser/launcherwindow.h b/WebKitTools/QtTestBrowser/launcherwindow.h
index d3b7f8e..84dedaa 100644
--- a/WebKitTools/QtTestBrowser/launcherwindow.h
+++ b/WebKitTools/QtTestBrowser/launcherwindow.h
@@ -110,6 +110,7 @@ public:
bool useQGLWidgetViewport;
#endif
QUrl inspectorUrl;
+ quint16 remoteInspectorPort;
};
class LauncherWindow : public MainWindow {
@@ -122,9 +123,7 @@ public:
virtual void keyPressEvent(QKeyEvent* event);
void grabZoomKeys(bool grab);
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
void sendTouchEvent();
-#endif
bool eventFilter(QObject* obj, QEvent* event);
@@ -199,11 +198,9 @@ private:
QAction* m_formatMenuAction;
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
QPropertyAnimation* m_zoomAnimation;
QList<QTouchEvent::TouchPoint> m_touchPoints;
bool m_touchMocking;
-#endif
};
#endif
diff --git a/WebKitTools/QtTestBrowser/main.cpp b/WebKitTools/QtTestBrowser/main.cpp
index ec864e9..41471fa 100644
--- a/WebKitTools/QtTestBrowser/main.cpp
+++ b/WebKitTools/QtTestBrowser/main.cpp
@@ -54,6 +54,8 @@ public:
LauncherApplication(int& argc, char** argv);
QStringList urls() const { return m_urls; }
bool isRobotized() const { return m_isRobotized; }
+ int robotTimeout() const { return m_robotTimeoutSeconds; }
+ int robotExtraTime() const { return m_robotExtraTimeSeconds; }
private:
void handleUserOptions();
@@ -61,6 +63,8 @@ private:
private:
bool m_isRobotized;
+ int m_robotTimeoutSeconds;
+ int m_robotExtraTimeSeconds;
QStringList m_urls;
};
@@ -78,6 +82,8 @@ void LauncherApplication::applyDefaultSettings()
LauncherApplication::LauncherApplication(int& argc, char** argv)
: QApplication(argc, argv, QApplication::GuiServer)
, m_isRobotized(false)
+ , m_robotTimeoutSeconds(0)
+ , m_robotExtraTimeSeconds(0)
{
// To allow QWebInspector's configuration persistence
setOrganizationName("Nokia");
@@ -115,6 +121,8 @@ void LauncherApplication::handleUserOptions()
<< "[-cache-webview]"
<< "[-show-fps]"
<< "[-r list]"
+ << "[-robot-timeout seconds]"
+ << "[-robot-extra-time seconds]"
<< "[-inspector-url location]"
<< "[-tiled-backing-store]"
<< "[-resizes-to-contents]"
@@ -180,6 +188,11 @@ void LauncherApplication::handleUserOptions()
if (inspectorUrlIndex != -1)
windowOptions.inspectorUrl = takeOptionValue(&args, inspectorUrlIndex);
+ QString remoteInspectorPortArg("-remote-inspector-port");
+ int remoteInspectorPortIndex = args.indexOf(remoteInspectorPortArg);
+ if (remoteInspectorPortIndex != -1)
+ windowOptions.remoteInspectorPort = takeOptionValue(&args, remoteInspectorPortIndex).toInt();
+
int robotIndex = args.indexOf("-r");
if (robotIndex != -1) {
QString listFile = takeOptionValue(&args, robotIndex);
@@ -190,11 +203,18 @@ void LauncherApplication::handleUserOptions()
m_isRobotized = true;
m_urls = QStringList(listFile);
- return;
+ } else {
+ int lastArg = args.lastIndexOf(QRegExp("^-.*"));
+ m_urls = (lastArg != -1) ? args.mid(++lastArg) : args.mid(1);
}
- int lastArg = args.lastIndexOf(QRegExp("^-.*"));
- m_urls = (lastArg != -1) ? args.mid(++lastArg) : args.mid(1);
+ int robotTimeoutIndex = args.indexOf("-robot-timeout");
+ if (robotTimeoutIndex != -1)
+ m_robotTimeoutSeconds = takeOptionValue(&args, robotTimeoutIndex).toInt();
+
+ int robotExtraTimeIndex = args.indexOf("-robot-extra-time");
+ if (robotExtraTimeIndex != -1)
+ m_robotExtraTimeSeconds = takeOptionValue(&args, robotExtraTimeIndex).toInt();
}
@@ -204,8 +224,7 @@ int main(int argc, char **argv)
if (app.isRobotized()) {
LauncherWindow* window = new LauncherWindow();
- UrlLoader loader(window->page()->mainFrame(), app.urls().at(0));
- QObject::connect(window->page()->mainFrame(), SIGNAL(loadFinished(bool)), &loader, SLOT(loadNext()));
+ UrlLoader loader(window->page()->mainFrame(), app.urls().at(0), app.robotTimeout(), app.robotExtraTime());
loader.loadNext();
window->show();
return launcherMain(app);
@@ -214,9 +233,9 @@ int main(int argc, char **argv)
QStringList urls = app.urls();
if (urls.isEmpty()) {
- QString defaultUrl = QString("file://%1/%2").arg(QDir::homePath()).arg(QLatin1String("index.html"));
- if (QDir(defaultUrl).exists())
- urls.append(defaultUrl);
+ QString defaultIndexFile = QString("%1/%2").arg(QDir::homePath()).arg(QLatin1String("index.html"));
+ if (QFile(defaultIndexFile).exists())
+ urls.append(QString("file://") + defaultIndexFile);
else
urls.append("");
}
diff --git a/WebKitTools/QtTestBrowser/urlloader.cpp b/WebKitTools/QtTestBrowser/urlloader.cpp
index 630ead6..abe9902 100644
--- a/WebKitTools/QtTestBrowser/urlloader.cpp
+++ b/WebKitTools/QtTestBrowser/urlloader.cpp
@@ -31,16 +31,31 @@
#include <QFile>
#include <QDebug>
-UrlLoader::UrlLoader(QWebFrame* frame, const QString& inputFileName)
+UrlLoader::UrlLoader(QWebFrame* frame, const QString& inputFileName, int timeoutSeconds, int extraTimeSeconds)
: m_frame(frame)
, m_stdOut(stdout)
, m_loaded(0)
{
- init(inputFileName);
+ if (timeoutSeconds) {
+ m_timeoutTimer.setInterval(timeoutSeconds * 1000);
+ m_timeoutTimer.setSingleShot(true);
+ connect(frame, SIGNAL(loadStarted()), &m_timeoutTimer, SLOT(start()));
+ connect(&m_timeoutTimer, SIGNAL(timeout()), this, SLOT(loadNext()));
+ }
+ if (extraTimeSeconds) {
+ m_extraTimeTimer.setInterval(extraTimeSeconds * 1000);
+ m_extraTimeTimer.setSingleShot(true);
+ connect(frame, SIGNAL(loadFinished(bool)), &m_extraTimeTimer, SLOT(start()));
+ connect(&m_extraTimeTimer, SIGNAL(timeout()), this, SLOT(loadNext()));
+ } else
+ connect(frame, SIGNAL(loadFinished(bool)), this, SLOT(loadNext()));
+ loadUrlList(inputFileName);
}
void UrlLoader::loadNext()
{
+ m_timeoutTimer.stop();
+ m_extraTimeTimer.stop();
QString qstr;
if (getUrl(qstr)) {
QUrl url(qstr, QUrl::StrictMode);
@@ -53,7 +68,7 @@ void UrlLoader::loadNext()
disconnect(m_frame, 0, this, 0);
}
-void UrlLoader::init(const QString& inputFileName)
+void UrlLoader::loadUrlList(const QString& inputFileName)
{
QFile inputFile(inputFileName);
if (inputFile.open(QIODevice::ReadOnly | QIODevice::Text)) {
diff --git a/WebKitTools/QtTestBrowser/urlloader.h b/WebKitTools/QtTestBrowser/urlloader.h
index ed14adc..e2a6d87 100644
--- a/WebKitTools/QtTestBrowser/urlloader.h
+++ b/WebKitTools/QtTestBrowser/urlloader.h
@@ -32,19 +32,20 @@
#include "qwebframe.h"
#include <QTextStream>
+#include <QTimer>
#include <QVector>
class UrlLoader : public QObject {
Q_OBJECT
public:
- UrlLoader(QWebFrame* frame, const QString& inputFileName);
+ UrlLoader(QWebFrame* frame, const QString& inputFileName, int timeoutSeconds, int extraTimeSeconds);
public slots:
void loadNext();
private:
- void init(const QString& inputFileName);
+ void loadUrlList(const QString& inputFileName);
bool getUrl(QString& qstr);
private:
@@ -53,6 +54,8 @@ private:
QWebFrame* m_frame;
QTextStream m_stdOut;
int m_loaded;
+ QTimer m_timeoutTimer;
+ QTimer m_extraTimeTimer;
};
#endif
diff --git a/WebKitTools/QtTestBrowser/utils.cpp b/WebKitTools/QtTestBrowser/utils.cpp
index 2d45dd0..567c989 100644
--- a/WebKitTools/QtTestBrowser/utils.cpp
+++ b/WebKitTools/QtTestBrowser/utils.cpp
@@ -82,11 +82,7 @@ QUrl urlFromUserInput(const QString& string)
if (fi.exists() && fi.isRelative())
input = fi.absoluteFilePath();
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
return QUrl::fromUserInput(input);
-#else
- return QUrl(input);
-#endif
}
diff --git a/WebKitTools/QtTestBrowser/webview.cpp b/WebKitTools/QtTestBrowser/webview.cpp
index d8d89a9..242daf6 100644
--- a/WebKitTools/QtTestBrowser/webview.cpp
+++ b/WebKitTools/QtTestBrowser/webview.cpp
@@ -151,7 +151,6 @@ void WebViewGraphicsBased::updateFrameRate()
void WebViewGraphicsBased::animatedFlip()
{
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
QSizeF center = graphicsWebView()->boundingRect().size() / 2;
QPointF centerPoint = QPointF(center.width(), center.height());
graphicsWebView()->setTransformOriginPoint(centerPoint);
@@ -165,12 +164,10 @@ void WebViewGraphicsBased::animatedFlip()
animation->setEndValue(rotation + 180 - (rotation % 180));
animation->start(QAbstractAnimation::DeleteWhenStopped);
-#endif
}
void WebViewGraphicsBased::animatedYFlip()
{
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
if (!m_machine) {
m_machine = new QStateMachine(this);
@@ -202,7 +199,6 @@ void WebViewGraphicsBased::animatedYFlip()
}
m_machine->start();
-#endif
}
void WebViewGraphicsBased::paintEvent(QPaintEvent* event)
diff --git a/WebKitTools/QtTestBrowser/webview.h b/WebKitTools/QtTestBrowser/webview.h
index aadf85c..e34d081 100644
--- a/WebKitTools/QtTestBrowser/webview.h
+++ b/WebKitTools/QtTestBrowser/webview.h
@@ -117,13 +117,11 @@ private:
inline void WebViewGraphicsBased::setYRotation(qreal angle)
{
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
QRectF r = graphicsWebView()->boundingRect();
graphicsWebView()->setTransform(QTransform()
.translate(r.width() / 2, r.height() / 2)
.rotate(angle, Qt::YAxis)
.translate(-r.width() / 2, -r.height() / 2));
-#endif
m_yRotation = angle;
}
diff --git a/WebKitTools/QueueStatusServer/handlers/queuestatus.py b/WebKitTools/QueueStatusServer/handlers/queuestatus.py
index f76157d..0259c37 100644
--- a/WebKitTools/QueueStatusServer/handlers/queuestatus.py
+++ b/WebKitTools/QueueStatusServer/handlers/queuestatus.py
@@ -31,24 +31,27 @@ from google.appengine.ext.webapp import template
from model.queues import queues, display_name_for_queue
from model.workitems import WorkItems
+from model.activeworkitems import ActiveWorkItems
from model import queuestatus
class QueueStatus(webapp.RequestHandler):
- def _rows_for_work_items(self, work_items):
- if not work_items:
+ def _rows_for_work_items(self, queued_items, active_items):
+ if not queued_items:
return []
rows = []
- for item_id in work_items.item_ids:
+ for item_id in queued_items.item_ids:
rows.append({
"attachment_id": item_id,
"bug_id": 1,
+ "lock_time": active_items and active_items.time_for_item(item_id),
})
return rows
def get(self, queue_name):
- work_items = WorkItems.all().filter("queue_name =", queue_name).get()
+ queued_items = WorkItems.all().filter("queue_name =", queue_name).get()
+ active_items = ActiveWorkItems.all().filter("queue_name =", queue_name).get()
statuses = queuestatus.QueueStatus.all().filter("queue_name =", queue_name).order("-date").fetch(15)
status_groups = []
@@ -67,7 +70,7 @@ class QueueStatus(webapp.RequestHandler):
template_values = {
"display_queue_name": display_name_for_queue(queue_name),
- "work_item_rows": self._rows_for_work_items(work_items),
+ "work_item_rows": self._rows_for_work_items(queued_items, active_items),
"status_groups": status_groups,
}
self.response.out.write(template.render("templates/queuestatus.html", template_values))
diff --git a/WebKitTools/QueueStatusServer/handlers/updatestatus.py b/WebKitTools/QueueStatusServer/handlers/updatestatus.py
index 5a93dbd..89858b6 100644
--- a/WebKitTools/QueueStatusServer/handlers/updatestatus.py
+++ b/WebKitTools/QueueStatusServer/handlers/updatestatus.py
@@ -31,6 +31,7 @@ from google.appengine.ext import webapp, db
from google.appengine.ext.webapp import template
from handlers.updatebase import UpdateBase
+from model.activeworkitems import ActiveWorkItems
from model.attachment import Attachment
from model.queuestatus import QueueStatus
@@ -56,8 +57,24 @@ class UpdateStatus(UpdateBase):
queue_status.results_file = db.Blob(str(results_file))
return queue_status
+ @staticmethod
+ def _expire_item(key, item_id):
+ active_work_items = db.get(key)
+ active_work_items.expire_item(item_id)
+ active_work_items.put()
+
+ # FIXME: An explicit lock_release request would be cleaner than this magical "Retry" status.
+ def _update_active_work_items(self, queue_status):
+ if queue_status.message != "Retry": # From AbstractQueue._retry_status
+ return
+ active_items = ActiveWorkItems.all().filter("queue_name =", queue_status.queue_name).get()
+ if not active_items:
+ return
+ return db.run_in_transaction(self._expire_item, active_items.key(), queue_status.active_patch_id)
+
def post(self):
queue_status = self._queue_status_from_request()
queue_status.put()
+ self._update_active_work_items(queue_status)
Attachment.dirty(queue_status.active_patch_id)
self.response.out.write(queue_status.key().id())
diff --git a/WebKitTools/QueueStatusServer/model/activeworkitems.py b/WebKitTools/QueueStatusServer/model/activeworkitems.py
index e24e6ca..a244c7d 100644
--- a/WebKitTools/QueueStatusServer/model/activeworkitems.py
+++ b/WebKitTools/QueueStatusServer/model/activeworkitems.py
@@ -28,7 +28,7 @@
from google.appengine.ext import db
-from datetime import timedelta
+from datetime import timedelta, datetime
import time
@@ -38,21 +38,41 @@ class ActiveWorkItems(db.Model):
item_dates = db.ListProperty(float)
date = db.DateTimeProperty(auto_now_add=True)
+ # The id/date pairs should probably just be their own class.
+ def _item_time_pairs(self):
+ return zip(self.item_ids, self.item_dates)
+
+ def _set_item_time_pairs(self, pairs):
+ if pairs:
+ # The * operator raises on an empty list.
+ # db.Model does not tuples, we have to make lists.
+ self.item_ids, self.item_dates = map(list, zip(*pairs))
+ else:
+ self.item_ids = []
+ self.item_dates = []
+
+ def _append_item_time_pair(self, pair):
+ self.item_ids.append(pair[0])
+ self.item_dates.append(pair[1])
+
+ def expire_item(self, item_id):
+ nonexpired_pairs = [pair for pair in self._item_time_pairs() if pair[0] != item_id]
+ self._set_item_time_pairs(nonexpired_pairs)
+
def deactivate_expired(self, now):
one_hour_ago = time.mktime((now - timedelta(minutes=60)).timetuple())
- nonexpired_item_ids = []
- nonexpired_item_dates = []
- for i in range(len(self.item_ids)):
- if self.item_dates[i] > one_hour_ago:
- nonexpired_item_ids.append(self.item_ids[i])
- nonexpired_item_dates.append(self.item_dates[i])
- self.item_ids = nonexpired_item_ids
- self.item_dates = nonexpired_item_dates
+ nonexpired_pairs = [pair for pair in self._item_time_pairs() if pair[1] > one_hour_ago]
+ self._set_item_time_pairs(nonexpired_pairs)
def next_item(self, work_item_ids, now):
for item_id in work_item_ids:
if item_id not in self.item_ids:
- self.item_ids.append(item_id)
- self.item_dates.append(time.mktime(now.timetuple()))
+ self._append_item_time_pair([item_id, time.mktime(now.timetuple())])
return item_id
return None
+
+ def time_for_item(self, item_id):
+ for active_item_id, time in self._item_time_pairs():
+ if active_item_id == item_id:
+ return datetime.fromtimestamp(time)
+ return None
diff --git a/WebKitTools/QueueStatusServer/templates/queuestatus.html b/WebKitTools/QueueStatusServer/templates/queuestatus.html
index d2d72c7..1b98952 100644
--- a/WebKitTools/QueueStatusServer/templates/queuestatus.html
+++ b/WebKitTools/QueueStatusServer/templates/queuestatus.html
@@ -42,13 +42,18 @@
<h3>Patches in queue</h3>
<table>
- <tr><th>Position</th><th>Patch</th></tr>
+ <tr><th>Position</th><th>Patch</th><th>Lock Acquired</th></tr>
{% for row in work_item_rows %}
<tr>
<td>#{{ forloop.counter }}</td>
<td>
{{ row.attachment_id|force_escape|webkit_attachment_id|safe }}
</td>
+ <td>
+ {% if row.lock_time %}
+ {{ row.lock_time|timesince }} ago
+ {% endif %}
+ </td>
</tr>
{% endfor %}
</table>
diff --git a/WebKitTools/Scripts/build-webkit b/WebKitTools/Scripts/build-webkit
index cd43499..bc1e8ad 100755
--- a/WebKitTools/Scripts/build-webkit
+++ b/WebKitTools/Scripts/build-webkit
@@ -106,7 +106,7 @@ my @features = (
define => "ENABLE_EVENTSOURCE", default => 1, value => \$eventsourceSupport },
{ option => "filters", desc => "Toggle Filters support",
- define => "ENABLE_FILTERS", default => (isAppleWebKit() || isGtk() || isQt()), value => \$filtersSupport },
+ define => "ENABLE_FILTERS", default => (isAppleWebKit() || isGtk() || isQt() || isEfl()), value => \$filtersSupport },
{ option => "geolocation", desc => "Toggle Geolocation support",
define => "ENABLE_GEOLOCATION", default => (isAppleWebKit() || isGtk()), value => \$geolocationSupport },
@@ -245,13 +245,14 @@ Usage: $programName [options] [options to pass to build system]
--chromium Build the Chromium port on Mac/Win/Linux
--gtk Build the GTK+ port
--qt Build the Qt port
+ --efl Build the EFL port
--inspector-frontend Copy changes to the inspector front-end files to the build directory
--install-headers=<path> Set installation path for the headers (Qt only)
--install-libs=<path> Set installation path for the libraries (Qt only)
--v8 Use V8 as JavaScript engine (Qt only)
- --prefix=<path> Set installation prefix to the given path (Gtk only)
+ --prefix=<path> Set installation prefix to the given path (Gtk/Efl only)
--makeargs=<arguments> Optional Makefile flags
--minimal No optional features, unless explicitly enabled.
@@ -428,6 +429,22 @@ if (isChromium()) {
exit exitStatus($result) if exitStatus($result);
}
+if (isEfl()) {
+ @options = ();
+ @projects = ();
+ foreach (@features) {
+ my $featureName = $_->{define};
+ if ($featureName) {
+ my $featureEnabled = ${$_->{value}} ? "ON" : "OFF";
+ push @options, "-D$featureName=$featureEnabled";
+ }
+ }
+ push @options, "--makeargs=" . $makeArgs if defined($makeArgs);
+ push @options, "--prefix=" . $prefixPath if defined($prefixPath);
+ my $result = buildCMakeEflProject($clean, @options);
+ exit exitStatus($result) if exitStatus($result);
+}
+
# Build, and abort if the build fails.
for my $dir (@projects) {
chdir $dir or die;
diff --git a/WebKitTools/Scripts/old-run-webkit-tests b/WebKitTools/Scripts/old-run-webkit-tests
index 886b4a8..80801dc 100755
--- a/WebKitTools/Scripts/old-run-webkit-tests
+++ b/WebKitTools/Scripts/old-run-webkit-tests
@@ -236,7 +236,7 @@ if (isAppleMacWebKit()) {
}
}
-if (isQt() || isGtk() || isCygwin()) {
+if (isQt() || isCygwin()) {
my $testfontPath = $ENV{"WEBKIT_TESTFONTS"};
if (!$testfontPath || !-d "$testfontPath") {
print "The WEBKIT_TESTFONTS environment variable is not defined or not set properly\n";
@@ -528,6 +528,7 @@ if (!$has3DRendering) {
if (!checkWebCoreFeatureSupport("3D Canvas", 0)) {
$ignoredDirectories{'fast/canvas/webgl'} = 1;
$ignoredDirectories{'compositing/webgl'} = 1;
+ $ignoredDirectories{'http/tests/canvas/webgl'} = 1;
}
if (checkWebCoreFeatureSupport("WML", 0)) {
diff --git a/WebKitTools/Scripts/prepare-ChangeLog b/WebKitTools/Scripts/prepare-ChangeLog
index c2adaf5..608c9ce 100755
--- a/WebKitTools/Scripts/prepare-ChangeLog
+++ b/WebKitTools/Scripts/prepare-ChangeLog
@@ -269,7 +269,7 @@ if ($bugNumber) {
if (`curl --version | grep ^Protocols` !~ /\bhttps\b/) {
print STDERR " Could not get description for bug $bugNumber.\n";
print STDERR " It looks like your version of curl does not support ssl.\n";
- print STDERR " If you are using macports, this can be fixed with sudo port install curl+ssl.\n";
+ print STDERR " If you are using macports, this can be fixed with sudo port install curl +ssl.\n";
} else {
print STDERR " Bug $bugNumber has no bug description. Maybe you set wrong bug ID?\n";
print STDERR " The bug URL: $bugXMLURL\n";
diff --git a/WebKitTools/Scripts/run-chromium-webkit-unit-tests b/WebKitTools/Scripts/run-chromium-webkit-unit-tests
new file mode 100755
index 0000000..62646af
--- /dev/null
+++ b/WebKitTools/Scripts/run-chromium-webkit-unit-tests
@@ -0,0 +1,51 @@
+#!/usr/bin/perl -w
+# 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.
+
+use strict;
+use File::Spec;
+use FindBin;
+use lib $FindBin::Bin;
+use webkitdirs;
+
+# Allow running this script from any directory.
+my $sourceRootDir = File::Spec->catfile($FindBin::Bin, "../..");
+chdir($sourceRootDir);
+
+setConfiguration();
+
+my $pathToBinary;
+if (isDarwin()) {
+ $pathToBinary = "WebKit/chromium/xcodebuild/" . configuration() . "/webkit_unit_tests";
+} elsif (isCygwin() || isWindows()) {
+ $pathToBinary = "WebKit/chromium/" . configuration() . "/webkit_unit_tests.exe";
+} elsif (isLinux()) {
+ $pathToBinary = "out/" . configuration() . "/webkit_unit_tests";
+}
+
+exit system ($pathToBinary, @ARGV);
diff --git a/WebKitTools/Scripts/test-webkitpy b/WebKitTools/Scripts/test-webkitpy
index e35c6e6..be7e870 100755
--- a/WebKitTools/Scripts/test-webkitpy
+++ b/WebKitTools/Scripts/test-webkitpy
@@ -137,8 +137,9 @@ def _clean_pyc_files(dir_to_clean, paths_not_to_log):
# As a substitute for a unit test, this method tests _clean_pyc_files()
# in addition to calling it. We chose not to use the unittest module
# because _clean_pyc_files() is called only once and is not used elsewhere.
-def _clean_webkitpy_with_test():
+def _clean_packages_with_test(external_package_paths):
webkitpy_dir = os.path.join(os.path.dirname(__file__), "webkitpy")
+ package_paths = [webkitpy_dir] + external_package_paths
# The test .pyc file is--
# webkitpy/python24/TEMP_test-webkitpy_test_pyc_file.pyc.
@@ -156,13 +157,14 @@ def _clean_webkitpy_with_test():
if not os.path.exists(test_path):
raise Exception("Test .pyc file not created: %s" % test_path)
- _clean_pyc_files(webkitpy_dir, [test_path])
+ for path in package_paths:
+ _clean_pyc_files(path, [test_path])
if os.path.exists(test_path):
raise Exception("Test .pyc file not deleted: %s" % test_path)
-def init(command_args):
+def init(command_args, external_package_paths):
"""Execute code prior to importing from webkitpy.unittests.
Args:
@@ -186,8 +188,8 @@ def init(command_args):
configure_logging(is_verbose_logging)
_log.debug("Verbose WebKit logging enabled.")
- # We clean orphaned *.pyc files from webkitpy prior to importing from
- # webkitpy to make sure that no import statements falsely succeed.
+ # We clean orphaned *.pyc files from the packages prior to importing from
+ # them to make sure that no import statements falsely succeed.
# This helps to check that import statements have been updated correctly
# after any file moves. Otherwise, incorrect import statements can
# be masked.
@@ -208,7 +210,7 @@ def init(command_args):
#
# Deleting the orphaned .pyc file prior to importing, however, would
# cause an ImportError to occur on import as desired.
- _clean_webkitpy_with_test()
+ _clean_packages_with_test(external_package_paths)
import webkitpy.python24.versioning as versioning
@@ -227,7 +229,8 @@ def init(command_args):
if __name__ == "__main__":
- init(sys.argv[1:])
+ external_package_paths = [os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(__file__))), 'WebKit2', 'Scripts', 'webkit2')]
+ init(sys.argv[1:], external_package_paths)
# We import the unit test code after init() to ensure that any
# Python version warnings are displayed in case an error occurs
@@ -237,4 +240,4 @@ if __name__ == "__main__":
# running the unit tests.
from webkitpy.test.main import Tester
- Tester().run_tests(sys.argv)
+ Tester().run_tests(sys.argv, external_package_paths)
diff --git a/WebKitTools/Scripts/webkitdirs.pm b/WebKitTools/Scripts/webkitdirs.pm
index 2980750..08e14ab 100644
--- a/WebKitTools/Scripts/webkitdirs.pm
+++ b/WebKitTools/Scripts/webkitdirs.pm
@@ -1408,6 +1408,72 @@ sub buildAutotoolsProject($@)
return $result;
}
+sub buildCMakeProject($@)
+{
+ my ($port, $clean, @buildParams) = @_;
+ my $dir = File::Spec->canonpath(baseProductDir());
+ my $config = configuration();
+ my $result;
+ my $makeArgs = "";
+ my @buildArgs;
+
+ $makeArgs .= " -j" . numberOfCPUs() if ($makeArgs !~ m/-j\s*\d+/);
+
+ if ($clean) {
+ print "Cleaning the build directory '$dir'\n";
+ $dir = File::Spec->catfile($dir, $config);
+ File::Path::remove_tree($dir, {keep_root => 1});
+ $result = 0;
+ } else {
+ my $cmakebin = "cmake";
+ my $make = "make";
+
+ push @buildArgs, "-DPORT=$port";
+
+ for my $i (0 .. $#buildParams) {
+ my $opt = $buildParams[$i];
+ if ($opt =~ /^--makeargs=(.*)/i ) {
+ $makeArgs = $1;
+ } elsif ($opt =~ /^--prefix=(.*)/i ) {
+ push @buildArgs, "-DCMAKE_INSTALL_PREFIX=$1";
+ } else {
+ push @buildArgs, $opt;
+ }
+ }
+
+ if ($config =~ m/debug/i) {
+ push @buildArgs, "-DCMAKE_BUILD_TYPE=Debug";
+ } elsif ($config =~ m/release/i) {
+ push @buildArgs, "-DCMAKE_BUILD_TYPE=Release";
+ }
+
+ push @buildArgs, sourceDir();
+
+ $dir = File::Spec->catfile($dir, $config);
+ File::Path::mkpath($dir);
+ chdir $dir or die "Failed to cd into " . $dir . "\n";
+
+ print "Calling '$cmakebin @buildArgs' in " . $dir . "\n\n";
+ my $result = system "$cmakebin @buildArgs";
+ if ($result ne 0) {
+ die "Failed while running $cmakebin to generate makefiles!\n";
+ }
+
+ print "Calling '$make $makeArgs' in " . $dir . "\n\n";
+ $result = system "$make $makeArgs";
+
+ chdir ".." or die;
+ }
+
+ return $result;
+}
+
+sub buildCMakeEflProject($@)
+{
+ my ($clean, @buildArgs) = @_;
+ return buildCMakeProject("Efl", $clean, @buildArgs);
+}
+
sub buildQMakeProject($@)
{
my ($clean, @buildParams) = @_;
@@ -1480,7 +1546,6 @@ sub buildQMakeProject($@)
}
}
- push @buildArgs, sourceDir() . "/WebKit.pro";
if ($config =~ m/debug/i) {
push @buildArgs, "CONFIG-=release";
push @buildArgs, "CONFIG+=debug";
@@ -1495,6 +1560,8 @@ sub buildQMakeProject($@)
}
}
+ push @buildArgs, sourceDir() . "/WebKit.pro";
+
print "Calling '$qmakebin @buildArgs' in " . $dir . "\n\n";
print "Installation headers directory: $installHeaders\n" if(defined($installHeaders));
print "Installation libraries directory: $installLibs\n" if(defined($installLibs));
@@ -1504,6 +1571,16 @@ sub buildQMakeProject($@)
die "Failed to setup build environment using $qmakebin!\n";
}
+ # Manually create makefiles for the examples so we don't build by default
+ my $examplesDir = $dir . "/WebKit/qt/examples";
+ File::Path::mkpath($examplesDir);
+ $buildArgs[-1] = sourceDir() . "/WebKit/qt/examples/examples.pro";
+ chdir $examplesDir or die;
+ print "Calling '$qmakebin @buildArgs' in " . $examplesDir . "\n\n";
+ $result = system "$qmakebin @buildArgs";
+ die "Failed to create makefiles for the examples!\n" if $result ne 0;
+ chdir $dir or die;
+
if ($clean) {
print "Calling '$make $makeargs distclean' in " . $dir . "\n\n";
$result = system "$make $makeargs distclean";
diff --git a/WebKitTools/Scripts/webkitpy/common/config/committers.py b/WebKitTools/Scripts/webkitpy/common/config/committers.py
index 113131f..2d07158 100644
--- a/WebKitTools/Scripts/webkitpy/common/config/committers.py
+++ b/WebKitTools/Scripts/webkitpy/common/config/committers.py
@@ -111,6 +111,7 @@ committers_unable_to_review = [
Committer("Graham Dennis", ["Graham.Dennis@gmail.com", "gdennis@webkit.org"]),
Committer("Greg Bolsinga", "bolsinga@apple.com"),
Committer("Hans Wennborg", "hans@chromium.org", "hwennborg"),
+ Committer("Hayato Ito", "hayato@chromium.org", "hayato"),
Committer("Hin-Chung Lam", ["hclam@google.com", "hclam@chromium.org"]),
Committer("Ilya Tikhonovsky", "loislo@chromium.org", "loislo"),
Committer("Jakob Petsovits", ["jpetsovits@rim.com", "jpetso@gmx.at"], "jpetso"),
@@ -136,6 +137,7 @@ committers_unable_to_review = [
Committer("Kent Hansen", "kent.hansen@nokia.com", "khansen"),
Committer("Kinuko Yasuda", "kinuko@chromium.org", "kinuko"),
Committer("Krzysztof Kowalczyk", "kkowalczyk@gmail.com"),
+ Committer("Kwang Yul Seo", ["kwangyul.seo@gmail.com", "skyul@company100.net", "kseo@webkit.org"], "kwangseo"),
Committer("Leandro Pereira", ["leandro@profusion.mobi", "leandro@webkit.org"], "acidx"),
Committer("Levi Weintraub", "lweintraub@apple.com"),
Committer("Lucas De Marchi", ["lucas.demarchi@profusion.mobi", "demarchi@webkit.org"], "demarchi"),
@@ -158,6 +160,7 @@ committers_unable_to_review = [
Committer("Noam Rosenthal", "noam.rosenthal@nokia.com", "noamr"),
Committer("Pam Greene", "pam@chromium.org", "pamg"),
Committer("Patrick Gansterer", ["paroga@paroga.com", "paroga@webkit.org"], "paroga"),
+ Committer("Pavel Podivilov", "podivilov@chromium.org", "podivilov"),
Committer("Peter Kasting", ["pkasting@google.com", "pkasting@chromium.org"], "pkasting"),
Committer("Philippe Normand", ["pnormand@igalia.com", "philn@webkit.org"], "philn-tp"),
Committer("Pierre d'Herbemont", ["pdherbemont@free.fr", "pdherbemont@apple.com"], "pdherbemont"),
diff --git a/WebKitTools/Scripts/webkitpy/common/net/buildbot.py b/WebKitTools/Scripts/webkitpy/common/net/buildbot.py
index 593ebc1..17f6c7a 100644
--- a/WebKitTools/Scripts/webkitpy/common/net/buildbot.py
+++ b/WebKitTools/Scripts/webkitpy/common/net/buildbot.py
@@ -34,6 +34,8 @@ import urllib
import urllib2
import xmlrpclib
+from webkitpy.common.net.failuremap import FailureMap
+from webkitpy.common.net.regressionwindow import RegressionWindow
from webkitpy.common.system.logutils import get_logger
from webkitpy.thirdparty.autoinstalled.mechanize import Browser
from webkitpy.thirdparty.BeautifulSoup import BeautifulSoup
@@ -145,9 +147,9 @@ class Builder(object):
)
return build
- def find_failure_transition(self, red_build, look_back_limit=30):
+ def find_regression_window(self, red_build, look_back_limit=30):
if not red_build or red_build.is_green():
- return (None, None)
+ return RegressionWindow(None, None)
common_failures = None
current_build = red_build
build_after_current_build = None
@@ -172,34 +174,25 @@ class Builder(object):
break
look_back_count += 1
if look_back_count > look_back_limit:
- return (None, current_build)
+ return RegressionWindow(None, current_build, common_failures=common_failures)
build_after_current_build = current_build
current_build = current_build.previous_build()
# We must iterate at least once because red_build is red.
assert(build_after_current_build)
# Current build must either be green or have no failures in common
# with red build, so we've found our failure transition.
- return (current_build, build_after_current_build)
+ return RegressionWindow(current_build, build_after_current_build, common_failures=common_failures)
- # FIXME: This likely does not belong on Builder
- def suspect_revisions_for_transition(self, last_good_build, first_bad_build):
- suspect_revisions = range(first_bad_build.revision(),
- last_good_build.revision(),
- -1)
- suspect_revisions.reverse()
- return suspect_revisions
-
- def blameworthy_revisions(self, red_build_number, look_back_limit=30, avoid_flakey_tests=True):
+ def find_blameworthy_regression_window(self, red_build_number, look_back_limit=30, avoid_flakey_tests=True):
red_build = self.build(red_build_number)
- (last_good_build, first_bad_build) = \
- self.find_failure_transition(red_build, look_back_limit)
- if not last_good_build:
- return [] # We ran off the limit of our search
+ regression_window = self.find_regression_window(red_build, look_back_limit)
+ if not regression_window.build_before_failure():
+ return None # We ran off the limit of our search
# If avoid_flakey_tests, require at least 2 bad builds before we
# suspect a real failure transition.
- if avoid_flakey_tests and first_bad_build == red_build:
- return []
- return self.suspect_revisions_for_transition(last_good_build, first_bad_build)
+ if avoid_flakey_tests and regression_window.failing_build() == red_build:
+ return None
+ return regression_window
# FIXME: This should be unified with all the layout test results code in the layout_tests package
@@ -414,20 +407,27 @@ class BuildBot(object):
build_status_url = "http://%s/one_box_per_builder" % self.buildbot_host
return urllib2.urlopen(build_status_url)
+ def _file_cell_text(self, file_cell):
+ """Traverses down through firstChild elements until one containing a string is found, then returns that string"""
+ element = file_cell
+ while element.string is None and element.contents:
+ element = element.contents[0]
+ return element.string
+
def _parse_twisted_file_row(self, file_row):
- string_or_empty = lambda soup: unicode(soup.string) if soup.string else u""
+ string_or_empty = lambda string: unicode(string) if string else u""
file_cells = file_row.findAll('td')
return {
- "filename": string_or_empty(file_cells[0].find("a")),
- "size": string_or_empty(file_cells[1]),
- "type": string_or_empty(file_cells[2]),
- "encoding": string_or_empty(file_cells[3]),
+ "filename": string_or_empty(self._file_cell_text(file_cells[0])),
+ "size": string_or_empty(self._file_cell_text(file_cells[1])),
+ "type": string_or_empty(self._file_cell_text(file_cells[2])),
+ "encoding": string_or_empty(self._file_cell_text(file_cells[3])),
}
def _parse_twisted_directory_listing(self, page):
soup = BeautifulSoup(page)
# HACK: Match only table rows with a class to ignore twisted header/footer rows.
- file_rows = soup.find('table').findAll('tr', { "class" : True })
+ file_rows = soup.find('table').findAll('tr', {'class': re.compile(r'\b(?:directory|file)\b')})
return [self._parse_twisted_file_row(file_row) for file_row in file_rows]
# FIXME: There should be a better way to get this information directly from twisted.
@@ -452,19 +452,17 @@ class BuildBot(object):
self._builder_by_name[name] = builder
return builder
- def revisions_causing_failures(self, only_core_builders=True):
+ def failure_map(self, only_core_builders=True):
builder_statuses = self.core_builder_statuses() if only_core_builders else self.builder_statuses()
+ failure_map = FailureMap()
revision_to_failing_bots = {}
for builder_status in builder_statuses:
if builder_status["is_green"]:
continue
builder = self.builder_with_name(builder_status["name"])
- revisions = builder.blameworthy_revisions(builder_status["build_number"])
- for revision in revisions:
- failing_bots = revision_to_failing_bots.get(revision, [])
- failing_bots.append(builder)
- revision_to_failing_bots[revision] = failing_bots
- return revision_to_failing_bots
+ regression_window = builder.find_blameworthy_regression_window(builder_status["build_number"])
+ failure_map.add_regression_window(builder, regression_window)
+ return failure_map
# This makes fewer requests than calling Builder.latest_build would. It grabs all builder
# statuses in one request using self.builder_statuses (fetching /one_box_per_builder instead of builder pages).
diff --git a/WebKitTools/Scripts/webkitpy/common/net/buildbot_unittest.py b/WebKitTools/Scripts/webkitpy/common/net/buildbot_unittest.py
index b48f0e4..c99ab32 100644
--- a/WebKitTools/Scripts/webkitpy/common/net/buildbot_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/common/net/buildbot_unittest.py
@@ -54,53 +54,53 @@ class BuilderTest(unittest.TestCase):
self.builder = Builder(u"Test Builder \u2661", self.buildbot)
self._install_fetch_build(lambda build_number: ["test1", "test2"])
- def test_find_failure_transition(self):
- (green_build, red_build) = self.builder.find_failure_transition(self.builder.build(10))
- self.assertEqual(green_build.revision(), 1003)
- self.assertEqual(red_build.revision(), 1004)
+ def test_find_regression_window(self):
+ regression_window = self.builder.find_regression_window(self.builder.build(10))
+ self.assertEqual(regression_window.build_before_failure().revision(), 1003)
+ self.assertEqual(regression_window.failing_build().revision(), 1004)
- (green_build, red_build) = self.builder.find_failure_transition(self.builder.build(10), look_back_limit=2)
- self.assertEqual(green_build, None)
- self.assertEqual(red_build.revision(), 1008)
+ regression_window = self.builder.find_regression_window(self.builder.build(10), look_back_limit=2)
+ self.assertEqual(regression_window.build_before_failure(), None)
+ self.assertEqual(regression_window.failing_build().revision(), 1008)
def test_none_build(self):
self.builder._fetch_build = lambda build_number: None
- (green_build, red_build) = self.builder.find_failure_transition(self.builder.build(10))
- self.assertEqual(green_build, None)
- self.assertEqual(red_build, None)
+ regression_window = self.builder.find_regression_window(self.builder.build(10))
+ self.assertEqual(regression_window.build_before_failure(), None)
+ self.assertEqual(regression_window.failing_build(), None)
def test_flaky_tests(self):
self._install_fetch_build(lambda build_number: ["test1"] if build_number % 2 else ["test2"])
- (green_build, red_build) = self.builder.find_failure_transition(self.builder.build(10))
- self.assertEqual(green_build.revision(), 1009)
- self.assertEqual(red_build.revision(), 1010)
+ regression_window = self.builder.find_regression_window(self.builder.build(10))
+ self.assertEqual(regression_window.build_before_failure().revision(), 1009)
+ self.assertEqual(regression_window.failing_build().revision(), 1010)
def test_failure_and_flaky(self):
self._install_fetch_build(lambda build_number: ["test1", "test2"] if build_number % 2 else ["test2"])
- (green_build, red_build) = self.builder.find_failure_transition(self.builder.build(10))
- self.assertEqual(green_build.revision(), 1003)
- self.assertEqual(red_build.revision(), 1004)
+ regression_window = self.builder.find_regression_window(self.builder.build(10))
+ self.assertEqual(regression_window.build_before_failure().revision(), 1003)
+ self.assertEqual(regression_window.failing_build().revision(), 1004)
def test_no_results(self):
self._install_fetch_build(lambda build_number: ["test1", "test2"] if build_number % 2 else ["test2"])
- (green_build, red_build) = self.builder.find_failure_transition(self.builder.build(10))
- self.assertEqual(green_build.revision(), 1003)
- self.assertEqual(red_build.revision(), 1004)
+ regression_window = self.builder.find_regression_window(self.builder.build(10))
+ self.assertEqual(regression_window.build_before_failure().revision(), 1003)
+ self.assertEqual(regression_window.failing_build().revision(), 1004)
def test_failure_after_flaky(self):
self._install_fetch_build(lambda build_number: ["test1", "test2"] if build_number > 6 else ["test3"])
- (green_build, red_build) = self.builder.find_failure_transition(self.builder.build(10))
- self.assertEqual(green_build.revision(), 1006)
- self.assertEqual(red_build.revision(), 1007)
+ regression_window = self.builder.find_regression_window(self.builder.build(10))
+ self.assertEqual(regression_window.build_before_failure().revision(), 1006)
+ self.assertEqual(regression_window.failing_build().revision(), 1007)
- def test_blameworthy_revisions(self):
- self.assertEqual(self.builder.blameworthy_revisions(10), [1004])
- self.assertEqual(self.builder.blameworthy_revisions(10, look_back_limit=2), [])
+ def test_find_blameworthy_regression_window(self):
+ self.assertEqual(self.builder.find_blameworthy_regression_window(10).revisions(), [1004])
+ self.assertEqual(self.builder.find_blameworthy_regression_window(10, look_back_limit=2), None)
# Flakey test avoidance requires at least 2 red builds:
- self.assertEqual(self.builder.blameworthy_revisions(4), [])
- self.assertEqual(self.builder.blameworthy_revisions(4, avoid_flakey_tests=False), [1004])
+ self.assertEqual(self.builder.find_blameworthy_regression_window(4), None)
+ self.assertEqual(self.builder.find_blameworthy_regression_window(4, avoid_flakey_tests=False).revisions(), [1004])
# Green builder:
- self.assertEqual(self.builder.blameworthy_revisions(3), [])
+ self.assertEqual(self.builder.find_blameworthy_regression_window(3), None)
def test_build_caching(self):
self.assertEqual(self.builder.build(10), self.builder.build(10))
@@ -361,22 +361,19 @@ class BuildBotTest(unittest.TestCase):
<h1>Directory listing for /results/SnowLeopard Intel Leaks/</h1>
<table>
- <thead>
- <tr>
+ <tr class="alt">
<th>Filename</th>
<th>Size</th>
<th>Content type</th>
<th>Content encoding</th>
</tr>
- </thead>
- <tbody>
-<tr class="odd">
- <td><a href="r47483%20%281%29/">r47483 (1)/</a></td>
- <td></td>
- <td>[Directory]</td>
- <td></td>
+<tr class="directory ">
+ <td><a href="r47483%20%281%29/"><b>r47483 (1)/</b></a></td>
+ <td><b></b></td>
+ <td><b>[Directory]</b></td>
+ <td><b></b></td>
</tr>
-<tr class="odd">
+<tr class="file alt">
<td><a href="r47484%20%282%29.zip">r47484 (2).zip</a></td>
<td>89K</td>
<td>[application/zip]</td>
diff --git a/WebKitTools/Scripts/webkitpy/common/net/credentials.py b/WebKitTools/Scripts/webkitpy/common/net/credentials.py
index 1d5f83d..1c3e6c0 100644
--- a/WebKitTools/Scripts/webkitpy/common/net/credentials.py
+++ b/WebKitTools/Scripts/webkitpy/common/net/credentials.py
@@ -39,14 +39,23 @@ from webkitpy.common.system.executive import Executive, ScriptError
from webkitpy.common.system.user import User
from webkitpy.common.system.deprecated_logging import log
+try:
+ # Use keyring, a cross platform keyring interface, as a fallback:
+ # http://pypi.python.org/pypi/keyring
+ import keyring
+except ImportError:
+ keyring = None
+
class Credentials(object):
- def __init__(self, host, git_prefix=None, executive=None, cwd=os.getcwd()):
+ def __init__(self, host, git_prefix=None, executive=None, cwd=os.getcwd(),
+ keyring=keyring):
self.host = host
self.git_prefix = "%s." % git_prefix if git_prefix else ""
self.executive = executive or Executive()
self.cwd = cwd
+ self._keyring = keyring
def _credentials_from_git(self):
return [Git.read_git_config(self.git_prefix + "username"),
@@ -117,10 +126,19 @@ class Credentials(object):
if not username or not password:
(username, password) = self._credentials_from_keychain(username)
+ if username and not password and self._keyring:
+ password = self._keyring.get_password(self.host, username)
+
if not username:
username = User.prompt("%s login: " % self.host)
if not password:
password = getpass.getpass("%s password for %s: " % (self.host,
username))
+ if self._keyring:
+ store_password = User().confirm(
+ "Store password in system keyring?", User.DEFAULT_NO)
+ if store_password:
+ self._keyring.set_password(self.host, username, password)
+
return [username, password]
diff --git a/WebKitTools/Scripts/webkitpy/common/net/credentials_unittest.py b/WebKitTools/Scripts/webkitpy/common/net/credentials_unittest.py
index 9a42bdd..d30291b 100644
--- a/WebKitTools/Scripts/webkitpy/common/net/credentials_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/common/net/credentials_unittest.py
@@ -113,5 +113,28 @@ password: "SECRETSAUCE"
self.assertEqual(credentials.read_credentials(), ["test@webkit.org", "SECRETSAUCE"])
os.rmdir(temp_dir_path)
+ def test_keyring_without_git_repo(self):
+ class MockKeyring(object):
+ def get_password(self, host, username):
+ return "NOMNOMNOM"
+
+ class FakeCredentials(Credentials):
+ def __init__(self, cwd):
+ Credentials.__init__(self, "fake.hostname", cwd=cwd,
+ keyring=MockKeyring())
+
+ def _is_mac_os_x(self):
+ return True
+
+ def _credentials_from_keychain(self, username):
+ return ("test@webkit.org", None)
+
+ temp_dir_path = tempfile.mkdtemp(suffix="not_a_git_repo")
+ credentials = FakeCredentials(temp_dir_path)
+ try:
+ self.assertEqual(credentials.read_credentials(), ["test@webkit.org", "NOMNOMNOM"])
+ finally:
+ os.rmdir(temp_dir_path)
+
if __name__ == '__main__':
unittest.main()
diff --git a/WebKitTools/Scripts/webkitpy/common/net/failuremap.py b/WebKitTools/Scripts/webkitpy/common/net/failuremap.py
new file mode 100644
index 0000000..98e4b8f
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/common/net/failuremap.py
@@ -0,0 +1,48 @@
+# 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.
+
+
+class FailureMap(object):
+ def __init__(self):
+ self._failures = []
+
+ def add_regression_window(self, builder, regression_window):
+ self._failures.append({
+ 'builder': builder,
+ 'regression_window': regression_window,
+ })
+
+ def revisions_causing_failures(self):
+ revision_to_failing_bots = {}
+ for failure_info in self._failures:
+ revisions = failure_info['regression_window'].revisions()
+ for revision in revisions:
+ failing_bots = revision_to_failing_bots.get(revision, [])
+ failing_bots.append(failure_info['builder'])
+ revision_to_failing_bots[revision] = failing_bots
+ return revision_to_failing_bots
diff --git a/WebKitTools/Scripts/webkitpy/common/net/regressionwindow.py b/WebKitTools/Scripts/webkitpy/common/net/regressionwindow.py
new file mode 100644
index 0000000..231459f
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/common/net/regressionwindow.py
@@ -0,0 +1,48 @@
+# 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.
+
+
+class RegressionWindow(object):
+ def __init__(self, build_before_failure, failing_build, common_failures=None):
+ self._build_before_failure = build_before_failure
+ self._failing_build = failing_build
+ self._common_failures = common_failures
+
+ def build_before_failure(self):
+ return self._build_before_failure
+
+ def failing_build(self):
+ return self._failing_build
+
+ def common_failures(self):
+ return self._common_failures
+
+ def revisions(self):
+ revisions = range(self._failing_build.revision(), self._build_before_failure.revision(), -1)
+ revisions.reverse()
+ return revisions
diff --git a/WebKitTools/Scripts/webkitpy/common/system/user.py b/WebKitTools/Scripts/webkitpy/common/system/user.py
index 9444c00..240b67b 100644
--- a/WebKitTools/Scripts/webkitpy/common/system/user.py
+++ b/WebKitTools/Scripts/webkitpy/common/system/user.py
@@ -28,6 +28,7 @@
import logging
import os
+import re
import shlex
import subprocess
import sys
@@ -51,6 +52,9 @@ except ImportError:
class User(object):
+ DEFAULT_NO = 'n'
+ DEFAULT_YES = 'y'
+
# FIXME: These are @classmethods because bugzilla.py doesn't have a Tool object (thus no User instance).
@classmethod
def prompt(cls, message, repeat=1, raw_input=raw_input):
@@ -61,14 +65,30 @@ class User(object):
return response
@classmethod
- def prompt_with_list(cls, list_title, list_items):
+ def prompt_with_list(cls, list_title, list_items, can_choose_multiple=False, raw_input=raw_input):
print list_title
i = 0
for item in list_items:
i += 1
print "%2d. %s" % (i, item)
- result = int(cls.prompt("Enter a number: ")) - 1
- return list_items[result]
+
+ # Loop until we get valid input
+ while True:
+ if can_choose_multiple:
+ response = cls.prompt("Enter one or more numbers (comma-separated), or \"all\": ", raw_input=raw_input)
+ if not response.strip() or response == "all":
+ return list_items
+ try:
+ indices = [int(r) - 1 for r in re.split("\s*,\s*", response)]
+ except ValueError, err:
+ continue
+ return [list_items[i] for i in indices]
+ else:
+ try:
+ result = int(cls.prompt("Enter a number: ", raw_input=raw_input)) - 1
+ except ValueError, err:
+ continue
+ return list_items[result]
def edit(self, files):
editor = os.environ.get("EDITOR") or "vi"
@@ -98,11 +118,14 @@ class User(object):
except IOError, e:
pass
- def confirm(self, message=None):
+ def confirm(self, message=None, default=DEFAULT_YES, raw_input=raw_input):
if not message:
message = "Continue?"
- response = raw_input("%s [Y/n]: " % message)
- return not response or response.lower() == "y"
+ choice = {'y': 'Y/n', 'n': 'y/N'}[default]
+ response = raw_input("%s [%s]: " % (message, choice))
+ if not response:
+ response = default
+ return response.lower() == 'y'
def can_open_url(self):
try:
diff --git a/WebKitTools/Scripts/webkitpy/common/system/user_unittest.py b/WebKitTools/Scripts/webkitpy/common/system/user_unittest.py
index dadead3..ae1bad5 100644
--- a/WebKitTools/Scripts/webkitpy/common/system/user_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/common/system/user_unittest.py
@@ -28,6 +28,7 @@
import unittest
+from webkitpy.common.system.outputcapture import OutputCapture
from webkitpy.common.system.user import User
class UserTest(unittest.TestCase):
@@ -50,5 +51,51 @@ class UserTest(unittest.TestCase):
return None
self.assertEqual(User.prompt("input", repeat=self.repeatsRemaining, raw_input=mock_raw_input), None)
+ def test_prompt_with_list(self):
+ def run_prompt_test(inputs, expected_result, can_choose_multiple=False):
+ def mock_raw_input(message):
+ return inputs.pop(0)
+ output_capture = OutputCapture()
+ actual_result = output_capture.assert_outputs(
+ self,
+ User.prompt_with_list,
+ args=["title", ["foo", "bar"]],
+ kwargs={"can_choose_multiple": can_choose_multiple, "raw_input": mock_raw_input},
+ expected_stdout="title\n 1. foo\n 2. bar\n")
+ self.assertEqual(actual_result, expected_result)
+ self.assertEqual(len(inputs), 0)
+
+ run_prompt_test(["1"], "foo")
+ run_prompt_test(["badinput", "2"], "bar")
+
+ run_prompt_test(["1,2"], ["foo", "bar"], can_choose_multiple=True)
+ run_prompt_test([" 1, 2 "], ["foo", "bar"], can_choose_multiple=True)
+ run_prompt_test(["all"], ["foo", "bar"], can_choose_multiple=True)
+ run_prompt_test([""], ["foo", "bar"], can_choose_multiple=True)
+ run_prompt_test([" "], ["foo", "bar"], can_choose_multiple=True)
+ run_prompt_test(["badinput", "all"], ["foo", "bar"], can_choose_multiple=True)
+
+ def test_confirm(self):
+ test_cases = (
+ (("Continue? [Y/n]: ", True), (User.DEFAULT_YES, 'y')),
+ (("Continue? [Y/n]: ", False), (User.DEFAULT_YES, 'n')),
+ (("Continue? [Y/n]: ", True), (User.DEFAULT_YES, '')),
+ (("Continue? [Y/n]: ", False), (User.DEFAULT_YES, 'q')),
+ (("Continue? [y/N]: ", True), (User.DEFAULT_NO, 'y')),
+ (("Continue? [y/N]: ", False), (User.DEFAULT_NO, 'n')),
+ (("Continue? [y/N]: ", False), (User.DEFAULT_NO, '')),
+ (("Continue? [y/N]: ", False), (User.DEFAULT_NO, 'q')),
+ )
+ for test_case in test_cases:
+ expected, inputs = test_case
+
+ def mock_raw_input(message):
+ self.assertEquals(expected[0], message)
+ return inputs[1]
+
+ result = User().confirm(default=inputs[0],
+ raw_input=mock_raw_input)
+ self.assertEquals(expected[1], result)
+
if __name__ == '__main__':
unittest.main()
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/checksum-expected.checksum b/WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/checksum-expected.checksum
deleted file mode 100644
index 5890112..0000000
--- a/WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/checksum-expected.checksum
+++ /dev/null
@@ -1 +0,0 @@
-checksum-checksum
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/checksum-expected.png b/WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/checksum-expected.png
deleted file mode 100644
index 83a5de3..0000000
--- a/WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/checksum-expected.png
+++ /dev/null
@@ -1 +0,0 @@
-checksum-png
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/checksum-expected.txt b/WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/checksum-expected.txt
deleted file mode 100644
index 5628d69..0000000
--- a/WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/checksum-expected.txt
+++ /dev/null
@@ -1 +0,0 @@
-checksum-txt
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/checksum.html b/WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/checksum.html
deleted file mode 100644
index 2b78d31..0000000
--- a/WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/checksum.html
+++ /dev/null
@@ -1 +0,0 @@
-image_checksum
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/crash.html b/WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/crash.html
deleted file mode 100644
index 0bc3798..0000000
--- a/WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/crash.html
+++ /dev/null
@@ -1 +0,0 @@
-crash
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/exception.html b/WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/exception.html
deleted file mode 100644
index 38c54e3..0000000
--- a/WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/exception.html
+++ /dev/null
@@ -1 +0,0 @@
-exception
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/hang.html b/WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/hang.html
deleted file mode 100644
index 4e0de08..0000000
--- a/WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/hang.html
+++ /dev/null
@@ -1 +0,0 @@
-timeout-thread
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/image-expected.checksum b/WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/image-expected.checksum
deleted file mode 100644
index 24b887a..0000000
--- a/WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/image-expected.checksum
+++ /dev/null
@@ -1 +0,0 @@
-image-checksum
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/image-expected.png b/WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/image-expected.png
deleted file mode 100644
index 4c23996..0000000
--- a/WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/image-expected.png
+++ /dev/null
@@ -1 +0,0 @@
-image-png
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/image-expected.txt b/WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/image-expected.txt
deleted file mode 100644
index c6ee718..0000000
--- a/WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/image-expected.txt
+++ /dev/null
@@ -1 +0,0 @@
-image-txt
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/image.html b/WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/image.html
deleted file mode 100644
index 53e4b27..0000000
--- a/WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/image.html
+++ /dev/null
@@ -1 +0,0 @@
-image_failure
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/image_checksum-expected.checksum b/WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/image_checksum-expected.checksum
deleted file mode 100644
index 8fa0851..0000000
--- a/WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/image_checksum-expected.checksum
+++ /dev/null
@@ -1 +0,0 @@
-image_checksum-checksum
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/image_checksum-expected.png b/WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/image_checksum-expected.png
deleted file mode 100644
index d677d2e..0000000
--- a/WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/image_checksum-expected.png
+++ /dev/null
@@ -1 +0,0 @@
-image_checksum-png
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/image_checksum-expected.txt b/WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/image_checksum-expected.txt
deleted file mode 100644
index 453f213..0000000
--- a/WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/image_checksum-expected.txt
+++ /dev/null
@@ -1 +0,0 @@
-image_checksum-txt
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/image_checksum.html b/WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/image_checksum.html
deleted file mode 100644
index 2b78d31..0000000
--- a/WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/image_checksum.html
+++ /dev/null
@@ -1 +0,0 @@
-image_checksum
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/keyboard.html b/WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/keyboard.html
deleted file mode 100644
index c253983..0000000
--- a/WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/keyboard.html
+++ /dev/null
@@ -1 +0,0 @@
-keyboard
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/missing_check-expected.png b/WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/missing_check-expected.png
deleted file mode 100644
index e45c7af..0000000
--- a/WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/missing_check-expected.png
+++ /dev/null
@@ -1 +0,0 @@
-missing_check-png
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/missing_check-expected.txt b/WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/missing_check-expected.txt
deleted file mode 100644
index 0ea9227..0000000
--- a/WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/missing_check-expected.txt
+++ /dev/null
@@ -1 +0,0 @@
-missing_check-txt
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/missing_check.html b/WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/missing_check.html
deleted file mode 100644
index 0af8000..0000000
--- a/WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/missing_check.html
+++ /dev/null
@@ -1 +0,0 @@
-missing_image
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/missing_image.html b/WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/missing_image.html
deleted file mode 100644
index 0af8000..0000000
--- a/WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/missing_image.html
+++ /dev/null
@@ -1 +0,0 @@
-missing_image
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/missing_text.html b/WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/missing_text.html
deleted file mode 100644
index 47b8ad6..0000000
--- a/WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/missing_text.html
+++ /dev/null
@@ -1 +0,0 @@
-missing_text
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/text-expected.txt b/WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/text-expected.txt
deleted file mode 100644
index e21ea45..0000000
--- a/WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/text-expected.txt
+++ /dev/null
@@ -1 +0,0 @@
-text_failures-txt
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/text.html b/WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/text.html
deleted file mode 100644
index 91f5fc7..0000000
--- a/WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/text.html
+++ /dev/null
@@ -1 +0,0 @@
-text_failure
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/timeout.html b/WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/timeout.html
deleted file mode 100644
index 790851a..0000000
--- a/WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/timeout.html
+++ /dev/null
@@ -1 +0,0 @@
-timeout
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/data/failures/unexpected/text-image-checksum-expected.checksum b/WebKitTools/Scripts/webkitpy/layout_tests/data/failures/unexpected/text-image-checksum-expected.checksum
deleted file mode 100644
index 0c4f6da..0000000
--- a/WebKitTools/Scripts/webkitpy/layout_tests/data/failures/unexpected/text-image-checksum-expected.checksum
+++ /dev/null
@@ -1 +0,0 @@
-fail_checksum
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/data/failures/unexpected/text-image-checksum-expected.png b/WebKitTools/Scripts/webkitpy/layout_tests/data/failures/unexpected/text-image-checksum-expected.png
deleted file mode 100644
index db483ee..0000000
--- a/WebKitTools/Scripts/webkitpy/layout_tests/data/failures/unexpected/text-image-checksum-expected.png
+++ /dev/null
@@ -1 +0,0 @@
-fail_png
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/data/failures/unexpected/text-image-checksum-expected.txt b/WebKitTools/Scripts/webkitpy/layout_tests/data/failures/unexpected/text-image-checksum-expected.txt
deleted file mode 100644
index a1f3c24..0000000
--- a/WebKitTools/Scripts/webkitpy/layout_tests/data/failures/unexpected/text-image-checksum-expected.txt
+++ /dev/null
@@ -1 +0,0 @@
-fail_output
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/data/failures/unexpected/text-image-checksum.html b/WebKitTools/Scripts/webkitpy/layout_tests/data/failures/unexpected/text-image-checksum.html
deleted file mode 100644
index b325924..0000000
--- a/WebKitTools/Scripts/webkitpy/layout_tests/data/failures/unexpected/text-image-checksum.html
+++ /dev/null
@@ -1 +0,0 @@
-Google
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/data/http/tests/passes/text-expected.txt b/WebKitTools/Scripts/webkitpy/layout_tests/data/http/tests/passes/text-expected.txt
deleted file mode 100644
index 2b38a06..0000000
--- a/WebKitTools/Scripts/webkitpy/layout_tests/data/http/tests/passes/text-expected.txt
+++ /dev/null
@@ -1 +0,0 @@
-text-txt
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/data/http/tests/passes/text.html b/WebKitTools/Scripts/webkitpy/layout_tests/data/http/tests/passes/text.html
deleted file mode 100644
index 8e27be7..0000000
--- a/WebKitTools/Scripts/webkitpy/layout_tests/data/http/tests/passes/text.html
+++ /dev/null
@@ -1 +0,0 @@
-text
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/data/http/tests/ssl/text-expected.txt b/WebKitTools/Scripts/webkitpy/layout_tests/data/http/tests/ssl/text-expected.txt
deleted file mode 100644
index 2b38a06..0000000
--- a/WebKitTools/Scripts/webkitpy/layout_tests/data/http/tests/ssl/text-expected.txt
+++ /dev/null
@@ -1 +0,0 @@
-text-txt
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/data/http/tests/ssl/text.html b/WebKitTools/Scripts/webkitpy/layout_tests/data/http/tests/ssl/text.html
deleted file mode 100644
index 8e27be7..0000000
--- a/WebKitTools/Scripts/webkitpy/layout_tests/data/http/tests/ssl/text.html
+++ /dev/null
@@ -1 +0,0 @@
-text
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/data/passes/error-expected.txt b/WebKitTools/Scripts/webkitpy/layout_tests/data/passes/error-expected.txt
deleted file mode 100644
index 9427269..0000000
--- a/WebKitTools/Scripts/webkitpy/layout_tests/data/passes/error-expected.txt
+++ /dev/null
@@ -1 +0,0 @@
-error-txt
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/data/passes/error.html b/WebKitTools/Scripts/webkitpy/layout_tests/data/passes/error.html
deleted file mode 100644
index 8276753..0000000
--- a/WebKitTools/Scripts/webkitpy/layout_tests/data/passes/error.html
+++ /dev/null
@@ -1 +0,0 @@
-error
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/data/passes/image-expected.checksum b/WebKitTools/Scripts/webkitpy/layout_tests/data/passes/image-expected.checksum
deleted file mode 100644
index 24b887a..0000000
--- a/WebKitTools/Scripts/webkitpy/layout_tests/data/passes/image-expected.checksum
+++ /dev/null
@@ -1 +0,0 @@
-image-checksum
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/data/passes/image-expected.png b/WebKitTools/Scripts/webkitpy/layout_tests/data/passes/image-expected.png
deleted file mode 100644
index 4c23996..0000000
--- a/WebKitTools/Scripts/webkitpy/layout_tests/data/passes/image-expected.png
+++ /dev/null
@@ -1 +0,0 @@
-image-png
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/data/passes/image-expected.txt b/WebKitTools/Scripts/webkitpy/layout_tests/data/passes/image-expected.txt
deleted file mode 100644
index c6ee718..0000000
--- a/WebKitTools/Scripts/webkitpy/layout_tests/data/passes/image-expected.txt
+++ /dev/null
@@ -1 +0,0 @@
-image-txt
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/data/passes/image.html b/WebKitTools/Scripts/webkitpy/layout_tests/data/passes/image.html
deleted file mode 100644
index 773b222..0000000
--- a/WebKitTools/Scripts/webkitpy/layout_tests/data/passes/image.html
+++ /dev/null
@@ -1 +0,0 @@
-image
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/data/passes/platform_image-expected.checksum b/WebKitTools/Scripts/webkitpy/layout_tests/data/passes/platform_image-expected.checksum
deleted file mode 100644
index 52038ae..0000000
--- a/WebKitTools/Scripts/webkitpy/layout_tests/data/passes/platform_image-expected.checksum
+++ /dev/null
@@ -1 +0,0 @@
-platform_image-generic-checksum
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/data/passes/platform_image-expected.png b/WebKitTools/Scripts/webkitpy/layout_tests/data/passes/platform_image-expected.png
deleted file mode 100644
index 087872b..0000000
--- a/WebKitTools/Scripts/webkitpy/layout_tests/data/passes/platform_image-expected.png
+++ /dev/null
@@ -1 +0,0 @@
-platform_image-generic-png
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/data/passes/platform_image-expected.txt b/WebKitTools/Scripts/webkitpy/layout_tests/data/passes/platform_image-expected.txt
deleted file mode 100644
index f71680c..0000000
--- a/WebKitTools/Scripts/webkitpy/layout_tests/data/passes/platform_image-expected.txt
+++ /dev/null
@@ -1 +0,0 @@
-platform_image-generic-txt
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/data/passes/platform_image.html b/WebKitTools/Scripts/webkitpy/layout_tests/data/passes/platform_image.html
deleted file mode 100644
index ca48a7b..0000000
--- a/WebKitTools/Scripts/webkitpy/layout_tests/data/passes/platform_image.html
+++ /dev/null
@@ -1 +0,0 @@
-platform_image
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/data/passes/text-expected.txt b/WebKitTools/Scripts/webkitpy/layout_tests/data/passes/text-expected.txt
deleted file mode 100644
index 2b38a06..0000000
--- a/WebKitTools/Scripts/webkitpy/layout_tests/data/passes/text-expected.txt
+++ /dev/null
@@ -1 +0,0 @@
-text-txt
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/data/passes/text.html b/WebKitTools/Scripts/webkitpy/layout_tests/data/passes/text.html
deleted file mode 100644
index 8e27be7..0000000
--- a/WebKitTools/Scripts/webkitpy/layout_tests/data/passes/text.html
+++ /dev/null
@@ -1 +0,0 @@
-text
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/data/platform/test/passes/platform_image-expected.checksum b/WebKitTools/Scripts/webkitpy/layout_tests/data/platform/test/passes/platform_image-expected.checksum
deleted file mode 100644
index ea557cf..0000000
--- a/WebKitTools/Scripts/webkitpy/layout_tests/data/platform/test/passes/platform_image-expected.checksum
+++ /dev/null
@@ -1 +0,0 @@
-platform_image-checksum
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/data/platform/test/passes/platform_image-expected.png b/WebKitTools/Scripts/webkitpy/layout_tests/data/platform/test/passes/platform_image-expected.png
deleted file mode 100644
index ec42fc1..0000000
--- a/WebKitTools/Scripts/webkitpy/layout_tests/data/platform/test/passes/platform_image-expected.png
+++ /dev/null
@@ -1 +0,0 @@
-platform_image-png
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/data/platform/test/passes/platform_image-expected.txt b/WebKitTools/Scripts/webkitpy/layout_tests/data/platform/test/passes/platform_image-expected.txt
deleted file mode 100644
index ff8bf43..0000000
--- a/WebKitTools/Scripts/webkitpy/layout_tests/data/platform/test/passes/platform_image-expected.txt
+++ /dev/null
@@ -1 +0,0 @@
-platform_image-txt
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/data/platform/test/test_expectations.txt b/WebKitTools/Scripts/webkitpy/layout_tests/data/platform/test/test_expectations.txt
deleted file mode 100644
index 0619fde..0000000
--- a/WebKitTools/Scripts/webkitpy/layout_tests/data/platform/test/test_expectations.txt
+++ /dev/null
@@ -1,13 +0,0 @@
-WONTFIX : failures/expected/checksum.html = IMAGE
-WONTFIX : failures/expected/crash.html = CRASH
-// This one actually passes because the checksums will match.
-WONTFIX : failures/expected/image.html = PASS
-WONTFIX : failures/expected/image_checksum.html = IMAGE
-WONTFIX : failures/expected/missing_check.html = MISSING PASS
-WONTFIX : failures/expected/missing_image.html = MISSING PASS
-WONTFIX : failures/expected/missing_text.html = MISSING PASS
-WONTFIX : failures/expected/text.html = TEXT
-WONTFIX : failures/expected/timeout.html = TIMEOUT
-WONTFIX SKIP : failures/expected/hang.html = TIMEOUT
-WONTFIX SKIP : failures/expected/keyboard.html = CRASH
-WONTFIX SKIP : failures/expected/exception.html = CRASH
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/data/resources/README.txt b/WebKitTools/Scripts/webkitpy/layout_tests/data/resources/README.txt
deleted file mode 100644
index b806b06..0000000
--- a/WebKitTools/Scripts/webkitpy/layout_tests/data/resources/README.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-This directory exists solely to make sure that when we gather the lists of
-tests, we skip over directories named 'resources'.
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/data/websocket/tests/passes/text-expected.txt b/WebKitTools/Scripts/webkitpy/layout_tests/data/websocket/tests/passes/text-expected.txt
deleted file mode 100644
index 2b38a06..0000000
--- a/WebKitTools/Scripts/webkitpy/layout_tests/data/websocket/tests/passes/text-expected.txt
+++ /dev/null
@@ -1 +0,0 @@
-text-txt
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/data/websocket/tests/passes/text.html b/WebKitTools/Scripts/webkitpy/layout_tests/data/websocket/tests/passes/text.html
deleted file mode 100644
index 8e27be7..0000000
--- a/WebKitTools/Scripts/webkitpy/layout_tests/data/websocket/tests/passes/text.html
+++ /dev/null
@@ -1 +0,0 @@
-text
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/printing.py b/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/printing.py
index d420631..00ff211 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/printing.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/printing.py
@@ -351,11 +351,20 @@ class Printer(object):
filename = result.filename
test_name = self._port.relative_test_filename(filename)
self._write('trace: %s' % test_name)
- self._write(' txt: %s' %
- self._port.relative_test_filename(
- self._port.expected_filename(filename, '.txt')))
+ txt_file = self._port.expected_filename(filename, '.txt')
+ if self._port.path_exists(txt_file):
+ self._write(' txt: %s' %
+ self._port.relative_test_filename(txt_file))
+ else:
+ self._write(' txt: <none>')
+ checksum_file = self._port.expected_filename(filename, '.checksum')
+ if self._port.path_exists(checksum_file):
+ self._write(' sum: %s' %
+ self._port.relative_test_filename(checksum_file))
+ else:
+ self._write(' sum: <none>')
png_file = self._port.expected_filename(filename, '.png')
- if os.path.exists(png_file):
+ if self._port.path_exists(png_file):
self._write(' png: %s' %
self._port.relative_test_filename(png_file))
else:
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/printing_unittest.py b/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/printing_unittest.py
index 29139d0..0344aa7 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/printing_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/printing_unittest.py
@@ -151,7 +151,7 @@ class Testprinter(unittest.TestCase):
expectations = test_expectations.TestExpectations(
self._port, test_paths, expectations_str,
self._port.test_platform_name(), is_debug_mode=False,
- is_lint_mode=False, tests_are_present=False)
+ is_lint_mode=False)
rs = run_webkit_tests.ResultSummary(expectations, test_paths)
return test_paths, rs, expectations
@@ -318,6 +318,16 @@ class Testprinter(unittest.TestCase):
self.assertFalse(err.empty())
printer, err, out = self.get_printer(['--print', 'trace-everything'])
+ result = self.get_result('passes/image.html')
+ printer.print_test_result(result, expected=True, exp_str='',
+ got_str='')
+ result = self.get_result('failures/expected/missing_text.html')
+ printer.print_test_result(result, expected=True, exp_str='',
+ got_str='')
+ result = self.get_result('failures/expected/missing_check.html')
+ printer.print_test_result(result, expected=True, exp_str='',
+ got_str='')
+ result = self.get_result('failures/expected/missing_image.html')
printer.print_test_result(result, expected=True, exp_str='',
got_str='')
self.assertFalse(err.empty())
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_expectations.py b/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_expectations.py
index 3d8349b..508a6ad 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_expectations.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_expectations.py
@@ -87,8 +87,7 @@ class TestExpectations:
TEST_LIST = "test_expectations.txt"
def __init__(self, port, tests, expectations, test_platform_name,
- is_debug_mode, is_lint_mode, tests_are_present=True,
- overrides=None):
+ is_debug_mode, is_lint_mode, overrides=None):
"""Loads and parses the test expectations given in the string.
Args:
port: handle to object containing platform-specific functionality
@@ -101,10 +100,6 @@ class TestExpectations:
in the expectations
is_lint_mode: If True, just parse the expectations string
looking for errors.
- tests_are_present: whether the test files exist in the file
- system and can be probed for. This is useful for distinguishing
- test files from directories, and is needed by the LTTF
- dashboard, where the files aren't actually locally present.
overrides: test expectations that are allowed to override any
entries in |expectations|. This is used by callers
that need to manage two sets of expectations (e.g., upstream
@@ -112,7 +107,7 @@ class TestExpectations:
"""
self._expected_failures = TestExpectationsFile(port, expectations,
tests, test_platform_name, is_debug_mode, is_lint_mode,
- tests_are_present=tests_are_present, overrides=overrides)
+ overrides=overrides)
# TODO(ojan): Allow for removing skipped tests when getting the list of
# tests to run, but not when getting metrics.
@@ -302,8 +297,7 @@ class TestExpectationsFile:
'flaky': FLAKY}
def __init__(self, port, expectations, full_test_list, test_platform_name,
- is_debug_mode, is_lint_mode, suppress_errors=False,
- tests_are_present=True, overrides=None):
+ is_debug_mode, is_lint_mode, suppress_errors=False, overrides=None):
"""
expectations: Contents of the expectations file
full_test_list: The list of all tests to be run pending processing of
@@ -314,9 +308,6 @@ class TestExpectationsFile:
is_debug_mode: Whether we testing a test_shell built debug mode.
is_lint_mode: Whether this is just linting test_expecatations.txt.
suppress_errors: Whether to suppress lint errors.
- tests_are_present: Whether the test files are present in the local
- filesystem. The LTTF Dashboard uses False here to avoid having to
- keep a local copy of the tree.
overrides: test expectations that are allowed to override any
entries in |expectations|. This is used by callers
that need to manage two sets of expectations (e.g., upstream
@@ -329,7 +320,6 @@ class TestExpectationsFile:
self._test_platform_name = test_platform_name
self._is_debug_mode = is_debug_mode
self._is_lint_mode = is_lint_mode
- self._tests_are_present = tests_are_present
self._overrides = overrides
self._suppress_errors = suppress_errors
self._errors = []
@@ -462,7 +452,7 @@ class TestExpectationsFile:
def remove_platform_from_expectations(self, tests, platform):
"""Returns a copy of the expectations with the tests matching the
- platform remove.
+ platform removed.
If a test is in the test list and has an option that matches the given
platform, remove the matching platform and save the updated test back
@@ -699,8 +689,8 @@ class TestExpectationsFile:
# WebKit's way of skipping tests is to add a -disabled suffix.
# So we should consider the path existing if the path or the
# -disabled version exists.
- if (self._tests_are_present and not os.path.exists(full_path)
- and not os.path.exists(full_path + '-disabled')):
+ if (not self._port.path_exists(full_path)
+ and not self._port.path_exists(full_path + '-disabled')):
# Log a non fatal error here since you hit this case any
# time you update test_expectations.txt without syncing
# the LayoutTests directory
@@ -735,7 +725,8 @@ class TestExpectationsFile:
path and make sure directories end with the OS path separator."""
path = os.path.join(self._port.layout_tests_dir(), test_list_path)
path = os.path.normpath(path)
- path = self._fix_dir(path)
+ if self._port.path_isdir(path):
+ path = os.path.join(path, '')
result = []
for test in self._full_test_list:
@@ -743,20 +734,6 @@ class TestExpectationsFile:
result.append(test)
return result
- def _fix_dir(self, path):
- """Check to see if the path points to a directory, and if so, append
- the directory separator if necessary."""
- if self._tests_are_present:
- if os.path.isdir(path):
- path = os.path.join(path, '')
- else:
- # If we can't check the filesystem to see if this is a directory,
- # we assume that files w/o an extension are directories.
- # TODO(dpranke): What happens w/ LayoutTests/css2.1 ?
- if os.path.splitext(path)[1] == '':
- path = os.path.join(path, '')
- return path
-
def _add_tests(self, tests, expectations, test_list_path, lineno,
modifiers, options, overrides_allowed):
for test in tests:
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_expectations_unittest.py b/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_expectations_unittest.py
index 26eb18d..2e1b6ec 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_expectations_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_expectations_unittest.py
@@ -106,14 +106,13 @@ BUG_TEST WONTFIX WIN : failures/expected/image.html = IMAGE
"""
def parse_exp(self, expectations, overrides=None, is_lint_mode=False,
- is_debug_mode=False, tests_are_present=True):
+ is_debug_mode=False):
self._exp = TestExpectations(self._port,
tests=self.get_basic_tests(),
expectations=expectations,
test_platform_name=self._port.test_platform_name(),
is_debug_mode=is_debug_mode,
is_lint_mode=is_lint_mode,
- tests_are_present=tests_are_present,
overrides=overrides)
def assert_exp(self, test, result):
@@ -151,10 +150,6 @@ BUGX DEFER : failures/expected = IMAGE
self.assert_exp('failures/expected/text.html', TEXT)
self.assert_exp('failures/expected/crash.html', IMAGE)
- self.parse_exp(exp_str, tests_are_present=False)
- self.assert_exp('failures/expected/text.html', TEXT)
- self.assert_exp('failures/expected/crash.html', IMAGE)
-
def test_release_mode(self):
self.parse_exp('BUGX DEBUG : failures/expected/text.html = TEXT',
is_debug_mode=True)
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/base.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/base.py
index 70beac3..6a5d43b 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/port/base.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/base.py
@@ -42,11 +42,13 @@ import sys
import time
import apache_http_server
+import test_files
import http_server
import websocket_server
from webkitpy.common.system import logutils
from webkitpy.common.system.executive import Executive, ScriptError
+from webkitpy.common.system.user import User
_log = logutils.get_logger(__file__)
@@ -81,14 +83,15 @@ class Port(object):
}
return flags_by_configuration[configuration]
- def __init__(self, port_name=None, options=None, executive=Executive()):
- self._name = port_name
- self._options = options
+ def __init__(self, **kwargs):
+ self._name = kwargs.get('port_name', None)
+ self._options = kwargs.get('options', None)
+ self._executive = kwargs.get('executive', Executive())
+ self._user = kwargs.get('user', User())
self._helper = None
self._http_server = None
self._webkit_base_dir = None
self._websocket_server = None
- self._executive = executive
def default_child_processes(self):
"""Return the number of DumpRenderTree instances to use for this
@@ -130,11 +133,11 @@ class Port(object):
interface so that it can be overriden for testing purposes."""
return expected_text != actual_text
- def diff_image(self, expected_filename, actual_filename,
+ def diff_image(self, expected_contents, actual_contents,
diff_filename=None, tolerance=0):
- """Compare two image files and produce a delta image file.
+ """Compare two images and produce a delta image file.
- Return True if the two files are different, False if they are the same.
+ Return True if the two images are different, False if they are the same.
Also produce a delta image of the two images and write that into
|diff_filename| if it is not None.
@@ -252,6 +255,31 @@ class Port(object):
return os.path.join(platform_dir, baseline_filename)
return os.path.join(self.layout_tests_dir(), baseline_filename)
+ def _expected_file_contents(self, test, extension, encoding):
+ path = self.expected_filename(test, extension)
+ if not os.path.exists(path):
+ return None
+ with codecs.open(path, 'r', encoding) as file:
+ return file.read()
+
+ def expected_checksum(self, test):
+ """Returns the checksum of the image we expect the test to produce, or None if it is a text-only test."""
+ return self._expected_file_contents(test, '.checksum', 'ascii')
+
+ def expected_image(self, test):
+ """Returns the image we expect the test to produce."""
+ return self._expected_file_contents(test, '.png', None)
+
+ def expected_text(self, test):
+ """Returns the text output we expect the test to produce."""
+ # NOTE: -expected.txt files are ALWAYS utf-8. However,
+ # we do not decode the output from DRT, so we should not
+ # decode the -expected.txt values either to allow comparisons.
+ text = self._expected_file_contents(test, '.txt', None)
+ if not text:
+ return ''
+ return text.strip("\r\n").replace("\r\n", "\n") + "\n"
+
def filename_to_uri(self, filename):
"""Convert a test file to a URI."""
LAYOUTTEST_HTTP_DIR = "http/tests/"
@@ -287,6 +315,73 @@ class Port(object):
return "file:///" + self.get_absolute_path(filename)
return "file://" + self.get_absolute_path(filename)
+ def tests(self, paths):
+ """Return the list of tests found (relative to layout_tests_dir()."""
+ return test_files.find(self, paths)
+
+ def test_dirs(self):
+ """Returns the list of top-level test directories.
+
+ Used by --clobber-old-results."""
+ layout_tests_dir = self.layout_tests_dir()
+ return filter(lambda x: os.path.isdir(os.path.join(layout_tests_dir, x)),
+ os.listdir(layout_tests_dir))
+
+ def path_isdir(self, path):
+ """Returns whether the path refers to a directory of tests.
+
+ Used by test_expectations.py to apply rules to whole directories."""
+ return os.path.isdir(path)
+
+ def path_exists(self, path):
+ """Returns whether the path refers to an existing test or baseline."""
+ # Used by test_expectations.py to determine if an entry refers to a
+ # valid test and by printing.py to determine if baselines exist."""
+ return os.path.exists(path)
+
+ def update_baseline(self, path, data, encoding):
+ """Updates the baseline for a test.
+
+ Args:
+ path: the actual path to use for baseline, not the path to
+ the test. This function is used to update either generic or
+ platform-specific baselines, but we can't infer which here.
+ data: contents of the baseline.
+ encoding: file encoding to use for the baseline.
+ """
+ with codecs.open(path, "w", encoding=encoding) as file:
+ file.write(data)
+
+ def uri_to_test_name(self, uri):
+ """Return the base layout test name for a given URI.
+
+ This returns the test name for a given URI, e.g., if you passed in
+ "file:///src/LayoutTests/fast/html/keygen.html" it would return
+ "fast/html/keygen.html".
+
+ """
+ test = uri
+ if uri.startswith("file:///"):
+ if sys.platform == 'win32':
+ test = test.replace('file:///', '')
+ test = test.replace('/', '\\')
+ else:
+ test = test.replace('file://', '')
+ return self.relative_test_filename(test)
+
+ if uri.startswith("http://127.0.0.1:8880/"):
+ # websocket tests
+ return test.replace('http://127.0.0.1:8880/', '')
+
+ if uri.startswith("http://"):
+ # regular HTTP test
+ return test.replace('http://127.0.0.1:8000/', 'http/tests/')
+
+ if uri.startswith("https://"):
+ return test.replace('https://127.0.0.1:8443/', 'http/tests/')
+
+ raise NotImplementedError('unknown url type: %s' % uri)
+
def get_absolute_path(self, filename):
"""Return the absolute path in unix format for the given filename.
@@ -369,10 +464,10 @@ class Port(object):
"""
return os.environ.copy()
- def show_html_results_file(self, results_filename):
+ def show_results_html_file(self, results_filename):
"""This routine should display the HTML file pointed at by
results_filename in a users' browser."""
- raise NotImplementedError('Port.show_html_results_file')
+ return self._user.open_url(results_filename)
def create_driver(self, image_path, options):
"""Return a newly created base.Driver subclass for starting/stopping
@@ -588,7 +683,7 @@ class Port(object):
try:
with self._open_configuration_file() as file:
return file.readline().rstrip()
- except IOError, e:
+ except:
return None
# FIXME: This list may be incomplete as Apple has some sekret configs.
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/base_unittest.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/base_unittest.py
index 780cd22..71877b3 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/port/base_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/base_unittest.py
@@ -57,16 +57,17 @@ class MockExecutive():
class UnitTestPort(base.Port):
"""Subclass of base.Port used for unit testing."""
- def __init__(self, configuration_contents=None, executive_exception=None):
+ def __init__(self, configuration_contents=None, configuration_exception=IOError, executive_exception=None):
base.Port.__init__(self)
self._configuration_contents = configuration_contents
+ self._configuration_exception = configuration_exception
if executive_exception:
self._executive = MockExecutive(executive_exception)
def _open_configuration_file(self):
if self._configuration_contents:
return NewStringIO(self._configuration_contents)
- raise IOError
+ raise self._configuration_exception
class PortTest(unittest.TestCase):
@@ -191,9 +192,14 @@ class PortTest(unittest.TestCase):
self.assertFalse('nosuchthing' in diff)
def test_default_configuration_notfound(self):
+ # Regular IOError thrown while trying to get the configuration.
port = UnitTestPort()
self.assertEqual(port.default_configuration(), "Release")
+ # More exotic OSError thrown.
+ port = UnitTestPort(configuration_exception=OSError)
+ self.assertEqual(port.default_configuration(), "Release")
+
def test_layout_tests_skipping(self):
port = base.Port()
port.skipped_layout_tests = lambda: ['foo/bar.html', 'media']
@@ -214,6 +220,11 @@ class PortTest(unittest.TestCase):
# This routine is a no-op. We just test it for coverage.
port.setup_test_run()
+ def test_test_dirs(self):
+ port = base.Port()
+ dirs = port.test_dirs()
+ self.assertTrue('canvas' in dirs)
+ self.assertTrue('css2.1' in dirs)
class VirtualTest(unittest.TestCase):
"""Tests that various methods expected to be virtual are."""
@@ -231,7 +242,6 @@ class VirtualTest(unittest.TestCase):
self.assertVirtual(port.path_to_test_expectations_file)
self.assertVirtual(port.test_platform_name)
self.assertVirtual(port.results_directory)
- self.assertVirtual(port.show_html_results_file, None)
self.assertVirtual(port.test_expectations)
self.assertVirtual(port.test_base_platform_names)
self.assertVirtual(port.test_platform_name)
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium.py
index 3fc4613..a72627a 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium.py
@@ -39,6 +39,7 @@ import shutil
import signal
import subprocess
import sys
+import tempfile
import time
import webbrowser
@@ -46,7 +47,6 @@ import base
import http_server
from webkitpy.common.system.executive import Executive
-from webkitpy.layout_tests.layout_package import test_files
from webkitpy.layout_tests.layout_package import test_expectations
# Chromium DRT on OSX uses WebKitDriver.
@@ -82,8 +82,13 @@ def check_file_exists(path_to_file, file_description, override_step=None,
class ChromiumPort(base.Port):
"""Abstract base class for Chromium implementations of the Port class."""
- def __init__(self, port_name=None, options=None, **kwargs):
- base.Port.__init__(self, port_name, options, **kwargs)
+ def __init__(self, **kwargs):
+ base.Port.__init__(self, **kwargs)
+ if 'options' in kwargs:
+ options = kwargs['options']
+ if (options and (not hasattr(options, 'configuration') or
+ options.configuration is None)):
+ options.configuration = self.default_configuration()
self._chromium_base_dir = None
def baseline_path(self):
@@ -126,14 +131,18 @@ class ChromiumPort(base.Port):
return check_file_exists(image_diff_path, 'image diff exe',
override_step, logging)
- def diff_image(self, expected_filename, actual_filename,
+ def diff_image(self, expected_contents, actual_contents,
diff_filename=None, tolerance=0):
executable = self._path_to_image_diff()
+ expected_tmpfile = tempfile.NamedTemporaryFile()
+ expected_tmpfile.write(expected_contents)
+ actual_tmpfile = tempfile.NamedTemporaryFile()
+ actual_tmpfile.write(actual_contents)
if diff_filename:
- cmd = [executable, '--diff', expected_filename, actual_filename,
- diff_filename]
+ cmd = [executable, '--diff', expected_tmpfile.name,
+ actual_tmpfile.name, diff_filename]
else:
- cmd = [executable, expected_filename, actual_filename]
+ cmd = [executable, expected_tmpfile.name, actual_tmpfile.name]
result = True
try:
@@ -144,6 +153,9 @@ class ChromiumPort(base.Port):
_compare_available = False
else:
raise e
+ finally:
+ expected_tmpfile.close()
+ actual_tmpfile.close()
return result
def driver_name(self):
@@ -183,15 +195,6 @@ class ChromiumPort(base.Port):
if os.path.exists(cachedir):
shutil.rmtree(cachedir)
- def show_results_html_file(self, results_filename):
- uri = self.get_absolute_path(results_filename)
- if self._options.use_drt:
- # FIXME: This should use User.open_url
- webbrowser.open(uri, new=1)
- else:
- # Note: Not thread safe: http://bugs.python.org/issue2320
- subprocess.Popen([self._path_to_driver(), uri])
-
def create_driver(self, image_path, options):
"""Starts a new Driver and returns a handle to it."""
if options.use_drt and sys.platform == 'darwin':
@@ -236,7 +239,7 @@ class ChromiumPort(base.Port):
# FIXME: This drt_overrides handling should be removed when we switch
# from tes_shell to DRT.
drt_overrides = ''
- if self._options.use_drt:
+ if self._options and self._options.use_drt:
drt_overrides_path = self.path_from_webkit_base('LayoutTests',
'platform', 'chromium', 'drt_expectations.txt')
if os.path.exists(drt_overrides_path):
@@ -259,14 +262,13 @@ class ChromiumPort(base.Port):
test_platform_name = self.test_platform_name()
is_debug_mode = False
- all_test_files = test_files.gather_test_files(self, '*')
+ all_test_files = self.tests([])
if extra_test_files:
all_test_files.update(extra_test_files)
expectations = test_expectations.TestExpectations(
self, all_test_files, expectations_str, test_platform_name,
- is_debug_mode, is_lint_mode=True,
- tests_are_present=False, overrides=overrides_str)
+ is_debug_mode, is_lint_mode=True, overrides=overrides_str)
tests_dir = self.layout_tests_dir()
return [self.relative_test_filename(test)
for test in expectations.get_tests_with_result_type(test_expectations.SKIP)]
@@ -354,6 +356,12 @@ class ChromiumDriver(base.Driver):
if self._options.gp_fault_error_box:
driver_args.append('--gp-fault-error-box')
+
+ if self._options.accelerated_compositing:
+ driver_args.append('--enable-accelerated-compositing')
+
+ if self._options.accelerated_2d_canvas:
+ driver_args.append('--enable-accelerated-2d-canvas')
return driver_args
def start(self):
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_gpu.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_gpu.py
new file mode 100644
index 0000000..80602d9
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_gpu.py
@@ -0,0 +1,137 @@
+#!/usr/bin/env python
+# 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.
+
+# 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 __future__ import with_statement
+
+import codecs
+import os
+import sys
+
+import chromium_linux
+import chromium_mac
+import chromium_win
+
+
+def get(**kwargs):
+ """Some tests have slightly different results when run while using
+ hardware acceleration. In those cases, we prepend an additional directory
+ to the baseline paths."""
+ port_name = kwargs.get('port_name', None)
+ if port_name == 'chromium-gpu':
+ if sys.platform in ('cygwin', 'win32'):
+ port_name = 'chromium-gpu-win'
+ elif sys.platform == 'linux2':
+ port_name = 'chromium-gpu-linux'
+ elif sys.platform == 'darwin':
+ port_name = 'chromium-gpu-mac'
+ else:
+ raise NotImplementedError('unsupported platform: %s' %
+ sys.platform)
+
+ if port_name == 'chromium-gpu-linux':
+ return ChromiumGpuLinuxPort(**kwargs)
+
+ if port_name.startswith('chromium-gpu-mac'):
+ return ChromiumGpuMacPort(**kwargs)
+
+ if port_name.startswith('chromium-gpu-win'):
+ return ChromiumGpuWinPort(**kwargs)
+
+ raise NotImplementedError('unsupported port: %s' % port_name)
+
+
+def _set_gpu_options(options):
+ if options:
+ if options.accelerated_compositing is None:
+ options.accelerated_composting = True
+ if options.accelerated_2d_canvas is None:
+ options.accelerated_2d_canvas = True
+
+
+def _gpu_overrides(port):
+ try:
+ overrides_path = port.path_from_chromium_base('webkit', 'tools',
+ 'layout_tests', 'test_expectations_gpu.txt')
+ except AssertionError:
+ return None
+ if not os.path.exists(overrides_path):
+ return None
+ with codecs.open(overrides_path, "r", "utf-8") as file:
+ return file.read()
+
+
+class ChromiumGpuLinuxPort(chromium_linux.ChromiumLinuxPort):
+ def __init__(self, **kwargs):
+ kwargs.setdefault('port_name', 'chromium-gpu-linux')
+ _set_gpu_options(kwargs.get('options'))
+ chromium_linux.ChromiumLinuxPort.__init__(self, **kwargs)
+
+ def baseline_search_path(self):
+ return ([self._webkit_baseline_path('chromium-gpu-linux')] +
+ chromium_linux.ChromiumLinuxPort.baseline_search_path(self))
+
+ def path_to_test_expectations_file(self):
+ return self.path_from_webkit_base('LayoutTests', 'platform',
+ 'chromium-gpu', 'test_expectations.txt')
+
+ def test_expectations_overrides(self):
+ return _gpu_overrides(self)
+
+
+class ChromiumGpuMacPort(chromium_mac.ChromiumMacPort):
+ def __init__(self, **kwargs):
+ kwargs.setdefault('port_name', 'chromium-gpu-mac')
+ _set_gpu_options(kwargs.get('options'))
+ chromium_mac.ChromiumMacPort.__init__(self, **kwargs)
+
+ def baseline_search_path(self):
+ return ([self._webkit_baseline_path('chromium-gpu-mac')] +
+ chromium_mac.ChromiumMacPort.baseline_search_path(self))
+
+ def path_to_test_expectations_file(self):
+ return self.path_from_webkit_base('LayoutTests', 'platform',
+ 'chromium-gpu', 'test_expectations.txt')
+
+ def test_expectations_overrides(self):
+ return _gpu_overrides(self)
+
+
+class ChromiumGpuWinPort(chromium_win.ChromiumWinPort):
+ def __init__(self, **kwargs):
+ kwargs.setdefault('port_name', 'chromium-gpu-win' + self.version())
+ _set_gpu_options(kwargs.get('options'))
+ chromium_win.ChromiumWinPort.__init__(self, **kwargs)
+
+ def baseline_search_path(self):
+ return ([self._webkit_baseline_path('chromium-gpu-win')] +
+ chromium_win.ChromiumWinPort.baseline_search_path(self))
+
+ def path_to_test_expectations_file(self):
+ return self.path_from_webkit_base('LayoutTests', 'platform',
+ 'chromium-gpu', 'test_expectations.txt')
+
+ def test_expectations_overrides(self):
+ return _gpu_overrides(self)
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_gpu_unittest.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_gpu_unittest.py
new file mode 100644
index 0000000..5c79a3f
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_gpu_unittest.py
@@ -0,0 +1,58 @@
+#!/usr/bin/env python
+# 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.
+
+# 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.
+
+import os
+import unittest
+import chromium_gpu
+
+
+class ChromiumGpuTest(unittest.TestCase):
+ def test_get_chromium_gpu_linux(self):
+ self.assertOverridesWorked('chromium-gpu-linux')
+
+ def test_get_chromium_gpu_mac(self):
+ self.assertOverridesWorked('chromium-gpu-mac')
+
+ def test_get_chromium_gpu_win(self):
+ self.assertOverridesWorked('chromium-gpu-win')
+
+ def assertOverridesWorked(self, port_name):
+ # test that we got the right port
+ port = chromium_gpu.get(port_name=port_name, options=None)
+
+ # we use startswith() instead of Equal to gloss over platform versions.
+ self.assertTrue(port.name().startswith(port_name))
+
+ # test that it has the right directory in front of the search path.
+ path = port.baseline_search_path()[0]
+ self.assertEqual(port._webkit_baseline_path(port_name), path)
+
+ # test that we have the right expectations file.
+ self.assertTrue('chromium-gpu' in
+ port.path_to_test_expectations_file())
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_linux.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_linux.py
index 4df43e0..176991b 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_linux.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_linux.py
@@ -41,12 +41,9 @@ _log = logging.getLogger("webkitpy.layout_tests.port.chromium_linux")
class ChromiumLinuxPort(chromium.ChromiumPort):
"""Chromium Linux implementation of the Port class."""
- def __init__(self, port_name=None, options=None):
- if port_name is None:
- port_name = 'chromium-linux'
- if options and not hasattr(options, 'configuration'):
- options.configuration = 'Release'
- chromium.ChromiumPort.__init__(self, port_name, options)
+ def __init__(self, **kwargs):
+ kwargs.setdefault('port_name', 'chromium-linux')
+ chromium.ChromiumPort.__init__(self, **kwargs)
def baseline_search_path(self):
port_names = ["chromium-linux", "chromium-win", "chromium", "win", "mac"]
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_mac.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_mac.py
index abd84ae..64016ab 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_mac.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_mac.py
@@ -44,12 +44,9 @@ _log = logging.getLogger("webkitpy.layout_tests.port.chromium_mac")
class ChromiumMacPort(chromium.ChromiumPort):
"""Chromium Mac implementation of the Port class."""
- def __init__(self, port_name=None, options=None):
- if port_name is None:
- port_name = 'chromium-mac'
- if options and not hasattr(options, 'configuration'):
- options.configuration = 'Release'
- chromium.ChromiumPort.__init__(self, port_name, options)
+ def __init__(self, **kwargs):
+ kwargs.setdefault('port_name', 'chromium-mac')
+ chromium.ChromiumPort.__init__(self, **kwargs)
def baseline_search_path(self):
port_names = ["chromium-mac", "chromium", "mac" + self.version(), "mac"]
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_unittest.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_unittest.py
index 7a005b1..a4a9ea6 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_unittest.py
@@ -83,17 +83,39 @@ class ChromiumDriverTest(unittest.TestCase):
self.driver._proc.stdout.readline = mock_readline
self._assert_write_command_and_read_line(expected_crash=True)
+
+class ChromiumPortTest(unittest.TestCase):
+ class TestMacPort(chromium_mac.ChromiumMacPort):
+ def __init__(self, options):
+ chromium_mac.ChromiumMacPort.__init__(self,
+ port_name='test-port',
+ options=options)
+
+ def default_configuration(self):
+ self.default_configuration_called = True
+ return 'default'
+
+ class TestLinuxPort(chromium_linux.ChromiumLinuxPort):
+ def __init__(self, options):
+ chromium_linux.ChromiumLinuxPort.__init__(self,
+ port_name='test-port',
+ options=options)
+
+ def default_configuration(self):
+ self.default_configuration_called = True
+ return 'default'
+
def test_path_to_image_diff(self):
class MockOptions:
def __init__(self):
self.use_drt = True
- port = chromium_linux.ChromiumLinuxPort('test-port', options=MockOptions())
+ port = ChromiumPortTest.TestLinuxPort(options=MockOptions())
self.assertTrue(port._path_to_image_diff().endswith(
- '/out/Release/ImageDiff'))
- port = chromium_mac.ChromiumMacPort('test-port', options=MockOptions())
+ '/out/default/ImageDiff'), msg=port._path_to_image_diff())
+ port = ChromiumPortTest.TestMacPort(options=MockOptions())
self.assertTrue(port._path_to_image_diff().endswith(
- '/xcodebuild/Release/ImageDiff'))
+ '/xcodebuild/default/ImageDiff'))
# FIXME: Figure out how this is going to work on Windows.
#port = chromium_win.ChromiumWinPort('test-port', options=MockOptions())
@@ -102,16 +124,37 @@ class ChromiumDriverTest(unittest.TestCase):
def __init__(self):
self.use_drt = True
- port = chromium_linux.ChromiumLinuxPort('test-port', options=MockOptions())
+ port = ChromiumPortTest.TestLinuxPort(options=MockOptions())
fake_test = os.path.join(port.layout_tests_dir(), "fast/js/not-good.js")
port.test_expectations = lambda: """BUG_TEST SKIP : fast/js/not-good.js = TEXT
DEFER LINUX WIN : fast/js/very-good.js = TIMEOUT PASS"""
port.test_expectations_overrides = lambda: ''
+ port.tests = lambda paths: set()
+ port.path_exists = lambda test: True
skipped_tests = port.skipped_layout_tests(extra_test_files=[fake_test, ])
self.assertTrue("fast/js/not-good.js" in skipped_tests)
+ def test_default_configuration(self):
+ class EmptyOptions:
+ def __init__(self):
+ pass
+
+ options = EmptyOptions()
+ port = ChromiumPortTest.TestLinuxPort(options)
+ self.assertEquals(options.configuration, 'default')
+ self.assertTrue(port.default_configuration_called)
+
+ class OptionsWithUnsetConfiguration:
+ def __init__(self):
+ self.configuration = None
+
+ options = OptionsWithUnsetConfiguration()
+ port = ChromiumPortTest.TestLinuxPort(options)
+ self.assertEquals(options.configuration, 'default')
+ self.assertTrue(port.default_configuration_called)
+
if __name__ == '__main__':
unittest.main()
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_win.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_win.py
index e9a81e7..d2b0265 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_win.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_win.py
@@ -41,12 +41,9 @@ _log = logging.getLogger("webkitpy.layout_tests.port.chromium_win")
class ChromiumWinPort(chromium.ChromiumPort):
"""Chromium Win implementation of the Port class."""
- def __init__(self, port_name=None, options=None):
- if port_name is None:
- port_name = "chromium-win" + self.version()
- if options and not hasattr(options, "configuration"):
- options.configuration = "Release"
- chromium.ChromiumPort.__init__(self, port_name, options)
+ def __init__(self, **kwargs):
+ kwargs.setdefault('port_name', 'chromium-win' + self.version())
+ chromium.ChromiumPort.__init__(self, **kwargs)
def setup_environ_for_server(self):
env = chromium.ChromiumPort.setup_environ_for_server(self)
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/dryrun.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/dryrun.py
index 4940e4c..648ccad 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/port/dryrun.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/dryrun.py
@@ -46,48 +46,24 @@
from __future__ import with_statement
+import os
import sys
import base
import factory
-def _read_file(path, mode='r'):
- """Return the contents of a file as a string.
-
- Returns '' if anything goes wrong, instead of throwing an IOError.
-
- """
- contents = ''
- try:
- with open(path, mode) as f:
- contents = f.read()
- except IOError:
- pass
- return contents
-
-
-def _write_file(path, contents, mode='w'):
- """Write the string to the specified path.
-
- Writes should never fail, so we may raise IOError.
-
- """
- with open(path, mode) as f:
- f.write(contents)
-
-
class DryRunPort(object):
"""DryRun implementation of the Port interface."""
- def __init__(self, port_name=None, options=None):
+ def __init__(self, **kwargs):
pfx = 'dryrun-'
- if port_name.startswith(pfx):
- port_name = port_name[len(pfx):]
- else:
- port_name = None
- self._options = options
- self.__delegate = factory.get(port_name, options)
+ if 'port_name' in kwargs:
+ if kwargs['port_name'].startswith(pfx):
+ kwargs['port_name'] = kwargs['port_name'][len(pfx):]
+ else:
+ kwargs['port_name'] = None
+ self.__delegate = factory.get(**kwargs)
def __getattr__(self, name):
return getattr(self.__delegate, name)
@@ -134,19 +110,16 @@ class DryrunDriver(base.Driver):
return None
def run_test(self, uri, timeoutms, image_hash):
- test_name = self._uri_to_test(uri)
-
- text_filename = self._port.expected_filename(test_name, '.txt')
- text_output = _read_file(text_filename)
+ test_name = self._port.uri_to_test_name(uri)
+ path = os.path.join(self._port.layout_tests_dir(), test_name)
+ text_output = self._port.expected_text(path)
if image_hash is not None:
- image_filename = self._port.expected_filename(test_name, '.png')
- image = _read_file(image_filename, 'rb')
- if self._image_path:
- _write_file(self._image_path, image)
- hash_filename = self._port.expected_filename(test_name,
- '.checksum')
- hash = _read_file(hash_filename)
+ image = self._port.expected_image(path)
+ if image and self._image_path:
+ with open(self._image_path, 'w') as f:
+ f.write(image)
+ hash = self._port.expected_checksum(path)
else:
hash = None
return (False, False, hash, text_output, None)
@@ -156,39 +129,3 @@ class DryrunDriver(base.Driver):
def stop(self):
pass
-
- def _uri_to_test(self, uri):
- """Return the base layout test name for a given URI.
-
- This returns the test name for a given URI, e.g., if you passed in
- "file:///src/LayoutTests/fast/html/keygen.html" it would return
- "fast/html/keygen.html".
-
- """
- if not self._layout_tests_dir:
- self._layout_tests_dir = self._port.layout_tests_dir()
- test = uri
-
- if uri.startswith("file:///"):
- if sys.platform == 'win32':
- test = test.replace('file:///', '')
- test = test.replace('/', '\\')
- else:
- test = test.replace('file://', '')
- return test
- elif uri.startswith("http://127.0.0.1:8880/"):
- # websocket tests
- test = test.replace('http://127.0.0.1:8880/',
- self._layout_tests_dir + '/')
- return test
- elif uri.startswith("http://"):
- # regular HTTP test
- test = test.replace('http://127.0.0.1:8000/',
- self._layout_tests_dir + '/http/tests/')
- return test
- elif uri.startswith("https://"):
- test = test.replace('https://127.0.0.1:8443/',
- self._layout_tests_dir + '/http/tests/')
- return test
- else:
- raise NotImplementedError('unknown url type: %s' % uri)
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/factory.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/factory.py
index 5704f65..6935744 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/port/factory.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/factory.py
@@ -37,11 +37,21 @@ ALL_PORT_NAMES = ['test', 'dryrun', 'mac', 'win', 'gtk', 'qt', 'chromium-mac',
'google-chrome-mac', 'google-chrome-linux32', 'google-chrome-linux64']
-def get(port_name=None, options=None):
+def get(port_name=None, options=None, **kwargs):
"""Returns an object implementing the Port interface. If
port_name is None, this routine attempts to guess at the most
appropriate port on this platform."""
- port_to_use = port_name
+ # Wrapped for backwards-compatibility
+ if port_name:
+ kwargs['port_name'] = port_name
+ if options:
+ kwargs['options'] = options
+ return _get_kwargs(**kwargs)
+
+
+def _get_kwargs(**kwargs):
+ port_to_use = kwargs.get('port_name', None)
+ options = kwargs.get('options', None)
if port_to_use is None:
if sys.platform == 'win32' or sys.platform == 'cygwin':
if options and hasattr(options, 'chromium') and options.chromium:
@@ -62,37 +72,40 @@ def get(port_name=None, options=None):
if port_to_use == 'test':
import test
- return test.TestPort(port_name, options)
+ maker = test.TestPort
elif port_to_use.startswith('dryrun'):
import dryrun
- return dryrun.DryRunPort(port_name, options)
+ maker = dryrun.DryRunPort
elif port_to_use.startswith('mac'):
import mac
- return mac.MacPort(port_name, options)
+ maker = mac.MacPort
elif port_to_use.startswith('win'):
import win
- return win.WinPort(port_name, options)
+ maker = win.WinPort
elif port_to_use.startswith('gtk'):
import gtk
- return gtk.GtkPort(port_name, options)
+ maker = gtk.GtkPort
elif port_to_use.startswith('qt'):
import qt
- return qt.QtPort(port_name, options)
+ maker = qt.QtPort
+ elif port_to_use.startswith('chromium-gpu'):
+ import chromium_gpu
+ maker = chromium_gpu.get
elif port_to_use.startswith('chromium-mac'):
import chromium_mac
- return chromium_mac.ChromiumMacPort(port_name, options)
+ maker = chromium_mac.ChromiumMacPort
elif port_to_use.startswith('chromium-linux'):
import chromium_linux
- return chromium_linux.ChromiumLinuxPort(port_name, options)
+ maker = chromium_linux.ChromiumLinuxPort
elif port_to_use.startswith('chromium-win'):
import chromium_win
- return chromium_win.ChromiumWinPort(port_name, options)
+ maker = chromium_win.ChromiumWinPort
elif port_to_use.startswith('google-chrome'):
import google_chrome
- return google_chrome.GetGoogleChromePort(port_name, options)
-
- raise NotImplementedError('unsupported port: %s' % port_to_use)
-
+ maker = google_chrome.GetGoogleChromePort
+ else:
+ raise NotImplementedError('unsupported port: %s' % port_to_use)
+ return maker(**kwargs)
def get_all(options=None):
"""Returns all the objects implementing the Port interface."""
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/factory_unittest.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/factory_unittest.py
index c0a4c5e..81c3732 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/port/factory_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/factory_unittest.py
@@ -29,6 +29,7 @@
import sys
import unittest
+import chromium_gpu
import chromium_linux
import chromium_mac
import chromium_win
@@ -133,6 +134,15 @@ class FactoryTest(unittest.TestCase):
def test_qt(self):
self.assert_port("qt", qt.QtPort)
+ def test_chromium_gpu_linux(self):
+ self.assert_port("chromium-gpu-linux", chromium_gpu.ChromiumGpuLinuxPort)
+
+ def test_chromium_gpu_mac(self):
+ self.assert_port("chromium-gpu-mac", chromium_gpu.ChromiumGpuMacPort)
+
+ def test_chromium_gpu_win(self):
+ self.assert_port("chromium-gpu-win", chromium_gpu.ChromiumGpuWinPort)
+
def test_chromium_mac(self):
self.assert_port("chromium-mac", chromium_mac.ChromiumMacPort)
self.assert_platform_port("darwin", self.chromium_options,
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/google_chrome.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/google_chrome.py
index 46ab3ed..bffc860 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/port/google_chrome.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/google_chrome.py
@@ -25,10 +25,12 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-def GetGoogleChromePort(port_name, options):
+def GetGoogleChromePort(**kwargs):
"""Some tests have slightly different results when compiled as Google
Chrome vs Chromium. In those cases, we prepend an additional directory to
to the baseline paths."""
+ port_name = kwargs['port_name']
+ del kwargs['port_name']
if port_name == 'google-chrome-linux32':
import chromium_linux
@@ -39,7 +41,7 @@ def GetGoogleChromePort(port_name, options):
paths.insert(0, self._webkit_baseline_path(
'google-chrome-linux32'))
return paths
- return GoogleChromeLinux32Port(None, options)
+ return GoogleChromeLinux32Port(**kwargs)
elif port_name == 'google-chrome-linux64':
import chromium_linux
@@ -50,7 +52,7 @@ def GetGoogleChromePort(port_name, options):
paths.insert(0, self._webkit_baseline_path(
'google-chrome-linux64'))
return paths
- return GoogleChromeLinux64Port(None, options)
+ return GoogleChromeLinux64Port(**kwargs)
elif port_name.startswith('google-chrome-mac'):
import chromium_mac
@@ -61,7 +63,7 @@ def GetGoogleChromePort(port_name, options):
paths.insert(0, self._webkit_baseline_path(
'google-chrome-mac'))
return paths
- return GoogleChromeMacPort(None, options)
+ return GoogleChromeMacPort(**kwargs)
elif port_name.startswith('google-chrome-win'):
import chromium_win
@@ -72,5 +74,5 @@ def GetGoogleChromePort(port_name, options):
paths.insert(0, self._webkit_baseline_path(
'google-chrome-win'))
return paths
- return GoogleChromeWinPort(None, options)
+ return GoogleChromeWinPort(**kwargs)
raise NotImplementedError('unsupported port: %s' % port_name)
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/google_chrome_unittest.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/google_chrome_unittest.py
index a2d7056..85e9338 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/port/google_chrome_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/google_chrome_unittest.py
@@ -41,6 +41,7 @@ class GetGoogleChromePortTest(unittest.TestCase):
self._verify_baseline_path('google-chrome-win', 'google-chrome-win-vista')
def _verify_baseline_path(self, expected_path, port_name):
- port = google_chrome.GetGoogleChromePort(port_name, None)
+ port = google_chrome.GetGoogleChromePort(port_name=port_name,
+ options=None)
path = port.baseline_search_path()[0]
self.assertEqual(expected_path, os.path.split(path)[1])
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/gtk.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/gtk.py
index 59dc1d9..c60909e 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/port/gtk.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/gtk.py
@@ -39,10 +39,9 @@ _log = logging.getLogger("webkitpy.layout_tests.port.gtk")
class GtkPort(WebKitPort):
"""WebKit Gtk implementation of the Port class."""
- def __init__(self, port_name=None, options=None):
- if port_name is None:
- port_name = 'gtk'
- WebKitPort.__init__(self, port_name, options)
+ def __init__(self, **kwargs):
+ kwargs.setdefault('port_name', 'gtk')
+ WebKitPort.__init__(self, **kwargs)
def _tests_for_other_platforms(self):
# FIXME: This list could be dynamic based on platform name and
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/mac.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/mac.py
index 413b5f2..696e339 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/port/mac.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/mac.py
@@ -43,10 +43,9 @@ _log = logging.getLogger("webkitpy.layout_tests.port.mac")
class MacPort(WebKitPort):
"""WebKit Mac implementation of the Port class."""
- def __init__(self, port_name=None, options=None):
- if port_name is None:
- port_name = 'mac' + self.version()
- WebKitPort.__init__(self, port_name, options)
+ def __init__(self, **kwargs):
+ kwargs.setdefault('port_name', 'mac' + self.version())
+ WebKitPort.__init__(self, **kwargs)
def default_child_processes(self):
# FIXME: new-run-webkit-tests is unstable on Mac running more than
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/port_testcase.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/port_testcase.py
index 2d650f5..47597d6 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/port/port_testcase.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/port_testcase.py
@@ -68,14 +68,20 @@ class PortTestCase(unittest.TestCase):
dir = port.layout_tests_dir()
file1 = os.path.join(dir, 'fast', 'css', 'button_center.png')
+ fh1 = file(file1)
+ contents1 = fh1.read()
file2 = os.path.join(dir, 'fast', 'css',
'remove-shorthand-expected.png')
+ fh2 = file(file2)
+ contents2 = fh2.read()
tmpfile = tempfile.mktemp()
- self.assertFalse(port.diff_image(file1, file1))
- self.assertTrue(port.diff_image(file1, file2))
+ self.assertFalse(port.diff_image(contents1, contents1))
+ self.assertTrue(port.diff_image(contents1, contents2))
- self.assertTrue(port.diff_image(file1, file2, tmpfile))
+ self.assertTrue(port.diff_image(contents1, contents2, tmpfile))
+ fh1.close()
+ fh2.close()
# FIXME: this may not be being written?
# self.assertTrue(os.path.exists(tmpfile))
# os.remove(tmpfile)
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/qt.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/qt.py
index 158c633..4c8fa0a 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/port/qt.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/qt.py
@@ -42,10 +42,9 @@ _log = logging.getLogger("webkitpy.layout_tests.port.qt")
class QtPort(WebKitPort):
"""QtWebKit implementation of the Port class."""
- def __init__(self, port_name=None, options=None):
- if port_name is None:
- port_name = 'qt'
- WebKitPort.__init__(self, port_name, options)
+ def __init__(self, **kwargs):
+ kwargs.setdefault('port_name', 'qt')
+ WebKitPort.__init__(self, **kwargs)
def _tests_for_other_platforms(self):
# FIXME: This list could be dynamic based on platform name and
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/server_process.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/server_process.py
index 8e0bc11..5a0a40c 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/port/server_process.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/server_process.py
@@ -179,7 +179,7 @@ class ServerProcess:
elif size == 0:
index = self._output.find('\n') + 1
- if index or self.crashed or self.timed_out:
+ if index > 0 or self.crashed or self.timed_out:
output = self._output[0:index]
self._output = self._output[index:]
return output
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/test.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/test.py
index 2ccddb0..3b81167 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/port/test.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/test.py
@@ -31,17 +31,100 @@
from __future__ import with_statement
import codecs
+import fnmatch
import os
+import sys
import time
import base
+# This sets basic expectations for a test. Each individual expectation
+# can be overridden by a keyword argument in TestList.add().
+class TestInstance:
+ def __init__(self, name):
+ self.name = name
+ self.base = name[(name.rfind("/") + 1):name.rfind(".html")]
+ self.crash = False
+ self.exception = False
+ self.hang = False
+ self.keyboard = False
+ self.error = ''
+ self.timeout = False
+ self.actual_text = self.base + '-txt\n'
+ self.actual_checksum = self.base + '-checksum\n'
+ self.actual_image = self.base + '-png\n'
+ self.expected_text = self.actual_text
+ self.expected_checksum = self.actual_checksum
+ self.expected_image = self.actual_image
+
+
+# This is an in-memory list of tests, what we want them to produce, and
+# what we want to claim are the expected results.
+class TestList:
+ def __init__(self, port):
+ self.port = port
+ self.tests = {}
+
+ def add(self, name, **kwargs):
+ test = TestInstance(name)
+ for key, value in kwargs.items():
+ test.__dict__[key] = value
+ self.tests[name] = test
+
+ def keys(self):
+ return self.tests.keys()
+
+ def __contains__(self, item):
+ return item in self.tests
+
+ def __getitem__(self, item):
+ return self.tests[item]
+
+
class TestPort(base.Port):
"""Test implementation of the Port interface."""
- def __init__(self, port_name=None, options=None):
- base.Port.__init__(self, port_name, options)
+ def __init__(self, **kwargs):
+ base.Port.__init__(self, **kwargs)
+ tests = TestList(self)
+ tests.add('passes/image.html')
+ tests.add('passes/text.html')
+ tests.add('failures/expected/checksum.html',
+ actual_checksum='checksum_fail-checksum')
+ tests.add('failures/expected/crash.html', crash=True)
+ tests.add('failures/expected/exception.html', exception=True)
+ tests.add('failures/expected/timeout.html', timeout=True)
+ tests.add('failures/expected/hang.html', hang=True)
+ tests.add('failures/expected/missing_text.html',
+ expected_text=None)
+ tests.add('failures/expected/image.html',
+ actual_image='image_fail-png',
+ expected_image='image-png')
+ tests.add('failures/expected/image_checksum.html',
+ actual_checksum='image_checksum_fail-checksum',
+ actual_image='image_checksum_fail-png')
+ tests.add('failures/expected/keyboard.html',
+ keyboard=True)
+ tests.add('failures/expected/missing_check.html',
+ expected_checksum=None)
+ tests.add('failures/expected/missing_image.html',
+ expected_image=None)
+ tests.add('failures/expected/missing_text.html',
+ expected_text=None)
+ tests.add('failures/expected/text.html',
+ actual_text='text_fail-png')
+ tests.add('failures/unexpected/text-image-checksum.html',
+ actual_text='text-image-checksum_fail-txt',
+ actual_checksum='text-image-checksum_fail-checksum')
+ tests.add('http/tests/passes/text.html')
+ tests.add('http/tests/ssl/text.html')
+ tests.add('passes/error.html', error='stuff going to stderr')
+ tests.add('passes/image.html')
+ tests.add('passes/platform_image.html')
+ tests.add('passes/text.html')
+ tests.add('websocket/tests/passes/text.html')
+ self._tests = tests
def baseline_path(self):
return os.path.join(self.layout_tests_dir(), 'platform',
@@ -53,12 +136,8 @@ class TestPort(base.Port):
def check_build(self, needs_http):
return True
- def diff_image(self, expected_filename, actual_filename,
+ def diff_image(self, expected_contents, actual_contents,
diff_filename=None, tolerance=0):
- with codecs.open(actual_filename, "r", "utf-8") as actual_fh:
- actual_contents = actual_fh.read()
- with codecs.open(expected_filename, "r", "utf-8") as expected_fh:
- expected_contents = expected_fh.read()
diffed = actual_contents != expected_contents
if diffed and diff_filename:
with codecs.open(diff_filename, "w", "utf-8") as diff_fh:
@@ -66,24 +145,79 @@ class TestPort(base.Port):
(expected_contents, actual_contents))
return diffed
+ def expected_checksum(self, test):
+ test = self.relative_test_filename(test)
+ return self._tests[test].expected_checksum
+
+ def expected_image(self, test):
+ test = self.relative_test_filename(test)
+ return self._tests[test].expected_image
+
+ def expected_text(self, test):
+ test = self.relative_test_filename(test)
+ text = self._tests[test].expected_text
+ if not text:
+ text = ''
+ return text
+
+ def tests(self, paths):
+ # Test the idea of port-specific overrides for test lists. Also
+ # keep in memory to speed up the test harness.
+ if not paths:
+ paths = ['*']
+
+ matched_tests = []
+ for p in paths:
+ if self.path_isdir(p):
+ matched_tests.extend(fnmatch.filter(self._tests.keys(), p + '*'))
+ else:
+ matched_tests.extend(fnmatch.filter(self._tests.keys(), p))
+ layout_tests_dir = self.layout_tests_dir()
+ return set([os.path.join(layout_tests_dir, p) for p in matched_tests])
+
+ def path_exists(self, path):
+ # used by test_expectations.py and printing.py
+ rpath = self.relative_test_filename(path)
+ if rpath in self._tests:
+ return True
+ if self.path_isdir(rpath):
+ return True
+ if rpath.endswith('-expected.txt'):
+ test = rpath.replace('-expected.txt', '.html')
+ return (test in self._tests and
+ self._tests[test].expected_text)
+ if rpath.endswith('-expected.checksum'):
+ test = rpath.replace('-expected.checksum', '.html')
+ return (test in self._tests and
+ self._tests[test].expected_checksum)
+ if rpath.endswith('-expected.png'):
+ test = rpath.replace('-expected.png', '.html')
+ return (test in self._tests and
+ self._tests[test].expected_image)
+ return False
+
def layout_tests_dir(self):
return self.path_from_webkit_base('WebKitTools', 'Scripts',
'webkitpy', 'layout_tests', 'data')
+ def path_isdir(self, path):
+ # Used by test_expectations.py
+ #
+ # We assume that a path is a directory if we have any tests that
+ # whose prefix matches the path plus a directory modifier.
+ if path[-1] != '/':
+ path += '/'
+ return any([t.startswith(path) for t in self._tests.keys()])
+
+ def test_dirs(self):
+ return ['passes', 'failures']
+
def name(self):
return self._name
def options(self):
return self._options
- def skipped_layout_tests(self):
- return []
-
- def path_to_test_expectations_file(self):
- return self.path_from_webkit_base('WebKitTools', 'Scripts',
- 'webkitpy', 'layout_tests', 'data', 'platform', 'test',
- 'test_expectations.txt')
-
def _path_to_wdiff(self):
return None
@@ -93,9 +227,6 @@ class TestPort(base.Port):
def setup_test_run(self):
pass
- def show_results_html_file(self, filename):
- pass
-
def create_driver(self, image_path, options):
return TestDriver(self, image_path, options, executive=None)
@@ -116,9 +247,21 @@ class TestPort(base.Port):
Basically this string should contain the equivalent of a
test_expectations file. See test_expectations.py for more details."""
- expectations_path = self.path_to_test_expectations_file()
- with codecs.open(expectations_path, "r", "utf-8") as file:
- return file.read()
+ return """
+WONTFIX : failures/expected/checksum.html = IMAGE
+WONTFIX : failures/expected/crash.html = CRASH
+// This one actually passes because the checksums will match.
+WONTFIX : failures/expected/image.html = PASS
+WONTFIX : failures/expected/image_checksum.html = IMAGE
+WONTFIX : failures/expected/missing_check.html = MISSING PASS
+WONTFIX : failures/expected/missing_image.html = MISSING PASS
+WONTFIX : failures/expected/missing_text.html = MISSING PASS
+WONTFIX : failures/expected/text.html = TEXT
+WONTFIX : failures/expected/timeout.html = TIMEOUT
+WONTFIX SKIP : failures/expected/hang.html = TIMEOUT
+WONTFIX SKIP : failures/expected/keyboard.html = CRASH
+WONTFIX SKIP : failures/expected/exception.html = CRASH
+"""
def test_base_platform_names(self):
return ('mac', 'win')
@@ -150,68 +293,21 @@ class TestDriver(base.Driver):
return True
def run_test(self, uri, timeoutms, image_hash):
- basename = uri[(uri.rfind("/") + 1):uri.rfind(".html")]
-
- if 'error' in basename:
- error = basename + "_error\n"
- else:
- error = ''
- checksum = None
- # There are four currently supported types of tests: text, image,
- # image hash (checksum), and stderr output. The fake output
- # is the basename of the file + "-" plus the type of test output
- # (or a blank string for stderr).
- #
- # If 'image' or 'check' appears in the basename, we assume this is
- # simulating a pixel test.
- #
- # If 'failures' appears in the URI, then we assume this test should
- # fail. Which type of failures are determined by which strings appear
- # in the basename of the test. For failures that produce outputs,
- # we change the fake output to basename + "_failed-".
- #
- # The fact that each test produces (more or less) unique output data
- # will allow us to see if any results get crossed by the rest of the
- # program.
- if 'failures' in uri:
- if 'keyboard' in basename:
- raise KeyboardInterrupt
- if 'exception' in basename:
- raise ValueError('exception from ' + basename)
-
- crash = 'crash' in basename
- timeout = 'timeout' in basename or 'hang' in basename
- timeout = 'timeout' in basename
- if 'text' in basename:
- output = basename + '_failed-txt\n'
- else:
- output = basename + '-txt\n'
- if self._port.options().pixel_tests:
- if ('image' in basename or 'check' in basename):
- checksum = basename + "-checksum\n"
-
- if 'image' in basename:
- with open(self._image_path, "w") as f:
- f.write(basename + "_failed-png\n")
- elif 'check' in basename:
- with open(self._image_path, "w") as f:
- f.write(basename + "-png\n")
- if 'checksum' in basename:
- checksum = basename + "_failed-checksum\n"
-
- if 'hang' in basename:
- time.sleep((float(timeoutms) * 4) / 1000.0)
- else:
- crash = False
- timeout = False
- output = basename + '-txt\n'
- if self._options.pixel_tests and (
- 'image' in basename or 'check' in basename):
- checksum = basename + '-checksum\n'
- with open(self._image_path, "w") as f:
- f.write(basename + "-png")
-
- return (crash, timeout, checksum, output, error)
+ test_name = self._port.uri_to_test_name(uri)
+ test = self._port._tests[test_name]
+ if test.keyboard:
+ raise KeyboardInterrupt
+ if test.exception:
+ raise ValueError('exception from ' + test_name)
+ if test.hang:
+ time.sleep((float(timeoutms) * 4) / 1000.0)
+
+ if self._port.options().pixel_tests and test.actual_image:
+ with open(self._image_path, 'w') as file:
+ file.write(test.actual_image)
+
+ return (test.crash, test.timeout, test.actual_checksum,
+ test.actual_text, test.error)
def start(self):
pass
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_files.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/test_files.py
index 8f79505..3fa0fb3 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_files.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/test_files.py
@@ -27,11 +27,11 @@
# (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 module is used to find all of the layout test files used by Chromium
-(across all platforms). It exposes one public function - GatherTestFiles() -
+"""This module is used to find all of the layout test files used by
+run-webkit-tests. It exposes one public function - find() -
which takes an optional list of paths. If a list is passed in, the returned
list of test files is constrained to those found under the paths passed in,
-i.e. calling GatherTestFiles(["LayoutTests/fast"]) will only return files
+i.e. calling find(["LayoutTests/fast"]) will only return files
under that directory."""
import glob
@@ -51,12 +51,12 @@ _supported_file_extensions = set(['.html', '.shtml', '.xml', '.xhtml', '.xhtmlmp
_skipped_directories = set(['.svn', '_svn', 'resources', 'script-tests'])
-def gather_test_files(port, paths):
- """Generate a set of test files and return them.
+def find(port, paths):
+ """Finds the set of tests under port.layout_tests_dir().
Args:
- paths: a list of command line paths relative to the webkit/tests
- directory. glob patterns are ok.
+ paths: a list of command line paths relative to the layout_tests_dir()
+ to limit the search to. glob patterns are ok.
"""
gather_start_time = time.time()
paths_to_walk = set()
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/test_files_unittest.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/test_files_unittest.py
new file mode 100644
index 0000000..c37eb92
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/test_files_unittest.py
@@ -0,0 +1,68 @@
+# Copyright (C) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+import os
+import unittest
+
+import base
+import test_files
+
+
+class TestFilesTest(unittest.TestCase):
+ def test_find_no_paths_specified(self):
+ port = base.Port()
+ layout_tests_dir = port.layout_tests_dir()
+ port.layout_tests_dir = lambda: os.path.join(layout_tests_dir,
+ 'fast', 'html')
+ tests = test_files.find(port, [])
+ self.assertNotEqual(tests, 0)
+
+ def test_find_one_test(self):
+ port = base.Port()
+ # This is just a test picked at random but known to exist.
+ tests = test_files.find(port, ['fast/html/keygen.html'])
+ self.assertEqual(len(tests), 1)
+
+ def test_find_glob(self):
+ port = base.Port()
+ tests = test_files.find(port, ['fast/html/key*'])
+ self.assertEqual(len(tests), 1)
+
+ def test_find_with_skipped_directories(self):
+ port = base.Port()
+ tests = port.tests('userscripts')
+ self.assertTrue('userscripts/resources/frame1.html' not in tests)
+
+ def test_find_with_skipped_directories_2(self):
+ port = base.Port()
+ tests = test_files.find(port, ['userscripts/resources'])
+ self.assertEqual(tests, set([]))
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/webkit.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/webkit.py
index 88c9bdf..ed19c09 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/port/webkit.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/webkit.py
@@ -58,16 +58,16 @@ _log = logging.getLogger("webkitpy.layout_tests.port.webkit")
class WebKitPort(base.Port):
"""WebKit implementation of the Port class."""
- def __init__(self, port_name=None, options=None, **kwargs):
- base.Port.__init__(self, port_name, options, **kwargs)
+ def __init__(self, **kwargs):
+ base.Port.__init__(self, **kwargs)
self._cached_build_root = None
self._cached_apache_path = None
# FIXME: disable pixel tests until they are run by default on the
# build machines.
- if options and (not hasattr(options, "pixel_tests") or
- options.pixel_tests is None):
- options.pixel_tests = False
+ if self._options and (not hasattr(self._options, "pixel_tests") or
+ self._options.pixel_tests is None):
+ self._options.pixel_tests = False
def baseline_path(self):
return self._webkit_baseline_path(self._name)
@@ -84,10 +84,14 @@ class WebKitPort(base.Port):
return ''
def _build_driver(self):
- return not self._executive.run_command([
+ exit_code = self._executive.run_command([
self.script_path("build-dumprendertree"),
self.flag_from_configuration(self._options.configuration),
], return_exit_code=True)
+ if exit_code != 0:
+ _log.error("Failed to build DumpRenderTree")
+ return False
+ return True
def _check_driver(self):
driver_path = self._path_to_driver()
@@ -119,7 +123,7 @@ class WebKitPort(base.Port):
return False
return True
- def diff_image(self, expected_filename, actual_filename,
+ def diff_image(self, expected_contents, actual_contents,
diff_filename=None, tolerance=0.1):
"""Return True if the two files are different. Also write a delta
image of the two images into |diff_filename| if it is not None."""
@@ -128,31 +132,24 @@ class WebKitPort(base.Port):
# parameter, or make it go away and always use exact matches.
# Handle the case where the test didn't actually generate an image.
- actual_length = os.stat(actual_filename).st_size
- if actual_length == 0:
- if diff_filename:
- shutil.copyfile(actual_filename, expected_filename)
+ if not actual_contents:
return True
- sp = self._diff_image_request(expected_filename, actual_filename, tolerance)
- return self._diff_image_reply(sp, expected_filename, diff_filename)
+ sp = self._diff_image_request(expected_contents, actual_contents,
+ tolerance)
+ return self._diff_image_reply(sp, diff_filename)
- def _diff_image_request(self, expected_filename, actual_filename, tolerance):
+ def _diff_image_request(self, expected_contents, actual_contents, tolerance):
command = [self._path_to_image_diff(), '--tolerance', str(tolerance)]
sp = server_process.ServerProcess(self, 'ImageDiff', command)
- actual_length = os.stat(actual_filename).st_size
- with open(actual_filename) as file:
- actual_file = file.read()
- expected_length = os.stat(expected_filename).st_size
- with open(expected_filename) as file:
- expected_file = file.read()
sp.write('Content-Length: %d\n%sContent-Length: %d\n%s' %
- (actual_length, actual_file, expected_length, expected_file))
+ (len(actual_contents), actual_contents,
+ len(expected_contents), expected_contents))
return sp
- def _diff_image_reply(self, sp, expected_filename, diff_filename):
+ def _diff_image_reply(self, sp, diff_filename):
timeout = 2.0
deadline = time.time() + timeout
output = sp.read_line(timeout)
@@ -178,7 +175,7 @@ class WebKitPort(base.Port):
with open(diff_filename, 'w') as file:
file.write(output)
elif sp.timed_out:
- _log.error("ImageDiff timed out on %s" % expected_filename)
+ _log.error("ImageDiff timed out")
elif sp.crashed:
_log.error("ImageDiff crashed")
sp.stop()
@@ -193,11 +190,6 @@ class WebKitPort(base.Port):
# This port doesn't require any specific configuration.
pass
- def show_results_html_file(self, results_filename):
- uri = self.filename_to_uri(results_filename)
- # FIXME: We should open results in the version of WebKit we built.
- webbrowser.open(uri, new=1)
-
def create_driver(self, image_path, options):
return WebKitDriver(self, image_path, options,
executive=self._executive)
@@ -255,7 +247,7 @@ class WebKitPort(base.Port):
"MathMLElement": ["mathml"],
"GraphicsLayer": ["compositing"],
"WebCoreHas3DRendering": ["animations/3d", "transforms/3d"],
- "WebGLShader": ["fast/canvas/webgl"],
+ "WebGLShader": ["fast/canvas/webgl", "compositing/webgl", "http/tests/canvas/webgl"],
"WMLElement": ["http/tests/wml", "fast/wml", "wml"],
"parseWCSSInputProperty": ["fast/wcss"],
"isXHTMLMPDocument": ["fast/xhtmlmp"],
@@ -418,12 +410,17 @@ class WebKitDriver(base.Driver):
def _driver_args(self):
driver_args = []
+
if self._image_path:
driver_args.append('--pixel-tests')
- # These are used by the Chromium DRT port
if self._options.use_drt:
- driver_args.append('--test-shell')
+ if self._options.accelerated_compositing:
+ driver_args.append('--enable-accelerated-compositing')
+
+ if self._options.accelerated_2d_canvas:
+ driver_args.append('--enable-accelerated-2d-canvas')
+
return driver_args
def start(self):
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/webkit_unittest.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/webkit_unittest.py
index fbfadc3..7b68310 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/port/webkit_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/webkit_unittest.py
@@ -53,7 +53,7 @@ class WebKitPortTest(unittest.TestCase):
def test_skipped_directories_for_symbols(self):
supported_symbols = ["GraphicsLayer", "WebCoreHas3DRendering", "isXHTMLMPDocument", "fooSymbol"]
- expected_directories = set(["mathml", "fast/canvas/webgl", "http/tests/wml", "fast/wml", "wml", "fast/wcss"])
+ expected_directories = set(["mathml", "fast/canvas/webgl", "compositing/webgl", "http/tests/canvas/webgl", "http/tests/wml", "fast/wml", "wml", "fast/wcss"])
result_directories = set(TestWebKitPort(supported_symbols, None)._skipped_tests_for_unsupported_features())
self.assertEqual(result_directories, expected_directories)
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/win.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/win.py
index e05a69d..9e30155 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/port/win.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/win.py
@@ -39,10 +39,9 @@ _log = logging.getLogger("webkitpy.layout_tests.port.win")
class WinPort(WebKitPort):
"""WebKit Win implementation of the Port class."""
- def __init__(self, port_name=None, options=None):
- if port_name is None:
- port_name = 'win'
- WebKitPort.__init__(self, port_name, options)
+ def __init__(self, **kwargs):
+ kwargs.setdefault('port_name', 'win')
+ WebKitPort.__init__(self, **kwargs)
def baseline_search_path(self):
# Based on code from old-run-webkit-tests expectedDirectoryForTest()
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests.py b/WebKitTools/Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests.py
index 3a9f923..e57ceb2 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests.py
@@ -55,9 +55,9 @@ import sys
import tempfile
import time
import urllib
-import webbrowser
import zipfile
+from webkitpy.common.system import user
from webkitpy.common.system.executive import run_command, ScriptError
import webkitpy.common.checkout.scm as scm
@@ -518,8 +518,15 @@ class Rebaseliner(object):
fallback_fullpath = os.path.normpath(
os.path.join(fallback_dir, fallback_file))
if fallback_fullpath.lower() != baseline_path.lower():
- if not self._diff_baselines(new_baseline,
- fallback_fullpath):
+ with codecs.open(new_baseline, "r",
+ None) as file_handle1:
+ new_output = file_handle1.read()
+ with codecs.open(fallback_fullpath, "r",
+ None) as file_handle2:
+ fallback_output = file_handle2.read()
+ is_image = baseline_path.lower().endswith('.png')
+ if not self._diff_baselines(new_output, fallback_output,
+ is_image):
_log.info(' Found same baseline at %s',
fallback_fullpath)
return True
@@ -528,31 +535,20 @@ class Rebaseliner(object):
return False
- def _diff_baselines(self, file1, file2):
+ def _diff_baselines(self, output1, output2, is_image):
"""Check whether two baselines are different.
Args:
- file1, file2: full paths of the baselines to compare.
+ output1, output2: contents of the baselines to compare.
Returns:
True if two files are different or have different extensions.
False otherwise.
"""
- ext1 = os.path.splitext(file1)[1].upper()
- ext2 = os.path.splitext(file2)[1].upper()
- if ext1 != ext2:
- _log.warn('Files to compare have different ext. '
- 'File1: %s; File2: %s', file1, file2)
- return True
-
- if ext1 == '.PNG':
- return self._port.diff_image(file1, file2)
+ if is_image:
+ return self._port.diff_image(output1, output2)
else:
- with codecs.open(file1, "r", "utf8") as file_handle1:
- output1 = file_handle1.read()
- with codecs.open(file2, "r", "utf8") as file_handle2:
- output2 = file_handle2.read()
return self._port.compare_text(output1, output2)
def _delete_baseline(self, filename):
@@ -593,7 +589,7 @@ class Rebaseliner(object):
# Or is new_expectations always a byte array?
with open(path, "w") as file:
file.write(new_expectations)
- self._scm.add(path)
+ # self._scm.add(path)
else:
_log.info('No test was rebaselined so nothing to remove.')
@@ -737,10 +733,7 @@ class HtmlGenerator(object):
"""Launch the rebaselining html in brwoser."""
_log.info('Launching html: "%s"', self._html_file)
-
- html_uri = self._target_port.filename_to_uri(self._html_file)
- webbrowser.open(html_uri, 1)
-
+ user.User().open_url(self._html_file)
_log.info('Html launched.')
def _generate_baseline_links(self, test_basename, suffix, platform):
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests_unittest.py b/WebKitTools/Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests_unittest.py
index dbb2b91..9ba3d6b 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests_unittest.py
@@ -103,15 +103,20 @@ class TestRebaseliner(unittest.TestCase):
def test_diff_baselines_txt(self):
rebaseliner = self.make_rebaseliner()
- path = os.path.join(rebaseliner._port.layout_tests_dir(),
- "passes", "text-expected.txt")
- self.assertFalse(rebaseliner._diff_baselines(path, path))
+ output = rebaseliner._port.expected_text(
+ os.path.join(rebaseliner._port.layout_tests_dir(),
+ 'passes/text.html'))
+ self.assertFalse(rebaseliner._diff_baselines(output, output,
+ is_image=False))
def test_diff_baselines_png(self):
+ return
rebaseliner = self.make_rebaseliner()
- path = os.path.join(rebaseliner._port.layout_tests_dir(),
- "passes", "image-expected.png")
- self.assertFalse(rebaseliner._diff_baselines(path, path))
+ image = rebaseliner._port.expected_image(
+ os.path.join(rebaseliner._port.layout_tests_dir(),
+ 'passes/image.html'))
+ self.assertFalse(rebaseliner._diff_baselines(image, image,
+ is_image=True))
if __name__ == '__main__':
unittest.main()
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/run_webkit_tests.py b/WebKitTools/Scripts/webkitpy/layout_tests/run_webkit_tests.py
index 14d4f0e..e9c6d2c 100755
--- a/WebKitTools/Scripts/webkitpy/layout_tests/run_webkit_tests.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/run_webkit_tests.py
@@ -68,12 +68,12 @@ from layout_package import json_layout_results_generator
from layout_package import printing
from layout_package import test_expectations
from layout_package import test_failures
-from layout_package import test_files
from layout_package import test_results_uploader
from test_types import image_diff
from test_types import text_diff
from test_types import test_type_base
+from webkitpy.common.system import user
from webkitpy.thirdparty import simplejson
import port
@@ -96,28 +96,21 @@ class TestInfo:
timeout: Timeout for running the test in TestShell.
"""
self.filename = filename
+ self._port = port
self.uri = port.filename_to_uri(filename)
self.timeout = timeout
- # FIXME: Confusing that the file is .checksum and we call it "hash"
- self._expected_hash_path = port.expected_filename(filename, '.checksum')
- self._have_read_expected_hash = False
- self._image_hash = None
-
- def _read_image_hash(self):
- if not os.path.exists(self._expected_hash_path):
- return None
-
- with codecs.open(self._expected_hash_path, "r", "ascii") as hash_file:
- return hash_file.read()
+ self._image_checksum = -1
def image_hash(self):
# Read the image_hash lazily to reduce startup time.
# This class is accessed across threads, but only one thread should
# ever be dealing with any given TestInfo so no locking is needed.
- if not self._have_read_expected_hash:
- self._have_read_expected_hash = True
- self._image_hash = self._read_image_hash()
- return self._image_hash
+ #
+ # Note that we use -1 to indicate that we haven't read the value,
+ # because expected_checksum() returns a string or None.
+ if self._image_checksum == -1:
+ self._image_checksum = self._port.expected_checksum(self.filename)
+ return self._image_checksum
class ResultSummary(object):
@@ -292,7 +285,7 @@ class TestRunner:
paths += last_unexpected_results
if self._options.test_list:
paths += read_test_files(self._options.test_list)
- self._test_files = test_files.gather_test_files(self._port, paths)
+ self._test_files = self._port.tests(paths)
def lint(self):
# Creating the expecations for each platform/configuration pair does
@@ -321,7 +314,7 @@ class TestRunner:
self._expectations = test_expectations.TestExpectations(
self._port, test_files, expectations_str, test_platform_name,
is_debug_mode, self._options.lint_test_files,
- tests_are_present=True, overrides=overrides_str)
+ overrides=overrides_str)
return self._expectations
except SyntaxError, err:
if self._options.lint_test_files:
@@ -865,7 +858,7 @@ class TestRunner:
self._printer.print_update("Clobbering old results in %s" %
self._options.results_directory)
layout_tests_dir = self._port.layout_tests_dir()
- possible_dirs = os.listdir(layout_tests_dir)
+ possible_dirs = self._port.test_dirs()
for dirname in possible_dirs:
if os.path.isdir(os.path.join(layout_tests_dir, dirname)):
shutil.rmtree(os.path.join(self._options.results_directory,
@@ -1408,6 +1401,7 @@ def run(port, options, args, regular_output=sys.stderr,
printer.print_update("Checking build ...")
if not port.check_build(test_runner.needs_http()):
+ _log.error("Build check failed")
return -1
result_summary = test_runner.set_up_run()
@@ -1515,6 +1509,20 @@ def parse_args(args=None):
optparse.make_option("--use-drt", action="store_true",
default=False,
help="Use DumpRenderTree instead of test_shell"),
+ optparse.make_option("--accelerated-compositing",
+ action="store_true",
+ help="Use hardware-accelated compositing for rendering"),
+ optparse.make_option("--no-accelerated-compositing",
+ action="store_false",
+ dest="accelerated_compositing",
+ help="Don't use hardware-accelerated compositing for rendering"),
+ optparse.make_option("--accelerated-2d-canvas",
+ action="store_true",
+ help="Use hardware-accelerated 2D Canvas calls"),
+ optparse.make_option("--no-accelerated-2d-canvas",
+ action="store_false",
+ dest="accelerated_2d_canvas",
+ help="Don't use hardware-accelerated 2D Canvas calls"),
]
# Missing Mac-specific old-run-webkit-tests options:
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py b/WebKitTools/Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py
index aa96962..6fe99d6 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py
@@ -42,6 +42,7 @@ import unittest
from webkitpy.common import array_stream
from webkitpy.common.system import outputcapture
+from webkitpy.common.system import user
from webkitpy.layout_tests import port
from webkitpy.layout_tests import run_webkit_tests
from webkitpy.layout_tests.layout_package import dump_render_tree_thread
@@ -49,6 +50,14 @@ from webkitpy.layout_tests.layout_package import dump_render_tree_thread
from webkitpy.thirdparty.mock import Mock
+class MockUser():
+ def __init__(self):
+ self.url = None
+
+ def open_url(self, url):
+ self.url = url
+
+
def passing_run(args=[], port_obj=None, record_results=False,
tests_included=False):
new_args = ['--print', 'nothing']
@@ -65,7 +74,8 @@ def passing_run(args=[], port_obj=None, record_results=False,
'failures/expected/*'])
options, parsed_args = run_webkit_tests.parse_args(new_args)
if port_obj is None:
- port_obj = port.get(options.platform, options)
+ port_obj = port.get(port_name=options.platform, options=options,
+ user=MockUser())
res = run_webkit_tests.run(port_obj, options, parsed_args)
return res == 0
@@ -77,20 +87,31 @@ def logging_run(args=[], tests_included=False):
new_args.extend(args)
if not tests_included:
new_args.extend(['passes',
- 'http/tests'
+ 'http/tests',
'websocket/tests',
'failures/expected/*'])
options, parsed_args = run_webkit_tests.parse_args(new_args)
- port_obj = port.get(options.platform, options)
+ user = MockUser()
+ port_obj = port.get(port_name=options.platform, options=options, user=user)
buildbot_output = array_stream.ArrayStream()
regular_output = array_stream.ArrayStream()
res = run_webkit_tests.run(port_obj, options, parsed_args,
buildbot_output=buildbot_output,
regular_output=regular_output)
- return (res, buildbot_output, regular_output)
+ return (res, buildbot_output, regular_output, user)
class MainTest(unittest.TestCase):
+ def test_accelerated_compositing(self):
+ # This just tests that we recognize the command line args
+ self.assertTrue(passing_run(['--accelerated-compositing']))
+ self.assertTrue(passing_run(['--no-accelerated-compositing']))
+
+ def test_accelerated_2d_canvas(self):
+ # This just tests that we recognize the command line args
+ self.assertTrue(passing_run(['--accelerated-2d-canvas']))
+ self.assertTrue(passing_run(['--no-accelerated-2d-canvas']))
+
def test_basic(self):
self.assertTrue(passing_run())
@@ -99,13 +120,13 @@ class MainTest(unittest.TestCase):
self.assertTrue(passing_run(['--batch-size', '2']))
def test_child_process_1(self):
- (res, buildbot_output, regular_output) = logging_run(
+ (res, buildbot_output, regular_output, user) = logging_run(
['--print', 'config', '--child-processes', '1'])
self.assertTrue('Running one DumpRenderTree\n'
in regular_output.get())
def test_child_processes_2(self):
- (res, buildbot_output, regular_output) = logging_run(
+ (res, buildbot_output, regular_output, user) = logging_run(
['--print', 'config', '--child-processes', '2'])
self.assertTrue('Running 2 DumpRenderTrees in parallel\n'
in regular_output.get())
@@ -119,15 +140,15 @@ class MainTest(unittest.TestCase):
self.assertTrue(passing_run(['--full-results-html']))
def test_help_printing(self):
- res, out, err = logging_run(['--help-printing'])
+ res, out, err, user = logging_run(['--help-printing'])
self.assertEqual(res, 0)
self.assertTrue(out.empty())
self.assertFalse(err.empty())
def test_hung_thread(self):
- res, out, err = logging_run(['--run-singly', '--time-out-ms=50',
- 'failures/expected/hang.html'],
- tests_included=True)
+ res, out, err, user = logging_run(['--run-singly', '--time-out-ms=50',
+ 'failures/expected/hang.html'],
+ tests_included=True)
self.assertEqual(res, 0)
self.assertFalse(out.empty())
self.assertFalse(err.empty())
@@ -140,26 +161,27 @@ class MainTest(unittest.TestCase):
def test_last_results(self):
passing_run(['--clobber-old-results'], record_results=True)
- (res, buildbot_output, regular_output) = logging_run(
+ (res, buildbot_output, regular_output, user) = logging_run(
['--print-last-failures'])
self.assertEqual(regular_output.get(), ['\n\n'])
self.assertEqual(buildbot_output.get(), [])
def test_lint_test_files(self):
# FIXME: add errors?
- res, out, err = logging_run(['--lint-test-files'], tests_included=True)
+ res, out, err, user = logging_run(['--lint-test-files'],
+ tests_included=True)
self.assertEqual(res, 0)
self.assertTrue(out.empty())
self.assertTrue(any(['lint succeeded' in msg for msg in err.get()]))
def test_no_tests_found(self):
- res, out, err = logging_run(['resources'], tests_included=True)
+ res, out, err, user = logging_run(['resources'], tests_included=True)
self.assertEqual(res, -1)
self.assertTrue(out.empty())
self.assertTrue('No tests to run.\n' in err.get())
def test_no_tests_found_2(self):
- res, out, err = logging_run(['foo'], tests_included=True)
+ res, out, err, user = logging_run(['foo'], tests_included=True)
self.assertEqual(res, -1)
self.assertTrue(out.empty())
self.assertTrue('No tests to run.\n' in err.get())
@@ -196,17 +218,19 @@ class MainTest(unittest.TestCase):
self.assertTrue(passing_run(['--test-list=%s' % filename],
tests_included=True))
os.remove(filename)
- res, out, err = logging_run(['--test-list=%s' % filename],
- tests_included=True)
+ res, out, err, user = logging_run(['--test-list=%s' % filename],
+ tests_included=True)
self.assertEqual(res, -1)
self.assertFalse(err.empty())
def test_unexpected_failures(self):
# Run tests including the unexpected failures.
- res, out, err = logging_run(tests_included=True)
+ self._url_opened = None
+ res, out, err, user = logging_run(tests_included=True)
self.assertEqual(res, 1)
self.assertFalse(out.empty())
self.assertFalse(err.empty())
+ self.assertEqual(user.url, '/tmp/layout-test-results/results.html')
def _mocked_open(original_open, file_list):
@@ -269,6 +293,7 @@ class RebaselineTest(unittest.TestCase):
finally:
codecs.open = original_open
+
class TestRunnerTest(unittest.TestCase):
def test_results_html(self):
mock_port = Mock()
@@ -306,11 +331,8 @@ class DryrunTest(unittest.TestCase):
'fast/html']))
def test_test(self):
- res, out, err = logging_run(['--platform', 'dryrun-test',
- '--pixel-tests'])
- self.assertEqual(res, 2)
- self.assertFalse(out.empty())
- self.assertFalse(err.empty())
+ self.assertTrue(passing_run(['--platform', 'dryrun-test',
+ '--pixel-tests']))
class TestThread(dump_render_tree_thread.WatchableThread):
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/test_types/image_diff.py b/WebKitTools/Scripts/webkitpy/layout_tests/test_types/image_diff.py
index 879646c..1ad0fe6 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/test_types/image_diff.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/test_types/image_diff.py
@@ -103,7 +103,11 @@ class ImageDiff(test_type_base.TestTypeBase):
expected_filename = self.output_filename(filename,
self.FILENAME_SUFFIX_EXPECTED + '.png')
- result = port.diff_image(expected_filename, actual_filename,
+ expected_image = port.expected_image(filename)
+ with codecs.open(actual_filename, 'r', None) as file:
+ actual_image = file.read()
+
+ result = port.diff_image(expected_image, actual_image,
diff_filename)
return result
@@ -124,19 +128,12 @@ class ImageDiff(test_type_base.TestTypeBase):
return failures
# Compare hashes.
- expected_hash_file = self._port.expected_filename(filename,
- '.checksum')
- expected_png_file = self._port.expected_filename(filename, '.png')
-
- # FIXME: We repeat this pattern often, we should share code.
- expected_hash = ''
- if os.path.exists(expected_hash_file):
- with codecs.open(expected_hash_file, "r", "ascii") as file:
- expected_hash = file.read()
+ expected_hash = self._port.expected_checksum(filename)
+ expected_png = self._port.expected_image(filename)
- if not os.path.isfile(expected_png_file):
+ if not expected_png:
# Report a missing expected PNG file.
- self.write_output_files(port, filename, '.checksum',
+ self.write_output_files(filename, '.checksum',
test_args.hash, expected_hash,
encoding="ascii",
print_text_diffs=False)
@@ -147,17 +144,21 @@ class ImageDiff(test_type_base.TestTypeBase):
# Hash matched (no diff needed, okay to return).
return failures
- self.write_output_files(port, filename, '.checksum',
+ self.write_output_files(filename, '.checksum',
test_args.hash, expected_hash,
encoding="ascii",
print_text_diffs=False)
+
+ # FIXME: combine next two lines
self._copy_output_png(filename, test_args.png_path, '-actual.png')
- self._copy_output_png(filename, expected_png_file, '-expected.png')
+ self.write_output_files(filename, '.png', output=None,
+ expected=expected_png,
+ encoding=None, print_text_diffs=False)
# Even though we only use the result in one codepath below but we
# still need to call CreateImageDiff for other codepaths.
images_are_different = self._create_image_diff(port, filename, configuration)
- if expected_hash == '':
+ if not expected_hash:
failures.append(test_failures.FailureMissingImageHash())
elif test_args.hash != expected_hash:
if images_are_different:
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/test_types/test_type_base.py b/WebKitTools/Scripts/webkitpy/layout_tests/test_types/test_type_base.py
index 753dbee..3a6e92b 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/test_types/test_type_base.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/test_types/test_type_base.py
@@ -120,7 +120,7 @@ class TestTypeBase(object):
output_path = self._port.expected_filename(filename, modifier)
_log.debug('resetting baseline result "%s"' % output_path)
- self._write_into_file_at_path(output_path, data, encoding)
+ self._port.update_baseline(output_path, data, encoding)
def output_filename(self, filename, modifier):
"""Returns a filename inside the output dir that contains modifier.
@@ -164,7 +164,7 @@ class TestTypeBase(object):
with codecs.open(file_path, "w", encoding=encoding) as file:
file.write(contents)
- def write_output_files(self, port, filename, file_type,
+ def write_output_files(self, filename, file_type,
output, expected, encoding,
print_text_diffs=False):
"""Writes the test output, the expected output and optionally the diff
@@ -201,16 +201,16 @@ class TestTypeBase(object):
# Note: We pass encoding=None for all diff writes, as we treat diff
# output as binary. Diff output may contain multiple files in
# conflicting encodings.
- diff = port.diff_text(expected, output, expected_filename, actual_filename)
+ diff = self._port.diff_text(expected, output, expected_filename, actual_filename)
diff_filename = self.output_filename(filename, self.FILENAME_SUFFIX_DIFF + file_type)
self._write_into_file_at_path(diff_filename, diff, encoding=None)
# Shell out to wdiff to get colored inline diffs.
- wdiff = port.wdiff_text(expected_filename, actual_filename)
+ wdiff = self._port.wdiff_text(expected_filename, actual_filename)
wdiff_filename = self.output_filename(filename, self.FILENAME_SUFFIX_WDIFF)
self._write_into_file_at_path(wdiff_filename, wdiff, encoding=None)
# Use WebKit's PrettyPatch.rb to get an HTML diff.
- pretty_patch = port.pretty_patch_text(diff_filename)
+ pretty_patch = self._port.pretty_patch_text(diff_filename)
pretty_patch_filename = self.output_filename(filename, self.FILENAME_SUFFIX_PRETTY_PATCH)
self._write_into_file_at_path(pretty_patch_filename, pretty_patch, encoding=None)
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/test_types/text_diff.py b/WebKitTools/Scripts/webkitpy/layout_tests/test_types/text_diff.py
index 50a9995..b1f621e 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/test_types/text_diff.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/test_types/text_diff.py
@@ -59,24 +59,7 @@ class TestTextDiff(test_type_base.TestTypeBase):
"""Given the filename of the test, read the expected output from a file
and normalize the text. Returns a string with the expected text, or ''
if the expected output file was not found."""
- # Read the port-specific expected text.
- expected_filename = self._port.expected_filename(filename, '.txt')
- return self._get_normalized_text(expected_filename)
-
- def _get_normalized_text(self, filename):
- # FIXME: We repeat this pattern often, we should share code.
- if not os.path.exists(filename):
- return ''
-
- # NOTE: -expected.txt files are ALWAYS utf-8. However,
- # we do not decode the output from DRT, so we should not
- # decode the -expected.txt values either to allow comparisons.
- with codecs.open(filename, "r", encoding=None) as file:
- text = file.read()
- # We could assert that the text is valid utf-8.
-
- # Normalize line endings
- return text.strip("\r\n").replace("\r\n", "\n") + "\n"
+ return self._port.expected_text(filename)
def compare_output(self, port, filename, output, test_args, configuration):
"""Implementation of CompareOutput that checks the output text against
@@ -99,7 +82,7 @@ class TestTextDiff(test_type_base.TestTypeBase):
# Write output files for new tests, too.
if port.compare_text(output, expected):
# Text doesn't match, write output files.
- self.write_output_files(port, filename, ".txt", output,
+ self.write_output_files(filename, ".txt", output,
expected, encoding=None,
print_text_diffs=True)
diff --git a/WebKitTools/Scripts/webkitpy/style/checkers/test_expectations.py b/WebKitTools/Scripts/webkitpy/style/checkers/test_expectations.py
index ddc3983..d2d67f3 100644
--- a/WebKitTools/Scripts/webkitpy/style/checkers/test_expectations.py
+++ b/WebKitTools/Scripts/webkitpy/style/checkers/test_expectations.py
@@ -93,8 +93,7 @@ class TestExpectationsChecker(object):
expectations = test_expectations.TestExpectationsFile(
port=self._port_obj, expectations=expectations_str, full_test_list=tests,
test_platform_name=self._port_to_check, is_debug_mode=False,
- is_lint_mode=True, suppress_errors=False, tests_are_present=True,
- overrides=overrides)
+ is_lint_mode=True, suppress_errors=False, overrides=overrides)
except SyntaxError, error:
errors = str(error).splitlines()
diff --git a/WebKitTools/Scripts/webkitpy/test/main.py b/WebKitTools/Scripts/webkitpy/test/main.py
index daf255f..9351768 100644
--- a/WebKitTools/Scripts/webkitpy/test/main.py
+++ b/WebKitTools/Scripts/webkitpy/test/main.py
@@ -78,7 +78,7 @@ class Tester(object):
return modules
- def run_tests(self, sys_argv):
+ def run_tests(self, sys_argv, external_package_paths=None):
"""Run the unit tests in all *_unittest.py modules in webkitpy.
This method excludes "webkitpy.common.checkout.scm_unittest" unless
@@ -88,6 +88,11 @@ class Tester(object):
sys_argv: A reference to sys.argv.
"""
+ if external_package_paths is None:
+ external_package_paths = []
+ else:
+ sys.path.extend(set(os.path.dirname(path) for path in external_package_paths))
+
if len(sys_argv) > 1 and not sys_argv[-1].startswith("-"):
# Then explicit modules or test names were provided, which
# the unittest module is equipped to handle.
@@ -97,9 +102,10 @@ class Tester(object):
# Otherwise, auto-detect all unit tests.
webkitpy_dir = os.path.dirname(webkitpy.__file__)
- unittest_paths = self._find_unittest_files(webkitpy_dir)
- modules = self._modules_from_paths(webkitpy_dir, unittest_paths)
+ modules = []
+ for path in [webkitpy_dir] + external_package_paths:
+ modules.extend(self._modules_from_paths(path, self._find_unittest_files(path)))
modules.sort()
# This is a sanity check to ensure that the unit-test discovery
diff --git a/WebKitTools/Scripts/webkitpy/tool/bot/commitqueuetask.py b/WebKitTools/Scripts/webkitpy/tool/bot/commitqueuetask.py
new file mode 100644
index 0000000..a347972
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/bot/commitqueuetask.py
@@ -0,0 +1,158 @@
+# 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.
+
+from webkitpy.common.system.executive import ScriptError
+
+
+class CommitQueueTask(object):
+ def __init__(self, tool, commit_queue, patch):
+ self._tool = tool
+ self._commit_queue = commit_queue
+ self._patch = patch
+ self._script_error = None
+
+ def _validate(self):
+ # Bugs might get closed, or patches might be obsoleted or r-'d while the
+ # commit-queue is processing.
+ self._patch = self._tool.bugs.fetch_attachment(self._patch.id())
+ if self._patch.is_obsolete():
+ return False
+ if self._patch.bug().is_closed():
+ return False
+ if not self._patch.committer():
+ return False
+ # Reviewer is not required. Missing reviewers will be caught during
+ # the ChangeLog check during landing.
+ return True
+
+ def _run_command(self, command, success_message, failure_message):
+ try:
+ self._commit_queue.run_webkit_patch(command)
+ self._commit_queue.command_passed(success_message, patch=self._patch)
+ return True
+ except ScriptError, e:
+ self._script_error = e
+ self.failure_status_id = self._commit_queue.command_failed(failure_message, script_error=self._script_error, patch=self._patch)
+ return False
+
+ def _apply(self):
+ return self._run_command([
+ "apply-attachment",
+ "--force-clean",
+ "--non-interactive",
+ "--quiet",
+ self._patch.id(),
+ ],
+ "Applied patch",
+ "Patch does not apply")
+
+ def _build(self):
+ return self._run_command([
+ "build",
+ "--no-clean",
+ "--no-update",
+ "--build",
+ "--build-style=both",
+ "--quiet",
+ ],
+ "Built patch",
+ "Patch does not build")
+
+ def _build_without_patch(self):
+ return self._run_command([
+ "build",
+ "--force-clean",
+ "--no-update",
+ "--build",
+ "--build-style=both",
+ "--quiet",
+ ],
+ "Able to build without patch",
+ "Unable to build without patch")
+
+ def _test(self):
+ return self._run_command([
+ "build-and-test",
+ "--no-clean",
+ "--no-update",
+ # Notice that we don't pass --build, which means we won't build!
+ "--test",
+ "--quiet",
+ "--non-interactive",
+ ],
+ "Passed tests",
+ "Patch does not pass tests")
+
+ def _build_and_test_without_patch(self):
+ return self._run_command([
+ "build-and-test",
+ "--force-clean",
+ "--no-update",
+ "--build",
+ "--test",
+ "--quiet",
+ "--non-interactive",
+ ],
+ "Able to pass tests without patch",
+ "Unable to pass tests without patch (tree is red?)")
+
+ def _land(self):
+ return self._run_command([
+ "land-attachment",
+ "--force-clean",
+ "--ignore-builders",
+ "--quiet",
+ "--non-interactive",
+ "--parent-command=commit-queue",
+ self._patch.id(),
+ ],
+ "Landed patch",
+ "Unable to land patch")
+
+ def run(self):
+ if not self._validate():
+ return False
+ if not self._apply():
+ raise self._script_error
+ if not self._build():
+ if not self._build_without_patch():
+ return False
+ raise self._script_error
+ if not self._patch.is_rollout():
+ if not self._test():
+ if not self._test():
+ if not self._build_and_test_without_patch():
+ return False
+ raise self._script_error
+ # Make sure the patch is still valid before landing (e.g., make sure
+ # no one has set commit-queue- since we started working on the patch.)
+ if not self._validate():
+ return False
+ if not self._land():
+ raise self._script_error
+ return True
diff --git a/WebKitTools/Scripts/webkitpy/tool/bot/commitqueuetask_unittest.py b/WebKitTools/Scripts/webkitpy/tool/bot/commitqueuetask_unittest.py
new file mode 100644
index 0000000..8b46146
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/bot/commitqueuetask_unittest.py
@@ -0,0 +1,194 @@
+# 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.
+
+from datetime import datetime
+import unittest
+
+from webkitpy.common.system.deprecated_logging import error, log
+from webkitpy.common.system.outputcapture import OutputCapture
+from webkitpy.thirdparty.mock import Mock
+from webkitpy.tool.bot.commitqueuetask import *
+from webkitpy.tool.mocktool import MockTool
+
+
+class MockCommitQueue:
+ def __init__(self, error_plan):
+ self._error_plan = error_plan
+
+ def run_webkit_patch(self, command):
+ log("run_webkit_patch: %s" % command)
+ if self._error_plan:
+ error = self._error_plan.pop(0)
+ if error:
+ raise error
+
+ def command_passed(self, success_message, patch):
+ log("command_passed: success_message='%s' patch='%s'" % (
+ success_message, patch.id()))
+
+ def command_failed(self, failure_message, script_error, patch):
+ log("command_failed: failure_message='%s' script_error='%s' patch='%s'" % (
+ failure_message, script_error, patch.id()))
+ return 3947
+
+
+class CommitQueueTaskTest(unittest.TestCase):
+ def _run_through_task(self, commit_queue, expected_stderr, expected_exception=None):
+ tool = MockTool(log_executive=True)
+ patch = tool.bugs.fetch_attachment(197)
+ task = CommitQueueTask(tool, commit_queue, patch)
+ OutputCapture().assert_outputs(self, task.run, expected_stderr=expected_stderr, expected_exception=expected_exception)
+
+ def test_success_case(self):
+ commit_queue = MockCommitQueue([])
+ expected_stderr = """run_webkit_patch: ['apply-attachment', '--force-clean', '--non-interactive', '--quiet', 197]
+command_passed: success_message='Applied patch' patch='197'
+run_webkit_patch: ['build', '--no-clean', '--no-update', '--build', '--build-style=both', '--quiet']
+command_passed: success_message='Built patch' patch='197'
+run_webkit_patch: ['build-and-test', '--no-clean', '--no-update', '--test', '--quiet', '--non-interactive']
+command_passed: success_message='Passed tests' patch='197'
+run_webkit_patch: ['land-attachment', '--force-clean', '--ignore-builders', '--quiet', '--non-interactive', '--parent-command=commit-queue', 197]
+command_passed: success_message='Landed patch' patch='197'
+"""
+ self._run_through_task(commit_queue, expected_stderr)
+
+ def test_apply_failure(self):
+ commit_queue = MockCommitQueue([
+ ScriptError("MOCK apply failure"),
+ ])
+ expected_stderr = """run_webkit_patch: ['apply-attachment', '--force-clean', '--non-interactive', '--quiet', 197]
+command_failed: failure_message='Patch does not apply' script_error='MOCK apply failure' patch='197'
+"""
+ self._run_through_task(commit_queue, expected_stderr, ScriptError)
+
+ def test_build_failure(self):
+ commit_queue = MockCommitQueue([
+ None,
+ ScriptError("MOCK build failure"),
+ ])
+ expected_stderr = """run_webkit_patch: ['apply-attachment', '--force-clean', '--non-interactive', '--quiet', 197]
+command_passed: success_message='Applied patch' patch='197'
+run_webkit_patch: ['build', '--no-clean', '--no-update', '--build', '--build-style=both', '--quiet']
+command_failed: failure_message='Patch does not build' script_error='MOCK build failure' patch='197'
+run_webkit_patch: ['build', '--force-clean', '--no-update', '--build', '--build-style=both', '--quiet']
+command_passed: success_message='Able to build without patch' patch='197'
+"""
+ self._run_through_task(commit_queue, expected_stderr, ScriptError)
+
+ def test_red_build_failure(self):
+ commit_queue = MockCommitQueue([
+ None,
+ ScriptError("MOCK build failure"),
+ ScriptError("MOCK clean build failure"),
+ ])
+ expected_stderr = """run_webkit_patch: ['apply-attachment', '--force-clean', '--non-interactive', '--quiet', 197]
+command_passed: success_message='Applied patch' patch='197'
+run_webkit_patch: ['build', '--no-clean', '--no-update', '--build', '--build-style=both', '--quiet']
+command_failed: failure_message='Patch does not build' script_error='MOCK build failure' patch='197'
+run_webkit_patch: ['build', '--force-clean', '--no-update', '--build', '--build-style=both', '--quiet']
+command_failed: failure_message='Unable to build without patch' script_error='MOCK clean build failure' patch='197'
+"""
+ self._run_through_task(commit_queue, expected_stderr)
+
+ def test_flaky_test_failure(self):
+ commit_queue = MockCommitQueue([
+ None,
+ None,
+ ScriptError("MOCK tests failure"),
+ ])
+ expected_stderr = """run_webkit_patch: ['apply-attachment', '--force-clean', '--non-interactive', '--quiet', 197]
+command_passed: success_message='Applied patch' patch='197'
+run_webkit_patch: ['build', '--no-clean', '--no-update', '--build', '--build-style=both', '--quiet']
+command_passed: success_message='Built patch' patch='197'
+run_webkit_patch: ['build-and-test', '--no-clean', '--no-update', '--test', '--quiet', '--non-interactive']
+command_failed: failure_message='Patch does not pass tests' script_error='MOCK tests failure' patch='197'
+run_webkit_patch: ['build-and-test', '--no-clean', '--no-update', '--test', '--quiet', '--non-interactive']
+command_passed: success_message='Passed tests' patch='197'
+run_webkit_patch: ['land-attachment', '--force-clean', '--ignore-builders', '--quiet', '--non-interactive', '--parent-command=commit-queue', 197]
+command_passed: success_message='Landed patch' patch='197'
+"""
+ self._run_through_task(commit_queue, expected_stderr)
+
+ def test_test_failure(self):
+ commit_queue = MockCommitQueue([
+ None,
+ None,
+ ScriptError("MOCK test failure"),
+ ScriptError("MOCK test failure again"),
+ ])
+ expected_stderr = """run_webkit_patch: ['apply-attachment', '--force-clean', '--non-interactive', '--quiet', 197]
+command_passed: success_message='Applied patch' patch='197'
+run_webkit_patch: ['build', '--no-clean', '--no-update', '--build', '--build-style=both', '--quiet']
+command_passed: success_message='Built patch' patch='197'
+run_webkit_patch: ['build-and-test', '--no-clean', '--no-update', '--test', '--quiet', '--non-interactive']
+command_failed: failure_message='Patch does not pass tests' script_error='MOCK test failure' patch='197'
+run_webkit_patch: ['build-and-test', '--no-clean', '--no-update', '--test', '--quiet', '--non-interactive']
+command_failed: failure_message='Patch does not pass tests' script_error='MOCK test failure again' patch='197'
+run_webkit_patch: ['build-and-test', '--force-clean', '--no-update', '--build', '--test', '--quiet', '--non-interactive']
+command_passed: success_message='Able to pass tests without patch' patch='197'
+"""
+ self._run_through_task(commit_queue, expected_stderr, ScriptError)
+
+ def test_red_test_failure(self):
+ commit_queue = MockCommitQueue([
+ None,
+ None,
+ ScriptError("MOCK test failure"),
+ ScriptError("MOCK test failure again"),
+ ScriptError("MOCK clean test failure"),
+ ])
+ expected_stderr = """run_webkit_patch: ['apply-attachment', '--force-clean', '--non-interactive', '--quiet', 197]
+command_passed: success_message='Applied patch' patch='197'
+run_webkit_patch: ['build', '--no-clean', '--no-update', '--build', '--build-style=both', '--quiet']
+command_passed: success_message='Built patch' patch='197'
+run_webkit_patch: ['build-and-test', '--no-clean', '--no-update', '--test', '--quiet', '--non-interactive']
+command_failed: failure_message='Patch does not pass tests' script_error='MOCK test failure' patch='197'
+run_webkit_patch: ['build-and-test', '--no-clean', '--no-update', '--test', '--quiet', '--non-interactive']
+command_failed: failure_message='Patch does not pass tests' script_error='MOCK test failure again' patch='197'
+run_webkit_patch: ['build-and-test', '--force-clean', '--no-update', '--build', '--test', '--quiet', '--non-interactive']
+command_failed: failure_message='Unable to pass tests without patch (tree is red?)' script_error='MOCK clean test failure' patch='197'
+"""
+ self._run_through_task(commit_queue, expected_stderr)
+
+ def test_land_failure(self):
+ commit_queue = MockCommitQueue([
+ None,
+ None,
+ None,
+ ScriptError("MOCK land failure"),
+ ])
+ expected_stderr = """run_webkit_patch: ['apply-attachment', '--force-clean', '--non-interactive', '--quiet', 197]
+command_passed: success_message='Applied patch' patch='197'
+run_webkit_patch: ['build', '--no-clean', '--no-update', '--build', '--build-style=both', '--quiet']
+command_passed: success_message='Built patch' patch='197'
+run_webkit_patch: ['build-and-test', '--no-clean', '--no-update', '--test', '--quiet', '--non-interactive']
+command_passed: success_message='Passed tests' patch='197'
+run_webkit_patch: ['land-attachment', '--force-clean', '--ignore-builders', '--quiet', '--non-interactive', '--parent-command=commit-queue', 197]
+command_failed: failure_message='Unable to land patch' script_error='MOCK land failure' patch='197'
+"""
+ self._run_through_task(commit_queue, expected_stderr, ScriptError)
diff --git a/WebKitTools/Scripts/webkitpy/tool/bot/feeders.py b/WebKitTools/Scripts/webkitpy/tool/bot/feeders.py
new file mode 100644
index 0000000..15eaaf3
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/bot/feeders.py
@@ -0,0 +1,73 @@
+# 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.
+
+from webkitpy.common.system.deprecated_logging import log
+from webkitpy.common.net.bugzilla import CommitterValidator
+
+
+class AbstractFeeder(object):
+ def __init__(self, tool):
+ self._tool = tool
+
+ def feed(tool):
+ raise NotImplementedError, "subclasses must implement"
+
+ def update_work_items(self, item_ids):
+ self._tool.status_server.update_work_items(self.queue_name, item_ids)
+ log("Feeding %s items %s" % (self.queue_name, item_ids))
+
+
+class CommitQueueFeeder(AbstractFeeder):
+ queue_name = "commit-queue"
+
+ def __init__(self, tool):
+ AbstractFeeder.__init__(self, tool)
+ self.committer_validator = CommitterValidator(self._tool.bugs)
+
+ def feed(self):
+ patches = self._validate_patches()
+ patches = sorted(patches, self._patch_cmp)
+ patch_ids = [patch.id() for patch in patches]
+ self.update_work_items(patch_ids)
+
+ def _patches_for_bug(self, bug_id):
+ return self._tool.bugs.fetch_bug(bug_id).commit_queued_patches(include_invalid=True)
+
+ def _validate_patches(self):
+ # Not using BugzillaQueries.fetch_patches_from_commit_queue() so we can reject patches with invalid committers/reviewers.
+ bug_ids = self._tool.bugs.queries.fetch_bug_ids_from_commit_queue()
+ all_patches = sum([self._patches_for_bug(bug_id) for bug_id in bug_ids], [])
+ return self.committer_validator.patches_after_rejecting_invalid_commiters_and_reviewers(all_patches)
+
+ def _patch_cmp(self, a, b):
+ # Sort first by is_rollout, then by attach_date.
+ # Reversing the order so that is_rollout is first.
+ rollout_cmp = cmp(b.is_rollout(), a.is_rollout())
+ if rollout_cmp != 0:
+ return rollout_cmp
+ return cmp(a.attach_date(), b.attach_date())
diff --git a/WebKitTools/Scripts/webkitpy/tool/bot/feeders_unittest.py b/WebKitTools/Scripts/webkitpy/tool/bot/feeders_unittest.py
new file mode 100644
index 0000000..5ce00b4
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/bot/feeders_unittest.py
@@ -0,0 +1,70 @@
+# Copyright (c) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+from datetime import datetime
+import unittest
+
+from webkitpy.common.system.outputcapture import OutputCapture
+from webkitpy.thirdparty.mock import Mock
+from webkitpy.tool.bot.feeders import *
+from webkitpy.tool.mocktool import MockTool
+
+
+class FeedersTest(unittest.TestCase):
+ def test_commit_queue_feeder(self):
+ feeder = CommitQueueFeeder(MockTool())
+ expected_stderr = u"""Warning, attachment 128 on bug 42 has invalid committer (non-committer@example.com)
+Warning, attachment 128 on bug 42 has invalid committer (non-committer@example.com)
+MOCK setting flag 'commit-queue' to '-' on attachment '128' with comment 'Rejecting patch 128 from commit-queue.' and additional comment 'non-committer@example.com does not have committer permissions according to http://trac.webkit.org/browser/trunk/WebKitTools/Scripts/webkitpy/common/config/committers.py.
+
+- If you do not have committer rights please read http://webkit.org/coding/contributing.html for instructions on how to use bugzilla flags.
+
+- If you have committer rights please correct the error in WebKitTools/Scripts/webkitpy/common/config/committers.py by adding yourself to the file (no review needed). The commit-queue restarts itself every 2 hours. After restart the commit-queue will correctly respect your committer rights.'
+MOCK: update_work_items: commit-queue [106, 197]
+Feeding commit-queue items [106, 197]
+"""
+ OutputCapture().assert_outputs(self, feeder.feed, expected_stderr=expected_stderr)
+
+ def _mock_attachment(self, is_rollout, attach_date):
+ attachment = Mock()
+ attachment.is_rollout = lambda: is_rollout
+ attachment.attach_date = lambda: attach_date
+ return attachment
+
+ def test_patch_cmp(self):
+ long_ago_date = datetime(1900, 1, 21)
+ recent_date = datetime(2010, 1, 21)
+ attachment1 = self._mock_attachment(is_rollout=False, attach_date=recent_date)
+ attachment2 = self._mock_attachment(is_rollout=False, attach_date=long_ago_date)
+ attachment3 = self._mock_attachment(is_rollout=True, attach_date=recent_date)
+ attachment4 = self._mock_attachment(is_rollout=True, attach_date=long_ago_date)
+ attachments = [attachment1, attachment2, attachment3, attachment4]
+ expected_sort = [attachment4, attachment3, attachment2, attachment1]
+ queue = CommitQueueFeeder(MockTool())
+ attachments.sort(queue._patch_cmp)
+ self.assertEqual(attachments, expected_sort)
diff --git a/WebKitTools/Scripts/webkitpy/tool/bot/queueengine.py b/WebKitTools/Scripts/webkitpy/tool/bot/queueengine.py
index 289dc4a..8118653 100644
--- a/WebKitTools/Scripts/webkitpy/tool/bot/queueengine.py
+++ b/WebKitTools/Scripts/webkitpy/tool/bot/queueengine.py
@@ -141,6 +141,8 @@ class QueueEngine:
def _open_work_log(self, work_item):
work_item_log_path = self._delegate.work_item_log_path(work_item)
+ if not work_item_log_path:
+ return
self._work_log = self._output_tee.add_log(work_item_log_path)
def _ensure_work_log_closed(self):
diff --git a/WebKitTools/Scripts/webkitpy/tool/commands/download.py b/WebKitTools/Scripts/webkitpy/tool/commands/download.py
index ed0e3d6..9916523 100644
--- a/WebKitTools/Scripts/webkitpy/tool/commands/download.py
+++ b/WebKitTools/Scripts/webkitpy/tool/commands/download.py
@@ -289,7 +289,7 @@ class AbstractRolloutPrepCommand(AbstractSequencedCommand):
argument_names = "REVISION REASON"
def _commit_info(self, revision):
- commit_info = self.tool.checkout().commit_info_for_revision(revision)
+ commit_info = self._tool.checkout().commit_info_for_revision(revision)
if commit_info and commit_info.bug_id():
# Note: Don't print a bug URL here because it will confuse the
# SheriffBot because the SheriffBot just greps the output
diff --git a/WebKitTools/Scripts/webkitpy/tool/commands/openbugs.py b/WebKitTools/Scripts/webkitpy/tool/commands/openbugs.py
index 5da5bbb..1b51c9f 100644
--- a/WebKitTools/Scripts/webkitpy/tool/commands/openbugs.py
+++ b/WebKitTools/Scripts/webkitpy/tool/commands/openbugs.py
@@ -41,8 +41,8 @@ class OpenBugs(AbstractDeclarativeCommand):
def _open_bugs(self, bug_ids):
for bug_id in bug_ids:
- bug_url = self.tool.bugs.bug_url_for_bug_id(bug_id)
- self.tool.user.open_url(bug_url)
+ bug_url = self._tool.bugs.bug_url_for_bug_id(bug_id)
+ self._tool.user.open_url(bug_url)
# _find_bugs_in_string mostly exists for easy unit testing.
def _find_bugs_in_string(self, string):
diff --git a/WebKitTools/Scripts/webkitpy/tool/commands/queries.py b/WebKitTools/Scripts/webkitpy/tool/commands/queries.py
index 9b8d162..c6e45aa 100644
--- a/WebKitTools/Scripts/webkitpy/tool/commands/queries.py
+++ b/WebKitTools/Scripts/webkitpy/tool/commands/queries.py
@@ -33,6 +33,7 @@ from optparse import make_option
from webkitpy.common.checkout.commitinfo import CommitInfo
from webkitpy.common.config.committers import CommitterList
from webkitpy.common.net.buildbot import BuildBot
+from webkitpy.common.net.regressionwindow import RegressionWindow
from webkitpy.common.system.user import User
from webkitpy.tool.grammar import pluralize
from webkitpy.tool.multicommandtool import AbstractDeclarativeCommand
@@ -112,7 +113,7 @@ class LastGreenRevision(AbstractDeclarativeCommand):
help_text = "Prints the last known good revision"
def execute(self, options, args, tool):
- print self.tool.buildbot.last_green_revision()
+ print self._tool.buildbot.last_green_revision()
class WhatBroke(AbstractDeclarativeCommand):
@@ -122,29 +123,26 @@ class WhatBroke(AbstractDeclarativeCommand):
def _print_builder_line(self, builder_name, max_name_width, status_message):
print "%s : %s" % (builder_name.ljust(max_name_width), status_message)
- # FIXME: This is slightly different from Builder.suspect_revisions_for_green_to_red_transition
- # due to needing to detect the "hit the limit" case an print a special message.
def _print_blame_information_for_builder(self, builder_status, name_width, avoid_flakey_tests=True):
- builder = self.tool.buildbot.builder_with_name(builder_status["name"])
+ builder = self._tool.buildbot.builder_with_name(builder_status["name"])
red_build = builder.build(builder_status["build_number"])
- (last_green_build, first_red_build) = builder.find_failure_transition(red_build)
- if not first_red_build:
+ regression_window = builder.find_regression_window(red_build)
+ if not regression_window.failing_build():
self._print_builder_line(builder.name(), name_width, "FAIL (error loading build information)")
return
- if not last_green_build:
- self._print_builder_line(builder.name(), name_width, "FAIL (blame-list: sometime before %s?)" % first_red_build.revision())
+ if not regression_window.build_before_failure():
+ self._print_builder_line(builder.name(), name_width, "FAIL (blame-list: sometime before %s?)" % regression_window.failing_build().revision())
return
- suspect_revisions = range(first_red_build.revision(), last_green_build.revision(), -1)
- suspect_revisions.reverse()
+ revisions = regression_window.revisions()
first_failure_message = ""
- if (first_red_build == builder.build(builder_status["build_number"])):
+ if (regression_window.failing_build() == builder.build(builder_status["build_number"])):
first_failure_message = " FIRST FAILURE, possibly a flaky test"
- self._print_builder_line(builder.name(), name_width, "FAIL (blame-list: %s%s)" % (suspect_revisions, first_failure_message))
- for revision in suspect_revisions:
- commit_info = self.tool.checkout().commit_info_for_revision(revision)
+ self._print_builder_line(builder.name(), name_width, "FAIL (blame-list: %s%s)" % (revisions, first_failure_message))
+ for revision in revisions:
+ commit_info = self._tool.checkout().commit_info_for_revision(revision)
if commit_info:
- print commit_info.blame_string(self.tool.bugs)
+ print commit_info.blame_string(self._tool.bugs)
else:
print "FAILED to fetch CommitInfo for r%s, likely missing ChangeLog" % revision
@@ -169,7 +167,7 @@ class WhoBrokeIt(AbstractDeclarativeCommand):
help_text = "Print a list of revisions causing failures on %s" % BuildBot.default_host
def execute(self, options, args, tool):
- for revision, builders in self.tool.buildbot.revisions_causing_failures(False).items():
+ for revision, builders in self._tool.buildbot.failure_map(False).revisions_causing_failures().items():
print "r%s appears to have broken %s" % (revision, [builder.name() for builder in builders])
@@ -188,7 +186,7 @@ class ResultsFor(AbstractDeclarativeCommand):
print " %s" % filename
def execute(self, options, args, tool):
- builders = self.tool.buildbot.builders()
+ builders = self._tool.buildbot.builders()
for builder in builders:
print "%s:" % builder.name()
build = builder.build_for_revision(args[0], allow_failed_lookups=True)
@@ -200,13 +198,14 @@ class FailureReason(AbstractDeclarativeCommand):
help_text = "Lists revisions where individual test failures started at %s" % BuildBot.default_host
def _print_blame_information_for_transition(self, green_build, red_build, failing_tests):
- suspect_revisions = green_build.builder().suspect_revisions_for_transition(green_build, red_build)
+ regression_window = RegressionWindow(green_build, red_build)
+ revisions = regression_window.revisions()
print "SUCCESS: Build %s (r%s) was the first to show failures: %s" % (red_build._number, red_build.revision(), failing_tests)
print "Suspect revisions:"
- for revision in suspect_revisions:
- commit_info = self.tool.checkout().commit_info_for_revision(revision)
+ for revision in revisions:
+ commit_info = self._tool.checkout().commit_info_for_revision(revision)
if commit_info:
- print commit_info.blame_string(self.tool.bugs)
+ print commit_info.blame_string(self._tool.bugs)
else:
print "FAILED to fetch CommitInfo for r%s, likely missing ChangeLog" % revision
@@ -255,7 +254,7 @@ class FailureReason(AbstractDeclarativeCommand):
return 0
def _builder_to_explain(self):
- builder_statuses = self.tool.buildbot.builder_statuses()
+ builder_statuses = self._tool.buildbot.builder_statuses()
red_statuses = [status for status in builder_statuses if not status["is_green"]]
print "%s failing" % (pluralize("builder", len(red_statuses)))
builder_choices = [status["name"] for status in red_statuses]
@@ -264,11 +263,11 @@ class FailureReason(AbstractDeclarativeCommand):
# FIXME: prompt_with_list should really take a set of objects and a set of names and then return the object.
for status in red_statuses:
if status["name"] == chosen_name:
- return (self.tool.buildbot.builder_with_name(chosen_name), status["built_revision"])
+ return (self._tool.buildbot.builder_with_name(chosen_name), status["built_revision"])
def execute(self, options, args, tool):
(builder, latest_revision) = self._builder_to_explain()
- start_revision = self.tool.user.prompt("Revision to walk backwards from? [%s] " % latest_revision) or latest_revision
+ start_revision = self._tool.user.prompt("Revision to walk backwards from? [%s] " % latest_revision) or latest_revision
if not start_revision:
print "Revision required."
return 1
diff --git a/WebKitTools/Scripts/webkitpy/tool/commands/queues.py b/WebKitTools/Scripts/webkitpy/tool/commands/queues.py
index bc9ee42..80fd2ea 100644
--- a/WebKitTools/Scripts/webkitpy/tool/commands/queues.py
+++ b/WebKitTools/Scripts/webkitpy/tool/commands/queues.py
@@ -27,6 +27,7 @@
# (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 time
import traceback
import os
@@ -39,6 +40,8 @@ from webkitpy.common.net.statusserver import StatusServer
from webkitpy.common.system.executive import ScriptError
from webkitpy.common.system.deprecated_logging import error, log
from webkitpy.tool.commands.stepsequence import StepSequenceErrorHandler
+from webkitpy.tool.bot.commitqueuetask import CommitQueueTask
+from webkitpy.tool.bot.feeders import CommitQueueFeeder
from webkitpy.tool.bot.patchcollection import PersistentPatchCollection, PersistentPatchCollectionDelegate
from webkitpy.tool.bot.queueengine import QueueEngine, QueueEngineDelegate
from webkitpy.tool.grammar import pluralize
@@ -50,6 +53,7 @@ class AbstractQueue(Command, QueueEngineDelegate):
_pass_status = "Pass"
_fail_status = "Fail"
+ _retry_status = "Retry"
_error_status = "Error"
def __init__(self, options=None): # Default values should never be collections (like []) as default values are shared between invocations
@@ -62,20 +66,20 @@ class AbstractQueue(Command, QueueEngineDelegate):
def _cc_watchers(self, bug_id):
try:
- self.tool.bugs.add_cc_to_bug(bug_id, self.watchers)
+ self._tool.bugs.add_cc_to_bug(bug_id, self.watchers)
except Exception, e:
traceback.print_exc()
log("Failed to CC watchers.")
def run_webkit_patch(self, args):
- webkit_patch_args = [self.tool.path()]
+ webkit_patch_args = [self._tool.path()]
# FIXME: This is a hack, we should have a more general way to pass global options.
# FIXME: We must always pass global options and their value in one argument
# because our global option code looks for the first argument which does
# not begin with "-" and assumes that is the command name.
- webkit_patch_args += ["--status-host=%s" % self.tool.status_server.host]
+ webkit_patch_args += ["--status-host=%s" % self._tool.status_server.host]
webkit_patch_args.extend(args)
- return self.tool.executive.run_and_throw_if_fail(webkit_patch_args)
+ return self._tool.executive.run_and_throw_if_fail(webkit_patch_args)
def _log_directory(self):
return "%s-logs" % self.name
@@ -89,16 +93,16 @@ class AbstractQueue(Command, QueueEngineDelegate):
raise NotImplementedError, "subclasses must implement"
def begin_work_queue(self):
- log("CAUTION: %s will discard all local changes in \"%s\"" % (self.name, self.tool.scm().checkout_root))
+ log("CAUTION: %s will discard all local changes in \"%s\"" % (self.name, self._tool.scm().checkout_root))
if self.options.confirm:
- response = self.tool.user.prompt("Are you sure? Type \"yes\" to continue: ")
+ response = self._tool.user.prompt("Are you sure? Type \"yes\" to continue: ")
if (response != "yes"):
error("User declined.")
log("Running WebKit %s." % self.name)
- self.tool.status_server.update_status(self.name, "Starting Queue")
+ self._tool.status_server.update_status(self.name, "Starting Queue")
def stop_work_queue(self, reason):
- self.tool.status_server.update_status(self.name, "Stopping Queue, reason: %s" % reason)
+ self._tool.status_server.update_status(self.name, "Stopping Queue, reason: %s" % reason)
def should_continue_work_queue(self):
self._iteration_count += 1
@@ -120,8 +124,8 @@ class AbstractQueue(Command, QueueEngineDelegate):
def execute(self, options, args, tool, engine=QueueEngine):
self.options = options # FIXME: This code is wrong. Command.options is a list, this assumes an Options element!
- self.tool = tool # FIXME: This code is wrong too! Command.bind_to_tool handles this!
- return engine(self.name, self, self.tool.wakeup_event).run()
+ self._tool = tool # FIXME: This code is wrong too! Command.bind_to_tool handles this!
+ return engine(self.name, self, self._tool.wakeup_event).run()
@classmethod
def _log_from_script_error_for_upload(cls, script_error, output_limit=None):
@@ -144,20 +148,47 @@ class AbstractQueue(Command, QueueEngineDelegate):
return tool.status_server.update_status(cls.name, message, state["patch"], failure_log)
+class FeederQueue(AbstractQueue):
+ name = "feeder-queue"
+
+ _sleep_duration = 30 # seconds
+
+ # AbstractPatchQueue methods
+
+ def begin_work_queue(self):
+ AbstractQueue.begin_work_queue(self)
+ self.feeders = [
+ CommitQueueFeeder(self._tool),
+ ]
+
+ def next_work_item(self):
+ # This really show inherit from some more basic class that doesn't
+ # understand work items, but the base class in the heirarchy currently
+ # understands work items.
+ return "synthetic-work-item"
+
+ def should_proceed_with_work_item(self, work_item):
+ return True
+
+ def process_work_item(self, work_item):
+ for feeder in self.feeders:
+ feeder.feed()
+ time.sleep(self._sleep_duration)
+ return True
+
+ def work_item_log_path(self, work_item):
+ return None
+
+ def handle_unexpected_error(self, work_item, message):
+ log(message)
+
+
class AbstractPatchQueue(AbstractQueue):
def _update_status(self, message, patch=None, results_file=None):
- self.tool.status_server.update_status(self.name, message, patch, results_file)
-
- # Note, eventually this will be done by a separate "feeder" queue
- # whose job it is to poll bugzilla and feed work items into the
- # status server for other queues to munch on.
- def _update_work_items(self, patch_ids):
- self.tool.status_server.update_work_items(self.name, patch_ids)
- if patch_ids:
- self.log_progress(patch_ids)
+ return self._tool.status_server.update_status(self.name, message, patch, results_file)
def _fetch_next_work_item(self):
- return self.tool.status_server.next_work_item(self.name)
+ return self._tool.status_server.next_work_item(self.name)
def _did_pass(self, patch):
self._update_status(self._pass_status, patch)
@@ -165,6 +196,9 @@ class AbstractPatchQueue(AbstractQueue):
def _did_fail(self, patch):
self._update_status(self._fail_status, patch)
+ def _did_retry(self, patch):
+ self._update_status(self._retry_status, patch)
+
def _did_error(self, patch, reason):
message = "%s: %s" % (self._error_status, reason)
self._update_status(message, patch)
@@ -172,178 +206,63 @@ class AbstractPatchQueue(AbstractQueue):
def work_item_log_path(self, patch):
return os.path.join(self._log_directory(), "%s.log" % patch.bug_id())
- def log_progress(self, patch_ids):
- log("%s in %s [%s]" % (pluralize("patch", len(patch_ids)), self.name, ", ".join(map(str, patch_ids))))
-
class CommitQueue(AbstractPatchQueue, StepSequenceErrorHandler):
name = "commit-queue"
- def __init__(self):
- AbstractPatchQueue.__init__(self)
# AbstractPatchQueue methods
def begin_work_queue(self):
AbstractPatchQueue.begin_work_queue(self)
- self.committer_validator = CommitterValidator(self.tool.bugs)
-
- def _validate_patches_in_commit_queue(self):
- # Not using BugzillaQueries.fetch_patches_from_commit_queue() so we can reject patches with invalid committers/reviewers.
- bug_ids = self.tool.bugs.queries.fetch_bug_ids_from_commit_queue()
- all_patches = sum([self.tool.bugs.fetch_bug(bug_id).commit_queued_patches(include_invalid=True) for bug_id in bug_ids], [])
- return self.committer_validator.patches_after_rejecting_invalid_commiters_and_reviewers(all_patches)
-
- def _patch_cmp(self, a, b):
- # Sort first by is_rollout, then by attach_date.
- # Reversing the order so that is_rollout is first.
- rollout_cmp = cmp(b.is_rollout(), a.is_rollout())
- if (rollout_cmp != 0):
- return rollout_cmp
- return cmp(a.attach_date(), b.attach_date())
-
- def _feed_work_items_to_server(self):
- # Grab the set of patches from bugzilla, sort them, and update the status server.
- # Eventually this will all be done by a separate feeder queue.
- patches = self._validate_patches_in_commit_queue()
- patches = sorted(patches, self._patch_cmp)
- self._update_work_items([patch.id() for patch in patches])
+ self.committer_validator = CommitterValidator(self._tool.bugs)
def next_work_item(self):
- self._feed_work_items_to_server()
- # The grab the next patch to work on back from the status server.
patch_id = self._fetch_next_work_item()
if not patch_id:
return None
- return self.tool.bugs.fetch_attachment(patch_id)
-
- def _can_build_and_test_without_patch(self):
- try:
- self.run_webkit_patch([
- "build-and-test",
- "--force-clean",
- "--build",
- "--test",
- "--non-interactive",
- "--no-update",
- "--build-style=both",
- "--quiet"])
- return True
- except ScriptError, e:
- failure_log = self._log_from_script_error_for_upload(e)
- self._update_status("Unable to build and test without patch", results_file=failure_log)
- return False
+ return self._tool.bugs.fetch_attachment(patch_id)
def should_proceed_with_work_item(self, patch):
patch_text = "rollout patch" if patch.is_rollout() else "patch"
- self._update_status("Landing %s" % patch_text, patch)
+ self._update_status("Processing %s" % patch_text, patch)
return True
- def _build_and_test_patch(self, patch, first_run=False):
+ def process_work_item(self, patch):
+ self._cc_watchers(patch.bug_id())
+ task = CommitQueueTask(self._tool, self, patch)
try:
- args = [
- "build-and-test-attachment",
- "--force-clean",
- "--build",
- "--non-interactive",
- "--build-style=both",
- "--quiet",
- patch.id()
- ]
- # We don't bother to run tests for rollouts as that makes them too slow.
- if not patch.is_rollout():
- args.append("--test")
- if not first_run:
- # The first time through, we don't reject the patch from the
- # commit queue because we want to make sure we can build and
- # test ourselves. However, the second time through, we
- # register ourselves as the parent-command so we can reject
- # the patch on failure.
- args.append("--parent-command=commit-queue")
- # The second time through, we also don't want to update so we
- # know we're testing the same revision that we successfully
- # built and tested.
- args.append("--no-update")
- self.run_webkit_patch(args)
- return True
+ if task.run():
+ self._did_pass(patch)
+ return True
+ self._did_retry(patch)
except ScriptError, e:
- failure_log = self._log_from_script_error_for_upload(e)
- self._update_status("Unable to build and test patch", patch=patch, results_file=failure_log)
- if first_run:
- return False
+ validator = CommitterValidator(self._tool.bugs)
+ validator.reject_patch_from_commit_queue(patch.id(), self._error_message_for_bug(task.failure_status_id, e))
self._did_fail(patch)
- raise
-
- def _revalidate_patch(self, patch):
- # Bugs might get closed, or patches might be obsoleted or r-'d while the
- # commit-queue is processing. Do one last minute check before landing.
- patch = self.tool.bugs.fetch_attachment(patch.id())
- if patch.is_obsolete():
- return None
- if patch.bug().is_closed():
- return None
- if not patch.committer():
- return None
- # Reviewer is not required. Misisng reviewers will be caught during the ChangeLog check during landing.
- return patch
-
- def _land(self, patch):
- try:
- args = [
- "land-attachment",
- "--force-clean",
- "--non-interactive",
- "--ignore-builders",
- "--quiet",
- "--parent-command=commit-queue",
- patch.id(),
- ]
- self.run_webkit_patch(args)
- self._did_pass(patch)
- except ScriptError, e:
- failure_log = self._log_from_script_error_for_upload(e)
- self._update_status("Unable to land patch", patch=patch, results_file=failure_log)
- self._did_fail(patch)
- raise
-
- def process_work_item(self, patch):
- self._cc_watchers(patch.bug_id())
- if not self._build_and_test_patch(patch, first_run=True):
- self._update_status("Building and testing without the patch as a sanity check", patch)
- # The patch failed to build and test. It's possible that the
- # tree is busted. To check that case, we try to build and test
- # without the patch.
- if not self._can_build_and_test_without_patch():
- return False
- self._update_status("Build and test succeeded, trying again with patch", patch)
- # Hum, looks like the patch is actually bad. Of course, we could
- # have been bitten by a flaky test the first time around. We try
- # to build and test again. If it fails a second time, we're pretty
- # sure its a bad test and re can reject it outright.
- self._build_and_test_patch(patch)
- # Do one last check to catch any bug changes (cq-, closed, reviewer changed, etc.)
- # This helps catch races between the bots if locks expire.
- patch = self._revalidate_patch(patch)
- if not patch:
- return False
- self._land(patch)
- return True
def handle_unexpected_error(self, patch, message):
self.committer_validator.reject_patch_from_commit_queue(patch.id(), message)
- # StepSequenceErrorHandler methods
- @staticmethod
- def _error_message_for_bug(tool, status_id, script_error):
+ def command_passed(self, message, patch):
+ self._update_status(message, patch=patch)
+
+ def command_failed(self, message, script_error, patch):
+ failure_log = self._log_from_script_error_for_upload(script_error)
+ return self._update_status(message, patch=patch, results_file=failure_log)
+
+ def _error_message_for_bug(self, status_id, script_error):
if not script_error.output:
return script_error.message_with_output()
- results_link = tool.status_server.results_url_for_status(status_id)
+ results_link = self._tool.status_server.results_url_for_status(status_id)
return "%s\nFull output: %s" % (script_error.message_with_output(), results_link)
- @classmethod
+ # StepSequenceErrorHandler methods
+
def handle_script_error(cls, tool, state, script_error):
- status_id = cls._update_status_for_script_error(tool, state, script_error)
- validator = CommitterValidator(tool.bugs)
- validator.reject_patch_from_commit_queue(state["patch"].id(), cls._error_message_for_bug(tool, status_id, script_error))
+ # Hitting this error handler should be pretty rare. It does occur,
+ # however, when a patch no longer applies to top-of-tree in the final
+ # land step.
+ log(script_error.message_with_output())
@classmethod
def handle_checkout_needs_update(cls, tool, state, options, error):
@@ -368,7 +287,7 @@ class RietveldUploadQueue(AbstractPatchQueue, StepSequenceErrorHandler):
# AbstractPatchQueue methods
def next_work_item(self):
- patch_id = self.tool.bugs.queries.fetch_first_patch_from_rietveld_queue()
+ patch_id = self._tool.bugs.queries.fetch_first_patch_from_rietveld_queue()
if patch_id:
return patch_id
self._update_status("Empty queue")
@@ -393,7 +312,7 @@ class RietveldUploadQueue(AbstractPatchQueue, StepSequenceErrorHandler):
def handle_unexpected_error(self, patch, message):
log(message)
- self._reject_patch(self.tool, patch.id())
+ self._reject_patch(self._tool, patch.id())
# StepSequenceErrorHandler methods
@@ -417,10 +336,10 @@ class AbstractReviewQueue(AbstractPatchQueue, PersistentPatchCollectionDelegate,
return self.name
def fetch_potential_patch_ids(self):
- return self.tool.bugs.queries.fetch_attachment_ids_from_review_queue()
+ return self._tool.bugs.queries.fetch_attachment_ids_from_review_queue()
def status_server(self):
- return self.tool.status_server
+ return self._tool.status_server
def is_terminal_status(self, status):
return status == "Pass" or status == "Fail" or status.startswith("Error:")
@@ -434,7 +353,7 @@ class AbstractReviewQueue(AbstractPatchQueue, PersistentPatchCollectionDelegate,
def next_work_item(self):
patch_id = self._patches.next()
if patch_id:
- return self.tool.bugs.fetch_attachment(patch_id)
+ return self._tool.bugs.fetch_attachment(patch_id)
def should_proceed_with_work_item(self, patch):
raise NotImplementedError, "subclasses must implement"
diff --git a/WebKitTools/Scripts/webkitpy/tool/commands/queues_unittest.py b/WebKitTools/Scripts/webkitpy/tool/commands/queues_unittest.py
index 2deee76..029814e 100644
--- a/WebKitTools/Scripts/webkitpy/tool/commands/queues_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/tool/commands/queues_unittest.py
@@ -47,20 +47,16 @@ class TestReviewQueue(AbstractReviewQueue):
name = "test-review-queue"
+class TestFeederQueue(FeederQueue):
+ _sleep_duration = 0
+
+
class MockRolloutPatch(MockPatch):
def is_rollout(self):
return True
class AbstractQueueTest(CommandsTest):
- def _assert_log_progress_output(self, patch_ids, progress_output):
- OutputCapture().assert_outputs(self, TestQueue().log_progress, [patch_ids], expected_stderr=progress_output)
-
- def test_log_progress(self):
- self._assert_log_progress_output([1,2,3], "3 patches in test-queue [1, 2, 3]\n")
- self._assert_log_progress_output(["1","2","3"], "3 patches in test-queue [1, 2, 3]\n")
- self._assert_log_progress_output([1], "1 patch in test-queue [1]\n")
-
def test_log_directory(self):
self.assertEquals(TestQueue()._log_directory(), "test-queue-logs")
@@ -115,6 +111,29 @@ class AbstractQueueTest(CommandsTest):
self._assert_log_message(script_error, expected_output)
+class FeederQueueTest(QueuesTest):
+ def test_feeder_queue(self):
+ queue = TestFeederQueue()
+ tool = MockTool(log_executive=True)
+ expected_stderr = {
+ "begin_work_queue": self._default_begin_work_queue_stderr("feeder-queue", MockSCM.fake_checkout_root),
+ "should_proceed_with_work_item": "",
+ "next_work_item": "",
+ "process_work_item": """Warning, attachment 128 on bug 42 has invalid committer (non-committer@example.com)
+Warning, attachment 128 on bug 42 has invalid committer (non-committer@example.com)
+MOCK setting flag 'commit-queue' to '-' on attachment '128' with comment 'Rejecting patch 128 from commit-queue.' and additional comment 'non-committer@example.com does not have committer permissions according to http://trac.webkit.org/browser/trunk/WebKitTools/Scripts/webkitpy/common/config/committers.py.
+
+- If you do not have committer rights please read http://webkit.org/coding/contributing.html for instructions on how to use bugzilla flags.
+
+- If you have committer rights please correct the error in WebKitTools/Scripts/webkitpy/common/config/committers.py by adding yourself to the file (no review needed). The commit-queue restarts itself every 2 hours. After restart the commit-queue will correctly respect your committer rights.'
+MOCK: update_work_items: commit-queue [106, 197]
+Feeding commit-queue items [106, 197]
+""",
+ "handle_unexpected_error": "Mock error message\n",
+ }
+ self.assert_queue_outputs(queue, tool=tool, expected_stderr=expected_stderr)
+
+
class AbstractPatchQueueTest(CommandsTest):
def test_fetch_next_work_item(self):
queue = AbstractPatchQueue()
@@ -167,7 +186,7 @@ class SecondThoughtsCommitQueue(CommitQueue):
"attacher_email": "Contributer1",
}
patch = Attachment(attachment_dictionary, None)
- self.tool.bugs.set_override_patch(patch)
+ self._tool.bugs.set_override_patch(patch)
return True
@@ -175,40 +194,58 @@ class CommitQueueTest(QueuesTest):
def test_commit_queue(self):
expected_stderr = {
"begin_work_queue": self._default_begin_work_queue_stderr("commit-queue", MockSCM.fake_checkout_root),
- "should_proceed_with_work_item": "MOCK: update_status: commit-queue Landing patch\n",
- # FIXME: The commit-queue warns about bad committers twice. This is due to the fact that we access Attachment.reviewer() twice and it logs each time.
- "next_work_item": """Warning, attachment 128 on bug 42 has invalid committer (non-committer@example.com)
-Warning, attachment 128 on bug 42 has invalid committer (non-committer@example.com)
-MOCK setting flag 'commit-queue' to '-' on attachment '128' with comment 'Rejecting patch 128 from commit-queue.' and additional comment 'non-committer@example.com does not have committer permissions according to http://trac.webkit.org/browser/trunk/WebKitTools/Scripts/webkitpy/common/config/committers.py.\n\n- If you do not have committer rights please read http://webkit.org/coding/contributing.html for instructions on how to use bugzilla flags.\n\n- If you have committer rights please correct the error in WebKitTools/Scripts/webkitpy/common/config/committers.py by adding yourself to the file (no review needed). The commit-queue restarts itself every 2 hours. After restart the commit-queue will correctly respect your committer rights.'
-MOCK: update_work_items: commit-queue [106, 197]
-2 patches in commit-queue [106, 197]
+ "should_proceed_with_work_item": "MOCK: update_status: commit-queue Processing patch\n",
+ "next_work_item": "",
+ "process_work_item": """MOCK: update_status: commit-queue Applied patch
+MOCK: update_status: commit-queue Built patch
+MOCK: update_status: commit-queue Passed tests
+MOCK: update_status: commit-queue Landed patch
+MOCK: update_status: commit-queue Pass
""",
- "process_work_item": "MOCK: update_status: commit-queue Pass\n",
"handle_unexpected_error": "MOCK setting flag 'commit-queue' to '-' on attachment '197' with comment 'Rejecting patch 197 from commit-queue.' and additional comment 'Mock error message'\n",
- "handle_script_error": "MOCK: update_status: commit-queue ScriptError error message\nMOCK setting flag 'commit-queue' to '-' on attachment '197' with comment 'Rejecting patch 197 from commit-queue.' and additional comment 'ScriptError error message'\n",
+ "handle_script_error": "ScriptError error message\n",
}
self.assert_queue_outputs(CommitQueue(), expected_stderr=expected_stderr)
+ def test_commit_queue_failure(self):
+ expected_stderr = {
+ "begin_work_queue": self._default_begin_work_queue_stderr("commit-queue", MockSCM.fake_checkout_root),
+ "should_proceed_with_work_item": "MOCK: update_status: commit-queue Processing patch\n",
+ "next_work_item": "",
+ "process_work_item": """MOCK: update_status: commit-queue Patch does not apply
+MOCK setting flag 'commit-queue' to '-' on attachment '197' with comment 'Rejecting patch 197 from commit-queue.' and additional comment 'MOCK script error'
+MOCK: update_status: commit-queue Fail
+""",
+ "handle_unexpected_error": "MOCK setting flag 'commit-queue' to '-' on attachment '197' with comment 'Rejecting patch 197 from commit-queue.' and additional comment 'Mock error message'\n",
+ "handle_script_error": "ScriptError error message\n",
+ }
+ queue = CommitQueue()
+
+ def mock_run_webkit_patch(command):
+ raise ScriptError('MOCK script error')
+
+ queue.run_webkit_patch = mock_run_webkit_patch
+ self.assert_queue_outputs(queue, expected_stderr=expected_stderr)
+
def test_rollout(self):
tool = MockTool(log_executive=True)
tool.buildbot.light_tree_on_fire()
expected_stderr = {
"begin_work_queue": self._default_begin_work_queue_stderr("commit-queue", MockSCM.fake_checkout_root),
- "should_proceed_with_work_item": "MOCK: update_status: commit-queue Landing patch\n",
- # FIXME: The commit-queue warns about bad committers twice. This is due to the fact that we access Attachment.reviewer() twice and it logs each time.
- "next_work_item": """Warning, attachment 128 on bug 42 has invalid committer (non-committer@example.com)
-Warning, attachment 128 on bug 42 has invalid committer (non-committer@example.com)
-MOCK setting flag 'commit-queue' to '-' on attachment '128' with comment 'Rejecting patch 128 from commit-queue.' and additional comment 'non-committer@example.com does not have committer permissions according to http://trac.webkit.org/browser/trunk/WebKitTools/Scripts/webkitpy/common/config/committers.py.
-
-- If you do not have committer rights please read http://webkit.org/coding/contributing.html for instructions on how to use bugzilla flags.
-
-- If you have committer rights please correct the error in WebKitTools/Scripts/webkitpy/common/config/committers.py by adding yourself to the file (no review needed). The commit-queue restarts itself every 2 hours. After restart the commit-queue will correctly respect your committer rights.'
-MOCK: update_work_items: commit-queue [106, 197]
-2 patches in commit-queue [106, 197]
+ "should_proceed_with_work_item": "MOCK: update_status: commit-queue Processing patch\n",
+ "next_work_item": "",
+ "process_work_item": """MOCK run_and_throw_if_fail: ['echo', '--status-host=example.com', 'apply-attachment', '--force-clean', '--non-interactive', '--quiet', 197]
+MOCK: update_status: commit-queue Applied patch
+MOCK run_and_throw_if_fail: ['echo', '--status-host=example.com', 'build', '--no-clean', '--no-update', '--build', '--build-style=both', '--quiet']
+MOCK: update_status: commit-queue Built patch
+MOCK run_and_throw_if_fail: ['echo', '--status-host=example.com', 'build-and-test', '--no-clean', '--no-update', '--test', '--quiet', '--non-interactive']
+MOCK: update_status: commit-queue Passed tests
+MOCK run_and_throw_if_fail: ['echo', '--status-host=example.com', 'land-attachment', '--force-clean', '--ignore-builders', '--quiet', '--non-interactive', '--parent-command=commit-queue', 197]
+MOCK: update_status: commit-queue Landed patch
+MOCK: update_status: commit-queue Pass
""",
- "process_work_item": "MOCK run_and_throw_if_fail: ['echo', '--status-host=example.com', 'build-and-test-attachment', '--force-clean', '--build', '--non-interactive', '--build-style=both', '--quiet', 197, '--test']\nMOCK run_and_throw_if_fail: ['echo', '--status-host=example.com', 'land-attachment', '--force-clean', '--non-interactive', '--ignore-builders', '--quiet', '--parent-command=commit-queue', 197]\nMOCK: update_status: commit-queue Pass\n",
"handle_unexpected_error": "MOCK setting flag 'commit-queue' to '-' on attachment '197' with comment 'Rejecting patch 197 from commit-queue.' and additional comment 'Mock error message'\n",
- "handle_script_error": "MOCK: update_status: commit-queue ScriptError error message\nMOCK setting flag 'commit-queue' to '-' on attachment '197' with comment 'Rejecting patch 197 from commit-queue.' and additional comment 'ScriptError error message'\n",
+ "handle_script_error": "ScriptError error message\n",
}
self.assert_queue_outputs(CommitQueue(), tool=tool, expected_stderr=expected_stderr)
@@ -218,52 +255,23 @@ MOCK: update_work_items: commit-queue [106, 197]
rollout_patch = MockRolloutPatch()
expected_stderr = {
"begin_work_queue": self._default_begin_work_queue_stderr("commit-queue", MockSCM.fake_checkout_root),
- "should_proceed_with_work_item": "MOCK: update_status: commit-queue Landing rollout patch\n",
- # FIXME: The commit-queue warns about bad committers twice. This is due to the fact that we access Attachment.reviewer() twice and it logs each time.
- "next_work_item": """Warning, attachment 128 on bug 42 has invalid committer (non-committer@example.com)
-Warning, attachment 128 on bug 42 has invalid committer (non-committer@example.com)
-MOCK setting flag 'commit-queue' to '-' on attachment '128' with comment 'Rejecting patch 128 from commit-queue.' and additional comment 'non-committer@example.com does not have committer permissions according to http://trac.webkit.org/browser/trunk/WebKitTools/Scripts/webkitpy/common/config/committers.py.
-
-- If you do not have committer rights please read http://webkit.org/coding/contributing.html for instructions on how to use bugzilla flags.
-
-- If you have committer rights please correct the error in WebKitTools/Scripts/webkitpy/common/config/committers.py by adding yourself to the file (no review needed). The commit-queue restarts itself every 2 hours. After restart the commit-queue will correctly respect your committer rights.'
-MOCK: update_work_items: commit-queue [106, 197]
-2 patches in commit-queue [106, 197]
+ "should_proceed_with_work_item": "MOCK: update_status: commit-queue Processing rollout patch\n",
+ "next_work_item": "",
+ "process_work_item": """MOCK run_and_throw_if_fail: ['echo', '--status-host=example.com', 'apply-attachment', '--force-clean', '--non-interactive', '--quiet', 197]
+MOCK: update_status: commit-queue Applied patch
+MOCK run_and_throw_if_fail: ['echo', '--status-host=example.com', 'build', '--no-clean', '--no-update', '--build', '--build-style=both', '--quiet']
+MOCK: update_status: commit-queue Built patch
+MOCK run_and_throw_if_fail: ['echo', '--status-host=example.com', 'build-and-test', '--no-clean', '--no-update', '--test', '--quiet', '--non-interactive']
+MOCK: update_status: commit-queue Passed tests
+MOCK run_and_throw_if_fail: ['echo', '--status-host=example.com', 'land-attachment', '--force-clean', '--ignore-builders', '--quiet', '--non-interactive', '--parent-command=commit-queue', 197]
+MOCK: update_status: commit-queue Landed patch
+MOCK: update_status: commit-queue Pass
""",
- "process_work_item": "MOCK run_and_throw_if_fail: ['echo', '--status-host=example.com', 'build-and-test-attachment', '--force-clean', '--build', '--non-interactive', '--build-style=both', '--quiet', 197]\nMOCK run_and_throw_if_fail: ['echo', '--status-host=example.com', 'land-attachment', '--force-clean', '--non-interactive', '--ignore-builders', '--quiet', '--parent-command=commit-queue', 197]\nMOCK: update_status: commit-queue Pass\n",
"handle_unexpected_error": "MOCK setting flag 'commit-queue' to '-' on attachment '197' with comment 'Rejecting patch 197 from commit-queue.' and additional comment 'Mock error message'\n",
- "handle_script_error": "MOCK: update_status: commit-queue ScriptError error message\nMOCK setting flag 'commit-queue' to '-' on attachment '197' with comment 'Rejecting patch 197 from commit-queue.' and additional comment 'ScriptError error message'\n",
+ "handle_script_error": "ScriptError error message\n",
}
self.assert_queue_outputs(CommitQueue(), tool=tool, work_item=rollout_patch, expected_stderr=expected_stderr)
- def test_can_build_and_test(self):
- queue = CommitQueue()
- tool = MockTool()
- tool.executive = Mock()
- queue.bind_to_tool(tool)
- self.assertTrue(queue._can_build_and_test_without_patch())
- expected_run_args = ["echo", "--status-host=example.com", "build-and-test", "--force-clean", "--build", "--test", "--non-interactive", "--no-update", "--build-style=both", "--quiet"]
- tool.executive.run_and_throw_if_fail.assert_called_with(expected_run_args)
-
- def _mock_attachment(self, is_rollout, attach_date):
- attachment = Mock()
- attachment.is_rollout = lambda: is_rollout
- attachment.attach_date = lambda: attach_date
- return attachment
-
- def test_patch_cmp(self):
- long_ago_date = datetime(1900, 1, 21)
- recent_date = datetime(2010, 1, 21)
- attachment1 = self._mock_attachment(is_rollout=False, attach_date=recent_date)
- attachment2 = self._mock_attachment(is_rollout=False, attach_date=long_ago_date)
- attachment3 = self._mock_attachment(is_rollout=True, attach_date=recent_date)
- attachment4 = self._mock_attachment(is_rollout=True, attach_date=long_ago_date)
- attachments = [attachment1, attachment2, attachment3, attachment4]
- expected_sort = [attachment4, attachment3, attachment2, attachment1]
- queue = CommitQueue()
- attachments.sort(queue._patch_cmp)
- self.assertEqual(attachments, expected_sort)
-
def test_auto_retry(self):
queue = CommitQueue()
options = Mock()
@@ -282,7 +290,13 @@ MOCK: update_work_items: commit-queue [106, 197]
def test_manual_reject_during_processing(self):
queue = SecondThoughtsCommitQueue()
queue.bind_to_tool(MockTool())
- queue.process_work_item(MockPatch())
+ expected_stderr = """MOCK: update_status: commit-queue Applied patch
+MOCK: update_status: commit-queue Built patch
+MOCK: update_status: commit-queue Passed tests
+MOCK: update_status: commit-queue Landed patch
+MOCK: update_status: commit-queue Pass
+"""
+ OutputCapture().assert_outputs(self, queue.process_work_item, [MockPatch()], expected_stderr=expected_stderr)
class RietveldUploadQueueTest(QueuesTest):
diff --git a/WebKitTools/Scripts/webkitpy/tool/commands/queuestest.py b/WebKitTools/Scripts/webkitpy/tool/commands/queuestest.py
index aa3cef4..9f3583d 100644
--- a/WebKitTools/Scripts/webkitpy/tool/commands/queuestest.py
+++ b/WebKitTools/Scripts/webkitpy/tool/commands/queuestest.py
@@ -32,6 +32,7 @@ from webkitpy.common.net.bugzilla import Attachment
from webkitpy.common.system.outputcapture import OutputCapture
from webkitpy.common.system.executive import ScriptError
from webkitpy.thirdparty.mock import Mock
+from webkitpy.tool.commands.stepsequence import StepSequenceErrorHandler
from webkitpy.tool.mocktool import MockTool
@@ -100,4 +101,6 @@ class QueuesTest(unittest.TestCase):
self.assert_outputs(queue.should_proceed_with_work_item, "should_proceed_with_work_item", [work_item], expected_stdout, expected_stderr, expected_exceptions)
self.assert_outputs(queue.process_work_item, "process_work_item", [work_item], expected_stdout, expected_stderr, expected_exceptions)
self.assert_outputs(queue.handle_unexpected_error, "handle_unexpected_error", [work_item, "Mock error message"], expected_stdout, expected_stderr, expected_exceptions)
- self.assert_outputs(queue.handle_script_error, "handle_script_error", [tool, {"patch": MockPatch()}, ScriptError(message="ScriptError error message", script_args="MockErrorCommand")], expected_stdout, expected_stderr, expected_exceptions)
+ # Should we have a different function for testing StepSequenceErrorHandlers?
+ if isinstance(queue, StepSequenceErrorHandler):
+ self.assert_outputs(queue.handle_script_error, "handle_script_error", [tool, {"patch": MockPatch()}, ScriptError(message="ScriptError error message", script_args="MockErrorCommand")], expected_stdout, expected_stderr, expected_exceptions)
diff --git a/WebKitTools/Scripts/webkitpy/tool/commands/rebaseline.py b/WebKitTools/Scripts/webkitpy/tool/commands/rebaseline.py
index 78e06c6..abfa850 100644
--- a/WebKitTools/Scripts/webkitpy/tool/commands/rebaseline.py
+++ b/WebKitTools/Scripts/webkitpy/tool/commands/rebaseline.py
@@ -72,15 +72,15 @@ class Rebaseline(AbstractDeclarativeCommand):
# FIXME: This should share more code with FailureReason._builder_to_explain
def _builder_to_pull_from(self):
- builder_statuses = self.tool.buildbot.builder_statuses()
+ builder_statuses = self._tool.buildbot.builder_statuses()
red_statuses = [status for status in builder_statuses if not status["is_green"]]
print "%s failing" % (pluralize("builder", len(red_statuses)))
builder_choices = [status["name"] for status in red_statuses]
- chosen_name = self.tool.user.prompt_with_list("Which builder to pull results from:", builder_choices)
+ chosen_name = self._tool.user.prompt_with_list("Which builder to pull results from:", builder_choices)
# FIXME: prompt_with_list should really take a set of objects and a set of names and then return the object.
for status in red_statuses:
if status["name"] == chosen_name:
- return (self.tool.buildbot.builder_with_name(chosen_name), status["build_number"])
+ return (self._tool.buildbot.builder_with_name(chosen_name), status["build_number"])
def _replace_expectation_with_remote_result(self, local_file, remote_file):
(downloaded_file, headers) = urllib.urlretrieve(remote_file)
@@ -90,7 +90,8 @@ class Rebaseline(AbstractDeclarativeCommand):
parsed_results = build.layout_test_results().parsed_results()
# FIXME: This probably belongs as API on LayoutTestResults
# but .failing_tests() already means something else.
- return parsed_results[LayoutTestResults.fail_key]
+ failing_tests = parsed_results[LayoutTestResults.fail_key]
+ return self._tool.user.prompt_with_list("Which test(s) to rebaseline:", failing_tests, can_choose_multiple=True)
def _results_url_for_test(self, build, test):
test_base = os.path.splitext(test)[0]
diff --git a/WebKitTools/Scripts/webkitpy/tool/commands/sheriffbot.py b/WebKitTools/Scripts/webkitpy/tool/commands/sheriffbot.py
index 24c8517..23d013d 100644
--- a/WebKitTools/Scripts/webkitpy/tool/commands/sheriffbot.py
+++ b/WebKitTools/Scripts/webkitpy/tool/commands/sheriffbot.py
@@ -50,9 +50,9 @@ class SheriffBot(AbstractQueue, StepSequenceErrorHandler):
def begin_work_queue(self):
AbstractQueue.begin_work_queue(self)
- self._sheriff = Sheriff(self.tool, self)
- self._irc_bot = SheriffIRCBot(self.tool, self._sheriff)
- self.tool.ensure_irc_connected(self._irc_bot.irc_delegate())
+ self._sheriff = Sheriff(self._tool, self)
+ self._irc_bot = SheriffIRCBot(self._tool, self._sheriff)
+ self._tool.ensure_irc_connected(self._irc_bot.irc_delegate())
def work_item_log_path(self, new_failures):
return os.path.join("%s-logs" % self.name, "%s.log" % new_failures.keys()[0])
@@ -86,12 +86,12 @@ class SheriffBot(AbstractQueue, StepSequenceErrorHandler):
self._update()
# We do one read from buildbot to ensure a consistent view.
- revisions_causing_failures = self.tool.buildbot.revisions_causing_failures()
+ revisions_causing_failures = self._tool.buildbot.failure_map().revisions_causing_failures()
# Similarly, we read once from our the status_server.
old_failing_svn_revisions = []
for svn_revision in revisions_causing_failures.keys():
- if self.tool.status_server.svn_revision(svn_revision):
+ if self._tool.status_server.svn_revision(svn_revision):
old_failing_svn_revisions.append(svn_revision)
new_failures = self._new_failures(revisions_causing_failures,
@@ -108,7 +108,7 @@ class SheriffBot(AbstractQueue, StepSequenceErrorHandler):
blame_list = new_failures.keys()
for svn_revision, builders in new_failures.items():
try:
- commit_info = self.tool.checkout().commit_info_for_revision(svn_revision)
+ commit_info = self._tool.checkout().commit_info_for_revision(svn_revision)
if not commit_info:
print "FAILED to fetch CommitInfo for r%s, likely missing ChangeLog" % revision
continue
@@ -120,7 +120,7 @@ class SheriffBot(AbstractQueue, StepSequenceErrorHandler):
builders)
finally:
for builder in builders:
- self.tool.status_server.update_svn_revision(svn_revision,
+ self._tool.status_server.update_svn_revision(svn_revision,
builder.name())
return True
diff --git a/WebKitTools/Scripts/webkitpy/tool/commands/upload.py b/WebKitTools/Scripts/webkitpy/tool/commands/upload.py
index 4a15ed6..107d8db 100644
--- a/WebKitTools/Scripts/webkitpy/tool/commands/upload.py
+++ b/WebKitTools/Scripts/webkitpy/tool/commands/upload.py
@@ -82,14 +82,14 @@ class CleanPendingCommit(AbstractDeclarativeCommand):
def execute(self, options, args, tool):
committers = CommitterList()
for bug_id in tool.bugs.queries.fetch_bug_ids_from_pending_commit_list():
- bug = self.tool.bugs.fetch_bug(bug_id)
+ bug = self._tool.bugs.fetch_bug(bug_id)
patches = bug.patches(include_obsolete=True)
for patch in patches:
flags_to_clear = self._flags_to_clear_on_patch(patch)
if not flags_to_clear:
continue
message = "Cleared %s from obsolete attachment %s so that this bug does not appear in http://webkit.org/pending-commit." % (flags_to_clear, patch.id())
- self.tool.bugs.obsolete_attachment(patch.id(), message)
+ self._tool.bugs.obsolete_attachment(patch.id(), message)
class AssignToCommitter(AbstractDeclarativeCommand):
@@ -104,7 +104,7 @@ class AssignToCommitter(AbstractDeclarativeCommand):
def _assign_bug_to_last_patch_attacher(self, bug_id):
committers = CommitterList()
- bug = self.tool.bugs.fetch_bug(bug_id)
+ bug = self._tool.bugs.fetch_bug(bug_id)
if not bug.is_unassigned():
assigned_to_email = bug.assigned_to_email()
log("Bug %s is already assigned to %s (%s)." % (bug_id, assigned_to_email, committers.committer_by_email(assigned_to_email)))
@@ -128,7 +128,7 @@ class AssignToCommitter(AbstractDeclarativeCommand):
return
reassign_message = "Attachment %s was posted by a committer and has review+, assigning to %s for commit." % (latest_patch.id(), committer.full_name)
- self.tool.bugs.reassign_bug(bug_id, committer.bugzilla_email(), reassign_message)
+ self._tool.bugs.reassign_bug(bug_id, committer.bugzilla_email(), reassign_message)
def execute(self, options, args, tool):
for bug_id in tool.bugs.queries.fetch_bug_ids_from_pending_commit_list():
diff --git a/WebKitTools/Scripts/webkitpy/tool/mocktool.py b/WebKitTools/Scripts/webkitpy/tool/mocktool.py
index 8a6188a..277bd08 100644
--- a/WebKitTools/Scripts/webkitpy/tool/mocktool.py
+++ b/WebKitTools/Scripts/webkitpy/tool/mocktool.py
@@ -350,6 +350,16 @@ class MockBuilder(object):
self._name, username, comments))
+class MockFailureMap():
+ def __init__(self, buildbot):
+ self._buildbot = buildbot
+
+ def revisions_causing_failures(self):
+ return {
+ "29837": [self._buildbot.builder_with_name("Builder1")],
+ }
+
+
class MockBuildBot(object):
buildbot_host = "dummy_buildbot_host"
def __init__(self):
@@ -394,10 +404,8 @@ class MockBuildBot(object):
def light_tree_on_fire(self):
self._mock_builder2_status["is_green"] = False
- def revisions_causing_failures(self):
- return {
- "29837": [self.builder_with_name("Builder1")],
- }
+ def failure_map(self):
+ return MockFailureMap(self)
class MockSCM(Mock):
@@ -483,8 +491,8 @@ class MockUser(object):
def page(self, message):
pass
- def confirm(self, message=None):
- return True
+ def confirm(self, message=None, default='y'):
+ return default == 'y'
def can_open_url(self):
return True
diff --git a/WebKitTools/Scripts/webkitpy/tool/multicommandtool.py b/WebKitTools/Scripts/webkitpy/tool/multicommandtool.py
index 12ede2e..4848ae5 100644
--- a/WebKitTools/Scripts/webkitpy/tool/multicommandtool.py
+++ b/WebKitTools/Scripts/webkitpy/tool/multicommandtool.py
@@ -53,7 +53,7 @@ class Command(object):
self.required_arguments = self._parse_required_arguments(argument_names)
self.options = options
self.requires_local_commits = requires_local_commits
- self.tool = None
+ self._tool = None
# option_parser can be overriden by the tool using set_option_parser
# This default parser will be used for standalone_help printing.
self.option_parser = HelpPrintingOptionParser(usage=SUPPRESS_USAGE, add_help_option=False, option_list=self.options)
@@ -73,9 +73,9 @@ class Command(object):
# The tool calls bind_to_tool on each Command after adding it to its list.
def bind_to_tool(self, tool):
# Command instances can only be bound to one tool at a time.
- if self.tool and tool != self.tool:
+ if self._tool and tool != self._tool:
raise Exception("Command already bound to tool!")
- self.tool = tool
+ self._tool = tool
@staticmethod
def _parse_required_arguments(argument_names):
@@ -179,17 +179,17 @@ class HelpCommand(AbstractDeclarativeCommand):
# Only show commands which are relevant to this checkout's SCM system. Might this be confusing to some users?
if self.show_all_commands:
epilog = "All %prog commands:\n"
- relevant_commands = self.tool.commands[:]
+ relevant_commands = self._tool.commands[:]
else:
epilog = "Common %prog commands:\n"
- relevant_commands = filter(self.tool.should_show_in_main_help, self.tool.commands)
+ relevant_commands = filter(self._tool.should_show_in_main_help, self._tool.commands)
longest_name_length = max(map(lambda command: len(command.name), relevant_commands))
relevant_commands.sort(lambda a, b: cmp(a.name, b.name))
command_help_texts = map(lambda command: " %s %s\n" % (command.name.ljust(longest_name_length), command.help_text), relevant_commands)
epilog += "%s\n" % "".join(command_help_texts)
epilog += "See '%prog help --all-commands' to list all commands.\n"
epilog += "See '%prog help COMMAND' for more information on a specific command.\n"
- return epilog.replace("%prog", self.tool.name()) # Use of %prog here mimics OptionParser.expand_prog_name().
+ return epilog.replace("%prog", self._tool.name()) # Use of %prog here mimics OptionParser.expand_prog_name().
# FIXME: This is a hack so that we don't show --all-commands as a global option:
def _remove_help_options(self):
@@ -198,7 +198,7 @@ class HelpCommand(AbstractDeclarativeCommand):
def execute(self, options, args, tool):
if args:
- command = self.tool.command_by_name(args[0])
+ command = self._tool.command_by_name(args[0])
if command:
print command.standalone_help()
return 0
diff --git a/WebKitTools/WebKitTestRunner/Configurations/InjectedBundleCFLite.vsprops b/WebKitTools/WebKitTestRunner/Configurations/InjectedBundleCFLite.vsprops
new file mode 100644
index 0000000..03c7501
--- /dev/null
+++ b/WebKitTools/WebKitTestRunner/Configurations/InjectedBundleCFLite.vsprops
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioPropertySheet
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="InjectedBundleCFLite"
+ >
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="JavaScriptCore$(WebKitDLLConfigSuffix).lib WebKit$(WebKitDLLConfigSuffix).lib CFLite$(LibraryConfigSuffix).lib"
+ OutputFile="$(OutDir)\$(ProjectName)$(WebKitConfigSuffix).dll"
+ />
+</VisualStudioPropertySheet>
diff --git a/WebKitTools/WebKitTestRunner/Configurations/InjectedBundleCommon.vsprops b/WebKitTools/WebKitTestRunner/Configurations/InjectedBundleCommon.vsprops
index e90ddb1..4e7b84e 100644
--- a/WebKitTools/WebKitTestRunner/Configurations/InjectedBundleCommon.vsprops
+++ b/WebKitTools/WebKitTestRunner/Configurations/InjectedBundleCommon.vsprops
@@ -10,11 +10,6 @@
ForcedIncludeFiles="WebKitTestRunnerPrefix.h"
/>
<Tool
- Name="VCLinkerTool"
- AdditionalDependencies="JavaScriptCore$(WebKitDLLConfigSuffix).lib WebKit$(WebKitDLLConfigSuffix).lib CoreFoundation$(LibraryConfigSuffix).lib"
- OutputFile="$(OutDir)\$(ProjectName)$(WebKitConfigSuffix).dll"
- />
- <Tool
Name="VCPostBuildEventTool"
CommandLine="if exist &quot;$(WebKitOutputDir)\buildfailed&quot; del &quot;$(WebKitOutputDir)\buildfailed&quot;"
/>
diff --git a/WebKitTools/WebKitTestRunner/Configurations/InjectedBundleCoreFoundation.vsprops b/WebKitTools/WebKitTestRunner/Configurations/InjectedBundleCoreFoundation.vsprops
new file mode 100644
index 0000000..d58b221
--- /dev/null
+++ b/WebKitTools/WebKitTestRunner/Configurations/InjectedBundleCoreFoundation.vsprops
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioPropertySheet
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="InjectedBundleCoreFoundation"
+ >
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="JavaScriptCore$(WebKitDLLConfigSuffix).lib WebKit$(WebKitDLLConfigSuffix).lib CoreFoundation$(LibraryConfigSuffix).lib"
+ OutputFile="$(OutDir)\$(ProjectName)$(WebKitConfigSuffix).dll"
+ />
+</VisualStudioPropertySheet>
diff --git a/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundle.h b/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundle.h
index d094f42..520ea1f 100644
--- a/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundle.h
+++ b/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundle.h
@@ -30,7 +30,6 @@
#include "GCController.h"
#include "LayoutTestController.h"
#include <WebKit2/WKBase.h>
-#include <WebKit2/WKBundleBase.h>
#include <wtf/HashMap.h>
#include <wtf/OwnPtr.h>
#include <wtf/RefPtr.h>
diff --git a/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp b/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp
index dd92eca..32b92cb 100644
--- a/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp
+++ b/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp
@@ -169,6 +169,7 @@ InjectedBundlePage::InjectedBundlePage(WKBundlePageRef page)
didReceiveTitleForFrame,
0,
0,
+ 0,
didClearWindowForFrame,
didCancelClientRedirectForFrame,
willPerformClientRedirectForFrame,
@@ -186,7 +187,8 @@ InjectedBundlePage::InjectedBundlePage(WKBundlePageRef page)
willSetStatusbarText,
willRunJavaScriptAlert,
willRunJavaScriptConfirm,
- willRunJavaScriptPrompt
+ willRunJavaScriptPrompt,
+ 0 /*mouseDidMoveOverElement*/
};
WKBundlePageSetUIClient(m_page, &uiClient);
diff --git a/WebKitTools/WebKitTestRunner/TestController.cpp b/WebKitTools/WebKitTestRunner/TestController.cpp
index a71b07d..fc2e28d 100644
--- a/WebKitTools/WebKitTestRunner/TestController.cpp
+++ b/WebKitTools/WebKitTestRunner/TestController.cpp
@@ -84,6 +84,8 @@ static WKPageRef createOtherPage(WKPageRef oldPage, const void*)
0,
0,
0,
+ 0,
+ 0,
0
};
WKPageSetPageUIClient(newPage, &otherPageUIClient);
@@ -163,6 +165,8 @@ void TestController::initialize(int argc, const char* argv[])
0,
0,
0,
+ 0,
+ 0,
0
};
WKPageSetPageUIClient(m_mainWebView->page(), &pageUIClient);
@@ -186,6 +190,7 @@ void TestController::initialize(int argc, const char* argv[])
0,
0,
0,
+ 0,
0
};
WKPageSetPageLoaderClient(m_mainWebView->page(), &pageLoaderClient);
diff --git a/WebKitTools/WebKitTestRunner/win/InjectedBundle.vcproj b/WebKitTools/WebKitTestRunner/win/InjectedBundle.vcproj
index 22c9a89..0412562 100644
--- a/WebKitTools/WebKitTestRunner/win/InjectedBundle.vcproj
+++ b/WebKitTools/WebKitTestRunner/win/InjectedBundle.vcproj
@@ -18,7 +18,7 @@
<Configuration
Name="Debug|Win32"
ConfigurationType="2"
- InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug.vsprops;..\Configurations\InjectedBundleCommon.vsprops"
+ InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug.vsprops;..\Configurations\InjectedBundleCoreFoundation.vsprops;..\Configurations\InjectedBundleCommon.vsprops"
CharacterSet="1"
>
<Tool
@@ -79,7 +79,7 @@
<Configuration
Name="Release|Win32"
ConfigurationType="2"
- InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\release.vsprops;..\Configurations\InjectedBundleCommon.vsprops"
+ InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\release.vsprops;..\Configurations\InjectedBundleCoreFoundation.vsprops;..\Configurations\InjectedBundleCommon.vsprops"
CharacterSet="1"
WholeProgramOptimization="1"
>
@@ -141,7 +141,7 @@
<Configuration
Name="Debug_All|Win32"
ConfigurationType="2"
- InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug_internal.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug_all.vsprops;..\Configurations\InjectedBundleCommon.vsprops"
+ InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug_internal.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug_all.vsprops;..\Configurations\InjectedBundleCoreFoundation.vsprops;..\Configurations\InjectedBundleCommon.vsprops"
CharacterSet="1"
>
<Tool
@@ -202,7 +202,7 @@
<Configuration
Name="Debug_Internal|Win32"
ConfigurationType="2"
- InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug_internal.vsprops;..\Configurations\InjectedBundleCommon.vsprops"
+ InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug_internal.vsprops;..\Configurations\InjectedBundleCoreFoundation.vsprops;..\Configurations\InjectedBundleCommon.vsprops"
CharacterSet="1"
>
<Tool
@@ -260,6 +260,133 @@
Name="VCPostBuildEventTool"
/>
</Configuration>
+ <Configuration
+ Name="Debug_CFLite|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)"
+ ConfigurationType="2"
+ InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug_wincairo.vsprops;..\Configurations\InjectedBundleCFLite.vsprops;..\Configurations\InjectedBundleCommon.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release_CFLite|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)"
+ ConfigurationType="2"
+ InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\release.vsprops;..\Configurations\InjectedBundleCFLite.vsprops;..\Configurations\InjectedBundleCommon.vsprops"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
</Configurations>
<References>
</References>
diff --git a/WebKitTools/WebKitTestRunner/win/WebKitTestRunner.vcproj b/WebKitTools/WebKitTestRunner/win/WebKitTestRunner.vcproj
index d7ddd5c..e4cd870 100644
--- a/WebKitTools/WebKitTestRunner/win/WebKitTestRunner.vcproj
+++ b/WebKitTools/WebKitTestRunner/win/WebKitTestRunner.vcproj
@@ -298,6 +298,153 @@
CommandLine="if exist &quot;$(WebKitOutputDir)\buildfailed&quot; del &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;&#x0D;&#x0A;if not defined ARCHIVE_BUILD (if defined PRODUCTION exit /b)&#x0D;&#x0A;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;&#x0D;&#x0A;if not exist &quot;$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).dll&quot; exit /b&#x0D;&#x0A;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CFNetwork$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CFNetwork$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d /e /i &quot;$(WebKitLibrariesDir)\bin\CFNetwork.resources&quot; &quot;$(WebKitOutputDir)\bin\CFNetwork.resources&quot;&#x0D;&#x0A;xcopy /y /d /e /i &quot;$(WebKitLibrariesDir)\bin\CoreFoundation.resources&quot; &quot;$(WebKitOutputDir)\bin\CoreFoundation.resources&quot;&#x0D;&#x0A;xcopy /y /d /e /i &quot;$(WebKitLibrariesDir)\bin\CharacterSets&quot; &quot;$(WebKitOutputDir)\bin\CharacterSets&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreGraphics$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreGraphics$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\dnssd.dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icudt40.dll&quot; xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icudt40.dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icudt40$(LibraryConfigSuffix).dll&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icudt40$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).dll&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).pdb&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).dll&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).pdb&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icudt42.dll&quot; xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icudt42.dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icudt42$(LibraryConfigSuffix).dll&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icudt42$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuin42$(LibraryConfigSuffix).dll&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuin42$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuin42$(LibraryConfigSuffix).pdb&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuin42$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuuc42$(LibraryConfigSuffix).dll&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuuc42$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuuc42$(LibraryConfigSuffix).pdb&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuuc42$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\libxml2$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\libxslt$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\pthreadVC2$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\pthreadVC2$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\SQLite3$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\SQLite3$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\zlib1$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\zlib1$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;"
/>
</Configuration>
+ <Configuration
+ Name="Debug_CFLite|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug_wincairo.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ CommandLine="%SystemDrive%\cygwin\bin\which.exe bash&#x0D;&#x0A;if errorlevel 1 set PATH=%SystemDrive%\cygwin\bin;%PATH%&#x0D;&#x0A;cmd /c&#x0D;&#x0A;if exist &quot;$(WebKitOutputDir)\buildfailed&quot; grep XX$(ProjectName)XX &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;if errorlevel 1 exit 1&#x0D;&#x0A;echo XX$(ProjectName)XX &gt; &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebKitTestRunner&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebKitTestRunner\ForwardingHeaders&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebKitTestRunner\ForwardingHeaders\wtf&quot;&#x0D;&#x0A;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wtf\*.h&quot; &quot;$(WebKitOutputDir)\include\WebKitTestRunner\ForwardingHeaders\wtf&quot;&#x0D;&#x0A;"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="&quot;$(ProjectDir)\..&quot;;&quot;$(WebKitOutputDir)\Include&quot;;&quot;$(WebKitOutputDir)\Include\private&quot;;&quot;$(WebKitOutputDir)\Include\WebKitTestRunner\ForwardingHeaders&quot;;&quot;$(WebKitLibrariesDir)\Include&quot;"
+ PreprocessorDefinitions="__WIN32__;_CONSOLE"
+ DisableSpecificWarnings="4146"
+ ForcedIncludeFiles="WebKitTestRunnerPrefix.h"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/NXCOMPAT"
+ AdditionalDependencies="JavaScriptCore$(WebKitDLLConfigSuffix).lib WebKit$(WebKitDLLConfigSuffix).lib CFLite$(LibraryConfigSuffix).lib shlwapi.lib"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ CommandLine="if exist &quot;$(WebKitOutputDir)\buildfailed&quot; del &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;&#x0D;&#x0A;if not defined ARCHIVE_BUILD (if defined PRODUCTION exit /b)&#x0D;&#x0A;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;&#x0D;&#x0A;if not exist &quot;$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).dll&quot; exit /b&#x0D;&#x0A;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CFNetwork$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CFNetwork$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d /e /i &quot;$(WebKitLibrariesDir)\bin\CFNetwork.resources&quot; &quot;$(WebKitOutputDir)\bin\CFNetwork.resources&quot;&#x0D;&#x0A;xcopy /y /d /e /i &quot;$(WebKitLibrariesDir)\bin\CoreFoundation.resources&quot; &quot;$(WebKitOutputDir)\bin\CoreFoundation.resources&quot;&#x0D;&#x0A;xcopy /y /d /e /i &quot;$(WebKitLibrariesDir)\bin\CharacterSets&quot; &quot;$(WebKitOutputDir)\bin\CharacterSets&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreGraphics$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreGraphics$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\dnssd.dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icudt40.dll&quot; xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icudt40.dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icudt40$(LibraryConfigSuffix).dll&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icudt40$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).dll&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).pdb&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).dll&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).pdb&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icudt42.dll&quot; xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icudt42.dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icudt42$(LibraryConfigSuffix).dll&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icudt42$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuin42$(LibraryConfigSuffix).dll&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuin42$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuin42$(LibraryConfigSuffix).pdb&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuin42$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuuc42$(LibraryConfigSuffix).dll&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuuc42$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuuc42$(LibraryConfigSuffix).pdb&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuuc42$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\libxml2$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\libxslt$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\pthreadVC2$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\pthreadVC2$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\SQLite3$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\SQLite3$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\zlib1$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\zlib1$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release_CFLite|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\release.vsprops"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ CommandLine="%SystemDrive%\cygwin\bin\which.exe bash&#x0D;&#x0A;if errorlevel 1 set PATH=%SystemDrive%\cygwin\bin;%PATH%&#x0D;&#x0A;cmd /c&#x0D;&#x0A;if exist &quot;$(WebKitOutputDir)\buildfailed&quot; grep XX$(ProjectName)XX &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;if errorlevel 1 exit 1&#x0D;&#x0A;echo XX$(ProjectName)XX &gt; &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebKitTestRunner&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebKitTestRunner\ForwardingHeaders&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebKitTestRunner\ForwardingHeaders\wtf&quot;&#x0D;&#x0A;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wtf\*.h&quot; &quot;$(WebKitOutputDir)\include\WebKitTestRunner\ForwardingHeaders\wtf&quot;&#x0D;&#x0A;"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="&quot;$(ProjectDir)\..&quot;;&quot;$(WebKitOutputDir)\Include&quot;;&quot;$(WebKitOutputDir)\Include\private&quot;;&quot;$(WebKitOutputDir)\Include\WebKitTestRunner\ForwardingHeaders&quot;;&quot;$(WebKitLibrariesDir)\Include&quot;"
+ PreprocessorDefinitions="__WIN32__;_CONSOLE"
+ DisableSpecificWarnings="4146"
+ ForcedIncludeFiles="WebKitTestRunnerPrefix.h"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/NXCOMPAT"
+ AdditionalDependencies="JavaScriptCore$(WebKitDLLConfigSuffix).lib WebKit$(WebKitDLLConfigSuffix).lib CFLite$(LibraryConfigSuffix).lib shlwapi.lib"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ CommandLine="if exist &quot;$(WebKitOutputDir)\buildfailed&quot; del &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;&#x0D;&#x0A;if not defined ARCHIVE_BUILD (if defined PRODUCTION exit /b)&#x0D;&#x0A;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;&#x0D;&#x0A;if not exist &quot;$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).dll&quot; exit /b&#x0D;&#x0A;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CFNetwork$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CFNetwork$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d /e /i &quot;$(WebKitLibrariesDir)\bin\CFNetwork.resources&quot; &quot;$(WebKitOutputDir)\bin\CFNetwork.resources&quot;&#x0D;&#x0A;xcopy /y /d /e /i &quot;$(WebKitLibrariesDir)\bin\CoreFoundation.resources&quot; &quot;$(WebKitOutputDir)\bin\CoreFoundation.resources&quot;&#x0D;&#x0A;xcopy /y /d /e /i &quot;$(WebKitLibrariesDir)\bin\CharacterSets&quot; &quot;$(WebKitOutputDir)\bin\CharacterSets&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreGraphics$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreGraphics$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\dnssd.dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icudt40.dll&quot; xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icudt40.dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icudt40$(LibraryConfigSuffix).dll&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icudt40$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).dll&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).pdb&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).dll&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).pdb&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icudt42.dll&quot; xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icudt42.dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icudt42$(LibraryConfigSuffix).dll&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icudt42$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuin42$(LibraryConfigSuffix).dll&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuin42$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuin42$(LibraryConfigSuffix).pdb&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuin42$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuuc42$(LibraryConfigSuffix).dll&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuuc42$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuuc42$(LibraryConfigSuffix).pdb&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuuc42$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\libxml2$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\libxslt$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\pthreadVC2$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\pthreadVC2$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\SQLite3$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\SQLite3$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\zlib1$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\zlib1$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;"
+ />
+ </Configuration>
</Configurations>
<References>
</References>
diff --git a/WebKitTools/wx/packaging/build-mac-installer.py b/WebKitTools/wx/packaging/build-mac-installer.py
index a0c1b22..5b76b0b 100644
--- a/WebKitTools/wx/packaging/build-mac-installer.py
+++ b/WebKitTools/wx/packaging/build-mac-installer.py
@@ -26,6 +26,7 @@
# Script for building Mac .pkg installer
import commands
+import datetime
import distutils.sysconfig
import glob
import optparse
@@ -48,11 +49,11 @@ wxwebkit_dir = os.path.abspath(os.path.join(wxwk_root, "WebKitBuild", get_config
wx_version = wx.__version__[:5]
py_version = sys.version[:3]
-wxwk_version = svn_revision()
+date = str(datetime.date.today())
platform = "osx"
-pkgname = "wxWebKit-%s-wx%s-py%s" % (platform, wx_version[:3], py_version)
+pkgname = "wxWebKit-%s-wx%s-py%s-%s" % (platform, wx_version[:3], py_version, date)
tempdir = "/tmp/%s" % (pkgname)
@@ -141,7 +142,7 @@ try:
pkg_args = ['--title ' + pkgname,
'--out %s.pkg' % pkgname,
- '--version ' + wxwk_version.strip(),
+ '--version ' + date.strip(),
'--id org.wxwebkit.wxwebkit',
'--domain system',
'--root-volume-only',
diff --git a/WebKitTools/wx/packaging/build-win-installer.py b/WebKitTools/wx/packaging/build-win-installer.py
index 2bb8034..ffbdd19 100644
--- a/WebKitTools/wx/packaging/build-win-installer.py
+++ b/WebKitTools/wx/packaging/build-win-installer.py
@@ -27,6 +27,7 @@
import sys, os, string
import commands
+import datetime
import glob
from subprocess import *
@@ -62,7 +63,7 @@ if __name__ == "__main__":
innoSetup = getInnoSetupPath()
os.chdir(sys.path[0])
- svnrevision = svn_revision()
+ date = str(datetime.date.today())
if not os.path.exists(innoSetup):
print "ERROR: Cannot find InnoSetup."
@@ -84,7 +85,7 @@ CopyMode: alwaysoverwrite; Source: *.py; DestDir: "{app}"
installerTemplate = open("wxWebKitInstaller.iss.in", "r").read()
- installerTemplate = installerTemplate.replace("<<VERSION>>", svnrevision)
+ installerTemplate = installerTemplate.replace("<<VERSION>>", date)
installerTemplate = installerTemplate.replace("<<ROOTDIR>>", wxwebkit_dir )
installerTemplate = installerTemplate.replace("<<PYTHONVER>>", sys.version[0:3] )
installerTemplate = installerTemplate.replace("<<FILES>>", fileList )